7 #include <linux/hdlc.h>
11 #include <linux/kernel.h>
12 #include <linux/pci.h>
20 #define SLOT_ETHA 0x0B
21 #define SLOT_ETHB 0x0C
22 #define SLOT_MPCI 0x0D
29 #define GPIO_IRQ_NEC 3
30 #define GPIO_IRQ_ETHA 4
31 #define GPIO_IRQ_ETHB 5
32 #define GPIO_HSS0_DCD_N 6
33 #define GPIO_HSS1_DCD_N 7
34 #define GPIO_UART0_DCD 8
35 #define GPIO_UART1_DCD 9
36 #define GPIO_HSS0_CTS_N 10
37 #define GPIO_HSS1_CTS_N 11
38 #define GPIO_IRQ_MPCI 12
39 #define GPIO_HSS1_RTS_N 13
40 #define GPIO_HSS0_RTS_N 14
44 #define CONTROL_HSS0_CLK_INT 0
45 #define CONTROL_HSS1_CLK_INT 1
46 #define CONTROL_HSS0_DTR_N 2
47 #define CONTROL_HSS1_DTR_N 3
49 #define CONTROL_AUTO_RESET 5
50 #define CONTROL_PCI_RESET_N 6
51 #define CONTROL_EEPROM_WC_N 7
54 #define CFG_ETH0_ADDRESS 0x40
55 #define CFG_ETH1_ADDRESS 0x46
57 #define CFG_SDRAM_SIZE 0x50
58 #define CFG_SDRAM_CONF 0x54
59 #define CFG_SDRAM_MODE 0x58
60 #define CFG_SDRAM_REFRESH 0x5C
62 #define CFG_HW_BITS 0x60
63 #define CFG_HW_USB_PORTS 0x00000007
64 #define CFG_HW_HAS_PCI_SLOT 0x00000008
65 #define CFG_HW_HAS_ETH0 0x00000010
66 #define CFG_HW_HAS_ETH1 0x00000020
67 #define CFG_HW_HAS_HSS0 0x00000040
68 #define CFG_HW_HAS_HSS1 0x00000080
69 #define CFG_HW_HAS_UART0 0x00000100
70 #define CFG_HW_HAS_UART1 0x00000200
71 #define CFG_HW_HAS_EEPROM 0x00000400
73 #define FLASH_CMD_READ_ARRAY 0xFF
74 #define FLASH_CMD_READ_ID 0x90
75 #define FLASH_SER_OFF 0x102
77 static u32 hw_bits = 0xFFFFFFFD; ;
78 static u8 control_value;
98 static inline void set_control(
int line,
int value)
101 control_value |= (1 << line);
103 control_value &= ~(1 << line);
107 static void output_control(
void)
114 for (i = 0; i < 8; i++) {
116 set_sda(control_value & (0x80 >> i));
129 static void (*set_carrier_cb_tab[2])(
void *
pdev,
int carrier);
131 static int hss_set_clock(
int port,
unsigned int clock_type)
135 switch (clock_type) {
138 set_control(ctrl_int, 0);
143 set_control(ctrl_int, 1);
152 static irqreturn_t hss_dcd_irq(
int irq,
void *pdev)
156 set_carrier_cb_tab[
port](pdev, !
i);
161 static int hss_open(
int port,
void *pdev,
162 void (*set_carrier_cb)(
void *pdev,
int carrier))
172 set_carrier_cb(pdev, !i);
174 set_carrier_cb_tab[!!
port] = set_carrier_cb;
176 if ((i =
request_irq(irq, hss_dcd_irq, 0,
"IXP4xx HSS", pdev)) != 0) {
188 static void hss_close(
int port,
void *pdev)
202 .map_name =
"cfi_probe",
206 static struct resource flash_resource = {
211 .name =
"IXP4XX-Flash",
213 .dev = { .platform_data = &flash_data },
215 .resource = &flash_resource,
228 .dev = { .platform_data = &i2c_data },
233 static struct resource uart_resources[] = {
271 .name =
"serial8250",
273 .dev.platform_data = uart_data,
275 .resource = uart_resources,
294 .name =
"ixp4xx_eth",
296 .dev.platform_data = eth_plat,
298 .name =
"ixp4xx_eth",
300 .dev.platform_data = eth_plat + 1,
308 .set_clock = hss_set_clock,
313 .set_clock = hss_set_clock,
322 .name =
"ixp4xx_hss",
324 .dev.platform_data = hss_plat,
326 .name =
"ixp4xx_hss",
328 .dev.platform_data = hss_plat + 1,
355 static void __init gmlr_init(
void)
364 " configuration data\n");
390 memset(&uart_data[1], 0,
sizeof(uart_data[1]));
395 device_uarts.
dev.platform_data = &uart_data[1];
396 device_uarts.
resource = &uart_resources[1];
401 device_tab[devices++] = &device_uarts;
404 device_tab[devices++] = &device_eth_tab[0];
406 device_tab[devices++] = &device_eth_tab[1];
409 device_tab[devices++] = &device_hss_tab[0];
411 device_tab[devices++] = &device_hss_tab[1];
414 device_tab[devices++] = &device_i2c;
442 static void __init gmlr_pci_preinit(
void)
451 static void __init gmlr_pci_postinit(
void)
454 (hw_bits & CFG_HW_USB_PORTS) < 5) {
475 static struct hw_pci gmlr_hw_pci __initdata = {
478 .preinit = gmlr_pci_preinit,
479 .postinit = gmlr_pci_postinit,
481 .map_irq = gmlr_map_irq,
484 static int __init gmlr_pci_init(
void)
486 if (machine_is_goramo_mlr() &&
502 .atag_offset = 0x100,
503 .init_machine = gmlr_init,
504 #if defined(CONFIG_PCI)