Jianjun Wang has uploaded this change for review.

View Change

device/mmio.h: Move readXp/writeXp helpers to device/mmio.h

These helpers is not architecture dependent and it might be used for
different platform.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Change-Id: Ic13a94d91affb7cf65a2f22f08ea39ed671bc8e8
---
M src/arch/x86/include/arch/mmio.h
M src/include/device/mmio.h
2 files changed, 40 insertions(+), 40 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/62561/1
diff --git a/src/arch/x86/include/arch/mmio.h b/src/arch/x86/include/arch/mmio.h
index 7188eac..c2aa0fb 100644
--- a/src/arch/x86/include/arch/mmio.h
+++ b/src/arch/x86/include/arch/mmio.h
@@ -45,44 +45,4 @@
*((volatile uint64_t *)(addr)) = value;
}

-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 /* __ARCH_MMIO_H__ */
diff --git a/src/include/device/mmio.h b/src/include/device/mmio.h
index 3c9a833..7c8e2bd 100644
--- a/src/include/device/mmio.h
+++ b/src/include/device/mmio.h
@@ -207,4 +207,44 @@
#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__ */

To view, visit change 62561. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic13a94d91affb7cf65a2f22f08ea39ed671bc8e8
Gerrit-Change-Number: 62561
Gerrit-PatchSet: 1
Gerrit-Owner: Jianjun Wang <jianjun.wang@mediatek.corp-partner.google.com>
Gerrit-MessageType: newchange