Linux 4.5 on a Bay Trail tablet

This post is a short update to my original article on booting Arch Linux on a Bay Trail tablet.

I originally wrote this for 4.4.5, but I wasn’t fast enough, and 4.5 was released before the post was completed, so might as well continue with a 4.5 kernel.

To simplify the build process I took the PKGBUILD for linux-mainline in AUR and modified it to build a mainline kernel with patches for SDIO WiFi on BayTrail.

If you’d like to build the kernel yourself (and you happen to run Arch Linux) you can download the PKGBUILD.

The firmware for the rtl8723bs card is in its own package, in keeping with the Arch Linux best practices for separating firmware from the kernel package. Download the firmware PKGBUILD.

Or, if you’d rather just have a newer kernel on your tablet which is already running Arch Linux, you can download the pre-built kernel package, and the firmware package.

I will be submitting both of these packages to AUR shortly.

Turns out you can actually get GRUB working with a menu if you build a standalone version of grub. However, the issue is that even though the grub menu works, there’s some issue with modesetting and you’ll never see any console after grub hands off to the kernel. You can download the standalone version of grub if you want to try, I wasn’t able to get any usable installer environment out of it. You can download standalone grub for ia32 (i686), you will also need grub.cfg.

$ tar -Jxf bootia32.tar.xz
$ cp bootia32.efi /mnt/archiso/EFI/boot/bootia32.efi
$ cp grub.cfg /mnt/archiso/EFI/boot/grub.cfg

Since grub video handoff isn’t working well, the only way I was able to successfully boot was to drop to command line by pressing c at the menu, and typing the following:

set root=hd0,msdos1
linux /arch/boot/x86_64/vmlinuz archisobasedir=arch archisolabel=ARCH_201603 video=VGA-1:[email protected]
initrd /arch/boot/x86_64/archiso.img
boot

There is a small issue with kernel oops, which has been present since at least 4.4.5:

[  164.281827] NMI watchdog: Watchdog detected hard LOCKUP on cpu 2
[  164.281913] Modules linked in:
[  164.281962]  intel_rapl intel_soc_dts_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw iTCO_wdt snd_soc_sst_bytcr_rt5640 iTCO_vendor_support hid_multitouch gf128mul glue_helper dcdbas ablk_helper cryptd pcspkr hci_uart snd_intel_sst_acpi mei_txe joydev input_leds snd_intel_sst_core btbcm snd_soc_rt5640 evdev snd_soc_sst_mfld_platform mousedev btintel mei lpc_ich mac_hid snd_soc_rl6231 thermal snd_soc_sst_match dw_dmac dw_dmac_core tpm_crb snd_soc_core bluetooth processor_thermal_device int3400_thermal int3403_thermal acpi_thermal_rel int3402_thermal i2c_hid int340x_thermal_zone snd_compress intel_soc_dts_iosf tpm_tis rfkill_gpio snd_pcm_dmaengine battery ac97_bus ac spi_pxa2xx_platform crc16 tpm snd_pcm i2c_designware_platform
[  164.283185]  acpi_pad i2c_designware_core 8250_dw snd_timer snd processor soundcore sch_fq_codel nfs lockd grace sunrpc fscache ip_tables x_tables overlay squashfs loop nls_iso8859_1 nls_cp437 vfat fat sd_mod uas usb_storage scsi_mod hid_generic usbhid hid i915 mmc_block button i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops crc32c_intel xhci_pci drm xhci_hcd intel_gtt wmi serio video sdhci_acpi sdhci led_class r8723bs(O) cfg80211 rfkill mmc_core
[  164.283978] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G           O    4.5.0-byt #1
[  164.284073] Hardware name: Dell Inc. Venue 8 Pro 3845/XXXXXX, BIOS A02 12/29/2014
[  164.284169]  0000000000000086 9ad5a4512f59852f ffff880039d05b50 ffffffff812d25d1
[  164.284284]  0000000000000000 0000000000000000 ffff880039d05b68 ffffffff81116550
[  164.284399]  ffff880038ca8000 ffff880039d05ba0 ffffffff81156b4c 0000000000000001
[  164.284513] Call Trace:
[  164.284552]    [] dump_stack+0x63/0x82
[  164.284645]  [] watchdog_overflow_callback+0xe0/0xf0
[  164.284733]  [] __perf_event_overflow+0x8c/0x1d0
[  164.284815]  [] perf_event_overflow+0x14/0x20
[  164.284894]  [] intel_pmu_handle_irq+0x1e1/0x460
[  164.284980]  [] perf_event_nmi_handler+0x28/0x50
[  164.285062]  [] nmi_handle+0x5e/0x130
[  164.285133]  [] default_do_nmi+0x48/0x120
[  164.285207]  [] do_nmi+0xe2/0x130
[  164.285274]  [] end_repeat_nmi+0x1a/0x1e
[  164.285349]  [] ? poll_idle+0x39/0x80
[  164.285420]  [] ? poll_idle+0x39/0x80
[  164.285490]  [] ? poll_idle+0x39/0x80
[  164.285558]  <>  [] cpuidle_enter_state+0xf3/0x2f0
[  164.285655]  [] cpuidle_enter+0x17/0x20
[  164.285728]  [] call_cpuidle+0x2a/0x40
[  164.285800]  [] cpu_startup_entry+0x2c5/0x3a0
[  164.285878]  [] start_secondary+0x165/0x1a0
[  164.285964] INFO: NMI handler (perf_event_nmi_handler) took too long to run: 4.144 msecs
[  164.286069] perf interrupt took too long (32852 > 2495), lowering kernel.perf_event_max_sample_rate to 50100
[  172.707012] perf interrupt took too long (32619 > 4960), lowering kernel.perf_event_max_sample_rate to 25200

