mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
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. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEm+Rq3+YGJdiR9yuFh9CWnEQHBwQFAmLMTtEACgkQh9CWnEQH BwSmNw/+KC2qMPJ7e1favA8joQ+YCOWht3URTLDNrWpFrkAWLqjEkeYfSJQ3fBns vhDs42nt3318GZKa0YRFkttHEG4ZB5eV4pcf1GGV2/BtnUjr3tgD8iEIDLYeq8Z1 Y1F5WVXrCx3ta+xADVy1MMIM82ycWjKsrF7f8iADdP/hJtrlpnEdhOIzqz8Az5g+ ezFrs66/P0X+tc/a41mZ1BHIXa/4nnibo+A+hT/gtDK0g4uv/94XaQVaAn3VvELx m/RgkQsrKed3xGnniz9N+LX9oQ/IHQzz6HxZD3TokKlTS1rjHr0YMb++jo0430na NQ45Y9U0gl3gwalN+85YTabA0VWkVdkzn0YGydmcrJqphm3s78M+/FiMddaVQtMv D4ndLVqr6LXTKtsZIk97shuuxMHMaix5mA2hOOWFO0TjQFzsKOi/k2uZ0mo9hBPC FMsetOjmoeA1e01ztuW/3T2yQH1CQkHow/lp1xoidvLzgALraK3wAdhMX0lIR5Fg bxPNkrj1mTHPcBO7C7DKbvXt7bybZcn624/55FrTaYu5p0BdaazshMUHKBUb1l5K lhB4znh9dKQwc94VGdHzNISEjZSpjRbdnqBr/1qzpwR6SGR9jMFS1wTcjK2iAyMz iUR+O3vEeyOfRz2rSkgGSYIqkxdCX4Q6jyk4wz56gYP8FfIqmQ8= =O/9g -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmLN4J0ACgkQmmx57+YA GNnFBQ/8CMZHB963Azx+ybxj95ClLjtKKio7IjQRr4YoawXHYdNipLumrBS3V7BZ qu432X9gGHC5QP4U46d4zHUvWeLqPwsns6WnTa8wwbY2kAccnoCtOaVyWM8O2YyS n7Zwq6wSEul6GT7ig+eEsZ5NFhC3+i1C/mqCZfcEGWrIfzse5UwKVmcG/dmnavIP NtmaWMWr2PUvF3VJpgn71JpWJegkyANjDi7JJC/71h5MzjNrpGsE3XG5QyLpQfRZ +lAxT+2zJNbk+eSnISg1bpaeL/S9F8vrmzpgMEcCcydcpgQQ7I/M9nx+mNAbpRwn c7DuoXYB9VNX6bsI0pUjavhMc3qAIPtgYknGe/WhAmS6D4y/IfTJ7L91irULH/gC ZDH2aDTblhtefiSgd8X9RJyRTZb0CtTUoSR2ST0SfpMI8xJaaswXBS7nYfLib08v pSLAU6qalUpJpJ+ADeSEIbfUjuGR6GR1iT1R4dpdp3NfhR8u6bPdkphxzwdzctBL bZ+ZcFMlAfSp07FzII+2Ce5fuT5qM7rdqKurL5WFmJOYIHfqGDTESWp5vvViAHPJ 2c+ONWnPvMXoKxC6d90E8AhOhvOeE1frfu5NWJtzU7OY98rI1J5nFEF9hmVQWZ3p hfEzP+wiBuN2mHRDNtgmmJFFhbzPdXlY5QafR2XDm1kpfuFh/cY= =yTZT -----END PGP SIGNATURE----- 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: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
9bc697091a
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -25,9 +25,52 @@ static const struct mfd_cell bcm2835_power_devs[] = {
|
||||
{ .name = "bcm2835-power" },
|
||||
};
|
||||
|
||||
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 resource *res;
|
||||
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,
|
||||
ARRAY_SIZE(bcm2835_power_devs),
|
||||
NULL, 0, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (pm->asb)
|
||||
return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
|
||||
ARRAY_SIZE(bcm2835_power_devs),
|
||||
NULL, 0, NULL);
|
||||
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);
|
||||
|
@ -83,7 +83,7 @@ config PHY_NS2_USB_DRD
|
||||
config PHY_BRCM_SATA
|
||||
tristate "Broadcom SATA PHY driver"
|
||||
depends on ARCH_BRCMSTB || ARCH_BCM_IPROC || BMIPS_GENERIC || \
|
||||
ARCH_BCM_63XX || COMPILE_TEST
|
||||
ARCH_BCMBCA || COMPILE_TEST
|
||||
depends on OF
|
||||
select GENERIC_PHY
|
||||
default ARCH_BCM_IPROC
|
||||
|
@ -126,8 +126,7 @@
|
||||
|
||||
#define ASB_AXI_BRDG_ID 0x20
|
||||
|
||||
#define ASB_READ(reg) readl(power->asb + (reg))
|
||||
#define ASB_WRITE(reg, val) writel(PM_PASSWORD | (val), power->asb + (reg))
|
||||
#define BCM2835_BRDG_ID 0x62726467
|
||||
|
||||
struct bcm2835_power_domain {
|
||||
struct generic_pm_domain base;
|
||||
@ -142,24 +141,41 @@ struct bcm2835_power {
|
||||
void __iomem *base;
|
||||
/* AXI Async bridge registers. */
|
||||
void __iomem *asb;
|
||||
/* RPiVid bridge registers. */
|
||||
void __iomem *rpivid_asb;
|
||||
|
||||
struct genpd_onecell_data pd_xlate;
|
||||
struct bcm2835_power_domain domains[BCM2835_POWER_DOMAIN_COUNT];
|
||||
struct reset_controller_dev reset;
|
||||
};
|
||||
|
||||
static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
|
||||
static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable)
|
||||
{
|
||||
void __iomem *base = power->asb;
|
||||
u64 start;
|
||||
u32 val;
|
||||
|
||||
if (!reg)
|
||||
switch (reg) {
|
||||
case 0:
|
||||
return 0;
|
||||
case ASB_V3D_S_CTRL:
|
||||
case ASB_V3D_M_CTRL:
|
||||
if (power->rpivid_asb)
|
||||
base = power->rpivid_asb;
|
||||
break;
|
||||
}
|
||||
|
||||
start = ktime_get_ns();
|
||||
|
||||
/* Enable the module's async AXI bridges. */
|
||||
ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP);
|
||||
while (ASB_READ(reg) & ASB_ACK) {
|
||||
if (enable) {
|
||||
val = readl(base + reg) & ~ASB_REQ_STOP;
|
||||
} else {
|
||||
val = readl(base + reg) | ASB_REQ_STOP;
|
||||
}
|
||||
writel(PM_PASSWORD | val, base + reg);
|
||||
|
||||
while (readl(base + reg) & ASB_ACK) {
|
||||
cpu_relax();
|
||||
if (ktime_get_ns() - start >= 1000)
|
||||
return -ETIMEDOUT;
|
||||
@ -168,30 +184,24 @@ static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
|
||||
{
|
||||
return bcm2835_asb_control(power, reg, true);
|
||||
}
|
||||
|
||||
static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg)
|
||||
{
|
||||
u64 start;
|
||||
|
||||
if (!reg)
|
||||
return 0;
|
||||
|
||||
start = ktime_get_ns();
|
||||
|
||||
/* Enable the module's async AXI bridges. */
|
||||
ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP);
|
||||
while (!(ASB_READ(reg) & ASB_ACK)) {
|
||||
cpu_relax();
|
||||
if (ktime_get_ns() - start >= 1000)
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return bcm2835_asb_control(power, reg, false);
|
||||
}
|
||||
|
||||
static int bcm2835_power_power_off(struct bcm2835_power_domain *pd, u32 pm_reg)
|
||||
{
|
||||
struct bcm2835_power *power = pd->power;
|
||||
|
||||
/* We don't run this on BCM2711 */
|
||||
if (power->rpivid_asb)
|
||||
return 0;
|
||||
|
||||
/* Enable functional isolation */
|
||||
PM_WRITE(pm_reg, PM_READ(pm_reg) & ~PM_ISFUNC);
|
||||
|
||||
@ -213,6 +223,10 @@ static int bcm2835_power_power_on(struct bcm2835_power_domain *pd, u32 pm_reg)
|
||||
int inrush;
|
||||
bool powok;
|
||||
|
||||
/* We don't run this on BCM2711 */
|
||||
if (power->rpivid_asb)
|
||||
return 0;
|
||||
|
||||
/* If it was already powered on by the fw, leave it that way. */
|
||||
if (PM_READ(pm_reg) & PM_POWUP)
|
||||
return 0;
|
||||
@ -626,13 +640,23 @@ static int bcm2835_power_probe(struct platform_device *pdev)
|
||||
power->dev = dev;
|
||||
power->base = pm->base;
|
||||
power->asb = pm->asb;
|
||||
power->rpivid_asb = pm->rpivid_asb;
|
||||
|
||||
id = ASB_READ(ASB_AXI_BRDG_ID);
|
||||
if (id != 0x62726467 /* "BRDG" */) {
|
||||
id = readl(power->asb + ASB_AXI_BRDG_ID);
|
||||
if (id != BCM2835_BRDG_ID /* "BRDG" */) {
|
||||
dev_err(dev, "ASB register ID returned 0x%08x\n", id);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (power->rpivid_asb) {
|
||||
id = readl(power->rpivid_asb + ASB_AXI_BRDG_ID);
|
||||
if (id != BCM2835_BRDG_ID /* "BRDG" */) {
|
||||
dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n",
|
||||
id);
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
power->pd_xlate.domains = devm_kcalloc(dev,
|
||||
ARRAY_SIZE(power_domain_names),
|
||||
sizeof(*power->pd_xlate.domains),
|
||||
|
@ -340,12 +340,12 @@ static int __init brcmstb_biuctrl_init(void)
|
||||
|
||||
ret = setup_hifcpubiuctrl_regs(np);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out_put;
|
||||
|
||||
ret = mcp_write_pairing_set();
|
||||
if (ret) {
|
||||
pr_err("MCP: Unable to disable write pairing!\n");
|
||||
return ret;
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
a72_b53_rac_enable_all(np);
|
||||
@ -353,6 +353,9 @@ static int __init brcmstb_biuctrl_init(void)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
register_syscore_ops(&brcmstb_cpu_credit_syscore_ops);
|
||||
#endif
|
||||
return 0;
|
||||
ret = 0;
|
||||
out_put:
|
||||
of_node_put(np);
|
||||
return ret;
|
||||
}
|
||||
early_initcall(brcmstb_biuctrl_init);
|
||||
|
@ -721,7 +721,7 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
|
||||
ctrl.phy_a_standby_ctrl_offs = ddr_phy_data->phy_a_standby_ctrl_offs;
|
||||
ctrl.phy_b_standby_ctrl_offs = ddr_phy_data->phy_b_standby_ctrl_offs;
|
||||
/*
|
||||
* Slightly grosss to use the phy ver to get a memc,
|
||||
* Slightly gross to use the phy ver to get a memc,
|
||||
* offset but that is the only versioned things so far
|
||||
* we can test for.
|
||||
*/
|
||||
|
@ -183,7 +183,7 @@ config SPI_BCM63XX
|
||||
|
||||
config SPI_BCM63XX_HSSPI
|
||||
tristate "Broadcom BCM63XX HS SPI controller driver"
|
||||
depends on BCM63XX || BMIPS_GENERIC || ARCH_BCM_63XX || COMPILE_TEST
|
||||
depends on BCM63XX || BMIPS_GENERIC || ARCH_BCMBCA || COMPILE_TEST
|
||||
help
|
||||
This enables support for the High Speed SPI controller present on
|
||||
newer Broadcom BCM63XX SoCs.
|
||||
|
@ -1099,8 +1099,8 @@ config SERIAL_TIMBERDALE
|
||||
config SERIAL_BCM63XX
|
||||
tristate "Broadcom BCM63xx/BCM33xx UART support"
|
||||
select SERIAL_CORE
|
||||
depends on ARCH_BCM4908 || ARCH_BCM_63XX || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
|
||||
default ARCH_BCM4908 || ARCH_BCM_63XX || BCM63XX || BMIPS_GENERIC
|
||||
depends on ARCH_BCM4908 || ARCH_BCMBCA || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
|
||||
default ARCH_BCM4908 || ARCH_BCMBCA || BCM63XX || BMIPS_GENERIC
|
||||
help
|
||||
This enables the driver for the onchip UART core found on
|
||||
the following chipsets:
|
||||
|
@ -9,6 +9,7 @@ struct bcm2835_pm {
|
||||
struct device *dev;
|
||||
void __iomem *base;
|
||||
void __iomem *asb;
|
||||
void __iomem *rpivid_asb;
|
||||
};
|
||||
|
||||
#endif /* BCM2835_MFD_PM_H */
|
||||
|
Loading…
Reference in New Issue
Block a user