Chris Enrique <
microdevel@xxxxxxxxxxxxxx> wrote:
> Hello,
>
> i have some problems making a driver module (very similar to uartlite
> driver) work. My situation is the following:
> I am running petalinux on a Xilinx Spartan3A1800DSP Starter Kit Board
> (Microblaze), my hardware has 2 uartlite-cores implemented. The first one
> should be accessed by the original uartlite driver, the second one (which
> was modified for testing purposes...its fifo always contains "0101010...")
> should be driven by a modified uartlite driver, which is currently loaded as
> a module after system startup. the module_init procedure is exactly the same
> that can be found in the uartlite driver:
>
> (module pan)
> -------------------------------
>
> int __devinit pan_init(void)
> {
> int ret;
>
> ret = uart_register_driver(&pan_uart_driver);
> printk(KERN_INFO "PAN: pan_init - uart_register_driver ret:%d\n",ret);
> if (ret)
> return ret;
>
> ret = platform_driver_register(&pan_platform_driver);
> printk(KERN_INFO "PAN: pan_init - platform_driver_register
> ret:%d\n",ret);
> if (ret)
> {
> uart_unregister_driver(&pan_uart_driver);
> printk(KERN_WARNING "PAN: pan_init - UNREGISTERED DRIVER
> ret:%d\n",ret);
> }
>
> printk(KERN_INFO "PAN: pan_init - success\n");
>
> return ret;
> }
>
> this init procedure just works fine but the problem is, the .probe function
> specified in pan_platform_driver struct never gets called...so my module
> doesn't do any work at all...
> can anyone explain me how the kernel gets an idea of which module to probe
> for the uart hardware?shouldn't it just probe any driver registered via te
> platform_driver_register() call? i chose 4 as major number and 68 as minor
> and created a device node pan0,c,4,68..should be good so far.
> there is some issue concerning the original uartlite driver that is driving
> the first uartlite-core...it gets probed twice when the system is loaded, so
> i limited its UARTLITE_NR_UARTS to 1, is that the right way?
> thanks for help in advance
> chris