linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Reading a config file in a driver ....
@ 2008-01-03  5:03 Misbah khan
  2008-01-03 16:30 ` Olof Johansson
  0 siblings, 1 reply; 7+ messages in thread
From: Misbah khan @ 2008-01-03  5:03 UTC (permalink / raw)
  To: linuxppc-embedded


Hi all ....

I am writing a LCD driver in which the default configuration for LCD would
be loded at the Init . This default configuration if keep in the driver then
for a change in default configuration we need to compile the driver which we
never want . Hence we want a .config file in /etc/lcd.config dir which could
be changed and the next boot will take this configuration as the default
configuration. 

I need to know How to read from the config file in the driver form the dir
/etc/lcd.config. The driver would be installed at boot up 

Please if any of you have an experience in this or could suggest something
,I would really appriciate ...


----Misbah <><
-- 
View this message in context: http://www.nabble.com/Reading-a-config-file-in-a-driver-....-tp14591717p14591717.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading a config file in a driver ....
  2008-01-03  5:03 Reading a config file in a driver Misbah khan
@ 2008-01-03 16:30 ` Olof Johansson
  2008-01-03 18:43   ` Carlos Munoz
  2008-01-04  8:36   ` Reading a config file in a driver Misbah khan
  0 siblings, 2 replies; 7+ messages in thread
From: Olof Johansson @ 2008-01-03 16:30 UTC (permalink / raw)
  To: Misbah khan; +Cc: linuxppc-embedded

On Wed, Jan 02, 2008 at 09:03:20PM -0800, Misbah khan wrote:
> 
> Hi all ....
> 
> I am writing a LCD driver in which the default configuration for LCD would
> be loded at the Init . This default configuration if keep in the driver then
> for a change in default configuration we need to compile the driver which we
> never want . Hence we want a .config file in /etc/lcd.config dir which could
> be changed and the next boot will take this configuration as the default
> configuration. 
> 
> I need to know How to read from the config file in the driver form the dir
> /etc/lcd.config. The driver would be installed at boot up 

The driver/kernel shouldn't read the file directly, if anything you
should have a userspace tool that reads it and adjusts the driver via
sysfs or similar. That tool can be run from some of the init scripts,
or from the ramdisk in case you want to do it early.


-Olof

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading a config file in a driver ....
  2008-01-03 16:30 ` Olof Johansson
@ 2008-01-03 18:43   ` Carlos Munoz
  2008-01-04  8:32     ` Misbah khan
  2008-01-04  8:36   ` Reading a config file in a driver Misbah khan
  1 sibling, 1 reply; 7+ messages in thread
From: Carlos Munoz @ 2008-01-03 18:43 UTC (permalink / raw)
  To: Misbah khan; +Cc: linuxppc-embedded

Olof Johansson wrote:
> On Wed, Jan 02, 2008 at 09:03:20PM -0800, Misbah khan wrote:
>   
>> Hi all ....
>>
>> I am writing a LCD driver in which the default configuration for LCD would
>> be loded at the Init . This default configuration if keep in the driver then
>> for a change in default configuration we need to compile the driver which we
>> never want . Hence we want a .config file in /etc/lcd.config dir which could
>> be changed and the next boot will take this configuration as the default
>> configuration. 
>>
>> I need to know How to read from the config file in the driver form the dir
>> /etc/lcd.config. The driver would be installed at boot up 
>>     
>
> The driver/kernel shouldn't read the file directly, if anything you
> should have a userspace tool that reads it and adjusts the driver via
> sysfs or similar. That tool can be run from some of the init scripts,
> or from the ramdisk in case you want to do it early.
>   
What I've done in the past is to use module_param() to define variables 
that get set when the module is loaded. Then all you need to do is edit 
the /etc/modules file and change the parameter value. However, this 
technique is only efficient if only a few parameters will ever change. 
If you need to change more than a few parameters, Olof's suggestion 
would be preferred.

