linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/9] ARM: pxa: enable sparsemem in saarb
Date: Fri, 1 Apr 2011 19:31:09 +0100	[thread overview]
Message-ID: <20110401183109.GA8482@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1301625568-16583-2-git-send-email-haojian.zhuang@marvell.com>

On Fri, Apr 01, 2011 at 10:39:21AM +0800, Haojian Zhuang wrote:
> Make sparsemem to support 512MB low memory with two banks in SAARB.
> 
> Change-Id: I1688dde366b5f3b13b48b7167bf6b88afc4f9a92
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> ---
>  arch/arm/mach-pxa/Kconfig               |    1 +
>  arch/arm/mach-pxa/include/mach/memory.h |   36 ++++++++++++++++++++++++++++++-
>  2 files changed, 36 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> index 2fc9f94..e8615ee 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -53,6 +53,7 @@ config MACH_SAAR
>  config MACH_SAARB
>  	bool "PXA955 Handheld Platform (aka SAARB)"
>  	select CPU_PXA955
> +	select ARCH_SPARSEMEM_ENABLE
>  
>  comment "Third Party Dev Platforms (sorted by vendor name)"
>  
> diff --git a/arch/arm/mach-pxa/include/mach/memory.h b/arch/arm/mach-pxa/include/mach/memory.h
> index 92361a6..9a3f265 100644
> --- a/arch/arm/mach-pxa/include/mach/memory.h
> +++ b/arch/arm/mach-pxa/include/mach/memory.h
> @@ -3,6 +3,7 @@
>   *
>   * Author:	Nicolas Pitre
>   * Copyright:	(C) 2001 MontaVista Software Inc.
> + * Copyright:	(C) 2010 Marvell Semiconductor Inc.
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
> @@ -27,4 +28,37 @@ void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
>  #define MAX_DMA_ADDRESS		(PAGE_OFFSET + SZ_64M)
>  #endif
>  
> -#endif
> +
> +#ifdef CONFIG_SPARSEMEM
> +
> +#if defined(CONFIG_MACH_SAARB) || defined(CONFIG_MACH_SAARB_MG1)
> +/*
> + * There're two DRAM banks in PXA955 Saarb board.
> + *
> + * The macros below define sections with 256MB size and a non-linear virtual to
> + * physical mapping:
> + *
> + * node 0: 0x80000000-0x8fffffff -> 0xc0000000-0xcfffffff
> + * node 1: 0xc0000000-0xcfffffff -> 0xd0000000-0xdfffffff
> + *
> + * Since DRAM can be wrapped, 0xa0000000 equals to 0x80000000.
> + */
> +#define MAX_PHYSMEM_BITS	32
> +#define SECTION_SIZE_BITS	28
> +
> +/* bank page offsets */
> +#define BANK_PAGE_OFFSET	(PAGE_OFFSET + 0x10000000)
> +
> +#define __phys_to_virt(phys)						\
> +	((phys) >= 0xc0000000 ? (phys) - 0xc0000000 + BANK_PAGE_OFFSET :\
> +	 (phys) >= 0xa0000000 ? (phys) - 0xa0000000 + PAGE_OFFSET :	\
> +	 (phys) - 0x80000000 + PAGE_OFFSET)				\
> +
> +#define __virt_to_phys(virt)						\
> +	((virt) >= BANK_PAGE_OFFSET ? (virt) - BANK_PAGE_OFFSET + 0xc0000000 :\
> +	 (virt) - PAGE_OFFSET + PLAT_PHYS_OFFSET)

This immediately means that you can't use the dynamic P2V stuff on PXA,
and so PXA can't be integrated with any other platform.  Is there a reason
why you can't use highmem rather than squashing both 256MB banks into one
512MB region?

  parent reply	other threads:[~2011-04-01 18:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <040101>
2011-04-01  2:39 ` [PATCH 1/9] ARM: pxa: add clk_set_rate() Haojian Zhuang
2011-04-01  2:39   ` [PATCH 2/9] ARM: pxa: enable sparsemem in saarb Haojian Zhuang
2011-04-01  2:39     ` [PATCH 3/9] ARM: mmp: remove redundant macro definition in mfp Haojian Zhuang
2011-04-01  2:39       ` [PATCH 4/9] ARM: pxa: use gpio reset Haojian Zhuang
2011-04-01  2:39         ` [PATCH 5/9] ARM: mmp: set correct uart according to board Haojian Zhuang
2011-04-01  2:39           ` [PATCH 6/9] ARM: mmp: update the reset implementation Haojian Zhuang
2011-04-01  2:39             ` [PATCH 7/9] ARM: pxa: align NR_BUILTIN_GPIO with GPIO interrupt number Haojian Zhuang
2011-04-01  2:39               ` [PATCH 8/9] ARM: mmp: align NR_BUILTIN_GPIO with gpio " Haojian Zhuang
2011-04-01  2:39                 ` [PATCH 9/9] ARM: mmp: enable max7312 gpio expander in dkb Haojian Zhuang
2011-04-01 18:36                   ` Russell King - ARM Linux
2011-07-05  7:14                     ` Eric Miao
2011-04-01 18:35         ` [PATCH 4/9] ARM: pxa: use gpio reset Russell King - ARM Linux
2011-04-03 10:39         ` Igor Grinberg
2011-04-01  4:51       ` [PATCH 3/9] ARM: mmp: remove redundant macro definition in mfp Eric Miao
2011-04-01  5:09         ` Haojian Zhuang
2011-04-01  5:31           ` Eric Miao
2011-04-01  5:45             ` Haojian Zhuang
2011-04-01  6:47               ` Eric Miao
2011-04-01  3:45     ` [PATCH 2/9] ARM: pxa: enable sparsemem in saarb Eric Miao
2011-04-01  4:35       ` Haojian Zhuang
2011-04-01  5:10         ` Eric Miao
2011-04-01 18:33           ` Russell King - ARM Linux
2011-04-02  6:48             ` Eric Miao
2011-04-01 18:31     ` Russell King - ARM Linux [this message]
2011-04-01  3:36   ` [PATCH 1/9] ARM: pxa: add clk_set_rate() Eric Miao

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=20110401183109.GA8482@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).