2009-04-28 01:28:41     Driver probe?

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-04-28 01:28:41     Driver probe?

Adam Dershowitz (UNITED STATES)

Message: 73326   

 

I am trying to build a framebuffer device driver.  As a starting point I just copied bfin-t3350mcqb-fb.c over to a different directory, and did a global replace of t350mcqb with my version.  I then followed the instruction here:  http://docs.blackfin.uclinux.org/doku.php?id=a_simple_module_example.

 

I can build my "new" module, and I can load it with insmod.  The problem is that it seems that the probe function is not being called and /dev/fb0 is never being created.

 

I also switched the t350 to build as a module.

 

What I don't understand is why if I load the necessary other modules, then insmod bfin-t350mcqb-fb.ko I see /dev/fb0 appear.  But I don't get the same thing for my version, that is identical code, except for the global name changes?

 

Is there some other location that is necessary to "tell" the kernel about the module or to tell it to run the probe function by name, other than in the source file itself?

 

Thanks,

 

 

 

--Adam

QuoteReplyEditDelete

 

 

2009-04-28 01:36:29     Re: Driver probe?

Mike Frysinger (UNITED STATES)

Message: 73330   

 

if you dont declare proper platform resources in your board file, then the kernel has no way of knowing what drivers to load

QuoteReplyEditDelete

 

 

2009-04-28 01:50:09     Re: Driver probe?

Adam Dershowitz (UNITED STATES)

Message: 73333   

 

So modules have to be pre-defined in boards/ezkit.c (or whichever is appropriate) and then the kernel must be recompiled before a module can be used?  Even for a module that is using the identical resources as another module?

QuoteReplyEditDelete

 

 

2009-04-28 02:02:01     Re: Driver probe?

Mike Frysinger (UNITED STATES)

Message: 73334   

 

your terminology is incorrect.  modules are not defined in any board resource file, they are certain Kconfig options that are declared as tristate (which means the code can be built as a module).

 

as every good Linux device driver book and the kernel documentation itself (Documentation/driver-model/platform.txt) explains, platform drivers only get loaded when platform resources are defined for a board.

QuoteReplyEditDelete

 

 

2009-04-28 02:17:45     Re: Driver probe?

Adam Dershowitz (UNITED STATES)

Message: 73336   

 

Sorry about the terminology.  Perhaps it would be better to say that the kernel code must be edited in a way that is specific to each module and that module must be referenced in the kernel code?  So platform resources are specific to a specific driver and are not just hardware related?

QuoteReplyEditDelete

 

 

2009-04-28 02:31:02     Re: Driver probe?

Mike Frysinger (UNITED STATES)

Message: 73339   

 

no, that would not be correct.  linux kernel modules are not dependent upon any aspect of the linux driver model.  a kernel module is merely a piece of code/data that is dynamically loaded at runtime into kernel space.  the exact contents of said module are irrelevant.

 

platform resources directly correspond to a platform driver and describe *exactly* the hardware that the platform driver is concerned with.  please review the .txt file i previously referred to.

QuoteReplyEditDelete

 

 

2009-04-28 12:05:42     Re: Driver probe?

Adam Dershowitz (UNITED STATES)

Message: 73390   

 

I did review that document.

 

What has me confused is that I am not making a hardware change AT ALL.  I am barely making a software change as, for now, I am using an identical driver (except for all the name changing).  I also see that ezkit.c specifically names the t350mcqb.  I didn't say that the exact content of the module must be known in advance, what I said is that the kernel code must reference the module.  Is that not the case?  I see that ezkit.c has ifdefs for many different modules that can be loaded, and I assume by adding mine to that list I can get mine to be probed also?

QuoteReplyEditDelete

 

 

2009-04-28 12:18:52     Re: Driver probe?

Mike Frysinger (UNITED STATES)

Message: 73391   

 

the ifdef's in the board resources are largely an optimization, not a hard requirement.  it doesnt matter that you took an existing driver and renamed it as that is exactly the same thing as having a new driver.  you need to add platform resources that correspond to the new driver you've created.

 

ignore the ifdef stuff and just enable your resources all the time.

QuoteReplyEditDelete

Attachments

    Outcomes