From 5e16360a01e6b58862a22711d5c6565f1a106b00 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Tue, 31 Jan 2023 09:46:26 +0100 Subject: ARM: imx6q: skip ethernet refclock reconfiguration if enet_clk_ref is present Current mach-imx6q code has following logic: - if ptp clock of the ethernet controller node is attached to the SoC internal enet_ref clock, then we configure RMII reference clock pin as output by setting IOMUXC_GPR1 BIT(21). In this case - MAC (SoC) is the clock provider, PHY is the clock consumer. - if ptp clock of the ethernet controller node is not attached to the enet_ref clock, then we configure RMII reference clock pin as input by clearing IOMUXC_GPR1 BIT(21). In this case - PHY is the clock provider, MAC is the clock consumer. According to the Freescale MX6SDL ReferenceManual v4, IOMUXC_GPR1 BIT(21) (page 2033) this configuration bit is not related to the PTP (IEEE1588) clock: 21 ENET_CLK_SEL - choose enet reference clk mode: 0 - get enet tx reference clk from pad (external OSC for both external PHY and Internal Controller) 1 - get enet tx reference clk from internal clock from anatop (loopback through pad), this clock also sent out to external PHY. According to the Documentation/devicetree/bindings/net/fsl,fec.yaml: The "ptp"(option), for IEEE1588 timer clock that requires the clock. The "enet_clk_ref"(option), for MAC transmit/receiver reference clock like RGMII TXC clock or RMII reference clock. It depends on board design, the clock is required if RGMII TXC and RMII reference clock source from SOC internal PLL. The "enet_out"(option), output clock for external device, like supply clock for PHY. The clock is required if PHY clock source from SOC. We can see, that "enet_clk_ref" clock is the best fit for this purpose. Other properties like "ptp" is designed for IEEE1588 and "enet_out" do not have real functionality within imx related clock infrastructure. Since the "enet_clk_ref" is not used by the imx6qdl devicetrees, we can use it as indicator of potentially properly configured DT. At same time we can keep ptp clock based logic as the fallback for old DTs. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-imx6q.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index c9d7c29d95e1..7f6200925752 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -79,7 +79,7 @@ static void __init imx6q_enet_phy_init(void) static void __init imx6q_1588_init(void) { struct device_node *np; - struct clk *ptp_clk; + struct clk *ptp_clk, *fec_enet_ref; struct clk *enet_ref; struct regmap *gpr; u32 clksel; @@ -90,6 +90,14 @@ static void __init imx6q_1588_init(void) return; } + /* + * If enet_clk_ref configured, we assume DT did it properly and . + * clk-imx6q.c will do needed configuration. + */ + fec_enet_ref = of_clk_get_by_name(np, "enet_clk_ref"); + if (!IS_ERR(fec_enet_ref)) + goto put_node; + ptp_clk = of_clk_get(np, 2); if (IS_ERR(ptp_clk)) { pr_warn("%s: failed to get ptp clock\n", __func__); -- cgit v1.2.3 From e87f3be1c7f88ae10bbf100da1e6dc5939de7378 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Tue, 31 Jan 2023 09:46:41 +0100 Subject: ARM: mach-imx: imx6ul: remove not optional ethernet refclock overwrite Ethernet refclock direction is board specific and should be configurable by devicetree. In fact there are board not working with this defaults, which will be fixed by separate patch. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-imx6ul.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index dbf8d19cef11..7a0299de1db6 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c @@ -4,8 +4,6 @@ */ #include #include -#include -#include #include #include #include @@ -16,30 +14,12 @@ #include "cpuidle.h" #include "hardware.h" -static void __init imx6ul_enet_clk_init(void) -{ - struct regmap *gpr; - - gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr"); - if (!IS_ERR(gpr)) - regmap_update_bits(gpr, IOMUXC_GPR1, IMX6UL_GPR1_ENET_CLK_DIR, - IMX6UL_GPR1_ENET_CLK_OUTPUT); - else - pr_err("failed to find fsl,imx6ul-iomux-gpr regmap\n"); -} - -static inline void imx6ul_enet_init(void) -{ - imx6ul_enet_clk_init(); -} - static void __init imx6ul_init_machine(void) { imx_print_silicon_rev(cpu_is_imx6ull() ? "i.MX6ULL" : "i.MX6UL", imx_get_soc_revision()); of_platform_default_populate(NULL, NULL, NULL); - imx6ul_enet_init(); imx_anatop_init(); imx6ul_pm_init(); } -- cgit v1.2.3 From 2b8ed0c89f5dc7af756473651deb1be1770d2136 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:46:54 -0600 Subject: ARM: exynos: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230310144655.1540655-1-robh@kernel.org Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/suspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 3bf14ca78b62..6d5d7696aaf7 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -667,7 +667,7 @@ void __init exynos_pm_init(void) return; } - if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { + if (WARN_ON(!of_property_read_bool(np, "interrupt-controller"))) { pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); of_node_put(np); return; -- cgit v1.2.3 From 70dc8a098cddc5d5b5a5d9a6e7e4887c8e0575c6 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:46:54 -0600 Subject: ARM: mxs: Use of_property_present() for testing DT property presence It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring Signed-off-by: Shawn Guo --- arch/arm/mach-mxs/mach-mxs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 0129b7c514d7..51e47053c816 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -174,7 +174,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui) from = np; - if (of_get_property(np, "local-mac-address", NULL)) + if (of_property_present(np, "local-mac-address")) continue; newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL); -- cgit v1.2.3 From 614bef7e2727f35ff7edb7f41354e4e5c655590c Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:46:55 -0600 Subject: ARM: imx: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Signed-off-by: Shawn Guo --- arch/arm/mach-imx/gpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index ebc4339b8be4..5909088d5482 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -275,7 +275,7 @@ void __init imx_gpc_check_dt(void) if (WARN_ON(!np)) return; - if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { + if (WARN_ON(!of_property_read_bool(np, "interrupt-controller"))) { pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); /* map GPC, so that at least CPUidle and WARs keep working */ -- cgit v1.2.3 From 74a5b94b62217627a00b52f80c640a4a30d53115 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 14 Mar 2023 11:32:25 +0100 Subject: ARM: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: Arnd Bergmann Acked-by: Shawn Guo # for imx/mmdc Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230314103225.2787101-1-u.kleine-koenig@pengutronix.de Signed-off-by: Arnd Bergmann --- arch/arm/common/locomo.c | 6 ++---- arch/arm/common/sa1111.c | 6 ++---- arch/arm/common/scoop.c | 6 ++---- arch/arm/mach-imx/mmdc.c | 5 ++--- arch/arm/mach-omap1/omap-dma.c | 6 ++---- arch/arm/mach-pxa/sharpsl_pm.c | 6 ++---- arch/arm/mach-sa1100/jornada720_ssp.c | 5 ++--- arch/arm/mach-sa1100/neponset.c | 6 ++---- 8 files changed, 16 insertions(+), 30 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index da30a4d4f35c..309b74783468 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -494,7 +494,7 @@ static int locomo_probe(struct platform_device *dev) return __locomo_probe(&dev->dev, mem, irq); } -static int locomo_remove(struct platform_device *dev) +static void locomo_remove(struct platform_device *dev) { struct locomo *lchip = platform_get_drvdata(dev); @@ -502,8 +502,6 @@ static int locomo_remove(struct platform_device *dev) __locomo_remove(lchip); platform_set_drvdata(dev, NULL); } - - return 0; } /* @@ -514,7 +512,7 @@ static int locomo_remove(struct platform_device *dev) */ static struct platform_driver locomo_device_driver = { .probe = locomo_probe, - .remove = locomo_remove, + .remove_new = locomo_remove, #ifdef CONFIG_PM .suspend = locomo_suspend, .resume = locomo_resume, diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index f5e6990b8856..aad6ba236f0f 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -1123,7 +1123,7 @@ static int sa1111_probe(struct platform_device *pdev) return __sa1111_probe(&pdev->dev, mem, irq); } -static int sa1111_remove(struct platform_device *pdev) +static void sa1111_remove(struct platform_device *pdev) { struct sa1111 *sachip = platform_get_drvdata(pdev); @@ -1135,8 +1135,6 @@ static int sa1111_remove(struct platform_device *pdev) __sa1111_remove(sachip); platform_set_drvdata(pdev, NULL); } - - return 0; } static struct dev_pm_ops sa1111_pm_ops = { @@ -1155,7 +1153,7 @@ static struct dev_pm_ops sa1111_pm_ops = { */ static struct platform_driver sa1111_device_driver = { .probe = sa1111_probe, - .remove = sa1111_remove, + .remove_new = sa1111_remove, .driver = { .name = "sa1111", .pm = &sa1111_pm_ops, diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index e74c5bfdc6d3..9018c7240166 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c @@ -236,7 +236,7 @@ err_ioremap: return ret; } -static int scoop_remove(struct platform_device *pdev) +static void scoop_remove(struct platform_device *pdev) { struct scoop_dev *sdev = platform_get_drvdata(pdev); @@ -246,13 +246,11 @@ static int scoop_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); iounmap(sdev->base); kfree(sdev); - - return 0; } static struct platform_driver scoop_driver = { .probe = scoop_probe, - .remove = scoop_remove, + .remove_new = scoop_remove, .suspend = scoop_suspend, .resume = scoop_resume, .driver = { diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index b9efe9da06e0..2157493b78a9 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -456,7 +456,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, return pmu_mmdc->id; } -static int imx_mmdc_remove(struct platform_device *pdev) +static void imx_mmdc_remove(struct platform_device *pdev) { struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev); @@ -466,7 +466,6 @@ static int imx_mmdc_remove(struct platform_device *pdev) iounmap(pmu_mmdc->mmdc_base); clk_disable_unprepare(pmu_mmdc->mmdc_ipg_clk); kfree(pmu_mmdc); - return 0; } static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base, @@ -592,7 +591,7 @@ static struct platform_driver imx_mmdc_driver = { .of_match_table = imx_mmdc_dt_ids, }, .probe = imx_mmdc_probe, - .remove = imx_mmdc_remove, + .remove_new = imx_mmdc_remove, }; static int __init imx_mmdc_init(void) diff --git a/arch/arm/mach-omap1/omap-dma.c b/arch/arm/mach-omap1/omap-dma.c index f7e62de427f3..9ee472f8ead1 100644 --- a/arch/arm/mach-omap1/omap-dma.c +++ b/arch/arm/mach-omap1/omap-dma.c @@ -833,7 +833,7 @@ exit_dma_irq_fail: return ret; } -static int omap_system_dma_remove(struct platform_device *pdev) +static void omap_system_dma_remove(struct platform_device *pdev) { int dma_irq, irq_rel = 0; @@ -841,13 +841,11 @@ static int omap_system_dma_remove(struct platform_device *pdev) dma_irq = platform_get_irq(pdev, irq_rel); free_irq(dma_irq, (void *)(irq_rel + 1)); } - - return 0; } static struct platform_driver omap_system_dma_driver = { .probe = omap_system_dma_probe, - .remove = omap_system_dma_remove, + .remove_new = omap_system_dma_remove, .driver = { .name = "omap_dma_system" }, diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index 929cc51ed7c2..d29bdcd5270e 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -890,7 +890,7 @@ static int sharpsl_pm_probe(struct platform_device *pdev) return 0; } -static int sharpsl_pm_remove(struct platform_device *pdev) +static void sharpsl_pm_remove(struct platform_device *pdev) { suspend_set_ops(NULL); @@ -917,13 +917,11 @@ static int sharpsl_pm_remove(struct platform_device *pdev) del_timer_sync(&sharpsl_pm.chrg_full_timer); del_timer_sync(&sharpsl_pm.ac_timer); - - return 0; } static struct platform_driver sharpsl_pm_driver = { .probe = sharpsl_pm_probe, - .remove = sharpsl_pm_remove, + .remove_new = sharpsl_pm_remove, .suspend = sharpsl_pm_suspend, .resume = sharpsl_pm_resume, .driver = { diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c index 1dbe98948ce3..67f72ca984b2 100644 --- a/arch/arm/mach-sa1100/jornada720_ssp.c +++ b/arch/arm/mach-sa1100/jornada720_ssp.c @@ -175,18 +175,17 @@ static int jornada_ssp_probe(struct platform_device *dev) return 0; }; -static int jornada_ssp_remove(struct platform_device *dev) +static void jornada_ssp_remove(struct platform_device *dev) { /* Note that this doesn't actually remove the driver, since theres nothing to remove * It just makes sure everything is turned off */ GPSR = GPIO_GPIO25; ssp_exit(); - return 0; }; struct platform_driver jornadassp_driver = { .probe = jornada_ssp_probe, - .remove = jornada_ssp_remove, + .remove_new = jornada_ssp_remove, .driver = { .name = "jornada_ssp", }, diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index 6876bc1e33b4..0ef0ebbf31ac 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -376,7 +376,7 @@ static int neponset_probe(struct platform_device *dev) return ret; } -static int neponset_remove(struct platform_device *dev) +static void neponset_remove(struct platform_device *dev) { struct neponset_drvdata *d = platform_get_drvdata(dev); int irq = platform_get_irq(dev, 0); @@ -395,8 +395,6 @@ static int neponset_remove(struct platform_device *dev) nep = NULL; iounmap(d->base); kfree(d); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -425,7 +423,7 @@ static const struct dev_pm_ops neponset_pm_ops = { static struct platform_driver neponset_device_driver = { .probe = neponset_probe, - .remove = neponset_remove, + .remove_new = neponset_remove, .driver = { .name = "neponset", .pm = PM_OPS, -- cgit v1.2.3 From 68e505e2aa7fe534226d57364f1e1753deb22d2d Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Fri, 17 Mar 2023 09:11:56 +0100 Subject: ARM: mmp: remove obsolete config USB_EHCI_MV_U2O Commit 77acc85ce797 ("ARM: mmp: remove device definitions") and commit 06f11dfb5b75 ("ARM: mmp: remove all board files") remove mach-mmp's device definitions and the board file for the Marvell PXA910-based TTC_DKB Development Platform. With that removal, all references to the config USB_EHCI_MV_U2O are gone. The config has no remaining effect and can be deleted. Remove the obsolete config USB_EHCI_MV_U2O. Signed-off-by: Lukas Bulwahn Signed-off-by: Arnd Bergmann --- arch/arm/mach-mmp/Kconfig | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index 85b0d9ddb7d8..8c1d4402fd69 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig @@ -76,10 +76,4 @@ config CPU_MMP2 help Select code specific to MMP2. MMP2 is ARMv7 compatible. -config USB_EHCI_MV_U2O - bool "EHCI support for PXA USB OTG controller" - depends on USB_EHCI_MV - help - Enables support for OTG controller which can be switched to host mode. - endif -- cgit v1.2.3 From cb56f508e541036ad41cb9a5afb46339b2f83b9f Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sun, 19 Mar 2023 11:31:44 -0500 Subject: ARM: EXYNOS: Use of_address_to_resource() Replace of_get_address() and of_translate_address() with single call to of_address_to_resource(). With this, use ioremap() instead of of_iomap() which would parse "reg" a second time. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230319163145.225323-1-robh@kernel.org Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/exynos.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 51a247ca4da8..966a0995e047 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -50,11 +50,13 @@ void __init exynos_sysram_init(void) struct device_node *node; for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { + struct resource res; if (!of_device_is_available(node)) continue; - sysram_base_addr = of_iomap(node, 0); - sysram_base_phys = of_translate_address(node, - of_get_address(node, 0, NULL, NULL)); + + of_address_to_resource(node, 0, &res); + sysram_base_addr = ioremap(res.start, resource_size(&res)); + sysram_base_phys = res.start; of_node_put(node); break; } -- cgit v1.2.3 From 2e6115c175c7e7127702ef469347c3a62095d755 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Mon, 20 Mar 2023 14:01:59 +0100 Subject: ARM: spear: remove obsolete config MACH_SPEAR600 ARM: spear: remove obsolete config MACH_SPEAR600 Since commit ddb902cc3459 ("ARM: centralize common multi-platform kconfig options"), the config MACH_SPEAR600 has no effect. Remove this config. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20230320130159.32316-1-lukas.bulwahn@gmail.com Signed-off-by: Arnd Bergmann --- arch/arm/mach-spear/Kconfig | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig index 1add7ee49b63..7108ad628f8d 100644 --- a/arch/arm/mach-spear/Kconfig +++ b/arch/arm/mach-spear/Kconfig @@ -81,12 +81,6 @@ config ARCH_SPEAR6XX help Supports for ARM's SPEAR6XX family -config MACH_SPEAR600 - def_bool y - depends on ARCH_SPEAR6XX - help - Supports ST SPEAr600 boards configured via the device-tree - config ARCH_SPEAR_AUTO bool depends on !ARCH_SPEAR13XX && !ARCH_SPEAR6XX -- cgit v1.2.3 From d6053666ef2b6631ef8f265f49ff2cc0f4d45c50 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Tue, 21 Mar 2023 04:38:10 +0100 Subject: ARM: mstar: remove unused config MACH_MERCURY Commit 312b62b6610c ("ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs") adds the config MACH_INFINITY and MACH_MERCURY. The MACH_INFINITY config is used in the gpio-msc313 driver, but the MACH_MERCURY config is never used to configure anything in the kernel tree. Remove the unused config MACH_MERCURY. Signed-off-by: Lukas Bulwahn Acked-by: Romain Perier Link: https://lore.kernel.org/r/20230321033810.22017-1-lukas.bulwahn@gmail.com Signed-off-by: Arnd Bergmann --- arch/arm/mach-mstar/Kconfig | 7 ------- 1 file changed, 7 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-mstar/Kconfig b/arch/arm/mach-mstar/Kconfig index 5dbea7b485af..fa9709f30b46 100644 --- a/arch/arm/mach-mstar/Kconfig +++ b/arch/arm/mach-mstar/Kconfig @@ -20,11 +20,4 @@ config MACH_INFINITY help Support for MStar/Sigmastar infinity IP camera SoCs. -config MACH_MERCURY - bool "MStar/Sigmastar mercury SoC support" - default ARCH_MSTARV7 - help - Support for MStar/Sigmastar mercury dash camera SoCs. - Note that older Mercury2 SoCs are ARM9 based and not supported. - endif -- cgit v1.2.3 From 3c01b05407bfeb42c4db0f7cc079437228ab0ab2 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sun, 19 Mar 2023 11:31:25 -0500 Subject: ARM: bcm: Use of_address_to_resource() Replace open coded parsing of "reg" with of_address_to_resource(). Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230319163125.224833-1-robh@kernel.org Signed-off-by: Florian Fainelli --- arch/arm/mach-bcm/bcm_kona_smc.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c index 185335843bbd..f236e12d7a59 100644 --- a/arch/arm/mach-bcm/bcm_kona_smc.c +++ b/arch/arm/mach-bcm/bcm_kona_smc.c @@ -31,34 +31,23 @@ static const struct of_device_id bcm_kona_smc_ids[] __initconst = { int __init bcm_kona_smc_init(void) { struct device_node *node; - const __be32 *prop_val; - u64 prop_size = 0; - unsigned long buffer_size; - u32 buffer_phys; + struct resource res; + int ret; /* Read buffer addr and size from the device tree node */ node = of_find_matching_node(NULL, bcm_kona_smc_ids); if (!node) return -ENODEV; - prop_val = of_get_address(node, 0, &prop_size, NULL); + ret = of_address_to_resource(node, 0, &res); of_node_put(node); - if (!prop_val) + if (ret) return -EINVAL; - /* We assume space for four 32-bit arguments */ - if (prop_size < 4 * sizeof(u32) || prop_size > (u64)ULONG_MAX) - return -EINVAL; - buffer_size = (unsigned long)prop_size; - - buffer_phys = be32_to_cpup(prop_val); - if (!buffer_phys) - return -EINVAL; - - bcm_smc_buffer = ioremap(buffer_phys, buffer_size); + bcm_smc_buffer = ioremap(res.start, resource_size(&res)); if (!bcm_smc_buffer) return -ENOMEM; - bcm_smc_buffer_phys = buffer_phys; + bcm_smc_buffer_phys = res.start; pr_info("Kona Secure API initialized\n"); -- cgit v1.2.3 From 3ea0b91d9b48124b01e30004547238afd6b5a310 Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Wed, 15 Mar 2023 10:11:52 +0100 Subject: ARM: omap1: Kconfig: Fix indentation The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger Message-Id: <20230315091152.132443-1-juerg.haefliger@canonical.com> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 8df9a4de0e79..cbf703f0d850 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -118,7 +118,7 @@ config MACH_OMAP_OSK depends on ARCH_OMAP16XX help TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here - if you have such a board. + if you have such a board. config MACH_OMAP_PALMTE bool "Palm Tungsten E" -- cgit v1.2.3 From c29313d58c42f205cdecdd337f784f59bdf92dd7 Mon Sep 17 00:00:00 2001 From: Jinpeng Cui Date: Tue, 30 Aug 2022 14:21:36 +0000 Subject: ARM: omap1: remove redundant variables err Return value directly from platform_device_register() instead of getting value from redundant variable err. Reported-by: Zeal Robot Signed-off-by: Jinpeng Cui Message-Id: <20220830142136.299373-1-cui.jinpeng2@zte.com.cn> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/board-ams-delta.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 0f67ac4c6fd2..9108c871d129 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -822,8 +822,6 @@ static int __init modem_nreset_init(void) */ static int __init ams_delta_modem_init(void) { - int err; - if (!machine_is_ams_delta()) return -ENODEV; @@ -832,9 +830,7 @@ static int __init ams_delta_modem_init(void) /* Initialize the modem_nreset regulator consumer before use */ modem_priv.regulator = ERR_PTR(-ENODEV); - err = platform_device_register(&ams_delta_modem_device); - - return err; + return platform_device_register(&ams_delta_modem_device); } arch_initcall_sync(ams_delta_modem_init); -- cgit v1.2.3 From d26f05931fb7bcfbd0f64acc692c606fd76bbb3a Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:46:55 -0600 Subject: ARM: OMAP2+: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Message-Id: <20230310144655.1540793-1-robh@kernel.org> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 5a2a9b8e61ed..989195f6f7be 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2322,11 +2322,11 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, static void __init parse_module_flags(struct omap_hwmod *oh, struct device_node *np) { - if (of_find_property(np, "ti,no-reset-on-init", NULL)) + if (of_property_read_bool(np, "ti,no-reset-on-init")) oh->flags |= HWMOD_INIT_NO_RESET; - if (of_find_property(np, "ti,no-idle-on-init", NULL)) + if (of_property_read_bool(np, "ti,no-idle-on-init")) oh->flags |= HWMOD_INIT_NO_IDLE; - if (of_find_property(np, "ti,no-idle", NULL)) + if (of_property_read_bool(np, "ti,no-idle")) oh->flags |= HWMOD_NO_IDLE; } -- cgit v1.2.3 From 6eaf5d97bb46a625274c84ef4b320a7242630929 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sun, 19 Mar 2023 11:31:35 -0500 Subject: ARM: OMAP2+: Use of_address_to_resource() Replace open coded parsing of "reg" with of_address_to_resource(). Signed-off-by: Rob Herring Message-Id: <20230319163135.225076-1-robh@kernel.org> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 989195f6f7be..de3fd0bc862d 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -706,9 +706,7 @@ static const struct of_device_id ti_clkctrl_match_table[] __initconst = { static int __init _setup_clkctrl_provider(struct device_node *np) { - const __be32 *addrp; struct clkctrl_provider *provider; - u64 size; int i; provider = memblock_alloc(sizeof(*provider), SMP_CACHE_BYTES); @@ -717,8 +715,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np) provider->node = np; - provider->num_addrs = - of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2; + provider->num_addrs = of_address_count(np); provider->addr = memblock_alloc(sizeof(void *) * provider->num_addrs, @@ -733,11 +730,11 @@ static int __init _setup_clkctrl_provider(struct device_node *np) return -ENOMEM; for (i = 0; i < provider->num_addrs; i++) { - addrp = of_get_address(np, i, &size, NULL); - provider->addr[i] = (u32)of_translate_address(np, addrp); - provider->size[i] = size; - pr_debug("%s: %pOF: %x...%x\n", __func__, np, provider->addr[i], - provider->addr[i] + provider->size[i]); + struct resource res; + of_address_to_resource(np, i, &res); + provider->addr[i] = res.start; + provider->size[i] = resource_size(&res); + pr_debug("%s: %pOF: %pR\n", __func__, np, &res); } list_add(&provider->link, &clkctrl_providers); -- cgit v1.2.3 From 977f54705e99b92779f2bfac2597b967772b1b16 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Mon, 20 Mar 2023 09:38:06 +0100 Subject: ARM: OMAP2+: remove obsolete config OMAP3_SDRC_AC_TIMING Commit d42f265a5d7a ("ARM: OMAP3: clock: remove un-used core dpll re-program code") removes arch/arm/mach-omap2/sram34xx.S, which implemented the effect of the config OMAP3_SDRC_AC_TIMING. Since then, the OMAP3_SDRC_AC_TIMING config was hanging around without effect. Remove this obsolete config. Signed-off-by: Lukas Bulwahn Message-Id: <20230320083806.9545-1-lukas.bulwahn@gmail.com> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/Kconfig | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 3b53dda9ec79..821727eefd5a 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -255,17 +255,6 @@ config MACH_NOKIA_N8X0 select MACH_NOKIA_N810 select MACH_NOKIA_N810_WIMAX -config OMAP3_SDRC_AC_TIMING - bool "Enable SDRC AC timing register changes" - depends on ARCH_OMAP3 - help - If you know that none of your system initiators will attempt to - access SDRAM during CORE DVFS, select Y here. This should boost - SDRAM performance at lower CORE OPPs. There are relatively few - users who will wish to say yes at this point - almost everyone will - wish to say no. Selecting yes without understanding what is - going on could result in system crashes; - endmenu endif -- cgit v1.2.3 From 31006a885118ef7eb18f865f5ff615fb31868bfe Mon Sep 17 00:00:00 2001 From: Jilin Yuan Date: Wed, 14 Sep 2022 16:43:15 +0800 Subject: ARM: OMAP2+: fix repeated words in comments Delete the redundant word 'from'. Signed-off-by: Jilin Yuan Message-Id: <20220914084315.40165-1-yuanjilin@cdjrlc.com> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/cm33xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index d61fa06117b4..c824d4e3db63 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c @@ -5,7 +5,7 @@ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/ * Vaibhav Hiremath * - * Reference taken from from OMAP4 cminst44xx.c + * Reference taken from OMAP4 cminst44xx.c */ #include -- cgit v1.2.3 From 89e990559c378e06d2b2ef4f5dd6e963795cb7d8 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Tue, 20 Sep 2022 06:51:13 +0000 Subject: ARM: OMAP2+: Remove the unneeded result variable Return the value amx3_common_init() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Message-Id: <20220920065113.215685-1-ye.xingchen@zte.com.cn> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/pm33xx-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c index 711bcc6c8ddd..c907478be196 100644 --- a/arch/arm/mach-omap2/pm33xx-core.c +++ b/arch/arm/mach-omap2/pm33xx-core.c @@ -104,8 +104,6 @@ static int amx3_common_init(int (*idle)(u32 wfi_flags)) static int am33xx_suspend_init(int (*idle)(u32 wfi_flags)) { - int ret; - gfx_l4ls_clkdm = clkdm_lookup("gfx_l4ls_gfx_clkdm"); if (!gfx_l4ls_clkdm) { @@ -113,9 +111,7 @@ static int am33xx_suspend_init(int (*idle)(u32 wfi_flags)) return -ENODEV; } - ret = amx3_common_init(idle); - - return ret; + return amx3_common_init(idle); } static int am43xx_suspend_init(int (*idle)(u32 wfi_flags)) -- cgit v1.2.3 From 19050da1d1057a7bc73fd9039f94b7f63a00e54e Mon Sep 17 00:00:00 2001 From: Kenneth Lee Date: Tue, 9 Aug 2022 00:20:50 -0700 Subject: ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element Use kzalloc(...) rather than kcalloc(1, ...) because the number of elements we are specifying in this case is 1, so kzalloc would accomplish the same thing and we can simplify. Signed-off-by: Kenneth Lee Message-Id: <20220809072050.1733996-1-klee33@uw.edu> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index de3fd0bc862d..aac4c4ee2528 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -3454,7 +3454,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, } if (list_empty(&oh->slave_ports)) { - oi = kcalloc(1, sizeof(*oi), GFP_KERNEL); + oi = kzalloc(sizeof(*oi), GFP_KERNEL); if (!oi) goto out_free_class; -- cgit v1.2.3 From 6050cb1c7ad40b5673cd6ee7cfd36db3ca9be5fe Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 27 Mar 2023 15:52:28 -0500 Subject: ARM: sh-mobile: Use of_cpu_node_to_id() to read CPU node 'reg' Replace open coded CPU nodes reading of "reg" and translation to logical ID with of_cpu_node_to_id(). The original code called of_parse_phandle() CONFIG_NR_CPUS times regardless of the length of 'cpus'. Optimize the loop to bail out once of_parse_phandle() fails as the end of 'cpus' property has been reached. Signed-off-by: Rob Herring Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230327205228.573456-1-robh@kernel.org Signed-off-by: Geert Uytterhoeven --- arch/arm/mach-shmobile/platsmp-apmu.c | 36 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index e771ce70e132..ec6f421c0f4d 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -210,7 +211,6 @@ static void apmu_parse_dt(void (*fn)(struct resource *res, int cpu, int bit)) struct device_node *np_apmu, *np_cpu; struct resource res; int bit, index; - u32 id; for_each_matching_node(np_apmu, apmu_ids) { /* only enable the cluster that includes the boot CPU */ @@ -218,33 +218,29 @@ static void apmu_parse_dt(void (*fn)(struct resource *res, int cpu, int bit)) for (bit = 0; bit < CONFIG_NR_CPUS; bit++) { np_cpu = of_parse_phandle(np_apmu, "cpus", bit); - if (np_cpu) { - if (!of_property_read_u32(np_cpu, "reg", &id)) { - if (id == cpu_logical_map(0)) { - is_allowed = true; - of_node_put(np_cpu); - break; - } - - } + if (!np_cpu) + break; + if (of_cpu_node_to_id(np_cpu) == 0) { + is_allowed = true; of_node_put(np_cpu); + break; } + of_node_put(np_cpu); } if (!is_allowed) continue; for (bit = 0; bit < CONFIG_NR_CPUS; bit++) { np_cpu = of_parse_phandle(np_apmu, "cpus", bit); - if (np_cpu) { - if (!of_property_read_u32(np_cpu, "reg", &id)) { - index = get_logical_index(id); - if ((index >= 0) && - !of_address_to_resource(np_apmu, - 0, &res)) - fn(&res, index, bit); - } - of_node_put(np_cpu); - } + if (!np_cpu) + break; + + index = of_cpu_node_to_id(np_cpu); + if ((index >= 0) && + !of_address_to_resource(np_apmu, 0, &res)) + fn(&res, index, bit); + + of_node_put(np_cpu); } } } -- cgit v1.2.3 From 5ca2653011a4f4217ebd16144ddd5c2dca177cc0 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 3 Apr 2023 09:42:19 +0200 Subject: ARM: oxnas: remove OXNAS support Due to lack of maintainance and stall of development for a few years now, and since no new features will ever be added upstream, remove support for OX810 and OX820 ARM support. Acked-by: Linus Walleij Acked-by: Arnd Bergmann Acked-by: Daniel Golle Signed-off-by: Neil Armstrong Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 2 - arch/arm/Makefile | 1 - arch/arm/mach-oxnas/Kconfig | 38 ----------------- arch/arm/mach-oxnas/Makefile | 2 - arch/arm/mach-oxnas/headsmp.S | 23 ----------- arch/arm/mach-oxnas/platsmp.c | 96 ------------------------------------------- 6 files changed, 162 deletions(-) delete mode 100644 arch/arm/mach-oxnas/Kconfig delete mode 100644 arch/arm/mach-oxnas/Makefile delete mode 100644 arch/arm/mach-oxnas/headsmp.S delete mode 100644 arch/arm/mach-oxnas/platsmp.c (limited to 'arch/arm') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e24a9820e12f..017329401b3d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -497,8 +497,6 @@ source "arch/arm/mach-omap2/Kconfig" source "arch/arm/mach-orion5x/Kconfig" -source "arch/arm/mach-oxnas/Kconfig" - source "arch/arm/mach-pxa/Kconfig" source "arch/arm/mach-qcom/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 485a439e22ca..547e5856eaa0 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -203,7 +203,6 @@ machine-$(CONFIG_ARCH_MSTARV7) += mstar machine-$(CONFIG_ARCH_NOMADIK) += nomadik machine-$(CONFIG_ARCH_NPCM) += npcm machine-$(CONFIG_ARCH_NSPIRE) += nspire -machine-$(CONFIG_ARCH_OXNAS) += oxnas machine-$(CONFIG_ARCH_OMAP1) += omap1 machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2 machine-$(CONFIG_ARCH_ORION5X) += orion5x diff --git a/arch/arm/mach-oxnas/Kconfig b/arch/arm/mach-oxnas/Kconfig deleted file mode 100644 index a9ded7079268..000000000000 --- a/arch/arm/mach-oxnas/Kconfig +++ /dev/null @@ -1,38 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -menuconfig ARCH_OXNAS - bool "Oxford Semiconductor OXNAS Family SoCs" - depends on (ARCH_MULTI_V5 && CPU_LITTLE_ENDIAN) || ARCH_MULTI_V6 - select ARCH_HAS_RESET_CONTROLLER - select COMMON_CLK_OXNAS - select GPIOLIB - select MFD_SYSCON - select OXNAS_RPS_TIMER - select PINCTRL_OXNAS - select RESET_CONTROLLER - select RESET_OXNAS - select VERSATILE_FPGA_IRQ - select PINCTRL - help - Support for OxNas SoC family developed by Oxford Semiconductor. - -if ARCH_OXNAS - -config MACH_OX810SE - bool "Support OX810SE Based Products" - depends on ARCH_MULTI_V5 - select CPU_ARM926T - help - Include Support for the Oxford Semiconductor OX810SE SoC Based Products. - -config MACH_OX820 - bool "Support OX820 Based Products" - depends on ARCH_MULTI_V6 - select ARM_GIC - select DMA_CACHE_RWFO if SMP - select HAVE_SMP - select HAVE_ARM_SCU if SMP - select HAVE_ARM_TWD if SMP - help - Include Support for the Oxford Semiconductor OX820 SoC Based Products. - -endif diff --git a/arch/arm/mach-oxnas/Makefile b/arch/arm/mach-oxnas/Makefile deleted file mode 100644 index 0e78ecfe6c49..000000000000 --- a/arch/arm/mach-oxnas/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_SMP) += platsmp.o headsmp.o diff --git a/arch/arm/mach-oxnas/headsmp.S b/arch/arm/mach-oxnas/headsmp.S deleted file mode 100644 index 9c0f1479f33a..000000000000 --- a/arch/arm/mach-oxnas/headsmp.S +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (C) 2013 Ma Haijun - * Copyright (c) 2003 ARM Limited - * All Rights Reserved - */ -#include -#include - - __INIT - -/* - * OX820 specific entry point for secondary CPUs. - */ -ENTRY(ox820_secondary_startup) - mov r4, #0 - /* invalidate both caches and branch target cache */ - mcr p15, 0, r4, c7, c7, 0 - /* - * we've been released from the holding pen: secondary_stack - * should now contain the SVC stack for this core - */ - b secondary_startup diff --git a/arch/arm/mach-oxnas/platsmp.c b/arch/arm/mach-oxnas/platsmp.c deleted file mode 100644 index f0a50b9e61df..000000000000 --- a/arch/arm/mach-oxnas/platsmp.c +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2016 Neil Armstrong - * Copyright (C) 2013 Ma Haijun - * Copyright (C) 2002 ARM Ltd. - * All Rights Reserved - */ -#include -#include -#include -#include - -#include -#include -#include -#include - -extern void ox820_secondary_startup(void); - -static void __iomem *cpu_ctrl; -static void __iomem *gic_cpu_ctrl; - -#define HOLDINGPEN_CPU_OFFSET 0xc8 -#define HOLDINGPEN_LOCATION_OFFSET 0xc4 - -#define GIC_NCPU_OFFSET(cpu) (0x100 + (cpu)*0x100) -#define GIC_CPU_CTRL 0x00 -#define GIC_CPU_CTRL_ENABLE 1 - -static int __init ox820_boot_secondary(unsigned int cpu, - struct task_struct *idle) -{ - /* - * Write the address of secondary startup into the - * system-wide flags register. The BootMonitor waits - * until it receives a soft interrupt, and then the - * secondary CPU branches to this address. - */ - writel(virt_to_phys(ox820_secondary_startup), - cpu_ctrl + HOLDINGPEN_LOCATION_OFFSET); - - writel(cpu, cpu_ctrl + HOLDINGPEN_CPU_OFFSET); - - /* - * Enable GIC cpu interface in CPU Interface Control Register - */ - writel(GIC_CPU_CTRL_ENABLE, - gic_cpu_ctrl + GIC_NCPU_OFFSET(cpu) + GIC_CPU_CTRL); - - /* - * Send the secondary CPU a soft interrupt, thereby causing - * the boot monitor to read the system wide flags register, - * and branch to the address found there. - */ - arch_send_wakeup_ipi_mask(cpumask_of(cpu)); - - return 0; -} - -static void __init ox820_smp_prepare_cpus(unsigned int max_cpus) -{ - struct device_node *np; - void __iomem *scu_base; - - np = of_find_compatible_node(NULL, NULL, "arm,arm11mp-scu"); - scu_base = of_iomap(np, 0); - of_node_put(np); - if (!scu_base) - return; - - /* Remap CPU Interrupt Interface Registers */ - np = of_find_compatible_node(NULL, NULL, "arm,arm11mp-gic"); - gic_cpu_ctrl = of_iomap(np, 1); - of_node_put(np); - if (!gic_cpu_ctrl) - goto unmap_scu; - - np = of_find_compatible_node(NULL, NULL, "oxsemi,ox820-sys-ctrl"); - cpu_ctrl = of_iomap(np, 0); - of_node_put(np); - if (!cpu_ctrl) - goto unmap_scu; - - scu_enable(scu_base); - flush_cache_all(); - -unmap_scu: - iounmap(scu_base); -} - -static const struct smp_operations ox820_smp_ops __initconst = { - .smp_prepare_cpus = ox820_smp_prepare_cpus, - .smp_boot_secondary = ox820_boot_secondary, -}; - -CPU_METHOD_OF_DECLARE(ox820_smp, "oxsemi,ox820-smp", &ox820_smp_ops); -- cgit v1.2.3 From 908ce5c0e7cba4ec64c4ae4c6dd803be4ff236ae Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:46:56 -0600 Subject: ARM: pxa: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/irq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 96f33ef1d9ea..a9ef71008147 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -257,8 +257,7 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)) } pxa_irq_base = io_p2v(res.start); - if (of_find_property(node, "marvell,intc-priority", NULL)) - cpu_has_ipr = 1; + cpu_has_ipr = of_property_read_bool(node, "marvell,intc-priority"); ret = irq_alloc_descs(-1, 0, pxa_internal_irq_nr, 0); if (ret < 0) { -- cgit v1.2.3 From cf15079c6b6163c15254437d862351e5b438be8b Mon Sep 17 00:00:00 2001 From: "Jeremy J. Peper" Date: Fri, 17 Mar 2023 10:43:44 -0500 Subject: ARM: mv78xx0: adjust init logic for ts-wxl to reflect single core dev Original code was largely copy-pasted from the reference board code, adjust pcie initialiazation to reflect the TS-WXL using the single-core variant of this SoC. Correct pcie_port_size to be a power of 2 as required. Signed-off-by: Jeremy J. Peper Reviewed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann --- arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | 12 ++---------- arch/arm/mach-mv78xx0/pcie.c | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c index 9aa765d4cdc8..383dc6eab71a 100644 --- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c +++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c @@ -125,16 +125,8 @@ static void __init wxl_init(void) static int __init wxl_pci_init(void) { - if (machine_is_terastation_wxl()) { - /* - * Assign the x16 PCIe slot on the board to CPU core - * #0, and let CPU core #1 have the four x1 slots. - */ - if (mv78xx0_core_index() == 0) - mv78xx0_pcie_init(0, 1); - else - mv78xx0_pcie_init(1, 0); - } + if (machine_is_terastation_wxl() && mv78xx0_core_index() == 0) + mv78xx0_pcie_init(1, 1); return 0; } diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index 6190f538a124..fa68b63941b1 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c @@ -42,7 +42,7 @@ void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) u32 pcie_port_size[8] = { 0, - 0x30000000, + 0x20000000, 0x10000000, 0x10000000, 0x08000000, -- cgit v1.2.3 From 189e3ddb64cca682fc13a0f3d7216a1314a7975d Mon Sep 17 00:00:00 2001 From: "Jeremy J. Peper" Date: Fri, 17 Mar 2023 10:43:45 -0500 Subject: ARM: mv78xx0: set the correct driver for the i2c RTC Original code was largely copy-pasted from the reference board code, adjust to use the actual RTC chip present on the TS-WXL. Signed-off-by: Jeremy J. Peper Signed-off-by: Arnd Bergmann --- arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c index 383dc6eab71a..c3f6dc3518af 100644 --- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c +++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c @@ -39,7 +39,7 @@ static struct mv_sata_platform_data db78x00_sata_data = { }; static struct i2c_board_info __initdata db78x00_i2c_rtc = { - I2C_BOARD_INFO("ds1338", 0x68), + I2C_BOARD_INFO("rs5c372a", 0x32), }; -- cgit v1.2.3 From 4b01f735a619ae535d4459aec3b070c9336e56b4 Mon Sep 17 00:00:00 2001 From: "Jeremy J. Peper" Date: Fri, 17 Mar 2023 10:43:46 -0500 Subject: ARM: mv78xx0: add code to enable XOR and CRYPTO engines on mv78xx0 Adding missing code/values required to enable the XOR and CESA engines for this SoC Signed-off-by: Jeremy J. Peper Signed-off-by: Arnd Bergmann --- arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | 2 ++ arch/arm/mach-mv78xx0/common.c | 23 +++++++++++++++++++++++ arch/arm/mach-mv78xx0/common.h | 2 ++ arch/arm/mach-mv78xx0/mv78xx0.h | 10 ++++++++++ 4 files changed, 37 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c index c3f6dc3518af..31359f586657 100644 --- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c +++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c @@ -119,6 +119,8 @@ static void __init wxl_init(void) mv78xx0_uart1_init(); mv78xx0_uart2_init(); mv78xx0_uart3_init(); + mv78xx0_xor_init(); + mv78xx0_crypto_init(); mv78xx0_i2c_init(); i2c_register_board_info(0, &db78x00_i2c_rtc, 1); } diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 461a68945c26..679753fcc0ef 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c @@ -342,6 +342,29 @@ void __ref mv78xx0_timer_init(void) IRQ_MV78XX0_TIMER_1, get_tclk()); } +/**************************************************************************** +* XOR engine +****************************************************************************/ +void __init mv78xx0_xor_init(void) +{ + orion_xor0_init(XOR_PHYS_BASE, + XOR_PHYS_BASE + 0x200, + IRQ_MV78XX0_XOR_0, IRQ_MV78XX0_XOR_1); +} + +/**************************************************************************** + * Cryptographic Engines and Security Accelerator (CESA) +****************************************************************************/ +void __init mv78xx0_crypto_init(void) +{ + mvebu_mbus_add_window_by_id(MV78XX0_MBUS_SRAM_TARGET, + MV78XX0_MBUS_SRAM_ATTR, + MV78XX0_SRAM_PHYS_BASE, + MV78XX0_SRAM_SIZE); + orion_crypto_init(CRYPTO_PHYS_BASE, MV78XX0_SRAM_PHYS_BASE, + SZ_8K, IRQ_MV78XX0_CRYPTO); +} + /***************************************************************************** * General diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h index d8c6c2400e27..9f1dfd595003 100644 --- a/arch/arm/mach-mv78xx0/common.h +++ b/arch/arm/mach-mv78xx0/common.h @@ -43,6 +43,8 @@ void mv78xx0_uart0_init(void); void mv78xx0_uart1_init(void); void mv78xx0_uart2_init(void); void mv78xx0_uart3_init(void); +void mv78xx0_xor_init(void); +void mv78xx0_crypto_init(void); void mv78xx0_i2c_init(void); void mv78xx0_restart(enum reboot_mode, const char *); diff --git a/arch/arm/mach-mv78xx0/mv78xx0.h b/arch/arm/mach-mv78xx0/mv78xx0.h index 3f19bef7d7ac..88efb1e44142 100644 --- a/arch/arm/mach-mv78xx0/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/mv78xx0.h @@ -49,9 +49,15 @@ #define MV78XX0_REGS_VIRT_BASE IOMEM(0xfec00000) #define MV78XX0_REGS_SIZE SZ_1M +#define MV78XX0_SRAM_PHYS_BASE (0xf2200000) +#define MV78XX0_SRAM_SIZE SZ_8K + #define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 #define MV78XX0_PCIE_MEM_SIZE 0x30000000 +#define MV78XX0_MBUS_SRAM_TARGET 0x09 +#define MV78XX0_MBUS_SRAM_ATTR 0x00 + /* * Core-specific peripheral registers. */ @@ -98,6 +104,8 @@ #define USB1_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x51000) #define USB2_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x52000) +#define XOR_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x60900) + #define GE00_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x70000) #define GE01_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x74000) @@ -106,6 +114,8 @@ #define PCIE12_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x88000) #define PCIE13_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x8c000) +#define CRYPTO_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x90000) + #define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0xa0000) /* -- cgit v1.2.3 From b1b99b0cc2e5a342613fd9db3e6f54928d7c76d6 Mon Sep 17 00:00:00 2001 From: "Jeremy J. Peper" Date: Fri, 17 Mar 2023 10:43:47 -0500 Subject: ARM: mv78xx0: fix entries for gpios, buttons and usb ports Original code was largely copy-pasted from the reference board code, correct values to reflect the hardware actually present in the TS-WXL. Signed-off-by: Jeremy J. Peper Signed-off-by: Arnd Bergmann --- arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | 66 ++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 15 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c index 31359f586657..62e982f74bc2 100644 --- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c +++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include #include #include "mv78xx0.h" @@ -21,6 +24,11 @@ #include "mpp.h" +#define TSWXL_AUTO_SWITCH 15 +#define TSWXL_USB_POWER1 30 +#define TSWXL_USB_POWER2 31 + + /* This arch has 2 Giga Ethernet */ static struct mv643xx_eth_platform_data db78x00_ge00_data = { @@ -57,9 +65,9 @@ static unsigned int wxl_mpp_config[] __initdata = { MPP10_GE1_RXD2, MPP11_GE1_RXD3, MPP12_GPIO, - MPP13_SYSRST_OUTn, - MPP14_SATA1_ACTn, - MPP15_SATA0_ACTn, + MPP13_GPIO, + MPP14_GPIO, + MPP15_GPIO, MPP16_GPIO, MPP17_GPIO, MPP18_GPIO, @@ -73,7 +81,7 @@ static unsigned int wxl_mpp_config[] __initdata = { MPP26_UA2_CTSn, MPP27_UA2_RTSn, MPP28_GPIO, - MPP29_SYSRST_OUTn, + MPP29_GPIO, MPP30_GPIO, MPP31_GPIO, MPP32_GPIO, @@ -84,19 +92,41 @@ static unsigned int wxl_mpp_config[] __initdata = { MPP37_GPIO, MPP38_GPIO, MPP39_GPIO, - MPP40_UNUSED, - MPP41_UNUSED, - MPP42_UNUSED, - MPP43_UNUSED, - MPP44_UNUSED, - MPP45_UNUSED, - MPP46_UNUSED, - MPP47_UNUSED, - MPP48_SATA1_ACTn, - MPP49_SATA0_ACTn, + MPP40_GPIO, + MPP41_GPIO, + MPP42_GPIO, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, + MPP47_GPIO, + MPP48_GPIO, + MPP49_GPIO, 0 }; +static struct gpio_keys_button tswxl_buttons[] = { + { + .code = KEY_OPTION, + .gpio = TSWXL_AUTO_SWITCH, + .desc = "Power-auto Switch", + .active_low = 1, + } +}; + +static struct gpio_keys_platform_data tswxl_button_data = { + .buttons = tswxl_buttons, + .nbuttons = ARRAY_SIZE(tswxl_buttons), +}; + +static struct platform_device tswxl_button_device = { + .name = "gpio-keys", + .id = -1, + .num_resources = 0, + .dev = { + .platform_data = &tswxl_button_data, + }, +}; static void __init wxl_init(void) { @@ -111,7 +141,6 @@ static void __init wxl_init(void) */ mv78xx0_ehci0_init(); mv78xx0_ehci1_init(); - mv78xx0_ehci2_init(); mv78xx0_ge00_init(&db78x00_ge00_data); mv78xx0_ge01_init(&db78x00_ge01_data); mv78xx0_sata_init(&db78x00_sata_data); @@ -123,6 +152,13 @@ static void __init wxl_init(void) mv78xx0_crypto_init(); mv78xx0_i2c_init(); i2c_register_board_info(0, &db78x00_i2c_rtc, 1); + + //enable both usb ports + gpio_direction_output(TSWXL_USB_POWER1, 1); + gpio_direction_output(TSWXL_USB_POWER2, 1); + + //enable rear switch + platform_device_register(&tswxl_button_device); } static int __init wxl_pci_init(void) -- cgit v1.2.3