2 * June 2006 steve.glendinning@smsc.com
4 * Polaris-specific resource declaration
8 #include <linux/init.h>
9 #include <linux/interrupt.h>
10 #include <linux/irq.h>
11 #include <linux/platform_device.h>
12 #include <linux/smsc911x.h>
15 #include <asm/machvec.h>
16 #include <asm/heartbeat.h>
18 #include <mach-se/mach/se.h>
20 #define BCR2 (0xFFFFFF62)
21 #define WCR2 (0xFFFFFF66)
22 #define AREA5_WAIT_CTRL (0x1C00)
23 #define WAIT_STATES_10 (0x7)
25 static struct resource smsc911x_resources[] = {
27 .name = "smsc911x-memory",
29 .end = PA_EXT5 + 0x1fff,
30 .flags = IORESOURCE_MEM,
33 .name = "smsc911x-irq",
36 .flags = IORESOURCE_IRQ,
40 static struct smsc911x_platform_config smsc911x_config = {
41 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
42 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
43 .flags = SMSC911X_USE_32BIT,
44 .phy_interface = PHY_INTERFACE_MODE_MII,
47 static struct platform_device smsc911x_device = {
50 .num_resources = ARRAY_SIZE(smsc911x_resources),
51 .resource = smsc911x_resources,
53 .platform_data = &smsc911x_config,
57 static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 };
59 static struct heartbeat_data heartbeat_data = {
60 .bit_pos = heartbeat_bit_pos,
61 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
65 static struct resource heartbeat_resources[] = {
69 .flags = IORESOURCE_MEM,
73 static struct platform_device heartbeat_device = {
77 .platform_data = &heartbeat_data,
79 .num_resources = ARRAY_SIZE(heartbeat_resources),
80 .resource = heartbeat_resources,
83 static struct platform_device *polaris_devices[] __initdata = {
88 static int __init polaris_initialise(void)
92 printk(KERN_INFO "Configuring Polaris external bus\n");
94 /* Configure area 5 with 2 wait states */
96 wcr &= (~AREA5_WAIT_CTRL);
97 wcr |= (WAIT_STATES_10 << 10);
100 /* Configure area 5 for 32-bit access */
101 bcr_mask = ctrl_inw(BCR2);
103 ctrl_outw(bcr_mask, BCR2);
105 return platform_add_devices(polaris_devices,
106 ARRAY_SIZE(polaris_devices));
108 arch_initcall(polaris_initialise);
110 static struct ipr_data ipr_irq_table[] = {
112 { IRQ0_IRQ, 0, 0, 1, }, /* IRQ0 */
113 { IRQ1_IRQ, 0, 4, 1, }, /* IRQ1 */
116 static unsigned long ipr_offsets[] = {
120 static struct ipr_desc ipr_irq_desc = {
121 .ipr_offsets = ipr_offsets,
122 .nr_offsets = ARRAY_SIZE(ipr_offsets),
124 .ipr_data = ipr_irq_table,
125 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
127 .name = "sh7709-ext",
131 static void __init init_polaris_irq(void)
133 /* Disable all interrupts */
134 ctrl_outw(0, BCR_ILCRA);
135 ctrl_outw(0, BCR_ILCRB);
136 ctrl_outw(0, BCR_ILCRC);
137 ctrl_outw(0, BCR_ILCRD);
138 ctrl_outw(0, BCR_ILCRE);
139 ctrl_outw(0, BCR_ILCRF);
140 ctrl_outw(0, BCR_ILCRG);
142 register_ipr_controller(&ipr_irq_desc);
145 static struct sh_machine_vector mv_polaris __initmv = {
146 .mv_name = "Polaris",
148 .mv_init_irq = init_polaris_irq,