device/mmio.h: Move readXp/writeXp helpers to device/mmio.h
These helpers are not architecture dependent and it might be used for different platform. Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com> Change-Id: Ic13a94d91affb7cf65a2f22f08ea39ed671bc8e8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62561 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Hung-Te Lin
parent
0e834a9455
commit
8565b94a53
@@ -207,4 +207,44 @@ static inline void buffer_to_fifo32(const void *buffer, size_t size, void *fifo,
|
||||
#define READ32_BITFIELD(addr, name) \
|
||||
EXTRACT_BITFIELD(read32(addr), name)
|
||||
|
||||
static __always_inline uint8_t read8p(const uintptr_t addr)
|
||||
{
|
||||
return read8((void *)addr);
|
||||
}
|
||||
|
||||
static __always_inline uint16_t read16p(const uintptr_t addr)
|
||||
{
|
||||
return read16((void *)addr);
|
||||
}
|
||||
|
||||
static __always_inline uint32_t read32p(const uintptr_t addr)
|
||||
{
|
||||
return read32((void *)addr);
|
||||
}
|
||||
|
||||
static __always_inline uint64_t read64p(const uintptr_t addr)
|
||||
{
|
||||
return read64((void *)addr);
|
||||
}
|
||||
|
||||
static __always_inline void write8p(const uintptr_t addr, const uint8_t value)
|
||||
{
|
||||
write8((void *)addr, value);
|
||||
}
|
||||
|
||||
static __always_inline void write16p(const uintptr_t addr, const uint16_t value)
|
||||
{
|
||||
write16((void *)addr, value);
|
||||
}
|
||||
|
||||
static __always_inline void write32p(const uintptr_t addr, const uint32_t value)
|
||||
{
|
||||
write32((void *)addr, value);
|
||||
}
|
||||
|
||||
static __always_inline void write64p(const uintptr_t addr, const uint64_t value)
|
||||
{
|
||||
write64((void *)addr, value);
|
||||
}
|
||||
|
||||
#endif /* __DEVICE_MMIO_H__ */
|
||||
|
Reference in New Issue
Block a user