From patchwork Thu Aug 14 02:44:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Wang X-Patchwork-Id: 379794 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 0858114008B for ; Thu, 14 Aug 2014 13:36:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94FA14A05D; Thu, 14 Aug 2014 05:36:09 +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 3TgTTrKxjMxi; Thu, 14 Aug 2014 05:36:09 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4247EA740A; Thu, 14 Aug 2014 05:35:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3B7DA73F0 for ; Thu, 14 Aug 2014 05:34:50 +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 pXUUI-lBYiNM for ; Thu, 14 Aug 2014 05:34:48 +0200 (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 na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0206.outbound.protection.outlook.com [207.46.163.206]) by theia.denx.de (Postfix) with ESMTPS id 19B1D4A056 for ; Thu, 14 Aug 2014 05:34:43 +0200 (CEST) Received: from BN3PR0301CA0039.namprd03.prod.outlook.com (25.160.180.177) by BN1PR03MB153.namprd03.prod.outlook.com (10.255.201.15) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Thu, 14 Aug 2014 03:34:26 +0000 Received: from BY2FFO11FD007.protection.gbl (2a01:111:f400:7c0c::127) by BN3PR0301CA0039.outlook.office365.com (2a01:111:e400:4000::49) with Microsoft SMTP Server (TLS) id 15.0.1005.10 via Frontend Transport; Thu, 14 Aug 2014 03:34:26 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD007.mail.protection.outlook.com (10.1.14.128) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Thu, 14 Aug 2014 03:34:25 +0000 Received: from rock.ap.freescale.net (rock.ap.freescale.net [10.193.20.106]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s7E3Y70f001619; Wed, 13 Aug 2014 20:34:23 -0700 From: Alison Wang To: , Date: Thu, 14 Aug 2014 10:44:42 +0800 Message-ID: <1407984294-346-7-git-send-email-b18965@freescale.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1407984294-346-1-git-send-email-b18965@freescale.com> References: <1407984294-346-1-git-send-email-b18965@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199003)(54534003)(107046002)(20776003)(85306004)(85852003)(47776003)(83072002)(81342001)(104016003)(4396001)(105606002)(229853001)(48376002)(84676001)(50226001)(95666004)(33646002)(92566001)(76482001)(31966008)(92726001)(74662001)(106466001)(87286001)(6806004)(88136002)(50986999)(50466002)(76176999)(87936001)(83322001)(21056001)(102836001)(64706001)(104166001)(79102001)(80022001)(97736001)(46102001)(68736004)(74502001)(81542001)(89996001)(99396002)(44976005)(93916002)(19580395003)(36756003)(77156001)(77982001)(62966002)(26826002)(19580405001)(42262002); DIR:OUT; SFP:; SCL:1; SRVR:BN1PR03MB153; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 03030B9493 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=alison.wang@freescale.com; X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH v3 06/18] ls102xa: etsec: Add etsec support for LS102xA X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 For LS102xA, RxBDs and TxBDs are interpreted with little-endian bytes ordering. The offset for each of eTSECs and MDIOs is 256K bytes. Signed-off-by: Alison Wang --- Change log: v3: No change. v2: Add private mdio read and write support. drivers/net/tsec.c | 7 +++++++ include/tsec.h | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index e9138f0..a220221 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -20,6 +20,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -270,6 +271,9 @@ void redundant_init(struct eth_device *dev) out_be32(®s->tstat, TSTAT_CLEAR_THALT); out_be32(®s->rstat, RSTAT_CLEAR_RHALT); clrbits_be32(®s->dmactrl, DMACTRL_GRS | DMACTRL_GTS); +#ifdef CONFIG_LS102xA + setbits_be32(®s->dmactrl, DMACTRL_LE); +#endif do { uint16_t status; @@ -366,6 +370,9 @@ static void startup_tsec(struct eth_device *dev) out_be32(®s->tstat, TSTAT_CLEAR_THALT); out_be32(®s->rstat, RSTAT_CLEAR_RHALT); clrbits_be32(®s->dmactrl, DMACTRL_GRS | DMACTRL_GTS); +#ifdef CONFIG_LS102xA + setbits_be32(®s->dmactrl, DMACTRL_LE); +#endif } /* This returns the status bits of the device. The return value diff --git a/include/tsec.h b/include/tsec.h index 2054715..5b74f67 100644 --- a/include/tsec.h +++ b/include/tsec.h @@ -20,10 +20,14 @@ #include #include #include -#include +#ifdef CONFIG_LS102xA +#define TSEC_SIZE 0x40000 +#define TSEC_MDIO_OFFSET 0x40000 +#else #define TSEC_SIZE 0x01000 #define TSEC_MDIO_OFFSET 0x01000 +#endif #define CONFIG_SYS_MDIO_BASE_ADDR (MDIO_BASE_ADDR + 0x520) @@ -128,6 +132,7 @@ #define DMACTRL_INIT_SETTINGS 0x000000c3 #define DMACTRL_GRS 0x00000010 #define DMACTRL_GTS 0x00000008 +#define DMACTRL_LE 0x00008000 #define TSTAT_CLEAR_THALT 0x80000000 #define RSTAT_CLEAR_RHALT 0x00800000