source: trunk/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/danube/devices.c @ 20789

Last change on this file since 20789 was 20789, checked in by blogic, 7 years ago

[ifxmips] adss 2.6.33 kernel patches, not defult yet as linux-atm breaks on 2.6.33

File size: 2.1 KB
Line 
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>
13#include <linux/io.h>
14#include <linux/gpio.h>
15#include <linux/leds.h>
16
17#include <asm/bootinfo.h>
18#include <asm/irq.h>
19
20#include <ifxmips.h>
21#include <ifxmips_irq.h>
22
23/* usb */
24static struct resource dwc_usb_res[] =
25{
26        {
27                .name = "dwc3884_membase",
28                .flags = IORESOURCE_MEM,
29                .start = 0x1E101000,
30                .end = 0x1E101FFF
31        },
32        {
33                .name = "dwc3884_irq",
34                .flags = IORESOURCE_IRQ,
35                .start = IFXMIPS_USB_INT,
36        }
37};
38
39static struct platform_device dwc_usb =
40{
41        .name = "dwc3884-hcd",
42        .resource = dwc_usb_res,
43        .num_resources = ARRAY_SIZE(dwc_usb_res),
44};
45
46void __init
47danube_register_usb(void)
48{
49        platform_device_register(&dwc_usb);
50}
51
52/* ebu gpio */
53static struct platform_device ifxmips_ebu_gpio =
54{
55        .name = "ifxmips_ebu",
56        .num_resources = 1,
57};
58
59void __init
60danube_register_ebu_gpio(struct resource *resource, u32 value)
61{
62        ifxmips_ebu_gpio.resource = resource;
63        ifxmips_ebu_gpio.dev.platform_data = (void*)value;
64        platform_device_register(&ifxmips_ebu_gpio);
65}
66
67/* ethernet */
68unsigned char ifxmips_ethaddr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
69static struct resource danube_ethernet_resources =
70{
71        .start  = IFXMIPS_PPE32_BASE_ADDR,
72        .end    = IFXMIPS_PPE32_BASE_ADDR + IFXMIPS_PPE32_SIZE - 1,
73        .flags  = IORESOURCE_MEM,
74};
75
76static struct platform_device danube_ethernet =
77{
78        .name                   = "danube_ethernet",
79        .resource               = &danube_ethernet_resources,
80        .num_resources  = 1,
81        .dev = {
82                .platform_data = ifxmips_ethaddr,
83        }
84};
85
86void __init
87danube_register_ethernet(unsigned char *mac)
88{
89        if(mac)
90                danube_ethernet.dev.platform_data = mac;
91        platform_device_register(&danube_ethernet);
92}
93
94/* pci */
95extern int ifxmips_pci_external_clock;
96extern int ifxmips_pci_req_mask;
97
98void __init
99danube_register_pci(int clock, int irq_mask)
100{
101        ifxmips_pci_external_clock = clock;
102        if(irq_mask)
103                ifxmips_pci_req_mask = irq_mask;
104}
Note: See TracBrowser for help on using the repository browser.