Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

USB kernel config

Hi,

We're using the Cypress SL811 host controller on our NIOS2 board. The kernel config option wasn't available until I edited the Kconfig file in the source tree (drivers/usb/host/Kconfig), found the appropriate option, and added

<div class='quotetop'>QUOTE </div>

--- Quote Start ---

|| (NIOS2 && USB)[/b]

--- Quote End ---

You guys really need to go through and update the stuff which is in there to make it available. :-)

Or does this stuff only work in NIOS 1 but not NIOS2? (I haven&#39;t compiled yet.)

This was the case with all USB support too, you may recall.

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The one I spent time on is the old driver. It worked only for 2.6.5, not for 2.6.9. I am supposed to switch to the new driver, but have not got time. But with the new driver, you should have little problem.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ah, gotcha.

    Interesting word, "should". :-)

    I&#39;m trying to add the appropriate lines to set up the resource to setup.c as follows:

    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 = 100,
        .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  = 3,
        .resource       = sl811_resources,
    };

    and then down in the setup_arch() function in arch/nios2nommu/kernel/setup.c (right before the
    printk("Done setup_arch\n");

    I added
    platform_device_register(&sl811_device);

    But when the kernel boots, I get

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    <3>sl811-hcd: failed to claim resource 0[/b]

    --- Quote End ---