Note that there are some explanatory texts on larger screens.

plurals
  1. POLinux device model: Same device but different drivers
    primarykey
    data
    text
    <p>I'm customising Linux for an ARM9 Atmel AT91SAM960 board. </p> <p>In the <a href="http://lxr.free-electrons.com/source/arch/arm/mach-at91/at91sam9260_devices.c#L901" rel="nofollow">device file</a> Atmel named all the USART the same <code>atmel_usart</code>. Of course with id enumeration:</p> <pre><code>static struct platform_device at91sam9260_uart0_device = { .name = "atmel_usart", .id = 1, .dev = { ...} } </code></pre> <p>According to the Linux Device model, all these devices (5 UARTS on a SAM9260) would be bind to <a href="http://lxr.free-electrons.com/source/drivers/serial/atmel_serial.c#L1638" rel="nofollow">the driver named <code>atmel_usart</code></a>.</p> <p>I don't want to set a TTYS driver on all UARTS which will be registerd. I have several own drivers which serve for different specialised purposes (LON, RS-485 etc.) I want the control which driver does serve a certain USART. So what could I do:</p> <ul> <li><p>The Atmel device files are unsatisfiable and I can do it better. So I rename (patch) the devices in the device file. However, in case I want a TTYS driver on UART4 I would be in trouble. </p></li> <li><p>I manipulate (patch) the device file, so that I'm able the access the structures <code>platform_device</code>. I could change their names before I would register them. But as far as I understood the idea of the <em>Linux Driver Model</em>, devices should be registered early during boot-up but the binding to a driver follows .... later.</p></li> <li><p>I could write a driver, which has an alias name and which would be binded to a specific bus_Id -> <code>atmel_usart.4</code>. Can I really?</p></li> </ul> <p>What solutions else exist. I want to touch a minimal set of Kernel files but <em>I want all the freedom possible?</em></p> <p><strong>Addendum what freedom means to me</strong>: I can specify at runtime how the UARTS can be used</p> <ul> <li>with the Atmel-Serial driver (ttyS)</li> <li>with my own drivers</li> </ul> <p>It means also, that changes to the kernel source are minimal.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload