From patchwork Thu Jun 30 18:06:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 102801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B86F2B6F57 for ; Fri, 1 Jul 2011 04:21:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E76E8280A7; Thu, 30 Jun 2011 20:21:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MyOcJJgzWUkK; Thu, 30 Jun 2011 20:21:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BCFD62809D; Thu, 30 Jun 2011 20:21:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 011B82809D for ; Thu, 30 Jun 2011 20:21:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WqC4WV8xJmuX for ; Thu, 30 Jun 2011 20:21:51 +0200 (CEST) X-Greylist: delayed 905 seconds by postgrey-1.27 at theia; Thu, 30 Jun 2011 20:21:49 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from VA3EHSOBE010.bigfish.com (va3ehsobe010.messaging.microsoft.com [216.32.180.30]) by theia.denx.de (Postfix) with ESMTPS id 0F6E32809C for ; Thu, 30 Jun 2011 20:21:49 +0200 (CEST) Received: from mail159-va3-R.bigfish.com (10.7.14.235) by VA3EHSOBE010.bigfish.com (10.7.40.12) with Microsoft SMTP Server id 14.1.225.22; Thu, 30 Jun 2011 18:06:43 +0000 Received: from mail159-va3 (localhost.localdomain [127.0.0.1]) by mail159-va3-R.bigfish.com (Postfix) with ESMTP id 59DFD12682EE for ; Thu, 30 Jun 2011 18:06:43 +0000 (UTC) X-SpamScore: 2 X-BigFish: VS2(zzfb6Ic8kzz1202hzz8275bhz2dh2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail159-va3 (localhost.localdomain [127.0.0.1]) by mail159-va3 (MessageSwitch) id 1309457202655100_4821; Thu, 30 Jun 2011 18:06:42 +0000 (UTC) Received: from VA3EHSMHS029.bigfish.com (unknown [10.7.14.246]) by mail159-va3.bigfish.com (Postfix) with ESMTP id 9B68345004E for ; Thu, 30 Jun 2011 18:06:42 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS029.bigfish.com (10.7.99.39) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 30 Jun 2011 18:06:38 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.289.8; Thu, 30 Jun 2011 13:06:37 -0500 Received: from localhost.localdomain (mvp-10-214-72-206.am.freescale.net [10.214.72.206]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p5UI6aHW029284; Thu, 30 Jun 2011 13:06:36 -0500 (CDT) From: York Sun To: Date: Thu, 30 Jun 2011 11:06:35 -0700 Message-ID: <1309457195-8475-1-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] powerpc/eeprom: cleanup mac command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Move mac command to board/freescale/common/sys_eeprom.c. Change the help message to be more helpful. Print argument format. Fix MAX_NUM_PORTS to comply with v1 NXID format. Signed-off-by: York Sun --- board/freescale/common/sys_eeprom.c | 29 ++++++++++++++++++++- common/Makefile | 1 - common/cmd_mac.c | 49 ----------------------------------- 3 files changed, 28 insertions(+), 51 deletions(-) delete mode 100644 common/cmd_mac.c diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index d2ed036..b11899e 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -34,7 +34,7 @@ #endif #ifdef CONFIG_SYS_I2C_EEPROM_NXID -#define MAX_NUM_PORTS 23 +#define MAX_NUM_PORTS 31 #define NXID_VERSION 1 #endif @@ -552,3 +552,30 @@ unsigned int get_cpu_board_revision(void) return MPC85XX_CPU_BOARD_REV(be.major, be.minor); } #endif + +U_BOOT_CMD( + mac, 3, 1, do_mac, + "display and program the system ID and MAC addresses in EEPROM", + "without argument\n" + " - show content of system ID and MAC addresses\n" + "read\n" + " - read EEPROM without showing\n" + "mac save\n" + " - save to the EEPROM\n" + "mac id\n" + " - program system id (fixed)\n" + "mac num \n" + " - program as system serial number\n" + "mac errata \n" + " - program as errata data\n" + "mac date \n" + " - program timestamp\n" + "mac ports \n" + " - program the number of ports\n" + "mac \n" +#ifdef NXID_VERSION + " - program the MAC address for port n [n=0...22]" +#else + " - program the MAC address for port n [n=0...7]" +#endif +); diff --git a/common/Makefile b/common/Makefile index f81cff9..4a1514a 100644 --- a/common/Makefile +++ b/common/Makefile @@ -110,7 +110,6 @@ COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o COBJS-y += cmd_load.o COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o -COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o COBJS-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o diff --git a/common/cmd_mac.c b/common/cmd_mac.c deleted file mode 100644 index 1884c2a..0000000 --- a/common/cmd_mac.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2006 Freescale Semiconductor - * York Sun (yorksun@freescale.com) - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include -#include - -extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); - -U_BOOT_CMD( - mac, 3, 1, do_mac, - "display and program the system ID and MAC addresses in EEPROM", - "[read|save|id|num|errata|date|ports|0|1|2|3|4|5|6|7]\n" - "read\n" - " - show content of EEPROM\n" - "mac save\n" - " - save to the EEPROM\n" - "mac id\n" - " - program system id\n" - "mac num\n" - " - program system serial number\n" - "mac errata\n" - " - program errata data\n" - "mac date\n" - " - program date\n" - "mac ports\n" - " - program the number of ports\n" - "mac X\n" - " - program the MAC address for port X [X=0...7]" -);