UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer kallensf
Observer
589 Views
Registered: ‎07-31-2017

platform driver not probed in 2018.2 Petalinux/kernel 4.14

Hi All,

 

I made a platform driver in 2017.4 and it worked.  The same code in 2018.2 doesn't.  I checked the device tree and the compatible names match.  From my understanding, if the compatible names match, the driver is loaded.  I put a printk message at the start of the probe and I don't see the printk message when I insmod.

 

Is there something else I'm missing?  I compared the device trees of 2017.4 and 2018.2 and the only difference is an extra property: 

                        interrupt-names = "eof_int";

 Thanks in advance!

 

Device tree example:

Enc_Postprocessor@a0050000 {
	compatible = "xlnx,Enc-Postprocessor-1.0";
	interrupt-names = "eof_int";
	interrupt-parent = <0x4>;
	interrupts = <0x0 0x68 0x1>;
	reg = <0x0 0xa0050000 0x0 0x10000>;
	xlnx,s00-axi-addr-width = <0x6>;
	xlnx,s00-axi-data-width = <0x20>;
};

Driver example:

 

static const struct of_device_id irqepp_of_match[] = {
   { .compatible = "xlnx,Enc-Postprocessor-1.0", },
   { /* end of list */ },
};
MODULE_DEVICE_TABLE(of, irqepp_of_match);

static struct platform_driver irqepp_of_driver = {
   .probe      = irqepp_of_probe,
   .remove     = irqepp_of_remove,
   .driver = {
      .name = "encpost_irq",
      .owner = THIS_MODULE,
      .of_match_table = irqepp_of_match,
   },
};

module_platform_driver(irqepp_of_driver);
0 Kudos
4 Replies
Observer kallensf
Observer
566 Views
Registered: ‎07-31-2017

Re: platform driver not probed in 2018.2 Petalinux/kernel 4.14

More background:  the reason I did a platform driver was to get the dynamically assigned interrupt number.  The number in

interrupts = <0x0 0x68 0x1>;

is not the number that is passed to request_irq().  If there is another way to obtain the dynamically assigned interrupt number, please let me know.  Thanks.

0 Kudos
Moderator
Moderator
555 Views
Registered: ‎04-24-2017

Re: platform driver not probed in 2018.2 Petalinux/kernel 4.14

Hi @kallensf,

 

I haven't see the driver probe issue in 2018.x versions.

 

Can you increase the kernel log level and post the output of lsmod(after insmod)

echo "7" > /proc/sys/kernel/printk

 

Also can you share your driver we can investigate. 

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Observer kallensf
Observer
549 Views
Registered: ‎07-31-2017

Re: platform driver not probed in 2018.2 Petalinux/kernel 4.14

Thank you for the suggestion.  I did as you asked and here's the results:

 

root:/mnt/card# lsmod
    Not tainted
uio_pdrv_genirq 16384 0 - Live 0xffffff8000840000


root:/mnt/card# echo "7" > /proc/sys/kernel/printk
root:/mnt/card# insmod enc_post_irq.ko
[   96.017326] enc_post_irq: loading out-of-tree module taints kernel.


root:/mnt/card# lsmod
    Tainted: G
enc_post_irq 16384 0 - Live 0xffffff8000848000 (O)
uio_pdrv_genirq 16384 0 - Live 0xffffff8000840000

 

I also did another platform driver to handle the HDMI core IRQ, ie:

v_hdmi_tx_ss@a0080000 {
   compatible = "xlnx,v-hdmi-tx-ss-3.1";


root:/mnt/card# insmod dvi_irq.ko
[  113.112211] DVI Irq probe
[  113.114754] DVI0, IRQ# 52
[  113.117373] DVI IRQ major number: 244
[  113.121080] DVI Irq probe
[  113.123620] DVI1, IRQ# 53


root:/mnt/card# lsmod
    Tainted: G
dvi_irq 16384 0 - Live 0xffffff8000850000 (O)
enc_post_irq 16384 0 - Live 0xffffff8000848000 (O)
uio_pdrv_genirq 16384 0 - Live 0xffffff8000840000

 

My driver for the HDMI was probed as shown in the above printk, but the Enc_post wasn't because it should've printed: 

Enc_post probe. 

Both have similar code. In fact, I developed Enc_post first and got it working then used it to make my HDMI platform driver.

The HDMI in the fabric is Xilinx's HDMI core, but the Enc_post is a custom logic block. I'm suspicious that the custom block wasn't included in the device tree.  Is there a way to verify this?  Thanks again.

0 Kudos
Observer kallensf
Observer
536 Views
Registered: ‎07-31-2017

Re: platform driver not probed in 2018.2 Petalinux/kernel 4.14

More investigation:

I replace the compatible string of our custom PL block with a block from the xilinx library and just exit the probe after printing a message.

 

echo "7" > /proc/sys/kernel/printk
root:~# insmod enc_post_irq.ko
[ 280.733368] enc_post_irq: loading out-of-tree module taints kernel.
[ 280.739971] EncPost probe, compatible = xlnx,axi-bram-ctrl-4.0
[ 280.745739] Dbg done
[ 280.747964] EncPost probe, compatible = xlnx,axi-bram-ctrl-4.0
[ 280.753723] Dbg done

 

The message printed, so that verifies that my probe & of_match is organized properly.  I replace the compatible string with another custom PL block, sysver.  Our sysver PL block is a simple register with predefined bit values to indicate the version.
root:~# echo "7" > /proc/sys/kernel/printk
root:~# lsmod
Not tainted
uio_pdrv_genirq 16384 0 - Live 0xffffff8000840000
root:~# insmod enc_post_irq.ko
[ 194.077282] enc_post_irq: loading out-of-tree module taints kernel.
[ 194.083904] EncPost probe, compatible = xlnx,sysver-1.0
[ 194.089062] Dbg done

 

Since sysver's compatible name is very short, I added a copy  of the Enc Post entry with very short names in system-user.dtsi and used the short name in my driver.  This didn't work.  It seems to me that the Enc Post block is somehow being excluded or ignored in the device tree.

 

 

0 Kudos