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)
 
(add redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ARM/breadcrumb}}
+
#REDIRECT [[NixOS_on_ARM/OLIMEX_Teres-A64]]
<div class="infobox">
 
{|class="table"
 
!colspan="2" class="title"|Teres I
 
|-
 
!Manufacturer
 
|OLIMEX
 
|-
 
!Architecture
 
|AArch64
 
|-
 
!Bootloader
 
|U-Boot
 
|-
 
!Boot order
 
|To be confirmed
 
|-
 
!Maintainer
 
|[[User:Thra11|Thra11]]
 
|}
 
</div>
 
 
 
The Teres I is a DIY laptop kit based on the Allwinner A64 SoC.
 
 
 
It can boot from SD or from the internal eMMC.
 
 
 
== Status ==
 
 
 
Most functionality works in a generic aarch64 image using a recent kernel (tested 5.11 and 5.12).
 
 
 
== Board-specific installation notes ==
 
 
 
{{expansion}}
 
 
 
== 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}}
 
 
 
== Bluetooth ==
 
 
 
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:
 
<syntaxhighlight lang="nix">
 
  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;
 
        }
 
      ];
 
    };
 
  };
 
</syntaxhighlight>
 
2. Add a section to the teres devicetree, <code>arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts</code>, 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:
 
<syntaxhighlight lang=dts>
 
&uart1 {
 
  pinctrl-names = "default";
 
  pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
 
  uart-has-rtscts;
 
  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 */
 
  };
 
};
 
</syntaxhighlight>
 
 
 
3. The package <code>firmware-linux-nonfree</code>contains a blob which is suitable, <code>rtl8723bs_config-OBDA8723.bin</code> but it is suffixed with the ACPI ID. Since we are using a devicetree instead, linux expects it to be available as <code>rtl8723bs_config.bin</code>. We can achieve this by creating a simple package containing a symlink to the firmware file, and adding it to <code>hardware.firmware</code> in our NixOS configuration:
 
{{file|teres-rtl8723bs-firmware/default.nix|nix|<nowiki>
 
{ 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 \
 
    $out/lib/firmware/rtl_bt/rtl8723bs_config.bin
 
''
 
</nowiki>}}
 
 
 
== 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.
 
 
 
{{expansion}}
 
 
 
== Resources ==
 
 
 
* [https://www.olimex.com/Products/DIY-Laptop/ Official product page]
 
* [https://www.olimex.com/forum/index.php?board=39.0 Manufacturer's forum]
 

Latest revision as of 16:03, 3 July 2023