2 * arch/ppc/platforms/4xx/redwood6.c
4 * Author: Armin Kuster <akuster@mvista.com>
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
12 #include <linux/config.h>
13 #include <linux/init.h>
14 #include <linux/pagemap.h>
15 #include <linux/device.h>
16 #include <linux/ioport.h>
18 #include <asm/ppc4xx_pic.h>
19 #include <linux/delay.h>
20 #include <asm/machdep.h>
24 * Define all of the IRQ senses and polarities.
27 static u_char redwood6_IRQ_initsenses[] __initdata = {
28 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 0: RTC/FPC */
29 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 1: Transport */
30 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 2: Audio Dec */
31 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 3: Video Dec */
32 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 4: DMA Chan 0 */
33 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 5: DMA Chan 1 */
34 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 6: DMA Chan 2 */
35 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 7: DMA Chan 3 */
36 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 8: SmartCard 0 */
37 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 9: IIC0 */
38 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 10: IRR */
39 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 11: Cap Timers */
40 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 12: Cmp Timers */
41 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 13: Serial Port */
42 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 14: Soft Modem */
43 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 15: Down Ctrs */
44 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 16: SmartCard 1 */
45 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 17: Ext Int 7 */
46 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 18: Ext Int 8 */
47 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 19: Ext Int 9 */
48 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 20: Serial 0 */
49 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 21: Serial 1 */
50 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 22: Serial 2 */
51 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 23: XPT_DMA */
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 24: DCR timeout */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 25: Ext Int 0 */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 26: Ext Int 1 */
55 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 27: Ext Int 2 */
56 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 28: Ext Int 3 */
57 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 29: Ext Int 4 */
58 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 30: Ext Int 5 */
59 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 31: Ext Int 6 */
62 static struct resource smc91x_resources[] = {
64 .start = SMC91111_BASE_ADDR,
65 .end = SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
66 .flags = IORESOURCE_MEM,
69 .start = SMC91111_IRQ,
71 .flags = IORESOURCE_IRQ,
75 static struct platform_device smc91x_device = {
78 .num_resources = ARRAY_SIZE(smc91x_resources),
79 .resource = smc91x_resources,
82 static struct platform_device *redwood6_devs[] __initdata = {
87 redwood6_platform_add_devices(void)
89 return platform_add_devices(redwood6_devs, ARRAY_SIZE(redwood6_devs));
94 redwood6_setup_arch(void)
97 void *xilinx, *xilinx_1, *xilinx_2;
98 unsigned short us_reg5;
104 xilinx = (unsigned long) ioremap(IDE_XLINUX_MUX_BASE, 0x10);
105 /* init xilinx control registers - enable ide mux, clear reset bit */
108 "redwood6_setup_arch() xilinxi ioremap failed\n");
111 xilinx_1 = xilinx + 0xa;
112 xilinx_2 = xilinx + 0xe;
114 us_reg5 = readb(xilinx_1);
115 writeb(0x01d1, xilinx_1);
116 writeb(0x0008, xilinx_2);
120 writeb(0x01d1, xilinx_1);
121 writeb(0x0008, xilinx_2);
125 bd_t *bip = (bd_t *) __res;
127 printk("machine\t: %s\n", PPC4xx_MACHINE_NAME);
129 printk("bi_s_version\t %s\n", bip->bi_s_version);
130 printk("bi_r_version\t %s\n", bip->bi_r_version);
131 printk("bi_memsize\t 0x%8.8x\t %dMBytes\n", bip->bi_memsize,
132 bip->bi_memsize / (1024 * 1000));
133 printk("bi_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", 0,
134 bip->bi_enetaddr[0], bip->bi_enetaddr[1], bip->bi_enetaddr[2],
135 bip->bi_enetaddr[3], bip->bi_enetaddr[4], bip->bi_enetaddr[5]);
137 printk("bi_intfreq\t 0x%8.8x\t clock:\t %dMhz\n",
138 bip->bi_intfreq, bip->bi_intfreq / 1000000);
140 printk("bi_busfreq\t 0x%8.8x\t plb bus clock:\t %dMHz\n",
141 bip->bi_busfreq, bip->bi_busfreq / 1000000);
142 printk("bi_tbfreq\t 0x%8.8x\t TB freq:\t %dMHz\n",
143 bip->bi_tbfreq, bip->bi_tbfreq / 1000000);
147 ibm4xxPIC_InitSenses = redwood6_IRQ_initsenses;
148 ibm4xxPIC_NumInitSenses = sizeof(redwood6_IRQ_initsenses);
150 /* Identify the system */
151 printk(KERN_INFO "IBM Redwood6 (STBx25XX) Platform\n");
153 "Port by MontaVista Software, Inc. (source@mvista.com)\n");
155 device_initcall(redwood6_platform_add_devices);
159 redwood6_map_io(void)
164 for (i = 0; i < 16; i++) {
167 /* 0x400x0000 -> 0xe00x0000 */
168 p = 0x40000000 | (i << 16);
169 v = STBx25xx_IO_BASE | (i << 16);
171 io_block_mapping(v, p, PAGE_SIZE,
172 _PAGE_NO_CACHE | pgprot_val(PAGE_KERNEL) |
178 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
179 unsigned long r6, unsigned long r7)
181 ppc4xx_init(r3, r4, r5, r6, r7);
183 ppc_md.setup_arch = redwood6_setup_arch;
184 ppc_md.setup_io_mappings = redwood6_map_io;