Skip to contentSkip to conversation

Support for LEGO MINDSTORTMS EV3

PATCH Applied David Lechner 4 participants 27 messages Oct 21, 2016 – Oct 28, 2016

Subsystems (3)

v1 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Support for LEGO MINDSTORTMS EV3

This patch series adds support for LEGO MINDSTORTMS EV3[1]. This is a TI AM1808 based board.

This patch series has been tested working (along with some hacks to fix the GPIOs) on an EV3.

There are still quite a few additional new drivers that need to be submitted to get everything working. This patch series just adds support for the parts that already have mainline kernel drivers.

I have a plan/driver in progress for many of the components[2], but I could use some advice on a few particulars.

Bluetooth: This needs a driver to sequence a GPIO to take the Bluetooth chip out of shutdown *after* the Bluetooth clock has been configured and started. Is there a generic driver that can do this sort of thing? Or, if not, which subsystem should the new driver go in?

Input and output ports: These ports are capable of hotplugging various devices, such as sensors and motors. I have written a driver for these that can detect most devices. I created a new subsystem for this called lego-port. However, I am wondering if the existing phy or extcon subsystems might be a good fit for this sort of thing.

[1]: http://mindstorms.lego.com
[2]: https://github.com/ev3dev/lego-linux-drivers/tree/master/evb

David Lechner (5):
ARM: davinci: Compile MMC in kernel
ARM: davinci: Don't append git rev to local version
ARM: davinci: enable gpio poweroff in default config
ARM: davinci: enable LEDs default-on trigger in default config
ARM: dts: Add LEGO MINDSTORTMS EV3 dts

 arch/arm/boot/dts/Makefile             |   3 +-
 arch/arm/boot/dts/lego-ev3.dts         | 454 +++++++++++++++++++++++++++++++++
 arch/arm/configs/davinci_all_defconfig |   8 +-
 3 files changed, 462 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/boot/dts/lego-ev3.dts
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 ARM: davinci: Compile MMC in kernel

This changes the davinci default configuration to compile the davinci MMC driver into the kernel. This allows booting from an SD card without requiring an initrd containing the kernel module.

---
 arch/arm/configs/davinci_all_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/configs/davinci_all_defconfig +2 -2
index 58d04f1..a2f89a3 100644
@@ -169,9 +169,9 @@ CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_USB_G_PRINTER=m
 CONFIG_USB_CDC_COMPOSITE=m
-CONFIG_MMC=m
+CONFIG_MMC=y
 # CONFIG_MMC_BLOCK_BOUNCE is not set
-CONFIG_MMC_DAVINCI=m
+CONFIG_MMC_DAVINCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=m
 CONFIG_LEDS_GPIO=m
Signature · 1 line
2.7.4
#3 lore raw

PATCH 2/5 ARM: davinci: Don't append git rev to local version

In reply to David Lechner

In the davinci default configuration, don't append the git revision to the local kernel version by. This seems like the more desirable default value.

---
 arch/arm/configs/davinci_all_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/davinci_all_defconfig +1 -0
index a2f89a3..9254609 100644
@@ -1,3 +1,4 @@
+# CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
Signature · 1 line
2.7.4
#8 lore raw

PATCH 3/5 ARM: davinci: enable gpio poweroff in default config

In reply to David Lechner

The gpio-poweroff driver is needed by LEGO MINDSTORMS EV3 (AM1808 based board).

---
 arch/arm/configs/davinci_all_defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/configs/davinci_all_defconfig +2 -0
index 9254609..9d7f0bc 100644
@@ -117,6 +117,8 @@ CONFIG_SPI_DAVINCI=m
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_PCA953X=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_GPIO=y
 CONFIG_WATCHDOG=y
 CONFIG_DAVINCI_WATCHDOG=m
 CONFIG_MFD_DM355EVM_MSP=y
Signature · 1 line
2.7.4
#10 lore raw

PATCH 4/5 ARM: davinci: enable LEDs default-on trigger in default config

In reply to David Lechner

The LEDs default-on trigger is nice to have. For example, it can be used to configure a LED as a power indicator.

---
 arch/arm/configs/davinci_all_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/davinci_all_defconfig +1 -0
index 9d7f0bc..e380743 100644
@@ -181,6 +181,7 @@ CONFIG_LEDS_GPIO=m
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_OMAP=m
 CONFIG_DMADEVICES=y
Signature · 1 line
2.7.4
#14 lore raw

PATCH 5/5 ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

What is partially working:

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix
* Flash memory - driver loads but can't read the block devices - this is probably due to the fact that we are not able to configure the SPI to use DMA via device tree
* EEPROM - there seems to be a hardware bug that causes the first byte read to be corrupted - this can be worked around by adding an I2C stop between writing the register and reading the data, but the at24 driver does not have an option to do this

What is not working/to be added later:

* Display - waiting for "tiny DRM" to be mainlined
* Speaker - needs new PWM sound driver
* USB - waiting for OHCI and MUSB device tree support to be mainlined
* ADC - needs new iio driver
* GPIOs - broken because of recent changes to core gpio driver
* Bluetooth - needs new driver for sequencing power/enable/clock
* Input and output ports - need some sort of new phy or extcon driver
* Battery - needs new power supply driver (depends on ADC iio driver)

---
 arch/arm/boot/dts/Makefile     |   3 +-
 arch/arm/boot/dts/lego-ev3.dts | 454 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 456 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/lego-ev3.dts
arch/arm/boot/dts/Makefile +2 -1
index f80f5b7..5f91c1a 100644
@@ -116,7 +116,8 @@ dtb-$(CONFIG_ARCH_CLPS711X) += \
 dtb-$(CONFIG_ARCH_DAVINCI) += \
 	da850-lcdk.dtb \
 	da850-enbw-cmc.dtb \
