From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] nios2: fix map_physmem to do real cache mapping
Date: Tue, 27 Oct 2015 10:17:33 +0100 [thread overview]
Message-ID: <201510271017.33369.marex@denx.de> (raw)
In-Reply-To: <1445908183-8623-1-git-send-email-thomas@wytron.com.tw>
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 <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
[...]
> #include <asm-generic/global_data.h>
> 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
next prev parent reply other threads:[~2015-10-27 9:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 1:09 [U-Boot] [PATCH] nios2: fix map_physmem to do real cache mapping Thomas Chou
2015-10-27 9:17 ` Marek Vasut [this message]
2015-11-03 5:15 ` Thomas Chou
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=201510271017.33369.marex@denx.de \
--to=marex@denx.de \
--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