Linux Logo

Work on the mainline kernel for open Xperia devices

We’ve just released new build guides on how to build Linux mainline kernel for Xperia devices and how to build a minimal version of Linux for Xperia devices. With these assets, you can experiment with IoT prototyping, or join the development of support for Xperia devices in the Linux kernel. Learn about this, and find out how the Open Device program got its start after the jump.

Since we started the Open Device experiment, we have received more than a thousand accepted push requests from developers in the open community. To add another dimension to the program, we have been working to add basic support for Xperia devices to the mainline Linux kernel.

By adding support for Xperia devices in the mainline Linux kernel, we open up for prototyping and innovation, making device repurposing, possible in the expanding IoT area. However, compared to the unified Linux kernel provided for the devices supported in the Open Device program, the mainline kernel is more experimental and provides less features and stability.

In the future, we aim to increase support for Xperia devices on the mainline Linux kernel, to be able to merge the mainline and unified kernel tracks. This way, we could provide a mature and stable base for a wide range of uses. In the meantime, the mainline Linux kernel provides a full open source base for Linux distributions, while the unified Linux kernel for Xperia devices supported in the Open Device program provides a more stable base for custom firmware based on Android, such as custom ROMs.

Now we would like to invite experienced kernel developers and hobbyists to join our effort and improve support for ARM platforms. Learn more under “How to get started with mainline kernel development” below.

Open Devices, AOSP for Xperia and the Linux kernel
Roughly three years ago, Sony engineers teamed up with Jean-Baptiste Quéru of Google to bring Xperia S support to AOSP. We released a small set of binaries to support the most basic components and a basic set of patches was merged into AOSP to support this project. The purpose of our experiment was to evaluate the work of bringing AOSP to an unsupported platform, and it was the task of keeping it running that showed to be the biggest challenge.

The experiment was started on Android 4.0 (Ice Cream Sandwich), and as the release of Jelly Bean required the huge task of upgrading the kernel, Xperia S support was minimized.

Minimizing the amount of patches to speed up development
The Linux kernel for Xperia devices starts in the git tree of Linus Torvalds, upon which the Android team at Google adds various patches for Android support. The platform vendor then adds all the necessary platform hardware support, features and bug fixes before Sony finally adds device specific hardware support, configuration and bug fixes.

Every new Android release comes with added requirements and continued development that essentially restarts the entire process. This process of re-implementing features and bug fixes to be able to upgrade devices is costly and does not scale, which makes it difficult to provide upgrades to older devices.

We decided to approach this problem in two ways within the Open Devices team. The first is to streamline patches and processes. We now have one single set of patches for all supported devices, structured in a way to reduce the cost of re-applying them on top of future vendor releases.

For the second effort, we looked back at the kernel development process for Xperia devices, where everything starts in Linus Torvalds’ kernel-tree. This means that every patch (for example, a device driver, bug-fix or feature) included in a release by the Android team will be free for us. If we can create a feedback loop to get Sony patches into Linus Torvalds’ tree we will be able to reduce the amount of repetitive work needed for an Android upgrade over time.

To realize this, we must have the latest Linux kernel running on a piece of hardware that is similar to the Xperia devices, making it easy to port and test patches before attempting to contribute them to the Linux project. At the time the support for the platforms used in Xperia devices was very limited, so we joined forces with the Linux community to build this up.

Current status and future development
Today, we have the basic support for running the mainline Linux kernel on Xperia devices based on two Qualcomm® platforms: APQ8064 (for example Xperia Z) and MSM8974 (for example Xperia Z1, Xperia Z2 and Xperia Z3). These have support for UART, eMMC, uSD, USB gadget, hardware buttons, charging (MSM8974 only) and a lot of plumbing for future work.

Based on this we have many ongoing projects, for example Freedreno, WiFi/BT, sensors and of course more house-keeping work. This is something we will continue working on going forward, and we hope that you are interested to come with us on the journey.

How to get started with mainline kernel development
To explore the mainline kernel and start experimenting with it in your project, check out the instructions in how to build Linux mainline kernel for Xperia devices and how to build a minimal version of Linux for Xperia devices. Explore the code, and don’t forget to contribute your improvements back to the mainline kernel.

If you want to discuss kernel development, or need support from other developers or Sony engineers, visit our Open Devices forum. For more resources and the latest updates on our Open Device program, go to the Open Device section here on Developer World.

More information

Comments 2

Sort by: Newest | Oldest | Most popular

  1. By Arnav Gupta

    #1

    It would also be really nice if there is a way we can get developer boards from Sony (I’d be ready to buy) with UART and other board connectors to try out a project like mainline kernel.

  2. By Arnav Gupta

    #2

    Really really nice,
    I recently used my old Xperia V as a brain for a drone we are building.

    With efforts like minimal Linux it really helps when using Xperia phones for IoT projects etc. THank you so much Alin 🙂

1-2 of 2 comments.