On Fri, Nov 19, 2010 at 4:13 PM, David Daney <ddaney@caviumnetworks.com> wrote:
My inclination is to shy away from such hard-coded values. I agreed
with Grant's comment about separating into separate cells, but I think
specification of hard-coded register writes is too rigid. I think a
better approach would be to specify configuration attributes, like:
marvell,blink-periods = <blah>;
marvell,led-config = <[drive type] [indicates]>;
For one, I always advocate making the DTS human-readable. For
another, I think that there are a number of configuration sequences
that require read-modify-write, or write-wait-write. In other words,
I think that there are enough cases where actual software will be
needed, that an attempt to generically specify a register
initialization sequence will be impossible, and leave us with the same
problems to solve later on. For third...ly... allowing
device-tree-specified register initializations might encourage
developers to put all of their register initializations in the device
tree. Especially when they realize that the LED initialization for
*their* PHY has to come between two standard initialization steps in
the driver. Or before. Or after.
By specifying actual functionality, the driver can work around those
problems, while being aware of the functional goal. However, I'm
aware that such a path is more difficult, and perhaps just as futile,
as PHY vendors frequently don't want to document what their magic
sequences mean.
Andy
--