Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) #include <linux/export.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) #include <linux/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * __ioread64_copy - copy data from MMIO space, in 64-bit units
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  * @to: destination (must be 64-bit aligned)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  * @from: source, in MMIO space (must be 64-bit aligned)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  * @count: number of 64-bit quantities to copy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)  * Copy data from MMIO space to kernel space, in units of 32 or 64 bits at a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)  * time.  Order of access is not guaranteed, nor is a memory barrier
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)  * performed afterwards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) void __ioread64_copy(void *to, const void __iomem *from, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #ifdef CONFIG_64BIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 	u64 *dst = to;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 	const u64 __iomem *src = from;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 	const u64 __iomem *end = src + count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	while (src < end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 		*dst++ = __raw_readq(src++);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	__ioread32_copy(to, from, count * 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) EXPORT_SYMBOL_GPL(__ioread64_copy);