-	da850-evm.dtb
+	da850-evm.dtb \
+	lego-ev3.dtb
 dtb-$(CONFIG_ARCH_DIGICOLOR) += \
 	cx92755_equinox.dtb
 dtb-$(CONFIG_ARCH_EFM32) += \
arch/arm/boot/dts/lego-ev3.dts new file +454 -0

454 lines not on this page · raw message

Signature · 1 line
2.7.4
#26 lore raw
In reply to David Lechner
Quoted 18 lines · David Lechner

This patch series adds support for LEGO MINDSTORTMS EV3[1]. This is a TI AM1808 based board.

This patch series has been tested working (along with some hacks to fix the GPIOs) on an EV3.

There are still quite a few additional new drivers that need to be submitted to get everything working. This patch series just adds support for the parts that already have mainline kernel drivers.

I have a plan/driver in progress for many of the components[2], but I could use some advice on a few particulars.

Bluetooth: This needs a driver to sequence a GPIO to take the Bluetooth chip out of shutdown *after* the Bluetooth clock has been configured and started. Is there a generic driver that can do this sort of thing? Or, if not, which subsystem should the new driver go in?

Quoted 5 lines

Input and output ports: These ports are capable of hotplugging various devices, such as sensors and motors. I have written a driver for these that can detect most devices. I created a new subsystem for this called lego-port. However, I am wondering if the existing phy or extcon subsystems might be a good fit for this sort of thing.

Both this cover and patch 5/5 has MINDSTORTMS instead of MINDSTORMS in a few places (including the subject line).

Signature · 1 line
Len Sorensen
#15 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner
Quoted 32 lines · David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

What is partially working:

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix
* Flash memory - driver loads but can't read the block devices - this is probably due to the fact that we are not able to configure the SPI to use DMA via device tree
* EEPROM - there seems to be a hardware bug that causes the first byte read to be corrupted - this can be worked around by adding an I2C stop between writing the register and reading the data, but the at24 driver does not have an option to do this

What is not working/to be added later:

* Display - waiting for "tiny DRM" to be mainlined
* Speaker - needs new PWM sound driver
* USB - waiting for OHCI and MUSB device tree support to be mainlined
* ADC - needs new iio driver
* GPIOs - broken because of recent changes to core gpio driver
* Bluetooth - needs new driver for sequencing power/enable/clock
* Input and output ports - need some sort of new phy or extcon driver
* Battery - needs new power supply driver (depends on ADC iio driver)

Quoted 4 lines
---
 arch/arm/boot/dts/Makefile     |   3 +-
 arch/arm/boot/dts/lego-ev3.dts | 454 +++++++++++++++++++++++++++++++++++++++++

nit: can you name this da850-lego-ev3.dts

Though it's not very strictly enforced, we *try* to use the form <soc>-<board>.dts.

Kevin

#4 lore raw

Re: [PATCH 2/5] ARM: davinci: Don't append git rev to local version

In reply to David Lechner
Quoted 3 lines · David Lechner

In the davinci default configuration, don't append the git revision to the local kernel version by. This seems like the more desirable default value.

Why? To the contrary I actually quite like the fact that the git commit is appended to version string. Makes it easy for me to cross-check that I am booting the right image.

Quoted 2 lines

Thanks,
Sekhar

#16 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner
Quoted 1 line · David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

Thanks for the patch!

Quoted 7 lines

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

Quoted 5 lines

What is partially working:

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix

Is the GPIO fix something that will go in v4.9-rc cycle ?

Quoted 3 lines

* Flash memory - driver loads but can't read the block devices - this is probably due to the fact that we are not able to configure the SPI to use DMA via device tree

Hmm, I would not have expected PIO mode to be so inefficient that you are unable to even read the block device.

Quoted 82 lines

* EEPROM - there seems to be a hardware bug that causes the first byte read to be corrupted - this can be worked around by adding an I2C stop between writing the register and reading the data, but the at24 driver does not have an option to do this

What is not working/to be added later:

* Display - waiting for "tiny DRM" to be mainlined
* Speaker - needs new PWM sound driver
* USB - waiting for OHCI and MUSB device tree support to be mainlined
* ADC - needs new iio driver
* GPIOs - broken because of recent changes to core gpio driver
* Bluetooth - needs new driver for sequencing power/enable/clock
* Input and output ports - need some sort of new phy or extcon driver
* Battery - needs new power supply driver (depends on ADC iio driver)

---
 arch/arm/boot/dts/Makefile     |   3 +-
 arch/arm/boot/dts/lego-ev3.dts | 454 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 456 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/lego-ev3.dts
arch/arm/boot/dts/Makefile +2 -1
index f80f5b7..5f91c1a 100644
@@ -116,7 +116,8 @@ dtb-$(CONFIG_ARCH_CLPS711X) += \
 dtb-$(CONFIG_ARCH_DAVINCI) += \
 	da850-lcdk.dtb \
 	da850-enbw-cmc.dtb \
-	da850-evm.dtb
+	da850-evm.dtb \
+	lego-ev3.dtb
 dtb-$(CONFIG_ARCH_DIGICOLOR) += \
 	cx92755_equinox.dtb
 dtb-$(CONFIG_ARCH_EFM32) += \
