Difference between revisions of "NixOS on ARM/Teres-I"

From NixOS Wiki
Jump to: navigation, search
(Created first draft of page for Olimex Teres I DIY laptop kit)
(Removed outdated bit about the keyboard in u-boot)
Line 35: Line 35:
== Serial console==
== Serial console==
Details about the pinout for the headphone jack are available [https://github.com/d3v1c3nv11/teres1-debug]. Serial output is enabled by writing 1 to GPIO 361. {{expansion}}
Details about the pinout for the headphone jack are available [https://github.com/d3v1c3nv11/teres1-debug]. {{expansion}}
== Bluetooth ==
== Bluetooth ==
Line 85: Line 85:
== Known issues ==
== Known issues ==
* The keyboard firmware does not initialise in time to provide input to u-boot. An external USB keyboard can be used to change u-boot settings or choose which NixOS generation to boot.

Latest revision as of 21:56, 2 June 2021

Teres I
Manufacturer OLIMEX
Architecture AArch64
Bootloader U-Boot
Boot order To be confirmed
Maintainer Thra11

The Teres I is a DIY laptop kit based on the Allwinner A64 SoC.

It can boot from SD or from the internal eMMC.


Most functionality works in a generic aarch64 image using a recent kernel (tested 5.11 and 5.12).

Board-specific installation notes

Serial console

Details about the pinout for the headphone jack are available [1].


Bluetooth support for the Teres I is not yet included in linux. However, it can be made to work with a few modifications:

1. Enable support for Realtek bluetooth controllers in your chosen kernel:

  nixpkgs.config.packageOverrides = pkgs: {
    linux_5_11 = pkgs.linux_5_11.override {
      extraConfig = ''
        BT_HCIUART_RTL y
      kernelPatches = [ {
          name = "arm64-dts-allwinner-a64-Enable-Bluetooth-on-Teres-I";
          patch = ./0001-arm64-dts-allwinner-a64-Enable-Bluetooth-on-Teres-I.patch;

2. Add a section to the teres devicetree, arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts, to indicate that it has a realtek rtl8723bs bluetooth chip attached to uart1. This can be done either by patching the kernel sources, or as a device tree overlay:

&uart1 {
   pinctrl-names = "default";
   pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
   status = "okay";

   bluetooth {
       compatible = "realtek,rtl8723bs-bt";
       device-wake-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
       host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
       enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */

3. The package firmware-linux-nonfreecontains a blob which is suitable, rtl8723bs_config-OBDA8723.bin but it is suffixed with the ACPI ID. Since we are using a devicetree instead, linux expects it to be available as rtl8723bs_config.bin. We can achieve this by creating a simple package containing a symlink to the firmware file, and adding it to hardware.firmware in our NixOS configuration:

{ runCommandNoCC, firmwareLinuxNonfree }:

runCommandNoCC "teres-rtl8723bs-firmware-${firmwareLinuxNonfree.version}" {} ''
  mkdir -p $out/lib/firmware/rtl_bt
  ln -s ${firmwareLinuxNonfree}/lib/firmware/rtl_bt/rtl8723bs_config-OBDA8723.bin \

Known issues