Unverified Commit 9bc69709 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'arm-soc/for-5.20/drivers' of https://github.com/Broadcom/stblinux into arm/drivers

This pull request contains Broadcom SoC drivers updatse for 5.20, please
pull the following:

- Julia fixes a typo in the Broadcom STB legacy power management code

- Liang fixes a device_node reference count leak in the Broadcom STB BIU
  driver code error path(s)

- Nicolas and Stefan provide updates to the BCM2835 power management
  driver allowing its use on BCM2711 (Raspberry Pi 4) and to enable the
  use of the V3D GPU driver on such platforms. This is a merge of an
  immutable branch from Lee Jones' MFD tree

- William removes the use of CONFIG_ARCH_BCM_63XX which is removed and
  replaces the dependencies with CONFIG_ARCH_BCMBCA which is how all of
  the DSL/PON SoCs from Broadcom are now supported in the upstream
  kernel.

* tag 'arm-soc/for-5.20/drivers' of https://github.com/Broadcom/stblinux:
  tty: serial: bcm63xx: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  spi: bcm63xx-hsspi: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  clk: bcm: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  hwrng: bcm2835: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  phy: brcm-sata: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  i2c: brcmstb: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  ata: ahci_brcm: bcmbca: Replace ARCH_BCM_63XX with ARCH_BCMBCA
  soc: bcm: bcm2835-power: Bypass power_on/off() calls
  soc: bcm: bcm2835-power: Add support for BCM2711's RPiVid ASB
  soc: bcm: bcm2835-power: Resolve ASB register macros
  soc: bcm: bcm2835-power: Refactor ASB control
  mfd: bcm2835-pm: Add support for BCM2711
  mfd: bcm2835-pm: Use 'reg-names' to get resources
  soc: bcm: brcmstb: biuctrl: Add missing of_node_put()
  soc: bcm: brcmstb: pm: pm-arm: fix typo in comment

Link: https://lore.kernel.org/r/20220711164451.3542127-6-f.fainelli@gmail.com


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 03e31603 ef4ef28a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ config SATA_AHCI_PLATFORM
config AHCI_BRCM
	tristate "Broadcom AHCI SATA support"
	depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP || \
		   ARCH_BCM_63XX || COMPILE_TEST
		   ARCH_BCMBCA || COMPILE_TEST
	select SATA_HOST
	help
	  This option enables support for the AHCI SATA3 controller found on
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ config HW_RANDOM_BA431
config HW_RANDOM_BCM2835
	tristate "Broadcom BCM2835/BCM63xx Random Number Generator support"
	depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X || \
		   ARCH_BCM_63XX || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
		   ARCH_BCMBCA || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
	default HW_RANDOM
	help
	  This driver provides kernel-side support for the Random Number
+2 −2
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@ config CLK_BCM2835

config CLK_BCM_63XX
	bool "Broadcom BCM63xx clock support"
	depends on ARCH_BCM_63XX || COMPILE_TEST
	depends on ARCH_BCMBCA || COMPILE_TEST
	select COMMON_CLK_IPROC
	default ARCH_BCM_63XX
	default ARCH_BCMBCA
	help
	  Enable common clock framework support for Broadcom BCM63xx DSL SoCs
	  based on the ARM architecture
+1 −1
Original line number Diff line number Diff line
@@ -486,7 +486,7 @@ config I2C_BCM_KONA

config I2C_BRCMSTB
	tristate "BRCM Settop/DSL I2C controller"
	depends on ARCH_BCM2835 || ARCH_BCM4908 || ARCH_BCM_63XX || \
	depends on ARCH_BCM2835 || ARCH_BCM4908 || ARCH_BCMBCA || \
		   ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
	default y
	help
+54 −20
Original line number Diff line number Diff line
@@ -25,9 +25,52 @@ static const struct mfd_cell bcm2835_power_devs[] = {
	{ .name = "bcm2835-power" },
};

static int bcm2835_pm_probe(struct platform_device *pdev)
static int bcm2835_pm_get_pdata(struct platform_device *pdev,
				struct bcm2835_pm *pm)
{
	if (of_find_property(pm->dev->of_node, "reg-names", NULL)) {
		struct resource *res;

		pm->base = devm_platform_ioremap_resource_byname(pdev, "pm");
		if (IS_ERR(pm->base))
			return PTR_ERR(pm->base);

		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "asb");
		if (res) {
			pm->asb = devm_ioremap_resource(&pdev->dev, res);
			if (IS_ERR(pm->asb))
				pm->asb = NULL;
		}

		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
						    "rpivid_asb");
		if (res) {
			pm->rpivid_asb = devm_ioremap_resource(&pdev->dev, res);
			if (IS_ERR(pm->rpivid_asb))
				pm->rpivid_asb = NULL;
		}

		return 0;
	}

	/* If no 'reg-names' property is found we can assume we're using old DTB. */
	pm->base = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(pm->base))
		return PTR_ERR(pm->base);

	pm->asb = devm_platform_ioremap_resource(pdev, 1);
	if (IS_ERR(pm->asb))
		pm->asb = NULL;

	pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2);
	if (IS_ERR(pm->rpivid_asb))
		pm->rpivid_asb = NULL;

	return 0;
}

static int bcm2835_pm_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct bcm2835_pm *pm;
	int ret;
@@ -39,10 +82,9 @@ static int bcm2835_pm_probe(struct platform_device *pdev)

	pm->dev = dev;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	pm->base = devm_ioremap_resource(dev, res);
	if (IS_ERR(pm->base))
		return PTR_ERR(pm->base);
	ret = bcm2835_pm_get_pdata(pdev, pm);
	if (ret)
		return ret;

	ret = devm_mfd_add_devices(dev, -1,
				   bcm2835_pm_devs, ARRAY_SIZE(bcm2835_pm_devs),
@@ -50,30 +92,22 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
	if (ret)
		return ret;

	/* We'll use the presence of the AXI ASB regs in the
	/*
	 * We'll use the presence of the AXI ASB regs in the
	 * bcm2835-pm binding as the key for whether we can reference
	 * the full PM register range and support power domains.
	 */
	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
	if (res) {
		pm->asb = devm_ioremap_resource(dev, res);
		if (IS_ERR(pm->asb))
			return PTR_ERR(pm->asb);

		ret = devm_mfd_add_devices(dev, -1,
					   bcm2835_power_devs,
	if (pm->asb)
		return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
					    ARRAY_SIZE(bcm2835_power_devs),
					    NULL, 0, NULL);
		if (ret)
			return ret;
	}

	return 0;
}

static const struct of_device_id bcm2835_pm_of_match[] = {
	{ .compatible = "brcm,bcm2835-pm-wdt", },
	{ .compatible = "brcm,bcm2835-pm", },
	{ .compatible = "brcm,bcm2711-pm", },
	{},
};
MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
Loading