[Lenny400] [Letux-kernel] JZ4730/Minibook framebuffer driver updates

Paul Boddie paul at boddie.org.uk
Sun Sep 10 22:20:06 CEST 2017

On Sunday 10. September 2017 20.55.15 H. Nikolaus Schaller wrote:
> > Am 10.09.2017 um 19:55 schrieb Daniel Glöckner <daniel-gl at gmx.net>:
> > 
> > I've been following the recent activities on this mailing list and I
> > really hope it will lead to mainline support for this device. But did I
> > understand correctly that all of the work so far has been done without
> > booting the new kernel?
> Yes :)

Yes, more or less. I did actually try at a fairly early stage to see what 
might happen, but I doubt that I enabled everything correctly in the kernel 
configuration. And it was probably unrealistic to see if it would work, too.

> I still have to remove dust from my devices (one is still missing) and find
> out which ones are still booting from flash with the built-in 2.4 kernel.
> Next I have to add the uart interface to watch the boot console.

Here, I can only use the machine's external indicators (screen, LEDs) for 
debugging. But I did manage to get a "bare metal" payload working on the Ben 
NanoNote without anything other than the screen for feedback, so it is 
possible to achieve things this way, although it is very frustrating to do so.

> And before booting the 2.6.24, I have to flash a working old SD card first
> :)
> And then we will see if we can get a mainline kernel running...
> Best expectation is that we see
> Starting kernel...
> [0.00000] first messages
> ...
> and then something hangs or emits warnings, errors or kernel panics. Then
> printk() becomes our best friend :)
> Worst expectation is that we do not see anything after
> Starting kernel...
> This is more difficult, but not impossible to debug (even without JTAG). I
> had that on the GTA04 several times during our long journey towards latest
> Letux kernels.

Just having a UART connection is immensely helpful. I deployed L4Re/Fiasco.OC 
on the MIPS Creator CI20 with only UART to help me, and that got me as far as 
actually getting it to boot into the environment, which actually wasn't 
possible when I started to look into it (despite the board having been listed 
as supported). Being able to do simple debugging over the serial connection 
helped a lot.

> But IMHO chances are not thad bad. I looked through Paul's code and
> although I did not understand everything and have not compared, he has
> basically mixed things from the older 2.6.24 kernel and modern (and
> tested) jz4740/80 code.
> So I'd expect the mix to be 80% correct and less than 20% wrong...

The limitations are my understanding of the hardware, which I tried to improve 
by replacing things in the 2.6 kernel and seeing if I broke things, and my 
understanding of how modern kernel code should be written. I've tried to 
either modify existing modern drivers where the differences are small between 
chipsets (for example, the RTC and watchdog drivers) or to write drivers that 
are very similar to the existing ones (for example, the PWM driver).

There is actually no code from 2.6 unless it survived from that era in the 
mainlining process. In other words, I started from the mainlined code and 
introduced the necessary differences for the JZ4730. A good example of this is 
the GPIO support which wasn't there in that form in the 2.6 kernel.

But I will have made mistakes in doing all this, of course. That's why I 
shared the code as soon as I could.


More information about the Lenny400 mailing list