mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-17 21:11:34 +03:00
Merge pull request #289 from samueldr-wip/device/oneplus-oneplus3/qcacld-2.0
oneplus-oneplus3: Enable Wi-Fi
This commit is contained in:
commit
9fbcf888a7
@ -3,6 +3,8 @@ include::_support/common.inc[]
|
|||||||
|
|
||||||
== Device-specific notes
|
== Device-specific notes
|
||||||
|
|
||||||
|
=== `rootfs` installation
|
||||||
|
|
||||||
Using `fastboot` to burn system.img to the userdata partition will fail.
|
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
|
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
|
$ 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.
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
kernel.package = pkgs.callPackage ./kernel { };
|
kernel.package = pkgs.callPackage ./kernel { };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mobile.device.firmware = pkgs.callPackage ./firmware {};
|
||||||
|
|
||||||
mobile.system.android.bootimg = {
|
mobile.system.android.bootimg = {
|
||||||
flash = {
|
flash = {
|
||||||
offset_base = "0x80000000";
|
offset_base = "0x80000000";
|
||||||
@ -50,4 +52,8 @@
|
|||||||
mobile.system.type = "android";
|
mobile.system.type = "android";
|
||||||
|
|
||||||
mobile.quirks.qualcomm.dwc3-otg_switch.enable = true;
|
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
devices/oneplus-oneplus3/firmware/default.nix
Normal file
42
devices/oneplus-oneplus3/firmware/default.nix
Normal file
@ -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
|
||||||
|
''
|
@ -3691,6 +3691,26 @@ CONFIG_ION_MSM=y
|
|||||||
# CONFIG_DGNC is not set
|
# CONFIG_DGNC is not set
|
||||||
# CONFIG_DGAP is not set
|
# CONFIG_DGAP is not set
|
||||||
# CONFIG_GS_FPGABOOT 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
|
# CONFIG_GOLDFISH is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
mobile-nixos
|
mobile-nixos
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, fetchpatch
|
||||||
}:
|
}:
|
||||||
|
|
||||||
mobile-nixos.kernel-builder-gcc6 {
|
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-Imports-drivers-input-changes-from-lineage-16.0.patch
|
||||||
./0001-s3320-Workaround-libinput-claiming-kernel-bug.patch
|
./0001-s3320-Workaround-libinput-claiming-kernel-bug.patch
|
||||||
./0001-oneplus3-Configure-LEDs-using-kernel-triggers.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;
|
isImageGzDtb = true;
|
||||||
isModular = false;
|
isModular = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user