arch/arm/boot/dts/lego-ev3.dts new file +39 -0
new file mode 100644
index 0000000..a6b4c7d
@@ -0,0 +1,454 @@
+/*
+ * Device tree for LEGO MINDSTORMS EV3
+ *
+ * Copyright (C) 2016 David Lechner <[email protected]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation, version 2.
+ */
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/pwm/pwm.h>
+
+#include "da850.dtsi"
+
+/ {
+	compatible = "lego,ev3", "ti,da850";
+	model = "LEGO MINDSTORMS EV3";
+
+	soc at 1c00000 {
+		/*
+		 * (ab)using pinctrl-single to disable all internal pullups/
+		 * pulldowns on I/O.
+		 */
+		pinmux at 22c00c {
+			compatible = "pinctrl-single";
+			reg = <0x22c00c 0x4>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			pinctrl-single,bit-per-mux;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0xf>;
+			/*
+			 * There is a bug in pinctrl-single that prevents us
+			 * from setting function-mask to 1, so doing things
+			 * in groups of 4. Doesn't really matter since we are
+			 * disabling all at once anyway.

arch/arm/boot/dts/lego-ev3.dts line 49

Quoted 10 lines
arch/arm/boot/dts/lego-ev3.dts new file +10 -0
+			 */
+
+			pinctrl-names = "default";
+			pinctrl-0 = <&pupu_disable>;
+
+			pupu_disable: pinmux_all_pins {
+				pinctrl-single,bits = <
+					0x0 0x00000000 0xffffffff
+				>;
+			};

Sigh. This is quite an abuse :)

I know we don't have a good way to configure this in kernel today. And I am surprised we never had to care about disabling pullups so far. Can you clarify why you need it? I assume there is some contention you want to avoid, but on which interface?

I dont think this can be done this way using pinctrl-single. A small driver to handle pullup/down control for da850 may have to be added to drivers/pinctrl. It will be better to check with Linus Walleij on his thoughts using a new thread ccing the pinctrl subsystem list as well.

[...]

arch/arm/boot/dts/lego-ev3.dts line 207

Quoted 12 lines
arch/arm/boot/dts/lego-ev3.dts new file +12 -0
+	in1_pins: pinmux_in1_pins {
+		pinctrl-single,bits = <
+			/* GP0[15] */
+			0x0 0x00000008 0x0000000f
+			/* GP0[2] */
+			0x4 0x00800000 0x00f00000
+			/* GP2[2] */
+			0x18 0x00800000 0x00f00000
+			/* GP8[10], GP8[11] */
+			0x48 0x88000000 0xff000000
+		>;
+	};

I see that this is not really used. Can you add these when you actually use them. Looks like that applies to some other definitions like this below.

arch/arm/boot/dts/lego-ev3.dts line 63

Quoted 2 lines
arch/arm/boot/dts/lego-ev3.dts new file +2 -0
+&ehrpwm1 {
+	status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

arch/arm/boot/dts/lego-ev3.dts line 387

Quoted 7 lines
arch/arm/boot/dts/lego-ev3.dts new file +7 -0
+	pinctrl-names = "default";
+	/* MBPWM, MAPWM */
+	pinctrl-0 = <&ehrpwm1a_pins>, <&ehrpwm1b_pins>;
+};
+
+&ecap1 {
+	status = "disabled";

same here and other places below.

Quoted 13 lines
arch/arm/boot/dts/lego-ev3.dts new file +13 -0
+	pinctrl-names = "default";
+	/* MDPWM */
+	pinctrl-0 = <&ecap1_pins>;
+};
+
+&spi0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>, <&spi0_cs3_pin>;
+	dmas = <&edma0 14 0>, <&edma0 15 0>;
+	dma-names = "rx", "tx";
+
+	spi-flash at 0 {

arch/arm/boot/dts/lego-ev3.dts line 417

Quoted 10 lines
arch/arm/boot/dts/lego-ev3.dts new file +10 -0
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "n25q128a13", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+		ti,spi-wdelay = <8>;
+
+		partition at 0 {
+			label = "U-Boot";
+			reg = <0 0x40000>;

Thats 256KB for U-Boot and MLO (I assume in concatenated AIS image). Is that sufficient for future too? Moving partitions later is tough ask because that means users will lose data when they upgrade the kernel because of partitions moving around. Just a suggestion to keep future U-Boot bloat in mind and not use a "just fits" number.

Quoted 14 lines
arch/arm/boot/dts/lego-ev3.dts new file +14 -0
+		};
+
+		partition at 40000 {
+			label = "U-Boot Env";
+			reg = <0x40000 0x10000>;
+		};
+
+		partition at 50000 {
+			label = "Kernel";
+			reg = <0x50000 0x200000>;
+		};
+
+		partition at 250000 {
+			label = "Filesystem";

arch/arm/boot/dts/lego-ev3.dts line 441

Quoted 10 lines
arch/arm/boot/dts/lego-ev3.dts new file +10 -0
+			reg = <0x250000 0xa50000>;
+		};
+
+		partition at cb0000 {
+			label = "Storage";
+			reg = <0xcb0000 0x2f0000>;
+		};
+	};
+
+	/* TODO: ADC goes here */

I would drop this comment.

arch/arm/boot/dts/lego-ev3.dts line 449

Quoted 8 lines
arch/arm/boot/dts/lego-ev3.dts new file +8 -0
+};
+
+&spi1 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi1_pins>, <&spi1_cs0_pin>;
+
+	/* TODO: LCD Display goes here */

Add this node when you actually have display working.

Thanks,
Sekhar

#5 lore raw

Re: [PATCH 2/5] ARM: davinci: Don't append git rev to local version

In reply to Sekhar Nori
Quoted 10 lines · Sekhar Nori
Quoted 3 lines · David Lechner

In the davinci default configuration, don't append the git revision to the local kernel version by. This seems like the more desirable default value.

Why? To the contrary I actually quite like the fact that the git commit is appended to version string. Makes it easy for me to cross-check that I am booting the right image.

Quoted 1 line
Quoted 5 lines
Quoted 1 line

Thanks,
Sekhar

Each time you make a commit, you get a new version, which installs another copy of the kernel modules on the device. This will fill up the SD card if you are making many commits.

Also, if someone wants to build the mainline kernel using the default configuration, it seems odd to have a git revision tacked on to the end even though you made no revisions.

#17 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to Sekhar Nori
Quoted 12 lines · Sekhar Nori
Quoted 1 line · David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

Thanks for the patch!

Quoted 7 lines

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

Quoted 7 lines
Quoted 5 lines

What is partially working:

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix

Is the GPIO fix something that will go in v4.9-rc cycle ?

Not sure. This is still being discussed.

http://www.gossamer-threads.com/lists/linux/kernel/2550178

Quoted 7 lines
Quoted 4 lines

* Flash memory - driver loads but can't read the block devices - this is probably due to the fact that we are not able to configure the SPI to use DMA via device tree

Hmm, I would not have expected PIO mode to be so inefficient that you are unable to even read the block device.

I am getting a -EIO error. I haven't been able to trace down exactly what is causing it yet though.

Quoted 1 line

...

Quoted 35 lines
Quoted 22 lines
arch/arm/boot/dts/lego-ev3.dts new file +22 -0
+/ {
+	compatible = "lego,ev3", "ti,da850";
+	model = "LEGO MINDSTORMS EV3";
+
+	soc at 1c00000 {
+		/*
+		 * (ab)using pinctrl-single to disable all internal pullups/
+		 * pulldowns on I/O.
+		 */
+		pinmux at 22c00c {
+			compatible = "pinctrl-single";
+			reg = <0x22c00c 0x4>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			pinctrl-single,bit-per-mux;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0xf>;
+			/*
+			 * There is a bug in pinctrl-single that prevents us
+			 * from setting function-mask to 1, so doing things
+			 * in groups of 4. Doesn't really matter since we are
+			 * disabling all at once anyway.

arch/arm/boot/dts/lego-ev3.dts line 49

Quoted 10 lines
arch/arm/boot/dts/lego-ev3.dts new file +10 -0
+			 */
+
+			pinctrl-names = "default";
+			pinctrl-0 = <&pupu_disable>;
+
+			pupu_disable: pinmux_all_pins {
+				pinctrl-single,bits = <
+					0x0 0x00000000 0xffffffff
+				>;
+			};

Sigh. This is quite an abuse :)

Quoted 4 lines

I know we don't have a good way to configure this in kernel today. And I am surprised we never had to care about disabling pullups so far. Can you clarify why you need it? I assume there is some contention you want to avoid, but on which interface?

The EV3 was designed with external pullup/pulldown everywhere. I know for certain that it breaks one of the buttons if you do not disable the internal ones. I imagine that it would have subtle effects elsewhere if they are not disabled.

I have not gone through each pullup/pulldown bank individually, but it would not surprise me at all if there was at least one thing on most of them that would be adversely affected.

Quoted 5 lines

I dont think this can be done this way using pinctrl-single. A small driver to handle pullup/down control for da850 may have to be added to drivers/pinctrl. It will be better to check with Linus Walleij on his thoughts using a new thread ccing the pinctrl subsystem list as well.

I will be glad to try to make a driver, but when I ran into this problem I could not find much information on how to handle banks of pullup/pulldown. Most of what I saw was for ones that can be individually controlled. If anyone knows something like this already that I could look at, it would be helpful to me.

Quoted 17 lines

[...]

arch/arm/boot/dts/lego-ev3.dts line 207

Quoted 12 lines
arch/arm/boot/dts/lego-ev3.dts new file +12 -0
+	in1_pins: pinmux_in1_pins {
+		pinctrl-single,bits = <
+			/* GP0[15] */
+			0x0 0x00000008 0x0000000f
+			/* GP0[2] */
+			0x4 0x00800000 0x00f00000
+			/* GP2[2] */
+			0x18 0x00800000 0x00f00000
+			/* GP8[10], GP8[11] */
+			0x48 0x88000000 0xff000000
+		>;
+	};

I see that this is not really used. Can you add these when you actually use them. Looks like that applies to some other definitions like this below.

It will be possible to uses these gpios via sysfs (until a proper driver for input and output ports is merged). So how about I attach these to the gpio node for now?

Quoted 5 lines

Review

Quoted 3 lines

+&ehrpwm1 {

(quoted diff) +1 -0
+	status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

Not sure why I have this disabled. Like the gpios, the pwms can be used via sysfs, so I would like to leave them.

Quoted 32 lines

arch/arm/boot/dts/lego-ev3.dts line 387

Quoted 8 lines
arch/arm/boot/dts/lego-ev3.dts new file +7 -0
+	pinctrl-names = "default";
+	/* MBPWM, MAPWM */
+	pinctrl-0 = <&ehrpwm1a_pins>, <&ehrpwm1b_pins>;
+};
+
+&ecap1 {
+	status = "disabled";

same here and other places below.

Quoted 21 lines
arch/arm/boot/dts/lego-ev3.dts new file +21 -0
+	pinctrl-names = "default";
+	/* MDPWM */
+	pinctrl-0 = <&ecap1_pins>;
+};
+
+&spi0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>, <&spi0_cs3_pin>;
+	dmas = <&edma0 14 0>, <&edma0 15 0>;
+	dma-names = "rx", "tx";
+
+	spi-flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "n25q128a13", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+		ti,spi-wdelay = <8>;
+
+		partition at 0 {
Quoted 8 lines

arch/arm/boot/dts/lego-ev3.dts line 417

Quoted 2 lines
arch/arm/boot/dts/lego-ev3.dts new file +2 -0
+			label = "U-Boot";
+			reg = <0 0x40000>;

Thats 256KB for U-Boot and MLO (I assume in concatenated AIS image). Is that sufficient for future too? Moving partitions later is tough ask because that means users will lose data when they upgrade the kernel because of partitions moving around. Just a suggestion to keep future U-Boot bloat in mind and not use a "just fits" number.

The MLO is on an EEPROM in the EV3, so the U-Boot partition is just U-boot. The SoC boots from I2C, which then runs whatever is as 0x0 on the flash memory.

This partition table matches the partition scheme used on the official LEGO firmware that ships with the devices. Most people running their own kernel will probably be loading it from a microSD card, leaving the official firmware intact and therefore will always have this partition table.

My thinking is that if someone does want to use a different partitioning scheme, they can build their own U-Boot and configure it to modify the device tree with a new partition table.

The way the LEGO firmware flashing utility works, it wipes out the entire flash memory each time you flash the firmware. So, data loss is not a concern - you will loose your data anyway.

Quoted 19 lines
Quoted 19 lines
arch/arm/boot/dts/lego-ev3.dts new file +18 -0
+		};
+
+		partition at 40000 {
+			label = "U-Boot Env";
+			reg = <0x40000 0x10000>;
+		};
+
+		partition at 50000 {
+			label = "Kernel";
+			reg = <0x50000 0x200000>;
+		};
+
+		partition at 250000 {
+			label = "Filesystem";
+			reg = <0x250000 0xa50000>;
+		};
+
+		partition at cb0000 {
Quoted 8 lines

arch/arm/boot/dts/lego-ev3.dts line 441

Quoted 6 lines
arch/arm/boot/dts/lego-ev3.dts new file +6 -0
+			label = "Storage";
+			reg = <0xcb0000 0x2f0000>;
+		};
+	};
+
+	/* TODO: ADC goes here */

I would drop this comment.

ack

Quoted 11 lines

arch/arm/boot/dts/lego-ev3.dts line 449

Quoted 9 lines
arch/arm/boot/dts/lego-ev3.dts new file +8 -0
+};
+
+&spi1 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi1_pins>, <&spi1_cs0_pin>;
+
+	/* TODO: LCD Display goes here */

Add this node when you actually have display working.

What if we set this up as a spidev node instead? This way the display could be used from userspace without a driver.

#18 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

Quoted 11 lines · David Lechner
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner

+&ehrpwm1 {
+ status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

Not sure why I have this disabled. Like the gpios, the pwms can be used via sysfs, so I would like to leave them.

Now I remember why these are disabled. The clock matching is broken. Only the first ehrpwm and the first ecap get clocks. The others fail.

I can change these to "okay". It will just result in a kernel error message until the clocks are fixed.

#19 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

Quoted 13 lines · David Lechner
Quoted 11 lines · David Lechner
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner

+&ehrpwm1 {
+ status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

Not sure why I have this disabled. Like the gpios, the pwms can be used via sysfs, so I would like to leave them.

Quoted 6 lines

Now I remember why these are disabled. The clock matching is broken. Only the first ehrpwm and the first ecap get clocks. The others fail.

I can change these to "okay". It will just result in a kernel error message until the clocks are fixed.

correction: it is not the clocks that are broken. it is the device names.

In arch/arm/mach-davinci/da8xx-dt.c, we have...

	OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
	OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL),
	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),

Which causes each device to have the same device node name. This causes sysfs errors because it is trying to register a second device at the same sysfs path.

If you change the names here, then the device do not work because the clock lookup fails.

#22 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner
Quoted 13 lines · David Lechner
Quoted 11 lines · Sekhar Nori

arch/arm/boot/dts/lego-ev3.dts line 449

Quoted 8 lines · David Lechner
arch/arm/boot/dts/lego-ev3.dts new file +8 -0
+};
+
+&spi1 {
+    status = "okay";
+    pinctrl-names = "default";
+    pinctrl-0 = <&spi1_pins>, <&spi1_cs0_pin>;
+
+    /* TODO: LCD Display goes here */

Add this node when you actually have display working.

Quoted 3 lines

What if we set this up as a spidev node instead? This way the display could be used from userspace without a driver.

To answer my own question, it seems that specifying "spidev" in devicetree is frowned upon since it does not "describe the hardware".

#20 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner
Quoted 33 lines · David Lechner
Quoted 13 lines · David Lechner
Quoted 11 lines · David Lechner
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner

+&ehrpwm1 {
+ status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

Not sure why I have this disabled. Like the gpios, the pwms can be used via sysfs, so I would like to leave them.

Quoted 6 lines

Now I remember why these are disabled. The clock matching is broken. Only the first ehrpwm and the first ecap get clocks. The others fail.

I can change these to "okay". It will just result in a kernel error message until the clocks are fixed.

correction: it is not the clocks that are broken. it is the device names.

In arch/arm/mach-davinci/da8xx-dt.c, we have...

    OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
    OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
    OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL),
    OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
    OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
Quoted 6 lines

Which causes each device to have the same device node name. This causes sysfs errors because it is trying to register a second device at the same sysfs path.

If you change the names here, then the device do not work because the clock lookup fails.

Yeah, this is incorrect (I should have caught it in review). The device id should have been present in the lookup. Can you fix auxdata and clock lookup too and send a separate patch? Its probably a v4.9-rc candidate.

Thanks,
Sekhar

#21 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

Quoted 41 lines · Sekhar Nori
Quoted 33 lines · David Lechner
Quoted 13 lines · David Lechner
Quoted 11 lines · David Lechner
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner

+&ehrpwm1 {
+ status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

Not sure why I have this disabled. Like the gpios, the pwms can be used via sysfs, so I would like to leave them.

Quoted 6 lines

Now I remember why these are disabled. The clock matching is broken. Only the first ehrpwm and the first ecap get clocks. The others fail.

I can change these to "okay". It will just result in a kernel error message until the clocks are fixed.

correction: it is not the clocks that are broken. it is the device names.

In arch/arm/mach-davinci/da8xx-dt.c, we have...

    OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
    OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
    OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL),
    OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
    OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
Quoted 6 lines

Which causes each device to have the same device node name. This causes sysfs errors because it is trying to register a second device at the same sysfs path.

If you change the names here, then the device do not work because the clock lookup fails.

Quoted 7 lines

Yeah, this is incorrect (I should have caught it in review). The device id should have been present in the lookup. Can you fix auxdata and clock lookup too and send a separate patch? Its probably a v4.9-rc candidate.

Thanks,
Sekhar

Yes, I can do this.

#6 lore raw

Re: [PATCH 2/5] ARM: davinci: Don't append git rev to local version

In reply to David Lechner
Quoted 13 lines · David Lechner
Quoted 12 lines · Sekhar Nori
Quoted 3 lines · David Lechner

In the davinci default configuration, don't append the git revision to the local kernel version by. This seems like the more desirable default value.

Why? To the contrary I actually quite like the fact that the git commit is appended to version string. Makes it easy for me to cross-check that I am booting the right image.

Quoted 2 lines
Quoted 7 lines
Quoted 3 lines

Thanks,
Sekhar

Each time you make a commit, you get a new version, which installs another copy of the kernel modules on the device. This will fill up the SD card if you are making many commits.

Right, but thats easily fixable by removing existing modules before installing new ones.

Quoted 3 lines

Also, if someone wants to build the mainline kernel using the default configuration, it seems odd to have a git revision tacked on to the end even though you made no revisions.

If you checkout a tag and build, then no commit information is added. Which I guess is what most end users will do.

I don't see this done in other defconfigs like omap2plus and multi_v7 as well. I would like to keep it similar for davinci.

Thanks,
Sekhar

Applied
#9 lore raw

Re: [PATCH 3/5] ARM: davinci: enable gpio poweroff in default config

In reply to David Lechner
Quoted 4 lines · David Lechner

The gpio-poweroff driver is needed by LEGO MINDSTORMS EV3 (AM1808 based board).

For defconfig patches, we have been using the davinci_all_defconfig prefix (see git log --oneline arch/arm/configs/davinci_all_defconfig).

Applied to v4.10/defconfig with subject line changed to:

"ARM: davinci_all_defconfig: enable gpio poweroff driver"

Thanks,
Sekhar

Applied
#2 lore raw

Re: [PATCH 1/5] ARM: davinci: Compile MMC in kernel

In reply to David Lechner
Quoted 5 lines · David Lechner

This changes the davinci default configuration to compile the davinci MMC driver into the kernel. This allows booting from an SD card without requiring an initrd containing the kernel module.

"build" is more relevant here than "compile" so I changed that. And also used davinci_all_defconfig as detailed in last e-mail.

Applied to v4.10/defconfig

Thanks,
Sekhar

#7 lore raw

Re: [PATCH 2/5] ARM: davinci: Don't append git rev to local version

In reply to Sekhar Nori
Quoted 29 lines · Sekhar Nori
Quoted 13 lines · David Lechner
Quoted 12 lines · Sekhar Nori
Quoted 3 lines · David Lechner

In the davinci default configuration, don't append the git revision to the local kernel version by. This seems like the more desirable default value.

Why? To the contrary I actually quite like the fact that the git commit is appended to version string. Makes it easy for me to cross-check that I am booting the right image.

Quoted 2 lines
Quoted 7 lines
Quoted 3 lines

Thanks,
Sekhar

Each time you make a commit, you get a new version, which installs another copy of the kernel modules on the device. This will fill up the SD card if you are making many commits.

Right, but thats easily fixable by removing existing modules before installing new ones.

Quoted 3 lines

Also, if someone wants to build the mainline kernel using the default configuration, it seems odd to have a git revision tacked on to the end even though you made no revisions.

Quoted 9 lines

If you checkout a tag and build, then no commit information is added. Which I guess is what most end users will do.

I don't see this done in other defconfigs like omap2plus and multi_v7 as well. I would like to keep it similar for davinci.

Thanks,
Sekhar

OK, I will drop this patch.

#24 lore raw

Re: [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to Sekhar Nori
Quoted 12 lines · Sekhar Nori
Quoted 1 line · David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

Thanks for the patch!

Quoted 7 lines

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

Quoted 8 lines
Quoted 5 lines

What is partially working:

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix

Is the GPIO fix something that will go in v4.9-rc cycle ?

FYI, the fix is in linux-gpio/fixes now.

#23 lore raw

PATCH 5/5 ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner
Quoted 30 lines · David Lechner
Quoted 12 lines · Sekhar Nori
Quoted 1 line · David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

Thanks for the patch!

Quoted 7 lines

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

Quoted 7 lines
Quoted 5 lines

What is partially working:

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix

Is the GPIO fix something that will go in v4.9-rc cycle ?

Not sure. This is still being discussed.

http://www.gossamer-threads.com/lists/linux/kernel/2550178

Quoted 5 lines
Quoted 4 lines

* Flash memory - driver loads but can't read the block devices - this is probably due to the fact that we are not able to configure the SPI to use DMA via device tree

Quoted 5 lines
Quoted 2 lines

Hmm, I would not have expected PIO mode to be so inefficient that you are unable to even read the block device.

I am getting a -EIO error. I haven't been able to trace down exactly what is causing it yet though.

Okay. Seems unrelated to DMA though. Will check the status of SPI on my DA850 EVM once I get the chance.

Quoted 58 lines
Quoted 2 lines

...

Quoted 35 lines
Quoted 22 lines
arch/arm/boot/dts/lego-ev3.dts new file +22 -0
+/ {
+    compatible = "lego,ev3", "ti,da850";
+    model = "LEGO MINDSTORMS EV3";
+
+    soc at 1c00000 {
+        /*
+         * (ab)using pinctrl-single to disable all internal pullups/
+         * pulldowns on I/O.
+         */
+        pinmux at 22c00c {
+            compatible = "pinctrl-single";
+            reg = <0x22c00c 0x4>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+            pinctrl-single,bit-per-mux;
+            pinctrl-single,register-width = <32>;
+            pinctrl-single,function-mask = <0xf>;
+            /*
+             * There is a bug in pinctrl-single that prevents us
+             * from setting function-mask to 1, so doing things
+             * in groups of 4. Doesn't really matter since we are
+             * disabling all at once anyway.

arch/arm/boot/dts/lego-ev3.dts line 49

Quoted 10 lines
arch/arm/boot/dts/lego-ev3.dts new file +10 -0
+             */
+
+            pinctrl-names = "default";
+            pinctrl-0 = <&pupu_disable>;
+
+            pupu_disable: pinmux_all_pins {
+                pinctrl-single,bits = <
+                    0x0 0x00000000 0xffffffff
+                >;
+            };

Sigh. This is quite an abuse :)

Quoted 4 lines

I know we don't have a good way to configure this in kernel today. And I am surprised we never had to care about disabling pullups so far. Can you clarify why you need it? I assume there is some contention you want to avoid, but on which interface?

The EV3 was designed with external pullup/pulldown everywhere. I know for certain that it breaks one of the buttons if you do not disable the internal ones. I imagine that it would have subtle effects elsewhere if they are not disabled.

I have not gone through each pullup/pulldown bank individually, but it would not surprise me at all if there was at least one thing on most of them that would be adversely affected.

Quoted 5 lines

I dont think this can be done this way using pinctrl-single. A small driver to handle pullup/down control for da850 may have to be added to drivers/pinctrl. It will be better to check with Linus Walleij on his thoughts using a new thread ccing the pinctrl subsystem list as well.

Quoted 5 lines

I will be glad to try to make a driver, but when I ran into this problem I could not find much information on how to handle banks of pullup/pulldown. Most of what I saw was for ones that can be individually controlled. If anyone knows something like this already that I could look at, it would be helpful to me.

pinctrl-single supports a different compatible "pinconf-single" which supports the pinconf interface that can be used to set pullup and pulldown bias.

Unfortunately, in case of AM18x, there are two registers to touch:
PUPD_ENA and PUPD_SEL. So I believe the pinctrl-single driver cannot be used.

There are pinconf operations pin_config_group_{set|get}(). Based on documentation these are meant to act on a group of pins. There are quite a few drivers implementing this interface. Perhaps they can be used as an example.

Also, this needs to be done in a way that can be used by other boards too, so please move the common properties to da850.dtsi. Only the board specific pullup/down configuration should be in this file.

Quoted 17 lines
Quoted 17 lines

[...]

Quoted 12 lines
arch/arm/boot/dts/lego-ev3.dts new file +12 -0
+    in1_pins: pinmux_in1_pins {
+        pinctrl-single,bits = <
+            /* GP0[15] */
+            0x0 0x00000008 0x0000000f
+            /* GP0[2] */
+            0x4 0x00800000 0x00f00000
+            /* GP2[2] */
+            0x18 0x00800000 0x00f00000
+            /* GP8[10], GP8[11] */
+            0x48 0x88000000 0xff000000
+        >;
+    };
Quoted 7 lines
Quoted 3 lines

I see that this is not really used. Can you add these when you actually use them. Looks like that applies to some other definitions like this below.

It will be possible to uses these gpios via sysfs (until a proper driver for input and output ports is merged). So how about I attach these to the gpio node for now?

pins are usually attached to the node that consumes the GPIO pins, not to the gpio node itself.

If the pins are not connected to anything and can be used via gpio sysfs, then "pinctrl hog" or "board level pinmux" is to be used. Something like below:

+&pmx_core {
+ pinctrl-names = "default";
+ pinctrl-0 = <&in1_pins>;
+
+ in1_pins: pinmux_in1_pins {
+ pinctrl-single,bits = <
+ 0x0 0x00000008 0x0000000f
+ ...
+ >;
+ };
+};

That said, device tree is supposed to describe hardware and not change depend on current driver support. So I would wait for the driver to get merged before merging the pins that are used by it. It looks like you wont be able to use the support in a meaningful way till then anyway.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

+&ehrpwm1 {
+ status = "disabled";

Hmm, disabled? Can you add this node when you actually use it?

Not sure why I have this disabled. Like the gpios, the pwms can be used via sysfs, so I would like to leave them.

Okay, then please keep the node enabled.

Quoted 42 lines
Quoted 33 lines

arch/arm/boot/dts/lego-ev3.dts line 387

Quoted 9 lines
arch/arm/boot/dts/lego-ev3.dts new file +7 -0
+    pinctrl-names = "default";
+    /* MBPWM, MAPWM */
+    pinctrl-0 = <&ehrpwm1a_pins>, <&ehrpwm1b_pins>;
+};
+
+&ecap1 {
+    status = "disabled";

same here and other places below.

Quoted 21 lines
arch/arm/boot/dts/lego-ev3.dts new file +21 -0
+    pinctrl-names = "default";
+    /* MDPWM */
+    pinctrl-0 = <&ecap1_pins>;
+};
+
+&spi0 {
+    status = "okay";
+    pinctrl-names = "default";
+    pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>, <&spi0_cs3_pin>;
+    dmas = <&edma0 14 0>, <&edma0 15 0>;
+    dma-names = "rx", "tx";
+
+    spi-flash at 0 {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        compatible = "n25q128a13", "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <50000000>;
+        ti,spi-wdelay = <8>;
+
+        partition at 0 {
Quoted 8 lines

arch/arm/boot/dts/lego-ev3.dts line 417

Quoted 2 lines
arch/arm/boot/dts/lego-ev3.dts new file +2 -0
+            label = "U-Boot";
+            reg = <0 0x40000>;

Thats 256KB for U-Boot and MLO (I assume in concatenated AIS image). Is that sufficient for future too? Moving partitions later is tough ask because that means users will lose data when they upgrade the kernel because of partitions moving around. Just a suggestion to keep future U-Boot bloat in mind and not use a "just fits" number.

Quoted 3 lines

The MLO is on an EEPROM in the EV3, so the U-Boot partition is just U-boot. The SoC boots from I2C, which then runs whatever is as 0x0 on the flash memory.

okay.

Quoted 6 lines

This partition table matches the partition scheme used on the official LEGO firmware that ships with the devices. Most people running their own kernel will probably be loading it from a microSD card, leaving the official firmware intact and therefore will always have this partition table.

Quoted 7 lines

My thinking is that if someone does want to use a different partitioning scheme, they can build their own U-Boot and configure it to modify the device tree with a new partition table.

The way the LEGO firmware flashing utility works, it wipes out the entire flash memory each time you flash the firmware. So, data loss is not a concern - you will loose your data anyway.

Alright, thanks for the detailed explanation.

Thanks,
Sekhar

#25 lore raw

PATCH 5/5 ARM: dts: Add LEGO MINDSTORTMS EV3 dts

In reply to David Lechner
Quoted 15 lines · David Lechner
Quoted 14 lines · Sekhar Nori
Quoted 1 line · David Lechner

This adds a device tree definition file for LEGO MINDSTORMS EV3.

Thanks for the patch!

Quoted 9 lines

What is working:

* Pin muxing
* MicroSD card reader
* UART on input port 1

What is partially working:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

* Buttons - working after GPIO fix
* LEDs - working after GPIO fix
* Poweroff/reset - working after GPIO fix

Is the GPIO fix something that will go in v4.9-rc cycle ?

FYI, the fix is in linux-gpio/fixes now.

Thanks, I added the patch to my 'acked' branch which has stuff useful for testing on davinci but not going through my tree. It gets merged into my master branch so that branch can be used for all mach-davinci development.

Thanks,
Sekhar

#11 lore raw

Re: [PATCH 4/5] ARM: davinci: enable LEDs default-on trigger in default config

In reply to David Lechner
Quoted 13 lines · David Lechner

The LEDs default-on trigger is nice to have. For example, it can be used to configure a LED as a power indicator.

---
 arch/arm/configs/davinci_all_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/davinci_all_defconfig +0 -0
index 9d7f0bc..e380743 100644

arch/arm/configs/davinci_all_defconfig CONFIG_LEDS_GPIO=m · line 184

Quoted 4 lines
arch/arm/configs/davinci_all_defconfig +1 -0
@@ -181,6 +181,7 @@ CONFIG_LEDS_GPIO=m
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y

Can this be module like rest of the triggers? It will come on later, but not sure if you care about the difference that much. Having it a module will be better for those boards that don't need it.

Thanks,
Sekhar

#12 lore raw

Re: [PATCH 4/5] ARM: davinci: enable LEDs default-on trigger in default config

Quoted 23 lines · Sekhar Nori
Quoted 13 lines · David Lechner

The LEDs default-on trigger is nice to have. For example, it can be used to configure a LED as a power indicator.

---
 arch/arm/configs/davinci_all_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/davinci_all_defconfig +0 -0
index 9d7f0bc..e380743 100644

arch/arm/configs/davinci_all_defconfig CONFIG_LEDS_GPIO=m · line 184

Quoted 4 lines
arch/arm/configs/davinci_all_defconfig +1 -0
@@ -181,6 +181,7 @@ CONFIG_LEDS_GPIO=m
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y

Can this be module like rest of the triggers? It will come on later, but not sure if you care about the difference that much. Having it a module will be better for those boards that don't need it.

Quoted 3 lines

Thanks,
Sekhar

Yes, module is OK here.

#13 lore raw

Re: [PATCH 4/5] ARM: davinci: enable LEDs default-on trigger in default config

Quoted 1 line · David Lechner

Yes, module is OK here.

Here is the patch I pushed to v4.10/defconfig.

Thanks,
Sekhar

---8<---
From: David Lechner <[email protected]>
Date: Fri, 21 Oct 2016 13:36:56 -0500
Subject: [PATCH] ARM: davinci_all_defconfig: enable LED default-on trigger

The LEDs default-on trigger is nice to have. For example, it can be used to configure a LED as a power indicator.

[nsekhar at ti.com: build as module, subject line fixes]
---
 arch/arm/configs/davinci_all_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/davinci_all_defconfig +1 -0
index 513978eaf03d..b5e978ff177f 100644
@@ -180,6 +180,7 @@ CONFIG_LEDS_GPIO=m
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_OMAP=m
 CONFIG_DMADEVICES=y
Signature · 1 line
2.9.0