Skip to contentSkip to conversation

riscv: add #define in asm/io.h for some device drivers

PATCH In review [email protected] 2 participants 2 messages Sep 30, 2021 – Oct 2, 2021 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: add #define in asm/io.h for some device drivers

From: TekkamanV <[email protected]>

This patch add memcpy_fromio and memcpy_toio definitions for some device drivers which has these definitions, like cadence_qspi_apb.c

---
 arch/riscv/include/asm/io.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/riscv/include/asm/io.h +4 -0
index acf5a96449..b693fd8cd6 100644
@@ -64,6 +64,10 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
 #define __raw_readl(a)			__arch_getl(a)
 #define __raw_readq(a)			__arch_getq(a)
 
+/* adding for some drivers, like cadence_qspi_apb.c */
+#define memcpy_fromio(a, c, l)		memcpy((a), (c), (l))
+#define memcpy_toio(c, a, l)		memcpy((c), (a), (l))
+
 #define dmb()		mb()
 #define __iormb()	rmb()
 #define __iowmb()	wmb()
Signature · 1 line
2.25.4
Reviewed-by on v1 1/1
#1 lore raw

Hi Wei,

Quoted 4 lines · On Thu, Sep 30, 2021 at 7:52 PM <[email protected]> wrote:

From: TekkamanV <[email protected]>

This patch add memcpy_fromio and memcpy_toio definitions for some device

%s/add/adds

Quoted 1 line

drivers which has these definitions, like cadence_qspi_apb.c

%s/has/have

Quoted 2 lines

Please use real name for the contribution, i.e.: following kernel submitting-patches.rst

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n409

Quoted 9 lines
---
 arch/riscv/include/asm/io.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/riscv/include/asm/io.h +0 -0
index acf5a96449..b693fd8cd6 100644

arch/riscv/include/asm/io.h static inline phys_addr_t map_to_sysmem(const void *ptr) · line 73

Quoted 10 lines
arch/riscv/include/asm/io.h +4 -0
@@ -64,6 +64,10 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
 #define __raw_readl(a)                 __arch_getl(a)
 #define __raw_readq(a)                 __arch_getq(a)
 
+/* adding for some drivers, like cadence_qspi_apb.c */
+#define memcpy_fromio(a, c, l)         memcpy((a), (c), (l))
+#define memcpy_toio(c, a, l)           memcpy((c), (a), (l))
+
 #define dmb()          mb()
 #define __iormb()      rmb()
 #define __iowmb()      wmb()

Otherwise, LGTM:

Regards,
Bin