All of lore.kernel.org
 help / color / mirror / Atom feed
* Platform device style question
@ 2006-08-24 17:53 Ben Warren
  2006-08-24 18:06 ` Vitaly Bordug
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Warren @ 2006-08-24 17:53 UTC (permalink / raw)
  To: linuxppc-embedded

Hello,

A 'newbie-to-platform-devices' question:

In a patch that Kumar just sent for a compact flash device, the resource
data (I/O addresses, IRQ # etc.) are retrieved from the platform system.
I guess I can either modify the device tree in U-boot by adding
additional nodes, or instantiate a platform device in Linux __init code
based on static information.  The former gives the advantage of having
the bootloader pass the info to the OS.  (Somebody please correct me if
I'm off-base here!)  

Are device trees meant to only contain information about the CPU and
tightly-coupled peripherals, or is it considered OK-form to also include
board-level hardware info?  I guess they can really hold anything, but
I'm trying to figure out the original intent.

regards,
Ben

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

* Re: Platform device style question
  2006-08-24 17:53 Platform device style question Ben Warren
@ 2006-08-24 18:06 ` Vitaly Bordug
  2006-08-24 18:43   ` Ben Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Vitaly Bordug @ 2006-08-24 18:06 UTC (permalink / raw)
  To: bwarren; +Cc: linuxppc-embedded

On Thu, 24 Aug 2006 13:53:17 -0400
Ben Warren <bwarren@qstreams.com> wrote:

> Hello,
> 
> A 'newbie-to-platform-devices' question:
> 
> In a patch that Kumar just sent for a compact flash device, the resource
> data (I/O addresses, IRQ # etc.) are retrieved from the platform system.
> I guess I can either modify the device tree in U-boot by adding
> additional nodes, or instantiate a platform device in Linux __init code
> based on static information.  The former gives the advantage of having
> the bootloader pass the info to the OS.  (Somebody please correct me if
> I'm off-base here!)  
> 
I'd suggest to make a look at LDD concerning linux device model...
For platform device, there's no need to cope with u-boot at all. You'll prolly need to 
register the respective platform device from the board-specific code, with proper name 
and driver's board-specific platform info. You may have a look at arch/ppc/syslib/ppc_sys.c about static
PD definitions usage.


> Are device trees meant to only contain information about the CPU and
> tightly-coupled peripherals, or is it considered OK-form to also include
> board-level hardware info?  I guess they can really hold anything, but
> I'm trying to figure out the original intent.
> 
I'd make sense to figure out the platform device bus before digging into device trees. It's slightly 
different stuff, for similar aim, but anyway... Actually you do not strictly need devtree to cope with 
your case afaiu.

> regards,
> Ben
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 


-- 
Sincerely, 
Vitaly

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

* Re: Platform device style question
  2006-08-24 18:06 ` Vitaly Bordug
@ 2006-08-24 18:43   ` Ben Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Warren @ 2006-08-24 18:43 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded

Thanks Vitaly,

On Thu, 2006-08-24 at 22:06 +0400, Vitaly Bordug wrote:

> I'd suggest to make a look at LDD concerning linux device model...
Thanks.  I'll read it again.  My little brain absorbs this stuff very
slowly.
> For platform device, there's no need to cope with u-boot at all. You'll prolly need to 
> register the respective platform device from the board-specific code, with proper name 
> and driver's board-specific platform info. You may have a look at arch/ppc/syslib/ppc_sys.c about static
> PD definitions usage.

My particular platform (MPC8349) gets its hardware info (CPU, IMMBAR,
PCI, I2C, SPI resources etc.) from an OF device tree that is generated
alongside U-boot and I guess embedded in the uImage file.  (I apologize
if I'm getting my jargon mixed up here)  The OF device tree idea seemed
like a slick way to abstract away some HW settings from Linux.  I was
imagining writing board-side platform device registration that gets its
settings from the device tree, allowing a bit of re-use between similar
but not identical boards.
> 

> I'd make sense to figure out the platform device bus before digging into device trees. It's slightly 
> different stuff, for similar aim, but anyway... Actually you do not strictly need devtree to cope with 
> your case afaiu.

I definitely have much learning to do.  Thanks very much for the
pointers!

regards,
Ben

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

end of thread, other threads:[~2006-08-24 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-24 17:53 Platform device style question Ben Warren
2006-08-24 18:06 ` Vitaly Bordug
2006-08-24 18:43   ` Ben Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.