Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "mainlining phone"
Do you know when you got into like a real low level programming ?
Not when you learn assembler because that takes ages to learn to the skill level where you can actually use it properly.
For me it is writing device tree files in Linux kernel. One typo and the mobile phone is literally dead.
Oh I accidentally typed one more 0 to the voltage in regulator. Yeah goodbye phone.
You have to be careful as fuck and read the shit six times before you flash it on the phone.
And oh God mainlining a phone. It surely is fun seeing the phone boot the same exact kernel version my PC uses. But dang it is hard.14
So you mainlined your phone to the point where UART is working. Amazing right ?
You flash it.
You boot it up and basically nothing happens.
You recheck the adresses and GPIO pins in device tree file. No its all correct.
Then you realize it.
The phone is old and the bootloader has no clue what dts file even is so no luck there. What do you do ?
You append the dts to the kernel image.
Isnt it wonderful that you can make 1 file from 2 and use that as kernel which then takes the dts file and uses it instead of relying on bootloader to do all the shit work for him ? Yeah it is absolutely AMAZING and saves me ton shit lot of time because if it wasnt for this i would be porting U-boot at this point which i really really dont wont to do at this point. Why not ?
Its kinda simple.
When mainlining a phone that doesnt have dts support the bootloader has to set the regulators to the correct values and shit otherwise the phone would die. And the amazing thing is that if i dont specify that regulator in dts it wont be set to anything and it will be at the value bootloader set it to. So its kinda like a safebox for me at this moment.
If i replaced it with uboot (Which i will do once the phone is working on mainline kernel) then the bootloader would not have all the regulators and it will be a shit mess and the phone would most likely die.
Isnt mainlining so much fun ? It IS.3