Re: [OpenWrt-Devel] Review and cleanup of base packages
Hey Petr, find some comments inline. 10/08/2019 11:58, Petr Štetiar: Hi, one of the topics discussed during recent Hamburg meeting was "Review base packages"[1], where we simply talked about: * lack of formal definition for a base package * transfer of base packages which don't fit formal definition into feeds So, how can we define which package should be included in the base/master tree? (Any idea where to put this on the wiki?) * package is needed by device in order to - build the image and flashing tools - boot device into usable state * package is convenient for development (gdb, perf, strace, valgrind etc.) - couldn't one just symlink/install those packages from feeds? * it's convenient for testing (ct-bugcheck, fbtest, spidev_test, iperf3 etc.) - couldn't one just symlink/install those packages from feeds? * package is needed for automatic testing - couldn't one just symlink/install those packages from feeds? * it's not possible to build the package and/or tooling out of the tree For the initial discussion, I've simply created a list of packages which are not used by any target, so probably possible candidates for transfer into the feeds: boot/kexec-tools devel/gdb devel/perf devel/strace devel/trace-cmd devel/valgrind firmware/am33x-cm3 firmware/amd64-microcode kernel/avila-wdt kernel/gpio-nct5104d kernel/leds-apu2/src kernel/rtc-rv5c386a kernel/rtl8812au-ct kernel/trelay kernel/w1-gpio-custom libs/libbsd (lldpd) libs/libconfig libs/libevent2(lldpd) libs/libnetfilter-cthelper libs/libnetfilter-cttimeout libs/libnetfilter-log libs/libnetfilter-queue libs/libroxml libs/libusb-compat libs/nghttp2 (curl) libs/popt network/config/ltq-vdsl-app At least this one is referenced in target/linux/lantiq/xrx200/target.mk network/config/qos-scripts network/config/vti network/config/vxlan network/config/xfrm network/ipv6/464xlat network/ipv6/6in4 network/ipv6/6rd network/ipv6/6to4 network/ipv6/ds-lite network/ipv6/map network/ipv6/thc-ipv6 network/services/igmpproxy network/services/ipset-dns network/services/lldpd network/services/omcproxy network/services/openvpn-easy-rsa network/services/openvpn network/services/relayd network/services/samba36 network/services/umdns network/services/wireguard network/utils/curl network/utils/dante network/utils/iftop network/utils/iperf3 network/utils/iperf network/utils/iproute2 network/utils/ipset network/utils/iputils network/utils/iwcap network/utils/owipcalc network/utils/tcpdump network/utils/umbim network/utils/wpan-tools Personally I prefer to have some debug tools I use regularly, like tcpdump, iftop and iperf*, in the base packages. During development I don't include the feeds. Rather I would like to see the tool "io", which allows memory/register manipulation, included in the base packages. Quite handy tool during driver debugging/development. system/rpcd system/zram-swap utils/ct-bugcheck utils/fbtest utils/fritz-tools The fritz-tools "meta" package provides the fritz-tffs package, which is included at least by target/linux/lantiq/Makefile. Regards Mathias ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq: use gpio_hog instead of gpio-export
02/08/2019 11:57, Birger Koblitz: lantiq: use gpio_hog instead of gpio-export The `gpio-export` functionality is a hack for missing kernel functionality, which was rejected in upstream kernel long time ago, for details see this email http://lists.infradead.org/pipermail/openwrt-devel/2019-February/015772.html, discussion in PR#1366 or https://github.com/openwrt/openwrt/pull/1814#issuecomment-462942022. This patch converts all remaining lantiq .dts(i) files which were using export-gpio and not making use of the change-direction functionality to using gpio_hog instead Signed-off-by: Birger Koblitz --- ... diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts b/target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts index 4796123c20..0b21b67504 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts @@ -37,22 +37,6 @@ }; }; - gpio_export { - compatible = "gpio-export"; - #size-cells = <0>; - - annexa { - gpio-export,name = "annexa"; - gpio-export,output = <0>; - gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; - }; - annexb { - gpio-export,name = "annexb"; - gpio-export,output = <0>; - gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; - }; - }; - leds { compatible = "gpio-leds"; @@ -85,6 +69,24 @@ }; }; +&gpio { + status = "okay"; + + annexa { + gpio-hog; + line-name = "annexa"; + gpios = <12 GPIO_ACTIVE_HIGH>; + output-low; + }; + + annexb { + gpio-hog; + line-name = "annexb"; + gpios = <15 GPIO_ACTIVE_HIGH>; + output-low; + }; +}; + ð0 { lantiq,phys = <&gphy1>; NAK on this change. Here w've an example where we can't hog gpios. These gpios are used to switch the xDSL Frontend to either Annex A or Annex B mode. It's a configuration which has to be done from userspace, based on the user selectable ADSL mode. Have a look at commit 08cd5b769deb4833b7a20208fa15674f52023fea for reference. If we hog the gpios, they can't be controlled from userspace any more. Before we drop these exports, we need to find another solution for this use case. Regards Mathias ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: use gpio_hog instead of gpio-export
02/08/2019 11:58, Birger Koblitz: ramips: use gpio_hog instead of gpio-export The `gpio-export` functionality is a hack for missing kernel functionality, which was rejected in upstream kernel long time ago, for details see this email http://lists.infradead.org/pipermail/openwrt-devel/2019-February/015772.html, discussion in PR#1366 or https://github.com/openwrt/openwrt/pull/1814#issuecomment-462942022. This patch converts all remaining ramips .dts(i) files which were using export-gpio and not making use of the change-direction functionality to using gpio_hog instead Signed-off-by: Birger Koblitz --- diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts index 4097dc6140..ea0d9801c1 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts @@ -21,39 +21,6 @@ bootargs = "console=ttyS0,115200"; }; - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - modem-enable { - gpio-export,name = "modem-enable"; - gpio-export,output = <1>; - gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; - }; - - modem-rf-enable { - gpio-export,name = "modem-rf-enable"; - gpio-export,output = <1>; - gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - - sim-select { - gpio-export,name = "sim-select"; - gpio-export,output = <0>; - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; - }; - - sim1-detect { - gpio-export,name = "sim1-detect"; - gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; - }; - - sim2-detect { - gpio-export,name = "sim2-detect"; - gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; - }; - }; - Hey Birger, similar to my comment for the lantiq version, this doesn't work as well. AFAIR, the Tube e4g has two sim card slots and the "sim-select" gpio is supposed to be used from the userspace, to select which sim card slot should be used. If we hog the gpio, it can't be manipulated from the userspace anymore. I haven't had a closer look at the patch. There might be similar issues for other boards. @Piotr can confirm what I might to remember? Regards Mathias ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: use gpio_hog instead of gpio-export
Hi Mathias, Birger, On 11.08.2019 11:36, Mathias Kresin wrote: 02/08/2019 11:58, Birger Koblitz: ramips: use gpio_hog instead of gpio-export The `gpio-export` functionality is a hack for missing kernel functionality, which was rejected in upstream kernel long time ago, for details see this email http://lists.infradead.org/pipermail/openwrt-devel/2019-February/015772.html, discussion in PR#1366 or https://github.com/openwrt/openwrt/pull/1814#issuecomment-462942022. This patch converts all remaining ramips .dts(i) files which were using export-gpio and not making use of the change-direction functionality to using gpio_hog instead Signed-off-by: Birger Koblitz --- diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts index 4097dc6140..ea0d9801c1 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts @@ -21,39 +21,6 @@ bootargs = "console=ttyS0,115200"; }; - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - modem-enable { - gpio-export,name = "modem-enable"; - gpio-export,output = <1>; - gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; - }; - - modem-rf-enable { - gpio-export,name = "modem-rf-enable"; - gpio-export,output = <1>; - gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - - sim-select { - gpio-export,name = "sim-select"; - gpio-export,output = <0>; - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; - }; - - sim1-detect { - gpio-export,name = "sim1-detect"; - gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; - }; - - sim2-detect { - gpio-export,name = "sim2-detect"; - gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; - }; - }; - Hey Birger, similar to my comment for the lantiq version, this doesn't work as well. AFAIR, the Tube e4g has two sim card slots and the "sim-select" gpio is supposed to be used from the userspace, to select which sim card slot should be used. If we hog the gpio, it can't be manipulated from the userspace anymore. I haven't had a closer look at the patch. There might be similar issues for other boards. @Piotr can confirm what I might to remember? Yes, you're correct. Also, the "modem-enable" should be available in user space as in case of some modems (without "SIM power down" feature support), only this approach works when changing SIM cards/slots: put the modem in reset -> switch SIM slot -> enable modem (still, there is a way to perform modem reset using AT command but IMHO it's not as convenient as toggling PERST# pin) -- Cheers, Piotr ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: use gpio_hog instead of gpio-export
Dear Mathias and Piotr, thank you for your comments. I had incorrectly assumed that a gpio_hog could still be switched on/off from user space and that the only thing not possible was changing the direction. I'll go through the patches and remove anything that sounds like it might need user space configuration (i.e. not power the USB bus or the like). Is anyone working on converting the use-cases which require user space switching to libgpiod or any other solution? Cheers, Birger On 11.08.19 12:06, Piotr Dymacz wrote: > Hi Mathias, Birger, > > On 11.08.2019 11:36, Mathias Kresin wrote: >> 02/08/2019 11:58, Birger Koblitz: >>> ramips: use gpio_hog instead of gpio-export >>> >>> The `gpio-export` functionality is a hack for >>> missing kernel functionality, which was rejected in upstream kernel >>> long >>> time >>> ago, for details see this email >>> http://lists.infradead.org/pipermail/openwrt-devel/2019-February/015772.html, >>> >>> discussion in PR#1366 or >>> https://github.com/openwrt/openwrt/pull/1814#issuecomment-462942022. >>> >>> This patch converts all remaining ramips .dts(i) files which were >>> using export-gpio and not making use of the change-direction >>> functionality >>> to using gpio_hog instead >>> >>> Signed-off-by: Birger Koblitz >>> >>> --- >>> >>> diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts >>> b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts >>> index 4097dc6140..ea0d9801c1 100644 >>> --- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts >>> +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts >>> @@ -21,39 +21,6 @@ >>> bootargs = "console=ttyS0,115200"; >>> }; >>> - gpio-export { >>> - compatible = "gpio-export"; >>> - #size-cells = <0>; >>> - >>> - modem-enable { >>> - gpio-export,name = "modem-enable"; >>> - gpio-export,output = <1>; >>> - gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; >>> - }; >>> - >>> - modem-rf-enable { >>> - gpio-export,name = "modem-rf-enable"; >>> - gpio-export,output = <1>; >>> - gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; >>> - }; >>> - >>> - sim-select { >>> - gpio-export,name = "sim-select"; >>> - gpio-export,output = <0>; >>> - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; >>> - }; >>> - >>> - sim1-detect { >>> - gpio-export,name = "sim1-detect"; >>> - gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; >>> - }; >>> - >>> - sim2-detect { >>> - gpio-export,name = "sim2-detect"; >>> - gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; >>> - }; >>> - }; >>> - >> >> Hey Birger, >> >> similar to my comment for the lantiq version, this doesn't work as well. >> >> AFAIR, the Tube e4g has two sim card slots and the "sim-select" gpio is >> supposed to be used from the userspace, to select which sim card slot >> should be used. >> >> If we hog the gpio, it can't be manipulated from the userspace anymore. >> >> I haven't had a closer look at the patch. There might be similar issues >> for other boards. >> >> @Piotr can confirm what I might to remember? > > Yes, you're correct. > > Also, the "modem-enable" should be available in user space as in case > of some modems (without "SIM power down" feature support), only this > approach works when changing SIM cards/slots: > > put the modem in reset -> switch SIM slot -> enable modem > > (still, there is a way to perform modem reset using AT command but > IMHO it's not as convenient as toggling PERST# pin) > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio-export
Dear Adrian, I'll resubmit a patch taking your comments into account. I am using a script that parses the DTS and I will use more of the original line-name to name the node, i.e. "tp-link:power:usb" -> power-usb "tp-link:reset:sr" -> reset-sr This should also prevent the double naming of the nodes. I am actually surprised the DTS compiler did not complain... Things like - compatible = "yuncore,a770", "qca,qca9531"; + compatible = "yuncore,a770", "qca,qca9533"; are probably due to trailing white-space in the original, I'll stop the script from touching that. Cheers, Birger On 10.08.19 22:20, m...@adrianschmutzler.de wrote: > Hi, > >> + usb { >> + gpio-hog; >> + line-name = "tp-link:power:usb"; >> + gpios = <6 GPIO_ACTIVE_HIGH>; >> + output-high; >> }; >> }; > As stated earlier, I would prefer calling those blocks usb-power, usb1-power, > etc.. > >> diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts >> b/target/linux/ath79/dts/qca9531_yuncore_a770.dts >> index da5b6dc7db..18ad6307a1 100644 >> --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts >> +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts >> @@ -8,7 +8,7 @@ >> >> / { >> model = "YunCore A770"; >> - compatible = "yuncore,a770", "qca,qca9531"; >> + compatible = "yuncore,a770", "qca,qca9533"; > This should be removed. > >> diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi >> b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi >> index 6d32fa3fc4..378c87c9ee 100644 >> --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi >> +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi >> @@ -54,22 +54,23 @@ >> gpios = <&gpio 21 GPIO_ACTIVE_LOW>; >> }; >> }; >> +}; >> >> - gpio-export { >> - compatible = "gpio-export"; >> - >> - gpio_shift_register_oe { >> - gpio-export,name = "tp-link:oe:sr"; >> - gpio-export,output = <0>; >> - gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; >> - }; >> +&gpio { >> + status = "okay"; >> >> - gpio_shift_register_reset { >> - gpio-export,name = "tp-link:reset:sr"; >> - gpio-export,output = <1>; >> - gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; >> - }; >> + sr { >> + gpio-hog; >> + line-name = "tp-link:oe:sr"; >> + gpios = <16 GPIO_ACTIVE_HIGH>; >> + output-low; >> + }; >> >> + sr { >> + gpio-hog; >> + line-name = "tp-link:reset:sr"; >> + gpios = <19 GPIO_ACTIVE_HIGH>; >> + output-high; >> }; > Those two should have different node names. > >> diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts >> b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts >> index f4add2fe31..d892d0e960 100644 >> --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts >> +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts >> @@ -41,22 +41,6 @@ >> }; >> }; >> >> - gpio-export { >> - compatible = "gpio-export"; >> - >> - gpio_shift_register_oe { >> - gpio-export,name = "tp-link:oe:sr"; >> - gpio-export,output = <0>; >> - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; // 74HC595 /OE (Output >> Enable) >> - }; >> - >> - gpio_shift_register_reset { >> - gpio-export,name = "tp-link:reset:sr"; >> - gpio-export,output = <1>; >> - gpios = <&gpio 21 GPIO_ACTIVE_LOW>; // 74HC595 /SRCLR (Serial >> Clear) >> - }; >> - }; >> - >> leds { >> compatible = "gpio-leds"; >> >> @@ -148,15 +132,29 @@ >> >> }; >> >> -&pcie { >> +&gpio { >> status = "okay"; >> + >> + sr { >> + gpio-hog; >> + line-name = "tp-link:oe:sr"; >> + gpios = <1 GPIO_ACTIVE_LOW>; >> + output-low; >> + }; >> + >> + sr { >> + gpio-hog; >> + line-name = "tp-link:reset:sr"; >> + gpios = <21 GPIO_ACTIVE_LOW>; >> + output-high; >> + }; >> }; > Same here. > > Rest looks good, I haven't checked for duplicate &gpio definitions (you seem > to have addressed some). > > Best > > Adrian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: use gpio_hog instead of gpio-export
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software.--- Begin Message --- On Sun, Aug 11, 2019 at 1:00 PM Birger Koblitz wrote: > I'll go through the patches and remove anything that sounds like it > might need user space configuration (i.e. not power the USB bus or the > like). upstream GPIO maintainers prefer dedicated properties instead of a GPIO hog. some USB controller drivers support a "vbus-supply" property, which can be used together with a GPIO regulator in case of the VBUS supply it means the GPIO will be turned off if the USB port is "disabled" (for example by unloading the kernel USB controller driver). I'm not saying that you have to switch over to something other than GPIO hogs. switching to an upstream solution is a good starting point! just be aware that this may not be the final solution > Is anyone working on converting the use-cases which require user space > switching to libgpiod or any other solution? how do you identify the "use-cases which require use space switching"? Martin --- End Message --- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Has OpenWrt suport for Powerline devices
Hi, I've a device with PowerLine. It's the devolo dLAN pro 500 wireless plus. It has an ath9k compatible WiFi (2.4GHz + 5GHz), and a free software bootloader, which is an old vendor fork of u-boot. The PowerLine part doesn't work out of the box and require a nonfree, non-redistributable firmware to work, however there is some documentation on it on the wiki[1]. A really good way to fix that, and integrate everything would be to have people working on free software replacements for such nonfree firmwares, however I've no idea if anyone has started working on that yet. There is also a tag called 'plc' (Power line communication[3]) on the wiki for device with PowerLine. References: --- [1]https://openwrt.org/toh/devolo/devolo_dlan_pro_wireless_500_plus [2]https://openwrt.org/tag/plc?do=showtag&tag=plc [3]Note that the PLC acronym is also commonly used for "Programmable logic controller" which has nothing to do at all with PowerLine. Denis. pgpQACYbyEM73.pgp Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: use gpio_hog instead of gpio-export
Fully agree. And BTW, AT commands may not be a viable option in some cases. We need to be able to manipulate gpios from user space sometime. Thanks, Enrico ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio-export
> -Original Message- > From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] > On Behalf Of Birger Koblitz > Sent: Sonntag, 11. August 2019 13:11 > To: m...@adrianschmutzler.de > Cc: 'OpenWrt Development List' > Subject: Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio- > export > > Dear Adrian, > > I'll resubmit a patch taking your comments into account. I am using a script > that parses the DTS ... So that means that duplicate &gpio is also treated with automatically (as I've seen with some devices)? > This should also prevent the double naming of the nodes. I am actually > surprised the DTS compiler did not complain... Things like > > - compatible = "yuncore,a770", "qca,qca9531"; > + compatible = "yuncore,a770", "qca,qca9533"; > > are probably due to trailing white-space in the original, I'll stop the > script from > touching that. Well, in this particular case it was not only whitespace, but the qca changing from 9531 to 9533... Best Adrian openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: use gpio_hog instead of gpio-export
Dear Martin and Enrico, thanks for your comments. On 11.08.19 13:38, Martin Blumenstingl wrote: > On Sun, Aug 11, 2019 at 1:00 PM Birger Koblitz wrote: >> I'll go through the patches and remove anything that sounds like it >> might need user space configuration (i.e. not power the USB bus or the >> like). > upstream GPIO maintainers prefer dedicated properties instead of a GPIO hog. > > some USB controller drivers support a "vbus-supply" property, which > can be used together with a GPIO regulator > in case of the VBUS supply it means the GPIO will be turned off if the > USB port is "disabled" (for example by unloading the kernel USB > controller driver). > > I'm not saying that you have to switch over to something other than GPIO hogs. > switching to an upstream solution is a good starting point! > just be aware that this may not be the final solution this is understood. gpio-hog is only the second best solution, where gpio-export is only the third best solution for the general case but in some cases at the moment the only reasonable one. > >> Is anyone working on converting the use-cases which require user space >> switching to libgpiod or any other solution? > how do you identify the "use-cases which require use space switching"? I believe this discussion has happened already, e.g. here: https://github.com/openwrt/openwrt/pull/1366 and I don't think you need a final answer to this question in order to start migrating to gpio_hog where it is easily possible. @Enrico: It is clear that in some cases definitely we need to have a possibility to manipulate gpios from user-space. Cheers Birger ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio-export
Hi Adrian, On 11.08.19 21:15, m...@adrianschmutzler.de wrote: >> -Original Message- >> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] >> On Behalf Of Birger Koblitz >> Sent: Sonntag, 11. August 2019 13:11 >> To: m...@adrianschmutzler.de >> Cc: 'OpenWrt Development List' >> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio- >> export >> >> Dear Adrian, >> >> I'll resubmit a patch taking your comments into account. I am using a script >> that parses the DTS ... > So that means that duplicate &gpio is also treated with automatically (as > I've seen with some devices)? The script is able to catch some cases, others are not so easy. I believe there is a case where the original .dts already has duplicates. Also the idea was to keep the sequence of the gpios definitions in the original .dts. If the original dts moves from chip 0 to chip 1 and back to chip 0 with the definition of gpios being exported, then this will give duplicates for gpio0 at the moment. I could sort the gpios so that it is guaranteed that there are no duplicate gpio definitions but this would destroy the original authors intention as to which gpio belongs to which other one. > >> This should also prevent the double naming of the nodes. I am actually >> surprised the DTS compiler did not complain... Things like >> >> - compatible = "yuncore,a770", "qca,qca9531"; >> + compatible = "yuncore,a770", "qca,qca9533"; >> >> are probably due to trailing white-space in the original, I'll stop the >> script from >> touching that. > Well, in this particular case it was not only whitespace, but the qca > changing from 9531 to 9533... Ouch, this was an accident with commit 5e9086b7b11976ba75014b257139ddc4b2885a8a don't know how I messed that up... > > > Adrian Thanks for the comments, Birger As an afterthought, here comes the current script, I know that it is ugly, but it shows what is done and how: #!/usr/bin/ruby unless ARGV.length == 1 puts "Usage: convertHog.rb " exit end line_num = 0 in_root = 0 in_export = false in_node = false in_comment = false last_empty = false in_node_comment = false node = -1 node_name = Array.new node_output = Array.new node_is_output = Array.new node_chip = Array.new node_num = Array.new node_active = Array.new node_comment = Array.new node_prefix = Array.new gpio_found = Array.new gpio_stack = "" remove_next_empty = false DEBUG = false f = File.open(ARGV[0]) f.each do |line| line_num += 1 if line.match(/\/\s*\{/) then print "Found beginning\n" if DEBUG in_root += 1 print "\n" if last_empty print "#{line}" last_empty = false next end if line.match(/{/) then in_root +=1 end if line.match(/}/) then in_root -=1 end if line.match(/^\s*$/) then print "last empty\n" if DEBUG if not remove_next_empty then last_empty = true next end end print "#{line_num} root #{in_root} " if DEBUG if (in_root > 0) and line.match(/gpio[_\-]export\s*\{/) then print "Found export\n" if DEBUG in_export = true next end if in_export then last_empty = false if not in_node then if line.match(/^\s*\/\*\s*$/) then in_comment = true; end if line.match(/^\s*\*\/\s*$/) then in_comment = false; print "#{line}" next end end if in_comment then print "#{line}" next end if line.match(/\w+\s*\{/) print "Found node\n" if DEBUG in_node = true; node += 1 end if line.match(/\}\s*;/) then if in_node in_node = false else in_export = false end end if in_node then line.match(/gpio\-export,name\s*=\s*"([\w\d\-:]+:)?([\w\d\-]+)"/) { |m| if m.length == 2 then print "Found export #{m[1]}\n" if DEBUG node_name[node] = m[1] else print "Found export #{m[2]}\n" if DEBUG node_name[node] = m[2] node_prefix[node] = m[1] end } line.match(/gpio\-export,output\s*=\s*<(\d)>\s*;/) { |m| print "Found output #{m[1]}\n" if DEBUG node_output[node] = m[1] node_is_output[node] = true } line.match(/gpios\s*\=\s*\<\&gpio(\d*)\s+(\d+)\s+GPIO_ACTIVE_(\w+)\s*\>\s*;/i) { |m| print "Found gpio #{m[1]}, #{m[2]}, #{m[3]}\n" if DEBUG node_chip[node] = m[1] node_num[node] = m[2] node_active[node] = m[3] gpio_found[m[1].to_i] = true } line.match(/\/\*(.*)\*\//){ |m| print "Found comment #{m[1]}\n" node_comment[node] = m[0] } if line.match(/^\s*\/\*\s*$/) then print "In Node COMMENT\n" if DEBUG in_node_comment = true; node_comment[node] = "" end if line.match(/^\s*\*\/\s*$/) then print "End Node COMMENT\n" if DEBUG node_comment[node] += line in_node_comment = false; end
Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio-export
> -Original Message- > From: Birger Koblitz [mailto:m...@birger-koblitz.de] > Sent: Sonntag, 11. August 2019 22:06 > To: m...@adrianschmutzler.de; 'OpenWrt Development List' de...@lists.openwrt.org> > Subject: Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio- > export > > Hi Adrian, > > On 11.08.19 21:15, m...@adrianschmutzler.de wrote: > >> -Original Message- > >> From: openwrt-devel [mailto:openwrt-devel- > boun...@lists.openwrt.org] > >> On Behalf Of Birger Koblitz > >> Sent: Sonntag, 11. August 2019 13:11 > >> To: m...@adrianschmutzler.de > >> Cc: 'OpenWrt Development List' > >> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of > >> gpio- export > >> > >> Dear Adrian, > >> > >> I'll resubmit a patch taking your comments into account. I am using a > >> script that parses the DTS ... > > So that means that duplicate &gpio is also treated with automatically (as > I've seen with some devices)? > > The script is able to catch some cases, others are not so easy. I believe > there > is a case where the original .dts already has duplicates. > > Also the idea was to keep the sequence of the gpios definitions in the > original .dts. Okay. I don't think that's the most critical topic, as build-testing will sort out all of the relevant possible errors. I was mostly asking out of curiosity and would not bother with this further... Best Adrian openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 3/5] ath79: add support for Netgear WNR2000 v3
This patch adds ath79 support for Netgear WNR2000v3. Router was previously supported by ar71xx target only. Note: this is a 4_32 device with limited upgrade capabilities. Specification = * Description: Netgear WNR2000 v3 * Loader: U-boot * SOC: Atheros AR7241 (360 MHz) * RAM: 32 MiB * Flash: 4 MiB (SPI NOR) - U-boot binary: 256 KiB - U-boot environment: 64 KiB - Firmware: 3712 KiB - ART: 64 KiB * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN * Wireless: 2.4 GHz b/g/n (Atheros AR9287) * USB: no * Buttons: - Reset - WiFi (rfkill) - WPS * LEDs: - Power (amber/green) - WAN (amber/green) - WLAN (blue) - 4 x LAN (amber/green) - WPS (green) * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1 * Power supply: DC 12V 1A Installation * TFTP recovery * TFTP via U-boot prompt * sysupgrade * Web interface Test build configuration CONFIG_TARGET_ath79=y CONFIG_TARGET_ath79_tiny=y CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr2000-v3=y CONFIG_ALL_KMODS=y CONFIG_DEVEL=y CONFIG_CCACHE=y CONFIG_COLLECT_KERNEL_DEBUG=y CONFIG_IMAGEOPT=y CONFIG_KERNEL_DEBUG_INFO=y CONFIG_KERNEL_DEBUG_KERNEL=y Signed-off-by: Michal Cieslakiewicz --- .../ath79/base-files/etc/board.d/01_leds | 12 + .../ath79/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom| 1 + .../ath79/dts/ar7241_netgear_wnr2000-v3.dts | 212 ++ target/linux/ath79/image/tiny-netgear.mk | 16 ++ 5 files changed, 242 insertions(+) create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index f1d738ba9f..4e919e7576 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -103,6 +103,18 @@ glinet,gl-ar300m-lite) glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ;; +netgear,wnr2000-v3) + ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" + ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0" + ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04" + ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04" + ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04" + ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04" + ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02" + ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02" + ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02" + ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02" + ;; netgear,wnr612-v2|\ on,n150r) ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0" diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index 99b9d421f4..aff62274b6 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -195,6 +195,7 @@ ath79_setup_interfaces() ucidef_add_switch_port_attr "switch0" 2 led 9 ucidef_add_switch_port_attr "switch0" 5 led 2 ;; + netgear,wnr2000-v3|\ netgear,wnr612-v2|\ on,n150r|\ tplink,tl-wr740n-v1|\ diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ec597dd1d4..747c1aab58 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -165,6 +165,7 @@ case "$FIRMWARE" in winchannel,wb2000) ath9k_eeprom_extract "art" 20480 1088 ;; + netgear,wnr2000-v3|\ netgear,wnr612-v2|\ on,n150r|\ pcs,cap324|\ diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts new file mode 100644 index 00..22f27f5313 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -0,0 +1,212 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7241.dtsi" + +/ { + compatible = "netgear,wnr2000-v3", "qca,ar7241"; + model = "Netgear WNR2000 v3"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-
[OpenWrt-Devel] [PATCH v3 0/5] ath79: add support for some Netgear WNR routers
This patchset enables ath79 target for following Netgear ar724x-based routers currently supported by ar71xx: * Netgear WNR1000v2 (tiny, 4_32) * Netgear WNR2000v3 (tiny, 4_32) * Netgear WNR2200 (generic, 8_64 + USB) and improves existing support for: * Netgear WNR612v2 (tiny, 4_32) For all above routers, MAC address printed on device label is for LAN interface (eth1, ART offset 0x6). The goal was to provide full functionality in ath79, on a par with ar71xx target. The only minor change is renaming 'netgear:amber:test' LED to 'netgear:amber:power' where applicable (apparently no one defines them as 'test' nowadays). Patched images were successfully flashed to respective devices and are confirmed to work. Patch #1 is a prerequisite. It adds DT flags to control network LEDs and clocks - in ar71xx these get disabled at setup phase in mach-*.c files. Now ath79 target can do this as well and provide sysfs access to LAN/WAN amber and green diodes. Changes from v2: * source DT files reformatted ('compatible' before 'model', hex numbers simplified, gpio hog renamed etc) * target makefiles updated (redundant variables removed) * startup scripts updated (do not define triggers already set by DTS) Patch list (5): ath79: add LAN LEDs control bits for AR724x GPIO function pinmux ath79: WNR612v2: improve device support ath79: add support for Netgear WNR2000 v3 ath79: add support for Netgear WNR1000 v2 ath79: add support for Netgear WNR2200 .../ath79/base-files/etc/board.d/01_leds | 14 ++ .../ath79/base-files/etc/board.d/02_network | 3 + .../etc/hotplug.d/firmware/10-ath9k-eeprom| 3 + .../ath79/dts/ar7240_netgear_wnr1000-v2.dts | 207 +++ .../ath79/dts/ar7240_netgear_wnr612-v2.dts| 2 +- .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 20 +- target/linux/ath79/dts/ar7240_on_n150r.dts| 2 +- .../ath79/dts/ar7241_netgear_wnr2000-v3.dts | 212 .../ath79/dts/ar7241_netgear_wnr2200.dts | 237 ++ target/linux/ath79/dts/ar724x.dtsi| 10 +- target/linux/ath79/image/generic.mk | 14 ++ target/linux/ath79/image/tiny-netgear.mk | 30 ++- 12 files changed, 744 insertions(+), 10 deletions(-) create mode 100644 target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2200.dts -- 2.22.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 4/5] ath79: add support for Netgear WNR1000 v2
This patch adds ath79 support for Netgear WNR1000v2. Router was previously supported by ar71xx target only. Note: this is a 4_32 device with limited upgrade capabilities. Specification = * Description: Netgear WNR1000 v2 * Loader: U-boot * SOC: Atheros AR7240 (340 MHz) * RAM: 32 MiB * Flash: 4 MiB (SPI NOR) - U-boot binary: 256 KiB - U-boot environment: 64 KiB - Firmware: 3712 KiB - ART: 64 KiB * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN * Wireless: 2.4 GHz b/g/n (Atheros AR9285) * USB: no * Buttons: - Reset - WiFi (rfkill) - WPS * LEDs: - Power (amber/green) - WAN (amber/green) - WLAN (blue) - 4 x LAN (amber/green) - WPS (green) * UART: 4-pin connector JP2, 3.3V (Vcc, TX, RX, GND), 115200 8N1 * Power supply: DC 12V 1A * MAC addresses: LAN on case label, WAN +1, WLAN +2 Installation * TFTP recovery * TFTP via U-boot prompt * sysupgrade * Web interface Test build configuration CONFIG_TARGET_ath79=y CONFIG_TARGET_ath79_tiny=y CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr1000-v2=y CONFIG_ALL_KMODS=y CONFIG_DEVEL=y CONFIG_CCACHE=y CONFIG_COLLECT_KERNEL_DEBUG=y CONFIG_IMAGEOPT=y CONFIG_KERNEL_DEBUG_INFO=y CONFIG_KERNEL_DEBUG_KERNEL=y Signed-off-by: Michal Cieslakiewicz --- .../ath79/base-files/etc/board.d/01_leds | 1 + .../ath79/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom| 1 + .../ath79/dts/ar7240_netgear_wnr1000-v2.dts | 207 ++ target/linux/ath79/image/tiny-netgear.mk | 12 + 5 files changed, 222 insertions(+) create mode 100644 target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index 4e919e7576..7eca103a9e 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -103,6 +103,7 @@ glinet,gl-ar300m-lite) glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ;; +netgear,wnr1000-v2|\ netgear,wnr2000-v3) ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0" diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index aff62274b6..fe491d1c26 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -195,6 +195,7 @@ ath79_setup_interfaces() ucidef_add_switch_port_attr "switch0" 2 led 9 ucidef_add_switch_port_attr "switch0" 5 led 2 ;; + netgear,wnr1000-v2|\ netgear,wnr2000-v3|\ netgear,wnr612-v2|\ on,n150r|\ diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 747c1aab58..dbe53b6f64 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -165,6 +165,7 @@ case "$FIRMWARE" in winchannel,wb2000) ath9k_eeprom_extract "art" 20480 1088 ;; + netgear,wnr1000-v2|\ netgear,wnr2000-v3|\ netgear,wnr612-v2|\ on,n150r|\ diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts new file mode 100644 index 00..e344c0e62c --- /dev/null +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7240.dtsi" + +/ { + compatible = "netgear,wnr1000-v2", "qca,ar7240"; + model = "Netgear WNR1000 v2"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &power_amber; + led-failsafe = &power_amber; + led-running = &power_green; + led-upgrade = &power_amber; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + linux,code = ; + gpios = <&ath9k 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&ath9k 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; +
[OpenWrt-Devel] [PATCH v3 1/5] ath79: add LAN LEDs control bits for AR724x GPIO function pinmux
Currently AR724x pinmux for register 0x18040028 controls only JTAG disable bit. This patch adds new DTS settings to control LAN LEDs and CLKs that allow full software control over these diodes - exactly the same is done by ar71xx target in device setup phase for many routers (WNR2000v3 for example). 'switch_led_disable_pins' clears AR724X_GPIO_FUNC_ETH_SWITCH_LED[0-4]_EN bits. 'clks_disable_pins' clears AR724X_GPIO_FUNC_CLK_OBS[1-5]_EN and AR724X_GPIO_FUNC_GE0_MII_CLK_EN bits. These all should be used together, along with 'jtag_disable_pins', to allow OS to control all GPIO-connected LEDs and buttons on device. Signed-off-by: Michal Cieslakiewicz --- target/linux/ath79/dts/ar724x.dtsi | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index b2844bf179..95832d998a 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -75,7 +75,15 @@ #pinctrl-cells = <2>; jtag_disable_pins: pinmux_jtag_disable_pins { - pinctrl-single,bits = <0x0 0x1 0x1>; + pinctrl-single,bits = <0x0 0x1 0x1>; + }; + + switch_led_disable_pins: pinmux_switch_led_disable_pins { + pinctrl-single,bits = <0x0 0x0 0xf8>; + }; + + clks_disable_pins: pinmux_clks_disable_pins { + pinctrl-single,bits = <0x0 0x0 0x81f00>; }; }; -- 2.22.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 2/5] ath79: WNR612v2: improve device support
This patch improves ath79 support for Netgear WNR612v2. Router functionality becomes identical to ar71xx version. Changes include: * software control over LAN LEDs via sysfs * correct MAC addresses for network interfaces * correct image size in device definition * formatting adjustments to source DT files Signed-off-by: Michal Cieslakiewicz --- .../ath79/dts/ar7240_netgear_wnr612-v2.dts| 2 +- .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 20 +-- target/linux/ath79/dts/ar7240_on_n150r.dts| 2 +- target/linux/ath79/image/tiny-netgear.mk | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts index b3ceecf932..e6e3e8b6da 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts @@ -4,7 +4,7 @@ #include "ar7240_netgear_wnr612-v2.dtsi" / { - model = "Netgear WNR612 v2"; compatible = "netgear,wnr612-v2", "qca,ar7240"; + model = "Netgear WNR612 v2"; }; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index 8e934429a3..ec4d5d710f 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -28,6 +28,10 @@ leds { compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + power: power { label = "netgear:green:power"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; @@ -47,6 +51,10 @@ label = "netgear:green:wan"; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; }; + }; + + ath9k-leds { + compatible = "gpio-leds"; wlan: wlan { label = "netgear:green:wlan"; @@ -70,7 +78,7 @@ #address-cells = <1>; #size-cells = <1>; - uboot: partition@0 { + partition@0 { reg = <0x0 0x4>; label = "u-boot"; read-only; @@ -87,7 +95,7 @@ label = "firmware"; }; - partition@3f { + art: partition@3f { reg = <0x3f 0x1>; label = "art"; read-only; @@ -99,15 +107,13 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + mtd-mac-address = <&art 0x0>; }; ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + mtd-mac-address = <&art 0x6>; }; &pcie { @@ -116,6 +122,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; diff --git a/target/linux/ath79/dts/ar7240_on_n150r.dts b/target/linux/ath79/dts/ar7240_on_n150r.dts index a318846a83..886ac6dad5 100644 --- a/target/linux/ath79/dts/ar7240_on_n150r.dts +++ b/target/linux/ath79/dts/ar7240_on_n150r.dts @@ -4,7 +4,7 @@ #include "ar7240_netgear_wnr612-v2.dtsi" / { - model = "ON Network N150R"; compatible = "on,n150r", "qca,ar7240"; + model = "ON Network N150R"; }; diff --git a/target/linux/ath79/image/tiny-netgear.mk b/target/linux/ath79/image/tiny-netgear.mk index 67ef28c9cc..2f17d79757 100644 --- a/target/linux/ath79/image/tiny-netgear.mk +++ b/target/linux/ath79/image/tiny-netgear.mk @@ -4,7 +4,7 @@ define Device/netgear_ar7240 ATH_SOC := ar7240 NETGEAR_KERNEL_MAGIC := 0x32303631 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma - IMAGE_SIZE := 3904k + IMAGE_SIZE := 3712k IMAGE/default := append-kernel | pad-to (BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs $(Device/netgear_ath79) endef -- 2.22.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 5/5] ath79: add support for Netgear WNR2200
This patch adds ath79 support for Netgear WNR2200. Router was previously supported by ar71xx target only. Specification = * Description: Netgear WNR2200 * Loader: U-boot * SOC: Atheros AR7241 (360 MHz) * RAM: 64 MiB * Flash: 8 MiB (SPI NOR) - U-boot binary: 256 KiB - U-boot environment: 64 KiB - Firmware: 7808 KiB - ART: 64 KiB * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN * Wireless: 2.4 GHz b/g/n (Atheros AR9287) * USB: yes, 1 x USB 2.0 * Buttons: - Reset - WiFi (rfkill) - WPS * LEDs: - Power (amber/green) - WAN (amber/green) - WLAN (blue) - 4 x LAN (amber/green) - WPS (green) * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1 * Power supply: DC 12V 1.5A * MAC addresses: LAN on case label, WAN +1, WLAN +2 Installation * TFTP recovery * TFTP via U-boot prompt * sysupgrade * Web interface Test build configuration CONFIG_TARGET_ath79=y CONFIG_TARGET_ath79_generic=y CONFIG_TARGET_ath79_generic_DEVICE_netgear_wnr2200=y CONFIG_ALL_KMODS=y CONFIG_DEVEL=y CONFIG_CCACHE=y CONFIG_COLLECT_KERNEL_DEBUG=y CONFIG_IMAGEOPT=y CONFIG_KERNEL_DEBUG_INFO=y CONFIG_KERNEL_DEBUG_KERNEL=y Signed-off-by: Michal Cieslakiewicz --- .../ath79/base-files/etc/board.d/01_leds | 3 +- .../ath79/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom| 1 + .../ath79/dts/ar7241_netgear_wnr2200.dts | 237 ++ target/linux/ath79/image/generic.mk | 14 ++ 5 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2200.dts diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index 7eca103a9e..82006efb6b 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -104,7 +104,8 @@ glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ;; netgear,wnr1000-v2|\ -netgear,wnr2000-v3) +netgear,wnr2000-v3|\ +netgear,wnr2200) ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0" ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04" diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index fe491d1c26..7d53f0a2fb 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -197,6 +197,7 @@ ath79_setup_interfaces() ;; netgear,wnr1000-v2|\ netgear,wnr2000-v3|\ + netgear,wnr2200|\ netgear,wnr612-v2|\ on,n150r|\ tplink,tl-wr740n-v1|\ diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index dbe53b6f64..044e6c0afd 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -167,6 +167,7 @@ case "$FIRMWARE" in ;; netgear,wnr1000-v2|\ netgear,wnr2000-v3|\ + netgear,wnr2200|\ netgear,wnr612-v2|\ on,n150r|\ pcs,cap324|\ diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dts new file mode 100644 index 00..9c439be6f8 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dts @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7241.dtsi" + +/ { + compatible = "netgear,wnr2200", "qca,ar7241"; + model = "Netgear WNR2200"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &power_amber; + led-failsafe = &power_amber; + led-running = &power_green; + led-upgrade = &power_amber; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + linux,code = ; + gpios = <&ath9k 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&ath9k 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&ath9k 3 GPI
[OpenWrt-Devel] [PATCH] tools/patch: apply upstream patch for cve-2019-13638
GNU patch through 2.7.6 is vulnerable to OS shell command injection that can be exploited by opening a crafted patch file that contains an ed style diff payload with shell metacharacters. The ed editor does not need to be present on the vulnerable system. This is different from CVE-2018-1000156. https://nvd.nist.gov/vuln/detail/CVE-2019-13638 Signed-off-by: Russell Senior --- tools/patch/Makefile | 2 +- tools/patch/patches/060-CVE-2019-13638.patch | 38 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 tools/patch/patches/060-CVE-2019-13638.patch diff --git a/tools/patch/Makefile b/tools/patch/Makefile index 3bcf668b04..e0481204f7 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=patch PKG_VERSION:=2.7.6 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_CPE_ID:=cpe:/a:gnu:patch PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/patch/patches/060-CVE-2019-13638.patch b/tools/patch/patches/060-CVE-2019-13638.patch new file mode 100644 index 00..38caff628a --- /dev/null +++ b/tools/patch/patches/060-CVE-2019-13638.patch @@ -0,0 +1,38 @@ +From 3fcd042d26d70856e826a42b5f93dc4854d80bf0 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Fri, 6 Apr 2018 19:36:15 +0200 +Subject: Invoke ed directly instead of using the shell + +* src/pch.c (do_ed_script): Invoke ed directly instead of using a shell +command to avoid quoting vulnerabilities. +--- + src/pch.c | 6 ++ + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/pch.c b/src/pch.c +index 4fd5a05..16e001a 100644 +--- a/src/pch.c b/src/pch.c +@@ -2459,9 +2459,6 @@ do_ed_script (char const *inname, char const *outname, + *outname_needs_removal = true; + copy_file (inname, outname, 0, exclusive, instat.st_mode, true); + } +- sprintf (buf, "%s %s%s", editor_program, +- verbosity == VERBOSE ? "" : "- ", +- outname); + fflush (stdout); + + pid = fork(); +@@ -2470,7 +2467,8 @@ do_ed_script (char const *inname, char const *outname, + else if (pid == 0) + { + dup2 (tmpfd, 0); +- execl ("/bin/sh", "sh", "-c", buf, (char *) 0); ++ assert (outname[0] != '!' && outname[0] != '-'); ++ execlp (editor_program, editor_program, "-", outname, (char *) NULL); + _exit (2); + } + else +-- +cgit v1.0-41-gc330 + -- 2.22.0 -- Russell Senior, President russ...@personaltelco.net ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] lantiq: unify Fritz!Box LED mappings
This commit unifies the LED mapping of the AVM Fritz!Box routers, which have a combined Power/DSL LED. With the stock firmware, the Power LED has the following characteristics: - Blink when DSL sync is being established - Solid when DSL sync is present We can't completely resemble this behavior in OpenWrt. Currently, the Power LED is completely off, when DSL sync is missing. This is not really helpful, as a user might have the impression, that he bricked his device. Instead, map the Info-LED to the state of the DSL connection. There is no consistent behavior for the Info-LED in the stock firmware, as the user can set it's function by himself. The DSL connection state is one possible option for the Info LED there. Also use the red Power LED to indicate a running upgrade, in case the board has a two-color Power LED. Signed-off-by: David Bauer --- .../linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi | 2 +- target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts | 3 +-- target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts | 3 +-- target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi| 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi index f23d2d2cf5..02e9589969 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi @@ -15,7 +15,7 @@ led-boot = &power_green; led-failsafe = &power_red; led-running = &power_green; - led-upgrade = &power_green; + led-upgrade = &power_red; led-dsl = &dsl; led-internet = &info_green; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts index 811f78f934..0190dd2f01 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts @@ -18,8 +18,7 @@ led-running = &power; led-upgrade = &power; - led-internet = &info_green; - led-dsl = &power; + led-dsl = &info_green; led-wifi = &wlan; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts index 40348b1d59..6c0dad873f 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts @@ -18,8 +18,7 @@ led-running = &power; led-upgrade = &power; - led-internet = &info_green; - led-dsl = &power; + led-dsl = &info_green; led-wifi = &wlan; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi index 82546a3572..57033eb4a9 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi @@ -17,7 +17,8 @@ led-boot = &power_green; led-failsafe = &power_red; led-running = &power_green; - led-upgrade = &power_green; + led-upgrade = &power_red; + led-dsl = &info_green; led-wifi = &wifi; }; -- 2.20.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [sdwalker/sdwalker.github.io] 75e9cb: This week's update
Branch: refs/heads/master Home: https://github.com/sdwalker/sdwalker.github.io Commit: 75e9cb4d27fc659d27ccfa6f47f802dd922a0552 https://github.com/sdwalker/sdwalker.github.io/commit/75e9cb4d27fc659d27ccfa6f47f802dd922a0552 Author: Stephen Walker Date: 2019-08-11 (Sun, 11 Aug 2019) Changed paths: M uscan/index-18.06.html M uscan/index.html Log Message: --- This week's update ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel