Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mcxiaoke/9485c7f6978326553269decbcc6beca3 to your computer and use it in GitHub Desktop.
Save mcxiaoke/9485c7f6978326553269decbcc6beca3 to your computer and use it in GitHub Desktop.
Installing Linux on a Baytrail tablet

Hardware specs

Chinese Brand "ITworks" , Model TW891, distributed in France and Belgium by Darty

  • CPU: Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz
  • Video: Intel® HD Graphics for Intel Atom® Processor Z3700 Series
  • Screen: 1280x800
  • WiFi + BT: Realtek RTL8723BS_BT
  • Disks: mmcblk1: mmc1:0001 DF4032 29.1 GiB
  • RAM: 2GB DDR3 @ 1333 MHz
  • BT:

UEFI32 / 64-bit OS

This common issue is solved out of the box by the most recent (testing/unstable) Debian installer.

Other OS (f.i. Ubuntu) are harder to install. To solve the issue with those OS, just check your USB install media before using it for installation. You should have a file named /EFI/BOOT/bootia32.efi. If not, download one from the net and put it in this directory. I was successful with the one from there : https://github.com/hirotakaster/baytail-bootia32.efi/

Generic guidelines

When faced with a new hardware that is not recognised by linux, your first task is to identify every component in the hardware. Install the following tools and check their output :

apt-get install i2c-tools hwinfo lshw pciutils usbutils
lspci
lshw
lsusb
hwinfo --short
cat /proc/cpuinfo
dmesg

I found out that this magic command can be helpfull :

find /sys/devices/platform -name name -printf "%p\t" -exec cat {} \;

It will show you the recognized platforms and all devices that it failed to recognize.

Newer kernel

By using the most recent kernel, most of the issues (MMC, Graphics, Wi-Fi) are resolved.

Device is running fine with Debian Buster with the most recent kernel back-ported.

Add this line to /etc/apt/sources.list :

deb http://deb.debian.org/debian buster-backports main contrib non-free

Then install the newest kernel and non-free realtek and intel drivers :

apt-get -t buster-backports install linux-image-5.2.0-0.bpo.1-amd64-unsigned firmware-realtek firmware-intel-sound

You need the non-free realtek drivers to support the built-in Wi-Fi card.

You get a mostly running device, but some drivers are still missing. You need to re-compile the kernel to support touchscreen and battery indicators.

Remaining issues

find /sys/devices/platform -name name -printf "%p\t" -exec cat {} \;

Gives you a list of ACPI devices which are not handled by the kernel : their name is not overriden by a human-friendly name.

/sys/devices/platform/80860F41:00/i2c-0/i2c-INT0310:00/name     INT0310:00
  Intel Camera Sensor Intel GC310
/sys/devices/platform/80860F41:03/i2c-3/i2c-MSSL1680:00/name    MSSL1680:00
  SiLead MSSL 1680 touch screen
/sys/devices/platform/80860F41:01/i2c-1/i2c-OVTI2680:01/name    OVTI2680:01
  OmniVision Technologies Camera Sensor OV2680 
/sys/devices/platform/80860F41:01/i2c-1/i2c-10EC5640:00/name    10EC5640:00
  Realtek I2S Audio Codec
/sys/devices/platform/80860F41:04/i2c-4/i2c-INT33F4:00/name     INT33F4:00
  Intel(R) Power Management IC
/sys/devices/platform/80860F41:02/i2c-2/i2c-KIOX000A:00/name    KIOX000A:00
  Kionix KXCJ9 Accelerometer 

Touchscreen

You need both the kernel driver (option in kernel config) and the firmware. Firmware can be found there : https://github.com/onitake/gsl-firmware

CONFIG_TOUCHSCREEN_SILEAD=y

Install the firmware file :

mkdir -p /lib/firmware/silead
cd /lib/firmware/silead
wget 'https://github.com/onitake/gsl-firmware/raw/master/firmware/linux/silead/gsl3670-itworks-tw891.fw'

Sound

