diff options
author | Paul Mackerras <paulus@samba.org> | 2005-11-07 19:14:20 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-07 19:14:20 -0500 |
commit | 24bfb00123e82a2e70bd115277d922438813515b (patch) | |
tree | 27328b8a5718e16d64e2d101f4b7ddcad5930aed /arch/sh | |
parent | c6135234550ed89a6fd0e8cb229633967e41d649 (diff) | |
parent | 3f00d3e8fb963968a922d821a9a53b503b687e81 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/Kconfig | 28 | ||||
-rw-r--r-- | arch/sh/Makefile | 8 | ||||
-rw-r--r-- | arch/sh/drivers/Makefile | 5 | ||||
-rw-r--r-- | arch/sh/drivers/superhyway/Makefile | 6 | ||||
-rw-r--r-- | arch/sh/drivers/superhyway/ops-sh4-202.c | 171 | ||||
-rw-r--r-- | arch/sh/kernel/ptrace.c | 44 | ||||
-rw-r--r-- | arch/sh/kernel/setup.c | 26 | ||||
-rw-r--r-- | arch/sh/mm/init.c | 21 | ||||
-rw-r--r-- | arch/sh/mm/tlb-sh3.c | 19 | ||||
-rw-r--r-- | arch/sh/ramdisk/Makefile | 20 | ||||
-rw-r--r-- | arch/sh/ramdisk/ld.script | 9 |
11 files changed, 203 insertions, 154 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 3e804c736e64..64f5ae0ff96d 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -490,16 +490,6 @@ config CPU_SUBTYPE_ST40 | |||
490 | depends on CPU_SUBTYPE_ST40STB1 || CPU_SUBTYPE_ST40GX1 | 490 | depends on CPU_SUBTYPE_ST40STB1 || CPU_SUBTYPE_ST40GX1 |
491 | default y | 491 | default y |
492 | 492 | ||
493 | config ARCH_DISCONTIGMEM_ENABLE | ||
494 | bool | ||
495 | depends on SH_HP690 | ||
496 | default y | ||
497 | help | ||
498 | Say Y to upport efficient handling of discontiguous physical memory, | ||
499 | for architectures which are either NUMA (Non-Uniform Memory Access) | ||
500 | or have huge holes in the physical address space for other reasons. | ||
501 | See <file:Documentation/vm/numa> for more. | ||
502 | |||
503 | source "mm/Kconfig" | 493 | source "mm/Kconfig" |
504 | 494 | ||
505 | config ZERO_PAGE_OFFSET | 495 | config ZERO_PAGE_OFFSET |
@@ -770,24 +760,6 @@ source "fs/Kconfig.binfmt" | |||
770 | 760 | ||
771 | endmenu | 761 | endmenu |
772 | 762 | ||
773 | menu "SH initrd options" | ||
774 | depends on BLK_DEV_INITRD | ||
775 | |||
776 | config EMBEDDED_RAMDISK | ||
777 | bool "Embed root filesystem ramdisk into the kernel" | ||
778 | |||
779 | config EMBEDDED_RAMDISK_IMAGE | ||
780 | string "Filename of gziped ramdisk image" | ||
781 | depends on EMBEDDED_RAMDISK | ||
782 | default "ramdisk.gz" | ||
783 | help | ||
784 | This is the filename of the ramdisk image to be built into the | ||
785 | kernel. Relative pathnames are relative to arch/sh/ramdisk/. | ||
786 | The ramdisk image is not part of the kernel distribution; you must | ||
787 | provide one yourself. | ||
788 | |||
789 | endmenu | ||
790 | |||
791 | source "net/Kconfig" | 763 | source "net/Kconfig" |
792 | 764 | ||
793 | source "drivers/Kconfig" | 765 | source "drivers/Kconfig" |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 4a3049080b41..67192d6b00d8 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -60,14 +60,6 @@ LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) | |||
60 | 60 | ||
61 | core-y += arch/sh/kernel/ arch/sh/mm/ | 61 | core-y += arch/sh/kernel/ arch/sh/mm/ |
62 | 62 | ||
63 | # | ||
64 | # ramdisk/initrd support | ||
65 | # You need a compressed ramdisk image, named | ||
66 | # CONFIG_EMBEDDED_RAMDISK_IMAGE. Relative pathnames | ||
67 | # are relative to arch/sh/ramdisk/. | ||
68 | # | ||
69 | core-$(CONFIG_EMBEDDED_RAMDISK) += arch/sh/ramdisk/ | ||
70 | |||
71 | # Boards | 63 | # Boards |
72 | machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x | 64 | machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x |
73 | machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 | 65 | machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 |
diff --git a/arch/sh/drivers/Makefile b/arch/sh/drivers/Makefile index bd6726cde398..338c3729d270 100644 --- a/arch/sh/drivers/Makefile +++ b/arch/sh/drivers/Makefile | |||
@@ -2,6 +2,7 @@ | |||
2 | # Makefile for the Linux SuperH-specific device drivers. | 2 | # Makefile for the Linux SuperH-specific device drivers. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_PCI) += pci/ | 5 | obj-$(CONFIG_PCI) += pci/ |
6 | obj-$(CONFIG_SH_DMA) += dma/ | 6 | obj-$(CONFIG_SH_DMA) += dma/ |
7 | obj-$(CONFIG_SUPERHYWAY) += superhyway/ | ||
7 | 8 | ||
diff --git a/arch/sh/drivers/superhyway/Makefile b/arch/sh/drivers/superhyway/Makefile new file mode 100644 index 000000000000..5b8e0c7ca3a5 --- /dev/null +++ b/arch/sh/drivers/superhyway/Makefile | |||
@@ -0,0 +1,6 @@ | |||
1 | # | ||
2 | # Makefile for the SuperHyway specific kernel interface routines under Linux. | ||
3 | # | ||
4 | |||
5 | obj-$(CONFIG_CPU_SUBTYPE_SH4_202) += ops-sh4-202.o | ||
6 | |||
diff --git a/arch/sh/drivers/superhyway/ops-sh4-202.c b/arch/sh/drivers/superhyway/ops-sh4-202.c new file mode 100644 index 000000000000..a55c98a9052b --- /dev/null +++ b/arch/sh/drivers/superhyway/ops-sh4-202.c | |||
@@ -0,0 +1,171 @@ | |||
1 | /* | ||
2 | * arch/sh/drivers/superhyway/ops-sh4-202.c | ||
3 | * | ||
4 | * SuperHyway bus support for SH4-202 | ||
5 | * | ||
6 | * Copyright (C) 2005 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU | ||
9 | * General Public License. See the file "COPYING" in the main | ||
10 | * directory of this archive for more details. | ||
11 | */ | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/superhyway.h> | ||
15 | #include <linux/string.h> | ||
16 | #include <asm/addrspace.h> | ||
17 | #include <asm/io.h> | ||
18 | |||
19 | #define PHYS_EMI_CBLOCK P4SEGADDR(0x1ec00000) | ||
20 | #define PHYS_EMI_DBLOCK P4SEGADDR(0x08000000) | ||
21 | #define PHYS_FEMI_CBLOCK P4SEGADDR(0x1f800000) | ||
22 | #define PHYS_FEMI_DBLOCK P4SEGADDR(0x00000000) | ||
23 | |||
24 | #define PHYS_EPBR_BLOCK P4SEGADDR(0x1de00000) | ||
25 | #define PHYS_DMAC_BLOCK P4SEGADDR(0x1fa00000) | ||
26 | #define PHYS_PBR_BLOCK P4SEGADDR(0x1fc00000) | ||
27 | |||
28 | static struct resource emi_resources[] = { | ||
29 | [0] = { | ||
30 | .start = PHYS_EMI_CBLOCK, | ||
31 | .end = PHYS_EMI_CBLOCK + 0x00300000 - 1, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | [1] = { | ||
35 | .start = PHYS_EMI_DBLOCK, | ||
36 | .end = PHYS_EMI_DBLOCK + 0x08000000 - 1, | ||
37 | .flags = IORESOURCE_MEM, | ||
38 | }, | ||
39 | }; | ||
40 | |||
41 | static struct superhyway_device emi_device = { | ||
42 | .name = "emi", | ||
43 | .num_resources = ARRAY_SIZE(emi_resources), | ||
44 | .resource = emi_resources, | ||
45 | }; | ||
46 | |||
47 | static struct resource femi_resources[] = { | ||
48 | [0] = { | ||
49 | .start = PHYS_FEMI_CBLOCK, | ||
50 | .end = PHYS_FEMI_CBLOCK + 0x00100000 - 1, | ||
51 | .flags = IORESOURCE_MEM, | ||
52 | }, | ||
53 | [1] = { | ||
54 | .start = PHYS_FEMI_DBLOCK, | ||
55 | .end = PHYS_FEMI_DBLOCK + 0x08000000 - 1, | ||
56 | .flags = IORESOURCE_MEM, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static struct superhyway_device femi_device = { | ||
61 | .name = "femi", | ||
62 | .num_resources = ARRAY_SIZE(femi_resources), | ||
63 | .resource = femi_resources, | ||
64 | }; | ||
65 | |||
66 | static struct resource epbr_resources[] = { | ||
67 | [0] = { | ||
68 | .start = P4SEGADDR(0x1e7ffff8), | ||
69 | .end = P4SEGADDR(0x1e7ffff8 + (sizeof(u32) * 2) - 1), | ||
70 | .flags = IORESOURCE_MEM, | ||
71 | }, | ||
72 | [1] = { | ||
73 | .start = PHYS_EPBR_BLOCK, | ||
74 | .end = PHYS_EPBR_BLOCK + 0x00a00000 - 1, | ||
75 | .flags = IORESOURCE_MEM, | ||
76 | }, | ||
77 | }; | ||
78 | |||
79 | static struct superhyway_device epbr_device = { | ||
80 | .name = "epbr", | ||
81 | .num_resources = ARRAY_SIZE(epbr_resources), | ||
82 | .resource = epbr_resources, | ||
83 | }; | ||
84 | |||
85 | static struct resource dmac_resource = { | ||
86 | .start = PHYS_DMAC_BLOCK, | ||
87 | .end = PHYS_DMAC_BLOCK + 0x00100000 - 1, | ||
88 | .flags = IORESOURCE_MEM, | ||
89 | }; | ||
90 | |||
91 | static struct superhyway_device dmac_device = { | ||
92 | .name = "dmac", | ||
93 | .num_resources = 1, | ||
94 | .resource = &dmac_resource, | ||
95 | }; | ||
96 | |||
97 | static struct resource pbr_resources[] = { | ||
98 | [0] = { | ||
99 | .start = P4SEGADDR(0x1ffffff8), | ||
100 | .end = P4SEGADDR(0x1ffffff8 + (sizeof(u32) * 2) - 1), | ||
101 | .flags = IORESOURCE_MEM, | ||
102 | }, | ||
103 | [1] = { | ||
104 | .start = PHYS_PBR_BLOCK, | ||
105 | .end = PHYS_PBR_BLOCK + 0x00400000 - (sizeof(u32) * 2) - 1, | ||
106 | .flags = IORESOURCE_MEM, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | static struct superhyway_device pbr_device = { | ||
111 | .name = "pbr", | ||
112 | .num_resources = ARRAY_SIZE(pbr_resources), | ||
113 | .resource = pbr_resources, | ||
114 | }; | ||
115 | |||
116 | static struct superhyway_device *sh4202_devices[] __initdata = { | ||
117 | &emi_device, &femi_device, &epbr_device, &dmac_device, &pbr_device, | ||
118 | }; | ||
119 | |||
120 | static int sh4202_read_vcr(unsigned long base, struct superhyway_vcr_info *vcr) | ||
121 | { | ||
122 | u32 vcrh, vcrl; | ||
123 | u64 tmp; | ||
124 | |||
125 | /* | ||
126 | * XXX: Even though the SH4-202 Evaluation Device documentation | ||
127 | * indicates that VCRL is mapped first with VCRH at a + 0x04 | ||
128 | * offset, the opposite seems to be true. | ||
129 | * | ||
130 | * Some modules (PBR and ePBR for instance) also appear to have | ||
131 | * VCRL/VCRH flipped in the documentation, but on the SH4-202 | ||
132 | * itself it appears that these are all consistently mapped with | ||
133 | * VCRH preceeding VCRL. | ||
134 | * | ||
135 | * Do not trust the documentation, for it is evil. | ||
136 | */ | ||
137 | vcrh = ctrl_inl(base); | ||
138 | vcrl = ctrl_inl(base + sizeof(u32)); | ||
139 | |||
140 | tmp = ((u64)vcrh << 32) | vcrl; | ||
141 | memcpy(vcr, &tmp, sizeof(u64)); | ||
142 | |||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | static int sh4202_write_vcr(unsigned long base, struct superhyway_vcr_info vcr) | ||
147 | { | ||
148 | u64 tmp = *(u64 *)&vcr; | ||
149 | |||
150 | ctrl_outl((tmp >> 32) & 0xffffffff, base); | ||
151 | ctrl_outl(tmp & 0xffffffff, base + sizeof(u32)); | ||
152 | |||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static struct superhyway_ops sh4202_superhyway_ops = { | ||
157 | .read_vcr = sh4202_read_vcr, | ||
158 | .write_vcr = sh4202_write_vcr, | ||
159 | }; | ||
160 | |||
161 | struct superhyway_bus superhyway_channels[] = { | ||
162 | { &sh4202_superhyway_ops, }, | ||
163 | { 0, }, | ||
164 | }; | ||
165 | |||
166 | int __init superhyway_scan_bus(struct superhyway_bus *bus) | ||
167 | { | ||
168 | return superhyway_add_devices(bus, sh4202_devices, | ||
169 | ARRAY_SIZE(sh4202_devices)); | ||
170 | } | ||
171 | |||
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index 1fbe5a428e31..1a8be06519ec 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c | |||
@@ -80,48 +80,11 @@ void ptrace_disable(struct task_struct *child) | |||
80 | /* nothing to do.. */ | 80 | /* nothing to do.. */ |
81 | } | 81 | } |
82 | 82 | ||
83 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | 83 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
84 | { | 84 | { |
85 | struct task_struct *child; | ||
86 | struct user * dummy = NULL; | 85 | struct user * dummy = NULL; |
87 | int ret; | 86 | int ret; |
88 | 87 | ||
89 | lock_kernel(); | ||
90 | ret = -EPERM; | ||
91 | if (request == PTRACE_TRACEME) { | ||
92 | /* are we already being traced? */ | ||
93 | if (current->ptrace & PT_PTRACED) | ||
94 | goto out; | ||
95 | ret = security_ptrace(current->parent, current); | ||
96 | if (ret) | ||
97 | goto out; | ||
98 | /* set the ptrace bit in the process flags. */ | ||
99 | current->ptrace |= PT_PTRACED; | ||
100 | ret = 0; | ||
101 | goto out; | ||
102 | } | ||
103 | ret = -ESRCH; | ||
104 | read_lock(&tasklist_lock); | ||
105 | child = find_task_by_pid(pid); | ||
106 | if (child) | ||
107 | get_task_struct(child); | ||
108 | read_unlock(&tasklist_lock); | ||
109 | if (!child) | ||
110 | goto out; | ||
111 | |||
112 | ret = -EPERM; | ||
113 | if (pid == 1) /* you may not mess with init */ | ||
114 | goto out_tsk; | ||
115 | |||
116 | if (request == PTRACE_ATTACH) { | ||
117 | ret = ptrace_attach(child); | ||
118 | goto out_tsk; | ||
119 | } | ||
120 | |||
121 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | ||
122 | if (ret < 0) | ||
123 | goto out_tsk; | ||
124 | |||
125 | switch (request) { | 88 | switch (request) { |
126 | /* when I and D space are separate, these will need to be fixed. */ | 89 | /* when I and D space are separate, these will need to be fixed. */ |
127 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | 90 | case PTRACE_PEEKTEXT: /* read word at location addr. */ |
@@ -289,10 +252,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | |||
289 | ret = ptrace_request(child, request, addr, data); | 252 | ret = ptrace_request(child, request, addr, data); |
290 | break; | 253 | break; |
291 | } | 254 | } |
292 | out_tsk: | 255 | |
293 | put_task_struct(child); | ||
294 | out: | ||
295 | unlock_kernel(); | ||
296 | return ret; | 256 | return ret; |
297 | } | 257 | } |
298 | 258 | ||
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 25b9d9ebe858..036050b377cd 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -83,9 +83,9 @@ static struct sh_machine_vector* __init get_mv_byname(const char* name); | |||
83 | /* ... */ | 83 | /* ... */ |
84 | #define COMMAND_LINE ((char *) (PARAM+0x100)) | 84 | #define COMMAND_LINE ((char *) (PARAM+0x100)) |
85 | 85 | ||
86 | #define RAMDISK_IMAGE_START_MASK 0x07FF | 86 | #define RAMDISK_IMAGE_START_MASK 0x07FF |
87 | #define RAMDISK_PROMPT_FLAG 0x8000 | 87 | #define RAMDISK_PROMPT_FLAG 0x8000 |
88 | #define RAMDISK_LOAD_FLAG 0x4000 | 88 | #define RAMDISK_LOAD_FLAG 0x4000 |
89 | 89 | ||
90 | static char command_line[COMMAND_LINE_SIZE] = { 0, }; | 90 | static char command_line[COMMAND_LINE_SIZE] = { 0, }; |
91 | 91 | ||
@@ -284,18 +284,6 @@ void __init setup_arch(char **cmdline_p) | |||
284 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | 284 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) |
285 | #define PFN_PHYS(x) ((x) << PAGE_SHIFT) | 285 | #define PFN_PHYS(x) ((x) << PAGE_SHIFT) |
286 | 286 | ||
287 | #ifdef CONFIG_DISCONTIGMEM | ||
288 | NODE_DATA(0)->bdata = &discontig_node_bdata[0]; | ||
289 | NODE_DATA(1)->bdata = &discontig_node_bdata[1]; | ||
290 | |||
291 | bootmap_size = init_bootmem_node(NODE_DATA(1), | ||
292 | PFN_UP(__MEMORY_START_2ND), | ||
293 | PFN_UP(__MEMORY_START_2ND), | ||
294 | PFN_DOWN(__MEMORY_START_2ND+__MEMORY_SIZE_2ND)); | ||
295 | free_bootmem_node(NODE_DATA(1), __MEMORY_START_2ND, __MEMORY_SIZE_2ND); | ||
296 | reserve_bootmem_node(NODE_DATA(1), __MEMORY_START_2ND, bootmap_size); | ||
297 | #endif | ||
298 | |||
299 | /* | 287 | /* |
300 | * Find the highest page frame number we have available | 288 | * Find the highest page frame number we have available |
301 | */ | 289 | */ |
@@ -306,10 +294,10 @@ void __init setup_arch(char **cmdline_p) | |||
306 | */ | 294 | */ |
307 | max_low_pfn = max_pfn; | 295 | max_low_pfn = max_pfn; |
308 | 296 | ||
309 | /* | 297 | /* |
310 | * Partially used pages are not usable - thus | 298 | * Partially used pages are not usable - thus |
311 | * we are rounding upwards: | 299 | * we are rounding upwards: |
312 | */ | 300 | */ |
313 | start_pfn = PFN_UP(__pa(_end)); | 301 | start_pfn = PFN_UP(__pa(_end)); |
314 | 302 | ||
315 | /* | 303 | /* |
@@ -360,12 +348,12 @@ void __init setup_arch(char **cmdline_p) | |||
360 | reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE); | 348 | reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE); |
361 | 349 | ||
362 | #ifdef CONFIG_BLK_DEV_INITRD | 350 | #ifdef CONFIG_BLK_DEV_INITRD |
363 | ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); | 351 | ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); |
364 | if (&__rd_start != &__rd_end) { | 352 | if (&__rd_start != &__rd_end) { |
365 | LOADER_TYPE = 1; | 353 | LOADER_TYPE = 1; |
366 | INITRD_START = PHYSADDR((unsigned long)&__rd_start) - __MEMORY_START; | 354 | INITRD_START = PHYSADDR((unsigned long)&__rd_start) - __MEMORY_START; |
367 | INITRD_SIZE = (unsigned long)&__rd_end - (unsigned long)&__rd_start; | 355 | INITRD_SIZE = (unsigned long)&__rd_end - (unsigned long)&__rd_start; |
368 | } | 356 | } |
369 | 357 | ||
370 | if (LOADER_TYPE && INITRD_START) { | 358 | if (LOADER_TYPE && INITRD_START) { |
371 | if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { | 359 | if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { |
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 4e9c854845a4..e342565f75fb 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -51,11 +51,6 @@ unsigned long mmu_context_cache = NO_CONTEXT; | |||
51 | #define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn) | 51 | #define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn) |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #ifdef CONFIG_DISCONTIGMEM | ||
55 | pg_data_t discontig_page_data[MAX_NUMNODES]; | ||
56 | bootmem_data_t discontig_node_bdata[MAX_NUMNODES]; | ||
57 | #endif | ||
58 | |||
59 | void (*copy_page)(void *from, void *to); | 54 | void (*copy_page)(void *from, void *to); |
60 | void (*clear_page)(void *to); | 55 | void (*clear_page)(void *to); |
61 | 56 | ||
@@ -216,15 +211,6 @@ void __init paging_init(void) | |||
216 | #endif | 211 | #endif |
217 | NODE_DATA(0)->node_mem_map = NULL; | 212 | NODE_DATA(0)->node_mem_map = NULL; |
218 | free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0); | 213 | free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0); |
219 | |||
220 | #ifdef CONFIG_DISCONTIGMEM | ||
221 | /* | ||
222 | * And for discontig, do some more fixups on the zone sizes.. | ||
223 | */ | ||
224 | zones_size[ZONE_DMA] = __MEMORY_SIZE_2ND >> PAGE_SHIFT; | ||
225 | zones_size[ZONE_NORMAL] = 0; | ||
226 | free_area_init_node(1, NODE_DATA(1), zones_size, __MEMORY_START_2ND >> PAGE_SHIFT, 0); | ||
227 | #endif | ||
228 | } | 214 | } |
229 | 215 | ||
230 | void __init mem_init(void) | 216 | void __init mem_init(void) |
@@ -248,7 +234,7 @@ void __init mem_init(void) | |||
248 | memset(empty_zero_page, 0, PAGE_SIZE); | 234 | memset(empty_zero_page, 0, PAGE_SIZE); |
249 | __flush_wback_region(empty_zero_page, PAGE_SIZE); | 235 | __flush_wback_region(empty_zero_page, PAGE_SIZE); |
250 | 236 | ||
251 | /* | 237 | /* |
252 | * Setup wrappers for copy/clear_page(), these will get overridden | 238 | * Setup wrappers for copy/clear_page(), these will get overridden |
253 | * later in the boot process if a better method is available. | 239 | * later in the boot process if a better method is available. |
254 | */ | 240 | */ |
@@ -257,9 +243,6 @@ void __init mem_init(void) | |||
257 | 243 | ||
258 | /* this will put all low memory onto the freelists */ | 244 | /* this will put all low memory onto the freelists */ |
259 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); | 245 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); |
260 | #ifdef CONFIG_DISCONTIGMEM | ||
261 | totalram_pages += free_all_bootmem_node(NODE_DATA(1)); | ||
262 | #endif | ||
263 | reservedpages = 0; | 246 | reservedpages = 0; |
264 | for (tmp = 0; tmp < num_physpages; tmp++) | 247 | for (tmp = 0; tmp < num_physpages; tmp++) |
265 | /* | 248 | /* |
@@ -286,7 +269,7 @@ void __init mem_init(void) | |||
286 | void free_initmem(void) | 269 | void free_initmem(void) |
287 | { | 270 | { |
288 | unsigned long addr; | 271 | unsigned long addr; |
289 | 272 | ||
290 | addr = (unsigned long)(&__init_begin); | 273 | addr = (unsigned long)(&__init_begin); |
291 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { | 274 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { |
292 | ClearPageReserved(virt_to_page(addr)); | 275 | ClearPageReserved(virt_to_page(addr)); |
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c index 7a0d5c10bf20..46b09e26e082 100644 --- a/arch/sh/mm/tlb-sh3.c +++ b/arch/sh/mm/tlb-sh3.c | |||
@@ -40,12 +40,17 @@ void update_mmu_cache(struct vm_area_struct * vma, | |||
40 | return; | 40 | return; |
41 | 41 | ||
42 | #if defined(CONFIG_SH7705_CACHE_32KB) | 42 | #if defined(CONFIG_SH7705_CACHE_32KB) |
43 | struct page *page; | 43 | { |
44 | page = pte_page(pte); | 44 | struct page *page = pte_page(pte); |
45 | if (VALID_PAGE(page) && !test_bit(PG_mapped, &page->flags)) { | 45 | unsigned long pfn = pte_pfn(pte); |
46 | unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; | 46 | |
47 | __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); | 47 | if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) { |
48 | __set_bit(PG_mapped, &page->flags); | 48 | unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; |
49 | |||
50 | __flush_wback_region((void *)P1SEGADDR(phys), | ||
51 | PAGE_SIZE); | ||
52 | __set_bit(PG_mapped, &page->flags); | ||
53 | } | ||
49 | } | 54 | } |
50 | #endif | 55 | #endif |
51 | 56 | ||
@@ -80,7 +85,7 @@ void __flush_tlb_page(unsigned long asid, unsigned long page) | |||
80 | */ | 85 | */ |
81 | addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000); | 86 | addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000); |
82 | data = (page & 0xfffe0000) | asid; /* VALID bit is off */ | 87 | data = (page & 0xfffe0000) | asid; /* VALID bit is off */ |
83 | 88 | ||
84 | if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) { | 89 | if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) { |
85 | addr |= MMU_PAGE_ASSOC_BIT; | 90 | addr |= MMU_PAGE_ASSOC_BIT; |
86 | ways = 1; /* we already know the way .. */ | 91 | ways = 1; /* we already know the way .. */ |
diff --git a/arch/sh/ramdisk/Makefile b/arch/sh/ramdisk/Makefile deleted file mode 100644 index 99e1c68673cf..000000000000 --- a/arch/sh/ramdisk/Makefile +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for a ramdisk image | ||
3 | # | ||
4 | |||
5 | obj-y += ramdisk.o | ||
6 | |||
7 | |||
8 | O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32) | ||
9 | img := $(subst ",,$(CONFIG_EMBEDDED_RAMDISK_IMAGE)) | ||
10 | # add $(src) when $(img) is relative | ||
11 | img := $(subst $(src)//,/,$(src)/$(img)) | ||
12 | |||
13 | quiet_cmd_ramdisk = LD $@ | ||
14 | define cmd_ramdisk | ||
15 | $(LD) -T $(srctree)/$(src)/ld.script -b binary --oformat $(O_FORMAT) \ | ||
16 | -o $@ $(img) | ||
17 | endef | ||
18 | |||
19 | $(obj)/ramdisk.o: $(img) $(srctree)/$(src)/ld.script | ||
20 | $(call cmd,ramdisk) | ||
diff --git a/arch/sh/ramdisk/ld.script b/arch/sh/ramdisk/ld.script deleted file mode 100644 index 94beee248c04..000000000000 --- a/arch/sh/ramdisk/ld.script +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | OUTPUT_ARCH(sh) | ||
2 | SECTIONS | ||
3 | { | ||
4 | .initrd : | ||
5 | { | ||
6 | *(.data) | ||
7 | } | ||
8 | } | ||
9 | |||