I am refering following li k to decribe all the drivers used in my embedded Arm linux board as platform devices, need few points to be clarified. Please suggest on these.
http://thomas.enix.org/pub/conf/rmll2010/kernel-architecture-for-drivers.pdf
=============== Defining platform driver ==================
static struct platform_driver serial_imx_driver = {
.probe = serial_imx_probe,
.remove = serial_imx_remove,
.driver = {
.name = "imx-uart",
.owner = THIS_MODULE,
},
};
================= Defining a platform device ================
static struct platform_device imx_uart1_device = {
.name = "imx-uart",
.id = 0,
.num_resources = ARRAY_SIZE(imx_uart1_resources),
.resource = imx_uart1_resources,
.dev = {
.platform_data = &uart_pdata,
}
};
======== Kernel start up code location - /arch/arm/mach-imx/mx1ads.c ===========
static struct platform_device *devices[] __initdata = {
&cs89x0_device,
&imx_uart1_device,
&imx_uart2_device,
};
static void __init mx1ads_init(void)
{
[...]
platform_add_devices(devices, ARRAY_SIZE(devices));
[...]
}
MACHINE_START(MX1ADS, "Freescale MX1ADS")
[...]
.init_machine = mx1ads_init,
MACHINE_END
===============================
In linux /drivers/ folder if i have 10 folders for 10 different platform drivers. And i want only 6 drivers to be included in kernel source ? So how will my kernel come to know which driver to include ?
Are platform drivers compiled as modules or statically compiled in the kernel ?
Also what happens when we call platform_add_devices()
system call ?
Does all the platform drivers which are included in kernel are loaded into ram before call to platform_add_devices() system call is made ?
At Which path/file in kernel source i can define all platform devices used in my embedded linux system (means where all platform devices used on board are described) ?