Jump to content

Samsung Galaxy Tab 3 8.0 (samsung-lt01)

From Nura Wiki
Samsung Galaxy Tab 3 8.0
Photo of the Galaxy Tab 3 8.0 running Nura
Photo of the Galaxy Tab 3 8.0 running Nura
Manufacturer Samsung
Name Galaxy Tab 3 8.0
Codename samsung-lt01
Model SM-T310, SM-T311, SM-T315
Released 2013
Type tablet
Hardware
Chipset Samsung Exynos 4212 Dual
CPU Dual-core 1.5 GHz Cortex-A9
GPU Mali-400MP4
Display 800x1280
Storage 16GB
Memory 1.5GB
Architecture armv7
Software
Original software
The software and version the device was shipped with.
Android 4.2.2
Extended version
The most recent supported version from the manufacturer.
Android
FOSS bootloader no
Nura
Category testing
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
yes
Nura kernel
The kernel version that runs on the device's port.
6.10.0
Unixbench score
Unixbench Whetstone/Dhrystone score. See Unixbench.
638.8
Device package device-samsung-lt01
Kernel package linux-postmarketos-exynos4
Features
Flashing
Whether it is possible to flash the device with pmbootstrap flasher.
Works
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Works
Internal storage
eMMC, SD cards, UFS...
Works
SD card
Also includes other external storage cards.
Works
Battery
Whether charging and battery level reporting work.
Works
Screen
Whether the display works; ideally with sleep mode and brightness control.
Partial
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Works
Camera
Broken
IR TX
Broken
Connectivity
Wi-Fi
Works
Bluetooth
Works
GPS
Broken
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Untested
USB OTG
USB On-The-Go or USB-C Role switching.
Works
Sensors
Accelerometer
Handles automatic screen rotation in many interfaces.
Works
Magnetometer
Sensor to measure the Earth's magnetism
Broken
Ambient Light
Measures the light level; used for automatic screen dimming in many interfaces.
Works
Hall Effect
Measures magnetic fields; usually used as a flip cover sensor
Works

Maintainer(s)

Users owning this device

  • Ka33 (Notes: Works, pmos installing target)
  • Knuxify (Notes: SM-T310, 2x, mainlined!)
  • Lordkaczuha (Notes: (SM-T310) 2x one cracked but touch works, other one is fully working but has a slightly spicy pillow .)

Special boot modes

  • Download Mode: With the device powered off, hold Volume Down and Power while connecting the device to a computer with a USB cable. A warning screen will appear: click Volume Up to enter Download Mode and run Heimdall commands.

Note: The device will only appear as USB gadget if booted into Android when plugging it in the host. Entering flash mode and then plugging it into the host computer will prevent it from showing up. To verify the device is available before trying the installation steps:

$ lsusb | grep -i samsung
Bus 003 Device 002: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy series, misc. (MTP mode)

Installation

See Installation/Using pmbootstrap. This section contains the device-specific information related to installing with pmbootstrap.

In pmbootstrap init, select samsung as the vendor and lt01 as the device. You will be prompted to select a variant:

  • wifi for the SM-T310;
  • 3g for the SM-T311;
  • lte for the SM-T315.

Flashing

To flash the image to the device, enter download mode by holding down the Power and Volume down keys simultaneously until the download mode warning screen shows up, then press Volume up to dismiss the warning.

First, flash the kernel:

$ pmbootstrap flasher flash_kernel

The device will reboot; boot it back into download move with the above key combination.

Then, flash the rootfs. To flash to the userdata partition (recommended as it has more space, but will wipe your Android data!):

$ pmbootstrap flasher flash_rootfs --partition USERDATA

If you want to flash the rootfs to the system partition, drop --partition USERDATA from the above command.

Edge larger than 8MB flash size

If flashing fails with ERROR: BOOT partition is too small for given file. Use --skip-size-check to flash anyways. your boot.img was larger than 8MB. The issue is mkinitfs uses the Go xz implementation, which produces slightly files larger than the xz binary even given the same parameters. You need to uncompress and recompress the initramfs to make the boot.img fit into the 8MB flash size boundaries.

$ cd ~/.local/var/pmbootstrap/chroot_rootfs_samsung-lt01/boot
$ xz -dc initramfs > initramfs.cpio
$ xz --format=xz --check=crc32 --lzma2=preset=9e,dict=8MiB -T1 -c initramfs.cpio > initramfs

Then rebuild boot.img, changing the ramdisk_size header field at absolute offset 16. You can use this python script to do this for you:

import struct

PAGE_SIZE = 2048

with open("boot.img", "rb") as f:
    boot_image = f.read()

(
    kernel_size,
    kernel_addr,
    ramdisk_size,
    ramdisk_addr,
    second_size,
    second_addr,
    tags_addr,
    page_size,
    dt_size,
    os_version,
) = struct.unpack("<10I", boot_image[8:48])


def aligned_pages(size):
    return (size + PAGE_SIZE - 1) // PAGE_SIZE


offset = PAGE_SIZE

kernel = boot_image[offset:offset + kernel_size]
offset += aligned_pages(kernel_size) * PAGE_SIZE

ramdisk = boot_image[offset:offset + ramdisk_size]
offset += aligned_pages(ramdisk_size) * PAGE_SIZE

second = boot_image[offset:offset + second_size]

with open("initramfs", "rb") as f:
    new_ramdisk = f.read()

