From patchwork Tue Oct 5 14:37:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 12536911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69F4FC433F5 for ; Tue, 5 Oct 2021 14:38:16 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 4CC2561381; Tue, 5 Oct 2021 14:38:16 +0000 (UTC) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E23E61372 for ; Tue, 5 Oct 2021 14:38:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E23E61372 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=semihalf.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=semihalf.com Received: by mail-lf1-f53.google.com with SMTP id x27so87334943lfu.5 for ; Tue, 05 Oct 2021 07:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=klTjczTUx8b1c2tX38XlKQEw8mKHpQEoY//ZV2AWwv8=; b=Dt8fAg1I9xPaomCa7reH7OK7NJBIuG3OckiqCfqYhOscZS+aDefAdl2iB6gSGYc9N8 FWy4PDKwKyaeGINQDfSU+6/FBU8W2XimCAdNYeQAQ/yWL5WwZd6iCnfQQBRBP1g7DC6f vLM0zBqkF++xS5L5lTB3R/2D1vO5dxzLFDjFb50sfpu7WYK0pdYEvIi1gcO8GBaDGfnm fh1wWuUp7K97RzDezKc/7D1y1AK9c82a9Y8QmOT7ySgQYgQTM4LKqn1uWWEEW2t8q1uy FXPACkkrzTjyQMyaektNdKcOQ3M9x7HIp3bTHhSlCyhsoNjUWaaeTrWdBF6eUGbNP2SE ePWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=klTjczTUx8b1c2tX38XlKQEw8mKHpQEoY//ZV2AWwv8=; b=yscaTKWAU28FD+nDKpq68uJWelb8g1ZFOQSkm9UtWO0vUQh0bnuiqUx0DV6DyCJj8A jC0iElW0Hdz26hxbnwhei6CAFMiI0c+Dtlw+EqbJk4nfnQr2MrVXstI/vfblGqRUcJKX mpqOgv8FtX5XyE9xZPQ9CknuAIP3EUtoijMB9atCtkLOSetHll4qAnbULnFt/wWIlhaz mUTBD2xETNItSHutIrGliRZKgFHz35QU45o79IeV16GYfkFMUv3kKetD1UONLjvbEgwi aIx6yrgoFkdIMTWF3r+tDeOm2v/gYz6/K4xlJ4y9ebhzHNGDLfSKlI7jZ4jPNBadNq8f qtww== X-Gm-Message-State: AOAM531dTTYDBhEvMhJrk6QrYeWrqQeK4RFxlA+gB33Gd9JXu690TzSN iqnKweNE4bF1AohcnA5ul3MbJA== X-Google-Smtp-Source: ABdhPJyClsOWQd1HOJx8+kEKXL8GXAvDh/ETWKrerqxRvGr3pDmCfDtf3PwnNF8948g8MDS7LYIO4w== X-Received: by 2002:a05:6512:32c1:: with SMTP id f1mr3769373lfg.471.1633444692745; Tue, 05 Oct 2021 07:38:12 -0700 (PDT) Received: from grasshopper.googchameleon.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id u25sm1973835lfc.176.2021.10.05.07.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 07:38:12 -0700 (PDT) From: =?utf-8?q?Pawe=C5=82_Anikiel?= List-Id: To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, robh+dt@kernel.org, p.zabel@pengutronix.de, arnd@arndb.de, olof@lixom.net, soc@kernel.org, dinguyen@kernel.org, p.yadav@ti.com, Tudor.Ambarus@microchip.com Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com, sre@kernel.org, thunder.leizhen@huawei.com, Jonathan.Cameron@huawei.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ka@semihalf.com, tn@semihalf.com, jam@semihalf.com, amstan@google.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Subject: [PATCH v2 1/4] i2c: check bus number property in DesignWare I2C Controller Date: Tue, 5 Oct 2021 16:37:45 +0200 Message-Id: <20211005143748.2471647-2-pan@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005143748.2471647-1-pan@semihalf.com> References: <20211005143748.2471647-1-pan@semihalf.com> MIME-Version: 1.0 On SoCFPGA systems, it's desireable to have fixed numbering for i2c busses, while being able to enable/disable them (e.g. have i2c1 be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also be achieved using devicetree aliases (see i2c_add_adapter). However, having the driver be self-contained without relying on aliases is more robust. Signed-off-by: Paweł Anikiel --- drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 21113665ddea..f27e6bc9ad9d 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -280,7 +280,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED; ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); adap->dev.of_node = pdev->dev.of_node; - adap->nr = -1; + if (of_property_read_u32(pdev->dev.of_node, "busno", &adap->nr)) + adap->nr = -1; if (dev->flags & ACCESS_NO_IRQ_SUSPEND) { dev_pm_set_driver_flags(&pdev->dev, From patchwork Tue Oct 5 14:37:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 12536913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 030D2C433F5 for ; Tue, 5 Oct 2021 14:38:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDA49613D5 for ; Tue, 5 Oct 2021 14:38:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235518AbhJEOkH (ORCPT ); Tue, 5 Oct 2021 10:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbhJEOkH (ORCPT ); Tue, 5 Oct 2021 10:40:07 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60006C061755 for ; Tue, 5 Oct 2021 07:38:16 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id i4so88027499lfv.4 for ; Tue, 05 Oct 2021 07:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z8yJ3pPZ9+WPMdAHGwCAtozfSgkyhJMEnQnMA+Z0TQI=; b=0CE3XJmx7D6euF5qrA2Opsb+C3uYz+egZm36W2sRX5c0XlTlmxj9meTCHFzWx4P+kC cj7WYKZkaziTQJItkQNcG7FDbGdy2qByNwUkZpr+z6QaJP7FXZoBHmna27omLi+1F+Pc Zy/BR3dISsxo34DCfGR0fF5qio1t59z8jfvYWCErYDjplgL/HQK99Rmtx8zEVqSLWCjN lR+icNyvVSyx2f6juS3dvQ5LpJQFDiQk0mchttG5xqk73hhNfin+cpSLYVsaljqYgc+j 1yUACMgYpNoGKLAihzOuQ8bgVHvsppCKtWcDD40kSsbV+A8y9AhDFawtDfZWWIgmOdNr ZLrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z8yJ3pPZ9+WPMdAHGwCAtozfSgkyhJMEnQnMA+Z0TQI=; b=qF9rgCBD2djuI/EXiHtnMuspYDLftpdB5qDyiRkixl4Xp3SM/yoiDnveYmnt5TFjon TjJ/67Rf8n8J8QgCuRlx0oKSdsjBZKKyQhsSfZp39uGLYuB7UIonXX0yrQrGahBBtCXr aIc+0mHZG1QvcKLtFlTbFaOtIeoHbjTuCkvYUqxZAQANNFRLvxChqy/fyaASAdEPafZI HQKZc5qtCQpWSMNxLebOBEixrw24r0K5Bbw1CWUV++NPdk1JhJ/6A6jtolRr8079cTa3 fJhcvFkJdhfxDXIJBloAOVU6eqeuNxFmj8c4NQeLYm0jp+l7SHHFE1KQPKvf/Fam6OcA tBTA== X-Gm-Message-State: AOAM533ctCosh82ewDe7ZBEv/Q6aOHcdPyA8ki659ErtqcF4wBxJ9nBw XMnGKKsdC70Tr6vOdBEtFYwGrg== X-Google-Smtp-Source: ABdhPJzaxO4ySi1hxPEHc55AKtXS0CtE0M+NBzHPCG+qdRxgDm6cu0AbkYqr8+G8n3cVtkEUfe7g0g== X-Received: by 2002:a19:4802:: with SMTP id v2mr3839955lfa.49.1633444694743; Tue, 05 Oct 2021 07:38:14 -0700 (PDT) Received: from grasshopper.googchameleon.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id u25sm1973835lfc.176.2021.10.05.07.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 07:38:14 -0700 (PDT) From: =?utf-8?q?Pawe=C5=82_Anikiel?= List-Id: To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, robh+dt@kernel.org, p.zabel@pengutronix.de, arnd@arndb.de, olof@lixom.net, soc@kernel.org, dinguyen@kernel.org, p.yadav@ti.com, Tudor.Ambarus@microchip.com Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com, sre@kernel.org, thunder.leizhen@huawei.com, Jonathan.Cameron@huawei.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ka@semihalf.com, tn@semihalf.com, jam@semihalf.com, amstan@google.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Subject: [PATCH v2 2/4] dt-bindings: add bus number property Date: Tue, 5 Oct 2021 16:37:46 +0200 Message-Id: <20211005143748.2471647-3-pan@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005143748.2471647-1-pan@semihalf.com> References: <20211005143748.2471647-1-pan@semihalf.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On SoCFPGA systems, it's desireable to have fixed numbering for i2c busses, while being able to enable/disable them (e.g. have i2c1 be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also be achieved using devicetree aliases (see i2c_add_adapter). However, having the driver be self-contained without relying on aliases is more robust. Signed-off-by: Paweł Anikiel --- .../devicetree/bindings/i2c/snps,designware-i2c.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml index d9293c57f573..1e02ddcbd690 100644 --- a/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml @@ -93,6 +93,11 @@ properties: - const: tx - const: rx + busno: + description: | + The property should contain the desired bus number (as opposed to + being assigned automatically) + unevaluatedProperties: false required: From patchwork Tue Oct 5 14:37:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 12536915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89BE9C43217 for ; Tue, 5 Oct 2021 14:38:19 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 7255A613E6; Tue, 5 Oct 2021 14:38:19 +0000 (UTC) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59BFF61372 for ; Tue, 5 Oct 2021 14:38:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 59BFF61372 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=semihalf.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=semihalf.com Received: by mail-lf1-f42.google.com with SMTP id u18so87445135lfd.12 for ; Tue, 05 Oct 2021 07:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aD0ZimcpDdMwxxDkok8INnwAF4L8JkxKG7hlNjJNuc4=; b=xr/EbJQXsQv4f8TFJbE2w6XzhEQf/jsX9u4gGwqhd0AvcG1AQDhsxEeR3pfpTpw9c/ KWVwcxUDdoeM0yqquLJuLWpJAAopOx97wTP2Q+143laE4khIxbb7JeDeJkR0gOb8oIYC 41ZvV95CrLfPsQoREGzi1/nO++3VwdYgi7hfrL1aUdWK/pibrAd2XGwDYYRuFNx+X2/j gcsZYfGj1GvbBlX1TeaPjFFx5ZmBKAMWu6nLTQlVGsYEgOUO5gOnH6phW7sFkuA0VJp7 0bdXaeVjd+P/1BCvlgovSJPtphlexKfI7yWMs6mFzykdj73vQENifMenCHBjmbdX5E9Y gEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aD0ZimcpDdMwxxDkok8INnwAF4L8JkxKG7hlNjJNuc4=; b=UsDyUJ8gxn6KK4jIoqj3OLXnYPi2YLeqLbG1DQMKEPsh7ov5lqNCgZ5Ay7te5WTPDb I0R22JKmn1TYBLyZUH8wkST2lLC3Qv8BsI7o6uhxp56iQCMHEVfQHixTfK3m5d5XGfcu 0U8z8kVaui3/vvdu7ya0W/XHxFv+Pcrwt3iRh5IF82TGxS3YhajngJrFQQTu0MmZm5Xv 8tEWmWPyT2Kr8YkWUJl87MFROCcNa2cGuCQaIZ52irQWjOC/XpGzr45QPnCrmow6wDKE O4SiFj5fyNCsfTaF6JZIG1GBLVS8jY5C+VxAopuqX/C4LFkGfqmFSVqQfbgtHcJ8dX1v dziQ== X-Gm-Message-State: AOAM530/5FQcdNg9dTa3hW1HMMnSqiHGpXSvmhVna3aa7yw7ydKn8dCS dFLB9rXU0rMsT0Bxs2mUJHXemQ== X-Google-Smtp-Source: ABdhPJz1Gqoll+/R0fBf7HkcMgpMiilGz9sNSE96xW6sZExUwmOViaK4fIephyq2Ege3h6LgH4KT9Q== X-Received: by 2002:a05:6512:1053:: with SMTP id c19mr3819153lfb.283.1633444697355; Tue, 05 Oct 2021 07:38:17 -0700 (PDT) Received: from grasshopper.googchameleon.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id u25sm1973835lfc.176.2021.10.05.07.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 07:38:17 -0700 (PDT) From: =?utf-8?q?Pawe=C5=82_Anikiel?= List-Id: To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, robh+dt@kernel.org, p.zabel@pengutronix.de, arnd@arndb.de, olof@lixom.net, soc@kernel.org, dinguyen@kernel.org, p.yadav@ti.com, Tudor.Ambarus@microchip.com Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com, sre@kernel.org, thunder.leizhen@huawei.com, Jonathan.Cameron@huawei.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ka@semihalf.com, tn@semihalf.com, jam@semihalf.com, amstan@google.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Subject: [PATCH v2 3/4] reset: socfpga: add empty driver allowing consumers to probe Date: Tue, 5 Oct 2021 16:37:47 +0200 Message-Id: <20211005143748.2471647-4-pan@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005143748.2471647-1-pan@semihalf.com> References: <20211005143748.2471647-1-pan@semihalf.com> MIME-Version: 1.0 The early reset driver doesn't ever probe, which causes consuming devices to be unable to probe. Add an empty driver to set this device as available, allowing consumers to probe. Signed-off-by: Paweł Anikiel --- drivers/reset/reset-socfpga.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index 2a72f861f798..8c6492e5693c 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c @@ -92,3 +92,29 @@ void __init socfpga_reset_init(void) for_each_matching_node(np, socfpga_early_reset_dt_ids) a10_reset_init(np); } + +/* + * The early driver is problematic, because it doesn't register + * itself as a driver. This causes certain device links to prevent + * consumer devices from probing. The hacky solution is to register + * an empty driver, whose only job is to attach itself to the reset + * manager and call probe. + */ +static const struct of_device_id socfpga_reset_dt_ids[] = { + { .compatible = "altr,rst-mgr", }, + { /* sentinel */ }, +}; + +static int reset_simple_probe(struct platform_device *pdev) +{ + return 0; +} + +static struct platform_driver reset_socfpga_driver = { + .probe = reset_simple_probe, + .driver = { + .name = "socfpga-reset", + .of_match_table = socfpga_reset_dt_ids, + }, +}; +builtin_platform_driver(reset_socfpga_driver); From patchwork Tue Oct 5 14:37:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 12536917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C13AC433EF for ; Tue, 5 Oct 2021 14:38:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84504613D5 for ; Tue, 5 Oct 2021 14:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235635AbhJEOkQ (ORCPT ); Tue, 5 Oct 2021 10:40:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235682AbhJEOkP (ORCPT ); Tue, 5 Oct 2021 10:40:15 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C0C2C0613EC for ; Tue, 5 Oct 2021 07:38:24 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id r19so4520186lfe.10 for ; Tue, 05 Oct 2021 07:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bft5UO0IvHnnqu7NpeleauDM+2TITH2jaKZbwnmA6VM=; b=UU9L+06t7QQJbnIFm6uKYIL3+oggbtuy1cE6fNaxN5loz+ex+Wx1xNM0Y61247WKKq t5Z+Q7lDLXzCH4RFCU2qjmOSqghXPGLyiEfq5cFrAcCd2Dtp3giGhL0aYbaeH2ZbQkh+ pBVgWY2c7yWewZ76+sPWg3r5Y47Ll/aR1h+PRecw3yYibWciEUrsXmyfEVCUYQstqFXb EOl9cEQZteQwpvPuEVEp/opTKIeazXBV6PD+n7k07E2+5qnKaiOcjXlEXlNC+6iKasjO XhSPAZOpi9xso7qEzN/vIQsecPJrYLN2XLDfNyWcZ/zig5mNwz5Rj5YGIAoj/pVNSsN7 wuAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bft5UO0IvHnnqu7NpeleauDM+2TITH2jaKZbwnmA6VM=; b=PuMv+Gx6DreHvPRcLgmrzmqRWK8wrwG1FvnKtKZAW0uztnz9giMfY6Ta9aHv+aILPs Bu821CdLArBexJXQQ8u8qRGjbJ0YvfvzxJWzvDKere1FhFtXqeXUcSl6EPLudDUNRUyp 3j7LXfwIBzph1b1/IrRCkTzm/xUotHvf92PQY5Cxuzb5xG9i7G35JjSS2OuLviWYiyPb t0U8OTUoiibeodo1rRA7saqssbP25V3fWMNZS6G2c7cUz5/MQoBnKvkP0iGP9qXJNcxp Ek+UN6VU9GP9G3MMReU8fXG5zA1DCuYp3DxwsPILH9EZFd/IUqKVv5p5gvaJkDb7ODWs CzdQ== X-Gm-Message-State: AOAM530ZEzG0nxN/5l+J2tR8eV7AJuJz0X7GSK5sSHF97UgEkujgNUQE p8A4L0U5A523s/Uy3spICPo/7A== X-Google-Smtp-Source: ABdhPJxtNs3DBnnLdW1v/+5GPBOiTJoGXMzrfQcqBWcrRZZgflaIbwl8qX/DwjWUYD8Pej361yO4XA== X-Received: by 2002:a05:6512:21c:: with SMTP id a28mr3890008lfo.626.1633444701917; Tue, 05 Oct 2021 07:38:21 -0700 (PDT) Received: from grasshopper.googchameleon.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id u25sm1973835lfc.176.2021.10.05.07.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 07:38:21 -0700 (PDT) From: =?utf-8?q?Pawe=C5=82_Anikiel?= List-Id: To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, robh+dt@kernel.org, p.zabel@pengutronix.de, arnd@arndb.de, olof@lixom.net, soc@kernel.org, dinguyen@kernel.org, p.yadav@ti.com, Tudor.Ambarus@microchip.com Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com, sre@kernel.org, thunder.leizhen@huawei.com, Jonathan.Cameron@huawei.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ka@semihalf.com, tn@semihalf.com, jam@semihalf.com, amstan@google.com, =?utf-8?q?Pawe=C5=82_Anikiel?= , Joanna Brozek , Mariusz Glebocki , Tomasz Gorochowik , Maciej Mikunda Subject: [PATCH v2 4/4] dts: socfpga: Add Mercury+ AA1 devicetree Date: Tue, 5 Oct 2021 16:37:48 +0200 Message-Id: <20211005143748.2471647-5-pan@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005143748.2471647-1-pan@semihalf.com> References: <20211005143748.2471647-1-pan@semihalf.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for the Mercury+ AA1 module for Arria 10 SoC FPGA. Signed-off-by: Paweł Anikiel Signed-off-by: Joanna Brozek Signed-off-by: Mariusz Glebocki Signed-off-by: Tomasz Gorochowik Signed-off-by: Maciej Mikunda --- arch/arm/boot/dts/Makefile | 1 + .../boot/dts/socfpga_arria10_mercury_aa1.dts | 111 ++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 7e0934180724..0a7809eb3795 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1078,6 +1078,7 @@ dtb-$(CONFIG_ARCH_INTEL_SOCFPGA) += \ socfpga_arria10_socdk_nand.dtb \ socfpga_arria10_socdk_qspi.dtb \ socfpga_arria10_socdk_sdmmc.dtb \ + socfpga_arria10_mercury_aa1.dtb \ socfpga_cyclone5_chameleon96.dtb \ socfpga_cyclone5_mcvevk.dtb \ socfpga_cyclone5_socdk.dtb \ diff --git a/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts b/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts new file mode 100644 index 000000000000..1e11168b80db --- /dev/null +++ b/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "socfpga_arria10.dtsi" + +/ { + + model = "Enclustra Mercury AA1"; + compatible = "altr,socfpga-arria10", "altr,socfpga"; + + aliases { + ethernet0 = &gmac0; + serial1 = &uart1; + }; + + memory@0 { + name = "memory"; + device_type = "memory"; + reg = <0x0 0x80000000>; /* 2GB */ + }; + + chosen { + stdout-path = "serial1:115200n8"; + }; +}; + +&eccmgr { + sdmmca-ecc@ff8c2c00 { + compatible = "altr,socfpga-sdmmc-ecc"; + reg = <0xff8c2c00 0x400>; + altr,ecc-parent = <&mmc>; + interrupts = <15 IRQ_TYPE_LEVEL_HIGH>, + <47 IRQ_TYPE_LEVEL_HIGH>, + <16 IRQ_TYPE_LEVEL_HIGH>, + <48 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&gmac0 { + phy-mode = "rgmii"; + phy-addr = <0xffffffff>; /* probe for phy addr */ + + max-frame-size = <3800>; + status = "okay"; + + phy-handle = <&phy3>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy3: ethernet-phy@3 { + txd0-skew-ps = <0>; /* -420ps */ + txd1-skew-ps = <0>; /* -420ps */ + txd2-skew-ps = <0>; /* -420ps */ + txd3-skew-ps = <0>; /* -420ps */ + rxd0-skew-ps = <420>; /* 0ps */ + rxd1-skew-ps = <420>; /* 0ps */ + rxd2-skew-ps = <420>; /* 0ps */ + rxd3-skew-ps = <420>; /* 0ps */ + txen-skew-ps = <0>; /* -420ps */ + txc-skew-ps = <1860>; /* 960ps */ + rxdv-skew-ps = <420>; /* 0ps */ + rxc-skew-ps = <1680>; /* 780ps */ + reg = <3>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&i2c1 { + status = "okay"; + busno = <1>; + isl12022: isl12022@6f { + status = "okay"; + compatible = "isil,isl12022"; + reg = <0x6f>; + }; +}; + +/* Following mappings are taken from arria10 socdk dts */ +&mmc { + status = "okay"; + cap-sd-highspeed; + broken-cd; + bus-width = <4>; +}; + +&osc1 { + clock-frequency = <33330000>; +}; + +&uart1 { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +};