Samsung Galaxy SII (samsung-i9100)

From postmarketOS
Revision as of 07:26, 21 May 2020 by Timbz (talk | contribs)
Jump to navigation Jump to search
Samsung Galaxy S II
First photo ever released of postmarketOS (from the original introduction post).
First photo ever released of postmarketOS (from the original introduction post).
Manufacturer Samsung
Name Galaxy S II
Codename samsung-i9100
Released 2011
Category testing
Original software Android 2.3.4
Chipset Exynos 4210 Dual
CPU Dual-core 1.2 GHz Cortex-A9
GPU Mali-400 MP4
Display 480x800 AMOLED
Storage 16/32 GB
Memory 1 GB
Architecture armv7
Unixbench Whet/Dhry score 542.5
USB Networking
3D Acceleration
Mobile data

Running XFCE


  • ollieparanoid
  • veggie

Device Owners


What works

  • Installation to device memory (pmbootstrap flasher flash_rootfs)
  • Installation to sdcard (pmbootstrap install --sdcard=/dev/mmcblk...)
  • Touchscreen
  • Weston (only on SD card)
  • XWayland
  • Wifi
  • Display brightness control
  • Accerelometer sensor
  • rtc
  • Xfce

What does not work

  • Audio, bluetooth, modem, ...
  • MHL (Video-out)
  • See "Hardware specifications" for ideas how to get them working.
  • Auto resizing partitions during installation to device memory (probably)


How to enter flash mode

  • Connect a USB cable
  • Make sure, the device is powered off
  • Hold power + Home + volume down
  • When prompted, release all buttons and press volume up

Step by step guide for Flashing via netcat (#456)

If you get a "no space left on device" error, see #928.

The normal installation does not work yet (#581, we might fix that in the future with our own flashing method which basically automatizes the netcat method). Right now you have the following options. If you use any of these, please expand the wiki with details.

  • use pmbootstrap install --sdcard (you will need a real sd card, but this is the easiest method)
  • use the netcat method (see below)
  • use the recovery zip installer (you need to install a recovery like TWRP on your device, then run pmbootstrap install --android-recovery-zip and pmbootstrap flasher --method=adb sideload.)

- Build image (on your computer)

-- Install pmboostrap

 $ git clone

-- Change working directory to the pmboostrap

 $ cd pmbootstrap/

-- Configure

 $ ./ init
 [18:27:09] Device [samsung-i9100]: samsung-i9100
 [18:27:45] User interface [weston]: weston
 [18:28:05] Work path [/home/<USER>/.local/var/pmbootstrap]:
 [18:28:29] Jobs [5]:
 [18:28:46] Timestamp based rebuilds (y/n) [y]:
 [18:29:05] Extra packages [none]:

-- Prepare the installation

 $ ./ install

- Flash to phone memory - This will replace (break) your current phone system! This uses the alternative flash method because it currently doesn't seem to work with heimdall -

-- Set phone to ODIN mode

 1. Turn off phone
 2. Connect USB cable
 3. Hold VOLUME_DOWN + HOME + POWER until you get Warning!! screen
 4. Push VOLUME_UP to continue to ODIN mode screen

-- Setup image for NETCAT flash method

 $ ./ initfs hook_add debug-shell

-- Flash Kernel and Recovery (phone will reboot to screen "boot partition not found")

 $ ./ flasher flash_kernel

-- Check USB network connection to phone


(if it does not ping, try replugging usb cable few times)

-- Connect to phone with telnet

 $ telnet

-- Start netcat to listen for image (on the phone) /dev/mmcblk0p9 should be FACTORYFS partition. Check by running fdisk -l /dev/mmcblk0

 / # nc -v -l -p 60000 > /dev/mmcblk0p9

-- Switch to pmboostrap chroot (on the computer in another terminal)

 $ ./ chroot --suffix native

-- Install pv in the chroot

 / # apk add pv

-- Send image from computer to netcat (via the chroot)

 / # pv /home/pmos/rootfs/samsung-i9100.img | nc 60000

-- Close both nc with CTRL+C when transfer finishes and reboot the phone with power button

Boot process

We're using the heimdall-isorec flash method, see deviceinfo_flash_methods for more information.

Mainline kernel

The user Sekilsgs2 on Github created a mainline kernel port, based on the older kernel version 4.2. Using ArchLinux, I was still able to compile and flash the kernel using following commands:

 $ git clone
 $ cd i9100_kernel_mainline_port
 $ export ARCH=arm
 $ export CROSS_COMPILE=arm-none-eabi-
 $ make i9100_defconfig
 $ make -j6
 $ cat arch/arm/boot/zImage arch/arm/boot/dts/exynos4210-i9100.dtb > zimage
 $ mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n Linux-android-sucks -d zimage boot.img
 $ make modules_install INSTALL_MOD_PATH=../
 $ heimdall flash --RECOVERY boot.img

It is also possible to use a more recent mainline kernel version. Therefore we will have to checkout the latest sources and download the device tree file:

 $ git clone git://
 $ cd linux-stable
 $ git checkout tags/5.4.5
 $ wget "" -O arch/arm/configs/i9100_defconfig
 $ wget "" -O arch/arm/boot/dts/exynos4210-i9100.dts
 $ wget "" -O arch/arm/boot/dts/exynos4210.dtsi
 # patch file arch/arm/boot/dts/Makefile
 $ export ARCH=arm
 $ export CROSS_COMPILE=arm-none-eabi-
 $ make i9100_defconfig
 $ make -j6
 $ make dtbs
 $ cat arch/arm/boot/zImage arch/arm/boot/dts/exynos4210-i9100.dtb > zimage
 $ mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n Linux-android-sucks -d zimage boot.img

make modules_install INSTALL_MOD_PATH=../

 $ heimdall flash --kernel u-boot.bin

Unfortunately some things doesn't work here any more. Using a keyboard with USB-OTG fails and also the screen output is up-side-down. I haven't yet found the fixes made to the custom 4.2 port which I have to reapply :(

Meanwhile Paul Cercueil is submitting an updated version of the device tree file upstream. As of March 2020, it is not yet clear when it will be accepted.

Firmware files

Proprietary firmware files are needed to get Wifi and Bluetooth working with the mainline kernel. In the following commands, I download them to the ArchLinuxARM root filesystem before booting the device. This should also work for postmarketOS:

 $ wget "" -O /usr/lib/firmware/brcm/,i9100.txt
 $ wget "" -O /usr/lib/firmware/brcm/brcmfmac4330-sdio.bin # for wifi
 $ wget "" -O /usr/lib/firmware/brcm/BCM4330B1.hcd # for bluetooth

U-Boot bootloader (legacy)

Sekilsgs2 on Github created a u-boot bootloader port, based on the work done by the user astarasikov at this repository. On Archlinux I was able to compile the older U-Boot version using following commands:

 $ pacman -U dtc-1.4.1-1-x86_64.pkg.tar.xz # downgrade to older version
 $ pacman -S gcc-arm-none-eabi-bin-49 # older gcc version
 $ git clone
 $ cd i9100-uboot
 $ export PATH="/usr/local/arm/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH"
 $ export ARCH=arm
 $ export CROSS_COMPILE=arm-none-eabi-
 $ make galaxys2_config
 $ make galaxys2
 $ heimdall flash --KERNEL u-boot.bin

After that, u-boot is booting, showing a nice bootloader menu which can be controlled by using the arrow keys. Configuring the boot options is done by editing the file include/configs/galaxys2.h. The critical part for me was to change boot parameters in the section "boot_android" to something like this:

 root=/dev/mmcblk1p1 rw rootfstype=ext4 rootwait init=/sbin/init ;

Where /dev/mmcblk1p1 was the ext4 partition with the root filesystem on the sd-card.

User:Onny is interested in porting the i9100 u-boot patches to newer versions of u-boot but currently u-boot fails with the newer s5p_sdhci driver introduced in newer versions, see Github issue here.

Sekilsgs2 is also working on (March 2020) supporting the Galaxy S2 in the latest u-boot version.

TALUAtGitHub has a recent commit (March 2020) git commit that might be helpful [1]



- Create conf for wpa_supplicant

 $ wpa_passphrase "SSID" "password" > wifi

Note : If you are connecting to a hidden wireless network, make sure to add line "scan_ssid=1" after the ssid line in your generated conf file

- Connect to wifi AP

 $ sudo wpa_supplicant -i wlan0 -c wifi &

- Get ip address from dhcp server (in another terminal)

 $ sudo udhcpc -i wlan0

To set wifi connection to start automatically on boot, please refer here wifi


Using Ofono: Best way seems to get Samsung IPC modem support from the patchset (but it was not accepted) and does not build . I would appreciate help from someone that understands C.

Second idea was to build Andoird RIL + Samsung RIL and get ofono working with ofono-ril support - .


Setting the hardware clock

If you have already setup chrony and if your hardware clock doesn't have the time set you can set it with,

localhost:~# hwclock -w  # Write the current system time to the hardware clock

Setting the display brightness

To adjust display brightness write a value between 0-255 to file given below,

localhost:~# echo 0 > /sys/class/backlight/panel/brightness #set the display to its lowest brightness

localhost:~# echo 255 > /sys/class/backlight/panel/brightness #set the display to maximum brightness

Reading Accelerometer sensor

Accelerometer sensor data can read from following file

localhost:~$ cat /sys/class/accelerometer/accelerometer/acc_file

Hardware specifications

This device is supported by Replicant. With some more research we should be able to get most stuff running with their free software userland drivers.


Samsung Exynos 4 Dual 45 nm (GT-I9100, SHW-M250S/K/L) source


1.2 GHz dual-core ARM Cortex-A9 (GT-I9100, GT-I9105, GT-I9100G, SHW-M250S/K/L) source


ARM Mali-400 MP4 (GT-I9100, SHW-M250S/K/L) source

WiFi / Bluetooth / FM radio

Broadcom BCM4330 (SWB-B42) Bluetooth 4.0 Dual Band WLAN FM source source

Driver? -

Firmware -


1 GB RAM [2]


16 GB or 32 GB flash memory [3]

Removable storage

microSD (up to 128 GB SDXC) [4]


  • XMM6260 [5]
  • aka "X-GOLD 626", and it's also used in Nexus 7 [6]
  • it seems to be supported by the mainline kernel (big questionmark here) [7]


  • Yamaha MC1N2
  • The Android kernel exposes the alsa API.
  • But when you play with the volume sliders in alsamixer, nothing happens
  • /dev/snd/hwC0D0 implements hardware-specific controls (via ioctl) [8] (check the link for a free software Android userspace driver)
  • We could write a daemon, that watches the alsa sound levels, and unmutes channels (speaker, headphones etc.) via hwC0D0 as necessary. (This will only work with the downstream kernel, the sound is probably not implemented in the upstream kernel at all?)
  • Maybe all this is overkill and the strategy from Audio works as well.

Light / proximity sensor

the CM3663 sensor is being use and there is no driver in mainline. A downstream driver is available here.


  • Fairchild FSA3200UMX switch [9]
  • Maxim MAX8997 PMIC [10]
  • Silicon Image 9244 transmitter [11]
  • Should be all supported to a certain extent in mainline 4.15 kernel (of course the device is still stuck to 3.0 for the time being)

Serial / UART

It is not exactly clear yet where to find UART / serial on the device. For possible location see second image below (red rectangle). Nevertheless a good instruction on hardware teardown is available here. Follow this guide until step 5, than proceed with removing the black cover from the circuit board (see first image below).


See also