Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
m68k
platform
coldfire
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 */
33
__raw_writeb
(
MCF_PAR_PSC_TXD
|
MCF_PAR_PSC_RXD
,
MCFGPIO_PAR_PSC0
);
34
__raw_writeb
(
MCF_PAR_PSC_TXD
|
MCF_PAR_PSC_RXD
|
MCF_PAR_PSC_RTS_RTS
,
35
MCFGPIO_PAR_PSC1
);
36
__raw_writeb
(
MCF_PAR_PSC_TXD
|
MCF_PAR_PSC_RXD
|
MCF_PAR_PSC_RTS_RTS
|
37
MCF_PAR_PSC_CTS_CTS
,
MCFGPIO_PAR_PSC2
);
38
__raw_writeb
(
MCF_PAR_PSC_TXD
|
MCF_PAR_PSC_RXD
,
MCFGPIO_PAR_PSC3
);
39
}
40
41
/***************************************************************************/
42
43
static
void
mcf54xx_reset(
void
)
44
{
45
/* disable interrupts and enable the watchdog */
46
asm
(
"movew #0x2700, %sr\n"
);
47
__raw_writel
(0,
MCF_GPT_GMS0
);
48
__raw_writel
(
MCF_GPT_GCIR_CNT
(1),
MCF_GPT_GCIR0
);
49
__raw_writel
(
MCF_GPT_GMS_WDEN
|
MCF_GPT_GMS_CE
|
MCF_GPT_GMS_TMS
(4),
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
;
75
max_low_pfn
=
_ramend
>>
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,
84
min_low_pfn
,
max_low_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();
96
mmu_context_init
();
97
#endif
98
mach_reset
= mcf54xx_reset;
99
mach_sched_init
=
hw_timer_init
;
100
m54xx_uarts_init();
101
}
102
103
/***************************************************************************/
Generated on Thu Jan 10 2013 13:08:28 for Linux Kernel by
1.8.2