aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/setup.c')
-rw-r--r--arch/sh/kernel/setup.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index b749403f6b3..0b8c45d53a4 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -32,12 +32,6 @@
32#include <asm/clock.h> 32#include <asm/clock.h>
33#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
34 34
35extern void * __rd_start, * __rd_end;
36
37/*
38 * Machine setup..
39 */
40
41/* 35/*
42 * Initialize loops_per_jiffy as 10000000 (1000MIPS). 36 * Initialize loops_per_jiffy as 10000000 (1000MIPS).
43 * This value will be used at the very early stage of serial setup. 37 * This value will be used at the very early stage of serial setup.
@@ -63,33 +57,25 @@ struct screen_info screen_info;
63 57
64extern int root_mountflags; 58extern int root_mountflags;
65 59
66/*
67 * This is set up by the setup-routine at boot-time
68 */
69#define PARAM ((unsigned char *)empty_zero_page)
70
71#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
72#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
73#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008))
74#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c))
75#define INITRD_START (*(unsigned long *) (PARAM+0x010))
76#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
77/* ... */
78#define COMMAND_LINE ((char *) (PARAM+0x100))
79
80#define RAMDISK_IMAGE_START_MASK 0x07FF 60#define RAMDISK_IMAGE_START_MASK 0x07FF
81#define RAMDISK_PROMPT_FLAG 0x8000 61#define RAMDISK_PROMPT_FLAG 0x8000
82#define RAMDISK_LOAD_FLAG 0x4000 62#define RAMDISK_LOAD_FLAG 0x4000
83 63
84static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, }; 64static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, };
85 65
86static struct resource code_resource = { .name = "Kernel code", }; 66static struct resource code_resource = {
87static struct resource data_resource = { .name = "Kernel data", }; 67 .name = "Kernel code",
68 .flags = IORESOURCE_BUSY | IORESOURCE_MEM,
69};
70
71static struct resource data_resource = {
72 .name = "Kernel data",
73 .flags = IORESOURCE_BUSY | IORESOURCE_MEM,
74};
88 75
89unsigned long memory_start; 76unsigned long memory_start;
90EXPORT_SYMBOL(memory_start); 77EXPORT_SYMBOL(memory_start);
91 78unsigned long memory_end = 0;
92unsigned long memory_end;
93EXPORT_SYMBOL(memory_end); 79EXPORT_SYMBOL(memory_end);
94 80
95static int __init early_parse_mem(char *p) 81static int __init early_parse_mem(char *p)
@@ -195,14 +181,7 @@ void __init setup_bootmem_allocator(unsigned long free_pfn)
195 sparse_memory_present_with_active_regions(0); 181 sparse_memory_present_with_active_regions(0);
196 182
197#ifdef CONFIG_BLK_DEV_INITRD 183#ifdef CONFIG_BLK_DEV_INITRD
198 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); 184 ROOT_DEV = Root_RAM0;
199 if (&__rd_start != &__rd_end) {
200 LOADER_TYPE = 1;
201 INITRD_START = PHYSADDR((unsigned long)&__rd_start) -
202 __MEMORY_START;
203 INITRD_SIZE = (unsigned long)&__rd_end -
204 (unsigned long)&__rd_start;
205 }
206 185
207 if (LOADER_TYPE && INITRD_START) { 186 if (LOADER_TYPE && INITRD_START) {
208 if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { 187 if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
@@ -265,7 +244,8 @@ void __init setup_arch(char **cmdline_p)
265 data_resource.end = virt_to_phys(_edata)-1; 244 data_resource.end = virt_to_phys(_edata)-1;
266 245
267 memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; 246 memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
268 memory_end = memory_start + __MEMORY_SIZE; 247 if (!memory_end)
248 memory_end = memory_start + __MEMORY_SIZE;
269 249
270#ifdef CONFIG_CMDLINE_BOOL 250#ifdef CONFIG_CMDLINE_BOOL
271 strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line)); 251 strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line));