From 77284600088de16f922b259a71718c919044d61f Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 3 Jan 2001 18:15:24 +0000 Subject: Re-commit 2nd set of memory map patches from Maciej. --- arch/mips/arc/memory.c | 2 +- arch/mips/ddb5476/prom.c | 31 +++------------- arch/mips/ddb5476/setup.c | 6 ---- arch/mips/galileo-boards/ev64120/setup.c | 57 +++--------------------------- arch/mips/galileo-boards/ev96100/memory.c | 22 ------------ arch/mips/galileo-boards/generic/cmdline.c | 2 +- arch/mips/galileo-boards/generic/init.c | 20 +---------- arch/mips/mips-boards/generic/cmdline.c | 2 +- 8 files changed, 12 insertions(+), 130 deletions(-) (limited to 'arch/mips') diff --git a/arch/mips/arc/memory.c b/arch/mips/arc/memory.c index 73b692e1d..26de3028b 100644 --- a/arch/mips/arc/memory.c +++ b/arch/mips/arc/memory.c @@ -124,7 +124,7 @@ void __init prom_meminit(void) size = p->pages << PAGE_SHIFT; type = prom_memtype_classify(p->type); - add_memory_region(base, pages, type); + add_memory_region(base, size, type); } } diff --git a/arch/mips/ddb5476/prom.c b/arch/mips/ddb5476/prom.c index 93c9d9014..4164bd381 100644 --- a/arch/mips/ddb5476/prom.c +++ b/arch/mips/ddb5476/prom.c @@ -15,25 +15,18 @@ #include -char arcs_cmdline[CL_SIZE]; - -extern char _end; - -#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) -#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) - +char arcs_cmdline[COMMAND_LINE_SIZE]; /* [jsun@junsun.net] PMON passes arguments in C main() style */ void __init prom_init(int argc, const char **arg) { int i; - unsigned long mem_size, free_start, free_end, start_pfn, - bootmap_size; /* arg[0] is "g", the rest is boot parameters */ arcs_cmdline[0] = '\0'; for (i = 1; i < argc; i++) { - if (strlen(arcs_cmdline) + strlen(arg[i] + 1) >= CL_SIZE) + if (strlen(arcs_cmdline) + strlen(arg[i] + 1) + >= sizeof(arcs_cmdline)) break; strcat(arcs_cmdline, arg[i]); strcat(arcs_cmdline, " "); @@ -42,23 +35,7 @@ void __init prom_init(int argc, const char **arg) mips_machgroup = MACH_GROUP_NEC_DDB; mips_machtype = MACH_NEC_DDB5476; /* 64 MB non-upgradable */ - mem_size = 64 << 20; - - free_start = PHYSADDR(PFN_ALIGN(&_end)); - free_end = mem_size; - start_pfn = PFN_UP((unsigned long) &_end); - - /* Register all the contiguous memory with the bootmem allocator - and free it. Be careful about the bootmem freemap. */ - bootmap_size = init_bootmem(start_pfn, mem_size >> PAGE_SHIFT); - - /* Free the entire available memory after the _end symbol. */ - free_start += bootmap_size; - free_bootmem(free_start, free_end - free_start); -} - -void __init prom_fixup_mem_map(unsigned long start, unsigned long end) -{ + add_memory_region(0, 64 << 20, BOOT_MEM_RAM); } void __init prom_free_prom_memory(void) diff --git a/arch/mips/ddb5476/setup.c b/arch/mips/ddb5476/setup.c index 7e0345c05..ce644a97c 100644 --- a/arch/mips/ddb5476/setup.c +++ b/arch/mips/ddb5476/setup.c @@ -246,12 +246,6 @@ void __init ddb_setup(void) } -int __init page_is_ram(unsigned long pagenr) -{ - return 1; -} - - #define USE_NILE4_SERIAL 0 #if USE_NILE4_SERIAL diff --git a/arch/mips/galileo-boards/ev64120/setup.c b/arch/mips/galileo-boards/ev64120/setup.c index a746a15e7..1031e6e38 100644 --- a/arch/mips/galileo-boards/ev64120/setup.c +++ b/arch/mips/galileo-boards/ev64120/setup.c @@ -69,7 +69,7 @@ extern struct pci_ops galileo_pci_ops; extern unsigned long mips_machgroup; -char arcs_cmdline[CL_SIZE] = { "console=ttyS0,115200 " +char arcs_cmdline[COMMAND_LINE_SIZE] = { "console=ttyS0,115200 " "root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal " "ip=192.168.1.211:192.168.1.1:::gt::" }; @@ -77,22 +77,13 @@ char arcs_cmdline[CL_SIZE] = { "console=ttyS0,115200 " //struct eeprom_parameters eeprom_param; /* - * These two functions are added because arch/mips/mm/init.c needs them - * basically they do nothing + * This function is added because arch/mips/mm/init.c needs it + * basically it does nothing */ -void __init prom_fixup_mem_map(unsigned long start, unsigned long end) -{ -} - void prom_free_prom_memory(void) { } -int /*__init*/ page_is_ram(unsigned long pagenr) -{ - return 1; -} - void (*board_time_init) (struct irqaction * irq); static unsigned char galileo_rtc_read_data(unsigned long addr) @@ -183,51 +174,11 @@ void SetUpBootInfo(int argc, char **argv, char **envp) mips_machtype = MACH_EV64120A; } -#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) -#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) - -extern int _end; - unsigned long mem_size; void __init prom_init(int a, char **b, char **c, int *d) { unsigned long free_start, free_end, start_pfn, bootmap_size; mips_machgroup = MACH_GROUP_GALILEO; - /* 32 MB */ - mem_size = 32 << 20; - mips_memory_upper = 0x81000000; - - free_start = PHYSADDR(PFN_ALIGN(&_end)); - free_end = mem_size; - start_pfn = PFN_UP((unsigned long) &_end); - - /* Register all the contiguous memory with the bootmem allocator - and free it. Be careful about the bootmem freemap. */ - bootmap_size = init_bootmem(start_pfn, mem_size >> PAGE_SHIFT); - - /* Free the entire available memory after the _end symbol. */ - free_start += bootmap_size; - free_bootmem(free_start, free_end - free_start); -} - -#if 0 -void prom_free_prom_memory(void) -{ -} - -int page_is_ram(unsigned long pagenr) -{ - if (pagenr < (mem_size >> PAGE_SHIFT)) - return 1; - return 0; -} - -void turn_on_debug_led(); - -void turn_on_debug_led() -{ -#define DEBUG_LIGHT (*(char *)0xbc080000) - DEBUG_LIGHT = 1; + add_memory_region(0, 32 << 20, BOOT_MEM_RAM); } -#endif diff --git a/arch/mips/galileo-boards/ev96100/memory.c b/arch/mips/galileo-boards/ev96100/memory.c index 1512f13ab..de045c366 100644 --- a/arch/mips/galileo-boards/ev96100/memory.c +++ b/arch/mips/galileo-boards/ev96100/memory.c @@ -48,28 +48,6 @@ * FIX ME!!! */ - -int __init page_is_ram(unsigned long pagenr) -{ - return 1; -#if 0 - if ((pagenr << PAGE_SHIFT) < mdesc[3].base + mdesc[3].size) - return 1; - - return 0; -#endif -} - - -static inline unsigned long find_max_low_pfn(void) -{ - return 0; -} - -static inline struct prom_pmemblock *find_largest_memblock(void) -{ -} - void __init prom_meminit(void) { } diff --git a/arch/mips/galileo-boards/generic/cmdline.c b/arch/mips/galileo-boards/generic/cmdline.c index f75c01979..538c075b7 100644 --- a/arch/mips/galileo-boards/generic/cmdline.c +++ b/arch/mips/galileo-boards/generic/cmdline.c @@ -29,7 +29,7 @@ extern int prom_argc; extern char **prom_argv; -char arcs_cmdline[CL_SIZE]; +char arcs_cmdline[COMMAND_LINE_SIZE]; char * __init prom_getcmdline(void) { diff --git a/arch/mips/galileo-boards/generic/init.c b/arch/mips/galileo-boards/generic/init.c index 593207bf3..e6885bc47 100644 --- a/arch/mips/galileo-boards/generic/init.c +++ b/arch/mips/galileo-boards/generic/init.c @@ -43,10 +43,6 @@ #include -extern char _end; - -#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) -#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) /* Environment variable */ typedef struct { @@ -129,8 +125,6 @@ int get_ethernet_addr(char *ethernet_addr) void __init prom_init(int argc, char **argv, char **envp, int *prom_vec) { - unsigned long mem_size, free_start, free_end, start_pfn, - bootmap_size; volatile unsigned char *uart; char ppbuf[8]; @@ -143,17 +137,5 @@ void __init prom_init(int argc, char **argv, char **envp, int *prom_vec) prom_init_cmdline(); /* 64 MB non-upgradable */ - mem_size = 64 << 20; - - free_start = PHYSADDR(PFN_ALIGN(&_end)); - free_end = mem_size; - start_pfn = PFN_UP((unsigned long) &_end); - - /* Register all the contiguous memory with the bootmem allocator - and free it. Be careful about the bootmem freemap. */ - bootmap_size = init_bootmem(start_pfn, mem_size >> PAGE_SHIFT); - - /* Free the entire available memory after the _end symbol. */ - free_start += bootmap_size; - free_bootmem(free_start, free_end - free_start); + add_memory_region(0, 64 << 20, BOOT_MEM_RAM); } diff --git a/arch/mips/mips-boards/generic/cmdline.c b/arch/mips/mips-boards/generic/cmdline.c index d88f2dac1..a33d04879 100644 --- a/arch/mips/mips-boards/generic/cmdline.c +++ b/arch/mips/mips-boards/generic/cmdline.c @@ -26,7 +26,7 @@ extern int prom_argc; extern char **prom_argv; -char arcs_cmdline[CL_SIZE]; +char arcs_cmdline[COMMAND_LINE_SIZE]; char * __init prom_getcmdline(void) { -- cgit v1.2.3