summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-01-08 19:37:35 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-01-08 19:47:50 +0100
commit3d00a8089ed6fd5875be75733adc2da3768ba252 (patch)
tree5ed74e627f761c0054ae4bbc71185c380f6806f6 /kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch
parentb8dd027e7c1b4103263135b75537d7117792ac8e (diff)
downloadabslibre-3d00a8089ed6fd5875be75733adc2da3768ba252.tar.gz
abslibre-3d00a8089ed6fd5875be75733adc2da3768ba252.tar.bz2
abslibre-3d00a8089ed6fd5875be75733adc2da3768ba252.zip
kernels: add linux-libre-aarch64
Some System On a Chip (SOC) have 64bit ARM CPUs that are also capable of running arm 32bit applications. Since: - Parabola doesn't have an aarch64 package repository yet - The devicetree of devices using such System On a Chip are not compiled when using the armv7 defconfig - Drivers or other platform support code for such hardware might also not be compiled in with the armv7 defconfig - This approach has already been tested with the linux-libre-x86_64 kenrel It's then a good idea to add support for such devices by adding an arrch64 kernel as the maintenance and work is minimal. The downside is that the external kernel modules that are either compiled against the kernel or using DKMS will not work by default. It's however still possible to compile them by hand by using ARCH= and CROSS_COMPILE= as it is done for this kernel, so it should be relatively easy to add support for the non-dkms modules. As for DKMS, someone would need to look into it to understand how to pass it the make flags (ARCH= and CROSS_COMPILE=) that are required to automatically build modules. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch')
-rw-r--r--kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch b/kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch
new file mode 100644
index 000000000..cf03b7a6b
--- /dev/null
+++ b/kernels/linux-libre-arm64/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch
@@ -0,0 +1,79 @@
+From 54dd8abeea02e5ea426a83f0a924d874a9c6e617 Mon Sep 17 00:00:00 2001
+From: Tuowen Zhao <ztuowen@gmail.com>
+Date: Wed, 16 Oct 2019 15:06:28 -0600
+Subject: [PATCH 02/13] lib: devres: add a helper function for ioremap_uc
+
+Implement a resource managed strongly uncachable ioremap function.
+
+Cc: <stable@vger.kernel.org> # v4.19+
+Tested-by: AceLan Kao <acelan.kao@canonical.com>
+Signed-off-by: Tuowen Zhao <ztuowen@gmail.com>
+Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Acked-by: Luis Chamberlain <mcgrof@kernel.org>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+---
+ include/linux/io.h | 2 ++
+ lib/devres.c | 19 +++++++++++++++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/include/linux/io.h b/include/linux/io.h
+index accac822336a..a59834bc0a11 100644
+--- a/include/linux/io.h
++++ b/include/linux/io.h
+@@ -64,6 +64,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)
+
+ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
+ resource_size_t size);
++void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
++ resource_size_t size);
+ void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
+ resource_size_t size);
+ void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
+diff --git a/lib/devres.c b/lib/devres.c
+index 6a0e9bd6524a..17624d35e82d 100644
+--- a/lib/devres.c
++++ b/lib/devres.c
+@@ -9,6 +9,7 @@
+ enum devm_ioremap_type {
+ DEVM_IOREMAP = 0,
+ DEVM_IOREMAP_NC,
++ DEVM_IOREMAP_UC,
+ DEVM_IOREMAP_WC,
+ };
+
+@@ -39,6 +40,9 @@ static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset,
+ case DEVM_IOREMAP_NC:
+ addr = ioremap_nocache(offset, size);
+ break;
++ case DEVM_IOREMAP_UC:
++ addr = ioremap_uc(offset, size);
++ break;
+ case DEVM_IOREMAP_WC:
+ addr = ioremap_wc(offset, size);
+ break;
+@@ -68,6 +72,21 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
+ }
+ EXPORT_SYMBOL(devm_ioremap);
+
++/**
++ * devm_ioremap_uc - Managed ioremap_uc()
++ * @dev: Generic device to remap IO address for
++ * @offset: Resource address to map
++ * @size: Size of map
++ *
++ * Managed ioremap_uc(). Map is automatically unmapped on driver detach.
++ */
++void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
++ resource_size_t size)
++{
++ return __devm_ioremap(dev, offset, size, DEVM_IOREMAP_UC);
++}
++EXPORT_SYMBOL_GPL(devm_ioremap_uc);
++
+ /**
+ * devm_ioremap_nocache - Managed ioremap_nocache()
+ * @dev: Generic device to remap IO address for
+--
+2.24.1
+