patch-2.4.10 linux/arch/sh/kernel/setup.c
Next file: linux/arch/sh/kernel/setup_7751se.c
Previous file: linux/arch/sh/kernel/rtc-aica.c
Back to the patch index
Back to the overall index
- Lines: 110
- Date:
Sat Sep 8 12:29:09 2001
- Orig file:
v2.4.9/linux/arch/sh/kernel/setup.c
- Orig date:
Tue Jul 3 17:08:18 2001
diff -u --recursive --new-file v2.4.9/linux/arch/sh/kernel/setup.c linux/arch/sh/kernel/setup.c
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.20 2000/03/05 02:44:41 gniibe Exp $
+/* $Id: setup.c,v 1.31 2001/08/23 16:36:40 dwmw2 Exp $
*
* linux/arch/sh/kernel/setup.c
*
@@ -38,7 +38,6 @@
#include <asm/system.h>
#include <asm/io.h>
#include <asm/io_generic.h>
-#include <asm/smp.h>
#include <asm/machvec.h>
#ifdef CONFIG_SH_EARLY_PRINTK
#include <asm/sh_bios.h>
@@ -48,7 +47,12 @@
* Machine setup..
*/
-struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 0, 0, };
+/*
+ * Initialize loops_per_jiffy as 10000000 (1000MIPS).
+ * This value will be used at the very early stage of serial setup.
+ * The bigger value means no problem.
+ */
+struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 10000000, };
struct screen_info screen_info;
unsigned char aux_device_present = 0xaa;
@@ -209,8 +213,7 @@
saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
- /* Default is 4Mbyte. */
- memory_end = (unsigned long)PAGE_OFFSET+0x00400000+__MEMORY_START;
+ memory_end = memory_start + __MEMORY_SIZE;
for (;;) {
/*
@@ -268,7 +271,9 @@
void __init setup_arch(char **cmdline_p)
{
+#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN)
extern struct sh_machine_vector mv_unknown;
+#endif
struct sh_machine_vector *mv = NULL;
char mv_name[MV_NAME_SIZE] = "";
unsigned long mv_io_base = 0;
@@ -356,6 +361,18 @@
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
+#ifdef CONFIG_DISCONTIGMEM
+ NODE_DATA(0)->bdata = &discontig_node_bdata[0];
+ NODE_DATA(1)->bdata = &discontig_node_bdata[1];
+
+ bootmap_size = init_bootmem_node(NODE_DATA(1),
+ PFN_UP(__MEMORY_START_2ND),
+ PFN_UP(__MEMORY_START_2ND),
+ PFN_DOWN(__MEMORY_START_2ND+__MEMORY_SIZE_2ND));
+ free_bootmem_node(NODE_DATA(1), __MEMORY_START_2ND, __MEMORY_SIZE_2ND);
+ reserve_bootmem_node(NODE_DATA(1), __MEMORY_START_2ND, bootmap_size);
+#endif
+
/*
* Find the highest page frame number we have available
*/
@@ -377,7 +394,7 @@
* is intact) must be done via bootmem_alloc().
*/
bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
- __MEMORY_START>>PAGE_SHIFT,
+ __MEMORY_START>>PAGE_SHIFT,
max_low_pfn);
/*
@@ -399,7 +416,8 @@
last_pfn = max_low_pfn;
pages = last_pfn - curr_pfn;
- free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages));
+ free_bootmem_node(NODE_DATA(0), PFN_PHYS(curr_pfn),
+ PFN_PHYS(pages));
}
/*
@@ -409,19 +427,19 @@
* case of us accidentally initializing the bootmem allocator with
* an invalid RAM area.
*/
- reserve_bootmem(__MEMORY_START+PAGE_SIZE, (PFN_PHYS(start_pfn) +
- bootmap_size + PAGE_SIZE-1) - __MEMORY_START);
+ reserve_bootmem_node(NODE_DATA(0), __MEMORY_START+PAGE_SIZE,
+ (PFN_PHYS(start_pfn)+bootmap_size+PAGE_SIZE-1)-__MEMORY_START);
/*
* reserve physical page 0 - it's a special BIOS page on many boxes,
* enabling clean reboots, SMP operation, laptop functions.
*/
- reserve_bootmem(__MEMORY_START, PAGE_SIZE);
+ reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE);
#ifdef CONFIG_BLK_DEV_INITRD
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
- reserve_bootmem(INITRD_START+__MEMORY_START, INITRD_SIZE);
+ reserve_bootmem_node(NODE_DATA(0), INITRD_START+__MEMORY_START, INITRD_SIZE);
initrd_start =
INITRD_START ? INITRD_START + PAGE_OFFSET + __MEMORY_START : 0;
initrd_end = initrd_start + INITRD_SIZE;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)