ST-Ericsson NovaThor U8500
Devices with this chipset
This chipset is used similarly in the following devices:
|Samsung Galaxy Ace 2||samsung-codina||N|
|Samsung Galaxy S Advance||samsung-i9070|
|Samsung Galaxy S III mini||samsung-golden||Y|
|Samsung Galaxy Xcover 2||samsung-skomer||Y|
|Sony Xperia P||sony-nypon|
|Sony Xperia U||sony-kumquat|
Other devices using this chipset but not yet ported to postmarketOS (remove once they are ported):
- Samsung Galaxy Beam GT-I8530 codename samsung-gavini (wikipedia)
- Sony Xperia Go (sony-lotus) (wikipedia)
- Sony Xperia Sola (sony-pepper) (wikipedia)
- Motorola XT760
- HTC Desire 400 dual SIM
The U8500 has a companion power management IC (PMIC, also known as analog baseband, AB) ASIC called AB8500/AB8505 that takes care of the charging. In difference from many other charging ICs this chip is not autonoumous and will not charge the phone without the right software to instruct it, respond to interrupts etc. So in short: the phone will not charge unless the kernel has started and provides the right driver for the charger portions of the AB8500.
The mainline kernel for the U8500 does not as of now (2021-03-20) yet support charging. To work with these phones an external battery charger is recommended, or you have to regularly revert to the original firmware just to charge, and if your battery depletes completely before you do that you have a problem.
This type of charger at Wish can charge all of these batteries. It is a noname product simply named "Multi-connector USB Battery charger" that originates in China and often found in webstores such as Aliexpress or Wish. The charger comes with a US plug, so you may additionally need a US-to-european power converter to use it.
Flash and SDcard Layout on Samsung NovaThor U8500 Devices
When working with these devices, we install U-Boot, the kernel (
zImage) and a small initial ramdisk (
initrd) in the internal flash of the phone. The installation is done in three steps:
- U-Boot is installed on the Samsung U8500 devices using the Samsung open source flashing tool Heimdall. This is the open source reimplementation of Samsungs Odin tool. This has to be done manually before you can use
- The kernel and inital ramdisk is then installed using U-Boot. After installing U-Boot, any time we want to reflash the phone internal eMMC kernel image and initial ramdisk, we do this using U-Boot's fastboot implementation, and on the host side we use the Android fastboot command-line tool to do the reflashing of new kernels.
pmbootstrap flashwill hide these details, but it's good to know.
- The root filesystem for PostmarketOS will be stored on the external SDcard, so you will need to set up an SDcard using
pmbootstrap install --sdcard=/dev/nnnn.
U-Boot on Samsung NovaThor U8500 Devices
There is a port of (mainline) U-Boot for U8500 currently maintained at: https://github.com/novathor-mainline/u-boot
It contains a board called
stemmy, which is intended for all Samsung devices using U8500 (see above). It provides a simple Android fastboot interface as replacement for Samsung's proprietary flashing procedure. As a device tree compatible bootloader, it can be also used to boot mainline without any hacks in the Linux kernel.
Heimdall can be found here but is packaged into most major Linux distributions such as Debian, Ubuntu and Fedora.
Pre-built images are available from: https://github.com/novathor-mainline/u-boot/releases. Alternatively, you can build it from source. See #Building below.
Choose the Android boot image (
u-boot.img) or the raw binary (
u-boot.bin), depending on your device. Most newer devices (e.g.
samsung-skomer) use the Android boot image format, but some older (e.g.
samsung-janice) use the raw binary.
|Galaxy S Advance||GT-I9070||Janice|
|Galaxy Ace 2||GT-I8160||Codina||?|
|Galaxy S III mini||GT-I8190N||Golden|
Install it normally to the boot partition replacing the default Kernel (notice capital K on Kernel):
heimdall flash --Kernel u-boot.[bin|img]
U-Boot will try to boot an Android boot image from the
boot partition by default. Pressing one of the volume keys during boot allows to change that behavior:
Volume Down: Enter Fastboot mode
Volume Up: Boot into recovery (
In Fastboot mode, kernels can be directly booted from RAM using
fastboot boot .... Alternatively, partitions can be flashed using
fastboot flash <partition> ....
U-Boot itself can be also flashed from U-Boot using
fastboot flash u-boot u-boot.img (in this case, it will not apply the offset for the
Requirements: ARM cross compiler (e.g.
export CROSS_COMPILE=arm-none-eabi- make stemmy_defconfig make
If your device uses Android boot images, package it into an Android boot image:
mkbootimg --kernel u-boot.bin --base=0x00000000 --kernel_offset=0x00100000 --ramdisk_offset=0x02000000 --tags_offset=0x00000100 --output=u-boot.img
Kernel Hacking on NovaThor U8500
These sections detail some tricks needed when working on kernel development.
Some details can be found at the external page for [Ux500 mainline work].
Assembling a Custom boot.img
When used with PostmarketOS the
boot.img that you flash into the phone should come out of the pmbootstrap utility, but if you for some reason want to assemble the
boot.img using some prefabricated kernel, ramdisk and device tree, the process is like this this:
mkbootimg --kernel zImage --ramdisk initrd --second foo.dtb --base=0x00000000 --kernel_offset=0x00008000 --ramdisk_offset=0x02000000 --second_offset=0x00f00000 --tags_offset=0x00000100 --output=boot.img
abootimg --create boot.img -k zImage -r initrd -s foo.dtb -c "pagesize=0x800" -c "kerneladdr=0x8000" -c "ramdiskaddr=0x02000000" -c "secondaddr=0x00f00000" -c "tagsaddr=0x100"
Notice how this puts the device tree binary
foo.dtb into the "second bootloader firmware".
If you are booting PostmarkeOS with a custom kernel, the
initrd you pass must better be a PostmarkeOS initramfs. This can be found in a path like
.local/var/pmbootstrap/chroot_native/mnt/rootfs_samsung-skomer/boot/initramfs-postmarketos-stericsson. The initrd is used to set up, detect and load the rest of the rootfs from the SDcard volume so it is pretty vital.
Flashing a Custom Kernel
You install a custom kernel into the device by booting into U-Boot as described above, go to fastboot mode by holding down+ or by holding while you insert the serial cable. Then you can flash a new kernel image like this:
fastboot flash boot boot.img
After this reboot the phone and your new kernel should start.
- This chipset has a [wikipedia page]