On Tue, Jul 27, 2010 at 11:28 AM, Anatolij Gustschin <ag...@denx.de> wrote: > On Tue, 27 Jul 2010 10:58:33 -0600 > Grant Likely <grant.lik...@secretlab.ca> wrote: > ... >> >> > + s...@11900 { >> >> > + compatible = "fsl,mpc5121-psc-spi", >> >> > "fsl,mpc5121-psc"; >> >> > + cell-index = <9>; >> >> >> >> Try to drop the cell-index properties. They are almost always misused. >> > >> > Removing cell-index would require changing the spi driver's probe. >> > Currently cell-index is used to set spi bus number. What could be used >> > for bus enumeration instead? Is it okay to use part of the spi node >> > address? e.g. obtaining the offset 0x11900, masking out the unrelated >> > bits and shifting by 8 would deliver unique index 9 for PSC9 in SPI >> > mode. This would work for all 12 PSC SPI controllers of mpc5121. >> >> Does the spi bus number really matter? The device tree context gives >> you a firm association between spi masters and devices which doesn't >> require assigning a specific bus number. The core spi code can >> dynamically assign a bus number for the bus by setting bus_num to -1. > > The bus number is used in the mpc5121 psc spi driver to obtain correct > clock for PSC in question (0 to 11) and to enable the PSC clock at probe > time. Therefore using dynamically assigned bus number would require another > change to the spi driver.
That's unrelated to the bus number. Use cell-index value directly for obtaining the clock if you need to; but limit its exposure. Once Jeremy gets his common clock architecture merged, then we could probably migrate to that for obtaining the correct clock without cell-index. g. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev