Hi Aaron,

IMO, serial_init or serial_initialize will only probe for console
device - stdout-path in case of devicetree.
One should add lazy probe of all serial devices using uclass helpers
with board_late_init or last_stage_init in init_sequence_r.
In this case, to probe only this device check against "pci-bootcmd" name.

Regards,
Suneel

On Sat, Jun 22, 2019 at 2:17 AM Aaron Williams <[email protected]> wrote:
>
> Hi all,
>
> I'm working on a driver for our ARM64 SOCs but am having an issue where the 
> driver never gets probed. I added a bind function and the driver is getting 
> bound and I have the appropriate entry in the device tree for it, but the 
> probe function is never called.
>
> This is a pseudo driver in that there is no actual underlying hardware for it 
> so there is no underlying PCI device. I'm sorry for the poor formatting, but 
> my employer's email system is unusable.
>
> Any idea on why my driver is not getting probed? The compatible field should 
> match and the driver is getting bound. The driver is a pseudo serial driver 
> using shared memory for input.
>
> I have the following entry in the device tree for a memory mapped region:
>
> DTS:
>         bootcmd: pci-bootcmd@0x03fff000 {
>   /* remote bootcmd buffer location */
>   compatible = "marvell,pci-bootcmd";
>   reg = <0 0x03fff000 0 0x1000>;
>         };
>
> My driver look like this:
>
> static int octeontx_bootcmd_probe(struct udevice *dev)
> {
>         struct octeontx_bootcmd_data *bc;
>         struct octeontx_pci_io_buf *buf;
>         struct octeontx_bootcmd_platdata *plat = dev_get_platdata(dev);
>
>         printf("%s(%s)\n", __func__, dev->name);
> return 0;
> }
> static int octeontx_bootcmd_bind(struct udevice *dev)
> {
>         printf("%s(%s)\n", __func__, dev->name);
>         return 0;
> }
>
> static const struct dm_serial_ops octeontx_bootcmd_ops = {
>         .putc = octeontx_bootcmd_putc,
>         .pending = octeontx_bootcmd_pending,
>         .getc = octeontx_bootcmd_getc,
> };
>
> static const struct udevice_id octeontx_bootcmd_serial_id[] = {
>         { .compatible = "marvell,pci-bootcmd", },
>         { },
> };
>
> U_BOOT_DRIVER(octeontx_bootcmd) = {
>         .name   = "pci-bootcmd",
>         .id     = UCLASS_SERIAL,
>         .of_match = of_match_ptr(octeontx_bootcmd_serial_id),
>         .ofdata_to_platdata = 
> of_match_ptr(octeontx_bootcmd_ofdata_to_platdata),
>         .platdata_auto_alloc_size = sizeof(struct octeontx_bootcmd_platdata),
>         .probe = octeontx_bootcmd_probe,
>         .bind = octeontx_bootcmd_bind,
>         .ops = &octeontx_bootcmd_ops,
>         .priv_auto_alloc_size = sizeof(struct octeontx_bootcmd_data),
>         .flags = DM_FLAG_PRE_RELOC,
> };
> _______________________________________________
> U-Boot mailing list
> [email protected]
> https://lists.denx.de/listinfo/u-boot
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to