Welcome to Weijie Semiconductor

Google stops ACK universal kernel support for RISC-V

Wednesday, May 15, 2024

Recently, the developer community discovered that in the AOSP project, a Google developer submitted a series of patches to remove ACK support for risc64. On the details page, it can be seen that these patches have been reviewed and will be updated to the Android main branch. This means that if you want to compile the RISC-V version of Android, you will no longer be able to use Google's ACK kernel, but will have to rely on creating your own or branching from the open source community.
ACK (Android Universal Kernel) aims to provide a unified Linux kernel version that supports Android device development while addressing kernel fragmentation issues and reducing the need for Android OEMs to customize kernel development. The newer version is also known as GKI (Universal Kernel Image), which separates hardware independent universal kernel code from GKI modules and hardware specific vendor modules.
It can be said that ACK is the foundation of all Android product kernels, and the lack of official support will undoubtedly greatly impact the adaptation work of RISC-V Android. Many people speculate that this move may be a prelude to Google's plan to stop supporting RISC-V. However, according to Google itself, due to its fast iteration speed, they are not yet able to provide a single universal image for all suppliers.
In fact, according to the developer community's response, the work of Android/riscv64 in the AOSP project has not changed, but the official GKI kernel is currently no longer supporting RISC-V. They are turning to non GKI kernels maintained by the Android/riscv64 team, and the future goal is still to incorporate the changes made into the official kernel.

Has Google's view on RISC-V changed

With the rapid explosion of RISC-V in the embedded and MCU fields, as well as its expansion in accelerators, servers, and mobile computing in recent years, Google has also realized the potential of RISC-V architecture in industry cooperation. At the RISC-V International Summit held in November 2022, Google officially announced its acceptance of patches prepared for RISC-V.
Google is well aware that RISC-V is a modular ISA, which also means that there are significant extensions to the architecture, making OS adaptation extremely complex. So Google has determined their first supported configuration, which is RVA22 with vector and vector encryption extensions.
Last October, Qualcomm also announced a partnership with Google to develop a wearable hardware platform based on RISC-V. The two sides will collaborate to provide support for Wear OS and commercialize RISC-V based wearable device solutions to the global market. This means that the next generation of Pixel Watch is likely to use Qualcomm's RISC-V chip.
For Google, they are quite cautious about adding new ISA support, as it means requiring more engineers and spending more time on maintenance and code review work, especially in security patch updates. So announcing support for RISC-V is a significant commitment, and they will not easily give up.
From the project page of Android riscv64, it can also be seen that Google continues to support Android development of RISC-V in terms of actual open-source code contributions. At present, the development team uses Cutlefish virtual Android devices to run ART (with JIT enabled) to complete startup, and the relevant shell and command-line tools (as well as dependency libraries) can run normally.
At present, the application binary interface (Android NDK ABI) for RISC-V has not been defined, but the development team is still advancing this work. However, users can download the NDK test version r27beta1, which has temporary support for risc64. However, the compiled code does not fully utilize RISC-V hardware performance, but is only compatible with it. Allowing users to download in advance is only for the convenience of finding serious errors that need to be corrected. Last year, Google announced that this work would be completed by the end of 2023. Although Google has not given up its support for RISC-V, the progress of related support work has not been as expected.

The efforts made to develop the community

For the Android software stack, it mainly includes nearly a thousand software packages at five levels: system kernel, hardware abstraction, runtime, framework layer, and application. Even if kernel support is completed, there is still a lot of software porting and adaptation work that needs to be completed. It is difficult for Google's own development team to complete it alone. This is also the reason why Google chose to open receive patches. Only by relying on the joint development efforts of the open source community can it be possible to achieve the landing of Android on RISC-V.
As early as 2020, Ping Tou Ge began adapting to Android 10, developing hardware for a dual core Xuan Tie C910 processor based on 28nm technology. This is also the earliest Android Demo project in the RISC-V development community, but it was initially released as a relatively basic version. For example, it took 20 minutes to enter the launcher interface at the beginning, but after switching to the Mterm interpreter, the startup time was reduced to 10 minutes. Combined with a series of optimization works such as the compiler, JIT&AOT, the Pingtouge team shortened the startup time to 1 minute.
In 2022, Ping Tou Ge started the adaptation support work for Android 12 again, which is based on the new hardware platform TH1520, and collaborated to launch two ecological development boards: BeagleV Ahead and Lichee Pi 4A EVB. Pingtou Ge took the lead in completing the kernel and driver preparation work for TH1520, while upgrading Clang12 to Clang15 version optimized for Xuantie, and updating Bionic.
In terms of ART, Pingtou Ge replaced the interpreter from Mterm to Nterm in 2023, reducing the link of method calls and improving performance in frequent method call scenarios. Moreover, Clang15 has added support for the Xuantie extended instruction set. After a series of optimizations, Android 12 has improved the startup time of the launcher to 47 seconds while enabling more services on TH1520.

Leave your comment