John Kasunich wrote: > Eric H. Johnson wrote: > >> halcmd loadrt hm2_5i20 config="firmware=hm2/5i20/SVST8_4.BIT num_pwmgens=1" ... > The kernel module is expecting a single string parameter called > "config", and you are trying to set its value to > "firmware=hm2/5i20/SVST8_4.BIT num_pwmgens=1" > > But the shell is interpreting the space in that string as a separator. > What is actually getting sent to the module is two parameters: > > 1) a string called "config" containing "firmware=hm2/5i20/SVST8_4.BIT" > > 2) an integer (probably) called "num_pwmgens", with the value 1 > > Since the module doesn't want a parameter called "num_pwmgens", it > causes an error. > > IMO this isn't a great way to handle configs ...
I totally agree it's far from ideal, but it's the least worst thing I could think of at the time. The fundamental problem is the low-level board drivers need to support multiple boards, and each board has multiple pwmgen and stepgen instances etc, each of which will need its own configuration information eventually. So really what's needed is an array of board-config structures. Lacking that, a two-dimensional array for pwmgen configs, another one for stepgens, etc, would work. But modparams dont support either of those data structures. I could hack up something like this: "loadrt hm2_5i20 firmware0=hm2/5i20/SVST12.BIT firmware1=hm2/5i20/SVST8_4.BIT encoder_enable0=1,1 encoder_enable0=0,0,0,0,0,0,0,0 encoder_index0=1,0 stepgen_enable1=1,1,0,0 stepgen_width1=2,2" That's not exactly pretty either, but maybe it's better than the alternatives. You (JMK & SWP) solved this configuration problem by (iirc) adding an "r" chunk to the bit files, but I dont like that, I think the config should be separate from the FPGA firmware. I considered putting the config info in a separate file and let the user supply the filename as a modparam, the driver would request_firmware() to pull it in and parse it in kernel space. That's pretty gross though, the user would have to put the file in /lib/firmware, and writing a config-file parser in kernel space will not make me any friends. :-/ What's there now is essentially that, except the file contents are passed in in the "config" modparam, and the kernel driver parses *that*. -- Sebastian Kuzminsky Theo: "Julian? I haven't seen you in twenty years. You look good. The picture the police have of you doesn't do you justice." Julian: "What do the police know about justice?" ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers