[BUG]odroid-c2 does not hotplug usb-devices

Otto Meier gf435 at gmx.net
Sat Dec 19 13:41:29 EST 2020


Hi Martin,

Am 19.12.20 um 14:58 schrieb Martin Blumenstingl:
> Hi Otto,
>
> On Mon, Dec 14, 2020 at 8:34 PM Otto Meier <gf435 at gmx.net> wrote:
>> Hi Martin,
>>
>> Am 13.12.20 um 19:46 schrieb Martin Blumenstingl:
>>> Hi Otto,
>>>
>>> On Mon, Dec 7, 2020 at 1:43 PM Otto Meier <gf435 at gmx.net> wrote:
>>> [...]
>>>>>> So with the latest u-boot and the kernel from https://github.com/chewitt/linux/tree/amlogic-5.10.y
>>>>>> commit 725fc8df7898102f9031ba2075f763884ffa3ee8 everything is working again.
>>>>>> USB does hotplugging as expected.
>>>>> So, this fixes USB under Linux ?? It's not clear
>>> if you have time it would be great if you could figure out which of
>>> the patches from Christian's tree fixes USB hotplugging for you.
>>> Or is it fixed in Linux 5.10-rcX even without any patches?
>>>
>> The new mainline kernel 5.10.0 from Linus, without any other patches
>> does detect USB hotpluging,
>> when using u-boot DMI: Hardkernel Co., Ltd. ODROID-C2/ODROID-C2, BIOS
>> 2021.01-rc3-00039-gec79f5ce22-dirty 12/08/2020
>> and the following u-boot patch:
> [...]
>> When i use the last unpatched emmc bootable u-boot 2020.04 the kernel
>> boots, but usb hotplugging
>> does not work.
> Thank you for testing this!
>
>> Hope this describes my findings. If i can help further, please give me a
>> note.
> to be honest: I am a bit lost here. I don't understand how the BOOT_*
> pins interfere with USB.
> I also don't have any Odroid-C2 board myself so I cannot do any
> experiments myself.
> Neil, please let me know if you have any idea here.
The latest Patch from Neil in U-boot also
fixes all the problems:

This fixes the wrong usage of clrsetbits_le32(), badly setting the set argument.

Fixes: c4c726c26b ("pinctrl: meson: add pinconf support")
Reported-by: Anton Arapov<arapov at gmail.com>
Reported-by: Otto Meier<gf435 at gmx.net>
Signed-off-by: Neil Armstrong<narmstrong at baylibre.com>
---
Hi Anton, Otto,

This should fix eMMC booting on Odroid-C2, could you have a quick try to confirm ?

Thanks,
Neil

  drivers/pinctrl/meson/pinctrl-meson.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index d4539b02d8..5065b62436 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -216,13 +216,13 @@ static int meson_pinconf_bias_set(struct udevice *dev, unsigned int pin,
         }

         /* othewise, enable the bias and select level */
-       clrsetbits_le32(priv->reg_pullen + reg, BIT(bit), 1);
+       clrsetbits_le32(priv->reg_pullen + reg, BIT(bit), BIT(bit));
         ret = meson_gpio_calc_reg_and_bit(dev, offset, REG_PULL, &reg, &bit);
         if (ret)
                 return ret;

         clrsetbits_le32(priv->reg_pull + reg, BIT(bit),
-                       param == PIN_CONFIG_BIAS_PULL_UP);
+                       (param == PIN_CONFIG_BIAS_PULL_UP ? BIT(bit) : 0));

         return 0;
  }
--
2.25.1

perhaps this gives an idea of what was wrong.
But anyhow for me the issues with U-boot and usb hotplug is solved so far.
For me this is even more i understand.


>
> Best regards,
> Martin
>
Thanks for your help.

Otto



More information about the linux-amlogic mailing list