samsung-afyonltecan: new device (MR 5009)
This commit is contained in:
parent
8d570a7847
commit
33dc6ef65f
13 changed files with 5033 additions and 0 deletions
24
device/testing/device-samsung-afyonltecan/APKBUILD
Normal file
24
device/testing/device-samsung-afyonltecan/APKBUILD
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname=device-samsung-afyonltecan
|
||||
pkgdesc="Samsung Galaxy Core LTE"
|
||||
pkgver=1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="armv7"
|
||||
options="!check !archcheck"
|
||||
depends="postmarketos-base linux-samsung-afyonltecan mkbootimg msm-fb-refresher"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
7f5dee60dc8a12b2cc7cfbb438e3ddf57bb2afc0c9759956f15841e67dcfe8956a01e4137ceb6193c7be593b32dfbf54ad10b3dbf420f1838593f2a8ce495487 deviceinfo
|
||||
"
|
30
device/testing/device-samsung-afyonltecan/deviceinfo
Normal file
30
device/testing/device-samsung-afyonltecan/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 Core LTE"
|
||||
deviceinfo_manufacturer="Samsung"
|
||||
deviceinfo_codename="samsung-afyonltecan"
|
||||
deviceinfo_year="2014"
|
||||
deviceinfo_arch="armv7"
|
||||
|
||||
# Device related
|
||||
deviceinfo_chassis="handset"
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_external_storage="true"
|
||||
|
||||
# Bootloader related
|
||||
deviceinfo_flash_method="heimdall-bootimg"
|
||||
deviceinfo_kernel_cmdline="console=null androidboot.console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 zcache.enabled=1 zcache.compressor=lz4 androidboot.selinux=permissive buildvariant=eng"
|
||||
deviceinfo_generate_bootimg="true"
|
||||
deviceinfo_bootimg_qcdt="true"
|
||||
deviceinfo_bootimg_dtb_second="false"
|
||||
deviceinfo_flash_pagesize="2048"
|
||||
deviceinfo_flash_offset_base="0x00000000"
|
||||
deviceinfo_flash_offset_kernel="0x00008000"
|
||||
deviceinfo_flash_offset_ramdisk="0x02000000"
|
||||
deviceinfo_flash_offset_second="0x00000000"
|
||||
deviceinfo_flash_offset_tags="0x01e00000"
|
||||
deviceinfo_flash_heimdall_partition_kernel="BOOT"
|
||||
deviceinfo_flash_heimdall_partition_rootfs="SYSTEM"
|
|
@ -0,0 +1,91 @@
|
|||
From a23d549c51e38ad9fc481859326a786bc00baad8 Mon Sep 17 00:00:00 2001
|
||||
From: Federico Amedeo Izzo <federico.izzo42@gmail.com>
|
||||
Date: Fri, 22 Mar 2019 19:37:07 +0100
|
||||
Subject: [PATCH] fix video argb setting
|
||||
|
||||
---
|
||||
drivers/video/msm/mdss/mdss_fb.c | 34 ++++++++++++++++----------------
|
||||
1 file changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
|
||||
index 835f6fc9687..a598cbd72dc 100644
|
||||
--- a/drivers/video/msm/mdss/mdss_fb.c
|
||||
+++ b/drivers/video/msm/mdss/mdss_fb.c
|
||||
@@ -1767,16 +1767,16 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
|
||||
fix->xpanstep = 1;
|
||||
fix->ypanstep = 1;
|
||||
var->vmode = FB_VMODE_NONINTERLACED;
|
||||
- var->blue.offset = 0;
|
||||
- var->green.offset = 8;
|
||||
- var->red.offset = 16;
|
||||
+ var->blue.offset = 24;
|
||||
+ var->green.offset = 16;
|
||||
+ var->red.offset = 8;
|
||||
var->blue.length = 8;
|
||||
var->green.length = 8;
|
||||
var->red.length = 8;
|
||||
var->blue.msb_right = 0;
|
||||
var->green.msb_right = 0;
|
||||
var->red.msb_right = 0;
|
||||
- var->transp.offset = 24;
|
||||
+ var->transp.offset = 0;
|
||||
var->transp.length = 8;
|
||||
bpp = 4;
|
||||
break;
|
||||
@@ -1786,16 +1786,16 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
|
||||
fix->xpanstep = 1;
|
||||
fix->ypanstep = 1;
|
||||
var->vmode = FB_VMODE_NONINTERLACED;
|
||||
- var->blue.offset = 8;
|
||||
- var->green.offset = 16;
|
||||
- var->red.offset = 24;
|
||||
+ var->blue.offset = 16;
|
||||
+ var->green.offset = 8;
|
||||
+ var->red.offset = 0;
|
||||
var->blue.length = 8;
|
||||
var->green.length = 8;
|
||||
var->red.length = 8;
|
||||
var->blue.msb_right = 0;
|
||||
var->green.msb_right = 0;
|
||||
var->red.msb_right = 0;
|
||||
- var->transp.offset = 0;
|
||||
+ var->transp.offset = 24;
|
||||
var->transp.length = 8;
|
||||
bpp = 4;
|
||||
break;
|
||||
@@ -2723,15 +2723,15 @@ static int mdss_fb_check_var(struct fb_var_screeninfo *var,
|
||||
/* Figure out if the user meant RGBA or ARGB
|
||||
and verify the position of the RGB components */
|
||||
|
||||
- if (var->transp.offset == 24) {
|
||||
- if ((var->blue.offset != 0) ||
|
||||
- (var->green.offset != 8) ||
|
||||
- (var->red.offset != 16))
|
||||
- return -EINVAL;
|
||||
- } else if (var->transp.offset == 0) {
|
||||
- if ((var->blue.offset != 8) ||
|
||||
+ if (var->transp.offset == 0) {
|
||||
+ if ((var->blue.offset != 24) ||
|
||||
(var->green.offset != 16) ||
|
||||
- (var->red.offset != 24))
|
||||
+ (var->red.offset != 8))
|
||||
+ return -EINVAL;
|
||||
+ } else if (var->transp.offset == 24) {
|
||||
+ if ((var->blue.offset != 16) ||
|
||||
+ (var->green.offset != 8) ||
|
||||
+ (var->red.offset != 0))
|
||||
return -EINVAL;
|
||||
} else
|
||||
return -EINVAL;
|
||||
@@ -2821,7 +2821,7 @@ static int mdss_fb_set_par(struct fb_info *info)
|
||||
break;
|
||||
|
||||
case 32:
|
||||
- if (var->transp.offset == 24)
|
||||
+ if (var->transp.offset == 0)
|
||||
mfd->fb_imgType = MDP_ARGB_8888;
|
||||
else
|
||||
mfd->fb_imgType = MDP_RGBA_8888;
|
||||
--
|
||||
2.21.0
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
From 2e32a401ea5df22ab899f4da3e5e1b448b2df51a Mon Sep 17 00:00:00 2001
|
||||
From: Alexey Min <alexey.min@gmail.com>
|
||||
Date: Thu, 7 Mar 2019 17:25:48 +0300
|
||||
Subject: [PATCH 5/6] usb_gadget: set random rndis host MAC address to prevent
|
||||
zero address
|
||||
|
||||
This fixes zero host MAC:
|
||||
|
||||
rndis0: MAC f6:45:91:9b:4e:43
|
||||
rndis0: HOST MAC 00:00:00:00:00:00
|
||||
|
||||
and allows devive to automatically obtain IP addrest on PC host side
|
||||
zero MAC address prevented interface from autoconfiguring
|
||||
---
|
||||
drivers/usb/gadget/u_ether.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
|
||||
index 72c4a992594..c0fc0698697 100644
|
||||
--- a/drivers/usb/gadget/u_ether.c
|
||||
+++ b/drivers/usb/gadget/u_ether.c
|
||||
@@ -1075,8 +1075,16 @@ int gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
|
||||
"using random %s ethernet address\n", "self");
|
||||
|
||||
#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
|
||||
- memcpy(dev->host_mac, ethaddr, ETH_ALEN);
|
||||
- printk(KERN_DEBUG "usb: set unique host mac\n");
|
||||
+ if ((ethaddr[0] == 0x00) && (ethaddr[1] == 0x00) &&
|
||||
+ (ethaddr[2] == 0x00) && (ethaddr[3] == 0x00) &&
|
||||
+ (ethaddr[4] == 0x00) && (ethaddr[5] == 0x00)) {
|
||||
+ printk(KERN_DEBUG "%s: no unique host MAC was set, generate random\n", __func__);
|
||||
+ /* we can use random_ether_addr() from include/linux/etherdevice.h */
|
||||
+ random_ether_addr(ethaddr);
|
||||
+ } else {
|
||||
+ printk(KERN_DEBUG "%s: set unique host mac\n", __func__);
|
||||
+ }
|
||||
+ memcpy(dev->host_mac, ethaddr, ETH_ALEN);
|
||||
#else
|
||||
if (get_ether_addr(host_addr, dev->host_mac))
|
||||
dev_warn(&g->dev,
|
||||
--
|
||||
2.21.0
|
||||
|
75
device/testing/linux-samsung-afyonltecan/APKBUILD
Normal file
75
device/testing/linux-samsung-afyonltecan/APKBUILD
Normal file
|
@ -0,0 +1,75 @@
|
|||
# Reference: <https://postmarketos.org/vendorkernel>
|
||||
|
||||
pkgname=linux-samsung-afyonltecan
|
||||
pkgver=3.4.113
|
||||
pkgrel=0
|
||||
pkgdesc="Samsung Galaxy Core LTE kernel fork"
|
||||
arch="armv7"
|
||||
_carch="arm"
|
||||
_flavor="samsung-afyonltecan"
|
||||
url="https://kernel.org"
|
||||
license="GPL-2.0-only"
|
||||
options="!strip !check !tracedeps pmb:cross-native"
|
||||
makedepends="bash bc bison devicepkg-dev flex openssl-dev perl dtbtool xz gcc6"
|
||||
|
||||
# Compiler: this kernel was only tested with gcc6. Feel free to make a merge
|
||||
# request if you find out that it is booting working with newer GCCs as
|
||||
# well. See <https://postmarketos.org/vendorkernel> for instructions.
|
||||
if [ "${CC:0:5}" != "gcc6-" ]; then
|
||||
CC="gcc6-$CC"
|
||||
HOSTCC="gcc6-gcc"
|
||||
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
||||
fi
|
||||
|
||||
# Source
|
||||
_repository="Lineage16_msm8226_afyonltecan"
|
||||
_commit="56fb9c64ecdce85fe418920c3c9f55666d010a55"
|
||||
_config="config-$_flavor.$arch"
|
||||
source="
|
||||
$pkgname-$_commit.tar.gz::https://github.com/greggit1986/$_repository/archive/$_commit.tar.gz
|
||||
$_config
|
||||
gcc7-give-up-on-ilog2-const-optimizations.patch
|
||||
gcc8-fix-put-user.patch
|
||||
kernel-use-the-gnu89-standard-explicitly.patch
|
||||
gcc10-extern_YYLOC_global_declaration.patch
|
||||
0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
|
||||
0001-fix-video-argb-setting.patch
|
||||
fix_fb.patch
|
||||
replace-Sun-Solaris-style-flag-on-section.patch
|
||||
replace-Sun-Solaris-style-flag-on-section-xz-supplementation.patch
|
||||
"
|
||||
builddir="$srcdir/$_repository-$_commit"
|
||||
_outdir="out"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
. downstreamkernel_prepare
|
||||
}
|
||||
|
||||
build() {
|
||||
unset LDFLAGS
|
||||
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||||
}
|
||||
|
||||
package() {
|
||||
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
|
||||
|
||||
# Master DTB (deviceinfo_bootimg_qcdt)
|
||||
dtbTool -p scripts/dtc/ -o "$_outdir/arch/$_carch/boot"/dt.img "$_outdir/arch/$_carch/boot/"
|
||||
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img "$pkgdir"/boot/dt.img
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
9e531d934cadeb6e985e4cc5ffff6bcbaa81455d7c2186357fce624ca96aed53eaaf3993255aa4672e0070657ef93f182cd53337e9bc9b30a99dde57c6c921ef linux-samsung-afyonltecan-56fb9c64ecdce85fe418920c3c9f55666d010a55.tar.gz
|
||||
7f878e70aed1d2b98f46b640f3aadaa56ca02e4162f60e01d4ded4be3f77c7ca8dd66032579b2b33d7d77add2937030e7d65bd312fbb7824671bc6c5d13fa385 config-samsung-afyonltecan.armv7
|
||||
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
|
||||
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
|
||||
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
|
||||
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
|
||||
27f890cf82027649ba742b606a87ce6a82f9685b075bb7b50bffec77221e70434ee78d118d39048350537c5ecdad208658967e492eeeb997e7f6884fa78ac696 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
|
||||
a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0001-fix-video-argb-setting.patch
|
||||
a1267c3a999aafd4d9ef9c5f75cdf05605a3dc53466681d232721f1613b06f1d54c9a80f964d3114c42800faef53457c7c80867381adea0010deda4cdbd4c2ce fix_fb.patch
|
||||
96b1121ed89df5f0c61e04d695efef90eee2cc22e99d42e308d5784adad526871ce0d62fa70e1ea0bf4865a6200e29d2ea19b021352bfb82f34996a8b97086b0 replace-Sun-Solaris-style-flag-on-section.patch
|
||||
a6b6c781dd23f9a45a1605456d8c9af3ec6b5c389acd2b5d4c32280dcb59118996d794165bea2005dbdd9415297e5060bcac7579f908f7d65406a862b743fed5 replace-Sun-Solaris-style-flag-on-section-xz-supplementation.patch
|
||||
"
|
File diff suppressed because it is too large
Load diff
12
device/testing/linux-samsung-afyonltecan/fix_fb.patch
Normal file
12
device/testing/linux-samsung-afyonltecan/fix_fb.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff -Naur kernel/drivers/video/msm/mdss/mdss_fb.c kernel-changed/drivers/video/msm/mdss/mdss_fb.c
|
||||
--- kernel/drivers/video/msm/mdss/mdss_fb.c 2020-04-26 22:22:08.386388683 +0530
|
||||
+++ kernel-changed/drivers/video/msm/mdss/mdss_fb.c 2020-04-27 01:35:05.748597845 +0530
|
||||
@@ -1216,7 +1216,7 @@
|
||||
boot_mode_lpm, boot_mode_recovery);
|
||||
|
||||
/* Incase of Normal Booting, Do not reserve FB memory */
|
||||
- if ((!boot_mode_lpm) && (!boot_mode_recovery)){
|
||||
+ if (0){
|
||||
/* Normal Booting */
|
||||
mfd->fbi->screen_base = NULL;
|
||||
mfd->fbi->fix.smem_start = 0;
|
|
@ -0,0 +1,39 @@
|
|||
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 3b41bfca636..9b9c29e6f31 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 2d30f41778b..d0eb405cb81 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 \
|
|
@ -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,67 @@
|
|||
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
|
||||
@@ -241,7 +241,7 @@ CONFIG_SHELL := $(shell if [ -x "$$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.
|
||||
@@ -373,7 +373,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstric
|
||||
-fno-strict-aliasing -fno-common \
|
||||
-Werror-implicit-function-declaration \
|
||||
-Wno-format-security \
|
||||
- -fno-delete-null-pointer-checks
|
||||
+ -fno-delete-null-pointer-checks \
|
||||
+ -std=gnu89
|
||||
+
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
KBUILD_AFLAGS := -D__ASSEMBLY__
|
|
@ -0,0 +1,12 @@
|
|||
This patch is the supplementation of linux3.4-ARM-8933-1-replace-Sun-Solaris-style-flag-on-section.patch.
|
||||
|
||||
diff --git a/arch/arm/boot/compressed/piggy.xzkern.S b/arch/arm/boot/compressed/piggy.xzkern.S
|
||||
index d7e69cffbc0a..cfea81ae8f4b 100644
|
||||
--- a/arch/arm/boot/compressed/piggy.xzkern.S
|
||||
+++ b/arch/arm/boot/compressed/piggy.xzkern.S
|
||||
@@ -1,4 +1,4 @@
|
||||
- .section .piggydata,#alloc
|
||||
+ .section .piggydata, "a"
|
||||
.globl input_data
|
||||
input_data:
|
||||
.incbin "arch/arm/boot/compressed/piggy.xzkern"
|
|
@ -0,0 +1,62 @@
|
|||
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
|
||||
index 78b50807..868eeeaa 100644
|
||||
--- a/arch/arm/boot/bootp/init.S
|
||||
+++ b/arch/arm/boot/bootp/init.S
|
||||
@@ -16,7 +16,7 @@
|
||||
* size immediately following the kernel, we could build this into
|
||||
* a binary blob, and concatenate the zImage using the cat command.
|
||||
*/
|
||||
- .section .start,#alloc,#execinstr
|
||||
+ .section .start, "ax"
|
||||
.type _start, #function
|
||||
.globl _start
|
||||
|
||||
diff --git a/arch/arm/boot/compressed/big-endian.S b/arch/arm/boot/compressed/big-endian.S
|
||||
index 25ab26f1..f22428e2 100644
|
||||
--- a/arch/arm/boot/compressed/big-endian.S
|
||||
+++ b/arch/arm/boot/compressed/big-endian.S
|
||||
@@ -5,7 +5,7 @@
|
||||
* Author: Nicolas Pitre
|
||||
*/
|
||||
|
||||
- .section ".start", #alloc, #execinstr
|
||||
+ .section ".start", "ax"
|
||||
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
||||
orr r0, r0, #(1 << 7) @ enable big endian mode
|
||||
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
|
||||
index d2e45951..290a13ed 100644
|
||||
--- a/arch/arm/boot/compressed/head.S
|
||||
+++ b/arch/arm/boot/compressed/head.S
|
||||
@@ -109,7 +109,7 @@
|
||||
#endif
|
||||
.endm
|
||||
|
||||
- .section ".start", #alloc, #execinstr
|
||||
+ .section ".start", "ax"
|
||||
/*
|
||||
* sort out different calling conventions
|
||||
*/
|
||||
diff --git a/arch/arm/boot/compressed/piggy.lzma.S b/arch/arm/boot/compressed/piggy.lzma.S
|
||||
index d7e69cff..cfea81ae 100644
|
||||
--- a/arch/arm/boot/compressed/piggy.lzma.S
|
||||
+++ b/arch/arm/boot/compressed/piggy.lzma.S
|
||||
@@ -1,4 +1,4 @@
|
||||
- .section .piggydata,#alloc
|
||||
+ .section .piggydata, "a"
|
||||
.globl input_data
|
||||
input_data:
|
||||
.incbin "arch/arm/boot/compressed/piggy.lzma"
|
||||
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
|
||||
index 22ac2a6f..68744e1c 100644
|
||||
--- a/arch/arm/mm/proc-v7.S
|
||||
+++ b/arch/arm/mm/proc-v7.S
|
||||
@@ -462,7 +462,7 @@ __v7_setup_stack:
|
||||
string cpu_elf_name, "v7"
|
||||
.align
|
||||
|
||||
- .section ".proc.info.init", #alloc, #execinstr
|
||||
+ .section ".proc.info.init", "ax"
|
||||
|
||||
/*
|
||||
* Standard v7 proc info content
|
Loading…
Reference in a new issue