You need to install sound profile from https://github.com/plbossart/UCM/tree/master/bytcr-rt5640

You also need to blacklist kernel's auto-detected HDMI sound driver to support built-in sound (speaker and headphones) :

echo 'blacklist snd_hdmi_lpe_audio' >> /etc/modprobe.d/50-block-hdmi-audio.conf

Bluetooth

Bluetooth is not detected (not sure if the tablet supports bluetooth, tough)

Cameras

Neither the front, nor the back cameras are detected

Battery levels

Battery levels are not detected

All devices without a corresponding driver

Using the ACPI identifier, you can get the vendor of the component ( https://uefi.org/acpi_id_list ) and possibly the component type/function (just google it)

/sys/devices/platform/80860F41:00/i2c-0/i2c-INT33FE:00

The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for 3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch.

Driver is found in Kernels >=4.19 (option INTEL_CHT_INT33FE)

/sys/devices/platform/80860F41:00/i2c-0/i2c-INT0310:00

Intel Camera Sensor CG310

/sys/devices/platform/80860F41:01/i2c-1/i2c-OVTI2680:01

The OV2680 (RAW) is a cost-effective, low-power 2-megapixel CameraChip™ sensor for feature phones and front-facing camera applications in smartphones and tablets. See https://www.ovt.com/sensors/OV2680

Driver is found in Kernels >=4.20 (drivers/media/i2c/ov2680.c)

/sys/devices/platform/80860F41:01/i2c-1/i2c-10EC5640:00

Realtek ALC5640 audio

/sys/devices/platform/80860F41:04/i2c-4/i2c-INT33F4:00

Intel(R) Power Management IC Device

Driver is found in Kernels >=4.20 (drivers/mfd/axp20x-i2c.c)

Kernel needs option CONFIG_MFD_AXP20X_I2C

Old pre-Buster (Debian 10) issues

Orientation sensors

The orientation sensors are not correctly interpreted. Display remains in landscape mode when it should be in portrait, and vice-versa.

Troubleshooting : when you use monitor-sensorin a root console (remotely), it shows orientation changes properly. I.e. when the keyboard is attached and the tablet in landscape mode with buttons up, it displays "normal". However, gnome does not understand this "normal" properly and uses a "portrait" orientation.

There is a solution to keep a script running, listening to orientation sensor events (see https://wiki.debian.org/InstallingDebianOn/Acer/Spin1 ) but it doesn't seem to be the "proper" way to do it.

This is fixed with Debian 10 (Buster) and a new version of xrandr.

Old pre-4.9 kernel issues

MMC controller issues

My tablet has quite a recent MMC controller. As such, the controller was not recognized by most kernels used in standard stable distributions.

This was solved by using the Debian "Unstable" netinst ISO - which uses linux kernel 4.8 : http://cdimage.debian.org/cdimage/stretch_di_rc1/amd64/iso-cd/debian-stretch-DI-rc1-amd64-netinst.iso

Download the ISO and use Rufus (under windows) to write it to a USB thumb drive.

Still, after the install the kernel has issues with the MMC controller one time out of two.

Graphic controller issues

Apparently, this tablet is a little tricky when it comes to graphical modes.

As such, any distribution depending on a graphical mode interface for installation is failing.

By using Debian, you can force a text mode install by selecting the corresponding option in grub menu.

After the initial install, the system reboots and tries to set the console to graphical mode. Also, the screen orientation is set to portrait.

Both issues are solved by editing /etc/default/grub and replacing "quiet" by "video=efifb fbcon=rotate:1 nomodeset"

With more recent kernels (4.19.0), this is no longer necessary. Just keep "fbcon=rotate:1" in the list.

WiFi controller

Downloaded and installed from https://github.com/hadess/rtl8723bs

Still unstable under load.

References

https://github.com/burzumishi/linux-baytrail-flexx10

@mcxiaoke
Copy link
Author

Introduction

This project is an efford to get GNU/Linux running on [Nextbook Flexx 10.1"] (http://nextbookusa.com/productdetail.php?product_id=26) Intel Atom Bay Trail (ASoC) device.

NOTE: Fleex 9 has almost the same hardware.

This document has been tested with the following "GNU/Linux" distributions:

Except for distribution related commands, this documentation can be useful for:

System Hardware Summary

[Nextbook Flexx 10.1"] (http://nextbookusa.com/productdetail.php?product_id=26)

Hardware

- CPU: **Intel Atom Bay Trail Z3735F**
- Video: **Intel HD Graphics (Atom Processor Z36xxx/Z37xxx Series Graphics & Display)** 
- Screen: **10.1" - I2C HID v1.00 Device [FTSC1000:00 2808:1015] on i2c-FTSC1000:00**
- WiFi: **Realtek RTL8723BS Wireless LAN 80211n SDIO Network Adapter**
- Disks: **mmcblk0: mmc0:0001 NCard  28.9 GiB** 
- RAM: **LPDDR3 1067 2GB (on-board)** 
- BT: **Realtek RTL8723BS_BT**

[Full System Hardware Info] (https://github.com/burzumishi/linux-baytrail-flexx10/wiki/Sytem-Hardware)

Project Status

  • Boot Standard Kernel {OK}
  • Detect hard drives {OK}
  • Shutdown {OK}
  • Reboot {OK}
  • Hibernation {OK}
  • Sleep / Suspend {OK}
  • Battery monitor {OK}
  • Xorg & XWayland {OK}
    • OpenGL {OK}
    • Resize-and-Rotate(randr) {OK}
  • Screen backlight {OK}
  • Light sensor {X}
  • Switch to External Screen (HDMI) {OK}
  • Mouse
    • Built-in (Touchpad) {OK}
    • Built-in (Touchscreen) {OK}
  • Bluetooth {i} {OK}
  • Keyboard's Hotkeys {OK}
  • Wireless/Wifi {OK}
  • Sound {i}
  • MicroSD card reader {OK}
  • Built-in camera {X}
  • Accelerometers {OK}

Legend : {OK} = OK ; {X} = Unsupported(No Driver) ; */!* = Error (Couldn't get it working); [?] = Unknown, Not Test; [-] = Not-applicable; {i} = Configuration Required/ needs the kernel patches from sunxi (also hosted here) ; X-( = Only works with a non-free driver and or firmware

Important Notes

{i} The following information and procedures are mostly extracted from the T100TA and Odys wintab 10.1 and adappted to the Flexx10. The T100TA has an hardware similar to that one of the Flexx10, informations and procedures regarding these two models can be usefully shared.

{i} Before installing Linux, Secure Boot needs to be disabled. Also, if dual-booting with Windows 8 it is recommended to disable its fast boot feature.

{i} Although the Debian Jessie (stable) installer includes all the needed modules and core changes to install and boot on this machine, it is advisable to install Debian Stretch (testing) and keep it up to date due to a lot of components still unsupported. If you really want to install Debian Jessie (stable) at least you can use the backport repository to install the latest kernels and firmwares when available.

{i} Another choice is any close to upstream distro (the Arch family will be supported here).

{i} In order to install with any netboot image, by using the internet (e.g. with a netinst image), the wifi has to be enabled. See the steps described in the WiFi section, prepare the needed firmware (see also the d-i manual Loading Missing Firmware) and reproduce the steps using a shell during the installation procedure.

{i} The Flexx 10.1 is a mixed mode EFI system (i.e. a 64-bit CPU combined with a 32-bit EFI) without any legacy BIOS mode. By default, any i386 installer images should boot on this machine via UEFI and let you install a complete 32-bit (i386) system. If you use the multi-arch amd64/i386 netinst or DVD image, you will also be able to install in 64-bit mode. You might expect slightly better performance that way in exchange for ram uasge. Multi-arch DVD images must be modified before booting.

BIOS Access

  1. To disable Secure Boot press F2 when the laptop is starting. You should get a BIOS-alike configuration application where Secure Boot may be disabled (Security tab).

    NOTE: that on Flex 10 you have to press "Fn + F2" to get the "F2" functionality, not some desktop config button.
    NOTE: Press "PowerOn + Volume Down" five seconds for boot menu.

  2. You have to go to pc settings via the charms bar ( bar on the right that pops up on desktop ) then General -> advanced startup-> restart. it will boot up into a blue screen with some options, select troubleshoot, then there should be a bios or uefi restart option, wording differs slightly based on hardware.

Or just open a cmd prompt and type: shutdown.exe /r /o

That will restart into the blue screen with options.

To Turn "Fast Startup" On or Off in System Settings

  1. Open the Control Panel (icons view), and click on the Power Options icon.

  2. Click/tap on the Choose what the power buttons do link on the left side. (see screenshot below)

  3. Click/tap on the Change settings that are currently unavailable link at the top. (see screenshot below)

  4. If prompted by UAC, then click/tap on Yes.

  5. Do step 6 or step 7 below for what you would like to do.

  6. To Turn On "Fast Startup" (Hybrid Boot) for a "Hybrid Shutdown"

    NOTE: This is the default setting.

A) Under Shutdown settings, check the Turn on fast startup box, and click/tap on the Save changes button. (see screenshot below)

NOTE: If the Turn on fast startup setting is not listed, then you will need to close the System Settings window,enable hibernate, then start back at step 1 again.

B) The Shut down Power option will now perform as a hybrid shut down when used.
C) Go to step 8 below.

  1. To Turn Off "Fast Startup" for a "Full Shutdown"

A) Under Shutdown settings, uncheck the Turn on fast startup box, and click/tap on the Save changes button. (see screenshot below step 6A)

NOTE: If the Turn on fast startup setting is not listed, then hibernate has been disabled that removed this setting and also disabled fast startup.

B) The Shut down Power option will now perform as a normal full shut down when used.
C) Go to step 8 below.

  1. You can now close the Power Options window if you like.

