Jump to content

ST-Ericsson NovaThor U8500: Difference between revisions

From postmarketOS Wiki
Linusw (talk | contribs)
proper headings
Linusw (talk | contribs)
Line 52: Line 52:
After installing U-Boot, we regularly reflash the phone internal eMMC kernel image using U-Boot's ''fastboot'' implementation, on the host side we use the Android '''fastboot''' command-line tool to do the reflashing of new kernels. pmbootstrap will hide these details, but it's good to know.
After installing U-Boot, we regularly reflash the phone internal eMMC kernel image using U-Boot's ''fastboot'' implementation, on the host side we use the Android '''fastboot''' command-line tool to do the reflashing of new kernels. pmbootstrap will hide these details, but it's good to know.


The root filesystem for PostmarketOS will be stored on the SDcard, so you will need to set up an SDcard using <code>pmbootstrap install sdcard=/dev/nnnn</code>.
The root filesystem for PostmarketOS will be stored on the SDcard, so you will need to set up an SDcard using <code>pmbootstrap install --sdcard=/dev/nnnn</code>.


== U-Boot on Samsung NovaThor U8500 Devices ==
== U-Boot on Samsung NovaThor U8500 Devices ==

Revision as of 10:36, 30 August 2020

ST-Ericsson NovaThor U8500
Manufacturer ST-Ericsson
Name NovaThor U8500
Architecture armv7
CPU 2x 1 GHz ARM Cortex-A9
GPU ARM Mali-400 MP
Year 2011
Process 40nm
Mainline yes
Components
CPU
Works
UART
Works
Storage
Works
USB
Works
Display
Works
GPU
Works
Pinctrl
Works
I²C
Works
SPI
No data
Audio
No data
Video
No data
Thermal
Works
Modem
No data
GPS
No data
Camera
No data
NPU
No data
Suspend
No data
Ethernet
No data
SATA
No data


Devices with this chipset

This chipset is used similarly in the following devices:

Device Codename Mainline
Samsung Galaxy Ace 2 GT-I8160 samsung-codina Y
Samsung Galaxy Amp (SGH-I407) samsung-kyle Y
Samsung Galaxy Beam samsung-gavini Y
Samsung Galaxy Exhibit (SGH-T599) samsung-codina-tmo Y
Samsung Galaxy S Advance samsung-janice Y
Samsung Galaxy S III Mini samsung-golden Y
Samsung Galaxy Xcover 2 GT-S7710 samsung-skomer Y
Sony Xperia Go sony-lotus
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)


Flash and SDcard Layout on Samsung NovaThor U8500 Devices

When working with these devices, we install U-Boot and the kernel in the internal flash of the phone, using the Samsung flash tool Heimdall.

After installing U-Boot, we regularly reflash the phone internal eMMC kernel image using U-Boot's fastboot implementation, on the host side we use the Android fastboot command-line tool to do the reflashing of new kernels. pmbootstrap will hide these details, but it's good to know.

The root filesystem for PostmarketOS will be stored on the 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.

Note Note: In this case, U-Boot does not replace the Samsung bootloader. Instead, it is packaged into an Android boot image (if necessary), and flashed to the Android boot partition like a regular Linux kernel.

Installation

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-golden) use the Android boot image format, but some older (e.g. samsung-janice) use the raw binary.

Install it normally to the boot partition:

heimdall flash --Kernel u-boot.img

Usage

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 (recovery partition)
Note Note: Since the boot partition is already used for U-Boot itself, U-Boot reads the Android boot image with 1 MB offset from the boot partition. This offset is applied automatically when using fastboot flash boot boot.img.

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 boot partition).

Building

Requirements: ARM cross compiler (e.g. arm-non-eabi-gcc)

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

Or using abootimg:

  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 dtb.foo into the "second bootloader firmware".

See also