Message ID | 20241024142206.411336-3-andreas@kemnade.info (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ARM: dts: add Kobo Clara 2E | expand |
On Thu, Oct 24, 2024 at 04:22:05PM +0200, Andreas Kemnade wrote: > Adds a devicetree for the Kobo Clara 2E Ebook reader. It is based > on boards marked with "37NB-E60K2M+4A2" or "37NB-E60K2M+4B0". It is > equipped with an i.MX6SLL SoC. > > Expected to work: > - Buttons > - Wifi > - Bluetooth > (if Wifi is initialized first, driver does not handle regulators > yet) > - LED > - uSD > - USB > - RTC > - Touchscreen > > Add human-readable comments for devices without mainlined driver and > binding. Such comments can e.g. be help to find testers if someone > starts to work on the missing drivers. In case me not responding would case this to get delayed or w/e, thanks for adding that.
On 24/10/2024 17:22, Andreas Kemnade wrote: > Adds a devicetree for the Kobo Clara 2E Ebook reader. It is based > on boards marked with "37NB-E60K2M+4A2" or "37NB-E60K2M+4B0". It is > equipped with an i.MX6SLL SoC. > > Expected to work: > - Buttons > - Wifi > - Bluetooth > (if Wifi is initialized first, driver does not handle regulators > yet) > - LED > - uSD > - USB > - RTC > - Touchscreen > > Add human-readable comments for devices without mainlined driver and > binding. Such comments can e.g. be help to find testers if someone > starts to work on the missing drivers. > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info> ... > + > + pmic@4b { > + compatible = "rohm,bd71879", "rohm,bd71828"; > + reg = <0x4b>; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_bd71828>; > + > + interrupt-parent = <&gpio4>; > + interrupts = <19 IRQ_TYPE_LEVEL_LOW>; > + system-power-controller; > + > + clocks = <&clks 0>; > + #clock-cells = <0>; > + clock-output-names = "bd71828-32k-out"; > + > + gpio-controller; > + #gpio-cells = <2>; > + gpio-reserved-ranges = <0 1>, <2 1>; > + > + rohm,charger-sense-resistor-ohms = <30000000>; I am afraid that this one is _my_ very much terrible brainfart. Yeah, pile up the stones and start casting ;) I am fairly sure the sense resistor is 30 mOhm (0,030 Ohm), not 30 MOhm (30 000 000 Ohm). (And I am the one who misinterpreted the M in some email/data-sheet in the past - and never questioned the sanity). In short, AFAICS the sense resistor is added "in series" to the system load. Eg: -------- ---| Rsense |----- | -------- | --------- ------- | VSupply | | Rload | --------- ------- | | ------------------ Hence, by measuring the voltage drop on the Rsense gives us the current flowing through the system ( good old U = RI ). I believe having 30 Mohm (30 000 000 Ohm) resistor there would not make much of sense... With a Fermi estimate that the system works with voltage magnitude of 1V and current magnitude of 1A and then applying good old P = UI and U = RI would give us wonderful results :) Quite a battery on poor Kobo, right? You'd better to not touch the battery termninals ;) Oh, and looking the driver code I've written for handling this property... Sometimes I really don't like mirrors :) Well, now that I got this out - I suppose this could be rohm,charger-sense-resistor-milli-ohms = <30>; or rohm,charger-sense-resistor-micro-ohms = <30000>; I further guess there is no upstreamn binding doc for this property. I think there is also no upstream charger driver for the BD71828/BD71879 - only an early RFC and some downstream mess - but stil it'd be nice to have the property in place as the size of the sense resistor is needed when converting coulomb counter register values to current. Yours, -- Matti
Am Tue, 29 Oct 2024 09:53:33 +0200 schrieb Matti Vaittinen <mazziesaccount@gmail.com>: > On 24/10/2024 17:22, Andreas Kemnade wrote: > > Adds a devicetree for the Kobo Clara 2E Ebook reader. It is based > > on boards marked with "37NB-E60K2M+4A2" or "37NB-E60K2M+4B0". It is > > equipped with an i.MX6SLL SoC. > > > > Expected to work: > > - Buttons > > - Wifi > > - Bluetooth > > (if Wifi is initialized first, driver does not handle > > regulators yet) > > - LED > > - uSD > > - USB > > - RTC > > - Touchscreen > > > > Add human-readable comments for devices without mainlined driver and > > binding. Such comments can e.g. be help to find testers if someone > > starts to work on the missing drivers. > > > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info> > > ... > > > + > > + pmic@4b { > > + compatible = "rohm,bd71879", "rohm,bd71828"; > > + reg = <0x4b>; > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_bd71828>; > > + > > + interrupt-parent = <&gpio4>; > > + interrupts = <19 IRQ_TYPE_LEVEL_LOW>; > > + system-power-controller; > > + > > + clocks = <&clks 0>; > > + #clock-cells = <0>; > > + clock-output-names = "bd71828-32k-out"; > > + > > + gpio-controller; > > + #gpio-cells = <2>; > > + gpio-reserved-ranges = <0 1>, <2 1>; > > + > > + rohm,charger-sense-resistor-ohms = <30000000>; > > I am afraid that this one is _my_ very much terrible brainfart. Yeah, > pile up the stones and start casting ;) > ... at everyone who had looked at this and did not question it ;-) > I am fairly sure the sense resistor is 30 mOhm (0,030 Ohm), not 30 > MOhm (30 000 000 Ohm). (And I am the one who misinterpreted the M in > some email/data-sheet in the past - and never questioned the sanity). > Well, I did question it, but then thought, ok there might be some current mirror to scale things down so that the massive rsense might make sense. Well, no schematics here. > In short, AFAICS the sense resistor is added "in series" to the > system load. Eg: > > -------- > ---| Rsense |----- > | -------- | > --------- ------- > | VSupply | | Rload | > --------- ------- > | | > ------------------ > > Hence, by measuring the voltage drop on the Rsense gives us the > current flowing through the system ( good old U = RI ). > Yes, that is the way I did know how these things are usually done. So I am still on track. > I believe having 30 Mohm (30 000 000 Ohm) resistor there would not > make much of sense... With a Fermi estimate that the system works > with voltage magnitude of 1V and current magnitude of 1A and then > applying good old P = UI and U = RI would give us wonderful results > :) Quite a battery on poor Kobo, right? You'd better to not touch the > battery termninals ;) Oh, and looking the driver code I've written > for handling this property... Sometimes I really don't like mirrors :) > > Well, now that I got this out - I suppose this could be > rohm,charger-sense-resistor-milli-ohms = <30>; > or > rohm,charger-sense-resistor-micro-ohms = <30000>; > > I further guess there is no upstreamn binding doc for this property. The binding doc is upstream. So an impressive amount of maintainers had a look at it... Well, everyone seem to entrust Rohm Semiconductors to do magic... wonderful reputation. So how to proceed? As this property is not required, I can simply remove it and add a comment. > I think there is also no upstream charger driver for the > BD71828/BD71879 - only an early RFC and some downstream mess - but > stil it'd be nice to have the property in place as the size of the > sense resistor is needed when converting coulomb counter register > values to current. > What are you upstreaming plans here? For all: I rebased the charger stuff to v6.11 on https://github.com/akemnade/linux branch kobo/power-6.11 Regards, Andreas
Am Tue, 29 Oct 2024 09:53:33 +0200 schrieb Matti Vaittinen <mazziesaccount@gmail.com>: > On 24/10/2024 17:22, Andreas Kemnade wrote: > > Adds a devicetree for the Kobo Clara 2E Ebook reader. It is based > > on boards marked with "37NB-E60K2M+4A2" or "37NB-E60K2M+4B0". It is > > equipped with an i.MX6SLL SoC. > > > > Expected to work: > > - Buttons > > - Wifi > > - Bluetooth > > (if Wifi is initialized first, driver does not handle > > regulators yet) > > - LED > > - uSD > > - USB > > - RTC > > - Touchscreen > > > > Add human-readable comments for devices without mainlined driver and > > binding. Such comments can e.g. be help to find testers if someone > > starts to work on the missing drivers. > > > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info> > > ... > > > + > > + pmic@4b { > > + compatible = "rohm,bd71879", "rohm,bd71828"; > > + reg = <0x4b>; > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_bd71828>; > > + > > + interrupt-parent = <&gpio4>; > > + interrupts = <19 IRQ_TYPE_LEVEL_LOW>; > > + system-power-controller; > > + > > + clocks = <&clks 0>; > > + #clock-cells = <0>; > > + clock-output-names = "bd71828-32k-out"; > > + > > + gpio-controller; > > + #gpio-cells = <2>; > > + gpio-reserved-ranges = <0 1>, <2 1>; > > + > > + rohm,charger-sense-resistor-ohms = <30000000>; > > I am afraid that this one is _my_ very much terrible brainfart. Yeah, > pile up the stones and start casting ;) > ... at everyone who had looked at this and did not question it ;-) > I am fairly sure the sense resistor is 30 mOhm (0,030 Ohm), not 30 > MOhm (30 000 000 Ohm). (And I am the one who misinterpreted the M in > some email/data-sheet in the past - and never questioned the sanity). > Well, I did question it, but then thought, ok there might be some current mirror to scale things down so that the massive rsense might make sense. Well, no schematics here. > In short, AFAICS the sense resistor is added "in series" to the > system load. Eg: > > -------- > ---| Rsense |----- > | -------- | > --------- ------- > | VSupply | | Rload | > --------- ------- > | | > ------------------ > > Hence, by measuring the voltage drop on the Rsense gives us the > current flowing through the system ( good old U = RI ). > Yes, that is the way I did know how these things are usually done. So I am still on track. > I believe having 30 Mohm (30 000 000 Ohm) resistor there would not > make much of sense... With a Fermi estimate that the system works > with voltage magnitude of 1V and current magnitude of 1A and then > applying good old P = UI and U = RI would give us wonderful results > :) Quite a battery on poor Kobo, right? You'd better to not touch the > battery termninals ;) Oh, and looking the driver code I've written > for handling this property... Sometimes I really don't like mirrors :) > > Well, now that I got this out - I suppose this could be > rohm,charger-sense-resistor-milli-ohms = <30>; > or > rohm,charger-sense-resistor-micro-ohms = <30000>; > > I further guess there is no upstreamn binding doc for this property. The binding doc is upstream. So an impressive amount of maintainers had a look at it... Well, everyone seem to entrust Rohm Semiconductors to do magic... wonderful reputation. So how to proceed? As this property is not required, I can simply remove it and add a comment. > I think there is also no upstream charger driver for the > BD71828/BD71879 - only an early RFC and some downstream mess - but > stil it'd be nice to have the property in place as the size of the > sense resistor is needed when converting coulomb counter register > values to current. > What are you upstreaming plans here? For all: I rebased the charger stuff to v6.11 on https://github.com/akemnade/linux branch kobo/power-6.11 Regards, Andreas
On 29/10/2024 10:44, Andreas Kemnade wrote: > Am Tue, 29 Oct 2024 09:53:33 +0200 > schrieb Matti Vaittinen <mazziesaccount@gmail.com>: > >> On 24/10/2024 17:22, Andreas Kemnade wrote: >>> Adds a devicetree for the Kobo Clara 2E Ebook reader. It is based >>> on boards marked with "37NB-E60K2M+4A2" or "37NB-E60K2M+4B0". It is >>> equipped with an i.MX6SLL SoC. >>> >>> Expected to work: >>> - Buttons >>> - Wifi >>> - Bluetooth >>> (if Wifi is initialized first, driver does not handle >>> regulators yet) >>> - LED >>> - uSD >>> - USB >>> - RTC >>> - Touchscreen >>> >>> Add human-readable comments for devices without mainlined driver and >>> binding. Such comments can e.g. be help to find testers if someone >>> starts to work on the missing drivers. >>> >>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info> >> >> ... >> >>> + >>> + pmic@4b { >>> + compatible = "rohm,bd71879", "rohm,bd71828"; >>> + reg = <0x4b>; >>> + pinctrl-names = "default"; >>> + pinctrl-0 = <&pinctrl_bd71828>; >>> + >>> + interrupt-parent = <&gpio4>; >>> + interrupts = <19 IRQ_TYPE_LEVEL_LOW>; >>> + system-power-controller; >>> + >>> + clocks = <&clks 0>; >>> + #clock-cells = <0>; >>> + clock-output-names = "bd71828-32k-out"; >>> + >>> + gpio-controller; >>> + #gpio-cells = <2>; >>> + gpio-reserved-ranges = <0 1>, <2 1>; >>> + >>> + rohm,charger-sense-resistor-ohms = <30000000>; >> >> Well, now that I got this out - I suppose this could be >> rohm,charger-sense-resistor-milli-ohms = <30>; >> or >> rohm,charger-sense-resistor-micro-ohms = <30000>; >> >> I further guess there is no upstreamn binding doc for this property. > > The binding doc is upstream. So an impressive amount of maintainers > had a look at it... Oh. So I have upstreamed it at some point... I suppose there is no users though. > Well, everyone seem to entrust Rohm Semiconductors to do magic... > wonderful reputation. :) > So how to proceed? As this property is not required, I can simply > remove it and add a comment. I would like to suggest adding: rohm,charger-sense-resistor-milli-ohms = <30>; and a binding with minimum 1 and maximum 50. Those should be sane enough limits. At the same time the 'rohm,charger-sense-resistor-ohms' could probably be deprecated. This, however, is an extra mile for you. So, if you don't feel like doing it, then dropping the entry is Ok as well. > >> I think there is also no upstream charger driver for the >> BD71828/BD71879 - only an early RFC and some downstream mess - but >> stil it'd be nice to have the property in place as the size of the >> sense resistor is needed when converting coulomb counter register >> values to current. >> > What are you upstreaming plans here? For all: > I rebased the charger stuff to v6.11 on > https://github.com/akemnade/linux branch kobo/power-6.11 Excellent question. The reason why this driver is not upstream is that (as far as I know) the PMIC variants supported by the driver have always been tailored for a specific customer's needs. I don't think these PMICs have been sold for anyone else besides the specific customers. Hence, there has been little benefit for creating an upstream driver. For the charger there has been additional complexity because the bd71827-charger driver implements also an in-kernel battery fuel gauge which computes the SOC values and sends them to the user-space. Like you know, this is very battery specific and requires correct battery parameters to be given. I think your work changes things a bit. Seems we will be having an upstream board (kobo) using the PMIC drivers - and it might also use some information from the charger block. I know you also implemented some control logic to get the charging working with limited power-supplies. (I think the BD71815 is also used in some projects which wanted to have upstream drivers - but I haven't seen upstream dts using it). Furthermore, we still seem to be having new variants - I am right now writing drivers for another customer specific PMIC using somewhat similar charging logic. Having upstream driver would help in work like that. (By the way, I took your rebased kobo patches and continued my work on top of those - so thanks for the rebasing!) So - in my opinion, upstreaming would be beneficial and I will push for this direction - but it will be slow process. Also, I think that maybe the downstream driver shouldn't be upstreamed as such. I am not 100% convinced the SOC should be computed in-kernel. It'd might be easier to implement the SOC computation in a user-space library which just gets the details from the kernel. On the other hand, I think the driver should support a few currently unsupported features like setting the currents for different charge phases based on device-tree properties. Giving I am the only guy at ROHM working on these Linux drivers (and not only these drivers), and knowing I don't have a system which is equipped with a real battery - I wouldn't hold my breath waiting :( Yours, -- Matti > Regards, > Andreas
diff --git a/arch/arm/boot/dts/nxp/imx/Makefile b/arch/arm/boot/dts/nxp/imx/Makefile index 92e291603ea13..58db45352b666 100644 --- a/arch/arm/boot/dts/nxp/imx/Makefile +++ b/arch/arm/boot/dts/nxp/imx/Makefile @@ -290,6 +290,8 @@ dtb-$(CONFIG_SOC_IMX6SL) += \ dtb-$(CONFIG_SOC_IMX6SLL) += \ imx6sll-evk.dtb \ imx6sll-kobo-clarahd.dtb \ + imx6sll-kobo-clara2e-a.dtb \ + imx6sll-kobo-clara2e-b.dtb \ imx6sll-kobo-librah2o.dtb dtb-$(CONFIG_SOC_IMX6SX) += \ imx6sx-nitrogen6sx.dtb \ diff --git a/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-a.dts b/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-a.dts new file mode 100644 index 0000000000000..33756d6de7aa0 --- /dev/null +++ b/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-a.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0) +/* + * Device tree for the Kobo Clara 2E rev A ebook reader + * + * Name on mainboard is: 37NB-E60K2M+4A2 + * Serials start with: E60K2M (a number also seen in + * vendor kernel sources) + * + * Copyright 2024 Andreas Kemnade + */ + +/dts-v1/; + +#include "imx6sll-kobo-clara2e-common.dtsi" + +/ { + model = "Kobo Clara 2E"; + compatible = "kobo,clara2e-b", "kobo,clara2e", "fsl,imx6sll"; +}; + +&i2c2 { + /* EPD PMIC SY7636 at 0x62 */ +}; diff --git a/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-b.dts b/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-b.dts new file mode 100644 index 0000000000000..f81aeacf51420 --- /dev/null +++ b/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-b.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0) +/* + * Device tree for the Kobo Clara 2E rev B ebook reader + * + * Name on mainboard is: 37NB-E60K2M+4B0 + * Serials start with: E60K2M (a number also seen in + * vendor kernel sources) + * + * Copyright 2024 Andreas Kemnade + */ + +/dts-v1/; + +#include "imx6sll-kobo-clara2e-common.dtsi" + +/ { + model = "Kobo Clara 2E"; + compatible = "kobo,clara2e-b", "kobo,clara2e", "fsl,imx6sll"; +}; + +&i2c2 { + /* EPD PMIC JD9930 at 0x18 */ +}; diff --git a/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-common.dtsi b/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-common.dtsi new file mode 100644 index 0000000000000..dd347253bc7be --- /dev/null +++ b/arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-common.dtsi @@ -0,0 +1,514 @@ +// SPDX-License-Identifier: (GPL-2.0) +/* + * Common part for Kobo Clara 2e device tree + * Copyright 2024 Andreas Kemnade + */ + +/dts-v1/; + +#include <dt-bindings/input/input.h> +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> +#include "imx6sll.dtsi" + +/ { + aliases { + mmc0 = &usdhc2; + mmc1 = &usdhc3; + }; + + chosen { + stdout-path = &uart1; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_keys>; + + key-cover { + label = "Cover"; + gpios = <&gpio4 23 GPIO_ACTIVE_LOW>; + linux,code = <SW_LID>; + linux,input-type = <EV_SW>; + wakeup-source; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_led>; + + led { + color = <LED_COLOR_ID_WHITE>; + function = LED_FUNCTION_POWER; + gpios = <&gpio4 17 GPIO_ACTIVE_LOW>; + linux,default-trigger = "timer"; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + reg_wifi: regulator-wifi { + compatible = "regulator-fixed"; + regulator-name = "SD3_SPWR"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&clks { + assigned-clocks = <&clks IMX6SLL_CLK_PLL4_AUDIO_DIV>; + assigned-clock-rates = <393216000>; +}; + +&cpu0 { + arm-supply = <&buck1>; + soc-supply = <&buck2>; +}; + +&i2c1 { + pinctrl-names = "default","sleep"; + pinctrl-0 = <&pinctrl_i2c1>; + pinctrl-1 = <&pinctrl_i2c1_sleep>; + clock-frequency = <100000>; + status = "okay"; + + /* backlight aw99703 at 0x36 */ +}; + +&i2c2 { + pinctrl-names = "default","sleep"; + pinctrl-0 = <&pinctrl_i2c2>; + pinctrl-1 = <&pinctrl_i2c2_sleep>; + clock-frequency = <100000>; + status = "okay"; + + /* backlight aw99703 at 0x36 */ + + touchscreen@38 { + compatible = "focaltech,ft5426"; + reg = <0x38>; + pinctrl-names = "default", "suspend"; + pinctrl-0 = <&pinctrl_touch_gpio>; + pinctrl-1 = <&pinctrl_touch_gpio_sleep>; + interrupt-parent = <&gpio4>; + interrupts = <24 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpio4 18 GPIO_ACTIVE_LOW>; + touchscreen-size-x = <1072>; + touchscreen-size-y = <1448>; + touchscreen-swapped-x-y; + }; +}; + +&i2c3 { + /* Bus seems to be in bad state after boot, allow full recovery */ + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&pinctrl_i2c3>; + pinctrl-1 = <&pinctrl_i2c3_gpio>; + sda-gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>; + scl-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>; + clock-frequency = <100000>; + status = "okay"; + + pmic@4b { + compatible = "rohm,bd71879", "rohm,bd71828"; + reg = <0x4b>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_bd71828>; + + interrupt-parent = <&gpio4>; + interrupts = <19 IRQ_TYPE_LEVEL_LOW>; + system-power-controller; + + clocks = <&clks 0>; + #clock-cells = <0>; + clock-output-names = "bd71828-32k-out"; + + gpio-controller; + #gpio-cells = <2>; + gpio-reserved-ranges = <0 1>, <2 1>; + + rohm,charger-sense-resistor-ohms = <30000000>; + + regulators { + LDO1 { + name = "LDO1"; + regulator-name = "ldo1"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + }; + + LDO2 { + name = "LDO2"; + regulator-name = "ldo2"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + }; + + LDO3 { + name = "LDO3"; + regulator-name = "ldo3"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + }; + + ldo4: LDO4 { + name = "LDO4"; + regulator-name = "ldo4"; + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + }; + + LDO5 { + name = "LDO5"; + regulator-name = "ldo5"; + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + }; + + LDO6 { + name = "LDO6"; + regulator-name = "ldo6"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + LDO7 { + name = "LDO7"; + regulator-name = "ldo7"; + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + buck1: BUCK1 { + name = "BUCK1"; + regulator-name = "buck1"; + regulator-always-on; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + }; + + buck2: BUCK2 { + name = "BUCK2"; + regulator-name = "buck2"; + regulator-always-on; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2000000>; + regulator-boot-on; + }; + + BUCK3 { + name = "BUCK3"; + regulator-name = "buck3"; + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + }; + + BUCK4 { + name = "BUCK4"; + regulator-name = "buck4"; + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1200000>; + regulator-boot-on; + }; + + BUCK5 { + name = "BUCK5"; + regulator-name = "buck5"; + regulator-always-on; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + BUCK6 { + name = "BUCK6"; + regulator-name = "buck6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2000000>; + }; + + BUCK7 { + name = "BUCK7"; + regulator-name = "buck7"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2000000>; + }; + }; + }; +}; + +&iomuxc { + pinctrl_touch_gpio: touch-gpiogrp { + fsl,pins = < + MX6SLL_PAD_GPIO4_IO24__GPIO4_IO24 0x17059 /* TP_INT */ + MX6SLL_PAD_GPIO4_IO18__GPIO4_IO18 0x10059 /* TP_RST */ + >; + }; + + pinctrl_touch_gpio_sleep: touch-gpio-sleepgrp { + fsl,pins = < + MX6SLL_PAD_GPIO4_IO24__GPIO4_IO24 0x10059 /* TP_INT */ + MX6SLL_PAD_GPIO4_IO18__GPIO4_IO18 0x10059 /* TP_RST */ + >; + }; + + pinctrl_gpio_keys: gpio-keysgrp { + fsl,pins = < + MX6SLL_PAD_GPIO4_IO25__GPIO4_IO25 0x17059 /* PWR_SW */ + MX6SLL_PAD_GPIO4_IO23__GPIO4_IO23 0x17059 /* HALL_EN */ + >; + }; + + pinctrl_i2c1: i2c1grp { + fsl,pins = < + MX6SLL_PAD_I2C1_SCL__I2C1_SCL 0x4001f8b1 + MX6SLL_PAD_I2C1_SDA__I2C1_SDA 0x4001f8b1 + >; + }; + + pinctrl_i2c1_sleep: i2c1-sleepgrp { + fsl,pins = < + MX6SLL_PAD_I2C1_SCL__I2C1_SCL 0x400108b1 + MX6SLL_PAD_I2C1_SDA__I2C1_SDA 0x400108b1 + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX6SLL_PAD_I2C2_SCL__I2C2_SCL 0x4001f8b1 + MX6SLL_PAD_I2C2_SDA__I2C2_SDA 0x4001f8b1 + >; + }; + + pinctrl_i2c2_sleep: i2c2-sleepgrp { + fsl,pins = < + MX6SLL_PAD_I2C2_SCL__I2C2_SCL 0x400108b1 + MX6SLL_PAD_I2C2_SDA__I2C2_SDA 0x400108b1 + >; + }; + + pinctrl_i2c3: i2c3grp { + fsl,pins = < + MX6SLL_PAD_REF_CLK_24M__I2C3_SCL 0x4001f8b1 + MX6SLL_PAD_REF_CLK_32K__I2C3_SDA 0x4001f8b1 + >; + }; + + pinctrl_i2c3_gpio: i2c3-gpiogrp { + fsl,pins = < + MX6SLL_PAD_REF_CLK_24M__GPIO3_IO21 0x4001f8b1 + MX6SLL_PAD_REF_CLK_32K__GPIO3_IO22 0x4001f8b1 + >; + }; + + pinctrl_led: ledgrp { + fsl,pins = < + MX6SLL_PAD_GPIO4_IO17__GPIO4_IO17 0x10059 + >; + }; + + pinctrl_uart1: uart1grp { + fsl,pins = < + MX6SLL_PAD_UART1_TXD__UART1_DCE_TX 0x1b0b1 + MX6SLL_PAD_UART1_RXD__UART1_DCE_RX 0x1b0b1 + >; + }; + + pinctrl_uart2: uart2grp { + fsl,pins = < + MX6SLL_PAD_LCD_ENABLE__UART2_DCE_RX 0x41b0b1 + MX6SLL_PAD_LCD_HSYNC__UART2_DCE_TX 0x41b0b1 + MX6SLL_PAD_LCD_VSYNC__UART2_DCE_RTS 0x41b0b1 + MX6SLL_PAD_LCD_RESET__UART2_DCE_CTS 0x41b0b1 + >; + }; + + pinctrl_uart2_sleep: uart2grp-sleep { + fsl,pins = < + MX6SLL_PAD_LCD_ENABLE__GPIO2_IO16 0x10059 + MX6SLL_PAD_LCD_HSYNC__GPIO2_IO17 0x10059 + MX6SLL_PAD_LCD_VSYNC__GPIO2_IO18 0x10059 + MX6SLL_PAD_LCD_RESET__GPIO2_IO19 0x10059 + >; + }; + + pinctrl_usbotg1: usbotg1grp { + fsl,pins = < + MX6SLL_PAD_EPDC_PWR_COM__USB_OTG1_ID 0x17059 + >; + }; + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < + MX6SLL_PAD_SD2_CMD__SD2_CMD 0x17059 + MX6SLL_PAD_SD2_CLK__SD2_CLK 0x13059 + MX6SLL_PAD_SD2_DATA0__SD2_DATA0 0x17059 + MX6SLL_PAD_SD2_DATA1__SD2_DATA1 0x17059 + MX6SLL_PAD_SD2_DATA2__SD2_DATA2 0x17059 + MX6SLL_PAD_SD2_DATA3__SD2_DATA3 0x17059 + >; + }; + + pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { + fsl,pins = < + MX6SLL_PAD_SD2_CMD__SD2_CMD 0x170b9 + MX6SLL_PAD_SD2_CLK__SD2_CLK 0x130b9 + MX6SLL_PAD_SD2_DATA0__SD2_DATA0 0x170b9 + MX6SLL_PAD_SD2_DATA1__SD2_DATA1 0x170b9 + MX6SLL_PAD_SD2_DATA2__SD2_DATA2 0x170b9 + MX6SLL_PAD_SD2_DATA3__SD2_DATA3 0x170b9 + >; + }; + + pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { + fsl,pins = < + MX6SLL_PAD_SD2_CMD__SD2_CMD 0x170f9 + MX6SLL_PAD_SD2_CLK__SD2_CLK 0x130f9 + MX6SLL_PAD_SD2_DATA0__SD2_DATA0 0x170f9 + MX6SLL_PAD_SD2_DATA1__SD2_DATA1 0x170f9 + MX6SLL_PAD_SD2_DATA2__SD2_DATA2 0x170f9 + MX6SLL_PAD_SD2_DATA3__SD2_DATA3 0x170f9 + >; + }; + + pinctrl_usdhc2_sleep: usdhc2-sleepgrp { + fsl,pins = < + MX6SLL_PAD_SD2_CMD__GPIO5_IO04 0x100f9 + MX6SLL_PAD_SD2_CLK__GPIO5_IO05 0x100f9 + MX6SLL_PAD_SD2_DATA0__GPIO5_IO01 0x100f9 + MX6SLL_PAD_SD2_DATA1__GPIO4_IO30 0x100f9 + MX6SLL_PAD_SD2_DATA2__GPIO5_IO03 0x100f9 + MX6SLL_PAD_SD2_DATA3__GPIO4_IO28 0x100f9 + >; + }; + + pinctrl_usdhc3: usdhc3grp { + fsl,pins = < + MX6SLL_PAD_SD3_CMD__SD3_CMD 0x11059 + MX6SLL_PAD_SD3_CLK__SD3_CLK 0x11059 + MX6SLL_PAD_SD3_DATA0__SD3_DATA0 0x11059 + MX6SLL_PAD_SD3_DATA1__SD3_DATA1 0x11059 + MX6SLL_PAD_SD3_DATA2__SD3_DATA2 0x11059 + MX6SLL_PAD_SD3_DATA3__SD3_DATA3 0x11059 + >; + }; + + pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp { + fsl,pins = < + MX6SLL_PAD_SD3_CMD__SD3_CMD 0x170b9 + MX6SLL_PAD_SD3_CLK__SD3_CLK 0x170b9 + MX6SLL_PAD_SD3_DATA0__SD3_DATA0 0x170b9 + MX6SLL_PAD_SD3_DATA1__SD3_DATA1 0x170b9 + MX6SLL_PAD_SD3_DATA2__SD3_DATA2 0x170b9 + MX6SLL_PAD_SD3_DATA3__SD3_DATA3 0x170b9 + >; + }; + + pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp { + fsl,pins = < + MX6SLL_PAD_SD3_CMD__SD3_CMD 0x170f9 + MX6SLL_PAD_SD3_CLK__SD3_CLK 0x170f9 + MX6SLL_PAD_SD3_DATA0__SD3_DATA0 0x170f9 + MX6SLL_PAD_SD3_DATA1__SD3_DATA1 0x170f9 + MX6SLL_PAD_SD3_DATA2__SD3_DATA2 0x170f9 + MX6SLL_PAD_SD3_DATA3__SD3_DATA3 0x170f9 + >; + }; + + pinctrl_usdhc3_sleep: usdhc3-sleepgrp { + fsl,pins = < + MX6SLL_PAD_SD3_CMD__GPIO5_IO21 0x100c1 + MX6SLL_PAD_SD3_CLK__GPIO5_IO18 0x100c1 + MX6SLL_PAD_SD3_DATA0__GPIO5_IO19 0x100c1 + MX6SLL_PAD_SD3_DATA1__GPIO5_IO20 0x100c1 + MX6SLL_PAD_SD3_DATA2__GPIO5_IO16 0x100c1 + MX6SLL_PAD_SD3_DATA3__GPIO5_IO17 0x100c1 + >; + }; + + pinctrl_wifi_power: wifi-powergrp { + fsl,pins = < + MX6SLL_PAD_SD2_DATA6__GPIO4_IO29 0x10059 + >; + }; + + pinctrl_bd71828: bd71828-gpiogrp { + fsl,pins = < + MX6SLL_PAD_KEY_COL0__GPIO3_IO24 0x1b8b1 + MX6SLL_PAD_GPIO4_IO19__GPIO4_IO19 0x1b8b1 + >; + }; +}; + +&snvs_rtc { + /* we are using the rtc in the pmic, not disabled in imx6sll.dtsi */ + status = "disabled"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart1>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pinctrl_uart2>; + pinctrl-1 = <&pinctrl_uart2_sleep>; + status = "okay"; + + /* requires LDO4 + power enable gpio */ + bluetooth { + compatible = "nxp,88w8987-bt"; + fw-init-baudrate = <1500000>; + }; +}; + +&usbotg1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg1>; + disable-over-current; + srp-disable; + hnp-disable; + adp-disable; + status = "okay"; +}; + +&usdhc2 { + pinctrl-names = "default", "state_100mhz", "state_200mhz","sleep"; + pinctrl-0 = <&pinctrl_usdhc2>; + pinctrl-1 = <&pinctrl_usdhc2_100mhz>; + pinctrl-2 = <&pinctrl_usdhc2_200mhz>; + pinctrl-3 = <&pinctrl_usdhc2_sleep>; + non-removable; + status = "okay"; +}; + +&usdhc3 { + pinctrl-names = "default", "state_100mhz", "state_200mhz","sleep"; + pinctrl-0 = <&pinctrl_usdhc3>; + pinctrl-1 = <&pinctrl_usdhc3_100mhz>; + pinctrl-2 = <&pinctrl_usdhc3_200mhz>; + pinctrl-3 = <&pinctrl_usdhc3_sleep>; + /* card requires also ldo4 */ + vmmc-supply = <®_wifi>; + cap-power-off-card; + non-removable; + status = "okay"; +};
Adds a devicetree for the Kobo Clara 2E Ebook reader. It is based on boards marked with "37NB-E60K2M+4A2" or "37NB-E60K2M+4B0". It is equipped with an i.MX6SLL SoC. Expected to work: - Buttons - Wifi - Bluetooth (if Wifi is initialized first, driver does not handle regulators yet) - LED - uSD - USB - RTC - Touchscreen Add human-readable comments for devices without mainlined driver and binding. Such comments can e.g. be help to find testers if someone starts to work on the missing drivers. Signed-off-by: Andreas Kemnade <andreas@kemnade.info> --- arch/arm/boot/dts/nxp/imx/Makefile | 2 + .../dts/nxp/imx/imx6sll-kobo-clara2e-a.dts | 23 + .../dts/nxp/imx/imx6sll-kobo-clara2e-b.dts | 23 + .../nxp/imx/imx6sll-kobo-clara2e-common.dtsi | 514 ++++++++++++++++++ 4 files changed, 562 insertions(+) create mode 100644 arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-a.dts create mode 100644 arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-b.dts create mode 100644 arch/arm/boot/dts/nxp/imx/imx6sll-kobo-clara2e-common.dtsi