From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Tue, 17 Nov 2015 08:18:46 +0800 Subject: [U-Boot] [PATCH 02/12] arc: add mapping between physical and virtual address In-Reply-To: <1447684616-10297-3-git-send-email-thomas@wytron.com.tw> References: <1447684616-10297-1-git-send-email-thomas@wytron.com.tw> <1447684616-10297-3-git-send-email-thomas@wytron.com.tw> Message-ID: <564A7266.7070700@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2015?11?16? 22:36, Thomas Chou wrote: > Add mapping between physical and virtual address. > > Signed-off-by: Thomas Chou > --- > arch/arc/include/asm/io.h | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > Drop this patch as it is taken cared by Alexey Brodkin. - Thomas > diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h > index 24b7337..273e9f9 100644 > --- a/arch/arc/include/asm/io.h > +++ b/arch/arc/include/asm/io.h > @@ -15,6 +15,34 @@ static inline void sync(void) > /* Not yet implemented */ > } > > +/* > + * Given a physical address and a length, return a virtual address > + * that can be used to access the memory range with the caching > + * properties specified by "flags". > + */ > +#define MAP_NOCACHE (0) > +#define MAP_WRCOMBINE (0) > +#define MAP_WRBACK (0) > +#define MAP_WRTHROUGH (0) > + > +static inline void *map_physmem(phys_addr_t paddr, unsigned long len, > + unsigned long flags) > +{ > + return (void *)(uintptr_t)paddr; > +} > + > +/* > + * Take down a mapping set up by map_physmem(). > + */ > +static inline void unmap_physmem(void *vaddr, unsigned long flags) > +{ > +} > + > +static inline phys_addr_t virt_to_phys(void *vaddr) > +{ > + return (phys_addr_t)(uintptr_t)vaddr; > +} > + > static inline u8 __raw_readb(const volatile void __iomem *addr) > { > u8 b; >