diff options
-rw-r--r-- | arch/powerpc/Kconfig | 16 | ||||
-rw-r--r-- | 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 b408e352198c..8782b4b689a7 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -730,6 +730,22 @@ config LOWMEM_SIZE | |||
730 | hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL | 730 | hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL |
731 | default "0x30000000" | 731 | default "0x30000000" |
732 | 732 | ||
733 | config LOWMEM_CAM_NUM_BOOL | ||
734 | bool "Set number of CAMs to use to map low memory" | ||
735 | depends on ADVANCED_OPTIONS && FSL_BOOKE | ||
736 | help | ||
737 | This option allows you to set the maximum number of CAM slots that | ||
738 | will be used to map low memory. There are a limited number of slots | ||
739 | available and even more limited number that will fit in the L1 MMU. | ||
740 | However, using more entries will allow mapping more low memory. This | ||
741 | can be useful in optimizing the layout of kernel virtual memory. | ||
742 | |||
743 | Say N here unless you know what you are doing. | ||
744 | |||
745 | config LOWMEM_CAM_NUM | ||
746 | int "Number of CAMs to use to map low memory" if LOWMEM_CAM_NUM_BOOL | ||
747 | default 3 | ||
748 | |||
733 | config RELOCATABLE | 749 | config RELOCATABLE |
734 | bool "Build a relocatable kernel (EXPERIMENTAL)" | 750 | bool "Build a relocatable kernel (EXPERIMENTAL)" |
735 | depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE | 751 | 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 dfd292748e6e..0b9ba6be49d9 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c | |||
@@ -56,10 +56,14 @@ | |||
56 | 56 | ||
57 | extern void loadcam_entry(unsigned int index); | 57 | extern void loadcam_entry(unsigned int index); |
58 | unsigned int tlbcam_index; | 58 | unsigned int tlbcam_index; |
59 | static unsigned long cam[3]; | 59 | static unsigned long cam[CONFIG_LOWMEM_CAM_NUM]; |
60 | 60 | ||
61 | #define NUM_TLBCAMS (16) | 61 | #define NUM_TLBCAMS (16) |
62 | 62 | ||
63 | #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS) | ||
64 | #error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS" | ||
65 | #endif | ||
66 | |||
63 | struct tlbcam TLBCAM[NUM_TLBCAMS]; | 67 | struct tlbcam TLBCAM[NUM_TLBCAMS]; |
64 | 68 | ||
65 | struct tlbcamrange { | 69 | struct tlbcamrange { |