Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Developement #7

Closed
alistair23 opened this issue Jan 13, 2021 · 12 comments
Closed

Linux Developement #7

alistair23 opened this issue Jan 13, 2021 · 12 comments

Comments

@alistair23
Copy link
Contributor

alistair23 commented Jan 13, 2021

The u-boot source indicates that u-boot will first try to boot a kernel/initrd/dtb from memory before falling back to loading a kernel from the rootFS.

Has anyone been able to flash images to boot a kernel from USB?

I'm guessing something along the lines of:

./imx_usb zImage -l0x82000000 zero-sugar.dtb -l0x88000000 rootfs.cpio -l0x83800000

It also seems like rM1 has serial access, any such luck on rM2?

As pointed out the rM2 kernel doesn't seem too far from a new mainline (assuming all the NXP patches are in). It would be nice to try and boot a newer kernel.

It also doesn't seem impossible to build a custom rootFS with OpenEmbedded.

@alistair23
Copy link
Contributor Author

Good news on the UART, it looks like UART6 in the device tree is exposed via the pogo pins with a pin mux: https://github.com/reMarkable/linux/blob/zero-sugar/drivers/misc/rm-otgcontrol/otgcontrol_onewire.c#L132

Just need to figure out how to enable it.

@ddvk
Copy link
Owner

ddvk commented Jan 13, 2021

i think uart6 is just for the otg mode switching (1-wire stuff).

Looking at the imx7drm it seems usbotg1_oc is multiplexed with uart3, but not much.
usb_otg_dp and _dn are not muxed.

edit: uart1 could be exposed somewhere on the boad, but i havent found it in any of the teardown photos

@alistair23
Copy link
Contributor Author

Progress!

From Linux I can write serial out over the ID pin on the OTG Pogo pins. It just takes a few changes to the device tree.

I have also changed the Linux console to print all boot output to the ID pin. I can see a handful of kernel log messages but not all of them. I'm not sure why I can't see all of them yet.

@alistair23
Copy link
Contributor Author

I have now also started to look at booting via the pogo pins. My mx7_usb_work.conf now has this

mx7
hid,1024,0x910000,0x80000000,1G,0x00900000,0x20000
zImage:load 0x80800000
zero-sugar.dtb:load 0x83000000

and I can successfully download the images but I can't get them to boot. Any ideas what I am missing? Do I need to load u-boot as well with u-boot.imx:clear_dcd,plug,jump header2?

@alistair23
Copy link
Contributor Author

Tried

zImage:load 0x80800000
zero-sugar.dtb:load 0x83000000
rootfs.cpio:load 0x83800000
u-boot-dtb.imx:clear_dcd,plug,jump header

and no luck. Seems like it might be loading something, but unable to see any UART output

@alistair23
Copy link
Contributor Author

Closing this. I have my own u-boot, Linux and OE rootFS booting with UART out over the pogo pins. Still to UART Rx though, but I haven't really tried to see if it works.

I also now have the latest 5.11-rc3 kernel running on the reMarkable 2 (without full support though). I have started sending patches to mainline Linux.

@Eeems
Copy link
Collaborator

Eeems commented Jan 18, 2021

Closing this. I have my own u-boot, Linux and OE rootFS booting with UART out over the pogo pins. Still to UART Rx though, but I haven't really tried to see if it works.

I also now have the latest 5.11-rc3 kernel running on the reMarkable 2 (without full support though). I have started sending patches to mainline Linux.

Any chance you could open a PR adding some of your learnings to the REAME?

@alistair23
Copy link
Contributor Author

I have started adding some bits to the wiki: https://remarkablewiki.com/tech/rm2_otg_pogo

I'm happy to write something up though. Any details on what specifically you would like?

@Eeems
Copy link
Collaborator

Eeems commented Jan 18, 2021

Perhaps just a link to the wiki page will be enough?

@alistair23
Copy link
Contributor Author

It's not super helpful, there are still a few patches and config changes required.

I have a working OE rootFS. I'm planning on getting that up and running fully, at that point I'll add a REAME and send a PR to meta-freescale-3rdparty. I'll add all the documentation there.

@ddvk
Copy link
Owner

ddvk commented Jan 18, 2021

did you modify u-boot to set the pin, you could probably get the serial output

@alistair23
Copy link
Contributor Author

Yep, I have u-boot working as well.

I just submitted a PR for this repo with some details and some more pictures: #8

Full software support is available here: Freescale/meta-freescale-3rdparty#116

Next step is upstreaming, if anyone wants to help let me know. My current tree is here: https://github.com/alistair23/linux/tree/zero-sugar-mainline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants