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
@@ -24,6 +24,9 @@ static inline uint32_t read32(const void *addr)
|
||||
return *(volatile uint32_t *)addr;
|
||||
}
|
||||
|
||||
/* Not supported */
|
||||
uint64_t read64(const void *addr);
|
||||
|
||||
static inline void write8(void *addr, uint8_t val)
|
||||
{
|
||||
*(volatile uint8_t *)addr = val;
|
||||
@@ -39,4 +42,7 @@ static inline void write32(void *addr, uint32_t val)
|
||||
*(volatile uint32_t *)addr = val;
|
||||
}
|
||||
|
||||
/* Not supported */
|
||||
void write64(void *addr, uint64_t val);
|
||||
|
||||
#endif /* __ARCH_MMIO_H__ */
|
||||
|
@@ -29,6 +29,9 @@ static inline uint32_t read32(const void *addr)
|
||||
return *(volatile uint32_t *)__builtin_assume_aligned(addr, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
/* Not supported */
|
||||
uint64_t read64(const void *addr);
|
||||
|
||||
static inline void write8(void *addr, uint8_t val)
|
||||
{
|
||||
dmb();
|
||||
@@ -50,4 +53,7 @@ static inline void write32(void *addr, uint32_t val)
|
||||
dmb();
|
||||
}
|
||||
|
||||
/* Not supported */
|
||||
void write64(void *addr, uint64_t val);
|
||||
|
||||
#endif /* __ARCH_MMIO_H__ */
|
||||
|
Reference in New Issue
Block a user