From 71fd11b9013eda5b618737f91e2b19daabb775a3 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 30 Dec 2020 13:16:36 +0100 Subject: [PATCH 1/5] nvme: Use only 32-bit accesses in nvme_writeq/nvme_readq There might be hardware configurations where 64-bit data accesses to NVMe registers are not supported properly. This patch removes the readq/writeq so always two 32-bit accesses are used to read/write 64-bit NVMe registers, similarly as it is done in Linux kernel. This patch fixes operation of NVMe devices on RPi4 Broadcom BCM2711 SoC based board, where the PCIe Root Complex, which is attached to the system through the SCB bridge. Even though the architecture is 64-bit the PCIe BAR is 32-bit and likely the 64-bit wide register accesses initiated by the CPU are not properly translated to a sequence of 32-bit PCIe accesses. nvme_readq(), for example, always returns same value in upper and lower 32-bits, e.g. 0x3c033fff3c033fff which lead to NVMe devices to fail probing. This fix is analogous to commit 8e2ab05000ab ("usb: xhci: Use only 32-bit accesses in xhci_writeq/xhci_readq"). Cc: Sylwester Nawrocki Cc: Nicolas Saenz Julienne Cc: Matthias Brugger Reviewed-by: Stefan Roese Reviewed-by: Bin Meng Signed-off-by: Stefan Agner --- drivers/nvme/nvme.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h index 0e8cb221a7a..aa4b3bac679 100644 --- a/drivers/nvme/nvme.h +++ b/drivers/nvme/nvme.h @@ -535,28 +535,20 @@ struct nvme_completion { */ static inline u64 nvme_readq(__le64 volatile *regs) { -#if BITS_PER_LONG == 64 - return readq(regs); -#else __u32 *ptr = (__u32 *)regs; u64 val_lo = readl(ptr); u64 val_hi = readl(ptr + 1); return val_lo + (val_hi << 32); -#endif } static inline void nvme_writeq(const u64 val, __le64 volatile *regs) { -#if BITS_PER_LONG == 64 - writeq(val, regs); -#else __u32 *ptr = (__u32 *)regs; u32 val_lo = lower_32_bits(val); u32 val_hi = upper_32_bits(val); writel(val_lo, ptr); writel(val_hi, ptr + 1); -#endif } struct nvme_bar { From 51549711b5960f2280629fe6231a07338bbcd57c Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 30 Dec 2020 17:55:22 +0100 Subject: [PATCH 2/5] doc: android/boot-image: invalid C declaration make htmldocs results in an error: doc/android/boot-image.rst:33: WARNING: Unparseable C cross-reference: 'struct andr_img_hdr' Invalid C declaration: Expected identifier in nested name, got keyword: struct [error at 6] Follow the style prescribed in https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#highlights-and-cross-references Add missing definite article. Signed-off-by: Heinrich Schuchardt --- doc/android/boot-image.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/android/boot-image.rst b/doc/android/boot-image.rst index 195da688f47..fa8f2a47ee3 100644 --- a/doc/android/boot-image.rst +++ b/doc/android/boot-image.rst @@ -30,9 +30,10 @@ next image headers: v2, v1 and v0 formats are backward compatible. -Android Boot Image format is represented by :c:type:`struct andr_img_hdr` in -U-Boot, and can be seen in ``include/android_image.h``. U-Boot supports booting -Android Boot Image and also has associated command +The Android Boot Image format is represented by +:c:type:`struct andr_img_hdr ` in U-Boot, and can be seen in +``include/android_image.h``. U-Boot supports booting Android Boot Image and also +has associated command Booting ------- From 19408a397cc634672a405f6235f65a718fc8e14c Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Wed, 30 Dec 2020 19:25:47 +0200 Subject: [PATCH 3/5] mailmap: Update mail address for Igor Opaniuk My address at Toradex doesn't exist anymore, map this address to my personal email. Signed-off-by: Igor Opaniuk Reviewed-by: Heinrich Schuchardt --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 33001f1e015..b76f02283c5 100644 --- a/.mailmap +++ b/.mailmap @@ -30,6 +30,7 @@ Jagan Teki Jagan Teki Jagan Teki Igor Opaniuk +Igor Opaniuk Markus Klotzbuecher Patrice Chotard Patrick Delaunay From 1639988fa4c0049e6580dc781fe9bb2c94258c02 Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Wed, 23 Dec 2020 15:33:07 +0100 Subject: [PATCH 4/5] cmd: ubi: don't allow to rename a volume to a name that already exist This commits add a check on the command ubi rename. This check avoids to rename a volume to with a name that is already used on another ubi volume. If two volumes has the same name, then the ubi device can't be mounted anymore. Signed-off-by: Philippe Reynes --- cmd/ubi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/ubi.c b/cmd/ubi.c index 171377cc66b..cb14e3e1e79 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -264,6 +264,11 @@ static int ubi_rename_vol(char *oldname, char *newname) return ENODEV; } + if (!ubi_check(newname)) { + printf("%s: volume %s already exist\n", __func__, newname); + return EINVAL; + } + printf("Rename UBI volume %s to %s\n", oldname, newname); if (ubi->ro_mode) { From acff02c6dd05740ba5fbfaa6e2dd87c01b5c3257 Mon Sep 17 00:00:00 2001 From: Marc Ferland Date: Wed, 23 Dec 2020 10:13:22 -0500 Subject: [PATCH 5/5] cosmetic: fix typo in drivers/usb/Kconfig This commit fixes a simple typo: sPL --> SPL. Signed-off-by: Marc Ferland --- drivers/usb/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index fedc0134f5f..6e291198abe 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -60,7 +60,7 @@ config DM_USB_GADGET mode) config SPL_DM_USB_GADGET - bool "Enable driver model for USB Gadget in sPL" + bool "Enable driver model for USB Gadget in SPL" depends on SPL_DM_USB help Enable driver model for USB Gadget in SPL