[PATCH v6 09/14] gtrace: Add RISC-V Trace ramsink driver
Zane Leung
liangzhen at linux.spacemit.com
Wed Nov 4 23:08:56 PST 2026
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.
More information about the linux-riscv
mailing list