summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorIonela Voinescu <ionela.voinescu@imgtec.com>2015-02-02 14:48:12 +0000
committerPatrick Georgi <pgeorgi@google.com>2015-03-21 11:09:29 +0100
commitdebc1744e185cc9edd09197dfd220bfbff2cdf1b (patch)
treeecdee088e09cb1c5ce667c0ec98657fc961ec7a4 /payloads/libpayload
parent367331161995e7cbaa507bd24a71a28bc97c4834 (diff)
downloadcoreboot-debc1744e185cc9edd09197dfd220bfbff2cdf1b.tar.xz
libpayload: arch/mips: add virt/bus/phy_to_bus/phy/virt operations
BUG=chrome-os-partner:31438 TEST=tested on Pistachio FPGA and bring up board; works as expected BRANCH=none Change-Id: I368494f388b82969dda0ce73a38824791efce616 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: e4c2bbcbdbcf706062724cffe2d5f15953468ace Original-Change-Id: Id5c9b1d65c6ec87f2aba06995dc940c50afb041f Original-Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com> Original-Reviewed-on: https://chromium-review.googlesource.com/245386 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/8746 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/arch/mips/virtual.c3
-rw-r--r--payloads/libpayload/include/mips/arch/virtual.h13
2 files changed, 10 insertions, 6 deletions
diff --git a/payloads/libpayload/arch/mips/virtual.c b/payloads/libpayload/arch/mips/virtual.c
index 9d226494b9..5c110d0f21 100644
--- a/payloads/libpayload/arch/mips/virtual.c
+++ b/payloads/libpayload/arch/mips/virtual.c
@@ -19,7 +19,8 @@
#include <unistd.h>
-unsigned long virtual_offset = 0;
+unsigned long virt_to_phys_offset = 0;
+unsigned long virt_to_bus_offset = 0x60000000;
int getpagesize(void)
{
diff --git a/payloads/libpayload/include/mips/arch/virtual.h b/payloads/libpayload/include/mips/arch/virtual.h
index 70aea20b9c..f470393b35 100644
--- a/payloads/libpayload/include/mips/arch/virtual.h
+++ b/payloads/libpayload/include/mips/arch/virtual.h
@@ -20,12 +20,15 @@
#ifndef __MIPS_ARCH_VIRTUAL_H
#define __MIPS_ARCH_VIRTUAL_H
-extern unsigned long virtual_offset;
+extern unsigned long virt_to_phys_offset;
+extern unsigned long virt_to_bus_offset;
-#define virt_to_phys(virt) ((unsigned long) (virt) + virtual_offset)
-#define phys_to_virt(phys) ((void *) ((unsigned long) (phys) - virtual_offset))
+#define virt_to_phys(virt) ((unsigned long) (virt) + virt_to_phys_offset)
+#define phys_to_virt(phys) ((void *) ((unsigned long) (phys) - \
+ virt_to_phys_offset))
-#define virt_to_bus(addr) virt_to_phys(addr)
-#define bus_to_virt(addr) phys_to_virt(addr)
+#define virt_to_bus(virt) ((unsigned long) (virt) + virt_to_bus_offset)
+#define bus_to_virt(phys) ((void *) ((unsigned long) (phys) - \
+ virt_to_bus_offset))
#endif