From nobody Fri Dec 19 20:59:56 2025 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47DA419EEC2 for ; Wed, 8 Jan 2025 01:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299734; cv=none; b=kqT9kavpBP+vdNZgCCraYh5kN/bJjigisU4z8SSttHLojV1jIgPTjJXz7j09X9t51+m5Ph7nsnceIpifHy5BWXipvO2H2Jsnf8YPNvjmJ9Y/AiNbLmOZfTD0l0sTga3LMXl0NMCgX2awUxBAIDkX+t/a3vLHN4G4KCWRjynjlD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299734; c=relaxed/simple; bh=t7arDmLNv1I8472tLkuO20WVqQ6j2EmCM9HKMORooEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sq7fNzsgR4ge8xBVzBSmdVK/GnIobv2sy8CA2zIgDVI/GhWEloPsLUbLmiyMn7HndcVCafOaiKWNkElPIlZDzoGRf8bvoLTYbfpz4FaD//Mtd1l2za+ZFkiOSiUHXa7w1LqgzLEKdEjVE847Yk8QkTemE6PUmpKDa8mKMRoQJk4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Q/6l7dEb; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Q/6l7dEb" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2162c0f6a39so6711215ad.0 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=1736299731; x=1736904531; darn=vger.kernel.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=Q/6l7dEbCoDEtJf+P6hdEcO29HBCnEmWr1MQefTl7/dD4DfPBci2jWJapqXIju5hhC ktkMFgvoFenJpgZ8VbWwKXaIR8dTLurgTUICOZKcvpDnZBw7+TSuUFS2ZjOsP3F31Y/m NAIeTGnDKjBS0zcJw1QyUw83Jn0Ti61uNjOF4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736299731; x=1736904531; 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=vzGK0ExD/vXu2vfnguDr/ShLQsTv5hmWg8ptSwGE0cnlstmEJllosqoW9wvZ6eRvXX 1yaPKSX3X+0zs0V/7t8CTDnM35lwjl1GIxHtD54NeRCM08qrXiZJToPFD6Qt8dNyAA/b A7bcQE0Qv30gw1ss10GfUjQLvkRv2vaj/H3yTQwUoedyaoaZo5NaSwSZXgZf7Fq7xSsR kE3t5NdhFHI4isrB7JmxtnhGM8xnmRY2FSegcDxYGoO4zgdC3n1HZIm7w1s+R5wL3wa7 +wxfIQQ8JRXqbZUQMh1her5Zh3tZzFc9B8pQ+08Irt11B+mo0JInOWmuEtzTyFHPYNaZ Bu1Q== X-Gm-Message-State: AOJu0Yy8999p892SFKh8UNc29TmTvHHBx5tGwbTG6E9zPvit000F1GbA GQbARFNYOVmcwOnkIGTZyf/PdqyozI/2bIkpi4ILJZFtJ77Dkkv/aoCbQaZ8Lg== X-Gm-Gg: ASbGncvDqA0JAhoBa7MWw37QFjxTk6XmYTz57Er4dw49MBGKhDptzC3yITPDCTitzfM ZVzVXONTVpV66u4+pKzsO4VWnyIsfuKXSLvO6uKsf3KckgYtiBkwFU9Jx1BR7U1/Bu0KrvNNq5z bltGDLAsW1trXh3D4saDdQxAnjpn9WTsSJBf0xMsL/K7h/KFVzHBEktAXvBMgXrbFRuTeR7gLMn Qct9cyQO3W3gqVUUAd3Zf4XkEbV7VNSs96gPlO+PgIoDk5sXCfUVGiY7LgJ30wNgjlxTFFt6UN1 sGqJAsdv86Fm6APr285v 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=20Kleine-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=C3=B6nig" 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. =20 +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" =20 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) +=3D vexpress-config.o =20 obj-$(CONFIG_DA8XX_MSTPRI) +=3D da8xx-mstpri.o =20 +# Must be last for driver registration ordering +obj-$(CONFIG_OF_SIMPLE_BUS) +=3D simple-bus.o + # MHI obj-y +=3D 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 *de= v) +{ + /* Skip if it's this simple bus driver */ + if (drv =3D=3D &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 =3D &pdev->dev; + const struct of_dev_auxdata *lookup =3D dev_get_platdata(dev); + struct device_node *np =3D 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") !=3D 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[] =3D { + { .compatible =3D "simple-bus", }, + { } +}; +MODULE_DEVICE_TABLE(of, simple_bus_of_match); + +static struct platform_driver simple_bus_driver =3D { + .probe =3D simple_bus_probe, + .driver =3D { + .name =3D "simple-bus", + .of_match_table =3D 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 =3D= { =20 static const struct of_device_id simple_pm_bus_of_match[] =3D { { .compatible =3D "simple-pm-bus", }, +#ifndef CONFIG_ALLOW_SIMPLE_BUS_OVERRIDE { .compatible =3D "simple-bus", .data =3D ONLY_BUS }, +#endif { .compatible =3D "simple-mfd", .data =3D ONLY_BUS }, { .compatible =3D "isa", .data =3D ONLY_BUS }, { .compatible =3D "arm,amba-bus", .data =3D 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(cons= t struct of_dev_auxdata *l return NULL; } =20 +/** + * of_platform_should_populate_children() - Should child nodes be populate= d 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=3Dy, in which case the simple-bus driv= er + * (CONFIG_OF_SIMPLE_BUS) will populate them. + * + * Return: True if child nodes should be populated as devices, false other= wise. + */ +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]; ma= tches++) { + 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") !=3D 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 *b= us, dev =3D of_platform_device_create_pdata(bus, bus_id, platform_data, paren= t); if (!dev || !of_match_node(matches, bus)) return 0; + if (!of_platform_should_populate_children(matches, bus)) + return 0; =20 for_each_child_of_node_scoped(bus, child) { pr_debug(" create child: %pOF\n", child); --=20 https://chromeos.dev From nobody Fri Dec 19 20:59:56 2025 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6FDB86AE3 for ; Wed, 8 Jan 2025 01:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299734; cv=none; b=Tk3TsO+BrdQUhQ7MSDnTIWjlSpCsJRGeQSHSsVefbdTkKgR8y9w8e1xn7ryC/5cJnRaNC/zMti/7RuwN0usRFEOOWwYMHMSDoMcO9IwbM92uY3WVJKEmYGUsX9rcEYbDuEKxCIQFGgRrzHOMyQXTfCwhixVKDAnmiBO1GDtY6Ao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299734; c=relaxed/simple; bh=HLeXh7e3GjhFtwyj5udajVxpHq3OwLVCrig2Syvg2OQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mC3vdGptHNM4PIUmlHykA0L8cIU8UbZ0zv4RV42FtMjJvtkZigmRjhm3KwlPpomm/LMvVqZ89ACHMchlYHj+rAPt1tXwQlDioXIG+b82NOYpxc+pvSy40PjCUdwP8F+3RT/GI7KhW8xW6OCQH+VKARi2gWksda5mNUn3cFQetBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=QEJMY2w5; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QEJMY2w5" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2ee50ffcf14so562598a91.0 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=vger.kernel.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=QEJMY2w5JAwZjsW6Inya573rCUnWJc/5YGzWbZW69ZPiItgHw86ZsTGh8fZSFiJ8ZF zILesgDbW+a2GVHrVNB7R8OCE3udjUqAxEnRBz1ccKYyzX4X5Y25QWVgmF8u8MYedY+p 6yUwiR1qBzkMR+vwgWYBLydvclg+PAsxXTypI= 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=PUiR3Bgv4CEK7nP6ctqCMbWGU/tWFE47LG7n6x9/o9OAcKRKkaLYrcVT69lXsu30jO nbv+hWy8rvILbY+uVNDoKFTb7cfv6z1dB1IbqGU9fRFSi6bZ8zw89dR8FNTJC60eraOG 7J8B1PNL2sEI+MF4jkUPIkW5IRe9t+0FLBK8BYkL9L+HRHJuRfMY1KTb7xgs2M/Fcu3l d6BP8k5c3GHPOHKQfqKnq0mPH/zntETXK59bEwkPV65pynWBsesXOOlOBXXbdiLL7LCc HFcNYXd+n60bLTPPJwIJ0fEwohPxp88t6qvKxwW6NgD9s/rNoe/uKFJT2fNnBTjY7RVV IhzQ== X-Gm-Message-State: AOJu0Yxx2tnoqQxKLj9DA1kNY3xrKaqDfg9XOKaERmCwjEXXrt6G9+Uq iljAMbTrhaJVjyQvAyvfJA00dxiXq2JPbDz7U+hVE9NlG65VrRwCodLzRyl04w== X-Gm-Gg: ASbGncvhvMRqpuhnfvOD43vk9Gmc5Ckz/LQ9rAltFByeRP9KsLonSoqttYfeUfoSMX1 KG4NgJAZpCcm3gVSesb6kGpcN1RXztGa+cXJ11hgT6mIZ1mM/jB1YDaCgNAaGInuEQGDfL0il/z jnvhNtG1SPQknKbN5pNQfbBj3Vwq55kSkbeOgSYMc23n09E41Sa4Er9keJRL0XKfxFqKQKWQ/mS lF67iXgMGzSNKa2sDjxRD6kxRmvDOfachSRS0CQVCNeVGvW3wk5goq/gHexw9MjbPO5mYWHpjwb 8a9hRtl4DMKAwY2G0zVk 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=20Kleine-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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.y= aml diff --git a/Documentation/devicetree/bindings/bus/qcom,soc-sc7180.yaml b/D= ocumentation/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 =3D <2>; + #size-cells =3D <2>; + compatible =3D "qcom,soc-sc7180", "simple-bus"; + + // TODO: Is it possible to ignore the details? + clock-controller@100000 { + compatible =3D "qcom,gcc-sc7180"; + reg =3D <0 0x00100000 0 0x1f0000>; + clocks =3D <&rpmhcc_RPMH_CXO_CLK>, + <&rpmhcc_RPMH_CXO_CLK_A>, + <&sleep_clk>; + clock-names =3D "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; + #clock-cells =3D <1>; + #reset-cells =3D <1>; + #power-domain-cells =3D <1>; + power-domains =3D <&rpmhpd_SC7180_CX>; + }; + + watchdog@17c10000 { + compatible =3D "qcom,apss-wdt-sc7180", "qcom,kpss-wdt"; + reg =3D <0 0x17c10000 0 0x1000>; + clocks =3D <&sleep_clk>; + interrupts =3D ; + }; + }; + +... --=20 https://chromeos.dev From nobody Fri Dec 19 20:59:56 2025 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E4DC19F117 for ; Wed, 8 Jan 2025 01:28:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299736; cv=none; b=H98EmXDmIAU9VW7/GCw48fXIXIiX0V4Rpsc165nGiWjp9vxccZQF75yQbu4dp07i2n5TiR/9bAFSzMgNF0qt5lcdD/NkbC/aQnkq0VnnvLjRSsEnUI3XewZRY/XINftBM3cq9K01kVQNTmcjB/9WMoFbHbFDTNoo9BesXW9Dr+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299736; c=relaxed/simple; bh=U0IWbkSIOHLV0YE/NKEsZZohQ07wjFpip/mVKrtIjDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=asYZ2XAbPhhkrdbmDkovQbJ6OLeR877KAKDyFNkJBW9SIDVbAT3TXrV7m89RiiH+1IRsKbMzG3hF8yhc5ucKPI9ZxQHXPYKNRg5IvqZlSbi4RZP53VigZygispxLWL2vAYel8nUELzg0JfRxS5ssCxogeae/ekZQWzXn15ERmVM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ROiRUwi7; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ROiRUwi7" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2164b662090so210846395ad.1 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=vger.kernel.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=ROiRUwi7G8ugpinRv+jIGeE5EeLbA3lIPkgsdPvFJrJHyJQkXBj9jbmjw5s1uBjYpZ wKQ4qbMW3hUXbo9laQSV4+pp0nAdX7KuoAcBbXqLKxC7jtxRW6Fra8IFt+SA3Pvh14gD lLNKmo8bXVMZHNEOY7HPBBAeBTbx/WM+wtDAE= 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=S1jYfNJYe4Qebsfw0L6MzUntu+wPShSr3Xq7Vj/zRGvBV+uZQoH2ibKvuSdAaR/JY5 F63d5QfTPgIn7vlI4muA0GJMgLuO06FVwR91HrVhcdv3U+/9lb0P3roU27miGXJ/F94Z uZ8ikaxkVo7omxyIE+9x/1COE2CXuJIS0r3h8H37YJJBd5ZWFHLt0okKIpcse4ERjtMH mTLUJHFGBPcxhRSPRBLuBLYPoYsrMz6MXaPzZKILcgSnJsK3+88UdeYPmvI22V4HSzqA KP70HrSy2cxYEaQGWOSwzPzHgEPHHJbxU8dQwM8MU54MbxtYJoy+JuraFkqmiGa8qhqs LZxQ== X-Gm-Message-State: AOJu0Yy2/ivBOImqb4G9C/N+EJmiCuzRsqqBY2+xAs/60zYfZkshR4Rs pzgi9VO3X6ryAZgwgT6VrcDnQ5IFGT3sOQM4YMx0rZc79AHzVA3pYC2bzs6ZUw== X-Gm-Gg: ASbGncvWCrPb76VZPiOai+SUPilNED2ar0tm+j7OQTCWN3rxBHjx5ZxDKu6w5e0RpVd c7r/fFHIohKnL4ijo3ROou+8mE2FB5YijDTkKdbel2IZPMLIDax8EAblWMUjkvdX+4NjSLzUhVR li0Uig/gOBleA7dBpAlvjgayes+vFy5phcapztkr4UxptHHWVhTwKhTMvHlFSatCS5nI0tGxMl7 ZfpkqFGHPHDWKALG+op60BbSX+C8TCOwjRoPVy+1fkEYMpgJEwEwRwxBjstdPC/DQ+EA7wDapTs Fiqs7+4yJ8YZKQ7FaDNV 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=20Kleine-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. =20 +# SoC specific drivers +source "drivers/bus/qcom/Kconfig" + source "drivers/bus/fsl-mc/Kconfig" source "drivers/bus/mhi/Kconfig" =20 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) +=3D vexpress-config.o =20 obj-$(CONFIG_DA8XX_MSTPRI) +=3D da8xx-mstpri.o =20 +# SoC specific drivers +obj-y +=3D qcom/ + # Must be last for driver registration ordering obj-$(CONFIG_OF_SIMPLE_BUS) +=3D simple-bus.o =20 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) +=3D 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 =3D &pdev->dev; + struct device_node *np =3D dev->of_node; + + return of_platform_populate(np, NULL, NULL, dev); +} + +static const struct of_device_id qcom_soc_sc7180_match[] =3D { + { .compatible =3D "qcom,soc-sc7180", }, + { } +}; +MODULE_DEVICE_TABLE(of, qcom_soc_sc7180_match); + +static struct platform_driver qcom_soc_sc7180_driver =3D { + .probe =3D qcom_soc_sc7180_probe, + .driver =3D { + .name =3D "qcom-soc-sc7180", + .of_match_table =3D qcom_soc_sc7180_match, + .suppress_bind_attrs =3D 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"); --=20 https://chromeos.dev From nobody Fri Dec 19 20:59:56 2025 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4C0D1A0BC9 for ; Wed, 8 Jan 2025 01:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299738; cv=none; b=BHAPIg7XBwtMHxZBVVhUHMlK6EXo9k7vcmfI6JgH0Rv6aLhvceucesWyuZPUt4MLffDYkLv2Zsu/QxhyHMWMPt2/PzpukmyHb/ZHEa7cR2Pdtfpy/nUkKnXQxSaKkjxsiqzTq+gA3JgngnKakRBB9Gnyufd0M5ZGHEEAU2tVRsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299738; c=relaxed/simple; bh=4tV3lnlihbjKXefUypMNRce6dC18x2ab/02qc1skGvw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nN9emu/EN+2Tqne7lkXnGKVqCCc2XKCAwD/8TcXQLiL3Hccqq5Hc+uUpnhdr6kL6fvJQM4702Fxp1HPp/kVSUhnFXxS8nV5sG59ZXgcmW/mJ6UJ1OvmMfmOWgnVo8md5+0QxVKq1+hABUyCGDPEjcRWDZGKx32OwHTw87oh6CIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=jeUhedi7; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jeUhedi7" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso19426208a91.1 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=vger.kernel.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=jeUhedi7/s9vN6UXJTOMvaZ+0hVG1cW7wzd65GXE0qqjZzy3l3VqrhyVcM4iAujUU7 NPw6De5hcs57pFB1HvmTjRCZyN/7hI8pLTa/QExNL2LIamZfidmgOysJl3yvd4PMI6IT hPA3JDe0j1YBFzxc6VDPrWZNYbLGaR5/bOXo0= 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=SfI/+83WoRtHHHjPYAHzT5dQ7nKy6MJd0r14uAj+hfK8C+XPUje9yRUcCkmPypDLTH Uj0xrV5p8yIBMAdN1dmPbaRsOy6hxy1nVgtHhDk7mu+hm/ujUoRvkqJSS/4TdngjzMfH +X+8R7t7+JZYRpXMq1nFIDyUq5HQlZMSnWYx4YMr1KgKDQvZYl4rBWGwp3VexeLOeBqq YL9Gx1MbSJsL24R93KnHasTCcpqJ99dAA2kF6X6ud3vMwGmgVNTJs8XDxmAKXZ3pvpmG ydqoIbdjGPrnFd8XruofX+3MJ3W3t6jGqoldJhuoVb2QOmc9duXIfdConGZ9Dh0efejg Mfrg== X-Gm-Message-State: AOJu0YwvHVTtn8kImP1OR0uhuXcVW6el+FMz8q3X1d2xfIl8pAbAm1wu D5eXghJDPTbMJ6AGdM+OjqWa7sghhObf8RR2XyDqLsEzY4sa3oSyJ6Yp5jPr5A== X-Gm-Gg: ASbGncu/VwhNysiTc6998bV6qbgYXV/QW53i4ox07juc8YwZQWiRJjuylRJpUOCTb7c 2JKVumBht/yBb/f4opLxuaEtcn87aFVRaCJy3X2k5ny7ZxB//+FUaTTEKHE66/Bws0WKK3tbFaq GwCayrFWKs4hQG8AtyIbz7RgdCwWsQhSuxc+oS9d+1WAs6YVK0PeQWBWsZZUYN+FEwVX/1QW9/U f2OypLRTv4cYYLgJG93jW5GFFe+zDSEEl3W7CdkUxiTkwI+vnIvL1tw0FDlaDtDp0497WJKv1J+ PSzpbb1T6wppKL7Gsjx6 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=20Kleine-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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); =20 +/** + * 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 =3D of_device_alloc(np, bus_id, parent); + if (!ofdev) { + of_node_clear_flag(np, OF_POPULATED); + return ofdev; + } + + ofdev->dev.coherent_dma_mask =3D DMA_BIT_MASK(32); + if (!ofdev->dev.dma_mask) + ofdev->dev.dma_mask =3D &ofdev->dev.coherent_dma_mask; + ofdev->dev.bus =3D &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 =3D ofdev->dev.of_node; + int ret; + + pr_debug("adding platform device: %pOF\n", np); + + ret =3D 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_cre= ate_pdata( void *platform_data, struct device *parent) { + int ret; struct platform_device *dev; =20 pr_debug("create platform device: %pOF\n", np); =20 - if (!of_device_is_available(np) || - of_node_test_and_set_flag(np, OF_POPULATED)) + dev =3D of_platform_device_alloc(np, bus_id, parent); + if (!dev) return NULL; =20 - dev =3D of_device_alloc(np, bus_id, parent); - if (!dev) - goto err_clear_flag; - - dev->dev.coherent_dma_mask =3D DMA_BIT_MASK(32); - if (!dev->dev.dma_mask) - dev->dev.dma_mask =3D &dev->dev.coherent_dma_mask; - dev->dev.bus =3D &platform_bus_type; dev->dev.platform_data =3D platform_data; - of_msi_configure(&dev->dev, dev->dev.of_node); - - if (of_device_add(dev) !=3D 0) { - platform_device_put(dev); + ret =3D of_platform_device_add(dev); + if (ret) goto err_clear_flag; - } =20 return dev; =20 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 *roo= t, =20 #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_nod= e *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 devi= ce_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 dev= ice_node *np, const char *bus_id, struct device *parent) --=20 https://chromeos.dev From nobody Fri Dec 19 20:59:56 2025 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 392FC1A23A1 for ; Wed, 8 Jan 2025 01:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299740; cv=none; b=jBnGA6MiXB+cA8NQnpDNrCme8as7PLfkPWww8xGQ3eBNXKz86Ve4dLrvJo0WokSU9dZqKA+7+eb0pmVoBiP4ZSNx24+ceVfvqDkWcfhv7uACbVnlC9TJN5gEoZxXUiN1dZIU+Mt6R/EJ8d2ncL+4ODAbIcRn/ZEPShmyqRJQnbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299740; c=relaxed/simple; bh=ZPZ1RvYh2kO8gp/HE4ITCITiJwPeiYCbTgy1PyW8+MI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Px6q4ZpEqAmcvmPNBJwx2+wrcfMYQvkqj44DwR5i8fAzVuYDwa+WzkLVYLKlclxCMeDVFuOJEi/uxpx06gFlKZUll7W45vGuiqf52Z60dat/aAYjdB4+nUUg2mUEd071hGf88s2dbs3UBFHLHxfI82Vm6xa0wBYQr2SpCvnpwus= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=HVHkSb7G; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HVHkSb7G" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-21619108a6bso223784565ad.3 for ; Tue, 07 Jan 2025 17:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736299736; x=1736904536; darn=vger.kernel.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=HVHkSb7GCWVl72WAHK0yvON8bJx6LRgWGgSl/8iNsxIFwVoUasyEFUf2PxNRDedGeQ FosZRJFn201HaCn4RV7sRL+GU9fs52Oj8Bdhpq5sjYtUFPlRcKc5JeZdPLoOM1LbICCf 94R2xCJ8OCC0qKKJ3Biu4oPr+nYQHg2AT9TOE= 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=Lz9AdYIQpbni4yLXdhvBYlL15wBntQq9Euy1umx5owuJjl0a+LU+91JUp6fAtddR9v XakbAQZyOvSpgQYkgy8FVAaG6kOVa3D29bd1bJwz+nEDPCXex/B4frSk8BXuj8UhO8lS tNUZvN0fAWlFY5QhPxvVSxY3I0dCmnZWtzJw5tIg1tCgXPZTowsycFe/vOxatEUQSJND JqMsjOjY+BzEUvIzG9y8JTd7+DtUBflHSCdAVtr4b+aVB+F+ArZUh9Ty5ulodZEE6d32 yCEh/cXF0b779VJhwiGYx8XkNScR8NfkpucmMw+hEGX8xEzZ53m5S0xW2NmatuIQxbIJ wKSA== X-Gm-Message-State: AOJu0YyJaAuU9IZazgqclnAa2cVJ7gTQWakHclitwd5kWbsni0eiWOie wzZ3q/SEbcVuapsRrTF5annbZMA1Kx2x6US+wzMrOxg+529X1QQCQgg7qnEtlw== X-Gm-Gg: ASbGncvtRiMgY9wmePLd8GbEH6UcF/3cGDJeZ/CRpfbcS1A37ssG9Cjz2m3hiqxkQmm pn13a3NwQTZo3m0pSpzQ8XZqsef9C2gqYAw1xxn1u+HmTHvaCDcLrflxVniedKi3gZcsyWlE8BK k1+IGIp5SlSWfJrNFlDu42Kwndw8PSE4r7t0Wv/S8up8JuQdG29yXxMvUkLOSNVu1k7VFqKjbj7 d3zzSmg/cmJqXnR/fhtiCUlkA/RyoqmsMJWY3xzBsALmTga5Mem3/PVxAf6iAxEbng4f2TA6zyo W75DtPHnI+MlLjvSxV3E 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=20Kleine-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 */ =20 +#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_d= omain *pd) +{ + struct generic_pm_domain *gpd; + + gpd =3D 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 =3D 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 *compatib= le) +{ + struct device_node *np __free(device_node); + + np =3D 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 =3D dev_to_qcom_soc_pm_domain(dev); + + soc_domain->clk =3D 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 =3D 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 =3D 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 =3D devm_kzalloc(&socdev->dev, sizeof(*domain), GFP_KERNEL); + if (!domain) + return -ENOMEM; + + pd =3D &domain->pd; + pd->name =3D "wdog"; + ret =3D 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 =3D qcom_soc_domain_activate; + pd->power_on =3D qcom_soc_domain_power_on; + pd->power_off =3D 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; +} =20 static int qcom_soc_sc7180_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; struct device_node *np =3D dev->of_node; + struct platform_device *sdev; + int ret; + + sdev =3D qcom_soc_alloc_device(pdev, "qcom,apss-wdt-sc7180"); + if (!sdev) + return dev_err_probe(dev, -ENODEV, "Failed to alloc sdev\n"); + + ret =3D qcom_soc_add_clk_domain(pdev, sdev); + if (ret) + return dev_err_probe(dev, ret, "Failed to add clk domain to sdev\n"); + + ret =3D of_platform_device_add(sdev); + if (ret) + return dev_err_probe(dev, ret, "Failed to add sdev to bus\n"); =20 return of_platform_populate(np, NULL, NULL, dev); } --=20 https://chromeos.dev From nobody Fri Dec 19 20:59:56 2025 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9EAF1A264A for ; Wed, 8 Jan 2025 01:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299740; cv=none; b=i0zOnhpZoGQxPqzVz5YLwZDESeH3QyG3JV3Eh3FX79yQV0DaZa0ddoRR5WikoP3x9Xtnn/cW731nwwr5hVDsr6uls3Pl4/KmJmqBV4z3kDN+qqUwHElbN5+nWyvolleh7sXXiBdRPx5OUZcKOiHFEM4G0oCENrYgaq4fS5RFWSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299740; c=relaxed/simple; bh=5zubYY3zABlZ5Mj79nxt1+Y1cBxawP+c6+xykDpJnXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gefxWVLz36WbOk8dNX0YJlT25dx03jlSKMdt1HtEPGTeJ2bt82kK5yUfzirHc55picf79azsPX7jnbgzmlXyF3JEkhanhHGIUnCShxmUf4VHftXIbWmiDEaWeR1x0KhuaYc0hGVI7++iEyt7Cb4Ry0i6mT3fJvnqkUUkU4Jz62k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ff6CKKif; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ff6CKKif" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-21634338cfdso25532435ad.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=vger.kernel.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=ff6CKKifk6rzvT7CB+l9IXC57TTANSF2rUpoGziP0szUnCmoaWxCOsYQoLPnKlBI48 kwOu1lF+wPKc4j7ZtCI78o1OV6Rkjdt8k8+m6FT1kpOwA588BvMY8Pg2Qg1C9pScf7dF V84N98MN7ocGSbzs9lfIGt7KubA3v1plKM8ws= 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=JTCuzyOrCzScTfD7hnlpdNjaFr+DcrkUt/ODyot0l/yGfGcaCuE/O+yB/+nE7AbWmv 7vEY8knD284HCcCgk8UptdKOmc72cytaU2RV6b4HqQ0U1tGefgiAVsNl2QT2dEvD/kDz ee/Pb1XbxftndB/ejz05t6Xt37faUkkmegmaltq1Ixai/tQ+fDVZyNY+4db4dcGlKMpE OeAOu1t/boeQckO2Mv+/LpIeKyZc1lNvwMIbwuoy0CaY4aKU6PSyfbQd6HscXYy85iMc v/Qu8g5Mx/kDvAnjUMHaWS2vLvOLgFbr/Re2WOQHNbMFSzhsoANDyvX4UTQ7youQLAu3 zbGA== X-Gm-Message-State: AOJu0Yxb0V21qJkhqhlp9tjTg7TwNyb9OAqZgaptpiXCc7ijHghBtdSK fAb4m9ocQHEsLjIIHgJ2W1FAHPArpExEYVvpY/gy7Qj45ZZZU/MaLbo9Q3VfWQ== X-Gm-Gg: ASbGnct6zZUL5LBuBN/91bDZn98aGT4KfZVqKv7AGAVylURQVmjPyVlCMtlzPe3nHkz xxoJeZUeB86jJenlreOe1hs8sA7z0QOLKBk5GVg+m+FwKt914izpp2f7A6PsV/Wu3aDEQ8JrcRK I0V+imLjO4yLa3zgT1416KD69GOTdPG0g0TTOKBApkYBFnMcSzBm6GKweOVNUidXasKfN8HFkQI 67WgGBwCeE4uzdyvMPB+cEq2xIikIqOwYymXUpJamvP5JobbbDl/1Mtp/aHm4vO25Kj5Ui4Y0nZ FZXE6oNTRwV767Dd4ro9 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=20Kleine-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/qco= m/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 =3D <2>; ranges =3D <0 0 0 0 0x10 0>; dma-ranges =3D <0 0 0 0 0x10 0>; - compatible =3D "simple-bus"; + compatible =3D "qcom,soc-sc7180", "simple-bus"; =20 gcc: clock-controller@100000 { compatible =3D "qcom,gcc-sc7180"; --=20 https://chromeos.dev