[solved] Hid controller broken

Started by marcellus, June 25, 2018, 08:00:13 PM

Previous topic - Next topic

marcellus

Hi,

I tried getting the 4.17.1 kernel to run on my teres-i but suddenly my keyboard and touchpad aren't responding anymore.

The latest patch I applied was:
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 20cfb2041..eebdf7483 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -213,13 +213,14 @@
  *  Bits 26-31: not used
  * Since we only ever set buf1 size, we can simply store it directly.
  */
-#define SDXC_IDMAC_DES0_DIC    BIT(1)  /* disable interrupt on completion */
-#define SDXC_IDMAC_DES0_LD BIT(2)  /* last descriptor */
-#define SDXC_IDMAC_DES0_FD BIT(3)  /* first descriptor */
-#define SDXC_IDMAC_DES0_CH BIT(4)  /* chain mode */
-#define SDXC_IDMAC_DES0_ER BIT(5)  /* end of ring */
-#define SDXC_IDMAC_DES0_CES    BIT(30) /* card error summary */
-#define SDXC_IDMAC_DES0_OWN    BIT(31) /* 1-idma owns it, 0-host owns it */
+#define LE32_BIT(n) (cpu_to_le32(BIT(n)))
+#define SDXC_IDMAC_DES0_DIC    LE32_BIT(1)  /* disable interrupt on completion */
+#define SDXC_IDMAC_DES0_LD LE32_BIT(2)  /* last descriptor */
+#define SDXC_IDMAC_DES0_FD LE32_BIT(3)  /* first descriptor */
+#define SDXC_IDMAC_DES0_CH LE32_BIT(4)  /* chain mode */
+#define SDXC_IDMAC_DES0_ER LE32_BIT(5)  /* end of ring */
+#define SDXC_IDMAC_DES0_CES    LE32_BIT(30) /* card error summary */
+#define SDXC_IDMAC_DES0_OWN    LE32_BIT(31) /* 1-idma owns it, 0-host owns it */

  #define SDXC_CLK_400K      0
  #define SDXC_CLK_25M       1
--
2.17.1


The patch is ment to fix the emmc initialisation, however I'm nut sure if it really caused the problem.

usb 1-1.4: USB disconnect, device number 4
usb 1-1.4: new full-speed USB device number 5 using sunxi-ehci
hid-generic 0003:15BA:003B.00FC: hiddev0: USB HID v1.11 Device [HID 15ba:003b] on usb-sunxi-ehci-1.4/input0

and this segment repeats itself every ~5 seconds with an increased device number.


The error occurs in my self compiled kernel and on the gentoo image I put on the micro sd card, which used to work fine before.

So the things I'm wondering about are:


  • I assume the usb id 15ba:003b is related to the hid controller https://www.olimex.com/Products/DIY-Laptop/SPARE-PARTS/TERES-PCB5-KEYBOARD/, is this correct?
  • Am I correct in assuming that as the usb device connects, but resets itself the main pcb should be working?
  • Can someone verify the A64 needs the emmc init set in little endian? Is the patch the cause of the problem?
  • Is it possible I just screwed up the programming of the arduino somehow and all I need is to reflash?
  • Is there any way to work this out without ordering replacement parts? Last time I ordered from olimex it took more than a month to get the delivery

If one of you has an Idea how to proceed I'd really appreciate it.

lambda

Quote from: marcellus on June 25, 2018, 08:00:13 PM
Is there any way to work this out without ordering replacement parts? Last time I ordered from olimex it took more than a month to get the delivery

Since you already tested with the gentoo image, it should be something with the hardware and not a kernel issue, but are you sure your gentoo image is still clean and unchanged? - It need not be a problem with the kernel. Some bootlaoder/devicetree/rootfs change might be responsible as well. Ideally you would start the official image from olimex or maybe use the debian image from the other thread on a new microSD card. (@olimex I think it would be reasonable to make the threads dedicated to software images stick at the top of the overview list.)

Also make sure to remove any external USB devices - I think to little power on the bus for all devices would explain the symptoms ...

If this doesn't help, also try to attach some external USB device and report if it too is caught in the connect/disconnect loop of if it works fine.

HTH,
Harald

marcellus

Quote from: lambda on June 27, 2018, 12:09:27 AM
Since you already tested with the gentoo image, it should be something with the hardware and not a kernel issue, but are you sure your gentoo image is still clean and unchanged? - It need not be a problem with the kernel. Some bootlaoder/devicetree/rootfs change might be responsible as well. Ideally you would start the official image from olimex or maybe use the debian image from the other thread on a new microSD card.

I tested it with the armbian image, still the issue persists.

QuoteAlso make sure to remove any external USB devices - I think to little power on the bus for all devices would explain the symptoms ...

I did already test it with no external usb devices, it didn't change anything.

QuoteIf this doesn't help, also try to attach some external USB device and report if it too is caught in the connect/disconnect loop of if it works fine.

My Usb keyboard and pen drive work fine, I think its really the hid controller that somehow died.

I'm now pretty sure its the hardware and will order a replacement. Still I'd really like to know how I killed it. I found a datasheet for the A64, but can't figure out which register the mmc init should be done in.

Thanks Harald, I'll check back after I got the replacement.

marcellus

Time to wrap things up.

My new keyboard controller arrived today in record time and it solved the problem.

I really have to say the teres is a lot more fun with the keyboard working.