mbox series

[v2,0/8] OLPC 1.75 Keyboard/Touchpad fixes

Message ID 20181010142504.233467-1-lkundrak@v3.sk (mailing list archive)
Headers show
Series OLPC 1.75 Keyboard/Touchpad fixes | expand

Message

Lubomir Rintel Oct. 10, 2018, 2:24 p.m. UTC
This makes keyboard/touchpad work on a DT MMP2 platform.

I believe that it would be a good idea if this, once reviewed, went in
via the input tree. The DT and CLK parts got reviews/acks.

Changes from v1:
- Basically none, just re-send, including Ack and Review tags in patches
  that received them. Plus an extra Cc.
  I'd be very thankful for reviews.

Lubi

Comments

Pavel Machek Oct. 15, 2018, 7:56 p.m. UTC | #1
Hi!

> This makes keyboard/touchpad work on a DT MMP2 platform.
> 
> I believe that it would be a good idea if this, once reviewed, went in
> via the input tree. The DT and CLK parts got reviews/acks.
> 
> Changes from v1:
> - Basically none, just re-send, including Ack and Review tags in patches
>   that received them. Plus an extra Cc.
>   I'd be very thankful for reviews.

Ok, I believe I have OLPC 1.75, and it is actually a nice
machine. Can I get recent kernel working there in useful fashion? (Is
there docs somewhere)?

Thanks,
									Pavel
Lubomir Rintel Oct. 16, 2018, 9:44 a.m. UTC | #2
Hello Pavel,

On Mon, 2018-10-15 at 21:56 +0200, Pavel Machek wrote:
> Hi!
> 
> > This makes keyboard/touchpad work on a DT MMP2 platform.
> > 
> > I believe that it would be a good idea if this, once reviewed, went
> > in
> > via the input tree. The DT and CLK parts got reviews/acks.
> > 
> > Changes from v1:
> > - Basically none, just re-send, including Ack and Review tags in
> > patches
> >   that received them. Plus an extra Cc.
> >   I'd be very thankful for reviews.
> 
> Ok, I believe I have OLPC 1.75, and it is actually a nice
> machine. Can I get recent kernel working there in useful fashion? (Is
> there docs somewhere)?

A lovely machine indeed. I've written this now:

https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75

I didn't test it yet -- will do when I get home in the evening. But
chances are it's good enough and I guess you'd be able to get it
working even if I messed up some details.

Please let me know if it works for you -- I'm having trouble getting
reviews/acks/tested-bys for the XO-1.75 patch sets [1] and will be
super thankful if I get some feedback from you.

[1] https://lore.kernel.org/patchwork/bundle/lkundrak/OLPC%20XO%201.75/

> 
> Thanks,
> 									
> Pavel

Cheers,
Lubo
Pavel Machek Oct. 30, 2018, 10:01 a.m. UTC | #3
Hi!

> > > This makes keyboard/touchpad work on a DT MMP2 platform.
> > > 
> > > I believe that it would be a good idea if this, once reviewed, went
> > > in
> > > via the input tree. The DT and CLK parts got reviews/acks.
> > > 
> > > Changes from v1:
> > > - Basically none, just re-send, including Ack and Review tags in
> > > patches
> > >   that received them. Plus an extra Cc.
> > >   I'd be very thankful for reviews.
> > 
> > Ok, I believe I have OLPC 1.75, and it is actually a nice
> > machine. Can I get recent kernel working there in useful fashion? (Is
> > there docs somewhere)?
> 
> A lovely machine indeed. I've written this now:
> 
> https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> 
> I didn't test it yet -- will do when I get home in the evening. But
> chances are it's good enough and I guess you'd be able to get it
> working even if I messed up some details.

Ok, let me check. I went to this branch:

commit f99b274084d320814f4b035a7e3455af424229ea
Author: Lubomir Rintel <lkundrak@v3.sk>
Date:   Sun Aug 5 23:11:27 2018 +0200

First comment: the zImage size adjusting hack should really be
somewhere in tools/ and preferably in python. This is way beyond
reasonable use of shell.

> Please let me know if it works for you -- I'm having trouble getting
> reviews/acks/tested-bys for the XO-1.75 patch sets [1] and will be
> super thankful if I get some feedback from you.
> 
> [1] https://lore.kernel.org/patchwork/bundle/lkundrak/OLPC%20XO%201.75/

You want to just continue without them :-). As long as you don't
change the core code, you should be ok.

									Pavel
Pavel Machek Oct. 30, 2018, 10:26 a.m. UTC | #4
Hi!

> > https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> > 
> > I didn't test it yet -- will do when I get home in the evening. But
> > chances are it's good enough and I guess you'd be able to get it
> > working even if I messed up some details.

