angler: support Wi-Fi and graphics (#555)

* Package Broadcom Wi-Fi firmware from AOSP

This uses a mirror of AOSP's platform/hardware/broadcom/wlan repo at version
android-8.0.0_r12 (6c8ef5b600cec5d36a54a0276fe8c97b9ab8d6bb).

This is needed as Nexus 6P uses a BCM4358, and the blob available in Alpine's
linux-firmware package is old and vulnerable to Broadpwn. See #513.

* device: angler: enable Wi-Fi and graphics output

Changes:

- Set resolution on bootup

This is copied from the Nexus 5's init script.

- Add Wi-Fi calibration file and change firmware path

This is also based on the Nexus 5's implementation.

- Enable CONFIG_VT and NFS in the kernel

- Explicitly use identity touchscreen calibration

- Rename the touchscreen udev rules

- Enable msm-fb-refresher
This commit is contained in:
zhuowei 2017-09-27 13:41:25 -04:00 committed by Oliver Smith
parent 0d8260c621
commit 0ed89b5621
8 changed files with 321 additions and 46 deletions

View file

@ -1,2 +1,7 @@
# udev rules file
# All device names can be read from weston's logfile (/tmp/weston.log in postmarketOS)
# Use default calibration for now.
SUBSYSTEM=="input", ATTRS{name}=="synaptics_dsx", \
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1" \
ENV{ID_INPUT_TOUCHPAD}="" ENV{ID_INPUT_KEY}="" \
ENV{LIBINPUT_CALIBRATION_MATRIX}="1 0 0 0 1 0"

View file

@ -1,15 +1,24 @@
pkgname=device-huawei-angler
pkgver=1
pkgrel=1
pkgrel=2
pkgdesc="Huawei Nexus 6P"
url="https://github.com/postmarketOS"
arch="noarch"
license="MIT"
depends="linux-huawei-angler mkbootimg"
depends="linux-huawei-angler mkbootimg firmware-aosp-broadcom-wlan msm-fb-refresher"
makedepends=""
install=""
subpackages=""
source="deviceinfo 90-android-touch-dev.rules"
source="
deviceinfo
90-android-touch-dev.rules
initfs-hook.sh
bcmdhd.cal
"
# Note: bcmdhd.cal is from https://github.com/LineageOS/android_device_huawei_angler/blob/752aaf664ab079f4ce9cbdeae6978f615d39b783/bcmdhd.cal
# TODO: this calibration file isn't valid for all variants of this device
# See https://github.com/LineageOS/android_device_huawei_angler/blob/cm-14.1/init.angler.rc#L450
options="!check"
build() {
@ -21,7 +30,13 @@ package() {
"$pkgdir/etc/deviceinfo"
install -D -m644 "$srcdir"/90-android-touch-dev.rules \
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
install -D -m644 "$srcdir"/initfs-hook.sh \
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
install -D -m644 "$srcdir"/bcmdhd.cal \
"$pkgdir"/etc/wifi/bcmdhd.cal
}
sha512sums="3bb53698b5fbfdd0522aaaf56966ea228cd79bea05c9af14d988604b1294d93a3a991107d5483845fc0064cf44d9f9ef54f9cbc517959f0327318b1902b9ee86 deviceinfo
155aa9c8bd0e202917c7f55312eaaa189114864d89bbf7fdbdcc4fe146af3c7c781a6e76b0030046383dee823465a994d6954408248cc2f43e48af40869d6b25 90-android-touch-dev.rules"
sha512sums="255a6f15a30f41e3db02be591cf41e62f7ac80c1b4dae6ecc174b4f81968a54ffeec8088ded5d44ce36d8a21b4013c79090bed6ed7e115b39ada20975649212b deviceinfo
e3472238341e5bdf7249a75e8f38019b145ea3e7a6137a49206945e6829fe8918c876a9caf2b0013357be9bff56d9f23c08900c80de4be93986246239e1b4fc7 90-android-touch-dev.rules
8590967fa10388a890fdfafdb1070b9ab22dc89e06a3a8834806c772191e3b67de7b914b0d68e5ddf581cee715cb90f3f24abcb8762c415ff328c6da23e55d52 initfs-hook.sh
61fe1f91d7b0b570b77fcca76503373cbac2515ca3dcc2f2543b910dfaeb1e935a11975f824f6a72001df4e63329356a6aff2d016e9b4f5d8f7b739fee065c4e bcmdhd.cal"

View file

@ -0,0 +1,227 @@
#BCM4358 WLBGA module for iPA, eLNA board with PCIE for production package
#adding two range TSSI parameters
NVRAMRev=$Rev: 500210 $
sromrev=11
boardrev=0x1100
## boardtype is subject to change
boardtype=0x07a1
boardflags=0x12001001
#enable eLNA both 2G/5G
boardflags2=0x00002000
boardflags3=0x48000109
#boardnum=57410
macaddr=00:90:4c:16:70:01
ccode=ALL
regrev=0
antswitch=0
pdgain5g=4
pdgain2g=4
tworangetssi2g=0
tworangetssi5g=0
lowpowerrange2g=0
lowpowerrange5g=0
olpc_thresh=1
femctrl=10
vendid=0x14e4
devid=0x43e9
manfid=0x2d0
#prodid=0x052e
nocrc=1
otpimagesize=484
xtalfreq=37400
ltecxmux=0x78560
rxgains2gelnagaina0=3
rxgains2gtrisoa0=8
rxgains2gtrelnabypa0=1
rxgains5gelnagaina0=3
rxgains5gtrisoa0=7
rxgains5gtrelnabypa0=1
rxgains5gmelnagaina0=3
rxgains5gmtrisoa0=7
rxgains5gmtrelnabypa0=1
rxgains5ghelnagaina0=3
rxgains5ghtrisoa0=6
rxgains5ghtrelnabypa0=1
rxgains2gelnagaina1=3
rxgains2gtrisoa1=8
rxgains2gtrelnabypa1=1
rxgains5gelnagaina1=3
rxgains5gtrisoa1=7
rxgains5gtrelnabypa1=1
rxgains5gmelnagaina1=3
rxgains5gmtrisoa1=7
rxgains5gmtrelnabypa1=1
rxgains5ghelnagaina1=3
rxgains5ghtrisoa1=6
rxgains5ghtrelnabypa1=1
rxchain=3
txchain=3
aa2g=3
aa5g=3
agbg0=0
agbg1=0
aga0=0
aga1=0
tssipos2g=1
extpagain2g=2
tssipos5g=1
extpagain5g=2
tempthresh=120
temps_hysteresis=15
tempoffset=255
rawtempsense=0x1ff
#PA parameters copied from 4356 wlbga design bcm94356wlsagbl
pa2gccka0=0xff34,0x1557,0xfd57
pa2ga0=0xff44,0x15de,0xfd58
#pa5ga0=-166,6427,-744,-174,6340,-742,-188,6004,-721,-178,6037,-714
pa5ga0=0xff3a,0x16fc,0xfd30,0xff37,0x16fe,0xfd2e,0xff40,0x16d3,0xfd3a,0xff3a,0x1643,0xfd46
pa2gccka1=0xff47,0x176a,0xfd21
pa2ga1=0xff4b,0x16bb,0xfd41
#pa5ga1=-168,6277,-731,-189,5964,-722,-173,6056,-712,-165,6195,-718
pa5ga1=0xff3c,0x17ea,0xfd18,0xff3c,0x17af,0xfd1c,0xff43,0x16f5,0xfd36,0xff40,0x16ff,0xfd34
#pa2ga0=-165,5774,-687
#pa2ga1=-151,6040,-693
#pa5ga0=-171,5985,-715,-164,5988,-710,-149,5992,-688,-165,5935,-699
#pa5ga1=-178,6049,-724,-166,6117,-721,-157,6073,-704,-164,6043,-712
###low range
#pa2ga2=-108,4009,-577
#pa2ga3=-129,4081,-572
#pa5ga2=-101,4150,-583,-103,4080,-582,-80,4147,-590,-120,3997,-567
#pa5ga3=-139,4129,-579,-133,4111,-580,-115,4129,-581,-121,4120,-577
maxp2ga0=82
maxp5ga0=82,82,82,82
maxp2ga1=82
maxp5ga1=82,82,82,82
subband5gver=0x4
pdoffsetcckma0=0x2
pdoffsetcckma1=0x2
pdoffset40ma0=0x2222
pdoffset80ma0=0x0000
pdoffset40ma1=0x2222
pdoffset80ma1=0x0000
cckbw202gpo=0x2222
cckbw20ul2gpo=0x2222
mcsbw202gpo=0xDC655442
mcsbw402gpo=0xFE777666
dot11agofdmhrbw202gpo=0x4431
ofdmlrbw202gpo=0x1111
mcsbw205glpo=0xA9654431
mcsbw405glpo=0xA9864444
mcsbw805glpo=0xcc865555
#mcsbw805glpo=0xBB865555
mcsbw205gmpo=0xA9654431
mcsbw405gmpo=0xA9864444
mcsbw805gmpo=0xcc865555
mcsbw205ghpo=0x99654431
mcsbw405ghpo=0xA9864444
mcsbw805ghpo=0xfe865555
mcslr5glpo=0x0000
mcslr5gmpo=0x0000
mcslr5ghpo=0x0000
sb20in40hrpo=0x0
sb20in80and160hr5glpo=0x0
sb40and80hr5glpo=0x0
sb20in80and160hr5gmpo=0x0
sb40and80hr5gmpo=0x0
sb20in80and160hr5ghpo=0x0
sb40and80hr5ghpo=0x0
sb20in40lrpo=0x0
sb20in80and160lr5glpo=0x0
sb40and80lr5glpo=0x0
sb20in80and160lr5gmpo=0x0
sb40and80lr5gmpo=0x0
sb20in80and160lr5ghpo=0x0
sb40and80lr5ghpo=0x0
dot11agduphrpo=0x0
dot11agduplrpo=0x0
phycal_tempdelta=25
temps_period=15
phy4350_ss_opt=1
AvVmid_c0=2,140,2,145,2,145,2,145,2,145
AvVmid_c1=2,140,2,145,2,145,2,145,2,145
rssicorrnorm_c0=-1,-1
rssicorrnorm_c1=-1,-1
rssicorrnorm5g_c0=1,2,2,0,2,2,1,2,2,1,2,3
rssicorrnorm5g_c1=0,1,2,0,1,2,0,1,2,0,1,2
epsdelta2g0=0
epsdelta2g1=0
papdwar=4
cckdigfilttype=2
cck_onecore_tx=1
tssisleep_en=0x1f
swctrlmap_5g=0x02080208,0x05a00000,0x04200000,0x000000,0x0fd
swctrlmap_2g=0x14011401,0x28500000,0x08100000,0x020202,0x0ff
#fem_table_init_val=0x1,0x1
swctrlmapext_2g=0x0,0x0,0x0,0x0,0x03
## Enabling OOB signal - needed for final board
host_wake_opt=0
# For Sensor Hub UART
#muxenab=0x4
## 2G TX power compensation
#powoffs2gtna0=0,-1,-1,0,2,3,4,4,2,0,-1,-2,-1,0
powoffs2gtna0=0,0,0,0,0,-1,-1,0,0,0,0,1,1,0
powoffs2gtna1=0,0,0,0,0,-1,-1,0,0,0,1,1,1,0
#rpcal2g=10
#rpcal5gb0=20
#rpcal5gb1=10
#rpcal5gb2=20
#rpcal5gb3=10
#dynamicsarctrl_2g=0xffb0
#dynamicsarctrl_5g=0xffa0
ofdmfilttype=1
ofdmfiltbesel_2g=0x39
ofdmfiltbe_2g=4
ofdmfiltbesel_5g20=0x3f
ofdmfiltbe_5g20=4
ofdmfiltbesel_5g40=0x1f
ofdmfiltbe_5g40=4
ofdmfiltbesel_5g80=0xf
ofdmfiltbe_5g80=4
btc_params82=0x0
btc_params51=0x409f
btc_params73=0
prot_btrssi_thresh=0
pacalshift5ga0=0,0,0,0,-2,-2,0,-2,0,-2,0,-3
pacalshift5ga1=0,0,0,0,-2,-1,0,-2,-2,-2,0,-3
# ########### BTC Dynctl profile params ############
# flags:bit0 - dynctl enabled, bit1 dynamic desense, bit2 dynamic mode
btcdyn_flags=0x7
btcdyn_dflt_dsns_level=0
btcdyn_low_dsns_level=0
btcdyn_mid_dsns_level=12
btcdyn_high_dsns_level=2
btcdyn_default_btc_mode=1
# --- number of rows in the array vars below ---
btcdyn_msw_rows=1
btcdyn_dsns_rows=1
# --- mode switch data rows (max is 4) ---
btcdyn_msw_row0=1,12,-70,-5,-100
# --- desense switching data rows (max is 4) ---
btcdyn_dsns_row0=5,4,0,-65,-65
## btc parameters should be added

View file

@ -13,6 +13,7 @@ deviceinfo_external_disk="false"
deviceinfo_external_disk_install="false"
deviceinfo_flash_methods="fastboot"
deviceinfo_arch="aarch64"
deviceinfo_msm_refresher="true"
# Splash screen
deviceinfo_screen_width="1440"

View file

@ -20,7 +20,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=1
pkgrel=2
arch="aarch64"
pkgdesc="LineageOS kernel for Nexus 6P Angler"
url="https://github.com/LineageOS/android_kernel_huawei_angler"
@ -104,6 +104,6 @@ package() {
}
sha512sums="de3f5ab1c6609b94d416b0eebd5ae948698f0f6ec81e84fbee152df7c2778d8df94cec43b5abca583fe5977bb28037b3b6d2c3ff652a50493a1f24da31dadd7f linux-huawei-angler-04d1557af1259b211609fa41adbe852b5f9cf2da.tar.gz
15889af8af37cca20a4c98234e44b9e5a1df77004a625c69f8377202227175f221a576006249d0e743d1dfb1a7fc010372e0032bb364d58ed93eff9f06574190 config-huawei-angler.aarch64
79eef863f3d6355511cb35673a368155574dad13f4f8f24fa92bd36af6ffb74c8036f1d5fc773e644676d72bf96c7443bc26d8036e8d7ba0ac3eece167556a71 config-huawei-angler.aarch64
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch"

View file

@ -840,7 +840,7 @@ CONFIG_NET_CLS_ACT=y
# CONFIG_NET_CLS_IND is not set
CONFIG_NET_SCH_FIFO=y
# CONFIG_DCB is not set
# CONFIG_DNS_RESOLVER is not set
CONFIG_DNS_RESOLVER=y
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
@ -1297,8 +1297,8 @@ CONFIG_BCMDHD_PCIE=y
# CONFIG_BCM4354 is not set
# CONFIG_BCM4356 is not set
CONFIG_BCM4358=y
CONFIG_BCMDHD_FW_PATH="/vendor/firmware/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/system/etc/wifi/bcmdhd.cal"
CONFIG_BCMDHD_FW_PATH="/lib/firmware/postmarketos/bcmdhd/bcm4358/fw_bcm4358.bin"
CONFIG_BCMDHD_NVRAM_PATH="/etc/wifi/bcmdhd.cal"
CONFIG_DHD_USE_STATIC_BUF=y
CONFIG_DHD_USE_SCHED_SCAN=y
CONFIG_DHD_SET_RANDOM_MAC_VAL=0x001A11
@ -2391,10 +2391,15 @@ CONFIG_FB_MSM_MDSS_WRITEBACK=y
#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGA_CONSOLE is not set
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE is not set
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
# CONFIG_LOGO is not set
# CONFIG_FB_SSD1307 is not set
CONFIG_SOUND=y
@ -3563,7 +3568,36 @@ CONFIG_PSTORE_RAM=y
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_NFS_SWAP=y
CONFIG_NFS_V4_1=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_ROOT_NFS is not set
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_SUNRPC_SWAP=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y

View file

@ -1,33 +0,0 @@
source:
https://github.com/ShinySide/HispAsian_Lollipop_G6/commit/b7756b6fc4bb728722b14d2dfdbaf1dc843812e9
* These need to be static to avoid these errors:
drivers/built-in.o: In function `.LANCHOR1':
msm_iommu_sec.c:(.data+0x9298): undefined reference to `kgsl_iommu_sync_lock'
msm_iommu_sec.c:(.data+0x929c): undefined reference to `kgsl_iommu_sync_unlock'
Makefile:877: recipe for target '.tmp_vmlinux1' failed
make: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
--- a/drivers/gpu/msm/kgsl_iommu.c
+++ b/drivers/gpu/msm/kgsl_iommu.c
@@ -1010,7 +1010,7 @@ static int kgsl_iommu_init_sync_lock(struct kgsl_mmu *mmu)
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
@@ -1080,7 +1080,7 @@ inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;

View file

@ -0,0 +1,26 @@
pkgname=firmware-aosp-broadcom-wlan
pkgver=1
pkgrel=0
pkgdesc="Broadcom Wi-Fi firmware from AOSP: https://android.googlesource.com/platform/hardware/broadcom/wlan/+/android-8.0.0_r12"
url="https://github.com/zhuowei/android_hardware_broadcom_wlan"
arch="noarch"
license="proprietary"
depends=""
makedepends=""
install=""
subpackages=""
# tag: android-8.0.0_r12
_hash=6c8ef5b600cec5d36a54a0276fe8c97b9ab8d6bb
source=$pkgname-$_hash.tar.gz::$url"/archive/${_hash}.tar.gz"
options="!check !strip !archcheck"
package() {
for fw in $(find "${srcdir}/android_hardware_broadcom_wlan-${_hash}/bcmdhd/firmware" -type f -name "*.bin")
do
dir=$(basename $(dirname $fw))
mkdir -p "$pkgdir/lib/firmware/postmarketos/bcmdhd/$dir"
install -m644 $fw "$pkgdir/lib/firmware/postmarketos/bcmdhd/$dir"
done
}
sha512sums="ffd125833076a257b6ad4bf9d3f1cb262331e0ce5b1a15b12b6a5b375fa82ea37c17876dada4cab8fe74c4c66dfc499bd9a00526c1a9c31664add3d4e45d5cf0 firmware-aosp-broadcom-wlan-6c8ef5b600cec5d36a54a0276fe8c97b9ab8d6bb.tar.gz"