Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mobile-nixos/mobile-nixos
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 173ddba0e89e
Choose a base ref
...
head repository: mobile-nixos/mobile-nixos
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9fbcf888a76e
Choose a head ref
  • 6 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 27, 2021

  1. Copy the full SHA
    8b81739 View commit details
  2. oneplus-oneplus3: Add qcacld-2.0 driver from LineageOS

    The `als` build tree *seems* to imply they are re-using the pre-built
    kernel modules from the vendor.
    
    This is not something we really want to do.
    
    The good thing is that LineageOS adds the required drivers to their
    trees. We can re-use it!
    samueldr committed Jan 27, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9bb3ec0 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ffd7dee View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d9a63ee View commit details
  5. Copy the full SHA
    3db7018 View commit details

Commits on Jan 29, 2021

  1. Merge pull request #289 from samueldr-wip/device/oneplus-oneplus3/qca…

    …cld-2.0
    
    oneplus-oneplus3: Enable Wi-Fi
    samueldr authored Jan 29, 2021
    Copy the full SHA
    9fbcf88 View commit details
25 changes: 25 additions & 0 deletions devices/oneplus-oneplus3/README.adoc
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ include::_support/common.inc[]

== Device-specific notes

=== `rootfs` installation

Using `fastboot` to burn system.img to the userdata partition will fail.

It seems like it flashes successfully like other devices do, but the flashed
@@ -15,3 +17,26 @@ flash the image.
$ cat .../.system.img | adb shell dd of=/dev/block/by-name/userdata bs=8m
```

=== Firmware for Wi-Fi

This particular phone keeps the firmware files on a partition named
`modem`.

To make use of the Wi-Fi capabilities of this phone you will need to
make them available to the firmware derivation.

The files can be acquired through different methods. You can use an
alternate recovery like TWRP, mount the partition (identified using
`blkid`) and copy the files.

Another way is to do it using an installed Mobile NixOS system, where,
too, you mount the partition and copy them:

```
$ sudo mount -o ro /dev/disk/by-partlabel/modem /mnt
$ cp -r /mnt ./modem
$ sudo umount /mnt
```

The copy of the firmware files will be in the modem directory, in the
current working directory, ready to be referred to.
6 changes: 6 additions & 0 deletions devices/oneplus-oneplus3/default.nix
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@
kernel.package = pkgs.callPackage ./kernel { };
};

mobile.device.firmware = pkgs.callPackage ./firmware {};

mobile.system.android.bootimg = {
flash = {
offset_base = "0x80000000";
@@ -50,4 +52,8 @@
mobile.system.type = "android";

mobile.quirks.qualcomm.dwc3-otg_switch.enable = true;

# qcacld-2.0 works the same way as wcnss-wlan
mobile.quirks.qualcomm.wcnss-wlan.enable = true;
mobile.quirks.wifi.disableMacAddressRandomization = true;
}
42 changes: 42 additions & 0 deletions devices/oneplus-oneplus3/firmware/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ lib
, runCommandNoCC
, fetchFromGitHub
, fetchurl
, modem ? builtins.throw ''
Your attention is required:
---------------------------
You will need to provide the content of the modem partition this way:
hardware.firmware = [
(config.mobile.device.firmware.override {
modem = ./path/to/copy/of/modem;
})
];
Refer to the device's documentation page for more details about enabling use of the firmware files.
''
}:

let
# The following files, though required, are not present in the modem
# partition.
cfg = fetchurl {
url = "https://raw.githubusercontent.com/LineageOS/android_device_oneplus_oneplus3/4d040a97e99032ce1623dca8765aedd6becbb587/wifi/WCNSS_qcom_cfg.ini";
sha256 = "1pcq64r4ag6rcgkbq3j2b43xzia9ccwbdgkgslw6pfqq8bmvcwxy";
};
in
runCommandNoCC "oneplus-oneplus3-firmware" {
inherit modem cfg;
meta.license = [
# We make no claims that it can be redistributed.
lib.licenses.unfree
];
} ''
fwpath="$out/lib/firmware"
mkdir -p $fwpath
cp -vr $modem/image/* $fwpath/
mkdir -p $fwpath/wlan/qca_cld
cp -v $cfg $fwpath/wlan/qca_cld/WCNSS_qcom_cfg.ini
''
20 changes: 20 additions & 0 deletions devices/oneplus-oneplus3/kernel/config.aarch64
Original file line number Diff line number Diff line change
@@ -3691,6 +3691,26 @@ CONFIG_ION_MSM=y
# CONFIG_DGNC is not set
# CONFIG_DGAP is not set
# CONFIG_GS_FPGABOOT is not set

#
# Qualcomm Atheros CLD WLAN module
#
CONFIG_QCA_CLD_WLAN=y
# CONFIG_QCACLD_WLAN_LFR3 is not set
# CONFIG_PRIMA_WLAN_OKC is not set
# CONFIG_PRIMA_WLAN_11AC_HIGH_TP is not set
# CONFIG_WLAN_FEATURE_11W is not set
# CONFIG_WLAN_FEATURE_LPSS is not set
# CONFIG_QCOM_VOWIFI_11R is not set
# CONFIG_WLAN_FEATURE_NAN is not set
# CONFIG_QCOM_TDLS is not set
# CONFIG_QCOM_LTE_COEX is not set
# CONFIG_WLAN_SYNC_TSF is not set
# CONFIG_WLAN_OFFLOAD_PACKETS is not set
# CONFIG_QCA_WIFI_AUTOMOTIVE_CONC is not set
# CONFIG_WLAN_UDP_RESPONSE_OFFLOAD is not set
# CONFIG_WLAN_WOW_PULSE is not set
# CONFIG_DPTRACE_ENABLE is not set
# CONFIG_GOLDFISH is not set

#
8 changes: 8 additions & 0 deletions devices/oneplus-oneplus3/kernel/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
mobile-nixos
, fetchFromGitHub
, fetchpatch
}:

mobile-nixos.kernel-builder-gcc6 {
@@ -19,8 +20,15 @@ mobile-nixos.kernel-builder-gcc6 {
./0001-Imports-drivers-input-changes-from-lineage-16.0.patch
./0001-s3320-Workaround-libinput-claiming-kernel-bug.patch
./0001-oneplus3-Configure-LEDs-using-kernel-triggers.patch

# qcacld-2.0 driver from LineageOS
(fetchpatch {
url = "https://github.com/mobile-nixos/linux/commit/4ebb0b70c19b7cc6d5a713cfdcdded7e07af4bf6.patch";
sha256 = "0szibn4ym6557138y8qham8zjzn3zfswwk2g2qnwvl4h0732sr9p";
})
];

enableRemovingWerror = true;
isImageGzDtb = true;
isModular = false;
}