SPI devices and OF

Milton Miller miltonm at bga.com
Fri Apr 6 01:00:23 EST 2007


Ben Herrenschmidt wrote:
> Kumar Gala wrote:
>>  From explicitly board code like we do today.  I mean the mechanism
>> can very so greatly that trying to decided and come up with all
>> possible cases and somehow encoding that in the device tree isn't
>> worth the effort.  Additionally you'll still need code to handle the
>> actual chip select and I don't see how you make that generic at all.

At this point I don't think we are trying to make a generic master.  At
most we are trying to expose the spi device in a manner that can be
reused by board-specific master drivers.

>> A board designer could use I2C, GPIO, or something off an FPGA.  I
>> just dont see trying to 'encode' this in the device tree as providing
>> any real value.
>
> Or board designers can use board specific device-tree bits and board
> specific code to udnerstand them :-) That works too and can be handy if
> you have for example several versions of a board with small differences
> that you want to expose that way in the device-tree.
>
> That is, the devive-tree -can- be used to put proprietary stuff, though
> if you do so, you should try to use prefixes on your properties, like
> mycompany,xxxx

I agree with Ben here.

Asserting the chip select is the responsibility of the master driver,
and that is selected by the compatable property in the device tree
to a specific driver.

The reg property in the device node can be useful to the master driver
wihtout expressing how to assert it in the master node.

milton




More information about the Linuxppc-dev mailing list