Samsung-i8190 wifi now working (#1440)

Guide for connecting to wlan is on the wiki page for the device, wifi
chip is BCM4334. Wlan interfaces are wlan0 and p2p0. Connection seems
stable, was able to install some packages.
This commit is contained in:
Callum A. D. Thomson 2018-05-05 20:44:34 +01:00 committed by Oliver Smith
parent ad20a1352c
commit e32030fdce
8 changed files with 164 additions and 14 deletions

View File

@ -1,17 +1,20 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-samsung-i8190"
pkgdesc="Samsung Galaxy SIII mini"
pkgver=0.3
pkgrel=2
pkgver=0.4
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="noarch"
options="!check"
depends="postmarketos-base linux-samsung-i8190 mkbootimg mesa-dri-swrast"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="
deviceinfo
init-usb-hook.sh
deviceinfo
init-usb-hook.sh
modules-load.conf
module-config.conf
"
build() {
@ -25,5 +28,18 @@ package() {
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-init_usb.sh
}
nonfree_firmware() {
pkgdesc="Wifi firmware"
depends="firmware-samsung-i8190"
# Add wifi config
install -Dm644 "$srcdir"/modules-load.conf \
"$subpkgdir"/etc/modules-load.d/00-load-wifi.conf
install -Dm644 "$srcdir"/module-config.conf \
"$subpkgdir"/etc/modprobe.d/00-module-config.conf
}
sha512sums="02774739faf54ca26690bc35fc83bccfbaebf092de35b15226f738bc5dedf2a3846e990738354b7d9da06ee915febad8f1d963dadd1f6ac9b7fdd118a415caf9 deviceinfo
769f76b2b0dc5279c514181f6cc915c045562df0c1fe08c54b6588d11ff2c75441a3a4f78d6dde669c82e1c572a66bdde475da3e289d334e3255fcf15430c044 init-usb-hook.sh"
769f76b2b0dc5279c514181f6cc915c045562df0c1fe08c54b6588d11ff2c75441a3a4f78d6dde669c82e1c572a66bdde475da3e289d334e3255fcf15430c044 init-usb-hook.sh
61e8becbf6fa7c1c6c42e481083f5981ae7af33a48cbc53e817d8ac2c6a8e4f67a54b32ae3b8f5f25f7b412165a849dc93a629110dc47b0d16927bf2a12eb7e1 modules-load.conf
436900f627e4ec7e8359bfa6b5d0ac98c69cdd3f3b5e68d23354fa87d79beef866afd6c4cf27b97e9b608cce44fe8d116594f3b08520c9c05624bcf58b61c7f1 module-config.conf"

View File

@ -0,0 +1,3 @@
# Needed to point modprobe to the correct destination when looking for modules
install dhd /sbin/insmod /lib/modules/dhd.ko

View File

@ -0,0 +1,6 @@
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# wifi module
dhd

View File

@ -0,0 +1,50 @@
diff -ruN '--from-file=android_kernel_samsung_golden-2662dc4f65ef3ad5eeb4222d3aad5dd418a04510' android_kernel_samsung_golden-2662dc4f65ef3ad5eeb4222d3aad5dd418a04510/include/linux/bcma/bcma.h tmp-kernel/include/linux/bcma/bcma.h
--- ./include/linux/bcma/bcma.h 2017-05-20 10:01:01.000000000 +0100
+++ ./include/linux/bcma/bcma.h 2018-04-21 02:21:45.736705185 +0100
@@ -181,38 +181,38 @@
struct bcma_drv_pci drv_pci;
};
-extern inline u32 bcma_read8(struct bcma_device *core, u16 offset)
+static inline u32 bcma_read8(struct bcma_device *core, u16 offset)
{
return core->bus->ops->read8(core, offset);
}
-extern inline u32 bcma_read16(struct bcma_device *core, u16 offset)
+static inline u32 bcma_read16(struct bcma_device *core, u16 offset)
{
return core->bus->ops->read16(core, offset);
}
-extern inline u32 bcma_read32(struct bcma_device *core, u16 offset)
+static inline u32 bcma_read32(struct bcma_device *core, u16 offset)
{
return core->bus->ops->read32(core, offset);
}
-extern inline
+static inline
void bcma_write8(struct bcma_device *core, u16 offset, u32 value)
{
core->bus->ops->write8(core, offset, value);
}
-extern inline
+static inline
void bcma_write16(struct bcma_device *core, u16 offset, u32 value)
{
core->bus->ops->write16(core, offset, value);
}
-extern inline
+static inline
void bcma_write32(struct bcma_device *core, u16 offset, u32 value)
{
core->bus->ops->write32(core, offset, value);
}
-extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
+static inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
{
return core->bus->ops->aread32(core, offset);
}
-extern inline
+static inline
void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value)
{
core->bus->ops->awrite32(core, offset, value);

View File

@ -0,0 +1,15 @@
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c
index ed549c3..09e83f6 100644
--- a/drivers/net/wireless/bcmdhd/dhd_linux.c
+++ b/drivers/net/wireless/bcmdhd/dhd_linux.c
@@ -360,8 +360,8 @@ uint dhd_download_fw_on_driverload = TRUE;
/* Definitions to provide path to the firmware and nvram
* example nvram_path[MOD_PARAM_PATHLEN]="/projects/wlan/nvram.txt"
*/
-char firmware_path[MOD_PARAM_PATHLEN] = "/system/etc/wifi/bcmdhd_sta.bin";
-char nvram_path[MOD_PARAM_PATHLEN] = "/system/etc/wifi/nvram_net.txt";
+char firmware_path[MOD_PARAM_PATHLEN]="/lib/firmware/postmarketos/bcmdhd_sta.bin";
+char nvram_path[MOD_PARAM_PATHLEN]="/lib/firmware/postmarketos/nvram_net.txt";
/* information string to keep firmware, chio, cheip version info visiable from log */
char info_string[MOD_PARAM_INFOLEN];

View File

@ -2,7 +2,7 @@
pkgname="linux-samsung-i8190"
pkgver=3.0.31
pkgrel=0
pkgrel=1
pkgdesc="Samsung Galaxy SIII mini kernel fork"
arch="armhf"
_carch="arm"
@ -26,6 +26,8 @@ source="
01_fix_return_address.patch
02_timeconst_fix.patch
03_fix_rndis.patch
04_fix_bcma.patch
05_change_dhd_firmware_path.patch
"
builddir="$srcdir/${_repository}-${_commit}"
@ -79,12 +81,22 @@ package() {
error "Could not find zImage in $PWD!"
return 1
fi
# Modules
cd "$builddir"
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" \
INSTALL_MOD_PATH="$pkgdir" INSTALL_MOD_STRIP=1 \
modules_install
}
sha512sums="318586c486d831719d678e7645c073146b6d2cfc60ac0b8b54ddc6e545723d207d46a7acd78d944e7a855e3a5181fa8ccf863d9dd0c10129a6814e9e7e70a2fa linux-samsung-i8190-2662dc4f65ef3ad5eeb4222d3aad5dd418a04510.tar.gz
e72c48c0e5230f75418a3e77b5e99e590a6e9e0830d89ccf7b994a2eb5fa8a015a7f1100056bba127d4c0ecd336899b629cbb65341d79387f4a1fa8a034610de config-samsung-i8190.armhf
8ff2701cca482389bf60cbe29fdde6cfa3dec9a44fd82098fae7c07a0e03c5e3577c93aa988fbf2da979cc0f836f48b9c3cc5b5ab75b66dd1df4b71c91a894ed config-samsung-i8190.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
1b3ffbfd511af7a81590e0004bcf45b89592d6bf38cc3dd48af1e227f879426894eede34376ac708e56e84217af6ff22ee16526b3e64905ef30f0d101bbcbc29 00_fix_makefile.patch
ea1d3b5a234fa565e3c1a792de48f4fc4e6023d281d303c8e319c7ef28edc5739ab0e4dea0139a41f0a5c7d03e27921ccaa214fd0ac5c72245a094ce60128864 01_fix_return_address.patch
a2bb98fb8d988bbb659cae00fbaca360828300e9b98b90aed5ee0dd839c3f740696df4094a9021b813cbada06820d115aabed581a47cdd2c947e8d853c20b145 02_timeconst_fix.patch
6585c67450f1ef6d0c165ce4cb5c64f64d779147d1390558bf72cd40da5a33d53de6fd3c67e5ab864c14b3f67602bbe3060eea07c85b19bb82a0735024b369eb 03_fix_rndis.patch"
6585c67450f1ef6d0c165ce4cb5c64f64d779147d1390558bf72cd40da5a33d53de6fd3c67e5ab864c14b3f67602bbe3060eea07c85b19bb82a0735024b369eb 03_fix_rndis.patch
31fe10c659d59fd086b49c20412a27cc6241e650cda1200efe86cedfc5d9ac380a3c7ff931161a40b26ab49b6e3fa04d27316efd66fba6605a5e35ef526b41e4 04_fix_bcma.patch
4d509ef6b004834cff731cfc57016efcd9d375d3d39de41a2ecb93573af781761bd498904887997824e0bb48de6a5ee4e39a8d7763adef165c5bcc3c62a897f2 05_change_dhd_firmware_path.patch"

View File

@ -967,10 +967,15 @@ CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
# CONFIG_COMPAT_WIRELESS is not set
CONFIG_CFG80211=y
# CONFIG_MAC80211 is not set
CONFIG_MAC80211=m
# CONFIG_NL80211_TESTMODE is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_MAC80211_RC_PID is not set
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
# CONFIG_MAC80211_LEDS is not set
# CONFIG_MAC80211_MESH is not set
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
@ -980,6 +985,11 @@ CONFIG_CFG80211_WEXT=y
CONFIG_WIRELESS_EXT_SYSFS=y
# CONFIG_LIB80211 is not set
# CONFIG_CFG80211_ALLOW_RECONNECT is not set
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_PM=y
@ -1223,21 +1233,34 @@ CONFIG_SMSC911X=y
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
CONFIG_WLAN=y
# CONFIG_LIBERTAS_THINFIRM is not set
# CONFIG_AT76C50X_USB is not set
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_RTL8187 is not set
# CONFIG_MAC80211_HWSIM is not set
CONFIG_WIFI_CONTROL_FUNC=y
# CONFIG_ATH_COMMON is not set
# CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set
# CONFIG_BCM4329 is not set
# CONFIG_BCM4330 is not set
CONFIG_BCM4334=y
CONFIG_BCM4334=m
# CONFIG_BCM43241 is not set
CONFIG_BCMDHD_FW_PATH="/system/etc/firmware/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/system/etc/wifi/bcmdhd.cal"
CONFIG_BCMDHD_FW_PATH="/lib/firmware/postmarketos/fw_bcmhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/postmarketos/bcmdhd.cal"
CONFIG_BROADCOM_WIFI_RESERVED_MEM=y
CONFIG_WLAN_REGION_CODE=100
# CONFIG_HOSTAP is not set
# CONFIG_IWM is not set
# CONFIG_LIBERTAS is not set
# CONFIG_P54_COMMON is not set
# CONFIG_RT2X00 is not set
# CONFIG_RTL8192SE is not set
# CONFIG_RTL8192CU is not set
# CONFIG_WL1251 is not set
# CONFIG_WL12XX_MENU is not set
# CONFIG_ZD1211RW is not set
# CONFIG_MWIFIEX is not set
#
@ -1717,7 +1740,8 @@ CONFIG_BCMA_POSSIBLE=y
#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set
CONFIG_BCMA=m
CONFIG_BCMA_DEBUG=y
CONFIG_MFD_SUPPORT=y
CONFIG_MFD_CORE=y
# CONFIG_MFD_88PM860X is not set
@ -2383,6 +2407,7 @@ CONFIG_DMA_ENGINE=y
# CONFIG_UIO is not set
CONFIG_STAGING=y
# CONFIG_USBIP_CORE is not set
# CONFIG_W35UND is not set
# CONFIG_PRISM2_USB is not set
# CONFIG_ECHO is not set
# CONFIG_BRCMUTIL is not set
@ -2397,7 +2422,7 @@ CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_RAM_CONSOLE=y
# CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE is not set
CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE=y
# CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION is not set
# CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT is not set
CONFIG_ANDROID_TIMED_OUTPUT=y

View File

@ -0,0 +1,23 @@
pkgname=firmware-samsung-i8190
pkgver=1
pkgrel=0
pkgdesc="Samsung Galaxy SIII mini proprietary firmware"
url="https://github.com/3liteking148/android_vendor_samsung_golden"
arch="armhf"
license="proprietary"
options="!check !strip"
# Source
_commit="3ca5e3fac6f68263bbe4ef72887cc8c3f10fed4c"
source=$pkgname-$_commit.tar.gz::$url"/archive/${_commit}.tar.gz"
package() {
cd "$srcdir/android_vendor_samsung_golden-${_commit}/proprietary/"
# Wifi
install -Dm644 "etc/wifi/bcmdhd_sta.bin" \
"$pkgdir/lib/firmware/postmarketos/bcmdhd_sta.bin"
install -Dm644 "etc/wifi/nvram_net.txt" \
"$pkgdir/lib/firmware/postmarketos/nvram_net.txt"
}
sha512sums="b1d39e4d2180585970d7c06eca424aa784d76b8ccb020dc0768f683e8fd1e68e4487213c021db33ec40141f09db1879d53851110fc89d4e57e2205d1788904a3 firmware-samsung-i8190-3ca5e3fac6f68263bbe4ef72887cc8c3f10fed4c.tar.gz"