Compare commits
256 Commits
v5.19.12
...
74d4ce666a
Author | SHA1 | Date | |
---|---|---|---|
|
74d4ce666a | ||
|
a34e849715 | ||
|
bfaaacb505 | ||
|
f92d4ed9ca | ||
|
562a12e778 | ||
|
ae773456f6 | ||
|
c3fc434ff9 | ||
|
298b3d4098 | ||
|
3ffc34d90d | ||
|
df360952b9 | ||
|
7e07a8288d | ||
|
2a6832e697 | ||
|
94a2ac0bd8 | ||
|
a2b6fc7bbe | ||
|
2f482b4904 | ||
|
b30f072867 | ||
|
94383606d0 | ||
|
1454d6c705 | ||
|
d9da42be99 | ||
|
20aea5a14a | ||
|
18f10e2989 | ||
|
d1caaffa2e | ||
|
097c2ed1b5 | ||
|
cc5e53f109 | ||
|
37369b74eb | ||
|
bf02edcc5e | ||
|
a4c0ab6b9f | ||
|
6aab0087df | ||
|
0bce3a438d | ||
|
b5e9b0a2d7 | ||
|
cf3ead6032 | ||
|
52fec34536 | ||
|
ad587009c1 | ||
|
654cad0486 | ||
|
b4dc19e393 | ||
|
ed68908438 | ||
|
a83739ccdb | ||
|
f8438aab4e | ||
|
3c22a1df74 | ||
|
f12ae96992 | ||
|
995e4b862e | ||
|
4408978fba | ||
|
d3290ee4f8 | ||
|
3e8afbe79f | ||
|
8a56e832e8 | ||
|
25c2172e13 | ||
|
d18c0870c6 | ||
|
432e560b92 | ||
|
4160cdc52b | ||
|
fb5ad72c94 | ||
|
65dc6bda2f | ||
|
44e228cc0f | ||
|
a0b63c0a3f | ||
|
231ecec0df | ||
|
de9e9855c2 | ||
|
a46f270646 | ||
|
5135834002 | ||
|
ff082aebba | ||
|
8ecdc882c3 | ||
|
e0c74e5e15 | ||
|
97c1bf4ce2 | ||
|
f63f1caaf4 | ||
|
1a69f04e6e | ||
|
ca58ae7353 | ||
|
8b578cde89 | ||
|
4a4455d8bb | ||
|
98657d2f4f | ||
|
e543974c90 | ||
|
2114c55a35 | ||
|
7b4bf31ffb | ||
|
e4bcfc88c8 | ||
|
e96e2b32b4 | ||
|
322a6ecf1f | ||
|
884be6016c | ||
|
40565b6947 | ||
|
dd2aef31ca | ||
|
f03e9cf1ae | ||
|
f10d9c2102 | ||
|
c0064e06be | ||
|
1ac2ea0fd2 | ||
|
eff2fa5684 | ||
|
ea3bfe9603 | ||
|
ca75dd59c3 | ||
|
ecd9931b34 | ||
|
69aa332c06 | ||
|
7287b74226 | ||
|
162820958b | ||
|
64f8c32eae | ||
|
992735baee | ||
|
92281e4045 | ||
|
59bb904128 | ||
|
9d26aea883 | ||
|
84f28d6e76 | ||
|
9903de97f9 | ||
|
ad326af2b2 | ||
|
544dffba6b | ||
|
53cf25acf9 | ||
|
9815727037 | ||
|
61b9172388 | ||
|
eb0fda3198 | ||
|
0c187fac4b | ||
|
a083c4abf2 | ||
|
93c0139a1c | ||
|
0beab34a82 | ||
|
61f911f5a5 | ||
|
5672eaa929 | ||
|
c0f8f6d68e | ||
|
1afda7c108 | ||
|
e6c1edf943 | ||
|
ddc5ffd463 | ||
|
2786ab2916 | ||
|
a586812578 | ||
|
77078d8340 | ||
|
f2561e8f52 | ||
|
ac13936ea1 | ||
|
feb1867486 | ||
|
5c02fb44c4 | ||
|
e5fd39cad7 | ||
|
6c9383631d | ||
|
b54abe9ba5 | ||
|
af84cc4514 | ||
|
f65c485bf4 | ||
|
c0f870d1f2 | ||
|
5750e6174c | ||
|
ac8b6420c6 | ||
|
e4f8d0d479 | ||
|
24f561c816 | ||
|
f033dc9a50 | ||
|
e64616ef3c | ||
|
d638829538 | ||
|
f95793c534 | ||
|
2b5eda7968 | ||
|
1f3a417ff7 | ||
|
b13b5bbcf3 | ||
|
764dc320d5 | ||
|
feb9373578 | ||
|
1d2c0e5c66 | ||
|
ee6cc74e03 | ||
|
e9bc6b34e4 | ||
|
e1372ce04b | ||
|
ccbf7e5a82 | ||
|
0213d7503f | ||
|
3fd1eaddc4 | ||
|
cf3ee4415a | ||
|
ccc1e5cb69 | ||
|
4616e8a334 | ||
|
0669717533 | ||
|
3eb0fca482 | ||
|
3c4f81daa3 | ||
|
d465b7bbd0 | ||
|
17d26874f0 | ||
|
8fa230cc47 | ||
|
5c7f413670 | ||
|
430895448e | ||
|
12f4af77d1 | ||
|
9f4e3a6ab4 | ||
|
b711bc9d4b | ||
|
27a63d3151 | ||
|
129d26c332 | ||
|
a7110488dd | ||
|
8d7c65690a | ||
|
2fb0ab964e | ||
|
c146fa94b6 | ||
|
3d2b09d984 | ||
|
d9aa0ce0e6 | ||
|
3a62d00e93 | ||
|
3cdda62d46 | ||
|
2a3ef54e6e | ||
|
cce2db1c9f | ||
|
06eb48b3e3 | ||
|
a38ef1643c | ||
|
86578256b7 | ||
|
5298957d9b | ||
|
8c776ecf64 | ||
|
a6877bd422 | ||
|
12ff2a498f | ||
|
b57e1824c2 | ||
|
c141a8c304 | ||
|
5c3621fc6a | ||
|
be5dfffb8d | ||
|
1fc60cc388 | ||
|
73e9a2eb3c | ||
|
f4324da8a1 | ||
|
1854907001 | ||
|
348f3c9bb6 | ||
|
9948b85dac | ||
|
eb4c793ca8 | ||
|
367925c322 | ||
|
d0d6f02944 | ||
|
38e73fb059 | ||
|
4547454e3d | ||
|
77002f1406 | ||
|
83660b78a6 | ||
|
9f55fbf7f5 | ||
|
d03c960e18 | ||
|
c94b9cca51 | ||
|
dfd8a7f877 | ||
|
18aabc9f62 | ||
|
ce12bdcc7f | ||
|
f131173680 | ||
|
b8835ca202 | ||
|
de5400ddde | ||
|
d4bace1676 | ||
|
b108b3a8d2 | ||
|
9949ffb1d0 | ||
|
0b7c5dfa72 | ||
|
75ea27821f | ||
|
f5cd3ea3b3 | ||
|
81c14e1950 | ||
|
081d3097a0 | ||
|
be8c8e8230 | ||
|
86d2ec1f79 | ||
|
eb2be11b19 | ||
|
aaa7b3d556 | ||
|
aa69546f01 | ||
|
accb6d07f4 | ||
|
f79f7ddb8e | ||
|
4201196110 | ||
|
8b0d439206 | ||
|
8316a6970a | ||
|
c171d77094 | ||
|
16c81fb013 | ||
|
1882fa3bd9 | ||
|
c4ceba207d | ||
|
a380d532bc | ||
|
b82abcf5f6 | ||
|
1084ad5ba1 | ||
|
1e4b8fb627 | ||
|
02132367d6 | ||
|
1c4fece830 | ||
|
786140014b | ||
|
c162bca30d | ||
|
da7b57fa92 | ||
|
9e06bbfb46 | ||
|
d60046d9fb | ||
|
2a07409439 | ||
|
e801f7735b | ||
|
de0a0d301e | ||
|
0eda0819ed | ||
|
c0f559bdf6 | ||
|
b321569fee | ||
|
47e774e85f | ||
|
13d7282016 | ||
|
0e44660b75 | ||
|
53ce492d09 | ||
|
b4bd161253 | ||
|
1e7f8580c2 | ||
|
f59fe98754 | ||
|
3d2b1257f1 | ||
|
1d063ca326 | ||
|
3bfe0af945 | ||
|
6f76d62c8c | ||
|
322fbbd290 | ||
|
c0e2e485ab | ||
|
063aa59334 | ||
|
ae19c0057e |
82
.github/workflows/build-current-kernel-arch.yml
vendored
82
.github/workflows/build-current-kernel-arch.yml
vendored
@@ -6,10 +6,15 @@ on:
|
||||
|
||||
|
||||
env:
|
||||
_anbox: "true"
|
||||
_waydroid: "true"
|
||||
_processor_opt: "generic"
|
||||
PKGDEST: "/tmp/linux-tkg"
|
||||
_debugdisable: "true"
|
||||
_noccache: "true"
|
||||
_STRIP: "true"
|
||||
_kernel_on_diet: "true"
|
||||
_kernel_work_folder: "/tmp"
|
||||
_kernel_source_folder: "/tmp"
|
||||
# _modprobeddb: "true"
|
||||
# _modprobeddb_db_path: ${{ github.workspace }}/modprobed.db
|
||||
|
||||
@@ -44,27 +49,21 @@ jobs:
|
||||
run: |
|
||||
./.github/get_latest_kver.sh
|
||||
latest_kernel="$(cat .github/latest-kernel)"
|
||||
echo "::set-output name=latest_kernel::$latest_kernel"
|
||||
echo "latest_kernel=$latest_kernel" >> $GITHUB_OUTPUT
|
||||
new_kernel=0
|
||||
[[ "$latest_kernel" != "$latest_release" ]] || new_kernel=$?
|
||||
echo "::set-output name=new_kernel::$new_kernel"
|
||||
echo "new_kernel=$new_kernel" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
latest_release: ${{ steps.latest_release.outputs.release }}
|
||||
|
||||
build-pds:
|
||||
build-eevdf:
|
||||
env:
|
||||
_cpusched: "pds"
|
||||
|
||||
# The following code is repeated in each build job
|
||||
# Can be factorized once YAML anchors get implemented in Github
|
||||
# See https://github.com/actions/runner/issues/1182 for status
|
||||
_cpusched: "eevdf"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
|
||||
needs: ["check-for-newer-kernel"]
|
||||
|
||||
# the == 0 test is for "true" because it tests the exit code of a bash test
|
||||
needs: [check-for-newer-kernel]
|
||||
if: |
|
||||
github.ref == 'refs/heads/master' &&
|
||||
needs.check-for-newer-kernel.outputs.new_kernel == '0'
|
||||
@@ -87,6 +86,7 @@ jobs:
|
||||
useradd user -G wheel && echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
chown user -R ..
|
||||
chown user -R /tmp
|
||||
echo -e 'CONFIG_FAT_FS=m\nCONFIG_MSDOS_FS=m\nCONFIG_VFAT_FS=m\nCONFIG_FAT_DEFAULT_CODEPAGE=437\nCONFIG_FAT_DEFAULT_IOCHARSET="ascii"\nCONFIG_FAT_DEFAULT_UTF8=y\nCONFIG_EXFAT_FS=m\nCONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"\n# CONFIG_NTFS_FS is not set\nCONFIG_NTFS3_FS=m\n# CONFIG_NTFS3_64BIT_CLUSTER is not set\nCONFIG_NTFS3_LZX_XPRESS=y\nCONFIG_NTFS3_FS_POSIX_ACL=y' > FS_modprobed-db.myfrag
|
||||
|
||||
# - name: "[debug] make dummy modprobed-db file for faster ci"
|
||||
# run: |
|
||||
@@ -104,61 +104,14 @@ jobs:
|
||||
name: kernel-packages-${{ env._cpusched }}
|
||||
path: ${{ env.PKGDEST }}/linux*.pkg.tar.zst
|
||||
|
||||
build-cfs:
|
||||
build-bore-eevdf:
|
||||
env:
|
||||
_cpusched: "cfs"
|
||||
_cpusched: "bore-eevdf"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
|
||||
needs: ["check-for-newer-kernel"]
|
||||
if: |
|
||||
github.ref == 'refs/heads/master' &&
|
||||
needs.check-for-newer-kernel.outputs.new_kernel == '0'
|
||||
|
||||
steps:
|
||||
# We need to install git so the checkout is done with it
|
||||
- name: Install git
|
||||
run: pacman -Syu --noconfirm git
|
||||
|
||||
- name: Checkount linux-tkg
|
||||
uses: actions/checkout@v3.0.2
|
||||
|
||||
# 1. Install deps needed for building and sudo
|
||||
# 2. create a user "user" and give it passwordless sudo
|
||||
# and necessary permissions
|
||||
# because makepkg absolutely refuses to run as root
|
||||
- name: Prepare for makepkg
|
||||
run: |
|
||||
pacman -Syu --noconfirm base-devel sudo
|
||||
useradd user -G wheel && echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
chown user -R ..
|
||||
chown user -R /tmp
|
||||
|
||||
# - name: "[debug] make dummy modprobed-db file for faster ci"
|
||||
# run: |
|
||||
# touch "${_modprobeddb_db_path}"
|
||||
# echo "${_modprobeddb_db_path}"
|
||||
|
||||
- name: Compile Kernel
|
||||
run: su user -c "yes '' | makepkg --noconfirm -s"
|
||||
# run: |
|
||||
# mkdir -p "$PKGDEST"
|
||||
# echo "test" > "$PKGDEST"/linux-$_cpusched.pkg.tar.zst
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: kernel-packages-${{ env._cpusched }}
|
||||
path: ${{ env.PKGDEST }}/linux*.pkg.tar.zst
|
||||
|
||||
build-bmq:
|
||||
env:
|
||||
_cpusched: "bmq"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
|
||||
needs: ["check-for-newer-kernel"]
|
||||
needs: [check-for-newer-kernel]
|
||||
if: |
|
||||
github.ref == 'refs/heads/master' &&
|
||||
needs.check-for-newer-kernel.outputs.new_kernel == '0'
|
||||
@@ -181,6 +134,7 @@ jobs:
|
||||
useradd user -G wheel && echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
chown user -R ..
|
||||
chown user -R /tmp
|
||||
echo -e 'CONFIG_FAT_FS=m\nCONFIG_MSDOS_FS=m\nCONFIG_VFAT_FS=m\nCONFIG_FAT_DEFAULT_CODEPAGE=437\nCONFIG_FAT_DEFAULT_IOCHARSET="ascii"\nCONFIG_FAT_DEFAULT_UTF8=y\nCONFIG_EXFAT_FS=m\nCONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"\n# CONFIG_NTFS_FS is not set\nCONFIG_NTFS3_FS=m\n# CONFIG_NTFS3_64BIT_CLUSTER is not set\nCONFIG_NTFS3_LZX_XPRESS=y\nCONFIG_NTFS3_FS_POSIX_ACL=y' > FS_modprobed-db.myfrag
|
||||
|
||||
# - name: "[debug] make dummy modprobed-db file for faster ci"
|
||||
# run: |
|
||||
@@ -202,7 +156,7 @@ jobs:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: [check-for-newer-kernel, "build-pds", "build-cfs", "build-bmq"]
|
||||
needs: [check-for-newer-kernel, "build-eevdf", "build-bore-eevdf"]
|
||||
steps:
|
||||
- name: Download release artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
@@ -215,6 +169,6 @@ jobs:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: ${{ needs.check-for-newer-kernel.outputs.latest_kernel }}
|
||||
prerelease: false
|
||||
title: "${{ needs.check-for-newer-kernel.outputs.latest_kernel }}"
|
||||
title: "[experimental] ${{ needs.check-for-newer-kernel.outputs.latest_kernel }}"
|
||||
files: |
|
||||
${{ env.PKGDEST }}/kernel-packages-*/*
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -24,3 +24,6 @@ logs/*
|
||||
kernel_updates
|
||||
gnupg/
|
||||
*sha256sum*
|
||||
current_env
|
||||
linux-kernel.git/
|
||||
linux-src-git/
|
||||
|
61
PKGBUILD
61
PKGBUILD
@@ -31,7 +31,6 @@ _distro="Arch"
|
||||
declare -p -x > current_env
|
||||
|
||||
source "$_where"/customization.cfg # load default configuration from file
|
||||
source "$_where"/linux-tkg-config/prepare
|
||||
|
||||
if [ -e "$_EXT_CONFIG_PATH" ]; then
|
||||
msg2 "External configuration file $_EXT_CONFIG_PATH will be used and will override customization.cfg values."
|
||||
@@ -40,6 +39,8 @@ fi
|
||||
|
||||
source current_env
|
||||
|
||||
source "$_where"/linux-tkg-config/prepare
|
||||
|
||||
# Make sure we're in a clean state
|
||||
if [ ! -e "$_where"/BIG_UGLY_FROGMINER ]; then
|
||||
_tkg_initscript
|
||||
@@ -47,8 +48,6 @@ fi
|
||||
|
||||
source "$_where"/BIG_UGLY_FROGMINER
|
||||
|
||||
_srcpath="linux-src-git"
|
||||
|
||||
if [ -n "$_custom_pkgbase" ]; then
|
||||
pkgbase="${_custom_pkgbase}"
|
||||
else
|
||||
@@ -56,7 +55,7 @@ else
|
||||
fi
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
||||
pkgver="${_basekernel}"."${_sub}"
|
||||
pkgrel=269
|
||||
pkgrel=273
|
||||
pkgdesc='Linux-tkg'
|
||||
arch=('x86_64') # no i686 in here
|
||||
url="https://www.kernel.org/"
|
||||
@@ -68,7 +67,7 @@ fi
|
||||
optdepends=('schedtool')
|
||||
options=('!strip' 'docs')
|
||||
|
||||
for f in $_where/linux-tkg-config/$_basekernel/* $_where/linux-tkg-patches/$_basekernel/*; do
|
||||
for f in "$_where"/linux-tkg-config/"$_basekernel"/* "$_where"/linux-tkg-patches/"$_basekernel"/*; do
|
||||
source+=( "$f" )
|
||||
sha256sums+=( "SKIP" )
|
||||
done
|
||||
@@ -80,10 +79,12 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP
|
||||
prepare() {
|
||||
rm -rf $pkgdir # Nuke the entire pkg folder so it'll get regenerated clean on next build
|
||||
|
||||
ln -s "${_where}/customization.cfg" "${srcdir}" # workaround
|
||||
ln -s "${_where}/linux-src-git" "${srcdir}" # workaround, this doesn't respect tmpfs choice
|
||||
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
_define_kernel_abs_paths
|
||||
if [ -e "${srcdir}/customization.cfg" ]; then
|
||||
msg2 "Nuking remnant customization.cfg symlink" && rm -rf "${srcdir}/customization.cfg"
|
||||
fi
|
||||
ln -s "${_where}/customization.cfg" "${srcdir}"
|
||||
ln -s "${_kernel_work_folder_abs}" "${srcdir}"
|
||||
|
||||
source "${_where}/current_env"
|
||||
|
||||
@@ -91,13 +92,13 @@ prepare() {
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
cd "$_kernel_work_folder_abs"
|
||||
|
||||
# Use custom compiler paths if defined
|
||||
if [ "$_compiler_name" = "-llvm" ] && [ -n "${CUSTOM_LLVM_PATH}" ]; then
|
||||
PATH=${CUSTOM_LLVM_PATH}/bin:${CUSTOM_LLVM_PATH}/lib:${CUSTOM_LLVM_PATH}/include:${PATH}
|
||||
PATH="${CUSTOM_LLVM_PATH}/bin:${CUSTOM_LLVM_PATH}/lib:${CUSTOM_LLVM_PATH}/include:${PATH}"
|
||||
elif [ -n "${CUSTOM_GCC_PATH}" ]; then
|
||||
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
|
||||
PATH="${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}"
|
||||
fi
|
||||
|
||||
if [ "$_force_all_threads" = "true" ]; then
|
||||
@@ -122,11 +123,24 @@ build() {
|
||||
CFLAGS+=" ${_compileropt}"
|
||||
|
||||
# build!
|
||||
_runtime=$( time ( schedtool -B -n 1 -e ionice -n 1 make ${_force_all_threads} ${llvm_opt} LOCALVERSION= bzImage modules 2>&1 ) 3>&1 1>&2 2>&3 ) || _runtime=$( time ( make ${_force_all_threads} ${llvm_opt} LOCALVERSION= bzImage modules 2>&1 ) 3>&1 1>&2 2>&3 )
|
||||
if pacman -Qq schedtool &> /dev/null; then
|
||||
msg2 "Using schedtool"
|
||||
_schedtool="command schedtool -B -n 1"
|
||||
_ionice="command ionice -n 1"
|
||||
fi
|
||||
_runtime=$(
|
||||
if [ -n "$_schedtool" ]; then
|
||||
_pid="$(exec bash -c 'echo "$PPID"')"
|
||||
$_schedtool "$_pid" ||:
|
||||
$_ionice -p "$_pid" ||:
|
||||
fi
|
||||
time ( make ${_force_all_threads} ${llvm_opt} LOCALVERSION= bzImage modules 2>&1 ) 3>&1 1>&2 2>&3
|
||||
return $?
|
||||
)
|
||||
}
|
||||
|
||||
hackbase() {
|
||||
pkgdesc="The $pkgdesc kernel and modules"
|
||||
pkgdesc="The $pkgdesc kernel and modules - https://github.com/Frogging-Family/linux-tkg"
|
||||
depends=('coreutils' 'kmod' 'initramfs')
|
||||
optdepends=('linux-docs: Kernel hackers manual - HTML documentation that comes with the Linux kernel.'
|
||||
'crda: to set the correct wireless channels of your country.'
|
||||
@@ -142,7 +156,8 @@ hackbase() {
|
||||
fi
|
||||
replaces=(virtualbox-guest-modules-arch wireguard-arch)
|
||||
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
_define_kernel_abs_paths
|
||||
cd "$_kernel_work_folder_abs"
|
||||
|
||||
# get kernel version
|
||||
local _kernver="$(<version)"
|
||||
@@ -157,11 +172,11 @@ hackbase() {
|
||||
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
|
||||
|
||||
msg2 "Installing modules..."
|
||||
make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
|
||||
ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
|
||||
DEPMOD=/doesnt/exist modules_install # Suppress depmod
|
||||
|
||||
# remove build and source links
|
||||
rm "$modulesdir"/{source,build}
|
||||
rm -f "$modulesdir"/{source,build}
|
||||
|
||||
# install cleanup pacman hook and script
|
||||
sed -e "s|cleanup|${pkgbase}-cleanup|g" "${srcdir}"/90-cleanup.hook |
|
||||
@@ -172,9 +187,9 @@ hackbase() {
|
||||
install -Dm644 "${srcdir}"/customization-full.cfg "${pkgdir}/usr/share/doc/${pkgbase}/customization.cfg"
|
||||
|
||||
# workaround for missing header with winesync
|
||||
if [ -e "${srcdir}/${_srcpath}/include/uapi/linux/winesync.h" ]; then
|
||||
if [ -e "${_kernel_work_folder_abs}/include/uapi/linux/winesync.h" ]; then
|
||||
msg2 "Workaround missing winesync header"
|
||||
install -Dm644 "${srcdir}/${_srcpath}"/include/uapi/linux/winesync.h "${pkgdir}/usr/include/linux/winesync.h"
|
||||
install -Dm644 "${_kernel_work_folder_abs}"/include/uapi/linux/winesync.h "${pkgdir}/usr/include/linux/winesync.h"
|
||||
fi
|
||||
|
||||
# load winesync module at boot
|
||||
@@ -191,7 +206,7 @@ hackbase() {
|
||||
}
|
||||
|
||||
hackheaders() {
|
||||
pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
|
||||
pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel - https://github.com/Frogging-Family/linux-tkg"
|
||||
provides=("linux-headers=${pkgver}" "${pkgbase}-headers=${pkgver}")
|
||||
case $_basever in
|
||||
54|57|58|59|510)
|
||||
@@ -201,7 +216,9 @@ hackheaders() {
|
||||
;;
|
||||
esac
|
||||
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
_define_kernel_abs_paths
|
||||
cd "$_kernel_work_folder_abs"
|
||||
|
||||
local builddir="${pkgdir}/usr/lib/modules/$(<version)/build"
|
||||
|
||||
msg2 "Installing build files..."
|
||||
@@ -261,7 +278,7 @@ hackheaders() {
|
||||
msg2 "Stripping build tools..."
|
||||
local file
|
||||
while read -rd '' file; do
|
||||
case "$(file -bi "$file")" in
|
||||
case "$(file -Sib "$file")" in
|
||||
application/x-sharedlib\;*) # Libraries (.so)
|
||||
strip -v $STRIP_SHARED "$file" ;;
|
||||
application/x-archive\;*) # Libraries (.a)
|
||||
|
65
README.md
65
README.md
@@ -1,12 +1,13 @@
|
||||
## linux-tkg
|
||||
|
||||
This repository provides scripts to automatically download, patch and compile the Linux Kernel from [the official Linux git repository](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git), with a selection of patches aiming for better desktop/gaming experience. The provided patches can be enabled/disabled by editing the `customization.cfg` file and/or by following the interactive install script. You can also use your own patches (more information in `customization.cfg` file).
|
||||
This repository provides scripts to automatically download, patch and compile the Linux Kernel from [the official Linux git repository](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git), with a selection of patches aiming for better desktop/gaming experience. The provided patches can be enabled/disabled by editing the `customization.cfg` file and/or by following the interactive install script. You can use an external config file (default is `$HOME/.config/frogminer/linux-tkg.cfg`, tweakable with the `_EXT_CONFIG_PATH` variable in `customization.cfg`). You can also use your own patches (more information in `customization.cfg` file).
|
||||
|
||||
### Important information
|
||||
|
||||
- **Non-pacman distros support can be considered experimental. You're invited to report issues you might encounter with it.**
|
||||
- **If your distro isn't using systemd, please set _configfile="running-kernel" in customization.cfg or you might end up with a non-bootable kernel**
|
||||
|
||||
- Keep in mind building recent linux kernels with GCC will require ~20-25GB of disk space. Using llvm/clang, LTO, ccache and/or enabling more drivers in the defconfig will push that requirement higher, so make sure you have enough free space on the volume you're using to build.
|
||||
- In `intel_pstate` driver, frequency scaling aggressiveness has been changed with kernel 5.5 which results in stutters and poor performance in low/medium load scenarios (for higher power savings). As a workaround for our gaming needs, we are setting it to passive mode to make use of the `acpi_cpufreq` governor passthrough, keeping full support for turbo frequencies. It's combined with our aggressive ondemand governor by default for good performance on most CPUs while keeping frequency scaling for power savings. In a typical low/medium load scenario (Core i7 9700k, playing Mario Galaxy on Dolphin emulator) intel_pstate in performance mode gives a stuttery 45-50 fps experience, while passive mode + aggressive ondemand offers a locked 60 fps.
|
||||
- Nvidia's proprietary drivers might need to be patched if they don't support your chosen kernel OOTB: [Frogging-Family nvidia-all](https://github.com/Frogging-Family/nvidia-all) can do that automatically for you.
|
||||
- Note regarding kernels older than 5.9 on Arch Linux: since the switch to `zstd` compressed `initramfs` by default, you will face an `invalid magic at start of compress` error by default. You can workaround the issue by editing `/etc/mkinitcpio.conf` to uncomment the `COMPRESSION="lz4"` (for example, since that's the best option after zstd) line and regenerating `initramfs` for all kernels with `sudo mkinitpcio -P`
|
||||
@@ -14,19 +15,24 @@ This repository provides scripts to automatically download, patch and compile th
|
||||
### Customization options
|
||||
#### Alternative CPU schedulers
|
||||
|
||||
[CFS](https://en.wikipedia.org/wiki/Completely_Fair_Scheduler) is the only CPU scheduler available in the "vanilla" kernel sources. Its current implementation doesn't allow for injecting additional schedulers, and requires replacing it. Only one scheduler can be patched in at a time.
|
||||
[CFS](https://en.wikipedia.org/wiki/Completely_Fair_Scheduler) is the only CPU scheduler available in the "vanilla" kernel sources ≤ 6.5.
|
||||
[EEVDF](https://lwn.net/Articles/925371/) is the only CPU scheduler available in the "vanilla" kernel sources ≥ 6.6.
|
||||
|
||||
Its current implementation doesn't allow for injecting additional schedulers, and requires replacing it. Only one scheduler can be patched in at a time.
|
||||
|
||||
Alternative schedulers are available to you in linux-tkg:
|
||||
- Project C / PDS & BMQ by Alfred Chen: [blog](http://cchalpha.blogspot.com/ ), [code repository](https://gitlab.com/alfredchen/projectc)
|
||||
- MuQSS by Con Kolivas : [blog](http://ck-hack.blogspot.com/), [code repository](https://github.com/ckolivas/linux)
|
||||
- CacULE by Hamad Marri: [code repository](https://github.com/hamadmarri/cacule-cpu-scheduler)
|
||||
- Undead PDS: TkG's port of the pre-Project C "PDS-mq" scheduler by Alfred Chen. While PDS-mq got dropped with kernel 5.1 in favor of its BMQ evolution/rework, it wasn't on par with PDS-mq in gaming. "U" PDS still performs better in some cases than other schedulers, so it's been kept undead.
|
||||
- CacULE by Hamad Marri - CFS based : [code repository](https://github.com/hamadmarri/cacule-cpu-scheduler)
|
||||
- Task Type (TT) by Hamad Marri - CFS based : [code repository](https://github.com/hamadmarri/TT-CPU-Scheduler)
|
||||
- BORE (Burst-Oriented Response Enhancer) by Masahito Suzuki - CFS/EEVDF based : [code repository](https://github.com/firelzrd/bore-scheduler)
|
||||
- Undead PDS : TkG's port of the pre-Project C "PDS-mq" scheduler by Alfred Chen. While PDS-mq got dropped with kernel 5.1 in favor of its BMQ evolution/rework, it wasn't on par with PDS-mq in gaming. "U" PDS still performed better in some cases than other schedulers, so it's been kept undead for a while.
|
||||
|
||||
These alternative schedulers can offer a better performance/latency ratio for gaming and desktop use. The availability of each scheduler depends on the chosen Kernel version: the script will display what's available on a per-version basis.
|
||||
#### Default tweaks
|
||||
- Memory management and swapping tweaks
|
||||
- Scheduling tweaks
|
||||
- `CFS` tweaks
|
||||
- `CFS/EEVDF` tweaks
|
||||
- Using the ["Cake"](https://www.bufferbloat.net/projects/codel/wiki/CakeTechnical/) network queue management system
|
||||
- Using `vm.max_map_count=16777216` by default
|
||||
- Cherry-picked patches from [Clear Linux's patchset](https://github.com/clearlinux-pkgs/linux)
|
||||
@@ -40,46 +46,15 @@ The `customization.cfg` file offers many toggles for extra tweaks:
|
||||
- Using [Modprobed-db](https://github.com/graysky2/modprobed-db)'s database can reduce the compilation time and produce a smaller kernel which will only contain the modules listed in it. **NOT recommended**
|
||||
- **Warning**: make sure to read [thoroughly about it first](https://wiki.archlinux.org/index.php/Modprobed-db) since it comes with caveats that can lead to an unbootable kernel.
|
||||
- "Zenify" patchset using core blk, mm and scheduler tweaks from Zen
|
||||
- [Anbox](https://wiki.archlinux.org/title/Anbox) support (See [Anbox usage](https://github.com/Frogging-Family/linux-tkg#anbox-usage))
|
||||
- `ZFS` FPU symbols (<5.9)
|
||||
- Overrides for missing ACS capabilities
|
||||
- [Waydroid](https://wiki.archlinux.org/title/Waydroid) support
|
||||
- [OpenRGB](https://gitlab.com/CalcProgrammer1/OpenRGB) support
|
||||
- Provide own kernel `.config` file
|
||||
- ...
|
||||
#### User patches
|
||||
|
||||
To apply your own patch files using the provided scripts, you will need to put them in a `linux5y-tkg-userpatches` folder -- `y` needs to be changed with the kernel version the patch works on, _e.g_ `linux510-tkg-userpatches` -- at the same level as the `PKGBUILD` file, with the `.mypatch` extension. The script will by default ask if you want to apply them, one by one. The option `_user_patches` should be set to `true` in the `customization.cfg` file for this to work.
|
||||
|
||||
#### Anbox usage
|
||||
|
||||
**As of kernel 5.18, ashmem was dropped, breaking anbox. Their old Android 7 base doesn't allow moving to memfd so it might take a while to fix. The newer WayDroid alternative moved to using memfd thanks to an easier to work with Android 10 base. It still depends on binderfs, which is supported on 5.18+, but ashmem isn't a requirement for it anymore. An ashmem dkms driver can be used to circumvent the issue, but it currently is problematic on 5.19 and is likely to require active maintenance going forward. If you can, consider moving to WayDroid.**
|
||||
|
||||
When enabling the anbox support option, the `binder` and `ashmem` modules are built-in. You don't have to load them. However you'll need to mount binderfs :
|
||||
```shell
|
||||
sudo mkdir /dev/binderfs
|
||||
sudo mount -t binder binder /dev/binderfs
|
||||
```
|
||||
|
||||
To make this persistent, you can create `/etc/tmpfiles.d/anbox.conf` with the following content :
|
||||
```
|
||||
d! /dev/binderfs 0755 root root
|
||||
```
|
||||
After which you can add the following to your `/etc/fstab` :
|
||||
```
|
||||
binder /dev/binderfs binder nofail 0 0
|
||||
```
|
||||
|
||||
Then, if needed, start the anbox service :
|
||||
```shell
|
||||
systemctl start anbox-container-manager.service
|
||||
```
|
||||
|
||||
You can also enable the service for it to be auto-started on boot :
|
||||
```shell
|
||||
systemctl enable anbox-container-manager.service
|
||||
```
|
||||
|
||||
You're set to run Anbox.
|
||||
If you prefer automatic setup you can install `anbox-support` from AUR which will take care of everything by itself.
|
||||
To apply your own patch files using the provided scripts, you will need to put them in a `linux<VERSION><PATCHLEVEL>-tkg-userpatches` folder -- where _VERSION_ and _PATCHLEVEL_ are the kernel version and patch level, as specified in [linux Makefile](https://github.com/torvalds/linux/blob/master/Makefile), the patch works on, _e.g_ `linux65-tkg-userpatches` -- at the same level as the `PKGBUILD` file, with the `.mypatch` extension. The script will by default ask if you want to apply them, one by one. The option `_user_patches` should be set to `true` in the `customization.cfg` file for this to work.
|
||||
|
||||
|
||||
### Install procedure
|
||||
@@ -103,7 +78,6 @@ The script will use a slightly modified Arch config from the `linux-tkg-config`
|
||||
- Some issues have been reported by both Fedora (see https://github.com/Frogging-Family/linux-tkg/issues/383) and Ubuntu (see https://github.com/Frogging-Family/linux-tkg/issues/436) users where stock kernels cannot boot any longer, the whereabouts are still not entirely clear (it does not seem to affect every user)
|
||||
- Ubuntu: appears to be an initramfs generation issue
|
||||
- Fedora: needs disabling then re-enabling SELINUX so one can boot
|
||||
- Fedora + Nvidia users: Fedora's `akmod` nvidia packages do not work with `linux-tkg` (see https://github.com/Frogging-Family/linux-tkg/issues/375). `linux-tkg` requires Nvidias official `.run` installer (that uses `dkms` instead of `akmod`) to properly work with Nvidia.
|
||||
|
||||
The interactive `install.sh` script will create, depending on the selected distro, `.deb` or `.rpm` packages, move them in the the subfolder `DEBS` or `RPMS` then prompts to install them with the distro's package manager.
|
||||
```shell
|
||||
@@ -120,17 +94,6 @@ cd path/to/linux-tkg
|
||||
```
|
||||
The script will use a slightly modified Arch config from the `linux-tkg-config` folder, it can be changed through the `_configfile` variable in `customization.cfg`.
|
||||
|
||||
#### Void Linux
|
||||
```shell
|
||||
git clone -b tkg https://github.com/Hyper-KVM/void-packages/
|
||||
cd void-packages
|
||||
./xbps-src binary-bootstrap
|
||||
# Optional: edit customization.cfg located in srcpkgs/linux-tkg/files
|
||||
# Optional: add custom userpatches with the ".mypatch" extension to srcpkgs/linux-tkg/files/mypatches
|
||||
./xbps-src pkg -j$(nproc) linux-tkg
|
||||
```
|
||||
If you have to restart the build for any reason, run `./xbps-src clean linux-tkg` first.
|
||||
|
||||
#### Generic install
|
||||
The interactive `install.sh` script can be used to perform a "Generic" install by choosing `Generic` when prompted. It git clones the kernel tree in the `linux-src-git` folder, patches the code and edits a `.config` file in it. The commands to do are the following:
|
||||
```shell
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# linux-TkG config file
|
||||
|
||||
# Linux distribution you are using, options are "Arch", "Void", "Ubuntu", "Debian", "Fedora", "Suse", "Gentoo", "Generic".
|
||||
# Linux distribution you are using, options are "Arch", "Ubuntu", "Debian", "Fedora", "Suse", "Gentoo", "Generic".
|
||||
# It is automatically set to "Arch" when using PKGBUILD.
|
||||
# If left empty, the script will prompt
|
||||
_distro=""
|
||||
_distro="Arch"
|
||||
|
||||
# Kernel Version - Options are "5.4", and from "5.7" to "5.19"
|
||||
# Kernel Version - x.x format without the subversion (will always grab latest available subversion) is recommended
|
||||
# you can also set a specific kernel version, e.g. "6.0-rc4" or "5.10.51",
|
||||
# -> note however that a "z" too small on a "x.y.z" version may make patches fail
|
||||
# as they got adapted for newer "z" values.
|
||||
@@ -20,9 +20,23 @@ _EXT_CONFIG_PATH=~/.config/frogminer/linux-tkg.cfg
|
||||
# Default is "true".
|
||||
_NUKR="true"
|
||||
|
||||
# Git mirror to use to get the kernel sources, possible values are "kernel.org", "googlesource.com" and "github.com"
|
||||
# Git mirror to use to get the kernel sources, possible values are "kernel.org", "googlesource.com", "github.com" and "torvalds"
|
||||
_git_mirror="kernel.org"
|
||||
|
||||
# Root folder where to checkout the kernel sources (linux-src-git subdir) and build
|
||||
# Note: - Leave empty to use PKGBUILD's dir
|
||||
# - Start with a '/' for an absolute path in which `linux-tkg/linux-src-git/` will be created
|
||||
# - This setting can be used to set the work/build folder to a tmpfs folder
|
||||
# - Requires >= 32GB ram when building a full kernel, should work with less ram with modprobed-db
|
||||
_kernel_work_folder=""
|
||||
|
||||
# Permanent root folder where to keep the git clone (linux-kernel.git subdir) and fetch new blobs
|
||||
# Note: - Leave empty to use PKGBUILD's dir
|
||||
# - Start with a '/' for an absolute path in which `linux-tkg/linux-kernel.git/` will be created
|
||||
# - If your internet is faster than your storage, it may be wise to put this folder
|
||||
# in a tmpfs location (although it will reclone after each restart / tmpfs folder cleanup)
|
||||
_kernel_source_folder=""
|
||||
|
||||
# Custom compiler root dirs - Leave empty to use system compilers
|
||||
# Example: CUSTOM_GCC_PATH="/home/frog/PKGBUILDS/mostlyportable-gcc/gcc-mostlyportable-9.2.0"
|
||||
CUSTOM_GCC_PATH=""
|
||||
@@ -32,35 +46,34 @@ CUSTOM_GCC_PATH=""
|
||||
CUSTOM_LLVM_PATH=""
|
||||
|
||||
# Set to true to bypass makepkg.conf and use all available threads for compilation. False will respect your makepkg.conf options.
|
||||
_force_all_threads="true"
|
||||
_force_all_threads="false"
|
||||
|
||||
# Set to true to prevent ccache from being used and set CONFIG_GCC_PLUGINS=y (which needs to be disabled for ccache to work properly)
|
||||
_noccache="false"
|
||||
|
||||
# [Experimental] Build only a subset of the default kernel modules list to speedup compile time and lower needed space to build kernel
|
||||
# Notes:
|
||||
# - If the kernel fails to boot with this option active, disable it and rebuild
|
||||
# - This option cannot be used with _modprobeddb="true"
|
||||
_kernel_on_diet="false"
|
||||
|
||||
# Set to true to use modprobed db to clean config from unneeded modules. Speeds up compilation considerably. Requires root - https://wiki.archlinux.org/index.php/Modprobed-db
|
||||
# Using this option can trigger user prompts if the config doesn't go smoothly.
|
||||
# !!!! Make sure to have a well populated db !!!! - Leave empty to be asked about it at build time
|
||||
# !!!! Make sure to have a well populated db !!!!
|
||||
_modprobeddb="false"
|
||||
|
||||
# modprobed-db database file location
|
||||
_modprobeddb_db_path=~/.config/modprobed.db
|
||||
|
||||
# Set to "1" to call make menuconfig, "2" to call make nconfig, "3" to call make xconfig, before building the kernel. Set to false to disable and skip the prompt.
|
||||
_menunconfig=""
|
||||
_menunconfig="false"
|
||||
|
||||
# Set to true to generate a kernel config fragment from your changes in menuconfig/nconfig. Set to false to disable and skip the prompt.
|
||||
_diffconfig=""
|
||||
_diffconfig="false"
|
||||
|
||||
# Set to the file name where the generated config fragment should be written to. Only used if _diffconfig is active.
|
||||
_diffconfig_name=""
|
||||
|
||||
# [install.sh specific] Use tmpfs as a work directory, recommended when RAM >= 32GB to reduce HDD/SSD usage. For more information, see https://wiki.archlinux.org/title/Tmpfs
|
||||
_use_tmpfs="false"
|
||||
|
||||
# [install.sh specific] tmpfs folder path, only used when _use_tmpfs="true".
|
||||
# Creates a linux-tkg work folder within that pathmake sure to have nothing important in "$_tmpfs_path/linux-tkg"
|
||||
_tmpfs_path="/tmp"
|
||||
|
||||
# [install.sh: Generic and Gentoo specific] Dracut options when generating initramfs
|
||||
_dracut_options="--lz4"
|
||||
|
||||
@@ -70,7 +83,7 @@ _dracut_options="--lz4"
|
||||
# Default (empty) : "config.x86_64" from the linux-tkg-config/5.y folder.
|
||||
# "running-kernel" : Picks the .config file from the currently running kernel.
|
||||
# It is recommended to be running an official kernel before running this script, to pick off a correct .config file
|
||||
# "config_hardened.x86_64" : config file for a hardened kernel, available for kernel version "5.13", "5.10" and "5.4" .
|
||||
# "config_hardened.x86_64" : config file for a hardened kernel, available for kernel version "5.15", "5.13", "5.11", "5.10", "5.7", "5.4".
|
||||
# To get a complete hardened setup, you have to use "cfs" as _cpusched.
|
||||
# User provided value : custom user provided file, the given path should be relative to the PKGBUILD file. This enables for example to use a user stripped down .config file.
|
||||
# If the .config file isn't up to date with the chosen kernel version, any extra CONFIG_XXXX is set to its default value.
|
||||
@@ -89,12 +102,13 @@ _STRIP="true"
|
||||
|
||||
# LEAVE AN EMPTY VALUE TO BE PROMPTED ABOUT FOLLOWING OPTIONS AT BUILD TIME
|
||||
|
||||
# CPU scheduler - Options are "upds" (TkG's Undead PDS), "pds", "bmq", "muqss", "cacule" or "cfs" (kernel's default)
|
||||
_cpusched=""
|
||||
# CPU scheduler - Options are "pds", "bmq", "cacule", "tt", "bore", "bore-eevdf", "cfs" (linux 6.5-) or "eevdf" (kernel's default, 6.6+)
|
||||
# "upds" (TkG's Undead PDS) and "muqss" are also available on legacy kernel revisions
|
||||
_cpusched="pds"
|
||||
|
||||
# Compiler to use - Options are "gcc" or "llvm".
|
||||
# For advanced users.
|
||||
_compiler=""
|
||||
_compiler="gcc"
|
||||
|
||||
# Force the use of the LLVM Integrated Assembler whether using LLVM, LTO or not.
|
||||
# Set to "1" to enable.
|
||||
@@ -124,7 +138,7 @@ _preempt_rt_force=""
|
||||
# For BMQ: 0: No yield.
|
||||
# 1: Deboost and requeue task. (Default)
|
||||
# 2: Set rq skip task.
|
||||
_sched_yield_type=""
|
||||
_sched_yield_type="0"
|
||||
|
||||
# Round Robin interval is the longest duration two tasks with the same nice level will be delayed for. When CPU time is requested by a task, it receives a time slice equal
|
||||
# to the rr_interval in addition to a virtual deadline. When using yield_type 2, a low value can help offset the disadvantages of rescheduling a process that has yielded.
|
||||
@@ -132,7 +146,7 @@ _sched_yield_type=""
|
||||
# PDS default: 4ms"
|
||||
# BMQ default: 2ms"
|
||||
# Set to "1" for 2ms, "2" for 4ms, "3" for 6ms, "4" for 8ms, or "default" to keep the chosen scheduler defaults.
|
||||
_rr_interval=""
|
||||
_rr_interval="default"
|
||||
|
||||
# Set to "true" to disable FUNCTION_TRACER/GRAPH_TRACER, lowering overhead but limiting debugging and analyzing of kernel functions - Kernel default is "false"
|
||||
_ftracedisable="false"
|
||||
@@ -144,50 +158,38 @@ _numadisable="false"
|
||||
_misc_adds="true"
|
||||
|
||||
# Set to "0" for periodic ticks, "1" to use CattaRappa mode (enabling full tickless) and "2" for tickless idle only.
|
||||
# Full tickless can give higher performances in various cases but, depending on hardware, lower consistency. Just tickless idle can perform better on some platforms (mostly AMD based).
|
||||
_tickless=""
|
||||
# Full tickless can give higher performances in case you use isolation of CPUs for tasks
|
||||
# and it works only when using the nohz_full kernel parameter, otherwise behaves like idle.
|
||||
# Just tickless idle perform better for most platforms.
|
||||
_tickless="2"
|
||||
|
||||
# Set to "true" to use ACS override patch - https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29 - Kernel default is "false"
|
||||
_acs_override=""
|
||||
_acs_override="false"
|
||||
|
||||
# Set to "true" to add Bcache filesystem support. You'll have to install bcachefs-tools-git from AUR for utilities - https://bcachefs.org/ - If in doubt, set to "false"
|
||||
# This can be buggy and isn't recommended on a production machine, also enabling this option will not allow you to enable MGLRU.
|
||||
_bcachefs="false"
|
||||
|
||||
# Set to "true" to add multi-generational LRU framework support on kernel 5.18+ - Improves memory pressure handling - https://lore.kernel.org/lkml/20220706220022.968789-1-yuzhao@google.com/
|
||||
# Older kernel versions might have a patch available in the community-patches repo
|
||||
# ! This option will be disabled when bcachefs is enabled for now !
|
||||
_mglru="true"
|
||||
|
||||
# Set to "true" to enable support for fsync, an experimental replacement for esync found in Valve Proton 4.11+ - https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305
|
||||
# Can be enabled alongside _futex_waitv on 5.13+ to use it as a fallback for older Proton builds
|
||||
_fsync="true"
|
||||
|
||||
# Set to "true" to enable support for futex2, an experimental interface that can be used by proton-tkg and proton 5.13 experimental through Fsync - Can be enabled alongside fsync to use it as a fallback
|
||||
# https://gitlab.collabora.com/tonyk/linux/-/tree/futex2-dev
|
||||
_futex2="true"
|
||||
|
||||
# Set to "true" to enable backported patches to add support for the futex_waitv() syscall, a new interface for fsync. It will appear in mainline at Linux 5.16 release and requires a wine/proton with builtin support for it. It's expected to be available in Valve Proton 6.3 stable soon - https://github.com/ValveSoftware/wine/pull/128
|
||||
# !! Disables futex2 interfaces support !!
|
||||
# https://github.com/andrealmeid/futex_waitv_patches
|
||||
_futex_waitv="false"
|
||||
|
||||
# Set to "true" to enable support for winesync, an experimental replacement for esync - requires patched wine - https://repo.or.cz/linux/zf.git/shortlog/refs/heads/winesync4
|
||||
# ! Can't be used on multiple kernels installed side-by-side, which will require https://aur.archlinux.org/packages/winesync-dkms/ instead of this option !
|
||||
_winesync="false"
|
||||
|
||||
# Set to "true" to enable Binder and Ashmem, the kernel modules required to use the android emulator Anbox. ! This doesn't apply to 5.4.y !
|
||||
_anbox=""
|
||||
# Set to "true" to enable Binder modules to use Waydroid Android containers
|
||||
_waydroid="false"
|
||||
|
||||
# Various patches and tweaks from Zen/Liquorix, Xanmod and the community - Default is "true"
|
||||
_glitched_base="true"
|
||||
|
||||
# A selection of patches from Zen/Liquorix kernel and additional tweaks for a better gaming experience (ZENIFY) - Default is "true"
|
||||
# ! depends on _glitched_base="true" !
|
||||
_zenify="true"
|
||||
|
||||
# compiler optimization level - 1. Optimize for performance (-O2); 2. Optimize harder (-O3); 3. Optimize for size (-Os) - Kernel default is "1"
|
||||
_compileroptlevel="1"
|
||||
_compileroptlevel="2"
|
||||
|
||||
# CPU compiler optimizations - Defaults to prompt at kernel config if left empty
|
||||
# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3" (zen3 opt support depends on GCC11)
|
||||
# Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake"
|
||||
# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3" "zen4" (zen3 opt support depends on GCC11) (zen4 opt support depends on GCC13)
|
||||
# Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake" "raptorlake" "meteorlake" (raptorlake and meteorlake opt support require GCC13)
|
||||
# Other options :
|
||||
# - "native_amd" (use compiler autodetection - Selecting your arch manually in the list above is recommended instead of this option)
|
||||
# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option)
|
||||
@@ -197,10 +199,7 @@ _compileroptlevel="1"
|
||||
# - "generic_v2" (depends on GCC11 - to share the package between machines with different CPU µarch supporting at least x86-64-v2
|
||||
# - "generic_v3" (depends on GCC11 - to share the package between machines with different CPU µarch supporting at least x86-64-v3
|
||||
# - "generic_v4" (depends on GCC11 - to share the package between machines with different CPU µarch supporting at least x86-64-v4
|
||||
_processor_opt=""
|
||||
|
||||
# MuQSS only - Make IRQ threading compulsory (FORCE_IRQ_THREADING) - Default is "false"
|
||||
_irq_threading="false"
|
||||
_processor_opt="skylake"
|
||||
|
||||
# CacULE only - Enable Response Driven Balancer, an experimental load balancer for CacULE
|
||||
_cacule_rdb="false"
|
||||
@@ -213,17 +212,13 @@ _cacule_rdb_interval="19"
|
||||
_tt_high_hz="false"
|
||||
|
||||
# MuQSS and PDS only - SMT (Hyperthreading) aware nice priority and policy support (SMT_NICE) - Kernel default is "true" - You can disable this on non-SMT/HT CPUs for lower overhead
|
||||
_smt_nice=""
|
||||
_smt_nice="true"
|
||||
|
||||
# Trust the CPU manufacturer to initialize Linux's CRNG (RANDOM_TRUST_CPU) - Kernel default is "false"
|
||||
_random_trust_cpu="false"
|
||||
_random_trust_cpu="true"
|
||||
|
||||
# MuQSS only - CPU scheduler runqueue sharing - No sharing (RQ_NONE), SMT (hyperthread) siblings (RQ_SMT), Multicore siblings (RQ_MC), Symmetric Multi-Processing (RQ_SMP), NUMA (RQ_ALL)
|
||||
# Valid values are "none", "smt", "mc", "mc-llc"(for zen), "smp", "all" - Kernel default is "smt"
|
||||
_runqueue_sharing=""
|
||||
|
||||
# Timer frequency - "100" "500", "750" or "1000" ("2000" can be set for cacule cpu sched, and will fallback to default if set while on another schedulers) - More options available in kernel config prompt when left empty depending on selected cpusched with the default option pointed with a ">"
|
||||
_timer_freq=""
|
||||
# Timer frequency - "100" "250" "300" "500" "750" "1000" ("2000" is available for cacule cpusched only) - More options available in kernel config prompt when left empty depending on selected cpusched with the default option pointed with a ">" (2000 for cacule, 100 for muqss and 1000 for other cpu schedulers)
|
||||
_timer_freq="1000"
|
||||
|
||||
# Default CPU governor - "performance", "ondemand", "schedutil" or leave empty for default (schedutil)
|
||||
_default_cpu_gov="ondemand"
|
||||
@@ -239,30 +234,62 @@ _aggressive_ondemand="true"
|
||||
_tcp_cong_alg=""
|
||||
|
||||
# You can pass a default set of kernel command line options here - example: "intel_pstate=passive nowatchdog amdgpu.ppfeaturemask=0xfffd7fff mitigations=off"
|
||||
_custom_commandline="intel_pstate=passive"
|
||||
_custom_commandline=""
|
||||
|
||||
# Selection of Clearlinux patches
|
||||
_clear_patches="true"
|
||||
|
||||
# Add OpenRGB compatibility for certain i2c controllers - https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/master/OpenRGB.patch
|
||||
_openrgb="true"
|
||||
|
||||
|
||||
#### SPESHUL OPTION ####
|
||||
|
||||
# If you want to bypass the stock naming scheme and enforce something else (example : "linux") - Useful for some bootloaders requiring manual entry editing on each release.
|
||||
# [Arch only] If you want to bypass the stock naming scheme and enforce something else (example : "linux") - Useful for some bootloaders requiring manual entry editing on each release.
|
||||
# !!! It will also change pkgname - If you don't explicitely need this, don't use it !!!
|
||||
# Use _kernel_localversion instead on non-Arch based distros
|
||||
_custom_pkgbase=""
|
||||
|
||||
# [non-Arch specific] Kernel localversion. Putting it to "Mario" will make for example the kernel version be 5.7.0-tkg-Mario (given by uname -r)
|
||||
# [non-Arch only] Kernel localversion. Putting it to "Mario" will make for example the kernel version be 5.7.0-tkg-Mario (given by uname -r)
|
||||
# If left empty, it will use "-tkg-${_cpusched}${_compiler}" where "${_cpusched}" will be replaced by the user chosen scheduler, ${_compiler} will be replaced by "-llvm" if clang is used (nothing for GCC).
|
||||
# Use _custom_pkgbase instead on Arch based distros
|
||||
_kernel_localversion=""
|
||||
|
||||
# Set to your maximum number of CPUs (physical + logical cores) - Lower means less overhead - You can set it to "$(nproc)" to use the current host's CPU(s) core count, or leave empty to use default
|
||||
# If you set this to a lower value than you have cores, some cores will be disabled
|
||||
# Default Arch kernel value is 320
|
||||
_NR_CPUS_value=""
|
||||
|
||||
#### LEGACY OPTIONS ####
|
||||
|
||||
# Upstreamed version of Fsync from Linux 5.16 for previous kernel versions - https://github.com/andrealmeid/futex_waitv_patches
|
||||
# ! Only affect 5.13, 5.14 and 5.15 kernel branches. Safely ignored for 5.16 or newer !
|
||||
_fsync_backport="true"
|
||||
|
||||
# Fsync legacy, known as FUTEX_WAIT_MULTIPLE (opcode 31) - previous version of fsync required for Valve Proton 4.11, 5.0 and 5.13 - https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305
|
||||
_fsync_legacy="true"
|
||||
|
||||
# Set to "true" to enable support for futex2, a DEPRECATED interface that can be used by proton-tkg and proton 5.13 experimental through Fsync - Can be enabled alongside fsync legacy to use it as a fallback
|
||||
# https://gitlab.collabora.com/tonyk/linux/-/tree/futex2-dev
|
||||
# ! Only affect 5.10-5.14 kernel branches. Safely ignored for 5.15 or newer !
|
||||
# ! required _fsync_backport="false" !
|
||||
_fsync_futex2="false"
|
||||
|
||||
# Set to "true" to add back missing symbol for AES-NI/AVX support on ZFS - This is a legacy option that can be ignored on 5.10+ kernels - https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions.patch
|
||||
_zfsfix="true"
|
||||
|
||||
# Set to your maximum number of CPUs (physical + logical cores) - Lower means less overhead - You can set it to "$(nproc)" to use the current host's CPU(s) core count, or leave empty to get a prompt
|
||||
# If you set this to a lower value than you have cores, some cores will be disabled
|
||||
# Default Arch kernel value is 320
|
||||
_NR_CPUS_value="128"
|
||||
# MuQSS only - CPU scheduler runqueue sharing - No sharing (RQ_NONE), SMT (hyperthread) siblings (RQ_SMT), Multicore siblings (RQ_MC), Symmetric Multi-Processing (RQ_SMP), NUMA (RQ_ALL)
|
||||
# Valid values are "none", "smt", "mc", "mc-llc"(for zen), "smp", "all" - Kernel default is "smt"
|
||||
_runqueue_sharing=""
|
||||
|
||||
# MuQSS only - Make IRQ threading compulsory (FORCE_IRQ_THREADING) - Default is "false"
|
||||
_irq_threading="false"
|
||||
|
||||
# Set to "true" to add multi-generational LRU framework support on kernel 5.18+ - Improves memory pressure handling - https://lore.kernel.org/lkml/20220706220022.968789-1-yuzhao@google.com/
|
||||
# Older kernel versions might have a patch available in the community-patches repo
|
||||
# Upstream as of 6.1
|
||||
# ! This option will be disabled when bcachefs is enabled !
|
||||
_mglru="true"
|
||||
|
||||
#### USER PATCHES ####
|
||||
|
||||
@@ -270,7 +297,7 @@ _NR_CPUS_value="128"
|
||||
# example: _community_patches="clear_nack_in_tend_isr.myrevert ffb_regression_fix.mypatch 0008-drm-amd-powerplay-force-the-trim-of-the-mclk-dpm-levels-if-OD-is-enabled.mypatch"
|
||||
_community_patches=""
|
||||
|
||||
# You can use your own patches by putting them in a subfolder called linux<version>-tkg-userpatches (e.g. linux510-tkg-userpatches) next to the PKGBUILD and giving them the .mypatch extension.
|
||||
# You can use your own patches by putting them in a subfolder called linux<VERSION><PATCHLEVEL>-tkg-userpatches (see README.md for more info) next to the PKGBUILD and giving them the .mypatch extension.
|
||||
# You can also revert patches by putting them in that same folder and giving them the .myrevert extension.
|
||||
|
||||
# Also, userpatches variable below must be set to true for the above to work.
|
||||
|
121
install.sh
121
install.sh
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Stop the script at any ecountered error
|
||||
set -e
|
||||
|
||||
# save current environment before losing it to the script call
|
||||
declare -p -x > current_env
|
||||
|
||||
# If current run is not using 'script' for logging, do it
|
||||
if [ -z "$SCRIPT" ]; then
|
||||
export SCRIPT=1
|
||||
@@ -11,8 +17,7 @@ if [ -z "$SCRIPT" ]; then
|
||||
exit $exit_status
|
||||
fi
|
||||
|
||||
# Stop the script at any ecountered error
|
||||
set -e
|
||||
###################### Definition of helper variables and functions
|
||||
|
||||
_where=`pwd`
|
||||
srcdir="$_where"
|
||||
@@ -42,12 +47,23 @@ plain() {
|
||||
echo -e "$1" >&2
|
||||
}
|
||||
|
||||
declare -p -x > current_env
|
||||
####################################################################
|
||||
|
||||
################### Config sourcing
|
||||
|
||||
source customization.cfg
|
||||
|
||||
if [ -e "$_EXT_CONFIG_PATH" ]; then
|
||||
msg2 "External configuration file $_EXT_CONFIG_PATH will be used and will override customization.cfg values."
|
||||
source "$_EXT_CONFIG_PATH"
|
||||
fi
|
||||
|
||||
. current_env
|
||||
|
||||
source linux-tkg-config/prepare
|
||||
|
||||
####################################################################
|
||||
|
||||
_distro_prompt() {
|
||||
echo "Which linux distribution are you running ?"
|
||||
echo "if it's not on the list, chose the closest one to it: Fedora/Suse for RPM, Ubuntu/Debian for DEB"
|
||||
@@ -61,23 +77,19 @@ _install_dependencies() {
|
||||
fi
|
||||
if [ "$_distro" = "Debian" -o "$_distro" = "Ubuntu" ]; then
|
||||
msg2 "Installing dependencies"
|
||||
sudo apt install bc bison build-essential ccache cpio fakeroot flex git kmod libelf-dev libncurses5-dev libssl-dev lz4 qtbase5-dev rsync schedtool wget zstd ${clang_deps} -y
|
||||
sudo apt install bc bison build-essential ccache cpio fakeroot flex git kmod libelf-dev libncurses5-dev libssl-dev lz4 qtbase5-dev rsync schedtool wget zstd debhelper ${clang_deps} -y
|
||||
elif [ "$_distro" = "Fedora" ]; then
|
||||
msg2 "Installing dependencies"
|
||||
if [ $(rpm -E %fedora) = "32" ]; then
|
||||
sudo dnf install bison ccache dwarves elfutils-libelf-devel fedora-packager fedpkg flex gcc-c++ git grubby libXi-devel lz4 ncurses-devel openssl-devel pesign qt5-devel rpm-build rpmdevtools schedtool zstd ${clang_deps} -y
|
||||
else
|
||||
sudo dnf install bison ccache dwarves elfutils-devel elfutils-libelf-devel fedora-packager fedpkg flex gcc-c++ git grubby libXi-devel lz4 make ncurses-devel openssl openssl-devel perl-devel perl-generators pesign python3-devel qt5-qtbase-devel rpm-build rpmdevtools schedtool zstd -y ${clang_deps} -y
|
||||
fi
|
||||
sudo dnf install perl bison ccache dwarves elfutils-devel elfutils-libelf-devel fedora-packager fedpkg flex gcc-c++ git grubby libXi-devel lz4 make ncurses-devel openssl openssl-devel perl-devel perl-generators pesign python3-devel qt5-qtbase-devel rpm-build rpmdevtools schedtool zstd bc rsync -y ${clang_deps} -y
|
||||
elif [ "$_distro" = "Suse" ]; then
|
||||
msg2 "Installing dependencies"
|
||||
sudo zypper install -y bc bison ccache dwarves elfutils flex gcc-c++ git libXi-devel libelf-devel libqt5-qtbase-common-devel libqt5-qtbase-devel lz4 make ncurses-devel openssl-devel patch pesign rpm-build rpmdevtools schedtool ${clang_deps}
|
||||
sudo zypper install -y bc bison ccache dwarves elfutils flex gcc-c++ git libXi-devel libelf-devel libqt5-qtbase-common-devel libqt5-qtbase-devel lz4 make ncurses-devel openssl-devel patch pesign rpm-build rpmdevtools schedtool python3 rsync zstd ${clang_deps}
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" != "install" ] && [ "$1" != "config" ] && [ "$1" != "uninstall-help" ]; then
|
||||
msg2 "Argument not recognised, options are:
|
||||
- config : interactive script that shallow clones the linux 5.x.y git tree into the folder linux-src-git, then applies extra patches and prepares the .config file
|
||||
- config : interactive script that shallow clones the linux 5.x.y git tree into the folder \$_kernel_work_folder, then applies extra patches and prepares the .config file
|
||||
by copying the one from the currently running linux system and updates it.
|
||||
- install : does the config step, proceeds to compile, then prompts to install
|
||||
- 'DEB' distros: it creates .deb packages that will be installed then stored in the DEBS folder.
|
||||
@@ -87,12 +99,6 @@ if [ "$1" != "install" ] && [ "$1" != "config" ] && [ "$1" != "uninstall-help" ]
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Load external configuration file if present. Available variable values will overwrite customization.cfg ones.
|
||||
if [ -e "$_EXT_CONFIG_PATH" ]; then
|
||||
msg2 "External configuration file $_EXT_CONFIG_PATH will be used and will override customization.cfg values."
|
||||
source "$_EXT_CONFIG_PATH"
|
||||
fi
|
||||
|
||||
if [ "$1" = "install" ] || [ "$1" = "config" ]; then
|
||||
|
||||
if [ -z "$_distro" ] && [ "$1" = "install" ]; then
|
||||
@@ -130,24 +136,9 @@ if [ "$1" = "install" ] || [ "$1" = "config" ]; then
|
||||
_distro=""
|
||||
fi
|
||||
|
||||
# cd into the linux-src folder is important before calling _tkg_srcprep
|
||||
cd "$_where/linux-src-git"
|
||||
_tkg_srcprep
|
||||
|
||||
_build_dir="$_where"
|
||||
if [ "$_use_tmpfs" = "true" ]; then
|
||||
if [ -d "$_tmpfs_path/linux-tkg" ]; then
|
||||
msg2 "Nuking linux-tkg tmpfs folder $_tmpfs_path/linux-tkg"
|
||||
rm -rf "$_tmpfs_path/linux-tkg"
|
||||
fi
|
||||
mkdir "$_tmpfs_path/linux-tkg"
|
||||
cp -r "$_where/linux-src-git" "$_tmpfs_path/linux-tkg/linux-src-git"
|
||||
|
||||
# cd into the linux-src folder is important before calling _tkg_srcprep
|
||||
_build_dir="$_tmpfs_path/linux-tkg"
|
||||
cd "$_tmpfs_path/linux-tkg/linux-src-git"
|
||||
fi
|
||||
|
||||
_build_dir="$_kernel_work_folder_abs/.."
|
||||
|
||||
# Uppercase characters are not allowed in source package name for debian based distros
|
||||
if [[ "$_distro" =~ ^(Debian|Ubuntu)$ && "$_cpusched" = "MuQSS" ]]; then
|
||||
@@ -211,14 +202,16 @@ if [ "$1" = "install" ]; then
|
||||
_kernel_subver="${_sub}"
|
||||
fi
|
||||
|
||||
_timed_build() {
|
||||
_runtime=$( time ( schedtool -B -n 1 -e ionice -n 1 "$@" 2>&1 ) 3>&1 1>&2 2>&3 ) || _runtime=$( time ( "$@" 2>&1 ) 3>&1 1>&2 2>&3 )
|
||||
}
|
||||
#_timed_build() {
|
||||
#_runtime=$( time ( schedtool -B -n 1 -e ionice -n 1 "$@" 2>&1 ) 3>&1 1>&2 2>&3 ) || _runtime=$( time ( "$@" 2>&1 ) 3>&1 1>&2 2>&3 ) - Bash 5.2 is broken https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018727
|
||||
#}
|
||||
|
||||
cd "$_kernel_work_folder_abs"
|
||||
|
||||
if [[ "$_distro" =~ ^(Ubuntu|Debian)$ ]]; then
|
||||
|
||||
msg2 "Building kernel DEB packages"
|
||||
_timed_build make ${llvm_opt} -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}
|
||||
make ${llvm_opt} -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}
|
||||
msg2 "Building successfully finished!"
|
||||
|
||||
# Create DEBS folder if it doesn't exist
|
||||
@@ -238,10 +231,9 @@ if [ "$1" = "install" ]; then
|
||||
fi
|
||||
_headers_deb="linux-headers-${_kernelname}*.deb"
|
||||
_image_deb="linux-image-${_kernelname}_*.deb"
|
||||
_kernel_devel_deb="linux-libc-dev_${_kernelname}*.deb"
|
||||
|
||||
cd DEBS
|
||||
sudo dpkg -i $_headers_deb $_image_deb $_kernel_devel_deb
|
||||
sudo dpkg -i $_headers_deb $_image_deb
|
||||
fi
|
||||
|
||||
elif [[ "$_distro" =~ ^(Fedora|Suse)$ ]]; then
|
||||
@@ -256,13 +248,13 @@ if [ "$1" = "install" ]; then
|
||||
_extra_ver_str="_${_kernel_flavor}"
|
||||
fi
|
||||
|
||||
_fedora_work_dir="${HOME}/.cache/linux-tkg-rpmbuild"
|
||||
if [ "$_use_tmpfs" = "true" ]; then
|
||||
_fedora_work_dir="$_tmpfs_path/linux-tkg/linux-tkg-rpmbuild"
|
||||
fi
|
||||
_fedora_work_dir="$_kernel_work_folder_abs/rpmbuild"
|
||||
|
||||
msg2 "Add patched files to the diff.patch"
|
||||
(cd ${_kernel_work_folder_abs} && git add -- . ':!rpmbuild')
|
||||
|
||||
msg2 "Building kernel RPM packages"
|
||||
RPMOPTS="--define '_topdir ${_fedora_work_dir}'" _timed_build make ${llvm_opt} -j ${_thread_num} rpm-pkg EXTRAVERSION="${_extra_ver_str}"
|
||||
RPMOPTS="--define '_topdir ${_fedora_work_dir}'" make ${llvm_opt} -j ${_thread_num} rpm-pkg EXTRAVERSION="${_extra_ver_str}"
|
||||
msg2 "Building successfully finished!"
|
||||
|
||||
# Create RPMS folder if it doesn't exist
|
||||
@@ -280,18 +272,38 @@ if [ "$1" = "install" ]; then
|
||||
else
|
||||
_kernelname=$_basekernel.${_kernel_subver}_$_kernel_flavor
|
||||
fi
|
||||
_headers_rpm="kernel-headers-${_kernelname}*.rpm"
|
||||
|
||||
_kernel_rpm="kernel-${_kernelname}*.rpm"
|
||||
# The headers are actually contained in the kernel-devel RPM and not the headers one...
|
||||
_kernel_devel_rpm="kernel-devel-${_kernelname}*.rpm"
|
||||
_kernel_syms_rpm="kernel-syms-${_kernelname}*.rpm"
|
||||
|
||||
cd RPMS
|
||||
if [ "$_distro" = "Fedora" ]; then
|
||||
sudo dnf install $_headers_rpm $_kernel_rpm $_kernel_devel_rpm
|
||||
sudo dnf install $_kernel_rpm $_kernel_devel_rpm
|
||||
elif [ "$_distro" = "Suse" ]; then
|
||||
# It seems there is some weird behavior with relocking existing locks, so let's unlock first
|
||||
sudo zypper removelock kernel-default-devel kernel-default kernel-devel kernel-syms
|
||||
|
||||
msg2 "Some files from 'linux-glibc-devel' will be replaced by files from the custom kernel-hearders package"
|
||||
msg2 "To revert back to the original kernel headers do 'sudo zypper install -f linux-glibc-devel'"
|
||||
sudo zypper install --replacefiles --allow-unsigned-rpm $_headers_rpm $_kernel_rpm $_kernel_devel_rpm
|
||||
sudo zypper install --oldpackage --allow-unsigned-rpm $_kernel_rpm $_kernel_devel_rpm $_kernel_syms_rpm
|
||||
|
||||
# Let's lock post install
|
||||
warning "By default, system kernel updates will overwrite your custom kernel."
|
||||
warning "Adding a lock will prevent this but skip system kernel updates."
|
||||
msg2 "You can remove the lock if needed with 'sudo zypper removelock kernel-default-devel kernel-default kernel-devel kernel-syms'"
|
||||
read -p "Would you like to lock system kernel packages ? Y/[n]: " _lock
|
||||
if [[ "$_lock" =~ ^(Y|y|Yes|yes)$ ]]; then
|
||||
sudo zypper addlock kernel-default-devel kernel-default kernel-devel kernel-syms
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$_distro" = "Suse" ]; then
|
||||
msg2 "Creating initramfs"
|
||||
sudo dracut --force --hostonly ${_dracut_options} --kver $_kernelname
|
||||
msg2 "Updating GRUB"
|
||||
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
fi
|
||||
|
||||
msg2 "Install successful"
|
||||
@@ -308,7 +320,7 @@ if [ "$1" = "install" ]; then
|
||||
fi
|
||||
|
||||
msg2 "Building kernel"
|
||||
_timed_build make ${llvm_opt} -j ${_thread_num}
|
||||
make ${llvm_opt} -j ${_thread_num}
|
||||
msg2 "Build successful"
|
||||
|
||||
if [ "$_STRIP" = "true" ]; then
|
||||
@@ -382,10 +394,6 @@ if [ "$1" = "install" ]; then
|
||||
|
||||
msg2 "Installing kernel"
|
||||
sudo make install
|
||||
msg2 "Creating initramfs"
|
||||
sudo dracut --force --hostonly ${_dracut_options} --kver $_kernelname
|
||||
msg2 "Updating GRUB"
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
if [ "$_distro" = "Gentoo" ]; then
|
||||
|
||||
@@ -403,6 +411,13 @@ if [ "$1" = "install" ]; then
|
||||
sudo emerge @module-rebuild --keep-going
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
msg2 "Creating initramfs"
|
||||
sudo dracut --force --hostonly ${_dracut_options} --kver $_kernelname
|
||||
msg2 "Updating GRUB"
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
@@ -426,7 +441,7 @@ if [ "$1" = "uninstall-help" ]; then
|
||||
msg2 "Note: linux-libc-dev packages are no longer created and installed, you can safely remove any remnants."
|
||||
elif [ "$_distro" = "Fedora" ]; then
|
||||
msg2 "List of installed custom tkg kernels: "
|
||||
dnf list --installed kernel*
|
||||
dnf list --installed | grep -i "tkg"
|
||||
msg2 "To uninstall a version, you should remove the kernel, kernel-headers and kernel-devel associated to it (if installed), with: "
|
||||
msg2 " sudo dnf remove --noautoremove kernel-VERSION kernel-devel-VERSION kernel-headers-VERSION"
|
||||
msg2 " where VERSION is displayed in the second column"
|
||||
|
@@ -1,15 +1,15 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/x86 5.15.61 Kernel Configuration
|
||||
# Linux/x86 5.15.131 Kernel Configuration
|
||||
#
|
||||
CONFIG_CC_VERSION_TEXT="gcc (TkG-mostlyportable) 12.1.1 20220515"
|
||||
CONFIG_CC_VERSION_TEXT="gcc (GCC) 13.2.1 20230801"
|
||||
CONFIG_CC_IS_GCC=y
|
||||
CONFIG_GCC_VERSION=120101
|
||||
CONFIG_GCC_VERSION=130201
|
||||
CONFIG_CLANG_VERSION=0
|
||||
CONFIG_AS_IS_GNU=y
|
||||
CONFIG_AS_VERSION=20244315
|
||||
CONFIG_AS_VERSION=24100
|
||||
CONFIG_LD_IS_BFD=y
|
||||
CONFIG_LD_VERSION=20244315
|
||||
CONFIG_LD_VERSION=24100
|
||||
CONFIG_LLD_VERSION=0
|
||||
CONFIG_CC_CAN_LINK=y
|
||||
CONFIG_CC_CAN_LINK_STATIC=y
|
||||
@@ -18,6 +18,7 @@ CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_INLINE=y
|
||||
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
|
||||
CONFIG_PAHOLE_VERSION=125
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_BUILDTIME_TABLE_SORT=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
@@ -437,7 +438,7 @@ CONFIG_I8K=m
|
||||
CONFIG_MICROCODE=y
|
||||
CONFIG_MICROCODE_INTEL=y
|
||||
CONFIG_MICROCODE_AMD=y
|
||||
# CONFIG_MICROCODE_OLD_INTERFACE is not set
|
||||
# CONFIG_MICROCODE_LATE_LOADING is not set
|
||||
CONFIG_X86_MSR=y
|
||||
CONFIG_X86_CPUID=y
|
||||
CONFIG_X86_5LEVEL=y
|
||||
@@ -519,7 +520,9 @@ CONFIG_RETHUNK=y
|
||||
CONFIG_CPU_UNRET_ENTRY=y
|
||||
CONFIG_CPU_IBPB_ENTRY=y
|
||||
CONFIG_CPU_IBRS_ENTRY=y
|
||||
CONFIG_CPU_SRSO=y
|
||||
CONFIG_SLS=y
|
||||
# CONFIG_GDS_FORCE_MITIGATION is not set
|
||||
CONFIG_ARCH_HAS_ADD_PAGES=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_USE_PERCPU_NUMA_NODE_ID=y
|
||||
@@ -755,6 +758,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
|
||||
CONFIG_ARCH_HAS_SET_MEMORY=y
|
||||
CONFIG_ARCH_HAS_SET_DIRECT_MAP=y
|
||||
CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y
|
||||
CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
|
||||
CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
@@ -1142,6 +1146,7 @@ CONFIG_INET_ESP=m
|
||||
CONFIG_INET_ESP_OFFLOAD=m
|
||||
CONFIG_INET_ESPINTCP=y
|
||||
CONFIG_INET_IPCOMP=m
|
||||
CONFIG_INET_TABLE_PERTURB_ORDER=16
|
||||
CONFIG_INET_XFRM_TUNNEL=m
|
||||
CONFIG_INET_TUNNEL=m
|
||||
CONFIG_INET_DIAG=m
|
||||
@@ -1625,7 +1630,6 @@ CONFIG_NET_DSA_TAG_XRS700X=m
|
||||
CONFIG_VLAN_8021Q=m
|
||||
CONFIG_VLAN_8021Q_GVRP=y
|
||||
CONFIG_VLAN_8021Q_MVRP=y
|
||||
# CONFIG_DECNET is not set
|
||||
CONFIG_LLC=m
|
||||
CONFIG_LLC2=m
|
||||
CONFIG_ATALK=m
|
||||
@@ -1707,7 +1711,6 @@ CONFIG_DEFAULT_NET_SCH="fq_codel"
|
||||
#
|
||||
CONFIG_NET_CLS=y
|
||||
CONFIG_NET_CLS_BASIC=m
|
||||
CONFIG_NET_CLS_TCINDEX=m
|
||||
CONFIG_NET_CLS_ROUTE4=m
|
||||
CONFIG_NET_CLS_FW=m
|
||||
CONFIG_NET_CLS_U32=m
|
||||
@@ -2489,7 +2492,6 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_DRBD=m
|
||||
# CONFIG_DRBD_FAULT_INJECTION is not set
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_SX8=m
|
||||
CONFIG_BLK_DEV_RAM=m
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=16384
|
||||
@@ -8387,9 +8389,10 @@ CONFIG_AMILO_RFKILL=m
|
||||
CONFIG_FUJITSU_LAPTOP=m
|
||||
CONFIG_FUJITSU_TABLET=m
|
||||
CONFIG_GPD_POCKET_FAN=m
|
||||
CONFIG_X86_PLATFORM_DRIVERS_HP=y
|
||||
CONFIG_HP_ACCEL=m
|
||||
CONFIG_WIRELESS_HOTKEY=m
|
||||
CONFIG_HP_WMI=m
|
||||
CONFIG_WIRELESS_HOTKEY=m
|
||||
CONFIG_IBM_RTL=m
|
||||
CONFIG_IDEAPAD_LAPTOP=m
|
||||
CONFIG_SENSORS_HDAPS=m
|
||||
@@ -8815,6 +8818,11 @@ CONFIG_VIPERBOARD_ADC=m
|
||||
CONFIG_XILINX_XADC=m
|
||||
# end of Analog to digital converters
|
||||
|
||||
#
|
||||
# Analog to digital and digital to analog converters
|
||||
#
|
||||
# end of Analog to digital and digital to analog converters
|
||||
|
||||
#
|
||||
# Analog Front Ends
|
||||
#
|
||||
@@ -9898,6 +9906,7 @@ CONFIG_GCC_PLUGIN_STRUCTLEAK=y
|
||||
# Memory initialization
|
||||
#
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
|
||||
# CONFIG_INIT_STACK_NONE is not set
|
||||
# CONFIG_GCC_PLUGIN_STRUCTLEAK_USER is not set
|
||||
@@ -10351,6 +10360,8 @@ CONFIG_SYMBOLIC_ERRNAME=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
# end of printk and dmesg options
|
||||
|
||||
CONFIG_AS_HAS_NON_CONST_LEB128=y
|
||||
|
||||
#
|
||||
# Compile-time checks and compiler options
|
||||
#
|
||||
@@ -10360,6 +10371,7 @@ CONFIG_DEBUG_INFO=y
|
||||
# CONFIG_DEBUG_INFO_SPLIT is not set
|
||||
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
|
||||
CONFIG_DEBUG_INFO_DWARF4=y
|
||||
# CONFIG_DEBUG_INFO_DWARF5 is not set
|
||||
CONFIG_DEBUG_INFO_BTF=y
|
||||
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
|
||||
CONFIG_DEBUG_INFO_BTF_MODULES=y
|
||||
|
@@ -1,24 +1,23 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/x86 6.0.0-rc1 Kernel Configuration
|
||||
# Linux/x86 6.0.5-arch1 Kernel Configuration
|
||||
#
|
||||
CONFIG_CC_VERSION_TEXT="gcc (TkG-mostlyportable) 12.1.1 20220515"
|
||||
CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0"
|
||||
CONFIG_CC_IS_GCC=y
|
||||
CONFIG_GCC_VERSION=120101
|
||||
CONFIG_GCC_VERSION=120200
|
||||
CONFIG_CLANG_VERSION=0
|
||||
CONFIG_AS_IS_GNU=y
|
||||
CONFIG_AS_VERSION=20244315
|
||||
CONFIG_AS_VERSION=23900
|
||||
CONFIG_LD_IS_BFD=y
|
||||
CONFIG_LD_VERSION=20244315
|
||||
CONFIG_LD_VERSION=23900
|
||||
CONFIG_LLD_VERSION=0
|
||||
CONFIG_CC_CAN_LINK=y
|
||||
CONFIG_CC_CAN_LINK_STATIC=y
|
||||
CONFIG_CC_HAS_ASM_GOTO=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_INLINE=y
|
||||
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
|
||||
CONFIG_PAHOLE_VERSION=123
|
||||
CONFIG_PAHOLE_VERSION=124
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_BUILDTIME_TABLE_SORT=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
@@ -829,6 +828,7 @@ CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
|
||||
CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
|
||||
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
|
||||
CONFIG_HAVE_EXIT_THREAD=y
|
||||
@@ -1136,7 +1136,7 @@ CONFIG_DAMON_PADDR=y
|
||||
CONFIG_DAMON_SYSFS=y
|
||||
CONFIG_DAMON_DBGFS=y
|
||||
CONFIG_DAMON_RECLAIM=y
|
||||
# CONFIG_DAMON_LRU_SORT is not set
|
||||
CONFIG_DAMON_LRU_SORT=y
|
||||
# end of Data Access Monitoring
|
||||
# end of Memory Management options
|
||||
|
||||
@@ -1364,7 +1364,7 @@ CONFIG_NFT_FIB_NETDEV=m
|
||||
CONFIG_NFT_REJECT_NETDEV=m
|
||||
CONFIG_NF_FLOW_TABLE_INET=m
|
||||
CONFIG_NF_FLOW_TABLE=m
|
||||
# CONFIG_NF_FLOW_TABLE_PROCFS is not set
|
||||
CONFIG_NF_FLOW_TABLE_PROCFS=y
|
||||
CONFIG_NETFILTER_XTABLES=m
|
||||
CONFIG_NETFILTER_XTABLES_COMPAT=y
|
||||
|
||||
@@ -1684,7 +1684,7 @@ CONFIG_NET_DSA_TAG_OCELOT_8021Q=m
|
||||
CONFIG_NET_DSA_TAG_QCA=m
|
||||
CONFIG_NET_DSA_TAG_RTL4_A=m
|
||||
CONFIG_NET_DSA_TAG_RTL8_4=m
|
||||
# CONFIG_NET_DSA_TAG_RZN1_A5PSW is not set
|
||||
CONFIG_NET_DSA_TAG_RZN1_A5PSW=m
|
||||
CONFIG_NET_DSA_TAG_LAN9303=m
|
||||
CONFIG_NET_DSA_TAG_SJA1105=m
|
||||
CONFIG_NET_DSA_TAG_TRAILER=m
|
||||
@@ -2522,7 +2522,7 @@ CONFIG_XEN_BLKDEV_FRONTEND=m
|
||||
CONFIG_XEN_BLKDEV_BACKEND=m
|
||||
CONFIG_VIRTIO_BLK=m
|
||||
CONFIG_BLK_DEV_RBD=m
|
||||
# CONFIG_BLK_DEV_UBLK is not set
|
||||
CONFIG_BLK_DEV_UBLK=m
|
||||
CONFIG_BLK_DEV_RNBD=y
|
||||
CONFIG_BLK_DEV_RNBD_CLIENT=m
|
||||
CONFIG_BLK_DEV_RNBD_SERVER=m
|
||||
@@ -2530,6 +2530,7 @@ CONFIG_BLK_DEV_RNBD_SERVER=m
|
||||
#
|
||||
# NVME Support
|
||||
#
|
||||
CONFIG_NVME_COMMON=m
|
||||
CONFIG_NVME_CORE=m
|
||||
CONFIG_BLK_DEV_NVME=m
|
||||
CONFIG_NVME_MULTIPATH=y
|
||||
@@ -2539,7 +2540,7 @@ CONFIG_NVME_FABRICS=m
|
||||
CONFIG_NVME_RDMA=m
|
||||
CONFIG_NVME_FC=m
|
||||
CONFIG_NVME_TCP=m
|
||||
# CONFIG_NVME_AUTH is not set
|
||||
CONFIG_NVME_AUTH=y
|
||||
CONFIG_NVME_TARGET=m
|
||||
CONFIG_NVME_TARGET_PASSTHRU=y
|
||||
CONFIG_NVME_TARGET_LOOP=m
|
||||
@@ -2547,7 +2548,7 @@ CONFIG_NVME_TARGET_RDMA=m
|
||||
CONFIG_NVME_TARGET_FC=m
|
||||
CONFIG_NVME_TARGET_FCLOOP=m
|
||||
CONFIG_NVME_TARGET_TCP=m
|
||||
# CONFIG_NVME_TARGET_AUTH is not set
|
||||
CONFIG_NVME_TARGET_AUTH=y
|
||||
# end of NVME Support
|
||||
|
||||
#
|
||||
@@ -2924,7 +2925,7 @@ CONFIG_DM_UEVENT=y
|
||||
CONFIG_DM_FLAKEY=m
|
||||
CONFIG_DM_VERITY=m
|
||||
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
|
||||
# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING is not set
|
||||
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING=y
|
||||
CONFIG_DM_VERITY_FEC=y
|
||||
CONFIG_DM_SWITCH=m
|
||||
CONFIG_DM_LOG_WRITES=m
|
||||
@@ -3046,7 +3047,7 @@ CONFIG_NET_DSA_MT7530=m
|
||||
CONFIG_NET_DSA_MV88E6060=m
|
||||
CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON=m
|
||||
CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C=m
|
||||
# CONFIG_NET_DSA_MICROCHIP_KSZ_SPI is not set
|
||||
CONFIG_NET_DSA_MICROCHIP_KSZ_SPI=m
|
||||
CONFIG_NET_DSA_MICROCHIP_KSZ8863_SMI=m
|
||||
CONFIG_NET_DSA_MV88E6XXX=m
|
||||
CONFIG_NET_DSA_MV88E6XXX_PTP=y
|
||||
@@ -3225,7 +3226,7 @@ CONFIG_ICE_HWTS=y
|
||||
CONFIG_FM10K=m
|
||||
CONFIG_IGC=m
|
||||
CONFIG_NET_VENDOR_WANGXUN=y
|
||||
# CONFIG_TXGBE is not set
|
||||
CONFIG_TXGBE=m
|
||||
CONFIG_JME=m
|
||||
CONFIG_NET_VENDOR_LITEX=y
|
||||
CONFIG_NET_VENDOR_MARVELL=y
|
||||
@@ -3485,7 +3486,7 @@ CONFIG_CAN_VXCAN=m
|
||||
CONFIG_CAN_NETLINK=y
|
||||
CONFIG_CAN_CALC_BITTIMING=y
|
||||
CONFIG_CAN_RX_OFFLOAD=y
|
||||
# CONFIG_CAN_CAN327 is not set
|
||||
CONFIG_CAN_CAN327=m
|
||||
CONFIG_CAN_JANZ_ICAN3=m
|
||||
CONFIG_CAN_KVASER_PCIEFD=m
|
||||
CONFIG_CAN_SLCAN=m
|
||||
@@ -3531,7 +3532,7 @@ CONFIG_CAN_MCP251XFD=m
|
||||
#
|
||||
CONFIG_CAN_8DEV_USB=m
|
||||
CONFIG_CAN_EMS_USB=m
|
||||
# CONFIG_CAN_ESD_USB is not set
|
||||
CONFIG_CAN_ESD_USB=m
|
||||
CONFIG_CAN_ETAS_ES58X=m
|
||||
CONFIG_CAN_GS_USB=m
|
||||
CONFIG_CAN_KVASER_USB=m
|
||||
@@ -3786,7 +3787,6 @@ CONFIG_IWLWIFI_DEBUGFS=y
|
||||
CONFIG_IWLWIFI_DEVICE_TRACING=y
|
||||
# end of Debugging Options
|
||||
|
||||
CONFIG_IWLMEI=m
|
||||
CONFIG_WLAN_VENDOR_INTERSIL=y
|
||||
CONFIG_HOSTAP=m
|
||||
CONFIG_HOSTAP_FIRMWARE=y
|
||||
@@ -4259,6 +4259,7 @@ CONFIG_TOUCHSCREEN_SX8654=m
|
||||
CONFIG_TOUCHSCREEN_TPS6507X=m
|
||||
CONFIG_TOUCHSCREEN_ZET6223=m
|
||||
CONFIG_TOUCHSCREEN_ZFORCE=m
|
||||
CONFIG_TOUCHSCREEN_COLIBRI_VF50=m
|
||||
CONFIG_TOUCHSCREEN_ROHM_BU21023=m
|
||||
CONFIG_TOUCHSCREEN_IQS5XX=m
|
||||
CONFIG_TOUCHSCREEN_ZINITIX=m
|
||||
@@ -4502,7 +4503,7 @@ CONFIG_TCG_TIS_CORE=m
|
||||
CONFIG_TCG_TIS=m
|
||||
CONFIG_TCG_TIS_SPI=m
|
||||
CONFIG_TCG_TIS_SPI_CR50=y
|
||||
# CONFIG_TCG_TIS_I2C is not set
|
||||
CONFIG_TCG_TIS_I2C=m
|
||||
CONFIG_TCG_TIS_I2C_CR50=m
|
||||
CONFIG_TCG_TIS_I2C_ATMEL=m
|
||||
CONFIG_TCG_TIS_I2C_INFINEON=m
|
||||
@@ -4660,7 +4661,7 @@ CONFIG_SPI_INTEL=m
|
||||
CONFIG_SPI_INTEL_PCI=m
|
||||
CONFIG_SPI_INTEL_PLATFORM=m
|
||||
CONFIG_SPI_LM70_LLP=m
|
||||
# CONFIG_SPI_MICROCHIP_CORE is not set
|
||||
CONFIG_SPI_MICROCHIP_CORE=m
|
||||
# CONFIG_SPI_LANTIQ_SSC is not set
|
||||
CONFIG_SPI_OC_TINY=m
|
||||
CONFIG_SPI_PXA2XX=m
|
||||
@@ -4757,7 +4758,7 @@ CONFIG_PINCTRL_ICELAKE=y
|
||||
CONFIG_PINCTRL_JASPERLAKE=y
|
||||
CONFIG_PINCTRL_LAKEFIELD=y
|
||||
CONFIG_PINCTRL_LEWISBURG=y
|
||||
# CONFIG_PINCTRL_METEORLAKE is not set
|
||||
CONFIG_PINCTRL_METEORLAKE=y
|
||||
CONFIG_PINCTRL_SUNRISEPOINT=y
|
||||
CONFIG_PINCTRL_TIGERLAKE=y
|
||||
# end of Intel pinctrl drivers
|
||||
@@ -5153,7 +5154,7 @@ CONFIG_SENSORS_IRPS5401=m
|
||||
CONFIG_SENSORS_ISL68137=m
|
||||
CONFIG_SENSORS_LM25066=m
|
||||
CONFIG_SENSORS_LM25066_REGULATOR=y
|
||||
# CONFIG_SENSORS_LT7182S is not set
|
||||
CONFIG_SENSORS_LT7182S=m
|
||||
CONFIG_SENSORS_LTC2978=m
|
||||
# CONFIG_SENSORS_LTC2978_REGULATOR is not set
|
||||
CONFIG_SENSORS_LTC3815=m
|
||||
@@ -6157,7 +6158,7 @@ CONFIG_VIDEO_IR_I2C=m
|
||||
#
|
||||
CONFIG_VIDEO_APTINA_PLL=m
|
||||
CONFIG_VIDEO_CCS_PLL=m
|
||||
# CONFIG_VIDEO_AR0521 is not set
|
||||
CONFIG_VIDEO_AR0521=m
|
||||
CONFIG_VIDEO_HI556=m
|
||||
CONFIG_VIDEO_HI846=m
|
||||
CONFIG_VIDEO_HI847=m
|
||||
@@ -6815,7 +6816,7 @@ CONFIG_SND_CTL_FAST_LOOKUP=y
|
||||
CONFIG_SND_DEBUG=y
|
||||
# CONFIG_SND_DEBUG_VERBOSE is not set
|
||||
# CONFIG_SND_PCM_XRUN_DEBUG is not set
|
||||
# CONFIG_SND_CTL_INPUT_VALIDATION is not set
|
||||
CONFIG_SND_CTL_INPUT_VALIDATION=y
|
||||
# CONFIG_SND_CTL_DEBUG is not set
|
||||
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
|
||||
CONFIG_SND_VMASTER=y
|
||||
@@ -7007,7 +7008,7 @@ CONFIG_SND_SOC_ADI_AXI_SPDIF=m
|
||||
CONFIG_SND_SOC_AMD_ACP=m
|
||||
CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH=m
|
||||
CONFIG_SND_SOC_AMD_CZ_RT5645_MACH=m
|
||||
# CONFIG_SND_SOC_AMD_ST_ES8336_MACH is not set
|
||||
CONFIG_SND_SOC_AMD_ST_ES8336_MACH=m
|
||||
CONFIG_SND_SOC_AMD_ACP3x=m
|
||||
CONFIG_SND_SOC_AMD_RV_RT5682_MACH=m
|
||||
CONFIG_SND_SOC_AMD_RENOIR=m
|
||||
@@ -7385,7 +7386,7 @@ CONFIG_SND_SOC_TAS2552=m
|
||||
CONFIG_SND_SOC_TAS2562=m
|
||||
CONFIG_SND_SOC_TAS2764=m
|
||||
CONFIG_SND_SOC_TAS2770=m
|
||||
# CONFIG_SND_SOC_TAS2780 is not set
|
||||
CONFIG_SND_SOC_TAS2780=m
|
||||
CONFIG_SND_SOC_TAS5086=m
|
||||
CONFIG_SND_SOC_TAS571X=m
|
||||
CONFIG_SND_SOC_TAS5720=m
|
||||
@@ -7444,7 +7445,7 @@ CONFIG_SND_SOC_WM8974=m
|
||||
CONFIG_SND_SOC_WM8978=m
|
||||
CONFIG_SND_SOC_WM8985=m
|
||||
CONFIG_SND_SOC_WSA881X=m
|
||||
# CONFIG_SND_SOC_WSA883X is not set
|
||||
CONFIG_SND_SOC_WSA883X=m
|
||||
CONFIG_SND_SOC_ZL38060=m
|
||||
CONFIG_SND_SOC_MAX9759=m
|
||||
CONFIG_SND_SOC_MT6351=m
|
||||
@@ -7595,6 +7596,7 @@ CONFIG_HID_SMARTJOYPLUS=m
|
||||
CONFIG_SMARTJOYPLUS_FF=y
|
||||
CONFIG_HID_TIVO=m
|
||||
CONFIG_HID_TOPSEED=m
|
||||
CONFIG_HID_TOPRE=m
|
||||
CONFIG_HID_THINGM=m
|
||||
CONFIG_HID_THRUSTMASTER=m
|
||||
CONFIG_THRUSTMASTER_FF=y
|
||||
@@ -8038,9 +8040,9 @@ CONFIG_TYPEC_WCOVE=m
|
||||
CONFIG_TYPEC_UCSI=m
|
||||
CONFIG_UCSI_CCG=m
|
||||
CONFIG_UCSI_ACPI=m
|
||||
# CONFIG_UCSI_STM32G0 is not set
|
||||
CONFIG_UCSI_STM32G0=m
|
||||
CONFIG_TYPEC_TPS6598X=m
|
||||
# CONFIG_TYPEC_ANX7411 is not set
|
||||
CONFIG_TYPEC_ANX7411=m
|
||||
CONFIG_TYPEC_RT1719=m
|
||||
CONFIG_TYPEC_HD3SS3220=m
|
||||
CONFIG_TYPEC_STUSB160X=m
|
||||
@@ -8169,7 +8171,7 @@ CONFIG_LEDS_TLC591XX=m
|
||||
CONFIG_LEDS_MAX8997=m
|
||||
CONFIG_LEDS_LM355x=m
|
||||
CONFIG_LEDS_MENF21BMC=m
|
||||
# CONFIG_LEDS_IS31FL319X is not set
|
||||
CONFIG_LEDS_IS31FL319X=m
|
||||
|
||||
#
|
||||
# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
|
||||
@@ -8257,7 +8259,7 @@ CONFIG_INFINIBAND_VIRT_DMA=y
|
||||
CONFIG_INFINIBAND_BNXT_RE=m
|
||||
CONFIG_INFINIBAND_CXGB4=m
|
||||
CONFIG_INFINIBAND_EFA=m
|
||||
# CONFIG_INFINIBAND_ERDMA is not set
|
||||
CONFIG_INFINIBAND_ERDMA=m
|
||||
CONFIG_INFINIBAND_HFI1=m
|
||||
# CONFIG_HFI1_DEBUG_SDMA_ORDER is not set
|
||||
# CONFIG_SDMA_VERBOSITY is not set
|
||||
@@ -8715,7 +8717,7 @@ CONFIG_DVB_AV7110_OSD=y
|
||||
CONFIG_DVB_BUDGET_PATCH=m
|
||||
CONFIG_DVB_SP8870=m
|
||||
CONFIG_VIDEO_IPU3_IMGU=m
|
||||
# CONFIG_VIDEO_STKWEBCAM is not set
|
||||
CONFIG_VIDEO_STKWEBCAM=m
|
||||
# CONFIG_VIDEO_ZORAN is not set
|
||||
CONFIG_LTE_GDM724X=m
|
||||
CONFIG_FIREWIRE_SERIAL=m
|
||||
@@ -8766,9 +8768,9 @@ CONFIG_SURFACE3_WMI=m
|
||||
CONFIG_SURFACE_3_POWER_OPREGION=m
|
||||
CONFIG_SURFACE_ACPI_NOTIFY=m
|
||||
CONFIG_SURFACE_AGGREGATOR_CDEV=m
|
||||
# CONFIG_SURFACE_AGGREGATOR_HUB is not set
|
||||
CONFIG_SURFACE_AGGREGATOR_HUB=m
|
||||
CONFIG_SURFACE_AGGREGATOR_REGISTRY=m
|
||||
# CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH is not set
|
||||
CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH=m
|
||||
CONFIG_SURFACE_DTX=m
|
||||
CONFIG_SURFACE_GPE=m
|
||||
CONFIG_SURFACE_HOTPLUG=m
|
||||
@@ -9190,7 +9192,7 @@ CONFIG_AXP288_ADC=m
|
||||
CONFIG_CC10001_ADC=m
|
||||
CONFIG_DA9150_GPADC=m
|
||||
CONFIG_DLN2_ADC=m
|
||||
# CONFIG_ENVELOPE_DETECTOR is not set
|
||||
CONFIG_ENVELOPE_DETECTOR=m
|
||||
CONFIG_HI8435=m
|
||||
CONFIG_HX711=m
|
||||
CONFIG_INA2XX_ADC=m
|
||||
@@ -9214,7 +9216,7 @@ CONFIG_MEN_Z188_ADC=m
|
||||
CONFIG_MP2629_ADC=m
|
||||
CONFIG_NAU7802=m
|
||||
CONFIG_PALMAS_GPADC=m
|
||||
# CONFIG_SD_ADC_MODULATOR is not set
|
||||
CONFIG_SD_ADC_MODULATOR=m
|
||||
CONFIG_TI_ADC081C=m
|
||||
CONFIG_TI_ADC0832=m
|
||||
CONFIG_TI_ADC084S021=m
|
||||
@@ -9233,7 +9235,7 @@ CONFIG_TI_TLC4541=m
|
||||
CONFIG_TI_TSC2046=m
|
||||
CONFIG_TWL4030_MADC=m
|
||||
CONFIG_TWL6030_GPADC=m
|
||||
# CONFIG_VF610_ADC is not set
|
||||
CONFIG_VF610_ADC=m
|
||||
CONFIG_VIPERBOARD_ADC=m
|
||||
CONFIG_XILINX_XADC=m
|
||||
# end of Analog to digital converters
|
||||
@@ -9712,7 +9714,7 @@ CONFIG_NTB_TRANSPORT=m
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
# CONFIG_PWM_DEBUG is not set
|
||||
# CONFIG_PWM_CLK is not set
|
||||
CONFIG_PWM_CLK=m
|
||||
CONFIG_PWM_CRC=y
|
||||
CONFIG_PWM_CROS_EC=m
|
||||
CONFIG_PWM_DWC=m
|
||||
@@ -9736,7 +9738,7 @@ CONFIG_BOARD_TPCI200=m
|
||||
CONFIG_SERIAL_IPOCTAL=m
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_RESET_TI_SYSCON=m
|
||||
# CONFIG_RESET_TI_TPS380X is not set
|
||||
CONFIG_RESET_TI_TPS380X=m
|
||||
|
||||
#
|
||||
# PHY Subsystem
|
||||
@@ -9844,8 +9846,8 @@ CONFIG_FPGA_DFL_FME_REGION=m
|
||||
CONFIG_FPGA_DFL_AFU=m
|
||||
CONFIG_FPGA_DFL_NIOS_INTEL_PAC_N3000=m
|
||||
CONFIG_FPGA_DFL_PCI=m
|
||||
# CONFIG_FPGA_M10_BMC_SEC_UPDATE is not set
|
||||
# CONFIG_FPGA_MGR_MICROCHIP_SPI is not set
|
||||
CONFIG_FPGA_M10_BMC_SEC_UPDATE=m
|
||||
CONFIG_FPGA_MGR_MICROCHIP_SPI=m
|
||||
CONFIG_TEE=m
|
||||
CONFIG_AMDTEE=m
|
||||
CONFIG_MULTIPLEXER=m
|
||||
@@ -10373,6 +10375,7 @@ CONFIG_LSM="landlock,lockdown,yama,integrity,bpf"
|
||||
# Memory initialization
|
||||
#
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
|
||||
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
|
||||
# CONFIG_INIT_STACK_NONE is not set
|
||||
# CONFIG_INIT_STACK_ALL_PATTERN is not set
|
||||
@@ -10467,13 +10470,14 @@ CONFIG_CRYPTO_ECB=m
|
||||
CONFIG_CRYPTO_LRW=m
|
||||
CONFIG_CRYPTO_OFB=m
|
||||
CONFIG_CRYPTO_PCBC=m
|
||||
CONFIG_CRYPTO_XCTR=m
|
||||
CONFIG_CRYPTO_XTS=m
|
||||
CONFIG_CRYPTO_KEYWRAP=m
|
||||
CONFIG_CRYPTO_NHPOLY1305=m
|
||||
CONFIG_CRYPTO_NHPOLY1305_SSE2=m
|
||||
CONFIG_CRYPTO_NHPOLY1305_AVX2=m
|
||||
CONFIG_CRYPTO_ADIANTUM=m
|
||||
# CONFIG_CRYPTO_HCTR2 is not set
|
||||
CONFIG_CRYPTO_HCTR2=m
|
||||
CONFIG_CRYPTO_ESSIV=m
|
||||
|
||||
#
|
||||
@@ -10498,7 +10502,8 @@ CONFIG_CRYPTO_CRCT10DIF=y
|
||||
CONFIG_CRYPTO_CRCT10DIF_PCLMUL=m
|
||||
CONFIG_CRYPTO_CRC64_ROCKSOFT=y
|
||||
CONFIG_CRYPTO_GHASH=m
|
||||
# CONFIG_CRYPTO_POLYVAL_CLMUL_NI is not set
|
||||
CONFIG_CRYPTO_POLYVAL=m
|
||||
CONFIG_CRYPTO_POLYVAL_CLMUL_NI=m
|
||||
CONFIG_CRYPTO_POLY1305=m
|
||||
CONFIG_CRYPTO_POLY1305_X86_64=m
|
||||
CONFIG_CRYPTO_MD4=m
|
||||
@@ -10542,7 +10547,7 @@ CONFIG_CRYPTO_DES3_EDE_X86_64=m
|
||||
CONFIG_CRYPTO_FCRYPT=m
|
||||
CONFIG_CRYPTO_CHACHA20=m
|
||||
CONFIG_CRYPTO_CHACHA20_X86_64=m
|
||||
# CONFIG_CRYPTO_ARIA is not set
|
||||
CONFIG_CRYPTO_ARIA=m
|
||||
CONFIG_CRYPTO_SERPENT=m
|
||||
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
|
||||
CONFIG_CRYPTO_SERPENT_AVX_X86_64=m
|
||||
@@ -10846,6 +10851,7 @@ CONFIG_DEBUG_KERNEL=y
|
||||
# Compile-time checks and compiler options
|
||||
#
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_AS_HAS_NON_CONST_LEB128=y
|
||||
# CONFIG_DEBUG_INFO_NONE is not set
|
||||
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
|
||||
# CONFIG_DEBUG_INFO_DWARF4 is not set
|
||||
@@ -10914,7 +10920,7 @@ CONFIG_GENERIC_PTDUMP=y
|
||||
CONFIG_PTDUMP_CORE=y
|
||||
# CONFIG_PTDUMP_DEBUGFS is not set
|
||||
# CONFIG_DEBUG_OBJECTS is not set
|
||||
# CONFIG_SHRINKER_DEBUG is not set
|
||||
CONFIG_SHRINKER_DEBUG=y
|
||||
CONFIG_HAVE_DEBUG_KMEMLEAK=y
|
||||
# CONFIG_DEBUG_KMEMLEAK is not set
|
||||
# CONFIG_DEBUG_STACK_USAGE is not set
|
||||
|
14
linux-tkg-config/6.1/90-cleanup.hook
Normal file
14
linux-tkg-config/6.1/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.1/cleanup
Executable file
10
linux-tkg-config/6.1/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11267
linux-tkg-config/6.1/config.x86_64
Normal file
11267
linux-tkg-config/6.1/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
14
linux-tkg-config/6.2/90-cleanup.hook
Normal file
14
linux-tkg-config/6.2/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.2/cleanup
Executable file
10
linux-tkg-config/6.2/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11348
linux-tkg-config/6.2/config.x86_64
Normal file
11348
linux-tkg-config/6.2/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
14
linux-tkg-config/6.3/90-cleanup.hook
Normal file
14
linux-tkg-config/6.3/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.3/cleanup
Executable file
10
linux-tkg-config/6.3/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11430
linux-tkg-config/6.3/config.x86_64
Normal file
11430
linux-tkg-config/6.3/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
14
linux-tkg-config/6.4/90-cleanup.hook
Normal file
14
linux-tkg-config/6.4/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.4/cleanup
Executable file
10
linux-tkg-config/6.4/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11463
linux-tkg-config/6.4/config.x86_64
Normal file
11463
linux-tkg-config/6.4/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
14
linux-tkg-config/6.5/90-cleanup.hook
Normal file
14
linux-tkg-config/6.5/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.5/cleanup
Executable file
10
linux-tkg-config/6.5/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11543
linux-tkg-config/6.5/config.x86_64
Normal file
11543
linux-tkg-config/6.5/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
676
linux-tkg-config/6.5/minimal-modprobed.db
Normal file
676
linux-tkg-config/6.5/minimal-modprobed.db
Normal file
@@ -0,0 +1,676 @@
|
||||
8021q
|
||||
8250_dw
|
||||
842
|
||||
842_compress
|
||||
842_decompress
|
||||
9p
|
||||
9pnet
|
||||
9pnet_virtio
|
||||
ac97_bus
|
||||
acer_wireless
|
||||
acer_wmi
|
||||
acpi_cpufreq
|
||||
acpi_mdio
|
||||
acpi_pad
|
||||
acpi_tad
|
||||
acpi_thermal_rel
|
||||
aesni_intel
|
||||
af_alg
|
||||
af_key
|
||||
af_packet
|
||||
agpgart
|
||||
ahci
|
||||
algif_aead
|
||||
algif_hash
|
||||
algif_skcipher
|
||||
alx
|
||||
amd64_edac
|
||||
amd_pmc
|
||||
amd_pstate
|
||||
amdgpu
|
||||
amdxcp
|
||||
apple_mfi_fastcharge
|
||||
appletalk
|
||||
asn1_encoder
|
||||
asus_atk0110
|
||||
asus_nb_wmi
|
||||
asus_wmi
|
||||
ata_generic
|
||||
ata_piix
|
||||
ath
|
||||
ath9k_common
|
||||
ath9k_htc
|
||||
ath9k_hw
|
||||
atkbd
|
||||
atl1c
|
||||
auth_rpcgss
|
||||
autofs4
|
||||
battery
|
||||
bch
|
||||
binder
|
||||
binfmt_misc
|
||||
blake2b_generic
|
||||
bluetooth
|
||||
bnep
|
||||
bpf
|
||||
bpf_preload
|
||||
br_netfilter
|
||||
bridge
|
||||
btbcm
|
||||
btcoexist
|
||||
btintel
|
||||
btmtk
|
||||
btrfs
|
||||
btrtl
|
||||
btusb
|
||||
button
|
||||
cbc
|
||||
ccm
|
||||
ccp
|
||||
cdc_acm
|
||||
cdc_ether
|
||||
cdc_mbim
|
||||
cdc_ncm
|
||||
cdc_wdm
|
||||
cdrom
|
||||
cec
|
||||
cfbcopyarea
|
||||
cfbfillrect
|
||||
cfbimgblt
|
||||
cfg80211
|
||||
cgroup
|
||||
ch341
|
||||
chacha_x86_64
|
||||
chipreg
|
||||
cifs
|
||||
cifs_arc4
|
||||
cifs_md4
|
||||
cls_cgroup
|
||||
cmac
|
||||
cmdlinepart
|
||||
coretemp
|
||||
cpufreq_ondemand
|
||||
crc16
|
||||
crc32_generic
|
||||
crc32_pclmul
|
||||
crc32c_generic
|
||||
crc32c_intel
|
||||
crc64
|
||||
crc64_rocksoft
|
||||
crc64_rocksoft_generic
|
||||
crc_itu_t
|
||||
crct10dif_pclmul
|
||||
cryptd
|
||||
crypto_null
|
||||
crypto_simd
|
||||
crypto_user
|
||||
curve25519_x86_64
|
||||
cuse
|
||||
dca
|
||||
des_generic
|
||||
dm_crypt
|
||||
dm_log
|
||||
dm_mirror
|
||||
dm_mod
|
||||
dm_multipath
|
||||
dm_region_hash
|
||||
dm_round_robin
|
||||
dmi_sysfs
|
||||
dns_resolver
|
||||
drm
|
||||
drm_buddy
|
||||
drm_display_helper
|
||||
drm_kms_helper
|
||||
drm_panel_orientation_quirks
|
||||
drm_suballoc_helper
|
||||
drm_ttm_helper
|
||||
dvb_core
|
||||
ebtable_filter
|
||||
ebtables
|
||||
ec_sys
|
||||
ecb
|
||||
ecc
|
||||
ecdh_generic
|
||||
edac_mce_amd
|
||||
ee1004
|
||||
eeepc_wmi
|
||||
eeprom
|
||||
efi_pstore
|
||||
efivarfs
|
||||
ehci_hcd
|
||||
ehci_pci
|
||||
enclosure
|
||||
encrypted_keys
|
||||
evdev
|
||||
exfat
|
||||
ext2
|
||||
ext4
|
||||
f2fs
|
||||
fan
|
||||
fat
|
||||
fb_sys_fops
|
||||
ff_memless
|
||||
fixed_phy
|
||||
fjes
|
||||
fscache
|
||||
ftdi_sio
|
||||
fuse
|
||||
fwnode_mdio
|
||||
garp
|
||||
gcm
|
||||
gf128mul
|
||||
ghash_clmulni_intel
|
||||
ghash_generic
|
||||
gigabyte_wmi
|
||||
gpio_amdpt
|
||||
gpio_generic
|
||||
gpu_sched
|
||||
grace
|
||||
hfs
|
||||
hfsplus
|
||||
hid
|
||||
hid_apple
|
||||
hid_asus
|
||||
hid_generic
|
||||
hid_hyperv
|
||||
hid_logitech_dj
|
||||
hid_logitech_hidpp
|
||||
hid_microsoft
|
||||
hid_multitouch
|
||||
hid_nintendo
|
||||
hid_playstation
|
||||
hid_roccat
|
||||
hid_roccat_common
|
||||
hid_roccat_koneplus
|
||||
hid_roccat_ryos
|
||||
hid_sony
|
||||
hid_steam
|
||||
hid_wiimote
|
||||
hidp
|
||||
hp_wmi
|
||||
hv_balloon
|
||||
hv_netvsc
|
||||
hv_storvsc
|
||||
hv_utils
|
||||
hv_vmbus
|
||||
hwmon_vid
|
||||
hyperv_drm
|
||||
hyperv_keyboard
|
||||
i2c_algo_bit
|
||||
i2c_core
|
||||
i2c_dev
|
||||
i2c_hid
|
||||
i2c_hid_acpi
|
||||
i2c_i801
|
||||
i2c_mux
|
||||
i2c_nvidia_gpu
|
||||
i2c_piix4
|
||||
i2c_smbus
|
||||
i8042
|
||||
i915
|
||||
iTCO_vendor_support
|
||||
iTCO_wdt
|
||||
ib_cm
|
||||
ib_core
|
||||
idma64
|
||||
igb
|
||||
igc
|
||||
inet_diag
|
||||
input_leds
|
||||
int3400_thermal
|
||||
int3403_thermal
|
||||
int340x_thermal_zone
|
||||
intel_agp
|
||||
intel_cstate
|
||||
intel_gtt
|
||||
intel_hid
|
||||
intel_lpss
|
||||
intel_lpss_pci
|
||||
intel_pch_thermal
|
||||
intel_pmc_bxt
|
||||
intel_powerclamp
|
||||
intel_rapl_common
|
||||
intel_rapl_msr
|
||||
intel_soc_dts_iosf
|
||||
intel_tcc_cooling
|
||||
intel_uncore
|
||||
intel_vsec
|
||||
intel_wmi_thunderbolt
|
||||
iommu_v2
|
||||
iommufd
|
||||
ip6_tables
|
||||
ip6_udp_tunnel
|
||||
ip6t_REJECT
|
||||
ip6t_rt
|
||||
ip6table_filter
|
||||
ip6table_mangle
|
||||
ip6table_nat
|
||||
ip6table_raw
|
||||
ip6table_security
|
||||
ip_set
|
||||
ip_tables
|
||||
ipmi_devintf
|
||||
ipmi_msghandler
|
||||
ipt_REJECT
|
||||
iptable_filter
|
||||
iptable_mangle
|
||||
iptable_nat
|
||||
iptable_raw
|
||||
iptable_security
|
||||
ipv6
|
||||
ir_kbd_i2c
|
||||
irqbypass
|
||||
isofs
|
||||
it87
|
||||
iw_cm
|
||||
iwlmei
|
||||
iwlmvm
|
||||
iwlwifi
|
||||
jbd2
|
||||
jc42
|
||||
jfs
|
||||
joydev
|
||||
k10temp
|
||||
ksmbd
|
||||
kvm
|
||||
kvm_amd
|
||||
kvm_intel
|
||||
led_class_multicolor
|
||||
ledtrig_audio
|
||||
ledtrig_timer
|
||||
libahci
|
||||
libarc4
|
||||
libata
|
||||
libchacha
|
||||
libchacha20poly1305
|
||||
libcrc32c
|
||||
libcurve25519_generic
|
||||
libdes
|
||||
libphy
|
||||
libps2
|
||||
llc
|
||||
lm75
|
||||
lm83
|
||||
lockd
|
||||
loop
|
||||
lpc_ich
|
||||
lz4
|
||||
lz4_compress
|
||||
lz4hc_compress
|
||||
lzo
|
||||
lzo_rle
|
||||
mac80211
|
||||
mac_hid
|
||||
mbcache
|
||||
mc
|
||||
mc44s803
|
||||
md4
|
||||
md_mod
|
||||
mdio
|
||||
mdio_devres
|
||||
mei
|
||||
mei_gsc
|
||||
mei_hdcp
|
||||
mei_me
|
||||
mei_pxp
|
||||
mii
|
||||
minix
|
||||
mmc_core
|
||||
mousedev
|
||||
mptcp_diag
|
||||
mrp
|
||||
msdos
|
||||
msr
|
||||
mt20xx
|
||||
mt76
|
||||
mt76_connac_lib
|
||||
mt76_usb
|
||||
mt76x02_lib
|
||||
mt76x02_usb
|
||||
mt76x2_common
|
||||
mt76x2u
|
||||
mt7921_common
|
||||
mt7921e
|
||||
mtd
|
||||
mxm_wmi
|
||||
nandcore
|
||||
nbd
|
||||
nct6683
|
||||
nct6775
|
||||
nct6775_core
|
||||
netfs
|
||||
nf_conntrack
|
||||
nf_conntrack_broadcast
|
||||
nf_conntrack_ftp
|
||||
nf_conntrack_h323
|
||||
nf_conntrack_irc
|
||||
nf_conntrack_netbios_ns
|
||||
nf_conntrack_netlink
|
||||
nf_conntrack_pptp
|
||||
nf_conntrack_sip
|
||||
nf_conntrack_tftp
|
||||
nf_defrag_ipv4
|
||||
nf_defrag_ipv6
|
||||
nf_nat
|
||||
nf_nat_ftp
|
||||
nf_nat_h323
|
||||
nf_nat_irc
|
||||
nf_nat_pptp
|
||||
nf_nat_sip
|
||||
nf_nat_tftp
|
||||
nf_reject_ipv4
|
||||
nf_reject_ipv6
|
||||
nf_tables
|
||||
nfnetlink
|
||||
nfnetlink_log
|
||||
nfnetlink_queue
|
||||
nfs
|
||||
nfsv4
|
||||
nft_chain_nat
|
||||
nft_compat
|
||||
nft_ct
|
||||
nft_fib
|
||||
nft_fib_inet
|
||||
nft_fib_ipv4
|
||||
nft_fib_ipv6
|
||||
nft_masq
|
||||
nft_nat
|
||||
nft_reject
|
||||
nft_reject_inet
|
||||
nft_reject_ipv4
|
||||
nft_reject_ipv6
|
||||
nft_xfrm
|
||||
nilfs2
|
||||
nlmon
|
||||
nls_ascii
|
||||
nls_cp437
|
||||
nls_iso8859_1
|
||||
nls_utf8
|
||||
nouveau
|
||||
ntfs
|
||||
ntfs3
|
||||
nvidia_wmi_ec_backlight
|
||||
nvme
|
||||
nvme_common
|
||||
nvme_core
|
||||
nvmem_rave_sp_eeprom
|
||||
nvram
|
||||
overlay
|
||||
p8022
|
||||
parport
|
||||
parport_pc
|
||||
pata_acpi
|
||||
pcc_cpufreq
|
||||
pcspkr
|
||||
pinctrl_alderlake
|
||||
pinctrl_amd
|
||||
pkcs8_key_parser
|
||||
pktcdvd
|
||||
platform_profile
|
||||
pmt_class
|
||||
pmt_telemetry
|
||||
poly1305_x86_64
|
||||
polyval_clmulni
|
||||
polyval_generic
|
||||
ppdev
|
||||
processor_thermal_device
|
||||
processor_thermal_device_pci_legacy
|
||||
processor_thermal_mbox
|
||||
processor_thermal_rapl
|
||||
processor_thermal_rfim
|
||||
psmouse
|
||||
psnap
|
||||
qcserial
|
||||
qrtr
|
||||
r8152
|
||||
r8153_ecm
|
||||
r8169
|
||||
radeon
|
||||
raid1
|
||||
raid6_pq
|
||||
rapl
|
||||
rave_sp
|
||||
raw_diag
|
||||
rc_core
|
||||
realtek
|
||||
rfcomm
|
||||
rfkill
|
||||
rndis_host
|
||||
rndis_wlan
|
||||
rng_core
|
||||
roles
|
||||
rpcsec_gss_krb5
|
||||
rt2800lib
|
||||
rt2800usb
|
||||
rt2x00lib
|
||||
rt2x00usb
|
||||
rtl8192ee
|
||||
rtl8723_common
|
||||
rtl8723ae
|
||||
rtl8723be
|
||||
rtl8821ae
|
||||
rtl_pci
|
||||
rtlwifi
|
||||
rtsx_pci
|
||||
rtsx_pci_sdmmc
|
||||
rtw88_8821c
|
||||
rtw88_8821ce
|
||||
rtw88_core
|
||||
rtw88_pci
|
||||
sch_cake
|
||||
sch_fq_codel
|
||||
sch_ingress
|
||||
scsi_common
|
||||
scsi_mod
|
||||
scsi_transport_fc
|
||||
scsi_transport_sas
|
||||
sd_mod
|
||||
selftests
|
||||
serial_multi_instantiate
|
||||
serio
|
||||
serio_raw
|
||||
ses
|
||||
sg
|
||||
sha512_ssse3
|
||||
snd
|
||||
snd_acp3x_pdm_dma
|
||||
snd_acp3x_rn
|
||||
snd_acp6x_pdm_dma
|
||||
snd_acp_config
|
||||
snd_acp_pci
|
||||
snd_aloop
|
||||
snd_compress
|
||||
snd_ctl_led
|
||||
snd_hda_codec
|
||||
snd_hda_codec_generic
|
||||
snd_hda_codec_hdmi
|
||||
snd_hda_codec_realtek
|
||||
snd_hda_core
|
||||
snd_hda_ext_core
|
||||
snd_hda_intel
|
||||
snd_hrtimer
|
||||
snd_hwdep
|
||||
snd_intel_dspcfg
|
||||
snd_intel_sdw_acpi
|
||||
snd_pci_acp3x
|
||||
snd_pci_acp5x
|
||||
snd_pci_acp6x
|
||||
snd_pci_ps
|
||||
snd_pcm
|
||||
snd_pcm_dmaengine
|
||||
snd_rawmidi
|
||||
snd_rn_pci_acp3x
|
||||
snd_rpl_pci_acp6x
|
||||
snd_seq
|
||||
snd_seq_device
|
||||
snd_seq_dummy
|
||||
snd_seq_midi
|
||||
snd_seq_midi_event
|
||||
snd_seq_oss
|
||||
snd_seq_virmidi
|
||||
snd_soc_acp6x_mach
|
||||
snd_soc_acpi
|
||||
snd_soc_acpi_intel_match
|
||||
snd_soc_core
|
||||
snd_soc_dmic
|
||||
snd_soc_hdac_hda
|
||||
snd_soc_skl
|
||||
snd_soc_sst_dsp
|
||||
snd_soc_sst_ipc
|
||||
snd_sof
|
||||
snd_sof_amd_acp
|
||||
snd_sof_amd_rembrandt
|
||||
snd_sof_amd_renoir
|
||||
snd_sof_intel_hda
|
||||
snd_sof_intel_hda_common
|
||||
snd_sof_intel_hda_mlink
|
||||
snd_sof_pci
|
||||
snd_sof_pci_intel_cnl
|
||||
snd_sof_pci_intel_tgl
|
||||
snd_sof_probes
|
||||
snd_sof_utils
|
||||
snd_sof_xtensa_dsp
|
||||
snd_timer
|
||||
snd_ua101
|
||||
snd_ump
|
||||
snd_usb_audio
|
||||
snd_usb_us122l
|
||||
snd_usb_usx2y
|
||||
snd_usbmidi_lib
|
||||
snd_virmidi
|
||||
soundcore
|
||||
soundwire_bus
|
||||
soundwire_cadence
|
||||
soundwire_generic_allocation
|
||||
soundwire_intel
|
||||
sp5100_tco
|
||||
sparse_keymap
|
||||
spi_intel
|
||||
spi_intel_pci
|
||||
spi_nor
|
||||
squashfs
|
||||
sr_mod
|
||||
st
|
||||
stp
|
||||
sunrpc
|
||||
syscopyarea
|
||||
sysfillrect
|
||||
sysimgblt
|
||||
t10_pi
|
||||
tap
|
||||
tcp_bbr
|
||||
tcp_diag
|
||||
tda18271
|
||||
tda827x
|
||||
tda8290
|
||||
tda9887
|
||||
tea5761
|
||||
tea5767
|
||||
tee
|
||||
tg3
|
||||
thermal
|
||||
thunderbolt
|
||||
tiny_power_button
|
||||
tls
|
||||
tpm
|
||||
tpm_crb
|
||||
tpm_tis
|
||||
tpm_tis_core
|
||||
trusted
|
||||
ttm
|
||||
tun
|
||||
tuner_simple
|
||||
tuner_types
|
||||
tunnel4
|
||||
tunnel6
|
||||
typec
|
||||
typec_ucsi
|
||||
uas
|
||||
ucsi_acpi
|
||||
ucsi_ccg
|
||||
udf
|
||||
udp_diag
|
||||
udp_tunnel
|
||||
ufs
|
||||
uhci_hcd
|
||||
uhid
|
||||
uinput
|
||||
uio
|
||||
uio_pdrv_genirq
|
||||
unix_diag
|
||||
usb_common
|
||||
usb_storage
|
||||
usb_wwan
|
||||
usbcore
|
||||
usbhid
|
||||
usbip_core
|
||||
usbip_host
|
||||
usbmon
|
||||
usbnet
|
||||
uvc
|
||||
uvcvideo
|
||||
uvesafb
|
||||
v4l2_dv_timings
|
||||
veth
|
||||
vfat
|
||||
vfio
|
||||
vfio_iommu_type1
|
||||
vfio_pci
|
||||
vfio_pci_core
|
||||
vhost
|
||||
vhost_iotlb
|
||||
vhost_net
|
||||
video
|
||||
videobuf2_common
|
||||
videobuf2_memops
|
||||
videobuf2_v4l2
|
||||
videobuf2_vmalloc
|
||||
videodev
|
||||
virtio_pci
|
||||
virtio_pci_legacy_dev
|
||||
virtio_pci_modern_dev
|
||||
virtio_scsi
|
||||
vivaldi_fmap
|
||||
vmw_vmci
|
||||
vmw_vsock_virtio_transport_common
|
||||
vmw_vsock_vmci_transport
|
||||
vsock
|
||||
vsock_loopback
|
||||
wacom
|
||||
watchdog
|
||||
wireguard
|
||||
wireless_hotkey
|
||||
wmi
|
||||
wmi_bmof
|
||||
x86_pkg_temp_thermal
|
||||
x_tables
|
||||
xc2028
|
||||
xc4000
|
||||
xc5000
|
||||
xfrm6_tunnel
|
||||
xfrm_interface
|
||||
xfs
|
||||
xhci_hcd
|
||||
xhci_pci
|
||||
xhci_pci_renesas
|
||||
xor
|
||||
xpad
|
||||
xt_CHECKSUM
|
||||
xt_LOG
|
||||
xt_MASQUERADE
|
||||
xt_NFQUEUE
|
||||
xt_REDIRECT
|
||||
xt_addrtype
|
||||
xt_cgroup
|
||||
xt_comment
|
||||
xt_conntrack
|
||||
xt_hl
|
||||
xt_limit
|
||||
xt_mark
|
||||
xt_nat
|
||||
xt_recent
|
||||
xt_state
|
||||
xt_tcpudp
|
||||
xxhash_generic
|
||||
zlib_deflate
|
||||
zram
|
14
linux-tkg-config/6.6/90-cleanup.hook
Normal file
14
linux-tkg-config/6.6/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.6/cleanup
Executable file
10
linux-tkg-config/6.6/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11623
linux-tkg-config/6.6/config.x86_64
Normal file
11623
linux-tkg-config/6.6/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
676
linux-tkg-config/6.6/minimal-modprobed.db
Normal file
676
linux-tkg-config/6.6/minimal-modprobed.db
Normal file
@@ -0,0 +1,676 @@
|
||||
8021q
|
||||
8250_dw
|
||||
842
|
||||
842_compress
|
||||
842_decompress
|
||||
9p
|
||||
9pnet
|
||||
9pnet_virtio
|
||||
ac97_bus
|
||||
acer_wireless
|
||||
acer_wmi
|
||||
acpi_cpufreq
|
||||
acpi_mdio
|
||||
acpi_pad
|
||||
acpi_tad
|
||||
acpi_thermal_rel
|
||||
aesni_intel
|
||||
af_alg
|
||||
af_key
|
||||
af_packet
|
||||
agpgart
|
||||
ahci
|
||||
algif_aead
|
||||
algif_hash
|
||||
algif_skcipher
|
||||
alx
|
||||
amd64_edac
|
||||
amd_pmc
|
||||
amd_pstate
|
||||
amdgpu
|
||||
amdxcp
|
||||
apple_mfi_fastcharge
|
||||
appletalk
|
||||
asn1_encoder
|
||||
asus_atk0110
|
||||
asus_nb_wmi
|
||||
asus_wmi
|
||||
ata_generic
|
||||
ata_piix
|
||||
ath
|
||||
ath9k_common
|
||||
ath9k_htc
|
||||
ath9k_hw
|
||||
atkbd
|
||||
atl1c
|
||||
auth_rpcgss
|
||||
autofs4
|
||||
battery
|
||||
bch
|
||||
binder
|
||||
binfmt_misc
|
||||
blake2b_generic
|
||||
bluetooth
|
||||
bnep
|
||||
bpf
|
||||
bpf_preload
|
||||
br_netfilter
|
||||
bridge
|
||||
btbcm
|
||||
btcoexist
|
||||
btintel
|
||||
btmtk
|
||||
btrfs
|
||||
btrtl
|
||||
btusb
|
||||
button
|
||||
cbc
|
||||
ccm
|
||||
ccp
|
||||
cdc_acm
|
||||
cdc_ether
|
||||
cdc_mbim
|
||||
cdc_ncm
|
||||
cdc_wdm
|
||||
cdrom
|
||||
cec
|
||||
cfbcopyarea
|
||||
cfbfillrect
|
||||
cfbimgblt
|
||||
cfg80211
|
||||
cgroup
|
||||
ch341
|
||||
chacha_x86_64
|
||||
chipreg
|
||||
cifs
|
||||
cifs_arc4
|
||||
cifs_md4
|
||||
cls_cgroup
|
||||
cmac
|
||||
cmdlinepart
|
||||
coretemp
|
||||
cpufreq_ondemand
|
||||
crc16
|
||||
crc32_generic
|
||||
crc32_pclmul
|
||||
crc32c_generic
|
||||
crc32c_intel
|
||||
crc64
|
||||
crc64_rocksoft
|
||||
crc64_rocksoft_generic
|
||||
crc_itu_t
|
||||
crct10dif_pclmul
|
||||
cryptd
|
||||
crypto_null
|
||||
crypto_simd
|
||||
crypto_user
|
||||
curve25519_x86_64
|
||||
cuse
|
||||
dca
|
||||
des_generic
|
||||
dm_crypt
|
||||
dm_log
|
||||
dm_mirror
|
||||
dm_mod
|
||||
dm_multipath
|
||||
dm_region_hash
|
||||
dm_round_robin
|
||||
dmi_sysfs
|
||||
dns_resolver
|
||||
drm
|
||||
drm_buddy
|
||||
drm_display_helper
|
||||
drm_kms_helper
|
||||
drm_panel_orientation_quirks
|
||||
drm_suballoc_helper
|
||||
drm_ttm_helper
|
||||
dvb_core
|
||||
ebtable_filter
|
||||
ebtables
|
||||
ec_sys
|
||||
ecb
|
||||
ecc
|
||||
ecdh_generic
|
||||
edac_mce_amd
|
||||
ee1004
|
||||
eeepc_wmi
|
||||
eeprom
|
||||
efi_pstore
|
||||
efivarfs
|
||||
ehci_hcd
|
||||
ehci_pci
|
||||
enclosure
|
||||
encrypted_keys
|
||||
evdev
|
||||
exfat
|
||||
ext2
|
||||
ext4
|
||||
f2fs
|
||||
fan
|
||||
fat
|
||||
fb_sys_fops
|
||||
ff_memless
|
||||
fixed_phy
|
||||
fjes
|
||||
fscache
|
||||
ftdi_sio
|
||||
fuse
|
||||
fwnode_mdio
|
||||
garp
|
||||
gcm
|
||||
gf128mul
|
||||
ghash_clmulni_intel
|
||||
ghash_generic
|
||||
gigabyte_wmi
|
||||
gpio_amdpt
|
||||
gpio_generic
|
||||
gpu_sched
|
||||
grace
|
||||
hfs
|
||||
hfsplus
|
||||
hid
|
||||
hid_apple
|
||||
hid_asus
|
||||
hid_generic
|
||||
hid_hyperv
|
||||
hid_logitech_dj
|
||||
hid_logitech_hidpp
|
||||
hid_microsoft
|
||||
hid_multitouch
|
||||
hid_nintendo
|
||||
hid_playstation
|
||||
hid_roccat
|
||||
hid_roccat_common
|
||||
hid_roccat_koneplus
|
||||
hid_roccat_ryos
|
||||
hid_sony
|
||||
hid_steam
|
||||
hid_wiimote
|
||||
hidp
|
||||
hp_wmi
|
||||
hv_balloon
|
||||
hv_netvsc
|
||||
hv_storvsc
|
||||
hv_utils
|
||||
hv_vmbus
|
||||
hwmon_vid
|
||||
hyperv_drm
|
||||
hyperv_keyboard
|
||||
i2c_algo_bit
|
||||
i2c_core
|
||||
i2c_dev
|
||||
i2c_hid
|
||||
i2c_hid_acpi
|
||||
i2c_i801
|
||||
i2c_mux
|
||||
i2c_nvidia_gpu
|
||||
i2c_piix4
|
||||
i2c_smbus
|
||||
i8042
|
||||
i915
|
||||
iTCO_vendor_support
|
||||
iTCO_wdt
|
||||
ib_cm
|
||||
ib_core
|
||||
idma64
|
||||
igb
|
||||
igc
|
||||
inet_diag
|
||||
input_leds
|
||||
int3400_thermal
|
||||
int3403_thermal
|
||||
int340x_thermal_zone
|
||||
intel_agp
|
||||
intel_cstate
|
||||
intel_gtt
|
||||
intel_hid
|
||||
intel_lpss
|
||||
intel_lpss_pci
|
||||
intel_pch_thermal
|
||||
intel_pmc_bxt
|
||||
intel_powerclamp
|
||||
intel_rapl_common
|
||||
intel_rapl_msr
|
||||
intel_soc_dts_iosf
|
||||
intel_tcc_cooling
|
||||
intel_uncore
|
||||
intel_vsec
|
||||
intel_wmi_thunderbolt
|
||||
iommu_v2
|
||||
iommufd
|
||||
ip6_tables
|
||||
ip6_udp_tunnel
|
||||
ip6t_REJECT
|
||||
ip6t_rt
|
||||
ip6table_filter
|
||||
ip6table_mangle
|
||||
ip6table_nat
|
||||
ip6table_raw
|
||||
ip6table_security
|
||||
ip_set
|
||||
ip_tables
|
||||
ipmi_devintf
|
||||
ipmi_msghandler
|
||||
ipt_REJECT
|
||||
iptable_filter
|
||||
iptable_mangle
|
||||
iptable_nat
|
||||
iptable_raw
|
||||
iptable_security
|
||||
ipv6
|
||||
ir_kbd_i2c
|
||||
irqbypass
|
||||
isofs
|
||||
it87
|
||||
iw_cm
|
||||
iwlmei
|
||||
iwlmvm
|
||||
iwlwifi
|
||||
jbd2
|
||||
jc42
|
||||
jfs
|
||||
joydev
|
||||
k10temp
|
||||
ksmbd
|
||||
kvm
|
||||
kvm_amd
|
||||
kvm_intel
|
||||
led_class_multicolor
|
||||
ledtrig_audio
|
||||
ledtrig_timer
|
||||
libahci
|
||||
libarc4
|
||||
libata
|
||||
libchacha
|
||||
libchacha20poly1305
|
||||
libcrc32c
|
||||
libcurve25519_generic
|
||||
libdes
|
||||
libphy
|
||||
libps2
|
||||
llc
|
||||
lm75
|
||||
lm83
|
||||
lockd
|
||||
loop
|
||||
lpc_ich
|
||||
lz4
|
||||
lz4_compress
|
||||
lz4hc_compress
|
||||
lzo
|
||||
lzo_rle
|
||||
mac80211
|
||||
mac_hid
|
||||
mbcache
|
||||
mc
|
||||
mc44s803
|
||||
md4
|
||||
md_mod
|
||||
mdio
|
||||
mdio_devres
|
||||
mei
|
||||
mei_gsc
|
||||
mei_hdcp
|
||||
mei_me
|
||||
mei_pxp
|
||||
mii
|
||||
minix
|
||||
mmc_core
|
||||
mousedev
|
||||
mptcp_diag
|
||||
mrp
|
||||
msdos
|
||||
msr
|
||||
mt20xx
|
||||
mt76
|
||||
mt76_connac_lib
|
||||
mt76_usb
|
||||
mt76x02_lib
|
||||
mt76x02_usb
|
||||
mt76x2_common
|
||||
mt76x2u
|
||||
mt7921_common
|
||||
mt7921e
|
||||
mtd
|
||||
mxm_wmi
|
||||
nandcore
|
||||
nbd
|
||||
nct6683
|
||||
nct6775
|
||||
nct6775_core
|
||||
netfs
|
||||
nf_conntrack
|
||||
nf_conntrack_broadcast
|
||||
nf_conntrack_ftp
|
||||
nf_conntrack_h323
|
||||
nf_conntrack_irc
|
||||
nf_conntrack_netbios_ns
|
||||
nf_conntrack_netlink
|
||||
nf_conntrack_pptp
|
||||
nf_conntrack_sip
|
||||
nf_conntrack_tftp
|
||||
nf_defrag_ipv4
|
||||
nf_defrag_ipv6
|
||||
nf_nat
|
||||
nf_nat_ftp
|
||||
nf_nat_h323
|
||||
nf_nat_irc
|
||||
nf_nat_pptp
|
||||
nf_nat_sip
|
||||
nf_nat_tftp
|
||||
nf_reject_ipv4
|
||||
nf_reject_ipv6
|
||||
nf_tables
|
||||
nfnetlink
|
||||
nfnetlink_log
|
||||
nfnetlink_queue
|
||||
nfs
|
||||
nfsv4
|
||||
nft_chain_nat
|
||||
nft_compat
|
||||
nft_ct
|
||||
nft_fib
|
||||
nft_fib_inet
|
||||
nft_fib_ipv4
|
||||
nft_fib_ipv6
|
||||
nft_masq
|
||||
nft_nat
|
||||
nft_reject
|
||||
nft_reject_inet
|
||||
nft_reject_ipv4
|
||||
nft_reject_ipv6
|
||||
nft_xfrm
|
||||
nilfs2
|
||||
nlmon
|
||||
nls_ascii
|
||||
nls_cp437
|
||||
nls_iso8859_1
|
||||
nls_utf8
|
||||
nouveau
|
||||
ntfs
|
||||
ntfs3
|
||||
nvidia_wmi_ec_backlight
|
||||
nvme
|
||||
nvme_common
|
||||
nvme_core
|
||||
nvmem_rave_sp_eeprom
|
||||
nvram
|
||||
overlay
|
||||
p8022
|
||||
parport
|
||||
parport_pc
|
||||
pata_acpi
|
||||
pcc_cpufreq
|
||||
pcspkr
|
||||
pinctrl_alderlake
|
||||
pinctrl_amd
|
||||
pkcs8_key_parser
|
||||
pktcdvd
|
||||
platform_profile
|
||||
pmt_class
|
||||
pmt_telemetry
|
||||
poly1305_x86_64
|
||||
polyval_clmulni
|
||||
polyval_generic
|
||||
ppdev
|
||||
processor_thermal_device
|
||||
processor_thermal_device_pci_legacy
|
||||
processor_thermal_mbox
|
||||
processor_thermal_rapl
|
||||
processor_thermal_rfim
|
||||
psmouse
|
||||
psnap
|
||||
qcserial
|
||||
qrtr
|
||||
r8152
|
||||
r8153_ecm
|
||||
r8169
|
||||
radeon
|
||||
raid1
|
||||
raid6_pq
|
||||
rapl
|
||||
rave_sp
|
||||
raw_diag
|
||||
rc_core
|
||||
realtek
|
||||
rfcomm
|
||||
rfkill
|
||||
rndis_host
|
||||
rndis_wlan
|
||||
rng_core
|
||||
roles
|
||||
rpcsec_gss_krb5
|
||||
rt2800lib
|
||||
rt2800usb
|
||||
rt2x00lib
|
||||
rt2x00usb
|
||||
rtl8192ee
|
||||
rtl8723_common
|
||||
rtl8723ae
|
||||
rtl8723be
|
||||
rtl8821ae
|
||||
rtl_pci
|
||||
rtlwifi
|
||||
rtsx_pci
|
||||
rtsx_pci_sdmmc
|
||||
rtw88_8821c
|
||||
rtw88_8821ce
|
||||
rtw88_core
|
||||
rtw88_pci
|
||||
sch_cake
|
||||
sch_fq_codel
|
||||
sch_ingress
|
||||
scsi_common
|
||||
scsi_mod
|
||||
scsi_transport_fc
|
||||
scsi_transport_sas
|
||||
sd_mod
|
||||
selftests
|
||||
serial_multi_instantiate
|
||||
serio
|
||||
serio_raw
|
||||
ses
|
||||
sg
|
||||
sha512_ssse3
|
||||
snd
|
||||
snd_acp3x_pdm_dma
|
||||
snd_acp3x_rn
|
||||
snd_acp6x_pdm_dma
|
||||
snd_acp_config
|
||||
snd_acp_pci
|
||||
snd_aloop
|
||||
snd_compress
|
||||
snd_ctl_led
|
||||
snd_hda_codec
|
||||
snd_hda_codec_generic
|
||||
snd_hda_codec_hdmi
|
||||
snd_hda_codec_realtek
|
||||
snd_hda_core
|
||||
snd_hda_ext_core
|
||||
snd_hda_intel
|
||||
snd_hrtimer
|
||||
snd_hwdep
|
||||
snd_intel_dspcfg
|
||||
snd_intel_sdw_acpi
|
||||
snd_pci_acp3x
|
||||
snd_pci_acp5x
|
||||
snd_pci_acp6x
|
||||
snd_pci_ps
|
||||
snd_pcm
|
||||
snd_pcm_dmaengine
|
||||
snd_rawmidi
|
||||
snd_rn_pci_acp3x
|
||||
snd_rpl_pci_acp6x
|
||||
snd_seq
|
||||
snd_seq_device
|
||||
snd_seq_dummy
|
||||
snd_seq_midi
|
||||
snd_seq_midi_event
|
||||
snd_seq_oss
|
||||
snd_seq_virmidi
|
||||
snd_soc_acp6x_mach
|
||||
snd_soc_acpi
|
||||
snd_soc_acpi_intel_match
|
||||
snd_soc_core
|
||||
snd_soc_dmic
|
||||
snd_soc_hdac_hda
|
||||
snd_soc_skl
|
||||
snd_soc_sst_dsp
|
||||
snd_soc_sst_ipc
|
||||
snd_sof
|
||||
snd_sof_amd_acp
|
||||
snd_sof_amd_rembrandt
|
||||
snd_sof_amd_renoir
|
||||
snd_sof_intel_hda
|
||||
snd_sof_intel_hda_common
|
||||
snd_sof_intel_hda_mlink
|
||||
snd_sof_pci
|
||||
snd_sof_pci_intel_cnl
|
||||
snd_sof_pci_intel_tgl
|
||||
snd_sof_probes
|
||||
snd_sof_utils
|
||||
snd_sof_xtensa_dsp
|
||||
snd_timer
|
||||
snd_ua101
|
||||
snd_ump
|
||||
snd_usb_audio
|
||||
snd_usb_us122l
|
||||
snd_usb_usx2y
|
||||
snd_usbmidi_lib
|
||||
snd_virmidi
|
||||
soundcore
|
||||
soundwire_bus
|
||||
soundwire_cadence
|
||||
soundwire_generic_allocation
|
||||
soundwire_intel
|
||||
sp5100_tco
|
||||
sparse_keymap
|
||||
spi_intel
|
||||
spi_intel_pci
|
||||
spi_nor
|
||||
squashfs
|
||||
sr_mod
|
||||
st
|
||||
stp
|
||||
sunrpc
|
||||
syscopyarea
|
||||
sysfillrect
|
||||
sysimgblt
|
||||
t10_pi
|
||||
tap
|
||||
tcp_bbr
|
||||
tcp_diag
|
||||
tda18271
|
||||
tda827x
|
||||
tda8290
|
||||
tda9887
|
||||
tea5761
|
||||
tea5767
|
||||
tee
|
||||
tg3
|
||||
thermal
|
||||
thunderbolt
|
||||
tiny_power_button
|
||||
tls
|
||||
tpm
|
||||
tpm_crb
|
||||
tpm_tis
|
||||
tpm_tis_core
|
||||
trusted
|
||||
ttm
|
||||
tun
|
||||
tuner_simple
|
||||
tuner_types
|
||||
tunnel4
|
||||
tunnel6
|
||||
typec
|
||||
typec_ucsi
|
||||
uas
|
||||
ucsi_acpi
|
||||
ucsi_ccg
|
||||
udf
|
||||
udp_diag
|
||||
udp_tunnel
|
||||
ufs
|
||||
uhci_hcd
|
||||
uhid
|
||||
uinput
|
||||
uio
|
||||
uio_pdrv_genirq
|
||||
unix_diag
|
||||
usb_common
|
||||
usb_storage
|
||||
usb_wwan
|
||||
usbcore
|
||||
usbhid
|
||||
usbip_core
|
||||
usbip_host
|
||||
usbmon
|
||||
usbnet
|
||||
uvc
|
||||
uvcvideo
|
||||
uvesafb
|
||||
v4l2_dv_timings
|
||||
veth
|
||||
vfat
|
||||
vfio
|
||||
vfio_iommu_type1
|
||||
vfio_pci
|
||||
vfio_pci_core
|
||||
vhost
|
||||
vhost_iotlb
|
||||
vhost_net
|
||||
video
|
||||
videobuf2_common
|
||||
videobuf2_memops
|
||||
videobuf2_v4l2
|
||||
videobuf2_vmalloc
|
||||
videodev
|
||||
virtio_pci
|
||||
virtio_pci_legacy_dev
|
||||
virtio_pci_modern_dev
|
||||
virtio_scsi
|
||||
vivaldi_fmap
|
||||
vmw_vmci
|
||||
vmw_vsock_virtio_transport_common
|
||||
vmw_vsock_vmci_transport
|
||||
vsock
|
||||
vsock_loopback
|
||||
wacom
|
||||
watchdog
|
||||
wireguard
|
||||
wireless_hotkey
|
||||
wmi
|
||||
wmi_bmof
|
||||
x86_pkg_temp_thermal
|
||||
x_tables
|
||||
xc2028
|
||||
xc4000
|
||||
xc5000
|
||||
xfrm6_tunnel
|
||||
xfrm_interface
|
||||
xfs
|
||||
xhci_hcd
|
||||
xhci_pci
|
||||
xhci_pci_renesas
|
||||
xor
|
||||
xpad
|
||||
xt_CHECKSUM
|
||||
xt_LOG
|
||||
xt_MASQUERADE
|
||||
xt_NFQUEUE
|
||||
xt_REDIRECT
|
||||
xt_addrtype
|
||||
xt_cgroup
|
||||
xt_comment
|
||||
xt_conntrack
|
||||
xt_hl
|
||||
xt_limit
|
||||
xt_mark
|
||||
xt_nat
|
||||
xt_recent
|
||||
xt_state
|
||||
xt_tcpudp
|
||||
xxhash_generic
|
||||
zlib_deflate
|
||||
zram
|
14
linux-tkg-config/6.7/90-cleanup.hook
Normal file
14
linux-tkg-config/6.7/90-cleanup.hook
Normal file
@@ -0,0 +1,14 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/*/
|
||||
Target = !usr/lib/modules/*/?*
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/cleanup
|
||||
NeedsTargets
|
||||
|
10
linux-tkg-config/6.7/cleanup
Executable file
10
linux-tkg-config/6.7/cleanup
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
for _f in /usr/lib/modules/*tkg*; do
|
||||
if [[ ! -e ${_f}/vmlinuz ]]; then
|
||||
rm -rf "$_f"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:set ft=sh sw=2 et:
|
||||
|
11706
linux-tkg-config/6.7/config.x86_64
Normal file
11706
linux-tkg-config/6.7/config.x86_64
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
38
linux-tkg-patches/5.10/0003-glitched-base-nonrt.patch
Normal file
38
linux-tkg-patches/5.10/0003-glitched-base-nonrt.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
@@ -54,46 +54,6 @@ index 361ea7ab30ea..0c5cf69b241a 100644
|
||||
2.28.0
|
||||
|
||||
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
|
||||
From acc49f33a10f61dc66c423888cbb883ba46710e4 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 17:41:29 +0000
|
||||
|
File diff suppressed because it is too large
Load Diff
53
linux-tkg-patches/5.10/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.10/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.10/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.10/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.11/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.11/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.11/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.11/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.12/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.12/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.12/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.12/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.13/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.13/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.13/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.13/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.14/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.14/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.14/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.14/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
38
linux-tkg-patches/5.15/0003-glitched-base-nonrt.patch
Normal file
38
linux-tkg-patches/5.15/0003-glitched-base-nonrt.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
@@ -54,46 +54,6 @@ index 361ea7ab30ea..0c5cf69b241a 100644
|
||||
2.28.0
|
||||
|
||||
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
|
||||
From acc49f33a10f61dc66c423888cbb883ba46710e4 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 17:41:29 +0000
|
||||
|
@@ -183,11 +183,11 @@ index 4700d24e5d55..8f7a3d7fd9c1 100644
|
||||
* Some Atheros AR9xxx and QCA988x chips do not behave after a bus reset.
|
||||
* The device will throw a Link Down error on AER-capable systems and
|
||||
@@ -4513,6 +4613,7 @@ static const struct pci_dev_acs_enabled {
|
||||
{ PCI_VENDOR_ID_ZHAOXIN, 0x9083, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_NXP, 0x8d9b, pci_quirk_nxp_rp_acs },
|
||||
/* Zhaoxin Root/Downstream Ports */
|
||||
{ PCI_VENDOR_ID_ZHAOXIN, PCI_ANY_ID, pci_quirk_zhaoxin_pcie_ports_acs },
|
||||
+ { PCI_ANY_ID, PCI_ANY_ID, pcie_acs_overrides },
|
||||
/* Wangxun nics */
|
||||
{ PCI_VENDOR_ID_WANGXUN, PCI_ANY_ID, pci_quirk_wangxun_nic_acs },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
|
@@ -68,7 +68,7 @@ Signed-off-by: André Almeida <andrealmeid@collabora.com>
|
||||
Adjusted for v5.9: Removed `put_futex_key` calls.
|
||||
---
|
||||
include/uapi/linux/futex.h | 20 +++
|
||||
kernel/futex.c | 348 +++++++++++++++++++++++++++++++++++++
|
||||
kernel/futex/core.c | 348 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 368 insertions(+)
|
||||
|
||||
diff --git a/include/uapi/linux/futex.h b/include/uapi/linux/futex.h
|
||||
@@ -114,10 +114,10 @@ index a89eb0accd5e2e..580001e89c6cae 100644
|
||||
+};
|
||||
+
|
||||
#endif /* _UAPI_LINUX_FUTEX_H */
|
||||
diff --git a/kernel/futex.c b/kernel/futex.c
|
||||
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
|
||||
index 408cad5e89680f..c30930a955cece 100644
|
||||
--- a/kernel/futex.c
|
||||
+++ b/kernel/futex.c
|
||||
--- a/kernel/futex/core.c
|
||||
+++ b/kernel/futex/core.c
|
||||
@@ -197,6 +197,8 @@ struct futex_pi_state {
|
||||
* @bitset: bitset for the optional bitmasked wakeup
|
||||
* @requeue_state: State field for futex_requeue_pi()
|
||||
@@ -536,7 +536,7 @@ Subject: [PATCH] futex: Add Proton compatibility code
|
||||
|
||||
---
|
||||
include/uapi/linux/futex.h | 2 +-
|
||||
kernel/futex.c | 3 ++-
|
||||
kernel/futex/core.c | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/uapi/linux/futex.h b/include/uapi/linux/futex.h
|
||||
@@ -552,10 +552,10 @@ index 580001e89c6cae..a3e760886b8e7e 100644
|
||||
|
||||
#define FUTEX_PRIVATE_FLAG 128
|
||||
#define FUTEX_CLOCK_REALTIME 256
|
||||
diff --git a/kernel/futex.c b/kernel/futex.c
|
||||
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
|
||||
index c30930a955cece..aa33e66df5c9df 100644
|
||||
--- a/kernel/futex.c
|
||||
+++ b/kernel/futex.c
|
||||
--- a/kernel/futex/core.c
|
||||
+++ b/kernel/futex/core.c
|
||||
@@ -4002,7 +4002,7 @@ futex_init_timeout(u32 cmd, u32 op, struct timespec64 *ts, ktime_t *t)
|
||||
return -EINVAL;
|
||||
|
@@ -43,7 +43,7 @@ Link: https://lore.kernel.org/r/20210923171111.300673-17-andrealmeid@collabora.c
|
||||
include/linux/syscalls.h | 6 +
|
||||
include/uapi/asm-generic/unistd.h | 5 +-
|
||||
include/uapi/linux/futex.h | 26 +++
|
||||
kernel/futex.c | 334 ++++++++++++++++++++++++++++++
|
||||
kernel/futex/core.c | 334 ++++++++++++++++++++++++++++++
|
||||
kernel/sys_ni.c | 1 +
|
||||
5 files changed, 371 insertions(+), 1 deletion(-)
|
||||
|
||||
@@ -125,10 +125,10 @@ index a89eb0accd5e..1666f5e4b837 100644
|
||||
/*
|
||||
* Support for robust futexes: the kernel cleans up held futexes at
|
||||
* thread exit time.
|
||||
diff --git a/kernel/futex.c b/kernel/futex.c
|
||||
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
|
||||
index 408cad5e8968..d7dc0bd9379c 100644
|
||||
--- a/kernel/futex.c
|
||||
+++ b/kernel/futex.c
|
||||
--- a/kernel/futex/core.c
|
||||
+++ b/kernel/futex/core.c
|
||||
@@ -285,6 +285,18 @@ static const struct futex_q futex_q_init = {
|
||||
.requeue_state = ATOMIC_INIT(Q_REQUEUE_PI_NONE),
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -564,26 +564,29 @@ index 291b857a6e20..f3480cdb7497 100644
|
||||
"%s: %s:%d is running\n", __func__, task->comm,
|
||||
task->pid);
|
||||
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
|
||||
index 6bb116c559b4..d4c8168a8270 100644
|
||||
index 7779ee8abc2a..5b9893cdfb1b 100644
|
||||
--- a/kernel/locking/rtmutex.c
|
||||
+++ b/kernel/locking/rtmutex.c
|
||||
@@ -298,21 +298,25 @@ static __always_inline void
|
||||
waiter_update_prio(struct rt_mutex_waiter *waiter, struct task_struct *task)
|
||||
{
|
||||
waiter->prio = __waiter_prio(task);
|
||||
- waiter->deadline = task->dl.deadline;
|
||||
+ waiter->deadline = __tsk_deadline(task);
|
||||
@@ -343,7 +343,7 @@ waiter_update_prio(struct rt_mutex_waite
|
||||
lockdep_assert(RB_EMPTY_NODE(&waiter->tree.entry));
|
||||
|
||||
waiter->tree.prio = __waiter_prio(task);
|
||||
- waiter->tree.deadline = task->dl.deadline;
|
||||
+ waiter->tree.deadline = __tsk_deadline(task);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only use with rt_mutex_waiter_{less,equal}()
|
||||
@@ -364,16 +364,20 @@ waiter_clone_prio(struct rt_mutex_waiter
|
||||
* Only use with rt_waiter_node_{less,equal}()
|
||||
*/
|
||||
#define task_to_waiter_node(p) \
|
||||
- &(struct rt_waiter_node){ .prio = __waiter_prio(p), .deadline = (p)->dl.deadline }
|
||||
+ &(struct rt_waiter_node){ .prio = __waiter_prio(p), .deadline = __tsk_deadline(p) }
|
||||
#define task_to_waiter(p) \
|
||||
- &(struct rt_mutex_waiter){ .prio = __waiter_prio(p), .deadline = (p)->dl.deadline }
|
||||
+ &(struct rt_mutex_waiter){ .prio = __waiter_prio(p), .deadline = __tsk_deadline(p) }
|
||||
&(struct rt_mutex_waiter){ .tree = *task_to_waiter_node(p) }
|
||||
|
||||
static __always_inline int rt_mutex_waiter_less(struct rt_mutex_waiter *left,
|
||||
struct rt_mutex_waiter *right)
|
||||
static __always_inline int rt_waiter_node_less(struct rt_waiter_node *left,
|
||||
struct rt_waiter_node *right)
|
||||
{
|
||||
+#ifdef CONFIG_SCHED_PDS
|
||||
+ return (left->deadline < right->deadline);
|
||||
@@ -595,7 +598,7 @@ index 6bb116c559b4..d4c8168a8270 100644
|
||||
/*
|
||||
* If both waiters have dl_prio(), we check the deadlines of the
|
||||
* associated tasks.
|
||||
@@ -321,16 +325,22 @@ static __always_inline int rt_mutex_waiter_less(struct rt_mutex_waiter *left,
|
||||
@@ -382,16 +386,22 @@ static __always_inline int rt_waiter_nod
|
||||
*/
|
||||
if (dl_prio(left->prio))
|
||||
return dl_time_before(left->deadline, right->deadline);
|
||||
@@ -605,8 +608,8 @@ index 6bb116c559b4..d4c8168a8270 100644
|
||||
+#endif
|
||||
}
|
||||
|
||||
static __always_inline int rt_mutex_waiter_equal(struct rt_mutex_waiter *left,
|
||||
struct rt_mutex_waiter *right)
|
||||
static __always_inline int rt_waiter_node_equal(struct rt_waiter_node *left,
|
||||
struct rt_waiter_node *right)
|
||||
{
|
||||
+#ifdef CONFIG_SCHED_PDS
|
||||
+ return (left->deadline == right->deadline);
|
||||
@@ -618,7 +621,7 @@ index 6bb116c559b4..d4c8168a8270 100644
|
||||
/*
|
||||
* If both waiters have dl_prio(), we check the deadlines of the
|
||||
* associated tasks.
|
||||
@@ -339,8 +349,10 @@ static __always_inline int rt_mutex_waiter_equal(struct rt_mutex_waiter *left,
|
||||
@@ -400,8 +410,10 @@ static __always_inline int rt_waiter_nod
|
||||
*/
|
||||
if (dl_prio(left->prio))
|
||||
return left->deadline == right->deadline;
|
||||
@@ -709,7 +712,7 @@ index 000000000000..8b0ddbdd24e4
|
||||
+#include <asm/switch_to.h>
|
||||
+
|
||||
+#include "../workqueue_internal.h"
|
||||
+#include "../../fs/io-wq.h"
|
||||
+#include "../../io_uring/io-wq.h"
|
||||
+#include "../smpboot.h"
|
||||
+
|
||||
+#include "pelt.h"
|
||||
@@ -9893,3 +9896,223 @@ index f2b9e686d6a69c07f54c2cae36f7ce0ab70f9cb2..55c2a4c0cb845580c97e4adf07a34646
|
||||
+
|
||||
extern void swake_up_all_locked(struct swait_queue_head *q);
|
||||
extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
||||
|
||||
From 3728c383c5031dce5ae0f5ea53fc47afba71270f Mon Sep 17 00:00:00 2001
|
||||
From: Juuso Alasuutari <juuso.alasuutari@gmail.com>
|
||||
Date: Sun, 14 Aug 2022 18:19:09 +0300
|
||||
Subject: [PATCH 01/10] sched/alt: [Sync] sched/core: Always flush pending
|
||||
blk_plug
|
||||
|
||||
---
|
||||
kernel/sched/alt_core.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
||||
index 588c7b983e3ba..8a6aa5b7279d3 100644
|
||||
--- a/kernel/sched/alt_core.c
|
||||
+++ b/kernel/sched/alt_core.c
|
||||
@@ -4663,8 +4663,12 @@ static inline void sched_submit_work(struct task_struct *tsk)
|
||||
io_wq_worker_sleeping(tsk);
|
||||
}
|
||||
|
||||
- if (tsk_is_pi_blocked(tsk))
|
||||
- return;
|
||||
+ /*
|
||||
+ * spinlock and rwlock must not flush block requests. This will
|
||||
+ * deadlock if the callback attempts to acquire a lock which is
|
||||
+ * already acquired.
|
||||
+ */
|
||||
+ SCHED_WARN_ON(current->__state & TASK_RTLOCK_WAIT);
|
||||
|
||||
/*
|
||||
* If we are going to sleep and we have plugged IO queued,
|
||||
|
||||
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
||||
index ff4a45708a68e7c43f4e6494e120341514b31b56..f783788e3caa71e4c668ef0c0284dc77529b10f3 100644
|
||||
--- a/kernel/sched/alt_core.c
|
||||
+++ b/kernel/sched/alt_core.c
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <linux/kprobes.h>
|
||||
#include <linux/mmu_context.h>
|
||||
#include <linux/nmi.h>
|
||||
-#include <linux/profile.h>
|
||||
#include <linux/rcupdate_wait.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/syscalls.h>
|
||||
@@ -2236,9 +2235,10 @@ ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
|
||||
rq = this_rq();
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
- if (cpu == rq->cpu)
|
||||
+ if (cpu == rq->cpu) {
|
||||
__schedstat_inc(rq->ttwu_local);
|
||||
- else {
|
||||
+ __schedstat_inc(p->stats.nr_wakeups_local);
|
||||
+ } else {
|
||||
/** Alt schedule FW ToDo:
|
||||
* How to do ttwu_wake_remote
|
||||
*/
|
||||
@@ -2246,6 +2246,7 @@ ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
__schedstat_inc(rq->ttwu_count);
|
||||
+ __schedstat_inc(p->stats.nr_wakeups);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2895,6 +2896,11 @@ static inline void __sched_fork(unsigned long clone_flags, struct task_struct *p
|
||||
p->stime = 0;
|
||||
p->sched_time = 0;
|
||||
|
||||
+#ifdef CONFIG_SCHEDSTATS
|
||||
+ /* Even if schedstat is disabled, there should not be garbage */
|
||||
+ memset(&p->stats, 0, sizeof(p->stats));
|
||||
+#endif
|
||||
+
|
||||
#ifdef CONFIG_PREEMPT_NOTIFIERS
|
||||
INIT_HLIST_HEAD(&p->preempt_notifiers);
|
||||
#endif
|
||||
@@ -7397,6 +7403,10 @@ void normalize_rt_tasks(void)
|
||||
if (p->flags & PF_KTHREAD)
|
||||
continue;
|
||||
|
||||
+ schedstat_set(p->stats.wait_start, 0);
|
||||
+ schedstat_set(p->stats.sleep_start, 0);
|
||||
+ schedstat_set(p->stats.block_start, 0);
|
||||
+
|
||||
if (!rt_task(p)) {
|
||||
/*
|
||||
* Renice negative nice level userspace
|
||||
diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h
|
||||
index 289058a09bd53a96a9bc09cb2e9cb5ee8e42a3d0..f2b9e686d6a69c07f54c2cae36f7ce0ab70f9cb2 100644
|
||||
--- a/kernel/sched/alt_sched.h
|
||||
+++ b/kernel/sched/alt_sched.h
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <linux/livepatch.h>
|
||||
#include <linux/membarrier.h>
|
||||
#include <linux/proc_fs.h>
|
||||
+#include <linux/profile.h>
|
||||
#include <linux/psi.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/stop_machine.h>
|
||||
diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h
|
||||
index 38f3698f5e5b31d35fe18c3c6c103a685475e64e..b9d597394316d2f5f16b6eb19f922b65bf9912fc 100644
|
||||
--- a/kernel/sched/stats.h
|
||||
+++ b/kernel/sched/stats.h
|
||||
@@ -89,6 +89,7 @@ static inline void rq_sched_info_depart (struct rq *rq, unsigned long long delt
|
||||
|
||||
#endif /* CONFIG_SCHEDSTATS */
|
||||
|
||||
+#ifndef CONFIG_SCHED_ALT
|
||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
||||
struct sched_entity_stats {
|
||||
struct sched_entity se;
|
||||
@@ -105,6 +106,7 @@ __schedstats_from_se(struct sched_entity *se)
|
||||
#endif
|
||||
return &task_of(se)->stats;
|
||||
}
|
||||
+#endif /* CONFIG_SCHED_ALT */
|
||||
|
||||
#ifdef CONFIG_PSI
|
||||
void psi_task_change(struct task_struct *task, int clear, int set);
|
||||
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
||||
index 03772805e4f9f1bf881740c8dd14aef667fbecf2..4742bbdfb2d715a439c0d505b4f293a82b76b255 100644
|
||||
--- a/kernel/sched/alt_core.c
|
||||
+++ b/kernel/sched/alt_core.c
|
||||
@@ -5661,9 +5661,6 @@ static int __sched_setscheduler(struct task_struct *p,
|
||||
return retval;
|
||||
}
|
||||
|
||||
- if (pi)
|
||||
- cpuset_read_lock();
|
||||
-
|
||||
/*
|
||||
* Make sure no PI-waiters arrive (or leave) while we are
|
||||
* changing the priority of the task:
|
||||
@@ -5709,8 +5706,6 @@ static int __sched_setscheduler(struct task_struct *p,
|
||||
policy = oldpolicy = -1;
|
||||
__task_access_unlock(p, lock);
|
||||
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
|
||||
- if (pi)
|
||||
- cpuset_read_unlock();
|
||||
goto recheck;
|
||||
}
|
||||
|
||||
@@ -5741,10 +5736,8 @@ static int __sched_setscheduler(struct task_struct *p,
|
||||
__task_access_unlock(p, lock);
|
||||
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
|
||||
|
||||
- if (pi) {
|
||||
- cpuset_read_unlock();
|
||||
+ if (pi)
|
||||
rt_mutex_adjust_pi(p);
|
||||
- }
|
||||
|
||||
/* Run balance callbacks after we've adjusted the PI chain: */
|
||||
balance_callbacks(rq, head);
|
||||
@@ -5755,8 +5748,6 @@ static int __sched_setscheduler(struct task_struct *p,
|
||||
unlock:
|
||||
__task_access_unlock(p, lock);
|
||||
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
|
||||
- if (pi)
|
||||
- cpuset_read_unlock();
|
||||
return retval;
|
||||
}
|
||||
|
||||
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
|
||||
index 2f6606f4a3ec941f78b85a8ff997f2a6c0405218..71f5da268ee8e597ee15b2b440b4a80f8a6adb1c 100644
|
||||
--- a/kernel/cgroup/cpuset.c
|
||||
+++ b/kernel/cgroup/cpuset.c
|
||||
@@ -2509,12 +2509,15 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
|
||||
+#ifndef CONFIG_SCHED_ALT
|
||||
if (dl_task(task)) {
|
||||
cs->nr_migrate_dl_tasks++;
|
||||
cs->sum_migrate_dl_bw += task->dl.dl_bw;
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
+#ifndef CONFIG_SCHED_ALT
|
||||
if (!cs->nr_migrate_dl_tasks)
|
||||
goto out_success;
|
||||
|
||||
@@ -2535,6 +2538,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)
|
||||
}
|
||||
|
||||
out_success:
|
||||
+#endif
|
||||
/*
|
||||
* Mark attach is in progress. This makes validate_change() fail
|
||||
* changes which zero cpus/mems_allowed.
|
||||
@@ -2558,12 +2562,14 @@ static void cpuset_cancel_attach(struct cgroup_taskset *tset)
|
||||
if (!cs->attach_in_progress)
|
||||
wake_up(&cpuset_attach_wq);
|
||||
|
||||
+#ifndef CONFIG_SCHED_ALT
|
||||
if (cs->nr_migrate_dl_tasks) {
|
||||
int cpu = cpumask_any(cs->effective_cpus);
|
||||
|
||||
dl_bw_free(cpu, cs->sum_migrate_dl_bw);
|
||||
reset_migrate_dl_data(cs);
|
||||
}
|
||||
+#endif
|
||||
|
||||
mutex_unlock(&cpuset_mutex);
|
||||
}
|
||||
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
|
||||
index 4742bbdfb2d715a439c0d505b4f293a82b76b255..8badb54c7d7b00bba30dbbd7206feeafbf919af2 100644
|
||||
--- a/kernel/sched/alt_core.c
|
||||
+++ b/kernel/sched/alt_core.c
|
||||
@@ -7156,8 +7156,7 @@ int cpuset_cpumask_can_shrink(const struct cpumask __maybe_unused *cur,
|
||||
return 1;
|
||||
}
|
||||
|
||||
-int task_can_attach(struct task_struct *p,
|
||||
- const struct cpumask *cs_cpus_allowed)
|
||||
+int task_can_attach(struct task_struct *p)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
53
linux-tkg-patches/5.15/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.15/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.15/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.15/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.16/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.16/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
703
linux-tkg-patches/5.16/0014-OpenRGB.patch
Normal file
703
linux-tkg-patches/5.16/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,703 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
53
linux-tkg-patches/5.17/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.17/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
703
linux-tkg-patches/5.17/0014-OpenRGB.patch
Normal file
703
linux-tkg-patches/5.17/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,703 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
53
linux-tkg-patches/5.18/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.18/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
703
linux-tkg-patches/5.18/0014-OpenRGB.patch
Normal file
703
linux-tkg-patches/5.18/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,703 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
53
linux-tkg-patches/5.19/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.19/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
703
linux-tkg-patches/5.19/0014-OpenRGB.patch
Normal file
703
linux-tkg-patches/5.19/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,703 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
38
linux-tkg-patches/5.4/0003-glitched-base-nonrt.patch
Normal file
38
linux-tkg-patches/5.4/0003-glitched-base-nonrt.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 28f32f59d9d55ac7ec3a20b79bdd02d2a0a5f7e1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Frade <admfrade@gmail.com>
|
||||
Date: Mon, 29 Jan 2018 18:29:13 +0000
|
||||
Subject: [PATCH 03/17] sched/core: nr_migrate = 128 increases number of tasks
|
||||
to iterate in a single balance run.
|
||||
|
||||
Signed-off-by: Alexandre Frade <admfrade@gmail.com>
|
||||
---
|
||||
kernel/sched/core.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index f788cd61df21..2bfbb4213707 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -59,7 +59,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we measure -rt task CPU usage in us.
|
||||
@@ -71,9 +71,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
--
|
||||
2.28.0
|
@@ -31,31 +31,6 @@ index 2acfc69878f5..3f1131431e06 100644
|
||||
EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
|
||||
|
||||
__cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index 211890edf37e..37121563407d 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -41,7 +41,7 @@ const_debug unsigned int sysctl_sched_features =
|
||||
* Number of tasks to iterate in a single balance run.
|
||||
* Limited because this is done with IRQs disabled.
|
||||
*/
|
||||
-const_debug unsigned int sysctl_sched_nr_migrate = 32;
|
||||
+const_debug unsigned int sysctl_sched_nr_migrate = 128;
|
||||
|
||||
/*
|
||||
* period over which we average the RT time consumption, measured
|
||||
@@ -61,9 +61,9 @@ __read_mostly int scheduler_running;
|
||||
|
||||
/*
|
||||
* part of the period that we allow rt tasks to run in us.
|
||||
- * default: 0.95s
|
||||
+ * XanMod default: 0.98s
|
||||
*/
|
||||
-int sysctl_sched_rt_runtime = 950000;
|
||||
+int sysctl_sched_rt_runtime = 980000;
|
||||
|
||||
/*
|
||||
* __task_rq_lock - lock the rq @p resides on.
|
||||
diff --git a/lib/Kconfig b/lib/Kconfig
|
||||
index 5fe577673b98..c44c27cd6e05 100644
|
||||
--- a/lib/Kconfig
|
||||
|
53
linux-tkg-patches/5.4/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.4/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
53
linux-tkg-patches/5.7/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.7/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.7/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.7/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.8/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.8/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.8/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.8/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
53
linux-tkg-patches/5.9/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/5.9/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
715
linux-tkg-patches/5.9/0014-OpenRGB.patch
Normal file
715
linux-tkg-patches/5.9/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,715 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
@@ -981,6 +981,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
retval = piix4_setup_sb800(dev, id, 1);
|
||||
}
|
||||
|
||||
+ if (dev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
+ dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
|
||||
+ retval = piix4_setup_sb800(dev, id, 1);
|
||||
+ }
|
||||
+
|
||||
if (retval > 0) {
|
||||
/* Try to add the aux adapter if it exists,
|
||||
* piix4_add_adapter will clean up if this fails */
|
90
linux-tkg-patches/6.0/0005-glitched-pds.patch
Normal file
90
linux-tkg-patches/6.0/0005-glitched-pds.patch
Normal file
@@ -0,0 +1,90 @@
|
||||
From f7f49141a5dbe9c99d78196b58c44307fb2e6be3 Mon Sep 17 00:00:00 2001
|
||||
From: Tk-Glitch <ti3nou@gmail.com>
|
||||
Date: Wed, 4 Jul 2018 04:30:08 +0200
|
||||
Subject: glitched - PDS
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_250
|
||||
+ default HZ_500
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -39,6 +39,13 @@ choice
|
||||
on SMP and NUMA systems and exactly dividing by both PAL and
|
||||
NTSC frame rates for video and multimedia work.
|
||||
|
||||
+ config HZ_500
|
||||
+ bool "500 HZ"
|
||||
+ help
|
||||
+ 500 Hz is a balanced timer frequency. Provides fast interactivity
|
||||
+ on desktops with great smoothness without increasing CPU power
|
||||
+ consumption and sacrificing the battery life on laptops.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -52,6 +59,7 @@ config HZ
|
||||
default 100 if HZ_100
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
+ default 500 if HZ_500
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_500
|
||||
+ default HZ_750
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -46,6 +46,13 @@ choice
|
||||
on desktops with great smoothness without increasing CPU power
|
||||
consumption and sacrificing the battery life on laptops.
|
||||
|
||||
+ config HZ_750
|
||||
+ bool "750 HZ"
|
||||
+ help
|
||||
+ 750 Hz is a good timer frequency for desktops. Provides fast
|
||||
+ interactivity with great smoothness without sacrificing too
|
||||
+ much throughput.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -60,6 +67,7 @@ config HZ
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
default 500 if HZ_500
|
||||
+ default 750 if HZ_750
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||
index 9270a4370d54..30d01e647417 100644
|
||||
--- a/mm/vmscan.c
|
||||
+++ b/mm/vmscan.c
|
||||
@@ -169,7 +169,7 @@
|
||||
/*
|
||||
* From 0 .. 200. Higher means more swappy.
|
||||
*/
|
||||
-int vm_swappiness = 60;
|
||||
+int vm_swappiness = 20;
|
||||
|
||||
static void set_task_reclaim_state(struct task_struct *task,
|
||||
struct reclaim_state *rs)
|
@@ -12,12 +12,12 @@ Subject: [PATCH 01/34] winesync: Introduce the winesync driver and character
|
||||
create mode 100644 drivers/misc/winesync.c
|
||||
|
||||
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
|
||||
index 0f5a49fc7c9e..e21e4424d6a2 100644
|
||||
index 94e9fb4cdd76..4f9e3d80a6e8 100644
|
||||
--- a/drivers/misc/Kconfig
|
||||
+++ b/drivers/misc/Kconfig
|
||||
@@ -470,6 +470,17 @@ config OPEN_DICE
|
||||
@@ -496,6 +496,17 @@ config VCPU_STALL_DETECTOR
|
||||
|
||||
If unsure, say N.
|
||||
If you do not intend to run this kernel as a guest, say N.
|
||||
|
||||
+config WINESYNC
|
||||
+ tristate "Synchronization primitives for Wine"
|
||||
@@ -34,16 +34,18 @@ index 0f5a49fc7c9e..e21e4424d6a2 100644
|
||||
source "drivers/misc/eeprom/Kconfig"
|
||||
source "drivers/misc/cb710/Kconfig"
|
||||
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
|
||||
index a086197af544..1fb39bc4637b 100644
|
||||
index 2be8542616dd..d061fe45407b 100644
|
||||
--- a/drivers/misc/Makefile
|
||||
+++ b/drivers/misc/Makefile
|
||||
@@ -58,5 +58,6 @@ obj-$(CONFIG_HABANA_AI) += habanalabs/
|
||||
@@ -58,6 +58,7 @@ obj-$(CONFIG_HABANA_AI) += habanalabs/
|
||||
obj-$(CONFIG_UACCE) += uacce/
|
||||
obj-$(CONFIG_XILINX_SDFEC) += xilinx_sdfec.o
|
||||
obj-$(CONFIG_HISI_HIKEY_USB) += hisi_hikey_usb.o
|
||||
+obj-$(CONFIG_WINESYNC) += winesync.o
|
||||
obj-$(CONFIG_HI6421V600_IRQ) += hi6421v600-irq.o
|
||||
obj-$(CONFIG_OPEN_DICE) += open-dice.o
|
||||
obj-$(CONFIG_VCPU_STALL_DETECTOR) += vcpu_stall_detector.o
|
||||
\ No newline at end of file
|
||||
diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
|
||||
new file mode 100644
|
||||
index 000000000000..111f33c5676e
|
||||
@@ -115,7 +117,7 @@ index 000000000000..111f33c5676e
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS("devname:" WINESYNC_NAME);
|
||||
--
|
||||
2.36.0
|
||||
2.37.3
|
||||
|
||||
From 1f142d40cb7537bd936a68cadaf0f2a0d94abd62 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
@@ -146,10 +148,10 @@ index c07dc0ee860e..4e5abe508426 100644
|
||||
|
||||
11 char Raw keyboard device (Linux/SPARC only)
|
||||
diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst
|
||||
index cfe6cccf0f44..d31e014d7bcb 100644
|
||||
index 3b985b19f39d..3f313fd4338c 100644
|
||||
--- a/Documentation/userspace-api/ioctl/ioctl-number.rst
|
||||
+++ b/Documentation/userspace-api/ioctl/ioctl-number.rst
|
||||
@@ -371,6 +371,8 @@ Code Seq# Include File Comments
|
||||
@@ -375,6 +375,8 @@ Code Seq# Include File Comments
|
||||
<mailto:thomas@winischhofer.net>
|
||||
0xF6 all LTTng Linux Trace Toolkit Next Generation
|
||||
<mailto:mathieu.desnoyers@efficios.com>
|
||||
@@ -2177,10 +2179,10 @@ diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
|
||||
index c852eb40c4f7..a366016d6254 100644
|
||||
--- a/tools/testing/selftests/Makefile
|
||||
+++ b/tools/testing/selftests/Makefile
|
||||
@@ -13,6 +13,7 @@ TARGETS += damon
|
||||
TARGETS += drivers/dma-buf
|
||||
@@ -14,6 +14,7 @@ TARGETS += drivers/dma-buf
|
||||
TARGETS += drivers/s390x/uvdevice
|
||||
TARGETS += drivers/net/bonding
|
||||
TARGETS += drivers/net/team
|
||||
+TARGETS += drivers/winesync
|
||||
TARGETS += efivarfs
|
||||
TARGETS += exec
|
||||
@@ -3282,10 +3284,10 @@ Subject: [PATCH 20/34] maintainers: Add an entry for winesync.
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/MAINTAINERS b/MAINTAINERS
|
||||
index af9530d98717..f51064fca6e9 100644
|
||||
index 72b9654f764c..ff31beb17835 100644
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -20536,6 +20536,15 @@ M: David Härdeman <david@hardeman.nu>
|
||||
@@ -21920,6 +21920,15 @@ M: David Härdeman <david@hardeman.nu>
|
||||
S: Maintained
|
||||
F: drivers/media/rc/winbond-cir.c
|
||||
|
||||
@@ -3299,10 +3301,10 @@ index af9530d98717..f51064fca6e9 100644
|
||||
+F: tools/testing/selftests/drivers/winesync/
|
||||
+
|
||||
WINSYSTEMS EBC-C384 WATCHDOG DRIVER
|
||||
M: William Breathitt Gray <vilhelm.gray@gmail.com>
|
||||
M: William Breathitt Gray <william.gray@linaro.org>
|
||||
L: linux-watchdog@vger.kernel.org
|
||||
--
|
||||
2.36.0
|
||||
2.37.3
|
||||
|
||||
From 4e6e34339182f13972e7b906c0bd0dde74eda3d7 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
@@ -4493,10 +4495,10 @@ Subject: [PATCH 31/34] winesync: Introduce alertable waits.
|
||||
2 files changed, 60 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
|
||||
index 0f8a8a94eef8..64b379d846db 100644
|
||||
index 4fbf231a7909..7a28f58dbbf2 100644
|
||||
--- a/drivers/misc/winesync.c
|
||||
+++ b/drivers/misc/winesync.c
|
||||
@@ -842,10 +842,11 @@ static int setup_wait(struct winesync_device *dev,
|
||||
@@ -841,10 +841,11 @@ static int setup_wait(struct winesync_device *dev,
|
||||
const __u32 count = args->count;
|
||||
struct winesync_q *q;
|
||||
ktime_t timeout = 0;
|
||||
@@ -4509,7 +4511,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
return -EINVAL;
|
||||
|
||||
if (args->timeout) {
|
||||
@@ -859,7 +860,11 @@ static int setup_wait(struct winesync_device *dev,
|
||||
@@ -858,7 +859,11 @@ static int setup_wait(struct winesync_device *dev,
|
||||
timeout = timespec64_to_ns(&to);
|
||||
}
|
||||
|
||||
@@ -4522,7 +4524,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
if (!ids)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(ids, u64_to_user_ptr(args->objs),
|
||||
@@ -867,8 +872,10 @@ static int setup_wait(struct winesync_device *dev,
|
||||
@@ -866,8 +871,10 @@ static int setup_wait(struct winesync_device *dev,
|
||||
kfree(ids);
|
||||
return -EFAULT;
|
||||
}
|
||||
@@ -4534,7 +4536,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
if (!q) {
|
||||
kfree(ids);
|
||||
return -ENOMEM;
|
||||
@@ -880,7 +887,7 @@ static int setup_wait(struct winesync_device *dev,
|
||||
@@ -879,7 +886,7 @@ static int setup_wait(struct winesync_device *dev,
|
||||
q->ownerdead = false;
|
||||
q->count = count;
|
||||
|
||||
@@ -4543,7 +4545,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
struct winesync_q_entry *entry = &q->entries[i];
|
||||
struct winesync_obj *obj = get_obj(dev, ids[i]);
|
||||
|
||||
@@ -935,9 +942,9 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
@@ -934,9 +941,9 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
{
|
||||
struct winesync_wait_args args;
|
||||
struct winesync_q *q;
|
||||
@@ -4554,7 +4556,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
int ret;
|
||||
|
||||
if (copy_from_user(&args, argp, sizeof(args)))
|
||||
@@ -947,9 +954,13 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
@@ -946,9 +953,13 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@@ -4569,7 +4571,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
struct winesync_q_entry *entry = &q->entries[i];
|
||||
struct winesync_obj *obj = entry->obj;
|
||||
|
||||
@@ -958,9 +969,15 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
@@ -957,9 +968,15 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
spin_unlock(&obj->lock);
|
||||
}
|
||||
|
||||
@@ -4587,7 +4589,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
struct winesync_obj *obj = q->entries[i].obj;
|
||||
|
||||
if (atomic_read(&q->signaled) != -1)
|
||||
@@ -977,7 +994,7 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
@@ -976,7 +993,7 @@ static int winesync_wait_any(struct winesync_device *dev, void __user *argp)
|
||||
|
||||
/* and finally, unqueue */
|
||||
|
||||
@@ -4596,7 +4598,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
struct winesync_q_entry *entry = &q->entries[i];
|
||||
struct winesync_obj *obj = entry->obj;
|
||||
|
||||
@@ -1037,6 +1054,14 @@ static int winesync_wait_all(struct winesync_device *dev, void __user *argp)
|
||||
@@ -1036,6 +1053,14 @@ static int winesync_wait_all(struct winesync_device *dev, void __user *argp)
|
||||
*/
|
||||
list_add_tail(&entry->node, &obj->all_waiters);
|
||||
}
|
||||
@@ -4611,7 +4613,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
|
||||
/* check if we are already signaled */
|
||||
|
||||
@@ -1044,6 +1069,21 @@ static int winesync_wait_all(struct winesync_device *dev, void __user *argp)
|
||||
@@ -1043,6 +1068,21 @@ static int winesync_wait_all(struct winesync_device *dev, void __user *argp)
|
||||
|
||||
spin_unlock(&dev->wait_all_lock);
|
||||
|
||||
@@ -4633,7 +4635,7 @@ index 0f8a8a94eef8..64b379d846db 100644
|
||||
/* sleep */
|
||||
|
||||
ret = winesync_schedule(q, args.timeout ? &timeout : NULL);
|
||||
@@ -1066,6 +1106,16 @@ static int winesync_wait_all(struct winesync_device *dev, void __user *argp)
|
||||
@@ -1065,6 +1105,16 @@ static int winesync_wait_all(struct winesync_device *dev, void __user *argp)
|
||||
|
||||
put_obj(obj);
|
||||
}
|
||||
@@ -4664,7 +4666,7 @@ index fb3788339ffe..5b4e369f7469 100644
|
||||
|
||||
#define WINESYNC_IOC_BASE 0xf7
|
||||
--
|
||||
2.36.0
|
||||
2.37.3
|
||||
|
||||
From 127efad71a0702a68890097b114b3467c234259f Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
|
94715
linux-tkg-patches/6.0/0008-6.0-bcachefs.patch
Normal file
94715
linux-tkg-patches/6.0/0008-6.0-bcachefs.patch
Normal file
File diff suppressed because it is too large
Load Diff
90
linux-tkg-patches/6.0/0009-glitched-bmq.patch
Normal file
90
linux-tkg-patches/6.0/0009-glitched-bmq.patch
Normal file
@@ -0,0 +1,90 @@
|
||||
From f7f49141a5dbe9c99d78196b58c44307fb2e6be3 Mon Sep 17 00:00:00 2001
|
||||
From: Tk-Glitch <ti3nou@gmail.com>
|
||||
Date: Wed, 4 Jul 2018 04:30:08 +0200
|
||||
Subject: glitched - BMQ
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_250
|
||||
+ default HZ_500
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -39,6 +39,13 @@ choice
|
||||
on SMP and NUMA systems and exactly dividing by both PAL and
|
||||
NTSC frame rates for video and multimedia work.
|
||||
|
||||
+ config HZ_500
|
||||
+ bool "500 HZ"
|
||||
+ help
|
||||
+ 500 Hz is a balanced timer frequency. Provides fast interactivity
|
||||
+ on desktops with great smoothness without increasing CPU power
|
||||
+ consumption and sacrificing the battery life on laptops.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -52,6 +59,7 @@ config HZ
|
||||
default 100 if HZ_100
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
+ default 500 if HZ_500
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
|
||||
index 2a202a846757..1d9c7ed79b11 100644
|
||||
--- a/kernel/Kconfig.hz
|
||||
+++ b/kernel/Kconfig.hz
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
choice
|
||||
prompt "Timer frequency"
|
||||
- default HZ_500
|
||||
+ default HZ_750
|
||||
help
|
||||
Allows the configuration of the timer frequency. It is customary
|
||||
to have the timer interrupt run at 1000 Hz but 100 Hz may be more
|
||||
@@ -46,6 +46,13 @@ choice
|
||||
on desktops with great smoothness without increasing CPU power
|
||||
consumption and sacrificing the battery life on laptops.
|
||||
|
||||
+ config HZ_750
|
||||
+ bool "750 HZ"
|
||||
+ help
|
||||
+ 750 Hz is a good timer frequency for desktops. Provides fast
|
||||
+ interactivity with great smoothness without sacrificing too
|
||||
+ much throughput.
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ"
|
||||
help
|
||||
@@ -60,6 +67,7 @@ config HZ
|
||||
default 250 if HZ_250
|
||||
default 300 if HZ_300
|
||||
default 500 if HZ_500
|
||||
+ default 750 if HZ_750
|
||||
default 1000 if HZ_1000
|
||||
|
||||
config SCHED_HRTICK
|
||||
|
||||
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||
index 9270a4370d54..30d01e647417 100644
|
||||
--- a/mm/vmscan.c
|
||||
+++ b/mm/vmscan.c
|
||||
@@ -169,7 +169,7 @@
|
||||
/*
|
||||
* From 0 .. 200. Higher means more swappy.
|
||||
*/
|
||||
-int vm_swappiness = 60;
|
||||
+int vm_swappiness = 20;
|
||||
|
||||
static void set_task_reclaim_state(struct task_struct *task,
|
||||
struct reclaim_state *rs)
|
18
linux-tkg-patches/6.0/0009-glitched-ondemand-bmq.patch
Normal file
18
linux-tkg-patches/6.0/0009-glitched-ondemand-bmq.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
|
||||
index 6b423eebfd5d..61e3271675d6 100644
|
||||
--- a/drivers/cpufreq/cpufreq_ondemand.c
|
||||
+++ b/drivers/cpufreq/cpufreq_ondemand.c
|
||||
@@ -21,10 +21,10 @@
|
||||
#include "cpufreq_ondemand.h"
|
||||
|
||||
/* On-demand governor macros */
|
||||
-#define DEF_FREQUENCY_UP_THRESHOLD (80)
|
||||
-#define DEF_SAMPLING_DOWN_FACTOR (1)
|
||||
+#define DEF_FREQUENCY_UP_THRESHOLD (55)
|
||||
+#define DEF_SAMPLING_DOWN_FACTOR (5)
|
||||
#define MAX_SAMPLING_DOWN_FACTOR (100000)
|
||||
-#define MICRO_FREQUENCY_UP_THRESHOLD (95)
|
||||
+#define MICRO_FREQUENCY_UP_THRESHOLD (63)
|
||||
#define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
|
||||
#define MIN_FREQUENCY_UP_THRESHOLD (1)
|
||||
#define MAX_FREQUENCY_UP_THRESHOLD (100)
|
10039
linux-tkg-patches/6.0/0009-prjc_v6.0-r0.patch
Normal file
10039
linux-tkg-patches/6.0/0009-prjc_v6.0-r0.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -64,3 +64,327 @@ index 2c7171e0b0010..85de313ddec29 100644
|
||||
select CPU_FREQ_GOV_PERFORMANCE
|
||||
help
|
||||
|
||||
From 430daaab3c78de6bd82f10cfb5a0f016c6e583f6 Mon Sep 17 00:00:00 2001
|
||||
From: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
|
||||
Date: Mon, 4 Oct 2021 14:07:34 -0400
|
||||
Subject: [PATCH] Bluetooth: fix deadlock for RFCOMM sk state change
|
||||
|
||||
Syzbot reports the following task hang [1]:
|
||||
|
||||
INFO: task syz-executor255:8499 blocked for more than 143 seconds.
|
||||
Not tainted 5.14.0-rc7-syzkaller #0
|
||||
|
||||
Call Trace:
|
||||
context_switch kernel/sched/core.c:4681 [inline]
|
||||
__schedule+0x93a/0x26f0 kernel/sched/core.c:5938
|
||||
schedule+0xd3/0x270 kernel/sched/core.c:6017
|
||||
__lock_sock+0x13d/0x260 net/core/sock.c:2644
|
||||
lock_sock_nested+0xf6/0x120 net/core/sock.c:3185
|
||||
lock_sock include/net/sock.h:1612 [inline]
|
||||
rfcomm_sk_state_change+0xb4/0x390 net/bluetooth/rfcomm/sock.c:73
|
||||
__rfcomm_dlc_close+0x1b6/0x8a0 net/bluetooth/rfcomm/core.c:489
|
||||
rfcomm_dlc_close+0x1ea/0x240 net/bluetooth/rfcomm/core.c:520
|
||||
__rfcomm_sock_close+0xac/0x260 net/bluetooth/rfcomm/sock.c:220
|
||||
rfcomm_sock_shutdown+0xe9/0x210 net/bluetooth/rfcomm/sock.c:931
|
||||
rfcomm_sock_release+0x5f/0x140 net/bluetooth/rfcomm/sock.c:951
|
||||
__sock_release+0xcd/0x280 net/socket.c:649
|
||||
sock_close+0x18/0x20 net/socket.c:1314
|
||||
__fput+0x288/0x920 fs/file_table.c:280
|
||||
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
|
||||
exit_task_work include/linux/task_work.h:32 [inline]
|
||||
do_exit+0xbd4/0x2a60 kernel/exit.c:825
|
||||
do_group_exit+0x125/0x310 kernel/exit.c:922
|
||||
get_signal+0x47f/0x2160 kernel/signal.c:2808
|
||||
arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865
|
||||
handle_signal_work kernel/entry/common.c:148 [inline]
|
||||
exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
|
||||
exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209
|
||||
__syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
|
||||
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
|
||||
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
|
||||
entry_SYSCALL_64_after_hwframe+0x44/0xae
|
||||
|
||||
Showing all locks held in the system:
|
||||
1 lock held by khungtaskd/1653:
|
||||
#0: ffffffff8b97c280 (rcu_read_lock){....}-{1:2}, at:
|
||||
debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6446
|
||||
1 lock held by krfcommd/4781:
|
||||
#0: ffffffff8d306528 (rfcomm_mutex){+.+.}-{3:3}, at:
|
||||
rfcomm_process_sessions net/bluetooth/rfcomm/core.c:1979 [inline]
|
||||
#0: ffffffff8d306528 (rfcomm_mutex){+.+.}-{3:3}, at:
|
||||
rfcomm_run+0x2ed/0x4a20 net/bluetooth/rfcomm/core.c:2086
|
||||
2 locks held by in:imklog/8206:
|
||||
#0: ffff8880182ce5f0 (&f->f_pos_lock){+.+.}-{3:3}, at:
|
||||
__fdget_pos+0xe9/0x100 fs/file.c:974
|
||||
#1: ffff8880b9c51a58 (&rq->__lock){-.-.}-{2:2}, at:
|
||||
raw_spin_rq_lock_nested kernel/sched/core.c:460 [inline]
|
||||
#1: ffff8880b9c51a58 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock
|
||||
kernel/sched/sched.h:1307 [inline]
|
||||
#1: ffff8880b9c51a58 (&rq->__lock){-.-.}-{2:2}, at: rq_lock
|
||||
kernel/sched/sched.h:1610 [inline]
|
||||
#1: ffff8880b9c51a58 (&rq->__lock){-.-.}-{2:2}, at:
|
||||
__schedule+0x233/0x26f0 kernel/sched/core.c:5852
|
||||
4 locks held by syz-executor255/8499:
|
||||
#0: ffff888039a83690 (&sb->s_type->i_mutex_key#13){+.+.}-{3:3}, at:
|
||||
inode_lock include/linux/fs.h:774 [inline]
|
||||
#0: ffff888039a83690 (&sb->s_type->i_mutex_key#13){+.+.}-{3:3}, at:
|
||||
__sock_release+0x86/0x280 net/socket.c:648
|
||||
#1:
|
||||
ffff88802fa31120 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0},
|
||||
at: lock_sock include/net/sock.h:1612 [inline]
|
||||
#1:
|
||||
ffff88802fa31120 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0},
|
||||
at: rfcomm_sock_shutdown+0x54/0x210 net/bluetooth/rfcomm/sock.c:928
|
||||
#2: ffffffff8d306528 (rfcomm_mutex){+.+.}-{3:3}, at:
|
||||
rfcomm_dlc_close+0x34/0x240 net/bluetooth/rfcomm/core.c:507
|
||||
#3: ffff888141bd6d28 (&d->lock){+.+.}-{3:3}, at:
|
||||
__rfcomm_dlc_close+0x162/0x8a0 net/bluetooth/rfcomm/core.c:487
|
||||
==================================================================
|
||||
|
||||
The task hangs because of a deadlock that occurs when lock_sock() is
|
||||
called in rfcomm_sk_state_change(). One such call stack is:
|
||||
|
||||
rfcomm_sock_shutdown():
|
||||
lock_sock();
|
||||
__rfcomm_sock_close():
|
||||
rfcomm_dlc_close():
|
||||
__rfcomm_dlc_close():
|
||||
rfcomm_dlc_lock();
|
||||
rfcomm_sk_state_change():
|
||||
lock_sock();
|
||||
|
||||
lock_sock() has to be called when the sk state is changed because the
|
||||
lock is not always held when rfcomm_sk_state_change() is
|
||||
called. However, besides the recursive deadlock, there is also an
|
||||
issue of a lock hierarchy inversion between rfcomm_dlc_lock() and
|
||||
lock_sock() if the socket is locked in rfcomm_sk_state_change().
|
||||
|
||||
To avoid these issues, we can instead schedule the sk state change in
|
||||
the global workqueue. This is already the implicit assumption about
|
||||
how sk state changes happen. For example, in rfcomm_sock_shutdown(),
|
||||
the call to __rfcomm_sock_close() is followed by
|
||||
bt_sock_wait_state().
|
||||
|
||||
Additionally, the call to rfcomm_sock_kill() inside
|
||||
rfcomm_sk_state_change() should be removed. The socket shouldn't be
|
||||
killed here because only rfcomm_sock_release() calls sock_orphan(),
|
||||
which it already follows up with a call to rfcomm_sock_kill().
|
||||
|
||||
Fixes: b7ce436a5d79 ("Bluetooth: switch to lock_sock in RFCOMM")
|
||||
Link: https://syzkaller.appspot.com/bug?extid=7d51f807c81b190a127d [1]
|
||||
Reported-by: syzbot+7d51f807c81b190a127d@syzkaller.appspotmail.com
|
||||
Tested-by: syzbot+7d51f807c81b190a127d@syzkaller.appspotmail.com
|
||||
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
|
||||
Cc: Hillf Danton <hdanton@sina.com>
|
||||
---
|
||||
include/net/bluetooth/rfcomm.h | 3 +++
|
||||
net/bluetooth/rfcomm/core.c | 2 ++
|
||||
net/bluetooth/rfcomm/sock.c | 34 ++++++++++++++++++++++------------
|
||||
3 files changed, 27 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
|
||||
index 99d26879b02a53..a92799fc5e74d0 100644
|
||||
--- a/include/net/bluetooth/rfcomm.h
|
||||
+++ b/include/net/bluetooth/rfcomm.h
|
||||
@@ -171,6 +171,7 @@ struct rfcomm_dlc {
|
||||
struct rfcomm_session *session;
|
||||
struct sk_buff_head tx_queue;
|
||||
struct timer_list timer;
|
||||
+ struct work_struct state_change_work;
|
||||
|
||||
struct mutex lock;
|
||||
unsigned long state;
|
||||
@@ -186,6 +187,7 @@ struct rfcomm_dlc {
|
||||
u8 sec_level;
|
||||
u8 role_switch;
|
||||
u32 defer_setup;
|
||||
+ int err;
|
||||
|
||||
uint mtu;
|
||||
uint cfc;
|
||||
@@ -310,6 +312,7 @@ struct rfcomm_pinfo {
|
||||
u8 role_switch;
|
||||
};
|
||||
|
||||
+void __rfcomm_sk_state_change(struct work_struct *work);
|
||||
int rfcomm_init_sockets(void);
|
||||
void rfcomm_cleanup_sockets(void);
|
||||
|
||||
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
|
||||
index 7324764384b677..c6494e85cd68b2 100644
|
||||
--- a/net/bluetooth/rfcomm/core.c
|
||||
+++ b/net/bluetooth/rfcomm/core.c
|
||||
@@ -289,6 +289,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
|
||||
d->flags = 0;
|
||||
d->mscex = 0;
|
||||
d->sec_level = BT_SECURITY_LOW;
|
||||
+ d->err = 0;
|
||||
d->mtu = RFCOMM_DEFAULT_MTU;
|
||||
d->v24_sig = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV;
|
||||
|
||||
@@ -306,6 +307,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
|
||||
timer_setup(&d->timer, rfcomm_dlc_timeout, 0);
|
||||
|
||||
skb_queue_head_init(&d->tx_queue);
|
||||
+ INIT_WORK(&d->state_change_work, __rfcomm_sk_state_change);
|
||||
mutex_init(&d->lock);
|
||||
refcount_set(&d->refcnt, 1);
|
||||
|
||||
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
|
||||
index 4bf4ea6cbb5eee..4850dafbaa05fb 100644
|
||||
--- a/net/bluetooth/rfcomm/sock.c
|
||||
+++ b/net/bluetooth/rfcomm/sock.c
|
||||
@@ -61,19 +61,22 @@ static void rfcomm_sk_data_ready(struct rfcomm_dlc *d, struct sk_buff *skb)
|
||||
rfcomm_dlc_throttle(d);
|
||||
}
|
||||
|
||||
-static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err)
|
||||
+void __rfcomm_sk_state_change(struct work_struct *work)
|
||||
{
|
||||
+ struct rfcomm_dlc *d = container_of(work, struct rfcomm_dlc,
|
||||
+ state_change_work);
|
||||
struct sock *sk = d->owner, *parent;
|
||||
|
||||
if (!sk)
|
||||
return;
|
||||
|
||||
- BT_DBG("dlc %p state %ld err %d", d, d->state, err);
|
||||
-
|
||||
lock_sock(sk);
|
||||
+ rfcomm_dlc_lock(d);
|
||||
|
||||
- if (err)
|
||||
- sk->sk_err = err;
|
||||
+ BT_DBG("dlc %p state %ld err %d", d, d->state, d->err);
|
||||
+
|
||||
+ if (d->err)
|
||||
+ sk->sk_err = d->err;
|
||||
|
||||
sk->sk_state = d->state;
|
||||
|
||||
@@ -91,15 +94,22 @@ static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err)
|
||||
sk->sk_state_change(sk);
|
||||
}
|
||||
|
||||
+ rfcomm_dlc_unlock(d);
|
||||
release_sock(sk);
|
||||
+ sock_put(sk);
|
||||
+}
|
||||
|
||||
- if (parent && sock_flag(sk, SOCK_ZAPPED)) {
|
||||
- /* We have to drop DLC lock here, otherwise
|
||||
- * rfcomm_sock_destruct() will dead lock. */
|
||||
- rfcomm_dlc_unlock(d);
|
||||
- rfcomm_sock_kill(sk);
|
||||
- rfcomm_dlc_lock(d);
|
||||
- }
|
||||
+static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err)
|
||||
+{
|
||||
+ struct sock *sk = d->owner;
|
||||
+
|
||||
+ if (!sk)
|
||||
+ return;
|
||||
+
|
||||
+ d->err = err;
|
||||
+ sock_hold(sk);
|
||||
+ if (!schedule_work(&d->state_change_work))
|
||||
+ sock_put(sk);
|
||||
}
|
||||
|
||||
/* ---- Socket functions ---- */
|
||||
From 50e6a66675f6c9835d4f1d4f8c947d1699ce8e24 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
|
||||
Date: Fri, 7 Oct 2022 09:51:13 +0200
|
||||
Subject: [PATCH 4/5] drm/sched: add DRM_SCHED_FENCE_DONT_PIPELINE flag
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Setting this flag on a scheduler fence prevents pipelining of jobs
|
||||
depending on this fence. In other words we always insert a full CPU
|
||||
round trip before dependen jobs are pushed to the pipeline.
|
||||
|
||||
Signed-off-by: Christian König <christian.koenig@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/scheduler/sched_entity.c | 3 ++-
|
||||
include/drm/gpu_scheduler.h | 9 +++++++++
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
|
||||
index 6b25b2f4f5a3..6137537aaea4 100644
|
||||
--- a/drivers/gpu/drm/scheduler/sched_entity.c
|
||||
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
|
||||
@@ -385,7 +385,8 @@ static bool drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity)
|
||||
}
|
||||
|
||||
s_fence = to_drm_sched_fence(fence);
|
||||
- if (s_fence && s_fence->sched == sched) {
|
||||
+ if (s_fence && s_fence->sched == sched &&
|
||||
+ !test_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &fence->flags)) {
|
||||
|
||||
/*
|
||||
* Fence is from the same scheduler, only need to wait for
|
||||
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
|
||||
index addb135eeea6..289a33e80639 100644
|
||||
--- a/include/drm/gpu_scheduler.h
|
||||
+++ b/include/drm/gpu_scheduler.h
|
||||
@@ -32,6 +32,15 @@
|
||||
|
||||
#define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000)
|
||||
|
||||
+/**
|
||||
+ * DRM_SCHED_FENCE_DONT_PIPELINE - Prefent dependency pipelining
|
||||
+ *
|
||||
+ * Setting this flag on a scheduler fence prevents pipelining of jobs depending
|
||||
+ * on this fence. In other words we always insert a full CPU round trip before
|
||||
+ * dependen jobs are pushed to the hw queue.
|
||||
+ */
|
||||
+#define DRM_SCHED_FENCE_DONT_PIPELINE DMA_FENCE_FLAG_USER_BITS
|
||||
+
|
||||
struct drm_gem_object;
|
||||
|
||||
struct drm_gpu_scheduler;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
From e15e1601fba660124acd7ad41b6f61d46a1c4835 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
|
||||
Date: Fri, 7 Oct 2022 10:59:58 +0200
|
||||
Subject: [PATCH 5/5] drm/amdgpu: use DRM_SCHED_FENCE_DONT_PIPELINE for VM
|
||||
updates
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Make sure that we always have a CPU round trip to let the submission
|
||||
code correctly decide if a TLB flush is necessary or not.
|
||||
|
||||
Signed-off-by: Christian König <christian.koenig@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
|
||||
index 1fd3cbca20a2..c7bf189d50de 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
|
||||
@@ -115,8 +115,15 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
|
||||
amdgpu_bo_fence(p->vm->root.bo, f, true);
|
||||
}
|
||||
|
||||
- if (fence && !p->immediate)
|
||||
+ if (fence && !p->immediate) {
|
||||
+ /*
|
||||
+ * Most hw generations now have a separate queue for page table
|
||||
+ * updates, but when the queue is shared with userspace we need
|
||||
+ * the extra CPU round trip to correctly flush the TLB.
|
||||
+ */
|
||||
+ set_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &f->flags);
|
||||
swap(*fence, f);
|
||||
+ }
|
||||
dma_fence_put(f);
|
||||
return 0;
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
53
linux-tkg-patches/6.0/0013-fedora-rpm.patch
Normal file
53
linux-tkg-patches/6.0/0013-fedora-rpm.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
|
||||
index 70392fd2f..34f98648f 100755
|
||||
--- a/scripts/package/mkspec
|
||||
+++ b/scripts/package/mkspec
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
+PROVIDES_DRM=""
|
||||
if grep -q CONFIG_DRM=y .config; then
|
||||
- PROVIDES=kernel-drm
|
||||
+ PROVIDES_DRM="Provides: kernel-drm = %{version}"
|
||||
fi
|
||||
|
||||
-PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
|
||||
__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
|
||||
@@ -50,3 +50,6 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
|
||||
$S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
- Provides: $PROVIDES
|
||||
+ $PROVIDES_DRM
|
||||
+ Provides: kernel = %{version}
|
||||
+ Provides: kernel-uname-r = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
# $UTS_MACHINE as a fallback of _arch in case
|
||||
@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz
|
||||
Group: Development/System
|
||||
- Obsoletes: kernel-headers
|
||||
Provides: kernel-headers = %{version}
|
||||
+ Provides: installonlypkg(kernel) = %{version}
|
||||
%description headers
|
||||
@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE
|
||||
$S$M Group: System Environment/Kernel
|
||||
+$S$M Provides: kernel-devel = %{version}
|
||||
+$S$M Provides: kernel-devel-uname-r = %{version}
|
||||
+$S$M Provides: installonlypkg(kernel) = %{version}
|
||||
$S$M AutoReqProv: no
|
||||
@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package.
|
||||
$S$M
|
||||
+$S # Opt out of a lot of Fedora hardening flags etc...
|
||||
+$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
|
||||
+$S %undefine _package_note_file
|
||||
+$S %undefine _auto_set_build_flags
|
||||
+$S %undefine _include_frame_pointers
|
||||
+$S %define _build_id_flags -Wl,--build-id=none
|
||||
+$S %undefine _annotated_build
|
||||
+$S %undefine _fortify_level
|
||||
+$S %undefine _hardened_build
|
||||
+$S %global _lto_cflags %{nil}
|
||||
+$S %global _configure_gnuconfig_hack 0
|
||||
+$S %global _configure_libtool_hardening_hack 0
|
||||
+$S # Nearly had to go to the deep web to find documentation on this one... Gosh
|
||||
+$S # See https://github.com/rpm-software-management/rpm/blob/master/macros.in#L471
|
||||
+$S %define _build_id_links none
|
||||
+$S
|
||||
$S %prep
|
703
linux-tkg-patches/6.0/0014-OpenRGB.patch
Normal file
703
linux-tkg-patches/6.0/0014-OpenRGB.patch
Normal file
@@ -0,0 +1,703 @@
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
+config I2C_NCT6775
|
||||
+ tristate "Nuvoton NCT6775 and compatible SMBus controller"
|
||||
+ help
|
||||
+ If you say yes to this option, support will be included for the
|
||||
+ Nuvoton NCT6775 and compatible SMBus controllers.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called i2c-nct6775.
|
||||
+
|
||||
config I2C_NFORCE2
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
+obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
|
||||
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
|
||||
obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
+/*
|
||||
+ * i2c-nct6775 - Driver for the SMBus master functionality of
|
||||
+ * Nuvoton NCT677x Super-I/O chips
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
|
||||
+ *
|
||||
+ * Derived from nct6775 hwmon driver
|
||||
+ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon-vid.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/nospec.h>
|
||||
+
|
||||
+#define DRVNAME "i2c-nct6775"
|
||||
+
|
||||
+/* Nuvoton SMBus address offsets */
|
||||
+#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
|
||||
+#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
|
||||
+#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
|
||||
+#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
|
||||
+
|
||||
+/* Command register */
|
||||
+#define NCT6793D_READ_BYTE 0
|
||||
+#define NCT6793D_READ_WORD 1
|
||||
+#define NCT6793D_READ_BLOCK 2
|
||||
+#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
|
||||
+#define NCT6793D_PROC_CALL 4
|
||||
+#define NCT6793D_WRITE_BYTE 8
|
||||
+#define NCT6793D_WRITE_WORD 9
|
||||
+#define NCT6793D_WRITE_BLOCK 10
|
||||
+
|
||||
+/* Control register */
|
||||
+#define NCT6793D_MANUAL_START 128
|
||||
+#define NCT6793D_SOFT_RESET 64
|
||||
+
|
||||
+/* Error register */
|
||||
+#define NCT6793D_NO_ACK 32
|
||||
+
|
||||
+/* Status register */
|
||||
+#define NCT6793D_FIFO_EMPTY 1
|
||||
+#define NCT6793D_FIFO_FULL 2
|
||||
+#define NCT6793D_MANUAL_ACTIVE 4
|
||||
+
|
||||
+#define NCT6775_LD_SMBUS 0x0B
|
||||
+
|
||||
+/* Other settings */
|
||||
+#define MAX_RETRIES 400
|
||||
+
|
||||
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
|
||||
+ nct6795, nct6796, nct6798 };
|
||||
+
|
||||
+struct nct6775_sio_data {
|
||||
+ int sioreg;
|
||||
+ enum kinds kind;
|
||||
+};
|
||||
+
|
||||
+/* used to set data->name = nct6775_device_names[data->sio_kind] */
|
||||
+static const char * const nct6775_device_names[] = {
|
||||
+ "nct6106",
|
||||
+ "nct6775",
|
||||
+ "nct6776",
|
||||
+ "nct6779",
|
||||
+ "nct6791",
|
||||
+ "nct6792",
|
||||
+ "nct6793",
|
||||
+ "nct6795",
|
||||
+ "nct6796",
|
||||
+ "nct6798",
|
||||
+};
|
||||
+
|
||||
+static const char * const nct6775_sio_names[] __initconst = {
|
||||
+ "NCT6106D",
|
||||
+ "NCT6775F",
|
||||
+ "NCT6776D/F",
|
||||
+ "NCT6779D",
|
||||
+ "NCT6791D",
|
||||
+ "NCT6792D",
|
||||
+ "NCT6793D",
|
||||
+ "NCT6795D",
|
||||
+ "NCT6796D",
|
||||
+ "NCT6798D",
|
||||
+};
|
||||
+
|
||||
+#define SIO_REG_LDSEL 0x07 /* Logical device select */
|
||||
+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
|
||||
+#define SIO_REG_SMBA 0x62 /* SMBus base address register */
|
||||
+
|
||||
+#define SIO_NCT6106_ID 0xc450
|
||||
+#define SIO_NCT6775_ID 0xb470
|
||||
+#define SIO_NCT6776_ID 0xc330
|
||||
+#define SIO_NCT6779_ID 0xc560
|
||||
+#define SIO_NCT6791_ID 0xc800
|
||||
+#define SIO_NCT6792_ID 0xc910
|
||||
+#define SIO_NCT6793_ID 0xd120
|
||||
+#define SIO_NCT6795_ID 0xd350
|
||||
+#define SIO_NCT6796_ID 0xd420
|
||||
+#define SIO_NCT6798_ID 0xd428
|
||||
+#define SIO_ID_MASK 0xFFF0
|
||||
+
|
||||
+static inline void
|
||||
+superio_outb(int ioreg, int reg, int val)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ outb(val, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_inb(int ioreg, int reg)
|
||||
+{
|
||||
+ outb(reg, ioreg);
|
||||
+ return inb(ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_select(int ioreg, int ld)
|
||||
+{
|
||||
+ outb(SIO_REG_LDSEL, ioreg);
|
||||
+ outb(ld, ioreg + 1);
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+superio_enter(int ioreg)
|
||||
+{
|
||||
+ /*
|
||||
+ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
|
||||
+ */
|
||||
+ if (!request_muxed_region(ioreg, 2, DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ outb(0x87, ioreg);
|
||||
+ outb(0x87, ioreg);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+superio_exit(int ioreg)
|
||||
+{
|
||||
+ outb(0xaa, ioreg);
|
||||
+ outb(0x02, ioreg);
|
||||
+ outb(0x02, ioreg + 1);
|
||||
+ release_region(ioreg, 2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ISA constants
|
||||
+ */
|
||||
+
|
||||
+#define IOREGION_ALIGNMENT (~7)
|
||||
+#define IOREGION_LENGTH 2
|
||||
+#define ADDR_REG_OFFSET 0
|
||||
+#define DATA_REG_OFFSET 1
|
||||
+
|
||||
+#define NCT6775_REG_BANK 0x4E
|
||||
+#define NCT6775_REG_CONFIG 0x40
|
||||
+
|
||||
+static struct i2c_adapter *nct6775_adapter;
|
||||
+
|
||||
+struct i2c_nct6775_adapdata {
|
||||
+ unsigned short smba;
|
||||
+};
|
||||
+
|
||||
+/* Return negative errno on error. */
|
||||
+static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
|
||||
+ unsigned short flags, char read_write,
|
||||
+ u8 command, int size, union i2c_smbus_data * data)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
|
||||
+ int i, len, cnt;
|
||||
+ union i2c_smbus_data tmp_data;
|
||||
+ int timeout = 0;
|
||||
+
|
||||
+ tmp_data.word = 0;
|
||||
+ cnt = 0;
|
||||
+ len = 0;
|
||||
+
|
||||
+ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ tmp_data.byte = data->byte;
|
||||
+ case I2C_SMBUS_BYTE:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(tmp_data.byte, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ outb_p(data->word & 0xff, SMBHSTDAT);
|
||||
+ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
|
||||
+ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
|
||||
+ }
|
||||
+ break;
|
||||
+ case I2C_SMBUS_BLOCK_DATA:
|
||||
+ outb_p((addr << 1) | read_write,
|
||||
+ SMBHSTADD);
|
||||
+ outb_p(command, SMBHSTIDX);
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ len = data->block[0];
|
||||
+ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
|
||||
+ return -EINVAL;
|
||||
+ outb_p(len, SMBBLKSZ);
|
||||
+
|
||||
+ cnt = 1;
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= 4; i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= len; i++ ) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
|
||||
+
|
||||
+ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
|
||||
+ if (read_write == I2C_SMBUS_WRITE) {
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ //Load more bytes into FIFO
|
||||
+ if (len >= 4) {
|
||||
+ for (i = cnt; i <= (cnt + 4); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len -= 4;
|
||||
+ cnt += 4;
|
||||
+ }
|
||||
+ else {
|
||||
+ for (i = cnt; i <= (cnt + len); i++) {
|
||||
+ outb_p(data->block[i], SMBHSTDAT);
|
||||
+ }
|
||||
+
|
||||
+ len = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ return -ENOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ //wait for manual mode to complete
|
||||
+ timeout = 0;
|
||||
+ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
|
||||
+ {
|
||||
+ if(timeout > MAX_RETRIES)
|
||||
+ {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ usleep_range(250, 500);
|
||||
+ timeout++;
|
||||
+ }
|
||||
+
|
||||
+ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
|
||||
+ return -ENXIO;
|
||||
+ }
|
||||
+ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ switch (size) {
|
||||
+ case I2C_SMBUS_QUICK:
|
||||
+ case I2C_SMBUS_BYTE_DATA:
|
||||
+ data->byte = inb_p(SMBHSTDAT);
|
||||
+ break;
|
||||
+ case I2C_SMBUS_WORD_DATA:
|
||||
+ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
|
||||
+ break;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32 nct6775_func(struct i2c_adapter *adapter)
|
||||
+{
|
||||
+ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
|
||||
+ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
|
||||
+ I2C_FUNC_SMBUS_BLOCK_DATA;
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_algorithm smbus_algorithm = {
|
||||
+ .smbus_xfer = nct6775_access,
|
||||
+ .functionality = nct6775_func,
|
||||
+};
|
||||
+
|
||||
+static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
|
||||
+{
|
||||
+ struct i2c_adapter *adap;
|
||||
+ struct i2c_nct6775_adapdata *adapdata;
|
||||
+ int retval;
|
||||
+
|
||||
+ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
|
||||
+ if (adap == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adap->owner = THIS_MODULE;
|
||||
+ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
+ adap->algo = &smbus_algorithm;
|
||||
+
|
||||
+ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
|
||||
+ if (adapdata == NULL) {
|
||||
+ kfree(adap);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ adapdata->smba = smba;
|
||||
+
|
||||
+ snprintf(adap->name, sizeof(adap->name),
|
||||
+ "SMBus NCT67xx adapter%s at %04x", name, smba);
|
||||
+
|
||||
+ i2c_set_adapdata(adap, adapdata);
|
||||
+
|
||||
+ retval = i2c_add_adapter(adap);
|
||||
+ if (retval) {
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ *padap = adap;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nct6775_remove_adapter(struct i2c_adapter *adap)
|
||||
+{
|
||||
+ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
|
||||
+
|
||||
+ if (adapdata->smba) {
|
||||
+ i2c_del_adapter(adap);
|
||||
+ kfree(adapdata);
|
||||
+ kfree(adap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
|
||||
+
|
||||
+/*
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * bus will manage the lifetime of the device and this module will only keep
|
||||
+ * track of the nct6775 driver. But since we use platform_device_alloc(), we
|
||||
+ * must keep track of the device
|
||||
+ */
|
||||
+static struct platform_device *pdev[2];
|
||||
+
|
||||
+static int nct6775_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
|
||||
+ struct resource *res;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
+ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
|
||||
+ DRVNAME))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ switch (sio_data->kind) {
|
||||
+ case nct6791:
|
||||
+ case nct6792:
|
||||
+ case nct6793:
|
||||
+ case nct6795:
|
||||
+ case nct6796:
|
||||
+ case nct6798:
|
||||
+ nct6775_add_adapter(res->start, "", &nct6775_adapter);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+/*
|
||||
+static void nct6791_enable_io_mapping(int sioaddr)
|
||||
+{
|
||||
+ int val;
|
||||
+
|
||||
+ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
|
||||
+ if (val & 0x10) {
|
||||
+ pr_info("Enabling hardware monitor logical device mappings.\n");
|
||||
+ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
|
||||
+ val & ~0x10);
|
||||
+ }
|
||||
+}*/
|
||||
+
|
||||
+static struct platform_driver i2c_nct6775_driver = {
|
||||
+ .driver = {
|
||||
+ .name = DRVNAME,
|
||||
+// .pm = &nct6775_dev_pm_ops,
|
||||
+ },
|
||||
+ .probe = nct6775_probe,
|
||||
+};
|
||||
+
|
||||
+static void __exit i2c_nct6775_exit(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if(nct6775_adapter)
|
||||
+ nct6775_remove_adapter(nct6775_adapter);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+}
|
||||
+
|
||||
+/* nct6775_find() looks for a '627 in the Super-I/O config space */
|
||||
+static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
|
||||
+{
|
||||
+ u16 val;
|
||||
+ int err;
|
||||
+ int addr;
|
||||
+
|
||||
+ err = superio_enter(sioaddr);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
|
||||
+ superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
+
|
||||
+ switch (val & SIO_ID_MASK) {
|
||||
+ case SIO_NCT6106_ID:
|
||||
+ sio_data->kind = nct6106;
|
||||
+ break;
|
||||
+ case SIO_NCT6775_ID:
|
||||
+ sio_data->kind = nct6775;
|
||||
+ break;
|
||||
+ case SIO_NCT6776_ID:
|
||||
+ sio_data->kind = nct6776;
|
||||
+ break;
|
||||
+ case SIO_NCT6779_ID:
|
||||
+ sio_data->kind = nct6779;
|
||||
+ break;
|
||||
+ case SIO_NCT6791_ID:
|
||||
+ sio_data->kind = nct6791;
|
||||
+ break;
|
||||
+ case SIO_NCT6792_ID:
|
||||
+ sio_data->kind = nct6792;
|
||||
+ break;
|
||||
+ case SIO_NCT6793_ID:
|
||||
+ sio_data->kind = nct6793;
|
||||
+ break;
|
||||
+ case SIO_NCT6795_ID:
|
||||
+ sio_data->kind = nct6795;
|
||||
+ break;
|
||||
+ case SIO_NCT6796_ID:
|
||||
+ sio_data->kind = nct6796;
|
||||
+ break;
|
||||
+ case SIO_NCT6798_ID:
|
||||
+ sio_data->kind = nct6798;
|
||||
+ break;
|
||||
+ default:
|
||||
+ if (val != 0xffff)
|
||||
+ pr_debug("unsupported chip ID: 0x%04x\n", val);
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* We have a known chip, find the SMBus I/O address */
|
||||
+ superio_select(sioaddr, NCT6775_LD_SMBUS);
|
||||
+ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
|
||||
+ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
+ addr = val & IOREGION_ALIGNMENT;
|
||||
+ if (addr == 0) {
|
||||
+ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
|
||||
+ superio_exit(sioaddr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
|
||||
+ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
|
||||
+ // sio_data->kind == nct6796)
|
||||
+ // nct6791_enable_io_mapping(sioaddr);
|
||||
+
|
||||
+ superio_exit(sioaddr);
|
||||
+ pr_info("Found %s or compatible chip at %#x:%#x\n",
|
||||
+ nct6775_sio_names[sio_data->kind], sioaddr, addr);
|
||||
+ sio_data->sioreg = sioaddr;
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+static int __init i2c_nct6775_init(void)
|
||||
+{
|
||||
+ int i, err;
|
||||
+ bool found = false;
|
||||
+ int address;
|
||||
+ struct resource res;
|
||||
+ struct nct6775_sio_data sio_data;
|
||||
+ int sioaddr[2] = { 0x2e, 0x4e };
|
||||
+
|
||||
+ err = platform_driver_register(&i2c_nct6775_driver);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /*
|
||||
+ * initialize sio_data->kind and sio_data->sioreg.
|
||||
+ *
|
||||
+ * when Super-I/O functions move to a separate file, the Super-I/O
|
||||
+ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
|
||||
+ * nct6775 hardware monitor, and call probe()
|
||||
+ */
|
||||
+ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
|
||||
+ address = nct6775_find(sioaddr[i], &sio_data);
|
||||
+ if (address <= 0)
|
||||
+ continue;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ pdev[i] = platform_device_alloc(DRVNAME, address);
|
||||
+ if (!pdev[i]) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto exit_device_unregister;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_data(pdev[i], &sio_data,
|
||||
+ sizeof(struct nct6775_sio_data));
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ memset(&res, 0, sizeof(res));
|
||||
+ res.name = DRVNAME;
|
||||
+ res.start = address;
|
||||
+ res.end = address + IOREGION_LENGTH - 1;
|
||||
+ res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ err = acpi_check_resource_conflict(&res);
|
||||
+ if (err) {
|
||||
+ platform_device_put(pdev[i]);
|
||||
+ pdev[i] = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ err = platform_device_add_resources(pdev[i], &res, 1);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+
|
||||
+ /* platform_device_add calls probe() */
|
||||
+ err = platform_device_add(pdev[i]);
|
||||
+ if (err)
|
||||
+ goto exit_device_put;
|
||||
+ }
|
||||
+ if (!found) {
|
||||
+ err = -ENODEV;
|
||||
+ goto exit_unregister;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+exit_device_put:
|
||||
+ platform_device_put(pdev[i]);
|
||||
+exit_device_unregister:
|
||||
+ while (--i >= 0) {
|
||||
+ if (pdev[i])
|
||||
+ platform_device_unregister(pdev[i]);
|
||||
+ }
|
||||
+exit_unregister:
|
||||
+ platform_driver_unregister(&i2c_nct6775_driver);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
|
||||
+MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
while ((++timeout < MAX_TIMEOUT) &&
|
||||
((temp = inb_p(SMBHSTSTS)) & 0x01))
|
||||
- usleep_range(250, 500);
|
||||
+ usleep_range(25, 50);
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
@@ -0,0 +1,151 @@
|
||||
From d50977b164e708bf523a35ef53315355528c3ca6 Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 04:53:20 +0200
|
||||
Subject: [PATCH] ZEN: Add sysctl and CONFIG to disallow unprivileged
|
||||
CLONE_NEWUSER
|
||||
|
||||
Our default behavior continues to match the vanilla kernel.
|
||||
---
|
||||
include/linux/user_namespace.h | 4 ++++
|
||||
init/Kconfig | 16 ++++++++++++++++
|
||||
kernel/fork.c | 14 ++++++++++++++
|
||||
kernel/sysctl.c | 12 ++++++++++++
|
||||
kernel/user_namespace.c | 7 +++++++
|
||||
5 files changed, 53 insertions(+)
|
||||
|
||||
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
|
||||
index 45f09bec02c485..87b20e2ee27445 100644
|
||||
--- a/include/linux/user_namespace.h
|
||||
+++ b/include/linux/user_namespace.h
|
||||
@@ -148,6 +148,8 @@ static inline void set_userns_rlimit_max(struct user_namespace *ns,
|
||||
|
||||
#ifdef CONFIG_USER_NS
|
||||
|
||||
+extern int unprivileged_userns_clone;
|
||||
+
|
||||
static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
|
||||
{
|
||||
if (ns)
|
||||
@@ -181,6 +183,8 @@ extern bool current_in_userns(const struct user_namespace *target_ns);
|
||||
struct ns_common *ns_get_owner(struct ns_common *ns);
|
||||
#else
|
||||
|
||||
+#define unprivileged_userns_clone 0
|
||||
+
|
||||
static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
|
||||
{
|
||||
return &init_user_ns;
|
||||
diff --git a/init/Kconfig b/init/Kconfig
|
||||
index 94125d3b6893c7..9f7139b536f638 100644
|
||||
--- a/init/Kconfig
|
||||
+++ b/init/Kconfig
|
||||
@@ -1247,6 +1247,22 @@ config USER_NS
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
+config USER_NS_UNPRIVILEGED
|
||||
+ bool "Allow unprivileged users to create namespaces"
|
||||
+ default y
|
||||
+ depends on USER_NS
|
||||
+ help
|
||||
+ When disabled, unprivileged users will not be able to create
|
||||
+ new namespaces. Allowing users to create their own namespaces
|
||||
+ has been part of several recent local privilege escalation
|
||||
+ exploits, so if you need user namespaces but are
|
||||
+ paranoid^Wsecurity-conscious you want to disable this.
|
||||
+
|
||||
+ This setting can be overridden at runtime via the
|
||||
+ kernel.unprivileged_userns_clone sysctl.
|
||||
+
|
||||
+ If unsure, say Y.
|
||||
+
|
||||
config PID_NS
|
||||
bool "PID Namespaces"
|
||||
default y
|
||||
diff --git a/kernel/fork.c b/kernel/fork.c
|
||||
index 08969f5aa38d59..ff601cb7a1fae0 100644
|
||||
--- a/kernel/fork.c
|
||||
+++ b/kernel/fork.c
|
||||
@@ -98,6 +98,10 @@
|
||||
#include <linux/io_uring.h>
|
||||
#include <linux/bpf.h>
|
||||
|
||||
+#ifdef CONFIG_USER_NS
|
||||
+#include <linux/user_namespace.h>
|
||||
+#endif
|
||||
+
|
||||
#include <asm/pgalloc.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/mmu_context.h>
|
||||
@@ -2008,6 +2012,10 @@ static __latent_entropy struct task_struct *copy_process(
|
||||
if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
+ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone)
|
||||
+ if (!capable(CAP_SYS_ADMIN))
|
||||
+ return ERR_PTR(-EPERM);
|
||||
+
|
||||
/*
|
||||
* Thread groups must share signals as well, and detached threads
|
||||
* can only be started up within the thread group.
|
||||
@@ -3166,6 +3174,12 @@ int ksys_unshare(unsigned long unshare_flags)
|
||||
if (unshare_flags & CLONE_NEWNS)
|
||||
unshare_flags |= CLONE_FS;
|
||||
|
||||
+ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
|
||||
+ err = -EPERM;
|
||||
+ if (!capable(CAP_SYS_ADMIN))
|
||||
+ goto bad_unshare_out;
|
||||
+ }
|
||||
+
|
||||
err = check_unshare_flags(unshare_flags);
|
||||
if (err)
|
||||
goto bad_unshare_out;
|
||||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
|
||||
index c6d9dec11b749d..9a4514ad481b21 100644
|
||||
--- a/kernel/sysctl.c
|
||||
+++ b/kernel/sysctl.c
|
||||
@@ -81,6 +81,9 @@
|
||||
#ifdef CONFIG_RT_MUTEXES
|
||||
#include <linux/rtmutex.h>
|
||||
#endif
|
||||
+#ifdef CONFIG_USER_NS
|
||||
+#include <linux/user_namespace.h>
|
||||
+#endif
|
||||
|
||||
/* shared constants to be used in various sysctls */
|
||||
const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
|
||||
@@ -1659,6 +1662,15 @@ static struct ctl_table kern_table[] = {
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec,
|
||||
},
|
||||
+#ifdef CONFIG_USER_NS
|
||||
+ {
|
||||
+ .procname = "unprivileged_userns_clone",
|
||||
+ .data = &unprivileged_userns_clone,
|
||||
+ .maxlen = sizeof(int),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = proc_dointvec,
|
||||
+ },
|
||||
+#endif
|
||||
#ifdef CONFIG_PROC_SYSCTL
|
||||
{
|
||||
.procname = "tainted",
|
||||
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
|
||||
index 54211dbd516c57..16ca0c1516298d 100644
|
||||
--- a/kernel/user_namespace.c
|
||||
+++ b/kernel/user_namespace.c
|
||||
@@ -22,6 +22,13 @@
|
||||
#include <linux/bsearch.h>
|
||||
#include <linux/sort.h>
|
||||
|
||||
+/* sysctl */
|
||||
+#ifdef CONFIG_USER_NS_UNPRIVILEGED
|
||||
+int unprivileged_userns_clone = 1;
|
||||
+#else
|
||||
+int unprivileged_userns_clone;
|
||||
+#endif
|
||||
+
|
||||
static struct kmem_cache *user_ns_cachep __read_mostly;
|
||||
static DEFINE_MUTEX(userns_state_mutex);
|
||||
|
@@ -0,0 +1,244 @@
|
||||
From 5ae86c8436b83762bc6cf46bea1da6ace2d3f50e Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Wed, 6 May 2020 14:37:44 +0300
|
||||
Subject: [PATCH 1/2] mm: Support soft dirty flag reset for VA range.
|
||||
|
||||
---
|
||||
fs/proc/task_mmu.c | 129 ++++++++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 103 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
|
||||
index 3cec6fbef725..7c7865028f10 100644
|
||||
--- a/fs/proc/task_mmu.c
|
||||
+++ b/fs/proc/task_mmu.c
|
||||
@@ -1032,6 +1032,8 @@ enum clear_refs_types {
|
||||
|
||||
struct clear_refs_private {
|
||||
enum clear_refs_types type;
|
||||
+ unsigned long start, end;
|
||||
+ bool clear_range;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MEM_SOFT_DIRTY
|
||||
@@ -1125,6 +1127,8 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr,
|
||||
spinlock_t *ptl;
|
||||
struct page *page;
|
||||
|
||||
+ BUG_ON(addr < cp->start || end > cp->end);
|
||||
+
|
||||
ptl = pmd_trans_huge_lock(pmd, vma);
|
||||
if (ptl) {
|
||||
if (cp->type == CLEAR_REFS_SOFT_DIRTY) {
|
||||
@@ -1181,9 +1185,11 @@ static int clear_refs_test_walk(unsigned long start, unsigned long end,
|
||||
struct clear_refs_private *cp = walk->private;
|
||||
struct vm_area_struct *vma = walk->vma;
|
||||
|
||||
- if (vma->vm_flags & VM_PFNMAP)
|
||||
+ if (!cp->clear_range && (vma->vm_flags & VM_PFNMAP))
|
||||
return 1;
|
||||
|
||||
+ BUG_ON(start < cp->start || end > cp->end);
|
||||
+
|
||||
/*
|
||||
* Writing 1 to /proc/pid/clear_refs affects all pages.
|
||||
* Writing 2 to /proc/pid/clear_refs only affects anonymous pages.
|
||||
@@ -1206,10 +1212,12 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct task_struct *task;
|
||||
- char buffer[PROC_NUMBUF];
|
||||
+ char buffer[18];
|
||||
struct mm_struct *mm;
|
||||
struct vm_area_struct *vma;
|
||||
enum clear_refs_types type;
|
||||
+ unsigned long start, end;
|
||||
+ bool clear_range;
|
||||
int itype;
|
||||
int rv;
|
||||
|
||||
@@ -1218,12 +1226,34 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
|
||||
count = sizeof(buffer) - 1;
|
||||
if (copy_from_user(buffer, buf, count))
|
||||
return -EFAULT;
|
||||
- rv = kstrtoint(strstrip(buffer), 10, &itype);
|
||||
- if (rv < 0)
|
||||
- return rv;
|
||||
- type = (enum clear_refs_types)itype;
|
||||
- if (type < CLEAR_REFS_ALL || type >= CLEAR_REFS_LAST)
|
||||
- return -EINVAL;
|
||||
+
|
||||
+ if (buffer[0] == '6')
|
||||
+ {
|
||||
+ static int once;
|
||||
+
|
||||
+ if (!once++)
|
||||
+ printk(KERN_DEBUG "task_mmu: Using POC clear refs range implementation.\n");
|
||||
+
|
||||
+ if (count != 17)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ type = CLEAR_REFS_SOFT_DIRTY;
|
||||
+ start = *(unsigned long *)(buffer + 1);
|
||||
+ end = *(unsigned long *)(buffer + 1 + 8);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ rv = kstrtoint(strstrip(buffer), 10, &itype);
|
||||
+ if (rv < 0)
|
||||
+ return rv;
|
||||
+ type = (enum clear_refs_types)itype;
|
||||
+
|
||||
+ if (type < CLEAR_REFS_ALL || type >= CLEAR_REFS_LAST)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ start = 0;
|
||||
+ end = -1UL;
|
||||
+ }
|
||||
|
||||
task = get_proc_task(file_inode(file));
|
||||
if (!task)
|
||||
@@ -1235,40 +1265,86 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
|
||||
.type = type,
|
||||
};
|
||||
|
||||
- if (mmap_write_lock_killable(mm)) {
|
||||
- count = -EINTR;
|
||||
- goto out_mm;
|
||||
+ if (start || end != -1UL)
|
||||
+ {
|
||||
+ start = min(start, -1) & PAGE_MASK;
|
||||
+ end = min(end, -1) & PAGE_MASK;
|
||||
+
|
||||
+ if (start >= end)
|
||||
+ {
|
||||
+ count = -EINVAL;
|
||||
+ goto out_mm;
|
||||
+ }
|
||||
+ clear_range = true;
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ clear_range = false;
|
||||
+ }
|
||||
+
|
||||
+ cp.start = start;
|
||||
+ cp.end = end;
|
||||
+ cp.clear_range = clear_range;
|
||||
+
|
||||
if (type == CLEAR_REFS_MM_HIWATER_RSS) {
|
||||
+ if (mmap_write_lock_killable(mm)) {
|
||||
+ count = -EINTR;
|
||||
+ goto out_mm;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Writing 5 to /proc/pid/clear_refs resets the peak
|
||||
* resident set size to this mm's current rss value.
|
||||
*/
|
||||
reset_mm_hiwater_rss(mm);
|
||||
- goto out_unlock;
|
||||
+ mmap_write_unlock(mm);
|
||||
+ goto out_mm;
|
||||
}
|
||||
|
||||
if (type == CLEAR_REFS_SOFT_DIRTY) {
|
||||
- mas_for_each(&mas, vma, ULONG_MAX) {
|
||||
- if (!(vma->vm_flags & VM_SOFTDIRTY))
|
||||
- continue;
|
||||
- vma->vm_flags &= ~VM_SOFTDIRTY;
|
||||
- vma_set_page_prot(vma);
|
||||
+ if (mmap_read_lock_killable(mm)) {
|
||||
+ count = -EINTR;
|
||||
+ goto out_mm;
|
||||
}
|
||||
-
|
||||
+ if (!clear_range)
|
||||
+ mas_for_each(&mas, vma, ULONG_MAX) {
|
||||
+ if (!(vma->vm_flags & VM_SOFTDIRTY))
|
||||
+ continue;
|
||||
+ mmap_read_unlock(mm);
|
||||
+ if (mmap_write_lock_killable(mm)) {
|
||||
+ count = -EINTR;
|
||||
+ goto out_mm;
|
||||
+ }
|
||||
+ mas_for_each(&mas, vma, ULONG_MAX) {
|
||||
+ vma->vm_flags &= ~VM_SOFTDIRTY;
|
||||
+ vma_set_page_prot(vma);
|
||||
+ }
|
||||
+ mmap_write_downgrade(mm);
|
||||
+ break;
|
||||
+ }
|
||||
inc_tlb_flush_pending(mm);
|
||||
mmu_notifier_range_init(&range, MMU_NOTIFY_SOFT_DIRTY,
|
||||
- 0, NULL, mm, 0, -1UL);
|
||||
+ 0, NULL, mm, start, end);
|
||||
mmu_notifier_invalidate_range_start(&range);
|
||||
}
|
||||
- walk_page_range(mm, 0, -1, &clear_refs_walk_ops, &cp);
|
||||
+ else
|
||||
+ {
|
||||
+ if (mmap_write_lock_killable(mm)) {
|
||||
+ count = -EINTR;
|
||||
+ goto out_mm;
|
||||
+ }
|
||||
+ }
|
||||
+ walk_page_range(mm, start, end == -1UL ? -1 : end, &clear_refs_walk_ops, &cp);
|
||||
if (type == CLEAR_REFS_SOFT_DIRTY) {
|
||||
mmu_notifier_invalidate_range_end(&range);
|
||||
flush_tlb_mm(mm);
|
||||
dec_tlb_flush_pending(mm);
|
||||
+ mmap_read_unlock(mm);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ mmap_write_unlock(mm);
|
||||
}
|
||||
-out_unlock:
|
||||
- mmap_write_unlock(mm);
|
||||
out_mm:
|
||||
mmput(mm);
|
||||
}
|
||||
@@ -1301,6 +1377,7 @@ struct pagemapread {
|
||||
#define PM_PFRAME_MASK GENMASK_ULL(PM_PFRAME_BITS - 1, 0)
|
||||
#define PM_SOFT_DIRTY BIT_ULL(55)
|
||||
#define PM_MMAP_EXCLUSIVE BIT_ULL(56)
|
||||
+#define PM_SOFT_DIRTY_PAGE BIT_ULL(57)
|
||||
#define PM_UFFD_WP BIT_ULL(57)
|
||||
#define PM_FILE BIT_ULL(61)
|
||||
#define PM_SWAP BIT_ULL(62)
|
||||
@@ -1373,13 +1450,13 @@ static pagemap_entry_t pte_to_pagemap_entry(struct pagemapread *pm,
|
||||
flags |= PM_PRESENT;
|
||||
page = vm_normal_page(vma, addr, pte);
|
||||
if (pte_soft_dirty(pte))
|
||||
- flags |= PM_SOFT_DIRTY;
|
||||
+ flags |= PM_SOFT_DIRTY | PM_SOFT_DIRTY_PAGE;
|
||||
if (pte_uffd_wp(pte))
|
||||
flags |= PM_UFFD_WP;
|
||||
} else if (is_swap_pte(pte)) {
|
||||
swp_entry_t entry;
|
||||
if (pte_swp_soft_dirty(pte))
|
||||
- flags |= PM_SOFT_DIRTY;
|
||||
+ flags |= PM_SOFT_DIRTY | PM_SOFT_DIRTY_PAGE;
|
||||
if (pte_swp_uffd_wp(pte))
|
||||
flags |= PM_UFFD_WP;
|
||||
entry = pte_to_swp_entry(pte);
|
||||
@@ -1500,7 +1500,7 @@
|
||||
|
||||
flags |= PM_PRESENT;
|
||||
if (pmd_soft_dirty(pmd))
|
||||
- flags |= PM_SOFT_DIRTY;
|
||||
+ flags |= PM_SOFT_DIRTY | PM_SOFT_DIRTY_PAGE;
|
||||
if (pmd_uffd_wp(pmd))
|
||||
flags |= PM_UFFD_WP;
|
||||
if (pm->show_pfn)
|
||||
@@ -1442,7 +1519,7 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end,
|
||||
}
|
||||
flags |= PM_SWAP;
|
||||
if (pmd_swp_soft_dirty(pmd))
|
||||
- flags |= PM_SOFT_DIRTY;
|
||||
+ flags |= PM_SOFT_DIRTY | PM_SOFT_DIRTY_PAGE;
|
||||
if (pmd_swp_uffd_wp(pmd))
|
||||
flags |= PM_UFFD_WP;
|
||||
VM_BUG_ON(!is_pmd_migration_entry(pmd));
|
||||
--
|
||||
2.30.2
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user