User:Knuxfanwin8/Grand Neo mainline journal

From postmarketOS

This is a small journal of mainlining progress and notes I made along the way.

07-05-2020

Ordered some required stuff yesterday (microUSB plugs, various wires and an UART to USB converter). I asked about voltages in the mainlining chat and it turns out I might need something else. I guess everybody uses Arduinos or whatever.

Oh well, hopefully I'll be able to make some kind of circuit to limit the output voltage from my UART to USB converter to 1.8V (if it will even be required). There doesn't seem to be a good guide on building serial cables and I'm not an electrical engineer, but I'm hoping that I won't fry anything.

---

A few days ago I started putting together a basic DTS for the baffinlite. It doesn't boot, and I might need an alternative bootloader. I managed to gather the following information so far:

- There is a downstream DTS but it seems to be kinda incomplete, and there's plenty of stuff in the downstream board.c file;

- I managed to create a small list of components and their driver status;

- I still need to check which display driver is actually used, since two are enabled and one of them isn't in mainline;

- There are contradicting statements on the frequency of the internal memory, with the frequency used in the baffinlite board.c and dts is higher than the usual (and the one in the downstream bcm23550 dts/board c); also, there's an sdio3 used for wifi?

08-05-2020

My cables arrived, and I soldered together a dodgy serial cable. And it seems to be working, since my device boots up when I plug it in!

The only problem? I don't seem to be getting any output, except for a single character on boot. Misconfigured data settings? Wrong resistor? Who knows.

Images

https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/HThhSWQtdEtvMGZmtKJTxYyc

https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/WhZRCZmqvohRzGbQiovnCJSJ

09-05-2020

The debug cable doesn't work anymore. I checked it, made a new one, even replaced the resistor and it still doesn't work. Regular USB works just fine still, which leads me to believe that I might've fried the ID pin on my phone. Fuck.

On the bright side, this means I have a proper debug cable for other pmOS ventures. (I also cleaned up the breadboard and made sure to solder wires of the proper color to the cable.) But the fact that it's broken on my device means that I'll have to do one of the following:

- Take apart the phone and risk damaging it even further;

- Or backport the ram console driver like I initially planned.

Both are painful, but I think I'm leaning a bit more towards the latter option.

Sadly, I'm most likely out of free time today, and Sunday doesn't look any better, so this will probably have to wait a bit.

15-05-2020

I did some research on pstore and ramoops and managed to get it, uhh, working? It seems?

Either way, it's not what I'm looking for. What I'm looking for is PSTORE_CONSOLE. And it's not present in my downstream kernel, even though it's supposedly 3.4.5. Isn't that just great.

Backporting this is going to take a while. I tried pulling some patches but they don't seem to apply, but it should be a matter of just a few commits, right?

Either way, I made a small wiki page for it! If I manage to get this fully working as expected, I'll make it a proper page and link it from the Mainlining FAQ. Looking forward to that!

16-05-2020

Backported (well, *sort of*) PSTORE_CONSOLE. My recovery now refuses to turn off and just gets stuck, and pulling out the battery makes it reboot back to recovery. I had to reflash it and it still didn't work. I guess my pstore backporting did work, just not in the way I'd expect it to.

Not much progress besides that.

21-05-2020

2 days ago it stopped booting properly and only got to the bootloader logo, made it to the system loading screen for a split second and rebooted to the bootloader logo, where it then powered off after a while. Not sure what happened, but it's pretty safe to say that this thing's dead.

I also cracked the display slightly at the bottom while trying to open it today, so that's fun.

I can't just buy a new one for testing, so I guess I'll have to collab with someone and send them over files to flash.

(I should probably stop for a second and try getting downstream cm14 working so that people on XDA don't get impatient waiting for a new ROM :p)

30-05-2020

Took a quick look at downstream and made some blind improvements to my dts. It's starting to look pretty neat! I also generated a proper defconfig now, so there is a smaller chance of something breaking due to the minimal defconfig settings I used previously. Unfortunately, I still haven't had a chance to order a new battery, and as such I still need to find someone who can test it for me.

Oh yeah, I forgot to mention: I think I know the cause of my device breaking, and it's a dead battery (as it reports 3.2v instead of the advertised 3.8v, and that's unusually low). That also means I can't boot downstream, since it doesn't boot on low battery. I need to boot downstream to figure out the framebuffer address, so that I can hijack it somewhat with simple-framebuffer.

As for any progress with downstream: I'm learning more and more about all the parts of the kernel and various quirks, and perhaps at the end of my mainlining journey I'll know enough to figure out what's wrong with the RIL stuff. Ooor I could try to get it working on the mainline kernel, but I imagine that would require a lot of work. /shrug

04-06-2020

I partially got persistent_ram working! Only problem is, it doesn't seem to want to read its data at the moment.

26-12-2020 (or, to be exact, a summary of things I did in the past 2 weeks)

Got a new microUSB plug breakout board (finally I have a proper cable that doesn't break apart), but even then the results were the same. I tested the cable on another device that should have working UART, but to no avail. I think my serial board is broken. I tried using my raspi for debugging, but didn't get it to work - uart via gpio is incredibly confusing, and it doesn't help that the raspi is slow as hell. Oh well.

???

It was the TX and RX cables. I swapped the TX and RX cables. It took me nearly half a year to realize.

...either way, I managed to get it booting! But clocks are failing. Not fun.