[Letux-kernel] [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel

Paul Boddie paul at boddie.org.uk
Wed Dec 23 19:34:17 CET 2020


On Wednesday, 23 December 2020 18:29:46 CET H. Nikolaus Schaller wrote:
> 
> There is some __mmc_start_req() and mmc_wait_for_cmd() activity but the card
> type and size is not decoded. So it appears as if DMA is initialized but
> not running. BTW: the register dump at 13020000 is still almost 0 although
> I now have
> 
> [    0.056651] jz4780-dma 13020000.dma: JZ4780 DMA controller initialised
> 
> which indicates that the address is ok.
> 
> Well, this is low priority at the moment since we have a workaround.

Indeed. It may be more complicated that I realise at the moment.

> > So, I guess that if we were to "override" the uhc definition in the
> > Mipsbook device tree, indicating that the peripheral is enabled (status =
> > "okay"), the necessary events might occur to propagate the external 48MHz
> > clock signal into the SoC and for the USB peripheral to get that signal.
> > But this may be based on a flawed mental model of how this stuff works.
> 
> Yes, indeed that enables USB :)
> 
> It even finds the Zydas trackpad controller and the WiFi module...
> Even firmware loads and I can see at least 3 networks.
> So it now seems possible to do apt-get update :)

At last, things actually work in our favour!

[...]

> Another finding: there is a pwm backlight in /sys/class/backlight but it
> does not respond. Maybe another pinctrl issue.

So this came up as I was looking for the Scroll Lock pin. PWM backlight is 
PC30 or GP94. This needs to be configured for alternate function 1, and the 
pinctrl group "pwm0" should be set up to do this.

I guess I can look into this to see what I did wrong. We rely on the backlight 
being activated by the panel, which is presumably activated by the LCD 
controller, or maybe the other way around. The usual "fun" associated with the 
baroque DRM subsystem.

[...]

> I have found that the right trackpad mouse button was also hooked up for GP9
> which gave a conflict. It should be GP13.
> 
> But the LAN_LED/GP9 (scroll lock) still remains dark on my machine. Could
> also be broken...

I haven't found anything obvious related to this yet.

> >> - trackpad not working (AFAIR it is USB)
> > 
> > Might it not be PS/2, accessible via the KBC (keyboard controller)
> > peripheral? On the schematic, the mousepad is connected to the PS2_KDATA
> > and PS2_KCLK lines.
> 
> Our device tree tries to set them up as GP16 and GP13 (after the fix). At
> least these are going from J501 to the jz4730. I now get a new
> /dev/input/event1 device but the buttons don't respond. Rather they report
> once that both are pressed.
> 
> BTW: the keyboard no longer reports FN keys. Maybe a common issue? Pinmux
> setup?
> 
> Great that I can now boot to a shell and with the full programming manual I
> can play with devmem2 to read/modify the pinmux registers... That likely
> speeds up fixing all the remaining issues.
> 
> So the (priority) list boils down to:
> - µs timer
> - boot speed
> - i2c
> - lcd and backlight pwm
> - keyboard, buttons
> - rtc
> - powerdown/reboot/suspend?
> - dma for mmc
> - ethernet
> - sound
> - nand

There were some clock configuration issues that I am trying to fix in my 
latest patch. I think I was using the wrong input clock for the DMA 
controller: it should be the "fast" device clock for the AHB peripherals, also 
known as HCLK or hclock. Meanwhile, I think the I2C peripheral should have the 
"slow" device clock for the APB peripherals, also known as PCLK or pclock.

Another issue is the LCD device frequency divider whose configuration field is 
described differently in the documentation from the legacy code. I have not 
changed that yet because the legacy code approach has worked in various 
environments, but it is possible that we might encounter problems that are 
explained by this discrepancy.

> I think I will next focus on i2c since I already had made it work 10 years
> ago:
> https://git.goldelico.com/?p=letux-400.git;a=commit;h=3df7a8077465d5aa75106
> b6373ecfb8b7f58b3ec

Maybe the above clock configuration change will help.

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixed-DMA-and-I2C-input-clocks.patch
Type: text/x-patch
Size: 1003 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20201223/3de1ca5b/attachment.bin>


More information about the Letux-kernel mailing list