Merge remote-tracking branch 'up/master' into master-riscv64
This commit is contained in:
commit
c84bdfed84
|
@ -8,3 +8,5 @@ kernel-[234].*/
|
|||
perf-man-*.tar.gz
|
||||
kernel-headers/
|
||||
kernel-tools/
|
||||
/linux-5.0-rc1.tar.gz
|
||||
/linux-5.0-rc2.tar.gz
|
||||
|
|
|
@ -6,27 +6,27 @@ Subject: [PATCH 1/3] Make get_cert_list() not complain about cert lists that
|
|||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
certs/load_uefi.c | 37 ++++++++++++++++++++++---------------
|
||||
security/integrity/platform_certs/load_uefi.c | 37 ++++++++++++++++++++++---------------
|
||||
1 file changed, 22 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/certs/load_uefi.c b/certs/load_uefi.c
|
||||
index 3d884598601..9ef34c44fd1 100644
|
||||
--- a/certs/load_uefi.c
|
||||
+++ b/certs/load_uefi.c
|
||||
@@ -35,8 +35,8 @@ static __init bool uefi_check_ignore_db(void)
|
||||
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)
|
||||
+ unsigned long *size , void **cert_list)
|
||||
{
|
||||
efi_status_t status;
|
||||
unsigned long lsize = 4;
|
||||
@@ -44,26 +44,33 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
@@ -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;
|
||||
|
@ -39,14 +39,12 @@ index 3d884598601..9ef34c44fd1 100644
|
|||
- return NULL;
|
||||
+ return efi_status_to_err(status);
|
||||
}
|
||||
|
||||
|
||||
db = kmalloc(lsize, GFP_KERNEL);
|
||||
if (!db) {
|
||||
pr_err("Couldn't allocate memory for uefi cert list\n");
|
||||
if (!db)
|
||||
- return NULL;
|
||||
+ return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
status = efi.get_variable(name, guid, NULL, &lsize, db);
|
||||
if (status != EFI_SUCCESS) {
|
||||
kfree(db);
|
||||
|
@ -54,15 +52,15 @@ index 3d884598601..9ef34c44fd1 100644
|
|||
- return NULL;
|
||||
+ return efi_status_to_err(status);
|
||||
}
|
||||
|
||||
|
||||
*size = lsize;
|
||||
- return db;
|
||||
+ *cert_list = db;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -152,10 +159,10 @@ static int __init load_uefi_certs(void)
|
||||
@@ -153,10 +160,10 @@ static int __init load_uefi_certs(void)
|
||||
* an error if we can't get them.
|
||||
*/
|
||||
if (!uefi_check_ignore_db()) {
|
||||
|
@ -74,36 +72,33 @@ index 3d884598601..9ef34c44fd1 100644
|
|||
- } else {
|
||||
+ } else if (dbsize != 0) {
|
||||
rc = parse_efi_signature_list("UEFI:db",
|
||||
db, dbsize, get_handler_for_db);
|
||||
db, dbsize, get_handler_for_db);
|
||||
if (rc)
|
||||
@@ -164,10 +171,10 @@ static int __init load_uefi_certs(void)
|
||||
@@ -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("MODSIGN: Couldn't get UEFI MokListRT\n");
|
||||
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)
|
||||
@@ -175,10 +182,10 @@ static int __init load_uefi_certs(void)
|
||||
@@ -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("MODSIGN: Couldn't get UEFI dbx list\n");
|
||||
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);
|
||||
--
|
||||
2.15.0
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@ Subject: [PATCH 3/3] Make get_cert_list() use efi_status_to_str() to print
|
|||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
certs/load_uefi.c | 6 ++++--
|
||||
security/integrity/platform_certs/load_uefi.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/certs/load_uefi.c b/certs/load_uefi.c
|
||||
diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
|
||||
index 9ef34c44fd1..13a2826715d 100644
|
||||
--- a/certs/load_uefi.c
|
||||
+++ b/certs/load_uefi.c
|
||||
--- 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,
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,60 +0,0 @@
|
|||
From 0451d4e795929a69a0fda6d960aa4b077c5bd179 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Howells <dhowells@redhat.com>
|
||||
Date: Fri, 5 May 2017 08:21:58 +0100
|
||||
Subject: [PATCH 1/4] efi: Add EFI signature data types
|
||||
|
||||
Add the data types that are used for containing hashes, keys and
|
||||
certificates for cryptographic verification along with their corresponding
|
||||
type GUIDs.
|
||||
|
||||
Signed-off-by: David Howells <dhowells@redhat.com>
|
||||
---
|
||||
include/linux/efi.h | 25 +++++++++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
diff --git a/include/linux/efi.h b/include/linux/efi.h
|
||||
index ec36f42..3259ad6 100644
|
||||
--- a/include/linux/efi.h
|
||||
+++ b/include/linux/efi.h
|
||||
@@ -614,6 +614,10 @@ void efi_native_runtime_setup(void);
|
||||
#define EFI_IMAGE_SECURITY_DATABASE_GUID EFI_GUID(0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f)
|
||||
#define EFI_SHIM_LOCK_GUID EFI_GUID(0x605dab50, 0xe046, 0x4300, 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23)
|
||||
|
||||
+#define EFI_CERT_SHA256_GUID EFI_GUID(0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28)
|
||||
+#define EFI_CERT_X509_GUID EFI_GUID(0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72)
|
||||
+#define EFI_CERT_X509_SHA256_GUID EFI_GUID(0x3bd2a492, 0x96c0, 0x4079, 0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed)
|
||||
+
|
||||
/*
|
||||
* This GUID is used to pass to the kernel proper the struct screen_info
|
||||
* structure that was populated by the stub based on the GOP protocol instance
|
||||
@@ -873,6 +877,27 @@ typedef struct {
|
||||
efi_memory_desc_t entry[0];
|
||||
} efi_memory_attributes_table_t;
|
||||
|
||||
+typedef struct {
|
||||
+ efi_guid_t signature_owner;
|
||||
+ u8 signature_data[];
|
||||
+} efi_signature_data_t;
|
||||
+
|
||||
+typedef struct {
|
||||
+ efi_guid_t signature_type;
|
||||
+ u32 signature_list_size;
|
||||
+ u32 signature_header_size;
|
||||
+ u32 signature_size;
|
||||
+ u8 signature_header[];
|
||||
+ /* efi_signature_data_t signatures[][] */
|
||||
+} efi_signature_list_t;
|
||||
+
|
||||
+typedef u8 efi_sha256_hash_t[32];
|
||||
+
|
||||
+typedef struct {
|
||||
+ efi_sha256_hash_t to_be_signed_hash;
|
||||
+ efi_time_t time_of_revocation;
|
||||
+} efi_cert_x509_sha256_t;
|
||||
+
|
||||
/*
|
||||
* All runtime access to EFI goes through this structure:
|
||||
*/
|
||||
--
|
||||
2.9.3
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
From e4c62c12635a371e43bd17e8d33a936668264491 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Howells <dhowells@redhat.com>
|
||||
Date: Fri, 5 May 2017 08:21:58 +0100
|
||||
Subject: [PATCH 2/4] efi: Add an EFI signature blob parser
|
||||
|
||||
Add a function to parse an EFI signature blob looking for elements of
|
||||
interest. A list is made up of a series of sublists, where all the
|
||||
elements in a sublist are of the same type, but sublists can be of
|
||||
different types.
|
||||
|
||||
For each sublist encountered, the function pointed to by the
|
||||
get_handler_for_guid argument is called with the type specifier GUID and
|
||||
returns either a pointer to a function to handle elements of that type or
|
||||
NULL if the type is not of interest.
|
||||
|
||||
If the sublist is of interest, each element is passed to the handler
|
||||
function in turn.
|
||||
|
||||
Signed-off-by: David Howells <dhowells@redhat.com>
|
||||
---
|
||||
certs/Kconfig | 8 ++++
|
||||
certs/Makefile | 1 +
|
||||
certs/efi_parser.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
include/linux/efi.h | 9 +++++
|
||||
4 files changed, 130 insertions(+)
|
||||
create mode 100644 certs/efi_parser.c
|
||||
|
||||
diff --git a/certs/Kconfig b/certs/Kconfig
|
||||
index 6ce51ed..630ae09 100644
|
||||
--- a/certs/Kconfig
|
||||
+++ b/certs/Kconfig
|
||||
@@ -82,4 +82,12 @@ config SYSTEM_BLACKLIST_HASH_LIST
|
||||
wrapper to incorporate the list into the kernel. Each <hash> should
|
||||
be a string of hex digits.
|
||||
|
||||
+config EFI_SIGNATURE_LIST_PARSER
|
||||
+ bool "EFI signature list parser"
|
||||
+ depends on EFI
|
||||
+ select X509_CERTIFICATE_PARSER
|
||||
+ help
|
||||
+ This option provides support for parsing EFI signature lists for
|
||||
+ X.509 certificates and turning them into keys.
|
||||
+
|
||||
endmenu
|
||||
diff --git a/certs/Makefile b/certs/Makefile
|
||||
index 4119bb3..738151a 100644
|
||||
--- a/certs/Makefile
|
||||
+++ b/certs/Makefile
|
||||
@@ -9,6 +9,7 @@ obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o
|
||||
else
|
||||
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o
|
||||
endif
|
||||
+obj-$(CONFIG_EFI_SIGNATURE_LIST_PARSER) += efi_parser.o
|
||||
|
||||
ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y)
|
||||
|
||||
diff --git a/certs/efi_parser.c b/certs/efi_parser.c
|
||||
new file mode 100644
|
||||
index 0000000..4e396f9
|
||||
--- /dev/null
|
||||
+++ b/certs/efi_parser.c
|
||||
@@ -0,0 +1,112 @@
|
||||
+/* EFI signature/key/certificate list parser
|
||||
+ *
|
||||
+ * Copyright (C) 2012, 2016 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) "EFI: "fmt
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/printk.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/efi.h>
|
||||
+
|
||||
+/**
|
||||
+ * parse_efi_signature_list - Parse an EFI signature list for certificates
|
||||
+ * @source: The source of the key
|
||||
+ * @data: The data blob to parse
|
||||
+ * @size: The size of the data blob
|
||||
+ * @get_handler_for_guid: Get the handler func for the sig type (or NULL)
|
||||
+ *
|
||||
+ * Parse an EFI signature list looking for elements of interest. A list is
|
||||
+ * made up of a series of sublists, where all the elements in a sublist are of
|
||||
+ * the same type, but sublists can be of different types.
|
||||
+ *
|
||||
+ * For each sublist encountered, the @get_handler_for_guid function is called
|
||||
+ * with the type specifier GUID and returns either a pointer to a function to
|
||||
+ * handle elements of that type or NULL if the type is not of interest.
|
||||
+ *
|
||||
+ * If the sublist is of interest, each element is passed to the handler
|
||||
+ * function in turn.
|
||||
+ *
|
||||
+ * Error EBADMSG is returned if the list doesn't parse correctly and 0 is
|
||||
+ * returned if the list was parsed correctly. No error can be returned from
|
||||
+ * the @get_handler_for_guid function or the element handler function it
|
||||
+ * returns.
|
||||
+ */
|
||||
+int __init parse_efi_signature_list(
|
||||
+ const char *source,
|
||||
+ const void *data, size_t size,
|
||||
+ efi_element_handler_t (*get_handler_for_guid)(const efi_guid_t *))
|
||||
+{
|
||||
+ efi_element_handler_t handler;
|
||||
+ unsigned offs = 0;
|
||||
+
|
||||
+ pr_devel("-->%s(,%zu)\n", __func__, size);
|
||||
+
|
||||
+ while (size > 0) {
|
||||
+ const efi_signature_data_t *elem;
|
||||
+ efi_signature_list_t list;
|
||||
+ size_t lsize, esize, hsize, elsize;
|
||||
+
|
||||
+ if (size < sizeof(list))
|
||||
+ return -EBADMSG;
|
||||
+
|
||||
+ memcpy(&list, data, sizeof(list));
|
||||
+ pr_devel("LIST[%04x] guid=%pUl ls=%x hs=%x ss=%x\n",
|
||||
+ offs,
|
||||
+ list.signature_type.b, list.signature_list_size,
|
||||
+ list.signature_header_size, list.signature_size);
|
||||
+
|
||||
+ lsize = list.signature_list_size;
|
||||
+ hsize = list.signature_header_size;
|
||||
+ esize = list.signature_size;
|
||||
+ elsize = lsize - sizeof(list) - hsize;
|
||||
+
|
||||
+ if (lsize > size) {
|
||||
+ pr_devel("<--%s() = -EBADMSG [overrun @%x]\n",
|
||||
+ __func__, offs);
|
||||
+ return -EBADMSG;
|
||||
+ }
|
||||
+
|
||||
+ if (lsize < sizeof(list) ||
|
||||
+ lsize - sizeof(list) < hsize ||
|
||||
+ esize < sizeof(*elem) ||
|
||||
+ elsize < esize ||
|
||||
+ elsize % esize != 0) {
|
||||
+ pr_devel("- bad size combo @%x\n", offs);
|
||||
+ return -EBADMSG;
|
||||
+ }
|
||||
+
|
||||
+ handler = get_handler_for_guid(&list.signature_type);
|
||||
+ if (!handler) {
|
||||
+ data += lsize;
|
||||
+ size -= lsize;
|
||||
+ offs += lsize;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ data += sizeof(list) + hsize;
|
||||
+ size -= sizeof(list) + hsize;
|
||||
+ offs += sizeof(list) + hsize;
|
||||
+
|
||||
+ for (; elsize > 0; elsize -= esize) {
|
||||
+ elem = data;
|
||||
+
|
||||
+ pr_devel("ELEM[%04x]\n", offs);
|
||||
+ handler(source,
|
||||
+ &elem->signature_data,
|
||||
+ esize - sizeof(*elem));
|
||||
+
|
||||
+ data += esize;
|
||||
+ size -= esize;
|
||||
+ offs += esize;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/include/linux/efi.h b/include/linux/efi.h
|
||||
index 3259ad6..08024c6 100644
|
||||
--- a/include/linux/efi.h
|
||||
+++ b/include/linux/efi.h
|
||||
@@ -1055,6 +1055,15 @@ extern int efi_memattr_apply_permissions(struct mm_struct *mm,
|
||||
char * __init efi_md_typeattr_format(char *buf, size_t size,
|
||||
const efi_memory_desc_t *md);
|
||||
|
||||
+
|
||||
+typedef void (*efi_element_handler_t)(const char *source,
|
||||
+ const void *element_data,
|
||||
+ size_t element_size);
|
||||
+extern int __init parse_efi_signature_list(
|
||||
+ const char *source,
|
||||
+ const void *data, size_t size,
|
||||
+ efi_element_handler_t (*get_handler_for_guid)(const efi_guid_t *));
|
||||
+
|
||||
/**
|
||||
* efi_range_is_wc - check the WC bit on an address range
|
||||
* @start: starting kvirt address
|
||||
--
|
||||
2.9.3
|
||||
|
|
@ -0,0 +1,527 @@
|
|||
From patchwork Sun Jan 13 02:17:18 2019
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Samuel Holland <samuel@sholland.org>
|
||||
X-Patchwork-Id: 10761197
|
||||
Return-Path:
|
||||
<linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7438D14E5
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 13 Jan 2019 02:18:08 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6324429093
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 13 Jan 2019 02:18:08 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 572B929097; Sun, 13 Jan 2019 02:18:08 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5F83A29093
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 13 Jan 2019 02:18:07 +0000 (UTC)
|
||||
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:Cc:List-Subscribe:List-Help:List-Post:
|
||||
List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
|
||||
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:
|
||||
List-Owner; bh=dQUQoZ0HK445Sd69SbjwJYcQyzVbBeZDboYvSLP8Vdw=; b=crafG7dY4EnzgC
|
||||
DsGSbEccC3W+IWHZ1IT48gptWAu7uAA+F8UlCxFhZjbnIWLSyJJ45p0OPLEpGqbXcAVG1b5PKktc2
|
||||
fccU3caHf3SodUNh3vGg0xGPPIpak0a3bFcU3kJ2b2HU31TCK7d8u5PPsELEX1044dKRGgelnShpT
|
||||
bWP3zCyZ2BsTJyX72XpZ3xDZTHA6vx0Pk+n6vuRPylDfGX0CIZrDlGFh6szWORsn0emEN+IJOPiXc
|
||||
qhc3Ba3yzsS7ImYjmBkrPlaQpDO15afdFm+LuEx3i0RN9ErPfdG0edtJjd95n/PA7UashuXX2b/5Q
|
||||
TygDejejoCnuJQ1meYBg==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1giVLf-0001hn-TG; Sun, 13 Jan 2019 02:18:03 +0000
|
||||
Received: from out1-smtp.messagingengine.com ([66.111.4.25])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1giVLA-0001BU-Qo
|
||||
for linux-arm-kernel@lists.infradead.org; Sun, 13 Jan 2019 02:17:36 +0000
|
||||
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
|
||||
by mailout.nyi.internal (Postfix) with ESMTP id 663DB23174;
|
||||
Sat, 12 Jan 2019 21:17:23 -0500 (EST)
|
||||
Received: from mailfrontend2 ([10.202.2.163])
|
||||
by compute5.internal (MEProxy); Sat, 12 Jan 2019 21:17:23 -0500
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h=
|
||||
from:to:cc:subject:date:message-id:in-reply-to:references
|
||||
:mime-version:content-type:content-transfer-encoding; s=fm1; bh=
|
||||
jKlMXS7XKvXn/szdGKBQgG32+kZpvO4uOo39QB1bolU=; b=mvmCKr9tLbEvZJbP
|
||||
pDROAd6IVm3H+tyjyvewON4VHOYfu+/+ArBujiVhfDXn37l0VEuv9+CnihXwQJz6
|
||||
4joEh2OkDUy/Q32KvZzaH2GCqpcfAXUzqg4gMHL3z2eF+krzqNFd9EfXRZH4p3zO
|
||||
HP0pa3tHrmZHsG9mnCbzz1JaRXVli6vxQKF/5KOoxpz++tQTllf25u0GpIbfKaOx
|
||||
Z4eKMXxSZvDpYbsxPhgdBnlBZfvOfhsSvTgphvpKdchneqyKUYVjwO68c7ajBeK9
|
||||
PGEo6YPH30QIE71YUD80IG8ZMrQOWYdlNLKocWTel4ZaJpkw4CIA1H+gnDmSKutJ
|
||||
VDRgYA==
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
|
||||
messagingengine.com; h=cc:content-transfer-encoding:content-type
|
||||
:date:from:in-reply-to:message-id:mime-version:references
|
||||
:subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
|
||||
:x-sasl-enc; s=fm1; bh=jKlMXS7XKvXn/szdGKBQgG32+kZpvO4uOo39QB1bo
|
||||
lU=; b=Upeefp0OZATDpZxWgrtHSzR2/FFiAwyRjS0PC/HWQehfO8m3OS4/AkyP1
|
||||
L96BnIrJ3Uk4WRUTblFAJvE+dJAiQeJ1WmOsJ+Dkgshp5OGZ0pUhxf/n45Ro4BuL
|
||||
VTC4QqUzoYnFC/ut2gfaL91yRN5tZmU+2ik5O+8E1vvF/IwhZcLDw6tcR/JX6Ixa
|
||||
X+EWoETX3GQC1Dbwzf9yMctarPw5mxJ8ERUyGHtDuFyzr0v0ReMlCfWqdBd0Ekca
|
||||
/EA5D9Um8kl6S9wVk6XgFvZm2vyzRIhfmLQqoEzcCKywrMv2qiCquAYqWMUFIdM+
|
||||
3TkvJqkWkNjRz6J6Dbd2i15CpL/Sw==
|
||||
X-ME-Sender: <xms:sp86XLgZgR-OuGupvTKImnW3geoxWw9AmBdt1C0DGN-t7owcwWYflg>
|
||||
X-ME-Proxy-Cause:
|
||||
gggruggvucftvghtrhhoucdtuddrgedtledrfeekgdduvdcutefuodetggdotefrodftvf
|
||||
curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt
|
||||
tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg
|
||||
hfgggtgfesthekredtredtjeenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceo
|
||||
shgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuffhomhgrihhnpegrrhhmsghirg
|
||||
hnrdgtohhmpdhgihhthhhusgdrtghomhdpfihhihhtvghquhgrrhhkrdhorhhgnecukfhp
|
||||
peejtddrudefhedrudegkedrudehudenucfrrghrrghmpehmrghilhhfrhhomhepshgrmh
|
||||
huvghlsehshhholhhlrghnugdrohhrghenucevlhhushhtvghrufhiiigvpedt
|
||||
X-ME-Proxy: <xmx:sp86XClRnRqP6qey5otmmQUXhLScRlq2lYK8B3cn0kI6EqlMQuByFg>
|
||||
<xmx:sp86XHpy0uQ1V3qD29APOD9ngWzb5KHgeV3vOBV4LioAvt-bR0k-rg>
|
||||
<xmx:sp86XLGPLYL3h3AW4JPSnrVuevGIGc3rsQVzKchjHOk5g30XwDbN5g>
|
||||
<xmx:s586XDRmlHkvg3iGQmu4ZPLH-3nA609xxZWSVf6vR2Xqp8dt6ACFxw>
|
||||
Received: from titanium.stl.sholland.net
|
||||
(70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151])
|
||||
by mail.messagingengine.com (Postfix) with ESMTPA id 6F2A31026D;
|
||||
Sat, 12 Jan 2019 21:17:21 -0500 (EST)
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
To: Catalin Marinas <catalin.marinas@arm.com>,
|
||||
Will Deacon <will.deacon@arm.com>,
|
||||
Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>,
|
||||
Rob Herring <robh+dt@kernel.org>, Mark Rutland <Mark.Rutland@arm.com>,
|
||||
Daniel Lezcano <daniel.lezcano@linaro.org>,
|
||||
Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <marc.zyngier@arm.com>
|
||||
Subject: [PATCH v3 1/2] arm64: arch_timer: Workaround for Allwinner A64 timer
|
||||
instability
|
||||
Date: Sat, 12 Jan 2019 20:17:18 -0600
|
||||
Message-Id: <20190113021719.46457-2-samuel@sholland.org>
|
||||
X-Mailer: git-send-email 2.19.2
|
||||
In-Reply-To: <20190113021719.46457-1-samuel@sholland.org>
|
||||
References: <20190113021719.46457-1-samuel@sholland.org>
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20190112_181733_065120_A96E9A2B
|
||||
X-CRM114-Status: GOOD ( 19.89 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
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,
|
||||
linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
|
||||
Samuel Holland <samuel@sholland.org>
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
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
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
The Allwinner A64 SoC is known[1] to have an unstable architectural
|
||||
timer, which manifests itself most obviously in the time jumping forward
|
||||
a multiple of 95 years[2][3]. This coincides with 2^56 cycles at a
|
||||
timer frequency of 24 MHz, implying that the time went slightly backward
|
||||
(and this was interpreted by the kernel as it jumping forward and
|
||||
wrapping around past the epoch).
|
||||
|
||||
Investigation revealed instability in the low bits of CNTVCT at the
|
||||
point a high bit rolls over. This leads to power-of-two cycle forward
|
||||
and backward jumps. (Testing shows that forward jumps are about twice as
|
||||
likely as backward jumps.) Since the counter value returns to normal
|
||||
after an indeterminate read, each "jump" really consists of both a
|
||||
forward and backward jump from the software perspective.
|
||||
|
||||
Unless the kernel is trapping CNTVCT reads, a userspace program is able
|
||||
to read the register in a loop faster than it changes. A test program
|
||||
running on all 4 CPU cores that reported jumps larger than 100 ms was
|
||||
run for 13.6 hours and reported the following:
|
||||
|
||||
Count | Event
|
||||
-------+---------------------------
|
||||
9940 | jumped backward 699ms
|
||||
268 | jumped backward 1398ms
|
||||
1 | jumped backward 2097ms
|
||||
16020 | jumped forward 175ms
|
||||
6443 | jumped forward 699ms
|
||||
2976 | jumped forward 1398ms
|
||||
9 | jumped forward 356516ms
|
||||
9 | jumped forward 357215ms
|
||||
4 | jumped forward 714430ms
|
||||
1 | jumped forward 3578440ms
|
||||
|
||||
This works out to a jump larger than 100 ms about every 5.5 seconds on
|
||||
each CPU core.
|
||||
|
||||
The largest jump (almost an hour!) was the following sequence of reads:
|
||||
0x0000007fffffffff → 0x00000093feffffff → 0x0000008000000000
|
||||
|
||||
Note that the middle bits don't necessarily all read as all zeroes or
|
||||
all ones during the anomalous behavior; however the low 10 bits checked
|
||||
by the function in this patch have never been observed with any other
|
||||
value.
|
||||
|
||||
Also note that smaller jumps are much more common, with backward jumps
|
||||
of 2048 (2^11) cycles observed over 400 times per second on each core.
|
||||
(Of course, this is partially explained by lower bits rolling over more
|
||||
frequently.) Any one of these could have caused the 95 year time skip.
|
||||
|
||||
Similar anomalies were observed while reading CNTPCT (after patching the
|
||||
kernel to allow reads from userspace). However, the CNTPCT jumps are
|
||||
much less frequent, and only small jumps were observed. The same program
|
||||
as before (except now reading CNTPCT) observed after 72 hours:
|
||||
|
||||
Count | Event
|
||||
-------+---------------------------
|
||||
17 | jumped backward 699ms
|
||||
52 | jumped forward 175ms
|
||||
2831 | jumped forward 699ms
|
||||
5 | jumped forward 1398ms
|
||||
|
||||
Further investigation showed that the instability in CNTPCT/CNTVCT also
|
||||
affected the respective timer's TVAL register. The following values were
|
||||
observed immediately after writing CNVT_TVAL to 0x10000000:
|
||||
|
||||
CNTVCT | CNTV_TVAL | CNTV_CVAL | CNTV_TVAL Error
|
||||
--------------------+------------+--------------------+-----------------
|
||||
0x000000d4a2d8bfff | 0x10003fff | 0x000000d4b2d8bfff | +0x00004000
|
||||
0x000000d4a2d94000 | 0x0fffffff | 0x000000d4b2d97fff | -0x00004000
|
||||
0x000000d4a2d97fff | 0x10003fff | 0x000000d4b2d97fff | +0x00004000
|
||||
0x000000d4a2d9c000 | 0x0fffffff | 0x000000d4b2d9ffff | -0x00004000
|
||||
|
||||
The pattern of errors in CNTV_TVAL seemed to depend on exactly which
|
||||
value was written to it. For example, after writing 0x10101010:
|
||||
|
||||
CNTVCT | CNTV_TVAL | CNTV_CVAL | CNTV_TVAL Error
|
||||
--------------------+------------+--------------------+-----------------
|
||||
0x000001ac3effffff | 0x1110100f | 0x000001ac4f10100f | +0x1000000
|
||||
0x000001ac40000000 | 0x1010100f | 0x000001ac5110100f | -0x1000000
|
||||
0x000001ac58ffffff | 0x1110100f | 0x000001ac6910100f | +0x1000000
|
||||
0x000001ac66000000 | 0x1010100f | 0x000001ac7710100f | -0x1000000
|
||||
0x000001ac6affffff | 0x1110100f | 0x000001ac7b10100f | +0x1000000
|
||||
0x000001ac6e000000 | 0x1010100f | 0x000001ac7f10100f | -0x1000000
|
||||
|
||||
I was also twice able to reproduce the issue covered by Allwinner's
|
||||
workaround[4], that writing to TVAL sometimes fails, and both CVAL and
|
||||
TVAL are left with entirely bogus values. One was the following values:
|
||||
|
||||
CNTVCT | CNTV_TVAL | CNTV_CVAL
|
||||
--------------------+------------+--------------------------------------
|
||||
0x000000d4a2d6014c | 0x8fbd5721 | 0x000000d132935fff (615s in the past)
|
||||
|
||||
========================================================================
|
||||
|
||||
Because the CPU can read the CNTPCT/CNTVCT registers faster than they
|
||||
change, performing two reads of the register and comparing the high bits
|
||||
(like other workarounds) is not a workable solution. And because the
|
||||
timer can jump both forward and backward, no pair of reads can
|
||||
distinguish a good value from a bad one. The only way to guarantee a
|
||||
good value from consecutive reads would be to read _three_ times, and
|
||||
take the middle value only if the three values are 1) each unique and
|
||||
2) increasing. This takes at minimum 3 counter cycles (125 ns), or more
|
||||
if an anomaly is detected.
|
||||
|
||||
However, since there is a distinct pattern to the bad values, we can
|
||||
optimize the common case (1022/1024 of the time) to a single read by
|
||||
simply ignoring values that match the error pattern. This still takes no
|
||||
more than 3 cycles in the worst case, and requires much less code. As an
|
||||
additional safety check, we still limit the loop iteration to the number
|
||||
of max-frequency (1.2 GHz) CPU cycles in three 24 MHz counter periods.
|
||||
|
||||
For the TVAL registers, the simple solution is to not use them. Instead,
|
||||
read or write the CVAL and calculate the TVAL value in software.
|
||||
|
||||
Although the manufacturer is aware of at least part of the erratum[4],
|
||||
there is no official name for it. For now, use the kernel-internal name
|
||||
"UNKNOWN1".
|
||||
|
||||
[1]: https://github.com/armbian/build/commit/a08cd6fe7ae9
|
||||
[2]: https://forum.armbian.com/topic/3458-a64-datetime-clock-issue/
|
||||
[3]: https://irclog.whitequark.org/linux-sunxi/2018-01-26
|
||||
[4]: https://github.com/Allwinner-Homlet/H6-BSP4.9-linux/blob/master/drivers/clocksource/arm_arch_timer.c#L272
|
||||
|
||||
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
|
||||
Tested-by: Andre Przywara <andre.przywara@arm.com>
|
||||
Signed-off-by: Samuel Holland <samuel@sholland.org>
|
||||
---
|
||||
Documentation/arm64/silicon-errata.txt | 2 +
|
||||
drivers/clocksource/Kconfig | 10 +++++
|
||||
drivers/clocksource/arm_arch_timer.c | 55 ++++++++++++++++++++++++++
|
||||
3 files changed, 67 insertions(+)
|
||||
|
||||
diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
|
||||
index 8f9577621144..4a269732d2a0 100644
|
||||
--- a/Documentation/arm64/silicon-errata.txt
|
||||
+++ b/Documentation/arm64/silicon-errata.txt
|
||||
@@ -44,6 +44,8 @@ stable kernels.
|
||||
|
||||
| Implementor | Component | Erratum ID | Kconfig |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+| Allwinner | A64/R18 | UNKNOWN1 | SUN50I_ERRATUM_UNKNOWN1 |
|
||||
+| | | | |
|
||||
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
|
||||
| ARM | Cortex-A53 | #827319 | ARM64_ERRATUM_827319 |
|
||||
| ARM | Cortex-A53 | #824069 | ARM64_ERRATUM_824069 |
|
||||
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
|
||||
index 55c77e44bb2d..d20ff4da07c3 100644
|
||||
--- a/drivers/clocksource/Kconfig
|
||||
+++ b/drivers/clocksource/Kconfig
|
||||
@@ -364,6 +364,16 @@ config ARM64_ERRATUM_858921
|
||||
The workaround will be dynamically enabled when an affected
|
||||
core is detected.
|
||||
|
||||
+config SUN50I_ERRATUM_UNKNOWN1
|
||||
+ bool "Workaround for Allwinner A64 erratum UNKNOWN1"
|
||||
+ default y
|
||||
+ depends on ARM_ARCH_TIMER && ARM64 && ARCH_SUNXI
|
||||
+ select ARM_ARCH_TIMER_OOL_WORKAROUND
|
||||
+ help
|
||||
+ This option enables a workaround for instability in the timer on
|
||||
+ the Allwinner A64 SoC. The workaround will only be active if the
|
||||
+ allwinner,erratum-unknown1 property is found in the timer node.
|
||||
+
|
||||
config ARM_GLOBAL_TIMER
|
||||
bool "Support for the ARM global timer" if COMPILE_TEST
|
||||
select TIMER_OF if OF
|
||||
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
|
||||
index 9a7d4dc00b6e..a8b20b65bd4b 100644
|
||||
--- a/drivers/clocksource/arm_arch_timer.c
|
||||
+++ b/drivers/clocksource/arm_arch_timer.c
|
||||
@@ -326,6 +326,48 @@ static u64 notrace arm64_1188873_read_cntvct_el0(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_SUN50I_ERRATUM_UNKNOWN1
|
||||
+/*
|
||||
+ * The low bits of the counter registers are indeterminate while bit 10 or
|
||||
+ * greater is rolling over. Since the counter value can jump both backward
|
||||
+ * (7ff -> 000 -> 800) and forward (7ff -> fff -> 800), ignore register values
|
||||
+ * with all ones or all zeros in the low bits. Bound the loop by the maximum
|
||||
+ * number of CPU cycles in 3 consecutive 24 MHz counter periods.
|
||||
+ */
|
||||
+#define __sun50i_a64_read_reg(reg) ({ \
|
||||
+ u64 _val; \
|
||||
+ int _retries = 150; \
|
||||
+ \
|
||||
+ do { \
|
||||
+ _val = read_sysreg(reg); \
|
||||
+ _retries--; \
|
||||
+ } while (((_val + 1) & GENMASK(9, 0)) <= 1 && _retries); \
|
||||
+ \
|
||||
+ WARN_ON_ONCE(!_retries); \
|
||||
+ _val; \
|
||||
+})
|
||||
+
|
||||
+static u64 notrace sun50i_a64_read_cntpct_el0(void)
|
||||
+{
|
||||
+ return __sun50i_a64_read_reg(cntpct_el0);
|
||||
+}
|
||||
+
|
||||
+static u64 notrace sun50i_a64_read_cntvct_el0(void)
|
||||
+{
|
||||
+ return __sun50i_a64_read_reg(cntvct_el0);
|
||||
+}
|
||||
+
|
||||
+static u32 notrace sun50i_a64_read_cntp_tval_el0(void)
|
||||
+{
|
||||
+ return read_sysreg(cntp_cval_el0) - sun50i_a64_read_cntpct_el0();
|
||||
+}
|
||||
+
|
||||
+static u32 notrace sun50i_a64_read_cntv_tval_el0(void)
|
||||
+{
|
||||
+ return read_sysreg(cntv_cval_el0) - sun50i_a64_read_cntvct_el0();
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#ifdef CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND
|
||||
DEFINE_PER_CPU(const struct arch_timer_erratum_workaround *, timer_unstable_counter_workaround);
|
||||
EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround);
|
||||
@@ -423,6 +465,19 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
|
||||
.read_cntvct_el0 = arm64_1188873_read_cntvct_el0,
|
||||
},
|
||||
#endif
|
||||
+#ifdef CONFIG_SUN50I_ERRATUM_UNKNOWN1
|
||||
+ {
|
||||
+ .match_type = ate_match_dt,
|
||||
+ .id = "allwinner,erratum-unknown1",
|
||||
+ .desc = "Allwinner erratum UNKNOWN1",
|
||||
+ .read_cntp_tval_el0 = sun50i_a64_read_cntp_tval_el0,
|
||||
+ .read_cntv_tval_el0 = sun50i_a64_read_cntv_tval_el0,
|
||||
+ .read_cntpct_el0 = sun50i_a64_read_cntpct_el0,
|
||||
+ .read_cntvct_el0 = sun50i_a64_read_cntvct_el0,
|
||||
+ .set_next_event_phys = erratum_set_next_event_tval_phys,
|
||||
+ .set_next_event_virt = erratum_set_next_event_tval_virt,
|
||||
+ },
|
||||
+#endif
|
||||
};
|
||||
|
||||
typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *,
|
||||
|
||||
From patchwork Sun Jan 13 02:17:19 2019
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Samuel Holland <samuel@sholland.org>
|
||||
X-Patchwork-Id: 10761195
|
||||
Return-Path:
|
||||
<linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5600213B5
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 13 Jan 2019 02:17:49 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 455A02908A
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 13 Jan 2019 02:17:49 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 397D52908F; Sun, 13 Jan 2019 02:17:49 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 99BED2908A
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 13 Jan 2019 02:17:48 +0000 (UTC)
|
||||
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:Cc:List-Subscribe:List-Help:List-Post:
|
||||
List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
|
||||
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:
|
||||
List-Owner; bh=81rywXc0nLAQXkKBaUF3JbVJE1w8kNqPZiSw/rJIxQU=; b=bzFR1Zl3PUkKOj
|
||||
GDlGg1LEgye6Wvu5OpjIF/BFr5WR3u6PByyyLk5b2v/IaPz/Jl+GwULiFoqCtOClaOf4eXTPUAVk4
|
||||
/zv54RuzWhCLNK5E+bMFJDcOmNqXlmoJnnQrXI4NsfWPgT0l8y8eqSW0vMplCCojSsdOw24wVv8y7
|
||||
UxMyWC8WKVaW6KzMEBAS5EgV1tredQlpRUBOsmnFMY2N6EkRCfFX4DxehywPBiv2Af35czHO0roiy
|
||||
WNESOXNXRxjJivnshxW4+XPfcLlSfQhovZKeue+ztLUkJdeQoeg56oBv9+Vh2SXNbUnew+Nw7v/Gm
|
||||
17TZYrFktGxOAOhb+cOw==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1giVLL-0001Ip-VF; Sun, 13 Jan 2019 02:17:44 +0000
|
||||
Received: from out1-smtp.messagingengine.com ([66.111.4.25])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1giVLA-0001BV-QY
|
||||
for linux-arm-kernel@lists.infradead.org; Sun, 13 Jan 2019 02:17:34 +0000
|
||||
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
|
||||
by mailout.nyi.internal (Postfix) with ESMTP id 58C172217A;
|
||||
Sat, 12 Jan 2019 21:17:23 -0500 (EST)
|
||||
Received: from mailfrontend2 ([10.202.2.163])
|
||||
by compute5.internal (MEProxy); Sat, 12 Jan 2019 21:17:23 -0500
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h=
|
||||
from:to:cc:subject:date:message-id:in-reply-to:references
|
||||
:mime-version:content-transfer-encoding; s=fm1; bh=BcKEOqrm2Nddz
|
||||
dFcJfheN0gw9UIuZWkg3rxvmQZRiIs=; b=VQCFZC/fuHByg4cpT6HXrPggPO7Ya
|
||||
7v5IEDVxQpSkqH702Nr1s4JAYbcdkol3j0AwYlfh4DXsKWVJu6aeu6WdntZViEGr
|
||||
cKYGOmRx9g/A9t4Pv74giorkqeDx4qsmjrOPGTxNkvYAVWOWYtyXllZDm2U+s30g
|
||||
wCw2Y40NPYrJKqcGXFrKmiLQeelJA7aBNcv464toHdGKqKssaj9Ga06vS9UnG7Pj
|
||||
JT90zC11j2dqM/SI+lblqWz3IQQqfx87qiKn/qhhOkiSv74fMFDfmBpgzQcfwJFZ
|
||||
hStK5QZihYCLG94SuhTGgfJzRTSXks0Kt3EL5AcLDqaVH9qujyMg6JKXQ==
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
|
||||
messagingengine.com; h=cc:content-transfer-encoding:date:from
|
||||
:in-reply-to:message-id:mime-version:references:subject:to
|
||||
:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
|
||||
fm1; bh=BcKEOqrm2NddzdFcJfheN0gw9UIuZWkg3rxvmQZRiIs=; b=iJBq9L23
|
||||
6lDXPuxV7FsoVVaFnY3c+Sc/+wsLVJCsIzowctPQ4Kt89W15UIaACbxm72T4LzGw
|
||||
RSg47CGMKVmqWdoFlCF3AqsADizdNHw8bZgSsug8OxThLWnm8bwDCMDgQNnoY9kN
|
||||
nlkmNI3g26PQJSTzYw+nPfgk//LCBlPWsacufHcT6dfbaoPLOVyRMXZTqwFArUQv
|
||||
oWx34MVGM+BYBvo78zpG4EkdLXx2nuvwiO3nz/D9aaFvLt//mXBHhpR2qFNCQoQh
|
||||
ExIIq/6GJSLRF29mHXwtmXSGGE2plK85c7lc599Hr6AwEFCMBbyYftksKF8gRCDT
|
||||
X5KWIrsMAHwNmw==
|
||||
X-ME-Sender: <xms:sp86XK7GnQHA9uHaHGZsyRJJRdVPHqaqXrcZSZDhFHK9mw52sOD8Mw>
|
||||
X-ME-Proxy-Cause:
|
||||
gggruggvucftvghtrhhoucdtuddrgedtledrfeekgdduvdcutefuodetggdotefrodftvf
|
||||
curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt
|
||||
tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojg
|
||||
hfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcujfholhhlrghnugcuoehs
|
||||
rghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucfkphepjedtrddufeehrddugeekrd
|
||||
duhedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu
|
||||
rdhorhhgnecuvehluhhsthgvrhfuihiivgeptd
|
||||
X-ME-Proxy: <xmx:sp86XB018KTtDKatCu7gB4vrEktSU_R5Kofe4r5HX1Vgcfgs3AWTxQ>
|
||||
<xmx:sp86XBApgRBLm_CLOjfcZdkoeYXTHGiaw5bTKV1ZWrD68QOFmKvX8A>
|
||||
<xmx:sp86XD3HOmrRMd6Re7jXqrUdDh9oicR3Mx3OuyUSPBmc0uhZzn-Dlw>
|
||||
<xmx:s586XOboucBXUXW8COEbY-dWquI3bdp6K1N7Piyn8RdSWcTQSPUVew>
|
||||
Received: from titanium.stl.sholland.net
|
||||
(70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151])
|
||||
by mail.messagingengine.com (Postfix) with ESMTPA id 07E8010085;
|
||||
Sat, 12 Jan 2019 21:17:22 -0500 (EST)
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
To: Catalin Marinas <catalin.marinas@arm.com>,
|
||||
Will Deacon <will.deacon@arm.com>,
|
||||
Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>,
|
||||
Rob Herring <robh+dt@kernel.org>, Mark Rutland <Mark.Rutland@arm.com>,
|
||||
Daniel Lezcano <daniel.lezcano@linaro.org>,
|
||||
Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <marc.zyngier@arm.com>
|
||||
Subject: [PATCH v3 2/2] arm64: dts: allwinner: a64: Enable A64 timer
|
||||
workaround
|
||||
Date: Sat, 12 Jan 2019 20:17:19 -0600
|
||||
Message-Id: <20190113021719.46457-3-samuel@sholland.org>
|
||||
X-Mailer: git-send-email 2.19.2
|
||||
In-Reply-To: <20190113021719.46457-1-samuel@sholland.org>
|
||||
References: <20190113021719.46457-1-samuel@sholland.org>
|
||||
MIME-Version: 1.0
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20190112_181733_014958_D1734ED1
|
||||
X-CRM114-Status: GOOD ( 10.90 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
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,
|
||||
linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
|
||||
Samuel Holland <samuel@sholland.org>
|
||||
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
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
As instability in the architectural timer has been observed on multiple
|
||||
devices using this SoC, inluding the Pine64 and the Orange Pi Win,
|
||||
enable the workaround in the SoC's device tree.
|
||||
|
||||
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
|
||||
Signed-off-by: Samuel Holland <samuel@sholland.org>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
index f3a66f888205..13eac92a8c55 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
@@ -175,6 +175,7 @@
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv8-timer";
|
||||
+ allwinner,erratum-unknown1;
|
||||
interrupts = <GIC_PPI 13
|
||||
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
|
||||
<GIC_PPI 14
|
|
@ -0,0 +1,42 @@
|
|||
From linux-netdev Thu Jan 03 12:26:34 2019
|
||||
From: Oliver Hartkopp <socketcan () hartkopp ! net>
|
||||
Date: Thu, 03 Jan 2019 12:26:34 +0000
|
||||
To: linux-netdev
|
||||
Subject: [PATCH] can: gw: ensure DLC boundaries after CAN frame modification
|
||||
Message-Id: <20190103122634.2530-1-socketcan () hartkopp ! net>
|
||||
X-MARC-Message: https://marc.info/?l=linux-netdev&m=154651842302479
|
||||
|
||||
The CAN frame modification rules allow bitwise logical operations which can
|
||||
be also applied to the can_dlc field. Ensure the manipulation result to
|
||||
maintain the can_dlc boundaries so that the CAN drivers do not accidently
|
||||
write arbitrary content beyond the data registers in the CAN controllers
|
||||
I/O mem when processing can-gw manipulated outgoing frames. When passing these
|
||||
frames to user space this issue did not have any effect to the kernel or any
|
||||
leaked data as we always strictly copy sizeof(struct can_frame) bytes.
|
||||
|
||||
Reported-by: Muyu Yu <ieatmuttonchuan@gmail.com>
|
||||
Reported-by: Marcus Meissner <meissner@suse.de>
|
||||
Tested-by: Muyu Yu <ieatmuttonchuan@gmail.com>
|
||||
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
|
||||
Cc: linux-stable <stable@vger.kernel.org> # >= v3.2
|
||||
---
|
||||
net/can/gw.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/net/can/gw.c b/net/can/gw.c
|
||||
index faa3da88a127..9000d9b8a133 100644
|
||||
--- a/net/can/gw.c
|
||||
+++ b/net/can/gw.c
|
||||
@@ -418,6 +418,10 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)
|
||||
|
||||
/* check for checksum updates when the CAN frame has been modified */
|
||||
if (modidx) {
|
||||
+ /* ensure DLC boundaries after the different mods */
|
||||
+ if (cf->can_dlc > 8)
|
||||
+ cf->can_dlc = 8;
|
||||
+
|
||||
if (gwj->mod.csumfunc.crc8)
|
||||
(*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8);
|
||||
|
||||
--
|
||||
2.19.2
|
|
@ -1,24 +0,0 @@
|
|||
From ea6e7d9d0fe3e448aef19b3943d4897ae0bef128 Mon Sep 17 00:00:00 2001
|
||||
From: Fedora Kernel Team <kernel-team@fedoraproject.org>
|
||||
Date: Thu, 3 Aug 2017 13:46:51 -0500
|
||||
Subject: [PATCH] Fix for module sig verification
|
||||
|
||||
---
|
||||
kernel/module_signing.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/kernel/module_signing.c b/kernel/module_signing.c
|
||||
index 937c844..d3d6f95 100644
|
||||
--- a/kernel/module_signing.c
|
||||
+++ b/kernel/module_signing.c
|
||||
@@ -81,6 +81,6 @@ int mod_verify_sig(const void *mod, unsigned long *_modlen)
|
||||
}
|
||||
|
||||
return verify_pkcs7_signature(mod, modlen, mod + modlen, sig_len,
|
||||
- NULL, VERIFYING_MODULE_SIGNATURE,
|
||||
+ (void *)1UL, VERIFYING_MODULE_SIGNATURE,
|
||||
NULL, NULL);
|
||||
}
|
||||
--
|
||||
2.13.3
|
||||
|
|
@ -1,246 +0,0 @@
|
|||
From 90dc66270b02981b19a085c6a9184e3452b7b3e8 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
Date: Fri, 5 May 2017 08:21:59 +0100
|
||||
Subject: [PATCH 3/4] MODSIGN: Import certificates from UEFI Secure Boot
|
||||
|
||||
Secure Boot stores a list of allowed certificates in the 'db' variable.
|
||||
This imports those certificates into the system trusted keyring. This
|
||||
allows for a third party signing certificate to be used in conjunction
|
||||
with signed modules. By importing the public certificate into the 'db'
|
||||
variable, a user can allow a module signed with that certificate to
|
||||
load. The shim UEFI bootloader has a similar certificate list stored
|
||||
in the 'MokListRT' variable. We import those as well.
|
||||
|
||||
Secure Boot also maintains a list of disallowed certificates in the 'dbx'
|
||||
variable. We load those certificates into the newly introduced system
|
||||
blacklist keyring and forbid any module signed with those from loading and
|
||||
forbid the use within the kernel of any key with a matching hash.
|
||||
|
||||
This facility is enabled by setting CONFIG_LOAD_UEFI_KEYS.
|
||||
|
||||
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
Signed-off-by: David Howells <dhowells@redhat.com>
|
||||
---
|
||||
certs/Kconfig | 16 ++++++
|
||||
certs/Makefile | 4 ++
|
||||
certs/load_uefi.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 188 insertions(+)
|
||||
create mode 100644 certs/load_uefi.c
|
||||
|
||||
diff --git a/certs/Kconfig b/certs/Kconfig
|
||||
index 630ae09..edf9f75 100644
|
||||
--- a/certs/Kconfig
|
||||
+++ b/certs/Kconfig
|
||||
@@ -90,4 +90,20 @@ config EFI_SIGNATURE_LIST_PARSER
|
||||
This option provides support for parsing EFI signature lists for
|
||||
X.509 certificates and turning them into keys.
|
||||
|
||||
+config LOAD_UEFI_KEYS
|
||||
+ bool "Load certs and blacklist from UEFI db for module checking"
|
||||
+ depends on SYSTEM_BLACKLIST_KEYRING
|
||||
+ depends on SECONDARY_TRUSTED_KEYRING
|
||||
+ depends on EFI
|
||||
+ depends on EFI_SIGNATURE_LIST_PARSER
|
||||
+ help
|
||||
+ If the kernel is booted in secure boot mode, this option will cause
|
||||
+ the kernel to load the certificates from the UEFI db and MokListRT
|
||||
+ into the secondary trusted keyring. It will also load any X.509
|
||||
+ SHA256 hashes in the dbx list into the blacklist.
|
||||
+
|
||||
+ The effect of this is that, if the kernel is booted in secure boot
|
||||
+ mode, modules signed with UEFI-stored keys will be permitted to be
|
||||
+ loaded and keys that match the blacklist will be rejected.
|
||||
+
|
||||
endmenu
|
||||
diff --git a/certs/Makefile b/certs/Makefile
|
||||
index 738151a..a5e057a 100644
|
||||
--- a/certs/Makefile
|
||||
+++ b/certs/Makefile
|
||||
@@ -11,6 +11,10 @@ obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o
|
||||
endif
|
||||
obj-$(CONFIG_EFI_SIGNATURE_LIST_PARSER) += efi_parser.o
|
||||
|
||||
+obj-$(CONFIG_LOAD_UEFI_KEYS) += load_uefi.o
|
||||
+$(obj)/load_uefi.o: KBUILD_CFLAGS += -fshort-wchar
|
||||
+
|
||||
+
|
||||
ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y)
|
||||
|
||||
$(eval $(call config_filename,SYSTEM_TRUSTED_KEYS))
|
||||
diff --git a/certs/load_uefi.c b/certs/load_uefi.c
|
||||
new file mode 100644
|
||||
index 0000000..b44e464
|
||||
--- /dev/null
|
||||
+++ b/certs/load_uefi.c
|
||||
@@ -0,0 +1,168 @@
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/sched.h>
|
||||
+#include <linux/cred.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/efi.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <keys/asymmetric-type.h>
|
||||
+#include <keys/system_keyring.h>
|
||||
+#include "internal.h"
|
||||
+
|
||||
+static __initdata efi_guid_t efi_cert_x509_guid = EFI_CERT_X509_GUID;
|
||||
+static __initdata efi_guid_t efi_cert_x509_sha256_guid = EFI_CERT_X509_SHA256_GUID;
|
||||
+static __initdata efi_guid_t efi_cert_sha256_guid = EFI_CERT_SHA256_GUID;
|
||||
+
|
||||
+/*
|
||||
+ * 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)
|
||||
+{
|
||||
+ efi_status_t status;
|
||||
+ unsigned long lsize = 4;
|
||||
+ unsigned long tmpdb[4];
|
||||
+ void *db;
|
||||
+
|
||||
+ status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
|
||||
+ if (status != EFI_BUFFER_TOO_SMALL) {
|
||||
+ pr_err("Couldn't get size: 0x%lx\n", status);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ db = kmalloc(lsize, GFP_KERNEL);
|
||||
+ if (!db) {
|
||||
+ pr_err("Couldn't allocate memory for uefi cert list\n");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ 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;
|
||||
+ }
|
||||
+
|
||||
+ *size = lsize;
|
||||
+ return db;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Blacklist an X509 TBS hash.
|
||||
+ */
|
||||
+static __init void uefi_blacklist_x509_tbs(const char *source,
|
||||
+ const void *data, size_t len)
|
||||
+{
|
||||
+ char *hash, *p;
|
||||
+
|
||||
+ hash = kmalloc(4 + len * 2 + 1, GFP_KERNEL);
|
||||
+ if (!hash)
|
||||
+ return;
|
||||
+ p = memcpy(hash, "tbs:", 4);
|
||||
+ p += 4;
|
||||
+ bin2hex(p, data, len);
|
||||
+ p += len * 2;
|
||||
+ *p = 0;
|
||||
+
|
||||
+ mark_hash_blacklisted(hash);
|
||||
+ kfree(hash);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Blacklist the hash of an executable.
|
||||
+ */
|
||||
+static __init void uefi_blacklist_binary(const char *source,
|
||||
+ const void *data, size_t len)
|
||||
+{
|
||||
+ char *hash, *p;
|
||||
+
|
||||
+ hash = kmalloc(4 + len * 2 + 1, GFP_KERNEL);
|
||||
+ if (!hash)
|
||||
+ return;
|
||||
+ p = memcpy(hash, "bin:", 4);
|
||||
+ p += 4;
|
||||
+ bin2hex(p, data, len);
|
||||
+ p += len * 2;
|
||||
+ *p = 0;
|
||||
+
|
||||
+ mark_hash_blacklisted(hash);
|
||||
+ kfree(hash);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Return the appropriate handler for particular signature list types found in
|
||||
+ * the UEFI db and MokListRT tables.
|
||||
+ */
|
||||
+static __init efi_element_handler_t get_handler_for_db(const efi_guid_t *sig_type)
|
||||
+{
|
||||
+ if (efi_guidcmp(*sig_type, efi_cert_x509_guid) == 0)
|
||||
+ return add_trusted_secondary_key;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Return the appropriate handler for particular signature list types found in
|
||||
+ * the UEFI dbx and MokListXRT tables.
|
||||
+ */
|
||||
+static __init efi_element_handler_t get_handler_for_dbx(const efi_guid_t *sig_type)
|
||||
+{
|
||||
+ if (efi_guidcmp(*sig_type, efi_cert_x509_sha256_guid) == 0)
|
||||
+ return uefi_blacklist_x509_tbs;
|
||||
+ if (efi_guidcmp(*sig_type, efi_cert_sha256_guid) == 0)
|
||||
+ return uefi_blacklist_binary;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Load the certs contained in the UEFI databases
|
||||
+ */
|
||||
+static int __init load_uefi_certs(void)
|
||||
+{
|
||||
+ efi_guid_t secure_var = EFI_IMAGE_SECURITY_DATABASE_GUID;
|
||||
+ efi_guid_t mok_var = EFI_SHIM_LOCK_GUID;
|
||||
+ void *db = NULL, *dbx = NULL, *mok = NULL;
|
||||
+ unsigned long dbsize = 0, dbxsize = 0, moksize = 0;
|
||||
+ int rc = 0;
|
||||
+
|
||||
+ if (!efi.get_variable)
|
||||
+ return false;
|
||||
+
|
||||
+ /* Get db, MokListRT, and dbx. They might not exist, so it isn't
|
||||
+ * an error if we can't get them.
|
||||
+ */
|
||||
+ db = get_cert_list(L"db", &secure_var, &dbsize);
|
||||
+ if (!db) {
|
||||
+ pr_err("MODSIGN: Couldn't get UEFI db list\n");
|
||||
+ } else {
|
||||
+ rc = parse_efi_signature_list("UEFI:db",
|
||||
+ db, dbsize, get_handler_for_db);
|
||||
+ if (rc)
|
||||
+ pr_err("Couldn't parse db signatures: %d\n", rc);
|
||||
+ kfree(db);
|
||||
+ }
|
||||
+
|
||||
+ mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
|
||||
+ if (!mok) {
|
||||
+ pr_info("MODSIGN: Couldn't get UEFI MokListRT\n");
|
||||
+ } else {
|
||||
+ rc = parse_efi_signature_list("UEFI:MokListRT",
|
||||
+ mok, moksize, get_handler_for_db);
|
||||
+ if (rc)
|
||||
+ pr_err("Couldn't parse MokListRT signatures: %d\n", rc);
|
||||
+ kfree(mok);
|
||||
+ }
|
||||
+
|
||||
+ dbx = get_cert_list(L"dbx", &secure_var, &dbxsize);
|
||||
+ if (!dbx) {
|
||||
+ pr_info("MODSIGN: Couldn't get UEFI dbx list\n");
|
||||
+ } else {
|
||||
+ rc = parse_efi_signature_list("UEFI:dbx",
|
||||
+ dbx, dbxsize,
|
||||
+ get_handler_for_dbx);
|
||||
+ if (rc)
|
||||
+ pr_err("Couldn't parse dbx signatures: %d\n", rc);
|
||||
+ kfree(dbx);
|
||||
+ }
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+late_initcall(load_uefi_certs);
|
||||
--
|
||||
2.9.3
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
From 9f1958a0cc911e1f79b2733ee5029dbd819ff328 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
Date: Fri, 5 May 2017 08:21:59 +0100
|
||||
Subject: [PATCH 4/4] MODSIGN: Allow the "db" UEFI variable to be suppressed
|
||||
|
||||
If a user tells shim to not use the certs/hashes in the UEFI db variable
|
||||
for verification purposes, shim will set a UEFI variable called
|
||||
MokIgnoreDB. Have the uefi import code look for this and ignore the db
|
||||
variable if it is found.
|
||||
|
||||
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
Signed-off-by: David Howells <dhowells@redhat.com>
|
||||
---
|
||||
certs/load_uefi.c | 44 ++++++++++++++++++++++++++++++++++----------
|
||||
1 file changed, 34 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/certs/load_uefi.c b/certs/load_uefi.c
|
||||
index b44e464..3d88459 100644
|
||||
--- a/certs/load_uefi.c
|
||||
+++ b/certs/load_uefi.c
|
||||
@@ -13,6 +13,26 @@ static __initdata efi_guid_t efi_cert_x509_sha256_guid = EFI_CERT_X509_SHA256_GU
|
||||
static __initdata efi_guid_t efi_cert_sha256_guid = EFI_CERT_SHA256_GUID;
|
||||
|
||||
/*
|
||||
+ * Look to see if a UEFI variable called MokIgnoreDB exists and return true if
|
||||
+ * it does.
|
||||
+ *
|
||||
+ * This UEFI variable is set by the shim if a user tells the shim to not use
|
||||
+ * the certs/hashes in the UEFI db variable for verification purposes. If it
|
||||
+ * is set, we should ignore the db variable also and the true return indicates
|
||||
+ * this.
|
||||
+ */
|
||||
+static __init bool uefi_check_ignore_db(void)
|
||||
+{
|
||||
+ efi_status_t status;
|
||||
+ unsigned int db = 0;
|
||||
+ unsigned long size = sizeof(db);
|
||||
+ efi_guid_t guid = EFI_SHIM_LOCK_GUID;
|
||||
+
|
||||
+ status = efi.get_variable(L"MokIgnoreDB", &guid, NULL, &size, &db);
|
||||
+ return status == EFI_SUCCESS;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Get a certificate list blob from the named EFI variable.
|
||||
*/
|
||||
static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
|
||||
@@ -113,7 +133,9 @@ static __init efi_element_handler_t get_handler_for_dbx(const efi_guid_t *sig_ty
|
||||
}
|
||||
|
||||
/*
|
||||
- * Load the certs contained in the UEFI databases
|
||||
+ * Load the certs contained in the UEFI databases into the secondary trusted
|
||||
+ * keyring and the UEFI blacklisted X.509 cert SHA256 hashes into the blacklist
|
||||
+ * keyring.
|
||||
*/
|
||||
static int __init load_uefi_certs(void)
|
||||
{
|
||||
@@ -129,15 +151,17 @@ static int __init load_uefi_certs(void)
|
||||
/* Get db, MokListRT, and dbx. They might not exist, so it isn't
|
||||
* an error if we can't get them.
|
||||
*/
|
||||
- db = get_cert_list(L"db", &secure_var, &dbsize);
|
||||
- if (!db) {
|
||||
- pr_err("MODSIGN: Couldn't get UEFI db list\n");
|
||||
- } else {
|
||||
- rc = parse_efi_signature_list("UEFI:db",
|
||||
- db, dbsize, get_handler_for_db);
|
||||
- if (rc)
|
||||
- pr_err("Couldn't parse db signatures: %d\n", rc);
|
||||
- kfree(db);
|
||||
+ if (!uefi_check_ignore_db()) {
|
||||
+ db = get_cert_list(L"db", &secure_var, &dbsize);
|
||||
+ if (!db) {
|
||||
+ pr_err("MODSIGN: Couldn't get UEFI db list\n");
|
||||
+ } else {
|
||||
+ rc = parse_efi_signature_list("UEFI:db",
|
||||
+ db, dbsize, get_handler_for_db);
|
||||
+ if (rc)
|
||||
+ pr_err("Couldn't parse db signatures: %d\n", rc);
|
||||
+ kfree(db);
|
||||
+ }
|
||||
}
|
||||
|
||||
mok = get_cert_list(L"MokListRT", &mok_var, &moksize);
|
||||
--
|
||||
2.9.3
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
From patchwork Fri May 11 02:27:50 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Subject: [1/2] arm64: arch_timer: Workaround for Allwinner A64 timer
|
||||
instability
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
X-Patchwork-Id: 10392891
|
||||
Message-Id: <20180511022751.9096-2-samuel@sholland.org>
|
||||
To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>,
|
||||
Catalin Marinas <catalin.marinas@arm.com>,
|
||||
Will Deacon <will.deacon@arm.com>,
|
||||
Daniel Lezcano <daniel.lezcano@linaro.org>,
|
||||
Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <marc.zyngier@arm.com>
|
||||
Cc: linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org, Samuel Holland <samuel@sholland.org>
|
||||
Date: Thu, 10 May 2018 21:27:50 -0500
|
||||
|
||||
The Allwinner A64 SoC is known [1] to have an unstable architectural
|
||||
timer, which manifests itself most obviously in the time jumping forward
|
||||
a multiple of 95 years [2][3]. This coincides with 2^56 cycles at a
|
||||
timer frequency of 24 MHz, implying that the time went slightly backward
|
||||
(and this was interpreted by the kernel as it jumping forward and
|
||||
wrapping around past the epoch).
|
||||
|
||||
Further investigation revealed instability in the low bits of CNTVCT at
|
||||
the point a high bit rolls over. This leads to power-of-two cycle
|
||||
forward and backward jumps. (Testing shows that forward jumps are about
|
||||
twice as likely as backward jumps.)
|
||||
|
||||
Without trapping reads to CNTVCT, a userspace program is able to read it
|
||||
in a loop faster than it changes. A test program running on all 4 CPU
|
||||
cores that reported jumps larger than 100 ms was run for 13.6 hours and
|
||||
reported the following:
|
||||
|
||||
Count | Event
|
||||
-------+---------------------------
|
||||
9940 | jumped backward 699ms
|
||||
268 | jumped backward 1398ms
|
||||
1 | jumped backward 2097ms
|
||||
16020 | jumped forward 175ms
|
||||
6443 | jumped forward 699ms
|
||||
2976 | jumped forward 1398ms
|
||||
9 | jumped forward 356516ms
|
||||
9 | jumped forward 357215ms
|
||||
4 | jumped forward 714430ms
|
||||
1 | jumped forward 3578440ms
|
||||
|
||||
This works out to a jump larger than 100 ms about every 5.5 seconds on
|
||||
each CPU core.
|
||||
|
||||
The largest jump (almost an hour!) was the following sequence of reads:
|
||||
0x0000007fffffffff → 0x00000093feffffff → 0x0000008000000000
|
||||
|
||||
Note that the middle bits don't necessarily all read as all zeroes or
|
||||
all ones during the anomalous behavior; however the low 11 bits checked
|
||||
by the function in this patch have never been observed with any other
|
||||
value.
|
||||
|
||||
Also note that smaller jumps are much more common, with the smallest
|
||||
backward jumps of 2048 cycles observed over 400 times per second on each
|
||||
core. (Of course, this is partially due to lower bits rolling over more
|
||||
frequently.) Any one of these could have caused the 95 year time skip.
|
||||
|
||||
Similar anomalies were observed while reading CNTPCT (after patching the
|
||||
kernel to allow reads from userspace). However, the jumps are much less
|
||||
frequent, and only small jumps were observed. The same program as before
|
||||
(except now reading CNTPCT) observed after 72 hours:
|
||||
|
||||
Count | Event
|
||||
-------+---------------------------
|
||||
17 | jumped backward 699ms
|
||||
52 | jumped forward 175ms
|
||||
2831 | jumped forward 699ms
|
||||
5 | jumped forward 1398ms
|
||||
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
|
||||
Tested-by: Andre Przywara <andre.przywara@arm.com>
|
||||
|
||||
========================================================================
|
||||
|
||||
Because the CPU can read the CNTPCT/CNTVCT registers faster than they
|
||||
change, performing two reads of the register and comparing the high bits
|
||||
(like other workarounds) is not a workable solution. And because the
|
||||
timer can jump both forward and backward, no pair of reads can
|
||||
distinguish a good value from a bad one. The only way to guarantee a
|
||||
good value from consecutive reads would be to read _three_ times, and
|
||||
take the middle value iff the three values are 1) individually unique
|
||||
and 2) increasing. This takes at minimum 3 cycles (125 ns), or more if
|
||||
an anomaly is detected.
|
||||
|
||||
However, since there is a distinct pattern to the bad values, we can
|
||||
optimize the common case (2046/2048 of the time) to a single read by
|
||||
simply ignoring values that match the pattern. This still takes no more
|
||||
than 3 cycles in the worst case, and requires much less code.
|
||||
|
||||
[1]: https://github.com/armbian/build/commit/a08cd6fe7ae9
|
||||
[2]: https://forum.armbian.com/topic/3458-a64-datetime-clock-issue/
|
||||
[3]: https://irclog.whitequark.org/linux-sunxi/2018-01-26
|
||||
|
||||
Signed-off-by: Samuel Holland <samuel@sholland.org>
|
||||
---
|
||||
drivers/clocksource/Kconfig | 11 ++++++++++
|
||||
drivers/clocksource/arm_arch_timer.c | 39 ++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 50 insertions(+)
|
||||
|
||||
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
|
||||
index 8e8a09755d10..7a5d434dd30b 100644
|
||||
--- a/drivers/clocksource/Kconfig
|
||||
+++ b/drivers/clocksource/Kconfig
|
||||
@@ -364,6 +364,17 @@ config ARM64_ERRATUM_858921
|
||||
The workaround will be dynamically enabled when an affected
|
||||
core is detected.
|
||||
|
||||
+config SUN50I_A64_UNSTABLE_TIMER
|
||||
+ bool "Workaround for Allwinner A64 timer instability"
|
||||
+ default y
|
||||
+ depends on ARM_ARCH_TIMER && ARM64 && ARCH_SUNXI
|
||||
+ select ARM_ARCH_TIMER_OOL_WORKAROUND
|
||||
+ help
|
||||
+ This option enables a workaround for instability in the timer on
|
||||
+ the Allwinner A64 SoC. The workaround will only be active if the
|
||||
+ allwinner,sun50i-a64-unstable-timer property is found in the
|
||||
+ timer node.
|
||||
+
|
||||
config ARM_GLOBAL_TIMER
|
||||
bool "Support for the ARM global timer" if COMPILE_TEST
|
||||
select TIMER_OF if OF
|
||||
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
|
||||
index 57cb2f00fc07..66ce13578c52 100644
|
||||
--- a/drivers/clocksource/arm_arch_timer.c
|
||||
+++ b/drivers/clocksource/arm_arch_timer.c
|
||||
@@ -319,6 +319,36 @@ static u64 notrace arm64_858921_read_cntvct_el0(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_SUN50I_A64_UNSTABLE_TIMER
|
||||
+/*
|
||||
+ * The low bits of each register can transiently read as all ones or all zeroes
|
||||
+ * when bit 11 or greater rolls over. Since the value can jump both backward
|
||||
+ * (7ff -> 000 -> 800) and forward (7ff -> fff -> 800), it is simplest to just
|
||||
+ * ignore register values with all ones or zeros in the low bits.
|
||||
+ */
|
||||
+static u64 notrace sun50i_a64_read_cntpct_el0(void)
|
||||
+{
|
||||
+ u64 val;
|
||||
+
|
||||
+ do {
|
||||
+ val = read_sysreg(cntpct_el0);
|
||||
+ } while (((val + 1) & GENMASK(10, 0)) <= 1);
|
||||
+
|
||||
+ return val;
|
||||
+}
|
||||
+
|
||||
+static u64 notrace sun50i_a64_read_cntvct_el0(void)
|
||||
+{
|
||||
+ u64 val;
|
||||
+
|
||||
+ do {
|
||||
+ val = read_sysreg(cntvct_el0);
|
||||
+ } while (((val + 1) & GENMASK(10, 0)) <= 1);
|
||||
+
|
||||
+ return val;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#ifdef CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND
|
||||
DEFINE_PER_CPU(const struct arch_timer_erratum_workaround *, timer_unstable_counter_workaround);
|
||||
EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround);
|
||||
@@ -408,6 +438,15 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
|
||||
.read_cntvct_el0 = arm64_1188873_read_cntvct_el0,
|
||||
},
|
||||
#endif
|
||||
+#ifdef CONFIG_SUN50I_A64_UNSTABLE_TIMER
|
||||
+ {
|
||||
+ .match_type = ate_match_dt,
|
||||
+ .id = "allwinner,sun50i-a64-unstable-timer",
|
||||
+ .desc = "Allwinner A64 timer instability",
|
||||
+ .read_cntpct_el0 = sun50i_a64_read_cntpct_el0,
|
||||
+ .read_cntvct_el0 = sun50i_a64_read_cntvct_el0,
|
||||
+ },
|
||||
+#endif
|
||||
};
|
||||
|
||||
typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *,
|
|
@ -1,38 +0,0 @@
|
|||
From patchwork Fri May 11 02:27:51 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: [2/2] arm64: dts: allwinner: a64: Enable A64 timer workaround
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
X-Patchwork-Id: 10392889
|
||||
Message-Id: <20180511022751.9096-3-samuel@sholland.org>
|
||||
To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>,
|
||||
Catalin Marinas <catalin.marinas@arm.com>,
|
||||
Will Deacon <will.deacon@arm.com>,
|
||||
Daniel Lezcano <daniel.lezcano@linaro.org>,
|
||||
Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <marc.zyngier@arm.com>
|
||||
Cc: linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org, Samuel Holland <samuel@sholland.org>
|
||||
Date: Thu, 10 May 2018 21:27:51 -0500
|
||||
|
||||
As instability in the architectural timer has been observed on multiple
|
||||
devices using this SoC, inluding the Pine64 and the Orange Pi Win,
|
||||
enable the workaround in the SoC's device tree.
|
||||
|
||||
Signed-off-by: Samuel Holland <samuel@sholland.org>
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
index 1b2ef28c42bd..5202b76e9684 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
@@ -152,6 +152,7 @@
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv8-timer";
|
||||
+ allwinner,sun50i-a64-unstable-timer;
|
||||
interrupts = <GIC_PPI 13
|
||||
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
|
||||
<GIC_PPI 14
|
|
@ -1,99 +0,0 @@
|
|||
From 330c27ee59fb76db02c671ac4cb32914565aa609 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Fri, 23 Nov 2018 13:31:00 +0100
|
||||
Subject: [PATCH 1/2] HID: asus: Add event handler to catch unmapped Asus
|
||||
Vendor UsagePage codes
|
||||
|
||||
Various Asus devices generate HID events using the Asus Vendor specific
|
||||
UsagePage 0xff31 and hid-asus will map these in its input_mapping for all
|
||||
devices to which it binds (independent of any quirks).
|
||||
|
||||
Add an event callback which check for unmapped (because sofar unknown)
|
||||
usages within the Asus Vendor UsagePage and log a warning for these.
|
||||
|
||||
The purpose of this patch is to help debugging / find such unmapped codes
|
||||
and add them to the asus_input_mapping() function.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
drivers/hid/hid-asus.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
|
||||
index a1fa2fc8c9b5..043120cc4b97 100644
|
||||
--- a/drivers/hid/hid-asus.c
|
||||
+++ b/drivers/hid/hid-asus.c
|
||||
@@ -241,6 +241,17 @@ static int asus_report_input(struct asus_drvdata *drvdat, u8 *data, int size)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static int asus_event(struct hid_device *hdev, struct hid_field *field,
|
||||
+ struct hid_usage *usage, __s32 value)
|
||||
+{
|
||||
+ if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 && !usage->type) {
|
||||
+ hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
|
||||
+ usage->hid & HID_USAGE);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int asus_raw_event(struct hid_device *hdev,
|
||||
struct hid_report *report, u8 *data, int size)
|
||||
{
|
||||
@@ -832,6 +843,7 @@ static struct hid_driver asus_driver = {
|
||||
#ifdef CONFIG_PM
|
||||
.reset_resume = asus_reset_resume,
|
||||
#endif
|
||||
+ .event = asus_event,
|
||||
.raw_event = asus_raw_event
|
||||
};
|
||||
module_hid_driver(asus_driver);
|
||||
--
|
||||
2.19.1
|
||||
|
||||
From 71256aaf9979072c9bd99fb08db586731e3ccf55 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Fri, 23 Nov 2018 13:44:27 +0100
|
||||
Subject: [PATCH 2/2] HID: asus: Add USB-id for the ASUS FX503VD laptop
|
||||
|
||||
The ASUS FX503VD laptop uses an USB keyboard with several hotkeys
|
||||
which use the Asus Vendor specific UsagePage.
|
||||
|
||||
At the USB-id for this keyboard to the hid-asus driver so that these
|
||||
custom usages get properly mapped.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
drivers/hid/hid-asus.c | 2 ++
|
||||
drivers/hid/hid-ids.h | 1 +
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
|
||||
index 043120cc4b97..6e9470e00c69 100644
|
||||
--- a/drivers/hid/hid-asus.c
|
||||
+++ b/drivers/hid/hid-asus.c
|
||||
@@ -806,6 +806,8 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
}
|
||||
|
||||
static const struct hid_device_id asus_devices[] = {
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
|
||||
+ USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD) },
|
||||
{ HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
|
||||
USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD), I2C_KEYBOARD_QUIRKS},
|
||||
{ HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
|
||||
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
|
||||
index c0d668944dbe..5ae1db6fa5c8 100644
|
||||
--- a/drivers/hid/hid-ids.h
|
||||
+++ b/drivers/hid/hid-ids.h
|
||||
@@ -190,6 +190,7 @@
|
||||
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1 0x1854
|
||||
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2 0x1837
|
||||
#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822
|
||||
+#define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869
|
||||
|
||||
#define USB_VENDOR_ID_ATEN 0x0557
|
||||
#define USB_DEVICE_ID_ATEN_UC100KM 0x2004
|
||||
--
|
||||
2.19.1
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From 624e057827435de39274c34e20c2d937cb9d4ac3 Mon Sep 17 00:00:00 2001
|
||||
From fbdb31e061b67941342fc5afa714488f75174632 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Thu, 31 May 2018 19:08:12 +0100
|
||||
Subject: [PATCH] bcm2835: cpufreq: add CPU frequency control driver
|
||||
Subject: [PATCH 1/3] bcm2835: cpufreq: add CPU frequency control driver
|
||||
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
|
@ -14,11 +14,11 @@ Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
|||
create mode 100644 drivers/clk/bcm/clk-raspberrypi.c
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
|
||||
index 6c3cfaa77f3d..e6d1627ec421 100644
|
||||
index 29f970f864dc..6d0f43957af4 100644
|
||||
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
|
||||
@@ -35,6 +35,13 @@
|
||||
reg = <0x7e00b840 0xf>;
|
||||
reg = <0x7e00b840 0x3c>;
|
||||
interrupts = <0 2>;
|
||||
};
|
||||
+
|
||||
|
@ -32,10 +32,10 @@ index 6c3cfaa77f3d..e6d1627ec421 100644
|
|||
};
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
|
||||
index 7704bb029605..c24176282a1f 100644
|
||||
index beb6c502dadc..9cfc553a3633 100644
|
||||
--- a/arch/arm/boot/dts/bcm2837.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2837.dtsi
|
||||
@@ -38,6 +38,9 @@
|
||||
@@ -44,6 +44,9 @@
|
||||
reg = <0>;
|
||||
enable-method = "spin-table";
|
||||
cpu-release-addr = <0x0 0x000000d8>;
|
||||
|
@ -45,7 +45,7 @@ index 7704bb029605..c24176282a1f 100644
|
|||
};
|
||||
|
||||
cpu1: cpu@1 {
|
||||
@@ -46,6 +49,9 @@
|
||||
@@ -52,6 +55,9 @@
|
||||
reg = <1>;
|
||||
enable-method = "spin-table";
|
||||
cpu-release-addr = <0x0 0x000000e0>;
|
||||
|
@ -55,7 +55,7 @@ index 7704bb029605..c24176282a1f 100644
|
|||
};
|
||||
|
||||
cpu2: cpu@2 {
|
||||
@@ -54,6 +60,9 @@
|
||||
@@ -60,6 +66,9 @@
|
||||
reg = <2>;
|
||||
enable-method = "spin-table";
|
||||
cpu-release-addr = <0x0 0x000000e8>;
|
||||
|
@ -65,7 +65,7 @@ index 7704bb029605..c24176282a1f 100644
|
|||
};
|
||||
|
||||
cpu3: cpu@3 {
|
||||
@@ -62,6 +71,30 @@
|
||||
@@ -68,6 +77,30 @@
|
||||
reg = <3>;
|
||||
enable-method = "spin-table";
|
||||
cpu-release-addr = <0x0 0x000000f0>;
|
||||
|
@ -269,12 +269,13 @@ index 000000000000..046efc822a59
|
|||
+MODULE_DESCRIPTION("Raspberry Pi CPU clock driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.17.0
|
||||
2.20.1
|
||||
|
||||
From 40a82f71737891581dcbe45331d15a29dd3e7805 Mon Sep 17 00:00:00 2001
|
||||
|
||||
From 0681db63db37cf9015ef9b667c237c3974de04e6 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Mon, 4 Jun 2018 09:14:10 +0100
|
||||
Subject: [PATCH 7/7] add 1.4 ghz OPP for the 3B+
|
||||
Subject: [PATCH 2/3] add 1.4 ghz OPP for the 3B+
|
||||
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
|
@ -282,7 +283,7 @@ Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
|||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
|
||||
index 4adb85e66be3..aaefb078f391 100644
|
||||
index 42bb09044cc7..3333c080696c 100644
|
||||
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
|
||||
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
|
||||
@@ -106,3 +106,10 @@
|
||||
|
@ -297,12 +298,13 @@ index 4adb85e66be3..aaefb078f391 100644
|
|||
+ };
|
||||
+};
|
||||
--
|
||||
2.17.1
|
||||
2.20.1
|
||||
|
||||
From d00bd46b40001d3500b8a7207dcfe1d66600e47e Mon Sep 17 00:00:00 2001
|
||||
|
||||
From 65f821f03ac635f28c8c79c5e436b398194521f2 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Date: Wed, 26 Sep 2018 21:13:22 +0200
|
||||
Subject: [PATCH] ARM: bcm2837: Use CPU0 as cooling device
|
||||
Subject: [PATCH 3/3] ARM: bcm2837: Use CPU0 as cooling device
|
||||
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
---
|
||||
|
@ -311,7 +313,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
|||
2 files changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
|
||||
index 9cfc553..1590d94 100644
|
||||
index 9cfc553a3633..1590d94b618e 100644
|
||||
--- a/arch/arm/boot/dts/bcm2837.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm2837.dtsi
|
||||
@@ -1,4 +1,5 @@
|
||||
|
@ -380,7 +382,7 @@ index 9cfc553..1590d94 100644
|
|||
|
||||
/* enable thermal sensor with the correct compatible property set */
|
||||
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
|
||||
index 31b2964..2def068 100644
|
||||
index 31b29646b14c..2def0684d198 100644
|
||||
--- a/arch/arm/boot/dts/bcm283x.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm283x.dtsi
|
||||
@@ -38,7 +38,7 @@
|
||||
|
@ -393,4 +395,5 @@ index 31b2964..2def068 100644
|
|||
hysteresis = <0>;
|
||||
type = "critical";
|
||||
--
|
||||
2.7.4
|
||||
2.20.1
|
||||
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
From patchwork Sun Dec 23 20:59:17 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
X-Patchwork-Id: 10741809
|
||||
Return-Path:
|
||||
<linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E9B66C2
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 23 Dec 2018 21:00:35 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BF3B28783
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 23 Dec 2018 21:00:35 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 0FE412878E; Sun, 23 Dec 2018 21:00:35 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B7EB128783
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Sun, 23 Dec 2018 21:00:34 +0000 (UTC)
|
||||
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=0Cfst0aavwq2BzhOoJiKH5s4NpJ/Us+GjXPJ4zrLsg0=; b=ZZ4
|
||||
op3YV27iZX0UKzSqXuUq2LaE+MP3aEAQmT8Rdvb/NFFHbn+wqbOszDRj6XW3ajga4pCSwUf3L4gvo
|
||||
ZheL4Sb+6+oiR1HdK8EBuDjmzKY1qn/zgS8gwvVv6TSbD2Bz8Lw0hQ/tW2MwUuIDngXtzfUoFvHrp
|
||||
wADpWDQf/OcQj2dRuqMLquQTkjTnYDP94Ml87y52NZhbu9+9n3h0+0X7oerCqM/RLjCwl9atrORaV
|
||||
DAWfKL1pif2kz0UoT1x6vjaOmbSa3NqSXmUo+2dM64jUixp5JllINpIuIDUX2KNTo2pRF3og+BnsP
|
||||
8TFZ0aIA+N69i6dOIQTBKCcJIb86Jjw==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gbArL-0005Ta-RL; Sun, 23 Dec 2018 21:00:27 +0000
|
||||
Received: from mout.kundenserver.de ([212.227.126.131])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gbArH-0004QG-NL
|
||||
for linux-arm-kernel@lists.infradead.org; Sun, 23 Dec 2018 21:00:25 +0000
|
||||
Received: from localhost.localdomain ([37.4.249.153]) by
|
||||
mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis)
|
||||
id 1MSZDt-1gz0AW3YfB-00SsKG; Sun, 23 Dec 2018 21:59:57 +0100
|
||||
From: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
To: Al Cooper <alcooperx@gmail.com>, Adrian Hunter <adrian.hunter@intel.com>,
|
||||
Ulf Hansson <ulf.hansson@linaro.org>
|
||||
Subject: [PATCH 1/2] mmc: sdhci-iproc: handle mmc_of_parse() errors during
|
||||
probe
|
||||
Date: Sun, 23 Dec 2018 21:59:17 +0100
|
||||
Message-Id: <1545598758-4502-1-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Mailer: git-send-email 2.7.4
|
||||
X-Provags-ID: V03:K1:FsBhp74NqgbMckX6QGEkM7zbuM0fjnbtNqB9c5GjfSu+JG+zOVC
|
||||
nt6p6+TF28Gk+lb0VFAh2hNrWHdwlR1sqk5ygcbOiXLgQ93PecRf9Zl130rJ7qR4Km04fzv
|
||||
AR0JypQ0XgjJ+nia824FdeQ9oO4xRynoGH5q7Raco0HsIMewr0syOybYSJgsqI5UUptIo+5
|
||||
FhdCMrpIfxuFpRh23naog==
|
||||
X-UI-Out-Filterresults: notjunk:1;V03:K0:7uvqm/6Tn2w=:qedwftyLF+r+WaFGRyzPKR
|
||||
vItrffDfG7f534X5qt1icf/24c6TYj93h3+1AKvP593z2hpmJxIemKNrdRT7/zXPP+Ipke8UQ
|
||||
I08zvqpRa5wcGU3iO0jQaPt/WU58GkdmjkiuWzotVkbcj4+NuMi4iMPfiAMd1VdT5ouv2omWI
|
||||
/7S/9AqsTnPbNYo+5i1oNsSFDmrxWvlKZC9K+Ab8vTe8J9L+wUiRCWFHsOr0C9lC1J3MRHbgZ
|
||||
OPX3nnGBLnuKcWjrMJyIjqsNOJ2w89xWpOFvNfsPTrVhHX/xApgyQQcbDBXvwgMh709QJowTD
|
||||
88M4HvgmrK3Ah0BS164aJZtufA38R7Fpay/nQ6hojx7BKV6OM712L+vkkzNuK4MrfQKtQeiv5
|
||||
sf7mvN2YqPw13dJxC70+a8u2MvwhX7Udha2YtQJT7ZhcqlIYkVb4HoDJ565iYqAe/jp9npFjh
|
||||
3wPekqu1cY3V/0rhdWVETv/Atcchi598SE0RS4cL8/C7Z189r2wCrohPWDDedc8/AmF+J9y4N
|
||||
2lAHyAmq7u7IUBkxmYHzFu+KvE6jVNgVFm6mB21lO2gHqTIz6toyP36igFPxPp0FZrigwqCWb
|
||||
Ot1jt/Ep+g9ykC8xjM36X5RKjfDrAOpgwSb+FWRqaablXguW1xgCC2weNx8PjENo21hCxHNgG
|
||||
2jSstrMAZFww3b39FzyTblcT3LcsuU6JOjyIMPCApzh0y7wgI+VVT+y3jyezQpszpAxbbdYnS
|
||||
WH896vn09u7vjjjfG9zlqROWkG+q3ZLGfxrm4gRjo5HnJF78W1Fq11QIq0U=
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20181223_130024_058181_62761026
|
||||
X-CRM114-Status: GOOD ( 14.51 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
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: Stefan Wahren <stefan.wahren@i2se.com>,
|
||||
Florian Fainelli <f.fainelli@gmail.com>,
|
||||
Scott Branden <sbranden@broadcom.com>,
|
||||
Ray Jui <rjui@broadcom.com>, linux-mmc@vger.kernel.org,
|
||||
stable@vger.kernel.org,
|
||||
Eric Anholt <eric@anholt.net>, bcm-kernel-feedback-list@broadcom.com,
|
||||
Gregory Fong <gregory.0xf0@gmail.com>,
|
||||
Brian Norris <computersforpeace@gmail.com>,
|
||||
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
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
We need to handle mmc_of_parse() errors during probe.
|
||||
|
||||
This finally fixes the wifi regression on Raspberry Pi 3 series.
|
||||
In error case the wifi chip was permanently in reset because of
|
||||
the power sequence depending on the deferred probe of the GPIO expander.
|
||||
|
||||
Fixes: b580c52d58d9 ("mmc: sdhci-iproc: add IPROC SDHCI driver")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
---
|
||||
drivers/mmc/host/sdhci-iproc.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
|
||||
index 0db9905..9d12c06 100644
|
||||
--- a/drivers/mmc/host/sdhci-iproc.c
|
||||
+++ b/drivers/mmc/host/sdhci-iproc.c
|
||||
@@ -296,7 +296,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
|
||||
|
||||
iproc_host->data = iproc_data;
|
||||
|
||||
- mmc_of_parse(host->mmc);
|
||||
+ ret = mmc_of_parse(host->mmc);
|
||||
+ if (ret)
|
||||
+ goto err;
|
||||
+
|
||||
sdhci_get_property(pdev);
|
||||
|
||||
host->mmc->caps |= iproc_host->data->mmc_caps;
|
|
@ -0,0 +1,511 @@
|
|||
From patchwork Tue Dec 4 18:58:17 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
X-Patchwork-Id: 10712425
|
||||
Return-Path:
|
||||
<linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C411313BF
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:34 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B721A2BD01
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:34 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id AB2B72BD2D; Tue, 4 Dec 2018 18:59:34 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 606D42BD01
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:34 +0000 (UTC)
|
||||
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:References:
|
||||
In-Reply-To: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:List-Owner;
|
||||
bh=6UbJBC0963I46fYE5zRy11baMmDB1ESW2gFQ5gI2wwE=; b=CDOM7grk/CTzf0ntrBtWfB3O6y
|
||||
33/BKjt6ihWsFz/ta8zAMEiFFs9BmnVKDymMGblsIWTjWTb3WfPF5GwSBSCi/ii/uO8sUxys6FtBW
|
||||
f9zzCKZG3yfWmznLUUEThlA5REEOKuV1+/jdk4w0WiNfGNKMMnKROAkmrJEVke4Zhd+8OuKmVOjmv
|
||||
Yn9zREWqYpUJtSut4b9OExhtJWtFrvnoLaj5u84K/gpnp+dVcv7cL+cWOgmYqmImUOwQHnk9GQMKQ
|
||||
uHHaWTRK96TNqgtk1pgwLdy3JTMNNm4x/rQX8eFTsXiAw27c+bUOqBDCCZZRq8uSJfbovVgPN+xvp
|
||||
8s4Q2LjA==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gUFup-0007EB-Le; Tue, 04 Dec 2018 18:59:27 +0000
|
||||
Received: from mout.kundenserver.de ([212.227.126.187])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gUFuc-000738-NV; Tue, 04 Dec 2018 18:59:16 +0000
|
||||
Received: from localhost.localdomain ([37.4.249.153]) by
|
||||
mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis)
|
||||
id 1MsJXG-1hMU9U03Ja-00tiwe; Tue, 04 Dec 2018 19:58:54 +0100
|
||||
From: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
To: Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
|
||||
Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>,
|
||||
Scott Branden <sbranden@broadcom.com>, Eric Anholt <eric@anholt.net>,
|
||||
Arnd Bergmann <arnd@arndb.de>
|
||||
Subject: [PATCH V3 1/3] dt-bindings: bcm: Add Raspberry Pi 3 A+
|
||||
Date: Tue, 4 Dec 2018 19:58:17 +0100
|
||||
Message-Id: <1543949899-13380-2-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Mailer: git-send-email 2.7.4
|
||||
In-Reply-To: <1543949899-13380-1-git-send-email-stefan.wahren@i2se.com>
|
||||
References: <1543949899-13380-1-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Provags-ID: V03:K1:zWjXUKGvRea+gMs+XnPtEqUFEt6coBWKiACMzuwYlKcCFu4r+lA
|
||||
iGx8uqFwUZeMlCRPt/ppyLb1sQzbMcCRqQQR6UhJtkdMZQIQAFlshUesPMbcUk9m4B2o+hV
|
||||
5MKPHtv0JgCoRiG1RHH5O6WhMVUlI/r6QHru1GtJpJnirkWBUM6ybU5if6JNxdc6Q1K+k+j
|
||||
Ely8Z1ImjRPnmySejSWMw==
|
||||
X-UI-Out-Filterresults: notjunk:1;V03:K0:npbkbCpjqTA=:aJ8W+r4VeSzddafgbOrFVV
|
||||
nq1xnYu1eZIBQfLjIYRbrv1nth1fKohmS61nN/+Td+n/k4e3TRa9AMLnwYp0rzFwoilG/0fJD
|
||||
oTRRftY0BKKXSdeoahKljHbUtCjqt7aSxHPbRC66juNlKlbYP2X2e1SpPMu6/KBzwqhTKxY6x
|
||||
vn18J++hPOkeyN548oSNhQLFkiKcL2ZTruhlba0dPZdsTllcVtNOLXod4cSszY72zZAPxmMd1
|
||||
vTwMs6i4VpYzu9JpSNysbkfLLuTcAum5kspFgEP1B6GlS5REBPQDfGl7M7v9RZcqRTpUoNVp7
|
||||
HQKJU3cBmWUQ8aHADyi0lBlon4zvZ/mrvmjqRSmdj7cYl2dsP8Xjhe5JIVy2zaIxW6lQrD2J3
|
||||
yP7h9YRbnloK4MsJleaDAkziQunrTMEc/O1gz46DJ9hU5Id6SpH2au7iq4QfldG+ioPWhoESx
|
||||
sjQd7tnniz2Z5cMtgdHfXZz4xu9FROiPq0uij1NijVZZU2bXfaKLhYJtoeDOGMWtIMUT1CKyo
|
||||
Iut2P58bwL0cAIYKyaSF7ak4Vy/MX3fkVymockjeTXHr0ep0s90YqlYxk4CYvxeRt2aPm8qRo
|
||||
zbUkVxCooJAKjhOm6IA2jxyuSKb6i8EciUi0vv7/XmUpazJ5hMznDAeNXVJmEt9asUCitqNq5
|
||||
MglMo4dFq61jUNDbeqU/zN/nXYX8fGVIEDDpgETB0dbSqhG1mANxVPs6Zb0Sd8OMEOct0k0dy
|
||||
PKEvU6Ol/K0o1Ufh5Fp2zyiflab/1djdSoPvlBFOVEx2D4n3gV6zfv9sKlE=
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20181204_105915_063796_DFDC7865
|
||||
X-CRM114-Status: GOOD ( 12.62 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
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: Stefan Wahren <stefan.wahren@i2se.com>, devicetree@vger.kernel.org,
|
||||
bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.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
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
This adds the root properties for the Raspberry Pi 3 A+ .
|
||||
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||||
Reviewed-by: Rob Herring <robh@kernel.org>
|
||||
---
|
||||
Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
|
||||
index 0dcc3ea..245328f 100644
|
||||
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
|
||||
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
|
||||
@@ -30,6 +30,10 @@ Raspberry Pi 2 Model B
|
||||
Required root node properties:
|
||||
compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
|
||||
|
||||
+Raspberry Pi 3 Model A+
|
||||
+Required root node properties:
|
||||
+compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837";
|
||||
+
|
||||
Raspberry Pi 3 Model B
|
||||
Required root node properties:
|
||||
compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
|
||||
|
||||
From patchwork Tue Dec 4 18:58:18 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
X-Patchwork-Id: 10712423
|
||||
Return-Path:
|
||||
<linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A15061731
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:21 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 924D82BD01
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:21 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 83F5B2BD2D; Tue, 4 Dec 2018 18:59:21 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A1EB2BD01
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:21 +0000 (UTC)
|
||||
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:References:
|
||||
In-Reply-To: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:List-Owner;
|
||||
bh=USNsthoN3FFEFx7U+2NkiWI+CturV+888pKSb0RNCqA=; b=JYnUBDrCnTGKB2TAy2JjiZd2Ra
|
||||
7AIas3zU/1y8q3AUyA90EFhuWPBAgj9XUbNlVZT/pYLLuI9jMywztAmG5bhh4aERhKkZXtVrijKX/
|
||||
ZnnEUmTQ9oGvuhDAxtjOS1TzHp5EI2iy/R9iLdiUYXCEOdlkcYdPIO3+PTb6AlQhWo42QCKG0xWcl
|
||||
pATIUVoDrXEf0jXEYsAiwd/wG3ukFNJ3lfvIfgNA+JPs3Ngu7quNxiYXJ2D1JvR8XkmfwRG1K0hZh
|
||||
7DT1bNn/DjqE6gArdDbTN7Zsg/0hZ/vtFrtguHfISa/W9rfkCCC5p6dzWGnOiTbHJhXWSEwrBTKkx
|
||||
Ts1HiMfQ==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gUFuf-00074u-E0; Tue, 04 Dec 2018 18:59:17 +0000
|
||||
Received: from mout.kundenserver.de ([212.227.126.135])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gUFuc-000737-AF; Tue, 04 Dec 2018 18:59:16 +0000
|
||||
Received: from localhost.localdomain ([37.4.249.153]) by
|
||||
mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis)
|
||||
id 1MTfgb-1gvyxH1xQz-00TyQt; Tue, 04 Dec 2018 19:58:54 +0100
|
||||
From: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
To: Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
|
||||
Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>,
|
||||
Scott Branden <sbranden@broadcom.com>, Eric Anholt <eric@anholt.net>,
|
||||
Arnd Bergmann <arnd@arndb.de>
|
||||
Subject: [PATCH V3 2/3] ARM: dts: add Raspberry Pi 3 A+
|
||||
Date: Tue, 4 Dec 2018 19:58:18 +0100
|
||||
Message-Id: <1543949899-13380-3-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Mailer: git-send-email 2.7.4
|
||||
In-Reply-To: <1543949899-13380-1-git-send-email-stefan.wahren@i2se.com>
|
||||
References: <1543949899-13380-1-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Provags-ID: V03:K1:3DMMDYjsCTx6IxBf2WC2ooKMnJiVzq9RVmh0csGsajg6lyIrJhZ
|
||||
1Bxu2ZSF3G0pHYpWlUkunk+gbYzjwXHLe7l8Qt331s0uI7iQlNoKYnDPTnSttqFWy6REewG
|
||||
TGQ/wBenT40TkCKYB4Jzxzm/sBnOCRuCRNOESZRNHpPgNmq54dplz7pgEsWcSC+rJNqDZ57
|
||||
hZVdKs0sW1HDASHCi5bwQ==
|
||||
X-UI-Out-Filterresults: notjunk:1;V03:K0:xL1UKc14icc=:ywcRqmyL4hAvJKGdv9SW2+
|
||||
nB4fjCvnj/X2wxnBW6IGj37m5w0vogpA8hZ8T6OzOMSxYREPfeTGl0fgSVwKdAAfQTilDe5XN
|
||||
wVJ+fvkM/SVIA7FUaeR+eechsklUZrJKVpjZMrIYH7GLwVl6OVF7VFhlvxC3o1DUlYE3m4GKL
|
||||
DrhSdB9wcKUO+KrQc67I4PhdhKePc2EaA1/fDGNkQFkCVlXsw1vdrfla5T/tetBlHQq+qCPcl
|
||||
vuLv5NeXx2KtC0zqEdEKZn7KqcA//KMtDQCWmXnc9jvjqx17DF5Iji1xQe4vXA196P9ZcF1U0
|
||||
vpv6mSI3SPtCJEn48zHMTIt6tVRJ6Ao0HmZEkFDyRW3c8sgK4OFLnLUjSx4YoSHB9RKnC+Psz
|
||||
5QZLWBT81RHxqPiLa49EXhaHkyDXtiinriofvqJqogtl+X0J9Rmn7wczjqYRaQzp1iBTrpXNT
|
||||
sC/ZLyTJ25ZAAMrotIK1UgL9S4CFgdwDk0AKcVUycNoVsWeIrCC743fQazerXkOFNeuBW9t55
|
||||
G5gQD5pmEvQkOjb+cExnODkM9L7eOIrrJzsap98bS0Bsu7inAsXOIObRVJWtKpEwXQ5PUo3gt
|
||||
Ku6C8Xgr5A2ydsc9LegxF5JXOM9UPx9+eN3hHsH3aW5+eW80KDN6INGwBoJnvwPHDdlK2PRH/
|
||||
nEOKWJBTLqRcf39DMKyzTJirlz/jNbWra0qisP3AYgQv2lF0jM5hs64oQ2nDzHbFAKljBdf+0
|
||||
wMfkYx1QgW1uF+G+3OEXmrPRKSqUFihd4VBKZ0WYsMkKX+VEO9T1n75KUNU=
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20181204_105914_660350_5C19EA39
|
||||
X-CRM114-Status: GOOD ( 18.48 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
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: Stefan Wahren <stefan.wahren@i2se.com>, devicetree@vger.kernel.org,
|
||||
bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.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
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
The Raspberry Pi 3 A+ is similar to the Pi 3 B+ but has only 512 MB RAM,
|
||||
1 USB 2.0 port and no Ethernet.
|
||||
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
arch/arm/boot/dts/Makefile | 1 +
|
||||
arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts | 107 +++++++++++++++++++++++++++++
|
||||
2 files changed, 108 insertions(+)
|
||||
create mode 100644 arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
|
||||
|
||||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
|
||||
index b0e966d..15bbd0d 100644
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -79,6 +79,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
|
||||
bcm2835-rpi-a-plus.dtb \
|
||||
bcm2835-rpi-cm1-io1.dtb \
|
||||
bcm2836-rpi-2-b.dtb \
|
||||
+ bcm2837-rpi-3-a-plus.dtb \
|
||||
bcm2837-rpi-3-b.dtb \
|
||||
bcm2837-rpi-3-b-plus.dtb \
|
||||
bcm2837-rpi-cm3-io3.dtb \
|
||||
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts b/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
|
||||
new file mode 100644
|
||||
index 0000000..b2df7cf
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
|
||||
@@ -0,0 +1,107 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/dts-v1/;
|
||||
+#include "bcm2837.dtsi"
|
||||
+#include "bcm2836-rpi.dtsi"
|
||||
+#include "bcm283x-rpi-usb-host.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837";
|
||||
+ model = "Raspberry Pi 3 Model A+";
|
||||
+
|
||||
+ chosen {
|
||||
+ /* 8250 auxiliary UART instead of pl011 */
|
||||
+ stdout-path = "serial1:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ memory {
|
||||
+ reg = <0 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ act {
|
||||
+ gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ pwr {
|
||||
+ label = "PWR";
|
||||
+ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ wifi_pwrseq: wifi-pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&firmware {
|
||||
+ expgpio: gpio {
|
||||
+ compatible = "raspberrypi,firmware-gpio";
|
||||
+ gpio-controller;
|
||||
+ #gpio-cells = <2>;
|
||||
+ gpio-line-names = "BT_ON",
|
||||
+ "WL_ON",
|
||||
+ "STATUS_LED",
|
||||
+ "",
|
||||
+ "",
|
||||
+ "CAM_GPIO0",
|
||||
+ "CAM_GPIO1",
|
||||
+ "";
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ hpd-gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
|
||||
+};
|
||||
+
|
||||
+&pwm {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+/* SDHCI is used to control the SDIO for wireless */
|
||||
+&sdhci {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emmc_gpio34>;
|
||||
+ status = "okay";
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+
|
||||
+ brcmf: wifi@1 {
|
||||
+ reg = <1>;
|
||||
+ compatible = "brcm,bcm4329-fmac";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+/* SDHOST is used to drive the SD card */
|
||||
+&sdhost {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&sdhost_gpio48>;
|
||||
+ status = "okay";
|
||||
+ bus-width = <4>;
|
||||
+};
|
||||
+
|
||||
+/* uart0 communicates with the BT module */
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ bluetooth {
|
||||
+ compatible = "brcm,bcm43438-bt";
|
||||
+ max-speed = <2000000>;
|
||||
+ shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+/* uart1 is mapped to the pin header */
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_gpio14>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
|
||||
From patchwork Tue Dec 4 18:58:19 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
X-Patchwork-Id: 10712427
|
||||
Return-Path:
|
||||
<linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAB7E13BF
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:55 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A9D42BD01
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:55 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 8D6682BD2D; Tue, 4 Dec 2018 18:59:55 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D36E2BD01
|
||||
for <patchwork-linux-arm@patchwork.kernel.org>;
|
||||
Tue, 4 Dec 2018 18:59:55 +0000 (UTC)
|
||||
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:References:
|
||||
In-Reply-To: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:List-Owner;
|
||||
bh=d6AyqRs+tRK/fschmfAdF+Ujjrm/vJZBIeGWaRWEq4w=; b=Y7xekwSen1413+ksdWargCdgIt
|
||||
9btgKKpQU7qjXIbtt/Y7DcOeRQJHpM3nx63Ft8BbjQMcMV/97DgweLj7gbaoi51D0OIxZ9sd431pP
|
||||
fFjpfTK9cN0Q85qtcssVISpnt7a6Fm+ixe+/Xt3IRSzchcPxqfipK6qDmUSpZGKrU101cJYG08VkV
|
||||
vY6Oa7w/hyeU0b8rULaIj5c069BzO/vGkkULiXCteGEn6y4juTjmXa/Nsoj2RKYUjdhOMXWxEwU6C
|
||||
MM7JTAxqPtcIX1ale070qdvGn5XJOuN+DYx03At0mj8aaCBr11NKTtB7PyutmcIPnRwGQwz1gW7go
|
||||
daDlwlnA==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gUFvA-0007cK-M8; Tue, 04 Dec 2018 18:59:48 +0000
|
||||
Received: from mout.kundenserver.de ([212.227.126.130])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1gUFud-00073L-OI; Tue, 04 Dec 2018 18:59:17 +0000
|
||||
Received: from localhost.localdomain ([37.4.249.153]) by
|
||||
mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis)
|
||||
id 1MFJfN-1gjyQ33mR7-00FlVP; Tue, 04 Dec 2018 19:58:55 +0100
|
||||
From: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
To: Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
|
||||
Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>,
|
||||
Scott Branden <sbranden@broadcom.com>, Eric Anholt <eric@anholt.net>,
|
||||
Arnd Bergmann <arnd@arndb.de>
|
||||
Subject: [PATCH V3 3/3] arm64: dts: broadcom: Add reference to RPi 3 A+
|
||||
Date: Tue, 4 Dec 2018 19:58:19 +0100
|
||||
Message-Id: <1543949899-13380-4-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Mailer: git-send-email 2.7.4
|
||||
In-Reply-To: <1543949899-13380-1-git-send-email-stefan.wahren@i2se.com>
|
||||
References: <1543949899-13380-1-git-send-email-stefan.wahren@i2se.com>
|
||||
X-Provags-ID: V03:K1:FFp5Wh7ZWhwN+0GnOIK4svX/EnE/lyWXYX5Q6pGbgpyE8/BWhkC
|
||||
HIozYn/aF1wiPHTyJBUFfAX8Bprfc2VwnJzzw9ujHYvH3l0PaQMDjk5EKXbX3EWjmbQumbE
|
||||
uyxkSsnoyLyfEVpoKKGGBgHPfzsATZGmLQj7UEyc5JvQ63IO0mdwywnOuI6LouMSJgs26MV
|
||||
+JgfGn5pKNrVStX597aIg==
|
||||
X-UI-Out-Filterresults: notjunk:1;V03:K0:arW5q/kpEak=:fNkvQgi7CQng+s4ZxkqrAl
|
||||
Shfn4kUf6kIfer4UddefIfpoKpAvezKz/iNNcd8IyBLFrA++7Igw03sj4to2x9/kBAlIbVINV
|
||||
JnAhVKciAu2qdP8xqMbmGrnJGAbkK10jhSsT6ufbHWHJmtxpizWgzDEtqJqbr2nzW0q8WL2dA
|
||||
YT1kdC3TCVS9IEJKxyAi26mf/pxvvoheQAygv0WBdtTAsdN6h2JMB7v6CPtGjL8CNOc/OemQK
|
||||
3fY/E6rQzoT5vc6F4NGVDje+vTBtMcFX/UhkKkKOnxuzyVpUdWITkeFaumc6q3miLeqpaKzm0
|
||||
gnnb7Tg9xKNdmPM/Ng049Qgy9bVJ3dVXaWyq2QleJAAUrhwVvN6zE8ogokYxzYR2pdrHs19gJ
|
||||
AhPNAX/QaP1VreCRGzo8D6ZEUJEkyK7mLOOyikqWFCT3kUtsKlmPaUGscn6rckZVU2OlfjijC
|
||||
GeEfaGcIEPyc3THhrPF5vbLos5lydlZkvNYUygQ5aTJXELDvt//cC9k+Kad/kOP8I7qa1TCcS
|
||||
M5brT1MnDj9qCja12qrxpkjF6Sih/5y2SfQFHLt7YFTX/YkvceXtUq4c9W6rLxHEnZKXm4ryY
|
||||
3cuJDYE3oOS4y/WMEhgazm795HJ8heBOv6T1tQPYlQkkKYNH8HKfeVgXBLbgHJLdc9r5AnjyH
|
||||
fOMjzqx2WqGT7S9I/oYGpTw7NQjHx45WexYKfhHfsjwSN3P4KgwtpAnl2vE++IIWQGiv+JR5L
|
||||
xIzts9r8uBaSUO1QR5qJG0cWqG+/FFdstWp3TsP2SeC0YMgeXSz1im5Ho/4=
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20181204_105916_085499_9EF7BF58
|
||||
X-CRM114-Status: GOOD ( 16.18 )
|
||||
X-BeenThere: linux-arm-kernel@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
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: Stefan Wahren <stefan.wahren@i2se.com>, devicetree@vger.kernel.org,
|
||||
bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.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
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
This adds a reference to the dts of the Raspberry Pi 3 A+,
|
||||
so we don't need to maintain the content in arm64.
|
||||
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
arch/arm64/boot/dts/broadcom/Makefile | 3 ++-
|
||||
arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts | 2 ++
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
create mode 100644 arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile
|
||||
index 667ca98..d1d31cc 100644
|
||||
--- a/arch/arm64/boot/dts/broadcom/Makefile
|
||||
+++ b/arch/arm64/boot/dts/broadcom/Makefile
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
-dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb \
|
||||
+dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-a-plus.dtb \
|
||||
+ bcm2837-rpi-3-b.dtb \
|
||||
bcm2837-rpi-3-b-plus.dtb \
|
||||
bcm2837-rpi-cm3-io3.dtb
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts
|
||||
new file mode 100644
|
||||
index 0000000..f0ec56a
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts
|
||||
@@ -0,0 +1,2 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+#include "arm/bcm2837-rpi-3-a-plus.dts"
|
|
@ -1,40 +0,0 @@
|
|||
From patchwork Tue Oct 9 13:24:46 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: drm/vc4: Set ->is_yuv to false when num_planes == 1
|
||||
From: Boris Brezillon <boris.brezillon@bootlin.com>
|
||||
X-Patchwork-Id: 255528
|
||||
Message-Id: <20181009132446.21960-1-boris.brezillon@bootlin.com>
|
||||
To: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
|
||||
dri-devel@lists.freedesktop.org, Eric Anholt <eric@anholt.net>
|
||||
Cc: Boris Brezillon <boris.brezillon@bootlin.com>, stable@vger.kernel.org
|
||||
Date: Tue, 9 Oct 2018 15:24:46 +0200
|
||||
|
||||
When vc4_plane_state is duplicated ->is_yuv is left assigned to its
|
||||
previous value, and we never set it back to false when switching to
|
||||
a non-YUV format.
|
||||
|
||||
Fix that by setting ->is_yuv to false in the 'num_planes == 1' branch
|
||||
of the vc4_plane_setup_clipping_and_scaling() function.
|
||||
|
||||
Fixes: fc04023fafecf ("drm/vc4: Add support for YUV planes.")
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
|
||||
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index d04b3c3246ba..60d5ad19cedd 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -321,6 +321,7 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
|
||||
if (vc4_state->is_unity)
|
||||
vc4_state->x_scaling[0] = VC4_SCALING_PPF;
|
||||
} else {
|
||||
+ vc4_state->is_yuv = false;
|
||||
vc4_state->x_scaling[1] = VC4_SCALING_NONE;
|
||||
vc4_state->y_scaling[1] = VC4_SCALING_NONE;
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
From ffe81d45322cc3cb140f0db080a4727ea284661e Mon Sep 17 00:00:00 2001
|
||||
From: Jens Axboe <axboe@kernel.dk>
|
||||
Date: Tue, 4 Dec 2018 20:06:48 -0700
|
||||
Subject: [PATCH] blk-mq: fix corruption with direct issue
|
||||
|
||||
If we attempt a direct issue to a SCSI device, and it returns BUSY, then
|
||||
we queue the request up normally. However, the SCSI layer may have
|
||||
already setup SG tables etc for this particular command. If we later
|
||||
merge with this request, then the old tables are no longer valid. Once
|
||||
we issue the IO, we only read/write the original part of the request,
|
||||
not the new state of it.
|
||||
|
||||
This causes data corruption, and is most often noticed with the file
|
||||
system complaining about the just read data being invalid:
|
||||
|
||||
[ 235.934465] EXT4-fs error (device sda1): ext4_iget:4831: inode #7142: comm dpkg-query: bad extra_isize 24937 (inode size 256)
|
||||
|
||||
because most of it is garbage...
|
||||
|
||||
This doesn't happen from the normal issue path, as we will simply defer
|
||||
the request to the hardware queue dispatch list if we fail. Once it's on
|
||||
the dispatch list, we never merge with it.
|
||||
|
||||
Fix this from the direct issue path by flagging the request as
|
||||
REQ_NOMERGE so we don't change the size of it before issue.
|
||||
|
||||
See also:
|
||||
https://bugzilla.kernel.org/show_bug.cgi?id=201685
|
||||
|
||||
Tested-by: Guenter Roeck <linux@roeck-us.net>
|
||||
Fixes: 6ce3dd6eec1 ("blk-mq: issue directly if hw queue isn't busy in case of 'none'")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
Signed-off-by: Jeremy Cline <jcline@redhat.com>
|
||||
---
|
||||
block/blk-mq.c | 26 +++++++++++++++++++++++++-
|
||||
1 file changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/block/blk-mq.c b/block/blk-mq.c
|
||||
index 3f91c6e5b17a..3262d83b9e07 100644
|
||||
--- a/block/blk-mq.c
|
||||
+++ b/block/blk-mq.c
|
||||
@@ -1715,6 +1715,15 @@ static blk_status_t __blk_mq_issue_directly(struct blk_mq_hw_ctx *hctx,
|
||||
break;
|
||||
case BLK_STS_RESOURCE:
|
||||
case BLK_STS_DEV_RESOURCE:
|
||||
+ /*
|
||||
+ * If direct dispatch fails, we cannot allow any merging on
|
||||
+ * this IO. Drivers (like SCSI) may have set up permanent state
|
||||
+ * for this request, like SG tables and mappings, and if we
|
||||
+ * merge to it later on then we'll still only do IO to the
|
||||
+ * original part.
|
||||
+ */
|
||||
+ rq->cmd_flags |= REQ_NOMERGE;
|
||||
+
|
||||
blk_mq_update_dispatch_busy(hctx, true);
|
||||
__blk_mq_requeue_request(rq);
|
||||
break;
|
||||
@@ -1727,6 +1736,18 @@ static blk_status_t __blk_mq_issue_directly(struct blk_mq_hw_ctx *hctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Don't allow direct dispatch of anything but regular reads/writes,
|
||||
+ * as some of the other commands can potentially share request space
|
||||
+ * with data we need for the IO scheduler. If we attempt a direct dispatch
|
||||
+ * on those and fail, we can't safely add it to the scheduler afterwards
|
||||
+ * without potentially overwriting data that the driver has already written.
|
||||
+ */
|
||||
+static bool blk_rq_can_direct_dispatch(struct request *rq)
|
||||
+{
|
||||
+ return req_op(rq) == REQ_OP_READ || req_op(rq) == REQ_OP_WRITE;
|
||||
+}
|
||||
+
|
||||
static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
|
||||
struct request *rq,
|
||||
blk_qc_t *cookie,
|
||||
@@ -1748,7 +1769,7 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
|
||||
goto insert;
|
||||
}
|
||||
|
||||
- if (q->elevator && !bypass_insert)
|
||||
+ if (!blk_rq_can_direct_dispatch(rq) || (q->elevator && !bypass_insert))
|
||||
goto insert;
|
||||
|
||||
if (!blk_mq_get_dispatch_budget(hctx))
|
||||
@@ -1810,6 +1831,9 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
|
||||
struct request *rq = list_first_entry(list, struct request,
|
||||
queuelist);
|
||||
|
||||
+ if (!blk_rq_can_direct_dispatch(rq))
|
||||
+ break;
|
||||
+
|
||||
list_del_init(&rq->queuelist);
|
||||
ret = blk_mq_request_issue_directly(rq);
|
||||
if (ret != BLK_STS_OK) {
|
||||
--
|
||||
2.19.2
|
||||
|
|
@ -1,615 +0,0 @@
|
|||
From 76202e874f06ab641fbe1caaddd4cfcf7158f174 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 10 Oct 2018 13:00:58 +0200
|
||||
Subject: [PATCH 1/5] brcmfmac: Remove firmware-loading code duplication
|
||||
|
||||
brcmf_fw_request_next_item and brcmf_fw_request_done both have identical
|
||||
code to complete the fw-request depending on the item-type.
|
||||
|
||||
This commit adds a new brcmf_fw_complete_request helper removing this code
|
||||
duplication.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/firmware.c | 62 +++++++++----------
|
||||
1 file changed, 31 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
index 9095b830ae4d..784c84f0e9e7 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -504,6 +504,34 @@ static int brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
+static int brcmf_fw_complete_request(const struct firmware *fw,
|
||||
+ struct brcmf_fw *fwctx)
|
||||
+{
|
||||
+ struct brcmf_fw_item *cur = &fwctx->req->items[fwctx->curpos];
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ brcmf_dbg(TRACE, "firmware %s %sfound\n", cur->path, fw ? "" : "not ");
|
||||
+
|
||||
+ switch (cur->type) {
|
||||
+ case BRCMF_FW_TYPE_NVRAM:
|
||||
+ ret = brcmf_fw_request_nvram_done(fw, fwctx);
|
||||
+ break;
|
||||
+ case BRCMF_FW_TYPE_BINARY:
|
||||
+ if (fw)
|
||||
+ cur->binary = fw;
|
||||
+ else
|
||||
+ ret = -ENOENT;
|
||||
+ break;
|
||||
+ default:
|
||||
+ /* something fishy here so bail out early */
|
||||
+ brcmf_err("unknown fw type: %d\n", cur->type);
|
||||
+ release_firmware(fw);
|
||||
+ ret = -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret;
|
||||
+}
|
||||
+
|
||||
static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
|
||||
{
|
||||
struct brcmf_fw_item *cur;
|
||||
@@ -525,15 +553,7 @@ static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
|
||||
if (ret < 0) {
|
||||
brcmf_fw_request_done(NULL, fwctx);
|
||||
} else if (!async && fw) {
|
||||
- brcmf_dbg(TRACE, "firmware %s %sfound\n", cur->path,
|
||||
- fw ? "" : "not ");
|
||||
- if (cur->type == BRCMF_FW_TYPE_BINARY)
|
||||
- cur->binary = fw;
|
||||
- else if (cur->type == BRCMF_FW_TYPE_NVRAM)
|
||||
- brcmf_fw_request_nvram_done(fw, fwctx);
|
||||
- else
|
||||
- release_firmware(fw);
|
||||
-
|
||||
+ brcmf_fw_complete_request(fw, fwctx);
|
||||
return -EAGAIN;
|
||||
}
|
||||
return 0;
|
||||
@@ -547,28 +567,8 @@ static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||
|
||||
cur = &fwctx->req->items[fwctx->curpos];
|
||||
|
||||
- brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
|
||||
- fw ? "" : "not ");
|
||||
-
|
||||
- if (!fw)
|
||||
- ret = -ENOENT;
|
||||
-
|
||||
- switch (cur->type) {
|
||||
- case BRCMF_FW_TYPE_NVRAM:
|
||||
- ret = brcmf_fw_request_nvram_done(fw, fwctx);
|
||||
- break;
|
||||
- case BRCMF_FW_TYPE_BINARY:
|
||||
- cur->binary = fw;
|
||||
- break;
|
||||
- default:
|
||||
- /* something fishy here so bail out early */
|
||||
- brcmf_err("unknown fw type: %d\n", cur->type);
|
||||
- release_firmware(fw);
|
||||
- ret = -EINVAL;
|
||||
- goto fail;
|
||||
- }
|
||||
-
|
||||
- if (ret < 0 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
|
||||
+ ret = brcmf_fw_complete_request(fw, fwctx);
|
||||
+ if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
do {
|
||||
--
|
||||
2.19.1
|
||||
|
||||
From a3c4b522bff976360fb21c9205fcb37a121d4074 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 10 Oct 2018 13:00:59 +0200
|
||||
Subject: [PATCH 2/5] brcmfmac: Remove recursion from firmware load error
|
||||
handling
|
||||
|
||||
Before this commit brcmf_fw_request_done would call
|
||||
brcmf_fw_request_next_item to load the next item, which on an error would
|
||||
call brcmf_fw_request_done, which if the error is recoverable (*) will
|
||||
then continue calling brcmf_fw_request_next_item for the next item again
|
||||
which on an error will call brcmf_fw_request_done again...
|
||||
|
||||
This does not blow up because we only have a limited number of items so
|
||||
we never recurse too deep. But the recursion is still quite ugly and
|
||||
frankly is giving me a headache, so lets fix this.
|
||||
|
||||
This commit fixes this by removing brcmf_fw_request_next_item and by
|
||||
making brcmf_fw_get_firmwares and brcmf_fw_request_done directly call
|
||||
firmware_request_nowait resp. firmware_request themselves.
|
||||
|
||||
*) brcmf_fw_request_nvram_done fallback path succeeds or
|
||||
BRCMF_FW_REQF_OPTIONAL is set
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/firmware.c | 65 ++++++-------------
|
||||
1 file changed, 19 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
index 784c84f0e9e7..08aaf99fee34 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -532,33 +532,6 @@ static int brcmf_fw_complete_request(const struct firmware *fw,
|
||||
return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret;
|
||||
}
|
||||
|
||||
-static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
|
||||
-{
|
||||
- struct brcmf_fw_item *cur;
|
||||
- const struct firmware *fw = NULL;
|
||||
- int ret;
|
||||
-
|
||||
- cur = &fwctx->req->items[fwctx->curpos];
|
||||
-
|
||||
- brcmf_dbg(TRACE, "%srequest for %s\n", async ? "async " : "",
|
||||
- cur->path);
|
||||
-
|
||||
- if (async)
|
||||
- ret = request_firmware_nowait(THIS_MODULE, true, cur->path,
|
||||
- fwctx->dev, GFP_KERNEL, fwctx,
|
||||
- brcmf_fw_request_done);
|
||||
- else
|
||||
- ret = request_firmware(&fw, cur->path, fwctx->dev);
|
||||
-
|
||||
- if (ret < 0) {
|
||||
- brcmf_fw_request_done(NULL, fwctx);
|
||||
- } else if (!async && fw) {
|
||||
- brcmf_fw_complete_request(fw, fwctx);
|
||||
- return -EAGAIN;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||
{
|
||||
struct brcmf_fw *fwctx = ctx;
|
||||
@@ -568,26 +541,19 @@ static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||
cur = &fwctx->req->items[fwctx->curpos];
|
||||
|
||||
ret = brcmf_fw_complete_request(fw, fwctx);
|
||||
- if (ret < 0)
|
||||
- goto fail;
|
||||
-
|
||||
- do {
|
||||
- if (++fwctx->curpos == fwctx->req->n_items) {
|
||||
- ret = 0;
|
||||
- goto done;
|
||||
- }
|
||||
|
||||
- ret = brcmf_fw_request_next_item(fwctx, false);
|
||||
- } while (ret == -EAGAIN);
|
||||
-
|
||||
- return;
|
||||
+ while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) {
|
||||
+ cur = &fwctx->req->items[fwctx->curpos];
|
||||
+ request_firmware(&fw, cur->path, fwctx->dev);
|
||||
+ ret = brcmf_fw_complete_request(fw, ctx);
|
||||
+ }
|
||||
|
||||
-fail:
|
||||
- brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret,
|
||||
- dev_name(fwctx->dev), cur->path);
|
||||
- brcmf_fw_free_request(fwctx->req);
|
||||
- fwctx->req = NULL;
|
||||
-done:
|
||||
+ if (ret) {
|
||||
+ brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret,
|
||||
+ dev_name(fwctx->dev), cur->path);
|
||||
+ brcmf_fw_free_request(fwctx->req);
|
||||
+ fwctx->req = NULL;
|
||||
+ }
|
||||
fwctx->done(fwctx->dev, ret, fwctx->req);
|
||||
kfree(fwctx);
|
||||
}
|
||||
@@ -611,7 +577,9 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
|
||||
void (*fw_cb)(struct device *dev, int err,
|
||||
struct brcmf_fw_request *req))
|
||||
{
|
||||
+ struct brcmf_fw_item *first = &req->items[0];
|
||||
struct brcmf_fw *fwctx;
|
||||
+ int ret;
|
||||
|
||||
brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
|
||||
if (!fw_cb)
|
||||
@@ -628,7 +596,12 @@ int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
|
||||
fwctx->req = req;
|
||||
fwctx->done = fw_cb;
|
||||
|
||||
- brcmf_fw_request_next_item(fwctx, true);
|
||||
+ ret = request_firmware_nowait(THIS_MODULE, true, first->path,
|
||||
+ fwctx->dev, GFP_KERNEL, fwctx,
|
||||
+ brcmf_fw_request_done);
|
||||
+ if (ret < 0)
|
||||
+ brcmf_fw_request_done(NULL, fwctx);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
From c2c41d3f837ed492369607940af950ef554b8685 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 10 Oct 2018 13:01:00 +0200
|
||||
Subject: [PATCH 3/5] brcmfmac: Add support for first trying to get a board
|
||||
specific nvram file
|
||||
|
||||
The nvram files which some brcmfmac chips need are board-specific. To be
|
||||
able to distribute these as part of linux-firmware, so that devices with
|
||||
such a wifi chip will work OOTB, multiple (one per board) versions must
|
||||
co-exist under /lib/firmware.
|
||||
|
||||
This commit adds support for callers of the brcmfmac/firmware.c code to
|
||||
pass in a board_type parameter through the request structure.
|
||||
|
||||
If that parameter is set then the code will first try to load
|
||||
chipmodel.board_type.txt before falling back to the old chipmodel.txt name.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/firmware.c | 27 ++++++++++++++++++-
|
||||
.../broadcom/brcm80211/brcmfmac/firmware.h | 1 +
|
||||
2 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
index 08aaf99fee34..6755b2388fbc 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -532,6 +532,31 @@ static int brcmf_fw_complete_request(const struct firmware *fw,
|
||||
return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret;
|
||||
}
|
||||
|
||||
+static int brcmf_fw_request_firmware(const struct firmware **fw,
|
||||
+ struct brcmf_fw *fwctx)
|
||||
+{
|
||||
+ struct brcmf_fw_item *cur = &fwctx->req->items[fwctx->curpos];
|
||||
+ int ret;
|
||||
+
|
||||
+ /* nvram files are board-specific, first try a board-specific path */
|
||||
+ if (cur->type == BRCMF_FW_TYPE_NVRAM && fwctx->req->board_type) {
|
||||
+ char alt_path[BRCMF_FW_NAME_LEN];
|
||||
+
|
||||
+ strlcpy(alt_path, cur->path, BRCMF_FW_NAME_LEN);
|
||||
+ /* strip .txt at the end */
|
||||
+ alt_path[strlen(alt_path) - 4] = 0;
|
||||
+ strlcat(alt_path, ".", BRCMF_FW_NAME_LEN);
|
||||
+ strlcat(alt_path, fwctx->req->board_type, BRCMF_FW_NAME_LEN);
|
||||
+ strlcat(alt_path, ".txt", BRCMF_FW_NAME_LEN);
|
||||
+
|
||||
+ ret = request_firmware(fw, alt_path, fwctx->dev);
|
||||
+ if (ret == 0)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return request_firmware(fw, cur->path, fwctx->dev);
|
||||
+}
|
||||
+
|
||||
static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||
{
|
||||
struct brcmf_fw *fwctx = ctx;
|
||||
@@ -544,7 +569,7 @@ static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||
|
||||
while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) {
|
||||
cur = &fwctx->req->items[fwctx->curpos];
|
||||
- request_firmware(&fw, cur->path, fwctx->dev);
|
||||
+ brcmf_fw_request_firmware(&fw, fwctx);
|
||||
ret = brcmf_fw_complete_request(fw, ctx);
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
|
||||
index 2893e56910f0..a0834be8864e 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
|
||||
@@ -70,6 +70,7 @@ struct brcmf_fw_request {
|
||||
u16 domain_nr;
|
||||
u16 bus_nr;
|
||||
u32 n_items;
|
||||
+ const char *board_type;
|
||||
struct brcmf_fw_item items[0];
|
||||
};
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
From 282477a8e4034ee2ea906d2eb234ce9c86f5685f Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Sat, 17 Nov 2018 15:18:35 +0000
|
||||
Subject: [PATCH 4/5] brcmfmac: Set board_type used for nvram file selection to
|
||||
machine-compatible
|
||||
|
||||
For of/devicetree using machines, set the board_type used for nvram file
|
||||
selection to the first string listed in the top-level's node compatible
|
||||
string, aka the machine-compatible as used by of_machine_is_compatible().
|
||||
|
||||
The board_type setting is used to load the board-specific nvram file with
|
||||
a board-specific name so that we can ship files for each supported board
|
||||
in linux-firmware.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/Makefile | 2 +
|
||||
.../broadcom/brcm80211/brcmfmac/common.c | 3 +-
|
||||
.../broadcom/brcm80211/brcmfmac/common.h | 8 ++
|
||||
.../broadcom/brcm80211/brcmfmac/dmi.c | 116 ++++++++++++++++++
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/of.c | 11 +-
|
||||
.../broadcom/brcm80211/brcmfmac/pcie.c | 1 +
|
||||
.../broadcom/brcm80211/brcmfmac/sdio.c | 1 +
|
||||
7 files changed, 140 insertions(+), 2 deletions(-)
|
||||
create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
|
||||
index 1f5a9b948abf..22fd95a736a8 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
|
||||
@@ -54,3 +54,5 @@ brcmfmac-$(CONFIG_BRCM_TRACING) += \
|
||||
tracepoint.o
|
||||
brcmfmac-$(CONFIG_OF) += \
|
||||
of.o
|
||||
+brcmfmac-$(CONFIG_DMI) += \
|
||||
+ dmi.o
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
index cd3651069d0c..b93b1e797333 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -450,7 +450,8 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
- /* No platform data for this device, try OF (Open Firwmare) */
|
||||
+ /* No platform data for this device, try OF and DMI data */
|
||||
+ brcmf_dmi_probe(settings, chip, chiprev);
|
||||
brcmf_of_probe(dev, bus_type, settings);
|
||||
}
|
||||
return settings;
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
index a34642cb4d2f..4ce56be90b74 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
@@ -59,6 +59,7 @@ struct brcmf_mp_device {
|
||||
bool iapp;
|
||||
bool ignore_probe_fail;
|
||||
struct brcmfmac_pd_cc *country_codes;
|
||||
+ const char *board_type;
|
||||
union {
|
||||
struct brcmfmac_sdio_pd sdio;
|
||||
} bus;
|
||||
@@ -74,4 +75,11 @@ void brcmf_release_module_param(struct brcmf_mp_device *module_param);
|
||||
/* Sets dongle media info (drv_version, mac address). */
|
||||
int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
|
||||
|
||||
+#ifdef CONFIG_DMI
|
||||
+void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev);
|
||||
+#else
|
||||
+static inline void
|
||||
+brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) {}
|
||||
+#endif
|
||||
+
|
||||
#endif /* BRCMFMAC_COMMON_H */
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||
new file mode 100644
|
||||
index 000000000000..51d76ac45075
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||
@@ -0,0 +1,116 @@
|
||||
+/*
|
||||
+ * Copyright 2018 Hans de Goede <hdegoede@redhat.com>
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/dmi.h>
|
||||
+#include <linux/mod_devicetable.h>
|
||||
+#include "core.h"
|
||||
+#include "common.h"
|
||||
+#include "brcm_hw_ids.h"
|
||||
+
|
||||
+/* The DMI data never changes so we can use a static buf for this */
|
||||
+static char dmi_board_type[128];
|
||||
+
|
||||
+struct brcmf_dmi_data {
|
||||
+ u32 chip;
|
||||
+ u32 chiprev;
|
||||
+ const char *board_type;
|
||||
+};
|
||||
+
|
||||
+/* NOTE: Please keep all entries sorted alphabetically */
|
||||
+
|
||||
+static const struct brcmf_dmi_data gpd_win_pocket_data = {
|
||||
+ BRCM_CC_4356_CHIP_ID, 2, "gpd-win-pocket"
|
||||
+};
|
||||
+
|
||||
+static const struct brcmf_dmi_data jumper_ezpad_mini3_data = {
|
||||
+ BRCM_CC_43430_CHIP_ID, 0, "jumper-ezpad-mini3"
|
||||
+};
|
||||
+
|
||||
+static const struct brcmf_dmi_data meegopad_t08_data = {
|
||||
+ BRCM_CC_43340_CHIP_ID, 2, "meegopad-t08"
|
||||
+};
|
||||
+
|
||||
+static const struct dmi_system_id dmi_platform_data[] = {
|
||||
+ {
|
||||
+ /* Match for the GPDwin which unfortunately uses somewhat
|
||||
+ * generic dmi strings, which is why we test for 4 strings.
|
||||
+ * Comparing against 23 other byt/cht boards, board_vendor
|
||||
+ * and board_name are unique to the GPDwin, where as only one
|
||||
+ * other board has the same board_serial and 3 others have
|
||||
+ * the same default product_name. Also the GPDwin is the
|
||||
+ * only device to have both board_ and product_name not set.
|
||||
+ */
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
|
||||
+ DMI_MATCH(DMI_BOARD_NAME, "Default string"),
|
||||
+ DMI_MATCH(DMI_BOARD_SERIAL, "Default string"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
|
||||
+ },
|
||||
+ .driver_data = (void *)&gpd_win_pocket_data,
|
||||
+ },
|
||||
+ {
|
||||
+ /* Jumper EZpad mini3 */
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
|
||||
+ /* jumperx.T87.KFBNEEA02 with the version-nr dropped */
|
||||
+ DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
|
||||
+ },
|
||||
+ .driver_data = (void *)&jumper_ezpad_mini3_data,
|
||||
+ },
|
||||
+ {
|
||||
+ /* Meegopad T08 */
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
|
||||
+ DMI_MATCH(DMI_BOARD_NAME, "T3 MRD"),
|
||||
+ DMI_MATCH(DMI_BOARD_VERSION, "V1.1"),
|
||||
+ },
|
||||
+ .driver_data = (void *)&meegopad_t08_data,
|
||||
+ },
|
||||
+ {}
|
||||
+};
|
||||
+
|
||||
+void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev)
|
||||
+{
|
||||
+ const struct dmi_system_id *match;
|
||||
+ const struct brcmf_dmi_data *data;
|
||||
+ const char *sys_vendor;
|
||||
+ const char *product_name;
|
||||
+
|
||||
+ /* Some models have DMI strings which are too generic, e.g.
|
||||
+ * "Default string", we use a quirk table for these.
|
||||
+ */
|
||||
+ for (match = dmi_first_match(dmi_platform_data);
|
||||
+ match;
|
||||
+ match = dmi_first_match(match + 1)) {
|
||||
+ data = match->driver_data;
|
||||
+
|
||||
+ if (data->chip == chip && data->chiprev == chiprev) {
|
||||
+ settings->board_type = data->board_type;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Not found in the quirk-table, use sys_vendor-product_name */
|
||||
+ sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR);
|
||||
+ product_name = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
+ if (sys_vendor && product_name) {
|
||||
+ snprintf(dmi_board_type, sizeof(dmi_board_type), "%s-%s",
|
||||
+ sys_vendor, product_name);
|
||||
+ settings->board_type = dmi_board_type;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
|
||||
index aee6e5937c41..84e3373289eb 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
|
||||
@@ -27,11 +27,20 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
|
||||
struct brcmf_mp_device *settings)
|
||||
{
|
||||
struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
|
||||
- struct device_node *np = dev->of_node;
|
||||
+ struct device_node *root, *np = dev->of_node;
|
||||
+ struct property *prop;
|
||||
int irq;
|
||||
u32 irqf;
|
||||
u32 val;
|
||||
|
||||
+ /* Set board-type to the first string of the machine compatible prop */
|
||||
+ root = of_find_node_by_path("/");
|
||||
+ if (root) {
|
||||
+ prop = of_find_property(root, "compatible", NULL);
|
||||
+ settings->board_type = of_prop_next_string(prop, NULL);
|
||||
+ of_node_put(root);
|
||||
+ }
|
||||
+
|
||||
if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
|
||||
!of_device_is_compatible(np, "brcm,bcm4329-fmac"))
|
||||
return;
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
index 4fffa6988087..b12f3e0ee69c 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1785,6 +1785,7 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
|
||||
fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
|
||||
fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
|
||||
fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
|
||||
+ fwreq->board_type = devinfo->settings->board_type;
|
||||
/* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */
|
||||
fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1;
|
||||
fwreq->bus_nr = devinfo->pdev->bus->number;
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
index a907d7b065fa..3dbbbb117563 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -4177,6 +4177,7 @@ brcmf_sdio_prepare_fw_request(struct brcmf_sdio *bus)
|
||||
|
||||
fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
|
||||
fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
|
||||
+ fwreq->board_type = bus->sdiodev->settings->board_type;
|
||||
|
||||
return fwreq;
|
||||
}
|
||||
--
|
||||
2.19.1
|
||||
|
||||
From 6351ca678eb1391129cf5afccab518f376d57596 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 10 Oct 2018 13:01:03 +0200
|
||||
Subject: [PATCH 5/5] brcmfmac: Cleanup brcmf_fw_request_done()
|
||||
|
||||
The "cur" variable is now only used for a debug print and we already
|
||||
print the same info from brcmf_fw_complete_request(), so the debug print
|
||||
does not provide any extra info and we can remove it.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
index 6755b2388fbc..b38c4b40b235 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -560,22 +560,16 @@ static int brcmf_fw_request_firmware(const struct firmware **fw,
|
||||
static void brcmf_fw_request_done(const struct firmware *fw, void *ctx)
|
||||
{
|
||||
struct brcmf_fw *fwctx = ctx;
|
||||
- struct brcmf_fw_item *cur;
|
||||
- int ret = 0;
|
||||
-
|
||||
- cur = &fwctx->req->items[fwctx->curpos];
|
||||
+ int ret;
|
||||
|
||||
ret = brcmf_fw_complete_request(fw, fwctx);
|
||||
|
||||
while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) {
|
||||
- cur = &fwctx->req->items[fwctx->curpos];
|
||||
brcmf_fw_request_firmware(&fw, fwctx);
|
||||
ret = brcmf_fw_complete_request(fw, ctx);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
- brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret,
|
||||
- dev_name(fwctx->dev), cur->path);
|
||||
brcmf_fw_free_request(fwctx->req);
|
||||
fwctx->req = NULL;
|
||||
}
|
||||
--
|
||||
2.19.1
|
||||
|
|
@ -1 +0,0 @@
|
|||
CONFIG_DEBUG_SLAB=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DMADEVICES_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AB3100_CORE is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AB3100_OTP is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AD5686 is not set
|
|
@ -0,0 +1 @@
|
|||
CONFIG_AD7124=m
|
|
@ -0,0 +1 @@
|
|||
CONFIG_AD7949=m
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ADM8211 is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AIRO is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_AIRO_CS is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_APM_POWER=m
|
|
@ -1 +0,0 @@
|
|||
CONFIG_AT76C50X_USB=m
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATMEL is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_AMBASSADOR_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_ATM_FORE200E_DEBUG=0
|
|
@ -1 +0,0 @@
|
|||
CONFIG_ATM_FORE200E_TX_RETRY=16
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_FORE200E_USE_TASKLET is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_HORIZON_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_IA_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_IDT77252_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_IDT77252_RCV_ALL is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ATM_ZATM_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_BACKLIGHT_WM831X=m
|
|
@ -1 +0,0 @@
|
|||
CONFIG_BCM63XX_PHY=m
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_BCM7038_WDT is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_BCM_FLEXRM_MBOX is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_BLK_WBT_SQ is not set
|
|
@ -0,0 +1 @@
|
|||
CONFIG_BPF_LIRC_MODE2=y
|
|
@ -1 +0,0 @@
|
|||
CONFIG_BT_WILINK=m
|
|
@ -1 +0,0 @@
|
|||
CONFIG_CAN_LEDS=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_CAN_TSCAN1 is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_CAN_XILINXCAN is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_CAPI_EICON is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_CELL_CPU is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_CFQ_GROUP_IOSCHED=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_CHARGER_PCF50633 is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_CIFS_NFSD_EXPORT=y
|
|
@ -0,0 +1 @@
|
|||
CONFIG_CRYPTO_ADIANTUM=m
|
|
@ -0,0 +1 @@
|
|||
CONFIG_CRYPTO_STREEBOG=m
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_DEFAULT_CFQ=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DEFAULT_DEADLINE is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DEFAULT_NOOP is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DEFXX is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DPM_WATCHDOG is not set # revisit this in debug
|
|
@ -1 +1 @@
|
|||
# CONFIG_DRM_PANEL is not set
|
||||
CONFIG_DRM_PANEL=y
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
CONFIG_DRM_PANEL_BRIDGE=y
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set
|
|
@ -1 +1 @@
|
|||
CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m
|
||||
# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DRM_SUN6I_DSI is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
|
|
@ -1 +1 @@
|
|||
CONFIG_DVB_MAX_ADAPTERS=8
|
||||
CONFIG_DVB_MAX_ADAPTERS=16
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_DVB_RTL2832_SDR is not set
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_EDAC_SYNOPSYS is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_EFI_SIGNATURE_LIST_PARSER is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_ENC28J60 is not set
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_ENERGY_MODEL is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_EXOFS_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_EZNPS_GIC is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_FB_ATY128_BACKLIGHT=y
|
|
@ -1 +0,0 @@
|
|||
CONFIG_FB_ATY_BACKLIGHT=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_ATY_CT is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_ATY_GX is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_BROADSHEET is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_HECUBA is not set
|
|
@ -0,0 +1 @@
|
|||
# CONFIG_FB_LOGO_CENTER is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_FB_NVIDIA_BACKLIGHT=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_NVIDIA_DEBUG is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_NVIDIA_I2C is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_PRE_INIT_FB is not set
|
|
@ -1 +0,0 @@
|
|||
CONFIG_FB_RADEON_BACKLIGHT=y
|
|
@ -1 +0,0 @@
|
|||
# CONFIG_FB_RADEON_DEBUG is not set
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue