Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279724
b: refs/heads/master
c: 88be351
h: refs/heads/master
v: v3
  • Loading branch information
Greg Ungerer committed Dec 30, 2011
1 parent ada4401 commit 1af431e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0079fe7502b45c2dbec6d04541e637484191c393
refs/heads/master: 88be3515934004d271398129ba7145635e95127e
4 changes: 4 additions & 0 deletions trunk/arch/m68k/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ typedef struct page *pgtable_t;
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )

extern unsigned long _rambase;
extern unsigned long _ramstart;
extern unsigned long _ramend;

#endif /* !__ASSEMBLY__ */

#ifdef CONFIG_MMU
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/m68k/include/asm/page_no.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

extern unsigned long memory_start;
extern unsigned long memory_end;
extern unsigned long _rambase;
extern unsigned long _ramstart;
extern unsigned long _ramend;

#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
#define free_user_page(page, addr) free_page(addr)
Expand Down
47 changes: 47 additions & 0 deletions trunk/arch/m68k/platform/54xx/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
#include <asm/pgalloc.h>
#include <asm/machdep.h>
#include <asm/coldfire.h>
#include <asm/m54xxsim.h>
#include <asm/mcfuart.h>
#include <asm/m54xxgpt.h>
#ifdef CONFIG_MMU
#include <asm/mmu_context.h>
#endif

/***************************************************************************/

Expand Down Expand Up @@ -95,8 +101,49 @@ static void mcf54xx_reset(void)

/***************************************************************************/

#ifdef CONFIG_MMU

unsigned long num_pages;

static void __init mcf54xx_bootmem_alloc(void)
{
unsigned long start_pfn;
unsigned long memstart;

/* _rambase and _ramend will be naturally page aligned */
m68k_memory[0].addr = _rambase;
m68k_memory[0].size = _ramend - _rambase;

/* compute total pages in system */
num_pages = (_ramend - _rambase) >> PAGE_SHIFT;

/* page numbers */
memstart = PAGE_ALIGN(_ramstart);
min_low_pfn = _rambase >> PAGE_SHIFT;
start_pfn = memstart >> PAGE_SHIFT;
max_low_pfn = _ramend >> PAGE_SHIFT;
high_memory = (void *)_ramend;

m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
module_fixup(NULL, __start_fixup, __stop_fixup);

/* setup bootmem data */
m68k_setup_node(0);
memstart += init_bootmem_node(NODE_DATA(0), start_pfn,
min_low_pfn, max_low_pfn);
free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart);
}

#endif /* CONFIG_MMU */

/***************************************************************************/

void __init config_BSP(char *commandp, int size)
{
#ifdef CONFIG_MMU
mcf54xx_bootmem_alloc();
mmu_context_init();
#endif
mach_reset = mcf54xx_reset;
m54xx_uarts_init();
}
Expand Down

0 comments on commit 1af431e

Please sign in to comment.