]> git.sur5r.net Git - u-boot/commit
mii: add read-modify-write option to mii command
authorTim James <tim.james@macltd.com>
Wed, 25 Mar 2015 11:55:15 +0000 (11:55 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Mon, 20 Apr 2015 22:57:12 +0000 (17:57 -0500)
commita095f047ebf3ee098e7b84197d765029e0797dd3
treea1e09c4991b65ba57a52a2b3ff8ca2560a4df9f3
parenta60de1ee7fc49480b90996eef7bbeb66e67a7808
mii: add read-modify-write option to mii command

When accessing PHY registers it is often desirable to only update
selected bits, so it is necessary to first read the current value
before writing back an modified value with the relevant bits
updated.

To simplify this and to allow such operations to be incorporated
into simple shell scripts propose adding a 'modify' option to the
existing mii command, which takes a mask indicating the bits to
be updated in addition to a data value containing the new bits,
ie, <updated> = (<data> & <mask>) | (<current> & ~<mask>).

Signed-off-by: Tim <tim.james@macltd.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tim <tim.james@macltd.com>
common/cmd_mii.c