]> git.kernelconcepts.de Git - karo-tx-uboot.git/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)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:29:19 +0000 (22:29 +0200)
commit43a6d6d930360940cb95efaf9483721c9362a86a
tree4e9b5cae8dc56b79ec6ffbf2a72d11fa061b68fb
parentc156d6366eacf0ae80ea502b1544e10450d79af7
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