public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 1/5] mips: implement to access the KSEG0/1 memory range in map_physmem
Date: Tue, 29 Dec 2015 19:08:44 +0100	[thread overview]
Message-ID: <5682CC2C.5070605@gmail.com> (raw)
In-Reply-To: <BLU436-SMTP175812A7FBA809D0BB5BF3CFFFC0@phx.gbl>



Am 29.12.2015 um 12:17 schrieb Wills Wang:
> U-boot just use the no MMU virtual address segment(KSEG0/1), this
> patch enable access the uncached memory range(KSEG1) by flag
> "MAP_NOCACHE", other flag for KSEG0 access.
> 
> Signed-off-by: Wills Wang <wills.wang@live.com>
> ---
> 
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  arch/mips/include/asm/io.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
> index a7ab087..943053d 100644
> --- a/arch/mips/include/asm/io.h
> +++ b/arch/mips/include/asm/io.h
> @@ -485,7 +485,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)
> @@ -493,7 +493,10 @@ static inline void sync(void)
>  static inline void *
>  map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
>  {
> -	return (void *)paddr;
> +	if (flags)
> +		return (void *)KSEG1ADDR(paddr);
> +	else
> +		return (void *)KSEG0ADDR(paddr);
>  }

please use CKSEG0ADDR and CKSEG1ADDR to be compatible with MIPS64. Also
drop the 'else' and always return CKSEG0ADDR as default.

>  
>  /*
> 

-- 
- Daniel

  parent reply	other threads:[~2015-12-29 18:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1451387833-932-1-git-send-email-wills.wang@live.com>
2015-12-29 11:17 ` [U-Boot] [PATCH v5 1/5] mips: implement to access the KSEG0/1 memory range in map_physmem Wills Wang
2015-12-29 12:49   ` Antony Pavlov
2015-12-30  1:08     ` Wills Wang
2015-12-29 18:08   ` Daniel Schwierzeck [this message]
2015-12-29 11:17 ` [U-Boot] [PATCH v5 2/5] mips: add support for QCA/Atheros ath79 SOCs Wills Wang
2015-12-29 19:09   ` Daniel Schwierzeck
2015-12-30  6:27     ` Wills Wang
2015-12-29 11:17 ` [U-Boot] [PATCH v5 3/5] mips: ath79: add serial driver for ar933x SOC Wills Wang
2015-12-29 12:26   ` Thomas Chou
2015-12-30  1:06     ` Wills Wang
2015-12-29 11:17 ` [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver Wills Wang
2015-12-29 13:00   ` Thomas Chou
2015-12-29 13:25     ` Marek Vasut
2015-12-29 23:46       ` Thomas Chou
2015-12-30  0:51         ` Marek Vasut
2015-12-30  4:02           ` Thomas Chou
2015-12-30  8:32           ` Antony Pavlov
2015-12-30  8:55             ` Marek Vasut
2015-12-30  1:35       ` Wills Wang
2015-12-30  1:46         ` Marek Vasut
2015-12-30  1:12     ` Wills Wang
2015-12-29 11:17 ` [U-Boot] [PATCH v5 5/5] mips: ath79: add AP121 reference board Wills Wang
2015-12-29 19:27   ` Daniel Schwierzeck
2015-12-30  6:31     ` Wills Wang

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=5682CC2C.5070605@gmail.com \
    --to=daniel.schwierzeck@gmail.com \
    --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