From patchwork Thu Mar 4 03:41:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 392944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5396C433E9 for ; Thu, 4 Mar 2021 03:44:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85FC564EE3 for ; Thu, 4 Mar 2021 03:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232941AbhCDDoI (ORCPT ); Wed, 3 Mar 2021 22:44:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232870AbhCDDnn (ORCPT ); Wed, 3 Mar 2021 22:43:43 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D4F2C0613D7 for ; Wed, 3 Mar 2021 19:42:25 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id p21so17975793pgl.12 for ; Wed, 03 Mar 2021 19:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7IXr18Hn1vMbGajH4e6/GFThZSI5KjMPmreJV9rQ8rA=; b=kRE7T/nkqip8YNz7QG7WPvRdvtYdpFzP9192IOB/Q6VZ2LQVNT1WNU1bpdYBlPy2mn S+5SwtX1E9GQUETYlGg58PPCKLvcdHqUYMHOQqjrEpbrXPrpAREi7jv7uKuvxlT8IcAV GzFRsfRTR7HgzBNNx/6AGNNwudMwN1FpAYayPt4SjXqpi3KsFkGye9bGKyjg937bHyle Tm8fHzoum+GV9vxkwYTQOd6m1rZvSLEGx+BPFjhQwNm830T6BoBEiWggy/QmlXKkrCHW 83bJFoFblyi1OoRfU4aNoHDJAuJAnOTWjBms2418qfxt2AEbxGK8VsOZS3yGzG2t91kY +pNA== 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; bh=7IXr18Hn1vMbGajH4e6/GFThZSI5KjMPmreJV9rQ8rA=; b=NYzBOgZxH3qbeFB4Wi1CxkIsQGHOD+zrHzZ9M1ZKS2YLjks9tPEocrsK7ujMq69b6w s9FkNh+EZulEJWU+/ZPfpx7fWRlXRsGDcZubuo1ogl3CQBQDe9oXMk6ZBnqnKMDE6RAT I6PxlrHqGGAahTlBJWbVZR8jbr818jgdXMqSMc5Ji7EF77uZN6xgo8kf3+VGaiJysEvp LaaruT3Bxhmi9wEuzpHHfIVacX4LhVbS/jCf16tg4pv2LcLfP27XK+rypPL9U5yfHDYc FuO0whxJ2ln9IIMabIXy/ox1eO/bnbzAqV188sOW/67XzDGiHBTmsWmB/csFJ2jM67cM voGg== X-Gm-Message-State: AOAM533Tg4yFP7fJu4f4jkSlI+Zn7y9uOBiCgeE7keHEZ1NQ/wqVnGVs 2vnKmrnZ1+dbOpEofrx8FB3CbQ== X-Google-Smtp-Source: ABdhPJxMTM5ReqMCqsCRCXJgOVJfHIWmnqTZJ9tyXozj1PAOfEuo2iFkwrnP8UWnNSW7//IWvda/7Q== X-Received: by 2002:a05:6a00:a95:b029:1ee:471f:e323 with SMTP id b21-20020a056a000a95b02901ee471fe323mr1798005pfl.69.1614829344580; Wed, 03 Mar 2021 19:42:24 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:24 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] gpio: Add Elba SoC gpio driver for spi cs control Date: Wed, 3 Mar 2021 19:41:34 -0800 Message-Id: <20210304034141.7062-2-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This GPIO driver is for the Pensando Elba SoC which provides control of four chip selects on two SPI busses. Signed-off-by: Brad Larson --- drivers/gpio/Kconfig | 6 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-elba-spics.c | 120 +++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 drivers/gpio/gpio-elba-spics.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index e3607ec4c2e8..d99bc82aa8fa 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -241,6 +241,12 @@ config GPIO_EIC_SPRD help Say yes here to support Spreadtrum EIC device. +config GPIO_ELBA_SPICS + bool "Pensando Elba SPI chip-select" + depends on ARCH_PENSANDO_ELBA_SOC + help + Say yes here to support the Pensndo Elba SoC SPI chip-select driver + config GPIO_EM tristate "Emma Mobile GPIO" depends on (ARCH_EMEV2 || COMPILE_TEST) && OF_GPIO diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index c58a90a3c3b1..c5c7acad371b 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -54,6 +54,7 @@ obj-$(CONFIG_GPIO_DAVINCI) += gpio-davinci.o obj-$(CONFIG_GPIO_DLN2) += gpio-dln2.o obj-$(CONFIG_GPIO_DWAPB) += gpio-dwapb.o obj-$(CONFIG_GPIO_EIC_SPRD) += gpio-eic-sprd.o +obj-$(CONFIG_GPIO_ELBA_SPICS) += gpio-elba-spics.o obj-$(CONFIG_GPIO_EM) += gpio-em.o obj-$(CONFIG_GPIO_EP93XX) += gpio-ep93xx.o obj-$(CONFIG_GPIO_EXAR) += gpio-exar.o diff --git a/drivers/gpio/gpio-elba-spics.c b/drivers/gpio/gpio-elba-spics.c new file mode 100644 index 000000000000..a845525cf2a3 --- /dev/null +++ b/drivers/gpio/gpio-elba-spics.c @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Pensando Elba ASIC SPI chip select driver + * + * Copyright (c) 2020-2021, Pensando Systems Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * pin: 3 2 | 1 0 + * bit: 7------6------5------4----|---3------2------1------0 + * cs1 cs1_ovr cs0 cs0_ovr | cs1 cs1_ovr cs0 cs0_ovr + * ssi1 | ssi0 + */ +#define SPICS_PIN_SHIFT(pin) (2 * (pin)) +#define SPICS_MASK(pin) (0x3 << SPICS_PIN_SHIFT(pin)) +#define SPICS_SET(pin, val) ((((val) << 1) | 0x1) << SPICS_PIN_SHIFT(pin)) + +struct elba_spics_priv { + void __iomem *base; + spinlock_t lock; + struct gpio_chip chip; +}; + +static int elba_spics_get_value(struct gpio_chip *chip, unsigned int pin) +{ + return -ENXIO; +} + +static void elba_spics_set_value(struct gpio_chip *chip, + unsigned int pin, int value) +{ + struct elba_spics_priv *p = gpiochip_get_data(chip); + unsigned long flags; + u32 tmp; + + /* select chip select from register */ + spin_lock_irqsave(&p->lock, flags); + tmp = readl_relaxed(p->base); + tmp = (tmp & ~SPICS_MASK(pin)) | SPICS_SET(pin, value); + writel_relaxed(tmp, p->base); + spin_unlock_irqrestore(&p->lock, flags); +} + +static int elba_spics_direction_input(struct gpio_chip *chip, unsigned int pin) +{ + return -ENXIO; +} + +static int elba_spics_direction_output(struct gpio_chip *chip, + unsigned int pin, int value) +{ + elba_spics_set_value(chip, pin, value); + return 0; +} + +static int elba_spics_probe(struct platform_device *pdev) +{ + struct elba_spics_priv *p; + struct resource *res; + int ret; + + p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); + if (!p) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + p->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(p->base)) { + dev_err(&pdev->dev, "failed to remap I/O memory\n"); + return PTR_ERR(p->base); + } + spin_lock_init(&p->lock); + platform_set_drvdata(pdev, p); + + p->chip.ngpio = 4; /* 2 cs pins for spi0, and 2 for spi1 */ + p->chip.base = -1; + p->chip.direction_input = elba_spics_direction_input; + p->chip.direction_output = elba_spics_direction_output; + p->chip.get = elba_spics_get_value; + p->chip.set = elba_spics_set_value; + p->chip.label = dev_name(&pdev->dev); + p->chip.parent = &pdev->dev; + p->chip.owner = THIS_MODULE; + + ret = devm_gpiochip_add_data(&pdev->dev, &p->chip, p); + if (ret) { + dev_err(&pdev->dev, "unable to add gpio chip\n"); + return ret; + } + + dev_info(&pdev->dev, "elba spics registered\n"); + return 0; +} + +static const struct of_device_id ebla_spics_of_match[] = { + { .compatible = "pensando,elba-spics" }, + {} +}; + +static struct platform_driver elba_spics_driver = { + .probe = elba_spics_probe, + .driver = { + .name = "pensando-elba-spics", + .of_match_table = ebla_spics_of_match, + }, +}; +module_platform_driver(elba_spics_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Elba SPI chip-select driver"); From patchwork Thu Mar 4 03:41:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 392943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D1EEC4360C for ; Thu, 4 Mar 2021 03:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A1FC64EE3 for ; Thu, 4 Mar 2021 03:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232966AbhCDDoJ (ORCPT ); Wed, 3 Mar 2021 22:44:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhCDDno (ORCPT ); Wed, 3 Mar 2021 22:43:44 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D188C0613DC for ; Wed, 3 Mar 2021 19:42:26 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id e9so5922436pjj.0 for ; Wed, 03 Mar 2021 19:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pEDn5zvdGAqn29kJmMDpnpbScHXapYdOv8Q9mn7KjzI=; b=dyQ6mxeda93Ed1Ys7wxwT79+2r8nJaEpnMREGZsW250EbE7qM9c6J9b4zVtzRWhVwc 8wRCFySB0rRbna24MTqikfa5Jbf5T67hOZlAQw8qrNH4/1JrBBymRZdyD5gZvo4thKw3 uPcuryUoMDCsW/g+88IWioCkLxarMIOuosRWUuyEPcgtnfNz9LUup9BcXlOK0t7RmzvQ G2+NF4Fu68lGlBGMpk33MXkuHaeuIJQjbObKz15VsEh+sJAJErqq0Z9JPR+Fo6uKc6Gb 9s7AsqWHtdmtJ9sb/w+i9BpjbwUQg0haBUa/9bS+8LTlAHk4lg5CMQLUq63AY8j34xuv Tk+A== 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; bh=pEDn5zvdGAqn29kJmMDpnpbScHXapYdOv8Q9mn7KjzI=; b=SnGJ7Fjwj672rkN0/mNPX5GSnHKfizncHIWvPTHO2icBSedNpyADOB8IXiCwgZUWLg GZPokEH43tuZsyAsuNefS9stWmEYrTTvZAu5a5zCAJWlZxslduyjIY1wn663lSa8fPpB 77UicUsvImh//8PZWlcZKJXHJaquhYacryj2VEmHU2aF7eLCYzceVPdnu/Ct03yBVOiS lSvTDG0kWhk46JEjClyxfmnKovXgJd/J0388NeaOgI1gX/8Qy2CEjs4p3pqCseWqdd6x CROf2UB29ngifPBA2FgUk0GPsqMZE/ChLkYytuyklbqU633cszz9kdIhAYTjhx4/xcSS o6bA== X-Gm-Message-State: AOAM530eX1pnrAZzAUm/KnDqP1ZF0yxoEmcMqfoxQCYhCyOWww678S0q 8kok8fQbqPI7eGGTR/fbp8F0vA== X-Google-Smtp-Source: ABdhPJwYrpHQt7QzewDSFjUimFQsjcQaardRWxa9Dovbew7izqL2bGvYzhlZbHVt9HmcILArx/1A5g== X-Received: by 2002:a17:90a:8b82:: with SMTP id z2mr2278618pjn.25.1614829346114; Wed, 03 Mar 2021 19:42:26 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:25 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/8] spi: cadence-quadspi: Add QSPI support for Pensando Elba SoC Date: Wed, 3 Mar 2021 19:41:35 -0800 Message-Id: <20210304034141.7062-3-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add QSPI controller support fo Pensando Elba SoC. Signed-off-by: Brad Larson --- drivers/spi/spi-cadence-quadspi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 442cc7c53a47..fb0d9b0bd596 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1353,6 +1353,7 @@ static int cqspi_request_mmap_dma(struct cqspi_st *cqspi) cqspi->rx_chan = dma_request_chan_by_mask(&mask); if (IS_ERR(cqspi->rx_chan)) { int ret = PTR_ERR(cqspi->rx_chan); + cqspi->rx_chan = NULL; return dev_err_probe(&cqspi->pdev->dev, ret, "No Rx DMA available\n"); } @@ -1632,6 +1633,10 @@ static const struct cqspi_driver_platdata intel_lgm_qspi = { .quirks = CQSPI_DISABLE_DAC_MODE, }; +static const struct cqspi_driver_platdata pen_cdns_qspi = { + .quirks = CQSPI_NEEDS_WR_DELAY | CQSPI_DISABLE_DAC_MODE, +}; + static const struct of_device_id cqspi_dt_ids[] = { { .compatible = "cdns,qspi-nor", @@ -1649,6 +1654,10 @@ static const struct of_device_id cqspi_dt_ids[] = { .compatible = "intel,lgm-qspi", .data = &intel_lgm_qspi, }, + { + .compatible = "pensando,cdns-qspi", + .data = &pen_cdns_qspi, + }, { /* end of table */ } }; From patchwork Thu Mar 4 03:41:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 393826 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF5F0C4332E for ; Thu, 4 Mar 2021 03:44:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB07364EE3 for ; Thu, 4 Mar 2021 03:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232960AbhCDDoJ (ORCPT ); Wed, 3 Mar 2021 22:44:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232944AbhCDDn7 (ORCPT ); Wed, 3 Mar 2021 22:43:59 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F37C0613E1 for ; Wed, 3 Mar 2021 19:42:29 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id b21so17995547pgk.7 for ; Wed, 03 Mar 2021 19:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7dD8l0mb5sDAQVSmMBFA7qaeWU8j70zeIRTlsOReUoY=; b=jYfGthLTJ7UnILPrxfDEyfnuE3YVIbtrs4TNr4n7KhPBnuOYoyhBb4oiNyDV5lgLtn kIXILi9nTZRmwnDodUzJYN+g+MBqQhE5ojBa0Az2OjPjNRuZX2rBLyBQ6bXYza6yRPJY fLxnyo9gvJUCSSAK6AhOckx0uaPaQE7j4uS+g/1p0K2KJbNnrLsmcgU6NO2f7K343Z/X xXfjIIRxMioez9qZQ6lyq6a47YThOFjp6gjQKA/7gBs6k7Nr3IEtlSf5eb/9Y+nptHO/ gGISGy3FX7Gf3yblt8t1xj/j8oe52f0NO8ix3llxy8u7wOHu6UyHDNdvGoWxQIOO2+5H Rp9g== 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; bh=7dD8l0mb5sDAQVSmMBFA7qaeWU8j70zeIRTlsOReUoY=; b=kF1AFAIF+hhHG+JqSM1vq19rCy9/FSsVzXTePKd5QpyI7CtqukZBfYjy64fVGypxcF 7GjyKcPmfCSwy1PURiSPIBED5KX/3zUaE3LuHh78IudCm/VWrZl0AXmRBvzBu44DslB0 m+Yyb59ZPec3yWiTjr+2SNX3FRkMDeX33bi2iqrl5sfNK+zgN6wotHDGU7GTAUhWwzvV HpVj5YgFJPnx1C1BEo8sCR2tTODs7efo6qF3UzAbVHJZ5OcexQhhj/KRAeA5P+LJXHaS 1ry2Jx9z4ZL4X2PF5L9TmUWG09xNir0ASoTfeWI7USF5yOmHIt3ruFpzDwGMjTDM+llV VXpg== X-Gm-Message-State: AOAM533YdXM0RYz3bx7Y/1URJ/oeLzQ75HulOWXUvwFB7gmppinUJZMV lPSDKRHym8K81NbqyvMn78a4rQ== X-Google-Smtp-Source: ABdhPJxc0749oEr4+QpvMEe4o0sa6qqQ6vfJQgl2a6HS1YjYrOhOFYJiFGgUZDGQH7Y7v+jcIV/3QQ== X-Received: by 2002:aa7:9d91:0:b029:1ed:e15b:631d with SMTP id f17-20020aa79d910000b02901ede15b631dmr1980685pfq.72.1614829347628; Wed, 03 Mar 2021 19:42:27 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:27 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] spi: dw: Add support for Pensando Elba SoC SPI Date: Wed, 3 Mar 2021 19:41:36 -0800 Message-Id: <20210304034141.7062-4-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Pensando Elba SoC uses a GPIO based chip select for two DW SPI busses with each bus having two chip selects. Signed-off-by: Brad Larson --- drivers/spi/spi-dw-mmio.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 17c06039a74d..417bd2125c07 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -56,7 +56,7 @@ struct dw_spi_mscc { /* * The Designware SPI controller (referred to as master in the documentation) * automatically deasserts chip select when the tx fifo is empty. The chip - * selects then needs to be either driven as GPIOs or, for the first 4 using the + * selects then needs to be either driven as GPIOs or, for the first 4 using * the SPI boot controller registers. the final chip select is an OR gate * between the Designware SPI controller and the SPI boot controller. */ @@ -237,6 +237,38 @@ static int dw_spi_canaan_k210_init(struct platform_device *pdev, return 0; } +static void dw_spi_elba_set_cs(struct spi_device *spi, bool enable) +{ + struct dw_spi *dws = spi_master_get_devdata(spi->master); + + if (!enable) { + if (spi->cs_gpiod) { + /* + * Using a GPIO-based chip-select, the DW SPI + * controller still needs its own CS bit selected + * to start the serial engine. On Elba the specific + * CS doesn't matter, so use CS0. + */ + dw_writel(dws, DW_SPI_SER, BIT(0)); + } else { + /* + * Using the intrinsic DW chip-select; set the + * appropriate CS. + */ + dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select)); + } + } else + dw_writel(dws, DW_SPI_SER, 0); +} + +static int dw_spi_elba_init(struct platform_device *pdev, + struct dw_spi_mmio *dwsmmio) +{ + dwsmmio->dws.set_cs = dw_spi_elba_set_cs; + + return 0; +} + static int dw_spi_mmio_probe(struct platform_device *pdev) { int (*init_func)(struct platform_device *pdev, @@ -351,6 +383,7 @@ static const struct of_device_id dw_spi_mmio_of_match[] = { { .compatible = "intel,keembay-ssi", .data = dw_spi_keembay_init}, { .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init}, { .compatible = "canaan,k210-spi", dw_spi_canaan_k210_init}, + { .compatible = "pensando,elba-spi", .data = dw_spi_elba_init }, { /* end of table */} }; MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match); From patchwork Thu Mar 4 03:41:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 392941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7466EC4361B for ; Thu, 4 Mar 2021 03:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6348064F16 for ; Thu, 4 Mar 2021 03:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233041AbhCDDom (ORCPT ); Wed, 3 Mar 2021 22:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233027AbhCDDoY (ORCPT ); Wed, 3 Mar 2021 22:44:24 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EBC0C0613E3 for ; Wed, 3 Mar 2021 19:42:29 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id jx13so5669535pjb.1 for ; Wed, 03 Mar 2021 19:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5evIgUHLH3iE2TL4J3188f+WN89LXupcPiWpSn3upRg=; b=krHS8jj2QXNypospcYRERtT0+swfUgztdkYoHNFA4VXLWuLUzq1MJ2lTyCbONQ9lm3 SW3+pEdHNibO6/v+AT+N1GXAJ3vlyfPvJBuznRg8PgvdmrSRvXHM1bbvOrgxmVS5NFTB fsk65ZMoYfpHFyxr+mc6JuuJoVsUtoeBzr4GpksP3Esx/CZGRBiGwBID782USqdyJ15n SqDOhFLlS4h7sR6YIdE+UcuCjTzzbET6pA1nFw+OzZp8yejsYPff5nNC4DloJ5AXxa9+ SyP2ksaKSvomzTQB22fRNsD3Qqy3qjWN90i7tG0rDH1dBA9CYj4+3a1nAU5Z5VRw5NV4 4SWQ== 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; bh=5evIgUHLH3iE2TL4J3188f+WN89LXupcPiWpSn3upRg=; b=NZtNU1wokl4LeVzSMlnM+ESORayGoyVwaOcoSAFiDxepi/cFkv8JxXtm+kQ9mE6vlx 7PwQ1G97TFpJZpO/byBn+3FNax2lXZ0RlA6L25R83wwB+Rid4ZL+JCK5LW7N4Hd2by3L GtAoQSORGZXMMpA0WKK7hcOZW4nnaRkgmHIhAd2nKvVGVZUWFrJO567jJLA7P2fk27xC n+woG8FILymbAHbZ+NKGswLvNfYp/ifSk70Yug8VUgL4CJkWRnfxDbSEftxTJ1SKgXRR wXZwgzij7R7V/0/tEpMYGppeoN33oVRHWwbnMQmMSVJkV5MU2/sTZd0BvsRFeuzq6PLa 04cA== X-Gm-Message-State: AOAM530E47lZSbq+kBUzAnT5WaYCAmpA66XTMtm0yRoEHyxYYAuzkvWS gfggPf6O3PFTpneUOYh56HAxJw== X-Google-Smtp-Source: ABdhPJyE5bFbeBfYEWSJ+gwpOI0+z1XD9msbhoODqnXnZy8LX7goajm/FKghGMdptdJQWuIweGqeRA== X-Received: by 2002:a17:903:2491:b029:e4:16d6:e0a4 with SMTP id p17-20020a1709032491b02900e416d6e0a4mr2197194plw.64.1614829349158; Wed, 03 Mar 2021 19:42:29 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:28 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] spidev: Add Pensando CPLD compatible Date: Wed, 3 Mar 2021 19:41:37 -0800 Message-Id: <20210304034141.7062-5-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Pensando Elba SoC platforms have a SPI connected CPLD for platform management. Signed-off-by: Brad Larson --- drivers/spi/spidev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 8cb4d923aeaa..8b285852ce82 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -683,6 +683,7 @@ static const struct of_device_id spidev_dt_ids[] = { { .compatible = "dh,dhcom-board" }, { .compatible = "menlo,m53cpld" }, { .compatible = "cisco,spi-petra" }, + { .compatible = "pensando,cpld" }, {}, }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); From patchwork Thu Mar 4 03:41:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 393825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA8FCC4160E for ; Thu, 4 Mar 2021 03:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8B2D64EF9 for ; Thu, 4 Mar 2021 03:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232964AbhCDDoJ (ORCPT ); Wed, 3 Mar 2021 22:44:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232959AbhCDDn7 (ORCPT ); Wed, 3 Mar 2021 22:43:59 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CAF0C0613EE for ; Wed, 3 Mar 2021 19:42:31 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id m6so17954443pfk.1 for ; Wed, 03 Mar 2021 19:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IGq13mVQnCL2F/Pzggff+qUxySDalGH8/got0UlrADY=; b=NFLF5gCiP73poABBCD/VLKTSuauriQYI1AX3hPVBG6qKHrlUluOU29ffVwXmS2B9H6 WNaOioYIHow9eviRkVF2TW8c5nJgjptOZzEPgk650nGWSaLQhl1crN9nuTQYyBapQXMX FXN/7Sb80NYyheL7SuR12H6uprAjbmfDvQBIiRRyJPS09kLaQHWByt49D3Swv1AQZACr G7FWngXrQCMXvNuUxdFFJ3jUuwxp7vrOy6wTYqYbbydthA+faA0jP0IcnUNZeLs1I0D6 cP9w6VfCBNtrLtm0oSH9bf3RUD6UPn9MA9BvK1WW/RfaC9Ow5nzhAwata7J7RgBz0e25 jCwA== 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; bh=IGq13mVQnCL2F/Pzggff+qUxySDalGH8/got0UlrADY=; b=UhCxKn6qLLbUK8/FgDcwr2dj2oPpJLRVJ0N017/QNmlZC9JZDRCRYi4SV13pgv9PEa ave+OAOwX8bK38w+2l15U1/Dk0GX7whTfKXxqvJLH2Wm3f7l5H1TsH6ZHrawm1JM+gz6 IgFQ7AXyIVlFeP2cXg6WY2puYyt8BsrY57swTkm+hbMt1RplN6b4Ij3SWJKiBu8rRv7n Nn9PAb9Sgi7Zla4UyRYiCPudK11IaJ9AAmVzfCLP88WZM1QACin8Lb4RTPNdlpDvPse+ IvIwZG9HE2HW761rgsXrQV/abtrTlDmRTu1zcNg3GX2cUGIajU2YlmLpjGVtIKywynmp qhQA== X-Gm-Message-State: AOAM530zMfvfK/d05RgB4qeoamMIlCT48Y8zi2+RDGkocb+h27sWRZB5 1izjTmT7lmuRmDhJ8ixeAmBcsQ== X-Google-Smtp-Source: ABdhPJzzYbOaLC1HxWs4HSY+c8DGuLVJJnYy5MZRg/+FghJEGKqIJ5pIQ4ajr3SOJ2fCOxmhHigj5Q== X-Received: by 2002:aa7:90c5:0:b029:1e3:5e84:4a7c with SMTP id k5-20020aa790c50000b02901e35e844a7cmr1841053pfk.71.1614829350720; Wed, 03 Mar 2021 19:42:30 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:30 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] mmc: sdhci-cadence: Add Pensando Elba SoC support Date: Wed, 3 Mar 2021 19:41:38 -0800 Message-Id: <20210304034141.7062-6-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for Pensando Elba SoC which explicitly controls byte-lane enables on writes. Refactor to allow platform specific write ops. Signed-off-by: Brad Larson --- drivers/mmc/host/Kconfig | 15 +++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-cadence-elba.c | 137 ++++++++++++++++++++++++++ drivers/mmc/host/sdhci-cadence.c | 78 +++++++-------- drivers/mmc/host/sdhci-cadence.h | 68 +++++++++++++ 5 files changed, 257 insertions(+), 42 deletions(-) create mode 100644 drivers/mmc/host/sdhci-cadence-elba.c create mode 100644 drivers/mmc/host/sdhci-cadence.h diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index b236dfe2e879..65ea323c06f2 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -250,6 +250,21 @@ config MMC_SDHCI_CADENCE If unsure, say N. +config MMC_SDHCI_CADENCE_ELBA + tristate "SDHCI support for the Pensando/Cadence SD/SDIO/eMMC controller" + depends on ARCH_PENSANDO_ELBA_SOC + depends on MMC_SDHCI + depends on OF + depends on MMC_SDHCI_CADENCE + depends on MMC_SDHCI_PLTFM + select MMC_SDHCI_IO_ACCESSORS + help + This selects the Pensando/Cadence SD/SDIO/eMMC controller. + + If you have a controller with this interface, say Y or M here. + + If unsure, say N. + config MMC_SDHCI_CNS3XXX tristate "SDHCI support on the Cavium Networks CNS3xxx SoC" depends on ARCH_CNS3XXX || COMPILE_TEST diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index 6df5c4774260..f2a6d50e64de 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -80,6 +80,7 @@ obj-$(CONFIG_MMC_REALTEK_USB) += rtsx_usb_sdmmc.o obj-$(CONFIG_MMC_SDHCI_PLTFM) += sdhci-pltfm.o obj-$(CONFIG_MMC_SDHCI_CADENCE) += sdhci-cadence.o +obj-$(CONFIG_MMC_SDHCI_CADENCE_ELBA) += sdhci-cadence-elba.o obj-$(CONFIG_MMC_SDHCI_CNS3XXX) += sdhci-cns3xxx.o obj-$(CONFIG_MMC_SDHCI_ESDHC_MCF) += sdhci-esdhc-mcf.o obj-$(CONFIG_MMC_SDHCI_ESDHC_IMX) += sdhci-esdhc-imx.o diff --git a/drivers/mmc/host/sdhci-cadence-elba.c b/drivers/mmc/host/sdhci-cadence-elba.c new file mode 100644 index 000000000000..e128e83e9be9 --- /dev/null +++ b/drivers/mmc/host/sdhci-cadence-elba.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2020-2021 Pensando Systems, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sdhci-pltfm.h" +#include "sdhci-cadence.h" + +// delay regs address +#define SDIO_REG_HRS4 0x10 +#define REG_DELAY_HS 0x00 +#define REG_DELAY_DEFAULT 0x01 +#define REG_DELAY_UHSI_SDR50 0x04 +#define REG_DELAY_UHSI_DDR50 0x05 + +static void elba_write_l(struct sdhci_host *host, u32 val, int reg) +{ + struct sdhci_cdns_priv *priv = sdhci_cdns_priv(host); + unsigned long flags; + + spin_lock_irqsave(&priv->wrlock, flags); + writel(0x78, priv->ctl_addr); + writel(val, host->ioaddr + reg); + spin_unlock_irqrestore(&priv->wrlock, flags); +} + +static void elba_write_w(struct sdhci_host *host, u16 val, int reg) +{ + struct sdhci_cdns_priv *priv = sdhci_cdns_priv(host); + unsigned long flags; + u32 m = (reg & 0x3); + u32 msk = (0x3 << (m)); + + spin_lock_irqsave(&priv->wrlock, flags); + writel(msk << 3, priv->ctl_addr); + writew(val, host->ioaddr + reg); + spin_unlock_irqrestore(&priv->wrlock, flags); +} + +static void elba_write_b(struct sdhci_host *host, u8 val, int reg) +{ + struct sdhci_cdns_priv *priv = sdhci_cdns_priv(host); + unsigned long flags; + u32 m = (reg & 0x3); + u32 msk = (0x1 << (m)); + + spin_lock_irqsave(&priv->wrlock, flags); + writel(msk << 3, priv->ctl_addr); + writeb(val, host->ioaddr + reg); + spin_unlock_irqrestore(&priv->wrlock, flags); +} + +static void elba_priv_write_l(struct sdhci_cdns_priv *priv, + u32 val, void __iomem *reg) +{ + unsigned long flags; + + spin_lock_irqsave(&priv->wrlock, flags); + writel(0x78, priv->ctl_addr); + writel(val, reg); + spin_unlock_irqrestore(&priv->wrlock, flags); +} + +static const struct sdhci_ops sdhci_elba_ops = { + .write_l = elba_write_l, + .write_w = elba_write_w, + .write_b = elba_write_b, + .set_clock = sdhci_set_clock, + .get_timeout_clock = sdhci_cdns_get_timeout_clock, + .set_bus_width = sdhci_set_bus_width, + .reset = sdhci_reset, + .set_uhs_signaling = sdhci_cdns_set_uhs_signaling, +}; + +static void sd4_set_dlyvr(struct sdhci_host *host, + unsigned char addr, unsigned char data) +{ + unsigned long dlyrv_reg; + + dlyrv_reg = ((unsigned long)data << 8); + dlyrv_reg |= addr; + + // set data and address + writel(dlyrv_reg, host->ioaddr + SDIO_REG_HRS4); + dlyrv_reg |= (1uL << 24uL); + // send write request + writel(dlyrv_reg, host->ioaddr + SDIO_REG_HRS4); + dlyrv_reg &= ~(1uL << 24); + // clear write request + writel(dlyrv_reg, host->ioaddr + SDIO_REG_HRS4); +} + +static void phy_config(struct sdhci_host *host) +{ + sd4_set_dlyvr(host, REG_DELAY_DEFAULT, 0x04); + sd4_set_dlyvr(host, REG_DELAY_HS, 0x04); + sd4_set_dlyvr(host, REG_DELAY_UHSI_SDR50, 0x06); + sd4_set_dlyvr(host, REG_DELAY_UHSI_DDR50, 0x16); +} + +static int elba_drv_init(struct platform_device *pdev) +{ + struct sdhci_host *host = platform_get_drvdata(pdev); + struct sdhci_cdns_priv *priv = sdhci_cdns_priv(host); + struct resource *iomem; + void __iomem *ioaddr; + + host->mmc->caps |= (MMC_CAP_1_8V_DDR | MMC_CAP_8_BIT_DATA); + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 1); + if (!iomem) + return -ENOMEM; + ioaddr = devm_ioremap_resource(&pdev->dev, iomem); + if (IS_ERR(ioaddr)) + return PTR_ERR(ioaddr); + priv->ctl_addr = ioaddr; + priv->priv_write_l = elba_priv_write_l; + spin_lock_init(&priv->wrlock); + writel(0x78, priv->ctl_addr); + phy_config(host); + return 0; +} + +const struct sdhci_cdns_drv_data sdhci_elba_drv_data = { + .init = elba_drv_init, + .pltfm_data = { + .ops = &sdhci_elba_ops, + }, +}; diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index 6f2de54a5987..3c6bc93d3314 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -14,6 +14,7 @@ #include #include "sdhci-pltfm.h" +#include "sdhci-cadence.h" /* HRS - Host Register Set (specific to Cadence) */ #define SDHCI_CDNS_HRS04 0x10 /* PHY access port */ @@ -59,23 +60,6 @@ */ #define SDHCI_CDNS_MAX_TUNING_LOOP 40 -struct sdhci_cdns_phy_param { - u8 addr; - u8 data; -}; - -struct sdhci_cdns_priv { - void __iomem *hrs_addr; - bool enhanced_strobe; - unsigned int nr_phy_params; - struct sdhci_cdns_phy_param phy_params[]; -}; - -struct sdhci_cdns_phy_cfg { - const char *property; - u8 addr; -}; - static const struct sdhci_cdns_phy_cfg sdhci_cdns_phy_cfgs[] = { { "cdns,phy-input-delay-sd-highspeed", SDHCI_CDNS_PHY_DLY_SD_HS, }, { "cdns,phy-input-delay-legacy", SDHCI_CDNS_PHY_DLY_SD_DEFAULT, }, @@ -104,17 +88,17 @@ static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_priv *priv, tmp = FIELD_PREP(SDHCI_CDNS_HRS04_WDATA, data) | FIELD_PREP(SDHCI_CDNS_HRS04_ADDR, addr); - writel(tmp, reg); + sdhci_cdns_priv_writel(priv, tmp, reg); tmp |= SDHCI_CDNS_HRS04_WR; - writel(tmp, reg); + sdhci_cdns_priv_writel(priv, tmp, reg); ret = readl_poll_timeout(reg, tmp, tmp & SDHCI_CDNS_HRS04_ACK, 0, 10); if (ret) return ret; tmp &= ~SDHCI_CDNS_HRS04_WR; - writel(tmp, reg); + sdhci_cdns_priv_writel(priv, tmp, reg); ret = readl_poll_timeout(reg, tmp, !(tmp & SDHCI_CDNS_HRS04_ACK), 0, 10); @@ -167,14 +151,7 @@ static int sdhci_cdns_phy_init(struct sdhci_cdns_priv *priv) return 0; } -static void *sdhci_cdns_priv(struct sdhci_host *host) -{ - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - - return sdhci_pltfm_priv(pltfm_host); -} - -static unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host) +unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host) { /* * Cadence's spec says the Timeout Clock Frequency is the same as the @@ -191,7 +168,7 @@ static void sdhci_cdns_set_emmc_mode(struct sdhci_cdns_priv *priv, u32 mode) tmp = readl(priv->hrs_addr + SDHCI_CDNS_HRS06); tmp &= ~SDHCI_CDNS_HRS06_MODE; tmp |= FIELD_PREP(SDHCI_CDNS_HRS06_MODE, mode); - writel(tmp, priv->hrs_addr + SDHCI_CDNS_HRS06); + sdhci_cdns_priv_writel(priv, tmp, priv->hrs_addr + SDHCI_CDNS_HRS06); } static u32 sdhci_cdns_get_emmc_mode(struct sdhci_cdns_priv *priv) @@ -223,7 +200,7 @@ static int sdhci_cdns_set_tune_val(struct sdhci_host *host, unsigned int val) */ for (i = 0; i < 2; i++) { tmp |= SDHCI_CDNS_HRS06_TUNE_UP; - writel(tmp, reg); + sdhci_cdns_priv_writel(priv, tmp, reg); ret = readl_poll_timeout(reg, tmp, !(tmp & SDHCI_CDNS_HRS06_TUNE_UP), @@ -275,7 +252,7 @@ static int sdhci_cdns_execute_tuning(struct sdhci_host *host, u32 opcode) return sdhci_cdns_set_tune_val(host, end_of_streak - max_streak / 2); } -static void sdhci_cdns_set_uhs_signaling(struct sdhci_host *host, +void sdhci_cdns_set_uhs_signaling(struct sdhci_host *host, unsigned int timing) { struct sdhci_cdns_priv *priv = sdhci_cdns_priv(host); @@ -318,13 +295,17 @@ static const struct sdhci_ops sdhci_cdns_ops = { .set_uhs_signaling = sdhci_cdns_set_uhs_signaling, }; -static const struct sdhci_pltfm_data sdhci_cdns_uniphier_pltfm_data = { - .ops = &sdhci_cdns_ops, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, +static const struct sdhci_cdns_drv_data sdhci_cdns_uniphier_drv_data = { + .pltfm_data = { + .ops = &sdhci_cdns_ops, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + }, }; -static const struct sdhci_pltfm_data sdhci_cdns_pltfm_data = { - .ops = &sdhci_cdns_ops, +static const struct sdhci_cdns_drv_data sdhci_cdns_drv_data = { + .pltfm_data = { + .ops = &sdhci_cdns_ops, + }, }; static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc, @@ -350,7 +331,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc, static int sdhci_cdns_probe(struct platform_device *pdev) { struct sdhci_host *host; - const struct sdhci_pltfm_data *data; + const struct sdhci_cdns_drv_data *data; struct sdhci_pltfm_host *pltfm_host; struct sdhci_cdns_priv *priv; struct clk *clk; @@ -369,10 +350,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev) data = of_device_get_match_data(dev); if (!data) - data = &sdhci_cdns_pltfm_data; + data = &sdhci_cdns_drv_data; nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node); - host = sdhci_pltfm_init(pdev, data, + host = sdhci_pltfm_init(pdev, &data->pltfm_data, struct_size(priv, phy_params, nr_phy_params)); if (IS_ERR(host)) { ret = PTR_ERR(host); @@ -389,11 +370,18 @@ static int sdhci_cdns_probe(struct platform_device *pdev) host->ioaddr += SDHCI_CDNS_SRS_BASE; host->mmc_host_ops.hs400_enhanced_strobe = sdhci_cdns_hs400_enhanced_strobe; - sdhci_enable_v4_mode(host); - __sdhci_read_caps(host, &version, NULL, NULL); sdhci_get_of_property(pdev); + if (data->init) { + ret = data->init(pdev); + if (ret) + goto free; + } + + sdhci_enable_v4_mode(host); + __sdhci_read_caps(host, &version, NULL, NULL); + ret = mmc_of_parse(host->mmc); if (ret) goto free; @@ -453,8 +441,14 @@ static const struct dev_pm_ops sdhci_cdns_pm_ops = { static const struct of_device_id sdhci_cdns_match[] = { { .compatible = "socionext,uniphier-sd4hc", - .data = &sdhci_cdns_uniphier_pltfm_data, + .data = &sdhci_cdns_uniphier_drv_data, }, +#ifdef CONFIG_MMC_SDHCI_CADENCE_ELBA + { + .compatible = "pensando,elba-emmc", + .data = &sdhci_elba_drv_data + }, +#endif { .compatible = "cdns,sd4hc" }, { /* sentinel */ } }; diff --git a/drivers/mmc/host/sdhci-cadence.h b/drivers/mmc/host/sdhci-cadence.h new file mode 100644 index 000000000000..bf48e8d13430 --- /dev/null +++ b/drivers/mmc/host/sdhci-cadence.h @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2016 Socionext Inc. + * Author: Masahiro Yamada + */ + +#ifndef _SDHCI_CADENCE_H_ +#define _SDHCI_CADENCE_H_ + +struct sdhci_cdns_phy_param { + u8 addr; + u8 data; +}; + +struct sdhci_cdns_priv { + void __iomem *hrs_addr; +#ifdef CONFIG_MMC_SDHCI_CADENCE_ELBA + void __iomem *ctl_addr; /* write control */ + spinlock_t wrlock; /* write lock */ +#endif + bool enhanced_strobe; + void (*priv_write_l)(struct sdhci_cdns_priv *priv, u32 val, + void __iomem *reg); /* for cadence-elba.c */ + unsigned int nr_phy_params; + struct sdhci_cdns_phy_param phy_params[]; +}; + +struct sdhci_cdns_phy_cfg { + const char *property; + u8 addr; +}; + +struct sdhci_cdns_drv_data { + int (*init)(struct platform_device *pdev); + const struct sdhci_pltfm_data pltfm_data; +}; + +static inline void *sdhci_cdns_priv(struct sdhci_host *host) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + + return sdhci_pltfm_priv(pltfm_host); +} + +/* + * The Pensando Elba SoC explicitly controls byte-lane enables on writes, + * which includes writes to the HRS registers. + * sdhci_cdns_priv_writel() is used in the common sdhci-cadence.c code + * to write HRS registers, and this function dispatches to the specific + * code. + */ +static inline void sdhci_cdns_priv_writel(struct sdhci_cdns_priv *priv, + u32 val, void __iomem *reg) +{ + if (unlikely(priv->priv_write_l)) + priv->priv_write_l(priv, val, reg); + else + writel(val, reg); +} + +#ifdef CONFIG_MMC_SDHCI_CADENCE_ELBA +extern const struct sdhci_cdns_drv_data sdhci_elba_drv_data; +#endif + +unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host); +void sdhci_cdns_set_uhs_signaling(struct sdhci_host *host, unsigned int timing); + +#endif From patchwork Thu Mar 4 03:41:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 392942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D633BC43332 for ; Thu, 4 Mar 2021 03:45:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC8B964EE3 for ; Thu, 4 Mar 2021 03:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233019AbhCDDom (ORCPT ); Wed, 3 Mar 2021 22:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233039AbhCDDoY (ORCPT ); Wed, 3 Mar 2021 22:44:24 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0BEFC06178C for ; Wed, 3 Mar 2021 19:42:32 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id t25so17994293pga.2 for ; Wed, 03 Mar 2021 19:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hFDDuuLCKMVUPK4LrKSbpDVOykG8ODUpVOe4CV5ias0=; b=1opUXAsn2Kt8qlhlTkZuka8cdGg9pcFuMg87cVSygAl2xQ5X0EAshUWlvWYCdUXMp5 AWhfN/NOGbE+AQh5ijSGOHHg3jjyH0fd4VMghuOm4V7uABp0spgfMvnIDwKRUAX869G/ W56G2VbCRO4OEYFtODPVNbJjZh6mwMdU0ouuqzzVtGYppmVCCfeGoIO6RsLHVQHkLkNK 1ZxI+fVL/wfF2uDsCHOF+HI/Pmd+UC/fXWbqWyKw/AcAenGrPGOFQ9s1JRoC3rGsGD9/ Rok3iMUTJpkyj69iIt3abyN9gQAvOf7PIDT2Ax8l10B9yQWwO1UJZxh67pP+3qHp+l+d kX3Q== 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; bh=hFDDuuLCKMVUPK4LrKSbpDVOykG8ODUpVOe4CV5ias0=; b=Mm3sJ+qeo0arIgA0kNwGmPTChJGNtttk6dFUjkyotWWSQhvjcZFX8NZlRkr/HiIje1 9aNpoNnpLtxbIkVBIHfoD0C6/5c4T5UJ0mOyMm1dj341nE+uApZM5o6BwiAQfpItlFPl SbQdA8VB6AEZ1vQFn9YC/TdQVG3A1JG4Z7Q3Y40b2lkq85VAZ6RAFf6+mEQZPv2O3fUM VHmU4+DoE+PjaHEl4DzVPv2pkv1oElFp215vsB2hlMCRaaO+E63/KCdBwPcFMQDh1qgc fbrJye5a4uLPbc4PZESCzzGlYXW4mE5Mh100thMahD5iYkJclxgru2PiUh249lqeLb9j XumA== X-Gm-Message-State: AOAM531KHQhwX1WAQ6MhdNuYQiaCf5ZXxr//2Y8YF9Z/eClj1rKja2DR YgRUv1CzSOCoyjS8+LauyeOVIg== X-Google-Smtp-Source: ABdhPJzLtFoQNkM8z+nPvDTwYRktUQTeKXYN+F/VF6vpP4GvYQVlLQkPZGGit0J8TlMHm+yaO6XMow== X-Received: by 2002:aa7:8c0f:0:b029:1ed:4d05:218c with SMTP id c15-20020aa78c0f0000b02901ed4d05218cmr2256407pfd.21.1614829352253; Wed, 03 Mar 2021 19:42:32 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:31 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] arm64: Add config for Pensando SoC platforms Date: Wed, 3 Mar 2021 19:41:39 -0800 Message-Id: <20210304034141.7062-7-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add ARCH_PENSANDO configuration option for Pensando SoC based platforms. Signed-off-by: Brad Larson --- arch/arm64/Kconfig.platforms | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index cdfd5fed457f..803e7cf1df55 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -210,6 +210,11 @@ config ARCH_MXC This enables support for the ARMv8 based SoCs in the NXP i.MX family. +config ARCH_PENSANDO + bool "Pensando Platforms" + help + This enables support for the ARMv8 based Pensando chipsets + config ARCH_QCOM bool "Qualcomm Platforms" select GPIOLIB From patchwork Thu Mar 4 03:41:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 393823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20639C432C3 for ; Thu, 4 Mar 2021 03:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0EDE64F07 for ; Thu, 4 Mar 2021 03:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbhCDDol (ORCPT ); Wed, 3 Mar 2021 22:44:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232996AbhCDDoO (ORCPT ); Wed, 3 Mar 2021 22:44:14 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72981C0617A9 for ; Wed, 3 Mar 2021 19:42:34 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id u18so9162260plc.12 for ; Wed, 03 Mar 2021 19:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SJWfUh2HeX7k+9F1fgVq2yfYXFMylmr0aO5m065Px8g=; b=006u7hRlIHnqMBKEAi9DxuIDoCAkgvLCREnkxfS6L6GJcH8TohTTJPUlg+0jLL5q28 p8LHGbh8PzFA9dCwB8By9Q/gH1zvyuoP8wrrIi6H9iwzFkQWOwEvQLgK2liofIOhqQ8j TZFCnL6xtsScNLb8/uJtMUyioe/8SH7oSeotiTa5dnvIkBXHfXKRt+VJdigYh032Z8IQ YcW4gb6POJ+CXjJJOYGgIKNDH57fhvvu4STN+pGuBqTTjV4n11k85kbaYkgXEc3tqRWm avMf+7VA9w639bqF7IYYe+Gp2rfrjUYlgnZMl8cfzAcaBgVejIfM2rWUt29z5bc3mWpc qznA== 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; bh=SJWfUh2HeX7k+9F1fgVq2yfYXFMylmr0aO5m065Px8g=; b=f4ljeVmuL+19wF3m+DQt+xrK5IZzbxobKXnNTxjEZYRzxieC8pICegfYMXX5vwjqpm sc7XEI+oGtWILjNku7ZKBkzH4KzuHzQo1tqkr2Kz5CBTU4txQM1bIxXaCtD7pwR8HiBW 8f24e1eUCUQuwPHlXWG7RP19e28wWNqBYLHBrlGLE5lfUvhnRsYnHq4OAOukSVqKHGV1 GyUGAQ6UyOGuResAMpdLdJ5FECwjezNl/2r9GYExytiKi7X5vBjJTMwYFVaoDLxAjt4N 7B3pLXPBYI7iicJb+JcwBVHRwxFVQIbBH63wxsTBMNnzobuJF7+GgrHvnfrmf0GvGj7h 0HPA== X-Gm-Message-State: AOAM530NjmhPELYdSQauTWV5T3fle26/5z/RtY/9cRhrjqaA6rxhoTyy cbANOI9/2XgfLKx79LDONQgXCg== X-Google-Smtp-Source: ABdhPJxps9JK7lmckRKgwOm8/KOKP9ibM3RK3a+8hr8T+coa5eoI9gEs+I+SpVEH9cSvaLrCISRgZA== X-Received: by 2002:a17:902:7898:b029:e4:182f:e31d with SMTP id q24-20020a1709027898b02900e4182fe31dmr2121360pll.13.1614829353848; Wed, 03 Mar 2021 19:42:33 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:33 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] arm64: dts: Add Pensando Elba SoC support Date: Wed, 3 Mar 2021 19:41:40 -0800 Message-Id: <20210304034141.7062-8-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add Pensando common and Elba SoC specific device nodes and corresponding binding documentation. Signed-off-by: Brad Larson --- .../bindings/gpio/pensando,elba-spics.txt | 24 ++ .../devicetree/bindings/mmc/cdns,sdhci.yaml | 2 +- .../bindings/spi/cadence-quadspi.txt | 1 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/pensando/Makefile | 6 + arch/arm64/boot/dts/pensando/elba-16core.dtsi | 171 ++++++++++ .../boot/dts/pensando/elba-asic-common.dtsi | 113 +++++++ arch/arm64/boot/dts/pensando/elba-asic.dts | 8 + .../boot/dts/pensando/elba-flash-parts.dtsi | 80 +++++ arch/arm64/boot/dts/pensando/elba.dtsi | 310 ++++++++++++++++++ 11 files changed, 717 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/gpio/pensando,elba-spics.txt create mode 100644 arch/arm64/boot/dts/pensando/Makefile create mode 100644 arch/arm64/boot/dts/pensando/elba-16core.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic-common.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba-asic.dts create mode 100644 arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi create mode 100644 arch/arm64/boot/dts/pensando/elba.dtsi diff --git a/Documentation/devicetree/bindings/gpio/pensando,elba-spics.txt b/Documentation/devicetree/bindings/gpio/pensando,elba-spics.txt new file mode 100644 index 000000000000..30f5f3275238 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/pensando,elba-spics.txt @@ -0,0 +1,24 @@ +Pensando Elba SPI Chip Select Driver + +The Pensando Elba ASIC provides four SPI bus chip selects + +Required properties: +- compatible: Should be "pensando,elba-spics" +- reg: Address range of spics controller +- gpio-controller: Marks the device node as gpio controller +- #gpio-cells: Must be 2 + +Example: +------- +spics: spics@307c2468 { + compatible = "pensando,elba-spics"; + reg = <0x0 0x307c2468 0x0 0x4>; + gpio-controller; + #gpio-cells = <2>; +}; + +&spi0 { + num-cs = <4>; + cs-gpios = <&spics 0 0>, <&spics 1 0>, <&porta 1 0>, <&porta 7 0>; + ... +} diff --git a/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml b/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml index af7442f73881..645ae696ba24 100644 --- a/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml +++ b/Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml @@ -122,7 +122,7 @@ unevaluatedProperties: false examples: - | emmc: mmc@5a000000 { - compatible = "socionext,uniphier-sd4hc", "cdns,sd4hc"; + compatible = "socionext,uniphier-sd4hc", "cdns,sd4hc", "pensando,elba-emmc"; reg = <0x5a000000 0x400>; interrupts = <0 78 4>; clocks = <&clk 4>; diff --git a/Documentation/devicetree/bindings/spi/cadence-quadspi.txt b/Documentation/devicetree/bindings/spi/cadence-quadspi.txt index 8ace832a2d80..dbb346b2b1d7 100644 --- a/Documentation/devicetree/bindings/spi/cadence-quadspi.txt +++ b/Documentation/devicetree/bindings/spi/cadence-quadspi.txt @@ -6,6 +6,7 @@ Required properties: For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor". For TI AM654 SoC - "ti,am654-ospi", "cdns,qspi-nor". For Intel LGM SoC - "intel,lgm-qspi", "cdns,qspi-nor". + For Pensando SoC - "pensando,cdns-qspi". - reg : Contains two entries, each of which is a tuple consisting of a physical address and length. The first entry is the address and length of the controller register set. The second entry is the diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index f6064d84a424..9a21d780c5e1 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -850,6 +850,8 @@ patternProperties: description: Parallax Inc. "^pda,.*": description: Precision Design Associates, Inc. + "^pensando,.*": + description: Pensando Systems Inc. "^pericom,.*": description: Pericom Technology Inc. "^pervasive,.*": diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index f1173cd93594..c85db0a097fe 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile @@ -19,6 +19,7 @@ subdir-y += marvell subdir-y += mediatek subdir-y += microchip subdir-y += nvidia +subdir-y += pensando subdir-y += qcom subdir-y += realtek subdir-y += renesas diff --git a/arch/arm64/boot/dts/pensando/Makefile b/arch/arm64/boot/dts/pensando/Makefile new file mode 100644 index 000000000000..0c2c0961e64a --- /dev/null +++ b/arch/arm64/boot/dts/pensando/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_PENSANDO_ELBA_SOC) += elba-asic.dtb + +always-y := $(dtb-y) +subdir-y := $(dts-dirs) +clean-files := *.dtb diff --git a/arch/arm64/boot/dts/pensando/elba-16core.dtsi b/arch/arm64/boot/dts/pensando/elba-16core.dtsi new file mode 100644 index 000000000000..b0386864cfec --- /dev/null +++ b/arch/arm64/boot/dts/pensando/elba-16core.dtsi @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu-map { + cluster0 { + core0 { cpu = <&cpu0>; }; + core1 { cpu = <&cpu1>; }; + core2 { cpu = <&cpu2>; }; + core3 { cpu = <&cpu3>; }; + }; + cluster1 { + core0 { cpu = <&cpu4>; }; + core1 { cpu = <&cpu5>; }; + core2 { cpu = <&cpu6>; }; + core3 { cpu = <&cpu7>; }; + }; + cluster2 { + core0 { cpu = <&cpu8>; }; + core1 { cpu = <&cpu9>; }; + core2 { cpu = <&cpu10>; }; + core3 { cpu = <&cpu11>; }; + }; + cluster3 { + core0 { cpu = <&cpu12>; }; + core1 { cpu = <&cpu13>; }; + core2 { cpu = <&cpu14>; }; + core3 { cpu = <&cpu15>; }; + }; + }; + + // CLUSTER 0 + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x0>; + enable-method = "spin-table"; + next-level-cache = <&l2_0>; + }; + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x1>; + enable-method = "spin-table"; + next-level-cache = <&l2_0>; + }; + cpu2: cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x2>; + enable-method = "spin-table"; + next-level-cache = <&l2_0>; + }; + cpu3: cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x3>; + enable-method = "spin-table"; + next-level-cache = <&l2_0>; + }; + + l2_0: l2-cache0 { + compatible = "cache"; + }; + + // CLUSTER 1 + cpu4: cpu@100 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x100>; + enable-method = "spin-table"; + next-level-cache = <&l2_1>; + }; + cpu5: cpu@101 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x101>; + enable-method = "spin-table"; + next-level-cache = <&l2_1>; + }; + cpu6: cpu@102 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x102>; + enable-method = "spin-table"; + next-level-cache = <&l2_1>; + }; + cpu7: cpu@103 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x103>; + enable-method = "spin-table"; + next-level-cache = <&l2_1>; + }; + + l2_1: l2-cache1 { + compatible = "cache"; + }; + + // CLUSTER 2 + cpu8: cpu@200 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x200>; + enable-method = "spin-table"; + next-level-cache = <&l2_2>; + }; + cpu9: cpu@201 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x201>; + enable-method = "spin-table"; + next-level-cache = <&l2_2>; + }; + cpu10: cpu@202 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x202>; + enable-method = "spin-table"; + next-level-cache = <&l2_2>; + }; + cpu11: cpu@203 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x203>; + enable-method = "spin-table"; + next-level-cache = <&l2_2>; + }; + + l2_2: l2-cache2 { + compatible = "cache"; + }; + + // CLUSTER 3 + cpu12: cpu@300 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x300>; + enable-method = "spin-table"; + next-level-cache = <&l2_3>; + }; + cpu13: cpu@301 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x301>; + enable-method = "spin-table"; + next-level-cache = <&l2_3>; + }; + cpu14: cpu@302 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x302>; + enable-method = "spin-table"; + next-level-cache = <&l2_3>; + }; + cpu15: cpu@303 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0 0x303>; + enable-method = "spin-table"; + next-level-cache = <&l2_3>; + }; + + l2_3: l2-cache3 { + compatible = "cache"; + }; + }; +}; diff --git a/arch/arm64/boot/dts/pensando/elba-asic-common.dtsi b/arch/arm64/boot/dts/pensando/elba-asic-common.dtsi new file mode 100644 index 000000000000..9623df208131 --- /dev/null +++ b/arch/arm64/boot/dts/pensando/elba-asic-common.dtsi @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + model = "Elba ASIC Board"; + + aliases { + serial0 = &uart0; + spi0 = &spi0; + spi1 = &qspi; + }; + + chosen { + stdout-path = "serial0:19200n8"; + }; +}; + +&ahb_clk { + clock-frequency = <400000000>; +}; + +&emmc_clk { + clock-frequency = <200000000>; +}; + +&flash_clk { + clock-frequency = <400000000>; +}; + +&ref_clk { + clock-frequency = <156250000>; +}; + +&qspi { + status = "okay"; + flash0: mt25q@0 { + compatible = "jdec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + spi-rx-bus-width = <2>; + m25p,fast-read; + cdns,read-delay = <0>; + cdns,tshsl-ns = <0>; + cdns,tsd2d-ns = <0>; + cdns,tchsh-ns = <0>; + cdns,tslch-ns = <0>; + }; +}; + +&gpio0 { + status = "ok"; +}; + +&emmc { + bus-width = <8>; + status = "ok"; +}; + +&wdt0 { + status = "okay"; +}; + +&i2c0 { + clock-frequency = <100000>; + status = "okay"; + tmp451@4c { + compatible = "ti,tmp451"; + reg = <0x4c>; + }; + tps53659@62 { + compatible = "ti,tps53659"; + reg = <0x62>; + }; + pcf85263@51 { + compatible = "nxp,pcf85263"; + reg = <0x51>; + }; +}; + +&spi0 { + num-cs = <4>; + cs-gpios = <&spics 0 0>, <&spics 1 0>, <&porta 1 0>, <&porta 7 0>; + status = "okay"; + spi@0 { + compatible = "pensando,cpld"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <0>; + }; + spi@1 { + compatible = "pensando,cpld"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <1>; + }; + spi@2 { + compatible = "pensando,cpld-rd1173"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <2>; + interrupt-parent = <&porta>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; + spi@3 { + compatible = "pensando,cpld"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <12000000>; + reg = <3>; + }; +}; diff --git a/arch/arm64/boot/dts/pensando/elba-asic.dts b/arch/arm64/boot/dts/pensando/elba-asic.dts new file mode 100644 index 000000000000..411c48457006 --- /dev/null +++ b/arch/arm64/boot/dts/pensando/elba-asic.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 + +/dts-v1/; + +#include "elba.dtsi" +#include "elba-16core.dtsi" +#include "elba-asic-common.dtsi" +#include "elba-flash-parts.dtsi" diff --git a/arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi b/arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi new file mode 100644 index 000000000000..1983de1a8403 --- /dev/null +++ b/arch/arm64/boot/dts/pensando/elba-flash-parts.dtsi @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0 + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "flash"; + reg = <0x00010000 0x0fff0000>; + }; + partition@f0000 { + label = "golduenv"; + reg = <0x000f0000 0x00010000>; + }; + partition@100000 { + label = "boot0"; + reg = <0x00100000 0x00080000>; + }; + partition@180000 { + label = "golduboot"; + reg = <0x00180000 0x00200000>; + }; + partition@400000 { + label = "goldfw"; + reg = <0x00400000 0x03c00000>; + }; + partition@4010000 { + label = "fwmap"; + reg = <0x04010000 0x00020000>; + }; + partition@4030000 { + label = "fwsel"; + reg = <0x04030000 0x00020000>; + }; + partition@4090000 { + label = "bootlog"; + reg = <0x04090000 0x00020000>; + }; + partition@40b0000 { + label = "panicbuf"; + reg = <0x040b0000 0x00020000>; + }; + partition@40d0000 { + label = "uservars"; + reg = <0x040d0000 0x00020000>; + }; + partition@4200000 { + label = "uboota"; + reg = <0x04200000 0x00400000>; + }; + partition@4600000 { + label = "ubootb"; + reg = <0x04600000 0x00400000>; + }; + partition@4a00000 { + label = "mainfwa"; + reg = <0x04a00000 0x01000000>; + }; + partition@5a00000 { + label = "mainfwb"; + reg = <0x05a00000 0x01000000>; + }; + partition@8000000 { + label = "diagfw"; + reg = <0x08000000 0x07fe0000>; + }; + partition@ffe0000 { + label = "ubootenv"; + reg = <0x0ffe0000 0x00010000>; + }; + }; +}; + +&soc { + panicdump@740b0000 { + compatible = "pensando,capri-crash"; + reg = <0x0 0x740b0000 0x0 0x00020000>; + }; +}; diff --git a/arch/arm64/boot/dts/pensando/elba.dtsi b/arch/arm64/boot/dts/pensando/elba.dtsi new file mode 100644 index 000000000000..72245e279483 --- /dev/null +++ b/arch/arm64/boot/dts/pensando/elba.dtsi @@ -0,0 +1,310 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019-2021, Pensando Systems Inc. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "dt-bindings/interrupt-controller/arm-gic.h" + +/ { + compatible = "pensando,elba"; + + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + + clocks { + ahb_clk: oscillator0 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + emmc_clk: oscillator2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + flash_clk: oscillator3 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + ref_clk: oscillator4 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + + pmu { + compatible = "arm,cortex-a72-pmu"; + interrupts = ; + }; + + /* Common UIO device for MSI drivers */ + uio_penmsi { + compatible = "pensando,uio_penmsi"; + name = "uio_penmsi"; + }; + + + soc: soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + gic: interrupt-controller@800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + interrupt-controller; + reg = <0x0 0x800000 0x0 0x200000>, // GICD + <0x0 0xa00000 0x0 0x200000>; // GICR + interrupts = ; + + its: interrupt-controller@820000 { + compatible = "arm,gic-v3-its"; + msi-controller; + #msi-cells = <1>; + reg = <0x0 0x820000 0x0 0x10000>; + socionext,synquacer-pre-its = + <0xc00000 0x1000000>; + }; + }; + + /* + * Until we know the interrupt domain following this, we + * are forced to use this is the place where interrupts from + * PCI converge. In the ideal case, we use one domain higher, + * where the PCI-ness has been shed. + */ + pxc0_intr: intc@20102200 { + compatible = "pensando,soc-ictlr-csrintr"; + interrupt-controller; + reg = <0x0 0x20102200 0x0 0x4>; + #interrupt-cells = <3>; + interrupt-parent = <&gic>; + interrupts = ; + interrupt-names = "pxc0_intr"; + }; + + uart0: serial@4800 { + device_type = "serial"; + compatible = "ns16550a"; + reg = <0x0 0x4800 0x0 0x100>; + clocks = <&ref_clk>; + interrupts = ; + reg-shift = <2>; + reg-io-width = <4>; + }; + + qspi: spi@2400 { + compatible = "pensando,cdns-qspi"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x2400 0x0 0x400>, + <0x0 0x7fff0000 0x0 0x1000>; + interrupts = ; + clocks = <&flash_clk>; + cdns,fifo-depth = <1024>; + cdns,fifo-width = <4>; + cdns,trigger-address = <0x7fff0000>; + status = "disabled"; + }; + + gpio0: gpio@4000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dw-apb-gpio"; + reg = <0x0 0x4000 0x0 0x78>; + status = "disabled"; + + porta: gpio-controller@0 { + compatible = "snps,dw-apb-gpio-port"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <8>; + interrupts = ; + interrupt-controller; + interrupt-parent = <&gic>; + #interrupt-cells = <2>; + }; + portb: gpio-controller@1 { + compatible = "snps,dw-apb-gpio-port"; + reg = <1>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <8>; + }; + }; + + i2c0: i2c@400 { + compatible = "snps,designware-i2c"; + reg = <0x0 0x400 0x0 0x100>; + clocks = <&ahb_clk>; + #address-cells = <1>; + #size-cells = <0>; + i2c-sda-hold-time-ns = <480>; + snps,sda-timeout-ms = <750>; + interrupts = ; + status = "disabled"; + }; + + /* UIO device using interrupt line PCIEMAC */ + pciemac@20102200 { + #address-cells = <2>; + #size-cells = <2>; + #interrupt-cells = <3>; + + compatible = "pensando,uio_pciemac"; + register-type = "csr-interrupt"; + interrupt-parent = <&pxc0_intr>; + interrupts = ; + reg = <0x0 0x20102200 0x0 0x10>; /* pxc0_intr */ + + enable_csr_paddr = <0x0 0x20102200 0x0 0x10>; + enable_mask = <(1 << 0)>; + }; + + /* MSI UIO device 1 */ + uio_penmsi1@520000 { + compatible = "pensando,uio_penmsi1"; + reg = <0x0 0x520000 0x0 0x10000>; + msi-parent = <&its 0xa>; + num-interrupts = <16>; /* # MSI interrupts to get */ + }; + + spics: spics@307c2468 { + compatible = "pensando,elba-spics"; + reg = <0x0 0x307c2468 0x0 0x4>; + gpio-controller; + #gpio-cells = <2>; + }; + + spi0: spi@2800 { + compatible = "pensando,elba-spi"; + reg = <0x0 0x2800 0x0 0x100>; + clocks = <&ahb_clk>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + num-cs = <2>; + status = "disabled"; + }; + + wdt0: watchdog@1400 { + compatible = "snps,dw-wdt"; + reg = <0x0 0x1400 0x0 0x100>; + clocks = <&ahb_clk>; + interrupts = ; + status = "disabled"; + }; + wdt1: watchdog@1800 { + compatible = "snps,dw-wdt"; + reg = <0x0 0x1800 0x0 0x100>; + clocks = <&ahb_clk>; + interrupts = ; + status = "disabled"; + }; + wdt2: watchdog@1c00 { + compatible = "snps,dw-wdt"; + reg = <0x0 0x1c00 0x0 0x100>; + clocks = <&ahb_clk>; + interrupts = ; + status = "disabled"; + }; + wdt3: watchdog@2000 { + compatible = "snps,dw-wdt"; + reg = <0x0 0x2000 0x0 0x100>; + clocks = <&ahb_clk>; + interrupts = ; + status = "disabled"; + }; + + emmc: sdio-host-chip@30440000 { + compatible = "pensando,elba-emmc"; + clocks = <&emmc_clk>; + interrupts = ; + reg = <0x0 0x30440000 0x0 0x10000 + 0x0 0x30480044 0x0 0x4>; + cdns,phy-input-delay-sd-highspeed = <0x4>; + cdns,phy-input-delay-legacy = <0x4>; + cdns,phy-input-delay-sd-uhs-sdr50 = <0x6>; + cdns,phy-input-delay-sd-uhs-ddr50 = <0x16>; + cdns,mmc-ddr-1_8v; + status = "disabled"; + } ; + + pcie@307c2480 { + compatible = "pensando,pcie"; + reg = <0x0 0x307c2480 0x0 0x4 /* MS CFG_WDT */ + 0x0 0x00001400 0x0 0x10 /* WDT0 */ + 0x0 0x20000000 0x0 0x00380000>; /* PXB Base */ + }; + + panic: panicdump@0 { + compatible = "pensando,pen-crash"; + status = "disabled"; + }; + + bsm@307c2080 { + compatible = "pensando,bsm"; + reg = <0x0 0x307c2080 0x0 0x4>; + }; + }; + mnet0: mnet0 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x0>; + }; + mnet1: mnet1 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x1>; + }; + mnet2: mnet2 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x2>; + }; + mnet3: mnet3 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x3>; + }; + mnet4: mnet4 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x4>; + }; + mnet5: mnet5 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x5>; + }; + mnet6: mnet6 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x6>; + }; + mnet7: mnet7 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x7>; + }; + mnet8: mnet8 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x8>; + }; + mnet9: mnet9 { + compatible = "pensando,mnet"; + msi-parent = <&its 0x9>; + }; +}; From patchwork Thu Mar 4 03:41:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Larson X-Patchwork-Id: 393824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57972C4361A for ; Thu, 4 Mar 2021 03:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45C2264EF9 for ; Thu, 4 Mar 2021 03:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233026AbhCDDol (ORCPT ); Wed, 3 Mar 2021 22:44:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233000AbhCDDoO (ORCPT ); Wed, 3 Mar 2021 22:44:14 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84C2C0617AB for ; Wed, 3 Mar 2021 19:42:35 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id j6so1788999plx.6 for ; Wed, 03 Mar 2021 19:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9Zk1ArnKgiQng2MWBVvqO/05T1WJkKR0dBPbHxZP+Xc=; b=WCI7rfGobOQo7ZIRzOvOR8E6h4m8BYK0/i2nOSBcXEiOL+UHoQjYcgaOqgrziZEXnu AUmIGYvHDDpMWD7ThHSCaT643Ylq/G3hx4fR3zsPHCRTihQ0JcxB2UMyDpWvRiPZCOEq 3Px52NRCItEH/LPP8x6f98azKYLL0kHP4sJy0UcXyXA4vxmvawFSM1kOBfB0oE/G7J1s imANFYLtJI7tmoub7Or1RTo1f09mjHtXdq3gdqfOH32zcsPcuCu8C6zmqe69JMJqRA9K BfeOiF6xdiUD8j/nCWQsLxe42qy/PCevHlSYhNq8R6stq5OPHAKrkcjo3A2PE2f8KsnH GYzQ== 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; bh=9Zk1ArnKgiQng2MWBVvqO/05T1WJkKR0dBPbHxZP+Xc=; b=JganJWPiYYAyo+NThYFq9X4/FuHm/Q4fIBeii+8llflCYiSpvFoPQjgLuRODVxHovw K7Uy+OqMCe8PKL6h+EThv7Y8BAeIFKwLre6P7tuYVGdX9J/97phrHYxhJe6RUm9THRNt sVqePR6DayG3O9ZadArknAKXqsECwz4LNREku7FVcF2LingDzxZ8VShMUEkImxtggOG7 hLl10NTtpuoh4Xset1IdLJn2KcWDqkzds9gMPv7hiSb4fsrD5LhqdWWfGySn+npZ6ce2 xcLzPjRdorYmMa2IGnTq3sfCa2Vp5q0xwNYBLwjTW3qdsGa3d7/sZLzydcC+syUR5w5F 5Ovg== X-Gm-Message-State: AOAM530SNaSbn8QNV2+RG+Muq8ymfgsEwWqGjiGoWFI0cM8L7p5LMA7c Te3k1FyuAw5nk5LT3F1IyrJEsg== X-Google-Smtp-Source: ABdhPJzsnDrq+NKB04Vh8VktiH3DxPrBoZQLqc5w7qlpjTTBX7YkMv4Q9TC2pA6f066JihQfHzhZhg== X-Received: by 2002:a17:902:c789:b029:e3:dcbd:843b with SMTP id w9-20020a170902c789b02900e3dcbd843bmr2062178pla.61.1614829355389; Wed, 03 Mar 2021 19:42:35 -0800 (PST) Received: from platform-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id h17sm2403989pfc.211.2021.03.03.19.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 19:42:35 -0800 (PST) From: Brad Larson To: linux-arm-kernel@lists.infradead.org Cc: arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, brad@pensando.io, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] MAINTAINERS: Add entry for PENSANDO Date: Wed, 3 Mar 2021 19:41:41 -0800 Message-Id: <20210304034141.7062-9-brad@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304034141.7062-1-brad@pensando.io> References: <20210304034141.7062-1-brad@pensando.io> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add entry for PENSANDO maintainer and files. Signed-off-by: Brad Larson --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 973a937386fa..3f2eebda2396 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2246,6 +2246,15 @@ S: Maintained W: http://hackndev.com F: arch/arm/mach-pxa/palmz72.* +ARM/PENSANDO SUPPORT +M: Brad Larson +L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/*/pensando* +F: arch/arm64/boot/dts/pensando/ +F: drivers/gpio/gpio-elba-spics.c +F: drivers/mmc/host/sdhci-cadence-elba.c + ARM/PLEB SUPPORT M: Peter Chubb S: Maintained