From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 4/4] ppc: Use addrmap in virt_to_phys and map_physmem.
Date: Sat, 13 Dec 2008 17:20:30 -0600 [thread overview]
Message-ID: <1229210430-4522-4-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <1229210430-4522-3-git-send-email-galak@kernel.crashing.org>
If we have addr map support enabled use the mapping functions to
implement virt_to_phys() and map_physmem().
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* No change, just reposting as part of the sequence
include/asm-ppc/io.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index c00de45..a8003ef 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -10,6 +10,10 @@
#include <linux/config.h>
#include <asm/byteorder.h>
+#ifdef CONFIG_ADDR_MAP
+#include <addr_map.h>
+#endif
+
#define SIO_CONFIG_RA 0x398
#define SIO_CONFIG_RD 0x399
@@ -287,7 +291,11 @@ extern inline void out_be32(volatile unsigned __iomem *addr, int val)
static inline void *
map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
{
+#ifdef CONFIG_ADDR_MAP
+ return (void *)(addrmap_phys_to_virt(paddr));
+#else
return (void *)((unsigned long)paddr);
+#endif
}
/*
@@ -300,7 +308,11 @@ static inline void unmap_physmem(void *vaddr, unsigned long flags)
static inline phys_addr_t virt_to_phys(void * vaddr)
{
+#ifdef CONFIG_ADDR_MAP
+ return addrmap_virt_to_phys(vaddr);
+#else
return (phys_addr_t)(vaddr);
+#endif
}
#endif
--
1.5.6.5
next prev parent reply other threads:[~2008-12-13 23:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-13 23:20 [U-Boot] [PATCH v4 1/4] Introduce virt_to_phys() Kumar Gala
2008-12-13 23:20 ` [U-Boot] [PATCH v4 2/4] Introduce addr_map library Kumar Gala
2008-12-13 23:20 ` [U-Boot] [PATCH v4 3/4] 85xx: Add support to populate addr map based on TLB settings Kumar Gala
2008-12-13 23:20 ` Kumar Gala [this message]
2008-12-15 21:07 ` [U-Boot] [PATCH v4 2/4] Introduce addr_map library Wolfgang Denk
2008-12-15 21:12 ` Kumar Gala
2008-12-16 0:46 ` Wolfgang Denk
2008-12-16 3:33 ` Becky Bruce
2008-12-16 15:55 ` Wolfgang Denk
2008-12-15 21:04 ` [U-Boot] [PATCH v4 1/4] Introduce virt_to_phys() Wolfgang Denk
2008-12-17 15:47 ` Haavard Skinnemoen
2008-12-17 15:55 ` Kumar Gala
2008-12-17 16:00 ` Haavard Skinnemoen
2008-12-17 16:04 ` Kumar Gala
2008-12-17 16:22 ` Haavard Skinnemoen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1229210430-4522-4-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox