Compare commits
178 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b8d47fa0 | ||
|
|
eee01b8335 | ||
|
|
42041fa804 | ||
|
|
cfb276ec02 | ||
|
|
acfa1c4c29 | ||
|
|
c161e56db4 | ||
|
|
676e9e309b | ||
|
|
0cf0fdc16f | ||
|
|
67f15457db | ||
|
|
80700245f5 | ||
|
|
a87a3d19a0 | ||
|
|
323f25a1ee | ||
|
|
5c30996f59 | ||
|
|
ff051365e4 | ||
|
|
9f2a885abc | ||
|
|
f18f5059a8 | ||
|
|
8e87aba0e3 | ||
|
|
7f97617b93 | ||
|
|
6a68437996 | ||
|
|
e5d0bcfb4f | ||
|
|
5a21c7fe58 | ||
|
|
7c40397f72 | ||
|
|
6681bf218f | ||
|
|
7e43881444 | ||
|
|
d43b6c054a | ||
|
|
d0804f723a | ||
|
|
d36c2e5471 | ||
|
|
f23167b8b1 | ||
|
|
f6c1aa8844 | ||
|
|
bd19f6f7e0 | ||
|
|
d3dacb86cf | ||
|
|
bd4e2ed2a4 | ||
|
|
02c2fcec70 | ||
|
|
762c15194e | ||
|
|
1a35ea6540 | ||
|
|
b5970da6c9 | ||
|
|
78cd327119 | ||
|
|
5d1df62b20 | ||
|
|
54e45590c4 | ||
|
|
38a4514f20 | ||
|
|
59aac79c26 | ||
|
|
00a0a74174 | ||
|
|
b1d4476bf3 | ||
|
|
3cbf1c284c | ||
|
|
e17c43b24a | ||
|
|
11b2bd1547 | ||
|
|
7af45b5b25 | ||
|
|
f839cb38ec | ||
|
|
4e7be4201e | ||
|
|
aa2d2eee14 | ||
|
|
111278c14e | ||
|
|
4e5efc03c3 | ||
|
|
8cbf8ccb0a | ||
|
|
a760bf919f | ||
|
|
ba3a5f47de | ||
|
|
58b171ce58 | ||
|
|
f9381cf012 | ||
|
|
b149e37827 | ||
|
|
e80611595f | ||
|
|
4b6e0ccf79 | ||
|
|
7213e886c3 | ||
|
|
2fdd468ba1 | ||
|
|
19b3730040 | ||
|
|
a14ea55bfe | ||
|
|
71893eb2f6 | ||
|
|
35699a5435 | ||
|
|
d0c72d0f53 | ||
|
|
e0e066aa6b | ||
|
|
16c5c0f7b3 | ||
|
|
680aa3e5c4 | ||
|
|
76320b5307 | ||
|
|
2c2797a4fe | ||
|
|
6b83912455 | ||
|
|
24e8702e2e | ||
|
|
98bf49ad0d | ||
|
|
c5fe8f9648 | ||
|
|
a723b3453a | ||
|
|
5bc585d35d | ||
|
|
07ae1e1270 | ||
|
|
45f76820a0 | ||
|
|
40f61d706c | ||
|
|
281d5b5f30 | ||
|
|
019446019b | ||
|
|
348755927b | ||
|
|
c2ef4b9a83 | ||
|
|
c5ecc439ca | ||
|
|
7f01999341 | ||
|
|
4f633fbc33 | ||
|
|
ec9adec78c | ||
|
|
ddfd56365f | ||
|
|
742215ba51 | ||
|
|
7231c57832 | ||
|
|
8bc294d7d7 | ||
|
|
5c8a69fcca | ||
|
|
1da0d7a024 | ||
|
|
d7d00d12af | ||
|
|
3f0347895c | ||
|
|
8300262941 | ||
|
|
73e68cc29d | ||
|
|
c0329ab89a | ||
|
|
73ef7ec883 | ||
|
|
be68e8579a | ||
|
|
478f01e4e4 | ||
|
|
6ed7c3491e | ||
|
|
ce45763b58 | ||
|
|
5166b3b763 | ||
|
|
e8abab3854 | ||
|
|
40a1cf57d3 | ||
|
|
9a4238fbd6 | ||
|
|
9607b5faaa | ||
|
|
8476c193cb | ||
|
|
34597fed7b | ||
|
|
d304e5f9ba | ||
|
|
ebe613e907 | ||
|
|
6bd09e8ecc | ||
|
|
094f2c110c | ||
|
|
03cd5911df | ||
|
|
a2d46139d9 | ||
|
|
b787ad1672 | ||
|
|
493595acdb | ||
|
|
b74acbd377 | ||
|
|
0690844121 | ||
|
|
48e1a4dcfc | ||
|
|
4b1925a90e | ||
|
|
3c560c6bd0 | ||
|
|
86e67ee11e | ||
|
|
ef41d9b816 | ||
|
|
61f347b6ff | ||
|
|
85835e68c4 | ||
|
|
5750778493 | ||
|
|
da7e076b23 | ||
|
|
fbd3f73ad4 | ||
|
|
bf6e2e5c45 | ||
|
|
82d983221c | ||
|
|
137fde170d | ||
|
|
94fd6d88ca | ||
|
|
45948240a7 | ||
|
|
e15ee21114 | ||
|
|
a4828aea55 | ||
|
|
6dfe5c1ffb | ||
|
|
396ad4eaca | ||
|
|
b5a4168451 | ||
|
|
9db1e5ec27 | ||
|
|
3180dfe446 | ||
|
|
3181ab1054 | ||
|
|
d8f7b1fa42 | ||
|
|
f60b42ed46 | ||
|
|
f64e21df99 | ||
|
|
3ca9f3d998 | ||
|
|
cd74d7acd3 | ||
|
|
6ee917b9e5 | ||
|
|
db2600b8ff | ||
|
|
7fa6a6fed5 | ||
|
|
6bd74d76fe | ||
|
|
aec7c80393 | ||
|
|
cda78490b3 | ||
|
|
4bba71a878 | ||
|
|
176603ba7c | ||
|
|
30675b84bb | ||
|
|
839d783d52 | ||
|
|
db060559f7 | ||
|
|
8bb21014a5 | ||
|
|
04b2e9ec7b | ||
|
|
988883b98d | ||
|
|
1ab25b7c73 | ||
|
|
7110e42ccf | ||
|
|
36123dbc39 | ||
|
|
6aef52e400 | ||
|
|
ac89b4ad91 | ||
|
|
e163d28535 | ||
|
|
715d406753 | ||
|
|
138f36aa16 | ||
|
|
b07dd9aa6f | ||
|
|
e0ac22bfc2 | ||
|
|
0498fb5dc5 | ||
|
|
06340ec177 | ||
|
|
9f3562b7a0 | ||
|
|
a948dfad97 |
1435 changed files with 27023 additions and 7014 deletions
|
|
@ -0,0 +1,71 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Al Stone <ahs3@redhat.com>
|
||||
Date: Tue, 27 Feb 2018 00:21:23 -0500
|
||||
Subject: [PATCH] ACPI: APEI: arm64: Ignore broken HPE moonshot APEI support
|
||||
|
||||
Message-id: <20180227002123.21608-1-ahs3@redhat.com>
|
||||
Patchwork-id: 206052
|
||||
O-Subject: [RHEL8 BZ1518076 PATCH] ACPI: APEI: arm64: Ignore broken HPE moonshot APEI support
|
||||
Bugzilla: 1518076
|
||||
RH-Acked-by: Mark Salter <msalter@redhat.com>
|
||||
RH-Acked-by: Jeremy McNicoll <jmcnicol@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1518076
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15417197
|
||||
Tested: compile-only; several other patches are required for full booting
|
||||
QE has tested limited boot (see comment#12 of BZ)
|
||||
|
||||
This is a re-post of a RHEL-ALT-7.5 patch specific to aarch64 moonshots
|
||||
that we use in beaker. It is required for these machines to boot.
|
||||
|
||||
commit 8a663a264863efedf8bb4a9d76ac603920fdd739
|
||||
Author: Robert Richter <rrichter@redhat.com>
|
||||
Date: Wed Aug 16 19:49:30 2017 -0400
|
||||
|
||||
[acpi] APEI: arm64: Ignore broken HPE moonshot APEI support
|
||||
|
||||
From: Mark Salter <msalter@redhat.com>
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1344237
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13768971
|
||||
Tested: Booted on moonshot with patched 4.11.0-20 kernel
|
||||
Upstream: RHEL-only
|
||||
|
||||
The aarch64 HP moonshot platforms we have in beaker and elsewhere have
|
||||
a firmware bug which causes a spurious fatal memory error via APEI at
|
||||
boot time. This platform is no longer supported and no further firmware
|
||||
updates are expected. This is a downstream-only hack to avoid the problem
|
||||
by bailing out of HEST table probing if we detect a moonshot HEST table.
|
||||
|
||||
Signed-off-by: Mark Salter <msalter@redhat.com>
|
||||
Signed-off-by: Robert Richter <rrichter@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Al Stone <ahs3@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
drivers/acpi/apei/hest.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
|
||||
index 953a2fae8b15..7ea07f7da582 100644
|
||||
--- a/drivers/acpi/apei/hest.c
|
||||
+++ b/drivers/acpi/apei/hest.c
|
||||
@@ -88,6 +88,14 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
|
||||
if (hest_disable || !hest_tab)
|
||||
return -EINVAL;
|
||||
|
||||
+#ifdef CONFIG_ARM64
|
||||
+ /* Ignore broken firmware */
|
||||
+ if (!strncmp(hest_tab->header.oem_id, "HPE ", 6) &&
|
||||
+ !strncmp(hest_tab->header.oem_table_id, "ProLiant", 8) &&
|
||||
+ MIDR_IMPLEMENTOR(read_cpuid_id()) == ARM_CPU_IMP_APM)
|
||||
+ return -EINVAL;
|
||||
+#endif
|
||||
+
|
||||
hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
|
||||
for (i = 0; i < hest_tab->error_source_count; i++) {
|
||||
len = hest_esrc_len(hest_hdr);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,8 +1,17 @@
|
|||
From dbdda4277cf0422a9ccb7ea98d0263c3cdbecdf6 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Salter <msalter@redhat.com>
|
||||
Date: Tue, 8 May 2018 21:54:39 -0400
|
||||
Subject: [PATCH] ACPI / irq: Workaround firmware issue on X-Gene based
|
||||
m400
|
||||
Date: Thu, 10 May 2018 17:38:43 -0400
|
||||
Subject: [PATCH] ACPI / irq: Workaround firmware issue on X-Gene based m400
|
||||
|
||||
Message-id: <20180510173844.29580-3-msalter@redhat.com>
|
||||
Patchwork-id: 214383
|
||||
O-Subject: [RHEL-8 BZ1519554 2/3] ACPI / irq: Workaround firmware issue on X-Gene based m400
|
||||
Bugzilla: 1519554
|
||||
RH-Acked-by: Al Stone <astone@redhat.com>
|
||||
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519554
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16144520
|
||||
|
||||
The ACPI firmware on the xgene-based m400 platorms erroneously
|
||||
describes its UART interrupt as ACPI_PRODUCER rather than
|
||||
|
|
@ -11,24 +20,26 @@ find its interrupt and the kernel unable find a console.
|
|||
Work around this by avoiding the producer/consumer check
|
||||
for X-Gene UARTs.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Mark Salter <msalter@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
drivers/acpi/irq.c | 17 +++++++++++++++--
|
||||
1 file changed, 15 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
|
||||
index 7c352cba0528..028c1a564cff 100644
|
||||
index e209081d644b..7484bcf59a1b 100644
|
||||
--- a/drivers/acpi/irq.c
|
||||
+++ b/drivers/acpi/irq.c
|
||||
@@ -129,6 +129,7 @@ struct acpi_irq_parse_one_ctx {
|
||||
@@ -126,6 +126,7 @@ struct acpi_irq_parse_one_ctx {
|
||||
unsigned int index;
|
||||
unsigned long *res_flags;
|
||||
struct irq_fwspec *fwspec;
|
||||
+ bool skip_producer_check;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -200,7 +201,8 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
|
||||
@@ -197,7 +198,8 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
|
||||
return AE_CTRL_TERMINATE;
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
eirq = &ares->data.extended_irq;
|
||||
|
|
@ -38,13 +49,13 @@ index 7c352cba0528..028c1a564cff 100644
|
|||
return AE_OK;
|
||||
if (ctx->index >= eirq->interrupt_count) {
|
||||
ctx->index -= eirq->interrupt_count;
|
||||
@@ -235,8 +237,19 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
|
||||
@@ -232,8 +234,19 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
|
||||
static int acpi_irq_parse_one(acpi_handle handle, unsigned int index,
|
||||
struct irq_fwspec *fwspec, unsigned long *flags)
|
||||
{
|
||||
- struct acpi_irq_parse_one_ctx ctx = { -EINVAL, index, flags, fwspec };
|
||||
+ struct acpi_irq_parse_one_ctx ctx = { -EINVAL, index, flags, fwspec, false };
|
||||
|
||||
|
||||
+ /*
|
||||
+ * Firmware on arm64-based HPE m400 platform incorrectly marks
|
||||
+ * its UART interrupt as ACPI_PRODUCER rather than ACPI_CONSUMER.
|
||||
|
|
@ -60,5 +71,5 @@ index 7c352cba0528..028c1a564cff 100644
|
|||
return ctx.rc;
|
||||
}
|
||||
--
|
||||
2.17.0
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
Date: Mon, 30 Sep 2019 14:59:25 +0900
|
||||
Subject: [PATCH] ARM: fix __get_user_check() in case uaccess_* calls are not
|
||||
inlined
|
||||
|
||||
KernelCI reports that bcm2835_defconfig is no longer booting since
|
||||
commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING
|
||||
forcibly"):
|
||||
|
||||
https://lkml.org/lkml/2019/9/26/825
|
||||
|
||||
I also received a regression report from Nicolas Saenz Julienne:
|
||||
|
||||
https://lkml.org/lkml/2019/9/27/263
|
||||
|
||||
This problem has cropped up on arch/arm/config/bcm2835_defconfig
|
||||
because it enables CONFIG_CC_OPTIMIZE_FOR_SIZE. The compiler tends
|
||||
to prefer not inlining functions with -Os. I was able to reproduce
|
||||
it with other boards and defconfig files by manually enabling
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE.
|
||||
|
||||
The __get_user_check() specifically uses r0, r1, r2 registers.
|
||||
So, uaccess_save_and_enable() and uaccess_restore() must be inlined
|
||||
in order to avoid those registers being overwritten in the callees.
|
||||
|
||||
Prior to commit 9012d011660e ("compiler: allow all arches to enable
|
||||
CONFIG_OPTIMIZE_INLINING"), the 'inline' marker was always enough for
|
||||
inlining functions, except on x86.
|
||||
|
||||
Since that commit, all architectures can enable CONFIG_OPTIMIZE_INLINING.
|
||||
So, __always_inline is now the only guaranteed way of forcible inlining.
|
||||
|
||||
I want to keep as much compiler's freedom as possible about the inlining
|
||||
decision. So, I changed the function call order instead of adding
|
||||
__always_inline around.
|
||||
|
||||
Call uaccess_save_and_enable() before assigning the __p ("r0"), and
|
||||
uaccess_restore() after evacuating the __e ("r0").
|
||||
|
||||
Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
|
||||
Reported-by: "kernelci.org bot" <bot@kernelci.org>
|
||||
Reported-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
|
||||
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
Acked-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
|
||||
Tested-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
|
||||
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
---
|
||||
arch/arm/include/asm/uaccess.h | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
|
||||
index 98c6b91be4a8..60055827dddc 100644
|
||||
--- a/arch/arm/include/asm/uaccess.h
|
||||
+++ b/arch/arm/include/asm/uaccess.h
|
||||
@@ -191,11 +191,12 @@ extern int __get_user_64t_4(void *);
|
||||
#define __get_user_check(x, p) \
|
||||
({ \
|
||||
unsigned long __limit = current_thread_info()->addr_limit - 1; \
|
||||
+ unsigned int __ua_flags = uaccess_save_and_enable(); \
|
||||
register typeof(*(p)) __user *__p asm("r0") = (p); \
|
||||
register __inttype(x) __r2 asm("r2"); \
|
||||
register unsigned long __l asm("r1") = __limit; \
|
||||
register int __e asm("r0"); \
|
||||
- unsigned int __ua_flags = uaccess_save_and_enable(); \
|
||||
+ unsigned int __err; \
|
||||
switch (sizeof(*(__p))) { \
|
||||
case 1: \
|
||||
if (sizeof((x)) >= 8) \
|
||||
@@ -223,9 +224,10 @@ extern int __get_user_64t_4(void *);
|
||||
break; \
|
||||
default: __e = __get_user_bad(); break; \
|
||||
} \
|
||||
- uaccess_restore(__ua_flags); \
|
||||
+ __err = __e; \
|
||||
x = (typeof(*(p))) __r2; \
|
||||
- __e; \
|
||||
+ uaccess_restore(__ua_flags); \
|
||||
+ __err; \
|
||||
})
|
||||
|
||||
#define get_user(x, p) \
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Thu, 3 May 2012 20:27:11 +0100
|
||||
Subject: [PATCH] ARM: tegra: usb no reset
|
||||
|
|
@ -9,13 +10,13 @@ Patch for disconnect issues with storage attached to a
|
|||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
|
||||
index 43cb2f2e3b43..7f838ec11c81 100644
|
||||
index b1e14beaac5f..b28779779058 100644
|
||||
--- a/drivers/usb/core/hub.c
|
||||
+++ b/drivers/usb/core/hub.c
|
||||
@@ -4996,6 +4996,13 @@ static void hub_event(struct work_struct *work)
|
||||
@@ -5517,6 +5517,13 @@ static void hub_event(struct work_struct *work)
|
||||
(u16) hub->change_bits[0],
|
||||
(u16) hub->event_bits[0]);
|
||||
|
||||
|
||||
+ /* Don't disconnect USB-SATA on TrimSlice */
|
||||
+ if (strcmp(dev_name(hdev->bus->controller), "tegra-ehci.0") == 0) {
|
||||
+ if ((hdev->state == 7) && (hub->change_bits[0] == 0) &&
|
||||
|
|
@ -26,3 +27,6 @@ index 43cb2f2e3b43..7f838ec11c81 100644
|
|||
/* Lock the device, then check to see if we were
|
||||
* disconnected while waiting for the lock to succeed. */
|
||||
usb_lock_device(hdev);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,55 +1,35 @@
|
|||
From c8218e9b3c38fcd36a2d06eec09952a0c6cee9e0 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 2 Oct 2017 18:22:13 -0400
|
||||
Subject: [PATCH 2/3] Add efi_status_to_str() and rework efi_status_to_err().
|
||||
Subject: [PATCH] Add efi_status_to_str() and rework efi_status_to_err().
|
||||
|
||||
This adds efi_status_to_str() for use when printing efi_status_t
|
||||
messages, and reworks efi_status_to_err() so that the two use a common
|
||||
list of errors.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
include/linux/efi.h | 3 ++
|
||||
drivers/firmware/efi/efi.c | 122 ++++++++++++++++++++++++++++++++++-----------
|
||||
2 files changed, 95 insertions(+), 30 deletions(-)
|
||||
drivers/firmware/efi/efi.c | 124 +++++++++++++++++++++++++++----------
|
||||
include/linux/efi.h | 3 +
|
||||
2 files changed, 96 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/include/linux/efi.h b/include/linux/efi.h
|
||||
index 18b16bf5ce1..436b3c93c3d 100644
|
||||
--- a/include/linux/efi.h
|
||||
+++ b/include/linux/efi.h
|
||||
@@ -42,6 +42,8 @@
|
||||
#define EFI_ABORTED (21 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
|
||||
|
||||
+#define EFI_IS_ERROR(x) ((x) & (1UL << (BITS_PER_LONG-1)))
|
||||
+
|
||||
typedef unsigned long efi_status_t;
|
||||
typedef u8 efi_bool_t;
|
||||
typedef u16 efi_char16_t; /* UNICODE character */
|
||||
@@ -1183,6 +1185,7 @@ static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
|
||||
#endif
|
||||
|
||||
extern int efi_status_to_err(efi_status_t status);
|
||||
+extern const char *efi_status_to_str(efi_status_t status);
|
||||
|
||||
/*
|
||||
* Variable Attributes
|
||||
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
|
||||
index 557a47829d0..e8f9c7d84e9 100644
|
||||
index fdd1db025dbf..8ef7d1df09dd 100644
|
||||
--- a/drivers/firmware/efi/efi.c
|
||||
+++ b/drivers/firmware/efi/efi.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/ucs2_string.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/security.h>
|
||||
+#include <linux/bsearch.h>
|
||||
|
||||
|
||||
#include <asm/early_ioremap.h>
|
||||
|
||||
@@ -865,40 +866,101 @@ int efi_mem_type(unsigned long phys_addr)
|
||||
|
||||
@@ -831,40 +832,101 @@ int efi_mem_type(unsigned long phys_addr)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+struct efi_error_code {
|
||||
+ efi_status_t status;
|
||||
+ int errno;
|
||||
|
|
@ -123,9 +103,7 @@ index 557a47829d0..e8f9c7d84e9 100644
|
|||
int efi_status_to_err(efi_status_t status)
|
||||
{
|
||||
- int err;
|
||||
+ struct efi_error_code *found;
|
||||
+ size_t num = sizeof(efi_error_codes) / sizeof(struct efi_error_code);
|
||||
|
||||
-
|
||||
- switch (status) {
|
||||
- case EFI_SUCCESS:
|
||||
- err = 0;
|
||||
|
|
@ -154,6 +132,10 @@ index 557a47829d0..e8f9c7d84e9 100644
|
|||
- default:
|
||||
- err = -EINVAL;
|
||||
- }
|
||||
+ struct efi_error_code *found;
|
||||
+ size_t num = sizeof(efi_error_codes) / sizeof(struct efi_error_code);
|
||||
|
||||
- return err;
|
||||
+ found = bsearch((void *)(uintptr_t)status, efi_error_codes,
|
||||
+ sizeof(struct efi_error_code), num,
|
||||
+ efi_status_cmp_bsearch);
|
||||
|
|
@ -161,8 +143,7 @@ index 557a47829d0..e8f9c7d84e9 100644
|
|||
+ return -EINVAL;
|
||||
+ return found->errno;
|
||||
+}
|
||||
|
||||
- return err;
|
||||
+
|
||||
+const char *
|
||||
+efi_status_to_str(efi_status_t status)
|
||||
+{
|
||||
|
|
@ -176,8 +157,29 @@ index 557a47829d0..e8f9c7d84e9 100644
|
|||
+ return "Unknown error code";
|
||||
+ return found->description;
|
||||
}
|
||||
|
||||
bool efi_is_table_address(unsigned long phys_addr)
|
||||
--
|
||||
2.15.0
|
||||
|
||||
static DEFINE_SPINLOCK(efi_mem_reserve_persistent_lock);
|
||||
diff --git a/include/linux/efi.h b/include/linux/efi.h
|
||||
index 05c47f857383..2e2f9f608f68 100644
|
||||
--- a/include/linux/efi.h
|
||||
+++ b/include/linux/efi.h
|
||||
@@ -43,6 +43,8 @@
|
||||
#define EFI_ABORTED (21 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
|
||||
|
||||
+#define EFI_IS_ERROR(x) ((x) & (1UL << (BITS_PER_LONG-1)))
|
||||
+
|
||||
typedef unsigned long efi_status_t;
|
||||
typedef u8 efi_bool_t;
|
||||
typedef u16 efi_char16_t; /* UNICODE character */
|
||||
@@ -828,6 +830,7 @@ static inline bool efi_rt_services_supported(unsigned int mask)
|
||||
#endif
|
||||
|
||||
extern int efi_status_to_err(efi_status_t status);
|
||||
+extern const char *efi_status_to_str(efi_status_t status);
|
||||
|
||||
/*
|
||||
* Variable Attributes
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,29 +1,32 @@
|
|||
From 487ff7b0e537506057960a0c2d9482d19f2acf4a Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Wed, 26 Apr 2017 11:12:54 +0100
|
||||
Date: Wed, 26 Feb 2020 13:38:40 -0500
|
||||
Subject: [PATCH] Add option of 13 for FORCE_MAX_ZONEORDER
|
||||
|
||||
This is a hack, but it's what the other distros currently use
|
||||
for aarch64 with 4K pages so we'll do the same while upstream
|
||||
decides what the best outcome is (which isn't this).
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
[Add a dependency on RHEL_DIFFERENCES]
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
arch/arm64/Kconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
|
||||
index 3741859765cf..deec9511f1d3 100644
|
||||
index 2e0700a451e5..77e7e749d7e5 100644
|
||||
--- a/arch/arm64/Kconfig
|
||||
+++ b/arch/arm64/Kconfig
|
||||
@@ -751,6 +751,7 @@ config XEN
|
||||
@@ -1133,6 +1133,7 @@ config XEN
|
||||
config FORCE_MAX_ZONEORDER
|
||||
int
|
||||
default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
|
||||
+ default "13" if (ARCH_THUNDER && !ARM64_64K_PAGES)
|
||||
+ default "13" if (ARCH_THUNDER && !ARM64_64K_PAGES && !RHEL_DIFFERENCES)
|
||||
default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
|
||||
default "11"
|
||||
help
|
||||
--
|
||||
2.12.2
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 12cec6680e67d6b4fed9e30cd8c1f13871996cc1 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Laura Abbott <labbott@redhat.com>
|
||||
Date: Wed, 23 Jan 2019 14:36:37 +0100
|
||||
Subject: [PATCH] Drop that for now
|
||||
|
|
@ -8,10 +8,10 @@ Subject: [PATCH] Drop that for now
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f5b1d0d168e0..5f31107b22d1 100644
|
||||
index 37cfb39d77af..c65a263990ae 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -430,7 +430,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
|
||||
@@ -496,7 +496,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
|
||||
KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
||||
-Werror=implicit-function-declaration -Werror=implicit-int \
|
||||
|
|
@ -21,5 +21,5 @@ index f5b1d0d168e0..5f31107b22d1 100644
|
|||
KBUILD_CPPFLAGS := -D__KERNEL__
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
--
|
||||
2.20.1
|
||||
2.26.2
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
From 0a74d0f27e8d60e427b447a041bc061917d85fac Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
||||
Date: Mon, 3 Apr 2017 18:18:21 +0200
|
||||
Subject: [PATCH] Input: rmi4 - remove the need for artificial IRQ in case of
|
||||
|
|
@ -22,33 +22,33 @@ Signed-off-by: Lyude <lyude@redhat.com>
|
|||
3 files changed, 75 insertions(+), 114 deletions(-)
|
||||
|
||||
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
|
||||
index 9e33165250a3..e7e33a160b47 100644
|
||||
index 8cffa84c9650..6c4e3675601a 100644
|
||||
--- a/drivers/hid/hid-rmi.c
|
||||
+++ b/drivers/hid/hid-rmi.c
|
||||
@@ -316,19 +316,12 @@ static int rmi_input_event(struct hid_device *hdev, u8 *data, int size)
|
||||
@@ -322,19 +322,12 @@ static int rmi_input_event(struct hid_device *hdev, u8 *data, int size)
|
||||
{
|
||||
struct rmi_data *hdata = hid_get_drvdata(hdev);
|
||||
struct rmi_device *rmi_dev = hdata->xport.rmi_dev;
|
||||
- unsigned long flags;
|
||||
|
||||
|
||||
if (!(test_bit(RMI_STARTED, &hdata->flags)))
|
||||
return 0;
|
||||
|
||||
|
||||
- local_irq_save(flags);
|
||||
-
|
||||
rmi_set_attn_data(rmi_dev, data[1], &data[2], size - 2);
|
||||
|
||||
|
||||
- generic_handle_irq(hdata->rmi_irq);
|
||||
-
|
||||
- local_irq_restore(flags);
|
||||
-
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -586,56 +579,6 @@ static const struct rmi_transport_ops hid_rmi_ops = {
|
||||
|
||||
@@ -592,56 +585,6 @@ static const struct rmi_transport_ops hid_rmi_ops = {
|
||||
.reset = rmi_hid_reset,
|
||||
};
|
||||
|
||||
|
||||
-static void rmi_irq_teardown(void *data)
|
||||
-{
|
||||
- struct rmi_data *hdata = data;
|
||||
|
|
@ -102,10 +102,10 @@ index 9e33165250a3..e7e33a160b47 100644
|
|||
static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
{
|
||||
struct rmi_data *data = NULL;
|
||||
@@ -708,18 +651,11 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
|
||||
@@ -714,18 +657,11 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
|
||||
mutex_init(&data->page_mutex);
|
||||
|
||||
|
||||
- ret = rmi_setup_irq_domain(hdev);
|
||||
- if (ret) {
|
||||
- hid_err(hdev, "failed to allocate IRQ domain\n");
|
||||
|
|
@ -114,26 +114,26 @@ index 9e33165250a3..e7e33a160b47 100644
|
|||
-
|
||||
if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)
|
||||
rmi_hid_pdata.f30_data.disable = true;
|
||||
|
||||
|
||||
data->xport.dev = hdev->dev.parent;
|
||||
data->xport.pdata = rmi_hid_pdata;
|
||||
- data->xport.pdata.irq = data->rmi_irq;
|
||||
data->xport.proto_name = "hid";
|
||||
data->xport.ops = &hid_rmi_ops;
|
||||
|
||||
|
||||
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
|
||||
index fc3ab93b7aea..35bc90141db8 100644
|
||||
index 258d5fe3d395..f7298e3dc8f3 100644
|
||||
--- a/drivers/input/rmi4/rmi_driver.c
|
||||
+++ b/drivers/input/rmi4/rmi_driver.c
|
||||
@@ -185,34 +185,47 @@ void rmi_set_attn_data(struct rmi_device *rmi_dev, unsigned long irq_status,
|
||||
@@ -182,34 +182,47 @@ void rmi_set_attn_data(struct rmi_device *rmi_dev, unsigned long irq_status,
|
||||
attn_data.data = fifo_data;
|
||||
|
||||
|
||||
kfifo_put(&drvdata->attn_fifo, attn_data);
|
||||
+
|
||||
+ schedule_work(&drvdata->attn_work);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rmi_set_attn_data);
|
||||
|
||||
|
||||
-static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
|
||||
+static void attn_callback(struct work_struct *work)
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
+ attn_work);
|
||||
struct rmi4_attn_data attn_data = {0};
|
||||
int ret, count;
|
||||
|
||||
|
||||
count = kfifo_get(&drvdata->attn_fifo, &attn_data);
|
||||
- if (count) {
|
||||
- *(drvdata->irq_status) = attn_data.irq_status;
|
||||
|
|
@ -152,7 +152,7 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
- }
|
||||
+ if (!count)
|
||||
+ return;
|
||||
|
||||
|
||||
- ret = rmi_process_interrupt_requests(rmi_dev);
|
||||
+ *(drvdata->irq_status) = attn_data.irq_status;
|
||||
+ drvdata->attn_data = attn_data;
|
||||
|
|
@ -162,14 +162,14 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
- rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev,
|
||||
+ rmi_dbg(RMI_DEBUG_CORE, &drvdata->rmi_dev->dev,
|
||||
"Failed to process interrupt request: %d\n", ret);
|
||||
|
||||
|
||||
- if (count) {
|
||||
- kfree(attn_data.data);
|
||||
- attn_data.data = NULL;
|
||||
- drvdata->attn_data.data = NULL;
|
||||
- }
|
||||
+ kfree(attn_data.data);
|
||||
+ attn_data.data = NULL;
|
||||
|
||||
+ drvdata->attn_data.data = NULL;
|
||||
|
||||
if (!kfifo_is_empty(&drvdata->attn_fifo))
|
||||
- return rmi_irq_fn(irq, dev_id);
|
||||
+ schedule_work(&drvdata->attn_work);
|
||||
|
|
@ -184,30 +184,30 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
+ if (ret)
|
||||
+ rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev,
|
||||
+ "Failed to process interrupt request: %d\n", ret);
|
||||
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -220,7 +233,6 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
|
||||
@@ -217,7 +230,6 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
|
||||
static int rmi_irq_init(struct rmi_device *rmi_dev)
|
||||
{
|
||||
struct rmi_device_platform_data *pdata = rmi_get_platform_data(rmi_dev);
|
||||
- struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
|
||||
int irq_flags = irq_get_trigger_type(pdata->irq);
|
||||
int ret;
|
||||
|
||||
@@ -238,8 +250,6 @@ static int rmi_irq_init(struct rmi_device *rmi_dev)
|
||||
|
||||
@@ -235,8 +247,6 @@ static int rmi_irq_init(struct rmi_device *rmi_dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
- data->enabled = true;
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -889,23 +899,27 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
|
||||
|
||||
@@ -886,23 +896,27 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
|
||||
if (data->enabled)
|
||||
goto out;
|
||||
|
||||
|
||||
- enable_irq(irq);
|
||||
- data->enabled = true;
|
||||
- if (clear_wake && device_may_wakeup(rmi_dev->xport->dev)) {
|
||||
|
|
@ -227,7 +227,7 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
+ "Failed to disable irq for wake: %d\n",
|
||||
+ retval);
|
||||
+ }
|
||||
|
||||
|
||||
- /*
|
||||
- * Call rmi_process_interrupt_requests() after enabling irq,
|
||||
- * otherwise we may lose interrupt on edge-triggered systems.
|
||||
|
|
@ -245,12 +245,12 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
+ } else {
|
||||
+ data->enabled = true;
|
||||
+ }
|
||||
|
||||
|
||||
out:
|
||||
mutex_unlock(&data->enabled_mutex);
|
||||
@@ -925,20 +939,22 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
|
||||
@@ -922,20 +936,22 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
|
||||
goto out;
|
||||
|
||||
|
||||
data->enabled = false;
|
||||
- disable_irq(irq);
|
||||
- if (enable_wake && device_may_wakeup(rmi_dev->xport->dev)) {
|
||||
|
|
@ -283,21 +283,21 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
+ kfree(attn_data.data);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
out:
|
||||
@@ -984,6 +1000,8 @@ static int rmi_driver_remove(struct device *dev)
|
||||
@@ -981,6 +997,8 @@ static int rmi_driver_remove(struct device *dev)
|
||||
irq_domain_remove(data->irqdomain);
|
||||
data->irqdomain = NULL;
|
||||
|
||||
|
||||
+ cancel_work_sync(&data->attn_work);
|
||||
+
|
||||
rmi_f34_remove_sysfs(rmi_dev);
|
||||
rmi_free_function_list(rmi_dev);
|
||||
|
||||
@@ -1221,9 +1239,15 @@ static int rmi_driver_probe(struct device *dev)
|
||||
|
||||
@@ -1219,9 +1237,15 @@ static int rmi_driver_probe(struct device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- retval = rmi_irq_init(rmi_dev);
|
||||
- if (retval < 0)
|
||||
- goto err_destroy_functions;
|
||||
|
|
@ -310,21 +310,21 @@ index fc3ab93b7aea..35bc90141db8 100644
|
|||
+ data->enabled = true;
|
||||
+
|
||||
+ INIT_WORK(&data->attn_work, attn_callback);
|
||||
|
||||
|
||||
if (data->f01_container->dev.driver) {
|
||||
/* Driver already bound, so enable ATTN now. */
|
||||
diff --git a/include/linux/rmi.h b/include/linux/rmi.h
|
||||
index 5ef5c7c412a7..21f48f2807de 100644
|
||||
index 7b22366d0065..307a651b2755 100644
|
||||
--- a/include/linux/rmi.h
|
||||
+++ b/include/linux/rmi.h
|
||||
@@ -366,6 +366,7 @@ struct rmi_driver_data {
|
||||
|
||||
@@ -363,6 +363,7 @@ struct rmi_driver_data {
|
||||
|
||||
struct rmi4_attn_data attn_data;
|
||||
DECLARE_KFIFO(attn_fifo, struct rmi4_attn_data, 16);
|
||||
+ struct work_struct attn_work;
|
||||
};
|
||||
|
||||
|
||||
int rmi_register_transport_device(struct rmi_transport_dev *xport);
|
||||
--
|
||||
2.17.1
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 70cecc97a4fc1667472224558a50dd7b6c42c789 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Holmes <robeholmes@gmail.com>
|
||||
Date: Tue, 23 Apr 2019 07:39:29 +0000
|
||||
Subject: [PATCH] KEYS: Make use of platform keyring for module signature
|
||||
|
|
@ -13,42 +13,32 @@ As such, kernel modules signed with keys from the MokList variable
|
|||
were not successfully verified.
|
||||
|
||||
Signed-off-by: Robert Holmes <robeholmes@gmail.com>
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
kernel/module_signing.c | 16 ++++++++++++----
|
||||
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||
kernel/module_signing.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/kernel/module_signing.c b/kernel/module_signing.c
|
||||
index 6b9a926fd86b..cf94220e9154 100644
|
||||
index 9d9fc678c91d..84ad75a53c83 100644
|
||||
--- a/kernel/module_signing.c
|
||||
+++ b/kernel/module_signing.c
|
||||
@@ -49,6 +49,7 @@ int mod_verify_sig(const void *mod, struct load_info *info)
|
||||
{
|
||||
struct module_signature ms;
|
||||
size_t sig_len, modlen = info->len;
|
||||
+ int ret;
|
||||
|
||||
pr_devel("==>%s(,%zu)\n", __func__, modlen);
|
||||
|
||||
@@ -82,8 +83,15 @@ int mod_verify_sig(const void *mod, struct load_info *info)
|
||||
return -EBADMSG;
|
||||
}
|
||||
|
||||
@@ -38,8 +38,15 @@ int mod_verify_sig(const void *mod, struct load_info *info)
|
||||
modlen -= sig_len + sizeof(ms);
|
||||
info->len = modlen;
|
||||
|
||||
- return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
|
||||
- VERIFY_USE_SECONDARY_KEYRING,
|
||||
- VERIFYING_MODULE_SIGNATURE,
|
||||
- NULL, NULL);
|
||||
+ ret = verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
|
||||
+ VERIFY_USE_SECONDARY_KEYRING,
|
||||
+ VERIFYING_MODULE_SIGNATURE,
|
||||
+ NULL, NULL);
|
||||
VERIFY_USE_SECONDARY_KEYRING,
|
||||
VERIFYING_MODULE_SIGNATURE,
|
||||
NULL, NULL);
|
||||
+ if (ret == -ENOKEY && IS_ENABLED(CONFIG_INTEGRITY_PLATFORM_KEYRING)) {
|
||||
+ ret = verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
|
||||
+ VERIFY_USE_PLATFORM_KEYRING,
|
||||
+ VERIFYING_MODULE_SIGNATURE,
|
||||
+ NULL, NULL);
|
||||
+ VERIFY_USE_PLATFORM_KEYRING,
|
||||
+ VERIFYING_MODULE_SIGNATURE,
|
||||
+ NULL, NULL);
|
||||
+ }
|
||||
+ return ret;
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
From 3ce5852ec6add45a28fe1706e9163351940e905c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 2 Oct 2017 18:25:29 -0400
|
||||
Subject: [PATCH 1/3] Make get_cert_list() not complain about cert lists that
|
||||
aren't present.
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
security/integrity/platform_certs/load_uefi.c | 37 ++++++++++++++++++++++---------------
|
||||
1 file changed, 22 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
|
||||
index 81b19c52832b..e188f3ecbce3 100644
|
||||
--- a/security/integrity/platform_certs/load_uefi.c
|
||||
+++ b/security/integrity/platform_certs/load_uefi.c
|
||||
@@ -38,8 +38,8 @@ static __init bool uefi_check_ignore_db(void)
|
||||
/*
|
||||
* Get a certificate list blob from the named EFI variable.
|
||||
*/
|
||||
-static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
- unsigned long *size)
|
||||
+static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
+ unsigned long *size , void **cert_list)
|
||||
{
|
||||
efi_status_t status;
|
||||
unsigned long lsize = 4;
|
||||
@@ -47,24 +47,31 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
void *db;
|
||||
|
||||
status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
|
||||
+ if (status == EFI_NOT_FOUND) {
|
||||
+ *size = 0;
|
||||
+ *cert_list = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (status != EFI_BUFFER_TOO_SMALL) {
|
||||
pr_err("Couldn't get size: 0x%lx\n", status);
|
||||
- return NULL;
|
||||
+ return efi_status_to_err(status);
|
||||
}
|
||||
|
||||
db = kmalloc(lsize, GFP_KERNEL);
|
||||
if (!db)
|
||||
- return NULL;
|
||||
+ return -ENOMEM;
|
||||
|
||||
status = efi.get_variable(name, guid, NULL, &lsize, db);
|
||||
if (status != EFI_SUCCESS) {
|
||||
kfree(db);
|
||||
pr_err("Error reading db var: 0x%lx\n", status);
|
||||
- return NULL;
|
||||
+ return efi_status_to_err(status);
|
||||
}
|
||||
|
||||
*size = lsize;
|
||||
- return db;
|
||||
+ *cert_list = db;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -153,10 +160,10 @@ static int __init load_uefi_certs(void)
|
||||
* an error if we can't get them.
|
||||
*/
|
||||
if (!uefi_check_ignore_db()) {
|
||||
- db = get_cert_list(L"db", &secure_var, &dbsize);
|
||||
- if (!db) {
|
||||
+ rc = get_cert_list(L"db", &secure_var, &dbsize, &db);
|
||||
+ if (rc < 0) {
|
||||
pr_err("MODSIGN: Couldn't get UEFI db list\n");
|
||||
- } else {
|
||||
+ } else if (dbsize != 0) {
|
||||
rc = parse_efi_signature_list("UEFI:db",
|
||||
db, dbsize, get_handler_for_db);
|
||||
if (rc)
|
||||
@@ -166,10 +173,10 @@ static int __init load_uefi_certs(void)
|
||||
}
|
||||
}
|
||||
|
||||
- mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
|
||||
- if (!mok) {
|
||||
+ rc = get_cert_list(L"MokListRT", &mok_var, &moksize, &mok);
|
||||
+ if (rc < 0) {
|
||||
pr_info("Couldn't get UEFI MokListRT\n");
|
||||
- } else {
|
||||
+ } else if (moksize != 0) {
|
||||
rc = parse_efi_signature_list("UEFI:MokListRT",
|
||||
mok, moksize, get_handler_for_db);
|
||||
if (rc)
|
||||
@@ -177,10 +184,10 @@ static int __init load_uefi_certs(void)
|
||||
kfree(mok);
|
||||
}
|
||||
|
||||
- dbx = get_cert_list(L"dbx", &secure_var, &dbxsize);
|
||||
- if (!dbx) {
|
||||
+ rc = get_cert_list(L"dbx", &secure_var, &dbxsize, &dbx);
|
||||
+ if (rc < 0) {
|
||||
pr_info("Couldn't get UEFI dbx list\n");
|
||||
- } else {
|
||||
+ } else if (dbxsize != 0) {
|
||||
rc = parse_efi_signature_list("UEFI:dbx",
|
||||
dbx, dbxsize,
|
||||
get_handler_for_dbx);
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 2 Oct 2017 18:18:30 -0400
|
||||
Subject: [PATCH] Make get_cert_list() use efi_status_to_str() to print error
|
||||
messages.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
security/integrity/platform_certs/load_uefi.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
|
||||
index 253fb9a7fc98..8c95b68d86d4 100644
|
||||
--- a/security/integrity/platform_certs/load_uefi.c
|
||||
+++ b/security/integrity/platform_certs/load_uefi.c
|
||||
@@ -46,7 +46,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
return NULL;
|
||||
|
||||
if (*status != EFI_BUFFER_TOO_SMALL) {
|
||||
- pr_err("Couldn't get size: 0x%lx\n", *status);
|
||||
+ pr_err("Couldn't get size: %s (0x%lx)\n",
|
||||
+ efi_status_to_str(*status), *status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -57,7 +58,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
*status = efi.get_variable(name, guid, NULL, &lsize, db);
|
||||
if (*status != EFI_SUCCESS) {
|
||||
kfree(db);
|
||||
- pr_err("Error reading db var: 0x%lx\n", *status);
|
||||
+ pr_err("Error reading db var: %s (0x%lx)\n",
|
||||
+ efi_status_to_str(*status), *status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
240
0001-PCI-Add-MCFG-quirks-for-Tegra194-host-controllers.patch
Normal file
240
0001-PCI-Add-MCFG-quirks-for-Tegra194-host-controllers.patch
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
From 9134295c0515492b1ab7733c0290b2afde336d6b Mon Sep 17 00:00:00 2001
|
||||
From: Vidya Sagar <vidyas@nvidia.com>
|
||||
Date: Sat, 11 Jan 2020 00:45:00 +0530
|
||||
Subject: [PATCH] PCI: Add MCFG quirks for Tegra194 host controllers
|
||||
|
||||
The PCIe controller in Tegra194 SoC is not completely ECAM-compliant.
|
||||
With the current hardware design limitations in place, ECAM can be enabled
|
||||
only for one controller (C5 controller to be precise) with bus numbers
|
||||
starting from 160 instead of 0. A different approach is taken to avoid this
|
||||
abnormal way of enabling ECAM for just one controller but to enable
|
||||
configuration space access for all the other controllers. In this approach,
|
||||
ops are added through MCFG quirk mechanism which access the configuration
|
||||
spaces by dynamically programming iATU (internal AddressTranslation Unit)
|
||||
to generate respective configuration accesses just like the way it is
|
||||
done in DesignWare core sub-system.
|
||||
|
||||
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
|
||||
Acked-by: Thierry Reding <treding@nvidia.com>
|
||||
[ Updated by jonathanh@nvidia.com only permit building the Tegra194
|
||||
PCIe driver into the kernel and not as a module ]
|
||||
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
|
||||
---
|
||||
drivers/acpi/pci_mcfg.c | 7 ++
|
||||
drivers/pci/controller/dwc/Kconfig | 10 +-
|
||||
drivers/pci/controller/dwc/Makefile | 2 +-
|
||||
drivers/pci/controller/dwc/pcie-tegra194.c | 102 +++++++++++++++++++++
|
||||
include/linux/pci-ecam.h | 1 +
|
||||
5 files changed, 117 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c
|
||||
index 54b36b7ad47d9..6573d495d9c1f 100644
|
||||
--- a/drivers/acpi/pci_mcfg.c
|
||||
+++ b/drivers/acpi/pci_mcfg.c
|
||||
@@ -116,6 +116,13 @@ static struct mcfg_fixup mcfg_quirks[] = {
|
||||
THUNDER_ECAM_QUIRK(2, 12),
|
||||
THUNDER_ECAM_QUIRK(2, 13),
|
||||
|
||||
+ { "NVIDIA", "TEGRA194", 1, 0, MCFG_BUS_ANY, &tegra194_pcie_ops},
|
||||
+ { "NVIDIA", "TEGRA194", 1, 1, MCFG_BUS_ANY, &tegra194_pcie_ops},
|
||||
+ { "NVIDIA", "TEGRA194", 1, 2, MCFG_BUS_ANY, &tegra194_pcie_ops},
|
||||
+ { "NVIDIA", "TEGRA194", 1, 3, MCFG_BUS_ANY, &tegra194_pcie_ops},
|
||||
+ { "NVIDIA", "TEGRA194", 1, 4, MCFG_BUS_ANY, &tegra194_pcie_ops},
|
||||
+ { "NVIDIA", "TEGRA194", 1, 5, MCFG_BUS_ANY, &tegra194_pcie_ops},
|
||||
+
|
||||
#define XGENE_V1_ECAM_MCFG(rev, seg) \
|
||||
{"APM ", "XGENE ", rev, seg, MCFG_BUS_ANY, \
|
||||
&xgene_v1_pcie_ecam_ops }
|
||||
diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
|
||||
index 044a3761c44f2..e4ee4bf9ac64a 100644
|
||||
--- a/drivers/pci/controller/dwc/Kconfig
|
||||
+++ b/drivers/pci/controller/dwc/Kconfig
|
||||
@@ -247,25 +247,27 @@ config PCI_MESON
|
||||
implement the driver.
|
||||
|
||||
config PCIE_TEGRA194
|
||||
- tristate
|
||||
+ bool
|
||||
|
||||
config PCIE_TEGRA194_HOST
|
||||
- tristate "NVIDIA Tegra194 (and later) PCIe controller - Host Mode"
|
||||
+ bool "NVIDIA Tegra194 (and later) PCIe controller - Host Mode"
|
||||
depends on ARCH_TEGRA_194_SOC || COMPILE_TEST
|
||||
depends on PCI_MSI_IRQ_DOMAIN
|
||||
select PCIE_DW_HOST
|
||||
select PHY_TEGRA194_P2U
|
||||
select PCIE_TEGRA194
|
||||
+ default y if ARCH_TEGRA_194_SOC
|
||||
help
|
||||
Enables support for the PCIe controller in the NVIDIA Tegra194 SoC to
|
||||
work in host mode. There are two instances of PCIe controllers in
|
||||
Tegra194. This controller can work either as EP or RC. In order to
|
||||
enable host-specific features PCIE_TEGRA194_HOST must be selected and
|
||||
in order to enable device-specific features PCIE_TEGRA194_EP must be
|
||||
- selected. This uses the DesignWare core.
|
||||
+ selected. This uses the DesignWare core. ACPI platforms with Tegra194
|
||||
+ don't need to enable this.
|
||||
|
||||
config PCIE_TEGRA194_EP
|
||||
- tristate "NVIDIA Tegra194 (and later) PCIe controller - Endpoint Mode"
|
||||
+ bool "NVIDIA Tegra194 (and later) PCIe controller - Endpoint Mode"
|
||||
depends on ARCH_TEGRA_194_SOC || COMPILE_TEST
|
||||
depends on PCI_ENDPOINT
|
||||
select PCIE_DW_EP
|
||||
diff --git a/drivers/pci/controller/dwc/Makefile b/drivers/pci/controller/dwc/Makefile
|
||||
index a751553fa0dbd..dbb9818765566 100644
|
||||
--- a/drivers/pci/controller/dwc/Makefile
|
||||
+++ b/drivers/pci/controller/dwc/Makefile
|
||||
@@ -17,7 +17,6 @@ obj-$(CONFIG_PCIE_INTEL_GW) += pcie-intel-gw.o
|
||||
obj-$(CONFIG_PCIE_KIRIN) += pcie-kirin.o
|
||||
obj-$(CONFIG_PCIE_HISI_STB) += pcie-histb.o
|
||||
obj-$(CONFIG_PCI_MESON) += pci-meson.o
|
||||
-obj-$(CONFIG_PCIE_TEGRA194) += pcie-tegra194.o
|
||||
obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o
|
||||
obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o
|
||||
|
||||
@@ -34,4 +33,5 @@ obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o
|
||||
ifdef CONFIG_PCI
|
||||
obj-$(CONFIG_ARM64) += pcie-al.o
|
||||
obj-$(CONFIG_ARM64) += pcie-hisi.o
|
||||
+obj-$(CONFIG_ARM64) += pcie-tegra194.o
|
||||
endif
|
||||
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
|
||||
index 92b77f7d83546..7b3d581795197 100644
|
||||
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
|
||||
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
|
||||
@@ -22,6 +22,8 @@
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_pci.h>
|
||||
#include <linux/pci.h>
|
||||
+#include <linux/pci-acpi.h>
|
||||
+#include <linux/pci-ecam.h>
|
||||
#include <linux/phy/phy.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/platform_device.h>
|
||||
@@ -324,6 +326,103 @@ struct tegra_pcie_dw_of_data {
|
||||
enum dw_pcie_device_mode mode;
|
||||
};
|
||||
|
||||
+#if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
|
||||
+struct tegra194_pcie_acpi {
|
||||
+ void __iomem *config_base;
|
||||
+ void __iomem *iatu_base;
|
||||
+ void __iomem *dbi_base;
|
||||
+};
|
||||
+
|
||||
+static int tegra194_acpi_init(struct pci_config_window *cfg)
|
||||
+{
|
||||
+ struct device *dev = cfg->parent;
|
||||
+ struct tegra194_pcie_acpi *pcie;
|
||||
+
|
||||
+ pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
+ if (!pcie)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ pcie->config_base = cfg->win;
|
||||
+ pcie->iatu_base = cfg->win + SZ_256K;
|
||||
+ pcie->dbi_base = cfg->win + SZ_512K;
|
||||
+ cfg->priv = pcie;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void atu_reg_write(struct tegra194_pcie_acpi *pcie, int index,
|
||||
+ u32 val, u32 reg)
|
||||
+{
|
||||
+ u32 offset = PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index);
|
||||
+
|
||||
+ writel(val, pcie->iatu_base + offset + reg);
|
||||
+}
|
||||
+
|
||||
+static void program_outbound_atu(struct tegra194_pcie_acpi *pcie, int index,
|
||||
+ int type, u64 cpu_addr, u64 pci_addr, u64 size)
|
||||
+{
|
||||
+ atu_reg_write(pcie, index, lower_32_bits(cpu_addr),
|
||||
+ PCIE_ATU_LOWER_BASE);
|
||||
+ atu_reg_write(pcie, index, upper_32_bits(cpu_addr),
|
||||
+ PCIE_ATU_UPPER_BASE);
|
||||
+ atu_reg_write(pcie, index, lower_32_bits(pci_addr),
|
||||
+ PCIE_ATU_LOWER_TARGET);
|
||||
+ atu_reg_write(pcie, index, lower_32_bits(cpu_addr + size - 1),
|
||||
+ PCIE_ATU_LIMIT);
|
||||
+ atu_reg_write(pcie, index, upper_32_bits(pci_addr),
|
||||
+ PCIE_ATU_UPPER_TARGET);
|
||||
+ atu_reg_write(pcie, index, type, PCIE_ATU_CR1);
|
||||
+ atu_reg_write(pcie, index, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
|
||||
+}
|
||||
+
|
||||
+static void __iomem *tegra194_map_bus(struct pci_bus *bus,
|
||||
+ unsigned int devfn, int where)
|
||||
+{
|
||||
+ struct pci_config_window *cfg = bus->sysdata;
|
||||
+ struct tegra194_pcie_acpi *pcie = cfg->priv;
|
||||
+ u32 busdev;
|
||||
+ int type;
|
||||
+
|
||||
+ if (bus->number < cfg->busr.start || bus->number > cfg->busr.end)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (bus->number == cfg->busr.start) {
|
||||
+ if (PCI_SLOT(devfn) == 0)
|
||||
+ return pcie->dbi_base + where;
|
||||
+ else
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
|
||||
+ PCIE_ATU_FUNC(PCI_FUNC(devfn));
|
||||
+
|
||||
+ if (bus->parent->number == cfg->busr.start) {
|
||||
+ if (PCI_SLOT(devfn) == 0)
|
||||
+ type = PCIE_ATU_TYPE_CFG0;
|
||||
+ else
|
||||
+ return NULL;
|
||||
+ } else {
|
||||
+ type = PCIE_ATU_TYPE_CFG1;
|
||||
+ }
|
||||
+
|
||||
+ program_outbound_atu(pcie, PCIE_ATU_REGION_INDEX0, type,
|
||||
+ cfg->res.start, busdev, SZ_256K);
|
||||
+ return (void __iomem *)(pcie->config_base + where);
|
||||
+}
|
||||
+
|
||||
+const struct pci_ecam_ops tegra194_pcie_ops = {
|
||||
+ .bus_shift = 20,
|
||||
+ .init = tegra194_acpi_init,
|
||||
+ .pci_ops = {
|
||||
+ .map_bus = tegra194_map_bus,
|
||||
+ .read = pci_generic_config_read,
|
||||
+ .write = pci_generic_config_write,
|
||||
+ }
|
||||
+};
|
||||
+#endif /* defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS) */
|
||||
+
|
||||
+#ifdef CONFIG_PCIE_TEGRA194
|
||||
+
|
||||
static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci)
|
||||
{
|
||||
return container_of(pci, struct tegra_pcie_dw, pci);
|
||||
@@ -2405,3 +2504,6 @@ MODULE_DEVICE_TABLE(of, tegra_pcie_dw_of_match);
|
||||
MODULE_AUTHOR("Vidya Sagar <vidyas@nvidia.com>");
|
||||
MODULE_DESCRIPTION("NVIDIA PCIe host controller driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
+
|
||||
+#endif /* CONFIG_PCIE_TEGRA194 */
|
||||
+
|
||||
diff --git a/include/linux/pci-ecam.h b/include/linux/pci-ecam.h
|
||||
index 1af5cb02ef7f9..3fb16ada505a0 100644
|
||||
--- a/include/linux/pci-ecam.h
|
||||
+++ b/include/linux/pci-ecam.h
|
||||
@@ -57,6 +57,7 @@ extern const struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */
|
||||
extern const struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
|
||||
extern const struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
|
||||
extern const struct pci_ecam_ops al_pcie_ops; /* Amazon Annapurna Labs PCIe */
|
||||
+extern const struct pci_ecam_ops tegra194_pcie_ops; /* Tegra194 PCIe */
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PCI_HOST_COMMON)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Sun, 12 Jul 2020 13:42:14 +0100
|
||||
Subject: [PATCH] Revert "arm64: allwinner: dts: a64: add LCD-related device
|
||||
nodes for PinePhone"
|
||||
|
||||
This reverts commit 6b9deda8c30064a254bc66e3f6763281c96db7db.
|
||||
---
|
||||
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 -------------------
|
||||
1 file changed, 37 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
index 96d9150423e0..cefda145c3c9 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
@@ -16,15 +16,6 @@ aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
- backlight: backlight {
|
||||
- compatible = "pwm-backlight";
|
||||
- pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
|
||||
- brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>;
|
||||
- default-brightness-level = <15>;
|
||||
- enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
|
||||
- power-supply = <®_ldo_io0>;
|
||||
- };
|
||||
-
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
@@ -93,30 +84,6 @@ &dai {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
-&de {
|
||||
- status = "okay";
|
||||
-};
|
||||
-
|
||||
-&dphy {
|
||||
- status = "okay";
|
||||
-};
|
||||
-
|
||||
-&dsi {
|
||||
- vcc-dsi-supply = <®_dldo1>;
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- status = "okay";
|
||||
-
|
||||
- panel@0 {
|
||||
- compatible = "xingbangda,xbd599";
|
||||
- reg = <0>;
|
||||
- reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
|
||||
- iovcc-supply = <®_dldo2>;
|
||||
- vcc-supply = <®_ldo_io0>;
|
||||
- backlight = <&backlight>;
|
||||
- };
|
||||
-};
|
||||
-
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -221,10 +188,6 @@ &r_pio {
|
||||
*/
|
||||
};
|
||||
|
||||
-&r_pwm {
|
||||
- status = "okay";
|
||||
-};
|
||||
-
|
||||
&r_rsb {
|
||||
status = "okay";
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
418
0001-Revert-drm-panel-add-Xingbangda-XBD599-panel.patch
Normal file
418
0001-Revert-drm-panel-add-Xingbangda-XBD599-panel.patch
Normal file
|
|
@ -0,0 +1,418 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Sun, 12 Jul 2020 13:41:56 +0100
|
||||
Subject: [PATCH] Revert "drm: panel: add Xingbangda XBD599 panel"
|
||||
|
||||
This reverts commit 5d53795bb19e39f048ac8028ec36ff04765e1237.
|
||||
---
|
||||
drivers/gpu/drm/panel/Kconfig | 9 -
|
||||
drivers/gpu/drm/panel/Makefile | 1 -
|
||||
.../gpu/drm/panel/panel-xingbangda-xbd599.c | 366 ------------------
|
||||
3 files changed, 376 deletions(-)
|
||||
delete mode 100644 drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
|
||||
index 1f55a87bb657..39055c1f0e2f 100644
|
||||
--- a/drivers/gpu/drm/panel/Kconfig
|
||||
+++ b/drivers/gpu/drm/panel/Kconfig
|
||||
@@ -462,15 +462,6 @@ config DRM_PANEL_VISIONOX_RM69299
|
||||
Say Y here if you want to enable support for Visionox
|
||||
RM69299 DSI Video Mode panel.
|
||||
|
||||
-config DRM_PANEL_XINGBANGDA_XBD599
|
||||
- tristate "Xingbangda XBD599 panel"
|
||||
- depends on OF
|
||||
- depends on DRM_MIPI_DSI
|
||||
- depends on BACKLIGHT_CLASS_DEVICE
|
||||
- help
|
||||
- Say Y here if you want to enable support for the Xingbangda XBD599
|
||||
- MIPI DSI Video Mode panel.
|
||||
-
|
||||
config DRM_PANEL_XINPENG_XPP055C272
|
||||
tristate "Xinpeng XPP055C272 panel driver"
|
||||
depends on OF
|
||||
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
|
||||
index 7b6b0c0397d6..de74f282c433 100644
|
||||
--- a/drivers/gpu/drm/panel/Makefile
|
||||
+++ b/drivers/gpu/drm/panel/Makefile
|
||||
@@ -49,5 +49,4 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
|
||||
obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
|
||||
obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
|
||||
obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
|
||||
-obj-$(CONFIG_DRM_PANEL_XINGBANGDA_XBD599) += panel-xingbangda-xbd599.o
|
||||
obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
|
||||
diff --git a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
|
||||
deleted file mode 100644
|
||||
index b483f96ee1db..000000000000
|
||||
--- a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
|
||||
+++ /dev/null
|
||||
@@ -1,366 +0,0 @@
|
||||
-// SPDX-License-Identifier: GPL-2.0
|
||||
-/*
|
||||
- * Xingbangda XBD599 MIPI-DSI panel driver
|
||||
- *
|
||||
- * Copyright (C) 2019-2020 Icenowy Zheng <icenowy@aosc.io>
|
||||
- *
|
||||
- * Based on panel-rocktech-jh057n00900.c, which is:
|
||||
- * Copyright (C) Purism SPC 2019
|
||||
- */
|
||||
-
|
||||
-#include <linux/delay.h>
|
||||
-#include <linux/gpio/consumer.h>
|
||||
-#include <linux/mod_devicetable.h>
|
||||
-#include <linux/module.h>
|
||||
-#include <linux/of_device.h>
|
||||
-#include <linux/regulator/consumer.h>
|
||||
-
|
||||
-#include <drm/drm_mipi_dsi.h>
|
||||
-#include <drm/drm_modes.h>
|
||||
-#include <drm/drm_panel.h>
|
||||
-#include <drm/drm_print.h>
|
||||
-
|
||||
-/* Manufacturer specific Commands send via DSI */
|
||||
-#define ST7703_CMD_ALL_PIXEL_OFF 0x22
|
||||
-#define ST7703_CMD_ALL_PIXEL_ON 0x23
|
||||
-#define ST7703_CMD_SETDISP 0xB2
|
||||
-#define ST7703_CMD_SETRGBIF 0xB3
|
||||
-#define ST7703_CMD_SETCYC 0xB4
|
||||
-#define ST7703_CMD_SETBGP 0xB5
|
||||
-#define ST7703_CMD_SETVCOM 0xB6
|
||||
-#define ST7703_CMD_SETOTP 0xB7
|
||||
-#define ST7703_CMD_SETPOWER_EXT 0xB8
|
||||
-#define ST7703_CMD_SETEXTC 0xB9
|
||||
-#define ST7703_CMD_SETMIPI 0xBA
|
||||
-#define ST7703_CMD_SETVDC 0xBC
|
||||
-#define ST7703_CMD_SETSCR 0xC0
|
||||
-#define ST7703_CMD_SETPOWER 0xC1
|
||||
-#define ST7703_CMD_UNK_C6 0xC6
|
||||
-#define ST7703_CMD_SETPANEL 0xCC
|
||||
-#define ST7703_CMD_SETGAMMA 0xE0
|
||||
-#define ST7703_CMD_SETEQ 0xE3
|
||||
-#define ST7703_CMD_SETGIP1 0xE9
|
||||
-#define ST7703_CMD_SETGIP2 0xEA
|
||||
-
|
||||
-static const char * const regulator_names[] = {
|
||||
- "iovcc",
|
||||
- "vcc",
|
||||
-};
|
||||
-
|
||||
-struct xbd599 {
|
||||
- struct device *dev;
|
||||
- struct drm_panel panel;
|
||||
- struct gpio_desc *reset_gpio;
|
||||
- struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)];
|
||||
- bool prepared;
|
||||
-};
|
||||
-
|
||||
-static inline struct xbd599 *panel_to_xbd599(struct drm_panel *panel)
|
||||
-{
|
||||
- return container_of(panel, struct xbd599, panel);
|
||||
-}
|
||||
-
|
||||
-#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \
|
||||
- static const u8 d[] = { seq }; \
|
||||
- int ret; \
|
||||
- ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
|
||||
- if (ret < 0) \
|
||||
- return ret; \
|
||||
- } while (0)
|
||||
-
|
||||
-static int xbd599_init_sequence(struct xbd599 *ctx)
|
||||
-{
|
||||
- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
- struct device *dev = ctx->dev;
|
||||
- int ret;
|
||||
-
|
||||
- /*
|
||||
- * Init sequence was supplied by the panel vendor.
|
||||
- */
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC,
|
||||
- 0xF1, 0x12, 0x83);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI,
|
||||
- 0x33, 0x81, 0x05, 0xF9, 0x0E, 0x0E, 0x20, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25,
|
||||
- 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02, 0x4F, 0x11,
|
||||
- 0x00, 0x00, 0x37);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT,
|
||||
- 0x25, 0x22, 0x20, 0x03);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF,
|
||||
- 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00,
|
||||
- 0x00, 0x00);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR,
|
||||
- 0x73, 0x73, 0x50, 0x50, 0x00, 0xC0, 0x08, 0x70,
|
||||
- 0x00);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0xF0);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ,
|
||||
- 0x00, 0x00, 0x0B, 0x0B, 0x10, 0x10, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10);
|
||||
- dsi_dcs_write_seq(dsi, 0xC6, 0x01, 0x00, 0xFF, 0xFF, 0x00);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
|
||||
- 0x74, 0x00, 0x32, 0x32, 0x77, 0xF1, 0xFF, 0xFF,
|
||||
- 0xCC, 0xCC, 0x77, 0x77);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x07, 0x07);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x2C, 0x2C);
|
||||
- dsi_dcs_write_seq(dsi, 0xBF, 0x02, 0x11, 0x00);
|
||||
-
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1,
|
||||
- 0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12,
|
||||
- 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
|
||||
- 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
|
||||
- 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88,
|
||||
- 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64,
|
||||
- 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
- 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2,
|
||||
- 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
|
||||
- 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
|
||||
- 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
- 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0A,
|
||||
- 0xA5, 0x00, 0x00, 0x00, 0x00);
|
||||
- dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA,
|
||||
- 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35,
|
||||
- 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12,
|
||||
- 0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41,
|
||||
- 0x35, 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12,
|
||||
- 0x12, 0x18);
|
||||
- msleep(20);
|
||||
-
|
||||
- ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(dev, "Failed to exit sleep mode\n");
|
||||
- return ret;
|
||||
- }
|
||||
- msleep(250);
|
||||
-
|
||||
- ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
- msleep(50);
|
||||
-
|
||||
- DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n");
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int xbd599_prepare(struct drm_panel *panel)
|
||||
-{
|
||||
- struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
- int ret;
|
||||
-
|
||||
- if (ctx->prepared)
|
||||
- return 0;
|
||||
-
|
||||
- ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
|
||||
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
- usleep_range(20, 40);
|
||||
- gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
- msleep(20);
|
||||
-
|
||||
- ctx->prepared = true;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int xbd599_enable(struct drm_panel *panel)
|
||||
-{
|
||||
- struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
- int ret;
|
||||
-
|
||||
- ret = xbd599_init_sequence(ctx);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
|
||||
- ret);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int xbd599_disable(struct drm_panel *panel)
|
||||
-{
|
||||
- struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
-
|
||||
- return mipi_dsi_dcs_set_display_off(dsi);
|
||||
-}
|
||||
-
|
||||
-static int xbd599_unprepare(struct drm_panel *panel)
|
||||
-{
|
||||
- struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
-
|
||||
- if (!ctx->prepared)
|
||||
- return 0;
|
||||
-
|
||||
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
- regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
|
||||
- ctx->prepared = false;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static const struct drm_display_mode xbd599_default_mode = {
|
||||
- .hdisplay = 720,
|
||||
- .hsync_start = 720 + 40,
|
||||
- .hsync_end = 720 + 40 + 40,
|
||||
- .htotal = 720 + 40 + 40 + 40,
|
||||
- .vdisplay = 1440,
|
||||
- .vsync_start = 1440 + 18,
|
||||
- .vsync_end = 1440 + 18 + 10,
|
||||
- .vtotal = 1440 + 18 + 10 + 17,
|
||||
- .vrefresh = 60,
|
||||
- .clock = 69000,
|
||||
- .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
-
|
||||
- .width_mm = 68,
|
||||
- .height_mm = 136,
|
||||
- .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
|
||||
-};
|
||||
-
|
||||
-static int xbd599_get_modes(struct drm_panel *panel,
|
||||
- struct drm_connector *connector)
|
||||
-{
|
||||
- struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
- struct drm_display_mode *mode;
|
||||
-
|
||||
- mode = drm_mode_duplicate(connector->dev, &xbd599_default_mode);
|
||||
- if (!mode) {
|
||||
- DRM_DEV_ERROR(ctx->dev, "Failed to add mode\n");
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- drm_mode_set_name(mode);
|
||||
-
|
||||
- mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
|
||||
- connector->display_info.width_mm = mode->width_mm;
|
||||
- connector->display_info.height_mm = mode->height_mm;
|
||||
- drm_mode_probed_add(connector, mode);
|
||||
-
|
||||
- return 1;
|
||||
-}
|
||||
-
|
||||
-static const struct drm_panel_funcs xbd599_drm_funcs = {
|
||||
- .prepare = xbd599_prepare,
|
||||
- .enable = xbd599_enable,
|
||||
- .disable = xbd599_disable,
|
||||
- .unprepare = xbd599_unprepare,
|
||||
- .get_modes = xbd599_get_modes,
|
||||
-};
|
||||
-
|
||||
-static int xbd599_probe(struct mipi_dsi_device *dsi)
|
||||
-{
|
||||
- struct device *dev = &dsi->dev;
|
||||
- struct xbd599 *ctx;
|
||||
- int i, ret;
|
||||
-
|
||||
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
- if (!ctx)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++)
|
||||
- ctx->supplies[i].supply = regulator_names[i];
|
||||
-
|
||||
- ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
|
||||
- ctx->supplies);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(&dsi->dev, "cannot get regulators\n");
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
|
||||
- if (IS_ERR(ctx->reset_gpio)) {
|
||||
- DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
|
||||
- return PTR_ERR(ctx->reset_gpio);
|
||||
- }
|
||||
-
|
||||
- mipi_dsi_set_drvdata(dsi, ctx);
|
||||
-
|
||||
- ctx->dev = dev;
|
||||
-
|
||||
- dsi->lanes = 4;
|
||||
- dsi->format = MIPI_DSI_FMT_RGB888;
|
||||
- dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
|
||||
-
|
||||
- drm_panel_init(&ctx->panel, &dsi->dev, &xbd599_drm_funcs,
|
||||
- DRM_MODE_CONNECTOR_DSI);
|
||||
-
|
||||
- ret = drm_panel_of_backlight(&ctx->panel);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- drm_panel_add(&ctx->panel);
|
||||
-
|
||||
- ret = mipi_dsi_attach(dsi);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(dev, "mipi_dsi_attach failed. Is host ready?\n");
|
||||
- drm_panel_remove(&ctx->panel);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
|
||||
- xbd599_default_mode.hdisplay,
|
||||
- xbd599_default_mode.vdisplay,
|
||||
- xbd599_default_mode.vrefresh,
|
||||
- mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static void xbd599_shutdown(struct mipi_dsi_device *dsi)
|
||||
-{
|
||||
- struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
- int ret;
|
||||
-
|
||||
- ret = drm_panel_unprepare(&ctx->panel);
|
||||
- if (ret < 0)
|
||||
- DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n",
|
||||
- ret);
|
||||
-}
|
||||
-
|
||||
-static int xbd599_remove(struct mipi_dsi_device *dsi)
|
||||
-{
|
||||
- struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
- int ret;
|
||||
-
|
||||
- xbd599_shutdown(dsi);
|
||||
-
|
||||
- ret = mipi_dsi_detach(dsi);
|
||||
- if (ret < 0)
|
||||
- DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n",
|
||||
- ret);
|
||||
-
|
||||
- drm_panel_remove(&ctx->panel);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static const struct of_device_id xbd599_of_match[] = {
|
||||
- { .compatible = "xingbangda,xbd599", },
|
||||
- { /* sentinel */ }
|
||||
-};
|
||||
-MODULE_DEVICE_TABLE(of, xbd599_of_match);
|
||||
-
|
||||
-static struct mipi_dsi_driver xbd599_driver = {
|
||||
- .probe = xbd599_probe,
|
||||
- .remove = xbd599_remove,
|
||||
- .shutdown = xbd599_shutdown,
|
||||
- .driver = {
|
||||
- .name = "panel-xingbangda-xbd599",
|
||||
- .of_match_table = xbd599_of_match,
|
||||
- },
|
||||
-};
|
||||
-module_mipi_dsi_driver(xbd599_driver);
|
||||
-
|
||||
-MODULE_AUTHOR("Icenowy Zheng <icenowy@aosc.io>");
|
||||
-MODULE_DESCRIPTION("DRM driver for Xingbangda XBD599 MIPI DSI panel");
|
||||
-MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Sun, 12 Jul 2020 13:42:04 +0100
|
||||
Subject: [PATCH] Revert "drm/sun4i: sun6i_mipi_dsi: fix horizontal timing
|
||||
calculation"
|
||||
|
||||
This reverts commit d20a2ac9c6ecf514e115f06b6744b584bbc7c1b8.
|
||||
---
|
||||
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
||||
index 52e009dc632b..aa67cb037e9d 100644
|
||||
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
||||
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
||||
@@ -556,7 +556,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HSA_PACKET_OVERHEAD 10
|
||||
hsa = max((unsigned int)HSA_PACKET_OVERHEAD,
|
||||
- (mode->hsync_end - mode->hsync_start) * Bpp) - HSA_PACKET_OVERHEAD;
|
||||
+ (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD);
|
||||
|
||||
/*
|
||||
* The backporch is set using a blanking packet (4
|
||||
@@ -565,7 +565,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HBP_PACKET_OVERHEAD 6
|
||||
hbp = max((unsigned int)HBP_PACKET_OVERHEAD,
|
||||
- (mode->htotal - mode->hsync_end) * Bpp) - HBP_PACKET_OVERHEAD;
|
||||
+ (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD);
|
||||
|
||||
/*
|
||||
* The frontporch is set using a sync event (4 bytes)
|
||||
@@ -575,7 +575,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HFP_PACKET_OVERHEAD 16
|
||||
hfp = max((unsigned int)HFP_PACKET_OVERHEAD,
|
||||
- (mode->hsync_start - mode->hdisplay) * Bpp) - HFP_PACKET_OVERHEAD;
|
||||
+ (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD);
|
||||
|
||||
/*
|
||||
* The blanking is set using a sync event (4 bytes)
|
||||
@@ -584,8 +584,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HBLK_PACKET_OVERHEAD 10
|
||||
hblk = max((unsigned int)HBLK_PACKET_OVERHEAD,
|
||||
- (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp) -
|
||||
- HBLK_PACKET_OVERHEAD;
|
||||
+ (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp -
|
||||
+ HBLK_PACKET_OVERHEAD);
|
||||
|
||||
/*
|
||||
* And I'm not entirely sure what vblk is about. The driver in
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Sun, 12 Jul 2020 13:41:49 +0100
|
||||
Subject: [PATCH] Revert "dt-bindings: panel: add binding for Xingbangda XBD599
|
||||
panel"
|
||||
|
||||
This reverts commit 8a717270db2000ff734d89e9448b32fbc038c49a.
|
||||
---
|
||||
.../display/panel/xingbangda,xbd599.yaml | 50 -------------------
|
||||
1 file changed, 50 deletions(-)
|
||||
delete mode 100644 Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml b/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
|
||||
deleted file mode 100644
|
||||
index b27bcf11198f..000000000000
|
||||
--- a/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
|
||||
+++ /dev/null
|
||||
@@ -1,50 +0,0 @@
|
||||
-# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
-%YAML 1.2
|
||||
----
|
||||
-$id: http://devicetree.org/schemas/display/panel/xingbangda,xbd599.yaml#
|
||||
-$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
-
|
||||
-title: Xingbangda XBD599 5.99in MIPI-DSI LCD panel
|
||||
-
|
||||
-maintainers:
|
||||
- - Icenowy Zheng <icenowy@aosc.io>
|
||||
-
|
||||
-allOf:
|
||||
- - $ref: panel-common.yaml#
|
||||
-
|
||||
-properties:
|
||||
- compatible:
|
||||
- const: xingbangda,xbd599
|
||||
- reg: true
|
||||
- backlight: true
|
||||
- reset-gpios: true
|
||||
- vcc-supply:
|
||||
- description: regulator that supplies the VCC voltage
|
||||
- iovcc-supply:
|
||||
- description: regulator that supplies the IOVCC voltage
|
||||
-
|
||||
-required:
|
||||
- - compatible
|
||||
- - reg
|
||||
- - backlight
|
||||
- - vcc-supply
|
||||
- - iovcc-supply
|
||||
-
|
||||
-additionalProperties: false
|
||||
-
|
||||
-examples:
|
||||
- - |
|
||||
- dsi {
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
-
|
||||
- panel@0 {
|
||||
- compatible = "xingbangda,xbd599";
|
||||
- reg = <0>;
|
||||
- backlight = <&backlight>;
|
||||
- iovcc-supply = <®_dldo2>;
|
||||
- vcc-supply = <®_ldo_io0>;
|
||||
- };
|
||||
- };
|
||||
-
|
||||
-...
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Richter <rrichter@redhat.com>
|
||||
Date: Thu, 7 Jun 2018 22:59:32 -0400
|
||||
Subject: [PATCH] Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
|
||||
|
||||
Message-id: <1528412373-19128-2-git-send-email-rrichter@redhat.com>
|
||||
Patchwork-id: 220950
|
||||
O-Subject: [RHEL-8.0 BZ 1563590 v2 1/2] PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
|
||||
Bugzilla: 1563590
|
||||
RH-Acked-by: Dean Nelson <dnelson@redhat.com>
|
||||
RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
|
||||
RH-Acked-by: Mark Salter <msalter@redhat.com>
|
||||
|
||||
From: Ashok Kumar Sekar <asekar@redhat.com>
|
||||
|
||||
PCI BAR 5 is not setup correctly for the on-board AHCI
|
||||
controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
|
||||
by using BAR 4's resources which are populated correctly but NOT used
|
||||
by the AHCI controller actually.
|
||||
|
||||
RHEL-only:
|
||||
|
||||
Both patches are in RHEL-7.6 also. Inclusion of the patches into RHEL-8
|
||||
was discussed. Since there are partners with Ax system configurations it
|
||||
was decided to carry them in RHEL8 too. See:
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1563590#c1
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
|
||||
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
|
||||
Signed-off-by: Robert Richter <rrichter@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
drivers/pci/quirks.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|
||||
index 2ea61abd5830..abb314891f5b 100644
|
||||
--- a/drivers/pci/quirks.c
|
||||
+++ b/drivers/pci/quirks.c
|
||||
@@ -4196,6 +4196,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
|
||||
quirk_bridge_cavm_thrx2_pcie_root);
|
||||
|
||||
+/*
|
||||
+ * PCI BAR 5 is not setup correctly for the on-board AHCI controller
|
||||
+ * on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by
|
||||
+ * using BAR 4's resources which are populated correctly and NOT
|
||||
+ * actually used by the AHCI controller.
|
||||
+ */
|
||||
+static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev)
|
||||
+{
|
||||
+ struct resource *r = &dev->resource[4];
|
||||
+
|
||||
+ if (!(r->flags & IORESOURCE_MEM) || (r->start == 0))
|
||||
+ return;
|
||||
+
|
||||
+ /* Set BAR5 resource to BAR4 */
|
||||
+ dev->resource[5] = *r;
|
||||
+
|
||||
+ /* Update BAR5 in pci config space */
|
||||
+ pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start);
|
||||
+
|
||||
+ /* Clear BAR4's resource */
|
||||
+ memset(r, 0, sizeof(*r));
|
||||
+}
|
||||
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars);
|
||||
+
|
||||
/*
|
||||
* Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
|
||||
* class code. Fix it.
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
From 90750a5b1205a7dcc002224738585b861779cdae Mon Sep 17 00:00:00 2001
|
||||
From: "Justin M. Forbes" <jforbes@fedoraproject.org>
|
||||
Date: Thu, 30 Jul 2020 10:26:11 -0500
|
||||
Subject: [PATCH] Work around for gcc bug
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96377
|
||||
|
||||
Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
|
||||
---
|
||||
crypto/aegis128-neon-inner.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/crypto/aegis128-neon-inner.c b/crypto/aegis128-neon-inner.c
|
||||
index 2a660ac1bc3a..fa87ff6a2a71 100644
|
||||
--- a/crypto/aegis128-neon-inner.c
|
||||
+++ b/crypto/aegis128-neon-inner.c
|
||||
@@ -148,8 +148,8 @@ void crypto_aegis128_init_neon(void *state, const void *key, const void *iv)
|
||||
kiv,
|
||||
vld1q_u8(const1),
|
||||
vld1q_u8(const0),
|
||||
- k ^ vld1q_u8(const0),
|
||||
- k ^ vld1q_u8(const1),
|
||||
+ (uint8x16_t) (k ^ vld1q_u8(const0)),
|
||||
+ (uint8x16_t) (k ^ vld1q_u8(const1)),
|
||||
}};
|
||||
int i;
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,7 +1,17 @@
|
|||
From 1e494dc5f3140005ff1f17bc06c0c16d6d50d580 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Salter <msalter@redhat.com>
|
||||
Date: Thu, 19 Apr 2018 23:29:47 -0400
|
||||
Subject: [PATCH] ACPI / scan: Fix regression related to X-Gene UARTs
|
||||
Date: Thu, 10 May 2018 17:38:44 -0400
|
||||
Subject: [PATCH] aarch64: acpi scan: Fix regression related to X-Gene UARTs
|
||||
|
||||
Message-id: <20180510173844.29580-4-msalter@redhat.com>
|
||||
Patchwork-id: 214381
|
||||
O-Subject: [RHEL-8 BZ1519554 3/3] aarch64: acpi scan: Fix regression related to X-Gene UARTs
|
||||
Bugzilla: 1519554
|
||||
RH-Acked-by: Al Stone <astone@redhat.com>
|
||||
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519554
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16144520
|
||||
|
||||
Commit e361d1f85855 ("ACPI / scan: Fix enumeration for special UART
|
||||
devices") caused a regression with some X-Gene based platforms (Mustang
|
||||
|
|
@ -10,30 +20,33 @@ device is also a slave device attached to itself. With the above commit
|
|||
the UART won't be enumerated by ACPI scan (slave serial devices shouldn't
|
||||
be). So check for X-Gene UART device and skip slace device check on it.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Mark Salter <msalter@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
drivers/acpi/scan.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
drivers/acpi/scan.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
|
||||
index e1b6231cfa1c..542dafac4306 100644
|
||||
index 8777faced51a..2e60d792005f 100644
|
||||
--- a/drivers/acpi/scan.c
|
||||
+++ b/drivers/acpi/scan.c
|
||||
@@ -1567,6 +1567,14 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
|
||||
@@ -1572,6 +1572,15 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
|
||||
if (!acpi_match_device_ids(device, i2c_multi_instantiate_ids))
|
||||
return false;
|
||||
|
||||
|
||||
+ /*
|
||||
+ * Firmware on some arm64 X-Gene platforms will make the UART
|
||||
+ * device appear as both a UART and a slave of that UART. Just
|
||||
+ * bail out here for X-Gene UARTs.
|
||||
+ */
|
||||
+ if (!strcmp(acpi_device_hid(device), "APMC0D08"))
|
||||
+ if (IS_ENABLED(CONFIG_ARM64) &&
|
||||
+ !strcmp(acpi_device_hid(device), "APMC0D08"))
|
||||
+ return false;
|
||||
+
|
||||
INIT_LIST_HEAD(&resource_list);
|
||||
acpi_dev_get_resources(device, &resource_list,
|
||||
acpi_check_serial_bus_slave,
|
||||
--
|
||||
2.17.1
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Richter <rrichter@redhat.com>
|
||||
Date: Thu, 7 Jun 2018 22:59:33 -0400
|
||||
Subject: [PATCH] ahci: thunderx2: Fix for errata that affects stop engine
|
||||
|
||||
Message-id: <1528412373-19128-3-git-send-email-rrichter@redhat.com>
|
||||
Patchwork-id: 220952
|
||||
O-Subject: [RHEL-8.0 BZ 1563590 v2 2/2] ahci: thunderx2: Fix for errata that affects stop engine
|
||||
Bugzilla: 1563590
|
||||
RH-Acked-by: Dean Nelson <dnelson@redhat.com>
|
||||
RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
|
||||
RH-Acked-by: Mark Salter <msalter@redhat.com>
|
||||
|
||||
From: Jayachandran C <jnair@caviumnetworks.com>
|
||||
|
||||
Apply workaround for this errata:
|
||||
Synopsis: Resetting PxCMD.ST may hang the SATA device
|
||||
|
||||
Description: An internal ping-pong buffer state is not reset
|
||||
correctly for an PxCMD.ST=0 command for a SATA channel. This
|
||||
may cause the SATA interface to hang when a PxCMD.ST=0 command
|
||||
is received.
|
||||
|
||||
Workaround: A SATA_BIU_CORE_ENABLE.sw_init_bsi must be asserted
|
||||
by the driver whenever the PxCMD.ST needs to be de-asserted. This
|
||||
will reset both the ports. So, it may not always work in a 2
|
||||
channel SATA system.
|
||||
|
||||
Resolution: Fix in B0.
|
||||
|
||||
Add the code to ahci_stop_engine() to do this. It is not easy to
|
||||
stop the other "port" since it is associated with a different AHCI
|
||||
interface. Please note that with this fix, SATA reset does not
|
||||
hang any more, but it can cause failures on the other interface
|
||||
if that is in active use.
|
||||
|
||||
Unfortunately, we have nothing other the the CPU ID to check if the
|
||||
SATA block has this issue.
|
||||
|
||||
RHEL-only:
|
||||
|
||||
Both patches are in RHEL-7.6 also. Inclusion of the patches into RHEL-8
|
||||
was discussed. Since there are partners with Ax system configurations it
|
||||
was decided to carry them in RHEL8 too. See:
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1563590#c1
|
||||
|
||||
[v3 with new delays]
|
||||
Signed-off-by: Jayachandran C <jnair@caviumnetworks.com>
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Robert Richter <rrichter@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
drivers/ata/libahci.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
|
||||
index ea5bf5f4cbed..71c55cae27ac 100644
|
||||
--- a/drivers/ata/libahci.c
|
||||
+++ b/drivers/ata/libahci.c
|
||||
@@ -666,6 +666,24 @@ int ahci_stop_engine(struct ata_port *ap)
|
||||
tmp &= ~PORT_CMD_START;
|
||||
writel(tmp, port_mmio + PORT_CMD);
|
||||
|
||||
+#ifdef CONFIG_ARM64
|
||||
+ /* Rev Ax of Cavium CN99XX needs a hack for port stop */
|
||||
+ if (dev_is_pci(ap->host->dev) &&
|
||||
+ to_pci_dev(ap->host->dev)->vendor == 0x14e4 &&
|
||||
+ to_pci_dev(ap->host->dev)->device == 0x9027 &&
|
||||
+ midr_is_cpu_model_range(read_cpuid_id(),
|
||||
+ MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN),
|
||||
+ MIDR_CPU_VAR_REV(0, 0),
|
||||
+ MIDR_CPU_VAR_REV(0, MIDR_REVISION_MASK))) {
|
||||
+ tmp = readl(hpriv->mmio + 0x8000);
|
||||
+ udelay(100);
|
||||
+ writel(tmp | (1 << 26), hpriv->mmio + 0x8000);
|
||||
+ udelay(100);
|
||||
+ writel(tmp & ~(1 << 26), hpriv->mmio + 0x8000);
|
||||
+ dev_warn(ap->host->dev, "CN99XX SATA reset workaround applied\n");
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
/* wait for engine to stop. This could be as long as 500 msec */
|
||||
tmp = ata_wait_register(ap, port_mmio + PORT_CMD,
|
||||
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Cline <jcline@redhat.com>
|
||||
Date: Tue, 1 Oct 2019 15:51:23 +0000
|
||||
Subject: [PATCH] arm: aarch64: Drop the EXPERT setting from ARM64_FORCE_52BIT
|
||||
|
||||
Message-id: <20191001181256.22935-1-jcline@redhat.com>
|
||||
Patchwork-id: 275498
|
||||
O-Subject: [ARK INTERNAL PATCH] [ARK INTERNAL PATCH] [redhat] Add patch
|
||||
to drop the EXPERT setting from ARM64_FORCE_52BIT
|
||||
Bugzilla:
|
||||
RH-Acked-by: Laura Abbott <labbott@redhat.com>
|
||||
|
||||
We don't turn on EXPERT as there are few settings we actually want to
|
||||
mess with. Remove the dependency for ARM64_FORCE_52BIT as we do want
|
||||
that on in debug builds to help find 52-bit bugs.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
arch/arm64/Kconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
|
||||
index 66dc41fd49f2..2e0700a451e5 100644
|
||||
--- a/arch/arm64/Kconfig
|
||||
+++ b/arch/arm64/Kconfig
|
||||
@@ -861,7 +861,7 @@ endchoice
|
||||
|
||||
config ARM64_FORCE_52BIT
|
||||
bool "Force 52-bit virtual addresses for userspace"
|
||||
- depends on ARM64_VA_BITS_52 && EXPERT
|
||||
+ depends on ARM64_VA_BITS_52
|
||||
help
|
||||
For systems with 52-bit userspace VAs enabled, the kernel will attempt
|
||||
to maintain compatibility with older software by providing 48-bit VAs
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 19908e5fe3e63ed2d39f0a8a9135f35fd428d766 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Masters <jcm@redhat.com>
|
||||
Date: Thu, 18 Jul 2019 15:47:26 -0400
|
||||
Subject: [PATCH] arm: make CONFIG_HIGHPTE optional without CONFIG_EXPERT
|
||||
|
|
@ -11,12 +11,12 @@ Signed-off-by: Jon Masters <jcm@redhat.com>
|
|||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
|
||||
index 2bf1ce39a96d..e792b3e60095 100644
|
||||
index 2ac74904a3ce..f0094424f76a 100644
|
||||
--- a/arch/arm/Kconfig
|
||||
+++ b/arch/arm/Kconfig
|
||||
@@ -1644,9 +1644,9 @@ config HIGHMEM
|
||||
@@ -1549,9 +1549,9 @@ config HIGHMEM
|
||||
If unsure, say n.
|
||||
|
||||
|
||||
config HIGHPTE
|
||||
- bool "Allocate 2nd-level pagetables from highmem" if EXPERT
|
||||
+ bool "Allocate 2nd-level pagetables from highmem"
|
||||
|
|
@ -27,5 +27,5 @@ index 2bf1ce39a96d..e792b3e60095 100644
|
|||
The VM uses one page of physical memory for each page table.
|
||||
For systems with a lot of processes, this can use a lot of
|
||||
--
|
||||
2.17.2
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Mon, 16 Mar 2020 21:35:03 +0800
|
||||
Subject: [PATCH] arm64: allwinner: dts: a64: add LCD-related device nodes for
|
||||
PinePhone
|
||||
|
||||
PinePhone uses PWM backlight and a XBD599 LCD panel over DSI for
|
||||
display.
|
||||
|
||||
Add its device nodes.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 +++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
index cefda145c3c9..96d9150423e0 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
@@ -16,6 +16,15 @@ aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
+ backlight: backlight {
|
||||
+ compatible = "pwm-backlight";
|
||||
+ pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
|
||||
+ brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>;
|
||||
+ default-brightness-level = <15>;
|
||||
+ enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
|
||||
+ power-supply = <®_ldo_io0>;
|
||||
+ };
|
||||
+
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
@@ -84,6 +93,30 @@ &dai {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&dphy {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&dsi {
|
||||
+ vcc-dsi-supply = <®_dldo1>;
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ panel@0 {
|
||||
+ compatible = "xingbangda,xbd599";
|
||||
+ reg = <0>;
|
||||
+ reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
|
||||
+ iovcc-supply = <®_dldo2>;
|
||||
+ vcc-supply = <®_ldo_io0>;
|
||||
+ backlight = <&backlight>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -188,6 +221,10 @@ &r_pio {
|
||||
*/
|
||||
};
|
||||
|
||||
+&r_pwm {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&r_rsb {
|
||||
status = "okay";
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:56:01 +0200
|
||||
Subject: [PATCH] arm64: dts: sun50i-a64-pinephone: Add touchscreen support
|
||||
|
||||
Pinephone has a Goodix GT917S capacitive touchscreen controller on
|
||||
I2C0 bus. Add support for it.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
index 85a7aa5efd32..2d5694446d17 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
@@ -123,6 +123,25 @@ &ehci1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&i2c0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&i2c0_pins>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ touchscreen@5d {
|
||||
+ compatible = "goodix,gt917s", "goodix,gt911";
|
||||
+ reg = <0x5d>;
|
||||
+ interrupt-parent = <&pio>;
|
||||
+ interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
|
||||
+ irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
|
||||
+ reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
|
||||
+ AVDD28-supply = <®_ldo_io0>;
|
||||
+ VDDIO-supply = <®_ldo_io0>;
|
||||
+ touchscreen-size-x = <720>;
|
||||
+ touchscreen-size-y = <1440>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
112
0001-arm64-dts-sun50i-a64-pinephone-Enable-LCD-support-on.patch
Normal file
112
0001-arm64-dts-sun50i-a64-pinephone-Enable-LCD-support-on.patch
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Fri, 26 Jun 2020 02:56:00 +0200
|
||||
Subject: [PATCH] arm64: dts: sun50i-a64-pinephone: Enable LCD support on
|
||||
PinePhone
|
||||
|
||||
PinePhone uses PWM backlight and a XBD599 LCD panel over DSI for
|
||||
display.
|
||||
|
||||
Backlight levels curve was optimized by Martijn Braam using a
|
||||
lux meter.
|
||||
|
||||
Add its device nodes.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
Signed-off-by: Martijn Braam <martijn@brixit.nl>
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
.../allwinner/sun50i-a64-pinephone-1.1.dts | 19 ++++++++++
|
||||
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 35 +++++++++++++++++++
|
||||
2 files changed, 54 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
|
||||
index 06a775c41664..3e99a87e9ce5 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
|
||||
@@ -9,3 +9,22 @@ / {
|
||||
model = "Pine64 PinePhone Braveheart (1.1)";
|
||||
compatible = "pine64,pinephone-1.1", "allwinner,sun50i-a64";
|
||||
};
|
||||
+
|
||||
+&backlight {
|
||||
+ power-supply = <®_ldo_io0>;
|
||||
+ /*
|
||||
+ * PWM backlight circuit on this PinePhone revision was changed since
|
||||
+ * 1.0, and the lowest PWM duty cycle that doesn't lead to backlight
|
||||
+ * being off is around 20%. Duty cycle for the lowest brightness level
|
||||
+ * also varries quite a bit between individual boards, so the lowest
|
||||
+ * value here was chosen as a safe default.
|
||||
+ */
|
||||
+ brightness-levels = <
|
||||
+ 774 793 814 842
|
||||
+ 882 935 1003 1088
|
||||
+ 1192 1316 1462 1633
|
||||
+ 1830 2054 2309 2596
|
||||
+ 2916 3271 3664 4096>;
|
||||
+ num-interpolated-steps = <50>;
|
||||
+ default-brightness-level = <400>;
|
||||
+};
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
index cefda145c3c9..85a7aa5efd32 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
|
||||
@@ -16,6 +16,13 @@ aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
+ backlight: backlight {
|
||||
+ compatible = "pwm-backlight";
|
||||
+ pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
|
||||
+ enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
|
||||
+ /* Backlight configuration differs per PinePhone revision. */
|
||||
+ };
|
||||
+
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
@@ -84,6 +91,30 @@ &dai {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&dphy {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&dsi {
|
||||
+ vcc-dsi-supply = <®_dldo1>;
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ panel@0 {
|
||||
+ compatible = "xingbangda,xbd599";
|
||||
+ reg = <0>;
|
||||
+ reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
|
||||
+ iovcc-supply = <®_dldo2>;
|
||||
+ vcc-supply = <®_ldo_io0>;
|
||||
+ backlight = <&backlight>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -188,6 +219,10 @@ &r_pio {
|
||||
*/
|
||||
};
|
||||
|
||||
+&r_pwm {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&r_rsb {
|
||||
status = "okay";
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
423
0001-drm-panel-add-Xingbangda-XBD599-panel.patch
Normal file
423
0001-drm-panel-add-Xingbangda-XBD599-panel.patch
Normal file
|
|
@ -0,0 +1,423 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Mon, 16 Mar 2020 21:35:01 +0800
|
||||
Subject: [PATCH] drm: panel: add Xingbangda XBD599 panel
|
||||
|
||||
Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI IPS LCD panel made by
|
||||
Xingbangda, which is used on PinePhone final assembled phones.
|
||||
|
||||
Add support for it.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
drivers/gpu/drm/panel/Kconfig | 9 +
|
||||
drivers/gpu/drm/panel/Makefile | 1 +
|
||||
.../gpu/drm/panel/panel-xingbangda-xbd599.c | 366 ++++++++++++++++++
|
||||
3 files changed, 376 insertions(+)
|
||||
create mode 100644 drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
|
||||
index 39055c1f0e2f..1f55a87bb657 100644
|
||||
--- a/drivers/gpu/drm/panel/Kconfig
|
||||
+++ b/drivers/gpu/drm/panel/Kconfig
|
||||
@@ -462,6 +462,15 @@ config DRM_PANEL_VISIONOX_RM69299
|
||||
Say Y here if you want to enable support for Visionox
|
||||
RM69299 DSI Video Mode panel.
|
||||
|
||||
+config DRM_PANEL_XINGBANGDA_XBD599
|
||||
+ tristate "Xingbangda XBD599 panel"
|
||||
+ depends on OF
|
||||
+ depends on DRM_MIPI_DSI
|
||||
+ depends on BACKLIGHT_CLASS_DEVICE
|
||||
+ help
|
||||
+ Say Y here if you want to enable support for the Xingbangda XBD599
|
||||
+ MIPI DSI Video Mode panel.
|
||||
+
|
||||
config DRM_PANEL_XINPENG_XPP055C272
|
||||
tristate "Xinpeng XPP055C272 panel driver"
|
||||
depends on OF
|
||||
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
|
||||
index de74f282c433..7b6b0c0397d6 100644
|
||||
--- a/drivers/gpu/drm/panel/Makefile
|
||||
+++ b/drivers/gpu/drm/panel/Makefile
|
||||
@@ -49,4 +49,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
|
||||
obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
|
||||
obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
|
||||
obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
|
||||
+obj-$(CONFIG_DRM_PANEL_XINGBANGDA_XBD599) += panel-xingbangda-xbd599.o
|
||||
obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
|
||||
diff --git a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
|
||||
new file mode 100644
|
||||
index 000000000000..b483f96ee1db
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c
|
||||
@@ -0,0 +1,366 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Xingbangda XBD599 MIPI-DSI panel driver
|
||||
+ *
|
||||
+ * Copyright (C) 2019-2020 Icenowy Zheng <icenowy@aosc.io>
|
||||
+ *
|
||||
+ * Based on panel-rocktech-jh057n00900.c, which is:
|
||||
+ * Copyright (C) Purism SPC 2019
|
||||
+ */
|
||||
+
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
+#include <linux/mod_devicetable.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+
|
||||
+#include <drm/drm_mipi_dsi.h>
|
||||
+#include <drm/drm_modes.h>
|
||||
+#include <drm/drm_panel.h>
|
||||
+#include <drm/drm_print.h>
|
||||
+
|
||||
+/* Manufacturer specific Commands send via DSI */
|
||||
+#define ST7703_CMD_ALL_PIXEL_OFF 0x22
|
||||
+#define ST7703_CMD_ALL_PIXEL_ON 0x23
|
||||
+#define ST7703_CMD_SETDISP 0xB2
|
||||
+#define ST7703_CMD_SETRGBIF 0xB3
|
||||
+#define ST7703_CMD_SETCYC 0xB4
|
||||
+#define ST7703_CMD_SETBGP 0xB5
|
||||
+#define ST7703_CMD_SETVCOM 0xB6
|
||||
+#define ST7703_CMD_SETOTP 0xB7
|
||||
+#define ST7703_CMD_SETPOWER_EXT 0xB8
|
||||
+#define ST7703_CMD_SETEXTC 0xB9
|
||||
+#define ST7703_CMD_SETMIPI 0xBA
|
||||
+#define ST7703_CMD_SETVDC 0xBC
|
||||
+#define ST7703_CMD_SETSCR 0xC0
|
||||
+#define ST7703_CMD_SETPOWER 0xC1
|
||||
+#define ST7703_CMD_UNK_C6 0xC6
|
||||
+#define ST7703_CMD_SETPANEL 0xCC
|
||||
+#define ST7703_CMD_SETGAMMA 0xE0
|
||||
+#define ST7703_CMD_SETEQ 0xE3
|
||||
+#define ST7703_CMD_SETGIP1 0xE9
|
||||
+#define ST7703_CMD_SETGIP2 0xEA
|
||||
+
|
||||
+static const char * const regulator_names[] = {
|
||||
+ "iovcc",
|
||||
+ "vcc",
|
||||
+};
|
||||
+
|
||||
+struct xbd599 {
|
||||
+ struct device *dev;
|
||||
+ struct drm_panel panel;
|
||||
+ struct gpio_desc *reset_gpio;
|
||||
+ struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)];
|
||||
+ bool prepared;
|
||||
+};
|
||||
+
|
||||
+static inline struct xbd599 *panel_to_xbd599(struct drm_panel *panel)
|
||||
+{
|
||||
+ return container_of(panel, struct xbd599, panel);
|
||||
+}
|
||||
+
|
||||
+#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \
|
||||
+ static const u8 d[] = { seq }; \
|
||||
+ int ret; \
|
||||
+ ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
|
||||
+ if (ret < 0) \
|
||||
+ return ret; \
|
||||
+ } while (0)
|
||||
+
|
||||
+static int xbd599_init_sequence(struct xbd599 *ctx)
|
||||
+{
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+ struct device *dev = ctx->dev;
|
||||
+ int ret;
|
||||
+
|
||||
+ /*
|
||||
+ * Init sequence was supplied by the panel vendor.
|
||||
+ */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC,
|
||||
+ 0xF1, 0x12, 0x83);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI,
|
||||
+ 0x33, 0x81, 0x05, 0xF9, 0x0E, 0x0E, 0x20, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25,
|
||||
+ 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02, 0x4F, 0x11,
|
||||
+ 0x00, 0x00, 0x37);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT,
|
||||
+ 0x25, 0x22, 0x20, 0x03);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF,
|
||||
+ 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00,
|
||||
+ 0x00, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR,
|
||||
+ 0x73, 0x73, 0x50, 0x50, 0x00, 0xC0, 0x08, 0x70,
|
||||
+ 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0xF0);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ,
|
||||
+ 0x00, 0x00, 0x0B, 0x0B, 0x10, 0x10, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10);
|
||||
+ dsi_dcs_write_seq(dsi, 0xC6, 0x01, 0x00, 0xFF, 0xFF, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
|
||||
+ 0x74, 0x00, 0x32, 0x32, 0x77, 0xF1, 0xFF, 0xFF,
|
||||
+ 0xCC, 0xCC, 0x77, 0x77);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x07, 0x07);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x2C, 0x2C);
|
||||
+ dsi_dcs_write_seq(dsi, 0xBF, 0x02, 0x11, 0x00);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1,
|
||||
+ 0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12,
|
||||
+ 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
|
||||
+ 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
|
||||
+ 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64,
|
||||
+ 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2,
|
||||
+ 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
|
||||
+ 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0A,
|
||||
+ 0xA5, 0x00, 0x00, 0x00, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA,
|
||||
+ 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35,
|
||||
+ 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12,
|
||||
+ 0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41,
|
||||
+ 0x35, 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12,
|
||||
+ 0x12, 0x18);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(dev, "Failed to exit sleep mode\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ msleep(250);
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ msleep(50);
|
||||
+
|
||||
+ DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int xbd599_prepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
+ int ret;
|
||||
+
|
||||
+ if (ctx->prepared)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
+ usleep_range(20, 40);
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ctx->prepared = true;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int xbd599_enable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = xbd599_init_sequence(ctx);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int xbd599_disable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+
|
||||
+ return mipi_dsi_dcs_set_display_off(dsi);
|
||||
+}
|
||||
+
|
||||
+static int xbd599_unprepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
+
|
||||
+ if (!ctx->prepared)
|
||||
+ return 0;
|
||||
+
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
+ regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
|
||||
+ ctx->prepared = false;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct drm_display_mode xbd599_default_mode = {
|
||||
+ .hdisplay = 720,
|
||||
+ .hsync_start = 720 + 40,
|
||||
+ .hsync_end = 720 + 40 + 40,
|
||||
+ .htotal = 720 + 40 + 40 + 40,
|
||||
+ .vdisplay = 1440,
|
||||
+ .vsync_start = 1440 + 18,
|
||||
+ .vsync_end = 1440 + 18 + 10,
|
||||
+ .vtotal = 1440 + 18 + 10 + 17,
|
||||
+ .vrefresh = 60,
|
||||
+ .clock = 69000,
|
||||
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
+
|
||||
+ .width_mm = 68,
|
||||
+ .height_mm = 136,
|
||||
+ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
|
||||
+};
|
||||
+
|
||||
+static int xbd599_get_modes(struct drm_panel *panel,
|
||||
+ struct drm_connector *connector)
|
||||
+{
|
||||
+ struct xbd599 *ctx = panel_to_xbd599(panel);
|
||||
+ struct drm_display_mode *mode;
|
||||
+
|
||||
+ mode = drm_mode_duplicate(connector->dev, &xbd599_default_mode);
|
||||
+ if (!mode) {
|
||||
+ DRM_DEV_ERROR(ctx->dev, "Failed to add mode\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ drm_mode_set_name(mode);
|
||||
+
|
||||
+ mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
|
||||
+ connector->display_info.width_mm = mode->width_mm;
|
||||
+ connector->display_info.height_mm = mode->height_mm;
|
||||
+ drm_mode_probed_add(connector, mode);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static const struct drm_panel_funcs xbd599_drm_funcs = {
|
||||
+ .prepare = xbd599_prepare,
|
||||
+ .enable = xbd599_enable,
|
||||
+ .disable = xbd599_disable,
|
||||
+ .unprepare = xbd599_unprepare,
|
||||
+ .get_modes = xbd599_get_modes,
|
||||
+};
|
||||
+
|
||||
+static int xbd599_probe(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct device *dev = &dsi->dev;
|
||||
+ struct xbd599 *ctx;
|
||||
+ int i, ret;
|
||||
+
|
||||
+ ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
+ if (!ctx)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++)
|
||||
+ ctx->supplies[i].supply = regulator_names[i];
|
||||
+
|
||||
+ ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
|
||||
+ ctx->supplies);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(&dsi->dev, "cannot get regulators\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
|
||||
+ if (IS_ERR(ctx->reset_gpio)) {
|
||||
+ DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
|
||||
+ return PTR_ERR(ctx->reset_gpio);
|
||||
+ }
|
||||
+
|
||||
+ mipi_dsi_set_drvdata(dsi, ctx);
|
||||
+
|
||||
+ ctx->dev = dev;
|
||||
+
|
||||
+ dsi->lanes = 4;
|
||||
+ dsi->format = MIPI_DSI_FMT_RGB888;
|
||||
+ dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
|
||||
+
|
||||
+ drm_panel_init(&ctx->panel, &dsi->dev, &xbd599_drm_funcs,
|
||||
+ DRM_MODE_CONNECTOR_DSI);
|
||||
+
|
||||
+ ret = drm_panel_of_backlight(&ctx->panel);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ drm_panel_add(&ctx->panel);
|
||||
+
|
||||
+ ret = mipi_dsi_attach(dsi);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(dev, "mipi_dsi_attach failed. Is host ready?\n");
|
||||
+ drm_panel_remove(&ctx->panel);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
|
||||
+ xbd599_default_mode.hdisplay,
|
||||
+ xbd599_default_mode.vdisplay,
|
||||
+ xbd599_default_mode.vrefresh,
|
||||
+ mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void xbd599_shutdown(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = drm_panel_unprepare(&ctx->panel);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n",
|
||||
+ ret);
|
||||
+}
|
||||
+
|
||||
+static int xbd599_remove(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ int ret;
|
||||
+
|
||||
+ xbd599_shutdown(dsi);
|
||||
+
|
||||
+ ret = mipi_dsi_detach(dsi);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n",
|
||||
+ ret);
|
||||
+
|
||||
+ drm_panel_remove(&ctx->panel);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id xbd599_of_match[] = {
|
||||
+ { .compatible = "xingbangda,xbd599", },
|
||||
+ { /* sentinel */ }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, xbd599_of_match);
|
||||
+
|
||||
+static struct mipi_dsi_driver xbd599_driver = {
|
||||
+ .probe = xbd599_probe,
|
||||
+ .remove = xbd599_remove,
|
||||
+ .shutdown = xbd599_shutdown,
|
||||
+ .driver = {
|
||||
+ .name = "panel-xingbangda-xbd599",
|
||||
+ .of_match_table = xbd599_of_match,
|
||||
+ },
|
||||
+};
|
||||
+module_mipi_dsi_driver(xbd599_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Icenowy Zheng <icenowy@aosc.io>");
|
||||
+MODULE_DESCRIPTION("DRM driver for Xingbangda XBD599 MIPI DSI panel");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.26.2
|
||||
|
||||
948
0001-drm-panel-rocktech-jh057n00900-Rename-the-driver-to-.patch
Normal file
948
0001-drm-panel-rocktech-jh057n00900-Rename-the-driver-to-.patch
Normal file
|
|
@ -0,0 +1,948 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:52 +0200
|
||||
Subject: [PATCH] drm/panel: rocktech-jh057n00900: Rename the driver to st7703
|
||||
|
||||
This rename is done so that the driver matches the name of the
|
||||
display controller and in preparation for adding support for more
|
||||
panels to the driver.
|
||||
|
||||
This is just a basic file rename, with no code changes.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/Kconfig | 26 +-
|
||||
drivers/gpu/drm/panel/Makefile | 2 +-
|
||||
.../drm/panel/panel-rocktech-jh057n00900.c | 424 ------------------
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 424 ++++++++++++++++++
|
||||
4 files changed, 438 insertions(+), 438 deletions(-)
|
||||
delete mode 100644 drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
|
||||
create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
|
||||
index 39055c1f0e2f..de2f2a452be5 100644
|
||||
--- a/drivers/gpu/drm/panel/Kconfig
|
||||
+++ b/drivers/gpu/drm/panel/Kconfig
|
||||
@@ -283,19 +283,6 @@ config DRM_PANEL_RAYDIUM_RM68200
|
||||
Say Y here if you want to enable support for Raydium RM68200
|
||||
720x1280 DSI video mode panel.
|
||||
|
||||
-config DRM_PANEL_ROCKTECH_JH057N00900
|
||||
- tristate "Rocktech JH057N00900 MIPI touchscreen panel"
|
||||
- depends on OF
|
||||
- depends on DRM_MIPI_DSI
|
||||
- depends on BACKLIGHT_CLASS_DEVICE
|
||||
- help
|
||||
- Say Y here if you want to enable support for Rocktech JH057N00900
|
||||
- MIPI DSI panel as e.g. used in the Librem 5 devkit. It has a
|
||||
- resolution of 720x1440 pixels, a built in backlight and touch
|
||||
- controller.
|
||||
- Touch input support is provided by the goodix driver and needs to be
|
||||
- selected separately.
|
||||
-
|
||||
config DRM_PANEL_RONBO_RB070D30
|
||||
tristate "Ronbo Electronics RB070D30 panel"
|
||||
depends on OF
|
||||
@@ -395,6 +382,19 @@ config DRM_PANEL_SITRONIX_ST7701
|
||||
ST7701 controller for 480X864 LCD panels with MIPI/RGB/SPI
|
||||
system interfaces.
|
||||
|
||||
+config DRM_PANEL_SITRONIX_ST7703
|
||||
+ tristate "Sitronix ST7703 based MIPI touchscreen panels"
|
||||
+ depends on OF
|
||||
+ depends on DRM_MIPI_DSI
|
||||
+ depends on BACKLIGHT_CLASS_DEVICE
|
||||
+ help
|
||||
+ Say Y here if you want to enable support for Sitronix ST7703 based
|
||||
+ panels, souch as Rocktech JH057N00900 MIPI DSI panel as e.g. used in
|
||||
+ the Librem 5 devkit. It has a resolution of 720x1440 pixels, a built
|
||||
+ in backlight and touch controller.
|
||||
+ Touch input support is provided by the goodix driver and needs to be
|
||||
+ selected separately.
|
||||
+
|
||||
config DRM_PANEL_SITRONIX_ST7789V
|
||||
tristate "Sitronix ST7789V panel"
|
||||
depends on OF && SPI
|
||||
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
|
||||
index de74f282c433..e45ceac6286f 100644
|
||||
--- a/drivers/gpu/drm/panel/Makefile
|
||||
+++ b/drivers/gpu/drm/panel/Makefile
|
||||
@@ -27,7 +27,6 @@ obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o
|
||||
obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o
|
||||
obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o
|
||||
obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o
|
||||
-obj-$(CONFIG_DRM_PANEL_ROCKTECH_JH057N00900) += panel-rocktech-jh057n00900.o
|
||||
obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o
|
||||
obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
|
||||
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o
|
||||
@@ -41,6 +40,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
|
||||
obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
|
||||
obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
|
||||
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o
|
||||
+obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o
|
||||
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
|
||||
obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o
|
||||
obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
|
||||
diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
|
||||
deleted file mode 100644
|
||||
index 38ff742bc120..000000000000
|
||||
--- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
|
||||
+++ /dev/null
|
||||
@@ -1,424 +0,0 @@
|
||||
-// SPDX-License-Identifier: GPL-2.0
|
||||
-/*
|
||||
- * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
|
||||
- *
|
||||
- * Copyright (C) Purism SPC 2019
|
||||
- */
|
||||
-
|
||||
-#include <linux/debugfs.h>
|
||||
-#include <linux/delay.h>
|
||||
-#include <linux/gpio/consumer.h>
|
||||
-#include <linux/media-bus-format.h>
|
||||
-#include <linux/mod_devicetable.h>
|
||||
-#include <linux/module.h>
|
||||
-#include <linux/regulator/consumer.h>
|
||||
-
|
||||
-#include <video/display_timing.h>
|
||||
-#include <video/mipi_display.h>
|
||||
-
|
||||
-#include <drm/drm_mipi_dsi.h>
|
||||
-#include <drm/drm_modes.h>
|
||||
-#include <drm/drm_panel.h>
|
||||
-#include <drm/drm_print.h>
|
||||
-
|
||||
-#define DRV_NAME "panel-rocktech-jh057n00900"
|
||||
-
|
||||
-/* Manufacturer specific Commands send via DSI */
|
||||
-#define ST7703_CMD_ALL_PIXEL_OFF 0x22
|
||||
-#define ST7703_CMD_ALL_PIXEL_ON 0x23
|
||||
-#define ST7703_CMD_SETDISP 0xB2
|
||||
-#define ST7703_CMD_SETRGBIF 0xB3
|
||||
-#define ST7703_CMD_SETCYC 0xB4
|
||||
-#define ST7703_CMD_SETBGP 0xB5
|
||||
-#define ST7703_CMD_SETVCOM 0xB6
|
||||
-#define ST7703_CMD_SETOTP 0xB7
|
||||
-#define ST7703_CMD_SETPOWER_EXT 0xB8
|
||||
-#define ST7703_CMD_SETEXTC 0xB9
|
||||
-#define ST7703_CMD_SETMIPI 0xBA
|
||||
-#define ST7703_CMD_SETVDC 0xBC
|
||||
-#define ST7703_CMD_UNKNOWN0 0xBF
|
||||
-#define ST7703_CMD_SETSCR 0xC0
|
||||
-#define ST7703_CMD_SETPOWER 0xC1
|
||||
-#define ST7703_CMD_SETPANEL 0xCC
|
||||
-#define ST7703_CMD_SETGAMMA 0xE0
|
||||
-#define ST7703_CMD_SETEQ 0xE3
|
||||
-#define ST7703_CMD_SETGIP1 0xE9
|
||||
-#define ST7703_CMD_SETGIP2 0xEA
|
||||
-
|
||||
-struct jh057n {
|
||||
- struct device *dev;
|
||||
- struct drm_panel panel;
|
||||
- struct gpio_desc *reset_gpio;
|
||||
- struct regulator *vcc;
|
||||
- struct regulator *iovcc;
|
||||
- bool prepared;
|
||||
-
|
||||
- struct dentry *debugfs;
|
||||
-};
|
||||
-
|
||||
-static inline struct jh057n *panel_to_jh057n(struct drm_panel *panel)
|
||||
-{
|
||||
- return container_of(panel, struct jh057n, panel);
|
||||
-}
|
||||
-
|
||||
-#define dsi_generic_write_seq(dsi, seq...) do { \
|
||||
- static const u8 d[] = { seq }; \
|
||||
- int ret; \
|
||||
- ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \
|
||||
- if (ret < 0) \
|
||||
- return ret; \
|
||||
- } while (0)
|
||||
-
|
||||
-static int jh057n_init_sequence(struct jh057n *ctx)
|
||||
-{
|
||||
- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
- struct device *dev = ctx->dev;
|
||||
- int ret;
|
||||
-
|
||||
- /*
|
||||
- * Init sequence was supplied by the panel vendor. Most of the commands
|
||||
- * resemble the ST7703 but the number of parameters often don't match
|
||||
- * so it's likely a clone.
|
||||
- */
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETEXTC,
|
||||
- 0xF1, 0x12, 0x83);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETRGBIF,
|
||||
- 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00,
|
||||
- 0x00, 0x00);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETSCR,
|
||||
- 0x73, 0x73, 0x50, 0x50, 0x00, 0x00, 0x08, 0x70,
|
||||
- 0x00);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0x30);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETEQ,
|
||||
- 0x07, 0x07, 0x0B, 0x0B, 0x03, 0x0B, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETBGP, 0x08, 0x08);
|
||||
- msleep(20);
|
||||
-
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETVCOM, 0x3F, 0x3F);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_UNKNOWN0, 0x02, 0x11, 0x00);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETGIP1,
|
||||
- 0x82, 0x10, 0x06, 0x05, 0x9E, 0x0A, 0xA5, 0x12,
|
||||
- 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
|
||||
- 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
|
||||
- 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88,
|
||||
- 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64,
|
||||
- 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
- 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETGIP2,
|
||||
- 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
|
||||
- 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
|
||||
- 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
- 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0A,
|
||||
- 0xA5, 0x00, 0x00, 0x00, 0x00);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_SETGAMMA,
|
||||
- 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41, 0x37,
|
||||
- 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10, 0x11,
|
||||
- 0x18, 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41,
|
||||
- 0x37, 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10,
|
||||
- 0x11, 0x18);
|
||||
- msleep(20);
|
||||
-
|
||||
- ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(dev, "Failed to exit sleep mode: %d\n", ret);
|
||||
- return ret;
|
||||
- }
|
||||
- /* Panel is operational 120 msec after reset */
|
||||
- msleep(60);
|
||||
- ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n");
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int jh057n_enable(struct drm_panel *panel)
|
||||
-{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
- int ret;
|
||||
-
|
||||
- ret = jh057n_init_sequence(ctx);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
|
||||
- ret);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int jh057n_disable(struct drm_panel *panel)
|
||||
-{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
-
|
||||
- return mipi_dsi_dcs_set_display_off(dsi);
|
||||
-}
|
||||
-
|
||||
-static int jh057n_unprepare(struct drm_panel *panel)
|
||||
-{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
-
|
||||
- if (!ctx->prepared)
|
||||
- return 0;
|
||||
-
|
||||
- regulator_disable(ctx->iovcc);
|
||||
- regulator_disable(ctx->vcc);
|
||||
- ctx->prepared = false;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int jh057n_prepare(struct drm_panel *panel)
|
||||
-{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
- int ret;
|
||||
-
|
||||
- if (ctx->prepared)
|
||||
- return 0;
|
||||
-
|
||||
- DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
|
||||
- ret = regulator_enable(ctx->vcc);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(ctx->dev,
|
||||
- "Failed to enable vcc supply: %d\n", ret);
|
||||
- return ret;
|
||||
- }
|
||||
- ret = regulator_enable(ctx->iovcc);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(ctx->dev,
|
||||
- "Failed to enable iovcc supply: %d\n", ret);
|
||||
- goto disable_vcc;
|
||||
- }
|
||||
-
|
||||
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
- usleep_range(20, 40);
|
||||
- gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
- msleep(20);
|
||||
-
|
||||
- ctx->prepared = true;
|
||||
-
|
||||
- return 0;
|
||||
-
|
||||
-disable_vcc:
|
||||
- regulator_disable(ctx->vcc);
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static const struct drm_display_mode default_mode = {
|
||||
- .hdisplay = 720,
|
||||
- .hsync_start = 720 + 90,
|
||||
- .hsync_end = 720 + 90 + 20,
|
||||
- .htotal = 720 + 90 + 20 + 20,
|
||||
- .vdisplay = 1440,
|
||||
- .vsync_start = 1440 + 20,
|
||||
- .vsync_end = 1440 + 20 + 4,
|
||||
- .vtotal = 1440 + 20 + 4 + 12,
|
||||
- .vrefresh = 60,
|
||||
- .clock = 75276,
|
||||
- .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
- .width_mm = 65,
|
||||
- .height_mm = 130,
|
||||
-};
|
||||
-
|
||||
-static int jh057n_get_modes(struct drm_panel *panel,
|
||||
- struct drm_connector *connector)
|
||||
-{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
- struct drm_display_mode *mode;
|
||||
-
|
||||
- mode = drm_mode_duplicate(connector->dev, &default_mode);
|
||||
- if (!mode) {
|
||||
- DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n",
|
||||
- default_mode.hdisplay, default_mode.vdisplay,
|
||||
- default_mode.vrefresh);
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- drm_mode_set_name(mode);
|
||||
-
|
||||
- mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
|
||||
- connector->display_info.width_mm = mode->width_mm;
|
||||
- connector->display_info.height_mm = mode->height_mm;
|
||||
- drm_mode_probed_add(connector, mode);
|
||||
-
|
||||
- return 1;
|
||||
-}
|
||||
-
|
||||
-static const struct drm_panel_funcs jh057n_drm_funcs = {
|
||||
- .disable = jh057n_disable,
|
||||
- .unprepare = jh057n_unprepare,
|
||||
- .prepare = jh057n_prepare,
|
||||
- .enable = jh057n_enable,
|
||||
- .get_modes = jh057n_get_modes,
|
||||
-};
|
||||
-
|
||||
-static int allpixelson_set(void *data, u64 val)
|
||||
-{
|
||||
- struct jh057n *ctx = data;
|
||||
- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
-
|
||||
- DRM_DEV_DEBUG_DRIVER(ctx->dev, "Setting all pixels on\n");
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON);
|
||||
- msleep(val * 1000);
|
||||
- /* Reset the panel to get video back */
|
||||
- drm_panel_disable(&ctx->panel);
|
||||
- drm_panel_unprepare(&ctx->panel);
|
||||
- drm_panel_prepare(&ctx->panel);
|
||||
- drm_panel_enable(&ctx->panel);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
|
||||
- allpixelson_set, "%llu\n");
|
||||
-
|
||||
-static void jh057n_debugfs_init(struct jh057n *ctx)
|
||||
-{
|
||||
- ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
|
||||
-
|
||||
- debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
|
||||
- &allpixelson_fops);
|
||||
-}
|
||||
-
|
||||
-static void jh057n_debugfs_remove(struct jh057n *ctx)
|
||||
-{
|
||||
- debugfs_remove_recursive(ctx->debugfs);
|
||||
- ctx->debugfs = NULL;
|
||||
-}
|
||||
-
|
||||
-static int jh057n_probe(struct mipi_dsi_device *dsi)
|
||||
-{
|
||||
- struct device *dev = &dsi->dev;
|
||||
- struct jh057n *ctx;
|
||||
- int ret;
|
||||
-
|
||||
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
- if (!ctx)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
|
||||
- if (IS_ERR(ctx->reset_gpio)) {
|
||||
- DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
|
||||
- return PTR_ERR(ctx->reset_gpio);
|
||||
- }
|
||||
-
|
||||
- mipi_dsi_set_drvdata(dsi, ctx);
|
||||
-
|
||||
- ctx->dev = dev;
|
||||
-
|
||||
- dsi->lanes = 4;
|
||||
- dsi->format = MIPI_DSI_FMT_RGB888;
|
||||
- dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
|
||||
- MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
|
||||
-
|
||||
- ctx->vcc = devm_regulator_get(dev, "vcc");
|
||||
- if (IS_ERR(ctx->vcc)) {
|
||||
- ret = PTR_ERR(ctx->vcc);
|
||||
- if (ret != -EPROBE_DEFER)
|
||||
- DRM_DEV_ERROR(dev,
|
||||
- "Failed to request vcc regulator: %d\n",
|
||||
- ret);
|
||||
- return ret;
|
||||
- }
|
||||
- ctx->iovcc = devm_regulator_get(dev, "iovcc");
|
||||
- if (IS_ERR(ctx->iovcc)) {
|
||||
- ret = PTR_ERR(ctx->iovcc);
|
||||
- if (ret != -EPROBE_DEFER)
|
||||
- DRM_DEV_ERROR(dev,
|
||||
- "Failed to request iovcc regulator: %d\n",
|
||||
- ret);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- drm_panel_init(&ctx->panel, dev, &jh057n_drm_funcs,
|
||||
- DRM_MODE_CONNECTOR_DSI);
|
||||
-
|
||||
- ret = drm_panel_of_backlight(&ctx->panel);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- drm_panel_add(&ctx->panel);
|
||||
-
|
||||
- ret = mipi_dsi_attach(dsi);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(dev,
|
||||
- "mipi_dsi_attach failed (%d). Is host ready?\n",
|
||||
- ret);
|
||||
- drm_panel_remove(&ctx->panel);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
|
||||
- default_mode.hdisplay, default_mode.vdisplay,
|
||||
- default_mode.vrefresh,
|
||||
- mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
|
||||
-
|
||||
- jh057n_debugfs_init(ctx);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static void jh057n_shutdown(struct mipi_dsi_device *dsi)
|
||||
-{
|
||||
- struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
- int ret;
|
||||
-
|
||||
- ret = drm_panel_unprepare(&ctx->panel);
|
||||
- if (ret < 0)
|
||||
- DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n",
|
||||
- ret);
|
||||
-
|
||||
- ret = drm_panel_disable(&ctx->panel);
|
||||
- if (ret < 0)
|
||||
- DRM_DEV_ERROR(&dsi->dev, "Failed to disable panel: %d\n",
|
||||
- ret);
|
||||
-}
|
||||
-
|
||||
-static int jh057n_remove(struct mipi_dsi_device *dsi)
|
||||
-{
|
||||
- struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
- int ret;
|
||||
-
|
||||
- jh057n_shutdown(dsi);
|
||||
-
|
||||
- ret = mipi_dsi_detach(dsi);
|
||||
- if (ret < 0)
|
||||
- DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n",
|
||||
- ret);
|
||||
-
|
||||
- drm_panel_remove(&ctx->panel);
|
||||
-
|
||||
- jh057n_debugfs_remove(ctx);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static const struct of_device_id jh057n_of_match[] = {
|
||||
- { .compatible = "rocktech,jh057n00900" },
|
||||
- { /* sentinel */ }
|
||||
-};
|
||||
-MODULE_DEVICE_TABLE(of, jh057n_of_match);
|
||||
-
|
||||
-static struct mipi_dsi_driver jh057n_driver = {
|
||||
- .probe = jh057n_probe,
|
||||
- .remove = jh057n_remove,
|
||||
- .shutdown = jh057n_shutdown,
|
||||
- .driver = {
|
||||
- .name = DRV_NAME,
|
||||
- .of_match_table = jh057n_of_match,
|
||||
- },
|
||||
-};
|
||||
-module_mipi_dsi_driver(jh057n_driver);
|
||||
-
|
||||
-MODULE_AUTHOR("Guido Günther <agx@sigxcpu.org>");
|
||||
-MODULE_DESCRIPTION("DRM driver for Rocktech JH057N00900 MIPI DSI panel");
|
||||
-MODULE_LICENSE("GPL v2");
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
new file mode 100644
|
||||
index 000000000000..38ff742bc120
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -0,0 +1,424 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
|
||||
+ *
|
||||
+ * Copyright (C) Purism SPC 2019
|
||||
+ */
|
||||
+
|
||||
+#include <linux/debugfs.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
+#include <linux/media-bus-format.h>
|
||||
+#include <linux/mod_devicetable.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+
|
||||
+#include <video/display_timing.h>
|
||||
+#include <video/mipi_display.h>
|
||||
+
|
||||
+#include <drm/drm_mipi_dsi.h>
|
||||
+#include <drm/drm_modes.h>
|
||||
+#include <drm/drm_panel.h>
|
||||
+#include <drm/drm_print.h>
|
||||
+
|
||||
+#define DRV_NAME "panel-rocktech-jh057n00900"
|
||||
+
|
||||
+/* Manufacturer specific Commands send via DSI */
|
||||
+#define ST7703_CMD_ALL_PIXEL_OFF 0x22
|
||||
+#define ST7703_CMD_ALL_PIXEL_ON 0x23
|
||||
+#define ST7703_CMD_SETDISP 0xB2
|
||||
+#define ST7703_CMD_SETRGBIF 0xB3
|
||||
+#define ST7703_CMD_SETCYC 0xB4
|
||||
+#define ST7703_CMD_SETBGP 0xB5
|
||||
+#define ST7703_CMD_SETVCOM 0xB6
|
||||
+#define ST7703_CMD_SETOTP 0xB7
|
||||
+#define ST7703_CMD_SETPOWER_EXT 0xB8
|
||||
+#define ST7703_CMD_SETEXTC 0xB9
|
||||
+#define ST7703_CMD_SETMIPI 0xBA
|
||||
+#define ST7703_CMD_SETVDC 0xBC
|
||||
+#define ST7703_CMD_UNKNOWN0 0xBF
|
||||
+#define ST7703_CMD_SETSCR 0xC0
|
||||
+#define ST7703_CMD_SETPOWER 0xC1
|
||||
+#define ST7703_CMD_SETPANEL 0xCC
|
||||
+#define ST7703_CMD_SETGAMMA 0xE0
|
||||
+#define ST7703_CMD_SETEQ 0xE3
|
||||
+#define ST7703_CMD_SETGIP1 0xE9
|
||||
+#define ST7703_CMD_SETGIP2 0xEA
|
||||
+
|
||||
+struct jh057n {
|
||||
+ struct device *dev;
|
||||
+ struct drm_panel panel;
|
||||
+ struct gpio_desc *reset_gpio;
|
||||
+ struct regulator *vcc;
|
||||
+ struct regulator *iovcc;
|
||||
+ bool prepared;
|
||||
+
|
||||
+ struct dentry *debugfs;
|
||||
+};
|
||||
+
|
||||
+static inline struct jh057n *panel_to_jh057n(struct drm_panel *panel)
|
||||
+{
|
||||
+ return container_of(panel, struct jh057n, panel);
|
||||
+}
|
||||
+
|
||||
+#define dsi_generic_write_seq(dsi, seq...) do { \
|
||||
+ static const u8 d[] = { seq }; \
|
||||
+ int ret; \
|
||||
+ ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \
|
||||
+ if (ret < 0) \
|
||||
+ return ret; \
|
||||
+ } while (0)
|
||||
+
|
||||
+static int jh057n_init_sequence(struct jh057n *ctx)
|
||||
+{
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+ struct device *dev = ctx->dev;
|
||||
+ int ret;
|
||||
+
|
||||
+ /*
|
||||
+ * Init sequence was supplied by the panel vendor. Most of the commands
|
||||
+ * resemble the ST7703 but the number of parameters often don't match
|
||||
+ * so it's likely a clone.
|
||||
+ */
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETEXTC,
|
||||
+ 0xF1, 0x12, 0x83);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETRGBIF,
|
||||
+ 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00,
|
||||
+ 0x00, 0x00);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETSCR,
|
||||
+ 0x73, 0x73, 0x50, 0x50, 0x00, 0x00, 0x08, 0x70,
|
||||
+ 0x00);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0x30);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETEQ,
|
||||
+ 0x07, 0x07, 0x0B, 0x0B, 0x03, 0x0B, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETBGP, 0x08, 0x08);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETVCOM, 0x3F, 0x3F);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_UNKNOWN0, 0x02, 0x11, 0x00);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETGIP1,
|
||||
+ 0x82, 0x10, 0x06, 0x05, 0x9E, 0x0A, 0xA5, 0x12,
|
||||
+ 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
|
||||
+ 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
|
||||
+ 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64,
|
||||
+ 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETGIP2,
|
||||
+ 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
|
||||
+ 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0A,
|
||||
+ 0xA5, 0x00, 0x00, 0x00, 0x00);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_SETGAMMA,
|
||||
+ 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41, 0x37,
|
||||
+ 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10, 0x11,
|
||||
+ 0x18, 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41,
|
||||
+ 0x37, 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10,
|
||||
+ 0x11, 0x18);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(dev, "Failed to exit sleep mode: %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ /* Panel is operational 120 msec after reset */
|
||||
+ msleep(60);
|
||||
+ ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int jh057n_enable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = jh057n_init_sequence(ctx);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int jh057n_disable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+
|
||||
+ return mipi_dsi_dcs_set_display_off(dsi);
|
||||
+}
|
||||
+
|
||||
+static int jh057n_unprepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+
|
||||
+ if (!ctx->prepared)
|
||||
+ return 0;
|
||||
+
|
||||
+ regulator_disable(ctx->iovcc);
|
||||
+ regulator_disable(ctx->vcc);
|
||||
+ ctx->prepared = false;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int jh057n_prepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ int ret;
|
||||
+
|
||||
+ if (ctx->prepared)
|
||||
+ return 0;
|
||||
+
|
||||
+ DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n");
|
||||
+ ret = regulator_enable(ctx->vcc);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(ctx->dev,
|
||||
+ "Failed to enable vcc supply: %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ ret = regulator_enable(ctx->iovcc);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(ctx->dev,
|
||||
+ "Failed to enable iovcc supply: %d\n", ret);
|
||||
+ goto disable_vcc;
|
||||
+ }
|
||||
+
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
+ usleep_range(20, 40);
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ctx->prepared = true;
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+disable_vcc:
|
||||
+ regulator_disable(ctx->vcc);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct drm_display_mode default_mode = {
|
||||
+ .hdisplay = 720,
|
||||
+ .hsync_start = 720 + 90,
|
||||
+ .hsync_end = 720 + 90 + 20,
|
||||
+ .htotal = 720 + 90 + 20 + 20,
|
||||
+ .vdisplay = 1440,
|
||||
+ .vsync_start = 1440 + 20,
|
||||
+ .vsync_end = 1440 + 20 + 4,
|
||||
+ .vtotal = 1440 + 20 + 4 + 12,
|
||||
+ .vrefresh = 60,
|
||||
+ .clock = 75276,
|
||||
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
+ .width_mm = 65,
|
||||
+ .height_mm = 130,
|
||||
+};
|
||||
+
|
||||
+static int jh057n_get_modes(struct drm_panel *panel,
|
||||
+ struct drm_connector *connector)
|
||||
+{
|
||||
+ struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct drm_display_mode *mode;
|
||||
+
|
||||
+ mode = drm_mode_duplicate(connector->dev, &default_mode);
|
||||
+ if (!mode) {
|
||||
+ DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n",
|
||||
+ default_mode.hdisplay, default_mode.vdisplay,
|
||||
+ default_mode.vrefresh);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ drm_mode_set_name(mode);
|
||||
+
|
||||
+ mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
|
||||
+ connector->display_info.width_mm = mode->width_mm;
|
||||
+ connector->display_info.height_mm = mode->height_mm;
|
||||
+ drm_mode_probed_add(connector, mode);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static const struct drm_panel_funcs jh057n_drm_funcs = {
|
||||
+ .disable = jh057n_disable,
|
||||
+ .unprepare = jh057n_unprepare,
|
||||
+ .prepare = jh057n_prepare,
|
||||
+ .enable = jh057n_enable,
|
||||
+ .get_modes = jh057n_get_modes,
|
||||
+};
|
||||
+
|
||||
+static int allpixelson_set(void *data, u64 val)
|
||||
+{
|
||||
+ struct jh057n *ctx = data;
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+
|
||||
+ DRM_DEV_DEBUG_DRIVER(ctx->dev, "Setting all pixels on\n");
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON);
|
||||
+ msleep(val * 1000);
|
||||
+ /* Reset the panel to get video back */
|
||||
+ drm_panel_disable(&ctx->panel);
|
||||
+ drm_panel_unprepare(&ctx->panel);
|
||||
+ drm_panel_prepare(&ctx->panel);
|
||||
+ drm_panel_enable(&ctx->panel);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
|
||||
+ allpixelson_set, "%llu\n");
|
||||
+
|
||||
+static void jh057n_debugfs_init(struct jh057n *ctx)
|
||||
+{
|
||||
+ ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
|
||||
+
|
||||
+ debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
|
||||
+ &allpixelson_fops);
|
||||
+}
|
||||
+
|
||||
+static void jh057n_debugfs_remove(struct jh057n *ctx)
|
||||
+{
|
||||
+ debugfs_remove_recursive(ctx->debugfs);
|
||||
+ ctx->debugfs = NULL;
|
||||
+}
|
||||
+
|
||||
+static int jh057n_probe(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct device *dev = &dsi->dev;
|
||||
+ struct jh057n *ctx;
|
||||
+ int ret;
|
||||
+
|
||||
+ ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
+ if (!ctx)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
|
||||
+ if (IS_ERR(ctx->reset_gpio)) {
|
||||
+ DRM_DEV_ERROR(dev, "cannot get reset gpio\n");
|
||||
+ return PTR_ERR(ctx->reset_gpio);
|
||||
+ }
|
||||
+
|
||||
+ mipi_dsi_set_drvdata(dsi, ctx);
|
||||
+
|
||||
+ ctx->dev = dev;
|
||||
+
|
||||
+ dsi->lanes = 4;
|
||||
+ dsi->format = MIPI_DSI_FMT_RGB888;
|
||||
+ dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
|
||||
+ MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
|
||||
+
|
||||
+ ctx->vcc = devm_regulator_get(dev, "vcc");
|
||||
+ if (IS_ERR(ctx->vcc)) {
|
||||
+ ret = PTR_ERR(ctx->vcc);
|
||||
+ if (ret != -EPROBE_DEFER)
|
||||
+ DRM_DEV_ERROR(dev,
|
||||
+ "Failed to request vcc regulator: %d\n",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ ctx->iovcc = devm_regulator_get(dev, "iovcc");
|
||||
+ if (IS_ERR(ctx->iovcc)) {
|
||||
+ ret = PTR_ERR(ctx->iovcc);
|
||||
+ if (ret != -EPROBE_DEFER)
|
||||
+ DRM_DEV_ERROR(dev,
|
||||
+ "Failed to request iovcc regulator: %d\n",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ drm_panel_init(&ctx->panel, dev, &jh057n_drm_funcs,
|
||||
+ DRM_MODE_CONNECTOR_DSI);
|
||||
+
|
||||
+ ret = drm_panel_of_backlight(&ctx->panel);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ drm_panel_add(&ctx->panel);
|
||||
+
|
||||
+ ret = mipi_dsi_attach(dsi);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(dev,
|
||||
+ "mipi_dsi_attach failed (%d). Is host ready?\n",
|
||||
+ ret);
|
||||
+ drm_panel_remove(&ctx->panel);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
|
||||
+ default_mode.hdisplay, default_mode.vdisplay,
|
||||
+ default_mode.vrefresh,
|
||||
+ mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
|
||||
+
|
||||
+ jh057n_debugfs_init(ctx);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void jh057n_shutdown(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = drm_panel_unprepare(&ctx->panel);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n",
|
||||
+ ret);
|
||||
+
|
||||
+ ret = drm_panel_disable(&ctx->panel);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(&dsi->dev, "Failed to disable panel: %d\n",
|
||||
+ ret);
|
||||
+}
|
||||
+
|
||||
+static int jh057n_remove(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ int ret;
|
||||
+
|
||||
+ jh057n_shutdown(dsi);
|
||||
+
|
||||
+ ret = mipi_dsi_detach(dsi);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n",
|
||||
+ ret);
|
||||
+
|
||||
+ drm_panel_remove(&ctx->panel);
|
||||
+
|
||||
+ jh057n_debugfs_remove(ctx);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id jh057n_of_match[] = {
|
||||
+ { .compatible = "rocktech,jh057n00900" },
|
||||
+ { /* sentinel */ }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, jh057n_of_match);
|
||||
+
|
||||
+static struct mipi_dsi_driver jh057n_driver = {
|
||||
+ .probe = jh057n_probe,
|
||||
+ .remove = jh057n_remove,
|
||||
+ .shutdown = jh057n_shutdown,
|
||||
+ .driver = {
|
||||
+ .name = DRV_NAME,
|
||||
+ .of_match_table = jh057n_of_match,
|
||||
+ },
|
||||
+};
|
||||
+module_mipi_dsi_driver(jh057n_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Guido Günther <agx@sigxcpu.org>");
|
||||
+MODULE_DESCRIPTION("DRM driver for Rocktech JH057N00900 MIPI DSI panel");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.26.2
|
||||
|
||||
251
0001-drm-panel-st7703-Add-support-for-Xingbangda-XBD599.patch
Normal file
251
0001-drm-panel-st7703-Add-support-for-Xingbangda-XBD599.patch
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:57 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Add support for Xingbangda XBD599
|
||||
|
||||
Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI LCD panel used in
|
||||
PinePhone. Add support for it.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 199 +++++++++++++++++-
|
||||
1 file changed, 197 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index cdbf7dfb4dd4..33611419059a 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -39,10 +39,11 @@
|
||||
#define ST7703_CMD_SETEXTC 0xB9
|
||||
#define ST7703_CMD_SETMIPI 0xBA
|
||||
#define ST7703_CMD_SETVDC 0xBC
|
||||
-#define ST7703_CMD_UNKNOWN0 0xBF
|
||||
+#define ST7703_CMD_UNKNOWN_BF 0xBF
|
||||
#define ST7703_CMD_SETSCR 0xC0
|
||||
#define ST7703_CMD_SETPOWER 0xC1
|
||||
#define ST7703_CMD_SETPANEL 0xCC
|
||||
+#define ST7703_CMD_UNKNOWN_C6 0xC6
|
||||
#define ST7703_CMD_SETGAMMA 0xE0
|
||||
#define ST7703_CMD_SETEQ 0xE3
|
||||
#define ST7703_CMD_SETGIP1 0xE9
|
||||
@@ -109,7 +110,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
|
||||
msleep(20);
|
||||
|
||||
dsi_generic_write_seq(dsi, ST7703_CMD_SETVCOM, 0x3F, 0x3F);
|
||||
- dsi_generic_write_seq(dsi, ST7703_CMD_UNKNOWN0, 0x02, 0x11, 0x00);
|
||||
+ dsi_generic_write_seq(dsi, ST7703_CMD_UNKNOWN_BF, 0x02, 0x11, 0x00);
|
||||
dsi_generic_write_seq(dsi, ST7703_CMD_SETGIP1,
|
||||
0x82, 0x10, 0x06, 0x05, 0x9E, 0x0A, 0xA5, 0x12,
|
||||
0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
|
||||
@@ -163,6 +164,199 @@ struct st7703_panel_desc jh057n00900_panel_desc = {
|
||||
.init_sequence = jh057n_init_sequence,
|
||||
};
|
||||
|
||||
+#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \
|
||||
+ static const u8 d[] = { seq }; \
|
||||
+ int ret; \
|
||||
+ ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
|
||||
+ if (ret < 0) \
|
||||
+ return ret; \
|
||||
+ } while (0)
|
||||
+
|
||||
+
|
||||
+static int xbd599_init_sequence(struct st7703 *ctx)
|
||||
+{
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+
|
||||
+ /*
|
||||
+ * Init sequence was supplied by the panel vendor.
|
||||
+ */
|
||||
+
|
||||
+ /* Magic sequence to unlock user commands below. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC, 0xF1, 0x12, 0x83);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI,
|
||||
+ 0x33, /* VC_main = 0, Lane_Number = 3 (4 lanes) */
|
||||
+ 0x81, /* DSI_LDO_SEL = 1.7V, RTERM = 90 Ohm */
|
||||
+ 0x05, /* IHSRX = x6 (Low High Speed driving ability) */
|
||||
+ 0xF9, /* TX_CLK_SEL = fDSICLK/16 */
|
||||
+ 0x0E, /* HFP_OSC (min. HFP number in DSI mode) */
|
||||
+ 0x0E, /* HBP_OSC (min. HBP number in DSI mode) */
|
||||
+ /* The rest is undocumented in ST7703 datasheet */
|
||||
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x44, 0x25, 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02,
|
||||
+ 0x4F, 0x11, 0x00, 0x00, 0x37);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT,
|
||||
+ 0x25, /* PCCS = 2, ECP_DC_DIV = 1/4 HSYNC */
|
||||
+ 0x22, /* DT = 15ms XDK_ECP = x2 */
|
||||
+ 0x20, /* PFM_DC_DIV = /1 */
|
||||
+ 0x03 /* ECP_SYNC_EN = 1, VGX_SYNC_EN = 1 */);
|
||||
+
|
||||
+ /* RGB I/F porch timing */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF,
|
||||
+ 0x10, /* VBP_RGB_GEN */
|
||||
+ 0x10, /* VFP_RGB_GEN */
|
||||
+ 0x05, /* DE_BP_RGB_GEN */
|
||||
+ 0x05, /* DE_FP_RGB_GEN */
|
||||
+ /* The rest is undocumented in ST7703 datasheet */
|
||||
+ 0x03, 0xFF,
|
||||
+ 0x00, 0x00,
|
||||
+ 0x00, 0x00);
|
||||
+
|
||||
+ /* Source driving settings. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR,
|
||||
+ 0x73, /* N_POPON */
|
||||
+ 0x73, /* N_NOPON */
|
||||
+ 0x50, /* I_POPON */
|
||||
+ 0x50, /* I_NOPON */
|
||||
+ 0x00, /* SCR[31,24] */
|
||||
+ 0xC0, /* SCR[23,16] */
|
||||
+ 0x08, /* SCR[15,8] */
|
||||
+ 0x70, /* SCR[7,0] */
|
||||
+ 0x00 /* Undocumented */);
|
||||
+
|
||||
+ /* NVDDD_SEL = -1.8V, VDDD_SEL = out of range (possibly 1.9V?) */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E);
|
||||
+
|
||||
+ /*
|
||||
+ * SS_PANEL = 1 (reverse scan), GS_PANEL = 0 (normal scan)
|
||||
+ * REV_PANEL = 1 (normally black panel), BGR_PANEL = 1 (BGR)
|
||||
+ */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B);
|
||||
+
|
||||
+ /* Zig-Zag Type C column inversion. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
+
|
||||
+ /* Set display resolution. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP,
|
||||
+ 0xF0, /* NL = 240 */
|
||||
+ 0x12, /* RES_V_LSB = 0, BLK_CON = VSSD,
|
||||
+ * RESO_SEL = 720RGB
|
||||
+ */
|
||||
+ 0xF0 /* WHITE_GND_EN = 1 (GND),
|
||||
+ * WHITE_FRAME_SEL = 7 frames,
|
||||
+ * ISC = 0 frames
|
||||
+ */);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ,
|
||||
+ 0x00, /* PNOEQ */
|
||||
+ 0x00, /* NNOEQ */
|
||||
+ 0x0B, /* PEQGND */
|
||||
+ 0x0B, /* NEQGND */
|
||||
+ 0x10, /* PEQVCI */
|
||||
+ 0x10, /* NEQVCI */
|
||||
+ 0x00, /* PEQVCI1 */
|
||||
+ 0x00, /* NEQVCI1 */
|
||||
+ 0x00, /* reserved */
|
||||
+ 0x00, /* reserved */
|
||||
+ 0xFF, /* reserved */
|
||||
+ 0x00, /* reserved */
|
||||
+ 0xC0, /* ESD_DET_DATA_WHITE = 1, ESD_WHITE_EN = 1 */
|
||||
+ 0x10 /* SLPIN_OPTION = 1 (no need vsync after sleep-in)
|
||||
+ * VEDIO_NO_CHECK_EN = 0
|
||||
+ * ESD_WHITE_GND_EN = 0
|
||||
+ * ESD_DET_TIME_SEL = 0 frames
|
||||
+ */);
|
||||
+
|
||||
+ /* Undocumented command. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_C6, 0x01, 0x00, 0xFF, 0xFF, 0x00);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
|
||||
+ 0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */
|
||||
+ 0x00, /* FBOFF_VGH = 0, FBOFF_VGL = 0 */
|
||||
+ 0x32, /* VRP */
|
||||
+ 0x32, /* VRN */
|
||||
+ 0x77, /* reserved */
|
||||
+ 0xF1, /* APS = 1 (small),
|
||||
+ * VGL_DET_EN = 1, VGH_DET_EN = 1,
|
||||
+ * VGL_TURBO = 1, VGH_TURBO = 1
|
||||
+ */
|
||||
+ 0xFF, /* VGH1_L_DIV, VGL1_L_DIV (1.5MHz) */
|
||||
+ 0xFF, /* VGH1_R_DIV, VGL1_R_DIV (1.5MHz) */
|
||||
+ 0xCC, /* VGH2_L_DIV, VGL2_L_DIV (2.6MHz) */
|
||||
+ 0xCC, /* VGH2_R_DIV, VGL2_R_DIV (2.6MHz) */
|
||||
+ 0x77, /* VGH3_L_DIV, VGL3_L_DIV (4.5MHz) */
|
||||
+ 0x77 /* VGH3_R_DIV, VGL3_R_DIV (4.5MHz) */);
|
||||
+
|
||||
+ /* Reference voltage. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP,
|
||||
+ 0x07, /* VREF_SEL = 4.2V */
|
||||
+ 0x07 /* NVREF_SEL = 4.2V */);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM,
|
||||
+ 0x2C, /* VCOMDC_F = -0.67V */
|
||||
+ 0x2C /* VCOMDC_B = -0.67V */);
|
||||
+
|
||||
+ /* Undocumented command. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_BF, 0x02, 0x11, 0x00);
|
||||
+
|
||||
+ /* This command is to set forward GIP timing. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1,
|
||||
+ 0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12,
|
||||
+ 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
|
||||
+ 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
|
||||
+ 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64,
|
||||
+ 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
+
|
||||
+ /* This command is to set backward GIP timing. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2,
|
||||
+ 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
|
||||
+ 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0A,
|
||||
+ 0xA5, 0x00, 0x00, 0x00, 0x00);
|
||||
+
|
||||
+ /* Adjust the gamma characteristics of the panel. */
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA,
|
||||
+ 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35,
|
||||
+ 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12,
|
||||
+ 0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41,
|
||||
+ 0x35, 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12,
|
||||
+ 0x12, 0x18);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct drm_display_mode xbd599_mode = {
|
||||
+ .hdisplay = 720,
|
||||
+ .hsync_start = 720 + 40,
|
||||
+ .hsync_end = 720 + 40 + 40,
|
||||
+ .htotal = 720 + 40 + 40 + 40,
|
||||
+ .vdisplay = 1440,
|
||||
+ .vsync_start = 1440 + 18,
|
||||
+ .vsync_end = 1440 + 18 + 10,
|
||||
+ .vtotal = 1440 + 18 + 10 + 17,
|
||||
+ .vrefresh = 60,
|
||||
+ .clock = 69000,
|
||||
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
+ .width_mm = 68,
|
||||
+ .height_mm = 136,
|
||||
+};
|
||||
+
|
||||
+static const struct st7703_panel_desc xbd599_desc = {
|
||||
+ .mode = &xbd599_mode,
|
||||
+ .lanes = 4,
|
||||
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
|
||||
+ .format = MIPI_DSI_FMT_RGB888,
|
||||
+ .init_sequence = xbd599_init_sequence,
|
||||
+};
|
||||
+
|
||||
static int st7703_enable(struct drm_panel *panel)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
@@ -428,6 +622,7 @@ static int st7703_remove(struct mipi_dsi_device *dsi)
|
||||
|
||||
static const struct of_device_id st7703_of_match[] = {
|
||||
{ .compatible = "rocktech,jh057n00900", .data = &jh057n00900_panel_desc },
|
||||
+ { .compatible = "xingbangda,xbd599", .data = &xbd599_desc },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, st7703_of_match);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:59 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Assert reset prior to powering down the
|
||||
regulators
|
||||
|
||||
The reset pin is inverted, so if we don't assert reset, the actual gpio
|
||||
will be high and may keep driving the IO port of the panel.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index e771281eb547..92930e127559 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -416,6 +416,7 @@ static int st7703_unprepare(struct drm_panel *panel)
|
||||
if (!ctx->prepared)
|
||||
return 0;
|
||||
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
regulator_disable(ctx->iovcc);
|
||||
regulator_disable(ctx->vcc);
|
||||
ctx->prepared = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
41
0001-drm-panel-st7703-Enter-sleep-after-display-off.patch
Normal file
41
0001-drm-panel-st7703-Enter-sleep-after-display-off.patch
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:58 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Enter sleep after display off
|
||||
|
||||
The datasheet suggests to issue sleep in after display off
|
||||
as a part of the panel's shutdown sequence.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index 33611419059a..e771281eb547 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -394,8 +394,19 @@ static int st7703_disable(struct drm_panel *panel)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_set_display_off(dsi);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(ctx->dev,
|
||||
+ "Failed to turn off the display: %d\n", ret);
|
||||
|
||||
- return mipi_dsi_dcs_set_display_off(dsi);
|
||||
+ ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
|
||||
+ if (ret < 0)
|
||||
+ DRM_DEV_ERROR(ctx->dev,
|
||||
+ "Failed to enter sleep mode: %d\n", ret);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int st7703_unprepare(struct drm_panel *panel)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:55 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Move code specific to jh057n closer
|
||||
together
|
||||
|
||||
It's better than having it spread around the driver.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 50 +++++++++----------
|
||||
1 file changed, 25 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index 08cbc316266c..d03aab10cfef 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -153,6 +153,31 @@ static int jh057n_init_sequence(struct st7703 *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static const struct drm_display_mode jh057n00900_mode = {
|
||||
+ .hdisplay = 720,
|
||||
+ .hsync_start = 720 + 90,
|
||||
+ .hsync_end = 720 + 90 + 20,
|
||||
+ .htotal = 720 + 90 + 20 + 20,
|
||||
+ .vdisplay = 1440,
|
||||
+ .vsync_start = 1440 + 20,
|
||||
+ .vsync_end = 1440 + 20 + 4,
|
||||
+ .vtotal = 1440 + 20 + 4 + 12,
|
||||
+ .vrefresh = 60,
|
||||
+ .clock = 75276,
|
||||
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
+ .width_mm = 65,
|
||||
+ .height_mm = 130,
|
||||
+};
|
||||
+
|
||||
+struct st7703_panel_desc jh057n00900_panel_desc = {
|
||||
+ .mode = &jh057n00900_mode,
|
||||
+ .lanes = 4,
|
||||
+ .mode_flags = MIPI_DSI_MODE_VIDEO |
|
||||
+ MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
|
||||
+ .format = MIPI_DSI_FMT_RGB888,
|
||||
+ .init_sequence = jh057n_init_sequence,
|
||||
+};
|
||||
+
|
||||
static int st7703_enable(struct drm_panel *panel)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
@@ -226,31 +251,6 @@ static int st7703_prepare(struct drm_panel *panel)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static const struct drm_display_mode jh057n00900_mode = {
|
||||
- .hdisplay = 720,
|
||||
- .hsync_start = 720 + 90,
|
||||
- .hsync_end = 720 + 90 + 20,
|
||||
- .htotal = 720 + 90 + 20 + 20,
|
||||
- .vdisplay = 1440,
|
||||
- .vsync_start = 1440 + 20,
|
||||
- .vsync_end = 1440 + 20 + 4,
|
||||
- .vtotal = 1440 + 20 + 4 + 12,
|
||||
- .vrefresh = 60,
|
||||
- .clock = 75276,
|
||||
- .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
- .width_mm = 65,
|
||||
- .height_mm = 130,
|
||||
-};
|
||||
-
|
||||
-struct st7703_panel_desc jh057n00900_panel_desc = {
|
||||
- .mode = &jh057n00900_mode,
|
||||
- .lanes = 4,
|
||||
- .mode_flags = MIPI_DSI_MODE_VIDEO |
|
||||
- MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
|
||||
- .format = MIPI_DSI_FMT_RGB888,
|
||||
- .init_sequence = jh057n_init_sequence,
|
||||
-};
|
||||
-
|
||||
static int st7703_get_modes(struct drm_panel *panel,
|
||||
struct drm_connector *connector)
|
||||
{
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:56 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Move generic part of init sequence to
|
||||
enable callback
|
||||
|
||||
Calling sleep out and display on is a controller specific part
|
||||
of the initialization process. Move it out of the panel specific
|
||||
initialization function to the enable callback.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 33 ++++++++++---------
|
||||
1 file changed, 18 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index d03aab10cfef..cdbf7dfb4dd4 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -84,8 +84,6 @@ static inline struct st7703 *panel_to_st7703(struct drm_panel *panel)
|
||||
static int jh057n_init_sequence(struct st7703 *ctx)
|
||||
{
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
- struct device *dev = ctx->dev;
|
||||
- int ret;
|
||||
|
||||
/*
|
||||
* Init sequence was supplied by the panel vendor. Most of the commands
|
||||
@@ -136,20 +134,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
|
||||
0x18, 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41,
|
||||
0x37, 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10,
|
||||
0x11, 0x18);
|
||||
- msleep(20);
|
||||
-
|
||||
- ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
- if (ret < 0) {
|
||||
- DRM_DEV_ERROR(dev, "Failed to exit sleep mode: %d\n", ret);
|
||||
- return ret;
|
||||
- }
|
||||
- /* Panel is operational 120 msec after reset */
|
||||
- msleep(60);
|
||||
- ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
|
||||
- DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -181,6 +166,7 @@ struct st7703_panel_desc jh057n00900_panel_desc = {
|
||||
static int st7703_enable(struct drm_panel *panel)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
int ret;
|
||||
|
||||
ret = ctx->desc->init_sequence(ctx);
|
||||
@@ -190,6 +176,23 @@ static int st7703_enable(struct drm_panel *panel)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ msleep(20);
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
+ if (ret < 0) {
|
||||
+ DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ /* Panel is operational 120 msec after reset */
|
||||
+ msleep(60);
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_set_display_on(dsi);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ DRM_DEV_DEBUG_DRIVER(ctx->dev, "Panel init sequence done\n");
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
128
0001-drm-panel-st7703-Prepare-for-supporting-multiple-pan.patch
Normal file
128
0001-drm-panel-st7703-Prepare-for-supporting-multiple-pan.patch
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:54 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Prepare for supporting multiple panels
|
||||
|
||||
Parametrize the driver so that it can support more panels based
|
||||
on st7703 controller.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 43 +++++++++++++------
|
||||
1 file changed, 31 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index 511af659f273..08cbc316266c 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/media-bus-format.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/of_device.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
|
||||
#include <video/display_timing.h>
|
||||
@@ -56,6 +57,15 @@ struct st7703 {
|
||||
bool prepared;
|
||||
|
||||
struct dentry *debugfs;
|
||||
+ const struct st7703_panel_desc *desc;
|
||||
+};
|
||||
+
|
||||
+struct st7703_panel_desc {
|
||||
+ const struct drm_display_mode *mode;
|
||||
+ unsigned int lanes;
|
||||
+ unsigned long mode_flags;
|
||||
+ enum mipi_dsi_pixel_format format;
|
||||
+ int (*init_sequence)(struct st7703 *ctx);
|
||||
};
|
||||
|
||||
static inline struct st7703 *panel_to_st7703(struct drm_panel *panel)
|
||||
@@ -148,7 +158,7 @@ static int st7703_enable(struct drm_panel *panel)
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
int ret;
|
||||
|
||||
- ret = jh057n_init_sequence(ctx);
|
||||
+ ret = ctx->desc->init_sequence(ctx);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n",
|
||||
ret);
|
||||
@@ -216,7 +226,7 @@ static int st7703_prepare(struct drm_panel *panel)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static const struct drm_display_mode default_mode = {
|
||||
+static const struct drm_display_mode jh057n00900_mode = {
|
||||
.hdisplay = 720,
|
||||
.hsync_start = 720 + 90,
|
||||
.hsync_end = 720 + 90 + 20,
|
||||
@@ -232,17 +242,26 @@ static const struct drm_display_mode default_mode = {
|
||||
.height_mm = 130,
|
||||
};
|
||||
|
||||
+struct st7703_panel_desc jh057n00900_panel_desc = {
|
||||
+ .mode = &jh057n00900_mode,
|
||||
+ .lanes = 4,
|
||||
+ .mode_flags = MIPI_DSI_MODE_VIDEO |
|
||||
+ MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
|
||||
+ .format = MIPI_DSI_FMT_RGB888,
|
||||
+ .init_sequence = jh057n_init_sequence,
|
||||
+};
|
||||
+
|
||||
static int st7703_get_modes(struct drm_panel *panel,
|
||||
struct drm_connector *connector)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
struct drm_display_mode *mode;
|
||||
|
||||
- mode = drm_mode_duplicate(connector->dev, &default_mode);
|
||||
+ mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
|
||||
if (!mode) {
|
||||
DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n",
|
||||
- default_mode.hdisplay, default_mode.vdisplay,
|
||||
- default_mode.vrefresh);
|
||||
+ ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
|
||||
+ ctx->desc->mode->vrefresh);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -317,11 +336,11 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
|
||||
mipi_dsi_set_drvdata(dsi, ctx);
|
||||
|
||||
ctx->dev = dev;
|
||||
+ ctx->desc = of_device_get_match_data(dev);
|
||||
|
||||
- dsi->lanes = 4;
|
||||
- dsi->format = MIPI_DSI_FMT_RGB888;
|
||||
- dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
|
||||
- MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
|
||||
+ dsi->mode_flags = ctx->desc->mode_flags;
|
||||
+ dsi->format = ctx->desc->format;
|
||||
+ dsi->lanes = ctx->desc->lanes;
|
||||
|
||||
ctx->vcc = devm_regulator_get(dev, "vcc");
|
||||
if (IS_ERR(ctx->vcc)) {
|
||||
@@ -361,8 +380,8 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
|
||||
}
|
||||
|
||||
DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
|
||||
- default_mode.hdisplay, default_mode.vdisplay,
|
||||
- default_mode.vrefresh,
|
||||
+ ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
|
||||
+ ctx->desc->mode->vrefresh,
|
||||
mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
|
||||
|
||||
st7703_debugfs_init(ctx);
|
||||
@@ -405,7 +424,7 @@ static int st7703_remove(struct mipi_dsi_device *dsi)
|
||||
}
|
||||
|
||||
static const struct of_device_id st7703_of_match[] = {
|
||||
- { .compatible = "rocktech,jh057n00900" },
|
||||
+ { .compatible = "rocktech,jh057n00900", .data = &jh057n00900_panel_desc },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, st7703_of_match);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
265
0001-drm-panel-st7703-Rename-functions-from-jh057n-prefix.patch
Normal file
265
0001-drm-panel-st7703-Rename-functions-from-jh057n-prefix.patch
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:53 +0200
|
||||
Subject: [PATCH] drm/panel: st7703: Rename functions from jh057n prefix to
|
||||
st7703
|
||||
|
||||
This is done so that code that's not specific to a particular
|
||||
jh057n panel is named after the controller. Functions specific
|
||||
to the panel are kept named after the panel.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 90 ++++++++++---------
|
||||
1 file changed, 46 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index 38ff742bc120..511af659f273 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
- * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
|
||||
+ * Driver for panels based on Sitronix ST7703 controller, souch as:
|
||||
+ *
|
||||
+ * - Rocktech jh057n00900 5.5" MIPI-DSI panel
|
||||
*
|
||||
* Copyright (C) Purism SPC 2019
|
||||
*/
|
||||
@@ -21,7 +23,7 @@
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
-#define DRV_NAME "panel-rocktech-jh057n00900"
|
||||
+#define DRV_NAME "panel-sitronix-st7703"
|
||||
|
||||
/* Manufacturer specific Commands send via DSI */
|
||||
#define ST7703_CMD_ALL_PIXEL_OFF 0x22
|
||||
@@ -45,7 +47,7 @@
|
||||
#define ST7703_CMD_SETGIP1 0xE9
|
||||
#define ST7703_CMD_SETGIP2 0xEA
|
||||
|
||||
-struct jh057n {
|
||||
+struct st7703 {
|
||||
struct device *dev;
|
||||
struct drm_panel panel;
|
||||
struct gpio_desc *reset_gpio;
|
||||
@@ -56,9 +58,9 @@ struct jh057n {
|
||||
struct dentry *debugfs;
|
||||
};
|
||||
|
||||
-static inline struct jh057n *panel_to_jh057n(struct drm_panel *panel)
|
||||
+static inline struct st7703 *panel_to_st7703(struct drm_panel *panel)
|
||||
{
|
||||
- return container_of(panel, struct jh057n, panel);
|
||||
+ return container_of(panel, struct st7703, panel);
|
||||
}
|
||||
|
||||
#define dsi_generic_write_seq(dsi, seq...) do { \
|
||||
@@ -69,7 +71,7 @@ static inline struct jh057n *panel_to_jh057n(struct drm_panel *panel)
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
||||
-static int jh057n_init_sequence(struct jh057n *ctx)
|
||||
+static int jh057n_init_sequence(struct st7703 *ctx)
|
||||
{
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
struct device *dev = ctx->dev;
|
||||
@@ -141,9 +143,9 @@ static int jh057n_init_sequence(struct jh057n *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int jh057n_enable(struct drm_panel *panel)
|
||||
+static int st7703_enable(struct drm_panel *panel)
|
||||
{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct st7703 *ctx = panel_to_st7703(panel);
|
||||
int ret;
|
||||
|
||||
ret = jh057n_init_sequence(ctx);
|
||||
@@ -156,17 +158,17 @@ static int jh057n_enable(struct drm_panel *panel)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int jh057n_disable(struct drm_panel *panel)
|
||||
+static int st7703_disable(struct drm_panel *panel)
|
||||
{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct st7703 *ctx = panel_to_st7703(panel);
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
|
||||
return mipi_dsi_dcs_set_display_off(dsi);
|
||||
}
|
||||
|
||||
-static int jh057n_unprepare(struct drm_panel *panel)
|
||||
+static int st7703_unprepare(struct drm_panel *panel)
|
||||
{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct st7703 *ctx = panel_to_st7703(panel);
|
||||
|
||||
if (!ctx->prepared)
|
||||
return 0;
|
||||
@@ -178,9 +180,9 @@ static int jh057n_unprepare(struct drm_panel *panel)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int jh057n_prepare(struct drm_panel *panel)
|
||||
+static int st7703_prepare(struct drm_panel *panel)
|
||||
{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct st7703 *ctx = panel_to_st7703(panel);
|
||||
int ret;
|
||||
|
||||
if (ctx->prepared)
|
||||
@@ -230,10 +232,10 @@ static const struct drm_display_mode default_mode = {
|
||||
.height_mm = 130,
|
||||
};
|
||||
|
||||
-static int jh057n_get_modes(struct drm_panel *panel,
|
||||
+static int st7703_get_modes(struct drm_panel *panel,
|
||||
struct drm_connector *connector)
|
||||
{
|
||||
- struct jh057n *ctx = panel_to_jh057n(panel);
|
||||
+ struct st7703 *ctx = panel_to_st7703(panel);
|
||||
struct drm_display_mode *mode;
|
||||
|
||||
mode = drm_mode_duplicate(connector->dev, &default_mode);
|
||||
@@ -254,17 +256,17 @@ static int jh057n_get_modes(struct drm_panel *panel,
|
||||
return 1;
|
||||
}
|
||||
|
||||
-static const struct drm_panel_funcs jh057n_drm_funcs = {
|
||||
- .disable = jh057n_disable,
|
||||
- .unprepare = jh057n_unprepare,
|
||||
- .prepare = jh057n_prepare,
|
||||
- .enable = jh057n_enable,
|
||||
- .get_modes = jh057n_get_modes,
|
||||
+static const struct drm_panel_funcs st7703_drm_funcs = {
|
||||
+ .disable = st7703_disable,
|
||||
+ .unprepare = st7703_unprepare,
|
||||
+ .prepare = st7703_prepare,
|
||||
+ .enable = st7703_enable,
|
||||
+ .get_modes = st7703_get_modes,
|
||||
};
|
||||
|
||||
static int allpixelson_set(void *data, u64 val)
|
||||
{
|
||||
- struct jh057n *ctx = data;
|
||||
+ struct st7703 *ctx = data;
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
|
||||
DRM_DEV_DEBUG_DRIVER(ctx->dev, "Setting all pixels on\n");
|
||||
@@ -282,7 +284,7 @@ static int allpixelson_set(void *data, u64 val)
|
||||
DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
|
||||
allpixelson_set, "%llu\n");
|
||||
|
||||
-static void jh057n_debugfs_init(struct jh057n *ctx)
|
||||
+static void st7703_debugfs_init(struct st7703 *ctx)
|
||||
{
|
||||
ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
|
||||
|
||||
@@ -290,16 +292,16 @@ static void jh057n_debugfs_init(struct jh057n *ctx)
|
||||
&allpixelson_fops);
|
||||
}
|
||||
|
||||
-static void jh057n_debugfs_remove(struct jh057n *ctx)
|
||||
+static void st7703_debugfs_remove(struct st7703 *ctx)
|
||||
{
|
||||
debugfs_remove_recursive(ctx->debugfs);
|
||||
ctx->debugfs = NULL;
|
||||
}
|
||||
|
||||
-static int jh057n_probe(struct mipi_dsi_device *dsi)
|
||||
+static int st7703_probe(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
struct device *dev = &dsi->dev;
|
||||
- struct jh057n *ctx;
|
||||
+ struct st7703 *ctx;
|
||||
int ret;
|
||||
|
||||
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
@@ -340,7 +342,7 @@ static int jh057n_probe(struct mipi_dsi_device *dsi)
|
||||
return ret;
|
||||
}
|
||||
|
||||
- drm_panel_init(&ctx->panel, dev, &jh057n_drm_funcs,
|
||||
+ drm_panel_init(&ctx->panel, dev, &st7703_drm_funcs,
|
||||
DRM_MODE_CONNECTOR_DSI);
|
||||
|
||||
ret = drm_panel_of_backlight(&ctx->panel);
|
||||
@@ -363,13 +365,13 @@ static int jh057n_probe(struct mipi_dsi_device *dsi)
|
||||
default_mode.vrefresh,
|
||||
mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
|
||||
|
||||
- jh057n_debugfs_init(ctx);
|
||||
+ st7703_debugfs_init(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void jh057n_shutdown(struct mipi_dsi_device *dsi)
|
||||
+static void st7703_shutdown(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
- struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ struct st7703 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
int ret;
|
||||
|
||||
ret = drm_panel_unprepare(&ctx->panel);
|
||||
@@ -383,12 +385,12 @@ static void jh057n_shutdown(struct mipi_dsi_device *dsi)
|
||||
ret);
|
||||
}
|
||||
|
||||
-static int jh057n_remove(struct mipi_dsi_device *dsi)
|
||||
+static int st7703_remove(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
- struct jh057n *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ struct st7703 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
int ret;
|
||||
|
||||
- jh057n_shutdown(dsi);
|
||||
+ st7703_shutdown(dsi);
|
||||
|
||||
ret = mipi_dsi_detach(dsi);
|
||||
if (ret < 0)
|
||||
@@ -397,28 +399,28 @@ static int jh057n_remove(struct mipi_dsi_device *dsi)
|
||||
|
||||
drm_panel_remove(&ctx->panel);
|
||||
|
||||
- jh057n_debugfs_remove(ctx);
|
||||
+ st7703_debugfs_remove(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static const struct of_device_id jh057n_of_match[] = {
|
||||
+static const struct of_device_id st7703_of_match[] = {
|
||||
{ .compatible = "rocktech,jh057n00900" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
-MODULE_DEVICE_TABLE(of, jh057n_of_match);
|
||||
+MODULE_DEVICE_TABLE(of, st7703_of_match);
|
||||
|
||||
-static struct mipi_dsi_driver jh057n_driver = {
|
||||
- .probe = jh057n_probe,
|
||||
- .remove = jh057n_remove,
|
||||
- .shutdown = jh057n_shutdown,
|
||||
+static struct mipi_dsi_driver st7703_driver = {
|
||||
+ .probe = st7703_probe,
|
||||
+ .remove = st7703_remove,
|
||||
+ .shutdown = st7703_shutdown,
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
- .of_match_table = jh057n_of_match,
|
||||
+ .of_match_table = st7703_of_match,
|
||||
},
|
||||
};
|
||||
-module_mipi_dsi_driver(jh057n_driver);
|
||||
+module_mipi_dsi_driver(st7703_driver);
|
||||
|
||||
MODULE_AUTHOR("Guido Günther <agx@sigxcpu.org>");
|
||||
-MODULE_DESCRIPTION("DRM driver for Rocktech JH057N00900 MIPI DSI panel");
|
||||
+MODULE_DESCRIPTION("DRM driver for Sitronix ST7703 based MIPI DSI panels");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Mon, 16 Mar 2020 21:35:02 +0800
|
||||
Subject: [PATCH] drm/sun4i: sun6i_mipi_dsi: fix horizontal timing calculation
|
||||
|
||||
The max() function call in horizontal timing calculation shouldn't pad a
|
||||
length already subtracted with overhead to overhead, instead it should
|
||||
only prevent the set timing to underflow.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
||||
index aa67cb037e9d..52e009dc632b 100644
|
||||
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
||||
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
||||
@@ -556,7 +556,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HSA_PACKET_OVERHEAD 10
|
||||
hsa = max((unsigned int)HSA_PACKET_OVERHEAD,
|
||||
- (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD);
|
||||
+ (mode->hsync_end - mode->hsync_start) * Bpp) - HSA_PACKET_OVERHEAD;
|
||||
|
||||
/*
|
||||
* The backporch is set using a blanking packet (4
|
||||
@@ -565,7 +565,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HBP_PACKET_OVERHEAD 6
|
||||
hbp = max((unsigned int)HBP_PACKET_OVERHEAD,
|
||||
- (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD);
|
||||
+ (mode->htotal - mode->hsync_end) * Bpp) - HBP_PACKET_OVERHEAD;
|
||||
|
||||
/*
|
||||
* The frontporch is set using a sync event (4 bytes)
|
||||
@@ -575,7 +575,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HFP_PACKET_OVERHEAD 16
|
||||
hfp = max((unsigned int)HFP_PACKET_OVERHEAD,
|
||||
- (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD);
|
||||
+ (mode->hsync_start - mode->hdisplay) * Bpp) - HFP_PACKET_OVERHEAD;
|
||||
|
||||
/*
|
||||
* The blanking is set using a sync event (4 bytes)
|
||||
@@ -584,8 +584,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
||||
*/
|
||||
#define HBLK_PACKET_OVERHEAD 10
|
||||
hblk = max((unsigned int)HBLK_PACKET_OVERHEAD,
|
||||
- (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp -
|
||||
- HBLK_PACKET_OVERHEAD);
|
||||
+ (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp) -
|
||||
+ HBLK_PACKET_OVERHEAD;
|
||||
|
||||
/*
|
||||
* And I'm not entirely sure what vblk is about. The driver in
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:51 +0200
|
||||
Subject: [PATCH] dt-bindings: panel: Add compatible for Xingbangda XBD599
|
||||
panel
|
||||
|
||||
Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI LCD panel. It is based on
|
||||
Sitronix ST7703 LCD controller just like rocktech,jh057n00900. It is
|
||||
used in PinePhone.
|
||||
|
||||
Add a compatible for it.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
.../bindings/display/panel/rocktech,jh057n00900.yaml | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
|
||||
index f97c48550741..4d43a1b36d7c 100644
|
||||
--- a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
|
||||
+++ b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
|
||||
@@ -18,7 +18,11 @@ allOf:
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
- const: rocktech,jh057n00900
|
||||
+ enum:
|
||||
+ # Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
|
||||
+ - rocktech,jh057n00900
|
||||
+ # Xingbangda XBD599 5.99" 720x1440 TFT LCD panel
|
||||
+ - xingbangda,xbd599
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
--
|
||||
2.26.2
|
||||
|
||||
119
0001-dt-bindings-panel-Convert-rocktech-jh057n00900-to-ya.patch
Normal file
119
0001-dt-bindings-panel-Convert-rocktech-jh057n00900-to-ya.patch
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Fri, 26 Jun 2020 02:55:50 +0200
|
||||
Subject: [PATCH] dt-bindings: panel: Convert rocktech, jh057n00900 to yaml
|
||||
|
||||
Convert Rocktech MIPI DSI panel driver from txt to yaml bindings.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
.../display/panel/rocktech,jh057n00900.txt | 23 -------
|
||||
.../display/panel/rocktech,jh057n00900.yaml | 66 +++++++++++++++++++
|
||||
2 files changed, 66 insertions(+), 23 deletions(-)
|
||||
delete mode 100644 Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
|
||||
create mode 100644 Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
|
||||
deleted file mode 100644
|
||||
index a372c5d84695..000000000000
|
||||
--- a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
|
||||
+++ /dev/null
|
||||
@@ -1,23 +0,0 @@
|
||||
-Rocktech jh057n00900 5.5" 720x1440 TFT LCD panel
|
||||
-
|
||||
-Required properties:
|
||||
-- compatible: should be "rocktech,jh057n00900"
|
||||
-- reg: DSI virtual channel of the peripheral
|
||||
-- reset-gpios: panel reset gpio
|
||||
-- backlight: phandle of the backlight device attached to the panel
|
||||
-- vcc-supply: phandle of the regulator that provides the vcc supply voltage.
|
||||
-- iovcc-supply: phandle of the regulator that provides the iovcc supply
|
||||
- voltage.
|
||||
-
|
||||
-Example:
|
||||
-
|
||||
- &mipi_dsi {
|
||||
- panel@0 {
|
||||
- compatible = "rocktech,jh057n00900";
|
||||
- reg = <0>;
|
||||
- backlight = <&backlight>;
|
||||
- reset-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
|
||||
- vcc-supply = <®_2v8_p>;
|
||||
- iovcc-supply = <®_1v8_p>;
|
||||
- };
|
||||
- };
|
||||
diff --git a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
|
||||
new file mode 100644
|
||||
index 000000000000..f97c48550741
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
|
||||
@@ -0,0 +1,66 @@
|
||||
+# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/display/panel/rocktech,jh057n00900.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
|
||||
+
|
||||
+maintainers:
|
||||
+ - Ondrej Jirman <megi@xff.cz>
|
||||
+
|
||||
+description: |
|
||||
+ Rocktech JH057N00900 is a 720x1440 TFT LCD panel
|
||||
+ connected using a MIPI-DSI video interface.
|
||||
+
|
||||
+allOf:
|
||||
+ - $ref: panel-common.yaml#
|
||||
+
|
||||
+properties:
|
||||
+ compatible:
|
||||
+ const: rocktech,jh057n00900
|
||||
+
|
||||
+ reg:
|
||||
+ maxItems: 1
|
||||
+ description: DSI virtual channel
|
||||
+
|
||||
+ vcc-supply:
|
||||
+ description: Panel power supply
|
||||
+
|
||||
+ vccio-supply:
|
||||
+ description: I/O voltage supply
|
||||
+
|
||||
+ reset-gpios:
|
||||
+ description: GPIO used for the reset pin
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ backlight:
|
||||
+ description: Backlight used by the panel
|
||||
+ $ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
+
|
||||
+required:
|
||||
+ - compatible
|
||||
+ - reg
|
||||
+ - vcc-supply
|
||||
+ - vccio-supply
|
||||
+ - reset-gpios
|
||||
+
|
||||
+additionalProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ #include <dt-bindings/gpio/gpio.h>
|
||||
+
|
||||
+ dsi {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ panel@0 {
|
||||
+ compatible = "rocktech,jh057n00900";
|
||||
+ reg = <0>;
|
||||
+ vcc-supply = <®_2v8_p>;
|
||||
+ iovcc-supply = <®_1v8_p>;
|
||||
+ reset-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
|
||||
+ backlight = <&backlight>;
|
||||
+ };
|
||||
+ };
|
||||
+...
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Mon, 16 Mar 2020 21:35:00 +0800
|
||||
Subject: [PATCH] dt-bindings: panel: add binding for Xingbangda XBD599 panel
|
||||
|
||||
Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI LCD panel.
|
||||
|
||||
Add its device tree binding.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
.../display/panel/xingbangda,xbd599.yaml | 50 +++++++++++++++++++
|
||||
1 file changed, 50 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml b/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
|
||||
new file mode 100644
|
||||
index 000000000000..b27bcf11198f
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml
|
||||
@@ -0,0 +1,50 @@
|
||||
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/display/panel/xingbangda,xbd599.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: Xingbangda XBD599 5.99in MIPI-DSI LCD panel
|
||||
+
|
||||
+maintainers:
|
||||
+ - Icenowy Zheng <icenowy@aosc.io>
|
||||
+
|
||||
+allOf:
|
||||
+ - $ref: panel-common.yaml#
|
||||
+
|
||||
+properties:
|
||||
+ compatible:
|
||||
+ const: xingbangda,xbd599
|
||||
+ reg: true
|
||||
+ backlight: true
|
||||
+ reset-gpios: true
|
||||
+ vcc-supply:
|
||||
+ description: regulator that supplies the VCC voltage
|
||||
+ iovcc-supply:
|
||||
+ description: regulator that supplies the IOVCC voltage
|
||||
+
|
||||
+required:
|
||||
+ - compatible
|
||||
+ - reg
|
||||
+ - backlight
|
||||
+ - vcc-supply
|
||||
+ - iovcc-supply
|
||||
+
|
||||
+additionalProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ dsi {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ panel@0 {
|
||||
+ compatible = "xingbangda,xbd599";
|
||||
+ reg = <0>;
|
||||
+ backlight = <&backlight>;
|
||||
+ iovcc-supply = <®_dldo2>;
|
||||
+ vcc-supply = <®_ldo_io0>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+...
|
||||
--
|
||||
2.26.2
|
||||
|
||||
33
0001-dt-bindings-vendor-prefixes-Add-Xingbangda.patch
Normal file
33
0001-dt-bindings-vendor-prefixes-Add-Xingbangda.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Fri, 26 Jun 2020 02:55:49 +0200
|
||||
Subject: [PATCH] dt-bindings: vendor-prefixes: Add Xingbangda
|
||||
|
||||
Shenzhen Xingbangda Display Technology Co., Ltd is a company which
|
||||
produces LCD modules. It supplies the LCD panels for the PinePhone.
|
||||
|
||||
Add the vendor prefix of it.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
Acked-by: Rob Herring <robh@kernel.org>
|
||||
---
|
||||
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
|
||||
index 9aeab66be85f..740b116b179f 100644
|
||||
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
|
||||
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
|
||||
@@ -1157,6 +1157,8 @@ patternProperties:
|
||||
description: Xiaomi Technology Co., Ltd.
|
||||
"^xillybus,.*":
|
||||
description: Xillybus Ltd.
|
||||
+ "^xingbangda,.*":
|
||||
+ description: Shenzhen Xingbangda Display Technology Co., Ltd
|
||||
"^xinpeng,.*":
|
||||
description: Shenzhen Xinpeng Technology Co., Ltd
|
||||
"^xlnx,.*":
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aaron Ma <aaron.ma@canonical.com>
|
||||
Date: Tue, 24 Mar 2020 03:16:39 +0800
|
||||
Subject: [PATCH] e1000e: bump up timeout to wait when ME un-configure ULP mode
|
||||
|
||||
ME takes 2+ seconds to un-configure ULP mode done after resume
|
||||
from s2idle on some ThinkPad laptops.
|
||||
Without enough wait, reset and re-init will fail with error.
|
||||
|
||||
Fixes: f15bb6dde738cc8fa0 ("e1000e: Add support for S0ix")
|
||||
BugLink: https://bugs.launchpad.net/bugs/1865570
|
||||
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
|
||||
---
|
||||
drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||
index 489bb5b59475..26bb39b62956 100644
|
||||
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||
@@ -1245,9 +1245,9 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
|
||||
ew32(H2ME, mac_reg);
|
||||
}
|
||||
|
||||
- /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */
|
||||
+ /* Poll up to 2.5sec for ME to clear ULP_CFG_DONE. */
|
||||
while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) {
|
||||
- if (i++ == 30) {
|
||||
+ if (i++ == 250) {
|
||||
ret_val = -E1000_ERR_PHY;
|
||||
goto out;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
161
0001-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch
Normal file
161
0001-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: David Howells <dhowells@redhat.com>
|
||||
Date: Tue, 27 Feb 2018 10:04:55 +0000
|
||||
Subject: [PATCH] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode
|
||||
|
||||
UEFI machines can be booted in Secure Boot mode. Add an EFI_SECURE_BOOT
|
||||
flag that can be passed to efi_enabled() to find out whether secure boot is
|
||||
enabled.
|
||||
|
||||
Move the switch-statement in x86's setup_arch() that inteprets the
|
||||
secure_boot boot parameter to generic code and set the bit there.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Signed-off-by: David Howells <dhowells@redhat.com>
|
||||
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
cc: linux-efi@vger.kernel.org
|
||||
[Rebased for context; efi_is_table_address was moved to arch/x86]
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
arch/x86/kernel/setup.c | 14 +-----------
|
||||
drivers/firmware/efi/Makefile | 1 +
|
||||
drivers/firmware/efi/secureboot.c | 38 +++++++++++++++++++++++++++++++
|
||||
include/linux/efi.h | 18 ++++++++++-----
|
||||
4 files changed, 52 insertions(+), 19 deletions(-)
|
||||
create mode 100644 drivers/firmware/efi/secureboot.c
|
||||
|
||||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
|
||||
index a1b8cb9a2579..28d43754aeb6 100644
|
||||
--- a/arch/x86/kernel/setup.c
|
||||
+++ b/arch/x86/kernel/setup.c
|
||||
@@ -1256,19 +1256,7 @@ void __init setup_arch(char **cmdline_p)
|
||||
/* Allocate bigger log buffer */
|
||||
setup_log_buf(1);
|
||||
|
||||
- if (efi_enabled(EFI_BOOT)) {
|
||||
- switch (boot_params.secure_boot) {
|
||||
- case efi_secureboot_mode_disabled:
|
||||
- pr_info("Secure boot disabled\n");
|
||||
- break;
|
||||
- case efi_secureboot_mode_enabled:
|
||||
- pr_info("Secure boot enabled\n");
|
||||
- break;
|
||||
- default:
|
||||
- pr_info("Secure boot could not be determined\n");
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
+ efi_set_secure_boot(boot_params.secure_boot);
|
||||
|
||||
reserve_initrd();
|
||||
|
||||
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
|
||||
index 7a216984552b..f0ef02d733af 100644
|
||||
--- a/drivers/firmware/efi/Makefile
|
||||
+++ b/drivers/firmware/efi/Makefile
|
||||
@@ -25,6 +25,7 @@ obj-$(CONFIG_EFI_FAKE_MEMMAP) += fake_map.o
|
||||
obj-$(CONFIG_EFI_BOOTLOADER_CONTROL) += efibc.o
|
||||
obj-$(CONFIG_EFI_TEST) += test/
|
||||
obj-$(CONFIG_EFI_DEV_PATH_PARSER) += dev-path-parser.o
|
||||
+obj-$(CONFIG_EFI) += secureboot.o
|
||||
obj-$(CONFIG_APPLE_PROPERTIES) += apple-properties.o
|
||||
obj-$(CONFIG_EFI_RCI2_TABLE) += rci2-table.o
|
||||
obj-$(CONFIG_EFI_EMBEDDED_FIRMWARE) += embedded-firmware.o
|
||||
diff --git a/drivers/firmware/efi/secureboot.c b/drivers/firmware/efi/secureboot.c
|
||||
new file mode 100644
|
||||
index 000000000000..de0a3714a5d4
|
||||
--- /dev/null
|
||||
+++ b/drivers/firmware/efi/secureboot.c
|
||||
@@ -0,0 +1,38 @@
|
||||
+/* Core kernel secure boot support.
|
||||
+ *
|
||||
+ * Copyright (C) 2017 Red Hat, Inc. All Rights Reserved.
|
||||
+ * Written by David Howells (dhowells@redhat.com)
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public Licence
|
||||
+ * as published by the Free Software Foundation; either version
|
||||
+ * 2 of the Licence, or (at your option) any later version.
|
||||
+ */
|
||||
+
|
||||
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
+
|
||||
+#include <linux/efi.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/printk.h>
|
||||
+
|
||||
+/*
|
||||
+ * Decide what to do when UEFI secure boot mode is enabled.
|
||||
+ */
|
||||
+void __init efi_set_secure_boot(enum efi_secureboot_mode mode)
|
||||
+{
|
||||
+ if (efi_enabled(EFI_BOOT)) {
|
||||
+ switch (mode) {
|
||||
+ case efi_secureboot_mode_disabled:
|
||||
+ pr_info("Secure boot disabled\n");
|
||||
+ break;
|
||||
+ case efi_secureboot_mode_enabled:
|
||||
+ set_bit(EFI_SECURE_BOOT, &efi.flags);
|
||||
+ pr_info("Secure boot enabled\n");
|
||||
+ break;
|
||||
+ default:
|
||||
+ pr_warn("Secure boot could not be determined (mode %u)\n",
|
||||
+ mode);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/include/linux/efi.h b/include/linux/efi.h
|
||||
index 2e2f9f608f68..6f5b3b019d3e 100644
|
||||
--- a/include/linux/efi.h
|
||||
+++ b/include/linux/efi.h
|
||||
@@ -781,6 +781,14 @@ extern int __init efi_setup_pcdp_console(char *);
|
||||
#define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
|
||||
#define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */
|
||||
#define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */
|
||||
+#define EFI_SECURE_BOOT 13 /* Are we in Secure Boot mode? */
|
||||
+
|
||||
+enum efi_secureboot_mode {
|
||||
+ efi_secureboot_mode_unset,
|
||||
+ efi_secureboot_mode_unknown,
|
||||
+ efi_secureboot_mode_disabled,
|
||||
+ efi_secureboot_mode_enabled,
|
||||
+};
|
||||
|
||||
#ifdef CONFIG_EFI
|
||||
/*
|
||||
@@ -792,6 +800,8 @@ static inline bool efi_enabled(int feature)
|
||||
}
|
||||
extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
|
||||
|
||||
+extern void __init efi_set_secure_boot(enum efi_secureboot_mode mode);
|
||||
+
|
||||
bool __pure __efi_soft_reserve_enabled(void);
|
||||
|
||||
static inline bool __pure efi_soft_reserve_enabled(void)
|
||||
@@ -818,6 +828,8 @@ efi_capsule_pending(int *reset_type)
|
||||
return false;
|
||||
}
|
||||
|
||||
+static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
|
||||
+
|
||||
static inline bool efi_soft_reserve_enabled(void)
|
||||
{
|
||||
return false;
|
||||
@@ -1090,12 +1102,6 @@ static inline bool efi_runtime_disabled(void) { return true; }
|
||||
extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
|
||||
extern unsigned long efi_call_virt_save_flags(void);
|
||||
|
||||
-enum efi_secureboot_mode {
|
||||
- efi_secureboot_mode_unset,
|
||||
- efi_secureboot_mode_unknown,
|
||||
- efi_secureboot_mode_disabled,
|
||||
- efi_secureboot_mode_enabled,
|
||||
-};
|
||||
enum efi_secureboot_mode efi_get_secureboot(void);
|
||||
|
||||
#ifdef CONFIG_RESET_ATTACK_MITIGATION
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: David Howells <dhowells@redhat.com>
|
||||
Date: Mon, 30 Sep 2019 21:28:16 +0000
|
||||
Subject: [PATCH] efi: Lock down the kernel if booted in secure boot mode
|
||||
|
||||
UEFI Secure Boot provides a mechanism for ensuring that the firmware
|
||||
will only load signed bootloaders and kernels. Certain use cases may
|
||||
also require that all kernel modules also be signed. Add a
|
||||
configuration option that to lock down the kernel - which includes
|
||||
requiring validly signed modules - if the kernel is secure-booted.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: David Howells <dhowells@redhat.com>
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
arch/x86/kernel/setup.c | 8 ++++++++
|
||||
security/lockdown/Kconfig | 13 +++++++++++++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
|
||||
index 28d43754aeb6..19d57bfc12f9 100644
|
||||
--- a/arch/x86/kernel/setup.c
|
||||
+++ b/arch/x86/kernel/setup.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/sfi.h>
|
||||
#include <linux/hugetlb.h>
|
||||
#include <linux/tboot.h>
|
||||
+#include <linux/security.h>
|
||||
#include <linux/usb/xhci-dbgp.h>
|
||||
|
||||
#include <uapi/linux/mount.h>
|
||||
@@ -1105,6 +1106,13 @@ void __init setup_arch(char **cmdline_p)
|
||||
if (efi_enabled(EFI_BOOT))
|
||||
efi_init();
|
||||
|
||||
+ efi_set_secure_boot(boot_params.secure_boot);
|
||||
+
|
||||
+#ifdef CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT
|
||||
+ if (efi_enabled(EFI_SECURE_BOOT))
|
||||
+ security_lock_kernel_down("EFI Secure Boot mode", LOCKDOWN_INTEGRITY_MAX);
|
||||
+#endif
|
||||
+
|
||||
dmi_setup();
|
||||
|
||||
/*
|
||||
diff --git a/security/lockdown/Kconfig b/security/lockdown/Kconfig
|
||||
index e84ddf484010..d0501353a4b9 100644
|
||||
--- a/security/lockdown/Kconfig
|
||||
+++ b/security/lockdown/Kconfig
|
||||
@@ -16,6 +16,19 @@ config SECURITY_LOCKDOWN_LSM_EARLY
|
||||
subsystem is fully initialised. If enabled, lockdown will
|
||||
unconditionally be called before any other LSMs.
|
||||
|
||||
+config LOCK_DOWN_IN_EFI_SECURE_BOOT
|
||||
+ bool "Lock down the kernel in EFI Secure Boot mode"
|
||||
+ default n
|
||||
+ depends on EFI && SECURITY_LOCKDOWN_LSM_EARLY
|
||||
+ help
|
||||
+ UEFI Secure Boot provides a mechanism for ensuring that the firmware
|
||||
+ will only load signed bootloaders and kernels. Secure boot mode may
|
||||
+ be determined from EFI variables provided by the system firmware if
|
||||
+ not indicated by the boot parameters.
|
||||
+
|
||||
+ Enabling this option results in kernel lockdown being triggered if
|
||||
+ EFI Secure Boot is set.
|
||||
+
|
||||
choice
|
||||
prompt "Kernel default lockdown mode"
|
||||
default LOCK_DOWN_KERNEL_FORCE_NONE
|
||||
--
|
||||
2.26.2
|
||||
|
||||
98
0001-iommu-arm-smmu-workaround-DMA-mode-issues.patch
Normal file
98
0001-iommu-arm-smmu-workaround-DMA-mode-issues.patch
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Laura Abbott <labbott@redhat.com>
|
||||
Date: Mon, 20 May 2019 22:21:02 -0400
|
||||
Subject: [PATCH] iommu/arm-smmu: workaround DMA mode issues
|
||||
|
||||
Message-id: <20190520222102.19488-1-labbott@redhat.com>
|
||||
Patchwork-id: 259215
|
||||
O-Subject: [ARK INTERNAL PATCH] iommu/arm-smmu: workaround DMA mode issues
|
||||
Bugzilla:
|
||||
RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
|
||||
RH-Acked-by: Mark Salter <msalter@redhat.com>
|
||||
|
||||
From: Mark Salter <msalter@redhat.com>
|
||||
|
||||
Rebased for v5.2-rc1
|
||||
|
||||
Bugzilla: 1652259
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19244562
|
||||
Upstream status: RHEL only.
|
||||
|
||||
rhel8 commit 65feb1ed0ec9a088a63a90d46c0f7563ac96ad0f
|
||||
Author: Mark Salter <msalter@redhat.com>
|
||||
Date: Wed Nov 21 17:15:59 2018 +0100
|
||||
|
||||
[iommu] iommu/arm-smmu: workaround DMA mode issues
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1624077
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=18112820
|
||||
Testing: Verified iommu.passthrough=1 no longer needed on gigabyte platforms.
|
||||
Upstream Status: RHEL-only
|
||||
|
||||
In RHEL_ALT 7.5 we carried a RHEL-only patch which forced the arm smmuv2
|
||||
into bypass mode due to performance issues on CN88xx. This was intended
|
||||
to be a temporary hack until the issues were resolved. Another vendor
|
||||
had issues with the iommu in bypass mode so we reverted the RHEL-only
|
||||
patch so that iommu is in DMA mode by default (upstream default).
|
||||
|
||||
It turns on that there are remaining SMMU DMA mode issues on Gigabyte
|
||||
platformws with CN88xx cpus. The problem manifests itself by pcie
|
||||
card drivers failing to initialize the cards when SMMU is in DMA mode.
|
||||
The root cause has not been determined yet, but looks likely to be
|
||||
a hw or firmware issue. This patch forces bypass mode for Gigabyte
|
||||
platforms. CN88xx isn't officially supported in RHEL but we have a
|
||||
lot of them being used internally for testing, so I think we want
|
||||
this to support that use case in RHEL8.
|
||||
|
||||
Signed-off-by: Mark Salter <msalter@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
|
||||
Acked-by: Mark Salter <msalter@redhat.com>
|
||||
Acked-by: Donald Dutile <ddutile@redhat.com>
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Laura Abbott <labbott@redhat.com>
|
||||
---
|
||||
drivers/iommu/iommu.c | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
|
||||
index b6858adc4f17..4c2da9f17514 100644
|
||||
--- a/drivers/iommu/iommu.c
|
||||
+++ b/drivers/iommu/iommu.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#define pr_fmt(fmt) "iommu: " fmt
|
||||
|
||||
#include <linux/device.h>
|
||||
+#include <linux/dmi.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/types.h>
|
||||
@@ -2838,3 +2839,24 @@ int iommu_sva_get_pasid(struct iommu_sva *handle)
|
||||
return ops->sva_get_pasid(handle);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iommu_sva_get_pasid);
|
||||
+
|
||||
+#ifdef CONFIG_ARM64
|
||||
+static int __init iommu_quirks(void)
|
||||
+{
|
||||
+ const char *vendor, *name;
|
||||
+
|
||||
+ vendor = dmi_get_system_info(DMI_SYS_VENDOR);
|
||||
+ name = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
+
|
||||
+ if (vendor &&
|
||||
+ (strncmp(vendor, "GIGABYTE", 8) == 0 && name &&
|
||||
+ (strncmp(name, "R120", 4) == 0 ||
|
||||
+ strncmp(name, "R270", 4) == 0))) {
|
||||
+ pr_warn("Gigabyte %s detected, force iommu passthrough mode", name);
|
||||
+ iommu_def_domain_type = IOMMU_DOMAIN_IDENTITY;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+arch_initcall(iommu_quirks);
|
||||
+#endif
|
||||
--
|
||||
2.26.2
|
||||
|
||||
123
0001-ipmi-do-not-configure-ipmi-for-HPE-m400.patch
Normal file
123
0001-ipmi-do-not-configure-ipmi-for-HPE-m400.patch
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Laura Abbott <labbott@redhat.com>
|
||||
Date: Sun, 10 Feb 2019 01:27:54 +0000
|
||||
Subject: [PATCH] ipmi: do not configure ipmi for HPE m400
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1670017
|
||||
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20147017
|
||||
|
||||
Commit 913a89f009d9 ("ipmi: Don't initialize anything in the core until
|
||||
something uses it") added new locking which broke context.
|
||||
|
||||
Message-id: <20180713142210.15700-1-tcamuso@redhat.com>
|
||||
Patchwork-id: 224899
|
||||
O-Subject: [RHEL8 BZ 1583537 1/1] ipmi: do not configure ipmi for HPE m400
|
||||
Bugzilla: 1583537
|
||||
RH-Acked-by: Dean Nelson <dnelson@redhat.com>
|
||||
RH-Acked-by: Al Stone <ahs3@redhat.com>
|
||||
RH-Acked-by: Mark Salter <msalter@redhat.com>
|
||||
|
||||
bugzilla:https://bugzilla.redhat.com/show_bug.cgi?id=1583537
|
||||
brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17150528
|
||||
|
||||
RHEL-only
|
||||
|
||||
The ARM-based HPE m400 reports host-side ipmi as residing in intel
|
||||
port-io space, which does not exist in ARM processors. Therefore, when
|
||||
running on an m400, host-side ipmi configuration code must simply return
|
||||
zero without trying to configure the host-side ipmi.
|
||||
|
||||
This patch prevents panic on boot by averting attempts to configure
|
||||
host-side ipmi on this platform.
|
||||
|
||||
Though HPE m400 is not certified with RHEL, and HPE has relegated it to
|
||||
EOL status, the platform is still used extensively in ARM development
|
||||
and test for RHEL.
|
||||
|
||||
Testing:
|
||||
Boot without blacklisting ipmi and check to see that no ipmi modules
|
||||
are loaded.
|
||||
|
||||
Signed-off-by: Tony Camuso <tcamuso@redhat.com>
|
||||
|
||||
cc: Prarit Bhargava <prarit@redhat.com>
|
||||
cc: Brendan Conoboy <blc@redhat.com>
|
||||
cc: Jeff Bastian <jbastian@redhat.com>
|
||||
cc: Scott Herold <sherold@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Laura Abbott <labbott@redhat.com>
|
||||
Acked-by: Tony Camuso <tcamuso@redhat.com>
|
||||
Acked-by: Dean Nelson <dnelson@redhat.com>
|
||||
Acked-by: Jarod Wilson <jarod@redhat.com>
|
||||
Acked-by: Mark Salter <msalter@redhat.com>
|
||||
---
|
||||
drivers/char/ipmi/ipmi_dmi.c | 15 +++++++++++++++
|
||||
drivers/char/ipmi/ipmi_msghandler.c | 16 +++++++++++++++-
|
||||
2 files changed, 30 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/char/ipmi/ipmi_dmi.c b/drivers/char/ipmi/ipmi_dmi.c
|
||||
index bbf7029e224b..cf7faa970dd6 100644
|
||||
--- a/drivers/char/ipmi/ipmi_dmi.c
|
||||
+++ b/drivers/char/ipmi/ipmi_dmi.c
|
||||
@@ -215,6 +215,21 @@ static int __init scan_for_dmi_ipmi(void)
|
||||
{
|
||||
const struct dmi_device *dev = NULL;
|
||||
|
||||
+#ifdef CONFIG_ARM64
|
||||
+ /* RHEL-only
|
||||
+ * If this is ARM-based HPE m400, return now, because that platform
|
||||
+ * reports the host-side ipmi address as intel port-io space, which
|
||||
+ * does not exist in the ARM architecture.
|
||||
+ */
|
||||
+ const char *dmistr = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
+
|
||||
+ if (dmistr && (strcmp("ProLiant m400 Server", dmistr) == 0)) {
|
||||
+ pr_debug("%s does not support host ipmi\n", dmistr);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ /* END RHEL-only */
|
||||
+#endif
|
||||
+
|
||||
while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev)))
|
||||
dmi_decode_ipmi((const struct dmi_header *) dev->device_data);
|
||||
|
||||
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
|
||||
index e1b22fe0916c..894eda427214 100644
|
||||
--- a/drivers/char/ipmi/ipmi_msghandler.c
|
||||
+++ b/drivers/char/ipmi/ipmi_msghandler.c
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <linux/uuid.h>
|
||||
#include <linux/nospec.h>
|
||||
#include <linux/vmalloc.h>
|
||||
+#include <linux/dmi.h>
|
||||
|
||||
#define IPMI_DRIVER_VERSION "39.2"
|
||||
|
||||
@@ -5155,8 +5156,21 @@ static int __init ipmi_init_msghandler_mod(void)
|
||||
{
|
||||
int rv;
|
||||
|
||||
- pr_info("version " IPMI_DRIVER_VERSION "\n");
|
||||
+#ifdef CONFIG_ARM64
|
||||
+ /* RHEL-only
|
||||
+ * If this is ARM-based HPE m400, return now, because that platform
|
||||
+ * reports the host-side ipmi address as intel port-io space, which
|
||||
+ * does not exist in the ARM architecture.
|
||||
+ */
|
||||
+ const char *dmistr = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
|
||||
+ if (dmistr && (strcmp("ProLiant m400 Server", dmistr) == 0)) {
|
||||
+ pr_debug("%s does not support host ipmi\n", dmistr);
|
||||
+ return -ENOSYS;
|
||||
+ }
|
||||
+ /* END RHEL-only */
|
||||
+#endif
|
||||
+ pr_info("version " IPMI_DRIVER_VERSION "\n");
|
||||
mutex_lock(&ipmi_interfaces_mutex);
|
||||
rv = ipmi_register_driver();
|
||||
mutex_unlock(&ipmi_interfaces_mutex);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
189
0001-kdump-add-support-for-crashkernel-auto.patch
Normal file
189
0001-kdump-add-support-for-crashkernel-auto.patch
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Cline <jcline@redhat.com>
|
||||
Date: Tue, 23 Jul 2019 15:24:30 +0000
|
||||
Subject: [PATCH] kdump: add support for crashkernel=auto
|
||||
|
||||
Rebased for v5.3-rc1 because the documentation has moved.
|
||||
|
||||
Message-id: <20180604013831.574215750@redhat.com>
|
||||
Patchwork-id: 8166
|
||||
O-Subject: [kernel team] [PATCH RHEL8.0 V2 2/2] kdump: add support for crashkernel=auto
|
||||
Bugzilla: 1507353
|
||||
RH-Acked-by: Don Zickus <dzickus@redhat.com>
|
||||
RH-Acked-by: Baoquan He <bhe@redhat.com>
|
||||
RH-Acked-by: Pingfan Liu <piliu@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1507353
|
||||
Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16534135
|
||||
Tested: ppc64le, x86_64 with several memory sizes.
|
||||
kdump qe tested 160M on various x86 machines in lab.
|
||||
|
||||
We continue to provide crashkernel=auto like we did in RHEL6
|
||||
and RHEL7, this will simplify the kdump deployment for common
|
||||
use cases that kdump just works with the auto reserved values.
|
||||
But this is still a best effort estimation, we can not know the
|
||||
exact memory requirement because it depends on a lot of different
|
||||
factors.
|
||||
|
||||
The implementation of crashkernel=auto is simplified as a wrapper
|
||||
to use below kernel cmdline:
|
||||
x86_64: crashkernel=1G-64G:160M,64G-1T:256M,1T-:512M
|
||||
s390x: crashkernel=4G-64G:160M,64G-1T:256M,1T-:512M
|
||||
arm64: crashkernel=2G-:512M
|
||||
ppc64: crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G
|
||||
|
||||
The difference between this way and the old implementation in
|
||||
RHEL6/7 is we do not scale the crash reserved memory size according
|
||||
to system memory size anymore.
|
||||
|
||||
Latest effort to move upstream is below thread:
|
||||
https://lkml.org/lkml/2018/5/20/262
|
||||
But unfortunately it is still unlikely to be accepted, thus we
|
||||
will still use a RHEL only patch in RHEL8.
|
||||
|
||||
Copied old patch description about the history reason see below:
|
||||
'''
|
||||
Non-upstream explanations:
|
||||
Besides "crashkenrel=X@Y" format, upstream also has advanced
|
||||
"crashkernel=range1:size1[,range2:size2,...][@offset]", and
|
||||
"crashkernel=X,high{low}" formats, but they need more careful
|
||||
manual configuration, and have different values for different
|
||||
architectures.
|
||||
|
||||
Most of the distributions use the standard "crashkernel=X@Y"
|
||||
upstream format, and use crashkernel range format for advanced
|
||||
scenarios, heavily relying on the user's involvement.
|
||||
|
||||
While "crashkernel=auto" is redhat's special feature, it exists
|
||||
and has been used as the default boot cmdline since 2008 rhel6.
|
||||
It does not require users to figure out how many crash memory
|
||||
size for their systems, also has been proved to be able to work
|
||||
pretty well for common scenarios.
|
||||
|
||||
"crashkernel=auto" was tested/based on rhel-related products, as
|
||||
we have stable kernel configurations which means more or less
|
||||
stable memory consumption. In 2014 we tried to post them again to
|
||||
upstream but NACKed by people because they think it's not general
|
||||
and unnecessary, users can specify their own values or do that by
|
||||
scripts. However our customers insist on having it added to rhel.
|
||||
|
||||
Also see one previous discussion related to this backport to Pegas:
|
||||
On 10/17/2016 at 10:15 PM, Don Zickus wrote:
|
||||
> On Fri, Oct 14, 2016 at 10:57:41AM +0800, Dave Young wrote:
|
||||
>> Don, agree with you we should evaluate them instead of just inherit
|
||||
>> them blindly. Below is what I think about kdump auto memory:
|
||||
>> There are two issues for crashkernel=auto in upstream:
|
||||
>> 1) It will be seen as a policy which should not go to kernel
|
||||
>> 2) It is hard to get a good number for the crash reserved size,
|
||||
>> considering various different kernel config options one can setups.
|
||||
>> In RHEL we are easier because our supported Kconfig is limited.
|
||||
>> I digged the upstream mail archive, but I'm not sure I got all the
|
||||
>> information, at least Michael Ellerman was objecting the series for
|
||||
>> 1).
|
||||
> Yes, I know. Vivek and I have argued about this for years. :-)
|
||||
>
|
||||
> I had hoped all the changes internally to the makedumpfile would allow
|
||||
> the memory configuration to stabilize at a number like 192M or 128M and
|
||||
> only in the rare cases extend beyond that.
|
||||
>
|
||||
> So I always treated that as a temporary hack until things were better.
|
||||
> With the hope of every new RHEL release we get smarter and better. :-)
|
||||
> Ideally it would be great if we could get the number down to 64M for most
|
||||
> cases and just turn it on in Fedora. Maybe someday.... ;-)
|
||||
>
|
||||
> We can have this conversation when the patch gets reposted/refreshed
|
||||
> for upstream on rhkl?
|
||||
>
|
||||
> Cheers,
|
||||
> Don
|
||||
|
||||
We had proposed to drop the historic crashkernel=auto code and move
|
||||
to use crashkernel=range:size format and pass them in anaconda.
|
||||
|
||||
The initial reason is crashkernel=range:size works just fine because
|
||||
we do not need complex algorithm to scale crashkernel reserved size
|
||||
any more. The old linear scaling is mainly for old makedumpfile
|
||||
requirements, now it is not necessary.
|
||||
|
||||
But With the new approach, backward compatibility is potentially at risk.
|
||||
For e.g. let's consider the following cases:
|
||||
1) When we upgrade from an older distribution like rhel-alt-7.4(which
|
||||
uses crashkernel=auto) to rhel-alt-7.5 (which uses the crashkernel=xY
|
||||
format)
|
||||
In this case we can use anaconda scripts for checking
|
||||
'crashkernel=auto' in kernel spec and update to the new
|
||||
'crashkernel=range:size' format.
|
||||
2) When we upgrade from rhel-alt-7.5(which uses crashkernel=xY format)
|
||||
to rhel-alt-7.6(which uses crashkernel=xY format), but the x and/or Y
|
||||
values are changed in rhel-alt-7.6.
|
||||
For example from crashkernel=2G-:160M to crashkernel=2G-:192M, then we have
|
||||
no way to determine if the X and/or Y values were distribution
|
||||
provided or user specified ones.
|
||||
Since it is recommended to give precedence to user-specified values,
|
||||
so we cannot do an upgrade in such a case."
|
||||
|
||||
Thus turn back to resolve it in kernel, and add a simpler version
|
||||
which just hacks to use the range:size style in code, and make
|
||||
rhel-only code easily to maintain.
|
||||
'''
|
||||
|
||||
Signed-off-by: Dave Young <dyoung@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
Documentation/admin-guide/kdump/kdump.rst | 11 +++++++++++
|
||||
kernel/crash_core.c | 14 ++++++++++++++
|
||||
2 files changed, 25 insertions(+)
|
||||
|
||||
diff --git a/Documentation/admin-guide/kdump/kdump.rst b/Documentation/admin-guide/kdump/kdump.rst
|
||||
index 2da65fef2a1c..d53a524f80f0 100644
|
||||
--- a/Documentation/admin-guide/kdump/kdump.rst
|
||||
+++ b/Documentation/admin-guide/kdump/kdump.rst
|
||||
@@ -285,6 +285,17 @@ This would mean:
|
||||
2) if the RAM size is between 512M and 2G (exclusive), then reserve 64M
|
||||
3) if the RAM size is larger than 2G, then reserve 128M
|
||||
|
||||
+Or you can use crashkernel=auto if you have enough memory. The threshold
|
||||
+is 2G on x86_64, arm64, ppc64 and ppc64le. The threshold is 4G for s390x.
|
||||
+If your system memory is less than the threshold crashkernel=auto will not
|
||||
+reserve memory.
|
||||
+
|
||||
+The automatically reserved memory size varies based on architecture.
|
||||
+The size changes according to system memory size like below:
|
||||
+ x86_64: 1G-64G:160M,64G-1T:256M,1T-:512M
|
||||
+ s390x: 4G-64G:160M,64G-1T:256M,1T-:512M
|
||||
+ arm64: 2G-:512M
|
||||
+ ppc64: 2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G
|
||||
|
||||
|
||||
Boot into System Kernel
|
||||
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
|
||||
index d631d22089ba..c252221b2f4b 100644
|
||||
--- a/kernel/crash_core.c
|
||||
+++ b/kernel/crash_core.c
|
||||
@@ -258,6 +258,20 @@ static int __init __parse_crashkernel(char *cmdline,
|
||||
if (suffix)
|
||||
return parse_crashkernel_suffix(ck_cmdline, crash_size,
|
||||
suffix);
|
||||
+
|
||||
+ if (strncmp(ck_cmdline, "auto", 4) == 0) {
|
||||
+#ifdef CONFIG_X86_64
|
||||
+ ck_cmdline = "1G-64G:160M,64G-1T:256M,1T-:512M";
|
||||
+#elif defined(CONFIG_S390)
|
||||
+ ck_cmdline = "4G-64G:160M,64G-1T:256M,1T-:512M";
|
||||
+#elif defined(CONFIG_ARM64)
|
||||
+ ck_cmdline = "2G-:512M";
|
||||
+#elif defined(CONFIG_PPC64)
|
||||
+ ck_cmdline = "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G";
|
||||
+#endif
|
||||
+ pr_info("Using crashkernel=auto, the size choosed is a best effort estimation.\n");
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* if the commandline contains a ':', then that's the extended
|
||||
* syntax -- if not, it must be the classic syntax
|
||||
--
|
||||
2.26.2
|
||||
|
||||
43
0001-kdump-fix-a-grammar-issue-in-a-kernel-message.patch
Normal file
43
0001-kdump-fix-a-grammar-issue-in-a-kernel-message.patch
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Young <dyoung@redhat.com>
|
||||
Date: Tue, 12 Jun 2018 00:54:22 -0400
|
||||
Subject: [PATCH] kdump: fix a grammar issue in a kernel message
|
||||
|
||||
Message-id: <20180612005422.GA2568@dhcp-128-65.nay.redhat.com>
|
||||
Patchwork-id: 8201
|
||||
O-Subject: [kernel team] [RHEL8.0 PATCH V2] kdump: fix a grammar issue in a kernel message
|
||||
Bugzilla: 1507353
|
||||
RH-Acked-by: Myron Stowe <mstowe@redhat.com>
|
||||
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
||||
RH-Acked-by: Jiri Benc <jbenc@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1507353
|
||||
Upstream Status: RHEL-only as crashkernel=auto is not accepted in upstream
|
||||
Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16661950
|
||||
Test: verified on a kvm guest
|
||||
|
||||
s/choosed/chosen
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Dave Young <dyoung@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
kernel/crash_core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
|
||||
index c252221b2f4b..df551fc9034c 100644
|
||||
--- a/kernel/crash_core.c
|
||||
+++ b/kernel/crash_core.c
|
||||
@@ -269,7 +269,7 @@ static int __init __parse_crashkernel(char *cmdline,
|
||||
#elif defined(CONFIG_PPC64)
|
||||
ck_cmdline = "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G";
|
||||
#endif
|
||||
- pr_info("Using crashkernel=auto, the size choosed is a best effort estimation.\n");
|
||||
+ pr_info("Using crashkernel=auto, the size chosen is a best effort estimation.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Young <dyoung@redhat.com>
|
||||
Date: Mon, 4 Jun 2018 01:38:25 -0400
|
||||
Subject: [PATCH] kdump: round up the total memory size to 128M for crashkernel
|
||||
reservation
|
||||
|
||||
Message-id: <20180604013831.523644967@redhat.com>
|
||||
Patchwork-id: 8165
|
||||
O-Subject: [kernel team] [PATCH RHEL8.0 V2 1/2] kdump: round up the total memory size to 128M for crashkernel reservation
|
||||
Bugzilla: 1507353
|
||||
RH-Acked-by: Don Zickus <dzickus@redhat.com>
|
||||
RH-Acked-by: Baoquan He <bhe@redhat.com>
|
||||
RH-Acked-by: Pingfan Liu <piliu@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1507353
|
||||
Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16534135
|
||||
Tested: ppc64le, x86_64 with several memory sizes.
|
||||
|
||||
The total memory size we get in kernel is usually slightly less than 2G with
|
||||
2G memory module machine. The main reason is bios/firmware reserve some area
|
||||
it will not export all memory as usable to Linux.
|
||||
|
||||
2G memory X86 kvm guest test result of the total_mem value:
|
||||
UEFI boot with ovmf: 0x7ef10000
|
||||
Legacy boot kvm guest: 0x7ff7cc00
|
||||
This is also a problem on arm64 UEFI booted system according to my test.
|
||||
|
||||
Thus for example crashkernel=1G-2G:128M, if we have a 1G memory
|
||||
machine, we get total size 1023M from firmware then it will not fall
|
||||
into 1G-2G thus no memory reserved. User will never know that, it is
|
||||
hard to let user to know the exact total value we get in kernel
|
||||
|
||||
An option is to use dmi/smbios to get physical memory size, but it's not
|
||||
reliable as well. According to Prarit hardware vendors sometimes screw this up.
|
||||
Thus round up total size to 128M to workaround this problem.
|
||||
|
||||
Posted below patch in upstream, but no response yet:
|
||||
http://lists.infradead.org/pipermail/kexec/2018-April/020568.html
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Dave Young <dyoung@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
kernel/crash_core.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
|
||||
index 9f1557b98468..d631d22089ba 100644
|
||||
--- a/kernel/crash_core.c
|
||||
+++ b/kernel/crash_core.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/crash_core.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/vmalloc.h>
|
||||
+#include <linux/sizes.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/sections.h>
|
||||
@@ -39,6 +40,15 @@ static int __init parse_crashkernel_mem(char *cmdline,
|
||||
unsigned long long *crash_base)
|
||||
{
|
||||
char *cur = cmdline, *tmp;
|
||||
+ unsigned long long total_mem = system_ram;
|
||||
+
|
||||
+ /*
|
||||
+ * Firmware sometimes reserves some memory regions for it's own use.
|
||||
+ * so we get less than actual system memory size.
|
||||
+ * Workaround this by round up the total size to 128M which is
|
||||
+ * enough for most test cases.
|
||||
+ */
|
||||
+ total_mem = roundup(total_mem, SZ_128M);
|
||||
|
||||
/* for each entry of the comma-separated list */
|
||||
do {
|
||||
@@ -83,13 +93,13 @@ static int __init parse_crashkernel_mem(char *cmdline,
|
||||
return -EINVAL;
|
||||
}
|
||||
cur = tmp;
|
||||
- if (size >= system_ram) {
|
||||
+ if (size >= total_mem) {
|
||||
pr_warn("crashkernel: invalid size\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* match ? */
|
||||
- if (system_ram >= start && system_ram < end) {
|
||||
+ if (total_mem >= start && total_mem < end) {
|
||||
*crash_size = size;
|
||||
break;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
71
0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch
Normal file
71
0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Murphy Zhou <jencce.kernel@gmail.com>
|
||||
Date: Sun, 29 Sep 2019 17:56:59 +0800
|
||||
Subject: [PATCH] mm/kmemleak: skip late_init if not skip disable
|
||||
|
||||
Now if DEFAULT_OFF set to y, kmemleak_init will start the cleanup_work
|
||||
workqueue. Then late_init call will set kmemleak_initialized to 1, the
|
||||
cleaup workqueue will try to do cleanup, triggering:
|
||||
|
||||
[24.738773] ==================================================================
|
||||
[24.742784] BUG: KASAN: global-out-of-bounds in __kmemleak_do_cleanup+0x166/0x180
|
||||
[24.744144] Key type ._fscrypt registered
|
||||
[24.745680] Read of size 8 at addr ffffffff88746c90 by task kworker/3:1/171
|
||||
[24.745687]
|
||||
[24.745697] CPU: 3 PID: 171 Comm: kworker/3:1 Not tainted 5.3.0-v5.3-12475-gcbafe18 #1
|
||||
[24.745701] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
|
||||
[24.745710] Workqueue: events kmemleak_do_cleanup
|
||||
[24.745717] Call Trace:
|
||||
[24.745736] dump_stack+0x7c/0xc0
|
||||
[24.745755] print_address_description.constprop.4+0x1f/0x300
|
||||
[24.751562] Key type .fscrypt registered
|
||||
[24.754370] __kasan_report.cold.8+0x76/0xb2
|
||||
[24.754388] ? __kmemleak_do_cleanup+0x166/0x180
|
||||
[24.754407] kasan_report+0xe/0x20
|
||||
[24.778543] __kmemleak_do_cleanup+0x166/0x180
|
||||
[24.780795] process_one_work+0x919/0x17d0
|
||||
[24.782929] ? pwq_dec_nr_in_flight+0x320/0x320
|
||||
[24.785092] worker_thread+0x87/0xb40
|
||||
[24.786948] ? __kthread_parkme+0xc3/0x190
|
||||
[24.789217] ? process_one_work+0x17d0/0x17d0
|
||||
[24.791414] kthread+0x333/0x3f0
|
||||
[24.793031] ? kthread_create_worker_on_cpu+0xc0/0xc0
|
||||
[24.795473] ret_from_fork+0x3a/0x50
|
||||
[24.797303]
|
||||
[24.798091] The buggy address belongs to the variable:
|
||||
[24.800634] mem_pool_free_count+0x10/0x40
|
||||
[24.802656]
|
||||
[24.803434] Memory state around the buggy address:
|
||||
[24.805793] ffffffff88746b80: 04 fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
||||
[24.809177] ffffffff88746c00: 00 fa fa fa fa fa fa fa 00 00 fa fa fa fa fa fa
|
||||
[24.812407] >ffffffff88746c80: 04 fa fa fa fa fa fa fa 00 00 fa fa fa fa fa fa
|
||||
[24.815638] ^
|
||||
[24.817372] ffffffff88746d00: 00 00 fa fa fa fa fa fa 00 00 00 00 00 00 00 00
|
||||
[24.820740] ffffffff88746d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
[24.824021] ==================================================================
|
||||
|
||||
Fixes: c5665868183f ("mm: kmemleak: use the memory pool for early allocations")
|
||||
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
|
||||
---
|
||||
mm/kmemleak.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
|
||||
index e362dc3d2028..0c3dfb8eef67 100644
|
||||
--- a/mm/kmemleak.c
|
||||
+++ b/mm/kmemleak.c
|
||||
@@ -1958,6 +1958,11 @@ void __init kmemleak_init(void)
|
||||
*/
|
||||
static int __init kmemleak_late_init(void)
|
||||
{
|
||||
+ if (!kmemleak_skip_disable) {
|
||||
+ kmemleak_disable();
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
kmemleak_initialized = 1;
|
||||
|
||||
debugfs_create_file("kmemleak", 0644, NULL, NULL, &kmemleak_fops);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
202
0001-platform-x86-thinkpad_acpi-lap-or-desk-mode-interfac.patch
Normal file
202
0001-platform-x86-thinkpad_acpi-lap-or-desk-mode-interfac.patch
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
From acf7f4a59114471c3964f118564fe8e7a6f34bb8 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Pearson <markpearson@lenovo.com>
|
||||
Date: Thu, 2 Jul 2020 21:23:53 -0400
|
||||
Subject: [PATCH] platform/x86: thinkpad_acpi: lap or desk mode interface
|
||||
|
||||
Newer Lenovo Thinkpad platforms have support to identify whether the
|
||||
system is on-lap or not using an ACPI DYTC event from the firmware.
|
||||
|
||||
This patch provides the ability to retrieve the current mode via sysfs
|
||||
entrypoints and will be used by userspace for thermal mode and WWAN
|
||||
functionality
|
||||
|
||||
Co-developed-by: Nitin Joshi <njoshi1@lenovo.com>
|
||||
Signed-off-by: Nitin Joshi <njoshi1@lenovo.com>
|
||||
Reviewed-by: Sugumaran <slacshiminar@lenovo.com>
|
||||
Reviewed-by: Bastien Nocera <bnocera@redhat.com>
|
||||
Signed-off-by: Mark Pearson <markpearson@lenovo.com>
|
||||
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
---
|
||||
.../admin-guide/laptops/thinkpad-acpi.rst | 15 +++
|
||||
drivers/platform/x86/thinkpad_acpi.c | 111 +++++++++++++++++-
|
||||
2 files changed, 124 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
|
||||
index 822907dcc845..99066aa8d97b 100644
|
||||
--- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst
|
||||
+++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
|
||||
@@ -50,6 +50,7 @@ detailed description):
|
||||
- WAN enable and disable
|
||||
- UWB enable and disable
|
||||
- LCD Shadow (PrivacyGuard) enable and disable
|
||||
+ - Lap mode sensor
|
||||
|
||||
A compatibility table by model and feature is maintained on the web
|
||||
site, http://ibm-acpi.sf.net/. I appreciate any success or failure
|
||||
@@ -1432,6 +1433,20 @@ The first command ensures the best viewing angle and the latter one turns
|
||||
on the feature, restricting the viewing angles.
|
||||
|
||||
|
||||
+DYTC Lapmode sensor
|
||||
+------------------
|
||||
+
|
||||
+sysfs: dytc_lapmode
|
||||
+
|
||||
+Newer thinkpads and mobile workstations have the ability to determine if
|
||||
+the device is in deskmode or lapmode. This feature is used by user space
|
||||
+to decide if WWAN transmission can be increased to maximum power and is
|
||||
+also useful for understanding the different thermal modes available as
|
||||
+they differ between desk and lap mode.
|
||||
+
|
||||
+The property is read-only. If the platform doesn't have support the sysfs
|
||||
+class is not created.
|
||||
+
|
||||
EXPERIMENTAL: UWB
|
||||
-----------------
|
||||
|
||||
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
|
||||
index 0f6fceda5fc0..7fee3c1c2418 100644
|
||||
--- a/drivers/platform/x86/thinkpad_acpi.c
|
||||
+++ b/drivers/platform/x86/thinkpad_acpi.c
|
||||
@@ -4030,8 +4030,8 @@ static bool hotkey_notify_6xxx(const u32 hkey,
|
||||
return true;
|
||||
case TP_HKEY_EV_THM_CSM_COMPLETED:
|
||||
pr_debug("EC reports: Thermal Control Command set completed (DYTC)\n");
|
||||
- /* recommended action: do nothing, we don't have
|
||||
- * Lenovo ATM information */
|
||||
+ /* Thermal event - pass on to event handler */
|
||||
+ tpacpi_driver_event(hkey);
|
||||
return true;
|
||||
case TP_HKEY_EV_THM_TRANSFM_CHANGED:
|
||||
pr_debug("EC reports: Thermal Transformation changed (GMTS)\n");
|
||||
@@ -9803,6 +9803,105 @@ static struct ibm_struct lcdshadow_driver_data = {
|
||||
.write = lcdshadow_write,
|
||||
};
|
||||
|
||||
+/*************************************************************************
|
||||
+ * DYTC subdriver, for the Lenovo lapmode feature
|
||||
+ */
|
||||
+
|
||||
+#define DYTC_CMD_GET 2 /* To get current IC function and mode */
|
||||
+#define DYTC_GET_LAPMODE_BIT 17 /* Set when in lapmode */
|
||||
+
|
||||
+static bool dytc_lapmode;
|
||||
+
|
||||
+static void dytc_lapmode_notify_change(void)
|
||||
+{
|
||||
+ sysfs_notify(&tpacpi_pdev->dev.kobj, NULL, "dytc_lapmode");
|
||||
+}
|
||||
+
|
||||
+static int dytc_command(int command, int *output)
|
||||
+{
|
||||
+ acpi_handle dytc_handle;
|
||||
+
|
||||
+ if (ACPI_FAILURE(acpi_get_handle(hkey_handle, "DYTC", &dytc_handle))) {
|
||||
+ /* Platform doesn't support DYTC */
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+ if (!acpi_evalf(dytc_handle, output, NULL, "dd", command))
|
||||
+ return -EIO;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int dytc_lapmode_get(bool *state)
|
||||
+{
|
||||
+ int output, err;
|
||||
+
|
||||
+ err = dytc_command(DYTC_CMD_GET, &output);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+ *state = output & BIT(DYTC_GET_LAPMODE_BIT) ? true : false;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void dytc_lapmode_refresh(void)
|
||||
+{
|
||||
+ bool new_state;
|
||||
+ int err;
|
||||
+
|
||||
+ err = dytc_lapmode_get(&new_state);
|
||||
+ if (err || (new_state == dytc_lapmode))
|
||||
+ return;
|
||||
+
|
||||
+ dytc_lapmode = new_state;
|
||||
+ dytc_lapmode_notify_change();
|
||||
+}
|
||||
+
|
||||
+/* sysfs lapmode entry */
|
||||
+static ssize_t dytc_lapmode_show(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ return snprintf(buf, PAGE_SIZE, "%d\n", dytc_lapmode);
|
||||
+}
|
||||
+
|
||||
+static DEVICE_ATTR_RO(dytc_lapmode);
|
||||
+
|
||||
+static struct attribute *dytc_attributes[] = {
|
||||
+ &dev_attr_dytc_lapmode.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+static const struct attribute_group dytc_attr_group = {
|
||||
+ .attrs = dytc_attributes,
|
||||
+};
|
||||
+
|
||||
+static int tpacpi_dytc_init(struct ibm_init_struct *iibm)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ err = dytc_lapmode_get(&dytc_lapmode);
|
||||
+ /* If support isn't available (ENODEV) then don't return an error
|
||||
+ * but just don't create the sysfs group
|
||||
+ */
|
||||
+ if (err == -ENODEV)
|
||||
+ return 0;
|
||||
+ /* For all other errors we can flag the failure */
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ /* Platform supports this feature - create the group */
|
||||
+ err = sysfs_create_group(&tpacpi_pdev->dev.kobj, &dytc_attr_group);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static void dytc_exit(void)
|
||||
+{
|
||||
+ sysfs_remove_group(&tpacpi_pdev->dev.kobj, &dytc_attr_group);
|
||||
+}
|
||||
+
|
||||
+static struct ibm_struct dytc_driver_data = {
|
||||
+ .name = "dytc",
|
||||
+ .exit = dytc_exit,
|
||||
+};
|
||||
+
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
*
|
||||
@@ -9850,6 +9949,10 @@ static void tpacpi_driver_event(const unsigned int hkey_event)
|
||||
|
||||
mutex_unlock(&kbdlight_mutex);
|
||||
}
|
||||
+
|
||||
+ if (hkey_event == TP_HKEY_EV_THM_CSM_COMPLETED)
|
||||
+ dytc_lapmode_refresh();
|
||||
+
|
||||
}
|
||||
|
||||
static void hotkey_driver_event(const unsigned int scancode)
|
||||
@@ -10288,6 +10391,10 @@ static struct ibm_init_struct ibms_init[] __initdata = {
|
||||
.init = tpacpi_lcdshadow_init,
|
||||
.data = &lcdshadow_driver_data,
|
||||
},
|
||||
+ {
|
||||
+ .init = tpacpi_dytc_init,
|
||||
+ .data = &dytc_driver_data,
|
||||
+ },
|
||||
};
|
||||
|
||||
static int __init set_ibm_param(const char *val, const struct kernel_param *kp)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Cline <jcline@redhat.com>
|
||||
Date: Wed, 30 Oct 2019 14:37:49 +0000
|
||||
Subject: [PATCH] s390: Lock down the kernel when the IPL secure flag is set
|
||||
|
||||
Automatically lock down the kernel to LOCKDOWN_CONFIDENTIALITY_MAX if
|
||||
the IPL secure flag is set.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Suggested-by: Philipp Rudo <prudo@redhat.com>
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
arch/s390/include/asm/ipl.h | 1 +
|
||||
arch/s390/kernel/ipl.c | 5 +++++
|
||||
arch/s390/kernel/setup.c | 4 ++++
|
||||
3 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/arch/s390/include/asm/ipl.h b/arch/s390/include/asm/ipl.h
|
||||
index 7d5cfdda5277..be66ee5d0437 100644
|
||||
--- a/arch/s390/include/asm/ipl.h
|
||||
+++ b/arch/s390/include/asm/ipl.h
|
||||
@@ -120,6 +120,7 @@ int ipl_report_add_component(struct ipl_report *report, struct kexec_buf *kbuf,
|
||||
unsigned char flags, unsigned short cert);
|
||||
int ipl_report_add_certificate(struct ipl_report *report, void *key,
|
||||
unsigned long addr, unsigned long len);
|
||||
+bool ipl_get_secureboot(void);
|
||||
|
||||
/*
|
||||
* DIAG 308 support
|
||||
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
|
||||
index 90a2a17239b0..be3b72c53656 100644
|
||||
--- a/arch/s390/kernel/ipl.c
|
||||
+++ b/arch/s390/kernel/ipl.c
|
||||
@@ -2110,3 +2110,8 @@ int ipl_report_free(struct ipl_report *report)
|
||||
}
|
||||
|
||||
#endif
|
||||
+
|
||||
+bool ipl_get_secureboot(void)
|
||||
+{
|
||||
+ return !!ipl_secure_flag;
|
||||
+}
|
||||
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
|
||||
index 07aa15ba43b3..307abb2d82d7 100644
|
||||
--- a/arch/s390/kernel/setup.c
|
||||
+++ b/arch/s390/kernel/setup.c
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <linux/memory.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/start_kernel.h>
|
||||
+#include <linux/security.h>
|
||||
|
||||
#include <asm/boot_data.h>
|
||||
#include <asm/ipl.h>
|
||||
@@ -1086,6 +1087,9 @@ void __init setup_arch(char **cmdline_p)
|
||||
|
||||
log_component_list();
|
||||
|
||||
+ if (ipl_get_secureboot())
|
||||
+ security_lock_kernel_down("Secure IPL mode", LOCKDOWN_INTEGRITY_MAX);
|
||||
+
|
||||
/* Have one command line that is parsed and saved in /proc/cmdline */
|
||||
/* boot_command_line has been already set up in early.c */
|
||||
*cmdline_p = boot_command_line;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
70
0001-scsi-smartpqi-add-inspur-advantech-ids.patch
Normal file
70
0001-scsi-smartpqi-add-inspur-advantech-ids.patch
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Don Brace <dbrace@redhat.com>
|
||||
Date: Mon, 16 Jul 2018 19:20:41 -0400
|
||||
Subject: [PATCH] scsi: smartpqi: add inspur advantech ids
|
||||
|
||||
Message-id: <1531768843-2544-4-git-send-email-dbrace@redhat.com>
|
||||
Patchwork-id: 224988
|
||||
O-Subject: [RHEL 8.0 e-stor V2 PATCH 3/5] scsi: smartpqi: add inspur advantech ids
|
||||
Bugzilla: 1503736
|
||||
RH-Acked-by: Ewan Milne <emilne@redhat.com>
|
||||
RH-Acked-by: Tomas Henzl <thenzl@redhat.com>
|
||||
|
||||
From: Kevin Barnett <kevin.barnett@microsemi.com>
|
||||
|
||||
Add support for these new device IDs:
|
||||
|
||||
Advantech MIC-8312BridgeB
|
||||
INSPUR PM8204-2GB
|
||||
INSPUR PM8204-4GB
|
||||
INSPUR PM8222-SHBA
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
|
||||
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
|
||||
Signed-off-by: Don Brace <don.brace@microsemi.com>
|
||||
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
||||
(cherry picked from commit 9f8d05fa98442de78d1ab30235b0cc656ed7aff0)
|
||||
Signed-off-by: Don Brace <dbrace@redhat.com>
|
||||
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
|
||||
---
|
||||
drivers/scsi/smartpqi/smartpqi_init.c | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
|
||||
index cd157f11eb22..c5dc6cf57a71 100644
|
||||
--- a/drivers/scsi/smartpqi/smartpqi_init.c
|
||||
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
|
||||
@@ -8247,6 +8247,18 @@ static const struct pci_device_id pqi_pci_id_table[] = {
|
||||
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
0x19e5, 0xd22c)
|
||||
},
|
||||
+ {
|
||||
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
+ 0x1bd4, 0x004a)
|
||||
+ },
|
||||
+ {
|
||||
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
+ 0x1bd4, 0x004b)
|
||||
+ },
|
||||
+ {
|
||||
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
+ 0x1bd4, 0x004c)
|
||||
+ },
|
||||
{
|
||||
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
PCI_VENDOR_ID_ADAPTEC2, 0x0110)
|
||||
@@ -8383,6 +8395,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
|
||||
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
PCI_VENDOR_ID_ADVANTECH, 0x8312)
|
||||
},
|
||||
+ {
|
||||
+ PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
+ PCI_VENDOR_ID_ADVANTECH, 0x8312)
|
||||
+ },
|
||||
{
|
||||
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
|
||||
PCI_VENDOR_ID_DELL, 0x1fe0)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
103
0001-security-lockdown-expose-a-hook-to-lock-the-kernel-d.patch
Normal file
103
0001-security-lockdown-expose-a-hook-to-lock-the-kernel-d.patch
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Cline <jcline@redhat.com>
|
||||
Date: Mon, 30 Sep 2019 21:22:47 +0000
|
||||
Subject: [PATCH] security: lockdown: expose a hook to lock the kernel down
|
||||
|
||||
In order to automatically lock down kernels running on UEFI machines
|
||||
booted in Secure Boot mode, expose the lock_kernel_down() hook.
|
||||
|
||||
Upstream Status: RHEL only
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
include/linux/lsm_hook_defs.h | 2 ++
|
||||
include/linux/lsm_hooks.h | 6 ++++++
|
||||
include/linux/security.h | 5 +++++
|
||||
security/lockdown/lockdown.c | 1 +
|
||||
security/security.c | 6 ++++++
|
||||
5 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
|
||||
index af998f93d256..3c33f00cd4d6 100644
|
||||
--- a/include/linux/lsm_hook_defs.h
|
||||
+++ b/include/linux/lsm_hook_defs.h
|
||||
@@ -383,6 +383,8 @@ LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security, struct bpf_prog_aux *aux)
|
||||
#endif /* CONFIG_BPF_SYSCALL */
|
||||
|
||||
LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
|
||||
+LSM_HOOK(int, 0, lock_kernel_down, const char *where, enum lockdown_reason level)
|
||||
+
|
||||
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
LSM_HOOK(int, 0, perf_event_open, struct perf_event_attr *attr, int type)
|
||||
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
|
||||
index 95b7c1d32062..dbacbb1fc129 100644
|
||||
--- a/include/linux/lsm_hooks.h
|
||||
+++ b/include/linux/lsm_hooks.h
|
||||
@@ -1507,6 +1507,12 @@
|
||||
*
|
||||
* @what: kernel feature being accessed
|
||||
*
|
||||
+ * @lock_kernel_down
|
||||
+ * Put the kernel into lock-down mode.
|
||||
+ *
|
||||
+ * @where: Where the lock-down is originating from (e.g. command line option)
|
||||
+ * @level: The lock-down level (can only increase)
|
||||
+ *
|
||||
* Security hooks for perf events
|
||||
*
|
||||
* @perf_event_open:
|
||||
diff --git a/include/linux/security.h b/include/linux/security.h
|
||||
index 0a0a03b36a3b..26869f44416b 100644
|
||||
--- a/include/linux/security.h
|
||||
+++ b/include/linux/security.h
|
||||
@@ -451,6 +451,7 @@ int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
|
||||
int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
|
||||
int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
|
||||
int security_locked_down(enum lockdown_reason what);
|
||||
+int security_lock_kernel_down(const char *where, enum lockdown_reason level);
|
||||
#else /* CONFIG_SECURITY */
|
||||
|
||||
static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)
|
||||
@@ -1291,6 +1292,10 @@ static inline int security_locked_down(enum lockdown_reason what)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
+static inline int security_lock_kernel_down(const char *where, enum lockdown_reason level)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
#endif /* CONFIG_SECURITY */
|
||||
|
||||
#if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE)
|
||||
diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
|
||||
index 87cbdc64d272..18555cf18da7 100644
|
||||
--- a/security/lockdown/lockdown.c
|
||||
+++ b/security/lockdown/lockdown.c
|
||||
@@ -73,6 +73,7 @@ static int lockdown_is_locked_down(enum lockdown_reason what)
|
||||
|
||||
static struct security_hook_list lockdown_hooks[] __lsm_ro_after_init = {
|
||||
LSM_HOOK_INIT(locked_down, lockdown_is_locked_down),
|
||||
+ LSM_HOOK_INIT(lock_kernel_down, lock_kernel_down),
|
||||
};
|
||||
|
||||
static int __init lockdown_lsm_init(void)
|
||||
diff --git a/security/security.c b/security/security.c
|
||||
index 70a7ad357bc6..23e16e773bc2 100644
|
||||
--- a/security/security.c
|
||||
+++ b/security/security.c
|
||||
@@ -2516,6 +2516,12 @@ int security_locked_down(enum lockdown_reason what)
|
||||
}
|
||||
EXPORT_SYMBOL(security_locked_down);
|
||||
|
||||
+int security_lock_kernel_down(const char *where, enum lockdown_reason level)
|
||||
+{
|
||||
+ return call_int_hook(lock_kernel_down, 0, where, level);
|
||||
+}
|
||||
+EXPORT_SYMBOL(security_lock_kernel_down);
|
||||
+
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
int security_perf_event_open(struct perf_event_attr *attr, int type)
|
||||
{
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Lebon <jlebon@redhat.com>
|
||||
Date: Thu, 28 May 2020 10:39:40 -0400
|
||||
Subject: [PATCH] selinux: allow reading labels before policy is loaded
|
||||
|
||||
This patch does for `getxattr` what commit 3e3e24b42043 ("selinux: allow
|
||||
labeling before policy is loaded") did for `setxattr`; it allows
|
||||
querying the current SELinux label on disk before the policy is loaded.
|
||||
|
||||
One of the motivations described in that commit message also drives this
|
||||
patch: for Fedora CoreOS (and eventually RHEL CoreOS), we want to be
|
||||
able to move the root filesystem for example, from xfs to ext4 on RAID,
|
||||
on first boot, at initrd time.[1]
|
||||
|
||||
Because such an operation works at the filesystem level, we need to be
|
||||
able to read the SELinux labels first from the original root, and apply
|
||||
them to the files of the new root. The previous commit enabled the
|
||||
second part of this process; this commit enables the first part.
|
||||
|
||||
[1] https://github.com/coreos/fedora-coreos-tracker/issues/94
|
||||
|
||||
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
|
||||
Signed-off-by: Jonathan Lebon <jlebon@redhat.com>
|
||||
Signed-off-by: Paul Moore <paul@paul-moore.com>
|
||||
---
|
||||
security/selinux/hooks.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
|
||||
index efa6108b1ce9..ca901025802a 100644
|
||||
--- a/security/selinux/hooks.c
|
||||
+++ b/security/selinux/hooks.c
|
||||
@@ -3332,7 +3332,12 @@ static int selinux_inode_getsecurity(struct inode *inode, const char *name, void
|
||||
char *context = NULL;
|
||||
struct inode_security_struct *isec;
|
||||
|
||||
- if (strcmp(name, XATTR_SELINUX_SUFFIX))
|
||||
+ /*
|
||||
+ * If we're not initialized yet, then we can't validate contexts, so
|
||||
+ * just let vfs_getxattr fall back to using the on-disk xattr.
|
||||
+ */
|
||||
+ if (!selinux_initialized(&selinux_state) ||
|
||||
+ strcmp(name, XATTR_SELINUX_SUFFIX))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/*
|
||||
--
|
||||
2.26.2
|
||||
|
||||
53
0001-update-phy-on-pine64-a64-devices.patch
Normal file
53
0001-update-phy-on-pine64-a64-devices.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
From bb421e23b49e39c117a31f7c07df83cddd0d96dc Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Mon, 26 Oct 2020 17:01:57 +0000
|
||||
Subject: [PATCH 1/2] update phy on pine64 a64 devices
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 2 +-
|
||||
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 2 +-
|
||||
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
|
||||
index b26181cf9095..01728a4c5309 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts
|
||||
@@ -13,7 +13,7 @@ / {
|
||||
&emac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&rgmii_pins>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-txid";
|
||||
phy-handle = <&ext_rgmii_phy>;
|
||||
status = "okay";
|
||||
};
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
index 2165f238af13..9741fb5caa6f 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
@@ -81,7 +81,7 @@ &ehci1 {
|
||||
&emac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&rmii_pins>;
|
||||
- phy-mode = "rmii";
|
||||
+ phy-mode = "rmii-id";
|
||||
phy-handle = <&ext_rmii_phy1>;
|
||||
phy-supply = <®_dc1sw>;
|
||||
status = "okay";
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
|
||||
index 2f6ea9f3f6a2..079b10641ccd 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
|
||||
@@ -79,7 +79,7 @@ &ehci1 {
|
||||
&emac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&rgmii_pins>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
phy-handle = <&ext_rgmii_phy>;
|
||||
phy-supply = <®_dc1sw>;
|
||||
status = "okay";
|
||||
--
|
||||
2.28.0
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Tue, 19 May 2020 11:05:40 +0200
|
||||
Subject: [PATCH] virt: vbox: Add a few new vmmdev request types to the
|
||||
userspace whitelist
|
||||
|
||||
Upstream VirtualBox has defined and is using a few new request types for
|
||||
vmmdev requests passed through /dev/vboxguest to the hypervisor.
|
||||
|
||||
Add the defines for these to vbox_vmmdev_types.h and add add them to the
|
||||
whitelists of vmmdev requests which userspace is allowed to make.
|
||||
|
||||
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1789545
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
|
||||
---
|
||||
drivers/virt/vboxguest/vboxguest_core.c | 2 ++
|
||||
include/uapi/linux/vbox_vmmdev_types.h | 3 +++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
index 4f1addaa3f6f..ffd76b949276 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.c
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
@@ -1299,7 +1299,9 @@ static int vbg_req_allowed(struct vbg_dev *gdev, struct vbg_session *session,
|
||||
case VMMDEVREQ_VIDEO_ACCEL_ENABLE:
|
||||
case VMMDEVREQ_VIDEO_ACCEL_FLUSH:
|
||||
case VMMDEVREQ_VIDEO_SET_VISIBLE_REGION:
|
||||
+ case VMMDEVREQ_VIDEO_UPDATE_MONITOR_POSITIONS:
|
||||
case VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX:
|
||||
+ case VMMDEVREQ_GET_DISPLAY_CHANGE_REQ_MULTI:
|
||||
case VMMDEVREQ_GET_SEAMLESS_CHANGE_REQ:
|
||||
case VMMDEVREQ_GET_VRDPCHANGE_REQ:
|
||||
case VMMDEVREQ_LOG_STRING:
|
||||
diff --git a/include/uapi/linux/vbox_vmmdev_types.h b/include/uapi/linux/vbox_vmmdev_types.h
|
||||
index c27289fd619a..f8a8d6b3c521 100644
|
||||
--- a/include/uapi/linux/vbox_vmmdev_types.h
|
||||
+++ b/include/uapi/linux/vbox_vmmdev_types.h
|
||||
@@ -63,6 +63,7 @@ enum vmmdev_request_type {
|
||||
VMMDEVREQ_SET_GUEST_CAPABILITIES = 56,
|
||||
VMMDEVREQ_VIDEMODE_SUPPORTED2 = 57, /* since version 3.2.0 */
|
||||
VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX = 80, /* since version 4.2.4 */
|
||||
+ VMMDEVREQ_GET_DISPLAY_CHANGE_REQ_MULTI = 81,
|
||||
VMMDEVREQ_HGCM_CONNECT = 60,
|
||||
VMMDEVREQ_HGCM_DISCONNECT = 61,
|
||||
VMMDEVREQ_HGCM_CALL32 = 62,
|
||||
@@ -92,6 +93,8 @@ enum vmmdev_request_type {
|
||||
VMMDEVREQ_WRITE_COREDUMP = 218,
|
||||
VMMDEVREQ_GUEST_HEARTBEAT = 219,
|
||||
VMMDEVREQ_HEARTBEAT_CONFIGURE = 220,
|
||||
+ VMMDEVREQ_NT_BUG_CHECK = 221,
|
||||
+ VMMDEVREQ_VIDEO_UPDATE_MONITOR_POSITIONS = 222,
|
||||
/* Ensure the enum is a 32 bit data-type */
|
||||
VMMDEVREQ_SIZEHACK = 0x7fffffff
|
||||
};
|
||||
--
|
||||
2.26.2
|
||||
|
||||
320
0001-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch
Normal file
320
0001-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch
Normal file
|
|
@ -0,0 +1,320 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Tue, 19 May 2020 18:04:30 +0200
|
||||
Subject: [PATCH] virt: vbox: Add support for the new
|
||||
VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES ioctl
|
||||
|
||||
Add support for the new VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES ioctl, this
|
||||
is necessary for automatic resizing of the guest resolution to match the
|
||||
VM-window size to work with the new VMSVGA virtual GPU which is now the
|
||||
new default in VirtualBox.
|
||||
|
||||
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1789545
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
|
||||
---
|
||||
drivers/virt/vboxguest/vboxguest_core.c | 163 +++++++++++++++++++++++-
|
||||
drivers/virt/vboxguest/vboxguest_core.h | 14 ++
|
||||
include/uapi/linux/vboxguest.h | 24 ++++
|
||||
3 files changed, 200 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
index 15b3cb618c6e..4f1addaa3f6f 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.c
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
@@ -679,7 +679,7 @@ static int vbg_set_host_capabilities(struct vbg_dev *gdev,
|
||||
|
||||
WARN_ON(!mutex_is_locked(&gdev->session_mutex));
|
||||
|
||||
- caps = gdev->set_guest_caps_tracker.mask;
|
||||
+ caps = gdev->acquired_guest_caps | gdev->set_guest_caps_tracker.mask;
|
||||
|
||||
if (gdev->guest_caps_host == caps)
|
||||
return 0;
|
||||
@@ -703,6 +703,113 @@ static int vbg_set_host_capabilities(struct vbg_dev *gdev,
|
||||
return vbg_status_code_to_errno(rc);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Acquire (get exclusive access) guest capabilities for a session.
|
||||
+ * Takes the session mutex.
|
||||
+ * Return: 0 or negative errno value.
|
||||
+ * @gdev: The Guest extension device.
|
||||
+ * @session: The session.
|
||||
+ * @flags: Flags (VBGL_IOC_AGC_FLAGS_XXX).
|
||||
+ * @or_mask: The capabilities to add.
|
||||
+ * @not_mask: The capabilities to remove.
|
||||
+ * @session_termination: Set if we're called by the session cleanup code.
|
||||
+ * This tweaks the error handling so we perform
|
||||
+ * proper session cleanup even if the host
|
||||
+ * misbehaves.
|
||||
+ */
|
||||
+static int vbg_acquire_session_capabilities(struct vbg_dev *gdev,
|
||||
+ struct vbg_session *session,
|
||||
+ u32 or_mask, u32 not_mask,
|
||||
+ u32 flags, bool session_termination)
|
||||
+{
|
||||
+ unsigned long irqflags;
|
||||
+ bool wakeup = false;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ mutex_lock(&gdev->session_mutex);
|
||||
+
|
||||
+ if (gdev->set_guest_caps_tracker.mask & or_mask) {
|
||||
+ vbg_err("%s error: cannot acquire caps which are currently set\n",
|
||||
+ __func__);
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Mark any caps in the or_mask as now being in acquire-mode. Note
|
||||
+ * once caps are in acquire_mode they always stay in this mode.
|
||||
+ * This impacts event handling, so we take the event-lock.
|
||||
+ */
|
||||
+ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
|
||||
+ gdev->acquire_mode_guest_caps |= or_mask;
|
||||
+ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
|
||||
+
|
||||
+ /* If we only have to switch the caps to acquire mode, we're done. */
|
||||
+ if (flags & VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE)
|
||||
+ goto out;
|
||||
+
|
||||
+ not_mask &= ~or_mask; /* or_mask takes priority over not_mask */
|
||||
+ not_mask &= session->acquired_guest_caps;
|
||||
+ or_mask &= ~session->acquired_guest_caps;
|
||||
+
|
||||
+ if (or_mask == 0 && not_mask == 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (gdev->acquired_guest_caps & or_mask) {
|
||||
+ ret = -EBUSY;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ gdev->acquired_guest_caps |= or_mask;
|
||||
+ gdev->acquired_guest_caps &= ~not_mask;
|
||||
+ /* session->acquired_guest_caps impacts event handling, take the lock */
|
||||
+ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
|
||||
+ session->acquired_guest_caps |= or_mask;
|
||||
+ session->acquired_guest_caps &= ~not_mask;
|
||||
+ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
|
||||
+
|
||||
+ ret = vbg_set_host_capabilities(gdev, session, session_termination);
|
||||
+ /* Roll back on failure, unless it's session termination time. */
|
||||
+ if (ret < 0 && !session_termination) {
|
||||
+ gdev->acquired_guest_caps &= ~or_mask;
|
||||
+ gdev->acquired_guest_caps |= not_mask;
|
||||
+ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
|
||||
+ session->acquired_guest_caps &= ~or_mask;
|
||||
+ session->acquired_guest_caps |= not_mask;
|
||||
+ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If we added a capability, check if that means some other thread in
|
||||
+ * our session should be unblocked because there are events pending
|
||||
+ * (the result of vbg_get_allowed_event_mask_for_session() may change).
|
||||
+ *
|
||||
+ * HACK ALERT! When the seamless support capability is added we generate
|
||||
+ * a seamless change event so that the ring-3 client can sync with
|
||||
+ * the seamless state.
|
||||
+ */
|
||||
+ if (ret == 0 && or_mask != 0) {
|
||||
+ spin_lock_irqsave(&gdev->event_spinlock, irqflags);
|
||||
+
|
||||
+ if (or_mask & VMMDEV_GUEST_SUPPORTS_SEAMLESS)
|
||||
+ gdev->pending_events |=
|
||||
+ VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
|
||||
+
|
||||
+ if (gdev->pending_events)
|
||||
+ wakeup = true;
|
||||
+
|
||||
+ spin_unlock_irqrestore(&gdev->event_spinlock, irqflags);
|
||||
+
|
||||
+ if (wakeup)
|
||||
+ wake_up(&gdev->event_wq);
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ mutex_unlock(&gdev->session_mutex);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Sets the guest capabilities for a session. Takes the session spinlock.
|
||||
* Return: 0 or negative errno value.
|
||||
@@ -725,6 +832,13 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
||||
|
||||
mutex_lock(&gdev->session_mutex);
|
||||
|
||||
+ if (gdev->acquire_mode_guest_caps & or_mask) {
|
||||
+ vbg_err("%s error: cannot set caps which are in acquire_mode\n",
|
||||
+ __func__);
|
||||
+ ret = -EBUSY;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
/* Apply the changes to the session mask. */
|
||||
previous = session->set_guest_caps;
|
||||
session->set_guest_caps |= or_mask;
|
||||
@@ -962,6 +1076,7 @@ void vbg_core_close_session(struct vbg_session *session)
|
||||
struct vbg_dev *gdev = session->gdev;
|
||||
int i, rc;
|
||||
|
||||
+ vbg_acquire_session_capabilities(gdev, session, 0, U32_MAX, 0, true);
|
||||
vbg_set_session_capabilities(gdev, session, 0, U32_MAX, true);
|
||||
vbg_set_session_event_filter(gdev, session, 0, U32_MAX, true);
|
||||
|
||||
@@ -1019,6 +1134,25 @@ static int vbg_ioctl_driver_version_info(
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/* Must be called with the event_lock held */
|
||||
+static u32 vbg_get_allowed_event_mask_for_session(struct vbg_dev *gdev,
|
||||
+ struct vbg_session *session)
|
||||
+{
|
||||
+ u32 acquire_mode_caps = gdev->acquire_mode_guest_caps;
|
||||
+ u32 session_acquired_caps = session->acquired_guest_caps;
|
||||
+ u32 allowed_events = VMMDEV_EVENT_VALID_EVENT_MASK;
|
||||
+
|
||||
+ if ((acquire_mode_caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS) &&
|
||||
+ !(session_acquired_caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS))
|
||||
+ allowed_events &= ~VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST;
|
||||
+
|
||||
+ if ((acquire_mode_caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS) &&
|
||||
+ !(session_acquired_caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS))
|
||||
+ allowed_events &= ~VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
|
||||
+
|
||||
+ return allowed_events;
|
||||
+}
|
||||
+
|
||||
static bool vbg_wait_event_cond(struct vbg_dev *gdev,
|
||||
struct vbg_session *session,
|
||||
u32 event_mask)
|
||||
@@ -1030,6 +1164,7 @@ static bool vbg_wait_event_cond(struct vbg_dev *gdev,
|
||||
spin_lock_irqsave(&gdev->event_spinlock, flags);
|
||||
|
||||
events = gdev->pending_events & event_mask;
|
||||
+ events &= vbg_get_allowed_event_mask_for_session(gdev, session);
|
||||
wakeup = events || session->cancel_waiters;
|
||||
|
||||
spin_unlock_irqrestore(&gdev->event_spinlock, flags);
|
||||
@@ -1044,6 +1179,7 @@ static u32 vbg_consume_events_locked(struct vbg_dev *gdev,
|
||||
{
|
||||
u32 events = gdev->pending_events & event_mask;
|
||||
|
||||
+ events &= vbg_get_allowed_event_mask_for_session(gdev, session);
|
||||
gdev->pending_events &= ~events;
|
||||
return events;
|
||||
}
|
||||
@@ -1445,6 +1581,29 @@ static int vbg_ioctl_change_filter_mask(struct vbg_dev *gdev,
|
||||
false);
|
||||
}
|
||||
|
||||
+static int vbg_ioctl_acquire_guest_capabilities(struct vbg_dev *gdev,
|
||||
+ struct vbg_session *session,
|
||||
+ struct vbg_ioctl_acquire_guest_caps *caps)
|
||||
+{
|
||||
+ u32 flags, or_mask, not_mask;
|
||||
+
|
||||
+ if (vbg_ioctl_chk(&caps->hdr, sizeof(caps->u.in), 0))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ flags = caps->u.in.flags;
|
||||
+ or_mask = caps->u.in.or_mask;
|
||||
+ not_mask = caps->u.in.not_mask;
|
||||
+
|
||||
+ if (flags & ~VBGL_IOC_AGC_FLAGS_VALID_MASK)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if ((or_mask | not_mask) & ~VMMDEV_GUEST_CAPABILITIES_MASK)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ return vbg_acquire_session_capabilities(gdev, session, or_mask,
|
||||
+ not_mask, flags, false);
|
||||
+}
|
||||
+
|
||||
static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
|
||||
struct vbg_session *session, struct vbg_ioctl_set_guest_caps *caps)
|
||||
{
|
||||
@@ -1554,6 +1713,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
|
||||
return vbg_ioctl_interrupt_all_wait_events(gdev, session, data);
|
||||
case VBG_IOCTL_CHANGE_FILTER_MASK:
|
||||
return vbg_ioctl_change_filter_mask(gdev, session, data);
|
||||
+ case VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES:
|
||||
+ return vbg_ioctl_acquire_guest_capabilities(gdev, session, data);
|
||||
case VBG_IOCTL_CHANGE_GUEST_CAPABILITIES:
|
||||
return vbg_ioctl_change_guest_capabilities(gdev, session, data);
|
||||
case VBG_IOCTL_CHECK_BALLOON:
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
|
||||
index dc745a033164..ab4bf64e2cec 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.h
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.h
|
||||
@@ -117,6 +117,15 @@ struct vbg_dev {
|
||||
*/
|
||||
u32 event_filter_host;
|
||||
|
||||
+ /**
|
||||
+ * Guest capabilities which have been switched to acquire_mode.
|
||||
+ */
|
||||
+ u32 acquire_mode_guest_caps;
|
||||
+ /**
|
||||
+ * Guest capabilities acquired by vbg_acquire_session_capabilities().
|
||||
+ * Only one session can acquire a capability at a time.
|
||||
+ */
|
||||
+ u32 acquired_guest_caps;
|
||||
/**
|
||||
* Usage counters for guest capabilities requested through
|
||||
* vbg_set_session_capabilities(). Indexed by capability bit
|
||||
@@ -164,6 +173,11 @@ struct vbg_session {
|
||||
* host filter. Protected by vbg_gdev.session_mutex.
|
||||
*/
|
||||
u32 event_filter;
|
||||
+ /**
|
||||
+ * Guest capabilities acquired by vbg_acquire_session_capabilities().
|
||||
+ * Only one session can acquire a capability at a time.
|
||||
+ */
|
||||
+ u32 acquired_guest_caps;
|
||||
/**
|
||||
* Guest capabilities set through vbg_set_session_capabilities().
|
||||
* A capability claimed by any guest session will be reported to the
|
||||
diff --git a/include/uapi/linux/vboxguest.h b/include/uapi/linux/vboxguest.h
|
||||
index f79d7abe27db..15125f6ec60d 100644
|
||||
--- a/include/uapi/linux/vboxguest.h
|
||||
+++ b/include/uapi/linux/vboxguest.h
|
||||
@@ -257,6 +257,30 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_change_filter, 24 + 8);
|
||||
_IOWR('V', 12, struct vbg_ioctl_change_filter)
|
||||
|
||||
|
||||
+/** VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES data structure. */
|
||||
+struct vbg_ioctl_acquire_guest_caps {
|
||||
+ /** The header. */
|
||||
+ struct vbg_ioctl_hdr hdr;
|
||||
+ union {
|
||||
+ struct {
|
||||
+ /** Flags (VBGL_IOC_AGC_FLAGS_XXX). */
|
||||
+ __u32 flags;
|
||||
+ /** Capabilities to set (VMMDEV_GUEST_SUPPORTS_XXX). */
|
||||
+ __u32 or_mask;
|
||||
+ /** Capabilities to drop (VMMDEV_GUEST_SUPPORTS_XXX). */
|
||||
+ __u32 not_mask;
|
||||
+ } in;
|
||||
+ } u;
|
||||
+};
|
||||
+VMMDEV_ASSERT_SIZE(vbg_ioctl_acquire_guest_caps, 24 + 12);
|
||||
+
|
||||
+#define VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE 0x00000001
|
||||
+#define VBGL_IOC_AGC_FLAGS_VALID_MASK 0x00000001
|
||||
+
|
||||
+#define VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES \
|
||||
+ _IOWR('V', 13, struct vbg_ioctl_acquire_guest_caps)
|
||||
+
|
||||
+
|
||||
/** VBG_IOCTL_CHANGE_GUEST_CAPABILITIES data structure. */
|
||||
struct vbg_ioctl_set_guest_caps {
|
||||
/** The header. */
|
||||
--
|
||||
2.26.2
|
||||
|
||||
130
0001-virt-vbox-Add-vbg_set_host_capabilities-helper-funct.patch
Normal file
130
0001-virt-vbox-Add-vbg_set_host_capabilities-helper-funct.patch
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Tue, 19 May 2020 15:30:29 +0200
|
||||
Subject: [PATCH] virt: vbox: Add vbg_set_host_capabilities() helper function
|
||||
|
||||
Add vbg_set_host_capabilities() helper function, this is a preparation
|
||||
patch for adding support for the VBGL_IOCTL_GUEST_CAPS_ACQUIRE ioctl.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
|
||||
---
|
||||
drivers/virt/vboxguest/vboxguest_core.c | 79 ++++++++++++++-----------
|
||||
1 file changed, 46 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
index aee5eff229f2..15b3cb618c6e 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.c
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
@@ -661,6 +661,48 @@ static int vbg_reset_host_capabilities(struct vbg_dev *gdev)
|
||||
return vbg_status_code_to_errno(rc);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Set guest capabilities on the host.
|
||||
+ * Must be called with gdev->session_mutex hold.
|
||||
+ * Return: 0 or negative errno value.
|
||||
+ * @gdev: The Guest extension device.
|
||||
+ * @session: The session.
|
||||
+ * @session_termination: Set if we're called by the session cleanup code.
|
||||
+ */
|
||||
+static int vbg_set_host_capabilities(struct vbg_dev *gdev,
|
||||
+ struct vbg_session *session,
|
||||
+ bool session_termination)
|
||||
+{
|
||||
+ struct vmmdev_mask *req;
|
||||
+ u32 caps;
|
||||
+ int rc;
|
||||
+
|
||||
+ WARN_ON(!mutex_is_locked(&gdev->session_mutex));
|
||||
+
|
||||
+ caps = gdev->set_guest_caps_tracker.mask;
|
||||
+
|
||||
+ if (gdev->guest_caps_host == caps)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* On termination the requestor is the kernel, as we're cleaning up. */
|
||||
+ req = vbg_req_alloc(sizeof(*req), VMMDEVREQ_SET_GUEST_CAPABILITIES,
|
||||
+ session_termination ? VBG_KERNEL_REQUEST :
|
||||
+ session->requestor);
|
||||
+ if (!req) {
|
||||
+ gdev->guest_caps_host = U32_MAX;
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ req->or_mask = caps;
|
||||
+ req->not_mask = ~caps;
|
||||
+ rc = vbg_req_perform(gdev, req);
|
||||
+ vbg_req_free(req, sizeof(*req));
|
||||
+
|
||||
+ gdev->guest_caps_host = (rc >= 0) ? caps : U32_MAX;
|
||||
+
|
||||
+ return vbg_status_code_to_errno(rc);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Sets the guest capabilities for a session. Takes the session spinlock.
|
||||
* Return: 0 or negative errno value.
|
||||
@@ -678,23 +720,8 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
||||
u32 or_mask, u32 not_mask,
|
||||
bool session_termination)
|
||||
{
|
||||
- struct vmmdev_mask *req;
|
||||
u32 changed, previous;
|
||||
- int rc, ret = 0;
|
||||
-
|
||||
- /*
|
||||
- * Allocate a request buffer before taking the spinlock, when
|
||||
- * the session is being terminated the requestor is the kernel,
|
||||
- * as we're cleaning up.
|
||||
- */
|
||||
- req = vbg_req_alloc(sizeof(*req), VMMDEVREQ_SET_GUEST_CAPABILITIES,
|
||||
- session_termination ? VBG_KERNEL_REQUEST :
|
||||
- session->requestor);
|
||||
- if (!req) {
|
||||
- if (!session_termination)
|
||||
- return -ENOMEM;
|
||||
- /* Ignore allocation failure, we must do session cleanup. */
|
||||
- }
|
||||
+ int ret = 0;
|
||||
|
||||
mutex_lock(&gdev->session_mutex);
|
||||
|
||||
@@ -709,23 +736,10 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
||||
goto out;
|
||||
|
||||
vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed, previous);
|
||||
- or_mask = gdev->set_guest_caps_tracker.mask;
|
||||
-
|
||||
- if (gdev->guest_caps_host == or_mask || !req)
|
||||
- goto out;
|
||||
-
|
||||
- gdev->guest_caps_host = or_mask;
|
||||
- req->or_mask = or_mask;
|
||||
- req->not_mask = ~or_mask;
|
||||
- rc = vbg_req_perform(gdev, req);
|
||||
- if (rc < 0) {
|
||||
- ret = vbg_status_code_to_errno(rc);
|
||||
-
|
||||
- /* Failed, roll back (unless it's session termination time). */
|
||||
- gdev->guest_caps_host = U32_MAX;
|
||||
- if (session_termination)
|
||||
- goto out;
|
||||
|
||||
+ ret = vbg_set_host_capabilities(gdev, session, session_termination);
|
||||
+ /* Roll back on failure, unless it's session termination time. */
|
||||
+ if (ret < 0 && !session_termination) {
|
||||
vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed,
|
||||
session->set_guest_caps);
|
||||
session->set_guest_caps = previous;
|
||||
@@ -733,7 +747,6 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
||||
|
||||
out:
|
||||
mutex_unlock(&gdev->session_mutex);
|
||||
- vbg_req_free(req, sizeof(*req));
|
||||
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
30
0001-virt-vbox-Log-unknown-ioctl-requests-as-error.patch
Normal file
30
0001-virt-vbox-Log-unknown-ioctl-requests-as-error.patch
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Tue, 19 May 2020 11:24:43 +0200
|
||||
Subject: [PATCH] virt: vbox: Log unknown ioctl requests as error
|
||||
|
||||
Every now and then upstream adds new ioctls without notifying us,
|
||||
log unknown ioctl requests as an error to catch these.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
|
||||
---
|
||||
drivers/virt/vboxguest/vboxguest_core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
index ffd76b949276..e0e343d0ba93 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.c
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
@@ -1739,7 +1739,7 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
|
||||
return vbg_ioctl_log(data);
|
||||
}
|
||||
|
||||
- vbg_debug("VGDrvCommonIoCtl: Unknown req %#08x\n", req);
|
||||
+ vbg_err("Userspace made an unknown ioctl req %#08x\n", req);
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
103
0001-virt-vbox-Rename-guest_caps-struct-members-to-set_gu.patch
Normal file
103
0001-virt-vbox-Rename-guest_caps-struct-members-to-set_gu.patch
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Tue, 19 May 2020 14:33:13 +0200
|
||||
Subject: [PATCH] virt: vbox: Rename guest_caps struct members to
|
||||
set_guest_caps
|
||||
|
||||
Rename guest_caps[_tracker] struct members to set_guest_caps[_tracker]
|
||||
this is a preparation patch for adding support for the
|
||||
VBGL_IOCTL_GUEST_CAPS_ACQUIRE ioctl.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Upstream Status: https://lore.kernel.org/lkml/20200520195440.38759-1-hdegoede@redhat.com/
|
||||
---
|
||||
drivers/virt/vboxguest/vboxguest_core.c | 20 ++++++++++----------
|
||||
drivers/virt/vboxguest/vboxguest_core.h | 9 +++++----
|
||||
2 files changed, 15 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
index 18ebd7a6af98..aee5eff229f2 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.c
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.c
|
||||
@@ -699,17 +699,17 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
||||
mutex_lock(&gdev->session_mutex);
|
||||
|
||||
/* Apply the changes to the session mask. */
|
||||
- previous = session->guest_caps;
|
||||
- session->guest_caps |= or_mask;
|
||||
- session->guest_caps &= ~not_mask;
|
||||
+ previous = session->set_guest_caps;
|
||||
+ session->set_guest_caps |= or_mask;
|
||||
+ session->set_guest_caps &= ~not_mask;
|
||||
|
||||
/* If anything actually changed, update the global usage counters. */
|
||||
- changed = previous ^ session->guest_caps;
|
||||
+ changed = previous ^ session->set_guest_caps;
|
||||
if (!changed)
|
||||
goto out;
|
||||
|
||||
- vbg_track_bit_usage(&gdev->guest_caps_tracker, changed, previous);
|
||||
- or_mask = gdev->guest_caps_tracker.mask;
|
||||
+ vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed, previous);
|
||||
+ or_mask = gdev->set_guest_caps_tracker.mask;
|
||||
|
||||
if (gdev->guest_caps_host == or_mask || !req)
|
||||
goto out;
|
||||
@@ -726,9 +726,9 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
||||
if (session_termination)
|
||||
goto out;
|
||||
|
||||
- vbg_track_bit_usage(&gdev->guest_caps_tracker, changed,
|
||||
- session->guest_caps);
|
||||
- session->guest_caps = previous;
|
||||
+ vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed,
|
||||
+ session->set_guest_caps);
|
||||
+ session->set_guest_caps = previous;
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -1452,7 +1452,7 @@ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- caps->u.out.session_caps = session->guest_caps;
|
||||
+ caps->u.out.session_caps = session->set_guest_caps;
|
||||
caps->u.out.global_caps = gdev->guest_caps_host;
|
||||
|
||||
return 0;
|
||||
diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
|
||||
index 77c3a9c8255d..dc745a033164 100644
|
||||
--- a/drivers/virt/vboxguest/vboxguest_core.h
|
||||
+++ b/drivers/virt/vboxguest/vboxguest_core.h
|
||||
@@ -118,11 +118,12 @@ struct vbg_dev {
|
||||
u32 event_filter_host;
|
||||
|
||||
/**
|
||||
- * Usage counters for guest capabilities. Indexed by capability bit
|
||||
+ * Usage counters for guest capabilities requested through
|
||||
+ * vbg_set_session_capabilities(). Indexed by capability bit
|
||||
* number, one count per session using a capability.
|
||||
* Protected by session_mutex.
|
||||
*/
|
||||
- struct vbg_bit_usage_tracker guest_caps_tracker;
|
||||
+ struct vbg_bit_usage_tracker set_guest_caps_tracker;
|
||||
/**
|
||||
* The guest capabilities last reported to the host (or UINT32_MAX).
|
||||
* Protected by session_mutex.
|
||||
@@ -164,11 +165,11 @@ struct vbg_session {
|
||||
*/
|
||||
u32 event_filter;
|
||||
/**
|
||||
- * Guest capabilities for this session.
|
||||
+ * Guest capabilities set through vbg_set_session_capabilities().
|
||||
* A capability claimed by any guest session will be reported to the
|
||||
* host. Protected by vbg_gdev.session_mutex.
|
||||
*/
|
||||
- u32 guest_caps;
|
||||
+ u32 set_guest_caps;
|
||||
/** VMMDEV_REQUESTOR_* flags */
|
||||
u32 requestor;
|
||||
/** Set on CANCEL_ALL_WAITEVENTS, protected by vbg_devevent_spinlock. */
|
||||
--
|
||||
2.26.2
|
||||
|
||||
161
0001-xen-events-avoid-removing-an-event-channel-while-han.patch
Normal file
161
0001-xen-events-avoid-removing-an-event-channel-while-han.patch
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
From 073d0552ead5bfc7a3a9c01de590e924f11b5dd2 Mon Sep 17 00:00:00 2001
|
||||
From: Juergen Gross <jgross@suse.com>
|
||||
Date: Mon, 7 Sep 2020 15:47:27 +0200
|
||||
Subject: [PATCH] xen/events: avoid removing an event channel while handling it
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Today it can happen that an event channel is being removed from the
|
||||
system while the event handling loop is active. This can lead to a
|
||||
race resulting in crashes or WARN() splats when trying to access the
|
||||
irq_info structure related to the event channel.
|
||||
|
||||
Fix this problem by using a rwlock taken as reader in the event
|
||||
handling loop and as writer when deallocating the irq_info structure.
|
||||
|
||||
As the observed problem was a NULL dereference in evtchn_from_irq()
|
||||
make this function more robust against races by testing the irq_info
|
||||
pointer to be not NULL before dereferencing it.
|
||||
|
||||
And finally make all accesses to evtchn_to_irq[row][col] atomic ones
|
||||
in order to avoid seeing partial updates of an array element in irq
|
||||
handling. Note that irq handling can be entered only for event channels
|
||||
which have been valid before, so any not populated row isn't a problem
|
||||
in this regard, as rows are only ever added and never removed.
|
||||
|
||||
This is XSA-331.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
Reported-by: Jinoh Kang <luke1337@theori.io>
|
||||
Signed-off-by: Juergen Gross <jgross@suse.com>
|
||||
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
|
||||
Reviewed-by: Wei Liu <wl@xen.org>
|
||||
---
|
||||
drivers/xen/events/events_base.c | 41 ++++++++++++++++++++++++++++----
|
||||
1 file changed, 36 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
|
||||
index 6f02c18fa65c..407741ece084 100644
|
||||
--- a/drivers/xen/events/events_base.c
|
||||
+++ b/drivers/xen/events/events_base.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/irqnr.h>
|
||||
#include <linux/pci.h>
|
||||
+#include <linux/spinlock.h>
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
#include <asm/desc.h>
|
||||
@@ -71,6 +72,23 @@ const struct evtchn_ops *evtchn_ops;
|
||||
*/
|
||||
static DEFINE_MUTEX(irq_mapping_update_lock);
|
||||
|
||||
+/*
|
||||
+ * Lock protecting event handling loop against removing event channels.
|
||||
+ * Adding of event channels is no issue as the associated IRQ becomes active
|
||||
+ * only after everything is setup (before request_[threaded_]irq() the handler
|
||||
+ * can't be entered for an event, as the event channel will be unmasked only
|
||||
+ * then).
|
||||
+ */
|
||||
+static DEFINE_RWLOCK(evtchn_rwlock);
|
||||
+
|
||||
+/*
|
||||
+ * Lock hierarchy:
|
||||
+ *
|
||||
+ * irq_mapping_update_lock
|
||||
+ * evtchn_rwlock
|
||||
+ * IRQ-desc lock
|
||||
+ */
|
||||
+
|
||||
static LIST_HEAD(xen_irq_list_head);
|
||||
|
||||
/* IRQ <-> VIRQ mapping. */
|
||||
@@ -105,7 +123,7 @@ static void clear_evtchn_to_irq_row(unsigned row)
|
||||
unsigned col;
|
||||
|
||||
for (col = 0; col < EVTCHN_PER_ROW; col++)
|
||||
- evtchn_to_irq[row][col] = -1;
|
||||
+ WRITE_ONCE(evtchn_to_irq[row][col], -1);
|
||||
}
|
||||
|
||||
static void clear_evtchn_to_irq_all(void)
|
||||
@@ -142,7 +160,7 @@ static int set_evtchn_to_irq(evtchn_port_t evtchn, unsigned int irq)
|
||||
clear_evtchn_to_irq_row(row);
|
||||
}
|
||||
|
||||
- evtchn_to_irq[row][col] = irq;
|
||||
+ WRITE_ONCE(evtchn_to_irq[row][col], irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -152,7 +170,7 @@ int get_evtchn_to_irq(evtchn_port_t evtchn)
|
||||
return -1;
|
||||
if (evtchn_to_irq[EVTCHN_ROW(evtchn)] == NULL)
|
||||
return -1;
|
||||
- return evtchn_to_irq[EVTCHN_ROW(evtchn)][EVTCHN_COL(evtchn)];
|
||||
+ return READ_ONCE(evtchn_to_irq[EVTCHN_ROW(evtchn)][EVTCHN_COL(evtchn)]);
|
||||
}
|
||||
|
||||
/* Get info for IRQ */
|
||||
@@ -261,10 +279,14 @@ static void xen_irq_info_cleanup(struct irq_info *info)
|
||||
*/
|
||||
evtchn_port_t evtchn_from_irq(unsigned irq)
|
||||
{
|
||||
- if (WARN(irq >= nr_irqs, "Invalid irq %d!\n", irq))
|
||||
+ const struct irq_info *info = NULL;
|
||||
+
|
||||
+ if (likely(irq < nr_irqs))
|
||||
+ info = info_for_irq(irq);
|
||||
+ if (!info)
|
||||
return 0;
|
||||
|
||||
- return info_for_irq(irq)->evtchn;
|
||||
+ return info->evtchn;
|
||||
}
|
||||
|
||||
unsigned int irq_from_evtchn(evtchn_port_t evtchn)
|
||||
@@ -440,16 +462,21 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi)
|
||||
static void xen_free_irq(unsigned irq)
|
||||
{
|
||||
struct irq_info *info = info_for_irq(irq);
|
||||
+ unsigned long flags;
|
||||
|
||||
if (WARN_ON(!info))
|
||||
return;
|
||||
|
||||
+ write_lock_irqsave(&evtchn_rwlock, flags);
|
||||
+
|
||||
list_del(&info->list);
|
||||
|
||||
set_info_for_irq(irq, NULL);
|
||||
|
||||
WARN_ON(info->refcnt > 0);
|
||||
|
||||
+ write_unlock_irqrestore(&evtchn_rwlock, flags);
|
||||
+
|
||||
kfree(info);
|
||||
|
||||
/* Legacy IRQ descriptors are managed by the arch. */
|
||||
@@ -1233,6 +1260,8 @@ static void __xen_evtchn_do_upcall(void)
|
||||
struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
|
||||
int cpu = smp_processor_id();
|
||||
|
||||
+ read_lock(&evtchn_rwlock);
|
||||
+
|
||||
do {
|
||||
vcpu_info->evtchn_upcall_pending = 0;
|
||||
|
||||
@@ -1243,6 +1272,8 @@ static void __xen_evtchn_do_upcall(void)
|
||||
virt_rmb(); /* Hypervisor can set upcall pending. */
|
||||
|
||||
} while (vcpu_info->evtchn_upcall_pending);
|
||||
+
|
||||
+ read_unlock(&evtchn_rwlock);
|
||||
}
|
||||
|
||||
void xen_evtchn_do_upcall(struct pt_regs *regs)
|
||||
--
|
||||
2.28.0
|
||||
|
||||
101
0002-arm64-tegra-Re-order-PCIe-aperture-mappings-to-suppo.patch
Normal file
101
0002-arm64-tegra-Re-order-PCIe-aperture-mappings-to-suppo.patch
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
From 6acf1ba7596a051d6ff4092d22bf9c4ce210d9f5 Mon Sep 17 00:00:00 2001
|
||||
From: Vidya Sagar <vidyas@nvidia.com>
|
||||
Date: Sat, 11 Jan 2020 00:44:59 +0530
|
||||
Subject: [PATCH 2/2] arm64: tegra: Re-order PCIe aperture mappings to support
|
||||
ACPI boot
|
||||
|
||||
Re-order Tegra194's PCIe aperture mappings to have IO window moved to
|
||||
64-bit aperture and have the entire 32-bit aperture used for accessing
|
||||
the configuration space. This makes it to use the entire 32MB of the 32-bit
|
||||
aperture for ECAM purpose while booting through ACPI.
|
||||
|
||||
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
|
||||
---
|
||||
arch/arm64/boot/dts/nvidia/tegra194.dtsi | 36 ++++++++++++------------
|
||||
1 file changed, 18 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
|
||||
index 4bc187a4eacdb..2b378fa06d19e 100644
|
||||
--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
|
||||
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
|
||||
@@ -1404,9 +1404,9 @@ pcie@14100000 {
|
||||
nvidia,aspm-l0s-entrance-latency-us = <3>;
|
||||
|
||||
bus-range = <0x0 0xff>;
|
||||
- ranges = <0x81000000 0x0 0x30100000 0x0 0x30100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
- 0xc3000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */
|
||||
- 0x82000000 0x0 0x40000000 0x12 0x30000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */
|
||||
+ ranges = <0xc3000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */
|
||||
+ 0x82000000 0x00 0x40000000 0x12 0x30000000 0x0 0x0fff0000 /* non-prefetchable memory (256MB - 64KB) */
|
||||
+ 0x81000000 0x00 0x00000000 0x12 0x3fff0000 0x0 0x00010000>; /* downstream I/O (64KB) */
|
||||
};
|
||||
|
||||
pcie@14120000 {
|
||||
@@ -1449,9 +1449,9 @@ pcie@14120000 {
|
||||
nvidia,aspm-l0s-entrance-latency-us = <3>;
|
||||
|
||||
bus-range = <0x0 0xff>;
|
||||
- ranges = <0x81000000 0x0 0x32100000 0x0 0x32100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
- 0xc3000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */
|
||||
- 0x82000000 0x0 0x40000000 0x12 0x70000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */
|
||||
+ ranges = <0xc3000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */
|
||||
+ 0x82000000 0x00 0x40000000 0x12 0x70000000 0x0 0x0fff0000 /* non-prefetchable memory (256MB - 64KB) */
|
||||
+ 0x81000000 0x00 0x00000000 0x12 0x7fff0000 0x0 0x00010000>; /* downstream I/O (64KB) */
|
||||
};
|
||||
|
||||
pcie@14140000 {
|
||||
@@ -1494,9 +1494,9 @@ pcie@14140000 {
|
||||
nvidia,aspm-l0s-entrance-latency-us = <3>;
|
||||
|
||||
bus-range = <0x0 0xff>;
|
||||
- ranges = <0x81000000 0x0 0x34100000 0x0 0x34100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
- 0xc3000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */
|
||||
- 0x82000000 0x0 0x40000000 0x12 0xb0000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */
|
||||
+ ranges = <0xc3000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */
|
||||
+ 0x82000000 0x00 0x40000000 0x12 0xb0000000 0x0 0x0fff0000 /* non-prefetchable memory (256MB - 64KB) */
|
||||
+ 0x81000000 0x00 0x00000000 0x12 0xbfff0000 0x0 0x00010000>; /* downstream I/O (64KB) */
|
||||
};
|
||||
|
||||
pcie@14160000 {
|
||||
@@ -1539,9 +1539,9 @@ pcie@14160000 {
|
||||
nvidia,aspm-l0s-entrance-latency-us = <3>;
|
||||
|
||||
bus-range = <0x0 0xff>;
|
||||
- ranges = <0x81000000 0x0 0x36100000 0x0 0x36100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
- 0xc3000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */
|
||||
- 0x82000000 0x0 0x40000000 0x17 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */
|
||||
+ ranges = <0xc3000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */
|
||||
+ 0x82000000 0x00 0x40000000 0x17 0x40000000 0x0 0xbfff0000 /* non-prefetchable memory (3GB - 64KB) */
|
||||
+ 0x81000000 0x00 0x00000000 0x17 0xffff0000 0x0 0x00010000>; /* downstream I/O (64KB) */
|
||||
};
|
||||
|
||||
pcie@14180000 {
|
||||
@@ -1584,9 +1584,9 @@ pcie@14180000 {
|
||||
nvidia,aspm-l0s-entrance-latency-us = <3>;
|
||||
|
||||
bus-range = <0x0 0xff>;
|
||||
- ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
- 0xc3000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */
|
||||
- 0x82000000 0x0 0x40000000 0x1b 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */
|
||||
+ ranges = <0xc3000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */
|
||||
+ 0x82000000 0x00 0x40000000 0x1b 0x40000000 0x0 0xbfff0000 /* non-prefetchable memory (3GB - 64KB) */
|
||||
+ 0x81000000 0x00 0x00000000 0x1b 0xffff0000 0x0 0x00010000>; /* downstream I/O (64KB) */
|
||||
};
|
||||
|
||||
pcie@141a0000 {
|
||||
@@ -1633,9 +1633,9 @@ pcie@141a0000 {
|
||||
nvidia,aspm-l0s-entrance-latency-us = <3>;
|
||||
|
||||
bus-range = <0x0 0xff>;
|
||||
- ranges = <0x81000000 0x0 0x3a100000 0x0 0x3a100000 0x0 0x00100000 /* downstream I/O (1MB) */
|
||||
- 0xc3000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */
|
||||
- 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */
|
||||
+ ranges = <0xc3000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */
|
||||
+ 0x82000000 0x00 0x40000000 0x1f 0x40000000 0x0 0xbfff0000 /* non-prefetchable memory (3GB - 64KB) */
|
||||
+ 0x81000000 0x00 0x00000000 0x1f 0xffff0000 0x0 0x00010000>; /* downstream I/O (64KB) */
|
||||
};
|
||||
|
||||
pcie_ep@14160000 {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
From 520e902d864930e2d4f329983d9ae9781a24231f Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 2 Oct 2017 18:18:30 -0400
|
||||
Subject: [PATCH 3/3] Make get_cert_list() use efi_status_to_str() to print
|
||||
error messages.
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
security/integrity/platform_certs/load_uefi.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
|
||||
index 9ef34c44fd1..13a2826715d 100644
|
||||
--- a/security/integrity/platform_certs/load_uefi.c
|
||||
+++ b/security/integrity/platform_certs/load_uefi.c
|
||||
@@ -51,7 +51,8 @@ static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
}
|
||||
|
||||
if (status != EFI_BUFFER_TOO_SMALL) {
|
||||
- pr_err("Couldn't get size: 0x%lx\n", status);
|
||||
+ pr_err("Couldn't get size: %s (0x%lx)\n",
|
||||
+ efi_status_to_str(status), status);
|
||||
return efi_status_to_err(status);
|
||||
}
|
||||
|
||||
@@ -64,7 +65,8 @@ static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
status = efi.get_variable(name, guid, NULL, &lsize, db);
|
||||
if (status != EFI_SUCCESS) {
|
||||
kfree(db);
|
||||
- pr_err("Error reading db var: 0x%lx\n", status);
|
||||
+ pr_err("Error reading db var: %s (0x%lx)\n",
|
||||
+ efi_status_to_str(status), status);
|
||||
return efi_status_to_err(status);
|
||||
}
|
||||
|
||||
--
|
||||
2.15.0
|
||||
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
From patchwork Sun Oct 25 14:01:44 2020
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Adam Sampson <ats@offog.org>
|
||||
X-Patchwork-Id: 11855267
|
||||
Return-Path:
|
||||
<SRS0=8R9C=EA=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH,
|
||||
DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,
|
||||
MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,
|
||||
USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id D1D99C388F7
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Sun, 25 Oct 2020 14:04:02 +0000 (UTC)
|
||||
Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id 539B92225E
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Sun, 25 Oct 2020 14:04:02 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="pKL4zMU1"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 539B92225E
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=offog.org
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding:
|
||||
Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive:
|
||||
List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From:
|
||||
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
|
||||
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
|
||||
bh=Smw7tRUwTAlV9zXVX1uVl3+PN3QebXDyiZrExxBSCPU=; b=pKL4zMU1LMKGyGrnNBuRIJVlPn
|
||||
yMf8/tMv8w7BT/mMtZkxY22WUlN4IpqNLAx1mdiIa5VUVbVpdsXYWYdSWaUvJe24nyJi8NycxIoO8
|
||||
168UTytxMlzI5F18yr9bXZ79rSRW+/P0zQbb+OQPMPbJPNb1RusFtve8WGNCkqlOWUOpiVQqPFPJ9
|
||||
hGhOsDJhXjep7y7HNpu7+UBYvZInmOOrAS079WoEc1jX4u6zDXt0ox24r0Fcc8wnVpsWpGxPhb0xZ
|
||||
uZtguJOo2ItQdeT/6OfafjzV15qXfPGK+148ny4vyOvgHNvJX88R6RBIxqUdvQzoh10GTlb76K45i
|
||||
Gfx5ufkA==;
|
||||
Received: from localhost ([::1] helo=merlin.infradead.org)
|
||||
by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kWgb2-0000uB-6w; Sun, 25 Oct 2020 14:02:08 +0000
|
||||
Received: from a-painless.mh.aa.net.uk ([2001:8b0:0:30::51]
|
||||
helo=alt.a-painless.mh.aa.net.uk)
|
||||
by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kWgaz-0000tq-Kq
|
||||
for linux-arm-kernel@lists.infradead.org; Sun, 25 Oct 2020 14:02:06 +0000
|
||||
Received: from cartman.offog.org ([2001:8b0:83b:b53f::a])
|
||||
by a-painless.mh.aa.net.uk with esmtps
|
||||
(TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
|
||||
(envelope-from <ats@offog.org>)
|
||||
id 1kWgay-0001oV-R0; Sun, 25 Oct 2020 14:02:04 +0000
|
||||
Received: from ats by cartman.offog.org with local (Exim 4.94)
|
||||
(envelope-from <ats@offog.org>)
|
||||
id 1kWgao-0007UQ-4s; Sun, 25 Oct 2020 14:01:54 +0000
|
||||
From: Adam Sampson <ats@offog.org>
|
||||
To: linux-sunxi@googlegroups.com, devicetree@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org
|
||||
Subject: [PATCH] ARM: dts: sun7i: pcduino3-nano: enable RGMII RX/TX delay on
|
||||
PHY
|
||||
Date: Sun, 25 Oct 2020 14:01:44 +0000
|
||||
Message-Id: <20201025140144.28693-1-ats@offog.org>
|
||||
X-Mailer: git-send-email 2.29.1
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20201025_100205_812453_7FAF68C8
|
||||
X-CRM114-Status: GOOD ( 13.85 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: Adam Sampson <ats@offog.org>
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
|
||||
The RX/TX delays for the Ethernet PHY on the Linksprite pcDuino 3 Nano
|
||||
are configured in hardware, using resistors that are populated to pull
|
||||
the RTL8211E's RXDLY/TXDLY pins low or high as needed.
|
||||
|
||||
phy-mode should be set to rgmii-id to reflect this. Previously it was
|
||||
set to rgmii, which used to work but now results in the delays being
|
||||
disabled again as a result of the bugfix in commit bbc4d71d6354 ("net:
|
||||
phy: realtek: fix rtl8211e rx/tx delay config").
|
||||
|
||||
Tested on two pcDuino 3 Nano boards purchased in 2015. Without this fix,
|
||||
Ethernet works unreliably on one board and doesn't work at all on the
|
||||
other.
|
||||
|
||||
Fixes: 061035d456c9 ("ARM: dts: sun7i: Add dts file for pcDuino 3 Nano board")
|
||||
Signed-off-by: Adam Sampson <ats@offog.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
---
|
||||
arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
|
||||
index fce2f7fcd084..bf38c66c1815 100644
|
||||
--- a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
|
||||
+++ b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright 2015 Adam Sampson <ats@offog.org>
|
||||
+ * Copyright 2015-2020 Adam Sampson <ats@offog.org>
|
||||
*
|
||||
* This file is dual-licensed: you can use it either under the terms
|
||||
* of the GPL or the X11 license, at your option. Note that this dual
|
||||
@@ -115,7 +115,7 @@ &gmac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&gmac_rgmii_pins>;
|
||||
phy-handle = <&phy1>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
122
ARM-dts-sun8i-r40-bananapi-m2-ultra-Fix-ethernet-node.patch
Normal file
122
ARM-dts-sun8i-r40-bananapi-m2-ultra-Fix-ethernet-node.patch
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
From patchwork Sun Oct 25 08:19:49 2020
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?=
|
||||
<jernej.skrabec@siol.net>
|
||||
X-Patchwork-Id: 11855181
|
||||
Return-Path:
|
||||
<SRS0=8R9C=EA=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH,
|
||||
DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,
|
||||
MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,
|
||||
USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id B6AE3C388F7
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Sun, 25 Oct 2020 08:16:10 +0000 (UTC)
|
||||
Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id 4237B22202
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Sun, 25 Oct 2020 08:16:10 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="aQsCF8Xs"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4237B22202
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=siol.net
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding:
|
||||
Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive:
|
||||
List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From:
|
||||
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
|
||||
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
|
||||
bh=OVfJGYUKDO8EDgWuqz0sWx0VmV2S5JECcAK3tuelNEg=; b=aQsCF8XsLEVFht8Uw49dbRkjUb
|
||||
l0/cqvHPmMU+u1YDBGKvcHh84au6Ycu0Yj9KpXz1xyyZWpw3J8kumzmmHbIf1PdmBIQgJHKVu2lJB
|
||||
DrsvuVRLcfl4PiJk/s26XVtl0otfluZWdH0lyPc9ZbOOeAQOrgVFTWdgOmv3UPOjLS5hT0jFnrRx2
|
||||
nMmHSImA04dLm7r0sDICCwVxYte3PcLFdPKOl/InrqErMZfVhNRXg39QBEHPhfjXebMpFYdxi25xP
|
||||
AX7Ki+J4I5Tln9McKb/VFPFmfxkImZH3cE+PQSwLSWgOniF2onxFBKZdZvqWM7CtGe4PNF1WMebvy
|
||||
88mZj4WA==;
|
||||
Received: from localhost ([::1] helo=merlin.infradead.org)
|
||||
by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kWbAd-0001fY-U8; Sun, 25 Oct 2020 08:14:31 +0000
|
||||
Received: from mailoutvs12.siol.net ([185.57.226.203] helo=mail.siol.net)
|
||||
by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kWbAW-0001eg-7I
|
||||
for linux-arm-kernel@lists.infradead.org; Sun, 25 Oct 2020 08:14:25 +0000
|
||||
Received: from localhost (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTP id 3296D529E39;
|
||||
Sun, 25 Oct 2020 09:14:22 +0100 (CET)
|
||||
X-Virus-Scanned: amavisd-new at psrvmta09.zcs-production.pri
|
||||
Received: from mail.siol.net ([127.0.0.1])
|
||||
by localhost (psrvmta09.zcs-production.pri [127.0.0.1]) (amavisd-new,
|
||||
port 10032)
|
||||
with ESMTP id aIRB7Go1sYw4; Sun, 25 Oct 2020 09:14:22 +0100 (CET)
|
||||
Received: from mail.siol.net (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTPS id E682152A0BE;
|
||||
Sun, 25 Oct 2020 09:14:21 +0100 (CET)
|
||||
Received: from kista.localdomain (cpe1-5-97.cable.triera.net [213.161.5.97])
|
||||
(Authenticated sender: 031275009)
|
||||
by mail.siol.net (Postfix) with ESMTPSA id A68F0529E39;
|
||||
Sun, 25 Oct 2020 09:14:21 +0100 (CET)
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
To: mripard@kernel.org,
|
||||
wens@csie.org
|
||||
Subject: [PATCH] ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix ethernet node
|
||||
Date: Sun, 25 Oct 2020 09:19:49 +0100
|
||||
Message-Id: <20201025081949.783443-1-jernej.skrabec@siol.net>
|
||||
X-Mailer: git-send-email 2.29.1
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20201025_041424_405883_C92DFA93
|
||||
X-CRM114-Status: GOOD ( 11.20 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com,
|
||||
robh+dt@kernel.org, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
|
||||
Ethernet PHY on BananaPi M2 Ultra provides RX and TX delays. Fix
|
||||
ethernet node to reflect that fact.
|
||||
|
||||
Fixes: c36fd5a48bd2 ("ARM: dts: sun8i: r40: bananapi-m2-ultra: Enable GMAC ethernet controller")
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
|
||||
index 2fc62ef0cb3e..a6a1087a0c9b 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
|
||||
@@ -129,7 +129,7 @@ &gmac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&gmac_rgmii_pins>;
|
||||
phy-handle = <&phy1>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
phy-supply = <®_dc1sw>;
|
||||
status = "okay";
|
||||
};
|
||||
305
CVE-2020-16119-DCCP-CCID-structure-use-after-free.patch
Normal file
305
CVE-2020-16119-DCCP-CCID-structure-use-after-free.patch
Normal file
|
|
@ -0,0 +1,305 @@
|
|||
From MAILER-DAEMON Wed Oct 14 16:34:37 2020
|
||||
From: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
|
||||
To: netdev@vger.kernel.org
|
||||
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thadeu Lima de Souza Cascardo <cascardo@canonical.com>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, "Alexander A. Klimov" <grandmaster@al2klimov.de>, Kees Cook <keescook@chromium.org>, Eric Dumazet <edumazet@google.com>, Alexey Kodanev <alexey.kodanev@oracle.com>, dccp@vger.kernel.org, linux-kernel@vger.kernel.org
|
||||
Subject: [PATCH 1/2] dccp: ccid: move timers to struct dccp_sock
|
||||
Date: Tue, 13 Oct 2020 19:18:48 +0200
|
||||
Message-Id: <20201013171849.236025-2-kleber.souza@canonical.com>
|
||||
In-Reply-To: <20201013171849.236025-1-kleber.souza@canonical.com>
|
||||
References: <20201013171849.236025-1-kleber.souza@canonical.com>
|
||||
List-ID: <linux-kernel.vger.kernel.org>
|
||||
X-Mailing-List: linux-kernel@vger.kernel.org
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
Content-Transfer-Encoding: 7bit
|
||||
|
||||
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
|
||||
|
||||
When dccps_hc_tx_ccid is freed, ccid timers may still trigger. The reason
|
||||
del_timer_sync can't be used is because this relies on keeping a reference
|
||||
to struct sock. But as we keep a pointer to dccps_hc_tx_ccid and free that
|
||||
during disconnect, the timer should really belong to struct dccp_sock.
|
||||
|
||||
This addresses CVE-2020-16119.
|
||||
|
||||
Fixes: 839a6094140a (net: dccp: Convert timers to use timer_setup())
|
||||
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
|
||||
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
|
||||
Acked-bd: Richard Sailer <richard_siegfried@systemli.org>
|
||||
---
|
||||
include/linux/dccp.h | 2 ++
|
||||
net/dccp/ccids/ccid2.c | 32 +++++++++++++++++++-------------
|
||||
net/dccp/ccids/ccid3.c | 30 ++++++++++++++++++++----------
|
||||
3 files changed, 41 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
|
||||
index 07e547c02fd8..504afa1a4be6 100644
|
||||
--- a/include/linux/dccp.h
|
||||
+++ b/include/linux/dccp.h
|
||||
@@ -259,6 +259,7 @@ struct dccp_ackvec;
|
||||
* @dccps_sync_scheduled - flag which signals "send out-of-band message soon"
|
||||
* @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
|
||||
* @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
|
||||
+ * @dccps_ccid_timer - used by the CCIDs
|
||||
* @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
|
||||
*/
|
||||
struct dccp_sock {
|
||||
@@ -303,6 +304,7 @@ struct dccp_sock {
|
||||
__u8 dccps_sync_scheduled:1;
|
||||
struct tasklet_struct dccps_xmitlet;
|
||||
struct timer_list dccps_xmit_timer;
|
||||
+ struct timer_list dccps_ccid_timer;
|
||||
};
|
||||
|
||||
static inline struct dccp_sock *dccp_sk(const struct sock *sk)
|
||||
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
|
||||
index 3da1f77bd039..dbca1f1e2449 100644
|
||||
--- a/net/dccp/ccids/ccid2.c
|
||||
+++ b/net/dccp/ccids/ccid2.c
|
||||
@@ -126,21 +126,26 @@ static void dccp_tasklet_schedule(struct sock *sk)
|
||||
|
||||
static void ccid2_hc_tx_rto_expire(struct timer_list *t)
|
||||
{
|
||||
- struct ccid2_hc_tx_sock *hc = from_timer(hc, t, tx_rtotimer);
|
||||
- struct sock *sk = hc->sk;
|
||||
- const bool sender_was_blocked = ccid2_cwnd_network_limited(hc);
|
||||
+ struct dccp_sock *dp = from_timer(dp, t, dccps_ccid_timer);
|
||||
+ struct sock *sk = (struct sock *)dp;
|
||||
+ struct ccid2_hc_tx_sock *hc;
|
||||
+ bool sender_was_blocked;
|
||||
|
||||
bh_lock_sock(sk);
|
||||
+
|
||||
+ if (inet_sk_state_load(sk) == DCCP_CLOSED)
|
||||
+ goto out;
|
||||
+
|
||||
+ hc = ccid_priv(dp->dccps_hc_tx_ccid);
|
||||
+ sender_was_blocked = ccid2_cwnd_network_limited(hc);
|
||||
+
|
||||
if (sock_owned_by_user(sk)) {
|
||||
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + HZ / 5);
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + HZ / 5);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ccid2_pr_debug("RTO_EXPIRE\n");
|
||||
|
||||
- if (sk->sk_state == DCCP_CLOSED)
|
||||
- goto out;
|
||||
-
|
||||
/* back-off timer */
|
||||
hc->tx_rto <<= 1;
|
||||
if (hc->tx_rto > DCCP_RTO_MAX)
|
||||
@@ -166,7 +171,7 @@ static void ccid2_hc_tx_rto_expire(struct timer_list *t)
|
||||
if (sender_was_blocked)
|
||||
dccp_tasklet_schedule(sk);
|
||||
/* restart backed-off timer */
|
||||
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
|
||||
out:
|
||||
bh_unlock_sock(sk);
|
||||
sock_put(sk);
|
||||
@@ -330,7 +335,7 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, unsigned int len)
|
||||
}
|
||||
#endif
|
||||
|
||||
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
|
||||
|
||||
#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
|
||||
do {
|
||||
@@ -700,9 +705,9 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
||||
|
||||
/* restart RTO timer if not all outstanding data has been acked */
|
||||
if (hc->tx_pipe == 0)
|
||||
- sk_stop_timer(sk, &hc->tx_rtotimer);
|
||||
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
|
||||
else
|
||||
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
|
||||
done:
|
||||
/* check if incoming Acks allow pending packets to be sent */
|
||||
if (sender_was_blocked && !ccid2_cwnd_network_limited(hc))
|
||||
@@ -737,17 +742,18 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
|
||||
hc->tx_last_cong = hc->tx_lsndtime = hc->tx_cwnd_stamp = ccid2_jiffies32;
|
||||
hc->tx_cwnd_used = 0;
|
||||
hc->sk = sk;
|
||||
- timer_setup(&hc->tx_rtotimer, ccid2_hc_tx_rto_expire, 0);
|
||||
+ timer_setup(&dp->dccps_ccid_timer, ccid2_hc_tx_rto_expire, 0);
|
||||
INIT_LIST_HEAD(&hc->tx_av_chunks);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ccid2_hc_tx_exit(struct sock *sk)
|
||||
{
|
||||
+ struct dccp_sock *dp = dccp_sk(sk);
|
||||
struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
|
||||
int i;
|
||||
|
||||
- sk_stop_timer(sk, &hc->tx_rtotimer);
|
||||
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
|
||||
|
||||
for (i = 0; i < hc->tx_seqbufc; i++)
|
||||
kfree(hc->tx_seqbuf[i]);
|
||||
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
|
||||
index b9ee1a4a8955..685f4d046c0d 100644
|
||||
--- a/net/dccp/ccids/ccid3.c
|
||||
+++ b/net/dccp/ccids/ccid3.c
|
||||
@@ -184,17 +184,24 @@ static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hc,
|
||||
|
||||
static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
|
||||
{
|
||||
- struct ccid3_hc_tx_sock *hc = from_timer(hc, t, tx_no_feedback_timer);
|
||||
- struct sock *sk = hc->sk;
|
||||
+ struct dccp_sock *dp = from_timer(dp, t, dccps_ccid_timer);
|
||||
+ struct ccid3_hc_tx_sock *hc;
|
||||
+ struct sock *sk = (struct sock *)dp;
|
||||
unsigned long t_nfb = USEC_PER_SEC / 5;
|
||||
|
||||
bh_lock_sock(sk);
|
||||
+
|
||||
+ if (inet_sk_state_load(sk) == DCCP_CLOSED)
|
||||
+ goto out;
|
||||
+
|
||||
if (sock_owned_by_user(sk)) {
|
||||
/* Try again later. */
|
||||
/* XXX: set some sensible MIB */
|
||||
goto restart_timer;
|
||||
}
|
||||
|
||||
+ hc = ccid_priv(dp->dccps_hc_tx_ccid);
|
||||
+
|
||||
ccid3_pr_debug("%s(%p, state=%s) - entry\n", dccp_role(sk), sk,
|
||||
ccid3_tx_state_name(hc->tx_state));
|
||||
|
||||
@@ -250,8 +257,8 @@ static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
|
||||
t_nfb = max(hc->tx_t_rto, 2 * hc->tx_t_ipi);
|
||||
|
||||
restart_timer:
|
||||
- sk_reset_timer(sk, &hc->tx_no_feedback_timer,
|
||||
- jiffies + usecs_to_jiffies(t_nfb));
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer,
|
||||
+ jiffies + usecs_to_jiffies(t_nfb));
|
||||
out:
|
||||
bh_unlock_sock(sk);
|
||||
sock_put(sk);
|
||||
@@ -280,7 +287,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
|
||||
return -EBADMSG;
|
||||
|
||||
if (hc->tx_state == TFRC_SSTATE_NO_SENT) {
|
||||
- sk_reset_timer(sk, &hc->tx_no_feedback_timer, (jiffies +
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, (jiffies +
|
||||
usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)));
|
||||
hc->tx_last_win_count = 0;
|
||||
hc->tx_t_last_win_count = now;
|
||||
@@ -354,6 +361,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len)
|
||||
static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
|
||||
+ struct dccp_sock *dp = dccp_sk(sk);
|
||||
struct tfrc_tx_hist_entry *acked;
|
||||
ktime_t now;
|
||||
unsigned long t_nfb;
|
||||
@@ -420,7 +428,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
||||
(unsigned int)(hc->tx_x >> 6));
|
||||
|
||||
/* unschedule no feedback timer */
|
||||
- sk_stop_timer(sk, &hc->tx_no_feedback_timer);
|
||||
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
|
||||
|
||||
/*
|
||||
* As we have calculated new ipi, delta, t_nom it is possible
|
||||
@@ -445,8 +453,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
||||
"expire in %lu jiffies (%luus)\n",
|
||||
dccp_role(sk), sk, usecs_to_jiffies(t_nfb), t_nfb);
|
||||
|
||||
- sk_reset_timer(sk, &hc->tx_no_feedback_timer,
|
||||
- jiffies + usecs_to_jiffies(t_nfb));
|
||||
+ sk_reset_timer(sk, &dp->dccps_ccid_timer,
|
||||
+ jiffies + usecs_to_jiffies(t_nfb));
|
||||
}
|
||||
|
||||
static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
|
||||
@@ -488,21 +496,23 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
|
||||
|
||||
static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk)
|
||||
{
|
||||
+ struct dccp_sock *dp = dccp_sk(sk);
|
||||
struct ccid3_hc_tx_sock *hc = ccid_priv(ccid);
|
||||
|
||||
hc->tx_state = TFRC_SSTATE_NO_SENT;
|
||||
hc->tx_hist = NULL;
|
||||
hc->sk = sk;
|
||||
- timer_setup(&hc->tx_no_feedback_timer,
|
||||
+ timer_setup(&dp->dccps_ccid_timer,
|
||||
ccid3_hc_tx_no_feedback_timer, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ccid3_hc_tx_exit(struct sock *sk)
|
||||
{
|
||||
+ struct dccp_sock *dp = dccp_sk(sk);
|
||||
struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
|
||||
|
||||
- sk_stop_timer(sk, &hc->tx_no_feedback_timer);
|
||||
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
|
||||
tfrc_tx_hist_purge(&hc->tx_hist);
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From MAILER-DAEMON Wed Oct 14 16:34:37 2020
|
||||
From: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
|
||||
To: netdev@vger.kernel.org
|
||||
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thadeu Lima de Souza Cascardo <cascardo@canonical.com>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, "Alexander A. Klimov" <grandmaster@al2klimov.de>, Kees Cook <keescook@chromium.org>, Eric Dumazet <edumazet@google.com>, Alexey Kodanev <alexey.kodanev@oracle.com>, dccp@vger.kernel.org, linux-kernel@vger.kernel.org
|
||||
Subject: [PATCH 2/2] Revert "dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect()"
|
||||
Date: Tue, 13 Oct 2020 19:18:49 +0200
|
||||
Message-Id: <20201013171849.236025-3-kleber.souza@canonical.com>
|
||||
In-Reply-To: <20201013171849.236025-1-kleber.souza@canonical.com>
|
||||
References: <20201013171849.236025-1-kleber.souza@canonical.com>
|
||||
List-ID: <linux-kernel.vger.kernel.org>
|
||||
X-Mailing-List: linux-kernel@vger.kernel.org
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
Content-Transfer-Encoding: 7bit
|
||||
|
||||
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
|
||||
|
||||
This reverts commit 2677d20677314101293e6da0094ede7b5526d2b1.
|
||||
|
||||
This fixes an issue that after disconnect, dccps_hc_tx_ccid will still be
|
||||
kept, allowing the socket to be reused as a listener socket, and the cloned
|
||||
socket will free its dccps_hc_tx_ccid, leading to a later use after free,
|
||||
when the listener socket is closed.
|
||||
|
||||
This addresses CVE-2020-16119.
|
||||
|
||||
Fixes: 2677d2067731 (dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect())
|
||||
Reported-by: Hadar Manor
|
||||
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
|
||||
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
|
||||
Acked-by: Richard Sailer <richard_siegfried@systemli.org>
|
||||
---
|
||||
net/dccp/proto.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
|
||||
index 6d705d90c614..359e848dba6c 100644
|
||||
--- a/net/dccp/proto.c
|
||||
+++ b/net/dccp/proto.c
|
||||
@@ -279,7 +279,9 @@ int dccp_disconnect(struct sock *sk, int flags)
|
||||
|
||||
dccp_clear_xmit_timers(sk);
|
||||
ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
|
||||
+ ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
|
||||
dp->dccps_hc_rx_ccid = NULL;
|
||||
+ dp->dccps_hc_tx_ccid = NULL;
|
||||
|
||||
__skb_queue_purge(&sk->sk_receive_queue);
|
||||
__skb_queue_purge(&sk->sk_write_queue);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
||||
Date: Thu, 16 Apr 2015 13:01:46 -0400
|
||||
Subject: [PATCH] Input - synaptics: pin 3 touches when the firmware reports 3
|
||||
fingers
|
||||
|
||||
Synaptics PS/2 touchpad can send only 2 touches in a report. They can
|
||||
detect 4 or 5 and this information is valuable.
|
||||
|
||||
In commit 63c4fda (Input: synaptics - allocate 3 slots to keep stability
|
||||
in image sensors), we allocate 3 slots, but we still continue to report
|
||||
the 2 available fingers. That means that the client sees 2 used slots while
|
||||
there is a total of 3 fingers advertised by BTN_TOOL_TRIPLETAP.
|
||||
|
||||
For old kernels this is not a problem because max_slots was 2 and libinput/
|
||||
xorg-synaptics knew how to deal with that. Now that max_slot is 3, the
|
||||
clients ignore BTN_TOOL_TRIPLETAP and count the actual used slots (so 2).
|
||||
It then gets confused when receiving the BTN_TOOL_TRIPLETAP and DOUBLETAP
|
||||
information, and goes wild.
|
||||
|
||||
We can pin the 3 slots until we get a total number of fingers below 2.
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1212230
|
||||
|
||||
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
||||
---
|
||||
drivers/input/mouse/synaptics.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
|
||||
index 3a32caf06bf1..58102970f94f 100644
|
||||
--- a/drivers/input/mouse/synaptics.c
|
||||
+++ b/drivers/input/mouse/synaptics.c
|
||||
@@ -940,6 +940,14 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
|
||||
input_report_abs(dev, ABS_MT_PRESSURE, hw[i]->z);
|
||||
}
|
||||
|
||||
+ /* keep (slot count <= num_fingers) by pinning all slots */
|
||||
+ if (num_fingers >= 3) {
|
||||
+ for (i = 0; i < 3; i++) {
|
||||
+ input_mt_slot(dev, i);
|
||||
+ input_mt_report_slot_state(dev, MT_TOOL_FINGER, true);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
input_mt_drop_unused(dev);
|
||||
|
||||
/* Don't use active slot count to generate BTN_TOOL events. */
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
From a446d2f94ce540689c7a46bf457d92409e9c4d7e Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Fri, 21 Nov 2014 10:40:00 -0800
|
||||
Subject: [PATCH] Kbuild: Add an option to enable GCC VTA
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Due to recent codegen issues, gcc -fvar-tracking-assignments was
|
||||
unconditionally disabled in commit 2062afb4f804a ("Fix gcc-4.9.0
|
||||
miscompilation of load_balance() in scheduler"). However, this reduces
|
||||
the debuginfo coverage for variable locations, especially in inline
|
||||
functions. VTA is certainly not perfect either in those cases, but it
|
||||
is much better than without. With compiler versions that have fixed the
|
||||
codegen bugs, we would prefer to have the better details for SystemTap,
|
||||
and surely other debuginfo consumers like perf will benefit as well.
|
||||
|
||||
This patch simply makes CONFIG_DEBUG_INFO_VTA an option. I considered
|
||||
Frank and Linus's discussion of a cc-option-like -fcompare-debug test,
|
||||
but I'm convinced that a narrow test of an arch-specific codegen issue
|
||||
is not really useful. GCC has their own regression tests for this, so
|
||||
I'd suggest GCC_COMPARE_DEBUG=-fvar-tracking-assignments-toggle is more
|
||||
useful for kernel developers to test confidence.
|
||||
|
||||
In fact, I ran into a couple more issues when testing for this patch[1],
|
||||
although neither of those had any codegen impact.
|
||||
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1140872
|
||||
|
||||
With gcc-4.9.2-1.fc22, I can now build v3.18-rc5 with Fedora's i686 and
|
||||
x86_64 configs, and this is completely clean with GCC_COMPARE_DEBUG.
|
||||
|
||||
Cc: Frank Ch. Eigler <fche@redhat.com>
|
||||
Cc: Jakub Jelinek <jakub@redhat.com>
|
||||
Cc: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Andrew Morton <akpm@linux-foundation.org>
|
||||
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
|
||||
Cc: Michel Dänzer <michel@daenzer.net>
|
||||
Signed-off-by: Josh Stone <jistone@redhat.com>
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
Makefile | 4 ++++
|
||||
lib/Kconfig.debug | 18 +++++++++++++++++-
|
||||
2 files changed, 21 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9ef547fc7ffe..5777d902f8f3 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -735,7 +735,11 @@ KBUILD_CFLAGS += -fomit-frame-pointer
|
||||
KBUILD_CFLAGS += -ftrivial-auto-var-init=pattern
|
||||
endif
|
||||
|
||||
+ifdef CONFIG_DEBUG_INFO_VTA
|
||||
+DEBUG_CFLAGS += $(call cc-option, -fvar-tracking-assignments)
|
||||
+else
|
||||
DEBUG_CFLAGS := $(call cc-option, -fno-var-tracking-assignments)
|
||||
+endif
|
||||
|
||||
ifdef CONFIG_DEBUG_INFO
|
||||
ifdef CONFIG_DEBUG_INFO_SPLIT
|
||||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
|
||||
index 0d9e81779e37..424206212931 100644
|
||||
--- a/lib/Kconfig.debug
|
||||
+++ b/lib/Kconfig.debug
|
||||
@@ -217,7 +217,23 @@ config DEBUG_INFO_DWARF4
|
||||
Generate dwarf4 debug info. This requires recent versions
|
||||
of gcc and gdb. It makes the debug information larger.
|
||||
But it significantly improves the success of resolving
|
||||
- variables in gdb on optimized code.
|
||||
+ variables in gdb on optimized code. The gcc docs also
|
||||
+ recommend enabling -fvar-tracking-assignments for maximum
|
||||
+ benefit. (see DEBUG_INFO_VTA)
|
||||
+
|
||||
+config DEBUG_INFO_VTA
|
||||
+ bool "Enable var-tracking-assignments for debuginfo"
|
||||
+ depends on DEBUG_INFO
|
||||
+ help
|
||||
+ Enable gcc -fvar-tracking-assignments for improved debug
|
||||
+ information on variable locations in optimized code. Per
|
||||
+ gcc, DEBUG_INFO_DWARF4 is recommended for best use of VTA.
|
||||
+
|
||||
+ VTA has been implicated in codegen bugs (gcc PR61801,
|
||||
+ PR61904), so this may deserve some caution. One can set
|
||||
+ GCC_COMPARE_DEBUG=-fvar-tracking-assignments-toggle in the
|
||||
+ environment to automatically compile everything both ways,
|
||||
+ generating an error if anything differs.
|
||||
|
||||
config DEBUG_INFO_BTF
|
||||
bool "Generate BTF typeinfo"
|
||||
--
|
||||
2.20.1
|
||||
|
||||
0
Module.kabi_aarch64
Normal file
0
Module.kabi_aarch64
Normal file
0
Module.kabi_dup_aarch64
Normal file
0
Module.kabi_dup_aarch64
Normal file
0
Module.kabi_dup_ppc64le
Normal file
0
Module.kabi_dup_ppc64le
Normal file
0
Module.kabi_dup_s390x
Normal file
0
Module.kabi_dup_s390x
Normal file
0
Module.kabi_dup_x86_64
Normal file
0
Module.kabi_dup_x86_64
Normal file
0
Module.kabi_ppc64le
Normal file
0
Module.kabi_ppc64le
Normal file
0
Module.kabi_s390x
Normal file
0
Module.kabi_s390x
Normal file
0
Module.kabi_x86_64
Normal file
0
Module.kabi_x86_64
Normal file
|
|
@ -1,57 +0,0 @@
|
|||
From patchwork Thu Jun 28 08:13:30 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: [2/3] mmc: sdhci: add quirk to prevent higher speed modes
|
||||
From: Stefan Agner <stefan@agner.ch>
|
||||
X-Patchwork-Id: 10493273
|
||||
Message-Id: <20180628081331.13051-3-stefan@agner.ch>
|
||||
To: adrian.hunter@intel.com, ulf.hansson@linaro.org
|
||||
Cc: fabio.estevam@nxp.com, haibo.chen@nxp.com, aisheng.dong@nxp.com,
|
||||
michael@amarulasolutions.com, rmk+kernel@armlinux.org.uk,
|
||||
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
|
||||
Stefan Agner <stefan@agner.ch>
|
||||
Date: Thu, 28 Jun 2018 10:13:30 +0200
|
||||
|
||||
Some hosts are capable of running higher speed modes but do not
|
||||
have the board support for it. Introduce a quirk which prevents
|
||||
the stack from using modes running at 100MHz or faster.
|
||||
|
||||
Signed-off-by: Stefan Agner <stefan@agner.ch>
|
||||
---
|
||||
drivers/mmc/host/sdhci.c | 8 ++++++++
|
||||
drivers/mmc/host/sdhci.h | 2 ++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
|
||||
index 1c828e0e9905..8ac257dfaab3 100644
|
||||
--- a/drivers/mmc/host/sdhci.c
|
||||
+++ b/drivers/mmc/host/sdhci.c
|
||||
@@ -3749,6 +3749,14 @@ int sdhci_setup_host(struct sdhci_host *host)
|
||||
}
|
||||
}
|
||||
|
||||
+ if (host->quirks2 & SDHCI_QUIRK2_NO_UHS_HS200_HS400) {
|
||||
+ host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
|
||||
+ SDHCI_SUPPORT_DDR50);
|
||||
+
|
||||
+ mmc->caps2 &= ~(MMC_CAP2_HSX00_1_8V | MMC_CAP2_HSX00_1_2V |
|
||||
+ MMC_CAP2_HS400_ES);
|
||||
+ }
|
||||
+
|
||||
if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) {
|
||||
host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
|
||||
SDHCI_SUPPORT_DDR50);
|
||||
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
|
||||
index 23966f887da6..cb2433d6d61f 100644
|
||||
--- a/drivers/mmc/host/sdhci.h
|
||||
+++ b/drivers/mmc/host/sdhci.h
|
||||
@@ -450,6 +450,8 @@ struct sdhci_host {
|
||||
* block count.
|
||||
*/
|
||||
#define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18)
|
||||
+/* Do not support any higher speeds (>50MHz) */
|
||||
+#define SDHCI_QUIRK2_NO_UHS_HS200_HS400 (1<<19)
|
||||
|
||||
int irq; /* Device IRQ */
|
||||
void __iomem *ioaddr; /* Mapped address */
|
||||
1385
arm-sun8i-realtek-phy-fixes.patch
Normal file
1385
arm-sun8i-realtek-phy-fixes.patch
Normal file
File diff suppressed because it is too large
Load diff
122
arm64-dts-allwinner-a64-OrangePi-Win-Fix-ethernet-node.patch
Normal file
122
arm64-dts-allwinner-a64-OrangePi-Win-Fix-ethernet-node.patch
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
From patchwork Thu Oct 22 18:58:39 2020
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?=
|
||||
<jernej.skrabec@siol.net>
|
||||
X-Patchwork-Id: 11851815
|
||||
Return-Path:
|
||||
<SRS0=FtUi=D5=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH,
|
||||
DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,
|
||||
MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,
|
||||
USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id 49923C4363A
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Thu, 22 Oct 2020 18:54:57 +0000 (UTC)
|
||||
Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id BE42824630
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Thu, 22 Oct 2020 18:54:56 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="MwGMWls5"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE42824630
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=siol.net
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding:
|
||||
Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive:
|
||||
List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From:
|
||||
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
|
||||
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
|
||||
bh=qw218/k563L/SgvRNrMcHuGAohVj+G+njRSUxTbH4/Y=; b=MwGMWls5lB6ROxeraw8NFhva87
|
||||
YclCqRbQf+4ALNGb51xUAobhmcRTMH8XN28wcc+cyGlR5v7vxgiiNdTbv1vehjJbQXoeZBexYeBfo
|
||||
Cz7p7c9v/iMpOj3EEnV7lvZjjScYq9K9eNA6LUfpe8hHTGaZR9o1Jabq7SoDK53cc9bOqa7KuWrTK
|
||||
eAkzQIt/0knwigxs/j0BjfhNkW6CCJwypTEWGy1hmrPmclEbgEx0CsvX6qFShyY//T7fn2LtIuSRh
|
||||
Z5GL2jc1VfMLRCzJKt8Nut7dq9NRPDaemSH5rZUo4U+/TbbTHZpcSTMxaJmHLyqGkX2mi4/WVEleF
|
||||
aU2kJPNA==;
|
||||
Received: from localhost ([::1] helo=merlin.infradead.org)
|
||||
by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kVfiG-0001Av-7F; Thu, 22 Oct 2020 18:53:24 +0000
|
||||
Received: from mailoutvs7.siol.net ([185.57.226.198] helo=mail.siol.net)
|
||||
by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kVfiD-00019b-Hk
|
||||
for linux-arm-kernel@lists.infradead.org; Thu, 22 Oct 2020 18:53:22 +0000
|
||||
Received: from localhost (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTP id A66DD528530;
|
||||
Thu, 22 Oct 2020 20:53:17 +0200 (CEST)
|
||||
X-Virus-Scanned: amavisd-new at psrvmta10.zcs-production.pri
|
||||
Received: from mail.siol.net ([127.0.0.1])
|
||||
by localhost (psrvmta10.zcs-production.pri [127.0.0.1]) (amavisd-new,
|
||||
port 10032)
|
||||
with ESMTP id ivWpOrxbe1hZ; Thu, 22 Oct 2020 20:53:17 +0200 (CEST)
|
||||
Received: from mail.siol.net (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTPS id 5ADFE528565;
|
||||
Thu, 22 Oct 2020 20:53:17 +0200 (CEST)
|
||||
Received: from kista.localdomain (cpe1-5-97.cable.triera.net [213.161.5.97])
|
||||
(Authenticated sender: 031275009)
|
||||
by mail.siol.net (Postfix) with ESMTPSA id A9CFB528530;
|
||||
Thu, 22 Oct 2020 20:53:15 +0200 (CEST)
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
To: mripard@kernel.org,
|
||||
wens@csie.org
|
||||
Subject: [PATCH] arm64: dts: allwinner: a64: OrangePi Win: Fix ethernet node
|
||||
Date: Thu, 22 Oct 2020 20:58:39 +0200
|
||||
Message-Id: <20201022185839.2779245-1-jernej.skrabec@siol.net>
|
||||
X-Mailer: git-send-email 2.29.0
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20201022_145321_724045_AE21B375
|
||||
X-CRM114-Status: GOOD ( 11.21 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com,
|
||||
robh+dt@kernel.org, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
|
||||
RX/TX delay on OrangePi Win board is set on PHY. Reflect that in
|
||||
ethernet node.
|
||||
|
||||
Fixes: 93d6a27cfcc0 ("arm64: dts: allwinner: a64: Orange Pi Win: Add Ethernet node")
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
|
||||
index d894ec5fa8a1..70e31743f0ba 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
|
||||
@@ -120,7 +120,7 @@ &ehci1 {
|
||||
&emac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&rgmii_pins>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
phy-handle = <&ext_rgmii_phy>;
|
||||
phy-supply = <®_gmac_3v3>;
|
||||
status = "okay";
|
||||
122
arm64-dts-allwinner-h5-OrangePi-PC2-Fix-ethernet-node.patch
Normal file
122
arm64-dts-allwinner-h5-OrangePi-PC2-Fix-ethernet-node.patch
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
From patchwork Fri Oct 23 18:48:58 2020
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?=
|
||||
<jernej.skrabec@siol.net>
|
||||
X-Patchwork-Id: 11854423
|
||||
Return-Path:
|
||||
<SRS0=LoId=D6=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH,
|
||||
DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,
|
||||
MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,
|
||||
USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id 1D6FCC55178
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Fri, 23 Oct 2020 18:45:31 +0000 (UTC)
|
||||
Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id 9531820882
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Fri, 23 Oct 2020 18:45:30 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="wAWD/7i6"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9531820882
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=siol.net
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding:
|
||||
Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive:
|
||||
List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From:
|
||||
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
|
||||
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
|
||||
bh=m06Ef3z67s1OKeS6vZi5U49+kjyVHbPq652p5RSY8mw=; b=wAWD/7i6V6QQknGeu4aP+whAUL
|
||||
x+z9xyIqngbq6nK4751GTRCn1anrtUOgwa69I01dBHGS3T2eEubbswHl7oaGbxDaExz+CVi4cNZPu
|
||||
lnsvfpHGiuhlTSaehcEvP4mmL+nr6RuZR65moYl2NGuTdO7KVH9BEjw1hLXZSCojWHoSZGDWKiUob
|
||||
3Z9qYd+scPoCh0OWUG8DNmx3o/7paRsyC7+6aKWIrGKCjjfcldGG8DLOQacJFZUK5jvdXHtBxNpBU
|
||||
+lTNQzxYTXc/8UEz0j7B+NE8vnFR8zkiyixd6Z8U/XbRc9cOWKjGaSYnH9RHdTL1c4caLfmpAgCEC
|
||||
Ce+Bw/5Q==;
|
||||
Received: from localhost ([::1] helo=merlin.infradead.org)
|
||||
by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kW22O-0002CR-V4; Fri, 23 Oct 2020 18:43:40 +0000
|
||||
Received: from mailoutvs25.siol.net ([185.57.226.216] helo=mail.siol.net)
|
||||
by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kW22K-00023f-Rr
|
||||
for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2020 18:43:38 +0000
|
||||
Received: from localhost (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTP id 72D2C52828D;
|
||||
Fri, 23 Oct 2020 20:43:34 +0200 (CEST)
|
||||
X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri
|
||||
Received: from mail.siol.net ([127.0.0.1])
|
||||
by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new,
|
||||
port 10032)
|
||||
with ESMTP id TVbMFK320epr; Fri, 23 Oct 2020 20:43:34 +0200 (CEST)
|
||||
Received: from mail.siol.net (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTPS id 2F71D5282BB;
|
||||
Fri, 23 Oct 2020 20:43:34 +0200 (CEST)
|
||||
Received: from kista.localdomain (cpe1-5-97.cable.triera.net [213.161.5.97])
|
||||
(Authenticated sender: 031275009)
|
||||
by mail.siol.net (Postfix) with ESMTPSA id 91F0A52828D;
|
||||
Fri, 23 Oct 2020 20:43:33 +0200 (CEST)
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
To: mripard@kernel.org,
|
||||
wens@csie.org
|
||||
Subject: [PATCH] arm64: dts: allwinner: h5: OrangePi PC2: Fix ethernet node
|
||||
Date: Fri, 23 Oct 2020 20:48:58 +0200
|
||||
Message-Id: <20201023184858.3272918-1-jernej.skrabec@siol.net>
|
||||
X-Mailer: git-send-email 2.29.0
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20201023_144337_054453_04C86957
|
||||
X-CRM114-Status: GOOD ( 10.84 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com,
|
||||
robh+dt@kernel.org, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
|
||||
RX and TX delay are provided by ethernet PHY. Reflect that in ethernet
|
||||
node.
|
||||
|
||||
Fixes: 44a94c7ef989 ("arm64: dts: allwinner: H5: Restore EMAC changes")
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
index 7d7aad18f078..8bf2db9dcbda 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
|
||||
@@ -123,7 +123,7 @@ &emac {
|
||||
pinctrl-0 = <&emac_rgmii_pins>;
|
||||
phy-supply = <®_gmac_3v3>;
|
||||
phy-handle = <&ext_rgmii_phy>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
145
arm64-dts-allwinner-h5-OrangePi-Prime-Fix-ethernet-node.patch
Normal file
145
arm64-dts-allwinner-h5-OrangePi-Prime-Fix-ethernet-node.patch
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
From patchwork Wed Oct 28 11:58:17 2020
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Nenad Peric <nperic@gmail.com>
|
||||
X-Patchwork-Id: 11862711
|
||||
Return-Path:
|
||||
<SRS0=AM15=ED=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,
|
||||
DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,
|
||||
FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,
|
||||
SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT
|
||||
autolearn=ham autolearn_force=no version=3.4.0
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id F41EBC4363A
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Wed, 28 Oct 2020 12:00:20 +0000 (UTC)
|
||||
Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id 595FD246DD
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Wed, 28 Oct 2020 12:00:20 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="DqpmXmwL";
|
||||
dkim=fail reason="signature verification failed" (2048-bit key)
|
||||
header.d=gmail.com header.i=@gmail.com header.b="uWoqSVv7"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 595FD246DD
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=gmail.com
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding:
|
||||
Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive:
|
||||
List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From:
|
||||
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
|
||||
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
|
||||
bh=iM3IMk6QdBKQv1Dkn6VfsoTDd+paWW6N4SwFo4W/pT4=; b=DqpmXmwLqnlvs85L9x+K5eSfiz
|
||||
GN+E05H0DMF5+zVOP8gpXahEpMhg887f5sEvbNMLlYIh1BouAijiz8nS1noh/UC2rU7ozned7uJr0
|
||||
mpD/7Of1OZL6brTPOJhrBPDGlUqchkrOdGTf0VxbGUDhCtvw5FdvoWWuzquj79JyvSZa/H++CkbcR
|
||||
74W9DixoNvOZfs1v73N2NSlegmqLDWzTRd66zMqeroN+xYHDOUxHT+Us2GyVh+NALSdRi5j5k5/p0
|
||||
OPrQ1NhT566jHS2BIEusfdUO1EwskEuqpvuTzQ+n5rLr+bb+YrOMoUGwJD3hW3XrOjmvOp0QRYT4y
|
||||
PpA6tS3Q==;
|
||||
Received: from localhost ([::1] helo=merlin.infradead.org)
|
||||
by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kXk6L-0004MI-Ms; Wed, 28 Oct 2020 11:58:49 +0000
|
||||
Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643])
|
||||
by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kXk6I-0004Ky-6g
|
||||
for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 11:58:47 +0000
|
||||
Received: by mail-ej1-x643.google.com with SMTP id s15so6783728ejf.8
|
||||
for <linux-arm-kernel@lists.infradead.org>;
|
||||
Wed, 28 Oct 2020 04:58:41 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
|
||||
h=from:to:cc:subject:date:message-id:mime-version
|
||||
:content-transfer-encoding;
|
||||
bh=blRKpHWKYllsC3fZsoBdHMYqC0YSHlFEixMlCc4fF1w=;
|
||||
b=uWoqSVv7/sXCFBs4uRVc7ZJnrRrLnXRL/+OZi80QKKTgvbfwumMUj5KjiHEfCDwRTT
|
||||
4l77Y7QqHNGwxkvw+86NlgbOJIbEGK4exb73CcG7bxXiIhUe0N903Cdh3FQo3A0tl3q2
|
||||
VVSy51o6KCEFVvO6WPGI4jxOMAYccyYb5zEX6DU9nVjW78QVsyJC3woh3PIjNjhr0gi7
|
||||
zA6Fm+EE9Jqof6qEe3uaZElg1mUFZEfpLNHtDSERMYtGr66mYG8lcT8onl0aY8Ew4dz/
|
||||
2ChThQ8iNbHXpa+VJlmskDf+WUndSWm2VHt4ifMPz4XZVW8mfQK3LdkpOO3eHP+1+v9D
|
||||
bUgw==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20161025;
|
||||
h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
|
||||
:content-transfer-encoding;
|
||||
bh=blRKpHWKYllsC3fZsoBdHMYqC0YSHlFEixMlCc4fF1w=;
|
||||
b=hcuII+cyYhy8NEgTGUVf1GusA61FKRDd5S51ziFO8yqmI5ZdmGcKRcE4XkA6MARqT/
|
||||
p6/yBHuLVLBQPsG/E2eFHnOxgHwmJJmnuDcEXyDibj5CH8vVabKPmQV8g9u2OEv74Ufj
|
||||
kSq2G5ZusReaIPfB/Jvku/zM7npReCYZRfoY+b1WbfTbIkKX7hKqBJfRH6oHfFfsUYCx
|
||||
jmtUyxX/iQ+zxA7QyGtpPNFQ01FngfkP8RiQOn9j8HlniGdHePpx38xZVwIk2Xw7cZTt
|
||||
WMlSTduDbqferQ4kvVHhS45swesUf0j17cl8/ulI2gsIypm+BXpMVT1EbNo1cLX6938G
|
||||
BZ4g==
|
||||
X-Gm-Message-State: AOAM533DIdRxZEJdUOkrAMKw6EuWX0vUxXnqmbiqmy7O/RXzqjgvJ39e
|
||||
PumNgB/8sggQCFj5Ra/GWBk=
|
||||
X-Google-Smtp-Source:
|
||||
ABdhPJz86BOoINx8fEi+KX53QXqf+HoCczR0skh70fOJrBPW6LQi7RmJY8byNi8zXcJRJpwKsL5dUw==
|
||||
X-Received: by 2002:a17:906:3689:: with SMTP id
|
||||
a9mr7090398ejc.403.1603886320892;
|
||||
Wed, 28 Oct 2020 04:58:40 -0700 (PDT)
|
||||
Received: from localhost.localdomain ([87.116.178.171])
|
||||
by smtp.googlemail.com with ESMTPSA id f13sm2817210ejf.42.2020.10.28.04.58.39
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Wed, 28 Oct 2020 04:58:40 -0700 (PDT)
|
||||
From: Nenad Peric <nperic@gmail.com>
|
||||
To: mripard@kernel.org,
|
||||
wens@csie.org,
|
||||
jernej.skrabec@siol.net
|
||||
Subject: [PATCH] arm64: dts: allwinner: h5: OrangePi Prime: Fix ethernet node
|
||||
Date: Wed, 28 Oct 2020 12:58:17 +0100
|
||||
Message-Id: <20201028115817.68113-1-nperic@gmail.com>
|
||||
X-Mailer: git-send-email 2.29.1
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20201028_075846_256245_4AB671AE
|
||||
X-CRM114-Status: GOOD ( 13.60 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
|
||||
linux-sunxi@googlegroups.com, robh+dt@kernel.org,
|
||||
Nenad Peric <nperic@gmail.com>, linux-arm-kernel@lists.infradead.org
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
|
||||
RX and TX delay are provided by ethernet PHY. Reflect that in ethernet
|
||||
node.
|
||||
|
||||
Fixes: 44a94c7ef989 ("arm64: dts: allwinner: H5: Restore EMAC changes")
|
||||
Signed-off-by: Nenad Peric <nperic@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
index cb44bfa5981f..33ab44072e6d 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
|
||||
@@ -124,7 +124,7 @@ &emac {
|
||||
pinctrl-0 = <&emac_rgmii_pins>;
|
||||
phy-supply = <®_gmac_3v3>;
|
||||
phy-handle = <&ext_rgmii_phy>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
125
arm64-dts-allwinner-h6-Pine-H64-Fix-ethernet-node.patch
Normal file
125
arm64-dts-allwinner-h6-Pine-H64-Fix-ethernet-node.patch
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
From patchwork Fri Oct 23 19:49:02 2020
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?=
|
||||
<jernej.skrabec@siol.net>
|
||||
X-Patchwork-Id: 11854475
|
||||
Return-Path:
|
||||
<SRS0=LoId=D6=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH,
|
||||
DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,
|
||||
MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,
|
||||
USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id 63302C388F9
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Fri, 23 Oct 2020 19:46:07 +0000 (UTC)
|
||||
Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id CEC072192A
|
||||
for <linux-arm-kernel@archiver.kernel.org>;
|
||||
Fri, 23 Oct 2020 19:46:06 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="RmcUbgOY"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEC072192A
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=siol.net
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding:
|
||||
Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive:
|
||||
List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From:
|
||||
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
|
||||
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
|
||||
bh=hLIZ2EP9nRbAti/wOrMDo1OIucNmHPYmeTz9hC5PCnA=; b=RmcUbgOYDKWjn2s7pGDpTPSI3x
|
||||
NuaDIYVWecJeYRkyIuo17CVfM2stKi4Z2NgNQifJYES97ZiPYblSPwx8eg5L8R896LrleIrASB1tG
|
||||
fqNpALWJk2GUtdXzkVIf1KlBlEuNBalgVfd7eIKKmXDbJI8cV3i37nnYQ/1rlYiMU3U6jtVqNd847
|
||||
0D3CMcyW2AKeG2+xCXrf+KeIytwkQDz51Wq/SkpZUJIEicBzg++3/yzKB9ZAf1v4le8V5SndXYoOL
|
||||
MN5fti8tO6Ox0KBvfzl7IfPOM4whPwduDXDUYhnWvBw4q7UHqsaIylAT18U1u7i+j127WKNb3oChK
|
||||
g1kLDIng==;
|
||||
Received: from localhost ([::1] helo=merlin.infradead.org)
|
||||
by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kW2yv-000840-7O; Fri, 23 Oct 2020 19:44:09 +0000
|
||||
Received: from mailoutvs25.siol.net ([185.57.226.216] helo=mail.siol.net)
|
||||
by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
|
||||
id 1kW2yT-0007t0-4y
|
||||
for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2020 19:43:42 +0000
|
||||
Received: from localhost (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTP id 126DA528120;
|
||||
Fri, 23 Oct 2020 21:43:36 +0200 (CEST)
|
||||
X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri
|
||||
Received: from mail.siol.net ([127.0.0.1])
|
||||
by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new,
|
||||
port 10032)
|
||||
with ESMTP id rEXZf2IX2IaY; Fri, 23 Oct 2020 21:43:35 +0200 (CEST)
|
||||
Received: from mail.siol.net (localhost [127.0.0.1])
|
||||
by mail.siol.net (Postfix) with ESMTPS id C4F7052818E;
|
||||
Fri, 23 Oct 2020 21:43:35 +0200 (CEST)
|
||||
Received: from kista.localdomain (cpe1-5-97.cable.triera.net [213.161.5.97])
|
||||
(Authenticated sender: 031275009)
|
||||
by mail.siol.net (Postfix) with ESMTPSA id 52CA9528176;
|
||||
Fri, 23 Oct 2020 21:43:35 +0200 (CEST)
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
To: mripard@kernel.org,
|
||||
wens@csie.org
|
||||
Subject: [PATCH] arm64: dts: allwinner: h6: Pine H64: Fix ethernet node
|
||||
Date: Fri, 23 Oct 2020 21:49:02 +0200
|
||||
Message-Id: <20201023194902.368239-1-jernej.skrabec@siol.net>
|
||||
X-Mailer: git-send-email 2.29.0
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20201023_154341_497396_834DE64F
|
||||
X-CRM114-Status: GOOD ( 11.24 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com,
|
||||
robh+dt@kernel.org, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
|
||||
|
||||
Ethernet PHY provides RX and TX delay on both models, A and B. Although
|
||||
schematic for model A suggests only TX delay, network never worked with
|
||||
such configuration.
|
||||
|
||||
Fix ethernet node to reflect PHY delays.
|
||||
|
||||
Fixes: 729e1ffcf47e ("arm64: allwinner: h6: add support for the Ethernet on Pine H64")
|
||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
|
||||
index af85b2074867..961732c52aa0 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
|
||||
@@ -100,7 +100,7 @@ &ehci3 {
|
||||
&emac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ext_rgmii_pins>;
|
||||
- phy-mode = "rgmii";
|
||||
+ phy-mode = "rgmii-id";
|
||||
phy-handle = <&ext_rgmii_phy>;
|
||||
phy-supply = <®_gmac_3v3>;
|
||||
allwinner,rx-delay-ps = <200>;
|
||||
|
|
@ -1,623 +0,0 @@
|
|||
From patchwork Thu Sep 5 14:51:12 2019
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Lee Jones <lee.jones@linaro.org>
|
||||
X-Patchwork-Id: 11133293
|
||||
Return-Path:
|
||||
<SRS0=FLD0=XA=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
|
||||
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
|
||||
[172.30.200.123])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF29913BD
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Thu, 5 Sep 2019 14:51:26 +0000 (UTC)
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.kernel.org (Postfix) with ESMTPS id 1997020820
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Thu, 5 Sep 2019 14:51:27 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=lists.infradead.org
|
||||
header.i=@lists.infradead.org header.b="QcCmRfwJ";
|
||||
dkim=fail reason="signature verification failed" (2048-bit key)
|
||||
header.d=linaro.org header.i=@linaro.org header.b="UUIx2S2a"
|
||||
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1997020820
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dmarc=fail (p=none dis=none) header.from=linaro.org
|
||||
Authentication-Results: mail.kernel.org;
|
||||
spf=none
|
||||
smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=bombadil.20170209; h=Sender:
|
||||
Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
|
||||
List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:
|
||||
Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:
|
||||
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:
|
||||
References:List-Owner; bh=RFMjkhfiAb3mDQJcei/M3ErXIrcuIvXho1uY3CGaFs8=; b=QcC
|
||||
mRfwJTEzsniFc2PQTDfopo/phWmprscia3e6OqRIHx0I6F8qNt3pLneLcx7MATAHPJHeD2Bfz/d1W
|
||||
vk/w8leYRcdrNca/SkMK3grqwTP3XueqwIC3W59cpisOR1/MTcmZZ05pTYnppFox5HNzWRfOL6Z6r
|
||||
CZvdTV7DVN0DYpv+NU1GnegQ3L8w/B1BaXGHVCPJjH/dHMLJ4OqBor2LD0dBQpYwROMamQbE3enrN
|
||||
WGMNjdb3YYZU47m5stsgoivzulIOlOF5PKp+VY75IwHxck1S07mqhqxB9cmIvdEke7S9T1EpoIOJs
|
||||
2cu8v9rxofEpJNocOcSJeYiEpGj6qIA==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux))
|
||||
id 1i5t6X-0000ra-3X; Thu, 05 Sep 2019 14:51:21 +0000
|
||||
Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux))
|
||||
id 1i5t6S-0000r9-W3
|
||||
for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2019 14:51:18 +0000
|
||||
Received: by mail-wm1-x343.google.com with SMTP id n10so3441823wmj.0
|
||||
for <linux-arm-kernel@lists.infradead.org>;
|
||||
Thu, 05 Sep 2019 07:51:16 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;
|
||||
h=from:to:cc:subject:date:message-id;
|
||||
bh=hP6dTKrGhmI4Li1vYBwvA5G00RWYLdiehRQLahBt/08=;
|
||||
b=UUIx2S2a1OTzLYcxsOGi8vjYvnpXjIXXfjjInQmQhJrOoLVMUI4bMk0pP8K4hv5+v1
|
||||
bC+ahF3FezFlzFIlypiny7EYPPxM79sdZHZnnpe6qgrTfl/6guRvEmNJy8vpPadhocR8
|
||||
IW0JAJGxuc7RH4bWScdjpjBLvTYEo3MLTNDGuJOCB05O5AH8D6gSDZPqwaUWbITmdboy
|
||||
JTOLJ37XUMxPF83r7F6BQwynpfcnLc9Ytv9w1tMp0R82MmO52QP457mar3d7PWPJu/Rw
|
||||
YJb6IDjcjSjZJrr3aGvnJVnETp/zGeRsmeTgNtJe37OYQ5blm4tzTlx1dRxuMiRRs6DS
|
||||
rUaA==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20161025;
|
||||
h=x-gm-message-state:from:to:cc:subject:date:message-id;
|
||||
bh=hP6dTKrGhmI4Li1vYBwvA5G00RWYLdiehRQLahBt/08=;
|
||||
b=d2RovY2av4Dyx8Ou6LJ+nAvLFVrruV6de3b6OWCOF5mnVZA2T2tJEcsrZEGXSSpkiz
|
||||
1YxSkV7YgJJElZhqlfudvkyyxth7A1ZDQnU4x3QyppMQ5lWeHg/xT9+q+h7orxiRjQeX
|
||||
2J+SRG4WqZwcpbUSe95Wy2tPFVB5GYv1eyARjCARCpYOECeprtSl1ckDVyBJ/3G4AVLm
|
||||
kB1xk3Ua101/bad3LA8IW1Zo0ld7x7u42jPYO7kJhPH8Ec/l0mrAVSIJn54PKoLu/DhW
|
||||
yH6q+kD4LffmAtpj4ICo/rQdtmjV7msTJZ/Dcos9IpUPi5KoXbxWdP+NoUyaVleKhEIl
|
||||
IYMA==
|
||||
X-Gm-Message-State: APjAAAUQgezKycPxaZ7DvJWRiVy/0dp867xlik7J0fXQ60D99YKcuW0q
|
||||
aRR9aWXTADWPSkrcTkd0a071Qw==
|
||||
X-Google-Smtp-Source:
|
||||
APXvYqybUDyw7bzKyC0JJlkse2i6lXau2tHY0+7iUxCwZcbyfwIDTqmYWXxNn26wfhgBAKudt68zBQ==
|
||||
X-Received: by 2002:a1c:a404:: with SMTP id n4mr3206745wme.137.1567695075383;
|
||||
Thu, 05 Sep 2019 07:51:15 -0700 (PDT)
|
||||
Received: from localhost.localdomain ([95.147.198.36])
|
||||
by smtp.gmail.com with ESMTPSA id g201sm4376858wmg.34.2019.09.05.07.51.14
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Thu, 05 Sep 2019 07:51:14 -0700 (PDT)
|
||||
From: Lee Jones <lee.jones@linaro.org>
|
||||
To: agross@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com,
|
||||
bjorn.andersson@linaro.org, arnd@arndb.de
|
||||
Subject: [PATCH v4 1/1] arm64: dts: qcom: Add Lenovo Yoga C630
|
||||
Date: Thu, 5 Sep 2019 15:51:12 +0100
|
||||
Message-Id: <20190905145112.7366-1-lee.jones@linaro.org>
|
||||
X-Mailer: git-send-email 2.17.1
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20190905_075117_040430_5C619449
|
||||
X-CRM114-Status: GOOD ( 14.05 )
|
||||
X-Spam-Score: -0.2 (/)
|
||||
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
|
||||
Content analysis details: (-0.2 points)
|
||||
pts rule name description
|
||||
---- ----------------------
|
||||
--------------------------------------------------
|
||||
-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
|
||||
no trust [2a00:1450:4864:20:0:0:0:343 listed in]
|
||||
[list.dnswl.org]
|
||||
-0.0 SPF_PASS SPF: sender matches SPF record
|
||||
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
|
||||
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
|
||||
envelope-from domain
|
||||
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
|
||||
author's domain
|
||||
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
|
||||
not necessarily
|
||||
valid
|
||||
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.29
|
||||
Precedence: list
|
||||
List-Id: <linux-arm-kernel.lists.infradead.org>
|
||||
List-Unsubscribe:
|
||||
<http://lists.infradead.org/mailman/options/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
|
||||
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
|
||||
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe:
|
||||
<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
|
||||
<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
|
||||
linux-kernel@vger.kernel.org, soc@kernel.org,
|
||||
Lee Jones <lee.jones@linaro.org>,
|
||||
linux-arm-kernel@lists.infradead.org
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset="us-ascii"
|
||||
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
|
||||
|
||||
From: Bjorn Andersson <bjorn.andersson@linaro.org>
|
||||
|
||||
The Lenovo Yoga C630 is built on the SDM850 from Qualcomm, but this seem
|
||||
to be similar enough to the SDM845 that we can reuse the sdm845.dtsi.
|
||||
|
||||
Supported by this patch is: keyboard, battery monitoring, UFS storage,
|
||||
USB host and Bluetooth.
|
||||
|
||||
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
||||
Reviewed-by: Vinod Koul <vkoul@kernel.org>
|
||||
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
|
||||
[Lee] Reorder, change licence, remove non-upstream device node
|
||||
Signed-off-by: Lee Jones <lee.jones@linaro.org>
|
||||
---
|
||||
|
||||
Changelog:
|
||||
* Reorder nodes alphabetically
|
||||
* Remove superfluous node for driver not yet upstream
|
||||
* Add (then remove) 'no-dma' property
|
||||
* Change licence to BSD
|
||||
|
||||
arch/arm64/boot/dts/qcom/Makefile | 1 +
|
||||
.../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 446 ++++++++++++++++++
|
||||
2 files changed, 447 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
|
||||
index 0a7e5dfce6f7..670c6c65f9e9 100644
|
||||
--- a/arch/arm64/boot/dts/qcom/Makefile
|
||||
+++ b/arch/arm64/boot/dts/qcom/Makefile
|
||||
@@ -12,5 +12,6 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r2.dtb
|
||||
dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb
|
||||
dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb
|
||||
dtb-$(CONFIG_ARCH_QCOM) += sdm845-mtp.dtb
|
||||
+dtb-$(CONFIG_ARCH_QCOM) += sdm850-lenovo-yoga-c630.dtb
|
||||
dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-1000.dtb
|
||||
dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-4000.dtb
|
||||
diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
|
||||
new file mode 100644
|
||||
index 000000000000..ded120d3aef5
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
|
||||
@@ -0,0 +1,446 @@
|
||||
+// SPDX-License-Identifier: BSD-3-Clause
|
||||
+/*
|
||||
+ * Lenovo Yoga C630
|
||||
+ *
|
||||
+ * Copyright (c) 2019, Linaro Ltd.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
|
||||
+#include "sdm845.dtsi"
|
||||
+#include "pm8998.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Lenovo Yoga C630";
|
||||
+ compatible = "lenovo,yoga-c630", "qcom,sdm845";
|
||||
+
|
||||
+ aliases {
|
||||
+ hsuart0 = &uart6;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&apps_rsc {
|
||||
+ pm8998-rpmh-regulators {
|
||||
+ compatible = "qcom,pm8998-rpmh-regulators";
|
||||
+ qcom,pmic-id = "a";
|
||||
+
|
||||
+ vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
|
||||
+ vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
|
||||
+
|
||||
+ vreg_s2a_1p125: smps2 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_s3a_1p35: smps3 {
|
||||
+ regulator-min-microvolt = <1352000>;
|
||||
+ regulator-max-microvolt = <1352000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_s4a_1p8: smps4 {
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_s5a_2p04: smps5 {
|
||||
+ regulator-min-microvolt = <2040000>;
|
||||
+ regulator-max-microvolt = <2040000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_s7a_1p025: smps7 {
|
||||
+ };
|
||||
+
|
||||
+ vdd_qusb_hs0:
|
||||
+ vdda_hp_pcie_core:
|
||||
+ vdda_mipi_csi0_0p9:
|
||||
+ vdda_mipi_csi1_0p9:
|
||||
+ vdda_mipi_csi2_0p9:
|
||||
+ vdda_mipi_dsi0_pll:
|
||||
+ vdda_mipi_dsi1_pll:
|
||||
+ vdda_qlink_lv:
|
||||
+ vdda_qlink_lv_ck:
|
||||
+ vdda_qrefs_0p875:
|
||||
+ vdda_pcie_core:
|
||||
+ vdda_pll_cc_ebi01:
|
||||
+ vdda_pll_cc_ebi23:
|
||||
+ vdda_sp_sensor:
|
||||
+ vdda_ufs1_core:
|
||||
+ vdda_ufs2_core:
|
||||
+ vdda_usb1_ss_core:
|
||||
+ vdda_usb2_ss_core:
|
||||
+ vreg_l1a_0p875: ldo1 {
|
||||
+ regulator-min-microvolt = <880000>;
|
||||
+ regulator-max-microvolt = <880000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vddpx_10:
|
||||
+ vreg_l2a_1p2: ldo2 {
|
||||
+ regulator-min-microvolt = <1200000>;
|
||||
+ regulator-max-microvolt = <1200000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l3a_1p0: ldo3 {
|
||||
+ };
|
||||
+
|
||||
+ vdd_wcss_cx:
|
||||
+ vdd_wcss_mx:
|
||||
+ vdda_wcss_pll:
|
||||
+ vreg_l5a_0p8: ldo5 {
|
||||
+ regulator-min-microvolt = <800000>;
|
||||
+ regulator-max-microvolt = <800000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vddpx_13:
|
||||
+ vreg_l6a_1p8: ldo6 {
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l7a_1p8: ldo7 {
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l8a_1p2: ldo8 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l9a_1p8: ldo9 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l10a_1p8: ldo10 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l11a_1p0: ldo11 {
|
||||
+ };
|
||||
+
|
||||
+ vdd_qfprom:
|
||||
+ vdd_qfprom_sp:
|
||||
+ vdda_apc1_cs_1p8:
|
||||
+ vdda_gfx_cs_1p8:
|
||||
+ vdda_qrefs_1p8:
|
||||
+ vdda_qusb_hs0_1p8:
|
||||
+ vddpx_11:
|
||||
+ vreg_l12a_1p8: ldo12 {
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vddpx_2:
|
||||
+ vreg_l13a_2p95: ldo13 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l14a_1p88: ldo14 {
|
||||
+ regulator-min-microvolt = <1880000>;
|
||||
+ regulator-max-microvolt = <1880000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l15a_1p8: ldo15 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l16a_2p7: ldo16 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l17a_1p3: ldo17 {
|
||||
+ regulator-min-microvolt = <1304000>;
|
||||
+ regulator-max-microvolt = <1304000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l18a_2p7: ldo18 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l19a_3p0: ldo19 {
|
||||
+ regulator-min-microvolt = <3100000>;
|
||||
+ regulator-max-microvolt = <3108000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l20a_2p95: ldo20 {
|
||||
+ regulator-min-microvolt = <2960000>;
|
||||
+ regulator-max-microvolt = <2960000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l21a_2p95: ldo21 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l22a_2p85: ldo22 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_l23a_3p3: ldo23 {
|
||||
+ };
|
||||
+
|
||||
+ vdda_qusb_hs0_3p1:
|
||||
+ vreg_l24a_3p075: ldo24 {
|
||||
+ regulator-min-microvolt = <3075000>;
|
||||
+ regulator-max-microvolt = <3083000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l25a_3p3: ldo25 {
|
||||
+ regulator-min-microvolt = <3104000>;
|
||||
+ regulator-max-microvolt = <3112000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vdda_hp_pcie_1p2:
|
||||
+ vdda_hv_ebi0:
|
||||
+ vdda_hv_ebi1:
|
||||
+ vdda_hv_ebi2:
|
||||
+ vdda_hv_ebi3:
|
||||
+ vdda_mipi_csi_1p25:
|
||||
+ vdda_mipi_dsi0_1p2:
|
||||
+ vdda_mipi_dsi1_1p2:
|
||||
+ vdda_pcie_1p2:
|
||||
+ vdda_ufs1_1p2:
|
||||
+ vdda_ufs2_1p2:
|
||||
+ vdda_usb1_ss_1p2:
|
||||
+ vdda_usb2_ss_1p2:
|
||||
+ vreg_l26a_1p2: ldo26 {
|
||||
+ regulator-min-microvolt = <1200000>;
|
||||
+ regulator-max-microvolt = <1208000>;
|
||||
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
+ };
|
||||
+
|
||||
+ vreg_l28a_3p0: ldo28 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_lvs1a_1p8: lvs1 {
|
||||
+ };
|
||||
+
|
||||
+ vreg_lvs2a_1p8: lvs2 {
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&apps_smmu {
|
||||
+ /* TODO: Figure out how to survive booting with this enabled */
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+&gcc {
|
||||
+ protected-clocks = <GCC_QSPI_CORE_CLK>,
|
||||
+ <GCC_QSPI_CORE_CLK_SRC>,
|
||||
+ <GCC_QSPI_CNOC_PERIPH_AHB_CLK>;
|
||||
+};
|
||||
+
|
||||
+&i2c1 {
|
||||
+ status = "okay";
|
||||
+ clock-frequency = <400000>;
|
||||
+};
|
||||
+
|
||||
+&i2c3 {
|
||||
+ status = "okay";
|
||||
+ clock-frequency = <400000>;
|
||||
+
|
||||
+ hid@15 {
|
||||
+ compatible = "hid-over-i2c";
|
||||
+ reg = <0x15>;
|
||||
+ hid-descr-addr = <0x1>;
|
||||
+
|
||||
+ interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>;
|
||||
+ };
|
||||
+
|
||||
+ hid@2c {
|
||||
+ compatible = "hid-over-i2c";
|
||||
+ reg = <0x2c>;
|
||||
+ hid-descr-addr = <0x20>;
|
||||
+
|
||||
+ interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>;
|
||||
+
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&i2c2_hid_active>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c5 {
|
||||
+ status = "okay";
|
||||
+ clock-frequency = <400000>;
|
||||
+
|
||||
+ hid@10 {
|
||||
+ compatible = "hid-over-i2c";
|
||||
+ reg = <0x10>;
|
||||
+ hid-descr-addr = <0x1>;
|
||||
+
|
||||
+ interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
|
||||
+
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&i2c6_hid_active>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c11 {
|
||||
+ status = "okay";
|
||||
+ clock-frequency = <400000>;
|
||||
+
|
||||
+ hid@5c {
|
||||
+ compatible = "hid-over-i2c";
|
||||
+ reg = <0x5c>;
|
||||
+ hid-descr-addr = <0x1>;
|
||||
+
|
||||
+ interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>;
|
||||
+
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&i2c12_hid_active>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&qup_i2c12_default {
|
||||
+ drive-strength = <2>;
|
||||
+ bias-disable;
|
||||
+};
|
||||
+
|
||||
+&qup_uart6_default {
|
||||
+ pinmux {
|
||||
+ pins = "gpio45", "gpio46", "gpio47", "gpio48";
|
||||
+ function = "qup6";
|
||||
+ };
|
||||
+
|
||||
+ cts {
|
||||
+ pins = "gpio45";
|
||||
+ bias-pull-down;
|
||||
+ };
|
||||
+
|
||||
+ rts-tx {
|
||||
+ pins = "gpio46", "gpio47";
|
||||
+ drive-strength = <2>;
|
||||
+ bias-disable;
|
||||
+ };
|
||||
+
|
||||
+ rx {
|
||||
+ pins = "gpio48";
|
||||
+ bias-pull-up;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&qupv3_id_0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&qupv3_id_1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tlmm {
|
||||
+ gpio-reserved-ranges = <0 4>, <81 4>;
|
||||
+
|
||||
+ i2c2_hid_active: i2c2-hid-active {
|
||||
+ pins = <37>;
|
||||
+ function = "gpio";
|
||||
+
|
||||
+ input-enable;
|
||||
+ bias-pull-up;
|
||||
+ drive-strength = <2>;
|
||||
+ };
|
||||
+
|
||||
+ i2c6_hid_active: i2c6-hid-active {
|
||||
+ pins = <125>;
|
||||
+ function = "gpio";
|
||||
+
|
||||
+ input-enable;
|
||||
+ bias-pull-up;
|
||||
+ drive-strength = <2>;
|
||||
+ };
|
||||
+
|
||||
+ i2c12_hid_active: i2c12-hid-active {
|
||||
+ pins = <92>;
|
||||
+ function = "gpio";
|
||||
+
|
||||
+ input-enable;
|
||||
+ bias-pull-up;
|
||||
+ drive-strength = <2>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart6 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ bluetooth {
|
||||
+ compatible = "qcom,wcn3990-bt";
|
||||
+
|
||||
+ vddio-supply = <&vreg_s4a_1p8>;
|
||||
+ vddxo-supply = <&vreg_l7a_1p8>;
|
||||
+ vddrf-supply = <&vreg_l17a_1p3>;
|
||||
+ vddch0-supply = <&vreg_l25a_3p3>;
|
||||
+ max-speed = <3200000>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&ufs_mem_hc {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vcc-supply = <&vreg_l20a_2p95>;
|
||||
+ vcc-max-microamp = <600000>;
|
||||
+};
|
||||
+
|
||||
+&ufs_mem_phy {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdda-phy-supply = <&vdda_ufs1_core>;
|
||||
+ vdda-pll-supply = <&vdda_ufs1_1p2>;
|
||||
+};
|
||||
+
|
||||
+&usb_1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_1_dwc3 {
|
||||
+ dr_mode = "host";
|
||||
+};
|
||||
+
|
||||
+&usb_1_hsphy {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdd-supply = <&vdda_usb1_ss_core>;
|
||||
+ vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
|
||||
+ vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
|
||||
+
|
||||
+ qcom,imp-res-offset-value = <8>;
|
||||
+ qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
|
||||
+ qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
|
||||
+ qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
|
||||
+};
|
||||
+
|
||||
+&usb_1_qmpphy {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdda-phy-supply = <&vdda_usb1_ss_1p2>;
|
||||
+ vdda-pll-supply = <&vdda_usb1_ss_core>;
|
||||
+};
|
||||
+
|
||||
+&usb_2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_2_dwc3 {
|
||||
+ dr_mode = "host";
|
||||
+};
|
||||
+
|
||||
+&usb_2_hsphy {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdd-supply = <&vdda_usb2_ss_core>;
|
||||
+ vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
|
||||
+ vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
|
||||
+
|
||||
+ qcom,imp-res-offset-value = <8>;
|
||||
+ qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
|
||||
+};
|
||||
+
|
||||
+&usb_2_qmpphy {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdda-phy-supply = <&vdda_usb2_ss_1p2>;
|
||||
+ vdda-pll-supply = <&vdda_usb2_ss_core>;
|
||||
+};
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
From patchwork Thu Sep 5 19:24:12 2019
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Lee Jones <lee.jones@linaro.org>
|
||||
X-Patchwork-Id: 11133827
|
||||
Return-Path: <SRS0=OmJI=XA=vger.kernel.org=linux-arm-msm-owner@kernel.org>
|
||||
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
|
||||
[172.30.200.123])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDFD514ED
|
||||
for <patchwork-linux-arm-msm@patchwork.kernel.org>;
|
||||
Thu, 5 Sep 2019 19:24:19 +0000 (UTC)
|
||||
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
|
||||
by mail.kernel.org (Postfix) with ESMTP id D540020870
|
||||
for <patchwork-linux-arm-msm@patchwork.kernel.org>;
|
||||
Thu, 5 Sep 2019 19:24:19 +0000 (UTC)
|
||||
Authentication-Results: mail.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
|
||||
header.b="j/6kUy9p"
|
||||
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||
id S1727540AbfIETYS (ORCPT
|
||||
<rfc822;patchwork-linux-arm-msm@patchwork.kernel.org>);
|
||||
Thu, 5 Sep 2019 15:24:18 -0400
|
||||
Received: from mail-wr1-f49.google.com ([209.85.221.49]:36821 "EHLO
|
||||
mail-wr1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||
with ESMTP id S1726008AbfIETYS (ORCPT
|
||||
<rfc822;linux-arm-msm@vger.kernel.org>);
|
||||
Thu, 5 Sep 2019 15:24:18 -0400
|
||||
Received: by mail-wr1-f49.google.com with SMTP id y19so4081592wrd.3
|
||||
for <linux-arm-msm@vger.kernel.org>;
|
||||
Thu, 05 Sep 2019 12:24:16 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=linaro.org; s=google;
|
||||
h=from:to:cc:subject:date:message-id;
|
||||
bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=;
|
||||
b=j/6kUy9psCaV+YLvz8j0kAZ3/WrmOU3xyh5rDOj0TwK0TnwjLtaLil9Q+C9KpFvvVG
|
||||
h4R8p4cZFB0U4b/PAfc9Xt4p4xJNkAIpTzL4QRjM+nkXdDcYyiwUGkr9BRJnJmO0lyZB
|
||||
zmylqwjRd1oOrTQ1tPvwqUV3OUR5u6WA+rDyhn+A516vskkns0bEICMG787HdDEwjigd
|
||||
+3SR4L9u7swSDpNhqxtfPsn9UFP36sehUfgx32xUcjUhX3ls4RtX+6HCZU+rkeQuILt5
|
||||
0qlmqliIuKXWkQe+ii/gtrK+ulFQ7lEl76YfDJyqXVo4Z357rIhVFAz+mooVn5qpscmU
|
||||
E+xA==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20161025;
|
||||
h=x-gm-message-state:from:to:cc:subject:date:message-id;
|
||||
bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=;
|
||||
b=QjFuCunKeBkoabY9fIsWTo3krapsS69k52eNtOIeLBaCd7M1lvCmItn41DcbJ5ykqT
|
||||
RQ0rnlNq35x9QvKNumPai3fMZp9AWt3KpJpxbpEokltyLbkGUqRWaeYTrOtuV9P9nRmT
|
||||
Yj72UBVzYj4d/G+FGq8EBesWjRyEFC51+RekvPlbRZ/h1fVW7/XAy5cO1ywnHrtNe8pQ
|
||||
7gYQJ3Xh1Y09qkiO0i8iru5PSMTK3U+vPSLWVdFOeqMh+Beins6I9mbKf+UX+xa8ECK3
|
||||
mEFjYxY57YVx+SpaKrmBwEmu9YXLgXqEif1OH1FHFiKZVQ4ABPp19D4+5JOXEV1tCwUS
|
||||
B6Qw==
|
||||
X-Gm-Message-State: APjAAAUM7yEkrkGZ+mbleFtCMQGsXfLQSXt2Bd+K6leuP2oAs8Vj1j9k
|
||||
4bsoJvF042q/z9+6bnLlGShjoA==
|
||||
X-Google-Smtp-Source:
|
||||
APXvYqyThx0kWliMdrjc7dedZ/+AhabFi7TIc04exnxhWAEkAOh7foRP8Cz8ZjjhxGJCvUyUPA4lFg==
|
||||
X-Received: by 2002:adf:ea0c:: with SMTP id q12mr4172788wrm.172.1567711455933;
|
||||
Thu, 05 Sep 2019 12:24:15 -0700 (PDT)
|
||||
Received: from localhost.localdomain ([95.147.198.36])
|
||||
by smtp.gmail.com with ESMTPSA id
|
||||
q24sm7942378wmc.3.2019.09.05.12.24.14
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Thu, 05 Sep 2019 12:24:14 -0700 (PDT)
|
||||
From: Lee Jones <lee.jones@linaro.org>
|
||||
To: alokc@codeaurora.org, agross@kernel.org, robh+dt@kernel.org,
|
||||
mark.rutland@arm.com, bjorn.andersson@linaro.org, vkoul@kernel.org,
|
||||
wsa@the-dreams.de
|
||||
Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org,
|
||||
devicetree@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
|
||||
Subject: [RESEND v3 1/1] i2c: qcom-geni: Disable DMA processing on the Lenovo
|
||||
Yoga C630
|
||||
Date: Thu, 5 Sep 2019 20:24:12 +0100
|
||||
Message-Id: <20190905192412.23116-1-lee.jones@linaro.org>
|
||||
X-Mailer: git-send-email 2.17.1
|
||||
Sender: linux-arm-msm-owner@vger.kernel.org
|
||||
Precedence: bulk
|
||||
List-ID: <linux-arm-msm.vger.kernel.org>
|
||||
X-Mailing-List: linux-arm-msm@vger.kernel.org
|
||||
|
||||
We have a production-level laptop (Lenovo Yoga C630) which is exhibiting
|
||||
a rather horrific bug. When I2C HID devices are being scanned for at
|
||||
boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA.
|
||||
When it does, the laptop reboots and the user never sees the OS.
|
||||
|
||||
Attempts are being made to debug the reason for the spontaneous reboot.
|
||||
No luck so far, hence the requirement for this hot-fix. This workaround
|
||||
will be removed once we have a viable fix.
|
||||
|
||||
Signed-off-by: Lee Jones <lee.jones@linaro.org>
|
||||
---
|
||||
drivers/i2c/busses/i2c-qcom-geni.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
|
||||
index a89bfce5388e..17abf60c94ae 100644
|
||||
--- a/drivers/i2c/busses/i2c-qcom-geni.c
|
||||
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
|
||||
@@ -355,11 +355,13 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
|
||||
{
|
||||
dma_addr_t rx_dma;
|
||||
unsigned long time_left;
|
||||
- void *dma_buf;
|
||||
+ void *dma_buf = NULL;
|
||||
struct geni_se *se = &gi2c->se;
|
||||
size_t len = msg->len;
|
||||
|
||||
- dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
|
||||
+ if (!of_machine_is_compatible("lenovo,yoga-c630"))
|
||||
+ dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
|
||||
+
|
||||
if (dma_buf)
|
||||
geni_se_select_mode(se, GENI_SE_DMA);
|
||||
else
|
||||
@@ -394,11 +396,13 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
|
||||
{
|
||||
dma_addr_t tx_dma;
|
||||
unsigned long time_left;
|
||||
- void *dma_buf;
|
||||
+ void *dma_buf = NULL;
|
||||
struct geni_se *se = &gi2c->se;
|
||||
size_t len = msg->len;
|
||||
|
||||
- dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
|
||||
+ if (!of_machine_is_compatible("lenovo,yoga-c630"))
|
||||
+ dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
|
||||
+
|
||||
if (dma_buf)
|
||||
geni_se_select_mode(se, GENI_SE_DMA);
|
||||
else
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 59780095ba35a49946e726c88caff6f65f3e433a Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Tue, 30 Jul 2019 14:22:36 +0100
|
||||
Subject: [PATCH] arm64: tegra: Jetson TX2: Allow bootloader to configure
|
||||
Ethernet MAC
|
||||
|
||||
Add an ethernet alias so that a stable MAC address is added to the
|
||||
device tree for the wired ethernet interface.
|
||||
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
|
||||
index 5e18acf5cfad..947744d0f04c 100644
|
||||
--- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
|
||||
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
|
||||
@@ -8,6 +8,7 @@
|
||||
compatible = "nvidia,p3310", "nvidia,tegra186";
|
||||
|
||||
aliases {
|
||||
+ ethernet0 = "/ethernet@2490000";
|
||||
sdhci0 = "/sdhci@3460000";
|
||||
sdhci1 = "/sdhci@3400000";
|
||||
serial0 = &uarta;
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
From a58d581e212b3acbc65e56384e6bc60bb109f29a Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Fri, 7 Aug 2020 15:51:42 +0100
|
||||
Subject: [PATCH] arm64: tegra: Use valid PWM period for VDD_GPU on Tegra210
|
||||
|
||||
From: Thierry Reding <treding@nvidia.com>
|
||||
|
||||
The PWM on Tegra210 can run at a maximum frequency of 48 MHz and cannot
|
||||
reach the minimum period is 5334 ns. The currently configured period of
|
||||
4880 ns is not within the valid range, so set it to 8000 ns. This value
|
||||
was taken from the downstream DTS files and seems to work fine.
|
||||
|
||||
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi | 2 +-
|
||||
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi
|
||||
index cc6ed45a2b485..e2e984a75f601 100644
|
||||
--- a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi
|
||||
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi
|
||||
@@ -346,7 +346,7 @@ regulators {
|
||||
vdd_gpu: regulator@100 {
|
||||
compatible = "pwm-regulator";
|
||||
reg = <100>;
|
||||
- pwms = <&pwm 1 4880>;
|
||||
+ pwms = <&pwm 1 8000>;
|
||||
regulator-name = "VDD_GPU";
|
||||
regulator-min-microvolt = <710000>;
|
||||
regulator-max-microvolt = <1320000>;
|
||||
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
|
||||
index 9bc52fdb393c8..ebaac57853138 100644
|
||||
--- a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
|
||||
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
|
||||
@@ -789,7 +789,7 @@ vdd_cpu: regulator@5 {
|
||||
vdd_gpu: regulator@6 {
|
||||
compatible = "pwm-regulator";
|
||||
reg = <6>;
|
||||
- pwms = <&pwm 1 4880>;
|
||||
+ pwms = <&pwm 1 8000>;
|
||||
regulator-name = "VDD_GPU";
|
||||
regulator-min-microvolt = <710000>;
|
||||
regulator-max-microvolt = <1320000>;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From aea4a7a551fd7342299d34f04a8b75f58644ac07 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Sat, 23 Mar 2019 17:45:10 +0000
|
||||
Subject: [PATCH 2/3] arm64: tegra210: Jetson TX1: disable display panel and
|
||||
associated backlight
|
||||
|
||||
The Jetson TX1 dev kit doesn't ship with a screen by default and if
|
||||
it's not there it appears to crash on boot so disable them both by
|
||||
default until we work out the problem.
|
||||
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
|
||||
index 37e3c46e753f..a16f24f1d5ff 100644
|
||||
--- a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
|
||||
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
host1x@50000000 {
|
||||
dsi@54300000 {
|
||||
- status = "okay";
|
||||
+ status = "disabled";
|
||||
|
||||
avdd-dsi-csi-supply = <&vdd_dsi_csi>;
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
|
||||
i2c@7000c400 {
|
||||
backlight: backlight@2c {
|
||||
+ status = "disabled";
|
||||
+
|
||||
compatible = "ti,lp8557";
|
||||
reg = <0x2c>;
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
From: "kernel-team@fedoraproject.org" <kernel-team@fedoraproject.org>
|
||||
Date: Wed, 6 Feb 2013 09:57:47 -0500
|
||||
Subject: [PATCH] ath9k: rx dma stop check
|
||||
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/mac.c | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
|
||||
index bba85d1a6cd1..ebbee8f17130 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/mac.c
|
||||
@@ -693,7 +693,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
|
||||
{
|
||||
#define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
- u32 mac_status, last_mac_status = 0;
|
||||
+ u32 mac_status = 0, last_mac_status = 0;
|
||||
int i;
|
||||
|
||||
/* Enable access to the DMA observation bus */
|
||||
@@ -723,6 +723,16 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
+ if (!AR_SREV_9300_20_OR_LATER(ah) &&
|
||||
+ (mac_status & 0x700) == 0) {
|
||||
+ /*
|
||||
+ * DMA is idle but the MAC is still stuck
|
||||
+ * processing events
|
||||
+ */
|
||||
+ *reset = true;
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
ath_err(common,
|
||||
"DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
|
||||
AH_RX_STOP_DMA_TIMEOUT / 1000,
|
||||
0
check-kabi
Normal file
0
check-kabi
Normal file
|
|
@ -19,8 +19,6 @@ cd $SCRIPT_DIR
|
|||
set errexit
|
||||
set nounset
|
||||
|
||||
control_file="config_generation"
|
||||
|
||||
cleanup()
|
||||
{
|
||||
rm -f config-*
|
||||
|
|
@ -52,7 +50,9 @@ function merge_configs()
|
|||
arch=$(echo "$archvar" | cut -f1 -d"-")
|
||||
configs=$2
|
||||
order=$3
|
||||
name=$OUTPUT_DIR/$PACKAGE_NAME-$archvar.config
|
||||
flavor=$4
|
||||
|
||||
name=$OUTPUT_DIR/$PACKAGE_NAME-$archvar-$flavor.config
|
||||
echo -n "Building $name ... "
|
||||
touch config-merging config-merged
|
||||
|
||||
|
|
@ -95,33 +95,55 @@ function merge_configs()
|
|||
echo "done"
|
||||
}
|
||||
|
||||
function build_flavor()
|
||||
{
|
||||
flavor=$1
|
||||
control_file="priority".$flavor
|
||||
while read line
|
||||
do
|
||||
if [ $(echo "$line" | grep -c "^#") -ne 0 ]; then
|
||||
continue
|
||||
elif [ $(echo "$line" | grep -c "^$") -ne 0 ]; then
|
||||
continue
|
||||
elif [ $(echo "$line" | grep -c "^EMPTY") -ne 0 ]; then
|
||||
empty=$(echo "$line" | cut -f2 -d"=")
|
||||
for a in $empty
|
||||
do
|
||||
echo "# EMPTY" > $OUTPUT_DIR/$PACKAGE_NAME-$a-$flavor.config
|
||||
|
||||
done
|
||||
elif [ $(echo "$line" | grep -c "^ORDER") -ne 0 ]; then
|
||||
order=$(echo "$line" | cut -f2 -d"=")
|
||||
for o in $order
|
||||
do
|
||||
glist=$(find $o -type d)
|
||||
for d in $glist
|
||||
do
|
||||
combine_config_layer $d
|
||||
done
|
||||
done
|
||||
else
|
||||
arch=$(echo "$line" | cut -f1 -d"=")
|
||||
configs=$(echo "$line" | cut -f2 -d"=")
|
||||
|
||||
if [ -n "$SUBARCH" ]; then
|
||||
case $arch in
|
||||
$SUBARCH*)
|
||||
;;
|
||||
*)
|
||||
continue
|
||||
esac
|
||||
fi
|
||||
|
||||
merge_configs $arch $configs "$order" $flavor
|
||||
fi
|
||||
done < $control_file
|
||||
}
|
||||
|
||||
while read line
|
||||
do
|
||||
if [ $(echo "$line" | grep -c "^#") -ne 0 ]; then
|
||||
continue
|
||||
elif [ $(echo "$line" | grep -c "^$") -ne 0 ]; then
|
||||
continue
|
||||
elif [ $(echo "$line" | grep -c "^ORDER") -ne 0 ]; then
|
||||
order=$(echo "$line" | cut -f2 -d"=")
|
||||
for o in $order
|
||||
do
|
||||
glist=$(find $o -type d)
|
||||
for d in $glist
|
||||
do
|
||||
combine_config_layer $d
|
||||
done
|
||||
done
|
||||
else
|
||||
arch=$(echo "$line" | cut -f1 -d"=")
|
||||
configs=$(echo "$line" | cut -f2 -d"=")
|
||||
|
||||
if [ -n "$SUBARCH" -a "$SUBARCH" != "$arch" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
merge_configs $arch $configs "$order"
|
||||
fi
|
||||
done < $control_file
|
||||
build_flavor $line
|
||||
done < flavors
|
||||
|
||||
# A passed in kernel version implies copy to final location
|
||||
# otherwise defer to another script
|
||||
|
|
|
|||
1
configs/fedora/debug/CONFIG_BTRFS_ASSERT
Normal file
1
configs/fedora/debug/CONFIG_BTRFS_ASSERT
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_BTRFS_ASSERT=y
|
||||
|
|
@ -1 +0,0 @@
|
|||
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4096
|
||||
1
configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE
Normal file
1
configs/fedora/debug/CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=4096
|
||||
24
configs/fedora/debug/CONFIG_DEBUG_VM_PGTABLE
Normal file
24
configs/fedora/debug/CONFIG_DEBUG_VM_PGTABLE
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# CONFIG_DEBUG_VM_PGTABLE:
|
||||
#
|
||||
# This option provides a debug method which can be used to test
|
||||
# architecture page table helper functions on various platforms in
|
||||
# verifying if they comply with expected generic MM semantics. This
|
||||
# will help architecture code in making sure that any changes or
|
||||
# new additions of these helpers still conform to expected
|
||||
# semantics of the generic MM. Platforms will have to opt in for
|
||||
# this through ARCH_HAS_DEBUG_VM_PGTABLE.
|
||||
#
|
||||
# If unsure, say N.
|
||||
#
|
||||
# Symbol: DEBUG_VM_PGTABLE [=y]
|
||||
# Type : bool
|
||||
# Defined at lib/Kconfig.debug:702
|
||||
# Prompt: Debug arch page table for semantics compliance
|
||||
# Depends on: MMU [=y] && ARCH_HAS_DEBUG_VM_PGTABLE [=y]
|
||||
# Location:
|
||||
# -> Kernel hacking
|
||||
# -> Memory Debugging
|
||||
#
|
||||
#
|
||||
#
|
||||
CONFIG_DEBUG_VM_PGTABLE=y
|
||||
|
|
@ -1 +1 @@
|
|||
# CONFIG_DMADEVICES_DEBUG is not set
|
||||
CONFIG_DMADEVICES_DEBUG=y
|
||||
|
|
|
|||
1
configs/fedora/debug/CONFIG_KASAN_VMALLOC
Normal file
1
configs/fedora/debug/CONFIG_KASAN_VMALLOC
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_KASAN_VMALLOC=y
|
||||
1
configs/fedora/debug/CONFIG_KPROBE_EVENT_GEN_TEST
Normal file
1
configs/fedora/debug/CONFIG_KPROBE_EVENT_GEN_TEST
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_KPROBE_EVENT_GEN_TEST=m
|
||||
|
|
@ -1 +0,0 @@
|
|||
CONFIG_MMIOTRACE=y
|
||||
|
|
@ -1 +0,0 @@
|
|||
CONFIG_PROVE_RCU=y
|
||||
1
configs/fedora/debug/CONFIG_PTDUMP_DEBUGFS
Normal file
1
configs/fedora/debug/CONFIG_PTDUMP_DEBUGFS
Normal file
|
|
@ -0,0 +1 @@
|
|||
CONFIG_PTDUMP_DEBUGFS=y
|
||||
|
|
@ -1 +0,0 @@
|
|||
CONFIG_REFCOUNT_FULL=y
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue