public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
@ 2007-12-28  3:50 Shinya Kuribayashi
  2007-12-29 12:38 ` gvb.uboot
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Shinya Kuribayashi @ 2007-12-28  3:50 UTC (permalink / raw)
  To: u-boot

We now have more useful version of do_mii() and everybody use it. Grald
Van Baren says

> When I originally wrote the mii command 6(!) years ago, I wrote a 
> verbose version that printed human readable decomposition of the flags, 
> etc., and a terse one that didn't print as much stuff and thus had a 
> smaller memory footprint.
> 
> It sounds like the terse version has withered and died, apparently 
> people are only using the verbose version (which is very understandable, 
> I do myself).

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---

 common/cmd_mii.c |  139 ------------------------------------------------------
 1 files changed, 0 insertions(+), 139 deletions(-)

diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index b99bd06..e44e45c 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -29,143 +29,6 @@
 #include <command.h>
 #include <miiphy.h>
 
-#ifdef CONFIG_TERSE_MII
-/*
- * Display values from last command.
- */
-uint last_op;
-uint last_addr;
-uint last_data;
-uint last_reg;
-
-/*
- * MII device/info/read/write
- *
- * Syntax:
- *  mii device {devname}
- *  mii info   {addr}
- *  mii read   {addr} {reg}
- *  mii write  {addr} {reg} {data}
- */
-int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
-	char		op;
-	unsigned char	addr, reg;
-	unsigned short	data;
-	int		rcode = 0;
-	char		*devname;
-
-	if (argc < 2) {
-		printf ("Usage:\n%s\n", cmdtp->usage);
-		return 1;
-	}
-
-#if defined(CONFIG_8xx) || defined(CONFIG_MCF52x2)
-	mii_init ();
-#endif
-
-	/*
-	 * We use the last specified parameters, unless new ones are
-	 * entered.
-	 */
-	op   = last_op;
-	addr = last_addr;
-	data = last_data;
-	reg  = last_reg;
-
-	if ((flag & CMD_FLAG_REPEAT) == 0) {
-		op = argv[1][0];
-		if (argc >= 3)
-			addr = simple_strtoul (argv[2], NULL, 16);
-		if (argc >= 4)
-			reg  = simple_strtoul (argv[3], NULL, 16);
-		if (argc >= 5)
-			data = simple_strtoul (argv[4], NULL, 16);
-	}
-
-	/* use current device */
-	devname = miiphy_get_current_dev();
-
-	/*
-	 * check device/read/write/list.
-	 */
-	if (op == 'i') {
-		unsigned char j, start, end;
-		unsigned int oui;
-		unsigned char model;
-		unsigned char rev;
-
-		/*
-		 * Look for any and all PHYs.  Valid addresses are 0..31.
-		 */
-		if (argc >= 3) {
-			start = addr; end = addr + 1;
-		} else {
-			start = 0; end = 31;
-		}
-
-		for (j = start; j < end; j++) {
-			if (miiphy_info (devname, j, &oui, &model, &rev) == 0) {
-				printf ("PHY 0x%02X: "
-					"OUI = 0x%04X, "
-					"Model = 0x%02X, "
-					"Rev = 0x%02X, "
-					"%3dbase%s, %s\n",
-					j, oui, model, rev,
-					miiphy_speed (devname, j),
-					miiphy_is_1000base_x (devname, j)
-						? "X" : "T",
-					(miiphy_duplex (devname, j) == FULL)
-						? "FDX" : "HDX");
-			}
-		}
-	} else if (op == 'r') {
-		if (miiphy_read (devname, addr, reg, &data) != 0) {
-			puts ("Error reading from the PHY\n");
-			rcode = 1;
-		} else {
-			printf ("%04X\n", data & 0x0000FFFF);
-		}
-	} else if (op == 'w') {
-		if (miiphy_write (devname, addr, reg, data) != 0) {
-			puts ("Error writing to the PHY\n");
-			rcode = 1;
-		}
-	} else if (op == 'd') {
-		if (argc == 2)
-			miiphy_listdev ();
-		else
-			miiphy_set_current_dev (argv[2]);
-	} else {
-		printf ("Usage:\n%s\n", cmdtp->usage);
-		return 1;
-	}
-
-	/*
-	 * Save the parameters for repeats.
-	 */
-	last_op = op;
-	last_addr = addr;
-	last_data = data;
-	last_reg = reg;
-
-	return rcode;
-}
-
-/***************************************************/
-
-U_BOOT_CMD(
-	mii,	5,	1,	do_mii,
-	"mii     - MII utility commands\n",
-	"device                     - list available devices\n"
-	"mii device <devname>           - set current device\n"
-	"mii info   <addr>              - display MII PHY info\n"
-	"mii read   <addr> <reg>        - read  MII PHY <addr> register <reg>\n"
-	"mii write  <addr> <reg> <data> - write MII PHY <addr> register <reg>\n"
-);
-
-#else /* ! CONFIG_TERSE_MII ================================================= */
-
 typedef struct _MII_reg_desc_t {
 	ushort regno;
 	char * name;
@@ -601,5 +464,3 @@ U_BOOT_CMD(
 	"mii dump   <addr> <reg>        - pretty-print <addr> <reg> (0-5 only)\n"
 	"Addr and/or reg may be ranges, e.g. 2-7.\n"
 );
-
-#endif /* CONFIG_TERSE_MII */

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
  2007-12-28  3:50 [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii() Shinya Kuribayashi
@ 2007-12-29 12:38 ` gvb.uboot
  2008-01-04  4:30   ` Shinya Kuribayashi
  2008-01-07  5:32 ` [U-Boot-Users] [PATCH] Remove the "terse" " Shinya Kuribayashi
  2008-01-09 20:44 ` [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse " Wolfgang Denk
  2 siblings, 1 reply; 8+ messages in thread
From: gvb.uboot @ 2007-12-29 12:38 UTC (permalink / raw)
  To: u-boot

Shinya Kuribayashi wrote:
> We now have more useful version of do_mii() and everybody use it. Grald
> Van Baren says
> 
>> When I originally wrote the mii command 6(!) years ago, I wrote a 
>> verbose version that printed human readable decomposition of the flags, 
>> etc., and a terse one that didn't print as much stuff and thus had a 
>> smaller memory footprint.
>>
>> It sounds like the terse version has withered and died, apparently 
>> people are only using the verbose version (which is very understandable, 
>> I do myself).
> 
> Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>

Hi Shinya,

Thanks for the patch to clean this up.  While I agree with the patch, I 
would appreciate respinning it:
* I should be an "Acked by" rather than a signed off by since I didn't 
do anything to generate the patch itself.

* I would also offer the following summary rather than quoting my 
original email (including the 6(!) year reference, which will look kinda 
funny in 2012 ;-):

Remove the "terse" version of the mii command, eliminating an #ifdef and 
apparently unused code.  The space savings of the "terse" version is not 
significant and it isn't worth the extra maintenance effort to keep it.

Acked-by: Gerald Van Baren <vanbaren@cideas.com>

Thanks,
gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
  2007-12-29 12:38 ` gvb.uboot
