Skip to content

Instantly share code, notes, and snippets.

@chinkiko
Last active July 21, 2018 23:57
Show Gist options
  • Save chinkiko/d99cba63490aa6982f076201e9e30c65 to your computer and use it in GitHub Desktop.
Save chinkiko/d99cba63490aa6982f076201e9e30c65 to your computer and use it in GitHub Desktop.
x205ta-Linux
#bcm943341wlagb
#AP6234_NVRAM_V1.2_20140820_WIN8.1_COEX_TEST_1204
manfid=0x2d0
prodid=0x0653
vendid=0x14e4
devid=0x4386
boardtype=0x0653
boardrev=0x1203
boardnum=22
macaddr=00:90:4c:c5:12:38
sromrev=3
#boardflags:
# bit 19 3tswitch: 2.4GHz FEM: SP3T switch share with BT
# bit 16 nopa: no external pa
# keep original 0x200
boardflags=0x0090201
xtalfreq=37400
nocrc=1
ag0=255
aa2g=1
ccode=CN
pa0itssit=0x20
#PA parameters for 2.4GHz
pa0b0=6957 default
#pa0b0=6727
pa0b1=-808
pa0b2=-178
tssifloor2g=69
# rssi params for 2.4GHz
rssismf2g=0xf
rssismc2g=0x8
rssisav2g=0x1
cckPwrOffset=3
# rssi params for 5GHz
rssismf5g=0xf
rssismc5g=0x7
#rssisav5g=0x1
rssisav5g=0x3
#PA parameters for lower a-band
#pa1lob0=5659 default
pa1lob0=5859
#pa1lob0=5659
pa1lob1=-693
pa1lob2=-178
tssifloor5gl=77
#PA parameters for midband
pa1b0=5372
#pa1b0=5172
pa1b1=-671
pa1b2=-212
tssifloor5gm=77
#PA paramasdeters for high band
#pa1hib0=5320 default
pa1hib0=5620
#pa1hib1=-963
pa1hib1=-663
pa1hib2=-179
tssifloor5gh=74
rxpo5g=0
maxp2ga0=76
# 19.5dBm max; 18dBm target
#Per rate power back-offs for g band, in .5 dB steps. Set it once you have the right numbers.
cck2gpo=0x2222
ofdm2gpo=0x333333333
# R54 16dBm; R48 17dBm; others 18dBm
mcs2gpo0=0x5555
# M0~ M4 17dBm
mcs2gpo1=0x5555
# M5M6 15dBm; M7 14.5dBm
#max power for 5G
maxp5ga0=68
# 16dBm target; 17.5dBm Max
maxp5gla0=74
maxp5gha0=68
#Per rate power back-offs for a band, in .5 dB steps. Set it once you have the right numbers.
ofdm5gpo=0x22222222
# R54 13.5dBm
ofdm5glpo=0x22222222
ofdm5ghpo=0x44444444
mcs5gpo0=0x8888
# M0~M4 16dBm (1dB higher than ofdm)
mcs5gpo1=0x8888
# M5M6 13.5dBm; M7 12dBm
mcs5glpo0=0x2222
mcs5glpo1=0x2222
mcs5ghpo0=0x8888
mcs5ghpo1=0x8888
# Parameters for DAC2x mode and ALPF bypass
# RF SW Truth Table: ctrl0 for BT_TX; ctrl1 or 5G Tx; ctrl2 for 5G Rx; Ctrl3 for 2G Tx; Ctrl4 for 2G Rx
swctrlmap_2g=0x00080008,0x00100010,0x00080008,0x011010,0x11f
swctrlmap_5g=0x00040004,0x00020002,0x00040004,0x011010,0x2fe
gain=32
triso2g=8
triso5g=8
#tx parameters
loflag=0
iqlocalidx5g=40
dlocalidx5g=70
iqcalidx5g=50
lpbckmode5g=1
txiqlopapu5g=0
txiqlopapu2g=0
dlorange_lowlimit=5
txalpfbyp=1
txalpfpu=1
dacrate2xen=1
papden2g=1
papden5g=1
#rx parameters
gain_settle_dly_2g=4
gain_settle_dly_5g=4
noise_cal_po_2g=-1
noise_cal_po_40_2g=-1
noise_cal_high_gain_2g=73
noise_cal_nf_substract_val_2g=346
noise_cal_po_5g=-1
noise_cal_po_40_5g=-1
noise_cal_high_gain_5g=73
noise_cal_nf_substract_val_5g=346
cckpapden=0
# Enable OOB interrupt: level trigger
#muxenab=0x10
# Out-of-band GPIO wakeup
sd_gpout=4
sd_gpval=1
sd_gpdc=0
btc_params64=0x0e
# from https://github.com/harryharryharry/x205ta-iso2usb-files/blob/master/brcmfmac43340-sdio.txt
manfid=0x2d0
prodid=0x0653
vendid=0x14e4
devid=0x4386
boardtype=0x0653
boardrev=0x1203
boardnum=22
macaddr=02:0A:F7:2A:3B:4C
sromrev=3
boardflags=0x0090201
xtalfreq=37400
nocrc=1
ag0=255
aa2g=1
aa5g=1
ccode=ALL
pa0itssit=0x20
pa0b0=6747
pa0b1=-808
pa0b2=-178
tssifloor2g=69
rssismf2g=0xf
rssismc2g=0x8
rssisav2g=0x1
cckPwrOffset=3
rssismf5g=0xf
rssismc5g=0x7
rssisav5g=0x3
pa1lob0=5659
pa1lob1=-693
pa1lob2=-178
tssifloor5gl=93
pa1b0=5172
pa1b1=-671
pa1b2=-212
tssifloor5gm=77
pa1hib0=5320
pa1hib1=-663
pa1hib2=-179
tssifloor5gh=74
rxpo5g=0
maxp2ga0=0x4E
cck2gpo=0x0000
ofdm2gpo=0x42000000
mcs2gpo0=0x2222
mcs2gpo1=0x7662
maxp5ga0=0x46
maxp5gla0=0x46
maxp5gha0=0x46
ofdm5gpo=0x52222222
ofdm5glpo=0x52222222
ofdm5ghpo=0x52222222
mcs5gpo0=0x0000
mcs5gpo1=0x8550
mcs5glpo0=0x0000
mcs5glpo1=0x8550
mcs5ghpo0=0x0000
mcs5ghpo1=0x8550
swctrlmap_2g=0x00080008,0x00100010,0x00080008,0x011010,0x11f
swctrlmap_5g=0x00020002,0x00040004,0x00020002,0x011010,0x2fe
gain=32
triso2g=8
triso5g=8
loflag=0
iqlocalidx5g=40
dlocalidx5g=70
iqcalidx5g=50
lpbckmode5g=1
txiqlopapu5g=0
txiqlopapu2g=0
dlorange_lowlimit=5
txalpfbyp=1
txalpfpu=1
dacrate2xen=1
papden2g=1
papden5g=1
gain_settle_dly_2g=4
gain_settle_dly_5g=4
noise_cal_po_2g=-1
noise_cal_po_40_2g=-1
noise_cal_high_gain_2g=73
noise_cal_nf_substract_val_2g=346
noise_cal_po_5g=-1
noise_cal_po_40_5g=-1
noise_cal_high_gain_5g=73
noise_cal_nf_substract_val_5g=346
cckpapden=0
paparambwver=1
EXPERIMENTAL Kernel changes for audio support
The section was created thanks to the great work done by those on [UbuntuForums](https://ubuntuforums.org/showthread.php?t=2254322&page=126&p=13592053#post13592053).
The following steps must be done on the x205ta after installation to provide experimental audio support:
# Required lib and packages not installed by default
apt -y install git libssl-dev
# Retrieve the Linux kernel source tree fork - will take some time
git clone https://github.com/plbossart/sound.git -b experimental/codecs
cd sound
# Obtain the kernel config already done - otherwise you will have to run
# 'make localmodconfig', 'make menuconfig', and answer questions.
# Original file from:
# ftp://x205ta.myftp.org:1337/kernel/.config
wget http://lopaka.github.io/files/instructions/x205ta.config -O .config
# reverse patch the commit that causes the keyboard to malfunction
git diff 3ae02c1^ 3ae02c1 | patch -Rp1
# Add patch that attempts to fix non-functioning FN-keys
# Original file from:
# https://raw.githubusercontent.com/harryharryharry/x205ta-patches/master/fn-brightness-hack.patch
wget http://lopaka.github.io/files/instructions/fn-brightness-hack.patch
patch -p1 < fn-brightness-hack.patch
# Build - will take some time
make -j6
# Install modules
make modules_install
# Install kernel to the boot dir
export KERNELRELEASE=$(<include/config/kernel.release)
cp -va arch/x86/boot/bzImage /boot/vmlinuz-$KERNELRELEASE
# Build initramfs
update-initramfs -c -k $KERNELRELEASE
# Rebuild /boot/grub/grub.cfg
update-grub
# Obtain HiFi.conf and install it at /usr/share/alsa/ucm/chtrt5645/
# Original files from:
# https://raw.githubusercontent.com/plbossart/UCM/master/chtrt5645/HiFi.conf
# https://raw.githubusercontent.com/plbossart/UCM/master/chtrt5645/chtrt5645.conf
mkdir -p /usr/share/alsa/ucm/chtrt5645
wget http://lopaka.github.io/files/instructions/HiFi.conf -O /usr/share/alsa/ucm/chtrt5645/HiFi.conf
wget http://lopaka.github.io/files/instructions/chtrt5645.conf -O /usr/share/alsa/ucm/chtrt5645/chtrt5645.conf
# Install audio packages
apt -y install pulseaudio alsa-base alsa-utils pavucontrol
# Reboot and use GUI to set default output - Sound Settings...
shutdown -r now
# 备注 新版的ubuntu16.04 kernel已经支持x205ta直接在32位/bootia32.efi引导安装64位linux
https://ubuntuforums.org/showthread.php?t=2254322&page=178&p=13681047#post13681047
-------
Arch linux
https://wiki.archlinux.org/index.php/ASUS_x205ta#Enable_wifi
https://github.com/savagezen/x205ta
-----------
Re: Asus X205TA hardware support in Ubuntu
@syscl: Yeah, I'll probably release a 4.13 kernel when it's stable (probably around 3 or 10 september)
As for f2fs: Only way to find out is to try I don't have much experience with f2fs on linux, on android it is real performance booster. Just keep in mind ext4 has been around for a long time so it is way more reliable and has much more support. If you want more information on performance I suggest you look at some of the articles Phoronix (Michael Larabel) has dedicated to the subject.
I wouldn't know what's causing the bluetooth issue you're having, could be a deficiency in my kernel (although my bluetooth mouse - a trust maxtrack - connects without too much issues). As mainstream 4.13 will deliver everything my kernel is and then some (more modules = broader support), you might have more success testing the official kernel instead:
@all: This is a guide to create a bootable ubuntu usb stick, install ubuntu and install a mainline kernel that supports everything that is available right now (sound,headphones,bluetooth,no freezes, etc). Finally you don't need those weird custom isos and suspicious scripts I created
PM me if you think the script is flawed/unclear
1. Download a 64bit ubuntu iso:
Code:
wget http://cdimage.ubuntu.com/xubuntu/releases/16.04/release/xubuntu-16.04.3-desktop-amd64.iso
2. Format a usb stick with a fat32 partition (for example with gparted) and mount the partition somewhere
3. Extract the iso to the chosen mountpoint
Code:
sudo 7z x xubuntu-16.04.3-desktop-amd64.iso -o/path/to/usbmountpoint/ #notice: no space after the -o flag
4. Download bootia32.efi and put it in /path/to/usbmountpoint/EFI/BOOT/
Code:
sudo wget https://github.com/jfwells/linux-asus-t100ta/raw/master/boot/bootia32.efi -O /path/to/usbmountpoint/EFI/BOOT/bootia32.efi
5. Unmount, and (re)boot the x205ta from the usb stick
6. Gain internet access
Code:
sudo cp -a /sys/firmware/efi/efivars/nvram* /lib/firmware/brcm/brcmfmac43340-sdio.txt; sudo rmmod brcmfmac; sudo modprobe brcmfmac
#(in my experience, this nvram does not have 5ghz support. this one does)
7. Install ubuntu (check the box to update packages during install, as it is needed to obtain efi-i386 grub libraries, which in turn are needed to boot ubuntu on the x205ta)
8. Reboot and let the x205ta boot into the installed ubuntu
9. Repeat step 6 to gain internet access again
10. Create a file called /etc/modprobe.d/50-x205ta.conf with the following contents:
Code:
#this quirk is needed to get headphones support in kernels >=4.13
options snd_soc_rt5645 quirk=0x31
#module snd_hdmi_lpe_audio breaks sound
blacklist snd_hdmi_lpe_audio
#module btsdio breaks wifi on suspend/resume
blacklist btsdio
11. Add some kernel boot parameters for the grub bootloader to use:
in the file /etc/default/grub ; append the line:
Code:
GRUB_CMDLINE_DEFAULT="quiet splash"
to:
Code:
GRUB_CMDLINE_DEFAULT="quiet splash intel_idle.max_cstate=1 button.lid_init_state=open"
#(intel_idle.max_cstate=1 to prevent freezes)
#(button.lid_init_state=open to prevent a suspend loop after closing/opening the lid)
12. Download Pierre Bossart's UCM files:
Code:
sudo mkdir -p /usr/share/alsa/ucm/chtrt5645
sudo rm -rf /usr/share/alsa/ucm/chtrt5645/{HiFi,chtrt5645}.conf
sudo wget https://raw.githubusercontent.com/plbossart/UCM/master/chtrt5645/HiFi.conf -O /usr/share/alsa/ucm/chtrt5645/HiFi.conf
sudo wget https://raw.githubusercontent.com/plbossart/UCM/master/chtrt5645/chtrt5645.conf -O /usr/share/alsa/ucm/chtrt5645/chtrt5645.conf
13. Download a >=v4.13 linux-image .deb from http://kernel.ubuntu.com/~kernel-ppa/mainline/ (I'd choose a generic one):
Code:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13/linux-image-4.13.0-041300-generic_4.13.0-041300.201709031731_amd64.deb
#(if you want to install headers, download them too)
14. Install the .deb-file
Code:
sudo dpkg -i linux-image-4.13.0-041300-generic_4.13.0-041300.201709031731_amd64.deb
#(if desired, install headers in a similar manner but after step 15)
15. Reboot into the >=4.13 kernel
16. Presto manifesto ! (well, shoot, now that I look at it, still a lot of work to get linux on this machine, but it has gotten better...)
Go for the bonus points!:
As you might notice, bluetooth is not working and some (one) applications (kodi) dont have sound after suspend/resume.
Bluetooth:
Download the appropriate firmware file:
Code:
sudo wget https://raw.githubusercontent.com/harryharryharry/x205ta-iso2usb-files/master/BCM43341B0.hcd -O /lib/firmware/brcm/BCM43341B0.hcd
Create a systemd service-file /etc/systemd/system/btattach.service with the following contents:
Code:
[Unit]
Description=Btattach
[Service]
Type=simple
ExecStart=/usr/bin/btattach --bredr /dev/ttyS1 -P bcm
ExecStop=/usr/bin/killall btattach
[Install]
WantedBy=multi-user.target
And enable it (and restart the bluetooth service):
Code:
sudo systemctl enable btattach --now
sudo systemctl restart bluetooth
Kodi:
To retain sound in kodi after suspend, create a file /etc/systemd/system/resume-fix-pulseaudio@.service with the following contents (read note below on how this does NOT work in ubuntu):
Code:
[Unit]
Description=Fix PulseAudio after resume from suspend
After=suspend.target
[Service]
User=%I
Type=oneshot
Environment="XDG_RUNTIME_DIR=/run/user/%U"
ExecStart=/usr/bin/pasuspender /bin/true
[Install]
WantedBy=suspend.target
And enable the service:
Code:
systemctl enable resume-fix-pulseaudio@harry #change to your own username
Note: I got this service file off the always excellent Arch Linux wiki page. While this systemd-file does work fine in other distros, for some reason ubuntu does not accept the %U parameter, so with ubuntu change it to whatever uid your username has (find it by running: ls /run/user).
So if your uid is 1000, append the line in the systemd-file to:
Environment="XDG_RUNTIME_DIR=/run/user/1000"
Last edited by harryharryharry; October 19th, 2017 at 06:52 PM. Reason: edit: typo in step 10, option needs to options
Script to create bootable usb-stick for the X205TA. Prebuilt kernel with sound support for X205TA. Guide to compile a kernel for the X205TA. Guides to install linux to X205TA: general or ubuntu
Thread: ASUS X205TA hardware support for any other OS
https://ubuntuforums.org/showthread.php?t=2379657
Drivers
https://wiki.debian.org/InstallingDebianOn/Asus/X205TA
Wireless-5g
https://doc-0g-ag-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/uem6j4slcjie3eurgtg0s0bb6h5m6eqg/1532138400000/01573838831158647850/*/0Bzm23BxAV00pR0dNZEZVSktGSVU?e=download
------------
Kernel Patches
https://github.com/harryharryharry/x205ta-patches
https://ubuntuforums.org/showthread.php?t=2254322&page=158&p=13625163#post13625163
Harry's Prebuild Kernel
https://ubuntuforums.org/showthread.php?t=2254322&page=132&p=13595504#post13595504
wget http://x205ta.myftp.org:1337/kernel/kernel-sound-64bit.tar
Harry's Guide to compile a kernel for the X205TA.
https://goo.gl/dcXIM0
---------
Arch Kernal
https://aur.archlinux.org/pkgbase/linux-x205ta
替换 /lib/firmware/brcm/brcmfmac43340-sdio.txt (在用Harry的Prebuild Kernel4.17可识别5G)
====================
====================
http://manpages.ubuntu.com/manpages/bionic/man5/regulatory.bin.5.html
https://wireless.wiki.kernel.org/en/developers/Regulatory
iw list
iw config
--------------------
sudo iw reg set US
To set the correct country code, use the following command (change the country code to the one your router supports)
The country code can be decoded as follows:
if USA then country code = US
if china then country code = CN
--------------------
解决linux系统WIFI无法使用5GHz频率的问题
https://blog.csdn.net/subfate/article/details/51882322
为了使用WIFI的5GHz频率,有很多事是要注意的:
1、无线网卡是否支持5GHz。
2、需要CRDA可执行文件:/sbin/crda
3、需要CRDA目录:/lib/crda/
4、udev文件:/lib/udev/rules.d/85-regulatory.rules
Do I need to install a wireless patch for ASUS X205TA after upgrading the kernel?
Looking at the Debian wiki WiFi section it has a link to a WiFi patch and under it says that WiFi works in kernel > 4.0.
Do I still need the WiFi patch if I upgrade to kernel 4.0?
wireless kernel asus
shareimprove this question
edited Nov 29 '17 at 6:43
Zanna
47.3k13114224
asked Mar 29 '16 at 8:04
------------------
No patch needed for 4* kernels. We need these two files in the right place for WiFi to work on this device.
/lib/firmware/brcm/brcmfmac43340-sdio.bin
/lib/firmware/brcm/brcmfmac43340-sdio.txt
The first one was present & correctly located when I installed 16.04. Previously we used a file from Android and this is still mentioned in old guides, but if you don't have it, you can now get it from the Linux firmware repository:
sudo apt-get install git
git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
This creates a new directory - copy the correct file from it to the right place:
sudo cp linux-firmware/brcm/brcmfmac43340-sdio.bin lib/firmware/brcm/brcmfmac43340-sdio.bin
you might want to delete the cloned directory after that, as it is quite big.
The other file is already in the system but in the wrong place. It needs to be copied to the same directory as the .bin file and renamed like this:
sudo cp /sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113 /lib/firmware/brcm/brcmfmac43340-sdio.txt
Wi-Fi works after reboot :)
@chinkiko
Copy link
Author

chinkiko commented Jul 21, 2018

[Brightness] simple temporary solution :
sudo chmod 666 /sys/class/backlight/intel_backlight/brightness
add alias to ~/.zshrc ~/.bashrc
alias lowbrightness = " sudo echo "512" > /sys/class/backlight/intel_backlight/brightness "

or check the output display by
$ xrandr | grep " connected" | cut -f1 -d " "
and change brightness using
$ xrandr --output eDP-1 --brightness 0.7
alias darkscreen = "xrandr --output eDP-1 --brightness"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment