2023-04-15 17:48:38

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH 0/3] Minor device-tree additions for C.H.I.P

This small patch series adds some improvements for the C.H.I.P DTS,
enabling bluetooth, exporting the PMIC temperature details via iio-hwmon
and finally adding the appropriate base pinmux info for an external MMC
card.

Jonathan McDowell (3):
ARM: dts: sun5i: chip: Enable bluetooth
ARM: dts: sun5i: Add port E pinmux settings for mmc2
ARM: dts: axp209: Add iio-hwmon node for internal temperature

arch/arm/boot/dts/axp209.dtsi | 7 +++++++
arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
arch/arm/boot/dts/sun5i.dtsi | 8 ++++++++
3 files changed, 19 insertions(+)

--
2.39.2


2023-04-15 17:59:32

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
up on UART3. Support for this didn't exist in mainline when the DTS was
initially added, but it does now, so enable it.

Signed-off-by: Jonathan McDowell <[email protected]>
---
arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
index fd37bd1f3920..4d72a181d8aa 100644
--- a/arch/arm/boot/dts/sun5i-r8-chip.dts
+++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
@@ -255,6 +255,10 @@ &uart3 {
pinctrl-0 = <&uart3_pg_pins>,
<&uart3_cts_rts_pg_pins>;
status = "okay";
+
+ bluetooth {
+ compatible = "realtek,rtl8723bs-bt";
+ }
};

&usb_otg {
--
2.39.2

2023-04-15 18:12:50

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH 3/3] ARM: dts: axp209: Add iio-hwmon node for internal temperature

This adds a DT node to hook up the internal temperature ADC to the
iio-hwmon driver. The various voltage + current ADCs are consumed and
exposed by their respective drivers, but this is not and is always
available. Naming chosen to match the axp20x_ prefix the power sensors
use.

Signed-off-by: Jonathan McDowell <[email protected]>
---
arch/arm/boot/dts/axp209.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
index ca240cd6f6c3..f00b5a7ec106 100644
--- a/arch/arm/boot/dts/axp209.dtsi
+++ b/arch/arm/boot/dts/axp209.dtsi
@@ -48,6 +48,13 @@
* http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
*/

+/ {
+ axp20x_temp {
+ compatible = "iio-hwmon";
+ io-channels = <&axp_adc 4>; /* Internal temperature */
+ };
+};
+
&axp209 {
compatible = "x-powers,axp209";
interrupt-controller;
--
2.39.2

2023-04-15 18:13:17

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH 2/3] ARM: dts: sun5i: Add port E pinmux settings for mmc2

These alternate pins for mmc2 are brought out to the 40 pin U14 header
on the C.H.I.P and can be used to add an external MMC device with a 4
bit interface. See

https://byteporter.com/ntc-chip-micro-sd-slot/

for further details on how.

Signed-off-by: Jonathan McDowell <[email protected]>
---
arch/arm/boot/dts/sun5i.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
index 250d6b87ab4d..e4922506ce22 100644
--- a/arch/arm/boot/dts/sun5i.dtsi
+++ b/arch/arm/boot/dts/sun5i.dtsi
@@ -517,6 +517,14 @@ mmc2_4bit_pc_pins: mmc2-4bit-pc-pins {
bias-pull-up;
};

