linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@freescale.com>
To: linuxppc-dev@ozlabs.org
Cc: Trent Piepho <tpiepho@freescale.com>
Subject: [PATCH 4/5] powerpc: booke: Make CAM entries used for lowmem configurable
Date: Mon,  8 Dec 2008 19:34:58 -0800	[thread overview]
Message-ID: <1228793699-23110-4-git-send-email-tpiepho@freescale.com> (raw)
In-Reply-To: <1228793699-23110-1-git-send-email-tpiepho@freescale.com>

On booke processors, the code that maps low memory only uses up to three
CAM entries, even though there are sixteen and nothing else uses them.

Make this number configurable in the advanced options menu along with max
low memory size.  If one wants 1 GB of lowmem, then it's typically
necessary to have four CAM entries.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
---
 arch/powerpc/Kconfig            |   16 ++++++++++++++++
 arch/powerpc/mm/fsl_booke_mmu.c |    6 +++++-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index be4f99b..2bb645c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -696,6 +696,22 @@ config LOWMEM_SIZE
 	hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
 	default "0x30000000"
 
+config LOWMEM_CAM_NUM_BOOL
+	bool "Set number of CAMs to use to map low memory"
+	depends on ADVANCED_OPTIONS && FSL_BOOKE
+	help
+	  This option allows you to set the maximum number of CAM slots that
+	  will be used to map low memory.  There are a limited number of slots
+	  available and even more limited number that will fit in the L1 MMU.
+	  However, using more entries will allow mapping more low memory.  This
+	  can be useful in optimizing the layout of kernel virtual memory.
+
+	  Say N here unless you know what you are doing.
+
+config LOWMEM_CAM_NUM
+	int "Number of CAMs to use to map low memory" if LOWMEM_CAM_NUM_BOOL
+	default 3
+
 config RELOCATABLE
 	bool "Build a relocatable kernel (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 1dabe1a..73aa9b7 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -56,10 +56,14 @@
 
 extern void loadcam_entry(unsigned int index);
 unsigned int tlbcam_index;
-static unsigned long cam[3];
+static unsigned long cam[CONFIG_LOWMEM_CAM_NUM];
 
 #define NUM_TLBCAMS	(16)
 
+#if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)
+#error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS"
+#endif
+
 struct tlbcam TLBCAM[NUM_TLBCAMS];
 
 struct tlbcamrange {
-- 
1.5.4.1

  parent reply	other threads:[~2008-12-09  3:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09  3:34 [PATCH 1/5] powerpc: booke: Don't hard-code size of struct tlbcam Trent Piepho
2008-12-09  3:34 ` [PATCH 2/5] powerpc: booke: Remove num_tlbcam_entries Trent Piepho
2009-01-07 16:04   ` Kumar Gala
2008-12-09  3:34 ` [PATCH 3/5] powerpc: booke: Remove code duplication in lowmem mapping Trent Piepho
2009-01-07 16:13   ` Kumar Gala
2009-01-13 15:43   ` Kumar Gala
2008-12-09  3:34 ` Trent Piepho [this message]
2009-01-13 15:43   ` [PATCH 4/5] powerpc: booke: Make CAM entries used for lowmem configurable Kumar Gala
2008-12-09  3:34 ` [PATCH 5/5] powerpc: booke: Allow larger CAM sizes than 256 MB Trent Piepho
2009-01-13 15:43   ` Kumar Gala
2008-12-09 14:26 ` [PATCH 1/5] powerpc: booke: Don't hard-code size of struct tlbcam Josh Boyer
2009-01-07 16:17   ` Kumar Gala
2009-01-07 16:03 ` Kumar Gala

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=1228793699-23110-4-git-send-email-tpiepho@freescale.com \
    --to=tpiepho@freescale.com \
    --cc=linuxppc-dev@ozlabs.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).