Re: [PATCH v6 09/14] gtrace: Add RISC-V Trace ramsink driver
From: Mayuresh Chitale
Date: Wed Nov 18 2026 - 07:14:14 EST
Hi Zane,
On Thu, Nov 5, 2026 at 12:39 PM Zane Leung <liangzhen@xxxxxxxxxxxxxxxxxx> wrote:
>
>
> On 11/5/2026 3:00 PM, Zane Leung wrote:
> > On 10/1/2026 1:22 PM, Mayuresh Chitale wrote:
> >> +/* Helper to access start, limit, wp pair registers */
> >> +static u64 rvtrace_ramsink_read_pair(struct gtrace_platform_data *pdata, u32 low_off)
> >> +{
> >> + u32 low, high;
> >> +
> >> + low = gtrace_read32(pdata, low_off);
> >> + high = gtrace_read32(pdata, low_off + 4);
> >> +
> >> + return (u64)high << 32 | low;
> >> +}
> >> +
> >> +static void rvtrace_ramsink_write_pair(struct gtrace_platform_data *pdata, u64 val, u32 low_off)
> >> +{
> >> + gtrace_write32(pdata, lower_32_bits(val), low_off);
> >> + gtrace_write32(pdata, upper_32_bits(val), low_off + 4);
> >> +}
> >> +
> >
> > Could you move these helpers into "include/linux/gtrace.h" and implement them as generic APIs
> > (e.g., gtrace_read_pair, gtrace_relaxed_read_pair, gtrace_write_pair, and gtrace_relaxed_write_pair)?
> > This would allow them to be easily reused by future components like Coresight.
> By the way, please pass both |low_off| and |hi_off| as parameters to handle non-contiguous register offsets.
Yes, I will do it in next version.
>