Installing Debian

Use native installer, compile kernel with the patches hosted here and install it.

Installing Arch based distros

Compile a custom kernel with patches hosted here.

Install grub with grub-install --target=i386-efi --no-nvram --efi-directory *where you mounted the efi dir* *path to usb efi block device* and make a configuration for grub with grub-mkconfig -o /boot/grub/grub.cfg

Do the usual stuff (locale-gen, set the time, ...)

Note: as with any installation, grub may (or not) crap itself and not use the right UUIDs

System Configuration

Once the system has booted sucessfully, it needs some tweaking:

 * Audio
 * Built-in camera

Intel SST Audio (RT5640)

Follow instructions on Sound folder.

Built-in camera (I2C)

The model should be "OV2680". There is no driver avaliable for Linux.

Manufacturer: [OVT] (http://www.ovt.com/products/sensor.php?id=140)

Documentation

I would like to thank these sites, as they were very useful because of similarities between both devices:

http://www.jfwhome.com/2014/03/07/perfect-ubuntu-or-other-linux-on-the-asus-transformer-book-t100/
http://forums.linuxmint.com/viewtopic.php?f=18&t=201040&p=1052609
http://forums.linuxmint.com/viewtopic.php?f=53&t=204172
https://wiki.debian.org/InstallingDebianOn/Asus/T100TA
https://sturmflut.github.io/linux/ubuntu/2015/02/04/installing-ubuntu-on-baytrail-tablets-version-2/

AUTHORS

2015-2016 **Antonio Cao** ([@burzumishi] (https://github.com/burzumishi)) under the **'GNU GPL v2 LICENSE'**.

@nicman23
Copy link

ASoC-rt5645-add-quirk-for-ASUS-EeeBook-X205TA-4.17.patch
brcmfmac-p2p-and-normal-ap-access-are-not-always-possible-at-the-same-time.patch
i915-pm-Be-less-agressive-with-clockfreq-changes-on-Bay-Trail.patch
intel_idle-Disable-C6N-and-C6S-on-Bay-Trail.patch

google for the above; zero crashes after them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment