From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938787AbdEXIbZ (ORCPT ); Wed, 24 May 2017 04:31:25 -0400 Received: from mga02.intel.com ([134.134.136.20]:25513 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934658AbdEXIbU (ORCPT ); Wed, 24 May 2017 04:31:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,385,1491289200"; d="scan'208";a="265749621" Subject: Re: [PATCH 05/12] arm64: dts: Add I2C nodes for Hi3660 To: zhangfei , Rob Herring References: <20170517083745.24479-1-guodong.xu@linaro.org> <20170517083745.24479-6-guodong.xu@linaro.org> <20170523003908.ztuh4oohdk3g34pm@rob-hp-laptop> <94d06900-d871-7bc6-e1f3-d2b22ba20aaf@linaro.org> <10a19a02-21ac-364e-ab5c-de8aa16c3858@linaro.org> Cc: Guodong Xu , Wei Xu , Catalin Marinas , Will Deacon , Kefeng Wang , Chen Feng , Jiancheng Xue , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" From: Jarkko Nikula Message-ID: Date: Wed, 24 May 2017 11:31:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <10a19a02-21ac-364e-ab5c-de8aa16c3858@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/24/2017 05:34 AM, zhangfei wrote: > Rob suggest add something like "hisilicon,hi3660-dw-i2c" as well. > "The problem is dw-i2c does not give any clue as to what the > configuration or version of the IP is. > Is that fully discoverable with version/capability registers? If not > then you need a specific compatible. > Generally when we have not required them, it ends up being a problem > later on." > Some features are discoverable from DW_IC_COMP_PARAM_1, DW_IC_COMP_VERSION and DW_IC_COMP_TYPE registers. Although my specification does not document what's inside of DW_IC_COMP_VERSION and DW_IC_COMP_TYPE but code is using them. > > While Documentation/devicetree/bindings/i2c/i2c-designware.txt > compatible : should be "snps,designware-i2c" > > Besides, on Hikey960, > [ 3.822353] dw_readl(dev, DW_IC_COMP_VERSION)=0x3132302a > [ 3.827763] dw_readl(dev, DW_IC_COMP_TYPE)=0x44570140 > Are these two registers enough to distinguish version etc? > I've seen DW_IC_COMP_VERSION being 0x3131352a or 0x3132312a in our platforms. DW_IC_COMP_TYPE has the same value what you are seeing. -- Jarkko