use of low level driver
I am a little confused about the use of low level functions provided by different drivers.
I got the mtd stuff work on my board with amd std non cfi flashes. In amd_flash.c
int __init amd_flash_init(void)
{
register_mtd_chip_driver(&amd_flash_chipdrv);
return 0;
}allows me to call : do_map_probe("amd_flash",...)
But, if I want to call do_map_probe("cfi" or "cfi_intel",...), I need to have registered the corresponding mtd chip driver. But when it is part of the kernel (not a module), "mod_init_t cfi_intelext_init(void)" is not called in kernel initialisation ? (correct?)
Is it correct to replace it with
int __init cfi_intelext_init(void)
{
register_mtd_chip_driver(&cfi_intelext_chipdrv);
return 0;
}andmod_init_t cfi_probe_init(void) by
int __init cfi_probe_init(void)
so that I will be able to call do_map_probe("cfi_intel" or "cfi",...) in kernel initialisation ?
otherwise, what happend is that kmod is looking for module in the filesystem ; but at that point, no root fs is mounted.
Xavier
Quoted 4 lines · [email protected] said:
But, if I want to call
do_map_probe("cfi" or "cfi_intel",...), I need
to have registered the corresponding mtd chip driver. But when it is part of the kernel (not a module), "mod_init_tcfi_intelext_init(void)"
is not called in kernel initialisation ? (correct?)
The Intel command set code is a back end only. It doesn't have any code for probing the chips, and should be invoked only from a driver which can do so. At the moment, the only driver which can do that is the CFI probe. If you want to use the cfi_cmdset_0001 code with non-CFI chips, you need to write your own probe code which will identify the chip, set up a dummy cfi structure, and swap the chip driver operations with the cfi_cmdset_0001 back end as the cfi_probe code does.
--
dwmw2