diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2008-08-26 01:45:37 -0400 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2008-08-26 01:45:37 -0400 |
| commit | 94d4ac2f4a58c6e37876827c6688c61cef21290c (patch) | |
| tree | 732f4e4794f3c116041242f69754637f75c0dd57 /arch/sh/mm | |
| parent | ed21763e7b0b3fb50e4efd9d4bc17ef5b035d304 (diff) | |
| parent | 08970fc4e0385790a7b093adfaa4165a189f9eb0 (diff) | |
Merge branch 'x86/urgent' into x86/cleanups
Diffstat (limited to 'arch/sh/mm')
| -rw-r--r-- | arch/sh/mm/Kconfig | 2 | ||||
| -rw-r--r-- | arch/sh/mm/consistent.c | 27 |
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 9c131cac91a4..8a03926ea84f 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
| @@ -181,10 +181,12 @@ config ENTRY_OFFSET | |||
| 181 | choice | 181 | choice |
| 182 | prompt "HugeTLB page size" | 182 | prompt "HugeTLB page size" |
| 183 | depends on HUGETLB_PAGE && (CPU_SH4 || CPU_SH5) && MMU | 183 | depends on HUGETLB_PAGE && (CPU_SH4 || CPU_SH5) && MMU |
| 184 | default HUGETLB_PAGE_SIZE_1MB if PAGE_SIZE_64KB | ||
| 184 | default HUGETLB_PAGE_SIZE_64K | 185 | default HUGETLB_PAGE_SIZE_64K |
| 185 | 186 | ||
| 186 | config HUGETLB_PAGE_SIZE_64K | 187 | config HUGETLB_PAGE_SIZE_64K |
| 187 | bool "64kB" | 188 | bool "64kB" |
| 189 | depends on !PAGE_SIZE_64KB | ||
| 188 | 190 | ||
| 189 | config HUGETLB_PAGE_SIZE_256K | 191 | config HUGETLB_PAGE_SIZE_256K |
| 190 | bool "256kB" | 192 | bool "256kB" |
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index b2ce014401b5..895bb3f335c7 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
| @@ -95,6 +95,29 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
| 95 | } | 95 | } |
| 96 | EXPORT_SYMBOL(dma_cache_sync); | 96 | EXPORT_SYMBOL(dma_cache_sync); |
| 97 | 97 | ||
| 98 | static int __init memchunk_setup(char *str) | ||
| 99 | { | ||
| 100 | return 1; /* accept anything that begins with "memchunk." */ | ||
| 101 | } | ||
| 102 | __setup("memchunk.", memchunk_setup); | ||
| 103 | |||
| 104 | static void memchunk_cmdline_override(char *name, unsigned long *sizep) | ||
| 105 | { | ||
| 106 | char *p = boot_command_line; | ||
| 107 | int k = strlen(name); | ||
| 108 | |||
| 109 | while ((p = strstr(p, "memchunk."))) { | ||
| 110 | p += 9; /* strlen("memchunk.") */ | ||
| 111 | if (!strncmp(name, p, k) && p[k] == '=') { | ||
| 112 | p += k + 1; | ||
| 113 | *sizep = memparse(p, NULL); | ||
| 114 | pr_info("%s: forcing memory chunk size to 0x%08lx\n", | ||
| 115 | name, *sizep); | ||
| 116 | break; | ||
| 117 | } | ||
| 118 | } | ||
| 119 | } | ||
| 120 | |||
| 98 | int platform_resource_setup_memory(struct platform_device *pdev, | 121 | int platform_resource_setup_memory(struct platform_device *pdev, |
| 99 | char *name, unsigned long memsize) | 122 | char *name, unsigned long memsize) |
| 100 | { | 123 | { |
| @@ -109,6 +132,10 @@ int platform_resource_setup_memory(struct platform_device *pdev, | |||
| 109 | return -EINVAL; | 132 | return -EINVAL; |
| 110 | } | 133 | } |
| 111 | 134 | ||
| 135 | memchunk_cmdline_override(name, &memsize); | ||
| 136 | if (!memsize) | ||
| 137 | return 0; | ||
| 138 | |||
| 112 | buf = dma_alloc_coherent(NULL, memsize, &dma_handle, GFP_KERNEL); | 139 | buf = dma_alloc_coherent(NULL, memsize, &dma_handle, GFP_KERNEL); |
| 113 | if (!buf) { | 140 | if (!buf) { |
| 114 | pr_warning("%s: unable to allocate memory\n", name); | 141 | pr_warning("%s: unable to allocate memory\n", name); |