+ mmc2_4bit_pe_pins: mmc2-4bit-pe-pins {
+ pins = "PE4", "PE5", "PE6", "PE7",
+ "PE8", "PE9";
+ function = "mmc2";
+ drive-strength = <30>;
+ bias-pull-up;
+ };
+
mmc2_8bit_pins: mmc2-8bit-pins {
pins = "PC6", "PC7", "PC8", "PC9",
"PC10", "PC11", "PC12", "PC13",
--
2.39.2

2023-04-15 20:37:45

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

Hi Jonathan,

kernel test robot noticed the following build errors:

[auto build test ERROR on sunxi/sunxi/for-next]
[also build test ERROR on robh/for-next krzk/for-next krzk-dt/for-next krzk-mem-ctrl/for-next linus/master v6.3-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Jonathan-McDowell/ARM-dts-sun5i-chip-Enable-bluetooth/20230416-014856
base: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
patch link: https://lore.kernel.org/r/f26d11e613df7bd55822ff3fb7689e36bf9e4f7a.1681580558.git.noodles%40earth.li
patch subject: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth
config: arm-defconfig (https://download.01.org/0day-ci/archive/20230416/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/7eb91ccc0e287519d5df2e97e81c3bee553e3535
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jonathan-McDowell/ARM-dts-sun5i-chip-Enable-bluetooth/20230416-014856
git checkout 7eb91ccc0e287519d5df2e97e81c3bee553e3535
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> Error: arch/arm/boot/dts/sun5i-r8-chip.dts:262.1-2 syntax error
FATAL ERROR: Unable to parse input tree

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

2023-04-16 01:21:05

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: dts: sun5i: Add port E pinmux settings for mmc2

On Sat, 15 Apr 2023 18:46:24 +0100
Jonathan McDowell <[email protected]> wrote:

Hi,

> These alternate pins for mmc2 are brought out to the 40 pin U14 header
> on the C.H.I.P and can be used to add an external MMC device with a 4
> bit interface. See
>
> https://byteporter.com/ntc-chip-micro-sd-slot/
>
> for further details on how.
>
> Signed-off-by: Jonathan McDowell <[email protected]>
> ---
> arch/arm/boot/dts/sun5i.dtsi | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
> index 250d6b87ab4d..e4922506ce22 100644
> --- a/arch/arm/boot/dts/sun5i.dtsi
> +++ b/arch/arm/boot/dts/sun5i.dtsi
> @@ -517,6 +517,14 @@ mmc2_4bit_pc_pins: mmc2-4bit-pc-pins {
> bias-pull-up;
> };
>

As this seems to be a highly non-standard and rare modification, that
doesn't even get used in the mainline DT, please add a:
/omit-if-no-ref/
line, so we don't get this into every sun5i board.

Otherwise looks good, though I don't know if that should belong into
the same DT overlay that is probably used to also enable the MMC2 node.

Cheers,
Andre


> + mmc2_4bit_pe_pins: mmc2-4bit-pe-pins {
> + pins = "PE4", "PE5", "PE6", "PE7",
> + "PE8", "PE9";
> + function = "mmc2";
> + drive-strength = <30>;
> + bias-pull-up;
> + };
> +
> mmc2_8bit_pins: mmc2-8bit-pins {
> pins = "PC6", "PC7", "PC8", "PC9",
> "PC10", "PC11", "PC12", "PC13",

2023-04-16 01:21:11

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Sat, 15 Apr 2023 18:46:03 +0100
Jonathan McDowell <[email protected]> wrote:

> The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> up on UART3. Support for this didn't exist in mainline when the DTS was
> initially added, but it does now, so enable it.
>
> Signed-off-by: Jonathan McDowell <[email protected]>
> ---
> arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> index fd37bd1f3920..4d72a181d8aa 100644
> --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> @@ -255,6 +255,10 @@ &uart3 {
> pinctrl-0 = <&uart3_pg_pins>,
> <&uart3_cts_rts_pg_pins>;
> status = "okay";
> +
> + bluetooth {
> + compatible = "realtek,rtl8723bs-bt";
> + }

As the kernel test robot already pointed out, there is a semicolon
missing here.
Otherwise looks good (dt-validate passes), but don't know if there are
any wakeup GPIOs connected (can't seem to find a schematic?).

Cheers,
Andre


> };
>
> &usb_otg {

2023-04-16 07:42:33

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] ARM: dts: axp209: Add iio-hwmon node for internal temperature

On 15/04/2023 19:47, Jonathan McDowell wrote:
> This adds a DT node to hook up the internal temperature ADC to the

Do not use "This commit/patch", but imperative mood. See:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

> iio-hwmon driver. The various voltage + current ADCs are consumed and
> exposed by their respective drivers, but this is not and is always
> available. Naming chosen to match the axp20x_ prefix the power sensors
> use.

Weird choice.

>
> Signed-off-by: Jonathan McDowell <[email protected]>
> ---
> arch/arm/boot/dts/axp209.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
> index ca240cd6f6c3..f00b5a7ec106 100644
> --- a/arch/arm/boot/dts/axp209.dtsi
> +++ b/arch/arm/boot/dts/axp209.dtsi
> @@ -48,6 +48,13 @@
> * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
> */
>
> +/ {
> + axp20x_temp {

No underscores in node names.

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

> + compatible = "iio-hwmon";
> + io-channels = <&axp_adc 4>; /* Internal temperature */
> + };
> +};
> +
> &axp209 {
> compatible = "x-powers,axp209";
> interrupt-controller;

Best regards,
Krzysztof

2023-04-20 19:13:29

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH 3/3] ARM: dts: axp209: Add iio-hwmon node for internal temperature

On Sun, Apr 16, 2023 at 09:27:46AM +0200, Krzysztof Kozlowski wrote:
> On 15/04/2023 19:47, Jonathan McDowell wrote:
> > This adds a DT node to hook up the internal temperature ADC to the
>
> Do not use "This commit/patch", but imperative mood. See:
> https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95
>
> > iio-hwmon driver. The various voltage + current ADCs are consumed and
> > exposed by their respective drivers, but this is not and is always
> > available. Naming chosen to match the axp20x_ prefix the power sensors
> > use.
>
> Weird choice.

You think? I didn't choose the axp20x_ prefix for the others, but it
made sense to me that all the sensors from the same device would be
identifiable as such. From your comment below it sounds like you'd
prefer I use the more generic pmic-temp as the node name? Will do for
v2.

> > Signed-off-by: Jonathan McDowell <[email protected]>
> > ---
> > arch/arm/boot/dts/axp209.dtsi | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
> > index ca240cd6f6c3..f00b5a7ec106 100644
> > --- a/arch/arm/boot/dts/axp209.dtsi
> > +++ b/arch/arm/boot/dts/axp209.dtsi
> > @@ -48,6 +48,13 @@
> > * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
> > */
> >
> > +/ {
> > + axp20x_temp {
>
> No underscores in node names.
>
> Node names should be generic.
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
>
> > + compatible = "iio-hwmon";
> > + io-channels = <&axp_adc 4>; /* Internal temperature */
> > + };
> > +};
> > +
> > &axp209 {
> > compatible = "x-powers,axp209";
> > interrupt-controller;

J.

--
"My house has this new innovation called "windows". Even my bedroom
has them. " -- Paul Tomblin

2023-04-20 19:17:02

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> On Sat, 15 Apr 2023 18:46:03 +0100
> Jonathan McDowell <[email protected]> wrote:
>
> > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > up on UART3. Support for this didn't exist in mainline when the DTS was
> > initially added, but it does now, so enable it.
> >
> > Signed-off-by: Jonathan McDowell <[email protected]>
> > ---
> > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > index fd37bd1f3920..4d72a181d8aa 100644
> > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > @@ -255,6 +255,10 @@ &uart3 {
> > pinctrl-0 = <&uart3_pg_pins>,
> > <&uart3_cts_rts_pg_pins>;
> > status = "okay";
> > +
> > + bluetooth {
> > + compatible = "realtek,rtl8723bs-bt";
> > + }
>
> As the kernel test robot already pointed out, there is a semicolon
> missing here.
> Otherwise looks good (dt-validate passes), but don't know if there are
> any wakeup GPIOs connected (can't seem to find a schematic?).

So there are wakeups, but if I add:

device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */

then some odd sort of dependency issue happens where the serial port
load is deferred waiting for the GPIO to appear, and then the device
doesn't work. Error in dmesg is:

serial serial0-0: deferred probe pending

on 6.3-rc and on 6.1 I get:

dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio

I'm not clear why it's trying to link the serial port to the GPIO; it
seems that it should be the bluetooth device that depends on both the
UART and the GPIO, and that the GPIO is actually optional so shouldn't
hold up loading, but I can't see how that should be represented.

Adding Greg + Saravana in the hope they can tell me what I've done wrong
here. The LED driver using a different GPIO line on the axp209 works
fine, so the device is definitely loaded and working ok.

> > };
> >
> > &usb_otg {
>

J.

--
Sex, truth and jellibabies. | .''`. Debian GNU/Linux Developer
| : :' : Happy to accept PGP signed
| `. `' or encrypted mail - RSA
| `- key on the keyservers.

2023-04-20 19:17:32

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: dts: sun5i: Add port E pinmux settings for mmc2

On Sun, Apr 16, 2023 at 01:47:56AM +0100, Andre Przywara wrote:
> On Sat, 15 Apr 2023 18:46:24 +0100
> Jonathan McDowell <[email protected]> wrote:
>
> Hi,
>
> > These alternate pins for mmc2 are brought out to the 40 pin U14 header
> > on the C.H.I.P and can be used to add an external MMC device with a 4
> > bit interface. See
> >
> > https://byteporter.com/ntc-chip-micro-sd-slot/
> >
> > for further details on how.
> >
> > Signed-off-by: Jonathan McDowell <[email protected]>
> > ---
> > arch/arm/boot/dts/sun5i.dtsi | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
> > index 250d6b87ab4d..e4922506ce22 100644
> > --- a/arch/arm/boot/dts/sun5i.dtsi
> > +++ b/arch/arm/boot/dts/sun5i.dtsi
> > @@ -517,6 +517,14 @@ mmc2_4bit_pc_pins: mmc2-4bit-pc-pins {
> > bias-pull-up;
> > };
> >
>
> As this seems to be a highly non-standard and rare modification, that
> doesn't even get used in the mainline DT, please add a:
> /omit-if-no-ref/
> line, so we don't get this into every sun5i board.

Neat, will add in v2.

> Otherwise looks good, though I don't know if that should belong into
> the same DT overlay that is probably used to also enable the MMC2 node.

I pondered that, but we already have the mmc2-4bit-pc-pins definition
here so it seemed helpful to add the pe-pins too.

> > + mmc2_4bit_pe_pins: mmc2-4bit-pe-pins {
> > + pins = "PE4", "PE5", "PE6", "PE7",
> > + "PE8", "PE9";
> > + function = "mmc2";
> > + drive-strength = <30>;
> > + bias-pull-up;
> > + };
> > +
> > mmc2_8bit_pins: mmc2-8bit-pins {
> > pins = "PC6", "PC7", "PC8", "PC9",
> > "PC10", "PC11", "PC12", "PC13",
>

J.

--
"Where the f**k is all this | .''`. Debian GNU/Linux Developer
water coming from?" -- Captain | : :' : Happy to accept PGP signed
of the Titanic | `. `' or encrypted mail - RSA
| `- key on the keyservers.

2023-04-21 01:53:10

by Saravana Kannan

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <[email protected]> wrote:
>
> On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > On Sat, 15 Apr 2023 18:46:03 +0100
> > Jonathan McDowell <[email protected]> wrote:
> >
> > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > initially added, but it does now, so enable it.
> > >
> > > Signed-off-by: Jonathan McDowell <[email protected]>
> > > ---
> > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > index fd37bd1f3920..4d72a181d8aa 100644
> > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > @@ -255,6 +255,10 @@ &uart3 {
> > > pinctrl-0 = <&uart3_pg_pins>,
> > > <&uart3_cts_rts_pg_pins>;
> > > status = "okay";
> > > +
> > > + bluetooth {
> > > + compatible = "realtek,rtl8723bs-bt";
> > > + }
> >
> > As the kernel test robot already pointed out, there is a semicolon
> > missing here.
> > Otherwise looks good (dt-validate passes), but don't know if there are
> > any wakeup GPIOs connected (can't seem to find a schematic?).
>
> So there are wakeups, but if I add:
>
> device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
>
> then some odd sort of dependency issue happens where the serial port
> load is deferred waiting for the GPIO to appear, and then the device
> doesn't work.

When you say your device doesn't work, are you saying it never probes?
<debugfs>/devices_deferred should tell you what devices have deferred and why.

> Error in dmesg is:
>
> serial serial0-0: deferred probe pending
>
> on 6.3-rc and on 6.1 I get:
>
> dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio

This error message doesn't block anything. So I don't think this is
the cause of your blocking issue. But I still want to understand why
this error message is showing up.

> I'm not clear why it's trying to link the serial port to the GPIO; it
> seems that it should be the bluetooth device that depends on both the
> UART and the GPIO,

A fix for the device link error message went in on v6.3-rc3. Is that
the 6.3 version you tested this on?

Also, I tried looking into the UART driver
(drivers/tty/serial/8250/8250_dw.c) but it wasn't clear how it ends up
populating the bluetooth serial device. If you can point that out,
that'd be helpful (assuming 6.3-rc3 still shows that error message).

> and that the GPIO is actually optional so shouldn't
> hold up loading, but I can't see how that should be represented.

Optional dependencies should get ignored after the default
deferred_probe_timeout runs out and the supplier driver hasn't been
loaded yet.

-Saravana

> Adding Greg + Saravana in the hope they can tell me what I've done wrong
> here. The LED driver using a different GPIO line on the axp209 works
> fine, so the device is definitely loaded and working ok.

2023-04-21 08:41:25

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Thu, Apr 20, 2023 at 06:43:06PM -0700, Saravana Kannan wrote:
> On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <[email protected]> wrote:
> > On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > > On Sat, 15 Apr 2023 18:46:03 +0100
> > > Jonathan McDowell <[email protected]> wrote:
> > >
> > > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > > initially added, but it does now, so enable it.
> > > >
> > > > Signed-off-by: Jonathan McDowell <[email protected]>
> > > > ---
> > > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > > 1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > index fd37bd1f3920..4d72a181d8aa 100644
> > > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > @@ -255,6 +255,10 @@ &uart3 {
> > > > pinctrl-0 = <&uart3_pg_pins>,
> > > > <&uart3_cts_rts_pg_pins>;
> > > > status = "okay";
> > > > +
> > > > + bluetooth {
> > > > + compatible = "realtek,rtl8723bs-bt";
> > > > + }
> > >
> > > As the kernel test robot already pointed out, there is a semicolon
> > > missing here.
> > > Otherwise looks good (dt-validate passes), but don't know if there are
> > > any wakeup GPIOs connected (can't seem to find a schematic?).
> >
> > So there are wakeups, but if I add:
> >
> > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> >
> > then some odd sort of dependency issue happens where the serial port
> > load is deferred waiting for the GPIO to appear, and then the device
> > doesn't work.
>
> When you say your device doesn't work, are you saying it never probes?

The bluetooth device (realtek,rtl8723bs-bt) never appears, apparently
because the UART it's attached to never loads - it doesn't even try to
load the firmware.

> <debugfs>/devices_deferred should tell you what devices have deferred and why.

root@chip:~# cat /sys/kernel/debug/devices_deferred
serial0-0

> > Error in dmesg is:
> >
> > serial serial0-0: deferred probe pending
> >
> > on 6.3-rc and on 6.1 I get:
> >
> > dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio
>
> This error message doesn't block anything. So I don't think this is
> the cause of your blocking issue. But I still want to understand why
> this error message is showing up.
>
> > I'm not clear why it's trying to link the serial port to the GPIO; it
> > seems that it should be the bluetooth device that depends on both the
> > UART and the GPIO,
>
> A fix for the device link error message went in on v6.3-rc3. Is that
> the 6.3 version you tested this on?

I originally tried on 6.1.21, which is where I got the "Failed to create
device link" message. I then moved to 6.3-rc7 as I saw there had been
further changes recently. There I just get the:

serial serial0-0: deferred probe pending

message.

> Also, I tried looking into the UART driver
> (drivers/tty/serial/8250/8250_dw.c) but it wasn't clear how it ends up
> populating the bluetooth serial device. If you can point that out,
> that'd be helpful (assuming 6.3-rc3 still shows that error message).

I have the following in my device tree:

&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pg_pins>,
<&uart3_cts_rts_pg_pins>;
status = "okay";

bluetooth {
compatible = "realtek,rtl8723bs-bt";
device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
};
};

uart3 is a snps,dw-apb-uart, defined in arch/arm/boot/dts/sun5i.dtsi

The UART and AXP209 device drivers are compiled into the kernel:

CONFIG_PINCTRL_AXP209=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DW=y

The bluetooth bits are modules (btrtl, hci_uart).

If I remove the device-wake-gpios line then the Bluetooth device works
fine, and /sys/kernel/debug/devices_deferred is empty.

Somehow it seems like the GPIO is being parsed as a dependency for the
serial port, even though the serial port + GPIO are both dependencies
for the bluetooth device. Even with that, given both are built-in I
don't understand why the serial port never completes setup.

> > and that the GPIO is actually optional so shouldn't
> > hold up loading, but I can't see how that should be represented.
>
> Optional dependencies should get ignored after the default
> deferred_probe_timeout runs out and the supplier driver hasn't been
> loaded yet.

When I say it's optional I mean if it's not listed everything works
fine, but I don't believe there's anyway to express that in the DTS.
It's certainly not required for the serial port, just the bluetooth
device.

J.

--
Web [ Don't be a stranger. ]
site: https:// [ ] Made by
http://www.earth.li/~noodles/ [ ] HuggieTag 0.0.24

2023-04-21 22:50:48

by Saravana Kannan

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Fri, Apr 21, 2023 at 1:28 AM Jonathan McDowell <[email protected]> wrote:
>
> On Thu, Apr 20, 2023 at 06:43:06PM -0700, Saravana Kannan wrote:
> > On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <[email protected]> wrote:
> > > On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > > > On Sat, 15 Apr 2023 18:46:03 +0100
> > > > Jonathan McDowell <[email protected]> wrote:
> > > >
> > > > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > > > initially added, but it does now, so enable it.
> > > > >
> > > > > Signed-off-by: Jonathan McDowell <[email protected]>
> > > > > ---
> > > > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > > > 1 file changed, 4 insertions(+)
> > > > >
> > > > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > index fd37bd1f3920..4d72a181d8aa 100644
> > > > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > @@ -255,6 +255,10 @@ &uart3 {
> > > > > pinctrl-0 = <&uart3_pg_pins>,
> > > > > <&uart3_cts_rts_pg_pins>;
> > > > > status = "okay";
> > > > > +
> > > > > + bluetooth {
> > > > > + compatible = "realtek,rtl8723bs-bt";
> > > > > + }
> > > >
> > > > As the kernel test robot already pointed out, there is a semicolon
> > > > missing here.
> > > > Otherwise looks good (dt-validate passes), but don't know if there are
> > > > any wakeup GPIOs connected (can't seem to find a schematic?).
> > >
> > > So there are wakeups, but if I add:
> > >
> > > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> > >
> > > then some odd sort of dependency issue happens where the serial port
> > > load is deferred waiting for the GPIO to appear, and then the device
> > > doesn't work.
> >
> > When you say your device doesn't work, are you saying it never probes?

Read your whole email and it's a strange issue. Also, going forward to
avoid confusion, only reply to questions with respect to 6.3-rc7.

> The bluetooth device (realtek,rtl8723bs-bt) never appears, apparently
> because the UART it's attached to never loads - it doesn't even try to
> load the firmware.
>
> > <debugfs>/devices_deferred should tell you what devices have deferred and why.
>
> root@chip:~# cat /sys/kernel/debug/devices_deferred
> serial0-0

Do you see this in 6.3-rc7 too?

> > > Error in dmesg is:
> > >
> > > serial serial0-0: deferred probe pending
> > >
> > > on 6.3-rc and on 6.1 I get:
> > >
> > > dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio
> >
> > This error message doesn't block anything. So I don't think this is
> > the cause of your blocking issue. But I still want to understand why
> > this error message is showing up.
> >
> > > I'm not clear why it's trying to link the serial port to the GPIO; it
> > > seems that it should be the bluetooth device that depends on both the
> > > UART and the GPIO,
> >
> > A fix for the device link error message went in on v6.3-rc3. Is that
> > the 6.3 version you tested this on?
>
> I originally tried on 6.1.21, which is where I got the "Failed to create
> device link" message. I then moved to 6.3-rc7 as I saw there had been
> further changes recently. There I just get the:
>
> serial serial0-0: deferred probe pending

If the deferral is related to fw_devlink, you should see the reason
for deferring in the devices_deferred file. So I don't think the issue
is related to fw_devlink.

> message.
>
> > Also, I tried looking into the UART driver
> > (drivers/tty/serial/8250/8250_dw.c) but it wasn't clear how it ends up
> > populating the bluetooth serial device. If you can point that out,
> > that'd be helpful (assuming 6.3-rc3 still shows that error message).
>
> I have the following in my device tree:
>
> &uart3 {
> pinctrl-names = "default";
> pinctrl-0 = <&uart3_pg_pins>,
> <&uart3_cts_rts_pg_pins>;
> status = "okay";
>
> bluetooth {
> compatible = "realtek,rtl8723bs-bt";
> device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> };
> };
>
> uart3 is a snps,dw-apb-uart, defined in arch/arm/boot/dts/sun5i.dtsi
>
> The UART and AXP209 device drivers are compiled into the kernel:
>
> CONFIG_PINCTRL_AXP209=y
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_DW=y
>
> The bluetooth bits are modules (btrtl, hci_uart).
>
> If I remove the device-wake-gpios line then the Bluetooth device works
> fine, and /sys/kernel/debug/devices_deferred is empty.
>
> Somehow it seems like the GPIO is being parsed as a dependency for the
> serial port, even though the serial port + GPIO are both dependencies
> for the bluetooth device.

I'm fairly sure that fw_devlink isn't causing that. Because even
without bluetooth, fw_devlink doesn't consider any suppliers listed in
child DT nodes as mandatory suppliers. That has been the case since
the beginning.

> Even with that, given both are built-in I
> don't understand why the serial port never completes setup.

My guess is that the driver itself has some bug that's sensitive to
device probe order even though it shouldn't.

Can you add #define DEBUG 1 to the top of drivers/base/core.c and
share the boot log? I can try and help debug it.

-Saravana

> > > and that the GPIO is actually optional so shouldn't
> > > hold up loading, but I can't see how that should be represented.
> >
> > Optional dependencies should get ignored after the default
> > deferred_probe_timeout runs out and the supplier driver hasn't been
> > loaded yet.
>
> When I say it's optional I mean if it's not listed everything works
> fine, but I don't believe there's anyway to express that in the DTS.
> It's certainly not required for the serial port, just the bluetooth
> device.
>
> J.
>
> --
> Web [ Don't be a stranger. ]
> site: https:// [ ] Made by
> http://www.earth.li/~noodles/ [ ] HuggieTag 0.0.24

2023-04-24 17:37:49

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Fri, Apr 21, 2023 at 03:45:52PM -0700, Saravana Kannan wrote:
> On Fri, Apr 21, 2023 at 1:28 AM Jonathan McDowell <[email protected]> wrote:
> >
> > On Thu, Apr 20, 2023 at 06:43:06PM -0700, Saravana Kannan wrote:
> > > On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <[email protected]> wrote:
> > > > On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > > > > On Sat, 15 Apr 2023 18:46:03 +0100
> > > > > Jonathan McDowell <[email protected]> wrote:
> > > > >
> > > > > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > > > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > > > > initially added, but it does now, so enable it.
> > > > > >
> > > > > > Signed-off-by: Jonathan McDowell <[email protected]>
> > > > > > ---
> > > > > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > > > > 1 file changed, 4 insertions(+)
> > > > > >
> > > > > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > index fd37bd1f3920..4d72a181d8aa 100644
> > > > > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > @@ -255,6 +255,10 @@ &uart3 {
> > > > > > pinctrl-0 = <&uart3_pg_pins>,
> > > > > > <&uart3_cts_rts_pg_pins>;
> > > > > > status = "okay";
> > > > > > +
> > > > > > + bluetooth {
> > > > > > + compatible = "realtek,rtl8723bs-bt";
> > > > > > + }
> > > > >
> > > > > As the kernel test robot already pointed out, there is a semicolon
> > > > > missing here.
> > > > > Otherwise looks good (dt-validate passes), but don't know if there are
> > > > > any wakeup GPIOs connected (can't seem to find a schematic?).
> > > >
> > > > So there are wakeups, but if I add:
> > > >
> > > > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > > > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> > > >
> > > > then some odd sort of dependency issue happens where the serial port
> > > > load is deferred waiting for the GPIO to appear, and then the device
> > > > doesn't work.
> > >
> > > When you say your device doesn't work, are you saying it never probes?
>
> Read your whole email and it's a strange issue. Also, going forward to
> avoid confusion, only reply to questions with respect to 6.3-rc7.

Just to be clear, in my initial mail I referred to 6.1.21 as that's
where I started, but in my reply to you all output was quoted from
6.3-rc7. 6.3 has been released since, so all details below are based on
that.

> > The bluetooth device (realtek,rtl8723bs-bt) never appears, apparently
> > because the UART it's attached to never loads - it doesn't even try to
> > load the firmware.
> >
> > > <debugfs>/devices_deferred should tell you what devices have deferred and why.
> >
> > root@chip:~# cat /sys/kernel/debug/devices_deferred
> > serial0-0
>
> Do you see this in 6.3-rc7 too?

That was under 6.3-rc7. I see it on 6.3 too:

root@chip:~# cat /sys/kernel/debug/devices_deferred
serial0-0

Without the device-wake-gpios line in the device tree it's empty.

> > > > Error in dmesg is:
> > > >
> > > > serial serial0-0: deferred probe pending
> > > >
> > > > on 6.3-rc and on 6.1 I get:
> > > >
> > > > dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio
> > >
> > > This error message doesn't block anything. So I don't think this is
> > > the cause of your blocking issue. But I still want to understand why
> > > this error message is showing up.
> > >
> > > > I'm not clear why it's trying to link the serial port to the GPIO; it
> > > > seems that it should be the bluetooth device that depends on both the
> > > > UART and the GPIO,
> > >
> > > A fix for the device link error message went in on v6.3-rc3. Is that
> > > the 6.3 version you tested this on?
> >
> > I originally tried on 6.1.21, which is where I got the "Failed to create
> > device link" message. I then moved to 6.3-rc7 as I saw there had been
> > further changes recently. There I just get the:
> >
> > serial serial0-0: deferred probe pending
>
> If the deferral is related to fw_devlink, you should see the reason
> for deferring in the devices_deferred file. So I don't think the issue
> is related to fw_devlink.

Ok.

> > message.
> >
> > > Also, I tried looking into the UART driver
> > > (drivers/tty/serial/8250/8250_dw.c) but it wasn't clear how it ends up
> > > populating the bluetooth serial device. If you can point that out,
> > > that'd be helpful (assuming 6.3-rc3 still shows that error message).
> >
> > I have the following in my device tree:
> >
> > &uart3 {
> > pinctrl-names = "default";
> > pinctrl-0 = <&uart3_pg_pins>,
> > <&uart3_cts_rts_pg_pins>;
> > status = "okay";
> >
> > bluetooth {
> > compatible = "realtek,rtl8723bs-bt";
> > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> > };
> > };
> >
> > uart3 is a snps,dw-apb-uart, defined in arch/arm/boot/dts/sun5i.dtsi
> >
> > The UART and AXP209 device drivers are compiled into the kernel:
> >
> > CONFIG_PINCTRL_AXP209=y
> > CONFIG_SERIAL_8250=y
> > CONFIG_SERIAL_8250_DW=y
> >
> > The bluetooth bits are modules (btrtl, hci_uart).
> >
> > If I remove the device-wake-gpios line then the Bluetooth device works
> > fine, and /sys/kernel/debug/devices_deferred is empty.
> >
> > Somehow it seems like the GPIO is being parsed as a dependency for the
> > serial port, even though the serial port + GPIO are both dependencies
> > for the bluetooth device.
>
> I'm fairly sure that fw_devlink isn't causing that. Because even
> without bluetooth, fw_devlink doesn't consider any suppliers listed in
> child DT nodes as mandatory suppliers. That has been the case since
> the beginning.

Ok, I just got confused with the 6.1 message about the device link and
thought that might be the rough area.

> > Even with that, given both are built-in I
> > don't understand why the serial port never completes setup.
>
> My guess is that the driver itself has some bug that's sensitive to
> device probe order even though it shouldn't.
>
> Can you add #define DEBUG 1 to the top of drivers/base/core.c and
> share the boot log? I can try and help debug it.

Thanks for any input you're able to provide. dmesg from 6.3 with a
failure to complete the probe:

https://the.earth.li/~noodles/chip-bluetooth/6.3-not-working

and just for completeness, without the device-wake-gpios line:

https://the.earth.li/~noodles/chip-bluetooth/6.3-working

J.

--
Most people are descended from apes. Redheads are descended from cats.

2023-05-01 21:19:06

by Saravana Kannan

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Mon, Apr 24, 2023 at 10:34 AM Jonathan McDowell <[email protected]> wrote:
>
> On Fri, Apr 21, 2023 at 03:45:52PM -0700, Saravana Kannan wrote:
> > On Fri, Apr 21, 2023 at 1:28 AM Jonathan McDowell <[email protected]> wrote:
> > >
> > > On Thu, Apr 20, 2023 at 06:43:06PM -0700, Saravana Kannan wrote:
> > > > On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <[email protected]> wrote:
> > > > > On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > > > > > On Sat, 15 Apr 2023 18:46:03 +0100
> > > > > > Jonathan McDowell <[email protected]> wrote:
> > > > > >
> > > > > > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > > > > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > > > > > initially added, but it does now, so enable it.
> > > > > > >
> > > > > > > Signed-off-by: Jonathan McDowell <[email protected]>
> > > > > > > ---
> > > > > > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > > > > > 1 file changed, 4 insertions(+)
> > > > > > >
> > > > > > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > > index fd37bd1f3920..4d72a181d8aa 100644
> > > > > > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > > @@ -255,6 +255,10 @@ &uart3 {
> > > > > > > pinctrl-0 = <&uart3_pg_pins>,
> > > > > > > <&uart3_cts_rts_pg_pins>;
> > > > > > > status = "okay";
> > > > > > > +
> > > > > > > + bluetooth {
> > > > > > > + compatible = "realtek,rtl8723bs-bt";
> > > > > > > + }
> > > > > >
> > > > > > As the kernel test robot already pointed out, there is a semicolon
> > > > > > missing here.
> > > > > > Otherwise looks good (dt-validate passes), but don't know if there are
> > > > > > any wakeup GPIOs connected (can't seem to find a schematic?).
> > > > >
> > > > > So there are wakeups, but if I add:
> > > > >
> > > > > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > > > > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> > > > >
> > > > > then some odd sort of dependency issue happens where the serial port
> > > > > load is deferred waiting for the GPIO to appear, and then the device
> > > > > doesn't work.
> > > >
> > > > When you say your device doesn't work, are you saying it never probes?
> >
> > Read your whole email and it's a strange issue. Also, going forward to
> > avoid confusion, only reply to questions with respect to 6.3-rc7.

Sorry it took a while to respond. Life got busy.

> Just to be clear, in my initial mail I referred to 6.1.21 as that's
> where I started, but in my reply to you all output was quoted from
> 6.3-rc7. 6.3 has been released since, so all details below are based on
> that.
>
> > > The bluetooth device (realtek,rtl8723bs-bt) never appears, apparently
> > > because the UART it's attached to never loads - it doesn't even try to
> > > load the firmware.
> > >
> > > > <debugfs>/devices_deferred should tell you what devices have deferred and why.
> > >
> > > root@chip:~# cat /sys/kernel/debug/devices_deferred
> > > serial0-0
> >
> > Do you see this in 6.3-rc7 too?
>
> That was under 6.3-rc7. I see it on 6.3 too:
>
> root@chip:~# cat /sys/kernel/debug/devices_deferred
> serial0-0

I somehow didn't connect the dots earlier... but serial0-0 is NOT the
uart/serial device. It's the child device of serial0 and in this case,
it's the bluetooth device.

So adding those gpios in DT is not breaking serial. It's just
preventing the BT device from probing.

Looking at the logs in the non-working case:

[ 0.715083] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 53,
base_baud = 1500000) is a U6_16550A
[ 0.724132] device: 'serial0': device_add

I don't know why all of the ttySx are showing up as serial0, but this
is the serial port. As you can see 1c28c00 is already probing.

[ 0.724228] device: 'serial0-0': device_add

This is the child devices getting populated. In this case this is the BT device.

[ 0.724311] device: 'platform:1c20800.pinctrl--serial:serial0-0': device_add

I can tell it's the BT device because we see a device link being
created between pinctrl and serial:serial0-0. So it's a device sitting
on the serial bus.

[ 0.724378] devices_kset: Moving serial0-0 to end of list
[ 0.724390] serial serial0-0: Linked as a consumer to 1c20800.pinctrl
[ 0.724401] /soc/serial@1c28c00/bluetooth Dropping the fwnode link
to /soc/pinctrl@1c20800

And the fwnode like that was converted to device link clearly shows
that the serial0-0 corresponds to the bluetooth node.

[ 0.724441] serial serial0: tty port ttyS1 registered

Serial port works.

>
> Without the device-wake-gpios line in the device tree it's empty.

I think the issue is at the BT driver level or some other framework.

Add a print at the start of the BT driver to see if the probe() is
actually getting called. I'm guessing it is and it's returning an
error from within.

If you don't see that print, then debug the really_probe() function to
see how far within it the BT device goes through before it errors out.
It's possible pinctrl_bind_pins() in really_probe() fails for the BT
device because of how the GPIO pins are configured in your DT.

Thanks,
Saravana

>
> > > > > Error in dmesg is:
> > > > >
> > > > > serial serial0-0: deferred probe pending
> > > > >
> > > > > on 6.3-rc and on 6.1 I get:
> > > > >
> > > > > dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio
> > > >
> > > > This error message doesn't block anything. So I don't think this is
> > > > the cause of your blocking issue. But I still want to understand why
> > > > this error message is showing up.
> > > >
> > > > > I'm not clear why it's trying to link the serial port to the GPIO; it
> > > > > seems that it should be the bluetooth device that depends on both the
> > > > > UART and the GPIO,
> > > >
> > > > A fix for the device link error message went in on v6.3-rc3. Is that
> > > > the 6.3 version you tested this on?
> > >
> > > I originally tried on 6.1.21, which is where I got the "Failed to create
> > > device link" message. I then moved to 6.3-rc7 as I saw there had been
> > > further changes recently. There I just get the:
> > >
> > > serial serial0-0: deferred probe pending
> >
> > If the deferral is related to fw_devlink, you should see the reason
> > for deferring in the devices_deferred file. So I don't think the issue
> > is related to fw_devlink.
>
> Ok.
>
> > > message.
> > >
> > > > Also, I tried looking into the UART driver
> > > > (drivers/tty/serial/8250/8250_dw.c) but it wasn't clear how it ends up
> > > > populating the bluetooth serial device. If you can point that out,
> > > > that'd be helpful (assuming 6.3-rc3 still shows that error message).
> > >
> > > I have the following in my device tree:
> > >
> > > &uart3 {
> > > pinctrl-names = "default";
> > > pinctrl-0 = <&uart3_pg_pins>,
> > > <&uart3_cts_rts_pg_pins>;
> > > status = "okay";
> > >
> > > bluetooth {
> > > compatible = "realtek,rtl8723bs-bt";
> > > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> > > };
> > > };
> > >
> > > uart3 is a snps,dw-apb-uart, defined in arch/arm/boot/dts/sun5i.dtsi
> > >
> > > The UART and AXP209 device drivers are compiled into the kernel:
> > >
> > > CONFIG_PINCTRL_AXP209=y
> > > CONFIG_SERIAL_8250=y
> > > CONFIG_SERIAL_8250_DW=y
> > >
> > > The bluetooth bits are modules (btrtl, hci_uart).
> > >
> > > If I remove the device-wake-gpios line then the Bluetooth device works
> > > fine, and /sys/kernel/debug/devices_deferred is empty.
> > >
> > > Somehow it seems like the GPIO is being parsed as a dependency for the
> > > serial port, even though the serial port + GPIO are both dependencies
> > > for the bluetooth device.
> >
> > I'm fairly sure that fw_devlink isn't causing that. Because even
> > without bluetooth, fw_devlink doesn't consider any suppliers listed in
> > child DT nodes as mandatory suppliers. That has been the case since
> > the beginning.
>
> Ok, I just got confused with the 6.1 message about the device link and
> thought that might be the rough area.
>
> > > Even with that, given both are built-in I
> > > don't understand why the serial port never completes setup.
> >
> > My guess is that the driver itself has some bug that's sensitive to
> > device probe order even though it shouldn't.
> >
> > Can you add #define DEBUG 1 to the top of drivers/base/core.c and
> > share the boot log? I can try and help debug it.
>
> Thanks for any input you're able to provide. dmesg from 6.3 with a
> failure to complete the probe:
>
> https://the.earth.li/~noodles/chip-bluetooth/6.3-not-working
>
> and just for completeness, without the device-wake-gpios line:
>
> https://the.earth.li/~noodles/chip-bluetooth/6.3-working
>
> J.
>
> --
> Most people are descended from apes. Redheads are descended from cats.

2023-05-10 11:52:22

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth

On Mon, May 01, 2023 at 02:12:05PM -0700, Saravana Kannan wrote:
> On Mon, Apr 24, 2023 at 10:34 AM Jonathan McDowell <[email protected]> wrote:
> >
> > On Fri, Apr 21, 2023 at 03:45:52PM -0700, Saravana Kannan wrote:
> > > On Fri, Apr 21, 2023 at 1:28 AM Jonathan McDowell <[email protected]> wrote:
> > > >
> > > > On Thu, Apr 20, 2023 at 06:43:06PM -0700, Saravana Kannan wrote:
> > > > > On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <[email protected]> wrote:
> > > > > > On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > > > > > > On Sat, 15 Apr 2023 18:46:03 +0100
> > > > > > > Jonathan McDowell <[email protected]> wrote:
> > > > > > >
> > > > > > > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > > > > > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > > > > > > initially added, but it does now, so enable it.
> > > > > > > >
> > > > > > > > Signed-off-by: Jonathan McDowell <[email protected]>
> > > > > > > > ---
> > > > > > > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > > > > > > 1 file changed, 4 insertions(+)
> > > > > > > >
> > > > > > > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > > > index fd37bd1f3920..4d72a181d8aa 100644
> > > > > > > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > > > > > > @@ -255,6 +255,10 @@ &uart3 {
> > > > > > > > pinctrl-0 = <&uart3_pg_pins>,
> > > > > > > > <&uart3_cts_rts_pg_pins>;
> > > > > > > > status = "okay";
> > > > > > > > +
> > > > > > > > + bluetooth {
> > > > > > > > + compatible = "realtek,rtl8723bs-bt";
> > > > > > > > + }
> > > > > > >
> > > > > > > As the kernel test robot already pointed out, there is a semicolon
> > > > > > > missing here.
> > > > > > > Otherwise looks good (dt-validate passes), but don't know if there are
> > > > > > > any wakeup GPIOs connected (can't seem to find a schematic?).
> > > > > >
> > > > > > So there are wakeups, but if I add:
> > > > > >
> > > > > > device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> > > > > > host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
> > > > > >
> > > > > > then some odd sort of dependency issue happens where the serial port
> > > > > > load is deferred waiting for the GPIO to appear, and then the device
> > > > > > doesn't work.
> > > > >
> > > > > When you say your device doesn't work, are you saying it never probes?
> > >
> > > Read your whole email and it's a strange issue. Also, going forward to
> > > avoid confusion, only reply to questions with respect to 6.3-rc7.
>
> Sorry it took a while to respond. Life got busy.

No problem, I appreciate you looking into this.

> > Just to be clear, in my initial mail I referred to 6.1.21 as that's
> > where I started, but in my reply to you all output was quoted from
> > 6.3-rc7. 6.3 has been released since, so all details below are based on
> > that.
> >
> > > > The bluetooth device (realtek,rtl8723bs-bt) never appears, apparently
> > > > because the UART it's attached to never loads - it doesn't even try to
> > > > load the firmware.
> > > >
> > > > > <debugfs>/devices_deferred should tell you what devices have deferred and why.
> > > >
> > > > root@chip:~# cat /sys/kernel/debug/devices_deferred
> > > > serial0-0
> > >
> > > Do you see this in 6.3-rc7 too?
> >
> > That was under 6.3-rc7. I see it on 6.3 too:
> >
> > root@chip:~# cat /sys/kernel/debug/devices_deferred
> > serial0-0
>
> I somehow didn't connect the dots earlier... but serial0-0 is NOT the
> uart/serial device. It's the child device of serial0 and in this case,
> it's the bluetooth device.
>
> So adding those gpios in DT is not breaking serial. It's just
> preventing the BT device from probing.

Aaaaah.

> Looking at the logs in the non-working case:
>
> [ 0.715083] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 53,
> base_baud = 1500000) is a U6_16550A
> [ 0.724132] device: 'serial0': device_add
>
> I don't know why all of the ttySx are showing up as serial0, but this
> is the serial port. As you can see 1c28c00 is already probing.
>
> [ 0.724228] device: 'serial0-0': device_add
>
> This is the child devices getting populated. In this case this is the BT device.
>
> [ 0.724311] device: 'platform:1c20800.pinctrl--serial:serial0-0': device_add
>
> I can tell it's the BT device because we see a device link being
> created between pinctrl and serial:serial0-0. So it's a device sitting
> on the serial bus.
>
> [ 0.724378] devices_kset: Moving serial0-0 to end of list
> [ 0.724390] serial serial0-0: Linked as a consumer to 1c20800.pinctrl
> [ 0.724401] /soc/serial@1c28c00/bluetooth Dropping the fwnode link
> to /soc/pinctrl@1c20800
>
> And the fwnode like that was converted to device link clearly shows
> that the serial0-0 corresponds to the bluetooth node.
>
> [ 0.724441] serial serial0: tty port ttyS1 registered
>
> Serial port works.
>
> >
> > Without the device-wake-gpios line in the device tree it's empty.
>
> I think the issue is at the BT driver level or some other framework.
>
> Add a print at the start of the BT driver to see if the probe() is
> actually getting called. I'm guessing it is and it's returning an
> error from within.
>
> If you don't see that print, then debug the really_probe() function to
> see how far within it the BT device goes through before it errors out.
> It's possible pinctrl_bind_pins() in really_probe() fails for the BT
> device because of how the GPIO pins are configured in your DT.

Thank you! That was exactly the pointer I needed to go and find the
actual issue, which is a real facepalm moment. The AXP209 driver does
not have support for GPIO3 (which is in a different register and needs a
bunch of special casing). So the Bluetooth driver tries to request it
and gets failures, so can't complete the probe.

I've added support to the pinctrl-axp209 driver for GPIO3 and everything
is working just fine now. I'll get that cleaned up and a v2 patch set
submitted. Thanks for all your help.

J.

--
101 things you can't have too much of : 49 - Bandwidth.
This .sig brought to you by the letter V and the number 8
Product of the Republic of HuggieTag

2023-05-10 12:39:11

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH v2 0/5] Minor device-tree additions for C.H.I.P

This small patch series adds some improvements for the C.H.I.P DTS,
enabling bluetooth, exporting the PMIC temperature details via iio-hwmon
and finally adding the appropriate base pinmux info for an external MMC
card. As a pre-requisite for the Bluetooth it also adds support to the
AXP209 driver for GPIO3, which is the Bluetooth device wakeup line.

v2:
- Fix missing ; on bluetooth stanza in DTS
- Add device/host wake GPIOs for Bluetooth device
- Add omit-if-no-ref on the port E pinmux stanza
- Rename axp20x_temp to pmic-temp
- Add AXP209 GPIO3 support

Jonathan McDowell (5):
dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema
pinctrl: axp209: Add support for GPIO3 on the AXP209
ARM: dts: sun5i: chip: Enable bluetooth
ARM: dts: sun5i: Add port E pinmux settings for mmc2
ARM: dts: axp209: Add iio-hwmon node for internal temperature

.../bindings/gpio/x-powers,axp209-gpio.yaml | 1 +
arch/arm/boot/dts/axp209.dtsi | 7 ++++
arch/arm/boot/dts/sun5i-r8-chip.dts | 6 +++
arch/arm/boot/dts/sun5i.dtsi | 9 ++++
drivers/pinctrl/pinctrl-axp209.c | 42 +++++++++++++++++++
5 files changed, 65 insertions(+)

--
2.39.2


2023-05-10 12:41:38

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH v2 2/5] pinctrl: axp209: Add support for GPIO3 on the AXP209

The AXP209 device has a 4th GPIO which has a slightly different register
setup, where the control + status bits are held in a single register
rather than sharing AXP20X_GPIO20_SS with GPIOs 0-2.

Signed-off-by: Jonathan McDowell <[email protected]>
---
drivers/pinctrl/pinctrl-axp209.c | 42 ++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c
index 0bc1b381a2b8..317691aee86b 100644
--- a/drivers/pinctrl/pinctrl-axp209.c
+++ b/drivers/pinctrl/pinctrl-axp209.c
@@ -30,6 +30,11 @@
#define AXP20X_GPIO_FUNCTION_OUT_HIGH 1
#define AXP20X_GPIO_FUNCTION_INPUT 2

+#define AXP20X_GPIO3_FUNCTIONS (BIT(2) | BIT(1))
+#define AXP20X_GPIO3_FUNCTION_OUT_LOW 0
+#define AXP20X_GPIO3_FUNCTION_OUT_HIGH BIT(1)
+#define AXP20X_GPIO3_FUNCTION_INPUT BIT(2)
+
#define AXP20X_FUNC_GPIO_OUT 0
#define AXP20X_FUNC_GPIO_IN 1
#define AXP20X_FUNC_LDO 2
@@ -73,6 +78,7 @@ static const struct pinctrl_pin_desc axp209_pins[] = {
PINCTRL_PIN(0, "GPIO0"),
PINCTRL_PIN(1, "GPIO1"),
PINCTRL_PIN(2, "GPIO2"),
+ PINCTRL_PIN(3, "GPIO3"),
};

static const struct pinctrl_pin_desc axp22x_pins[] = {
@@ -130,6 +136,14 @@ static int axp20x_gpio_get(struct gpio_chip *chip, unsigned int offset)
unsigned int val;
int ret;

+ /* AXP209 has GPIO3 status sharing the settings register */
+ if (offset == 3) {
+ ret = regmap_read(pctl->regmap, AXP20X_GPIO3_CTRL, &val);
+ if (ret)
+ return ret;
+ return !!(val & BIT(0));
+ }
+
ret = regmap_read(pctl->regmap, AXP20X_GPIO20_SS, &val);
if (ret)
return ret;
@@ -144,6 +158,17 @@ static int axp20x_gpio_get_direction(struct gpio_chip *chip,
unsigned int val;
int reg, ret;

+ /* AXP209 GPIO3 settings have a different layout */
+ if (offset == 3) {
+ ret = regmap_read(pctl->regmap, AXP20X_GPIO3_CTRL, &val);
+ if (ret)
+ return ret;
+ if (val & AXP20X_GPIO3_FUNCTION_INPUT)
+ return GPIO_LINE_DIRECTION_IN;
+ else
+ return GPIO_LINE_DIRECTION_OUT;
+ }
+
reg = axp20x_gpio_get_reg(offset);
if (reg < 0)
return reg;
@@ -184,6 +209,15 @@ static void axp20x_gpio_set(struct gpio_chip *chip, unsigned int offset,
struct axp20x_pctl *pctl = gpiochip_get_data(chip);
int reg;

+ /* AXP209 has GPIO3 status sharing the settings register */
+ if (offset == 3) {
+ regmap_update_bits(pctl->regmap, AXP20X_GPIO3_CTRL,
+ AXP20X_GPIO3_FUNCTIONS,
+ value ? AXP20X_GPIO3_FUNCTION_OUT_HIGH :
+ AXP20X_GPIO3_FUNCTION_OUT_LOW);
+ return;
+ }
+
reg = axp20x_gpio_get_reg(offset);
if (reg < 0)
return;
@@ -200,6 +234,14 @@ static int axp20x_pmx_set(struct pinctrl_dev *pctldev, unsigned int offset,
struct axp20x_pctl *pctl = pinctrl_dev_get_drvdata(pctldev);
int reg;

+ /* AXP209 GPIO3 settings have a different layout */
+ if (offset == 3) {
+ return regmap_update_bits(pctl->regmap, AXP20X_GPIO3_CTRL,
+ AXP20X_GPIO3_FUNCTIONS,
+ config == AXP20X_MUX_GPIO_OUT ? AXP20X_GPIO3_FUNCTION_OUT_LOW :
+ AXP20X_GPIO3_FUNCTION_INPUT);
+ }
+
reg = axp20x_gpio_get_reg(offset);
if (reg < 0)
return reg;
--
2.39.2


2023-05-10 12:48:05

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH v2 3/5] ARM: dts: sun5i: chip: Enable bluetooth

The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
up on UART3. Support for this didn't exist in mainline when the DTS was
initially added, but it does now, so enable it.

Signed-off-by: Jonathan McDowell <[email protected]>
---
arch/arm/boot/dts/sun5i-r8-chip.dts | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
index fd37bd1f3920..4192c23848c3 100644
--- a/arch/arm/boot/dts/sun5i-r8-chip.dts
+++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
@@ -255,6 +255,12 @@ &uart3 {
pinctrl-0 = <&uart3_pg_pins>,
<&uart3_cts_rts_pg_pins>;
status = "okay";
+
+ bluetooth {
+ compatible = "realtek,rtl8723bs-bt";
+ device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_HIGH>;
+ host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+ };
};

&usb_otg {
--
2.39.2


2023-05-10 12:49:11

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH v2 1/5] dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema

The AXP209 has a 4th GPIO, so add it in preparation for support in the
driver.

Signed-off-by: Jonathan McDowell <[email protected]>
---
Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml b/Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
index 31906c253940..1638cfe90f1c 100644
--- a/Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
@@ -44,6 +44,7 @@ patternProperties:
- GPIO0
- GPIO1
- GPIO2
+ - GPIO3

function:
enum:
--
2.39.2


2023-05-10 14:31:49

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] pinctrl: axp209: Add support for GPIO3 on the AXP209

Wed, May 10, 2023 at 01:01:27PM +0100, Jonathan McDowell kirjoitti:
> The AXP209 device has a 4th GPIO which has a slightly different register
> setup, where the control + status bits are held in a single register
> rather than sharing AXP20X_GPIO20_SS with GPIOs 0-2.

...

> +#define AXP20X_GPIO3_FUNCTIONS (BIT(2) | BIT(1))

GENMASK() ?

...


> +#define AXP20X_GPIO3_FUNCTION_OUT_LOW 0
> +#define AXP20X_GPIO3_FUNCTION_OUT_HIGH BIT(1)
> +#define AXP20X_GPIO3_FUNCTION_INPUT BIT(2)

Seems mixed use of decimal and bitwise values, switch to decimal, since it
makes more sense in my opinion.

...

> + if (offset == 3) {
> + ret = regmap_read(pctl->regmap, AXP20X_GPIO3_CTRL, &val);
> + if (ret)
> + return ret;
> + if (val & AXP20X_GPIO3_FUNCTION_INPUT)
> + return GPIO_LINE_DIRECTION_IN;

> + else

Redundant 'else'.

> + return GPIO_LINE_DIRECTION_OUT;
> + }


--
With Best Regards,
Andy Shevchenko



2023-05-11 15:46:37

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] ARM: dts: sun5i: chip: Enable bluetooth

Dne sreda, 10. maj 2023 ob 14:01:43 CEST je Jonathan McDowell napisal(a):
> The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> up on UART3. Support for this didn't exist in mainline when the DTS was
> initially added, but it does now, so enable it.
>
> Signed-off-by: Jonathan McDowell <[email protected]>

Acked-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej



2023-05-11 15:47:03

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema

Dne sreda, 10. maj 2023 ob 14:01:12 CEST je Jonathan McDowell napisal(a):
> The AXP209 has a 4th GPIO, so add it in preparation for support in the
> driver.
>
> Signed-off-by: Jonathan McDowell <[email protected]>

Acked-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej



2023-05-11 19:06:08

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema

On Wed, May 10, 2023 at 01:01:12PM +0100, Jonathan McDowell wrote:
> The AXP209 has a 4th GPIO, so add it in preparation for support in the
> driver.
>
> Signed-off-by: Jonathan McDowell <[email protected]>

Acked-by: Conor Dooley <[email protected]>

Thanks,
Conor.


Attachments:
(No filename) (286.00 B)
signature.asc (235.00 B)
Download all attachments

2023-05-16 18:08:49

by Jonathan McDowell

[permalink] [raw]
Subject: [PATCH v3 0/5] Minor device-tree additions for C.H.I.P

This small patch series adds some improvements for the C.H.I.P DTS,
enabling bluetooth, exporting the PMIC temperature details via iio-hwmon
and finally adding the appropriate base pinmux info for an external MMC
card. As a pre-requisite for the Bluetooth it also adds support to the
AXP209 driver for GPIO3, which is the Bluetooth device wakeup line.

v3:
- Add Reviewed-By/Acked-Bys
- Drop redundant else
- Switch to GENMASK/decimal values for GPIO3 function defs
v2:
- Fix missing ; on bluetooth stanza in DTS
- Add device/host wake GPIOs for Bluetooth device
- Add omit-if-no-ref on the port E pinmux stanza
- Rename axp20x_temp to pmic-temp
- Add AXP209 GPIO3 support

Jonathan McDowell (5):
dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema
pinctrl: axp209: Add support for GPIO3 on the AXP209
ARM: dts: sun5i: chip: Enable bluetooth
ARM: dts: sun5i: Add port E pinmux settings for mmc2
ARM: dts: axp209: Add iio-hwmon node for internal temperature

.../bindings/gpio/x-powers,axp209-gpio.yaml | 1 +
arch/arm/boot/dts/axp209.dtsi | 7 ++++
arch/arm/boot/dts/sun5i-r8-chip.dts | 6 +++
arch/arm/boot/dts/sun5i.dtsi | 9 ++++
drivers/pinctrl/pinctrl-axp209.c | 42 +++++++++++++++++++
5 files changed, 65 insertions(+)

--
2.39.2


2023-05-29 10:25:41

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] pinctrl: axp209: Add support for GPIO3 on the AXP209

On Wed, May 10, 2023 at 2:01 PM Jonathan McDowell <[email protected]> wrote:

> The AXP209 device has a 4th GPIO which has a slightly different register
> setup, where the control + status bits are held in a single register
> rather than sharing AXP20X_GPIO20_SS with GPIOs 0-2.
>
> Signed-off-by: Jonathan McDowell <[email protected]>

This patch 2/5 applied to the pinctrl tree.

I just assume it is fine to apply this one patch, Bartosz already
applied the binding patch.

Tell me if this works.

Yours,
Linus Walleij

2023-05-31 21:31:09

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH v3 0/5] Minor device-tree additions for C.H.I.P

Dne torek, 16. maj 2023 ob 19:46:55 CEST je Jonathan McDowell napisal(a):
> This small patch series adds some improvements for the C.H.I.P DTS,
> enabling bluetooth, exporting the PMIC temperature details via iio-hwmon
> and finally adding the appropriate base pinmux info for an external MMC
> card. As a pre-requisite for the Bluetooth it also adds support to the
> AXP209 driver for GPIO3, which is the Bluetooth device wakeup line.
>
> v3:
> - Add Reviewed-By/Acked-Bys
> - Drop redundant else
> - Switch to GENMASK/decimal values for GPIO3 function defs
> v2:
> - Fix missing ; on bluetooth stanza in DTS
> - Add device/host wake GPIOs for Bluetooth device
> - Add omit-if-no-ref on the port E pinmux stanza
> - Rename axp20x_temp to pmic-temp
> - Add AXP209 GPIO3 support
>
> Jonathan McDowell (5):
> dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema
> pinctrl: axp209: Add support for GPIO3 on the AXP209
> ARM: dts: sun5i: chip: Enable bluetooth
> ARM: dts: sun5i: Add port E pinmux settings for mmc2
> ARM: dts: axp209: Add iio-hwmon node for internal temperature

Patches 3-5 applied to sunxi tree. Thanks!

Best regards,
Jernej

>
> .../bindings/gpio/x-powers,axp209-gpio.yaml | 1 +
> arch/arm/boot/dts/axp209.dtsi | 7 ++++
> arch/arm/boot/dts/sun5i-r8-chip.dts | 6 +++
> arch/arm/boot/dts/sun5i.dtsi | 9 ++++
> drivers/pinctrl/pinctrl-axp209.c | 42 +++++++++++++++++++
> 5 files changed, 65 insertions(+)
>
>





2023-06-01 07:54:11

by Jonathan McDowell

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] pinctrl: axp209: Add support for GPIO3 on the AXP209

On Mon, May 29, 2023 at 11:51:46AM +0200, Linus Walleij wrote:
> On Wed, May 10, 2023 at 2:01 PM Jonathan McDowell <[email protected]> wrote:
> > The AXP209 device has a 4th GPIO which has a slightly different register
> > setup, where the control + status bits are held in a single register
> > rather than sharing AXP20X_GPIO20_SS with GPIOs 0-2.
> >
> > Signed-off-by: Jonathan McDowell <[email protected]>
>
> This patch 2/5 applied to the pinctrl tree.
>
> I just assume it is fine to apply this one patch, Bartosz already
> applied the binding patch.
>
> Tell me if this works.

Everything else seems to have been picked up, so that works for me.


J.

--
Revd Jonathan McDowell, ULC | Even the Evening Herald slags me off.