1 #include <linux/init.h>
2 #include <linux/module.h>
3 #include <linux/types.h>
4 #include <linux/string.h>
5 #include <linux/mtd/physmap.h>
6 #include <linux/kernel.h>
7 #include <linux/reboot.h>
8 #include <linux/platform_device.h>
9 #include <linux/leds.h>
10 #include <linux/etherdevice.h>
11 #include <linux/reboot.h>
12 #include <linux/time.h>
14 #include <linux/gpio.h>
15 #include <linux/leds.h>
17 #include <asm/bootinfo.h>
21 #include <ifxmips_irq.h>
26 static struct resource dwc_usb_res
[] =
29 .name
= "dwc3884_membase",
30 .flags
= IORESOURCE_MEM
,
35 .name
= "dwc3884_irq",
36 .flags
= IORESOURCE_IRQ
,
37 .start
= IFXMIPS_USB_INT
,
41 static struct platform_device dwc_usb
=
43 .name
= "dwc3884-hcd",
44 .resource
= dwc_usb_res
,
45 .num_resources
= ARRAY_SIZE(dwc_usb_res
),
49 danube_register_usb(void)
51 platform_device_register(&dwc_usb
);
55 static struct platform_device ifxmips_ebu_gpio
=
57 .name
= "ifxmips_ebu",
62 danube_register_ebu_gpio(struct resource
*resource
, u32 value
)
64 ifxmips_ebu_gpio
.resource
= resource
;
65 ifxmips_ebu_gpio
.dev
.platform_data
= (void*)value
;
66 platform_device_register(&ifxmips_ebu_gpio
);
70 unsigned char ifxmips_ethaddr
[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
71 static struct resource danube_ethernet_resources
=
73 .start
= IFXMIPS_PPE32_BASE_ADDR
,
74 .end
= IFXMIPS_PPE32_BASE_ADDR
+ IFXMIPS_PPE32_SIZE
- 1,
75 .flags
= IORESOURCE_MEM
,
78 static struct platform_device danube_ethernet
=
80 .name
= "ifxmips_mii0",
81 .resource
= &danube_ethernet_resources
,
84 .platform_data
= ifxmips_ethaddr
,
89 danube_register_ethernet(unsigned char *mac
, int mii_mode
)
91 struct ifxmips_eth_data
*eth
= kmalloc(sizeof(struct ifxmips_eth_data
), GFP_KERNEL
);
92 memset(eth
, 0, sizeof(struct ifxmips_eth_data
));
96 eth
->mac
= ifxmips_ethaddr
;
97 eth
->mii_mode
= mii_mode
;
98 danube_ethernet
.dev
.platform_data
= eth
;
99 platform_device_register(&danube_ethernet
);
103 extern int ifxmips_pci_external_clock
;
104 extern int ifxmips_pci_req_mask
;
107 danube_register_pci(int clock
, int irq_mask
)
109 ifxmips_pci_external_clock
= clock
;
111 ifxmips_pci_req_mask
= irq_mask
;