Forum Discussion
Altera_Forum
Honored Contributor
20 years agoDetails are a bit complicated. But here's a bit:
(1) Copy over the driver froma stock 2.6.10 kernel. It's called sl811-hcd. It has three files: drivers/usb/host/sl811-hcd.c drivers/usb/host/sl811.h include/linux/usb_sl811.h. Copy these into the appropriate place in your microtronix kernel source directory. (2) Modify the Kconfig in your microtronix drivers/usb/host/ dir to include <div class='quotetop'>QUOTE </div> --- Quote Start --- config USB_SL811_HCD tristate "SL811HS HCD support" depends on USB default N help The SL811HS is a single-port USB controller that supports either host side or peripheral side roles. Enable this option if your board has this chip, and you want to use it as a host controller. If unsure, say N. To compile this driver as a module, choose M here: the module will be called sl811-hcd.[/b] --- Quote End --- (3) Edit sl811-hcd.c and modify the sl811_init function something like this:static struct resource sl811_resources = {
= {
.start = 0x48389D0,
.end = 0x48389D3,
.flags = IORESOURCE_MEM,
},
= {
.start = 0x48389D4,
.end = 0x48389D7,
.flags = IORESOURCE_MEM,
},
= {
.start = 7,
.end = 7,
.flags = IORESOURCE_IRQ,
},
};
static void sm3k_port_power(struct device *dev, int is_on) {
// see linux/usb_sl811.h
}
static void sm3k_hc_reset(struct device *dev) {
// see linux/usb_sl811.h
}
struct sl811_platform_data sm3k_sl811 = {
.potpg = 10,
.power = 250,
.port_power = sm3k_port_power,
.reset = sm3k_hc_reset,
};
static struct platform_device sl811_device = {
.name = "sl811-hcd",
.id = -1,
.dev = {
.platform_data = &sm3k_sl811,
},
.num_resources = ARRAY_SIZE(sl811_resources),
.resource = sl811_resources,
};
static int __init sl811h_init(void)
{
if (usb_disabled())
return -ENODEV;
platform_device_register(&sl811_device);
INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION);
return driver_register(&sl811h_driver);
} (note: most of sl811_init() is the same, only the bolded line was added. You'll need to modify the data structures above it to suit your board, and you'll need to implement the power functions so that the driver can control the USB VBus power.) (4) Configure your kernel and compile. (5) Note: I am still trying to get usb-storage to work with this, and am not yet successful. Your mileage may vary.