Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2799517imm; Mon, 24 Sep 2018 10:05:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV60GbaeobdyywM5FIDCR36twh6+w23x4+wgD4LCEjFMTgYqlTfQuosB/BEakkGQnbilHz5Dm X-Received: by 2002:a17:902:7887:: with SMTP id q7-v6mr11411127pll.111.1537808746543; Mon, 24 Sep 2018 10:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537808746; cv=none; d=google.com; s=arc-20160816; b=qyYwyX6a+VSHR3kQEpbmCTtLRNpdFKH3rGkSNS8Mh1lFKW7R+J/2lrPtHT7+0TYvYS +oo/T48ILgNtYquMb6lQRz/6dmRlGobzb7vVKTE22OEJlDNcMG6RPEIXyISfS40EWpeD uLypkjxBvPNi0R+HLZ3iBt3m42CIrvYC/cE4uWBy9tCvI5sbSWUVJFJ5hvxHpjTAhvax LgVSmJy56Z7qX7h39OrvFAPy9Y/T9uKA8Foywsv+vNeZkvcmzPQ0zlONX2F8OXy/2oJ8 oYluk1eKyYsvYcs7yL1wnDCUuVDRzs6vL1Pz87Yn/v1HGH2eRM51JyR3hU/pcTg9+cXW VnwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=w4qAOQnu9VVXzOUDiFJQ5prvd6BIyYPjzmyEnmUDEB8=; b=zAbPjNDRgBWQ7LF7DkPkECf4eyagiO37G1t5rWgU5rAfZNQyE9f7jVfMG/4Rb2qxaK s10zF+DAcZ75YeZduK6WcfaJ8klQf6F5kDd8k/8Xa3nGTD6wfcLAgCjuMK3CITQfqAYL /Q/G7r8lAT4u3FakfAmi8ea27DNA3Yul+flXbUfDBR/0hQcsY2OshlBoe5JjnTydP3uA VDh9W7RMfcArczbPIzpkMWskK3Z3MCu+u9Zu2NGQqUFhvBHUKTbg2PaKDHtYmmHBcBt2 mSYEPVr/JVXiCiJOZ8fT3ueZ2FEHuTwZjYgt908eqyLyuw/koQx5HSBo602LwIwjennQ 5igA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WLcDTp0v; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15-v6si10171708pgr.336.2018.09.24.10.05.05; Mon, 24 Sep 2018 10:05:46 -0700 (PDT) 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=@google.com header.s=20161025 header.b=WLcDTp0v; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732367AbeIXXHo (ORCPT + 99 others); Mon, 24 Sep 2018 19:07:44 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:38389 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730118AbeIXXHo (ORCPT ); Mon, 24 Sep 2018 19:07:44 -0400 Received: by mail-yb1-f194.google.com with SMTP id e190-v6so8532702ybb.5 for ; Mon, 24 Sep 2018 10:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=w4qAOQnu9VVXzOUDiFJQ5prvd6BIyYPjzmyEnmUDEB8=; b=WLcDTp0vTWxfucdOgi0Ufo1TJjD5AbDIcU9GcUKs8K+gMkSGsyuc/F1gN4iuZiGpp+ Kh3a61gtVwTIE3P0LrjADnLM2LvUdKkEox0SAAUdI6+7hcLSF0jnqOuF3mVCES/MPokL vh0L+anUY+XHcR/lYPLkgOYvfWZsU2b5Df9S6CdljKNHW4mq9/E32ncP3r25BiBujrHM 4gZEUaz5qkHuDm7lKQEh8pvV5Ul507sX2YVXFDsr+Z8DtILJZphyaqfGapi5Jn8c6Yi4 15ZmgRK/xEXImNkgWDPhJlQr5a8H0FRnNZNNczTVtA2H4Ly681FlZrn7h8CpJw5bvb4e pNzw== 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:content-transfer-encoding; bh=w4qAOQnu9VVXzOUDiFJQ5prvd6BIyYPjzmyEnmUDEB8=; b=f2a2EIcjrcC4CE3jUVNhDMh7DjQYu6ZazXDDCCF2ui7ufPc5MyLigh3oYEjGeMzeIU 7J9mLnfDSKsJSkW/3wuLXAEW4VYeAe8EYU8IOEbYZgRoqarJMLQJ1LOfTuZkV+rCLGts 3C/musstXOcM4zBLNKPDJRZd9lTPpqsqkl/Ly3KAbH8pv/Iqcq4ZKrkNrn6SAE2Reryf 9vYXKf8Lz+Do8SJE4EsvUlWf5pxpTiy6YuHzg1JrTxEKwF/cPYi81f/uD8+z2fooNNTt L1lv6YblQj4m6NlInCpUNhxydSn29HKJv9Tt2smJol2c3Pw99N2G7IRMvE356CZ/GCLj gyBA== X-Gm-Message-State: ABuFfoi43bk402GYOfnokBp2M58VfjpNNYf0Hlf/cWWbXGdJkGYCOlmr HnuzIr6RvG9Cf4AtQ93/0jmKzrPtBzoI6H3IOn/NqQ== X-Received: by 2002:a5b:c4b:: with SMTP id d11-v6mr5396743ybr.381.1537808677386; Mon, 24 Sep 2018 10:04:37 -0700 (PDT) MIME-Version: 1.0 References: <20180913223143.12664-1-rajatja@google.com> <20180924135935.GP15943@smile.fi.intel.com> <70D28D5DAE32E9429B09AA8B7C84AC472C0000CB@BGSMSX106.gar.corp.intel.com> In-Reply-To: <70D28D5DAE32E9429B09AA8B7C84AC472C0000CB@BGSMSX106.gar.corp.intel.com> From: Rajat Jain Date: Mon, 24 Sep 2018 10:04:00 -0700 Message-ID: Subject: Re: [PATCH] pinctrl: icelake: Fix the resource number for community-4/5 To: "Banik, Subrata" Cc: Andy Shevchenko , Mika Westerberg , Linus Walleij , linux-gpio@vger.kernel.org, Linux Kernel Mailing List , Rajat Jain , "Bohra, Aamir" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Mon, Sep 24, 2018 at 7:54 AM Banik, Subrata wr= ote: > > HI Andy, > > You are right that this ASL code is not same with Intel reference BIOS co= de because BIOS sources are different between what you are looking vs what = Chrome OS is using. In Coreboot BIOS, we are more relying on EDS spec and a= s COM 3 is dedicated for CPU GPIO hence we are mapping, 0/1/2/4/5 (whatever= present in EDS vol 1.1) > > We have ensured that PCR ID and offsets are correct in ASL code for respe= ctive community, I don't think anything else really matter from BIOS unless= you tell me, that you are having any required that your drive code will on= ly probe for 4 COMM for LP and 5 for ICL-H? > > Thanks, > Subrata > > -----Original Message----- > From: Andy Shevchenko [mailto:andy.shevchenko@gmail.com] > Sent: Monday, September 24, 2018 7:30 PM > To: Rajat Jain > Cc: Mika Westerberg ; Linus Walleij ; linux-gpio@vger.kernel.org; Linux Kernel Mailing Li= st ; Rajat Jain ; Banik= , Subrata ; Bohra, Aamir > Subject: Re: [PATCH] pinctrl: icelake: Fix the resource number for commun= ity-4/5 > > On Thu, Sep 20, 2018 at 10:19:34AM -0700, Rajat Jain wrote: > > On Fri, Sep 14, 2018 at 2:38 PM Rajat Jain wrote: > > > On Fri, Sep 14, 2018 at 2:06 PM Rajat Jain wrote= : > > > > On Fri, Sep 14, 2018 at 12:41 AM Andy Shevchenko > > > > wrote: > > > > > On Fri, Sep 14, 2018 at 1:54 AM Rajat Jain w= rote: > > > > > > > > > > > > The Icelake does not have a community-3, and the memory > > > > > > resources are laid out in the following order in the ACPI: > > > > > > > > > > > > resource-0: community-0 registers > > > > > > resource-1: community-1 registers > > > > > > resource-2: community-2 registers > > > > > > resource-3: community-4 registers > > > > > > resource-4: community-5 registers > > > > > > > > > > > > (EDS also describes the communities in the above order). > > > > > > > > > > > > Since the pinctrl driver exposes communities 0, 1, 4, 5, it > > > > > > needs to get the corresponding community registers by getting t= he resourse number right. > > > > > > Currently the resourse number is not correct for community 4 > > > > > > and 5, thus fix that. > > > > > > > > > > > > > > > > Can you share link to the ACPI dump of the tables? (you may get > > > > > one by running `acpidump -o tables.dat`) > > > > Hello Andy, > > > > Any feedback on this patch? I provided a dump of the ACPI below, > > please let me know if you need more info. > > Sorry it took a while (I had to get tested on our reference BIOS(es) on I= ce Lake platforms we have). > See my reply below. > > > > > I don't have that command on my system, but I took > > > > /sys/firmware/acpi/tables/DSDT from the system and disassembled it > > > > using Intel disassembler (iasl -d) and here is the relevant > > > > portion that describes the GPIO controller. The port IDs for > > > > communities can be seen in the below output (i.e. the PCRB()): > > > > > > I realized PCRB() is an ACPI method defined in the same disasembly: > > > > > > Method (PCRB, 1, NotSerialized) > > > { > > > Return ((0xFD000000 + (Arg0 << 0x10))) > > > } > > > > > > > > > > > Device (GPIO) > > > > { > > > > Name (_HID, "INT3455") // _HID: Hardware ID > > > > Name (_UID, Zero) // _UID: Unique ID > > > > Name (_DDN, "GPIO Controller") // _DDN: DOS Device= Name > > > > Name (RBUF, ResourceTemplate () > > > > { > > > > Memory32Fixed (ReadWrite, > > > > 0x00000000, // Address Base > > > > 0x00000000, // Address Length > > > > _Y06) > > > > Memory32Fixed (ReadWrite, > > > > 0x00000000, // Address Base > > > > 0x00000000, // Address Length > > > > _Y07) > > > > Memory32Fixed (ReadWrite, > > > > 0x00000000, // Address Base > > > > 0x00000000, // Address Length > > > > _Y08) > > > > Memory32Fixed (ReadWrite, > > > > 0x00000000, // Address Base > > > > 0x00000000, // Address Length > > > > _Y09) > > > > Memory32Fixed (ReadWrite, > > > > 0x00000000, // Address Base > > > > 0x00000000, // Address Length > > > > _Y0A) > > > > Interrupt (ResourceConsumer, Level, ActiveLow, = Shared, ,, ) > > > > { > > > > 0x0000000E, > > > > } > > > > }) > > > > Method (_CRS, 0, NotSerialized) // _CRS: Current > > > > Resource Settings > > > > { > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y06._BAS, > > > > BAS0) // _BAS: Base Address > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y06._LEN, > > > > LEN0) // _LEN: Length > > > > BAS0 =3D PCRB (0x6E) > > > > LEN0 =3D 0x00010000 > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y07._BAS, > > > > BAS1) // _BAS: Base Address > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y07._LEN, > > > > LEN1) // _LEN: Length > > > > BAS1 =3D PCRB (0x6D) > > > > LEN1 =3D 0x00010000 > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y08._BAS, > > > > BAS2) // _BAS: Base Address > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y08._LEN, > > > > LEN2) // _LEN: Length > > > > BAS2 =3D PCRB (0x6C) > > > > LEN2 =3D 0x00010000 > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y09._BAS, > > > > BAS4) // _BAS: Base Address > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y09._LEN, > > > > LEN4) // _LEN: Length > > > > BAS4 =3D PCRB (0x6A) > > > > LEN4 =3D 0x00010000 > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y0A._BAS, > > > > BAS5) // _BAS: Base Address > > > > CreateDWordField (RBUF, > > > > \_SB.PCI0.GPIO._Y0A._LEN, > > > > LEN5) // _LEN: Length > > > > BAS5 =3D PCRB (0x69) > > > > LEN5 =3D 0x00010000 > > > > Return (RBUF) /* \_SB_.PCI0.GPIO.RBUF */ > > > > } > > > > > > > > Method (_STA, 0, NotSerialized) // _STA: Status > > > > { > > > > Return (0x0F) > > > > } > > > > } > > > > > > > > Please let me know if this helps, or if you need more info. > > First of all, this is pre-production chip, so, I don't think there is a b= ug in the driver (yet) discovered. > > Looking to the above ASL code I may conclude that is definitely is *not* = from our reference BIOS. > I have checked two versions of it and found that in both we have the foll= owing mapping: > for LP variant: there are only 4 communities are exported for H variant: = there are only 5 communities are exported > > So, I guess the problem is in ASL code you provided. It simple should not= export that community at all. > > In case you need to do so, there are ways: > - contact Intel and ask for a change in reference BIOS > - acquire another ACPI ID for the case, or, perhaps use special constant= s like > _HRV for that purpose (also need to contact Intel while doing that) As Subrata clarified (Subrata & Aamir are from Intel's Coreboot team), that is not *the* Intel reference BIOS that you are using, but it is *an* Intel generated BIOS/Coreboot image. Andy, can you please let us know in what order are the resources laid out in your reference BIOS for the case when it exports 5 communities (i.e. community-0-2, 4-5)? Thanks, Rajat > > P.S. I think EDS covers it as it present in HW, though not exported by FW= . > > -- > With Best Regards, > Andy Shevchenko > >