Instruction say make, but you really need to do make zImage and make
mmp2-olpc-xo-1-75.dtb .

Instructions say "make -j", which is nice way to crash a machine. I
suggest "make -j 8" :-).

Ok, I think I followed the instructions. I am using empty root
filesystem, just with /boot -- want to see kernel messages first
before I mess with the userland.

But I don't get kernel messages during boot:

OLPC 1B1, 512 MiB memory...
OpenFirmware Q4C02 EC Frimware 0.3.02

Type any key to interrupt...
(but keys do not interrupt anything, ouch).
Warning... partition type is 0xb...
Boot device: /usb/disk:\boot\olpc.fth Arguments:
Boot device ....
Warning... partition type is 0xb...

And that's it, cursor and no kernel messages.

Any ideas?

Could I get prepared binary zImage for testing?

Thanks,
									Pavel
Lubomir Rintel Oct. 30, 2018, 7:40 p.m. UTC | #5
Hello Pavel,

On Tue, 2018-10-30 at 11:26 +0100, Pavel Machek wrote:
> Hi!
> 
> > > https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> > > 
> > > I didn't test it yet -- will do when I get home in the evening.
> > > But
> > > chances are it's good enough and I guess you'd be able to get it
> > > working even if I messed up some details.
> 
> Instruction say make, but you really need to do make zImage and make
> mmp2-olpc-xo-1-75.dtb .

Have you tried? I'm typically doing just a plain "make".

According to "make help", a plain "make" (assuming it's equivalent to
"make all") includes "zImage" and "dtbs" targets.

> 
> Instructions say "make -j", which is nice way to crash a machine. I
> suggest "make -j 8" :-).

Holy... what sort of a machine do you have?

> Ok, I think I followed the instructions. I am using empty root
> filesystem, just with /boot -- want to see kernel messages first
> before I mess with the userland.
> 
> But I don't get kernel messages during boot:
> 
> OLPC 1B1, 512 MiB memory...
> OpenFirmware Q4C02 EC Frimware 0.3.02

"Frimware" -- I assume you don't have a serial console hooked on? :)

Doesn't matter though, your OF doesn't seem to even get to load the
kernel anyways. And the framebuffer console (though only by the means
of a hacked pxa168fb for the time being, no armada drm yet) works.

Here's my bootup banner:

OLPC 1B1, 800 MHz, 512 MiB memory, 4 GB internal storage...
OpenFirmware  Q4D38   EC Firmware 1.0.01   2018-10-30 19:11:36 UTC

I seem to have a bit newer OF.

> Type any key to interrupt...
> (but keys do not interrupt anything, ouch).

In my version of the OLPC OF the routine is replaced with one that only
accepts the Escape key, because kids like to press random keys without
really wanting a shell. Maybe try that one?

Although my prompt is also a bit different: "Type the Esc key to
interrupt automatic startup"

> Warning... partition type is 0xb...
> Boot device: /usb/disk:\boot\olpc.fth Arguments:
> Boot device ....
> Warning... partition type is 0xb...

Maybe the older version wouldn't support a VFAT volume, hence the
complains about the id=0xb volume? Try ext3?
> 
> And that's it, cursor and no kernel messages.
> 
> Any ideas?
> 
> Could I get prepared binary zImage for testing?

https://github.com/hackerspace/olpc-xo175-buildroot/releases

Here's a SD card image that works for me. The topmost commit in the
same repository is the build configuration that was used to generate
it:

https://github.com/hackerspace/olpc-xo175-buildroot/commit/71783d599.patch

Note it is only going to boot off the SD card, because the root=
argument is hardwired in the devicetree. Sorry about that -- I built
the image before I noticed you're booting off an USB stick and I don't
have the resources to regenerate the image at the moment.

If this won't boot for you, we may need fixes for older FW. Until then
it might be a good idea if you just update to the latest one (it is as
easy as booting the last version of the stock distro with a charged
battery pack).

> Thanks.							
>
> 		
> Pavel

Take care
Lubo
James Cameron Oct. 30, 2018, 11:54 p.m. UTC | #6
G'day Pavel,

On Tue, Oct 30, 2018 at 11:26:10AM +0100, Pavel Machek wrote:
> Hi!
> 
> > > https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> > > 
> > > I didn't test it yet -- will do when I get home in the evening. But
> > > chances are it's good enough and I guess you'd be able to get it
> > > working even if I messed up some details.
> 
> Instruction say make, but you really need to do make zImage and make
> mmp2-olpc-xo-1-75.dtb .
> 
> Instructions say "make -j", which is nice way to crash a machine. I
> suggest "make -j 8" :-).
> 
> Ok, I think I followed the instructions. I am using empty root
> filesystem, just with /boot -- want to see kernel messages first
> before I mess with the userland.
> 
> But I don't get kernel messages during boot:
> 
> OLPC 1B1, 512 MiB memory...
> OpenFirmware Q4C02 EC Frimware 0.3.02
> 
> Type any key to interrupt...
> (but keys do not interrupt anything, ouch).
> Warning... partition type is 0xb...
> Boot device: /usb/disk:\boot\olpc.fth Arguments:
> Boot device ....
> Warning... partition type is 0xb...

