1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31#include <linux/gpio.h>
32#include <linux/init.h>
33
34#include <asm/mach-au1x00/au1000.h>
35
36#include <prom.h>
37
38extern int (*board_pci_idsel)(unsigned int devsel, int assert);
39int mtx1_pci_idsel(unsigned int devsel, int assert);
40
41void board_reset(void)
42{
43
44 au_writel(0x00000000, 0xAE00001C);
45}
46
47void __init board_setup(void)
48{
49#ifdef CONFIG_SERIAL_8250_CONSOLE
50 char *argptr;
51 argptr = prom_getcmdline();
52 argptr = strstr(argptr, "console=");
53 if (argptr == NULL) {
54 argptr = prom_getcmdline();
55 strcat(argptr, " console=ttyS0,115200");
56 }
57#endif
58
59 alchemy_gpio2_enable();
60
61#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
62
63 alchemy_gpio_direction_output(204, 0);
64#endif
65
66#ifdef CONFIG_PCI
67#if defined(__MIPSEB__)
68 au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG);
69#else
70 au_writel(0xf, Au1500_PCI_CFG);
71#endif
72 board_pci_idsel = mtx1_pci_idsel;
73#endif
74
75
76 au_writel(SYS_PF_NI2, SYS_PINFUNC);
77
78
79 au_writel(0xFFFFFFFF, SYS_TRIOUTCLR);
80 alchemy_gpio_direction_output(0, 0);
81 alchemy_gpio_direction_output(3, 1);
82 alchemy_gpio_direction_output(1, 1);
83 alchemy_gpio_direction_output(5, 0);
84
85
86 alchemy_gpio_direction_output(211, 1);
87 alchemy_gpio_direction_output(212, 0);
88
89 printk(KERN_INFO "4G Systems MTX-1 Board\n");
90}
91
92int
93mtx1_pci_idsel(unsigned int devsel, int assert)
94{
95#define MTX_IDSEL_ONLY_0_AND_3 0
96#if MTX_IDSEL_ONLY_0_AND_3
97 if (devsel != 0 && devsel != 3) {
98 printk(KERN_ERR "*** not 0 or 3\n");
99 return 0;
100 }
101#endif
102
103 if (assert && devsel != 0)
104
105 gpio_set_value(1, 0);
106 else
107 gpio_set_value(1, 1);
108
109 au_sync_udelay(1);
110 return 1;
111}
112