Forgot to add the i2c id, grr
[openwrt/svn-archive/archive.git] / target / linux / au1000-2.6 / patches / 008-isdel_cardbus.patch
1 diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/board_setup.c linux-2.6.16.7.new/arch/mips/au1000/mtx-1/board_setup.c
2 --- linux-2.6.16.7/arch/mips/au1000/mtx-1/board_setup.c 2006-04-23 14:39:21.000000000 +0200
3 +++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/board_setup.c 2006-04-23 14:39:03.000000000 +0200
4 @@ -44,6 +44,9 @@
5 #include <asm/pgtable.h>
6 #include <asm/mach-au1x00/au1000.h>
7
8 +extern int (*board_pci_idsel)(unsigned int devsel, int assert);
9 +int mtx1_pci_idsel(unsigned int devsel, int assert);
10 +
11 void board_reset (void)
12 {
13 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
14 @@ -77,11 +80,37 @@
15 au_writel( 0xFFFFFFFF, SYS_TRIOUTCLR );
16 au_writel( 0x00000001, SYS_OUTPUTCLR ); // set M66EN (PCI 66MHz) to OFF
17 au_writel( 0x00000008, SYS_OUTPUTSET ); // set PCI CLKRUN# to OFF
18 + au_writel( 0x00000002, SYS_OUTPUTSET ); // set EXT_IO3 ON
19 au_writel( 0x00000020, SYS_OUTPUTCLR ); // set eth PHY TX_ER to OFF
20
21 // enable LED and set it to green
22 au_writel( au_readl(GPIO2_DIR) | 0x1800, GPIO2_DIR );
23 au_writel( 0x18000800, GPIO2_OUTPUT );
24
25 + board_pci_idsel = mtx1_pci_idsel;
26 +
27 printk("4G Systems MTX-1 Board\n");
28 }
29 +
30 +int
31 +mtx1_pci_idsel(unsigned int devsel, int assert)
32 +{
33 +#define MTX_IDSEL_ONLY_0_AND_3 0
34 +#if MTX_IDSEL_ONLY_0_AND_3
35 + if (devsel != 0 && devsel != 3) {
36 + printk("*** not 0 or 3\n");
37 + return 0;
38 + }
39 +#endif
40 +
41 + if (assert && devsel != 0) {
42 + // supress signal to cardbus
43 + au_writel( 0x00000002, SYS_OUTPUTCLR ); // set EXT_IO3 OFF
44 + }
45 + else {
46 + au_writel( 0x00000002, SYS_OUTPUTSET ); // set EXT_IO3 ON
47 + }
48 + au_sync_udelay(1);
49 + return 1;
50 +}
51 +
52 diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/irqmap.c linux-2.6.16.7.new/arch/mips/au1000/mtx-1/irqmap.c
53 --- linux-2.6.16.7/arch/mips/au1000/mtx-1/irqmap.c 2006-04-23 14:40:54.000000000 +0200
54 +++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/irqmap.c 2006-04-23 14:40:12.000000000 +0200
55 @@ -48,7 +48,7 @@
56 #include <asm/mach-au1x00/au1000.h>
57
58 char irq_tab_alchemy[][5] __initdata = {
59 - [0] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
60 + [0] = { -1, INTA, INTA, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
61 [1] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
62 [2] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 02 - AdapterB-Slot0 (top) */
63 [3] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 03 - AdapterB-Slot1 (bottom) */