diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/boot/compressed/Makefile | 6 | ||||
-rw-r--r-- | arch/sh/boot/compressed/head_32.S | 4 | ||||
-rw-r--r-- | arch/sh/include/asm/page.h | 13 | ||||
-rw-r--r-- | arch/sh/kernel/head_32.S | 5 | ||||
-rw-r--r-- | arch/sh/mm/pmb.c | 2 |
5 files changed, 24 insertions, 6 deletions
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 5d660b90943b..cfa5a087a886 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
@@ -14,10 +14,16 @@ OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o | |||
14 | # | 14 | # |
15 | # IMAGE_OFFSET is the load offset of the compression loader | 15 | # IMAGE_OFFSET is the load offset of the compression loader |
16 | # | 16 | # |
17 | ifeq ($(CONFIG_32BIT),y) | ||
18 | IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ | ||
19 | $$[$(CONFIG_MEMORY_START) + \ | ||
20 | $(CONFIG_BOOT_LINK_OFFSET)]') | ||
21 | else | ||
17 | IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ | 22 | IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ |
18 | $$[$(CONFIG_PAGE_OFFSET) + \ | 23 | $$[$(CONFIG_PAGE_OFFSET) + \ |
19 | $(KERNEL_MEMORY) + \ | 24 | $(KERNEL_MEMORY) + \ |
20 | $(CONFIG_BOOT_LINK_OFFSET)]') | 25 | $(CONFIG_BOOT_LINK_OFFSET)]') |
26 | endif | ||
21 | 27 | ||
22 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 28 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
23 | 29 | ||
diff --git a/arch/sh/boot/compressed/head_32.S b/arch/sh/boot/compressed/head_32.S index 02a30935f0b9..200c1d4f1efe 100644 --- a/arch/sh/boot/compressed/head_32.S +++ b/arch/sh/boot/compressed/head_32.S | |||
@@ -97,7 +97,11 @@ init_stack_addr: | |||
97 | decompress_kernel_addr: | 97 | decompress_kernel_addr: |
98 | .long decompress_kernel | 98 | .long decompress_kernel |
99 | kernel_start_addr: | 99 | kernel_start_addr: |
100 | #ifdef CONFIG_32BIT | ||
101 | .long ___pa(_text+PAGE_SIZE) | ||
102 | #else | ||
100 | .long _text+PAGE_SIZE | 103 | .long _text+PAGE_SIZE |
104 | #endif | ||
101 | 105 | ||
102 | .align 9 | 106 | .align 9 |
103 | fake_headers_as_bzImage: | 107 | fake_headers_as_bzImage: |
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h index d71feb359304..0152c040f6c3 100644 --- a/arch/sh/include/asm/page.h +++ b/arch/sh/include/asm/page.h | |||
@@ -128,13 +128,18 @@ typedef struct page *pgtable_t; | |||
128 | * added or subtracted as required. | 128 | * added or subtracted as required. |
129 | */ | 129 | */ |
130 | #ifdef CONFIG_PMB | 130 | #ifdef CONFIG_PMB |
131 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START) | 131 | #define ___pa(x) ((x)-PAGE_OFFSET+__MEMORY_START) |
132 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START)) | 132 | #define ___va(x) ((x)+PAGE_OFFSET-__MEMORY_START) |
133 | #else | 133 | #else |
134 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) | 134 | #define ___pa(x) ((x)-PAGE_OFFSET) |
135 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) | 135 | #define ___va(x) ((x)+PAGE_OFFSET) |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | #ifndef __ASSEMBLY__ | ||
139 | #define __pa(x) ___pa((unsigned long)x) | ||
140 | #define __va(x) (void *)___va((unsigned long)x) | ||
141 | #endif /* !__ASSEMBLY__ */ | ||
142 | |||
138 | #ifdef CONFIG_UNCACHED_MAPPING | 143 | #ifdef CONFIG_UNCACHED_MAPPING |
139 | #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start) | 144 | #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start) |
140 | #define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET) | 145 | #define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET) |
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S index 8c1fc9a9fab2..6e35f012cc03 100644 --- a/arch/sh/kernel/head_32.S +++ b/arch/sh/kernel/head_32.S | |||
@@ -131,6 +131,7 @@ ENTRY(_stext) | |||
131 | * r8 = scratch register | 131 | * r8 = scratch register |
132 | * r9 = scratch register | 132 | * r9 = scratch register |
133 | * r10 = number of PMB entries we've setup | 133 | * r10 = number of PMB entries we've setup |
134 | * r11 = scratch register | ||
134 | */ | 135 | */ |
135 | 136 | ||
136 | mov.l .LMMUCR, r1 /* Flush the TLB */ | 137 | mov.l .LMMUCR, r1 /* Flush the TLB */ |
@@ -167,8 +168,9 @@ ENTRY(_stext) | |||
167 | 168 | ||
168 | .Lvalidate_existing_mappings: | 169 | .Lvalidate_existing_mappings: |
169 | 170 | ||
171 | mov.l .LPMB_DATA_MASK, r11 | ||
170 | mov.l @r7, r8 | 172 | mov.l @r7, r8 |
171 | and r0, r8 | 173 | and r11, r8 |
172 | cmp/eq r0, r8 /* Check for valid __MEMORY_START mappings */ | 174 | cmp/eq r0, r8 /* Check for valid __MEMORY_START mappings */ |
173 | bt .Lpmb_done | 175 | bt .Lpmb_done |
174 | 176 | ||
@@ -341,6 +343,7 @@ ENTRY(stack_start) | |||
341 | #ifdef CONFIG_PMB | 343 | #ifdef CONFIG_PMB |
342 | .LPMB_ADDR: .long PMB_ADDR | 344 | .LPMB_ADDR: .long PMB_ADDR |
343 | .LPMB_DATA: .long PMB_DATA | 345 | .LPMB_DATA: .long PMB_DATA |
346 | .LPMB_DATA_MASK: .long PMB_PFN_MASK | PMB_V | ||
344 | .LFIRST_ADDR_ENTRY: .long PAGE_OFFSET | PMB_V | 347 | .LFIRST_ADDR_ENTRY: .long PAGE_OFFSET | PMB_V |
345 | .LFIRST_DATA_ENTRY: .long __MEMORY_START | PMB_V | 348 | .LFIRST_DATA_ENTRY: .long __MEMORY_START | PMB_V |
346 | .LMMUCR: .long MMUCR | 349 | .LMMUCR: .long MMUCR |
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index 3cc21933063b..c0fdc217ece5 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -681,7 +681,7 @@ static void __init pmb_merge(struct pmb_entry *head) | |||
681 | /* | 681 | /* |
682 | * The merged page size must be valid. | 682 | * The merged page size must be valid. |
683 | */ | 683 | */ |
684 | if (!pmb_size_valid(newsize)) | 684 | if (!depth || !pmb_size_valid(newsize)) |
685 | return; | 685 | return; |
686 | 686 | ||
687 | head->flags &= ~PMB_SZ_MASK; | 687 | head->flags &= ~PMB_SZ_MASK; |