Bug#783846: Patch to enable LEDs on sunix/Cubietruck
Today I tested U-Boot 2016.09 on a Cubietruck running Debian Jessie. The GPIO interface is working fine now. For example, the command gpio set PH20 switches on the orange LED, which solves my problem. Thank you for the help. Gundolf Kiefer On Sun, 1 May 2016 12:54:49 -0600 Simon Glasswrote: > Hi, > > On 25 April 2016 at 03:18, Prof. Dr. Gundolf Kiefer > wrote: > > On Mon, 25 Apr 2016 08:54:35 +0200 > > Hans de Goede wrote: > > > >> Hi, > >> > >> On 23-04-16 20:09, Prof. Dr. Gundolf Kiefer wrote: > >> > I would like to pass this question upstream. As what I can see from the > >> > code (arch/arm/dts/sun7i-a20-cubietruck.dts, > >> > configs/Cubietruck_defconfig), something actually has happened towards > >> > supporting GPIOs/LEDs for that board. > >> > > >> > Can somebody from the u-boot upstream team comment on this? Are LEDs > >> > supported now on the Cubietruck? Is additional testing required? > >> > >> The cubietruck leds are supported in the kernel. unxi u-boot does not > >> have LED support for any boards. > >> > >> And TBH I don't really see much use in LED support in u-boot. > > > > The reason why I needed LED support in u-boot was to give the user a > > sufficiently quick visible feedback when the device is switched on, > > i.e. a software-controlled power-on indicator. If the LEDs can only be > > controlled by the kernel, it may take seconds during which the user of > > has no chance to see if the device actually has power or not. Perhaps > > for the same reason, the legacy u-boot-sunxi fork > > (http://linux-sunxi.org/) had LED support. > > > > I personally feel that the possibility to switch on LEDs before the > > kernel is booted is not just a useful, but an important feature. And I > > would regret seeing it disappear when moving from the legacy sunxi fork > > to mainline u-boot. > > > > But, of course, it is up to the developers and package maintainers to > > decide which features are intergrated and which are not. Feel free to > > decide if the patch I provided can improve the package or not. > > There is the LED_GPIO Kconfig option if you are using the normal > device tree binding for GPIOs. You can use led_get_by_label() to get > an LED by label. The fully API is in led.h. > > Regards, > Simon > > > > > Regards, > > > > Gundolf > > > >> > >> Regards, > >> > >> Hans > >> > >> > > >> > Regards, > >> > > >> > Gundolf Kiefer > >> > > >> > > >> > On Sat, 16 Apr 2016 14:55:54 -0700 > >> > Vagrant Cascadian wrote: > >> > > >> >> Control: tags 783846 moreinfo upstream > >> >> Control: forwarded 783846 > >> >> http://lists.denx.de/pipermail/u-boot/2015-May/214036.html > >> >> Control: found 783846 2014.10+dfsg1-5 > >> >> > >> >> On 2015-05-05, Vagrant Cascadian wrote: > >> >>> On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: > >> It seems that the support for the onboard leds is missing for > >> sunxi-based boards even in the latest version (Debian unstable). IMHO > >> LEDs are very helpful for headless systems. > >> >>> > >> >>> Thanks for the patches! > >> >>> > >> >>> If you could submit these patches to u-boot upstream, that would be > >> >>> best; we're trying to minimize the patches that are not already > >> >>> included > >> >>> upstream. > >> >> > >> >> It looks like you attempted to get these upstream, though it doesn't > >> >> sound like they were accepted at the time. Is the bug still present in > >> >> current versions of u-boot (2016.03+ in Debian)? > >> >> > >> >> Thanks! > >> >> > >> >> live well, > >> >>vagrant > >> > > > > > > > > > > > --- > > Prof. Dr. Gundolf Kiefer > > Effiziente Eingebettete Systeme - Efficient Embedded Systems > > Fakultät für Informatik - Faculty of Computer Science > > Hochschule Augsburg - University of Applied Sciences > > http://ees.hs-augsburg.de > > --- --- Prof. Dr. Gundolf Kiefer Effiziente Eingebettete Systeme - Efficient Embedded Systems Fakultät für Informatik - Faculty of Computer Science Hochschule Augsburg - University of Applied Sciences http://ees.hs-augsburg.de ---
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
Hi, On 25 April 2016 at 03:18, Prof. Dr. Gundolf Kieferwrote: > On Mon, 25 Apr 2016 08:54:35 +0200 > Hans de Goede wrote: > >> Hi, >> >> On 23-04-16 20:09, Prof. Dr. Gundolf Kiefer wrote: >> > I would like to pass this question upstream. As what I can see from the >> > code (arch/arm/dts/sun7i-a20-cubietruck.dts, >> > configs/Cubietruck_defconfig), something actually has happened towards >> > supporting GPIOs/LEDs for that board. >> > >> > Can somebody from the u-boot upstream team comment on this? Are LEDs >> > supported now on the Cubietruck? Is additional testing required? >> >> The cubietruck leds are supported in the kernel. unxi u-boot does not >> have LED support for any boards. >> >> And TBH I don't really see much use in LED support in u-boot. > > The reason why I needed LED support in u-boot was to give the user a > sufficiently quick visible feedback when the device is switched on, > i.e. a software-controlled power-on indicator. If the LEDs can only be > controlled by the kernel, it may take seconds during which the user of > has no chance to see if the device actually has power or not. Perhaps > for the same reason, the legacy u-boot-sunxi fork > (http://linux-sunxi.org/) had LED support. > > I personally feel that the possibility to switch on LEDs before the > kernel is booted is not just a useful, but an important feature. And I > would regret seeing it disappear when moving from the legacy sunxi fork > to mainline u-boot. > > But, of course, it is up to the developers and package maintainers to > decide which features are intergrated and which are not. Feel free to > decide if the patch I provided can improve the package or not. There is the LED_GPIO Kconfig option if you are using the normal device tree binding for GPIOs. You can use led_get_by_label() to get an LED by label. The fully API is in led.h. Regards, Simon > > Regards, > > Gundolf > >> >> Regards, >> >> Hans >> >> > >> > Regards, >> > >> > Gundolf Kiefer >> > >> > >> > On Sat, 16 Apr 2016 14:55:54 -0700 >> > Vagrant Cascadian wrote: >> > >> >> Control: tags 783846 moreinfo upstream >> >> Control: forwarded 783846 >> >> http://lists.denx.de/pipermail/u-boot/2015-May/214036.html >> >> Control: found 783846 2014.10+dfsg1-5 >> >> >> >> On 2015-05-05, Vagrant Cascadian wrote: >> >>> On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: >> It seems that the support for the onboard leds is missing for >> sunxi-based boards even in the latest version (Debian unstable). IMHO >> LEDs are very helpful for headless systems. >> >>> >> >>> Thanks for the patches! >> >>> >> >>> If you could submit these patches to u-boot upstream, that would be >> >>> best; we're trying to minimize the patches that are not already included >> >>> upstream. >> >> >> >> It looks like you attempted to get these upstream, though it doesn't >> >> sound like they were accepted at the time. Is the bug still present in >> >> current versions of u-boot (2016.03+ in Debian)? >> >> >> >> Thanks! >> >> >> >> live well, >> >>vagrant >> > > > > > > --- > Prof. Dr. Gundolf Kiefer > Effiziente Eingebettete Systeme - Efficient Embedded Systems > Fakultät für Informatik - Faculty of Computer Science > Hochschule Augsburg - University of Applied Sciences > http://ees.hs-augsburg.de > ---
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
On Mon, 25 Apr 2016 08:54:35 +0200 Hans de Goedewrote: > Hi, > > On 23-04-16 20:09, Prof. Dr. Gundolf Kiefer wrote: > > I would like to pass this question upstream. As what I can see from the > > code (arch/arm/dts/sun7i-a20-cubietruck.dts, > > configs/Cubietruck_defconfig), something actually has happened towards > > supporting GPIOs/LEDs for that board. > > > > Can somebody from the u-boot upstream team comment on this? Are LEDs > > supported now on the Cubietruck? Is additional testing required? > > The cubietruck leds are supported in the kernel. unxi u-boot does not > have LED support for any boards. > > And TBH I don't really see much use in LED support in u-boot. The reason why I needed LED support in u-boot was to give the user a sufficiently quick visible feedback when the device is switched on, i.e. a software-controlled power-on indicator. If the LEDs can only be controlled by the kernel, it may take seconds during which the user of has no chance to see if the device actually has power or not. Perhaps for the same reason, the legacy u-boot-sunxi fork (http://linux-sunxi.org/) had LED support. I personally feel that the possibility to switch on LEDs before the kernel is booted is not just a useful, but an important feature. And I would regret seeing it disappear when moving from the legacy sunxi fork to mainline u-boot. But, of course, it is up to the developers and package maintainers to decide which features are intergrated and which are not. Feel free to decide if the patch I provided can improve the package or not. Regards, Gundolf > > Regards, > > Hans > > > > > Regards, > > > > Gundolf Kiefer > > > > > > On Sat, 16 Apr 2016 14:55:54 -0700 > > Vagrant Cascadian wrote: > > > >> Control: tags 783846 moreinfo upstream > >> Control: forwarded 783846 > >> http://lists.denx.de/pipermail/u-boot/2015-May/214036.html > >> Control: found 783846 2014.10+dfsg1-5 > >> > >> On 2015-05-05, Vagrant Cascadian wrote: > >>> On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: > It seems that the support for the onboard leds is missing for > sunxi-based boards even in the latest version (Debian unstable). IMHO > LEDs are very helpful for headless systems. > >>> > >>> Thanks for the patches! > >>> > >>> If you could submit these patches to u-boot upstream, that would be > >>> best; we're trying to minimize the patches that are not already included > >>> upstream. > >> > >> It looks like you attempted to get these upstream, though it doesn't > >> sound like they were accepted at the time. Is the bug still present in > >> current versions of u-boot (2016.03+ in Debian)? > >> > >> Thanks! > >> > >> live well, > >>vagrant > > --- Prof. Dr. Gundolf Kiefer Effiziente Eingebettete Systeme - Efficient Embedded Systems Fakultät für Informatik - Faculty of Computer Science Hochschule Augsburg - University of Applied Sciences http://ees.hs-augsburg.de ---
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
Hi, On 23-04-16 20:09, Prof. Dr. Gundolf Kiefer wrote: I would like to pass this question upstream. As what I can see from the code (arch/arm/dts/sun7i-a20-cubietruck.dts, configs/Cubietruck_defconfig), something actually has happened towards supporting GPIOs/LEDs for that board. Can somebody from the u-boot upstream team comment on this? Are LEDs supported now on the Cubietruck? Is additional testing required? The cubietruck leds are supported in the kernel. unxi u-boot does not have LED support for any boards. And TBH I don't really see much use in LED support in u-boot. Regards, Hans Regards, Gundolf Kiefer On Sat, 16 Apr 2016 14:55:54 -0700 Vagrant Cascadianwrote: Control: tags 783846 moreinfo upstream Control: forwarded 783846 http://lists.denx.de/pipermail/u-boot/2015-May/214036.html Control: found 783846 2014.10+dfsg1-5 On 2015-05-05, Vagrant Cascadian wrote: On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: It seems that the support for the onboard leds is missing for sunxi-based boards even in the latest version (Debian unstable). IMHO LEDs are very helpful for headless systems. Thanks for the patches! If you could submit these patches to u-boot upstream, that would be best; we're trying to minimize the patches that are not already included upstream. It looks like you attempted to get these upstream, though it doesn't sound like they were accepted at the time. Is the bug still present in current versions of u-boot (2016.03+ in Debian)? Thanks! live well, vagrant
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
I would like to pass this question upstream. As what I can see from the code (arch/arm/dts/sun7i-a20-cubietruck.dts, configs/Cubietruck_defconfig), something actually has happened towards supporting GPIOs/LEDs for that board. Can somebody from the u-boot upstream team comment on this? Are LEDs supported now on the Cubietruck? Is additional testing required? Regards, Gundolf Kiefer On Sat, 16 Apr 2016 14:55:54 -0700 Vagrant Cascadianwrote: > Control: tags 783846 moreinfo upstream > Control: forwarded 783846 > http://lists.denx.de/pipermail/u-boot/2015-May/214036.html > Control: found 783846 2014.10+dfsg1-5 > > On 2015-05-05, Vagrant Cascadian wrote: > > On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: > >> It seems that the support for the onboard leds is missing for > >> sunxi-based boards even in the latest version (Debian unstable). IMHO > >> LEDs are very helpful for headless systems. > > > > Thanks for the patches! > > > > If you could submit these patches to u-boot upstream, that would be > > best; we're trying to minimize the patches that are not already included > > upstream. > > It looks like you attempted to get these upstream, though it doesn't > sound like they were accepted at the time. Is the bug still present in > current versions of u-boot (2016.03+ in Debian)? > > Thanks! > > live well, > vagrant
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
Control: tags 783846 moreinfo upstream Control: forwarded 783846 http://lists.denx.de/pipermail/u-boot/2015-May/214036.html Control: found 783846 2014.10+dfsg1-5 On 2015-05-05, Vagrant Cascadian wrote: > On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: >> It seems that the support for the onboard leds is missing for >> sunxi-based boards even in the latest version (Debian unstable). IMHO >> LEDs are very helpful for headless systems. > > Thanks for the patches! > > If you could submit these patches to u-boot upstream, that would be > best; we're trying to minimize the patches that are not already included > upstream. It looks like you attempted to get these upstream, though it doesn't sound like they were accepted at the time. Is the bug still present in current versions of u-boot (2016.03+ in Debian)? Thanks! live well, vagrant signature.asc Description: PGP signature
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
On 2015-04-30, Prof. Dr. Gundolf Kiefer wrote: It seems that the support for the onboard leds is missing for sunxi-based boards even in the latest version (Debian unstable). IMHO LEDs are very helpful for headless systems. Thanks for the patches! If you could submit these patches to u-boot upstream, that would be best; we're trying to minimize the patches that are not already included upstream. live well, vagrant signature.asc Description: PGP signature
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
Package: u-boot-sunxi Version: 2014.10+dfsg1-5 It seems that the support for the onboard leds is missing for sunxi-based boards even in the latest version (Debian unstable). IMHO LEDs are very helpful for headless systems. The following/attached patch adds LED support for the Cubietruck board. The code has basically been ported from the u-boot version maintained at linux-sunxi.org. As in the sunxi version, the blue led is switched on by default. --- u-boot-2014.10+dfsg1.orig/configs/Cubietruck_defconfig +++ u-boot-2014.10+dfsg1/configs/Cubietruck_defconfig @@ -1,5 +1,5 @@ CONFIG_SPL=y -CONFIG_SYS_EXTRA_OPTIONS=CUBIETRUCK,AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPH(12),USB_EHCI +CONFIG_SYS_EXTRA_OPTIONS=CUBIETRUCK,AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPH(12),USB_EHCI,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231 CONFIG_FDTFILE=sun7i-a20-cubietruck.dtb +S:CONFIG_ARM=y +S:CONFIG_TARGET_SUN7I=y --- u-boot-2014.10+dfsg1.orig/include/configs/sunxi-common.h +++ u-boot-2014.10+dfsg1/include/configs/sunxi-common.h @@ -252,4 +252,50 @@ #define CONFIG_EXTRA_ENV_SETTINGS #endif +/* Status LEDs [GK] */ + +#ifdef CONFIG_STATUSLED +#define STATUS_LED_BIT CONFIG_STATUSLED +#endif +#ifdef CONFIG_STATUSLED1 +#define STATUS_LED_BIT1 CONFIG_STATUSLED1 +#endif +#ifdef CONFIG_STATUSLED2 +#define STATUS_LED_BIT2 CONFIG_STATUSLED2 +#endif +#ifdef CONFIG_STATUSLED3 +#define STATUS_LED_BIT3 CONFIG_STATUSLED3 +#endif + +#ifndef CONFIG_SPL_BUILD +#ifdef STATUS_LED_BIT +#define CONFIG_GPIO_LED +#define CONFIG_STATUS_LED +#ifndef STATUS_LED_BOOT +#define STATUS_LED_BOOT 0 +#endif +#ifndef STATUS_LED_STATE +#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD 1 +#endif +#ifndef STATUS_LED_STATE1 +#define STATUS_LED_STATE1 STATUS_LED_OFF +#define STATUS_LED_PERIOD1 1 +#endif +#ifndef STATUS_LED_STATE2 +#define STATUS_LED_STATE2 STATUS_LED_OFF +#define STATUS_LED_PERIOD2 1 +#endif +#ifndef STATUS_LED_STATE3 +#define STATUS_LED_STATE3 STATUS_LED_OFF +#define STATUS_LED_PERIOD3 1 +#endif +#define CONFIG_BOARD_SPECIFIC_LED +#define CONFIG_CMD_LED +#endif +#endif + + + + #endif /* _SUNXI_COMMON_CONFIG_H */ enabled-LEDs-for-sunxiCubietruck Description: Binary data
Bug#783846: Patch to enable LEDs on sunix/Cubietruck
Hi Gundolf, cool, dass Du noch patches zu Debian einschickst :-) Ist ansonsten alles im grünen Bereich bei Euch? Wie planen gerade ein neues Haus, ansonsten gibt es hier nicht allzu viel Neues. Viele Grüße Rainer On Thursday 30 April 2015 18:47:50 you wrote: Package: u-boot-sunxi Version: 2014.10+dfsg1-5 It seems that the support for the onboard leds is missing for sunxi-based boards even in the latest version (Debian unstable). IMHO LEDs are very helpful for headless systems. The following/attached patch adds LED support for the Cubietruck board. The code has basically been ported from the u-boot version maintained at linux-sunxi.org. As in the sunxi version, the blue led is switched on by default. --- u-boot-2014.10+dfsg1.orig/configs/Cubietruck_defconfig +++ u-boot-2014.10+dfsg1/configs/Cubietruck_defconfig @@ -1,5 +1,5 @@ CONFIG_SPL=y - CONFIG_SYS_EXTRA_OPTIONS=CUBIETRUCK,AXP209_POWER,SUNXI_GMAC,RGMII,AH CI,SAT APWR=SUNXI_GPH(12),USB_EHCI +CONFIG_SYS_EXTRA_OPTIONS=CUBIETRUCK,AXP209_POWER,SUNXI_GMAC,RGMII,A HCI,SA TAPWR=SUNXI_GPH(12),USB_EHCI,STATUSLED=245,STATUSLED1=244,STATUSLED2 =235,STA TUSLED3=231 CONFIG_FDTFILE=sun7i-a20-cubietruck.dtb +S:CONFIG_ARM=y +S:CONFIG_TARGET_SUN7I=y --- u-boot-2014.10+dfsg1.orig/include/configs/sunxi-common.h +++ u-boot-2014.10+dfsg1/include/configs/sunxi-common.h @@ -252,4 +252,50 @@ #define CONFIG_EXTRA_ENV_SETTINGS #endif +/* Status LEDs [GK] */ + +#ifdef CONFIG_STATUSLED +#define STATUS_LED_BIT CONFIG_STATUSLED +#endif +#ifdef CONFIG_STATUSLED1 +#define STATUS_LED_BIT1 CONFIG_STATUSLED1 +#endif +#ifdef CONFIG_STATUSLED2 +#define STATUS_LED_BIT2 CONFIG_STATUSLED2 +#endif +#ifdef CONFIG_STATUSLED3 +#define STATUS_LED_BIT3 CONFIG_STATUSLED3 +#endif + +#ifndef CONFIG_SPL_BUILD +#ifdef STATUS_LED_BIT +#define CONFIG_GPIO_LED +#define CONFIG_STATUS_LED +#ifndef STATUS_LED_BOOT +#define STATUS_LED_BOOT 0 +#endif +#ifndef STATUS_LED_STATE +#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD 1 +#endif +#ifndef STATUS_LED_STATE1 +#define STATUS_LED_STATE1 STATUS_LED_OFF +#define STATUS_LED_PERIOD1 1 +#endif +#ifndef STATUS_LED_STATE2 +#define STATUS_LED_STATE2 STATUS_LED_OFF +#define STATUS_LED_PERIOD2 1 +#endif +#ifndef STATUS_LED_STATE3 +#define STATUS_LED_STATE3 STATUS_LED_OFF +#define STATUS_LED_PERIOD3 1 +#endif +#define CONFIG_BOARD_SPECIFIC_LED +#define CONFIG_CMD_LED +#endif +#endif + + + + #endif /* _SUNXI_COMMON_CONFIG_H */ -- Rainer Dorsch Lärchenstr. 6 72135 Dettenhausen 07157/734133