iotrace: support iotrace driver [1/1]

PD#SWPL-114632

Problem:
support iotrace driver

Solution:
support iotrace

Verify:
on s4d_ap222 and c2_af400

Change-Id: Id4dc4f64d886dc551f32d776ebaa2c9c2d5650b0
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
This commit is contained in:
qiankun.wang
2023-05-11 15:08:24 +08:00
committed by Dongjin Kim
parent ed6c0c92dd
commit c7d56b663b
4 changed files with 15 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ config ARM
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAVE_CUSTOM_GPIO_H
select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K
select ARCH_HAVE_TRACE_MMIO_ACCESS if AMLOGIC_DEBUG_IOTRACE
select ARCH_HAS_GCOV_PROFILE_ALL
select ARCH_KEEP_MEMBLOCK
select ARCH_MIGHT_HAVE_PC_PARPORT

View File

@@ -115,7 +115,6 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
: "Qo" (*(volatile u32 __force *)addr));
return val;
}
/*
* Architecture ioremap implementation.
*/
@@ -288,6 +287,8 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
* IO port primitives for more information.
*/
#ifndef readl
/* use the macro definitions in include/asm-generic/io.h */
#if !IS_ENABLED(CONFIG_AMLOGIC_DEBUG_IOTRACE)
#define readb_relaxed(c) ({ u8 __r = __raw_readb(c); __r; })
#define readw_relaxed(c) ({ u16 __r = le16_to_cpu((__force __le16) \
__raw_readw(c)); __r; })
@@ -313,6 +314,7 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
#define writesb(p,d,l) __raw_writesb(p,d,l)
#define writesw(p,d,l) __raw_writesw(p,d,l)
#define writesl(p,d,l) __raw_writesl(p,d,l)
#endif
#ifndef __ARMBE__
static inline void memset_io(volatile void __iomem *dst, unsigned c,
@@ -338,7 +340,6 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from,
mmiocpy((void __force *)to, from, count);
}
#define memcpy_toio(to,from,count) memcpy_toio(to,from,count)
#else
#define memset_io(c,v,l) _memset_io(c,(v),(l))
#define memcpy_fromio(a,c,l) _memcpy_fromio((a),c,(l))

View File

@@ -112,6 +112,9 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
#define __iowmb() dma_wmb()
#define __iomb() dma_mb()
#if IS_BUILTIN(CONFIG_AMLOGIC_DEBUG_IOTRACE) || \
((IS_MODULE(CONFIG_AMLOGIC_DEBUG_IOTRACE)) && defined(MODULE))
#else
/*
* Relaxed I/O memory access primitives. These follow the Device memory
* ordering rules but do not guarantee any ordering relative to Normal memory
@@ -141,6 +144,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
#define writew(v,c) ({ __iowmb(); writew_relaxed((v),(c)); })
#define writel(v,c) ({ __iowmb(); writel_relaxed((v),(c)); })
#define writeq(v,c) ({ __iowmb(); writeq_relaxed((v),(c)); })
#endif
/*
* I/O port access primitives.

View File

@@ -18,6 +18,13 @@
#include <asm/mmiowb.h>
#include <asm-generic/pci_iomap.h>
/* get the macro ' _THIS_IP_' definition */
#if IS_ENABLED(CONFIG_AMLOGIC_DEBUG_IOTRACE)
#ifdef CONFIG_ARM
#include <linux/kernel.h>
#endif
#endif
#ifndef __io_br
#define __io_br() barrier()
#endif