Samsung Galaxy SII (samsung-i9100)

From postmarketOS
Jump to: navigation, 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, d710
Released 2011
Original software Android 2.3.4
Hardware
Chipset Exynos 4210 Dual
CPU Dual-core 1.2 GHz Cortex-A9
GPU Mali-400MP4
Display 480x800 AMOLED
Storage 16/32 GB
Memory 1 GB
Architecture armhf
Features
USB Networking
Works
Flashing
Touchscreen
Works
Display
Works
WiFi
Works
Xwayland
Works
FDE
Partial
Mainline
Battery
3D Acceleration
Accelerometer
Works
Audio
Bluetooth
Camera
GPS
Mobile data
SMS
Calls
Running XFCE

Contributors

  • ollieparanoid
  • veggie

What works

  • Installation to sdcard (pmbootstrap install --sdcard=/dev/mmcblk...)
  • Installation to device memory (partial)
  • 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

Installation

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.)
Step by step guide for Flashing via netcat (#456)

- Build image (on your computer)

-- Install pmboostrap

 $ git clone https://gitlab.com/postmarketOS/pmbootstrap.git

-- Change working directory to the pmboostrap

 $ cd pmbootstrap/

-- Configure

 $ ./pmbootstrap.py 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

 $ ./pmbootstrap.py 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 - https://github.com/Benjamin-Dobell/Heimdall/issues/418

-- 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

 $ ./pmbootstrap.py initfs hook_add debug-shell

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

 $ ./pmbootstrap.py flasher flash_kernel

-- Check USB network connection to phone

 ping 172.16.42.1

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

-- Connect to phone with telnet

 $ telnet 172.16.42.1

-- 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)

 $ ./pmbootstrap.py 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 172.16.42.1 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.

Wifi

- 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

ofono

Best way seems to get Samsung IPC modem support from the patchset https://lists.ofono.org/pipermail/ofono/2012-September/013766.html (but it was not accepted) and does not build https://github.com/tssk/pmbootstrap/commits/device-samsung-i9100_modem . 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 - https://redmine.replicant.us/projects/replicant/wiki/Samsung-RIL .

GPS

https://univers-libre.net/posts/galaxy-s2-gps-on-replicant.html

https://redmine.replicant.us/projects/replicant/wiki/GSD4t

https://github.com/mnalis/gsd4t_parser

https://redmine.replicant.us/boards/21/topics/897

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 for i9100

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.

SoC

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

CPU

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

GPU

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? - https://wireless.wiki.kernel.org/en/users/drivers/brcm80211

Firmware - https://android.googlesource.com/platform/hardware/broadcom/wlan/+/master/bcmdhd/firmware/bcm4330/

Memory

1 GB RAM [1]

Storage

16 GB or 32 GB flash memory [2]

Removable storage

microSD (up to 128 GB SDXC) [3]

Modem

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

Audio

  • 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) [7] (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.

MHL

  • Fairchild FSA3200UMX switch [8]
  • Maxim MAX8997 PMIC [9]
  • Silicon Image 9244 transmitter [10]
  • 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)

Photos

See also