Carlos

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading a config file in a driver ....
  2008-01-03 18:43   ` Carlos Munoz
@ 2008-01-04  8:32     ` Misbah khan
  2008-01-04 20:58       ` Control not branching to the instruction present at resetvec i.e 0xfffffffc ravi.rao
  0 siblings, 1 reply; 7+ messages in thread
From: Misbah khan @ 2008-01-04  8:32 UTC (permalink / raw)
  To: linuxppc-embedded


i appriciate your concept and i need to know this :-

The config should be in a structure or a bit mask . The user will have to
change the value whenever he needs to change the default config. Where
should i put that struct or bit field defination ???? He should know it
preciesly before he change ????

Can you share with me your Implimentation so that i could get the exactly
how you had done ...

----Misbah < ><

Carlos Munoz-2 wrote:
> 
> Olof Johansson wrote:
>> On Wed, Jan 02, 2008 at 09:03:20PM -0800, Misbah khan wrote:
>>   
>>> Hi all ....
>>>
>>> I am writing a LCD driver in which the default configuration for LCD
>>> would
>>> be loded at the Init . This default configuration if keep in the driver
>>> then
>>> for a change in default configuration we need to compile the driver
>>> which we
>>> never want . Hence we want a .config file in /etc/lcd.config dir which
>>> could
>>> be changed and the next boot will take this configuration as the default
>>> configuration. 
>>>
>>> I need to know How to read from the config file in the driver form the
>>> dir
>>> /etc/lcd.config. The driver would be installed at boot up 
>>>     
>>
>> The driver/kernel shouldn't read the file directly, if anything you
>> should have a userspace tool that reads it and adjusts the driver via
>> sysfs or similar. That tool can be run from some of the init scripts,
>> or from the ramdisk in case you want to do it early.
>>   
> What I've done in the past is to use module_param() to define variables 
> that get set when the module is loaded. Then all you need to do is edit 
> the /etc/modules file and change the parameter value. However, this 
> technique is only efficient if only a few parameters will ever change. 
> If you need to change more than a few parameters, Olof's suggestion 
> would be preferred.
> 
> Carlos
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/Reading-a-config-file-in-a-driver-....-tp14591717p14612548.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading a config file in a driver ....
  2008-01-03 16:30 ` Olof Johansson
  2008-01-03 18:43   ` Carlos Munoz
@ 2008-01-04  8:36   ` Misbah khan
  1 sibling, 0 replies; 7+ messages in thread
From: Misbah khan @ 2008-01-04  8:36 UTC (permalink / raw)
  To: linuxppc-embedded


Could you please let me know How in the driver i could be able to read the
file present in sysfs ??? Using init script how should i creat and edit the
file ????

I never had done these hence your suggession could be a better way for me to
learn it .

---Misbah


