From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 27 Oct 2015 10:17:33 +0100 Subject: [U-Boot] [PATCH] nios2: fix map_physmem to do real cache mapping In-Reply-To: <1445908183-8623-1-git-send-email-thomas@wytron.com.tw> References: <1445908183-8623-1-git-send-email-thomas@wytron.com.tw> Message-ID: <201510271017.33369.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday, October 27, 2015 at 02:09:43 AM, Thomas Chou wrote: > Fix the map_physmem() to do real cache mapping. > > Signed-off-by: Thomas Chou Acked-by: Marek Vasut [...] > #include > diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h > index e7da35b..007df8d 100644 > --- a/arch/nios2/include/asm/io.h > +++ b/arch/nios2/include/asm/io.h > @@ -18,7 +18,7 @@ static inline void sync(void) > * that can be used to access the memory range with the caching > * properties specified by "flags". > */ > -#define MAP_NOCACHE (0) > +#define MAP_NOCACHE (1) > #define MAP_WRCOMBINE (0) > #define MAP_WRBACK (0) > #define MAP_WRTHROUGH (0) Eventually, you might want to create a patch to drop these useless parenthesis. > @@ -26,7 +26,11 @@ static inline void sync(void) > static inline void * > map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) > { > - return (void *)paddr; > + DECLARE_GLOBAL_DATA_PTR; > + if (flags) > + return (void *)(paddr | gd->arch.io_region_base); > + else > + return (void *)(paddr | gd->arch.mem_region_base); > } > > /* Best regards, Marek Vasut