littlekernel / lk

LK embedded kernel
MIT License
3.11k stars 611 forks source link

Upstreaming msm8916 SoC support #405

Open samcday opened 2 months ago

samcday commented 2 months ago

Hi there @travisg . As I'm sure you're aware, the lk2nd project is an actively maintained LK derivative that was spun out from the CodeAurora (CAF) code. It's used as a chained (from the vendor LK) bootloader in the boot partition on a range of msm8916+msm8974+msm8226 devices.

The CAF codebase was forked from LK a very long time ago. Consequently lk2nd looks "kind-of" like LK but as you noted it's diverged quite a lot.

As an educational exercise I recently started exploring porting that downstream work on top of modern LK upstream.

I've managed to get some basic clock + UART working on an msm8196 device in this commit: https://github.com/littlekernel/lk/commit/d21343738bb9d4f59da245eb17dfd605fd100320

To be clear, I'm not asking you to review that code at all yet, since it's 5000 lines of mostly copy/pasta :sweat_smile:

What I'm asking is if you'd be interested in seeing support for these qcom devices brought upstream? If so, I'd be happy to work with you on this, and massage the downstream code for style/quality/nits/etc to make that happen.

The most obvious issue I see is that the downstream code that came from the CAF repo is BSD-licensed, whereas LK upstream is purely MIT. I have no idea how to navigate such a thing. I've always regarded BSD as a very permissive license though. Interestingly, it seems that it might be possible to simply re-license the BSD code as MIT, as long as the original copyright notices are retained? I dunno. I am a computer person not a lawyer ;)