Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp638245ybc; Tue, 19 Nov 2019 06:58:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwkjOWuitLYLh3t2bm0JrQmCXYLh543rVcHf9w8kEqqWBzdO2dKu/Y1c/XP9kY6U8Pl28wo X-Received: by 2002:a5d:5484:: with SMTP id h4mr6591969wrv.136.1574175519721; Tue, 19 Nov 2019 06:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574175519; cv=none; d=google.com; s=arc-20160816; b=chiAno9lvWwbh+Ca3byY8wrnxlpEggO9wXm+gAPqtyCE6dfKgNGa85MFk2JBBM6M2S PYDc+mAvM5LxfkFX/Xlkwhg20FBvVAAplz/R46gn4pkJBkD32arJGk5ryT72scpnN6iy u4jeFyETZL6anpTuQChm9tVZ0i6k85qo6OQe1jTeomNxscQKihfCpKO1H1FPrYMwH6lv E3WqU4G+jeR3IsqyruH/cWZJCHPr5jkCHFNkrEMIq4H0biP9eqqknHchSp90puJzDBvf fZJBrG88lRbzXcxSWwD8LN8lGET0NI/2YYW0evD4xFd0gkg/DV6sZInglYF9+t8iN0P4 j5+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=In1zGBDOC9xdynfqKqKcIIm3nf1+kiAaNiGZnanvLvY=; b=x7wYyBAoq6KLbe30a3/n+ag6xnyw6duDHPKoFhQJp4K1lSJkRMOWdsHr6oPwfYbEDb c4Ot6PTbkfo8IURS0+hkwTK1AxMLPYeSU97CHQtrIY5UMGEjDa+Nec6UMt3nrGQCBZJH VwOLnrxDpeD7CvCdc2tvsHYR4IhFMlMuSLfHEFRTzEDLnkinAQ5et7GGSvTOjTEsQmTr eaymMhel27g3i7/FK8NVcfcu1k2ODvm6HdQpqElV8S9b4hAxISgwIVL41MqyNYkzRlkD jCShQUXzoo87K6HjMr48i2hvUm357jAaxFjOrG998q1Pxr2lCc2bNdRuz4SnN5/FQznm nA3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QThEqdE2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si16615341edc.451.2019.11.19.06.58.15; Tue, 19 Nov 2019 06:58:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QThEqdE2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728140AbfKSO41 (ORCPT + 99 others); Tue, 19 Nov 2019 09:56:27 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34562 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfKSO41 (ORCPT ); Tue, 19 Nov 2019 09:56:27 -0500 Received: by mail-lj1-f194.google.com with SMTP id 139so23683678ljf.1 for ; Tue, 19 Nov 2019 06:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=In1zGBDOC9xdynfqKqKcIIm3nf1+kiAaNiGZnanvLvY=; b=QThEqdE2rR48X8oh0OxwIbdEI4egtNMX2nLjCHAmFesH7XsOljlFWzkSlgEJCooM1o 9oofv6OFX2+StOidzMwZkInUb1q7S3iYe1jGQBVRMnZfOgswcDhgDIWyKOAf1FCD6Rba XexJQjvzoZgk++lHzrQt26VgsTLJOx+TUHxlLHOeTK0MJEgCIpwHfRwVqJPlUzHxt9Zb /zQmjaHME4cmgDYw5AkgqfCHdJuboeYIpGoueKqYWs0vXtUAB+SkCD6YY4Fo0JRrpLh6 H7lOZvbGvmSmFckDGq++HhacqpYwrhABTGhOFbyLnnmHLSRxvnwysAiHcwDZn8jbvU6f luHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=In1zGBDOC9xdynfqKqKcIIm3nf1+kiAaNiGZnanvLvY=; b=PUmw5oUmH2EGIHe0uQ82LjpFNEnOmeslj2dEYtA6sbf1V001cBbM4LESm4aWflTV9a e/3N/EqNi8qd8e5XCp1VZEn8gWfykLJ+8cBSVh8afYIJ/gtsOhOaAwYwXNAshHz3x9/Z b6EeF+W7Cy+HNfZ+SA3yHCDMpds7WA8cFfwIeEbv/HLkBZBohLKz2KTcQVTG37WQ9CeU MeF6flx2pYf4tXbxwWdnEeLmYmIhlzeijuxxoBp2MMhQeUEAfj8c52SVoPjlYDciQFmP DP7urgHMj5vqyg7teEVSW9nu1bhwD4g+V/fs1LNxv2KTu4dY0paWNSFXOd40Rq8AJ9fE rTvg== X-Gm-Message-State: APjAAAURGBqTZoZUvtNJoyijSW5xccAgZFSHySjZstP5uC1RzVUGkKdw T00Z3VZqf7JSgttSREAoiMLNB7mV7BGQjIlKf7WxUQ== X-Received: by 2002:a2e:9699:: with SMTP id q25mr4283993lji.251.1574175385648; Tue, 19 Nov 2019 06:56:25 -0800 (PST) MIME-Version: 1.0 References: <1573819429-6937-1-git-send-email-qianggui.song@amlogic.com> <1573819429-6937-3-git-send-email-qianggui.song@amlogic.com> In-Reply-To: <1573819429-6937-3-git-send-email-qianggui.song@amlogic.com> From: Linus Walleij Date: Tue, 19 Nov 2019 15:56:14 +0100 Message-ID: Subject: Re: [PATCH v6 2/3] pinctrl: meson: add pinctrl driver support for Meson-A1 SoC To: Qianggui Song Cc: "open list:GPIO SUBSYSTEM" , Neil Armstrong , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Carlo Caione , Rob Herring , Xingyu Chen , Jianxin Pan , Hanjie Lin , Mark Rutland , Linux ARM , "open list:ARM/Amlogic Meson..." , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 15, 2019 at 1:03 PM Qianggui Song wrote: > Meson A1 SoC share the same register layout of pinmux with previous > Meson-G12A, however there is difference for gpio and pin config register > in A1. The main difference is that registers before A1 are grouped by > function while those of A1 are by bank. The new register layout is as > below: > > /* first bank */ /* addr */ > - P_PADCTRL_GPIOP_I base + 0x00 << 2 > - P_PADCTRL_GPIOP_O base + 0x01 << 2 > - P_PADCTRL_GPIOP_OEN base + 0x02 << 2 > - P_PADCTRL_GPIOP_PULL_EN base + 0x03 << 2 > - P_PADCTRL_GPIOP_PULL_UP base + 0x04 << 2 > - P_PADCTRL_GPIOP_DS base + 0x05 << 2 > > /* second bank */ > - P_PADCTRL_GPIOB_I base + 0x10 << 2 > - P_PADCTRL_GPIOB_O base + 0x11 << 2 > - P_PADCTRL_GPIOB_OEN base + 0x12 << 2 > - P_PADCTRL_GPIOB_PULL_EN base + 0x13 << 2 > - P_PADCTRL_GPIOB_PULL_UP base + 0x14 << 2 > - P_PADCTRL_GPIOB_DS base + 0x15 << 2 > > Each bank contains at least 6 registers to be configured, if one bank > has more than 16 gpios, an extra P_PADCTRL_GPIO[X]_DS_EXT is included. > Between two adjacent P_PADCTRL_GPIO[X]_I, there is an offset 0x10, that > is to say, for third bank, the offsets will be 0x20,0x21,0x22,0x23,0x24 > ,0x25 according to above register layout. For previous chips, registers > are grouped according to their functions while registers of A1 are > according to bank.Also note that there is no AO bank any more in A1. > > Current Meson pinctrl driver can cover such change by using base address > of GPIO as that of drive-strength. While simply giving reg_ds = reg_pullen > make wrong value to reg_ds for Socs that do not support drive-strength > like AXG.To make things simple, add an extra dt parser function for > a1 and remain the old dt parser function for only reg parsing. > > Signed-off-by: Qianggui Song Patch applied with Neil's Review tag. Yours, Linus Walleij