Jump to content

Samsung Galaxy SII (samsung-i9100): Difference between revisions

From postmarketOS Wiki
Knuxify (talk | contribs)
m adjust to new chipset naming rules (https://gitlab.com/postmarketOS/wiki/-/issues/69)
Halamix2 (talk | contribs)
mNo edit summary
 
(26 intermediate revisions by 8 users not shown)
Line 6: Line 6:
| imagecaption = First photo ever released of postmarketOS (from the original [https://ollieparanoid.github.io/post/postmarketOS/ introduction post]).
| imagecaption = First photo ever released of postmarketOS (from the original [https://ollieparanoid.github.io/post/postmarketOS/ introduction post]).
| releaseyear = 2011
| releaseyear = 2011
| originalsoftware = Android 2.3.4
| originalsoftware = Android
| originalversion = 2.3.4
| chipset = Samsung Exynos 4210 Dual
| chipset = Samsung Exynos 4210 Dual
| cpu = Dual-core 1.2 GHz Cortex-A9
| cpu = Dual-core 1.2 GHz Cortex-A9
Line 14: Line 15:
| memory = 1 GB
| memory = 1 GB
| architecture = armv7
| architecture = armv7
| type = handset
| status_usbnet = Y
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
Line 22: Line 24:
| status_fde = P
| status_fde = P
| status_mainline = P
| status_mainline = P
| status_battery =  
| status_battery = Y
| status_3d = Y
| status_3d = Y
| status_accel = Y
| status_accel = Y
| status_audio =  
| status_audio =  
| status_bluetooth =
| status_bluetooth = Y
| status_camera =
| status_camera =
| status_gps =  
| status_gps =  
Line 32: Line 34:
| status_sms =  
| status_sms =  
| status_calls =  
| status_calls =  
| status_uboot = yes
| status_uboot_mainline = N
| status_uboot_primary = Y
| status_uboot_keyboard = -
| booting = yes
| booting = yes
| whet_dhry = 542.5
| whet_dhry = 542.5
Line 53: Line 59:


=== Installation ===
=== Installation ===
Follow the [[Samsung_Galaxy_SII_(samsung-i9100)/Installation|Installation instructions]].


We're using the <code>heimdall-isorec</code> flash method, see [[deviceinfo_flash_methods]] for more information.
==== Enable ODIN (download) mode ====
* Turn off phone
* Connect USB cable
* Hold <code>VOLUME_DOWN</code> + <code>HOME</code> + <code>POWER</code> until you get the "Warning!!" screen
* Push <code>VOLUME_UP</code> to continue to ODIN mode, as per the instructions appearing on the screen
==== Option #1: Install to the internal memory (easiest) ====
* Configure the image:
  $ pmbootstrap init
Use the channel "edge", vendor "samsung", device codename "i9100".
It is recommended to use the mainline kernel, with the Phosh UI, and the WiFi firmwares for the best experience, but you can customize it to your needs.
{{note|Not all the configurations will work. See [[#What_works|What works]] to confirm your choice.}}
* Build the image:
  $ pmbootstrap install
* Flash the OS to the internal memory:
  $ pmbootstrap flasher flash_kernel
   $ pmbootstrap flasher flash_rootfs
   $ pmbootstrap flasher flash_rootfs
The phone will reboot between the two commands, make sure to re-enter the ODIN (download) mode to execute the last command. This one can take a very long time to start. Once the transfer is complete, the phone will reboot again and your phone should boot into PostmarketOS.
==== Option #2: Install to a SD card ====
* As above, configure the image with:
  $ pmbootstrap init
* Insert the SD card and find its path
One way is to run <code>lsblk</code> in a terminal and find the path to the SD card (e.g. <code>/dev/sde</code>). In the following steps, we will use <code>/path/to/sdcard</code> as a placeholder, which you should adapt to your system.
* Install PostmarketOS to the SD card
  $ pmbootstrap install --sdcard=/path/to/sdcard
* Insert the SD card into your Galaxy S2 and reboot. The system should boot (JonesV tested it with xfce4 and weston on 2020-08-20).
==== Option #3: Install from the recovery zip installer ====
* Install a recovery like TWRP on your device
* Configure the image
  $ pmbootstrap init
* Prepare the installation
  $ pmbootstrap install --android-recovery-zip
* Flash the image on the phone
  $ pmbootstrap flasher --method=adb sideload
==== Option #4: Export the recovery zip into the eMMC's UMS partition over MTP and install from recovery ====
{{note|Tacokoneko used this method for Samsung Galaxy S II Epic 4G Touch (d710) when none of the above methods worked for their device. Tacokoneko has not been able to enable WiFi with either downstream or mainline kernels as of 2021-08-25, but most other features in [[#What_works|What works]] and 3D acceleration are functional.}}
{{note|Requirements:
* GNU/Linux or busybox + alternative libc Linux PC with <code>pmbootstrap</code> and <code>heimdall</code> installed correctly
* USB-A to Micro-B 2.0 cable
* Very specific [https://web.archive.org/web/20211016165544/https://ava5.androidfilehost.com/dl/pxAk_EJZRWM-GXKQQDe8PQ/1634489670/24459283995313934/kernel-Lanchon-20160406-cm-13.0-i9100.zip special temporary kernel] and [https://web.archive.org/web/20211016165520/https://ava5.androidfilehost.com/dl/uO8S1FY1sLhEPmDN1dUXpA/1634489678/24369303960684130/recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-%28by-arnab%29.zip special version of TWRP custom recovery] - these are down a rabbit hole starting at the [https://twrp.me/samsung/samsunggalaxys2i9100.html official TWRP support page for i9100]
* An MTP client, preferably with virtual file system mounting support
}}
* Update pmbootstrap
  $ pmbootstrap pull
* Configure the image, select samsung i9100
  $ pmbootstrap init
* Download, prepare and compress postmarketOS into a recovery package for TWRP
  $ pmbootstrap install --android-recovery-zip
* Extract the required temporary recovery and kernel created by Lanchon on XDA Forums
  $ unzip recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-\(by-arnab\).zip
  $ unzip kernel-Lanchon-20160406-cm-13.0-i9100.zip
* Start the device in download mode (hold <code>VOLUME_DOWN</code> + <code>POWER</code> -> <code>VOLUME_UP</code> for d710) -> plug device into PC
* Flash the temporary kernel and TWRP using <code>heimdall</code>
  $ heimdall flash --RECOVERY recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-\(by-arnab\)/isorec-ramdrive.cpio.lzo --KERNEL kernel-Lanchon-20160406-cm-13.0-i9100/boot.img --no-reboot
* Unplug the device -> reboot to recovery (hold <code>VOLUME_UP</code> + <code>POWER</code> for d710)-> plug device back in -> in TWRP, mount -> disable MTP -> enable MTP -> back
* Export the pmbootstrap chroot contents and create a symlink to them in <code>/tmp/</code>
  $ pmbootstrap export
* Change directory to the location of <code>pmos-samsung-i9100.zip</code>
  $ cd $(dirname $(readlink /tmp/postmarketOS-export/pmos-*.zip))
* Use an MTP client, for example [https://pkgs.alpinelinux.org/package/edge/community/x86_64/gvfs-mtp gvfs-mtp] with [https://wiki.alpinelinux.org/wiki/Gnome_Setup GNOME], to mount the device's eMMC UMS partition (virtual SD card) filesystem. If the one included with your Desktop Environment isn't working with this device, keep trying other MTP clients until you find one that does. The path it is mounted to may vary for you.
  $ cp pmos-samsung-i9100.zip /run/user/1000/gvfs/mtp:host=samsung_GT-I9100_0123456789ABCDEF/eMMC/
* When the transfer is complete, in TWRP, install -> eMMC -> select pmos-samsung-i9100.zip -> swipe to flash postmarketOS into DATAFS
* When complete, reboot to download mode and flash the postmarketOS kernel and recovery, overwriting the temporary ones
   $ pmbootstrap flasher flash_kernel
   $ pmbootstrap flasher flash_kernel
* When complete, the device will reboot into postmarketOS
==== Mainline kernel ====
The Galaxy SII can be used with the mainline kernel for Exynos devices, packaged by PostmarketOS. Simply choose the mainline kernel when running pmbootstrap init.
==== Firmware files ====
When running "pmbootstrap init", it will ask you if you want to enable the "device-samsung-i9100-nonfree-firmware" package. Write "y" to be able to use the embedded WiFi chip.
==== U-Boot bootloader (legacy) ====
[https://github.com/Sekilsgs2 Sekilsgs2] on Github created a [https://github.com/Sekilsgs2/i9100-uboot.git u-boot bootloader port], based on the work done by the user [https://github.com/astarasikov astarasikov] at [https://github.com/astarasikov/i9100-uboot this repository]. It is possible to use it with PostmarketOS but it requires some things to be done by hand.
* In <code>pmbootstrap init</code>, add <code>u-boot-samsung-i9100</code> to the list of extra packages to enable.
* Run <code>pmbootstrap install</code> to build the image.
* Flash the OS using one of the methods listed above.
* Now, we want both u-boot and the kernel to be installed to the same partition (KERNEL). So you need to concatenate the two files and flash the result:
  $ cp ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9100/boot/u-boot.bin /tmp/u-boot-with-kernel.img
  $ dd if=~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9100/boot/vmlinuz-dtb of=/tmp/u-boot-with-kernel.img bs=512K seek=1 conv=notrunc
  $ heimdall flash --KERNEL /tmp/u-boot-with-kernel.img
Once flashed, the phone will reboot and you should see u-boot appear. Configuring the boot options is not trivial as it can only be done by editing the source code (file: <code>include/configs/galaxys2.h</code>). 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 <code>/dev/mmcblk1p1</code> 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 [https://github.com/Talustus/i9100-uboot/issues/1 here].
[https://github.com/Sekilsgs2 Sekilsgs2] is also working on (March 2020) [https://github.com/Talustus/i9100-uboot/issues/2 supporting the Galaxy S2] in the latest u-boot version.
[https://github.com/TALUAtGitHub/ TALUAtGitHub] has a recent commit (March 2020) git commit that might be helpful [https://github.com/TALUAtGitHub/i9100-uboot]


=== Usage ===
=== Usage ===
Line 214: Line 102:


If you have already setup chrony and if your hardware clock doesn't have the time set you can set it with,
If you have already setup chrony and if your hardware clock doesn't have the time set you can set it with,
<source lang="shell">
<syntaxhighlight lang="shell">
localhost:~# hwclock -w  # Write the current system time to the hardware clock</source>
localhost:~# hwclock -w  # Write the current system time to the hardware clock</syntaxhighlight>


==== Setting the display brightness ====
==== Setting the display brightness ====


To adjust display brightness write a value between 0-255 to file given below,
To adjust display brightness write a value between 0-255 to file given below,
<source lang="shell">
<syntaxhighlight lang="shell">
localhost:~# echo 0 > /sys/class/backlight/panel/brightness #set the display to its lowest brightness
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
localhost:~# echo 255 > /sys/class/backlight/panel/brightness #set the display to maximum brightness


</source>
</syntaxhighlight>


==== Reading Accelerometer sensor ====
==== Reading Accelerometer sensor ====


Accelerometer sensor data can read from following file
Accelerometer sensor data can read from following file
<source lang="shell">
<syntaxhighlight lang="shell">
localhost:~$ cat /sys/class/accelerometer/accelerometer/acc_file  
localhost:~$ cat /sys/class/accelerometer/accelerometer/acc_file  
</source>
</syntaxhighlight>


=== Hardware specifications ===
=== Hardware specifications ===
Line 285: Line 173:


==== Serial / UART ====
==== Serial / UART ====
<!-- Note: this section is linked to externally, please do not change the 'Serial / UART' header -->
Pressing home key during early boot enables bootloader debug output. To get kernel logs through 619 kOhm micro-usb serial debugging cable it is required to set the environmental variable SWITCH_SEL to 3 in bootloader SBL shell. To enter SBL shell hold the RETURN key in minicom/picocom/your favorite UART program when starting the device, until you get the SBL> prompt. From there you can then change the CMDLINE and boot with:
  setenv SWITCH_SEL 3
  setenv CMDLINE loglevel=7 console=ttySAC2,115200
  saveenv
  boot
Setting SWITCH_SEL somehow enables serial output on the USB connector.


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 [https://www.ifixit.com/Guide/Samsung+Galaxy+S+II+Micro-USB+Port+Replacement/58028 available here]. Follow this guide until step 5, than proceed with removing the black cover from the circuit board (see first image below).
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 [https://www.ifixit.com/Guide/Samsung+Galaxy+S+II+Micro-USB+Port+Replacement/58028 available here]. Follow this guide until step 5, than proceed with removing the black cover from the circuit board (see first image below).
Line 306: Line 204:
* [https://code.paulk.fr/article9/galaxy-s2-replicant-port-status-update Galaxy S2 Replicant port status update]
* [https://code.paulk.fr/article9/galaxy-s2-replicant-port-status-update Galaxy S2 Replicant port status update]
* [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS2I9100 Replicant wiki device page]
* [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS2I9100 Replicant wiki device page]
* [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS2I9100Installation Replicant wiki installation page]
* {{Device package|samsung-i9100}}
* {{Device package|samsung-i9100}}
* [https://github.com/postmarketOS/pmbootstrap/issues/456 netcat installation method]
* {{MR|456}} netcat installation method

Latest revision as of 11:33, 1 February 2025

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
Type handset
Hardware
Chipset Samsung 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
Software
Original software Android
Original version 2.3.4
postmarketOS
Category testing
Pre-built images no
Mainline partial
Unixbench Whet/Dhry score 542.5
Features
Flashing
Works
USB Networking
Works
Internal storage
No data
SD card
No data
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
No data
Camera
No data
Camera Flash
No data
Connectivity
WiFi
Works
Bluetooth
Works
GPS
No data
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
Partial
USB OTG
No data
HDMI/DP
No data
Sensors
Accelerometer
Works
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data
U-Boot
Primary Bootloader
Works
Secondary Bootloader
No data
Mainline
Broken
Internal Storage
No data
SD card
No data
USB Host
No data
USB Peripheral
No data
Display
No data
Buttons
No data
Running Xfce

Contributors

  • ollieparanoid
  • veggie
  • timbz

Device Owners


What does not work yet

  • Audio
  • Bluetooth
  • Modem
  • MHL (Video-out)
  • See "Hardware specifications" for ideas how to get them working.

Installation

Follow the Installation instructions.

 $ pmbootstrap flasher flash_rootfs
 $ pmbootstrap flasher flash_kernel

Usage

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

Modem

Using 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

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

Light / proximity sensor

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

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)

Serial / UART

Pressing home key during early boot enables bootloader debug output. To get kernel logs through 619 kOhm micro-usb serial debugging cable it is required to set the environmental variable SWITCH_SEL to 3 in bootloader SBL shell. To enter SBL shell hold the RETURN key in minicom/picocom/your favorite UART program when starting the device, until you get the SBL> prompt. From there you can then change the CMDLINE and boot with:

 setenv SWITCH_SEL 3
 setenv CMDLINE loglevel=7 console=ttySAC2,115200
 saveenv
 boot

Setting SWITCH_SEL somehow enables serial output on the USB connector.

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

Photos

See also