From: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> To: ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org, john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org, linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hauke.mehrtens-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, kishon-l0cyMroinI0@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> Subject: [PATCH v9 16/16] MIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation Date: Wed, 9 Aug 2017 00:52:47 +0200 [thread overview] Message-ID: <20170808225247.32266-17-hauke@hauke-m.de> (raw) In-Reply-To: <20170808225247.32266-1-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> From: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> The RCU register are now access through separates drivers. remove the last pieces of the old implementation. The GPHY reset bits are now set by the GPHY driver which registers a reboot notifier. The reboot is triggered by a syscon-reboot driver and the MIPS specific parts are done by the generic MIPS implementation in arch/mips/kernel/reset.c. Signed-off-by: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> --- arch/mips/lantiq/Kconfig | 1 + arch/mips/lantiq/xway/Makefile | 2 +- arch/mips/lantiq/xway/reset.c | 147 ----------------------------------------- 3 files changed, 2 insertions(+), 148 deletions(-) delete mode 100644 arch/mips/lantiq/xway/reset.c diff --git a/arch/mips/lantiq/Kconfig b/arch/mips/lantiq/Kconfig index f5db4a426568..35bc69b78268 100644 --- a/arch/mips/lantiq/Kconfig +++ b/arch/mips/lantiq/Kconfig @@ -18,6 +18,7 @@ config SOC_XWAY select SOC_TYPE_XWAY select HW_HAS_PCI select MFD_SYSCON + select MFD_CORE config SOC_FALCON bool "FALCON" diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile index 6daf3149e7ca..fbb0747c70b7 100644 --- a/arch/mips/lantiq/xway/Makefile +++ b/arch/mips/lantiq/xway/Makefile @@ -1,3 +1,3 @@ -obj-y := prom.o sysctrl.o clk.o reset.o dma.o gptu.o dcdc.o +obj-y := prom.o sysctrl.o clk.o dma.o gptu.o dcdc.o obj-y += vmmc.o diff --git a/arch/mips/lantiq/xway/reset.c b/arch/mips/lantiq/xway/reset.c deleted file mode 100644 index 04cd9a7c04a3..000000000000 --- a/arch/mips/lantiq/xway/reset.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * - * Copyright (C) 2010 John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org> - * Copyright (C) 2013-2015 Lantiq Beteiligungs-GmbH & Co.KG - */ - -#include <linux/init.h> -#include <linux/io.h> -#include <linux/ioport.h> -#include <linux/pm.h> -#include <linux/export.h> -#include <linux/delay.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> -#include <linux/reset-controller.h> - -#include <asm/reboot.h> - -#include <lantiq_soc.h> - -#include "../prom.h" - -/* reset request register */ -#define RCU_RST_REQ 0x0010 -/* reset status register */ -#define RCU_RST_STAT 0x0014 - -/* xbar BE flag */ -#define RCU_AHB_ENDIAN 0x004C -#define RCU_VR9_BE_AHB1S 0x00000008 - -/* reboot bit */ -#define RCU_RD_GPHY0_XRX200 BIT(31) -#define RCU_RD_SRST BIT(30) -#define RCU_RD_GPHY1_XRX200 BIT(29) - -/* reset cause */ -#define RCU_STAT_SHIFT 26 -/* boot selection */ -#define RCU_BOOT_SEL(x) ((x >> 18) & 0x7) -#define RCU_BOOT_SEL_XRX200(x) (((x >> 17) & 0xf) | ((x >> 8) & 0x10)) - -/* dwc2 USB configuration registers */ -#define RCU_USB1CFG 0x0018 -#define RCU_USB2CFG 0x0034 - -/* USB DMA endianness bits */ -#define RCU_USBCFG_HDSEL_BIT BIT(11) -#define RCU_USBCFG_HOST_END_BIT BIT(10) -#define RCU_USBCFG_SLV_END_BIT BIT(9) - -/* USB reset bits */ -#define RCU_USBRESET 0x0010 - -#define USBRESET_BIT BIT(4) - -#define RCU_USBRESET2 0x0048 - -#define USB1RESET_BIT BIT(4) -#define USB2RESET_BIT BIT(5) - -#define RCU_CFG1A 0x0038 -#define RCU_CFG1B 0x003C - -/* USB PMU devices */ -#define PMU_AHBM BIT(15) -#define PMU_USB0 BIT(6) -#define PMU_USB1 BIT(27) - -/* USB PHY PMU devices */ -#define PMU_USB0_P BIT(0) -#define PMU_USB1_P BIT(26) - -/* remapped base addr of the reset control unit */ -static void __iomem *ltq_rcu_membase; -static struct device_node *ltq_rcu_np; - -static void ltq_rcu_w32(uint32_t val, uint32_t reg_off) -{ - ltq_w32(val, ltq_rcu_membase + reg_off); -} - -static uint32_t ltq_rcu_r32(uint32_t reg_off) -{ - return ltq_r32(ltq_rcu_membase + reg_off); -} - -static void ltq_machine_restart(char *command) -{ - u32 val = ltq_rcu_r32(RCU_RST_REQ); - - if (of_device_is_compatible(ltq_rcu_np, "lantiq,rcu-xrx200")) - val |= RCU_RD_GPHY1_XRX200 | RCU_RD_GPHY0_XRX200; - - val |= RCU_RD_SRST; - - local_irq_disable(); - ltq_rcu_w32(val, RCU_RST_REQ); - unreachable(); -} - -static void ltq_machine_halt(void) -{ - local_irq_disable(); - unreachable(); -} - -static void ltq_machine_power_off(void) -{ - local_irq_disable(); - unreachable(); -} - -static int __init mips_reboot_setup(void) -{ - struct resource res; - - ltq_rcu_np = of_find_compatible_node(NULL, NULL, "lantiq,rcu-xway"); - if (!ltq_rcu_np) - ltq_rcu_np = of_find_compatible_node(NULL, NULL, - "lantiq,rcu-xrx200"); - - /* check if all the reset register range is available */ - if (!ltq_rcu_np) - panic("Failed to load reset resources from devicetree"); - - if (of_address_to_resource(ltq_rcu_np, 0, &res)) - panic("Failed to get rcu memory range"); - - if (!request_mem_region(res.start, resource_size(&res), res.name)) - pr_err("Failed to request rcu memory"); - - ltq_rcu_membase = ioremap_nocache(res.start, resource_size(&res)); - if (!ltq_rcu_membase) - panic("Failed to remap core memory"); - - _machine_restart = ltq_machine_restart; - _machine_halt = ltq_machine_halt; - pm_power_off = ltq_machine_power_off; - - return 0; -} - -arch_initcall(mips_reboot_setup); -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Hauke Mehrtens <hauke@hauke-m.de> To: ralf@linux-mips.org Cc: linux-mips@linux-mips.org, linux-mtd@lists.infradead.org, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, martin.blumenstingl@googlemail.com, john@phrozen.org, linux-spi@vger.kernel.org, hauke.mehrtens@intel.com, robh@kernel.org, andy.shevchenko@gmail.com, p.zabel@pengutronix.de, kishon@ti.com, mark.rutland@arm.com, Hauke Mehrtens <hauke@hauke-m.de> Subject: [PATCH v9 16/16] MIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation Date: Wed, 9 Aug 2017 00:52:47 +0200 [thread overview] Message-ID: <20170808225247.32266-17-hauke@hauke-m.de> (raw) In-Reply-To: <20170808225247.32266-1-hauke@hauke-m.de> From: Martin Blumenstingl <martin.blumenstingl@googlemail.com> The RCU register are now access through separates drivers. remove the last pieces of the old implementation. The GPHY reset bits are now set by the GPHY driver which registers a reboot notifier. The reboot is triggered by a syscon-reboot driver and the MIPS specific parts are done by the generic MIPS implementation in arch/mips/kernel/reset.c. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- arch/mips/lantiq/Kconfig | 1 + arch/mips/lantiq/xway/Makefile | 2 +- arch/mips/lantiq/xway/reset.c | 147 ----------------------------------------- 3 files changed, 2 insertions(+), 148 deletions(-) delete mode 100644 arch/mips/lantiq/xway/reset.c diff --git a/arch/mips/lantiq/Kconfig b/arch/mips/lantiq/Kconfig index f5db4a426568..35bc69b78268 100644 --- a/arch/mips/lantiq/Kconfig +++ b/arch/mips/lantiq/Kconfig @@ -18,6 +18,7 @@ config SOC_XWAY select SOC_TYPE_XWAY select HW_HAS_PCI select MFD_SYSCON + select MFD_CORE config SOC_FALCON bool "FALCON" diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile index 6daf3149e7ca..fbb0747c70b7 100644 --- a/arch/mips/lantiq/xway/Makefile +++ b/arch/mips/lantiq/xway/Makefile @@ -1,3 +1,3 @@ -obj-y := prom.o sysctrl.o clk.o reset.o dma.o gptu.o dcdc.o +obj-y := prom.o sysctrl.o clk.o dma.o gptu.o dcdc.o obj-y += vmmc.o diff --git a/arch/mips/lantiq/xway/reset.c b/arch/mips/lantiq/xway/reset.c deleted file mode 100644 index 04cd9a7c04a3..000000000000 --- a/arch/mips/lantiq/xway/reset.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * - * Copyright (C) 2010 John Crispin <john@phrozen.org> - * Copyright (C) 2013-2015 Lantiq Beteiligungs-GmbH & Co.KG - */ - -#include <linux/init.h> -#include <linux/io.h> -#include <linux/ioport.h> -#include <linux/pm.h> -#include <linux/export.h> -#include <linux/delay.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> -#include <linux/reset-controller.h> - -#include <asm/reboot.h> - -#include <lantiq_soc.h> - -#include "../prom.h" - -/* reset request register */ -#define RCU_RST_REQ 0x0010 -/* reset status register */ -#define RCU_RST_STAT 0x0014 - -/* xbar BE flag */ -#define RCU_AHB_ENDIAN 0x004C -#define RCU_VR9_BE_AHB1S 0x00000008 - -/* reboot bit */ -#define RCU_RD_GPHY0_XRX200 BIT(31) -#define RCU_RD_SRST BIT(30) -#define RCU_RD_GPHY1_XRX200 BIT(29) - -/* reset cause */ -#define RCU_STAT_SHIFT 26 -/* boot selection */ -#define RCU_BOOT_SEL(x) ((x >> 18) & 0x7) -#define RCU_BOOT_SEL_XRX200(x) (((x >> 17) & 0xf) | ((x >> 8) & 0x10)) - -/* dwc2 USB configuration registers */ -#define RCU_USB1CFG 0x0018 -#define RCU_USB2CFG 0x0034 - -/* USB DMA endianness bits */ -#define RCU_USBCFG_HDSEL_BIT BIT(11) -#define RCU_USBCFG_HOST_END_BIT BIT(10) -#define RCU_USBCFG_SLV_END_BIT BIT(9) - -/* USB reset bits */ -#define RCU_USBRESET 0x0010 - -#define USBRESET_BIT BIT(4) - -#define RCU_USBRESET2 0x0048 - -#define USB1RESET_BIT BIT(4) -#define USB2RESET_BIT BIT(5) - -#define RCU_CFG1A 0x0038 -#define RCU_CFG1B 0x003C - -/* USB PMU devices */ -#define PMU_AHBM BIT(15) -#define PMU_USB0 BIT(6) -#define PMU_USB1 BIT(27) - -/* USB PHY PMU devices */ -#define PMU_USB0_P BIT(0) -#define PMU_USB1_P BIT(26) - -/* remapped base addr of the reset control unit */ -static void __iomem *ltq_rcu_membase; -static struct device_node *ltq_rcu_np; - -static void ltq_rcu_w32(uint32_t val, uint32_t reg_off) -{ - ltq_w32(val, ltq_rcu_membase + reg_off); -} - -static uint32_t ltq_rcu_r32(uint32_t reg_off) -{ - return ltq_r32(ltq_rcu_membase + reg_off); -} - -static void ltq_machine_restart(char *command) -{ - u32 val = ltq_rcu_r32(RCU_RST_REQ); - - if (of_device_is_compatible(ltq_rcu_np, "lantiq,rcu-xrx200")) - val |= RCU_RD_GPHY1_XRX200 | RCU_RD_GPHY0_XRX200; - - val |= RCU_RD_SRST; - - local_irq_disable(); - ltq_rcu_w32(val, RCU_RST_REQ); - unreachable(); -} - -static void ltq_machine_halt(void) -{ - local_irq_disable(); - unreachable(); -} - -static void ltq_machine_power_off(void) -{ - local_irq_disable(); - unreachable(); -} - -static int __init mips_reboot_setup(void) -{ - struct resource res; - - ltq_rcu_np = of_find_compatible_node(NULL, NULL, "lantiq,rcu-xway"); - if (!ltq_rcu_np) - ltq_rcu_np = of_find_compatible_node(NULL, NULL, - "lantiq,rcu-xrx200"); - - /* check if all the reset register range is available */ - if (!ltq_rcu_np) - panic("Failed to load reset resources from devicetree"); - - if (of_address_to_resource(ltq_rcu_np, 0, &res)) - panic("Failed to get rcu memory range"); - - if (!request_mem_region(res.start, resource_size(&res), res.name)) - pr_err("Failed to request rcu memory"); - - ltq_rcu_membase = ioremap_nocache(res.start, resource_size(&res)); - if (!ltq_rcu_membase) - panic("Failed to remap core memory"); - - _machine_restart = ltq_machine_restart; - _machine_halt = ltq_machine_halt; - pm_power_off = ltq_machine_power_off; - - return 0; -} - -arch_initcall(mips_reboot_setup); -- 2.11.0
next prev parent reply other threads:[~2017-08-08 22:52 UTC|newest] Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-08-08 22:52 [PATCH v9 00/16] MIPS: lantiq: handle RCU register by separate drivers Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens [not found] ` <20170808225247.32266-1-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> 2017-08-08 22:52 ` [PATCH v9 01/16] MIPS: lantiq: Use of_platform_default_populate instead of __dt_register_buses Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 02/16] mtd: lantiq-flash: drop check of boot select Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 03/16] mtd: spi-falcon: " Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens [not found] ` <20170808225247.32266-4-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> 2017-08-09 11:44 ` Mark Brown 2017-08-09 11:44 ` Mark Brown [not found] ` <20170809114421.oo2bunardgw3p4tk-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 2017-08-09 14:02 ` Langer, Thomas 2017-08-09 14:02 ` Langer, Thomas 2017-08-09 14:02 ` Langer, Thomas [not found] ` <0DAF21CFE1B20740AE23D6AF6E54843F1EA0A385-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2017-08-10 15:05 ` Mark Brown 2017-08-10 15:05 ` Mark Brown 2017-08-10 15:05 ` Mark Brown 2017-08-08 22:52 ` [PATCH v9 04/16] watchdog: lantiq: access boot cause register through regmap Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 05/16] watchdog: lantiq: add device tree binding documentation Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens [not found] ` <20170808225247.32266-6-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> 2017-08-17 15:09 ` Rob Herring 2017-08-17 15:09 ` Rob Herring 2017-08-08 22:52 ` [PATCH v9 06/16] MIPS: lantiq: Enable MFD_SYSCON to be able to use it for the RCU MFD Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 07/16] Documentation: DT: MIPS: lantiq: Add docs for the RCU bindings Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 08/16] MIPS: lantiq: Convert the fpi bus driver to a platform_driver Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 09/16] MIPS: lantiq: remove ltq_reset_cause() and ltq_boot_select() Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 10/16] reset: Add a reset controller driver for the Lantiq XWAY based SoCs Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens [not found] ` <20170808225247.32266-11-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> 2017-08-17 15:10 ` Rob Herring 2017-08-17 15:10 ` Rob Herring 2017-08-08 22:52 ` [PATCH v9 11/16] MIPS: lantiq: remove old reset controller implementation Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 12/16] MIPS: lantiq: Add a GPHY driver which uses the RCU syscon-mfd Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 13/16] MIPS: lantiq: remove old GPHY loader code Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` [PATCH v9 14/16] phy: Add an USB PHY driver for the Lantiq SoCs using the RCU module Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-11 10:23 ` Kishon Vijay Abraham I 2017-08-11 10:23 ` Kishon Vijay Abraham I [not found] ` <20170808225247.32266-15-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> 2017-08-17 15:10 ` Rob Herring 2017-08-17 15:10 ` Rob Herring 2017-08-08 22:52 ` [PATCH v9 15/16] MIPS: lantiq: remove old USB PHY initialisation Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens 2017-08-08 22:52 ` Hauke Mehrtens [this message] 2017-08-08 22:52 ` [PATCH v9 16/16] MIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation Hauke Mehrtens
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170808225247.32266-17-hauke@hauke-m.de \ --to=hauke-5/s+jyg5szeelga04laivw@public.gmane.org \ --cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \ --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=hauke.mehrtens-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \ --cc=john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org \ --cc=kishon-l0cyMroinI0@public.gmane.org \ --cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \ --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \ --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \ --cc=martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \ --cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \ --cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \ --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.