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: 13929915 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 483D119F10A for ; Wed, 8 Jan 2025 01:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299733; cv=none; b=VoYPpgrPSAcEg3baP/fQAPfMm3/aJiA5R7qJJ24rbVSj0Jbz8E3rugebpqiDF4zUUQ+/ra68eo7B6inHOHDH+sXfVwcagaCtldzhL51gGwfxRIhYqdtY37J2yAeEmfZothCNChSio18ux2i8W3uOWBiL/RGVeX0F59Sg7tZ8po4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299733; c=relaxed/simple; bh=t7arDmLNv1I8472tLkuO20WVqQ6j2EmCM9HKMORooEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kJqxRoV9zxOCyzkWw8ilVKAvKOj8mKcQM1SUP8hB/H/dnEXoQRu1ahNo8rGsHcAQqjMlfqiY0X2vsU8l/ooPVPAOUi//q8PiX9OQx8qIbycYcVzO4sNWsAMUg2KErwj3cH+lD2Qrjj9xnil3S4lMDaAtiQEhmNZps+fRB1d6OHQ= 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=eYM4wBkJ; arc=none smtp.client-ip=209.85.214.174 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="eYM4wBkJ" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-216395e151bso4743245ad.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=1736299730; x=1736904530; 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=eYM4wBkJSJQgmyrIoqvJgIxitDPlgkGG4ODwZvCKrSgBSStjVSelXScXVN1kHg2VGH jIQxDCAp5K8hqa8b92s5T2Yj37AiRAG3UFXAxGCLWvmFR0lfzDJqP5IPMXbzRZ66wsnG 4ypNVdEZnN5HX6M1tLxW2MtNsEQSDZKDn4KQU= 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=UrSzs74bOuDbuk2NGW5nXyicI8zQHP3g2xlTcfto588OuKVLSFOxFMlpzyzdim7hjf bGwUZtK6RFKUU70M2MUU4DDQwnVkpTIJ0TiFQfPkrgRjwS7HmXsSkn4NPJQQAbfOzlhu BOV0Usix4nljFHykiPYRaD5uqvLEMJroLRZk/T3QrRMaDbQNbmdUHvtnaA5MMcz7tXI4 lkcJWsjXXs3t3Qdvh406vdOhNTZWn91KBI1tJHPt7On6iGe3fBAD3GLLm8WX4J70CNqk V4074X0QyFtgKbBffCyNYcMlFL8EhDKJBLgLEXZqN2ZH4Q6frpAy90YgZ9ikvlRxQohZ t/ZQ== X-Forwarded-Encrypted: i=1; AJvYcCU3atuDdI1qJRezkPxYTbl3dl3HIcWi3Bvk74CGmLEOwOB82IHKATSl7TlgyaSKFatC/ehmunntREO+M3fJ@vger.kernel.org X-Gm-Message-State: AOJu0YyRfWJNFGOM48jmP1WMG3ZzqNDvopDAKdiWNjSpGEVHzap61ZyB BI3PgKzwwt+WT2BffD+WHrEBhu+K1hwo7w/LircrnIcbvCRsi+tMSBtCiOiIEg== X-Gm-Gg: ASbGncv2JWi/ehtJOuNCldL/Yyjc9uXocVHB8ec6RjycoHUohIeg50uJzWYYHGp2kZT wiHZaYhszzjJADBamtl5EX+adwKouI6jZe6ELUwLfVCVIlz7s/sfYYRpOxUhLjpafaF5gBC05LU 45vx8r0OR98T1Y4jikQG3/K5kOc2hzYBto/GLbDS5wgPTA4C2B+pnFTXCmUZxMuSqy3IdlW5Mt9 zZGByP4dLoG26CvOH4jEjxz8cTqs5wsyC2EVfw3CiV9QtBCgSFIELgBuNmRoQbbbOcFsSauQePI MxXzruu61fpMLXA0SyNr 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13929916 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 C817119F421 for ; Wed, 8 Jan 2025 01:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299734; cv=none; b=Q3EKzO7AWamvzLC/wn0FLCMjU7u+7vPeqrPl43ymf6h1LBlV0LqRozZgKonJmFqWDnEfx36KuG9kzdEZuJfxO6M5GP+Z7PSsdBrT4jG/R3atfpFJwEjsbDrxZStDCGueI5/+sGQNrtqOWZejDRZEhwNfN6+AFUTrp925s4eUBLc= 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.41 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-f41.google.com with SMTP id 98e67ed59e1d1-2f13acbe29bso533915a91.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=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=Rjh+BbXvBkDWDgEeBFVLbJPUiD75rt/+okviQ+rzVpq8HrhDi8CFqUJQuP3a0nIewa 4dbuE4ZWjK7GbyJrhP3GSyP6M25jBs93q9mqtWPo2OFC68MKaA0UYFj0bVbJzjoFE7wb jT7h/sMA9ZeZ2sRA76+oAR7ExlcfFe9J6+bCge2xStb1CQZfOs+UAW9VzVFhn+05CfxK Oy/ZApHdQtRZRdVsou/SZW7mPg1PfRuS9l2syAasJCzGY3V95ZUxsnGuAZQS+xXhoGQL cnxzkOyvTOX8K59bjjh0UGBOBECdVaN/D0odYphHeeO2dop1XPKwAj7rvcm8o3CSz/bx JRrA== X-Forwarded-Encrypted: i=1; AJvYcCXtB5164aA3wkhCo3oyJDJMivvSVJMQbCkPssYDaaaCo/rswzP5COeWdJidut10H0yfcaW/o7R8r1c/MfZw@vger.kernel.org X-Gm-Message-State: AOJu0Yz2hN59VsXHx3KFTHY0nzYHGk2qIdBT7lWvADP2xH8H7DareFHk OiP9ycgq5hRIMDC5I091+LNRX34vKSMoLzjc94hAj/jU+sx6mKqtYCA12wuMew== X-Gm-Gg: ASbGncsp/sppyD5K9KdVOC6TaRoNirUDgCsTEPds9VkIAZ4hb02EKH9n32T47HIkYRZ w/HG4juvnEGxkaxfXVSlZn4oiYwGiJpznyAJbKhqlDD/v7PCLOBW2ljdVhyAFhwJNOnv2D+Yfbt fuixC2LZ+OORYJ/11pzb7+Yslq4WDtzIrV3GfgcNsrShRUlVwIUM/vHpzYy3FgUDPzZrQ4jZMRQ gLEkS9RGaxClyftg1ajpq4IYKRSisqmNNHmpqXBSFBXYg23f8iuv/wyt4SY3RGqk+lhHEgW3+eU CQmci3MvFIcIZlZClS88 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13929917 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 2E52B19F487 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=1736299735; cv=none; b=j1baYR8ETnWFnt+j+/fv47/fkjAyTRxAbni1lmmPZv7qPls4wWbRwZ7X13qZdqumZmppLU7RIS3WZhxeku1D5Ja6mmSxdE3ust5koQUj8EQMyxXrAdMcaUewvF2l25JS6fxoY8GoMAZImgfMAFf+aVQsvRPnLsBKVmJ6Mx5opXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299735; c=relaxed/simple; bh=U0IWbkSIOHLV0YE/NKEsZZohQ07wjFpip/mVKrtIjDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uKZdrIq+X5nEtFOm4EFVxWjUz0cFOzW40400hofqz7nDSthkmk128ZvHEP28493ytHB+2D3SQzmFIvyOEQUIVNLICfBfKU3m8m4smnnhgk47g2reR6dBgX7LW8BR1be2RUSrv66UUKlP3zTyh5Rv93YV00xRlTqOk4Hc61vZK5M= 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-2163dc5155fso236736605ad.0 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=USd0d0VIks4weBOCoS4Zf5K+STZ/IKmLtZ3DHytkONK89MDLZN6IABMhaL93U4NkLL dWzp29Qj7LKhCqj3R6sr3zauEJsWAAqsy/+4Z1iWsKO6bB/vBiR2MaxlDaOKG3V7kqZ0 CntzELs66y4tan2pcWUWl76NDS/PV/6Una/s/8Zn2Ygy0Dz2Ww/vMlfstiGe2p++2XGP FllCAyAzwb4T8Gsd0xC/eRmyKsl4a2UEMKy3J84rNCfOz9WDxDeszDRx/kdqxrAJkz3G kvbj1WMvJ1hLDZp0U9I83Py/oKgQhbBSqZvkCq4O0hhBjGVFOzmxzhq31zhVZgFkyyj1 fxCg== X-Forwarded-Encrypted: i=1; AJvYcCXqVvdlN2fjwRTzoNPpZ/uMLI+RO3wK60wvrS5zVul7HtwfKFfJcR03OAoCZFhw6QdYQBpfwaXORh0mNRpc@vger.kernel.org X-Gm-Message-State: AOJu0YyoKXgF7mNdv3VAFfNcKiDnAGdjYy52z7pRdbKkwSOmyhgnns28 EwmJwDuDebCM70CY0B828lX4u3dWUPL4DbB6OfA6LF8Hcp1gjaXr8Jr4b3ySQg== X-Gm-Gg: ASbGncuyt89Yg2QamsdLv0fQqYm20WRDCqclhXL4bxEjDtpgjPz8uS2rJJoV/E3ZhEO +89PGAYvT5+xqXtME7gTf9fEuvemeuYRGhLAnRuvHGLNSpz8bOK+oMYYVaJt5ad6owC5WB1iOih nRPUs9a5P45TXBJdS7lZHzFoOZW/RBf++w1Kl94greSgNdwdQ62aLXW28agt0JaZmhbku72PPz0 dRATMRGLB8BunpoUHHTVMGa2y0EwMtEdTG/NmBj55CqbhsDDJn0aiv8DrAl49+Chb7lqlIGZasQ BOXQWP4hKAgBrJg+UwFV 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13929918 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 C488A1A0BC5 for ; Wed, 8 Jan 2025 01:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299737; cv=none; b=XUhHWvQ4NmvNFveS+QQQ/tvFzOvkv1R/9qutRzJqPckMEelxSD1WZZWC2smllNjHRBU+8W3e5QdA7H6iXkzgA15YfOkqFXnLZI41WFnh5x4978yDUwF1tJ8wmSrtBl66WqKYFQQQa3Ys5tZvYLpvwjnZkQH5411p+oGjKq0eefk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299737; c=relaxed/simple; bh=4tV3lnlihbjKXefUypMNRce6dC18x2ab/02qc1skGvw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DmvgQRWUC+7WObZICXRiWQ0yZ5LmUdOdmAW89R/r+6vjiW0oBiVQM+6S1/9hH1Ia/aWZVDGGuICguUtTfVhZl8WecAZXU6fkogzkDSFb0oOEn/iA1OfwzBUkVJV2R3dgCZmeovgig1TcbtH10YdfM9gWqETgnX9PMFy8TLGYlII= 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.50 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-f50.google.com with SMTP id 98e67ed59e1d1-2f44353649aso19433334a91.0 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=rlde////PK3SmOrAxZ3J8UAwuxOtQvdnLCOEuSmJXEqPVFuuFmfXjkDTDyym+/SOsw nQ9D3q0NEAD+Uw22yLrqQxDt14esn4vbIIhLMLkQ5i6MQ5f3HyVtIWoYf1W6CKZnrw1O M0TZiqcmEx06HKPpJVQ+npZoCg88AkLo2nl2WrP3vHoVgdcdKGkuekPkTiZFft5phudF 7PVANY75qPmowEvzQNjVg+KdBcBYFz1635y772QdEUbziCihxWj+SJVbxooXbso33u5Z i+5rqZBH1pMUVYG8NMNTKc34uOXwSDKs5JpwrZChaFOD5wsNt4wPQEFZ3OcGVjFelc9I vShw== X-Forwarded-Encrypted: i=1; AJvYcCVDXMQgr2Qyh32H0BmGn3fu2KUIFnwyB1DtPSX8XnxuNBBF1HvxE2coN8Uul1nXFYIlQ4ZyOU52wnYm6dqz@vger.kernel.org X-Gm-Message-State: AOJu0YwIno7ovbQe3dY63cJHLYjdtlFnTpty8Qs8D40gNjD2TrQAHYb+ +pqM/PeZ2NR75Q4uph0sC5DssuiAMUybTRDUyHr0lF1dFqW2W8Llw1oAbF936g== X-Gm-Gg: ASbGncuc/AOPFg4txuGphGywgvODjFcDT8J6zYFdpPiJ23xJUHdZApyzvS0MxifPHsM XnMgUyDEtKq3vWVa6F2C+p2imGKhGn6zTh8GDnWbSqe9RetBUZuNfqUMnCcR2xzHM6+CVbUzRRC Uq0UgxI5gq9AsXtkcRVAlP/qSrwVdsQ09IzP1JMkpMujjTz7B0VkTS3OEgqu3tqvqS9XvCPT7uY 1SQDtoT4K7FxCIVnpg/+HMcM9bqysuvuOOVe9luS1n04pCcQqUloDNuwodrhvWT9I+TsZHUiDSM b4a3nHRh2cgZTuhDbQ7g 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13929919 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 1ABAB1A239D for ; Wed, 8 Jan 2025 01:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299739; cv=none; b=Dfs6jj51b4NItabxCl4+PSTV7QpI9zL8dL3p8e1j/UkwT88YNAT4GTgDEYcwDWWYVaoE1oxLssdYNksGC2LqMAO1eEvo+fJ3P/GpwXsqIlyNXSxMqrwdMsBOzVXxJnMc13C5zqfk4ZgfPDZvSz9xjYgLTfoFLsdaxdgOdZpuS5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299739; c=relaxed/simple; bh=ZPZ1RvYh2kO8gp/HE4ITCITiJwPeiYCbTgy1PyW8+MI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J2uiRjTgiRTxoGlKHkKNDpSbudeuu1W0WFuz1SF6c3Ql0ElYNfyTVMhQEYHcmv2wL09KaIEIsuNrTTjJQsvBieGDZKea9jMTNDqFaQk/8DQCkBHikqYBRiiPZRiAwPomO7s6Jer5jYTjyJtKNirkQPlivAT4pHry+1ngk+y+kus= 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.178 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-f178.google.com with SMTP id d9443c01a7336-2165cb60719so243688775ad.0 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=iDY/vo6s9H2FOGAzVB744CLBkZUkqQAt6O+L8WoiiQm+sYwT41DuAEHyoiy/JkFCNv VHDooS8a7iyXk1382Txh/Vy+sQnKCRi6C2R2JR9sDGt0dJeLYsAV+sp7SyyW0fX2ft9r xJl/C1vPG9k8yXrNq3FsWtF4zlIyqGkay5SehNzcyOewfv1e0CTwAf1YgfTtdhaVdzFf zFRE3bN274w8Eg3b9c6DgrFEz1Jcok48HoNhYrEFpDo/SmzaZGNQIFK1J2lclCtlbuTr uSng2OB8ttcErn22HZ/u5v7ahW6KE8GoQriTSkFWol6wNq+xYLbYnE7DIjhKfJLmBcn+ C5cg== X-Forwarded-Encrypted: i=1; AJvYcCVAZVMWimDq6gJ4SizCMfunHEpi8dOMi5kF5L6MYEqaAKVGjsk3Rt4Ptxrad4cfDZlDA3bj44VWNh1qv4pq@vger.kernel.org X-Gm-Message-State: AOJu0Ywul73X++yTiSlfZRNMyLmS4GUu7Z05r2uJhzMaCQyXnN7zqHPT RGT8lHknGZ682LRk9qoZjGTU49ujl10xqZ/85fC2GqyqMsP1BGiWzrUaaxZ8Ng== X-Gm-Gg: ASbGnctM11zQJgBWGeUdcOcag3pD33B0MsG1fi82ISW8tY7IeR2xWrFFXQHDyLkuLQN JuZe1O+O7OfPW4al+dQp4E5F8CMfVhNSI9kCnhRxADQIJPZ8Y7R6sITD5zxbmySDgMrXYkfZyVf LRsZ29RA4vd5+oQNU3j8xC/Svx8DD5Zppar9yh+aB7a4Mij4Rb9behToRJXcW43mxCmt1MopdG+ FWYcxdLE6uqSCxrxfSSsYDWjUIPX+JlJrrK/5OGHsE4ra6ln41m62D80WLVKBFH05+IWchn3ncM mb8Z2L2Ig8WlHmDYbG8N 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13929920 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 E28DA86AE3 for ; Wed, 8 Jan 2025 01:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736299740; cv=none; b=gfAfLdbEZc0EKMmMoNv9k2UOngT6eKAF/uEUJPjQaLtDi4fPXq4bHaHPz+9PSwqxnZwI4WK/GImn49gJ4ETxkSSnia0U3TIR8ZgFJWQPu2W0nQlloyhWxW+9IV9/4duoBN7S6fI7eSNGW/yobhSYL1r/ng8KWsIn5+WCx7z5J9E= 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.179 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-f179.google.com with SMTP id d9443c01a7336-216281bc30fso22196165ad.0 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=ByEXTvmOiIQ83/1JN3iwp4xusyaBGC6+PEfUcYcU9zh8zrCCGubSM/dc4Z1XswQ8hL fj8CufWknLMR0AS/zqayuXx4SWsMyruORtJvZlr/+0sq7xgs60RB0H7ypE8plOYEjmGr YvOw3PsL93jFyjGwQ4DkKrQUeLjEuf+wYsKold+6+JmpsxyEg60FaYOn8LhZje/XjWxS +V6cId+W4zfL791YgdZkB+cKmMumEY3BVivQ8uJ5icbQS3j0FAYzCcY8eJQwd2uI5BIp zZKUEpIYH1a8tFjGhUM45yYhmNrPEAlyhrVOUC4q3igAEca7w3JgG/QQZV8ssnXV8H0e w1GQ== X-Forwarded-Encrypted: i=1; AJvYcCWy9gVk7JMrfGZq1dr0mlKJjguUHdvVuhiMxZbPqoigVjexwoOHAABlT3C/VGvs3sVcn1AIxTvyxjGJHYJi@vger.kernel.org X-Gm-Message-State: AOJu0YwmRjRuRMUQeqUIM/ykhle3hX49oQaiPfd8mqO/3VtXrTwHMCB8 G4RjU878iSseJRvt/3Fqz1aqVshKqgwBo/sRgID3zq0p2LgWZ1MPQNSbYJ3oYg== X-Gm-Gg: ASbGncuqQFRMNNRs/AZERa8c/sEs7Izdmu67+TwvIlPDxvfanobSPNXCKyY6mqJYIqK 24u+WOM37ZNx35mUk0dfpcqAcR9gwrra1Kwos2t7mezF9GPrZYKdZ2nR5eOO79mP580jy+2rAqW mFeXq+10++19VJ6xjOuejg0j2kqvTNDudsxLzZcQqy8xuYCitd4aC0k68ghrkkwX3pi85TsmZJm uFj/GsPpI0f3zqYE2XJDTSCgknWBuB3kT/tlRoVBwyNLDJbFnwBhAWk4WQBdSYglyzAyzaLSMLk Va2Pa99xZRNR1NyW7YzF 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> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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";