samsung-treltexx: new device (MR 3285)
[ci:skip-build] already built successfully in CI
This commit is contained in:
parent
d22e6e0511
commit
49d91586ad
12 changed files with 5470 additions and 0 deletions
34
device/testing/device-samsung-treltexx/APKBUILD
Normal file
34
device/testing/device-samsung-treltexx/APKBUILD
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Reference: <https://postmarketos.org/devicepkg>
|
||||||
|
pkgname=device-samsung-treltexx
|
||||||
|
pkgdesc="Samsung Galaxy Note 4"
|
||||||
|
pkgver=0.1
|
||||||
|
pkgrel=0
|
||||||
|
url="https://postmarketos.org"
|
||||||
|
license="MIT"
|
||||||
|
arch="armv7"
|
||||||
|
options="!check !archcheck"
|
||||||
|
depends="
|
||||||
|
linux-samsung-treltexx
|
||||||
|
mesa-dri-gallium
|
||||||
|
msm-fb-refresher
|
||||||
|
mkbootimg
|
||||||
|
postmarketos-base
|
||||||
|
"
|
||||||
|
makedepends="devicepkg-dev"
|
||||||
|
source="deviceinfo"
|
||||||
|
|
||||||
|
build() {
|
||||||
|
devicepkg_build $startdir $pkgname
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
devicepkg_package $startdir $pkgname
|
||||||
|
# Disable v4l udev rules, because if enabled the device will fail to boot
|
||||||
|
# when VIDEO_EXYNOS_FIMC_IS is enabled.
|
||||||
|
mkdir -p "$pkgdir"/etc/udev/rules.d
|
||||||
|
ln -s /dev/null "$pkgdir"/etc/udev/rules.d/60-persistent-v4l.rules
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
ec604c2688b3dcfebbb2d19e3570babf00f55e343ee43d67becaf2ca24264647f0f88ea7c8714d961dbea5721c24d67c2fe739b28b979732591a6b337a5d4b22 deviceinfo
|
||||||
|
"
|
30
device/testing/device-samsung-treltexx/deviceinfo
Normal file
30
device/testing/device-samsung-treltexx/deviceinfo
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Reference: <https://postmarketos.org/deviceinfo>
|
||||||
|
# Please use double quotes only. You can source this file in shell
|
||||||
|
# scripts.
|
||||||
|
|
||||||
|
deviceinfo_format_version="0"
|
||||||
|
deviceinfo_name="Samsung Galaxy Note 4"
|
||||||
|
deviceinfo_manufacturer="Samsung"
|
||||||
|
deviceinfo_codename="samsung-treltexx"
|
||||||
|
deviceinfo_year="2014"
|
||||||
|
deviceinfo_arch="armv7"
|
||||||
|
|
||||||
|
# Device related
|
||||||
|
deviceinfo_chassis="handset"
|
||||||
|
deviceinfo_keyboard="false"
|
||||||
|
deviceinfo_external_storage="true"
|
||||||
|
deviceinfo_screen_width="1440"
|
||||||
|
deviceinfo_screen_height="2560"
|
||||||
|
|
||||||
|
# Bootloader related
|
||||||
|
deviceinfo_flash_method="heimdall-bootimg"
|
||||||
|
deviceinfo_generate_bootimg="true"
|
||||||
|
deviceinfo_bootimg_qcdt="true"
|
||||||
|
deviceinfo_bootimg_mtk_mkimage="false"
|
||||||
|
deviceinfo_bootimg_dtb_second="false"
|
||||||
|
deviceinfo_flash_pagesize="2048"
|
||||||
|
deviceinfo_flash_offset_base="0x10000000"
|
||||||
|
deviceinfo_flash_offset_kernel="0x00008000"
|
||||||
|
deviceinfo_flash_offset_ramdisk="0x01000000"
|
||||||
|
deviceinfo_flash_offset_second="0x00f00000"
|
||||||
|
deviceinfo_flash_offset_tags="0x00000100"
|
82
device/testing/linux-samsung-treltexx/APKBUILD
Normal file
82
device/testing/linux-samsung-treltexx/APKBUILD
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
# Reference: <https://postmarketos.org/vendorkernel>
|
||||||
|
# Kernel config based on: arch/arm/configs/lineage_trelte_defconfig
|
||||||
|
pkgname=linux-samsung-treltexx
|
||||||
|
pkgver=3.10.9
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="samsung Galaxy Note 4 kernel fork"
|
||||||
|
arch="armv7"
|
||||||
|
_carch="arm"
|
||||||
|
_flavor="samsung-treltexx"
|
||||||
|
url="https://kernel.org"
|
||||||
|
license="GPL-2.0-only"
|
||||||
|
options="!strip !check !tracedeps pmb:cross-native"
|
||||||
|
makedepends="
|
||||||
|
bash
|
||||||
|
bc
|
||||||
|
bison
|
||||||
|
devicepkg-dev
|
||||||
|
dtbtool-exynos
|
||||||
|
flex
|
||||||
|
openssl-dev
|
||||||
|
perl
|
||||||
|
linux-headers
|
||||||
|
xz
|
||||||
|
"
|
||||||
|
|
||||||
|
# Source
|
||||||
|
_repository="android_kernel_samsung_universal5433"
|
||||||
|
_commit="ab88c0ea282670b63059839b9483eb2f29d9d6dd"
|
||||||
|
_config="config-$_flavor.$arch"
|
||||||
|
source="
|
||||||
|
$pkgname-$_commit.tar.gz::https://github.com/universal5433/$_repository/archive/$_commit.tar.gz
|
||||||
|
$_config
|
||||||
|
gcc7-give-up-on-ilog2-const-optimizations.patch
|
||||||
|
gcc8-fix-put-user.patch
|
||||||
|
gcc10-extern_YYLOC_global_declaration.patch
|
||||||
|
samsung-usb-ethaddr.patch
|
||||||
|
kernel-use-the-gnu89-standard-explicitly.patch
|
||||||
|
drivers-muic-fix.patch
|
||||||
|
security-tima_uevent-fix.patch
|
||||||
|
treltexx_hw_rev.patch
|
||||||
|
"
|
||||||
|
builddir="$srcdir/$_repository-$_commit"
|
||||||
|
_outdir="out"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
default_prepare
|
||||||
|
. downstreamkernel_prepare
|
||||||
|
mkdir -p $_outdir/drivers/sensorhub/brcm/factory
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
build() {
|
||||||
|
unset LDFLAGS
|
||||||
|
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
|
||||||
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||||||
|
|
||||||
|
dtbTool-exynos --pagesize 2048 \
|
||||||
|
--platform 0x00003ec3 \
|
||||||
|
--subtype 0x3a37307e \
|
||||||
|
-o "$_outdir/arch/$_carch/boot"/dt.img \
|
||||||
|
$(find "$_outdir/arch/$_carch/boot/dts/" -name *exynos5433-tre_*.dtb)
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
|
||||||
|
"$_flavor" "$_outdir"
|
||||||
|
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \
|
||||||
|
"$pkgdir"/boot/dt.img
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
dd5d6ec38bd6f026bd811e0dfd190bfa8926b088669315ed179c16f1c32008592c585bbc6681c589226677c20ba2b75bb55e3179c18036a4d6116b7e919b2adc linux-samsung-treltexx-ab88c0ea282670b63059839b9483eb2f29d9d6dd.tar.gz
|
||||||
|
02871400e5f6c9005f46ec013611c8888e2f8946fd35ee7f68b8bb9e817af9d6783ecff57f35cf691e740bd2e4a3978e2ceadb98ef7be09f8110bae5d9146edd config-samsung-treltexx.armv7
|
||||||
|
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
|
||||||
|
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
|
||||||
|
7abefc75702b3275ad88055c57a580d419342d34df59ca38e0b2b183216ba563f0955a6794b1e3ee8dbc49da1d4531ae7c24451e53b0bc18fe1a0db209c66ddb gcc10-extern_YYLOC_global_declaration.patch
|
||||||
|
015cc3cd31c1edc208bf2bee872d3be1fe35006f8b90c3cc5c082fb7d89b2ae91a04239676b8868da75d5682e330b1d60d1f5fad67410cbaeeb66a8685df36f5 samsung-usb-ethaddr.patch
|
||||||
|
841d23c78c490a1434c254b06a284f08e6a63a2ed94150302e931b336e1d19704554e5027a29500d073ca89f624ecbdd6c2d323902b03f1b1134d927e6538d00 kernel-use-the-gnu89-standard-explicitly.patch
|
||||||
|
e2e550d9d5020c2f51e1af0576236ac9d57b2e0c10c14a2a92dc7b1bf4100ebc15a6bf0fff4f57232164e84358dc37d24721e1d9f133a526bf78b610eaf00add drivers-muic-fix.patch
|
||||||
|
f48216b4f2068d7ee2788d18deee4af769bcfa8cb88d4257275285a6017e8f193d527a1ede1ef1fb3a1bf7795f633434b57c13aed95ab1161066f215619a8c8b security-tima_uevent-fix.patch
|
||||||
|
fc618784b85fd77609e32a2af3a68456d66a3b6126c52d00e8a531e6c2c3c54c455330d9f4a9f857f2cc6e3d406a47c5d01ec9f7a96fede031f2dde136184ae1 treltexx_hw_rev.patch
|
||||||
|
"
|
4852
device/testing/linux-samsung-treltexx/config-samsung-treltexx.armv7
Normal file
4852
device/testing/linux-samsung-treltexx/config-samsung-treltexx.armv7
Normal file
File diff suppressed because it is too large
Load diff
114
device/testing/linux-samsung-treltexx/drivers-muic-fix.patch
Normal file
114
device/testing/linux-samsung-treltexx/drivers-muic-fix.patch
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
Fixes error:
|
||||||
|
|
||||||
|
drivers/muic/universal/muic_state.c:363:1: fatal error: opening dependency file drivers/muic/universal/.muic_state.o.d: No such file or directory
|
||||||
|
|
||||||
|
This commit is basically the same as (part of)
|
||||||
|
https://github.com/jcadduono/android_kernel_samsung_universal3475/commit/8b34f9d012cc
|
||||||
|
|
||||||
|
diff --git a/drivers/muic/Kconfig b/drivers/muic/Kconfig
|
||||||
|
index 9de6622d5791..ff3a5a0757a6 100644
|
||||||
|
--- a/drivers/muic/Kconfig
|
||||||
|
+++ b/drivers/muic/Kconfig
|
||||||
|
@@ -168,30 +168,11 @@ config MUIC_SM5502_SUPPORT_AUDIODOCK
|
||||||
|
help
|
||||||
|
If you say yes here you will get support for AUDIO DOCK
|
||||||
|
|
||||||
|
-config MUIC_UNIVERSAL
|
||||||
|
- bool "UNIVERSAL MUIC"
|
||||||
|
- depends on USE_MUIC
|
||||||
|
- default n
|
||||||
|
- help
|
||||||
|
- If you say yes here you will get support for various MUIC chips.
|
||||||
|
-
|
||||||
|
-config MUIC_UNIVERSAL_SM5703
|
||||||
|
- bool "SM5703 MUIC"
|
||||||
|
- depends on USE_MUIC
|
||||||
|
- default n
|
||||||
|
- help
|
||||||
|
- If you say yes here you will get support for the SM5703 MUIC chip.
|
||||||
|
-
|
||||||
|
-config MUIC_UNIVERSAL_MAX77849
|
||||||
|
- bool "MAX77849 MUIC"
|
||||||
|
- depends on USE_MUIC
|
||||||
|
- default n
|
||||||
|
- help
|
||||||
|
- If you say yes here you will get support for the MAX77849 MUIC chip.
|
||||||
|
-
|
||||||
|
config MUIC_HV_FORCE_LIMIT
|
||||||
|
bool "Force limit AFC QC MAX CHG VOLTAGE"
|
||||||
|
depends on HV_MUIC_MAX77843_AFC
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
- If you say yes here you will add function of limit afc charging volatage.
|
||||||
|
\ No newline at end of file
|
||||||
|
+ If you say yes here you will add function of limit afc charging voltage.
|
||||||
|
+
|
||||||
|
+source "drivers/muic/universal/Kconfig"
|
||||||
|
diff --git a/drivers/muic/Makefile b/drivers/muic/Makefile
|
||||||
|
index 4c99f107570e..6188662c5b6e 100644
|
||||||
|
--- a/drivers/muic/Makefile
|
||||||
|
+++ b/drivers/muic/Makefile
|
||||||
|
@@ -15,15 +15,4 @@ obj-$(CONFIG_MUIC_FSA9480) += fsa9480.o
|
||||||
|
obj-$(CONFIG_MUIC_SM5502) += sm5502-muic.o
|
||||||
|
|
||||||
|
# MUIC_UNIVERSAL
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_task.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_state.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_apis.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_sysfs.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_debug.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_dt.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_i2c.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_regmap.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL) += universal/muic_vps.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL_SM5703) += universal/muic_regmap_sm5703.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL_S2MM001) += universal/muic_regmap_s2mm001b.o
|
||||||
|
-obj-$(CONFIG_MUIC_UNIVERSAL_MAX77849) += universal/muic_regmap_max77849.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += universal/
|
||||||
|
diff --git a/drivers/muic/universal/Kconfig b/drivers/muic/universal/Kconfig
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000000..802ca2dd8a22
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/drivers/muic/universal/Kconfig
|
||||||
|
@@ -0,0 +1,22 @@
|
||||||
|
+# MUIC_UNIVERSAL
|
||||||
|
+
|
||||||
|
+config MUIC_UNIVERSAL
|
||||||
|
+ bool "UNIVERSAL MUIC"
|
||||||
|
+ depends on USE_MUIC
|
||||||
|
+ default n
|
||||||
|
+ help
|
||||||
|
+ If you say yes here you will get support for various MUIC chips.
|
||||||
|
+
|
||||||
|
+config MUIC_UNIVERSAL_SM5703
|
||||||
|
+ bool "SM5703 MUIC"
|
||||||
|
+ depends on USE_MUIC
|
||||||
|
+ default n
|
||||||
|
+ help
|
||||||
|
+ If you say yes here you will get support for the SM5703 MUIC chip.
|
||||||
|
+
|
||||||
|
+config MUIC_UNIVERSAL_MAX77849
|
||||||
|
+ bool "MAX77849 MUIC"
|
||||||
|
+ depends on USE_MUIC
|
||||||
|
+ default n
|
||||||
|
+ help
|
||||||
|
+ If you say yes here you will get support for the MAX77849 MUIC chip.
|
||||||
|
diff --git a/drivers/muic/universal/Makefile b/drivers/muic/universal/Makefile
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000000..2beb93df6b3c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/drivers/muic/universal/Makefile
|
||||||
|
@@ -0,0 +1,13 @@
|
||||||
|
+# MUIC_UNIVERSAL
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_task.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_state.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_apis.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_sysfs.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_debug.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_dt.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_i2c.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_regmap.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL) += muic_vps.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL_SM5703) += muic_regmap_sm5703.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL_S2MM001) += muic_regmap_s2mm001b.o
|
||||||
|
+obj-$(CONFIG_MUIC_UNIVERSAL_MAX77849) += muic_regmap_max77849.o
|
|
@ -0,0 +1,52 @@
|
||||||
|
Based on https://lkml.org/lkml/2020/4/1/1206. In original patch, YYLOC declaration was removed.
|
||||||
|
However, using original patch, which removes yylloc declaration on 3.18.14 kernel version results in 'yylloc not declared' error.
|
||||||
|
See part of the original description below:
|
||||||
|
|
||||||
|
gcc 10 will default to -fno-common, which causes this error at link
|
||||||
|
time:
|
||||||
|
|
||||||
|
(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here
|
||||||
|
|
||||||
|
This is because both dtc-lexer as well as dtc-parser define the same
|
||||||
|
global symbol yyloc. Before with -fcommon those were merged into one
|
||||||
|
defintion. The proper solution would be to to mark this as "extern",
|
||||||
|
|
||||||
|
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
|
||||||
|
index 3b41bfca636c..9b9c29e6f311 100644
|
||||||
|
--- a/scripts/dtc/dtc-lexer.l
|
||||||
|
+++ b/scripts/dtc/dtc-lexer.l
|
||||||
|
@@ -39,7 +39,7 @@ LINECOMMENT "//".*\n
|
||||||
|
#include "srcpos.h"
|
||||||
|
#include "dtc-parser.tab.h"
|
||||||
|
|
||||||
|
-YYLTYPE yylloc;
|
||||||
|
+extern YYLTYPE yylloc;
|
||||||
|
|
||||||
|
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
|
||||||
|
#define YY_USER_ACTION \
|
||||||
|
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
|
||||||
|
index 2d30f41778b7..d0eb405cb811 100644
|
||||||
|
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
|
||||||
|
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
|
||||||
|
@@ -637,7 +637,7 @@ char *yytext;
|
||||||
|
#include "srcpos.h"
|
||||||
|
#include "dtc-parser.tab.h"
|
||||||
|
|
||||||
|
-YYLTYPE yylloc;
|
||||||
|
+extern YYLTYPE yylloc;
|
||||||
|
|
||||||
|
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
|
||||||
|
#define YY_USER_ACTION \
|
||||||
|
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
|
||||||
|
index c8c8ca8b744f..ee1d8c3042fb 100644
|
||||||
|
--- a/scripts/dtc/dtc-parser.tab.c_shipped
|
||||||
|
+++ b/scripts/dtc/dtc-parser.tab.c_shipped
|
||||||
|
@@ -73,7 +73,7 @@
|
||||||
|
#include "dtc.h"
|
||||||
|
#include "srcpos.h"
|
||||||
|
|
||||||
|
-extern YYLTYPE yylloc;
|
||||||
|
+YYLTYPE yylloc;
|
||||||
|
|
||||||
|
extern int yylex(void);
|
||||||
|
extern void print_error(char const *fmt, ...);
|
|
@ -0,0 +1,90 @@
|
||||||
|
From a7bfe0a2832e66f3d732e4210b5d53c81cc7a85f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Linus Torvalds <torvalds@linux-foundation.org>
|
||||||
|
Date: Thu, 27 Sep 2018 19:16:56 -0400
|
||||||
|
Subject: [PATCH] give up on gcc ilog2() constant optimizations
|
||||||
|
|
||||||
|
commit 474c90156c8dcc2fa815e6716cc9394d7930cb9c upstream.
|
||||||
|
|
||||||
|
gcc-7 has an "optimization" pass that completely screws up, and
|
||||||
|
generates the code expansion for the (impossible) case of calling
|
||||||
|
ilog2() with a zero constant, even when the code gcc compiles does not
|
||||||
|
actually have a zero constant.
|
||||||
|
|
||||||
|
And we try to generate a compile-time error for anybody doing ilog2() on
|
||||||
|
a constant where that doesn't make sense (be it zero or negative). So
|
||||||
|
now gcc7 will fail the build due to our sanity checking, because it
|
||||||
|
created that constant-zero case that didn't actually exist in the source
|
||||||
|
code.
|
||||||
|
|
||||||
|
There's a whole long discussion on the kernel mailing about how to work
|
||||||
|
around this gcc bug. The gcc people themselevs have discussed their
|
||||||
|
"feature" in
|
||||||
|
|
||||||
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
|
||||||
|
|
||||||
|
but it's all water under the bridge, because while it looked at one
|
||||||
|
point like it would be solved by the time gcc7 was released, that was
|
||||||
|
not to be.
|
||||||
|
|
||||||
|
So now we have to deal with this compiler braindamage.
|
||||||
|
|
||||||
|
And the only simple approach seems to be to just delete the code that
|
||||||
|
tries to warn about bad uses of ilog2().
|
||||||
|
|
||||||
|
So now "ilog2()" will just return 0 not just for the value 1, but for
|
||||||
|
any non-positive value too.
|
||||||
|
|
||||||
|
It's not like I can recall anybody having ever actually tried to use
|
||||||
|
this function on any invalid value, but maybe the sanity check just
|
||||||
|
meant that such code never made it out in public.
|
||||||
|
|
||||||
|
[js] no tools/include/linux/log2.h copy of that yet
|
||||||
|
|
||||||
|
Reported-by: Laura Abbott <labbott@redhat.com>
|
||||||
|
Cc: John Stultz <john.stultz@linaro.org>,
|
||||||
|
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||||
|
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||||
|
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||||
|
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
||||||
|
---
|
||||||
|
include/linux/log2.h | 13 ++-----------
|
||||||
|
1 file changed, 2 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/include/linux/log2.h b/include/linux/log2.h
|
||||||
|
index fd7ff3d91..f38fae23b 100644
|
||||||
|
--- a/include/linux/log2.h
|
||||||
|
+++ b/include/linux/log2.h
|
||||||
|
@@ -15,12 +15,6 @@
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
|
-/*
|
||||||
|
- * deal with unrepresentable constant logarithms
|
||||||
|
- */
|
||||||
|
-extern __attribute__((const, noreturn))
|
||||||
|
-int ____ilog2_NaN(void);
|
||||||
|
-
|
||||||
|
/*
|
||||||
|
* non-constant log of base 2 calculators
|
||||||
|
* - the arch may override these in asm/bitops.h if they can be implemented
|
||||||
|
@@ -85,7 +79,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
|
||||||
|
#define ilog2(n) \
|
||||||
|
( \
|
||||||
|
__builtin_constant_p(n) ? ( \
|
||||||
|
- (n) < 1 ? ____ilog2_NaN() : \
|
||||||
|
+ (n) < 2 ? 0 : \
|
||||||
|
(n) & (1ULL << 63) ? 63 : \
|
||||||
|
(n) & (1ULL << 62) ? 62 : \
|
||||||
|
(n) & (1ULL << 61) ? 61 : \
|
||||||
|
@@ -148,10 +142,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
|
||||||
|
(n) & (1ULL << 4) ? 4 : \
|
||||||
|
(n) & (1ULL << 3) ? 3 : \
|
||||||
|
(n) & (1ULL << 2) ? 2 : \
|
||||||
|
- (n) & (1ULL << 1) ? 1 : \
|
||||||
|
- (n) & (1ULL << 0) ? 0 : \
|
||||||
|
- ____ilog2_NaN() \
|
||||||
|
- ) : \
|
||||||
|
+ 1 ) : \
|
||||||
|
(sizeof(n) <= 4) ? \
|
||||||
|
__ilog2_u32(n) : \
|
||||||
|
__ilog2_u64(n) \
|
|
@ -0,0 +1,39 @@
|
||||||
|
From 8c8187d41b99acd4f2078d0fff6807e0eeb47407 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Arnd Bergmann <arnd@arndb.de>
|
||||||
|
Date: Thu, 26 Jul 2018 10:13:23 +0200
|
||||||
|
Subject: [PATCH] ARM: fix put_user() for gcc-8
|
||||||
|
|
||||||
|
Building kernels before linux-4.7 with gcc-8 results in many build failures
|
||||||
|
when gcc triggers a check that was meant to catch broken compilers:
|
||||||
|
|
||||||
|
/tmp/ccCGMQmS.s:648: Error: .err encountered
|
||||||
|
|
||||||
|
According to the discussion in the gcc bugzilla, a local "register
|
||||||
|
asm()" variable is still supposed to be the correct way to force an
|
||||||
|
inline assembly to use a particular register, but marking it 'const'
|
||||||
|
lets the compiler do optimizations that break that, i.e the compiler is
|
||||||
|
free to treat the variable as either 'const' or 'register' in that case.
|
||||||
|
|
||||||
|
Upstream commit 9f73bd8bb445 ("ARM: uaccess: remove put_user() code
|
||||||
|
duplication") fixed this problem in linux-4.8 as part of a larger change,
|
||||||
|
but seems a little too big to be backported to 4.4.
|
||||||
|
|
||||||
|
Let's take the simplest fix and change only the one broken line in the
|
||||||
|
same way as newer kernels.
|
||||||
|
|
||||||
|
Suggested-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||||
|
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745
|
||||||
|
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
|
||||||
|
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||||
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||||
|
---
|
||||||
|
arch/arm/include/asm/uaccess.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
|
||||||
|
index b04850fdeb5..f8ad54b24ac 100644
|
||||||
|
--- a/arch/arm/include/asm/uaccess.h
|
||||||
|
+++ b/arch/arm/include/asm/uaccess.h
|
||||||
|
@@ -162 +162 @@ extern int __put_user_8(void *, unsigned long long);
|
||||||
|
- register const typeof(*(p)) __r2 asm("r2") = (x); \
|
||||||
|
+ register typeof(*(p)) __r2 asm("r2") = (x); \
|
|
@ -0,0 +1,68 @@
|
||||||
|
From 51b97e354ba9fce1890cf38ecc754aa49677fc89 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Kirill A. Shutemov" <kirill@shutemov.name>
|
||||||
|
Date: Mon, 20 Oct 2014 12:23:12 +0300
|
||||||
|
Subject: kernel: use the gnu89 standard explicitly
|
||||||
|
|
||||||
|
From: "Kirill A. Shutemov" <kirill@shutemov.name>
|
||||||
|
|
||||||
|
commit 51b97e354ba9fce1890cf38ecc754aa49677fc89 upstream.
|
||||||
|
|
||||||
|
Sasha Levin reports:
|
||||||
|
"gcc5 changes the default standard to c11, which makes kernel build
|
||||||
|
unhappy
|
||||||
|
|
||||||
|
Explicitly define the kernel standard to be gnu89 which should keep
|
||||||
|
everything working exactly like it was before gcc5"
|
||||||
|
|
||||||
|
There are multiple small issues with the new default, but the biggest
|
||||||
|
issue seems to be that the old - and very useful - GNU extension to
|
||||||
|
allow a cast in front of an initializer has gone away.
|
||||||
|
|
||||||
|
Patch updated by Kirill:
|
||||||
|
"I'm pretty sure all gcc versions you can build kernel with supports
|
||||||
|
-std=gnu89. cc-option is redunrant.
|
||||||
|
|
||||||
|
We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"
|
||||||
|
|
||||||
|
Note by Andrew Pinski:
|
||||||
|
"Yes it was reported and both problems relating to this extension has
|
||||||
|
been added to gnu99 and gnu11. Though there are other issues with the
|
||||||
|
kernel dealing with extern inline have different semantics between
|
||||||
|
gnu89 and gnu99/11"
|
||||||
|
|
||||||
|
End result: we may be able to move up to a newer stdc model eventually,
|
||||||
|
but right now the newer models have some annoying deficiencies, so the
|
||||||
|
traditional "gnu89" model ends up being the preferred one.
|
||||||
|
|
||||||
|
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
|
||||||
|
Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
|
||||||
|
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||||
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile | 6 ++++--
|
||||||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -242,7 +242,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
||||||
|
|
||||||
|
HOSTCC = gcc
|
||||||
|
HOSTCXX = g++
|
||||||
|
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
|
||||||
|
+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
|
||||||
|
HOSTCXXFLAGS = -O2
|
||||||
|
|
||||||
|
# Decide whether to build built-in, modular, or both.
|
||||||
|
@@ -380,8 +380,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||||
|
-Wno-implicit-function-declaration \
|
||||||
|
-Wno-format-security \
|
||||||
|
-fno-delete-null-pointer-checks \
|
||||||
|
- -fdiagnostics-show-option
|
||||||
|
-
|
||||||
|
+ -fdiagnostics-show-option \
|
||||||
|
+ -std=gnu89
|
||||||
|
+
|
||||||
|
KBUILD_AFLAGS_KERNEL :=
|
||||||
|
KBUILD_CFLAGS_KERNEL :=
|
||||||
|
KBUILD_AFLAGS := -D__ASSEMBLY__
|
|
@ -0,0 +1,17 @@
|
||||||
|
For some reason, CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE disables the code in u_ether
|
||||||
|
that assigns a random MAC address to the USB network interface. This patch simply
|
||||||
|
disables it to fall back to the original code that works correctly.
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
|
||||||
|
index 61d98db8bd63..105feffa4686 100644
|
||||||
|
--- a/drivers/usb/gadget/u_ether.c
|
||||||
|
+++ b/drivers/usb/gadget/u_ether.c
|
||||||
|
@@ -1148,7 +1148,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
|
||||||
|
if (get_ether_addr(dev_addr, net->dev_addr))
|
||||||
|
dev_warn(&g->dev,
|
||||||
|
"using random %s ethernet address\n", "self");
|
||||||
|
-#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
|
||||||
|
+#if 0
|
||||||
|
memcpy(dev->host_mac, ethaddr, ETH_ALEN);
|
||||||
|
printk(KERN_DEBUG "usb: set unique host mac\n");
|
||||||
|
#else
|
|
@ -0,0 +1,77 @@
|
||||||
|
Fixes error:
|
||||||
|
|
||||||
|
security/tima_uevent/tima_uevent.c:217:1: fatal error: opening dependency file security/tima_uevent/.tima_uevent.o.d: No such file or directory
|
||||||
|
217 | module_exit(tima_uevent_exit);
|
||||||
|
| ^~~~~~~~~~~
|
||||||
|
|
||||||
|
This commit is basically the same as (part of)
|
||||||
|
https://github.com/jcadduono/android_kernel_samsung_universal3475/commit/8b34f9d012cc
|
||||||
|
|
||||||
|
diff --git a/security/Kconfig b/security/Kconfig
|
||||||
|
index 0351ba7e4ed5..e332c9225bb1 100644
|
||||||
|
--- a/security/Kconfig
|
||||||
|
+++ b/security/Kconfig
|
||||||
|
@@ -133,6 +133,7 @@ source security/apparmor/Kconfig
|
||||||
|
source security/yama/Kconfig
|
||||||
|
|
||||||
|
source security/integrity/Kconfig
|
||||||
|
+source security/tima_uevent/Kconfig
|
||||||
|
source security/tz_iccc/Kconfig
|
||||||
|
|
||||||
|
choice
|
||||||
|
@@ -178,4 +179,3 @@ config DEFAULT_SECURITY
|
||||||
|
default "" if DEFAULT_SECURITY_DAC
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
-
|
||||||
|
diff --git a/security/Makefile b/security/Makefile
|
||||||
|
index 36d3f0d176b7..597e4f0369a1 100644
|
||||||
|
--- a/security/Makefile
|
||||||
|
+++ b/security/Makefile
|
||||||
|
@@ -30,7 +30,7 @@ subdir-$(CONFIG_INTEGRITY) += integrity
|
||||||
|
obj-$(CONFIG_INTEGRITY) += integrity/built-in.o
|
||||||
|
|
||||||
|
# TIMA uevent
|
||||||
|
-obj-$(CONFIG_TIMA) += tima_uevent/tima_uevent.o
|
||||||
|
+obj-$(CONFIG_TIMA) += tima_uevent/
|
||||||
|
|
||||||
|
#TZ ICCC
|
||||||
|
obj-$(CONFIG_TZ_ICCC) += tz_iccc/
|
||||||
|
diff --git a/security/tima_uevent/Kconfig b/security/tima_uevent/Kconfig
|
||||||
|
index fd7ea958b753..5c8006f19b3a 100644
|
||||||
|
--- a/security/tima_uevent/Kconfig
|
||||||
|
+++ b/security/tima_uevent/Kconfig
|
||||||
|
@@ -2,14 +2,11 @@
|
||||||
|
# TIMA uevent configuration
|
||||||
|
#
|
||||||
|
|
||||||
|
-menuconfig TIMA_UEVENT_MENU
|
||||||
|
- tristate "TIMA uevent support"
|
||||||
|
- help
|
||||||
|
- TIMA uevent device and driver provides a mechanism to propogate
|
||||||
|
- periodic kernel and module measurement events to observer.
|
||||||
|
-
|
||||||
|
config TIMA_UEVENT
|
||||||
|
- bool "TIMA uevents (EXPERIMENTAL)"
|
||||||
|
- depends on EXPERIMENTAL
|
||||||
|
- ---help---
|
||||||
|
- Generate udev events for TIMA events.
|
||||||
|
+ bool "TIMA uevents (EXPERIMENTAL)"
|
||||||
|
+ depends on EXPERIMENTAL
|
||||||
|
+ default n
|
||||||
|
+ ---help---
|
||||||
|
+ Generate udev events for TIMA events.
|
||||||
|
+ TIMA uevent device and driver provides a mechanism to propogate
|
||||||
|
+ periodic kernel and module measurement events to observer.
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/security/tima_uevent/Makefile b/security/tima_uevent/Makefile
|
||||||
|
index 4f1ca82645b7..ae0c213e371c 100644
|
||||||
|
--- a/security/tima_uevent/Makefile
|
||||||
|
+++ b/security/tima_uevent/Makefile
|
||||||
|
@@ -2,5 +2,4 @@
|
||||||
|
# Makefile for TIMA kernel uevent drivers.
|
||||||
|
#
|
||||||
|
|
||||||
|
-#obj-$(CONFIG_TIMA) += tima_uevent.o
|
||||||
|
-
|
||||||
|
+obj-$(CONFIG_TIMA) += tima_uevent.o
|
15
device/testing/linux-samsung-treltexx/treltexx_hw_rev.patch
Normal file
15
device/testing/linux-samsung-treltexx/treltexx_hw_rev.patch
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
diff --git a/arch/arm/boot/dts/exynos5433-tre_eur_open_14.dts b/arch/arm/boot/dts/exynos5433-tre_eur_open_14.dts
|
||||||
|
index 919019725ac..12638037e26 100644
|
||||||
|
--- a/arch/arm/boot/dts/exynos5433-tre_eur_open_14.dts
|
||||||
|
+++ b/arch/arm/boot/dts/exynos5433-tre_eur_open_14.dts
|
||||||
|
@@ -22,8 +22,8 @@
|
||||||
|
model_info-chip = <5433>;
|
||||||
|
model_info-platform = "trlte";
|
||||||
|
model_info-subtype = "trlte_eur_open";
|
||||||
|
- model_info-hw_rev = <14>;
|
||||||
|
- model_info-hw_rev_end = <15>;
|
||||||
|
+ model_info-hw_rev = <0x0000020>;
|
||||||
|
+ model_info-hw_rev_end = <0x0000021>;
|
||||||
|
compatible = "samsung,TR E LTE 14", "samsung,exynos5433";
|
||||||
|
|
||||||
|
hsi2c@14D90000 {
|
Loading…
Reference in a new issue