That firmware has problems with USB drives.  Please upgrade to Q4D38.
Quickest tested method is http://wiki.laptop.org/go/Upgrading_firmware

I'm firmware releaser and signer.

> And that's it, cursor and no kernel messages.
> 
> Any ideas?
> 
> Could I get prepared binary zImage for testing?
> 
> Thanks,
> 									Pavel
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
James Cameron Oct. 31, 2018, 3:37 a.m. UTC | #7
G'day,

Success, see below.

On Tue, Oct 30, 2018 at 08:40:38PM +0100, Lubomir Rintel wrote:
> Hello Pavel,
> 
> On Tue, 2018-10-30 at 11:26 +0100, Pavel Machek wrote:
> > Hi!
> > 
> > > > https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> > > > 
> > > > I didn't test it yet -- will do when I get home in the evening.
> > > > But
> > > > chances are it's good enough and I guess you'd be able to get it
> > > > working even if I messed up some details.
> >
> > [...]
> > Could I get prepared binary zImage for testing?
> 
> https://github.com/hackerspace/olpc-xo175-buildroot/releases
> 
> Here's a SD card image that works for me. The topmost commit in the
> same repository is the build configuration that was used to generate
> it:
> 
> https://github.com/hackerspace/olpc-xo175-buildroot/commit/71783d599.patch
> 
> Note it is only going to boot off the SD card, because the root=
> argument is hardwired in the devicetree. Sorry about that -- I built
> the image before I noticed you're booting off an USB stick and I don't
> have the resources to regenerate the image at the moment.

Your image does boot for me - after changing features on
filesystem.

	http://dev.laptop.org/~quozl/y/1gHh5m.txt (dmesg)

dumpe2fs of your image filesystem features; has_journal ext_attr
resize_inode dir_index filetype flex_bg sparse_super large_file
huge_file dir_nlink extra_isize metadata_csum, and flags;
signed_directory_hash.

dumpe2fs of my image filesystem features; has_journal ext_attr
resize_inode dir_index filetype extent flex_bg sparse_super uninit_bg
dir_nlink extra_isize, and flags; unsigned_directory_hash.

Our OLPC OS builder uses "mkfs.ext4 -O dir_index,^huge_file", from
e2fsprogs 1.42.5.

I'll look at the microSD card errors; by trying another one.

Fantastic progress though, thanks!  Wish I were a full time kernel
developer, but so much else to do now.

> If this won't boot for you, we may need fixes for older FW.

Let me know what you need there; with a patch, and if it isn't too
extensive I could spin a new build.  We're not producing these models,
so I don't _have_ to keep the factory test code working.

https://github.com/quozl/openfirmware
Pavel Machek Oct. 31, 2018, 11:54 a.m. UTC | #8
Hi!

> > > > https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> > > > 
> > > > I didn't test it yet -- will do when I get home in the evening.
> > > > But
> > > > chances are it's good enough and I guess you'd be able to get it
> > > > working even if I messed up some details.
> > 
> > Instruction say make, but you really need to do make zImage and make
> > mmp2-olpc-xo-1-75.dtb .
> 
> Have you tried? I'm typically doing just a plain "make".
> 
> According to "make help", a plain "make" (assuming it's equivalent to
> "make all") includes "zImage" and "dtbs" targets.

I believe I did, but not 100% sure.

> > Instructions say "make -j", which is nice way to crash a machine. I
> > suggest "make -j 8" :-).
> 
> Holy... what sort of a machine do you have?

Thinkpad X220. Is it too big or too small? :-). 4 threads, so I
usually use -j 5, but -j 8 should be for my notebook and also bigger
servers.


> > Ok, I think I followed the instructions. I am using empty root
> > filesystem, just with /boot -- want to see kernel messages first
> > before I mess with the userland.
> > 
> > But I don't get kernel messages during boot:
> > 
> > OLPC 1B1, 512 MiB memory...
> > OpenFirmware Q4C02 EC Frimware 0.3.02
> 
> "Frimware" -- I assume you don't have a serial console hooked on? :)

Not :-(. Altrough.. maybe I do have that cable somewhere, I just never
used it.

> > Type any key to interrupt...
> > (but keys do not interrupt anything, ouch).
> 
> In my version of the OLPC OF the routine is replaced with one that only
> accepts the Escape key, because kids like to press random keys without
> really wanting a shell. Maybe try that one?

Ok, will try.

> > And that's it, cursor and no kernel messages.
> > 
> > Any ideas?
> > 
> > Could I get prepared binary zImage for testing?
> 
> https://github.com/hackerspace/olpc-xo175-buildroot/releases
> 
> Here's a SD card image that works for me. The topmost commit in the
> same repository is the build configuration that was used to generate
> it:

Kernel works for me with this one. (First boot userland boots, then
blinking cursor; next boot filesystem is corrupted. Hmm.) Feel free to
add "Tested-by:" to patches this uses.

> Note it is only going to boot off the SD card, because the root=
> argument is hardwired in the devicetree. Sorry about that -- I built
> the image before I noticed you're booting off an USB stick and I don't
> have the resources to regenerate the image at the moment.

No problem, I have SD cards here, too.

> If this won't boot for you, we may need fixes for older FW. Until then
> it might be a good idea if you just update to the latest one (it is as
> easy as booting the last version of the stock distro with a charged
> battery pack).

I'd need more instructions for firmware update. Or maybe ... lets
ignore that. SD card is fine, and I don't want to brick it.

I already broken it enough that keys need to be held during boot (or
it does not boot).

Best regards,
									Pavel
Pavel Machek Oct. 31, 2018, 12:29 p.m. UTC | #9
Hi!

> > But I don't get kernel messages during boot:
> > 
> > OLPC 1B1, 512 MiB memory...
> > OpenFirmware Q4C02 EC Frimware 0.3.02
> > 
> > Type any key to interrupt...
> > (but keys do not interrupt anything, ouch).
> > Warning... partition type is 0xb...
> > Boot device: /usb/disk:\boot\olpc.fth Arguments:
> > Boot device ....
> > Warning... partition type is 0xb...
> 
> That firmware has problems with USB drives.  Please upgrade to Q4D38.
> Quickest tested method is http://wiki.laptop.org/go/Upgrading_firmware

Let me try that... Upgrading firmware said "USB drive" so I placed
bootfw.zip on usb drive. It did quite a show, but I believe it said
that my firmware is up to date?

It all ended with "activation lease not found" message. Let me retry?
Same result.

Let me try "upgrading firmware" with SD card. It seems to work with SD
card. Holding down both "yes" and "no" keys during boot results in
more useful messages... good. I have now updated firmware, and it even
fixed my previous boot problem. Good.

Thanks!
									Pavel
Pavel Machek Oct. 31, 2018, 12:46 p.m. UTC | #10
Hi!

> > https://github.com/hackerspace/olpc-xo175-buildroot/releases
> > 
> > Here's a SD card image that works for me. The topmost commit in the
> > same repository is the build configuration that was used to generate
> > it:
> > 
> > https://github.com/hackerspace/olpc-xo175-buildroot/commit/71783d599.patch
> > 
> > Note it is only going to boot off the SD card, because the root=
> > argument is hardwired in the devicetree. Sorry about that -- I built
> > the image before I noticed you're booting off an USB stick and I don't
> > have the resources to regenerate the image at the moment.
> 
> Your image does boot for me - after changing features on
> filesystem.
> 
> 	http://dev.laptop.org/~quozl/y/1gHh5m.txt (dmesg)
> 
> dumpe2fs of your image filesystem features; has_journal ext_attr
> resize_inode dir_index filetype flex_bg sparse_super large_file
> huge_file dir_nlink extra_isize metadata_csum, and flags;
> signed_directory_hash.
> 
> dumpe2fs of my image filesystem features; has_journal ext_attr
> resize_inode dir_index filetype extent flex_bg sparse_super uninit_bg
> dir_nlink extra_isize, and flags; unsigned_directory_hash.
> 
> Our OLPC OS builder uses "mkfs.ext4 -O dir_index,^huge_file", from
> e2fsprogs 1.42.5.
> 
> I'll look at the microSD card errors; by trying another one.

Success, too... after re-doing the filesystem with local mkfs.

One thing I noticed: olpc-battery/voltage_max_design is lower than
voltage normally reported by voltage_now.

I'll play with it some more

Best regards,
									Pavel
Pavel Machek Nov. 1, 2018, 1:47 p.m. UTC | #11
Hi!

> > > > https://github.com/hackerspace/olpc-xo175-linux/wiki/How-to-run-an-up-to-date-Linux-on-a-XO-1.75
> > > > 

Huh. You see that crazy sed magic script?

sed "s/^\(0*20: .... .... .... .... .... ....\) $BEFORE/\1 $AFTER/" |

Do this with the regular expression. My xxd actually has different
number of leading zeros, and so fails...

And with that fixed, I have self-compiled kernel that actually
boots. Yuppie!

Thanks!
								Pavel