coresight: Make new csdev_access offsets unsigned

New csdev_access functions were added as part of the previous
refactor. In order to make them more consistent with the
existing ones, change any signed offset types to be unsigned.

Now that they are unsigned, stop using hi_off = -1 to signify
a single 32bit access. Instead just call the existing 32bit
accessors. This is also applied to other parts of the codebase,
and the coresight_{read,write}_reg_pair() functions can be
deleted.

Signed-off-by: James Clark <james.clark@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Link: https://lore.kernel.org/r/20220830172614.340962-6-james.clark@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
James Clark 2022-08-30 18:26:13 +01:00 committed by Mathieu Poirier
parent fbca79e554
commit 0a98181f80
5 changed files with 47 additions and 45 deletions

View file

@ -373,21 +373,26 @@ static inline u32 csdev_access_relaxed_read32(struct csdev_access *csa,
}
static inline u64 csdev_access_relaxed_read_pair(struct csdev_access *csa,
s32 lo_offset, s32 hi_offset)
u32 lo_offset, u32 hi_offset)
{
u64 val;
if (likely(csa->io_mem)) {
val = readl_relaxed(csa->base + lo_offset);
val |= (hi_offset < 0) ? 0 :
(u64)readl_relaxed(csa->base + hi_offset) << 32;
return val;
return readl_relaxed(csa->base + lo_offset) |
((u64)readl_relaxed(csa->base + hi_offset) << 32);
}
val = csa->read(lo_offset, true, false);
val |= (hi_offset < 0) ? 0 :
(u64)csa->read(hi_offset, true, false) << 32;
return val;
return csa->read(lo_offset, true, false) | (csa->read(hi_offset, true, false) << 32);
}
static inline void csdev_access_relaxed_write_pair(struct csdev_access *csa, u64 val,
u32 lo_offset, u32 hi_offset)
{
if (likely(csa->io_mem)) {
writel_relaxed((u32)val, csa->base + lo_offset);
writel_relaxed((u32)(val >> 32), csa->base + hi_offset);
} else {
csa->write((u32)val, lo_offset, true, false);
csa->write((u32)(val >> 32), hi_offset, true, false);
}
}
static inline u32 csdev_access_read32(struct csdev_access *csa, u32 offset)