header = bytearray(boot_image[:PAGE_SIZE])
struct.pack_into("<I", header, 16, len(new_ramdisk))

output = bytes(header)

output += kernel
output += b"\0" * (aligned_pages(kernel_size) * PAGE_SIZE - kernel_size)

output += new_ramdisk
output += b"\0" * (
    aligned_pages(len(new_ramdisk)) * PAGE_SIZE - len(new_ramdisk)
)

if second_size:
    output += second
    output += b"\0" * (aligned_pages(second_size) * PAGE_SIZE - second_size)

with open("boot.img.new", "wb") as f:
    f.write(output)

Check that the size of boot.img.new is below 8MB and replace the original boot image.

$ cp boot.img.new boot.img

At last flash the boot image without rebuilding it:

$ pmbootstrap flasher flash_kernel --no-install

Then go on installing flashing the rootfs as described above with flash_rootfs.

Parts and their status

Note If the DRM driver crashes (screen gets stuck, lines start to get blurry/dimmer), power off the device immediately as leaving it on WILL (temporarily) damage your display! Usually the damage goes away after anywhere from a few minutes to about half an hour, but it's better to be safe.

Current issues:

  • RAM is limited to 1GB due to some weird quirks in how the later RAM is treated by the downstream kernel
  • Backlight forgets settings after suspend, resulting in choppy brightness changes
  • In Phosh, moving the mouse cursor around in landscape mode will cause the DRM driver to crash ("vblank wait timed out")
  • On one of my tablets, the screen sometimes has weird black lines on it; usually fixes itself on panel restart. Need to figure out if this is a hardware issue or if it could be worked around (the display seems to behave weirdly on startup too, maybe it's just the hardware...)
  • OTG works, but peripheral mode might not work after switching to OTG (if you see messages about DWC gadget init after plugging in an OTG cable, it will likely not work). This is yet to be fixed.
  • When plugging in headphones, the "media" key is detected to be pressed, causing a media player to be launched. (TODO, maybe it should be remapped to play/pause?)
  • Sometimes a display distortion appears like shown below, which may go away after a few times pressing the power button to turn off and on the display.

For the status of all components, see the tables below:

Element type Element Works? Notes
Chipset Exynos 4212 Y
Graphics Mali-400MP4 Y
Charging IC max77693 Y Supported in mainline.
Audio WM1811 Y Speaker and headphone jack works, internal mic works (but peaks - TODO).
PMIC S5M8767 Y Supported in mainline
Fuel gauge MAX17050 Y Supported by MAX17042 driver
Touchscreen MELFAS MMS252 Y Pretty much identical to the other Melfas touchscreens in mainline. Using mms114 compatible for now. Both touchscreen and touch keys work.
Buttons gpio-keys Y Volume up/down, power and home button.
WiFi, Bluetooth BCM4334 Y Driver in mainline.
Display S6D7AA0 LSL080AL02 P Driver in kernel fork. See also: Blog post about getting the display working. Moderate to heavy glitching on some tablets, pending investigation.
Backlight LP8556TMX Y PWM-controlled backlight controller. Seems to have a weird issue where setting it to 100% causes the backlight to shut down (though this is lazily worked around in my fork). Also seems to forget ROM settings after suspend.
Camera Sony ISX012 and Siliconfile SR130PC20 Both aren't in mainline
IR ABOV Semiconductor MC96FR332AUB The kernel option is IR_REMOCON_MC96, but REMOCON just seems to be Samsung's designation for remote controllers (given that they use it in part numbers for their TV remotes). The Kconfig description says it's a Micom(ABOV) device (Micom seems to be a generic term for microcontrollers). It's an 8-bit microcontroller, programmed with a custom firmware bundled in the kernel as drivers/irda/irda_fw.h. Chip markings say ABOV 332AUB 1427. Also used on the GT-N8000. Official site/datasheet for what seems to be the same model, datasheet mirror. WIP work in my kernel tree, IR led lights up but does not actually work as a remote - wrong configuration or driver bug?
MHL sii9244 sii9234 driver seems to initialize fine, can't test because I don't own a dock; currently disabled, since this is the same chip as in the S3 and likely suffers from the same issues (phosh not starting up with dock unplugged)
Modem XMM6262 (3G), Qualcomm ??? (LTE) XMM6262 seems to be supported by replicant but isn't yet in mainline; Qualcomm modem might be MDM9615, since that's what the S3 4G uses; didn't check the code to make sure
GPS BCM47521 No clue about mainline support, seems to be unsupported

Sensors

Shared

Element type Element Works? Notes
Hall effect/flip cover sensor gpio-keys Y Simple sensor connected via GPIO.
Accelerometer STMicroelectronics K2DH Y Seems to be compatible with LIS2DH12
Magnetometer YAS532 P Enabled in DTS and seems to be detected, but the values don't seem to make much sense? TODO

WiFi

Element type Element Works? Notes
Light sensor CM3323 Y Driver in mainline

3G/LTE

Element type Element Works? Notes
"Grip sensor"? AD semiconductor ASP01 Appears to be a "Capacitive Touch/Proximity Sensor"; datasheet. Not 100% sure what this is used for.
Proximity sensor CM36653 Not in mainline; likely similar to CM36651

Caveats

  • Firefox requires EGL 3.0 to run, while Mali 400 can only do EGL 2.0. Using a Firefox as webbrowser will force it into software rendering and putting a high load on the CPU even for simple tasks. Rather use a browser that is EGL 2.0 compatible.

See also