[PATCH 6/6] gpio-nxp-74hc153: remove package
This module was used solely by Buffalo WZR-HP-G300NH devices and has become obsolete with the introduction of gpio-cascade. Signed-off-by: Mauri Sandberg --- package/kernel/gpio-nxp-74hc153/Makefile | 35 --- package/kernel/gpio-nxp-74hc153/src/Makefile | 1 - .../gpio-nxp-74hc153/src/gpio-nxp-74hc153.c | 291 -- 3 files changed, 327 deletions(-) delete mode 100644 package/kernel/gpio-nxp-74hc153/Makefile delete mode 100644 package/kernel/gpio-nxp-74hc153/src/Makefile delete mode 100644 package/kernel/gpio-nxp-74hc153/src/gpio-nxp-74hc153.c diff --git a/package/kernel/gpio-nxp-74hc153/Makefile b/package/kernel/gpio-nxp-74hc153/Makefile deleted file mode 100644 index e275a9a856..00 --- a/package/kernel/gpio-nxp-74hc153/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (C) 2020 Mauri Sandberg -# -# 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:=gpio-nxp-74hc153 -PKG_RELEASE:=1 -PKG_LICENSE:=GPL-2.0 - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/gpio-nxp-74hc153 - SUBMENU:=Other modules - TITLE:= NXP 74HC153 GPIO expander - FILES:=$(PKG_BUILD_DIR)/gpio-nxp-74hc153.ko - AUTOLOAD:=$(call AutoLoad,30,gpio-nxp-74hc153,1) - KCONFIG:= - DEPENDS:= @GPIO_SUPPORT @TARGET_ath79 -endef - -define KernelPackage/gpio-nxp-74hc153/description - Platform driver for NXP 74HC153 Dual 4-input Multiplexer. - This provides a GPIO interface supporting input mode only. -endef - -define Build/Compile - $(KERNEL_MAKE) M=$(PKG_BUILD_DIR) modules -endef - -$(eval $(call KernelPackage,gpio-nxp-74hc153)) diff --git a/package/kernel/gpio-nxp-74hc153/src/Makefile b/package/kernel/gpio-nxp-74hc153/src/Makefile deleted file mode 100644 index 0a5cc2fdda..00 --- a/package/kernel/gpio-nxp-74hc153/src/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-m += gpio-nxp-74hc153.o diff --git a/package/kernel/gpio-nxp-74hc153/src/gpio-nxp-74hc153.c b/package/kernel/gpio-nxp-74hc153/src/gpio-nxp-74hc153.c deleted file mode 100644 index f683547cfd..00 --- a/package/kernel/gpio-nxp-74hc153/src/gpio-nxp-74hc153.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * NXP 74HC153 - Dual 4-input multiplexer GPIO driver - * - * Copyright (C) 2010 Gabor Juhos - * Copyright (C) 2020 Mauri Sandberg - * - * 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. - * - * Example device tree definition: - * - * gpio-extender { - *compatible = "nxp,74hc153-gpio"; - *gpio-controller; - *#gpio-cells = <2>; - * - *// GPIOs used by this node - *gpio-s0 = < 9 GPIO_ACTIVE_HIGH>; - *gpio-s1 = < 11 GPIO_ACTIVE_HIGH>; - *gpio-1y = < 12 GPIO_ACTIVE_HIGH>; - *gpio-2y = < 14 GPIO_ACTIVE_HIGH>; - * }; - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#define NXP_74HC153_NUM_GPIOS 8 -#define NXP_74HC153_S0_MASK 0x1 -#define NXP_74HC153_S1_MASK 0x2 -#define NXP_74HC153_BANK_MASK 0x4 - -#define NXP_74HC153_DRIVER_NAME "nxp-74hc153" - -struct nxp_74hc153_config { - unsigned gpio_pin_s0; - unsigned gpio_pin_s1; - unsigned gpio_pin_1y; - unsigned gpio_pin_2y; -}; - -struct nxp_74hc153_chip { - struct device *parent; - struct gpio_chip gpio_chip; - struct mutex lock; - struct nxp_74hc153_config config; -}; - -static struct nxp_74hc153_chip *gpio_to_nxp(struct gpio_chip *gc) -{ - return container_of(gc, struct nxp_74hc153_chip, gpio_chip); -} - -static int nxp_74hc153_direction_input(struct gpio_chip *gc, unsigned offset) -{ - return 0; -} - -static int nxp_74hc153_direction_output(struct gpio_chip *gc, - unsigned offset, int val) -{ - return -EINVAL; -} - -static int nxp_74hc153_get_value(struct gpio_chip *gc, unsigned offset) -{ - struct nxp_74hc153_chip *nxp; - struct nxp_74hc153_platform_data *pdata; - unsigned s0; - unsigned s1; - unsigned pin; - int ret; - - nxp = gpio_to_nxp(gc); - pdata = nxp->parent->platform_data; - - s0 = !!(offset & NXP_74HC153_S0_MASK); - s1 = !!(offset & NXP_74HC153_S1_MASK); - pin = (offset & NXP_74HC153_BANK_MASK) ? nxp->config.gpio_pin_2y - : nxp->config.gpio_pin_1y; - - mutex_lock(>lock); - gpio_set_value(nxp->config.gpio_pin_s0, s0); - gpio_set_value(nxp->config.gpio_pin_s1, s1); - ret = gpio_get_value(pin); - mutex_unlock(>lock); - - return ret; -} - -static void nxp_74hc153_set_value(struct gpio_chip *gc, - unsigned offset, int val) -{ - /* not supported */ -} - -static int nxp_74hc153_probe(struct platform_device *pdev) -{
[PATCH 1/6] kernel: 5.4: backport gpio-cascade and config symbols
The patch is under review at [1] and modified for 5.4 Signed-off-by: Mauri Sandberg [1] http://patchwork.ozlabs.org/project/linux-gpio/patch/20211026191506.3099-3-mau...@ext.kapsi.fi/ --- target/linux/generic/config-5.4 | 6 + ...pio-cascade-add-generic-GPIO-cascade.patch | 241 ++ 2 files changed, 247 insertions(+) create mode 100644 target/linux/generic/pending-5.4/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index bf2b462529..fc9f0c8797 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -1820,6 +1820,7 @@ CONFIG_GPIOLIB_FASTPATH_LIMIT=512 # CONFIG_GPIO_BCM_KONA is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_CADENCE is not set +# CONFIG_GPIO_CASCADE is not set # CONFIG_GPIO_CS5535 is not set # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EM is not set @@ -3335,8 +3336,13 @@ CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_UIMAGE_SPLIT is not set # CONFIG_MTD_VIRT_CONCAT is not set # CONFIG_MTK_MMC is not set +# CONFIG_MULTIPLEXER is not set CONFIG_MULTIUSER=y # CONFIG_MUTEX_SPIN_ON_OWNER is not set +# CONFIG_MUX_ADG792A is not set +# CONFIG_MUX_ADGS1408 is not set +# CONFIG_MUX_GPIO is not set +# CONFIG_MUX_MMIO is not set # CONFIG_MV643XX_ETH is not set # CONFIG_MVMDIO is not set # CONFIG_MVNETA_BM is not set diff --git a/target/linux/generic/pending-5.4/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch b/target/linux/generic/pending-5.4/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch new file mode 100644 index 00..b8cabb7993 --- /dev/null +++ b/target/linux/generic/pending-5.4/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch @@ -0,0 +1,241 @@ +From b4e813e9446fa0b8856693d170b2d98c035598b8 Mon Sep 17 00:00:00 2001 +From: Mauri Sandberg +Date: Thu, 25 Mar 2021 11:48:05 +0200 +Subject: [PATCH 2/2] gpio: gpio-cascade: add generic GPIO cascade + +Adds support for building cascades of GPIO lines. That is, it allows +setups when there is one upstream line and multiple cascaded lines, out +of which one can be chosen at a time. The status of the upstream line +can be conveyed to the selected cascaded line or, vice versa, the status +of the cascaded line can be conveyed to the upstream line. + +A multiplexer is being used to select, which cascaded GPIO line is being +used at any given time. + +At the moment only input direction is supported. In future it should be +possible to add support for output direction, too. + +Signed-off-by: Mauri Sandberg +Reviewed-by: Linus Walleij +Reviewed-by: Andy Shevchenko +--- +v7 -> v8: + - rearrange members in struct gpio_cascade + - cosmetic changes in file header and in one function declaration + - added Reviewed-by tags by Linus and Andy +v6 -> v7: + - In Kconfig add info about module name + - adhere to new convention that allows lines longer than 80 chars + - use dev_probe_err with upstream gpio line too + - refactor for cleaner exit of probe function. +v5 -> v6: + - In Kconfig, remove dependency to OF_GPIO and select only MULTIPLEXER + - refactor code preferring one-liners + - clean up prints, removing them from success-path. + - don't explicitly set gpio_chip.of_node as it's done in the GPIO library + - use devm_gpiochip_add_data instead of gpiochip_add +v4 -> v5: + - renamed gpio-mux-input -> gpio-cascade. refactored code accordingly + here and there and changed to use new bindings and compatible string + - ambigious and vague 'pin' was rename to 'upstream_line' + - dropped Tested-by and Reviewed-by due to changes in bindings + - dropped Reported-by suggested by an automatic bot as it was not really + appropriate to begin with + - functionally it's the same as v4 +v3 -> v4: + - Changed author email + - Included Tested-by and Reviewed-by from Drew +v2 -> v3: + - use managed device resources + - update Kconfig description +v1 -> v2: + - removed .owner from platform_driver as per test bot's instruction + - added MODULE_AUTHOR, MODULE_DESCRIPTION, MODULE_LICENSE + - added gpio_mux_input_get_direction as it's recommended for all chips + - removed because this is input only chip: gpio_mux_input_set_value + - removed because they are not needed for input/output only chips: + gpio_mux_input_direction_input + gpio_mux_input_direction_output + - fixed typo in an error message + - added info message about successful registration + - removed can_sleep flag as this does not sleep while getting GPIO value + like I2C or SPI do + - Updated description in Kconfig +--- + drivers/gpio/Kconfig| 15 + + drivers/gpio/Makefile | 1 + + drivers/gpio/gpio-cascade.c | 126 + 3 files changed, 142 insertions(+) + create mode 100644 drivers/gpio/gpio-cascade.c + +diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +index f9263426af03..5f94d1adf9dd 100644 +--- a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +@@ -1491,4
[PATCH 2/6] kernel: 5.10: backport gpio-cascade and related symbols
The patch is under review at [1]. Signed-off-by: Mauri Sandberg [1] http://patchwork.ozlabs.org/project/linux-gpio/patch/20211026191506.3099-3-mau...@ext.kapsi.fi/ --- target/linux/generic/config-5.10 | 6 + ...pio-cascade-add-generic-GPIO-cascade.patch | 232 ++ 2 files changed, 238 insertions(+) create mode 100644 target/linux/generic/pending-5.10/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 604d5e4e6c..58d5f45992 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2073,6 +2073,7 @@ CONFIG_GPIOLIB_FASTPATH_LIMIT=512 # CONFIG_GPIO_BCM_KONA is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_CADENCE is not set +# CONFIG_GPIO_CASCADE is not set # CONFIG_GPIO_CDEV is not set # CONFIG_GPIO_CDEV_V1 is not set # CONFIG_GPIO_CS5535 is not set @@ -3663,8 +3664,13 @@ CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_VIRT_CONCAT is not set # CONFIG_MTK_MMC is not set # CONFIG_MTK_MMSYS is not set +# CONFIG_MULTIPLEXER is not set CONFIG_MULTIUSER=y # CONFIG_MUTEX_SPIN_ON_OWNER is not set +# CONFIG_MUX_ADG792A is not set +# CONFIG_MUX_ADGS1408 is not set +# CONFIG_MUX_GPIO is not set +# CONFIG_MUX_MMIO is not set # CONFIG_MV643XX_ETH is not set # CONFIG_MVMDIO is not set # CONFIG_MVNETA_BM is not set diff --git a/target/linux/generic/pending-5.10/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch b/target/linux/generic/pending-5.10/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch new file mode 100644 index 00..8d3b3cf962 --- /dev/null +++ b/target/linux/generic/pending-5.10/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch @@ -0,0 +1,232 @@ +From fc23ea48ba52c24f201fe5ca0132ee1a3de5a70a Mon Sep 17 00:00:00 2001 +From: Mauri Sandberg +Date: Thu, 25 Mar 2021 11:48:05 +0200 +Subject: [PATCH 2/2] gpio: gpio-cascade: add generic GPIO cascade + +Adds support for building cascades of GPIO lines. That is, it allows +setups when there is one upstream line and multiple cascaded lines, out +of which one can be chosen at a time. The status of the upstream line +can be conveyed to the selected cascaded line or, vice versa, the status +of the cascaded line can be conveyed to the upstream line. + +A multiplexer is being used to select, which cascaded GPIO line is being +used at any given time. + +At the moment only input direction is supported. In future it should be +possible to add support for output direction, too. + +Signed-off-by: Mauri Sandberg +Reviewed-by: Linus Walleij +Reviewed-by: Andy Shevchenko +--- +v7 -> v8: + - rearrange members in struct gpio_cascade + - cosmetic changes in file header and in one function declaration + - added Reviewed-by tags by Linus and Andy +v6 -> v7: + - In Kconfig add info about module name + - adhere to new convention that allows lines longer than 80 chars + - use dev_probe_err with upstream gpio line too + - refactor for cleaner exit of probe function. +v5 -> v6: + - In Kconfig, remove dependency to OF_GPIO and select only MULTIPLEXER + - refactor code preferring one-liners + - clean up prints, removing them from success-path. + - don't explicitly set gpio_chip.of_node as it's done in the GPIO library + - use devm_gpiochip_add_data instead of gpiochip_add +v4 -> v5: + - renamed gpio-mux-input -> gpio-cascade. refactored code accordingly + here and there and changed to use new bindings and compatible string + - ambigious and vague 'pin' was rename to 'upstream_line' + - dropped Tested-by and Reviewed-by due to changes in bindings + - dropped Reported-by suggested by an automatic bot as it was not really + appropriate to begin with + - functionally it's the same as v4 +v3 -> v4: + - Changed author email + - Included Tested-by and Reviewed-by from Drew +v2 -> v3: + - use managed device resources + - update Kconfig description +v1 -> v2: + - removed .owner from platform_driver as per test bot's instruction + - added MODULE_AUTHOR, MODULE_DESCRIPTION, MODULE_LICENSE + - added gpio_mux_input_get_direction as it's recommended for all chips + - removed because this is input only chip: gpio_mux_input_set_value + - removed because they are not needed for input/output only chips: + gpio_mux_input_direction_input + gpio_mux_input_direction_output + - fixed typo in an error message + - added info message about successful registration + - removed can_sleep flag as this does not sleep while getting GPIO value + like I2C or SPI do + - Updated description in Kconfig +--- + drivers/gpio/Kconfig| 15 + + drivers/gpio/Makefile | 1 + + drivers/gpio/gpio-cascade.c | 117 + 3 files changed, 133 insertions(+) + create mode 100644 drivers/gpio/gpio-cascade.c + +diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +index 37a6f77c86fe..e69457144459 100644 +--- a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +@@ -1694,4 +1694,19 @@ config
[PATCH 4/6] kernel: add package kmod-gpio-cascade
Signed-off-by: Mauri Sandberg --- package/kernel/linux/modules/gpio-cascade.mk | 20 1 file changed, 20 insertions(+) create mode 100644 package/kernel/linux/modules/gpio-cascade.mk diff --git a/package/kernel/linux/modules/gpio-cascade.mk b/package/kernel/linux/modules/gpio-cascade.mk new file mode 100644 index 00..3a559f19ef --- /dev/null +++ b/package/kernel/linux/modules/gpio-cascade.mk @@ -0,0 +1,20 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +MENU_TITLE:=GPIO support + +define KernelPackage/gpio-cascade + SUBMENU:=$(MENU_TITLE) + TITLE:=Generic GPIO cascade + KCONFIG:=CONFIG_GPIO_CASCADE + DEPENDS:=@GPIO_SUPPORT +kmod-mux-core + FILES:=$(LINUX_DIR)/drivers/gpio/gpio-cascade.ko + AUTOLOAD:=$(call AutoLoad,29,gpio-cascade,1) +endef + +define KernelPackage/gpio-cascade/description + Kernel module for Generic GPIO cascade +endef + +$(eval $(call KernelPackage,gpio-cascade)) -- 2.25.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 0/6] use gpio-cascade for Buffalo WZR-HP-G300NH
Currently, Buffalo wzr-hp-g300nh uses a driver that is developed specificly for NXP 74HC153 dual 4-way multiplexer. It's being used for several different buttons on the device casing. Replace that driver with a generic gpio-cascade driver that is in the process of being upstreamed. All comments are welcome but I would need someone to have a look at the AUTOLOAD clauses in the kernel package makefiles. The way they are specified currently allows loading modules early enough for using the reset key for entering the failsafe. Nevertheless, it's a copypaste without much understanding what goes where and there could be room for improvements. Thanks, Mauri Mauri Sandberg (6): kernel: 5.4: backport gpio-cascade and config symbols kernel: 5.10: backport gpio-cascade and related symbols kernel: add package kmod-multiplexer kernel: add package kmod-gpio-cascade ath79: use gpio-cascade for Buffalo WZR-HP-G300NH gpio-nxp-74hc153: remove package package/kernel/gpio-nxp-74hc153/Makefile | 35 --- package/kernel/gpio-nxp-74hc153/src/Makefile | 1 - .../gpio-nxp-74hc153/src/gpio-nxp-74hc153.c | 291 -- package/kernel/linux/modules/gpio-cascade.mk | 20 ++ package/kernel/linux/modules/multiplexer.mk | 34 ++ .../dts/ar9132_buffalo_wzr-hp-g300nh.dtsi | 41 ++- target/linux/ath79/image/generic.mk | 2 +- target/linux/generic/config-5.10 | 6 + target/linux/generic/config-5.4 | 6 + ...pio-cascade-add-generic-GPIO-cascade.patch | 232 ++ ...pio-cascade-add-generic-GPIO-cascade.patch | 241 +++ 11 files changed, 571 insertions(+), 338 deletions(-) delete mode 100644 package/kernel/gpio-nxp-74hc153/Makefile delete mode 100644 package/kernel/gpio-nxp-74hc153/src/Makefile delete mode 100644 package/kernel/gpio-nxp-74hc153/src/gpio-nxp-74hc153.c create mode 100644 package/kernel/linux/modules/gpio-cascade.mk create mode 100644 package/kernel/linux/modules/multiplexer.mk create mode 100644 target/linux/generic/pending-5.10/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch create mode 100644 target/linux/generic/pending-5.4/801-gpio-gpio-cascade-add-generic-GPIO-cascade.patch base-commit: db34b93331e91bdb2cbc15d17632b7217a6d -- 2.25.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 5/6] ath79: use gpio-cascade for Buffalo WZR-HP-G300NH
Signed-off-by: Mauri Sandberg --- .../dts/ar9132_buffalo_wzr-hp-g300nh.dtsi | 41 ++- target/linux/ath79/image/generic.mk | 2 +- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi index ca1eeab449..7b0c09f68e 100644 --- a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi @@ -17,16 +17,37 @@ clock-frequency = <4000>; }; - gpio2: gpio-extender { - compatible = "nxp,74hc153-gpio"; + /* There is a GPIO driven NXP 74HC153 dual 4-way multiplexer on board +* used for buttons that are on top of the the device. + */ + mux: mux-controller { + compatible = "gpio-mux"; + #mux-control-cells = <0>; + + mux-gpios = < 9 GPIO_ACTIVE_HIGH>, /* s0 */ + < 11 GPIO_ACTIVE_HIGH>;/* s1 */ + }; + + gpio2: key-mux1 { + compatible = "gpio-cascade"; + mux-controls = <>; + + gpio-controller; + #gpio-cells = <2>; + + // GPIOs used by this node, the mux pin + upstream-gpios = < 12 GPIO_ACTIVE_HIGH>; /* 1y */ + }; + + gpio3: key-mux2 { + compatible = "gpio-cascade"; + mux-controls = <>; + gpio-controller; #gpio-cells = <2>; - // GPIOs used by this node - gpio-s0 = < 9 GPIO_ACTIVE_HIGH>; - gpio-s1 = < 11 GPIO_ACTIVE_HIGH>; - gpio-1y = < 12 GPIO_ACTIVE_HIGH>; - gpio-2y = < 14 GPIO_ACTIVE_HIGH>; + // GPIOs used by this node, the mux pin + upstream-gpios = < 14 GPIO_ACTIVE_HIGH>; /* 2y */ }; keys { @@ -64,21 +85,21 @@ usb { label = "usb"; linux,code = ; - gpios = < 5 GPIO_ACTIVE_LOW>; + gpios = < 1 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; router_auto { label = "router_auto"; linux,code = ; - gpios = < 6 GPIO_ACTIVE_HIGH>; + gpios = < 2 GPIO_ACTIVE_HIGH>; debounce-interval = <60>; }; movie_on { label = "movie_on"; linux,code = ; - gpios = < 7 GPIO_ACTIVE_HIGH>; + gpios = < 3 GPIO_ACTIVE_HIGH>; debounce-interval = <60>; }; }; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index fb393ba082..de1a1519ff 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -483,7 +483,7 @@ define Device/buffalo_wzr-hp-g300nh SOC := ar9132 BUFFALO_PRODUCT := WZR-HP-G300NH BUFFALO_HWVER := 1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-gpio-nxp-74hc153 + DEVICE_PACKAGES := kmod-gpio-cascade kmod-mux-gpio kmod-usb2 kmod-usb-ledtrig-usbport BLOCKSIZE := 128k IMAGE_SIZE := 32128k SUPPORTED_DEVICES += wzr-hp-g300nh -- 2.25.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 3/6] kernel: add package kmod-multiplexer
Signed-off-by: Mauri Sandberg --- package/kernel/linux/modules/multiplexer.mk | 34 + 1 file changed, 34 insertions(+) create mode 100644 package/kernel/linux/modules/multiplexer.mk diff --git a/package/kernel/linux/modules/multiplexer.mk b/package/kernel/linux/modules/multiplexer.mk new file mode 100644 index 00..135fc62c6d --- /dev/null +++ b/package/kernel/linux/modules/multiplexer.mk @@ -0,0 +1,34 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +MENU_TITLE:=Multiplexer Support + +define KernelPackage/mux-core + SUBMENU:=$(MENU_TITLE) + TITLE:=Multiplexer Support + KCONFIG:=CONFIG_MULTIPLEXER + FILES:=$(LINUX_DIR)/drivers/mux/mux-core.ko + AUTOLOAD:=$(call AutoLoad,25,mux-core,1) +endef + +define KernelPackage/mux-core/description + Kernel module for multiplexer support +endef + +$(eval $(call KernelPackage,mux-core)) + +define KernelPackage/mux-gpio + SUBMENU:=$(MENU_TITLE) + TITLE:=GPIO-controlled Multiplexer controller + KCONFIG:=CONFIG_MUX_GPIO + DEPENDS:=@GPIO_SUPPORT kmod-mux-core + FILES:=$(LINUX_DIR)/drivers/mux/mux-gpio.ko + AUTOLOAD:=$(call AutoLoad,25,mux-gpio,1) +endef + +define KernelPackage/mux-gpio/description + Kernel modules for GPIO-controlled Multiplexer controller +endef + +$(eval $(call KernelPackage,mux-gpio)) -- 2.25.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH v2] realtek: reset both ethernet NIC and queues
Recent versions of Realtek's SDK reset both the ethernet NIC and queues (SW_NIC_RST and SW_Q_RST bits) when initialising the hardware. Furthermore, when issuing a CPU reset on the Zyxel GS1900-8 (not supported by any current driver), the networking part of the SoC is not reset. This leads to unresponsive network after the restart. By resetting both the ethernet NIC and queues, networking always comes up reliably. Suggested-by: Birger Koblitz Signed-off-by: Sander Vanheule --- v1 -> v2: - Reword commit message - Introduce reset_mask variable --- .../files-5.10/drivers/net/ethernet/rtl838x_eth.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c index c966746f0246..dd3d3b66f970 100644 --- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c @@ -630,6 +630,7 @@ static const struct rtl838x_reg rtl931x_reg = { static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv) { u32 int_saved, nbuf; + u32 reset_mask; int i, pos; pr_info("RESETTING %x, CPU_PORT %d\n", priv->family_id, priv->cpu_port); @@ -662,15 +663,17 @@ static void rtl838x_hw_reset(struct rtl838x_eth_priv *priv) sw_w32(0x, priv->r->dma_if_intr_sts); } - /* Reset NIC */ + /* Reset NIC (SW_NIC_RST) and queues (SW_Q_RST) */ if (priv->family_id == RTL9300_FAMILY_ID || priv->family_id == RTL9310_FAMILY_ID) - sw_w32(0x4, priv->r->rst_glb_ctrl); + reset_mask = 0x6; else - sw_w32(0x8, priv->r->rst_glb_ctrl); + reset_mask = 0xc; + + sw_w32(reset_mask, priv->r->rst_glb_ctrl); do { /* Wait for reset of NIC and Queues done */ udelay(20); - } while (sw_r32(priv->r->rst_glb_ctrl) & 0xc); + } while (sw_r32(priv->r->rst_glb_ctrl) & reset_mask); mdelay(100); /* Setup Head of Line */ -- 2.33.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [iwinfo PATCH 1/2] iwinfo: add support for indoor only chan restriction
> > > Ansuel Smith wrote: > > Some country permit a specific channel to be used only indoor. > > Introduce a new restriction_flags entry to declare different > > restrition of a specific channel. > > > > Signed-off-by: Ansuel Smith > > --- > > include/iwinfo.h | 4 > > iwinfo_nl80211.c | 14 ++ > > 2 files changed, 14 insertions(+), 4 deletions(-) > > > > diff --git a/include/iwinfo.h b/include/iwinfo.h > > index 8469ee7..3543b91 100644 > > --- a/include/iwinfo.h > > +++ b/include/iwinfo.h > > @@ -61,6 +61,9 @@ > > #define IWINFO_FREQ_NO_160MHZ(1 << 5) > > #define IWINFO_FREQ_NO_2160MHZ (1 << 6) > > > > +#define IWINFO_FREQ_NO_IR(1 << 0) > > +#define IWINFO_FREQ_NO_OUTDOOR (2 << 0) > > That's a pretty non-standard way of defining bits? Did you really > mean (1<<0) and (1<<1) ? > Yes sorry... Copy paste error and then a microstroke in my brain LOL. Will fix in v2 with other changes if needed. > Sincerely, > Karl Palsson > > > + > > extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT]; > > extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT]; > > extern const char *IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT]; > > @@ -168,6 +171,7 @@ struct iwinfo_freqlist_entry { > > uint8_t channel; > > uint32_t mhz; > > uint8_t restricted; > > + uint32_t restricted_flags; > > uint32_t flags; > > }; > > > > diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c > > index c4b0ee2..57f820a 100644 > > --- a/iwinfo_nl80211.c > > +++ b/iwinfo_nl80211.c > > @@ -2911,10 +2911,16 @@ static int nl80211_get_freqlist_cb(struct nl_msg > > *msg, void *arg) > > e->mhz = > > nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]); > > e->channel = > > nl80211_freq2channel(e->mhz); > > > > - e->restricted = ( > > - > > freqs[NL80211_FREQUENCY_ATTR_NO_IR] && > > - > > !freqs[NL80211_FREQUENCY_ATTR_RADAR] > > - ) ? 1 : 0; > > + e->restricted = > > (freqs[NL80211_FREQUENCY_ATTR_NO_IR] && > > + > > !freqs[NL80211_FREQUENCY_ATTR_RADAR]) || > > + > > freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY]; > > + > > + if > > (freqs[NL80211_FREQUENCY_ATTR_NO_IR] && > > + > > !freqs[NL80211_FREQUENCY_ATTR_RADAR]) > > + e->restricted_flags |= > > IWINFO_FREQ_NO_IR; > > + > > + if > > (freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY]) > > + e->restricted_flags |= > > IWINFO_FREQ_NO_OUTDOOR; > > > > if > > (freqs[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS]) > > e->flags |= > > IWINFO_FREQ_NO_HT40MINUS; > > -- > > 2.32.0 > > > > > > ___ > > openwrt-devel mailing list > > openwrt-devel@lists.openwrt.org > > https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [iwinfo PATCH 1/2] iwinfo: add support for indoor only chan restriction
Ansuel Smith wrote: > Some country permit a specific channel to be used only indoor. > Introduce a new restriction_flags entry to declare different > restrition of a specific channel. > > Signed-off-by: Ansuel Smith > --- > include/iwinfo.h | 4 > iwinfo_nl80211.c | 14 ++ > 2 files changed, 14 insertions(+), 4 deletions(-) > > diff --git a/include/iwinfo.h b/include/iwinfo.h > index 8469ee7..3543b91 100644 > --- a/include/iwinfo.h > +++ b/include/iwinfo.h > @@ -61,6 +61,9 @@ > #define IWINFO_FREQ_NO_160MHZ(1 << 5) > #define IWINFO_FREQ_NO_2160MHZ (1 << 6) > > +#define IWINFO_FREQ_NO_IR(1 << 0) > +#define IWINFO_FREQ_NO_OUTDOOR (2 << 0) That's a pretty non-standard way of defining bits? Did you really mean (1<<0) and (1<<1) ? Sincerely, Karl Palsson > + > extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT]; > extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT]; > extern const char *IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT]; > @@ -168,6 +171,7 @@ struct iwinfo_freqlist_entry { > uint8_t channel; > uint32_t mhz; > uint8_t restricted; > + uint32_t restricted_flags; > uint32_t flags; > }; > > diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c > index c4b0ee2..57f820a 100644 > --- a/iwinfo_nl80211.c > +++ b/iwinfo_nl80211.c > @@ -2911,10 +2911,16 @@ static int nl80211_get_freqlist_cb(struct nl_msg > *msg, void *arg) > e->mhz = > nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]); > e->channel = > nl80211_freq2channel(e->mhz); > > - e->restricted = ( > - > freqs[NL80211_FREQUENCY_ATTR_NO_IR] && > - > !freqs[NL80211_FREQUENCY_ATTR_RADAR] > - ) ? 1 : 0; > + e->restricted = > (freqs[NL80211_FREQUENCY_ATTR_NO_IR] && > + > !freqs[NL80211_FREQUENCY_ATTR_RADAR]) || > + > freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY]; > + > + if (freqs[NL80211_FREQUENCY_ATTR_NO_IR] > && > + > !freqs[NL80211_FREQUENCY_ATTR_RADAR]) > + e->restricted_flags |= > IWINFO_FREQ_NO_IR; > + > + if > (freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY]) > + e->restricted_flags |= > IWINFO_FREQ_NO_OUTDOOR; > > if > (freqs[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS]) > e->flags |= > IWINFO_FREQ_NO_HT40MINUS; > -- > 2.32.0 > > > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel OpenPGP-digital-signature.html Description: OpenPGP Digital Signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[rpcd PATCH 2/2] rpcd: iwinfo: export no_outdoor restriction
A channel can declare restriction where it should be used only indoor. Export this restriction in the channel data. Signed-off-by: Ansuel Smith --- iwinfo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iwinfo.c b/iwinfo.c index ba4fc1e..85860e6 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -723,6 +723,9 @@ rpc_iwinfo_freqlist(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_u32(, "mhz", f->mhz); blobmsg_add_u8(, "restricted", f->restricted); + blobmsg_add_bool(, "no_outdoor", f->restricted_flags & +IWINFO_FREQ_NO_OUTDOOR); + if (ch > -1) blobmsg_add_u8(, "active", f->channel == ch); -- 2.32.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[iwinfo PATCH 1/2] iwinfo: add support for indoor only chan restriction
Some country permit a specific channel to be used only indoor. Introduce a new restriction_flags entry to declare different restrition of a specific channel. Signed-off-by: Ansuel Smith --- include/iwinfo.h | 4 iwinfo_nl80211.c | 14 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index 8469ee7..3543b91 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -61,6 +61,9 @@ #define IWINFO_FREQ_NO_160MHZ (1 << 5) #define IWINFO_FREQ_NO_2160MHZ (1 << 6) +#define IWINFO_FREQ_NO_IR (1 << 0) +#define IWINFO_FREQ_NO_OUTDOOR (2 << 0) + extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT]; extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT]; extern const char *IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT]; @@ -168,6 +171,7 @@ struct iwinfo_freqlist_entry { uint8_t channel; uint32_t mhz; uint8_t restricted; + uint32_t restricted_flags; uint32_t flags; }; diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index c4b0ee2..57f820a 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2911,10 +2911,16 @@ static int nl80211_get_freqlist_cb(struct nl_msg *msg, void *arg) e->mhz = nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]); e->channel = nl80211_freq2channel(e->mhz); - e->restricted = ( - freqs[NL80211_FREQUENCY_ATTR_NO_IR] && - !freqs[NL80211_FREQUENCY_ATTR_RADAR] - ) ? 1 : 0; + e->restricted = (freqs[NL80211_FREQUENCY_ATTR_NO_IR] && + !freqs[NL80211_FREQUENCY_ATTR_RADAR]) || + freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY]; + + if (freqs[NL80211_FREQUENCY_ATTR_NO_IR] && + !freqs[NL80211_FREQUENCY_ATTR_RADAR]) + e->restricted_flags |= IWINFO_FREQ_NO_IR; + + if (freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY]) + e->restricted_flags |= IWINFO_FREQ_NO_OUTDOOR; if (freqs[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS]) e->flags |= IWINFO_FREQ_NO_HT40MINUS; -- 2.32.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[RFC PATCH] treewide: drop librt and libpthread packages
Since OpenWrt's main libc library, musl, does not provide separate shared object files for libpthread and librt, the existing binary packages for them are empty placeholders which provide no runtime functionality and frequently cause confusion among users who attempt to build software linking -lrt or -lpthread on target. To clean this situation up somewhat and to simplify binary package dependecies for all of the potential musl, glibc and uclibc cases, drop those packages and move libpthread.so as well as librt.so into the main libc package for those libc implementations that happen ship them as extra shared libraries. Signed-off-by: Jo-Philipp Wich --- package/devel/perf/Makefile | 2 +- package/devel/valgrind/Makefile | 2 +- package/libs/libevent2/Makefile | 2 +- package/libs/libnl/Makefile | 1 - package/libs/libusb/Makefile | 1 - package/libs/musl-fts/Makefile | 1 - package/libs/toolchain/Makefile | 108 ++- package/network/config/ltq-adsl-app/Makefile | 2 +- package/network/config/ltq-vdsl-app/Makefile | 2 +- package/network/ipv6/thc-ipv6/Makefile | 5 +- package/system/opkg/Makefile | 2 +- package/utils/adb/Makefile | 2 +- package/utils/mdadm/Makefile | 2 +- package/utils/util-linux/Makefile| 1 - 14 files changed, 16 insertions(+), 117 deletions(-) diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile index bbf3aaf9ce..a5d253e94d 100644 --- a/package/devel/perf/Makefile +++ b/package/devel/perf/Makefile @@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/nls.mk define Package/perf SECTION:=devel CATEGORY:=Development - DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS + DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS TITLE:=Linux performance monitoring tool VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) URL:=http://www.kernel.org diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index e6ebff4b30..04a261a5c8 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -33,7 +33,7 @@ include $(INCLUDE_DIR)/kernel.mk define Package/valgrind SECTION:=devel CATEGORY:=Development - DEPENDS:=@mips||mipsel||mips64||mips64el||i386||x86_64||powerpc||arm_v7||aarch64 +libpthread +librt + DEPENDS:=@mips||mipsel||mips64||mips64el||i386||x86_64||powerpc||arm_v7||aarch64 TITLE:=debugging and profiling tools for Linux URL:=http://www.valgrind.org endef diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 85c159c2a6..b6b2fdfa50 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -102,7 +102,7 @@ endef define Package/libevent2-pthreads $(call Package/libevent2/Default) TITLE+= Pthreads library (version 2.1) - DEPENDS+=+libpthread +libevent2-core + DEPENDS+=+libevent2-core endef define Package/libevent2-pthreads/description diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index db0c65c7a7..64e37a28d5 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -31,7 +31,6 @@ endef define Package/libnl-core $(call Package/libnl/default) TITLE:=Core Netlink Library - DEPENDS:=+libpthread endef define Package/libnl-genl diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index 6b80b3848d..abf966a384 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -30,7 +30,6 @@ define Package/libusb-1.0 SECTION:=libs CATEGORY:=Libraries TITLE:=A library for accessing Linux USB devices - DEPENDS:=+libpthread +librt URL:=http://libusb.info/ ABI_VERSION:=0 endef diff --git a/package/libs/musl-fts/Makefile b/package/libs/musl-fts/Makefile index 494f700f8a..b2d9843bb3 100644 --- a/package/libs/musl-fts/Makefile +++ b/package/libs/musl-fts/Makefile @@ -36,7 +36,6 @@ define Package/musl-fts CATEGORY:=Libraries TITLE:=fts implementation for musl libc URL:=https://github.com/pullmoll/musl-fts - DEPENDS:= +libpthread endef define Package/musl-fts/description diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index dea99060f9..d3c571a80f 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -115,7 +115,7 @@ define Package/libasan $(call Package/gcc/Default) NAME:=libasan TITLE:=Runtime library for AddressSanitizer in GCC - DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc + DEPENDS:=@USE_GLIBC +libstdcpp @!mips64 @!mips64el @!arc ABI_VERSION:=5 endef @@ -144,7 +144,7 @@ define Package/libtsan $(call Package/gcc/Default) NAME:=libtsan TITLE:=Runtime library for ThreadSanitizer in GCC -
[PATCH] procd: setup /dev/stdin, /dev/stdout and /dev/stderr symlinks
Extend the hotplug.json ruleset to setup the common /dev/std{in,out,err} symbolic links which are needed by some applications, e.g. nftables when applying rulesets from stdin. Signed-off-by: Jo-Philipp Wich --- package/system/procd/files/hotplug.json | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json index 7e0f129d35..b930b307a4 100644 --- a/package/system/procd/files/hotplug.json +++ b/package/system/procd/files/hotplug.json @@ -7,9 +7,19 @@ [ "has", "MINOR" ] ], [ + [ "if", + [ "eq", "DEVNAME", "null" ], + [ + [ "makedev", "/dev/%DEVNAME%", "0666" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd/0", "/dev/stdin" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd/1", "/dev/stdout" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd/2", "/dev/stderr" ], + [ "return" ] + ] + ], [ "if", [ "eq", "DEVNAME", - [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ] + [ "full", "ptmx", "zero", "tty", "net", "random", "urandom" ] ], [ [ "makedev", "/dev/%DEVNAME%", "0666" ], -- 2.30.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel