From patchwork Mon Oct 21 03:38:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1180233 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ih+5y+KO"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46xNJ96NTJz9sCJ for ; Mon, 21 Oct 2019 15:02:17 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9ACB9C21CB6; Mon, 21 Oct 2019 03:52:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0AFEDC21D83; Mon, 21 Oct 2019 03:52:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C4D5FC21DD9; Mon, 21 Oct 2019 03:40:51 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id 61A5FC21DED for ; Mon, 21 Oct 2019 03:40:51 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id a1so14156775ioc.6 for ; Sun, 20 Oct 2019 20:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GHOSzm87tMPmP2jtJ00oiLc0nd9CC+/Uikx+aDdwGSw=; b=ih+5y+KOk6Awqf/Xo9FoGyielG9Ubx9FbUjTyxKGzjBt5U49lAH8hvpF4HZQ9kK60C c5ZLPZdpiK1Uiab5kM3doa6Er0D+l4xh79LLVJmOSZYKlsyu1Zn61jWJyP+sDZCNK+sZ QAzzbX81J2kwf2Bt3/DkzUz9QUvtd2mspXbaw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GHOSzm87tMPmP2jtJ00oiLc0nd9CC+/Uikx+aDdwGSw=; b=cOmL1iWUaaYCOt9H8hlAzIOxlz82vsoCAV1hlk1+FazGYFBy9A0epDTIOTqFY2uSsQ Sm2jNE+1vygK0d8PYqJCadJQjtmwvQZD4Dr0bo9dFP4c/Q/Ne+yRqfYaO9YWc0w9zIrW 7ivYvkBj12xV328pPqkKr6V/yxEX6rGo5yg3or3tYvtdDGsFS2KQMFBHnHOkw4cORm4u j6BKFH4GQVfyjymPgVuJj0XUquK2KeGkC1WMnVFudmlOcZFzfJoZVn+h1xHA7ZfCTHuZ h4z4morIHFCssrGn0R5b2yFjbqv8UUEnIGPHVL7Sw7+HzHEbRK3lJyCMk9RvvFMJQyTb kcKQ== X-Gm-Message-State: APjAAAXRvbjZ1gKsunVTXTBK+IXxhaXhoenb2/JTVu0MuO+f4EvSdi15 H9qQp17C+Em8EVJc9ZYQr4vs8y+mcWMSig== X-Google-Smtp-Source: APXvYqyMUELJyXvtZEVRHpOGJbjXVGGNlTH4jMXLqVvP/W/lJbIs41eg+dr0oAfE4oz/TZgv/t0TNg== X-Received: by 2002:a5d:8b8b:: with SMTP id p11mr20025902iol.2.1571629250148; Sun, 20 Oct 2019 20:40:50 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id x14sm1947028ion.67.2019.10.20.20.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 20:40:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 20 Oct 2019 21:38:59 -0600 Message-Id: <20191021033913.220758-89-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog In-Reply-To: <20191021033913.220758-22-sjg@chromium.org> References: <20191021033913.220758-22-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v3 094/108] i2c: designware: Add apollolake support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For apollolake we need to take the I2C bus controller out of reset before using this. Add this functionality to the driver. Signed-off-by: Simon Glass Reviewed-by: Heiko Schocher --- Changes in v3: - Add a weak function to avoid errors on other platforms Changes in v2: None drivers/i2c/dw_i2c_pci.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/dw_i2c_pci.c b/drivers/i2c/dw_i2c_pci.c index 065c0aa5994..d6d93f08a56 100644 --- a/drivers/i2c/dw_i2c_pci.c +++ b/drivers/i2c/dw_i2c_pci.c @@ -6,8 +6,14 @@ */ #include +#include #include "designware_i2c.h" +enum { + VANILLA = 0, + INTEL_APL, +}; + /* BayTrail HCNT/LCNT/SDA hold time */ static struct dw_scl_sda_cfg byt_config = { .ss_hcnt = 0x200, @@ -17,6 +23,9 @@ static struct dw_scl_sda_cfg byt_config = { .sda_hold = 0x6, }; +/* Have a weak function for now - possibly should be a new uclass */ +void lpss_reset_release(void *regs); + static int designware_i2c_pci_probe(struct udevice *dev) { struct dw_i2c *priv = dev_get_priv(dev); @@ -25,9 +34,12 @@ static int designware_i2c_pci_probe(struct udevice *dev) priv->regs = (struct i2c_regs *) dm_pci_map_bar(dev, PCI_BASE_ADDRESS_0, PCI_REGION_MEM); if (IS_ENABLED(CONFIG_INTEL_BAYTRAIL)) - /* Use BayTrail specific timing values */ + /* Use BayTrail-specific timing values */ priv->scl_sda_cfg = &byt_config; + if (dev_get_driver_data(dev) == INTEL_APL) + lpss_reset_release(priv->regs); + return designware_i2c_probe(dev); } @@ -72,6 +84,12 @@ static struct pci_device_id designware_pci_supported[] = { { PCI_VDEVICE(INTEL, 0x0f45) }, { PCI_VDEVICE(INTEL, 0x0f46) }, { PCI_VDEVICE(INTEL, 0x0f47) }, + { PCI_VDEVICE(INTEL, 0x5aac), .driver_data = INTEL_APL }, + { PCI_VDEVICE(INTEL, 0x5aae), .driver_data = INTEL_APL }, + { PCI_VDEVICE(INTEL, 0x5ab0), .driver_data = INTEL_APL }, + { PCI_VDEVICE(INTEL, 0x5ab2), .driver_data = INTEL_APL }, + { PCI_VDEVICE(INTEL, 0x5ab4), .driver_data = INTEL_APL }, + { PCI_VDEVICE(INTEL, 0x5ab6), .driver_data = INTEL_APL }, {}, };