@ 2008-01-04  4:30   ` Shinya Kuribayashi
  2008-01-04 12:38     ` Jerry Van Baren
  0 siblings, 1 reply; 8+ messages in thread
From: Shinya Kuribayashi @ 2008-01-04  4:30 UTC (permalink / raw)
  To: u-boot

gvb.uboot wrote:
> Thanks for the patch to clean this up.  While I agree with the patch, I 
> would appreciate respinning it:
> * I should be an "Acked by" rather than a signed off by since I didn't 
> do anything to generate the patch itself.

As you are the original writer, IMHO you could/should signed-off-by :-)
But it was my bad to add your sign without asking you. I'll resubmit the
patch later with your acked-by.

> * I would also offer the following summary rather than quoting my 
> original email (including the 6(!) year reference, which will look kinda 
> funny in 2012 ;-):
> 
> Remove the "terse" version of the mii command, eliminating an #ifdef and 
> apparently unused code.  The space savings of the "terse" version is not 
> significant and it isn't worth the extra maintenance effort to keep it.

Thanks for your kind summary.

  Shinya

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
  2008-01-04  4:30   ` Shinya Kuribayashi
@ 2008-01-04 12:38     ` Jerry Van Baren
  0 siblings, 0 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-01-04 12:38 UTC (permalink / raw)
  To: u-boot

Shinya Kuribayashi wrote:
> gvb.uboot wrote:
>> Thanks for the patch to clean this up.  While I agree with the patch, 
>> I would appreciate respinning it:
>> * I should be an "Acked by" rather than a signed off by since I didn't 
>> do anything to generate the patch itself.
> 
> As you are the original writer, IMHO you could/should signed-off-by :-)
> But it was my bad to add your sign without asking you. I'll resubmit the
> patch later with your acked-by.

I figure that an acked-by is more appropriate than a signed-off-by 
because, while I approve of the patch, I didn't actually contribute to 
it directly (I contributed the anti-patch, that is, the code that is 
being removed... but that already has my signed-off-by on it).

> Thanks for your kind summary.
> 
>  Shinya