You’ll see a lot of these, however WiFi still continues to work, and the tablet didn’t kernel panic for me in the installer environment.

Hopefully someone finds this useful. I’ll have a write up on installing and using Arch Linux on the tablet in the coming weeks.

7 thoughts on “Linux 4.5 on a Bay Trail tablet

  1. Hafsteinn Már Heimisson

    I tried installing these on an Acer Switch SW5-012 and get no WiFi. The 4.3.2 kerrnel is still going strong though and the only things keeping me from switching completely to arch are ACPI (lid close, wake etc.), screen brightness and audio.

    Does the WiFi work in the installer media?

    Reply
  2. Hal Martin Post author

    @Hafsteinn WiFi works from the installer media on my Dell Venue 8 Pro (3845).

    But, I haven’t actually installed Arch Linux to EMMC yet because I still have a need for a Windows machine to run some software. It may be that the behaviour of a system with an installed OS differs from the installer media (e.g. platform quirks with Xorg running, etc).

    Reply
  3. Eugene

    Pls, add package in aur, cuz rtl8723bs-dkms-git (in AUR) start with error 0xfffff on 4.5.1 kernel =(

    Reply
  4. Zarloc

    Thanks for the config, I use it for my Teclast X16 Power (x7-Z8700 CherryTrail) and it works. I add a little mod “CONFIG_MMC_BLOCK_MINORS=16” because of my dual boot android/linux the eMMC have 14 partitions.

    Do you have any informations about audio on Atom BayTrail/CherryTrail.

    Reply
    1. Hal Martin Post author

      Sorry, I was never able to get my Dell to do modesetting properly, and I never tested audio from tty, so I can’t tell you if it works.

      I did recently try a trunk build of Android x86 on the tablet, and there was no sound. I’d imagine if it’s not working in Android, it’s likely not working in Linux proper either.

      I’m pursuing other projects at the moment, but if I revisit this I will definitely look into testing audio as well.

      Reply
  5. m a r

    Please do follow up on this — and would you consider a step-by-step tutorial for us Arch newbs?

    I have a Winbook TW700 that I’d love to have Arch on, so that I can play with i3 and easystroke.

    Much aloha!

    Reply
  6. zak

    Thanx for the two articles on how to manually add hadess SDIO wifi module with a custom kernel for Bay Trail tablet. It was helpfull for me because i’ve just bought a Lenovo 100s-11by, an ultra netbook, that comes with intel Atom Z3735F processor. I use the hadess module with Linux kernel version 4.5.7, it works fine 🙂 It would also be great if hadess module could be added directely to the mainline development in the future for people using that kind of plateform.

    That being done, this purchase keeps me frustrated with no success in making work the sound for the Lenovo 100s. I think this laptop requires to use rt5640 kernel module (codec), but i’m not sure. Under Windows 10, opening Device Manager, i can see two objects for audio controler, “Intel SST Audio Device (WDM)” and “Realtek I2S Audio Codec”.

    I also have to find the fixes needed for sleep/suspend mode because it freezes the system after closing the lid.

    For testing Linux distros on the Lenovo 100s, i use LiveUSB sticks. A 4Gb key for testing ISO distros like LinuxMint, and a 8Gb key to make a persistent LiveUSB with ArchLinux. So till now, didn’t touched (delete/reformated) the internal eMMC storage, meaning that Windows is (still) there !… 🙁

    I purchased this ultra laptop for it low price, it’s dimension and weight, and specifically because it comes with an internal 32Gb eMMC that saves battery energy and do not heat comparing to internal HDD.

    If you are interested to read more about the product details it’s here http://shop.lenovo.com/us/en/laptops/ideapad/100-series/100s-11-inch/

    If i have any success with sound on that laptop i will tell.

    Reply

Leave a Reply

Your email address will not be published.