I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver.
drivers/net/ethernet/smsc/smsc911x.c
static struct platform_driver smc911x_driver = {
.probe = smc911x_drv_probe,
.remove = smc911x_drv_remove,
.suspend = smc911x_drv_suspend,
.resume = smc911x_drv_resume,
.driver = {
.name = CARDNAME,
.owner = THIS_MODULE,
},
};
Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are not probed automatically during system boot-up unlike legacy devices sitting on the pci bus.
I guess this understanding of mine is OK here?
Now when I say it is the platform devices, is it mean these devices(Ethernet Controller) are sitting on Platform bus and on ARM architecture default platform bus is AMBA.
So when we solder the Ethernet controller on ARM based board it should be sit on or interfaced with AMBA bus?
How Do we decide that driver we're going to write is Platform driver or Normal driver?
platform_register_device()
to your machine file. See: platform driver documenation for instance. If there is no bus that will probe the hardware, then you must use a platform device. – artless noise