m54xx.c (9938b04472d5c59f8bd8152a548533a8599596a2) m54xx.c (f71160655d1efda10081482c486481f2108abca5)
1/***************************************************************************/
2
3/*
4 * m54xx.c -- platform support for ColdFire 54xx based boards
5 *
6 * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be>
7 */
8

--- 11 unchanged lines hidden (view full) ---

20#include <asm/machdep.h>
21#include <asm/coldfire.h>
22#include <asm/m54xxsim.h>
23#include <asm/mcfuart.h>
24#include <asm/mcfclk.h>
25#include <asm/m54xxgpt.h>
26#ifdef CONFIG_MMU
27#include <asm/mmu_context.h>
1/***************************************************************************/
2
3/*
4 * m54xx.c -- platform support for ColdFire 54xx based boards
5 *
6 * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be>
7 */
8

--- 11 unchanged lines hidden (view full) ---

20#include <asm/machdep.h>
21#include <asm/coldfire.h>
22#include <asm/m54xxsim.h>
23#include <asm/mcfuart.h>
24#include <asm/mcfclk.h>
25#include <asm/m54xxgpt.h>
26#ifdef CONFIG_MMU
27#include <asm/mmu_context.h>
28#include <linux/pfn.h>
29#endif
30
31/***************************************************************************/
32
33DEFINE_CLK(pll, "pll.0", MCF_CLK);
34DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
35DEFINE_CLK(mcfslt0, "mcfslt.0", MCF_BUSCLK);
36DEFINE_CLK(mcfslt1, "mcfslt.1", MCF_BUSCLK);

--- 36 unchanged lines hidden (view full) ---

73 __raw_writel(0, MCF_GPT_GMS0);
74 __raw_writel(MCF_GPT_GCIR_CNT(1), MCF_GPT_GCIR0);
75 __raw_writel(MCF_GPT_GMS_WDEN | MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS(4),
76 MCF_GPT_GMS0);
77}
78
79/***************************************************************************/
80
28#endif
29
30/***************************************************************************/
31
32DEFINE_CLK(pll, "pll.0", MCF_CLK);
33DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
34DEFINE_CLK(mcfslt0, "mcfslt.0", MCF_BUSCLK);
35DEFINE_CLK(mcfslt1, "mcfslt.1", MCF_BUSCLK);

--- 36 unchanged lines hidden (view full) ---

72 __raw_writel(0, MCF_GPT_GMS0);
73 __raw_writel(MCF_GPT_GCIR_CNT(1), MCF_GPT_GCIR0);
74 __raw_writel(MCF_GPT_GMS_WDEN | MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS(4),
75 MCF_GPT_GMS0);
76}
77
78/***************************************************************************/
79
81#ifdef CONFIG_MMU
82
83unsigned long num_pages;
84
85static void __init mcf54xx_bootmem_alloc(void)
86{
87 unsigned long start_pfn;
88 unsigned long memstart;
89
90 /* _rambase and _ramend will be naturally page aligned */
91 m68k_memory[0].addr = _rambase;
92 m68k_memory[0].size = _ramend - _rambase;
93
94 /* compute total pages in system */
95 num_pages = PFN_DOWN(_ramend - _rambase);
96
97 /* page numbers */
98 memstart = PAGE_ALIGN(_ramstart);
99 min_low_pfn = PFN_DOWN(_rambase);
100 start_pfn = PFN_DOWN(memstart);
101 max_pfn = max_low_pfn = PFN_DOWN(_ramend);
102 high_memory = (void *)_ramend;
103
104 m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
105 module_fixup(NULL, __start_fixup, __stop_fixup);
106
107 /* setup bootmem data */
108 m68k_setup_node(0);
109 memstart += init_bootmem_node(NODE_DATA(0), start_pfn,
110 min_low_pfn, max_low_pfn);
111 free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart);
112}
113
114#endif /* CONFIG_MMU */
115
116/***************************************************************************/
117
118void __init config_BSP(char *commandp, int size)
119{
120#ifdef CONFIG_MMU
80void __init config_BSP(char *commandp, int size)
81{
82#ifdef CONFIG_MMU
121 mcf54xx_bootmem_alloc();
83 cf_bootmem_alloc();
122 mmu_context_init();
123#endif
124 mach_reset = mcf54xx_reset;
125 mach_sched_init = hw_timer_init;
126 m54xx_uarts_init();
127}
128
129/***************************************************************************/
84 mmu_context_init();
85#endif
86 mach_reset = mcf54xx_reset;
87 mach_sched_init = hw_timer_init;
88 m54xx_uarts_init();
89}
90
91/***************************************************************************/