From patchwork Fri Sep 26 10:33:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Wang X-Patchwork-Id: 393658 X-Patchwork-Delegate: yorksun@freescale.com 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 2CEA41400B2 for ; Fri, 26 Sep 2014 20:35:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9203B4A027; Fri, 26 Sep 2014 12:35:17 +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 R-fEFWfeJw5P; Fri, 26 Sep 2014 12:35:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 82B9D4A02E; Fri, 26 Sep 2014 12:34:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 589BC4A039 for ; Fri, 26 Sep 2014 12:34:52 +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 sPjsavHrusjO for ; Fri, 26 Sep 2014 12: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-bl2on0130.outbound.protection.outlook.com [65.55.169.130]) by theia.denx.de (Postfix) with ESMTPS id 40F66A73E9 for ; Fri, 26 Sep 2014 12:34:26 +0200 (CEST) Received: from CO2PR03CA0013.namprd03.prod.outlook.com (10.141.194.140) by BY2PR03MB160.namprd03.prod.outlook.com (10.242.36.22) with Microsoft SMTP Server (TLS) id 15.0.1034.13; Fri, 26 Sep 2014 10:34:23 +0000 Received: from BN1AFFO11FD014.protection.gbl (2a01:111:f400:7c10::113) by CO2PR03CA0013.outlook.office365.com (2a01:111:e400:1414::12) with Microsoft SMTP Server (TLS) id 15.0.1034.13 via Frontend Transport; Fri, 26 Sep 2014 10:34:23 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD014.mail.protection.outlook.com (10.58.52.74) with Microsoft SMTP Server (TLS) id 15.0.1029.15 via Frontend Transport; Fri, 26 Sep 2014 10:34:22 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s8QAY7Lu009200; Fri, 26 Sep 2014 03:34:20 -0700 From: Alison Wang To: , , , Date: Fri, 26 Sep 2014 18:33:40 +0800 Message-ID: <1411727622-26557-6-git-send-email-b18965@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1411727622-26557-1-git-send-email-b18965@freescale.com> References: <1411727622-26557-1-git-send-email-b18965@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(54534003)(189002)(199003)(92726001)(93916002)(81342003)(31966008)(50986999)(92566001)(81542003)(83072002)(87936001)(79102003)(80022003)(62966002)(87286001)(20776003)(46102003)(4396001)(33646002)(74502003)(2201001)(95666004)(102836001)(89996001)(50226001)(47776003)(19580405001)(85306004)(64706001)(76482002)(6806004)(44976005)(83322001)(104016003)(106466001)(76176999)(105606002)(68736004)(229853001)(97736003)(77156001)(104166001)(120916001)(36756003)(85852003)(77982003)(90102001)(107886001)(74662003)(81156004)(107046002)(10300001)(19580395003)(88136002)(50466002)(84676001)(21056001)(48376002)(69596002)(99396003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB160; H:az84smr01.freescale.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB160; X-Forefront-PRVS: 03468CBA43 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=alison.wang@freescale.com; X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH v2 5/7] ls102xa: qixis: Add CONFIG_QIXIS_I2C_ACCESS macro 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 Through adding CONFIG_QIXIS_I2C_ACCESS macro, QIXIS_READ(reg)/QIXIS_WRITE(reg, value) can be used for both i2c and ifc access to QIXIS FPGA. This is more convenient for coding. Signed-off-by: Jason Jin Signed-off-by: Alison Wang --- Change log: v2: No change. board/freescale/common/qixis.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/board/freescale/common/qixis.h b/board/freescale/common/qixis.h index d8fed14..52d2021 100644 --- a/board/freescale/common/qixis.h +++ b/board/freescale/common/qixis.h @@ -100,8 +100,15 @@ u8 qixis_read_i2c(unsigned int reg); void qixis_write_i2c(unsigned int reg, u8 value); #endif +#if defined(CONFIG_QIXIS_I2C_ACCESS) && defined(CONFIG_SYS_I2C_FPGA_ADDR) +#define QIXIS_READ(reg) qixis_read_i2c(offsetof(struct qixis, reg)) +#define QIXIS_WRITE(reg, value) \ + qixis_write_i2c(offsetof(struct qixis, reg), value) +#else #define QIXIS_READ(reg) qixis_read(offsetof(struct qixis, reg)) #define QIXIS_WRITE(reg, value) qixis_write(offsetof(struct qixis, reg), value) +#endif + #ifdef CONFIG_SYS_I2C_FPGA_ADDR #define QIXIS_READ_I2C(reg) qixis_read_i2c(offsetof(struct qixis, reg)) #define QIXIS_WRITE_I2C(reg, value) \