Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UltraSPARC III/IIe cpufreq drivers, please test



On Wed, Oct 01, 2014 at 03:42:51PM +0200, BERTRAND Joël wrote:
> Martin Husemann a écrit :
> >On Mon, Sep 29, 2014 at 02:19:00PM +1000, matthew green wrote:
> >>this is some what tricky.  ideally, it should be derived from
> >>the cpu device, and that should find and talk to the schizo
> >>device that controls it.
> >
> >Since mainbus device detection is mostly hardcoded, can't we rely on all
> >cpus to attach their autoconfig device node before any pci root hub is
> >attached?
> 
> 	Why not. But I don't know autoconf process enough to write it. Do 
> 	you have some ideas to start ?

Ok, looking at it again in more detail, I think we should do it differently.

Unfortunately this looks like it would need copy&pasting to all pci root
implementations (ideas to avoid that welcome).

Let's for example take schizo_attach:

 - go up one node (OF_parent(ma->ma_node))
 - basically clone the loop used to get the number of cpus from the
   firmware (get_ncpus) and just count, which index (from OF's point
   of view) each gets
 - within the same loop, count the PCI's, for each read the first word
   from the "reg" property to find out wether it is bus A or B (same
   condition we use in the attach code to set sp_bus_a). If bus is A,
   count the node

Now we should get the same node index for cpu and schizo, so if the
schizo node is the same node as in our attach args, we have found our
cpu and can break out of the loop.

Once we know the node of the CPU we are looking for, we can do a loop over
all CPUs and compare it against ci->ci_node.

This should work completely independent of all kernel config contents.

Martin


Home | Main Index | Thread Index | Old Index