Olof Johansson-2 wrote:
> 
> On Wed, Jan 02, 2008 at 09:03:20PM -0800, Misbah khan wrote:
>> 
>> Hi all ....
>> 
>> I am writing a LCD driver in which the default configuration for LCD
>> would
>> be loded at the Init . This default configuration if keep in the driver
>> then
>> for a change in default configuration we need to compile the driver which
>> we
>> never want . Hence we want a .config file in /etc/lcd.config dir which
>> could
>> be changed and the next boot will take this configuration as the default
>> configuration. 
>> 
>> I need to know How to read from the config file in the driver form the
>> dir
>> /etc/lcd.config. The driver would be installed at boot up 
> 
> The driver/kernel shouldn't read the file directly, if anything you
> should have a userspace tool that reads it and adjusts the driver via
> sysfs or similar. That tool can be run from some of the init scripts,
> or from the ramdisk in case you want to do it early.
> 
> 
> -Olof
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/Reading-a-config-file-in-a-driver-....-tp14591717p14612555.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Control not branching to the instruction present at resetvec i.e 0xfffffffc
  2008-01-04  8:32     ` Misbah khan
@ 2008-01-04 20:58       ` ravi.rao
  2008-01-05 14:19         ` Misbah khan
  0 siblings, 1 reply; 7+ messages in thread
From: ravi.rao @ 2008-01-04 20:58 UTC (permalink / raw)
  To: linuxlink-help; +Cc: Miki.Groftisza, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

Hi All,
    We have a custom target board based on PPC-EP405. We just got the 
board from the hardware team .I connected the board to BDI200 and powered 
it on. 
The control came to the resetvec address which is 0xfffffffc. I was able 
to read and write to flash. So I erased the flash and burnt the bootloader 
into flash from 0xfffc0000.
I verified that the instruction at 0xfffffffc is 4bfc2104 whicis actually 
a branch to 0xfffc2100. Also a memory dump of 0xfffc2100 shows the correct 
code. This proved that
the uboot bootloader was burnt properly.
Now when I reset the board the control never reaches 0xfffc2100 i.e for 
some reason the code at the resetvec is not getting executed. Any help or 
pointers to resolve this is greatly appreciated.
Thanks,
Ravishankar Govindarao
RFL Electronics Inc.
E-mail : Ravi.Rao@rflelect.com
Voice: 973.334.3100 Ext. 233
Fax: 973.334.3863
 
CONFIDENTIALITY NOTE
This e-mail, including any attachments, may contain confidential and/or 
legally privileged information.  The Information is intended only for the 
use of the individual or entity named on this e-mail .  If you are not the 
intended recipient, you are hereby notified that any disclosure, copying, 
distribution, or the taking of any action in reliance on the contents of 
this transmitted Information is strictly prohibited.  Further, if you are 
not the intended recipient, please notify us by return e-mail and delete 
the Information promptly.
 
 
 

[-- Attachment #2: Type: text/html, Size: 2192 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Control not branching to the instruction present at resetvec i.e 0xfffffffc
  2008-01-04 20:58       ` Control not branching to the instruction present at resetvec i.e 0xfffffffc ravi.rao
@ 2008-01-05 14:19         ` Misbah khan
  0 siblings, 0 replies; 7+ messages in thread
From: Misbah khan @ 2008-01-05 14:19 UTC (permalink / raw)
  To: linuxppc-embedded


Hi Mr Ravi ...
I suggest you to post a new concern in a new thread ....

----Misbah 

ravi.rao wrote:
> 
> Hi All,
>     We have a custom target board based on PPC-EP405. We just got the 
> board from the hardware team .I connected the board to BDI200 and powered 
> it on. 
> The control came to the resetvec address which is 0xfffffffc. I was able 
> to read and write to flash. So I erased the flash and burnt the bootloader 
> into flash from 0xfffc0000.
> I verified that the instruction at 0xfffffffc is 4bfc2104 whicis actually 
> a branch to 0xfffc2100. Also a memory dump of 0xfffc2100 shows the correct 
> code. This proved that
> the uboot bootloader was burnt properly.
> Now when I reset the board the control never reaches 0xfffc2100 i.e for 
> some reason the code at the resetvec is not getting executed. Any help or 
> pointers to resolve this is greatly appreciated.
> Thanks,
> Ravishankar Govindarao
> RFL Electronics Inc.
> E-mail : Ravi.Rao@rflelect.com
> Voice: 973.334.3100 Ext. 233
> Fax: 973.334.3863
>  
> CONFIDENTIALITY NOTE
> This e-mail, including any attachments, may contain confidential and/or 
> legally privileged information.  The Information is intended only for the 
> use of the individual or entity named on this e-mail .  If you are not the 
> intended recipient, you are hereby notified that any disclosure, copying, 
> distribution, or the taking of any action in reliance on the contents of 
> this transmitted Information is strictly prohibited.  Further, if you are 
> not the intended recipient, please notify us by return e-mail and delete 
> the Information promptly.
>  
>  
>  
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 

-- 
View this message in context: http://www.nabble.com/Reading-a-config-file-in-a-driver-....-tp14591717p14633599.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-05 14:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-03  5:03 Reading a config file in a driver Misbah khan
2008-01-03 16:30 ` Olof Johansson
2008-01-03 18:43   ` Carlos Munoz
2008-01-04  8:32     ` Misbah khan
2008-01-04 20:58       ` Control not branching to the instruction present at resetvec i.e 0xfffffffc ravi.rao
2008-01-05 14:19         ` Misbah khan
2008-01-04  8:36   ` Reading a config file in a driver Misbah khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).