From patchwork Thu May 9 19:23:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 1097646 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=impinj.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=impinj.com header.i=@impinj.com header.b="eYYZubga"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450NZQ0gsfz9s3Z for ; Fri, 10 May 2019 05:24:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C6FC5C21DD3; Thu, 9 May 2019 19:24:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 18532C21DA1; Thu, 9 May 2019 19:24:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 77DB5C21C8B; Thu, 9 May 2019 19:23:54 +0000 (UTC) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800118.outbound.protection.outlook.com [40.107.80.118]) by lists.denx.de (Postfix) with ESMTPS id AC326C21DB5 for ; Thu, 9 May 2019 19:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=impinj.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S+vdtnLDFBQMyU0BmOlHm3daTEKk9dXx9FrRrg11qJs=; b=eYYZubgaYRo6yldY5FuUXKnqoN66kaEqvgPGsQzTj8fEShBqs/yuJFJjI4578bNAwDLKtauhWNMFcvq9MaizHdtPesD6MkwLQyrOY8airosotQZ/u4R2k99G4YEl+zAstIzII0WsXoNHK3WSesSDrKMlVCNMUGjXP8qEEDs54pU= Received: from CY4PR0601MB3697.namprd06.prod.outlook.com (52.132.101.36) by CY4PR0601MB3668.namprd06.prod.outlook.com (52.132.101.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Thu, 9 May 2019 19:23:47 +0000 Received: from CY4PR0601MB3697.namprd06.prod.outlook.com ([fe80::5833:cf0f:4b6a:a2e3]) by CY4PR0601MB3697.namprd06.prod.outlook.com ([fe80::5833:cf0f:4b6a:a2e3%5]) with mapi id 15.20.1856.012; Thu, 9 May 2019 19:23:47 +0000 From: Trent Piepho To: "u-boot@lists.denx.de" Thread-Topic: [PATCH 2/2] cmd: mii: Add the standard 1000BASE-T registers Thread-Index: AQHVBpy5lcE5CyQdR0SrrS9uCgeUfQ== Date: Thu, 9 May 2019 19:23:47 +0000 Message-ID: <20190509192322.2384-2-tpiepho@impinj.com> References: <20190509192322.2384-1-tpiepho@impinj.com> In-Reply-To: <20190509192322.2384-1-tpiepho@impinj.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR06CA0046.namprd06.prod.outlook.com (2603:10b6:a03:14b::23) To CY4PR0601MB3697.namprd06.prod.outlook.com (2603:10b6:910:91::36) authentication-results: spf=none (sender IP is ) smtp.mailfrom=tpiepho@impinj.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.14.5 x-originating-ip: [216.207.205.253] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 012dbacc-bca4-49e8-dcaa-08d6d4b3dbbb x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:CY4PR0601MB3668; x-ms-traffictypediagnostic: CY4PR0601MB3668: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 003245E729 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39850400004)(396003)(136003)(346002)(376002)(366004)(199004)(189003)(64756008)(66446008)(446003)(11346002)(26005)(476003)(486006)(2616005)(86362001)(53936002)(4326008)(52116002)(99286004)(107886003)(186003)(6486002)(6916009)(68736007)(71200400001)(71190400001)(14454004)(102836004)(76176011)(386003)(6506007)(478600001)(256004)(66946007)(73956011)(66476007)(3846002)(6116002)(2906002)(66556008)(5660300002)(8936002)(81166006)(81156014)(8676002)(50226002)(2351001)(305945005)(2501003)(7736002)(36756003)(316002)(25786009)(6436002)(5640700003)(66066001)(1076003)(6512007); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR0601MB3668; H:CY4PR0601MB3697.namprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: impinj.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Md8K/0dHVY6qvhfHpLu1HxI1meGe5heRniSy1/deTAw9FcTN6EwuOTs+0ElNF2kVPL6XCwL+s36BIBlyH03LrYLwIOh2bhGmpeTYOn47At6VfpazUKs7h5SJNaiq3MfxaBkTDhALzF4wxur5FFrv1TeyN0mYvi2RLG0zFCHyka3xI2s1i9MCvFH1zdZWz/JRPpoeI7uBnNlZBlwXKZ5qkvT19Max/u1UwAog+smEMrj7PZ+fVMF82lZsxlnu1gc7nKk/BcB+3VNe2AJwyuLPPBqfuXoelGcBZWt+Uxxd9l3hKuB3Z8Z3G2S3QbVWyuZEyYUZc2vx+dR0pQEPtdsU8D/+TeHMG1SQ5rQvCHM3JjcF0XEXcrV/XqgEMB49trDGtO2/qtGNyuuwI8NYVM8KSgOfXiqthZdbLA7y+uovsek= MIME-Version: 1.0 X-OriginatorOrg: impinj.com X-MS-Exchange-CrossTenant-Network-Message-Id: 012dbacc-bca4-49e8-dcaa-08d6d4b3dbbb X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2019 19:23:47.3358 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6de70f0f-7357-4529-a415-d8cbb7e93e5e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0601MB3668 Cc: Trent Piepho Subject: [U-Boot] [PATCH 2/2] cmd: mii: Add the standard 1000BASE-T registers X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" These are standard across gigabit phys. These mostly extend the auto-negotiation information with gigabit fields. Signed-off-by: Trent Piepho --- cmd/mii.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/cmd/mii.c b/cmd/mii.c index fcc677b485..1cb0904689 100644 --- a/cmd/mii.c +++ b/cmd/mii.c @@ -91,6 +91,28 @@ static const MII_field_desc_t reg_5_desc_tbl[] = { { 4, 0, 0x1f, "partner selector" }, }; +static const MII_field_desc_t reg_9_desc_tbl[] = { + { 15, 13, 0x07, "test mode" }, + { 12, 12, 0x01, "manual master/slave enable" }, + { 11, 11, 0x01, "manual master/slave value" }, + { 10, 10, 0x01, "multi/single port" }, + { 9, 9, 0x01, "1000BASE-T full duplex able" }, + { 8, 8, 0x01, "1000BASE-T half duplex able" }, + { 7, 7, 0x01, "automatic TDR on link down" }, + { 6, 6, 0x7f, "(reserved)" }, +}; + +static const MII_field_desc_t reg_10_desc_tbl[] = { + { 15, 15, 0x01, "master/slave config fault" }, + { 14, 14, 0x01, "master/slave config result" }, + { 13, 13, 0x01, "local receiver status OK" }, + { 12, 12, 0x01, "remote receiver status OK" }, + { 11, 11, 0x01, "1000BASE-T full duplex able" }, + { 10, 10, 0x01, "1000BASE-T half duplex able" }, + { 9, 8, 0x03, "(reserved)" }, + { 7, 0, 0xff, "1000BASE-T idle error counter"}, +}; + typedef struct _MII_reg_desc_t { ushort regno; const MII_field_desc_t *pdesc; @@ -111,6 +133,10 @@ static const MII_reg_desc_t mii_reg_desc_tbl[] = { "Autonegotiation advertisement register" }, { MII_LPA, reg_5_desc_tbl, ARRAY_SIZE(reg_5_desc_tbl), "Autonegotiation partner abilities register" }, + { MII_CTRL1000, reg_9_desc_tbl, ARRAY_SIZE(reg_9_desc_tbl), + "1000BASE-T control register" }, + { MII_STAT1000, reg_10_desc_tbl, ARRAY_SIZE(reg_10_desc_tbl), + "1000BASE-T status register" }, }; static void dump_reg( @@ -390,12 +416,10 @@ static int do_mii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } } } else if (strncmp(op, "du", 2) == 0) { - ushort regs[6]; + ushort regs[MII_STAT1000 + 1]; /* Last reg is 0x0a */ int ok = 1; - if ((reglo > 5) || (reghi > 5)) { - printf( - "The MII dump command only formats the " - "standard MII registers, 0-5.\n"); + if (reglo > MII_STAT1000 || reghi > MII_STAT1000) { + printf("The MII dump command only formats the standard MII registers, 0-5, 9-a.\n"); return 1; } for (addr = addrlo; addr <= addrhi; addr++) {