1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/54xx/config.c
6 * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be>
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/param.h>
13 #include <linux/init.h>
14 #include <linux/interrupt.h>
16 #include <asm/machdep.h>
17 #include <asm/coldfire.h>
18 #include <asm/m54xxsim.h>
19 #include <asm/mcfuart.h>
20 #include <asm/m54xxgpt.h>
22 /***************************************************************************/
24 static struct mcf_platform_uart m54xx_uart_platform
[] = {
26 .mapbase
= MCF_MBAR
+ MCFUART_BASE1
,
30 .mapbase
= MCF_MBAR
+ MCFUART_BASE2
,
34 .mapbase
= MCF_MBAR
+ MCFUART_BASE3
,
38 .mapbase
= MCF_MBAR
+ MCFUART_BASE4
,
43 static struct platform_device m54xx_uart
= {
46 .dev
.platform_data
= m54xx_uart_platform
,
49 static struct platform_device
*m54xx_devices
[] __initdata
= {
54 /***************************************************************************/
56 static void __init
m54xx_uart_init_line(int line
, int irq
)
65 rts_cts
= MCF_PAR_PSC_RTS_RTS
; break;
67 rts_cts
= MCF_PAR_PSC_RTS_RTS
| MCF_PAR_PSC_CTS_CTS
; break;
71 __raw_writeb(MCF_PAR_PSC_TXD
| rts_cts
| MCF_PAR_PSC_RXD
,
72 MCF_MBAR
+ MCF_PAR_PSC(line
));
75 static void __init
m54xx_uarts_init(void)
77 const int nrlines
= ARRAY_SIZE(m54xx_uart_platform
);
80 for (line
= 0; (line
< nrlines
); line
++)
81 m54xx_uart_init_line(line
, m54xx_uart_platform
[line
].irq
);
84 /***************************************************************************/
86 static void mcf54xx_reset(void)
88 /* disable interrupts and enable the watchdog */
89 asm("movew #0x2700, %sr\n");
90 __raw_writel(0, MCF_MBAR
+ MCF_GPT_GMS0
);
91 __raw_writel(MCF_GPT_GCIR_CNT(1), MCF_MBAR
+ MCF_GPT_GCIR0
);
92 __raw_writel(MCF_GPT_GMS_WDEN
| MCF_GPT_GMS_CE
| MCF_GPT_GMS_TMS(4),
93 MCF_MBAR
+ MCF_GPT_GMS0
);
96 /***************************************************************************/
98 void __init
config_BSP(char *commandp
, int size
)
100 mach_reset
= mcf54xx_reset
;
104 /***************************************************************************/
106 static int __init
init_BSP(void)
109 platform_add_devices(m54xx_devices
, ARRAY_SIZE(m54xx_devices
));
113 arch_initcall(init_BSP
);
115 /***************************************************************************/