From patchwork Wed Jan 8 01:28:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13929929 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0020E77197 for ; Wed, 8 Jan 2025 01:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NtmiACSjJT3F9PAWPO6E+GzjG0s112mCP5ZFxh4lNAM=; b=Y1E00J+tjfxNvmT2UbzjBWmRf5 GwgfiOgVRc4hQTxXRKpzO7Bcwo6pKbHSAydN0CmLVw2MnstHhPeBOV3C0tl7zXa3SCzqKx8VNuat3 d73laKrYbCYpNmdCtM/d4pFXVNc+gvWDcP2hI/dr15b36KZ9m5Viz2VuWx+h5yPoGMqqVYbOqZXdE nXRjhxnyJE601tDotERkW7o6oYYa8lLMfcyI/3ygIXMQJO0W7L8j1Sjh7C602HiBf+GxvCQlTogfB Xu3OIUYH3NzGVLJgn5hQbaFYIUCrQQz7B5M8OnF0uceM4/hDNMxatgett1j/OVZClmgnfEN4jwH9f 3+Wn6pww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVKuk-00000006kZL-3paT; Wed, 08 Jan 2025 01:31:18 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVKsN-00000006jyo-2ZgL for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 01:28:52 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2167141dfa1so6298805ad.1 for ; Tue, 07 Jan 2025 17:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299730; x=1736904530; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NtmiACSjJT3F9PAWPO6E+GzjG0s112mCP5ZFxh4lNAM=; b=Cai/r63EIGTCKsRzAwaQ364yyMesNv/gCmjZm4uhYBXvPo7Y2n0GYPeUwaPtA1mSab Lxj7dt060BAa+qMUeqHZ4Sc7MoOCUwDhf6uetO+onLjyrkndc4Y9BHN6sOYUlpQYldwb F432jUcvN0ecyGYRj6Z9ezlRpn0jlBWzvgfzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299730; x=1736904530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NtmiACSjJT3F9PAWPO6E+GzjG0s112mCP5ZFxh4lNAM=; b=e2sUsiaXVbRcblC2IGgVsd+e+/kROpLiydHoKlYy3B6JP2ak9mMFsSt3vWVDb9ny0C Vs+Catwe9yD3gig33Kz/n/jN6r66SDfqzgnv5yxu3bzeACk8UEheDJaLOCQSa9uex/9g /1BPyD0j704nO//Cx905hbpuWNDbnv9L1vzFlxjzdl5OtCnZVXW3Sk9eoMN1GDE+TwTm 5MCcqOJ9L7gBRYDW7/uL8GlI9YL2BRwfPKaR/BbgWqTM36zhX2HFM5QMYBdOXkAiqEeN brs7xvCVNIMow7S3hJfL8OAc+N2dv27REk+KDjs6rOrWd/O6Mn7RfQtvgLh/cLDWw0/j MVmw== X-Forwarded-Encrypted: i=1; AJvYcCWMKIJaTUEoVWY7Woezj4uGXXWWXdN+bHDxiCVP2ZzBN77DrYOXLMp85YCiAS0rsV0QFaq2PwQpYYlYX4CCdskJ@lists.infradead.org X-Gm-Message-State: AOJu0YzEZqs9GchJHvBxt+sJVNGPPRN8J1+E+sIGMY7YNYkIzmp/Ne3R sizMWrXAjG6kY2/kIO4+J9D0IPELIXRYvbly9ZTwJupVwoa/kc8LIMRmONgdQQ== X-Gm-Gg: ASbGncucNyJeJEociVBfulIgLuHd7i2f6sWzO1q98UeUEP2xU21wFudVBVs5X6Fo0Hn TOSniGLmB+1xh/heVAG17g2hrwWhwtXJKctCSWLXucGaEZhAnF82z5H/Nmb3SsUZI/dYXZhyYQy wpGUsk9D73152y8OiyzgnMk4mDFsAGbHOdNl7UzAeCDcNirjHOnzj1lxpQKzJTLXUPl3pnW9Rp6 NzniH58e25VxWIZOPfmb/e9HPQ2Z7P7ylCn2VEk+jYDBYSiD9GyGu5riDF5yGxs15KkIOASMowY 6Ksb1q76VoUIOlW28+2k X-Google-Smtp-Source: AGHT+IECb87WVTKnPoq5klH18qVel9WHdGx/7ugyROn+iCaeZnJB4oA6NAnKgGI+EaTULuxAe5Qexw== X-Received: by 2002:a05:6a20:3943:b0:1e5:f8c6:203 with SMTP id adf61e73a8af0-1e745cb45damr6802792637.14.1736299730635; Tue, 07 Jan 2025 17:28:50 -0800 (PST) Received: from localhost (129.135.125.34.bc.googleusercontent.com. [34.125.135.129]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad90b90asm34097987b3a.177.2025.01.07.17.28.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 17:28:50 -0800 (PST) From: Stephen Boyd To: Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski , Rob Herring , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Conor Dooley , Saravana Kannan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [RFC PATCH 1/6] bus: Extract simple-bus into self-contained driver Date: Tue, 7 Jan 2025 17:28:38 -0800 Message-ID: <20250108012846.3275443-2-swboyd@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20250108012846.3275443-1-swboyd@chromium.org> References: <20250108012846.3275443-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_172851_656849_82C230BF X-CRM114-Status: GOOD ( 33.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Extract the simple bus into a self contained driver so that devices are still populated when a node has two (or more) compatibles with the least specific one being the generic "simple-bus". Allow the driver to be a module so that in a fully modular build a driver module for the more specific compatible will be loaded first before trying to match this driver. Cc: Rob Herring Cc: Saravana Kannan Cc: Cc: Arnd Bergmann Cc: "Uwe Kleine-König" Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Signed-off-by: Stephen Boyd --- drivers/bus/Kconfig | 23 +++++++++++ drivers/bus/Makefile | 3 ++ drivers/bus/simple-bus.c | 79 +++++++++++++++++++++++++++++++++++++ drivers/bus/simple-pm-bus.c | 2 + drivers/of/platform.c | 50 +++++++++++++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 drivers/bus/simple-bus.c diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index ff669a8ccad9..7c2aa1350578 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -261,6 +261,29 @@ config DA8XX_MSTPRI configuration. Allows to adjust the priorities of all master peripherals. +config ALLOW_SIMPLE_BUS_OVERRIDE + bool "Allow simple-bus compatible OF nodes to match other drivers" + depends on OF + help + Allow nodes with the "simple-bus" compatible to use a more specific + driver which populates child devices itself. + +config OF_SIMPLE_BUS + tristate "OF Simple Bus Driver" + depends on ALLOW_SIMPLE_BUS_OVERRIDE || COMPILE_TEST + default ALLOW_SIMPLE_BUS_OVERRIDE + help + Driver for the "simple-bus" compatible nodes in DeviceTree. Child + nodes are usually automatically populated on the platform bus when a + node is compatible with "simple-bus". This driver maintains that + feature but it fails probe to allow other drivers to try to probe + with a more specific compatible if possible. + + Those other drivers depend on this kconfig symbol so that they match + the builtin or modular status of this driver. Don't disable this + symbol if ALLOW_SIMPLE_BUS_OVERRIDE is set and there isn't another + driver for the simple-bus compatible. + source "drivers/bus/fsl-mc/Kconfig" source "drivers/bus/mhi/Kconfig" diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index cddd4984d6af..f3968221d704 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -40,5 +40,8 @@ obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o obj-$(CONFIG_DA8XX_MSTPRI) += da8xx-mstpri.o +# Must be last for driver registration ordering +obj-$(CONFIG_OF_SIMPLE_BUS) += simple-bus.o + # MHI obj-y += mhi/ diff --git a/drivers/bus/simple-bus.c b/drivers/bus/simple-bus.c new file mode 100644 index 000000000000..3e39b9818566 --- /dev/null +++ b/drivers/bus/simple-bus.c @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Simple Bus Driver + */ + +#include +#include +#include +#include +#include +#include + +static struct platform_driver simple_bus_driver; + +static int has_specific_simple_bus_drv(struct device_driver *drv, void *dev) +{ + /* Skip if it's this simple bus driver */ + if (drv == &simple_bus_driver.driver) + return 0; + + if (of_driver_match_device(dev, drv)) { + dev_dbg(dev, "Allowing '%s' to probe more specifically\n", drv->name); + return 1; + } + + return 0; +} + +static int simple_bus_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + const struct of_dev_auxdata *lookup = dev_get_platdata(dev); + struct device_node *np = dev->of_node; + + /* + * If any other driver wants the device, leave the device to the other + * driver. Only check drivers that come after this driver so that if an + * earlier driver failed to probe we don't populate any devices, and + * only check if there's a more specific compatible. + */ + if (of_property_match_string(np, "compatible", "simple-bus") != 0 && + bus_for_each_drv(&platform_bus_type, &simple_bus_driver.driver, dev, + has_specific_simple_bus_drv)) + return -ENODEV; + + if (np) + of_platform_populate(np, NULL, lookup, dev); + + return 0; +} + +static const struct of_device_id simple_bus_of_match[] = { + { .compatible = "simple-bus", }, + { } +}; +MODULE_DEVICE_TABLE(of, simple_bus_of_match); + +static struct platform_driver simple_bus_driver = { + .probe = simple_bus_probe, + .driver = { + .name = "simple-bus", + .of_match_table = simple_bus_of_match, + }, +}; + +static int __init simple_bus_driver_init(void) +{ + return platform_driver_register(&simple_bus_driver); +} +arch_initcall(simple_bus_driver_init); + +static void __exit simple_bus_driver_exit(void) +{ + platform_driver_unregister(&simple_bus_driver); +} +module_exit(simple_bus_driver_exit); + +MODULE_DESCRIPTION("Simple Bus Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c index 5dea31769f9a..be9879aa80c1 100644 --- a/drivers/bus/simple-pm-bus.c +++ b/drivers/bus/simple-pm-bus.c @@ -118,7 +118,9 @@ static const struct dev_pm_ops simple_pm_bus_pm_ops = { static const struct of_device_id simple_pm_bus_of_match[] = { { .compatible = "simple-pm-bus", }, +#ifndef CONFIG_ALLOW_SIMPLE_BUS_OVERRIDE { .compatible = "simple-bus", .data = ONLY_BUS }, +#endif { .compatible = "simple-mfd", .data = ONLY_BUS }, { .compatible = "isa", .data = ONLY_BUS }, { .compatible = "arm,amba-bus", .data = ONLY_BUS }, diff --git a/drivers/of/platform.c b/drivers/of/platform.c index c6d8afb284e8..63a80c30d515 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -311,6 +311,54 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l return NULL; } +/** + * of_platform_should_populate_children() - Should child nodes be populated for a bus + * @bus: device node of the bus to populate children for + * @matches: match table for bus nodes + * + * This function is used to determine if child nodes should be populated as + * devices for a bus. That is usually the case, unless + * CONFIG_ALLOW_SIMPLE_BUS_OVERRIDE=y, in which case the simple-bus driver + * (CONFIG_OF_SIMPLE_BUS) will populate them. + * + * Return: True if child nodes should be populated as devices, false otherwise. + */ +static bool of_platform_should_populate_children(const struct of_device_id *matches, + struct device_node *bus) +{ + /* Not configured to allow simple-bus to be overridden. Skip. */ + if (!IS_ENABLED(CONFIG_ALLOW_SIMPLE_BUS_OVERRIDE)) + return true; + + /* The simple-bus driver will handle it. */ + if (IS_ENABLED(CONFIG_OF_SIMPLE_BUS)) + return false; + + if (!matches) + return true; + + /* + * Always populate if the matches aren't populating a "simple-bus" + * compatible node. + */ + for (; matches->name[0] || matches->type[0] || matches->compatible[0]; matches++) { + if (!strncmp(matches->compatible, "simple-bus", + ARRAY_SIZE(matches->compatible))) { + /* + * Always populate if "simple-bus" is the first + * compatible, so that CONFIG_OF_SIMPLE_BUS can be + * disabled while CONFIG_ALLOW_SIMPLE_BUS_OVERRIDE can + * be enabled. + */ + if (of_property_match_string(bus, "compatible", "simple-bus") != 0) + return false; + break; + } + } + + return true; +} + /** * of_platform_bus_create() - Create a device for a node and its children. * @bus: device node of the bus to instantiate @@ -370,6 +418,8 @@ static int of_platform_bus_create(struct device_node *bus, dev = of_platform_device_create_pdata(bus, bus_id, platform_data, parent); if (!dev || !of_match_node(matches, bus)) return 0; + if (!of_platform_should_populate_children(matches, bus)) + return 0; for_each_child_of_node_scoped(bus, child) { pr_debug(" create child: %pOF\n", child); From patchwork Wed Jan 8 01:28:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13929930 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FB1BE77197 for ; Wed, 8 Jan 2025 01:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+3OGnfMaF6ttidHVZW35hLDvix/z1ZneywWqGiGVTK0=; b=i+CWbFszJjKgUFviF3aoyzU2uW x+2KFkXI2c/NGibGU6N5pm6GPDZXy2y5wmZG6iObTwDkqcScNfeGUdYCydhH+gQdR5R1Iwuqbt5Df NoheoE5jk+1cx3RZ0fRQOe2oik5JAJFMQyk1zRJYouT66W1UDg/BIZqp5J+n4xUhtvwuNNgjLm3jx 4IktbDfoq3eM8Cbk36WKHtnYj2bEY/nPbITCuWbDDDg8tCO4TGForWaeRhtn5Jfy2waVJwy/l1zm6 ItlFnIIjVkDUqIg/OzTcoB9oQYYDlEfII7l2SHQC0thgcGjw8q9z3m2jRQWFbKjuA/8bEx17ARiep UrU5uhsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVKvw-00000006kvK-2GIh; Wed, 08 Jan 2025 01:32:32 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVKsP-00000006jzQ-097z for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 01:28:54 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2f13acbe29bso533917a91.1 for ; Tue, 07 Jan 2025 17:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299732; x=1736904532; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+3OGnfMaF6ttidHVZW35hLDvix/z1ZneywWqGiGVTK0=; b=nIOB2UYHG8YBckPKKCIR+V6LH84oAkscImky0WQfJgv7szCyNJrPY9It7pR6UI3ouF wFk37DV/JKlA77m2UnEI6eZciN+p0dhVnShjj5QvJoqELeFUsQ2/4NQ1ws+s7boo4lf1 J0Np36ER7svJHke4Dp1ifg2iXa4rC8AgN6DMM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299732; x=1736904532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+3OGnfMaF6ttidHVZW35hLDvix/z1ZneywWqGiGVTK0=; b=F7uCXf4NUCv5nJQK/bic4zKgmq7nlIafyi8iWzg8+VQl/HwqZipDodqKYwe6DA4NO+ Yj7LRksmc7SJiBv1cCI1vlcsZTZmIaUbPUyDt6+np9G3XURSXzC7V4nsd33lK2b+Xiex tSBe0hyHoZgYUYNdloA7p2t1WScLzYcGDrtneTvDsXvGFYd9FrrVFr0I2LbKTsUN/G72 Obi83qiicwkXarcCPKFWd6Vim3sOYMU655Ae1hwWKH8DyEjFHnSM5kp669rrHnhgUWEK 8PzvglD8mSq+1PEsWcjAEgPPBZDmrj59sB/pyojwAPSRIlvRaKirY2iz5U9yD6pPixpF jICg== X-Forwarded-Encrypted: i=1; AJvYcCXQybpYYhI2xBufZyFxcex4QEiP8MG+iYrm4MAkSOcMuLRa4pAxZNjqStATRugn+nG3ygve9TZxnfMq6iR8aZRk@lists.infradead.org X-Gm-Message-State: AOJu0YxrUs0g7OYPo79rdhs3Rpp6P2V6RkqyKs5NtvnqgYtUm/2HpK9v cbFrjblT1f+QN/UdU3FxxhKRSjGQNIbzmjRLZzwqSMOxpH42eUv3Rjj1r3RBbg== X-Gm-Gg: ASbGnct6u3OiOvXplxefu7Ow/BKp7EvRiBtXfk2eQ74G6rUf4VcjrzeTkPwZ6/yiU/J 73gQRDx37g0Devq3G5QCNGIqvLIx149wVR/1QTkgCAsK8FH3D8MZEZ/wgw9Nx7JhB5hSpiHr4VS p566bOyHZev4Imdarxrzvq0LoCTkIoSZZ5w40dhuOpyJgHdeCaXZ9pd1mdhw4bq4IBgOjEuO7qj T8dI9ASs1nJueXtYdNRSUszrmObndLFzCUPoowCMLNf4ZoE9GTZnBCe/1OG4bRRHrQf4QprgRJt 1X2ES+N1zMho0IHPfUOt X-Google-Smtp-Source: AGHT+IGRIU+NqXGlb71FFJypyGjyxuINnxFY9kBScDBRLLqASUBsZ/TtCxmB7qxtQamZfY7V7xiN8A== X-Received: by 2002:a17:90b:2705:b0:2ef:949c:6f6b with SMTP id 98e67ed59e1d1-2f53cc6e0e4mr8060729a91.13.1736299732138; Tue, 07 Jan 2025 17:28:52 -0800 (PST) Received: from localhost (129.135.125.34.bc.googleusercontent.com. [34.125.135.129]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2f54a287254sm196478a91.20.2025.01.07.17.28.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 17:28:51 -0800 (PST) From: Stephen Boyd To: Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski , Rob Herring , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Conor Dooley , Saravana Kannan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Krzysztof Kozlowski Subject: [RFC PATCH 2/6] dt-bindings: bus: Add qcom,soc-sc7180 SoC Date: Tue, 7 Jan 2025 17:28:39 -0800 Message-ID: <20250108012846.3275443-3-swboyd@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20250108012846.3275443-1-swboyd@chromium.org> References: <20250108012846.3275443-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_172853_073016_B8C439B4 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document the Qualcomm SC7180 System on a Chip (SoC). This SoC is made up of multiple devices that have their own bindings, therefore this binding is for a "bus" that is the SoC node. TODO: Document all child nodes. This is woefully incomplete but at least shows what is involved with describing an SoC node in dt schema. Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Signed-off-by: Stephen Boyd --- .../bindings/bus/qcom,soc-sc7180.yaml | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/qcom,soc-sc7180.yaml diff --git a/Documentation/devicetree/bindings/bus/qcom,soc-sc7180.yaml b/Documentation/devicetree/bindings/bus/qcom,soc-sc7180.yaml new file mode 100644 index 000000000000..56f8b75ecdab --- /dev/null +++ b/Documentation/devicetree/bindings/bus/qcom,soc-sc7180.yaml @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/qcom,soc-sc7180.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SC7180 SoC + +maintainers: + - Bjorn Andersson + - Konrad Dybcio + +description: + Qualcomm's SC7180 System on a Chip (SoC). + +properties: + compatible: + items: + - const: qcom,soc-sc7180 + - const: simple-bus + + '#address-cells': + const: 2 + + '#size-cells': + const: 2 + + clock-controller@100000: + $ref: /schemas/clock/qcom,gcc-sc7180.yaml# + + watchdog@17c10000: + $ref: /schemas/watchdog/qcom-wdt.yaml# + +required: + - compatible + - '#address-cells' + - '#size-cells' + - clock-controller@100000 + - watchdog@17c10000 + +additionalProperties: false + +examples: + - | + #include + #include + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + compatible = "qcom,soc-sc7180", "simple-bus"; + + // TODO: Is it possible to ignore the details? + clock-controller@100000 { + compatible = "qcom,gcc-sc7180"; + reg = <0 0x00100000 0 0x1f0000>; + clocks = <&rpmhcc_RPMH_CXO_CLK>, + <&rpmhcc_RPMH_CXO_CLK_A>, + <&sleep_clk>; + clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + power-domains = <&rpmhpd_SC7180_CX>; + }; + + watchdog@17c10000 { + compatible = "qcom,apss-wdt-sc7180", "qcom,kpss-wdt"; + reg = <0 0x17c10000 0 0x1000>; + clocks = <&sleep_clk>; + interrupts = ; + }; + }; + +... From patchwork Wed Jan 8 01:28:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13929931 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7B8FE77197 for ; Wed, 8 Jan 2025 01:33:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dtdkWnLr/kObxk9d1OZrWr4jX4hdZNVEJy/OpGU79kA=; b=Gd1r52EVcEPMwgiQj+p4wMOFb6 C0iNOrrUIefSvq2Fz9Fq5jdGdMM0vT0tcDtGUZKLe1RgTpTQRy4DQrkxSR4/nQFi3sjeiVyhkbMTg roHsD00WW24K0mVkhb+0y5xoFZdlJRMd9hqM+/y/SlJfaD+IHRy5KUELPyrsmPNMyPxRlLRvRUbo8 C0FUCsIAdcVnMtUvfyzbu4GfdUdZW650IPOqIKs12RQB521+sswssuC2LmeFuDBB7SQxMnJ4KWEja RrQiigiYWcPEV+fGXCfZil7ogkKF1btWBvld1V7T6FNttHb1IhlqoYSw+Zy60W9LGe0zRHCgIpisY u7xoo8zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVKx7-00000006l9G-0jZR; Wed, 08 Jan 2025 01:33:45 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVKsQ-00000006jzx-1wcv for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 01:28:55 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2161eb94cceso168844895ad.2 for ; Tue, 07 Jan 2025 17:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299733; x=1736904533; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dtdkWnLr/kObxk9d1OZrWr4jX4hdZNVEJy/OpGU79kA=; b=nMHNpxJh0J74eINzQZ4QRLv2zB3GG5WxruJ3O/ud2TK53OuQLeO/CrW39QZ7R/q0QI h4WgF7mU5Ud9I5mSOYh1lyYkg7kXm+bjTotjb8QkdjJYGSCzg8fXqxbsoLnENHPV6xe6 igoyu+UI2/nkbVAVKsdyvQNs3LVfBLZASDyfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299733; x=1736904533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dtdkWnLr/kObxk9d1OZrWr4jX4hdZNVEJy/OpGU79kA=; b=vCAxDzJlp8zutyq4gMaPPb9a16oAFRzBYgwIy+o1G00H+5SQDwBUD3NYWeTPd5fRUJ 8jBQk7ydFDe0Xvxlo6mArjffZrxJLaazvKtWnS+c4ss0hleT3UxorDzoJhyQYF+UAzG7 VdaXWDeD63UdNY9Hw2T9qzoUgb+gx1Y8Rby/pa3msViOmqOHDwSfIYRuv2rwJuO3pGKy lMgCsE8rj4haFEOKJCzhtiZa6CR7CPb6ydCxdFwzp6e7kOu2ch10CxX7s+FqJ9ev5uov b6QY3iFI6yx5iOBZBL9bGwTthf7VDcQCK84epVHo6RE8aj2oHVTxa2gvF6qBw+PIp7pb +R+w== X-Forwarded-Encrypted: i=1; AJvYcCUu5jKxxkJAhYYcL+aWGZe2Te6kjKbN96Iucqft5dLm10EbNyd+ATjEnJa/73bPX1EvhbgC/nfixCCYR4uFsPgv@lists.infradead.org X-Gm-Message-State: AOJu0Yx1LiZ8a4PWBlBqSXK3C7J4NMOXj/CbrTEEHPOxgi26h/iPBayn DVagdq1fa7SnXl9901GwwwXpRms+Ygr1gV9Qpmjg+wmtHcCOmLE+rj/vCsPJWA== X-Gm-Gg: ASbGncu5a8juH0GtRWJZjabs46yjgkar2MFpqxCoOBzp/dGC4Be78CJ6oaR9WLwBWzC 9EetZ5ylMBDChnwbe7rmd7IkpXzu1HcCxBp3JDF99Uyo+CmVzplD6ds3fwn/ew1seOrSTRfxr/k fpE8gzTH/+Oh9bnhj2ZjDVP6lgQ45yAUBPxDiDQ7bUbKCCq/1wL2RA45l8oDwgR+4GQ4A56euYb 2HJyBHyZrB7oKY/iua0Q5hHYGye0Mh9PefjYkQFBbptaPHizXCGPvFEpbq70PKY2cW1A6cTuSMU 84ifpEYnmsHlFeZ6Z/Xy X-Google-Smtp-Source: AGHT+IHT5knJwT6WWg3ma5G8rT/UQQorba0QpRS5VpGWB4gpjmUniZb797RHNFR9BYNyRf9SZQjl8w== X-Received: by 2002:a05:6a21:339b:b0:1e0:c432:32fe with SMTP id adf61e73a8af0-1e88cff3d1amr1835597637.26.1736299733617; Tue, 07 Jan 2025 17:28:53 -0800 (PST) Received: from localhost (129.135.125.34.bc.googleusercontent.com. [34.125.135.129]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad834cecsm33982127b3a.70.2025.01.07.17.28.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 17:28:53 -0800 (PST) From: Stephen Boyd To: Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski , Rob Herring , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Conor Dooley , Saravana Kannan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [RFC PATCH 3/6] bus: Add basic sc7180 bus driver Date: Tue, 7 Jan 2025 17:28:40 -0800 Message-ID: <20250108012846.3275443-4-swboyd@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20250108012846.3275443-1-swboyd@chromium.org> References: <20250108012846.3275443-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_172854_503466_48A7F0E7 X-CRM114-Status: GOOD ( 20.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a bus driver that does nothing besides populate devices as a child of the soc device. Cc: Rob Herring Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Signed-off-by: Stephen Boyd --- drivers/bus/Kconfig | 3 ++ drivers/bus/Makefile | 3 ++ drivers/bus/qcom/Kconfig | 16 +++++++++++ drivers/bus/qcom/Makefile | 3 ++ drivers/bus/qcom/qcom-sc7180.c | 51 ++++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 drivers/bus/qcom/Kconfig create mode 100644 drivers/bus/qcom/Makefile create mode 100644 drivers/bus/qcom/qcom-sc7180.c diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 7c2aa1350578..69963f0f02f3 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -284,6 +284,9 @@ config OF_SIMPLE_BUS symbol if ALLOW_SIMPLE_BUS_OVERRIDE is set and there isn't another driver for the simple-bus compatible. +# SoC specific drivers +source "drivers/bus/qcom/Kconfig" + source "drivers/bus/fsl-mc/Kconfig" source "drivers/bus/mhi/Kconfig" diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index f3968221d704..796dd0515578 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -40,6 +40,9 @@ obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o obj-$(CONFIG_DA8XX_MSTPRI) += da8xx-mstpri.o +# SoC specific drivers +obj-y += qcom/ + # Must be last for driver registration ordering obj-$(CONFIG_OF_SIMPLE_BUS) += simple-bus.o diff --git a/drivers/bus/qcom/Kconfig b/drivers/bus/qcom/Kconfig new file mode 100644 index 000000000000..f4c5d05ec9ca --- /dev/null +++ b/drivers/bus/qcom/Kconfig @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0 + +menuconfig QCOM_SOC_BUS + tristate "Qualcomm SoC Bus Drivers" + depends on ARCH_QCOM || COMPILE_TEST + +if QCOM_SOC_BUS + +config QCOM_SOC_BUS_SC7180 + tristate "Qualcomm SC7180 SoC Bus" + depends on ALLOW_SIMPLE_BUS_OVERRIDE + depends on OF_SIMPLE_BUS || !OF_SIMPLE_BUS + help + Support for the Qualcomm SC7180 SoC bus. + +endif diff --git a/drivers/bus/qcom/Makefile b/drivers/bus/qcom/Makefile new file mode 100644 index 000000000000..5d41ad61fead --- /dev/null +++ b/drivers/bus/qcom/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_QCOM_SOC_BUS_SC7180) += qcom-sc7180.o diff --git a/drivers/bus/qcom/qcom-sc7180.c b/drivers/bus/qcom/qcom-sc7180.c new file mode 100644 index 000000000000..a615cf5a2129 --- /dev/null +++ b/drivers/bus/qcom/qcom-sc7180.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * SoC bus driver for Qualcomm SC7180 SoCs + */ + +#include +#include +#include +#include +#include +#include +#include + +static int qcom_soc_sc7180_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + + return of_platform_populate(np, NULL, NULL, dev); +} + +static const struct of_device_id qcom_soc_sc7180_match[] = { + { .compatible = "qcom,soc-sc7180", }, + { } +}; +MODULE_DEVICE_TABLE(of, qcom_soc_sc7180_match); + +static struct platform_driver qcom_soc_sc7180_driver = { + .probe = qcom_soc_sc7180_probe, + .driver = { + .name = "qcom-soc-sc7180", + .of_match_table = qcom_soc_sc7180_match, + .suppress_bind_attrs = true, + }, +}; + +static int __init qcom_soc_sc7180_driver_init(void) +{ + return platform_driver_register(&qcom_soc_sc7180_driver); +} +/* Register before simple-bus driver. */ +arch_initcall(qcom_soc_sc7180_driver_init); + +static void __exit qcom_soc_sc7180_driver_exit(void) +{ + platform_driver_unregister(&qcom_soc_sc7180_driver); +} +module_exit(qcom_soc_sc7180_driver_exit); + +MODULE_DESCRIPTION("Qualcomm SC7180 SoC Driver"); +MODULE_LICENSE("GPL"); From patchwork Wed Jan 8 01:28:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13929932 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC28DE77197 for ; Wed, 8 Jan 2025 01:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MfN6GTuNKF5VqrxYRWrKUqgkdrEWac7RU0Z/q9vfjN0=; b=PrOHDWFWXz3P5U9OZCZAXLr3vk 6BS9rulcokywrBnvLxT5ZpAvcVpThJEPRBK7Ugn55ZgJ2CxnQlC7K3ABdIOKq7DDiwwP7RwbMpwph JEypHSmtLXY/Dr/pPLbxrH+5gT+k7JaRMoEOnKZcg+hZtpuU9uu7DX7JMwAf1flLpOa6P0IzfdBQH RTA0pQ1rBCrvPy67wap7ynmCxOQ9Z1w4gVfwq+wxar/YhbAbDmvPeSI4LCw9NBOc2uv50cE3xmiBA Q+HeErCOeajhP3QU/SW6bFvodvjRF/yTieOOYxCxvoPN+MNAvEOsiuoZ7cWktep/r9b6NzFDu+ybi jfSNe6nA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVKyI-00000006lRE-3TNb; Wed, 08 Jan 2025 01:34:58 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVKsR-00000006k0T-2QpK for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 01:28:56 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ee74291415so19419883a91.3 for ; Tue, 07 Jan 2025 17:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299735; x=1736904535; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MfN6GTuNKF5VqrxYRWrKUqgkdrEWac7RU0Z/q9vfjN0=; b=k/QOFlOkrfox1/v+A3Q/rOXjC4tVmSFFStgm0XSAJAgpK3gCC4Am0ZNmfPVbMwRDTG TEJ3bHGNwsNZjGSFl2rbEHA8qlq/ZxhrUkZatWsTBKzQqvzwzVaPyalO6JD+OMmNEjyq RA9nc7viEEEe+3ZXBUbNGSP8yN/CL8tU+BH5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299735; x=1736904535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MfN6GTuNKF5VqrxYRWrKUqgkdrEWac7RU0Z/q9vfjN0=; b=nzxOiSZX9TfQjmHXkmMEgWA+k58NNfmMty6XKB+QbOKtRfYGXKdsgNqRSnyQXBDz0G JMBftpTPIoFBX9ZrejMQUbqfvta32O+My/JtlWC3MkyDBUBRFav0lejnFEb1qpRFfIYy iKl0Hlm5wvxDHdNIiDEDxqaJS2fhGKoGLEV//Zv0rYTUGUFA9Ac4TgrWqdYlp1/j0DbC HH72MvzA8tnYMNCEO9O2IDrM86At3e5i1V2gEMrHl+71UAqtyTFl+6cmoZxge55pYJIm YGLhWcSnE97ngB4eH/7acU4t+E5XEOZX7suiSA3twFPVKR7TxZKi7ZCWS4OoV5udmxxt uPhA== X-Forwarded-Encrypted: i=1; AJvYcCVVvuI9msciE3MPbKlWZlVCdaH0lf+MwtAPcZ1GiAVscY7ak/oRQoICcu55NzmTSZluoYCTNEHyGh+Gs9zFW2jB@lists.infradead.org X-Gm-Message-State: AOJu0YyC6bKT7ISEqF/W1HLwFcXFZ6MWJtSj7ukLnpo0mEmHJmnSzyEH zsP/C6++g34oHpXS7y688tga2oM48YFnwjX2AQh6e82o9TBt+3bkkR4gYcSwpA== X-Gm-Gg: ASbGnctThETsWqs5BhgJXun2j3W6QiT2BvbG34HgI4TUbEqFbnkiiJ67Fa3FB1yspwA 9j9km9htm8LsjJgThXd8C62Wzt2qS/A7gWjQSVkehWKxV5aHQXV7WaCE71Gk334npVp73R4l7z6 +QdUhrqZ639NJ/errPADTCijNjTO1Z21kOA85XeSth6OGQU+wFUFE5brE+56dCfTiaxhetl2l8I JwCJpKPcrpjGWfxqDm9ClN8Jyc0ypYk1blGg04R/KsBCrz+BEc2YPHdquvWVCR+JlXqOpUvFCNE KNLK7/ifWL+Z9YWyXvEU X-Google-Smtp-Source: AGHT+IH4Y++Unzll3LBTxpHGSJAl9gWr9EZnywMb7/5iKVZRlAs9Kn/eOeYulAHPdNQ/JPBW9ae4bA== X-Received: by 2002:a17:90b:2c84:b0:2f4:47fc:7f18 with SMTP id 98e67ed59e1d1-2f548ebb679mr1630164a91.10.1736299735123; Tue, 07 Jan 2025 17:28:55 -0800 (PST) Received: from localhost (129.135.125.34.bc.googleusercontent.com. [34.125.135.129]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2f54a13dcd5sm239559a91.0.2025.01.07.17.28.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 17:28:54 -0800 (PST) From: Stephen Boyd To: Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski , Rob Herring , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Conor Dooley , Saravana Kannan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [RFC PATCH 4/6] of: Extract alloc/add functions from of_platform_device_create_pdata() Date: Tue, 7 Jan 2025 17:28:41 -0800 Message-ID: <20250108012846.3275443-5-swboyd@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20250108012846.3275443-1-swboyd@chromium.org> References: <20250108012846.3275443-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_172855_622226_90091DA1 X-CRM114-Status: GOOD ( 19.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow drivers to modify the 'struct device' for a device node by splitting of_platform_device_create_pdata() into two functions. The first function, of_platform_device_alloc(), allocates the platform device and the second function, of_platform_device_add(), adds the platform device to the platform bus. SoC power management drivers can use these APIs to allocate a platform device for a node underneath the soc node, attach pmdomains and/or set the device as runtime PM active, and finally add the platform device to the platform bus. Cc: Rob Herring Cc: Saravana Kannan Cc: Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Signed-off-by: Stephen Boyd --- drivers/of/platform.c | 80 ++++++++++++++++++++++++++++++------- include/linux/of_platform.h | 14 +++++++ 2 files changed, 79 insertions(+), 15 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 63a80c30d515..d8ee2d38a382 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -138,6 +138,66 @@ struct platform_device *of_device_alloc(struct device_node *np, } EXPORT_SYMBOL(of_device_alloc); +/** + * of_platform_device_alloc - Alloc and initialize an of_device + * @np: pointer to node to create device for + * @bus_id: name to assign device + * @parent: Linux device model parent device. + * + * Return: Pointer to created platform device, or NULL if a device was not + * allocated. Unavailable devices will not get allocated. + */ +struct platform_device * +of_platform_device_alloc(struct device_node *np, const char *bus_id, + struct device *parent) +{ + struct platform_device *ofdev; + + pr_debug("alloc platform device: %pOF\n", np); + + if (!of_device_is_available(np) || + of_node_test_and_set_flag(np, OF_POPULATED)) + return NULL; + + ofdev = of_device_alloc(np, bus_id, parent); + if (!ofdev) { + of_node_clear_flag(np, OF_POPULATED); + return ofdev; + } + + ofdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + if (!ofdev->dev.dma_mask) + ofdev->dev.dma_mask = &ofdev->dev.coherent_dma_mask; + ofdev->dev.bus = &platform_bus_type; + of_msi_configure(&ofdev->dev, ofdev->dev.of_node); + + return ofdev; +} +EXPORT_SYMBOL(of_platform_device_alloc); + +/** + * of_platform_device_add - Add an of_device to the platform bus + * @ofdev: of_device to add + * + * Return: 0 on success, negative errno on failure. + */ +int of_platform_device_add(struct platform_device *ofdev) +{ + struct device_node *np = ofdev->dev.of_node; + int ret; + + pr_debug("adding platform device: %pOF\n", np); + + ret = of_device_add(ofdev); + if (ret) { + platform_device_put(ofdev); + of_node_clear_flag(np, OF_POPULATED); + } + + return ret; +} +EXPORT_SYMBOL(of_platform_device_add); + /** * of_platform_device_create_pdata - Alloc, initialize and register an of_device * @np: pointer to node to create device for @@ -154,29 +214,19 @@ static struct platform_device *of_platform_device_create_pdata( void *platform_data, struct device *parent) { + int ret; struct platform_device *dev; pr_debug("create platform device: %pOF\n", np); - if (!of_device_is_available(np) || - of_node_test_and_set_flag(np, OF_POPULATED)) + dev = of_platform_device_alloc(np, bus_id, parent); + if (!dev) return NULL; - dev = of_device_alloc(np, bus_id, parent); - if (!dev) - goto err_clear_flag; - - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); - if (!dev->dev.dma_mask) - dev->dev.dma_mask = &dev->dev.coherent_dma_mask; - dev->dev.bus = &platform_bus_type; dev->dev.platform_data = platform_data; - of_msi_configure(&dev->dev, dev->dev.of_node); - - if (of_device_add(dev) != 0) { - platform_device_put(dev); + ret = of_platform_device_add(dev); + if (ret) goto err_clear_flag; - } return dev; diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 17471ef8e092..e55c1371b560 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -71,6 +71,10 @@ extern int of_platform_bus_probe(struct device_node *root, #ifdef CONFIG_OF_ADDRESS /* Platform devices and busses creation */ +extern struct platform_device *of_platform_device_alloc(struct device_node *np, + const char *bus_id, + struct device *parent); +extern int of_platform_device_add(struct platform_device *ofdev); extern struct platform_device *of_platform_device_create(struct device_node *np, const char *bus_id, struct device *parent); @@ -91,6 +95,16 @@ extern int devm_of_platform_populate(struct device *dev); extern void devm_of_platform_depopulate(struct device *dev); #else /* Platform devices and busses creation */ +static inline struct platform_device *of_platform_device_alloc(struct device_node *np, + const char *bus_id, + struct device *parent) +{ + return NULL; +} +static inline int of_platform_device_add(struct platform_device *ofdev) +{ + return -ENODEV; +} static inline struct platform_device *of_platform_device_create(struct device_node *np, const char *bus_id, struct device *parent) From patchwork Wed Jan 8 01:28:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13929933 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB50DE77197 for ; Wed, 8 Jan 2025 01:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h2PH+YeR0bEBhGOmEQodK+uTa/B+QOdEM0hw2aypokE=; b=wGacejzxnSxmUTLZpcnT04Y/h/ p3I4WHUhd94hQGHdWYFBU9zXb9dS7K7+TTo3vAk0qb10Vl/78h6eS1Gc4dCb7JyXapW5nyfBLqpKL gE70TKSSf6gzgNgJgHq5nj75voHM4qzNHg1v2gLoTmJYR5Zs9pqmUu1qxlYKTSAIK0Yvd5JEp8iJw xFqLFRUL0XA6YrjuPzltwiB4Awm7jpEWHMmCJ1SZcN2Qijafd2bQSa4GsiGLWDeM931NMUs761Rd3 xE3jVRN9l/5zGqGL5XpIAfZbmT7zPOgU6WEhy6K+i6R24buTfXWHA4F74NTLLbYWbiN0j00fuC/6P UZICX39Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVKzU-00000006lld-2PUT; Wed, 08 Jan 2025 01:36:12 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVKsT-00000006k1N-1feH for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 01:28:58 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-21661be2c2dso219142125ad.1 for ; Tue, 07 Jan 2025 17:28:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299736; x=1736904536; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h2PH+YeR0bEBhGOmEQodK+uTa/B+QOdEM0hw2aypokE=; b=AXH0+HL/OBa7F1jLtE/lJ4HkwHPn+0TY53EHqE7CaZtXrqiZgoJJ9JenAB6WjGGWdm ZKRYljUFrhQ67AyWL2lQeNCaZzkNAKsrAFNQuzRouq28XjJGcdHfiX9Wkfa2ImH77l+B Vh5+USWMDOgMKFB7B5CDG3C7ihEm5EbgmBdyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299736; x=1736904536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h2PH+YeR0bEBhGOmEQodK+uTa/B+QOdEM0hw2aypokE=; b=cI54NNlAQMQc9GpYi4secaD162OAVHhvRHx9x3oPG1H5EANaUvKgoyEDDZZ+enyzXa FtQd23MUKl9MhvNM1vsAK1RF+DIhR7OqMlRsyZOSiJjg0k9WKA89sWBfTskacGbq41Rp KhXmXCMRxDId0Gfu+iuF7io8NbiOwIT4P4qYiGVszSIJknufw2AJrUojDvaYOJ4NPPE+ 9rYBTgzdnuvKiQRmc9SLjyrHLKpE1kCzuSMGRRwfxNEyq+gbURrQoZVc8/JjhMJVs8Cb Q/vYjvaN/8KUuzuEoiuqEp+/2RA6ZAlpUK//+1ZjsJzIO+nX4se5bGpDB4Nk0OB5y1jy FDPQ== X-Forwarded-Encrypted: i=1; AJvYcCWIdMD0/rXzroT8Ky8ta+Sr3/MCqFj3LXpHMOjTdr60uNm6VGakfrfXEuq4HtqaEbTON3c479KXb/xo5rlmocNJ@lists.infradead.org X-Gm-Message-State: AOJu0YwzpX4iTawqy7M1CG93w6h8mJ+97oabEvgSK95mZRvDbJIvFw/I 1eNEUx46kjQRteWDdmNdga/UCC9CA3IIGiep2K7KkZo2VLqY7adEVAdmV+nFBg== X-Gm-Gg: ASbGncvi5xzIglXg70jCviX801YpVnA4VjLBJc9ywBkMc8n8wrnPY/EBnY3AzJ0U4q4 NqPC/cDyBOdBZ1QYdtUlcL2ZvGY/Nrm1KCncgU/B05RaVhI+9/2arZW949BP1bph/twJaDgpi91 qYktHV7eJgdhcqo8f4L324vaB72pcH4zZsiMqKOghay66L8dfgSGbky2rcVbkXZrsOCf5aqbR6D XrsrJFHFUbq5ysSkoWkKtzsp++tWTV6J49O/SLSuSPZTyywcsbWajHVP/dBCrSAX/v3hYQlcjAC k4+nyM7pAo9B7WfpFwWA X-Google-Smtp-Source: AGHT+IEPnKUCG2gblLZlLZNHyLGaKfpBR0RoXfdx9u2gcf5pTAWqsgbyihyLPhCZcWcNvOkJsoUDRw== X-Received: by 2002:a17:903:2311:b0:215:a2e2:53ff with SMTP id d9443c01a7336-21a83f36e1dmr16501155ad.11.1736299736529; Tue, 07 Jan 2025 17:28:56 -0800 (PST) Received: from localhost (129.135.125.34.bc.googleusercontent.com. [34.125.135.129]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc962cf4sm316325925ad.25.2025.01.07.17.28.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 17:28:56 -0800 (PST) From: Stephen Boyd To: Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski , Rob Herring , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Conor Dooley , Saravana Kannan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [RFC PATCH 5/6] bus: qcom-sc7180: Attach pm domain to watchdog device Date: Tue, 7 Jan 2025 17:28:42 -0800 Message-ID: <20250108012846.3275443-6-swboyd@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20250108012846.3275443-1-swboyd@chromium.org> References: <20250108012846.3275443-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_172857_435739_5E24A522 X-CRM114-Status: GOOD ( 17.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Find the watchdog device described as a child node of the sc7180 SoC node and attach a generic pm domain to the device before registering the device with the platform bus. The domain simply gets the clk and turns it on when the pm domain is powered on and turns it off when the pm domain is powered off. Cc: Rob Herring Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Signed-off-by: Stephen Boyd --- drivers/bus/qcom/qcom-sc7180.c | 122 +++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/drivers/bus/qcom/qcom-sc7180.c b/drivers/bus/qcom/qcom-sc7180.c index a615cf5a2129..7dfe6b32efef 100644 --- a/drivers/bus/qcom/qcom-sc7180.c +++ b/drivers/bus/qcom/qcom-sc7180.c @@ -3,18 +3,140 @@ * SoC bus driver for Qualcomm SC7180 SoCs */ +#include +#include #include +#include #include #include #include #include #include #include +#include +#include + +struct qcom_soc_pm_domain { + struct clk *clk; + struct generic_pm_domain pd; +}; + +static struct qcom_soc_pm_domain * +gpd_to_qcom_soc_pm_domain(struct generic_pm_domain *gpd) +{ + return container_of(gpd, struct qcom_soc_pm_domain, pd); +} + +static struct qcom_soc_pm_domain *pd_to_qcom_soc_pm_domain(struct dev_pm_domain *pd) +{ + struct generic_pm_domain *gpd; + + gpd = container_of(pd, struct generic_pm_domain, domain); + + return gpd_to_qcom_soc_pm_domain(gpd); +} + +static struct qcom_soc_pm_domain *dev_to_qcom_soc_pm_domain(struct device *dev) +{ + struct dev_pm_domain *pd; + + pd = dev->pm_domain; + if (!pd) + return NULL; + + return pd_to_qcom_soc_pm_domain(pd); +} + +static struct platform_device * +qcom_soc_alloc_device(struct platform_device *socdev, const char *compatible) +{ + struct device_node *np __free(device_node); + + np = of_get_compatible_child(socdev->dev.of_node, compatible); + + return of_platform_device_alloc(np, NULL, &socdev->dev); +} + +static int qcom_soc_domain_activate(struct device *dev) +{ + struct qcom_soc_pm_domain *soc_domain; + + dev_info(dev, "Activating device\n"); + soc_domain = dev_to_qcom_soc_pm_domain(dev); + + soc_domain->clk = devm_clk_get(dev, NULL); + + return PTR_ERR_OR_ZERO(soc_domain->clk); +} + +static int qcom_soc_domain_power_on(struct generic_pm_domain *domain) +{ + struct qcom_soc_pm_domain *soc_domain; + + pr_info("Powering on device\n"); + soc_domain = gpd_to_qcom_soc_pm_domain(domain); + + return clk_prepare_enable(soc_domain->clk); +} + +static int qcom_soc_domain_power_off(struct generic_pm_domain *domain) +{ + struct qcom_soc_pm_domain *soc_domain; + + pr_info("Powering off device\n"); + soc_domain = gpd_to_qcom_soc_pm_domain(domain); + + clk_disable_unprepare(soc_domain->clk); + + return 0; +} + +static int qcom_soc_add_clk_domain(struct platform_device *socdev, + struct platform_device *pdev) +{ + struct qcom_soc_pm_domain *domain; + struct generic_pm_domain *pd; + int ret; + + domain = devm_kzalloc(&socdev->dev, sizeof(*domain), GFP_KERNEL); + if (!domain) + return -ENOMEM; + + pd = &domain->pd; + pd->name = "wdog"; + ret = pm_genpd_init(pd, NULL, false); + if (ret) + return ret; + + /* TODO: Wrap this in a generic_pm_domain function similar to power_on() */ + pd->domain.activate = qcom_soc_domain_activate; + pd->power_on = qcom_soc_domain_power_on; + pd->power_off = qcom_soc_domain_power_off; + + dev_info(&socdev->dev, "adding pm domain for %s\n", dev_name(&pdev->dev)); + dev_pm_domain_set(&pdev->dev, &pd->domain); + + return 0; +} static int qcom_soc_sc7180_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + struct platform_device *sdev; + int ret; + + sdev = qcom_soc_alloc_device(pdev, "qcom,apss-wdt-sc7180"); + if (!sdev) + return dev_err_probe(dev, -ENODEV, "Failed to alloc sdev\n"); + + ret = qcom_soc_add_clk_domain(pdev, sdev); + if (ret) + return dev_err_probe(dev, ret, "Failed to add clk domain to sdev\n"); + + ret = of_platform_device_add(sdev); + if (ret) + return dev_err_probe(dev, ret, "Failed to add sdev to bus\n"); return of_platform_populate(np, NULL, NULL, dev); } From patchwork Wed Jan 8 01:28:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13929934 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AF1AE77197 for ; Wed, 8 Jan 2025 01:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ffCbyZidm4yUSXcZ/TPGQgF5jycQyA1Mr5Btdy4Z8FA=; b=1LXzXpkQBMmXZ8mBGlq54X62PM oMsDEMoKPqlhpiTa3TVEvO7lt4fdgbZolkMxc8Tx3lhl64lIAMceMdS3ezdi1iDl5/pazYWGbc0ip xXEFsCEBg1GSbdvl3j9QiXOgDz7qmnLgUVjToOkRhZZEwc+tIg3d143trQeas9c+jpB60L26bTDPo VbzbtmoT5IVBoelQNCT//JeBBMzt0/AqdtjcjTrBPf66Z4ore6ED7DPGDTUC6VgV4FKG8fgjQ5VjM 9/gD7ctDfYDNX/wMiynVhMjiJ9TBvkMZKqnGuaBijJ49ZfiAj3lCcNVXTcVxFGhvaT1pXYaBra/g8 31smMQjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVL0i-00000006m6J-2yXE; Wed, 08 Jan 2025 01:37:28 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVKsU-00000006k2Q-42eF for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 01:29:00 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21634338cfdso25532445ad.2 for ; Tue, 07 Jan 2025 17:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299738; x=1736904538; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ffCbyZidm4yUSXcZ/TPGQgF5jycQyA1Mr5Btdy4Z8FA=; b=DJvLSgAwAJ4RmIwJ2qIQJF6v2bnGIfwOkPXHvqBmg/WGAu1jA9PSm6PjFZPvUBHp2b HOxWCgCcLoTfG2r4FDJi1LY0KDLNUgy7g2DLdkPhdcGuATfIeMNGKSmnlk2/iMyod/DN fRxmB163RSPk1GBtt8Om0svbfwdLPgMOOnGPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299738; x=1736904538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ffCbyZidm4yUSXcZ/TPGQgF5jycQyA1Mr5Btdy4Z8FA=; b=vhxUz6e5P4TM8bYtHiKQpMT51hkHsRa37xRwUXjbuv9wY2BhaVQS7rP+VFo11gG63E kHY99IxLvQGS1CQ+iuk+LHiSSWt+G4GtCaROVbRG6s07CqaPkdEw41VcfmmHRtz04HRq JytKu9k7dufssR3dyPw1W/JZ4gBJ+wE8AgJDxYoICYBJl0mcW/CDk7mpCpWxxGCBPs3o LCw9jw4nvJXzXeCiV4joRVzxd1PkEU4hcu0PBQ431qtb5nV3+ptg7uYQK1f1Rq+S9slG W1b/hJOG2e7Hmz4Alg0Nf+pGmtZJujdfzHdL9C9nR1CYmXQMb+FEM/pS1UyC6NFfCGk7 83Ag== X-Forwarded-Encrypted: i=1; AJvYcCXlkyjk1DeVPh4fKiGLwt8nSD7TJTwGd5TLkOCtr/ATryLnvQJw17Ew2XbuCUweLoNXphlOmUSixNs2+0bJQUvb@lists.infradead.org X-Gm-Message-State: AOJu0YxcArgzOQbtjGcXkrTX7ywFSl/IZnunyPU35KP/O6NaMvKxVmjb KyQxd0LLk/CRJsCLc5xookqpUcuObxQbW7EV8W77nKWw4KyZ6qil6TcJSjG5oA== X-Gm-Gg: ASbGncvLviogdgv4J/CbNbl4VFs/vybYhT1TjSBjJ/GqKeX87fo/CifM4XYjXTa/5Gi wGW99+zQKPVQ2ukwtUtzj/+D6t7vnziKLCZey9t6XRvKZy3RGfffQ3oMP+H5zhZx9P9MshBf8a6 /paNgoDSPLKBcMRe0Ygl5Qn7jTI17/iljzSzVLGwrKI5kBXepsBdVOZnyPem+B5OzqjUju2adIv y7yW3pFeN1hcB8BLcWVRbpRY8l+X9c/x+52ZfgbQZiwL7jlhBMN5Toy7/XvLv1ai6KW+IRVsdsU Jhd6+FZH9T32lnjZooBN X-Google-Smtp-Source: AGHT+IHCeMvnncVDMOJc7OiMB5lgPXTsD1S7AH7eB+5fQgbjHbeY0walQs9/plkYtVkogihuKxqjag== X-Received: by 2002:a17:902:b18d:b0:216:1543:195e with SMTP id d9443c01a7336-21a83f3f501mr14970345ad.5.1736299738102; Tue, 07 Jan 2025 17:28:58 -0800 (PST) Received: from localhost (129.135.125.34.bc.googleusercontent.com. [34.125.135.129]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc9d4474sm318577745ad.142.2025.01.07.17.28.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 17:28:57 -0800 (PST) From: Stephen Boyd To: Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski , Rob Herring , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Conor Dooley , Saravana Kannan , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [RFC PATCH 6/6] arm64: dts: qcom: sc7180: Add SoC specific compatible to soc node Date: Tue, 7 Jan 2025 17:28:43 -0800 Message-ID: <20250108012846.3275443-7-swboyd@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20250108012846.3275443-1-swboyd@chromium.org> References: <20250108012846.3275443-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_172859_003331_B47BA1AE X-CRM114-Status: GOOD ( 13.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow an SoC driver to probe for these devices. Add the SoC specific compatible to the soc node. Leave the original simple-bus compatible in place so that everything keeps working. Cc: Rob Herring Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Signed-off-by: Stephen Boyd --- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi index 76fe314d2ad5..257890a193e6 100644 --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi @@ -782,7 +782,7 @@ soc: soc@0 { #size-cells = <2>; ranges = <0 0 0 0 0x10 0>; dma-ranges = <0 0 0 0 0x10 0>; - compatible = "simple-bus"; + compatible = "qcom,soc-sc7180", "simple-bus"; gcc: clock-controller@100000 { compatible = "qcom,gcc-sc7180";