lkml.org 
[lkml]   [2013]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sysfs for my chips
On Thu, Oct 10, 2013 at 03:19:48PM +1100, Benjamin Herrenschmidt wrote:
> Hi Greg !
>
> (random CC list of clueful people)
>
> On some new powerpc platforms (non-hypervisor or rather linux is the
> hypervisor), I want to expose a bunch of stuff per "chip", the chips
> being currently the processor chips and the "centaurs" (think of them as
> the bottom half of the memory controllers).
>
> Among other, I want a sysfs file in there to access "xscom" on the chip
> which is a sideband bus used for low level stuff (think jtag on steroid)
> which we can use, among others, for chip health monitoring, general
> debugging and diagnostics, etc...
>
> I might add more such as VPD, model information, etc... later or at
> least a link to corresponding device-tree node.

So a mixture of things that traditionally have been in /proc/cpuinfo?

I've always wanted to see the cpuinfo files turn into sysfs files, so
that tools can parse them "properly" and not have to do different things
on different arches, like the proc/cpuinfo file is today (a mess).

> How do you suggest I expose that ? So far I've been thinking about
> something like
>
> /sys/chips/{processor,centaur}/chip#/files
>
> or to avoid namespace clashes
>
> /sys/firmware/chips/{processor,centaur}/chip#/files
>
> Or maybe just
>
> /sys/firmware/chips/chip#/files
>
> (the chip type can be inferred from the chip#, they use the same space
> at least as far my firmware exposes them to Linux)
>
> (the actual access to xscom goes via firmware tho it makes *some* sense)
>
> But I could instead create platform devices corresponding to the
> device-tree representation of each of those chips ... and have the
> platform devices contain the magic attributes. That's a bit more
> convoluted though.

We already create platform devices for the cpus in the system in
/sys/devices/system/, so can you just hang the attribute files off of
those platform devices?

And system devices seem like the correct thing for your "chips" that are
not cpus, right?

thanks,

greg k-h


\
 
 \ /
  Last update: 2013-10-10 20:21    [W:0.063 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site