162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Register read and write tracepoints
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <linux/ftrace.h>
962306a36Sopenharmony_ci#include <linux/module.h>
1062306a36Sopenharmony_ci#include <asm-generic/io.h>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define CREATE_TRACE_POINTS
1362306a36Sopenharmony_ci#include <trace/events/rwmmio.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#ifdef CONFIG_TRACE_MMIO_ACCESS
1662306a36Sopenharmony_civoid log_write_mmio(u64 val, u8 width, volatile void __iomem *addr,
1762306a36Sopenharmony_ci		    unsigned long caller_addr, unsigned long caller_addr0)
1862306a36Sopenharmony_ci{
1962306a36Sopenharmony_ci	trace_rwmmio_write(caller_addr, caller_addr0, val, width, addr);
2062306a36Sopenharmony_ci}
2162306a36Sopenharmony_ciEXPORT_SYMBOL_GPL(log_write_mmio);
2262306a36Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_write);
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_civoid log_post_write_mmio(u64 val, u8 width, volatile void __iomem *addr,
2562306a36Sopenharmony_ci			 unsigned long caller_addr, unsigned long caller_addr0)
2662306a36Sopenharmony_ci{
2762306a36Sopenharmony_ci	trace_rwmmio_post_write(caller_addr, caller_addr0, val, width, addr);
2862306a36Sopenharmony_ci}
2962306a36Sopenharmony_ciEXPORT_SYMBOL_GPL(log_post_write_mmio);
3062306a36Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_post_write);
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_civoid log_read_mmio(u8 width, const volatile void __iomem *addr,
3362306a36Sopenharmony_ci		   unsigned long caller_addr, unsigned long caller_addr0)
3462306a36Sopenharmony_ci{
3562306a36Sopenharmony_ci	trace_rwmmio_read(caller_addr, caller_addr0, width, addr);
3662306a36Sopenharmony_ci}
3762306a36Sopenharmony_ciEXPORT_SYMBOL_GPL(log_read_mmio);
3862306a36Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_read);
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_civoid log_post_read_mmio(u64 val, u8 width, const volatile void __iomem *addr,
4162306a36Sopenharmony_ci			unsigned long caller_addr, unsigned long caller_addr0)
4262306a36Sopenharmony_ci{
4362306a36Sopenharmony_ci	trace_rwmmio_post_read(caller_addr, caller_addr0, val, width, addr);
4462306a36Sopenharmony_ci}
4562306a36Sopenharmony_ciEXPORT_SYMBOL_GPL(log_post_read_mmio);
4662306a36Sopenharmony_ciEXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_post_read);
4762306a36Sopenharmony_ci#endif /* CONFIG_TRACE_MMIO_ACCESS */
48