From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3231CC433B4 for ; Thu, 20 May 2021 03:38:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF854611AD for ; Thu, 20 May 2021 03:38:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF854611AD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5T818weexEmijE16DsqlnSJpfnhsckkNUkvg0TIcQdQ=; b=INbqeptaX3SIiw4FdE8ia9ctB hli4c48Is0fRj4uGNdARhu0uHAYylbpMBm61AgOMGqPfaDL/8xRVHRaAyk/nEp1q2NVfQ12JLvMnv XL3BN5HgYnUYHMRvKqL98nhI9xZ8Hlv9omqgBwi3o3Z27lwCD3f6F8gyt1puEkBnEFzoODN5zDKzc K31MON/d6X5F738WZ5P9C1viRajGOmCYGyjm0jE5X2759TEw6Xm+QWSI9YKVjBVG3Og+TfWHYDa7s Ck/uxIMYfVPoOy//rI3tPf5ED49gGzh0LNOjntvUGGbnKwOra4pA9/UbR6HUWxxeBEtxkITFs8Ua4 BKq+Zno2g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljZSq-005lgV-1M; Thu, 20 May 2021 03:35:12 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljZSm-005lg4-SS for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 03:35:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:CC:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PJTB0ogSNbQ1x0GicdBDpr6yhbswha4ZYg+HsPWhCLA=; b=ZFmFliArBu+0cQ4W43LD9sCZGi pgoaHrFXFAxMAfARN94tTcYEKZTgekrKFIKDavoW9UT60Lv3+HDpVMxGWAWrwP6eUPyr/uZYTs1bC MwkcTi45uYaNBQkEAkdGEIAT9bO6b8CF3lMK4jt8GYBaZD7hQyR3s7P74OCFlZ8d3Wq+Wbk1WvJvh j21p6o2hi1KaKVoJW0tjwnOwa7/Utaf2kWE3GpuYO6z989gpLRIPhY3tblGKEn+WV+pWhTmGXz+sb ewhdNWA/1J2hLU8ol9NFPJFFo7zFTXtNvp19n/0qzOmisro8Se5b42THuQNrelbhW7XLJPYaTbr4c n0gR8IkQ==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljZQ2-00FXjT-HG for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 03:33:01 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 14K3JA4S041222; Thu, 20 May 2021 11:19:11 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from aspeedtech.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 20 May 2021 11:31:48 +0800 Date: Thu, 20 May 2021 11:31:41 +0800 From: Jamin Lin To: Joel Stanley CC: Rob Herring , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , Rayn Chen , "open list:I2C SUBSYSTEM HOST DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , "moderated list:ARM/ASPEED I2C DRIVER" , Ryan Chen , "ChiaWei Wang" , Troy Lee , Steven Lee Subject: Re: [PATCH 1/3] i2c: aspeed: avoid new registers definition of AST2600 Message-ID: <20210520033140.GA3656@aspeedtech.com> References: <20210519080436.18975-1-jamin_lin@aspeedtech.com> <20210519080436.18975-2-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 14K3JA4S041222 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_043300_079404_AED731E4 X-CRM114-Status: GOOD ( 25.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The 05/19/2021 22:59, Joel Stanley wrote: > On Wed, 19 May 2021 at 08:05, Jamin Lin wrote: > > > > The register definition between AST2600 A2 and A3 is different. > > This patch avoid new registers definition of AST2600 to use > > this driver. We will submit the path for the new registers > > definition of AST2600. > > The AST2600 v9 datasheet says that bit 2 selects between old and new > register sets, and that the old register set is the default. > > Has the default changed for the A3?, and the datasheet is incorrect? > > Does the A3 still support the old register set? > We suggest user to use the new i2c driver for AST2600 and we will sumbit it. This driver is used to AST2500 and AST2400 SOCs. Change this driver to check global register of i2c to avoid user build the wrong driver. > > > > Signed-off-by: Jamin Lin > > --- > > drivers/i2c/busses/i2c-aspeed.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c > > index 724bf30600d6..007309077d9f 100644 > > --- a/drivers/i2c/busses/i2c-aspeed.c > > +++ b/drivers/i2c/busses/i2c-aspeed.c > > @@ -19,14 +19,20 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > #include > > #include > > +#include > > #include > > #include > > > > +/* I2C Global Registers */ > > +/* 0x0c : I2CG Global Control Register (AST2500) */ > > +#define ASPEED_I2CG_GLOBAL_CTRL_REG 0x0c > > + > > /* I2C Register */ > > #define ASPEED_I2C_FUN_CTRL_REG 0x00 > > #define ASPEED_I2C_AC_TIMING_REG1 0x04 > > @@ -973,6 +979,22 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev) > > struct resource *res; > > int irq, ret; > > > > + if (of_device_is_compatible(pdev->dev.of_node, > > + "aspeed,ast2600-i2c-bus")) { > > + u32 global_ctrl; > > + struct regmap *gr_regmap; > > + > > + gr_regmap = syscon_regmap_lookup_by_compatible("aspeed,ast2600-i2c-global"); > > + > > + if (IS_ERR(gr_regmap)) { > > + ret = PTR_ERR(gr_regmap); > > + } else { > > + regmap_read(gr_regmap, ASPEED_I2CG_GLOBAL_CTRL_REG, &global_ctrl); > > + if (global_ctrl & BIT(2)) > > + return -EIO; > > + } > > + } > > + > > bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); > > if (!bus) > > return -ENOMEM; > > -- > > 2.17.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel