1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5249/config.c
6 * Copyright (C) 2002, Greg Ungerer (gerg@snapgear.com)
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/param.h>
13 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <asm/machdep.h>
17 #include <asm/coldfire.h>
18 #include <asm/mcfsim.h>
20 /***************************************************************************/
24 static struct resource m5249_smc91x_resources
[] = {
27 .end
= 0xe0000300 + 0x100,
28 .flags
= IORESOURCE_MEM
,
31 .start
= MCFINTC2_GPIOIRQ6
,
32 .end
= MCFINTC2_GPIOIRQ6
,
33 .flags
= IORESOURCE_IRQ
,
37 static struct platform_device m5249_smc91x
= {
40 .num_resources
= ARRAY_SIZE(m5249_smc91x_resources
),
41 .resource
= m5249_smc91x_resources
,
44 #endif /* CONFIG_M5249C3 */
46 static struct platform_device
*m5249_devices
[] __initdata
= {
52 /***************************************************************************/
54 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
56 static void __init
m5249_qspi_init(void)
59 writeb(MCFSIM_ICR_AUTOVEC
| MCFSIM_ICR_LEVEL4
| MCFSIM_ICR_PRI0
,
60 MCF_MBAR
+ MCFSIM_QSPIICR
);
61 mcf_mapirq2imr(MCF_IRQ_QSPI
, MCFINTC_QSPI
);
64 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
66 /***************************************************************************/
70 static void __init
m5249_smc91x_init(void)
74 /* Set the GPIO line as interrupt source for smc91x device */
75 gpio
= readl(MCF_MBAR2
+ MCFSIM2_GPIOINTENABLE
);
76 writel(gpio
| 0x40, MCF_MBAR2
+ MCFSIM2_GPIOINTENABLE
);
78 gpio
= readl(MCF_MBAR2
+ MCFSIM2_INTLEVEL5
);
79 writel(gpio
| 0x04000000, MCF_MBAR2
+ MCFSIM2_INTLEVEL5
);
82 #endif /* CONFIG_M5249C3 */
84 /***************************************************************************/
86 void __init
config_BSP(char *commandp
, int size
)
88 mach_sched_init
= hw_timer_init
;
93 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
98 /***************************************************************************/
100 static int __init
init_BSP(void)
102 platform_add_devices(m5249_devices
, ARRAY_SIZE(m5249_devices
));
106 arch_initcall(init_BSP
);
108 /***************************************************************************/