Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
m54xx.c
Go to the documentation of this file.
1 /***************************************************************************/
2 
3 /*
4  * linux/arch/m68knommu/platform/54xx/config.c
5  *
6  * Copyright (C) 2010, Philippe De Muyter <[email protected]>
7  */
8 
9 /***************************************************************************/
10 
11 #include <linux/kernel.h>
12 #include <linux/param.h>
13 #include <linux/init.h>
14 #include <linux/interrupt.h>
15 #include <linux/io.h>
16 #include <linux/mm.h>
17 #include <linux/bootmem.h>
18 #include <asm/pgalloc.h>
19 #include <asm/machdep.h>
20 #include <asm/coldfire.h>
21 #include <asm/m54xxsim.h>
22 #include <asm/mcfuart.h>
23 #include <asm/m54xxgpt.h>
24 #ifdef CONFIG_MMU
25 #include <asm/mmu_context.h>
26 #endif
27 
28 /***************************************************************************/
29 
30 static void __init m54xx_uarts_init(void)
31 {
32  /* enable io pins */
39 }
40 
41 /***************************************************************************/
42 
43 static void mcf54xx_reset(void)
44 {
45  /* disable interrupts and enable the watchdog */
46  asm("movew #0x2700, %sr\n");
50  MCF_GPT_GMS0);
51 }
52 
53 /***************************************************************************/
54 
55 #ifdef CONFIG_MMU
56 
57 unsigned long num_pages;
58 
59 static void __init mcf54xx_bootmem_alloc(void)
60 {
61  unsigned long start_pfn;
62  unsigned long memstart;
63 
64  /* _rambase and _ramend will be naturally page aligned */
65  m68k_memory[0].addr = _rambase;
66  m68k_memory[0].size = _ramend - _rambase;
67 
68  /* compute total pages in system */
69  num_pages = (_ramend - _rambase) >> PAGE_SHIFT;
70 
71  /* page numbers */
72  memstart = PAGE_ALIGN(_ramstart);
73  min_low_pfn = _rambase >> PAGE_SHIFT;
74  start_pfn = memstart >> PAGE_SHIFT;
76  high_memory = (void *)_ramend;
77 
78  m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
79  module_fixup(NULL, __start_fixup, __stop_fixup);
80 
81  /* setup bootmem data */
82  m68k_setup_node(0);
83  memstart += init_bootmem_node(NODE_DATA(0), start_pfn,
85  free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart);
86 }
87 
88 #endif /* CONFIG_MMU */
89 
90 /***************************************************************************/
91 
92 void __init config_BSP(char *commandp, int size)
93 {
94 #ifdef CONFIG_MMU
95  mcf54xx_bootmem_alloc();
97 #endif
98  mach_reset = mcf54xx_reset;
100  m54xx_uarts_init();
101 }
102 
103 /***************************************************************************/