Thanks for rerolling,
gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH] Remove the "terse" version of do_mii()
  2007-12-28  3:50 [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii() Shinya Kuribayashi
  2007-12-29 12:38 ` gvb.uboot
@ 2008-01-07  5:32 ` Shinya Kuribayashi
  2008-01-09 20:44 ` [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse " Wolfgang Denk
  2 siblings, 0 replies; 8+ messages in thread
From: Shinya Kuribayashi @ 2008-01-07  5:32 UTC (permalink / raw)
  To: u-boot

Remove the "terse" version of the mii command, eliminating an #ifdef and
apparently unused code.  The space savings of the "terse" version is not
significant and it isn't worth the extra maintenance effort to keep it.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
---

 common/cmd_mii.c |  139 ------------------------------------------------------
 1 files changed, 0 insertions(+), 139 deletions(-)


diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index b99bd06..e44e45c 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -29,143 +29,6 @@
 #include <command.h>
 #include <miiphy.h>
 
-#ifdef CONFIG_TERSE_MII
-/*
- * Display values from last command.
- */
-uint last_op;
-uint last_addr;
-uint last_data;
-uint last_reg;
-
-/*
- * MII device/info/read/write
- *
- * Syntax:
- *  mii device {devname}
- *  mii info   {addr}
- *  mii read   {addr} {reg}
- *  mii write  {addr} {reg} {data}
- */
-int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
-	char		op;
-	unsigned char	addr, reg;
-	unsigned short	data;
-	int		rcode = 0;
-	char		*devname;
-
-	if (argc < 2) {
-		printf ("Usage:\n%s\n", cmdtp->usage);
-		return 1;
-	}
-
-#if defined(CONFIG_8xx) || defined(CONFIG_MCF52x2)
-	mii_init ();
-#endif
-
-	/*
-	 * We use the last specified parameters, unless new ones are
-	 * entered.
-	 */
-	op   = last_op;
-	addr = last_addr;
-	data = last_data;
-	reg  = last_reg;
-
-	if ((flag & CMD_FLAG_REPEAT) == 0) {
-		op = argv[1][0];
-		if (argc >= 3)
-			addr = simple_strtoul (argv[2], NULL, 16);
-		if (argc >= 4)
-			reg  = simple_strtoul (argv[3], NULL, 16);
-		if (argc >= 5)
-			data = simple_strtoul (argv[4], NULL, 16);
-	}
-
-	/* use current device */
-	devname = miiphy_get_current_dev();
-
-	/*
-	 * check device/read/write/list.
-	 */
-	if (op == 'i') {
-		unsigned char j, start, end;
-		unsigned int oui;
-		unsigned char model;
-		unsigned char rev;
-
-		/*
-		 * Look for any and all PHYs.  Valid addresses are 0..31.
-		 */
-		if (argc >= 3) {
-			start = addr; end = addr + 1;
-		} else {
-			start = 0; end = 31;
-		}
-
-		for (j = start; j < end; j++) {
-			if (miiphy_info (devname, j, &oui, &model, &rev) == 0) {
-				printf ("PHY 0x%02X: "
-					"OUI = 0x%04X, "
-					"Model = 0x%02X, "
-					"Rev = 0x%02X, "
-					"%3dbase%s, %s\n",
-					j, oui, model, rev,
-					miiphy_speed (devname, j),
-					miiphy_is_1000base_x (devname, j)
-						? "X" : "T",
-					(miiphy_duplex (devname, j) == FULL)
-						? "FDX" : "HDX");
-			}
-		}
-	} else if (op == 'r') {
-		if (miiphy_read (devname, addr, reg, &data) != 0) {
-			puts ("Error reading from the PHY\n");
-			rcode = 1;
-		} else {
-			printf ("%04X\n", data & 0x0000FFFF);
-		}
-	} else if (op == 'w') {
-		if (miiphy_write (devname, addr, reg, data) != 0) {
-			puts ("Error writing to the PHY\n");
-			rcode = 1;
-		}
-	} else if (op == 'd') {
-		if (argc == 2)
-			miiphy_listdev ();
-		else
-			miiphy_set_current_dev (argv[2]);
-	} else {
-		printf ("Usage:\n%s\n", cmdtp->usage);
-		return 1;
-	}
-
-	/*
-	 * Save the parameters for repeats.
-	 */
-	last_op = op;
-	last_addr = addr;
-	last_data = data;
-	last_reg = reg;
-
-	return rcode;
-}
-
-/***************************************************/
-
-U_BOOT_CMD(
-	mii,	5,	1,	do_mii,
-	"mii     - MII utility commands\n",
-	"device                     - list available devices\n"
-	"mii device <devname>           - set current device\n"
-	"mii info   <addr>              - display MII PHY info\n"
-	"mii read   <addr> <reg>        - read  MII PHY <addr> register <reg>\n"
-	"mii write  <addr> <reg> <data> - write MII PHY <addr> register <reg>\n"
-);
-
-#else /* ! CONFIG_TERSE_MII ================================================= */
-
 typedef struct _MII_reg_desc_t {
 	ushort regno;
 	char * name;
@@ -601,5 +464,3 @@ U_BOOT_CMD(
 	"mii dump   <addr> <reg>        - pretty-print <addr> <reg> (0-5 only)\n"
 	"Addr and/or reg may be ranges, e.g. 2-7.\n"
 );
-
-#endif /* CONFIG_TERSE_MII */

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
  2007-12-28  3:50 [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii() Shinya Kuribayashi
  2007-12-29 12:38 ` gvb.uboot
  2008-01-07  5:32 ` [U-Boot-Users] [PATCH] Remove the "terse" " Shinya Kuribayashi
@ 2008-01-09 20:44 ` Wolfgang Denk
  2008-01-09 20:46   ` Jerry Van Baren
  2008-01-09 20:48   ` Jerry Van Baren
  2 siblings, 2 replies; 8+ messages in thread
From: Wolfgang Denk @ 2008-01-09 20:44 UTC (permalink / raw)
  To: u-boot

In message <477472A3.4020201@necel.com> you wrote:
> We now have more useful version of do_mii() and everybody use it. Grald
> Van Baren says
> 
> > When I originally wrote the mii command 6(!) years ago, I wrote a 
> > verbose version that printed human readable decomposition of the flags, 
> > etc., and a terse one that didn't print as much stuff and thus had a 
> > smaller memory footprint.
> > 
> > It sounds like the terse version has withered and died, apparently 
> > people are only using the verbose version (which is very understandable, 
> > I do myself).
> 
> Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I think there's a world market for about five computers.
         -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
  2008-01-09 20:44 ` [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse " Wolfgang Denk
@ 2008-01-09 20:46   ` Jerry Van Baren
  2008-01-09 20:48   ` Jerry Van Baren
  1 sibling, 0 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-01-09 20:46 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <477472A3.4020201@necel.com> you wrote:
>> We now have more useful version of do_mii() and everybody use it. Grald
>> Van Baren says
>>
>>> When I originally wrote the mii command 6(!) years ago, I wrote a 
>>> verbose version that printed human readable decomposition of the flags, 
>>> etc., and a terse one that didn't print as much stuff and thus had a 
>>> smaller memory footprint.
>>>
>>> It sounds like the terse version has withered and died, apparently 
>>> people are only using the verbose version (which is very understandable, 
>>> I do myself).
>> Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
>> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
> 
> Applied, thanks.
> 
> Best regards,
> 
> Wolfgang Denk

It isn't a big deal, but Shinya re-rolled this with a better description 
and my "acked by" rather than "SOB".

Best regards,
gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii()
  2008-01-09 20:44 ` [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse " Wolfgang Denk
  2008-01-09 20:46   ` Jerry Van Baren
@ 2008-01-09 20:48   ` Jerry Van Baren
  1 sibling, 0 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-01-09 20:48 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <477472A3.4020201@necel.com> you wrote:
>> We now have more useful version of do_mii() and everybody use it. Grald
>> Van Baren says
>>
>>> When I originally wrote the mii command 6(!) years ago, I wrote a 
>>> verbose version that printed human readable decomposition of the flags, 
>>> etc., and a terse one that didn't print as much stuff and thus had a 
>>> smaller memory footprint.
>>>
>>> It sounds like the terse version has withered and died, apparently 
>>> people are only using the verbose version (which is very understandable, 
>>> I do myself).
>> Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
>> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
> 
> Applied, thanks.
> 
> Best regards,
> 
> Wolfgang Denk

...here
<http://article.gmane.org/gmane.comp.boot-loaders.u-boot/34682/match=kuribayashi>

gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-01-09 20:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28  3:50 [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse version of do_mii() Shinya Kuribayashi
2007-12-29 12:38 ` gvb.uboot
2008-01-04  4:30   ` Shinya Kuribayashi
2008-01-04 12:38     ` Jerry Van Baren
2008-01-07  5:32 ` [U-Boot-Users] [PATCH] Remove the "terse" " Shinya Kuribayashi
2008-01-09 20:44 ` [U-Boot-Users] [PATCH 2/2] Remove the obsolete terse " Wolfgang Denk
2008-01-09 20:46   ` Jerry Van Baren
2008-01-09 20:48   ` Jerry Van Baren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox