* [PATCH 00/17] ARM: OMAP2+: reset controller support
@ 2015-09-24 14:26 Tero Kristo
2015-09-24 14:26 ` [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller Tero Kristo
` (16 more replies)
0 siblings, 17 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Hi,
This series adds reset controller support on top of the existing PRM/PRCM
code. All the currently defined reset sources in hwmod databases are
moved over to DT, and all except OMAP3 hwmod resets are also removed.
OMAP3 hwmod reset data can be removed once OMAP3 is DT only.
Reboot support is also converted to use the new reset controller nodes,
and a new DT node is introduced for this purpose; system_reset.
I guess the main question regarding this series is whether the DT
changes are okay, I was forced to create a few top level ocp nodes
for IVA/DSP etc. which were missing, and a couple of peripheral nodes
for AMx3xx to host the reset data. DSP/IVA nodes should be created for
OMAP5+ also to support the resets for these, but currently these are
completely missing so I did not bother adding them.
One motivation for this series is to get rid of the hwmod database reset
info, which eventually allows getting rid of the hwmod data completely
(read: moved over to DT.)
Boot tested on omap3-beagle, omap4-panda-es, omap5-uevm, dra7-evm, beagle-x15,
sdp2430, sdp3430, beaglebone-white, beaglebone-black, am43xx-gp-evm.
Reboot tested on omap3-beagle, omap4-panda-es, omap5-uevm, beagle-x15. Reboot
on amx3xx does not seem functional in base 4.3-rc2 so wasn't able to test
this.
Testing branch pushed at:
tree: https://github.com/t-kristo/linux-pm.git
branch: 4.3-rc2-prcm-reset-fwk
Tero Kristo (17):
ARM: OMAP2+: PRM: add support for reset controller
ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible
nodes
ARM: dts: omap3: add reset data
ARM: dts: omap4: add reset data
ARM: dts: omap5: add reset data
ARM: dts: dra7: add reset data
ARM: dts: am4372: add reset data
ARM: dts: am33xx: add reset data
ARM: dts: OMAP24xx: add reset data
ARM: OMAP2+: hwmod: parse reset information from DT
ARM: OMAP2+: use system reset info from device tree data
ARM: OMAP4: hwmod_data: remove reset data
ARM: OMAP5: hwmod_data: remove reset data
ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info
ARM: OMAP24xx: hwmod: remove reset data from hwmod database
ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic
ARM: OMAP2+: PRM: remove redundant system reset code
arch/arm/boot/dts/am33xx.dtsi | 24 +++
arch/arm/boot/dts/am4372.dtsi | 24 +++
arch/arm/boot/dts/dra7.dtsi | 7 +
arch/arm/boot/dts/omap2420.dtsi | 24 +++
arch/arm/boot/dts/omap2430.dtsi | 17 ++
arch/arm/boot/dts/omap3.dtsi | 21 ++
arch/arm/boot/dts/omap4.dtsi | 27 +++
arch/arm/boot/dts/omap5.dtsi | 11 ++
arch/arm/mach-omap2/Kconfig | 1 +
arch/arm/mach-omap2/Makefile | 6 -
arch/arm/mach-omap2/am33xx-restart.c | 27 ---
arch/arm/mach-omap2/board-generic.c | 16 +-
arch/arm/mach-omap2/common.c | 29 +++
arch/arm/mach-omap2/common.h | 2 +
arch/arm/mach-omap2/omap2-restart.c | 2 +-
arch/arm/mach-omap2/omap3-restart.c | 2 +-
arch/arm/mach-omap2/omap4-restart.c | 27 ---
arch/arm/mach-omap2/omap_hwmod.c | 203 ++++++++++----------
arch/arm/mach-omap2/omap_hwmod.h | 12 +-
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 13 --
arch/arm/mach-omap2/omap_hwmod_2430_data.c | 7 -
.../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 30 ---
arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 8 -
arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 8 -
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 48 +----
arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 14 --
arch/arm/mach-omap2/prm2xxx.c | 15 --
arch/arm/mach-omap2/prm33xx.c | 18 --
arch/arm/mach-omap2/prm44xx.c | 1 -
arch/arm/mach-omap2/prm_common.c | 167 ++++++++++++++++
arch/arm/mach-omap2/prminst44xx.c | 20 --
arch/arm/mach-omap2/ti81xx-restart.c | 34 ----
32 files changed, 476 insertions(+), 389 deletions(-)
delete mode 100644 arch/arm/mach-omap2/am33xx-restart.c
delete mode 100644 arch/arm/mach-omap2/omap4-restart.c
delete mode 100644 arch/arm/mach-omap2/ti81xx-restart.c
bloat-o-meter:
add/remove: 13/24 grow/shrink: 20/579 up/down: 1732/-3020 (-1288)
function old new delta
ti_reset_xlate - 456 +456
_init 1012 1380 +368
_dt_assert_hardreset - 128 +128
omap2_prm_reset_controller_register - 108 +108
__omap_init_restart - 100 +100
__func__ 23717 23805 +88
_dt_is_hardreset_asserted - 64 +64
_dt_deassert_hardreset - 64 +64
ti_reset_deassert - 60 +60
omap_restart - 32 +32
ti_reset_status - 28 +28
ti_reset_assert - 28 +28
omap4_prminst_rmw_inst_reg_bits 76 100 +24
omap_prcm_init 120 140 +20
_lookup_hardreset 124 144 +20
ti_reset_ops - 16 +16
omap2xxx_restart 40 56 +16
vermagic 49 64 +15
omap3xxx_restart 28 40 +12
omap3xxx_iva_resets 24 36 +12
_setup 1016 1028 +12
omap3xxx_sad2d_resets 16 24 +8
_shutdown 548 556 +8
_omap4_disable_module 252 260 +8
_are_all_hardreset_lines_asserted.part 88 96 +8
prm_was_any_context_lost_old 108 112 +4
omap_reset_control - 4 +4
omap_prm_vp_clear_txdone 100 104 +4
omap_hwmod_disable_wakeup 248 252 +4
omap3xxx_mmu_iva_resets 8 12 +4
_set_master_standbymode 144 148 +4
__initcall___omap_init_restart7 - 4 +4
__warned 2006 2007 +1
omap_prm_deassert_hardreset 136 132 -4
omap54xx_wd_timer2_hwmod 168 164 -4
omap54xx_usb_tll_hs_hwmod 168 164 -4
omap54xx_usb_otg_ss_hwmod 168 164 -4
omap54xx_usb_host_hs_hwmod 168 164 -4
omap54xx_uart6_hwmod 168 164 -4
...<snip>...
am33xx_aes0_hwmod 168 164 -4
am33xx_adc_tsc_hwmod 168 164 -4
_write_sysconfig 164 160 -4
_enable_wakeup 256 252 -4
_enable_sysc 576 572 -4
_clear_softreset 128 124 -4
omap54xx_mmu_ipu_resets 8 - -8
omap54xx_mmu_dsp_resets 8 - -8
omap44xx_mmu_ipu_resets 8 - -8
omap44xx_mmu_dsp_resets 8 - -8
omap44xx_dsp_resets 8 - -8
omap2420_iva_resets 8 - -8
am33xx_pruss_resets 8 - -8
am33xx_gfx_resets 8 - -8
omap44xx_prm_resets 16 - -16
omap44xx_ipu_resets 16 - -16
omap2430_iva_resets 16 - -16
omap2420_dsp_resets 16 - -16
am33xx_wkup_m3_resets 16 - -16
omap_hwmod_init 492 468 -24
omap_hwmod_am33xx_reg 664 640 -24
omap44xx_iva_resets 24 - -24
ti81xx_restart 28 - -28
omap2xxx_prm_dpll_reset 32 - -32
am33xx_prm_global_warm_sw_reset 32 - -32
omap_hwmod_am43xx_reg 680 644 -36
_omap4_is_hardreset_asserted 48 - -48
_omap4_assert_hardreset 48 - -48
_am33xx_deassert_hardreset 64 - -64
omap4_prminst_global_warm_sw_reset 84 - -84
_omap4_deassert_hardreset 120 - -120
--
1.7.9.5
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-10-06 12:06 ` Tony Lindgren
2015-09-24 14:26 ` [PATCH 02/17] ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible nodes Tero Kristo
` (15 subsequent siblings)
16 siblings, 1 reply; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
PRM driver now supports reset controller for the defined reset lines.
Reset configurations are provided through device tree. Later, functionality
like hwmod and system reboot will be changed to use the generic framework.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/Kconfig | 1 +
arch/arm/mach-omap2/prm_common.c | 167 ++++++++++++++++++++++++++++++++++++++
2 files changed, 168 insertions(+)
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 07d2e10..ac3ef43 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -92,6 +92,7 @@ config ARCH_OMAP2PLUS
select SOC_BUS
select TI_PRIV_EDMA
select OMAP_IRQCHIP
+ select RESET_CONTROLLER
help
Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 3fc2cbe..161d8ab 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -27,6 +27,8 @@
#include <linux/of_address.h>
#include <linux/clk-provider.h>
#include <linux/clk/ti.h>
+#include <linux/reset.h>
+#include <linux/reset-controller.h>
#include "soc.h"
#include "prm2xxx_3xxx.h"
@@ -51,6 +53,11 @@
#define OMAP_PRCM_MAX_NR_PENDING_REG 2
/*
+ * Default partition for OMAP resets, maps to PRM
+ */
+#define OMAP_RESET_DEFAULT_PARTITION 1
+
+/*
* prcm_irq_chips: an array of all of the "generic IRQ chips" in use
* by the PRCM interrupt handler code. There will be one 'chip' per
* PRM_{IRQSTATUS,IRQENABLE}_MPU register pair. (So OMAP3 will have
@@ -737,6 +744,162 @@ static const struct of_device_id const omap_prcm_dt_match_table[] __initconst =
{ }
};
+struct ti_reset_data {
+ s16 module;
+ u16 offset;
+ u16 st_offset;
+ u8 shift;
+ u8 st_shift;
+ u8 part;
+};
+
+struct ti_reset_ctrl {
+ struct reset_controller_dev rcdev;
+ struct ti_reset_data **resets;
+ int num_resets;
+ int max_resets;
+ s16 offset;
+};
+
+#define to_ti_reset_ctrl(_rcdev) container_of(_rcdev, struct ti_reset_ctrl, \
+ rcdev)
+
+static struct ti_reset_data *_get_reset(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct ti_reset_ctrl *ctrl = to_ti_reset_ctrl(rcdev);
+
+ return ctrl->resets[id];
+}
+
+static int ti_reset_assert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct ti_reset_data *reset = _get_reset(rcdev, id);
+
+ return omap_prm_assert_hardreset(reset->shift, reset->part,
+ reset->module, reset->offset);
+}
+
+static int ti_reset_deassert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct ti_reset_data *reset = _get_reset(rcdev, id);
+
+ return omap_prm_deassert_hardreset(reset->shift, reset->st_shift,
+ reset->part, reset->module,
+ reset->offset, reset->st_offset);
+}
+
+static int ti_reset_status(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct ti_reset_data *reset = _get_reset(rcdev, id);
+
+ return omap_prm_is_hardreset_asserted(reset->shift, reset->part,
+ reset->module, reset->offset);
+}
+
+static struct reset_control_ops ti_reset_ops = {
+ .assert = ti_reset_assert,
+ .deassert = ti_reset_deassert,
+ .status = ti_reset_status,
+};
+
+static int ti_reset_xlate(struct reset_controller_dev *rcdev,
+ const struct of_phandle_args *reset_spec)
+{
+ struct ti_reset_ctrl *ctrl = to_ti_reset_ctrl(rcdev);
+ s16 module;
+ u16 offset, st_offset;
+ u8 shift, st_shift;
+ int index = 0;
+ struct ti_reset_data *reset;
+
+ if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
+ return -EINVAL;
+
+ module = reset_spec->args[0] - ctrl->offset;
+ offset = reset_spec->args[1];
+ shift = reset_spec->args[2];
+ st_offset = reset_spec->args[3];
+ st_shift = reset_spec->args[4];
+
+ for (index = 0; index < ctrl->num_resets; index++) {
+ reset = ctrl->resets[index];
+
+ if (module == reset->module && offset == reset->offset &&
+ st_offset == reset->st_offset && shift == reset->shift &&
+ st_shift == reset->st_shift)
+ return index;
+ }
+
+ reset = kzalloc(sizeof(*reset), GFP_KERNEL);
+
+ reset->module = module;
+ reset->offset = offset;
+ reset->st_offset = st_offset;
+ reset->shift = shift;
+ reset->st_shift = st_shift;
+ reset->part = OMAP_RESET_DEFAULT_PARTITION;
+
+ if (ctrl->num_resets + 1 > ctrl->max_resets) {
+ struct ti_reset_data **arr;
+ int num;
+
+ num = ctrl->num_resets;
+ num *= 2;
+ if (!num)
+ num = 1;
+
+ arr = kcalloc(num, sizeof(*arr), GFP_KERNEL);
+ ctrl->max_resets = num;
+ if (ctrl->num_resets)
+ memcpy(arr, ctrl->resets,
+ sizeof(*arr) * ctrl->num_resets);
+
+ kfree(ctrl->resets);
+ ctrl->resets = arr;
+ }
+
+ ctrl->resets[index] = reset;
+ ctrl->num_resets++;
+
+ return index;
+}
+
+/**
+ * omap2_prm_reset_controller_register - register reset controller for a node
+ * @node: device node to register reset controller for
+ * @data: PRM init data for the node
+ *
+ * Registers a reset controller for the PRM node if applicable. Return 0
+ * in success, negative error value in failure.
+ */
+int __init
+omap2_prm_reset_controller_register(struct device_node *np,
+ const struct omap_prcm_init_data *data)
+{
+ struct ti_reset_ctrl *ctrl;
+
+ /* Reset controllers available only for PRM nodes */
+ if (data->index != TI_CLKM_PRM)
+ return 0;
+
+ ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
+
+ ctrl->rcdev.of_node = np;
+ ctrl->rcdev.of_reset_n_cells = 5;
+ ctrl->rcdev.ops = &ti_reset_ops;
+ ctrl->rcdev.of_xlate = &ti_reset_xlate;
+
+ ctrl->offset = data->offset;
+
+ reset_controller_register(&ctrl->rcdev);
+
+ return 0;
+}
+
/**
* omap2_prm_base_init - initialize iomappings for the PRM driver
*
@@ -802,6 +965,10 @@ int __init omap_prcm_init(void)
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
if (ret)
return ret;
+
+ ret = omap2_prm_reset_controller_register(np, data);
+ if (ret)
+ return ret;
}
omap_cm_init();
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/17] ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible nodes
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
2015-09-24 14:26 ` [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 03/17] ARM: dts: omap3: add reset data Tero Kristo
` (14 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Previously the code was only parsing ocp hierarchy, which misses mpu and
iva/dsp nodes at least, which still contain hwmod support. Parse also the
soc hierarchy to include these.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index cc8a987..f53ebc6 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2467,15 +2467,24 @@ static int __init _init(struct omap_hwmod *oh, void *data)
if (of_have_populated_dt()) {
struct device_node *bus;
+ struct device_node *soc;
bus = of_find_node_by_name(NULL, "ocp");
if (!bus)
return -ENODEV;
r = of_dev_hwmod_lookup(bus, oh, &index, &np);
- if (r)
- pr_debug("omap_hwmod: %s missing dt data\n", oh->name);
- else if (np && index)
+ if (r) {
+ soc = of_find_node_by_name(NULL, "soc");
+ if (soc)
+ r = of_dev_hwmod_lookup(soc, oh, &index, &np);
+
+ if (r)
+ pr_debug("omap_hwmod: %s missing dt data\n",
+ oh->name);
+ }
+
+ if (np && index)
pr_warn("omap_hwmod: %s using broken dt data from %s\n",
oh->name, np->name);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/17] ARM: dts: omap3: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
2015-09-24 14:26 ` [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller Tero Kristo
2015-09-24 14:26 ` [PATCH 02/17] ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible nodes Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 04/17] ARM: dts: omap4: " Tero Kristo
` (13 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Copy over the reset data from hwmod database to DT. After this is taken
into use, the data in hwmod database can be removed.
A new node has been also added for sad2d to support sad2d resets.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/omap3.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 69a40cf..5be9aaa 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -64,11 +64,23 @@
iva: iva {
compatible = "ti,iva2.2";
ti,hwmods = "iva";
+ reset-names = "logic", "seq0", "seq1";
+ resets = <&prm 0x0000 0 0 0 8>,
+ <&prm 0x0000 0 1 0 9>,
+ <&prm 0x0000 0 2 0 10>;
dsp {
compatible = "ti,omap3-c64";
};
};
+
+ sad2d: sad2d {
+ compatible = "ti,sad2d";
+ ti,hwmods = "sad2d";
+ reset-names = "rst_modem_sw", "rst_modem_pwron_sw";
+ resets = <&prm 0x0a00 0 0 0 8>,
+ <&prm 0x0a00 0 1 0 9>;
+ };
};
/*
@@ -154,6 +166,7 @@
compatible = "ti,omap3-prm";
reg = <0x48306000 0x4000>;
interrupts = <11>;
+ #reset-cells = <5>;
prm_clocks: clocks {
#address-cells = <1>;
@@ -162,6 +175,12 @@
prm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ resets = <&prm 0x1200 0 2 0 0>;
+ };
};
cm: cm@48004000 {
@@ -471,6 +490,8 @@
interrupts = <28>;
ti,hwmods = "mmu_iva";
status = "disabled";
+ reset-names = "mmu";
+ resets = <&prm 0x0000 0 1 0 9>;
};
wdt2: wdt@48314000 {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/17] ARM: dts: omap4: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (2 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 03/17] ARM: dts: omap3: add reset data Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 05/17] ARM: dts: omap5: " Tero Kristo
` (12 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Copy over the reset data from hwmod database to DT. After this is taken
into use, the data in hwmod database can be removed.
A new node has been also added for ipu to support ipu resets.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/omap4.dtsi | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index abc4473..d14c485 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -97,11 +97,25 @@
dsp {
compatible = "ti,omap3-c64";
ti,hwmods = "dsp";
+ reset-names = "dsp";
+ resets = <&prm 0x0400 0x10 0 0x14 0>;
};
iva {
compatible = "ti,ivahd";
ti,hwmods = "iva";
+ reset-names = "seq0", "seq1", "logic";
+ resets = <&prm 0x0f00 0x10 0 0x14 0>,
+ <&prm 0x0f00 0x10 1 0x14 1>,
+ <&prm 0x0f00 0x10 2 0x14 2>;
+ };
+
+ ipu {
+ compatible = "ti,omap4-ipu";
+ ti,hwmods = "ipu";
+ reset-names = "cpu0", "cpu1";
+ resets = <&prm 0x0700 0x210 0 0x214 0>,
+ <&prm 0x0700 0x210 1 0x214 1>;
};
};
@@ -226,6 +240,7 @@
compatible = "ti,omap4-prm";
reg = <0x6000 0x3000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+ #reset-cells = <5>;
prm_clocks: clocks {
#address-cells = <1>;
@@ -234,6 +249,14 @@
prm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system",
+ "cold_sw";
+ resets = <&prm 0x1b00 0 0 4 0>,
+ <&prm 0x1b00 0 1 4 1>;
+ };
};
scrm: scrm@a000 {
@@ -553,6 +576,8 @@
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
ti,hwmods = "mmu_dsp";
#iommu-cells = <0>;
+ reset-names = "mmu_cache";
+ resets = <&prm 0x400 0x10 1 0x14 1>;
};
mmu_ipu: mmu@55082000 {
@@ -562,6 +587,8 @@
ti,hwmods = "mmu_ipu";
#iommu-cells = <0>;
ti,iommu-bus-err-back;
+ reset-names = "mmu_cache";
+ resets = <&prm 0x700 0x210 2 0x214 2>;
};
wdt2: wdt@4a314000 {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/17] ARM: dts: omap5: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (3 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 04/17] ARM: dts: omap4: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 06/17] ARM: dts: dra7: " Tero Kristo
` (11 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Copy over the reset data from hwmod database to DT. After this is taken
into use, the data in hwmod database can be removed.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/omap5.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 4205a8a..631a8ae 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -242,6 +242,7 @@
compatible = "ti,omap5-prm";
reg = <0x6000 0x3000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+ #reset-cells = <5>;
prm_clocks: clocks {
#address-cells = <1>;
@@ -250,6 +251,12 @@
prm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ resets = <&prm 0x1c00 0 0 4 0>;
+ };
};
scrm: scrm@a000 {
@@ -614,6 +621,8 @@
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
ti,hwmods = "mmu_dsp";
#iommu-cells = <0>;
+ reset-names = "mmu_cache";
+ resets = <&prm 0x400 0x10 1 0x14 1>;
};
mmu_ipu: mmu@55082000 {
@@ -623,6 +632,8 @@
ti,hwmods = "mmu_ipu";
#iommu-cells = <0>;
ti,iommu-bus-err-back;
+ reset-names = "mmu_cache";
+ resets = <&prm 0x700 0x210 2 0x214 2>;
};
keypad: keypad@4ae1c000 {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/17] ARM: dts: dra7: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (4 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 05/17] ARM: dts: omap5: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 07/17] ARM: dts: am4372: " Tero Kristo
` (10 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Copy over the reset data from kernel to DT. Currently, only system reset
has been defined, but rest can be added later once needed.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/dra7.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 5d65db9..e299b07 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -199,6 +199,7 @@
compatible = "ti,dra7-prm";
reg = <0x6000 0x3000>;
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+ #reset-cells = <5>;
prm_clocks: clocks {
#address-cells = <1>;
@@ -207,6 +208,12 @@
prm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ resets = <&prm 0x1d00 0 0 4 0>;
+ };
};
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/17] ARM: dts: am4372: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (5 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 06/17] ARM: dts: dra7: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-25 12:57 ` Lokesh Vutla
2015-09-24 14:26 ` [PATCH 08/17] ARM: dts: am33xx: " Tero Kristo
` (9 subsequent siblings)
16 siblings, 1 reply; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Add reset data for pruss, gfx, wkup-m3 and system reset.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/am4372.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 0447c04a..fcc8d31 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -116,12 +116,15 @@
reg-names = "umem", "dmem";
ti,hwmods = "wkup_m3";
ti,pm-firmware = "am335x-pm-firmware.elf";
+ reset-names = "wkup_m3";
+ resets = <&prcm 0x2000 0x10 3 0x14 5>;
};
prcm: prcm@1f0000 {
compatible = "ti,am4-prcm";
reg = <0x1f0000 0x11000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+ #reset-cells = <5>;
prcm_clocks: clocks {
#address-cells = <1>;
@@ -130,6 +133,12 @@
prcm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ reset-cells = <&prcm 0x4000 0 0 4 0>;
+ };
};
scm: scm@210000 {
@@ -1053,6 +1062,21 @@
ti,hwmods = "vpfe1";
status = "disabled";
};
+
+ gfx: gfx@56000000 {
+ compatible = "ti,am4376-sgx530", "img,sgx530";
+ ti,hwmods = "gfx";
+ status = "disabled";
+ reset-names = "gfx";
+ resets = <&prcm 0x400 0x10 0 0x14 0>;
+ };
+
+ pruss: pruss@54400000 {
+ compatible = "ti,am4372-pruss";
+ ti,hwmods = "pruss";
+ reset-names = "pruss";
+ resets = <&prcm 0x800 0x10 1 0x14 0>;
+ };
};
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/17] ARM: dts: am33xx: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (6 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 07/17] ARM: dts: am4372: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 09/17] ARM: dts: OMAP24xx: " Tero Kristo
` (8 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Add reset data for pruss, gfx, wkup-m3, and system reset.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/am33xx.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index d23e252..3974c3b 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -110,11 +110,14 @@
reg-names = "umem", "dmem";
ti,hwmods = "wkup_m3";
ti,pm-firmware = "am335x-pm-firmware.elf";
+ reset-names = "wkup_m3";
+ resets = <&prcm 0xd00 0 3 0xc 5>;
};
prcm: prcm@200000 {
compatible = "ti,am3-prcm";
reg = <0x200000 0x4000>;
+ #reset-cells = <5>;
prcm_clocks: clocks {
#address-cells = <1>;
@@ -123,6 +126,12 @@
prcm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ resets = <&prcm 0xf00 0 0 8 1>;
+ };
};
scm: scm@210000 {
@@ -879,6 +888,21 @@
reg = <0x48310000 0x2000>;
interrupts = <111>;
};
+
+ pruss: pruss@4a300000 {
+ compatible = "ti,am3352-pruss";
+ ti,hwmods = "pruss";
+ reset-names = "pruss";
+ resets = <&prcm 0xc00 0 1 0 1>;
+ };
+
+ gfx: gfx@56000000 {
+ compatible = "ti,am3352-sgx530", "img,sgx530";
+ ti,hwmods = "gfx";
+ status = "disabled";
+ reset-names = "gfx";
+ resets = <&prcm 0x1100 0x4 0 0x14 0>;
+ };
};
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/17] ARM: dts: OMAP24xx: add reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (7 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 08/17] ARM: dts: am33xx: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 10/17] ARM: OMAP2+: hwmod: parse reset information from DT Tero Kristo
` (7 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Add iva, dsp and system reset control as DT data..
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/boot/dts/omap2420.dtsi | 24 ++++++++++++++++++++++++
arch/arm/boot/dts/omap2430.dtsi | 17 +++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
index 5b9a376..cfb802d 100644
--- a/arch/arm/boot/dts/omap2420.dtsi
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -13,6 +13,23 @@
/ {
compatible = "ti,omap2420", "ti,omap2";
+ soc {
+ iva {
+ compatible = "ti,omap2420-iva";
+ ti,hwmods = "iva";
+ reset-names = "iva";
+ resets = <&prcm 0x800 0 8 0 8>;
+ };
+
+ dsp {
+ ti,hwmods = "dsp";
+ compatible = "ti,omap2420-dsp";
+ reset-names = "logic", "mmu";
+ resets = <&prcm 0x800 0 0 0 4>,
+ <&prcm 0x800 0 1 0 5>;
+ };
+ };
+
ocp {
l4: l4@48000000 {
compatible = "ti,omap2-l4", "simple-bus";
@@ -23,6 +40,7 @@
prcm: prcm@8000 {
compatible = "ti,omap2-prcm";
reg = <0x8000 0x1000>;
+ #reset-cells = <5>;
prcm_clocks: clocks {
#address-cells = <1>;
@@ -31,6 +49,12 @@
prcm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ resets = <&prcm 0x400 0 2 0 0>;
+ };
};
scm: scm@0 {
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index 2390f38..0d5f0d6 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -13,6 +13,16 @@
/ {
compatible = "ti,omap2430", "ti,omap2";
+ soc {
+ iva {
+ compatible = "ti,iva2.1";
+ ti,hwmods = "iva";
+ reset-names = "logic", "mmu";
+ resets = <&prcm 0x800 0 0 0 4>,
+ <&prcm 0x800 0 1 0 5>;
+ };
+ };
+
ocp {
l4_wkup: l4_wkup@49000000 {
compatible = "ti,omap2-l4-wkup", "simple-bus";
@@ -23,6 +33,7 @@
prcm: prcm@6000 {
compatible = "ti,omap2-prcm";
reg = <0x6000 0x1000>;
+ #reset-cells = <5>;
prcm_clocks: clocks {
#address-cells = <1>;
@@ -31,6 +42,12 @@
prcm_clockdomains: clockdomains {
};
+
+ system_reset: system_reset {
+ compatible = "ti,system-reset";
+ reset-names = "system";
+ resets = <&prcm 0x400 0 2 0 0>;
+ };
};
scm: scm@2000 {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/17] ARM: OMAP2+: hwmod: parse reset information from DT
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (8 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 09/17] ARM: dts: OMAP24xx: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 11/17] ARM: OMAP2+: use system reset info from device tree data Tero Kristo
` (6 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
DT can now be used to provide reset information, so parse this to avoid
the need to have reset info under hwmod data. This patch disables the
support for existing reset data under hwmod data, so shall be applied
only after the DT reset conversion.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 104 +++++++++++++++++++++++++++++++++++++-
arch/arm/mach-omap2/omap_hwmod.h | 8 +--
2 files changed, 107 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index f53ebc6..974260a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -142,6 +142,7 @@
#include <linux/cpu.h>
#include <linux/of.h>
#include <linux/of_address.h>
+#include <linux/reset.h>
#include <asm/system_misc.h>
@@ -1611,9 +1612,10 @@ static int _lookup_hardreset(struct omap_hwmod *oh, const char *name,
if (!strcmp(rst_line, name)) {
ohri->rst_shift = oh->rst_lines[i].rst_shift;
ohri->st_shift = oh->rst_lines[i].st_shift;
- pr_debug("omap_hwmod: %s: %s: %s: rst %d st %d\n",
+ ohri->rc = oh->rst_lines[i].rc;
+ pr_debug("omap_hwmod: %s: %s: %s: rst %d st %d rc %x\n",
oh->name, __func__, rst_line, ohri->rst_shift,
- ohri->st_shift);
+ ohri->st_shift, (u32)ohri->rc);
return 0;
}
@@ -2445,6 +2447,58 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
}
/**
+ * _init_resets - initialize internal reset data for hwmod @oh
+ * @oh: struct omap_hwmod *
+ * @np: device node pointer for this hwmod
+ *
+ * Look up the reset info for this hwmod from device tree.
+ */
+static int __init _init_resets(struct omap_hwmod *oh, struct device_node *np)
+{
+ int num;
+ int i;
+ int ret;
+ const char *reset_name;
+ struct reset_control *rc;
+
+ num = of_property_count_strings(np, "reset-names");
+ if (num < 1)
+ return 0;
+
+ oh->rst_lines = kcalloc(num, sizeof(struct omap_hwmod_rst_info),
+ GFP_KERNEL);
+
+ for (i = 0; i < num; i++) {
+ ret = of_property_read_string_index(np, "reset-names", i,
+ &reset_name);
+ if (ret)
+ goto cleanup;
+
+ rc = of_reset_control_get(np, reset_name);
+ if (IS_ERR(rc)) {
+ ret = PTR_ERR(rc);
+ goto cleanup;
+ }
+
+ oh->rst_lines[i].name = kstrdup(reset_name, GFP_KERNEL);
+ oh->rst_lines[i].rc = rc;
+ }
+
+ oh->rst_lines_cnt = num;
+
+ return ret;
+
+cleanup:
+ for (i = 0; i < num; i++) {
+ if (oh->rst_lines[i].rc)
+ reset_control_put(oh->rst_lines[i].rc);
+ }
+ kfree(oh->rst_lines);
+ oh->rst_lines = NULL;
+ return ret;
+}
+
+/**
* _init - initialize internal data for the hwmod @oh
* @oh: struct omap_hwmod *
* @n: (unused)
@@ -2507,6 +2561,13 @@ static int __init _init(struct omap_hwmod *oh, void *data)
oh->flags |= HWMOD_INIT_NO_RESET;
if (of_find_property(np, "ti,no-idle-on-init", NULL))
oh->flags |= HWMOD_INIT_NO_IDLE;
+
+ r = _init_resets(oh, np);
+ if (r < 0) {
+ WARN(1, "omap_hwmod: %s: couldn't init reset\n",
+ oh->name);
+ return -EINVAL;
+ }
}
oh->_state = _HWMOD_STATE_INITIALIZED;
@@ -3108,6 +3169,39 @@ static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
oh->prcm.omap4.rstst_offs);
}
+static int _dt_assert_hardreset(struct omap_hwmod *oh,
+ struct omap_hwmod_rst_info *ohri)
+{
+ if (!ohri->rc) {
+ pr_err("%s: %s: missing rc\n", __func__, oh->name);
+ WARN_ONCE(1, "missing rc\n");
+ return 0;
+ }
+
+ return reset_control_assert(ohri->rc);
+}
+
+static int _dt_deassert_hardreset(struct omap_hwmod *oh,
+ struct omap_hwmod_rst_info *ohri)
+{
+ if (!ohri->rc) {
+ pr_err("%s: %s: missing rc\n", __func__, oh->name);
+ return 0;
+ }
+
+ return reset_control_deassert(ohri->rc);
+}
+
+static int _dt_is_hardreset_asserted(struct omap_hwmod *oh,
+ struct omap_hwmod_rst_info *ohri)
+{
+ if (!ohri->rc) {
+ pr_err("%s: %s: missing rc\n", __func__, oh->name);
+ return 0;
+ }
+ return reset_control_status(ohri->rc);
+}
+
/* Public functions */
u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs)
@@ -3922,6 +4016,12 @@ void __init omap_hwmod_init(void)
WARN(1, "omap_hwmod: unknown SoC type\n");
}
+ if (of_have_populated_dt()) {
+ soc_ops.assert_hardreset = _dt_assert_hardreset;
+ soc_ops.deassert_hardreset = _dt_deassert_hardreset;
+ soc_ops.is_hardreset_asserted = _dt_is_hardreset_asserted;
+ }
+
inited = true;
}
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index ca6df1a..a6f3ac2 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -199,14 +199,16 @@ struct omap_hwmod_dma_info {
* @name: name of the reset line (module local name)
* @rst_shift: Offset of the reset bit
* @st_shift: Offset of the reset status bit (OMAP2/3 only)
+ * @rc: reset control handle for the reset
*
* @name should be something short, e.g., "cpu0" or "rst". It is defined
* locally to the hwmod.
*/
struct omap_hwmod_rst_info {
- const char *name;
- u8 rst_shift;
- u8 st_shift;
+ const char *name;
+ u8 rst_shift;
+ u8 st_shift;
+ struct reset_control *rc;
};
/**
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 11/17] ARM: OMAP2+: use system reset info from device tree data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (9 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 10/17] ARM: OMAP2+: hwmod: parse reset information from DT Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 12/17] ARM: OMAP4: hwmod_data: remove reset data Tero Kristo
` (5 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
System reset mapping used by reboot is now provided through DT data and
a reset controller. Use this instead of the hardcoded PRM API.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/Makefile | 6 ------
arch/arm/mach-omap2/am33xx-restart.c | 27 ---------------------------
arch/arm/mach-omap2/board-generic.c | 16 ++++++++--------
arch/arm/mach-omap2/common.c | 29 +++++++++++++++++++++++++++++
arch/arm/mach-omap2/common.h | 2 ++
arch/arm/mach-omap2/omap2-restart.c | 2 +-
arch/arm/mach-omap2/omap3-restart.c | 2 +-
arch/arm/mach-omap2/omap4-restart.c | 27 ---------------------------
arch/arm/mach-omap2/ti81xx-restart.c | 34 ----------------------------------
9 files changed, 41 insertions(+), 104 deletions(-)
delete mode 100644 arch/arm/mach-omap2/am33xx-restart.c
delete mode 100644 arch/arm/mach-omap2/omap4-restart.c
delete mode 100644 arch/arm/mach-omap2/ti81xx-restart.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 9358696..491dc6e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -57,13 +57,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
# Restart code (OMAP4/5 currently in omap4-common.c)
obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
-obj-$(CONFIG_SOC_TI81XX) += ti81xx-restart.o
-obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o
-obj-$(CONFIG_SOC_AM43XX) += omap4-restart.o
obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
-obj-$(CONFIG_ARCH_OMAP4) += omap4-restart.o
-obj-$(CONFIG_SOC_OMAP5) += omap4-restart.o
-obj-$(CONFIG_SOC_DRA7XX) += omap4-restart.o
# Pin multiplexing
obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o
diff --git a/arch/arm/mach-omap2/am33xx-restart.c b/arch/arm/mach-omap2/am33xx-restart.c
deleted file mode 100644
index 5bace6a..0000000
--- a/arch/arm/mach-omap2/am33xx-restart.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * am33xx-restart.c - Code common to all AM33xx machines.
- *
- * 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.
- */
-#include <linux/kernel.h>
-#include <linux/reboot.h>
-
-#include "common.h"
-#include "prm.h"
-
-/**
- * am3xx_restart - trigger a software restart of the SoC
- * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
- * @cmd: passed from the userspace program rebooting the system (if provided)
- *
- * Resets the SoC. For @cmd, see the 'reboot' syscall in
- * kernel/sys.c. No return value.
- */
-void am33xx_restart(enum reboot_mode mode, const char *cmd)
-{
- /* TODO: Handle mode and cmd if necessary */
-
- omap_prm_reset_system();
-}
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 24c9afc..6a82a9c 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -177,7 +177,7 @@ DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)")
.init_late = ti81xx_init_late,
.init_time = omap3_gptimer_timer_init,
.dt_compat = ti814x_boards_compat,
- .restart = ti81xx_restart,
+ .restart = omap_restart,
MACHINE_END
static const char *const ti816x_boards_compat[] __initconst = {
@@ -194,7 +194,7 @@ DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
.init_late = ti81xx_init_late,
.init_time = omap3_gptimer_timer_init,
.dt_compat = ti816x_boards_compat,
- .restart = ti81xx_restart,
+ .restart = omap_restart,
MACHINE_END
#endif
@@ -212,7 +212,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
.init_late = am33xx_init_late,
.init_time = omap3_gptimer_timer_init,
.dt_compat = am33xx_boards_compat,
- .restart = am33xx_restart,
+ .restart = omap_restart,
MACHINE_END
#endif
@@ -237,7 +237,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
.init_late = omap4430_init_late,
.init_time = omap4_local_timer_init,
.dt_compat = omap4_boards_compat,
- .restart = omap44xx_restart,
+ .restart = omap_restart,
MACHINE_END
#endif
@@ -259,7 +259,7 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
.init_late = omap5_init_late,
.init_time = omap5_realtime_timer_init,
.dt_compat = omap5_boards_compat,
- .restart = omap44xx_restart,
+ .restart = omap_restart,
MACHINE_END
#endif
@@ -281,7 +281,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
.init_machine = omap_generic_init,
.init_time = omap3_gptimer_timer_init,
.dt_compat = am43_boards_compat,
- .restart = omap44xx_restart,
+ .restart = omap_restart,
MACHINE_END
#endif
@@ -304,7 +304,7 @@ DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
.init_machine = omap_generic_init,
.init_time = omap5_realtime_timer_init,
.dt_compat = dra74x_boards_compat,
- .restart = omap44xx_restart,
+ .restart = omap_restart,
MACHINE_END
static const char *const dra72x_boards_compat[] __initconst = {
@@ -323,6 +323,6 @@ DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
.init_machine = omap_generic_init,
.init_time = omap5_realtime_timer_init,
.dt_compat = dra72x_boards_compat,
- .restart = omap44xx_restart,
+ .restart = omap_restart,
MACHINE_END
#endif
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 484cdad..8afb4ac 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -14,9 +14,13 @@
*/
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/reset.h>
#include "common.h"
#include "omap-secure.h"
+#include "soc.h"
+
+static struct reset_control *omap_reset_control;
/*
* Stub function for OMAP2 so that common files
@@ -32,3 +36,28 @@ void __init omap_reserve(void)
omap_secure_ram_reserve_memblock();
omap_barrier_reserve_memblock();
}
+
+void omap_restart(enum reboot_mode mode, const char *cmd)
+{
+ if (omap_reset_control)
+ reset_control_assert(omap_reset_control);
+
+ while (1)
+ ;
+}
+
+static int __init omap_init_restart(void)
+{
+ struct device_node *np;
+
+ np = of_find_node_by_name(NULL, "system_reset");
+ omap_reset_control = of_reset_control_get(np, "system");
+ if (IS_ERR(omap_reset_control)) {
+ pr_err("%s: no reset controller, reboot not functional.\n",
+ __func__);
+ omap_reset_control = NULL;
+ }
+
+ return 0;
+}
+omap_late_initcall(omap_init_restart);
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 92e92cf..51d6068 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -148,6 +148,8 @@ static inline void omap_soc_device_init(void)
}
#endif
+void omap_restart(enum reboot_mode mode, const char *cmd);
+
#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
void omap2xxx_restart(enum reboot_mode mode, const char *cmd);
#else
diff --git a/arch/arm/mach-omap2/omap2-restart.c b/arch/arm/mach-omap2/omap2-restart.c
index d937b2e..f6dd4fc 100644
--- a/arch/arm/mach-omap2/omap2-restart.c
+++ b/arch/arm/mach-omap2/omap2-restart.c
@@ -40,7 +40,7 @@ void omap2xxx_restart(enum reboot_mode mode, const char *cmd)
/* XXX Should save the cmd argument for use after the reboot */
- omap_prm_reset_system();
+ omap_restart(mode, cmd);
}
/**
diff --git a/arch/arm/mach-omap2/omap3-restart.c b/arch/arm/mach-omap2/omap3-restart.c
index 4bdd22e..5669137 100644
--- a/arch/arm/mach-omap2/omap3-restart.c
+++ b/arch/arm/mach-omap2/omap3-restart.c
@@ -31,5 +31,5 @@
void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
{
omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
- omap_prm_reset_system();
+ omap_restart(mode, cmd);
}
diff --git a/arch/arm/mach-omap2/omap4-restart.c b/arch/arm/mach-omap2/omap4-restart.c
deleted file mode 100644
index e17136a..0000000
--- a/arch/arm/mach-omap2/omap4-restart.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * omap4-restart.c - Common to OMAP4 and OMAP5
- *
- *
- * 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.
- */
-
-#include <linux/types.h>
-#include <linux/reboot.h>
-#include "common.h"
-#include "prm.h"
-
-/**
- * omap44xx_restart - trigger a software restart of the SoC
- * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
- * @cmd: passed from the userspace program rebooting the system (if provided)
- *
- * Resets the SoC. For @cmd, see the 'reboot' syscall in
- * kernel/sys.c. No return value.
- */
-void omap44xx_restart(enum reboot_mode mode, const char *cmd)
-{
- /* XXX Should save 'cmd' into scratchpad for use after reboot */
- omap_prm_reset_system();
-}
diff --git a/arch/arm/mach-omap2/ti81xx-restart.c b/arch/arm/mach-omap2/ti81xx-restart.c
deleted file mode 100644
index 6c3ce7c..0000000
--- a/arch/arm/mach-omap2/ti81xx-restart.c
+++ /dev/null
@@ -1,34 +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.
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/reboot.h>
-
-#include "iomap.h"
-#include "common.h"
-#include "control.h"
-#include "prm3xxx.h"
-
-#define TI81XX_PRM_DEVICE_RSTCTRL 0x00a0
-#define TI81XX_GLOBAL_RST_COLD BIT(1)
-
-/**
- * ti81xx_restart - trigger a software restart of the SoC
- * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
- * @cmd: passed from the userspace program rebooting the system (if provided)
- *
- * Resets the SoC. For @cmd, see the 'reboot' syscall in
- * kernel/sys.c. No return value.
- *
- * NOTE: Warm reset does not seem to work, may require resetting
- * clocks to bypass mode.
- */
-void ti81xx_restart(enum reboot_mode mode, const char *cmd)
-{
- omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
- TI81XX_PRM_DEVICE_RSTCTRL);
- while (1);
-}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 12/17] ARM: OMAP4: hwmod_data: remove reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (10 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 11/17] ARM: OMAP2+: use system reset info from device tree data Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 13/17] ARM: OMAP5: " Tero Kristo
` (4 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
This is provided via DT and no longer needed under the hwmod database.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 48 +++-------------------------
1 file changed, 5 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 43eebf2..0447ba9 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -535,21 +535,14 @@ static struct omap_hwmod_class omap44xx_dsp_hwmod_class = {
};
/* dsp */
-static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = {
- { .name = "dsp", .rst_shift = 0 },
-};
-
static struct omap_hwmod omap44xx_dsp_hwmod = {
.name = "dsp",
.class = &omap44xx_dsp_hwmod_class,
.clkdm_name = "tesla_clkdm",
- .rst_lines = omap44xx_dsp_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap44xx_dsp_resets),
.main_clk = "dpll_iva_m4x2_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET,
.context_offs = OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
@@ -1414,22 +1407,14 @@ static struct omap_hwmod_class omap44xx_ipu_hwmod_class = {
};
/* ipu */
-static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = {
- { .name = "cpu0", .rst_shift = 0 },
- { .name = "cpu1", .rst_shift = 1 },
-};
-
static struct omap_hwmod omap44xx_ipu_hwmod = {
.name = "ipu",
.class = &omap44xx_ipu_hwmod_class,
.clkdm_name = "ducati_clkdm",
- .rst_lines = omap44xx_ipu_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_resets),
.main_clk = "ducati_clk_mux_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
.context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
@@ -1497,23 +1482,14 @@ static struct omap_hwmod_class omap44xx_iva_hwmod_class = {
};
/* iva */
-static struct omap_hwmod_rst_info omap44xx_iva_resets[] = {
- { .name = "seq0", .rst_shift = 0 },
- { .name = "seq1", .rst_shift = 1 },
- { .name = "logic", .rst_shift = 2 },
-};
-
static struct omap_hwmod omap44xx_iva_hwmod = {
.name = "iva",
.class = &omap44xx_iva_hwmod_class,
.clkdm_name = "ivahd_clkdm",
- .rst_lines = omap44xx_iva_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_resets),
.main_clk = "dpll_iva_m5x2_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET,
.context_offs = OMAP4_RM_IVAHD_IVAHD_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
@@ -2093,9 +2069,6 @@ static struct omap_mmu_dev_attr mmu_ipu_dev_attr = {
};
static struct omap_hwmod omap44xx_mmu_ipu_hwmod;
-static struct omap_hwmod_rst_info omap44xx_mmu_ipu_resets[] = {
- { .name = "mmu_cache", .rst_shift = 2 },
-};
static struct omap_hwmod_addr_space omap44xx_mmu_ipu_addrs[] = {
{
@@ -2119,13 +2092,10 @@ static struct omap_hwmod omap44xx_mmu_ipu_hwmod = {
.name = "mmu_ipu",
.class = &omap44xx_mmu_hwmod_class,
.clkdm_name = "ducati_clkdm",
- .rst_lines = omap44xx_mmu_ipu_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap44xx_mmu_ipu_resets),
.main_clk = "ducati_clk_mux_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
.context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
@@ -2140,9 +2110,6 @@ static struct omap_mmu_dev_attr mmu_dsp_dev_attr = {
};
static struct omap_hwmod omap44xx_mmu_dsp_hwmod;
-static struct omap_hwmod_rst_info omap44xx_mmu_dsp_resets[] = {
- { .name = "mmu_cache", .rst_shift = 1 },
-};
static struct omap_hwmod_addr_space omap44xx_mmu_dsp_addrs[] = {
{
@@ -2166,13 +2133,10 @@ static struct omap_hwmod omap44xx_mmu_dsp_hwmod = {
.name = "mmu_dsp",
.class = &omap44xx_mmu_hwmod_class,
.clkdm_name = "tesla_clkdm",
- .rst_lines = omap44xx_mmu_dsp_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap44xx_mmu_dsp_resets),
.main_clk = "dpll_iva_m4x2_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET,
.context_offs = OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
@@ -2320,16 +2284,14 @@ static struct omap_hwmod omap44xx_cm_core_hwmod = {
};
/* prm */
-static struct omap_hwmod_rst_info omap44xx_prm_resets[] = {
- { .name = "rst_global_warm_sw", .rst_shift = 0 },
- { .name = "rst_global_cold_sw", .rst_shift = 1 },
-};
-
static struct omap_hwmod omap44xx_prm_hwmod = {
.name = "prm",
.class = &omap44xx_prcm_hwmod_class,
- .rst_lines = omap44xx_prm_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap44xx_prm_resets),
+ .prcm = {
+ .omap4 = {
+ .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
+ },
+ },
};
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 13/17] ARM: OMAP5: hwmod_data: remove reset data
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (11 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 12/17] ARM: OMAP4: hwmod_data: remove reset data Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 14/17] ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info Tero Kristo
` (3 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
This is provided via DT, and no longer needed in the hwmod database.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index 7c3fac0..9e33ac8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -1378,21 +1378,14 @@ static struct omap_hwmod_class omap54xx_mmu_hwmod_class = {
.sysc = &omap54xx_mmu_sysc,
};
-static struct omap_hwmod_rst_info omap54xx_mmu_dsp_resets[] = {
- { .name = "mmu_cache", .rst_shift = 1 },
-};
-
static struct omap_hwmod omap54xx_mmu_dsp_hwmod = {
.name = "mmu_dsp",
.class = &omap54xx_mmu_hwmod_class,
.clkdm_name = "dsp_clkdm",
- .rst_lines = omap54xx_mmu_dsp_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap54xx_mmu_dsp_resets),
.main_clk = "dpll_iva_h11x2_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP54XX_CM_DSP_DSP_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP54XX_RM_DSP_RSTCTRL_OFFSET,
.context_offs = OMAP54XX_RM_DSP_DSP_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
@@ -1400,21 +1393,14 @@ static struct omap_hwmod omap54xx_mmu_dsp_hwmod = {
};
/* mmu ipu */
-static struct omap_hwmod_rst_info omap54xx_mmu_ipu_resets[] = {
- { .name = "mmu_cache", .rst_shift = 2 },
-};
-
static struct omap_hwmod omap54xx_mmu_ipu_hwmod = {
.name = "mmu_ipu",
.class = &omap54xx_mmu_hwmod_class,
.clkdm_name = "ipu_clkdm",
- .rst_lines = omap54xx_mmu_ipu_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap54xx_mmu_ipu_resets),
.main_clk = "dpll_core_h22x2_ck",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP54XX_CM_IPU_IPU_CLKCTRL_OFFSET,
- .rstctrl_offs = OMAP54XX_RM_IPU_RSTCTRL_OFFSET,
.context_offs = OMAP54XX_RM_IPU_IPU_CONTEXT_OFFSET,
.modulemode = MODULEMODE_HWCTRL,
},
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 14/17] ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (12 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 13/17] ARM: OMAP5: " Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 15/17] ARM: OMAP24xx: hwmod: remove reset data from hwmod database Tero Kristo
` (2 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
AMx3xx reset info is now parsed from DT, so the data under hwmod
database can be removed.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
.../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 30 --------------------
arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 8 ------
arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 8 ------
3 files changed, 46 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index 907a452b..7405e78 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -27,8 +27,6 @@
#include "common.h"
#define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
-#define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
-#define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
/*
* 'l3' class
@@ -143,10 +141,6 @@ static struct omap_hwmod_class am33xx_pruss_hwmod_class = {
.name = "pruss",
};
-static struct omap_hwmod_rst_info am33xx_pruss_resets[] = {
- { .name = "pruss", .rst_shift = 1 },
-};
-
/* pru-icss */
/* Pseudo hwmod for reset control purpose only */
struct omap_hwmod am33xx_pruss_hwmod = {
@@ -159,8 +153,6 @@ struct omap_hwmod am33xx_pruss_hwmod = {
.modulemode = MODULEMODE_SWCTRL,
},
},
- .rst_lines = am33xx_pruss_resets,
- .rst_lines_cnt = ARRAY_SIZE(am33xx_pruss_resets),
};
/* gfx */
@@ -169,10 +161,6 @@ static struct omap_hwmod_class am33xx_gfx_hwmod_class = {
.name = "gfx",
};
-static struct omap_hwmod_rst_info am33xx_gfx_resets[] = {
- { .name = "gfx", .rst_shift = 0, .st_shift = 0},
-};
-
struct omap_hwmod am33xx_gfx_hwmod = {
.name = "gfx",
.class = &am33xx_gfx_hwmod_class,
@@ -183,8 +171,6 @@ struct omap_hwmod am33xx_gfx_hwmod = {
.modulemode = MODULEMODE_SWCTRL,
},
},
- .rst_lines = am33xx_gfx_resets,
- .rst_lines_cnt = ARRAY_SIZE(am33xx_gfx_resets),
};
/*
@@ -1397,17 +1383,9 @@ static void omap_hwmod_am33xx_clkctrl(void)
CLKCTRL(am33xx_aes0_hwmod , AM33XX_CM_PER_AES0_CLKCTRL_OFFSET);
}
-static void omap_hwmod_am33xx_rst(void)
-{
- RSTCTRL(am33xx_pruss_hwmod, AM33XX_RM_PER_RSTCTRL_OFFSET);
- RSTCTRL(am33xx_gfx_hwmod, AM33XX_RM_GFX_RSTCTRL_OFFSET);
- RSTST(am33xx_gfx_hwmod, AM33XX_RM_GFX_RSTST_OFFSET);
-}
-
void omap_hwmod_am33xx_reg(void)
{
omap_hwmod_am33xx_clkctrl();
- omap_hwmod_am33xx_rst();
}
static void omap_hwmod_am43xx_clkctrl(void)
@@ -1470,15 +1448,7 @@ static void omap_hwmod_am43xx_clkctrl(void)
CLKCTRL(am33xx_aes0_hwmod , AM43XX_CM_PER_AES0_CLKCTRL_OFFSET);
}
-static void omap_hwmod_am43xx_rst(void)
-{
- RSTCTRL(am33xx_pruss_hwmod, AM43XX_RM_PER_RSTCTRL_OFFSET);
- RSTCTRL(am33xx_gfx_hwmod, AM43XX_RM_GFX_RSTCTRL_OFFSET);
- RSTST(am33xx_gfx_hwmod, AM43XX_RM_GFX_RSTST_OFFSET);
-}
-
void omap_hwmod_am43xx_reg(void)
{
omap_hwmod_am43xx_clkctrl();
- omap_hwmod_am43xx_rst();
}
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index cc0791d..e4fc8b3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -64,10 +64,6 @@ static struct omap_hwmod am33xx_l4_hs_hwmod = {
},
};
-static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = {
- { .name = "wkup_m3", .rst_shift = 3, .st_shift = 5 },
-};
-
/* wkup_m3 */
static struct omap_hwmod am33xx_wkup_m3_hwmod = {
.name = "wkup_m3",
@@ -79,13 +75,9 @@ static struct omap_hwmod am33xx_wkup_m3_hwmod = {
.prcm = {
.omap4 = {
.clkctrl_offs = AM33XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
- .rstctrl_offs = AM33XX_RM_WKUP_RSTCTRL_OFFSET,
- .rstst_offs = AM33XX_RM_WKUP_RSTST_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
- .rst_lines = am33xx_wkup_m3_resets,
- .rst_lines_cnt = ARRAY_SIZE(am33xx_wkup_m3_resets),
};
/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index e97a894..d486c42 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -52,10 +52,6 @@ static struct omap_hwmod am43xx_l4_hs_hwmod = {
},
};
-static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = {
- { .name = "wkup_m3", .rst_shift = 3, .st_shift = 5 },
-};
-
static struct omap_hwmod am43xx_wkup_m3_hwmod = {
.name = "wkup_m3",
.class = &am33xx_wkup_m3_hwmod_class,
@@ -66,13 +62,9 @@ static struct omap_hwmod am43xx_wkup_m3_hwmod = {
.prcm = {
.omap4 = {
.clkctrl_offs = AM43XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
- .rstctrl_offs = AM43XX_RM_WKUP_RSTCTRL_OFFSET,
- .rstst_offs = AM43XX_RM_WKUP_RSTST_OFFSET,
.modulemode = MODULEMODE_SWCTRL,
},
},
- .rst_lines = am33xx_wkup_m3_resets,
- .rst_lines_cnt = ARRAY_SIZE(am33xx_wkup_m3_resets),
};
static struct omap_hwmod am43xx_control_hwmod = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 15/17] ARM: OMAP24xx: hwmod: remove reset data from hwmod database
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (13 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 14/17] ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 16/17] ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic Tero Kristo
2015-09-24 14:26 ` [PATCH 17/17] ARM: OMAP2+: PRM: remove redundant system reset code Tero Kristo
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
These are now parsed from DT, so not needed under the hwmod database
anymore.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 13 -------------
arch/arm/mach-omap2/omap_hwmod_2430_data.c | 7 -------
2 files changed, 20 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 65b1647..5db681d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -49,16 +49,10 @@ static struct omap_hwmod_class iva1_hwmod_class = {
.name = "iva1",
};
-static struct omap_hwmod_rst_info omap2420_iva_resets[] = {
- { .name = "iva", .rst_shift = 8 },
-};
-
static struct omap_hwmod omap2420_iva_hwmod = {
.name = "iva",
.class = &iva1_hwmod_class,
.clkdm_name = "iva1_clkdm",
- .rst_lines = omap2420_iva_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap2420_iva_resets),
.main_clk = "iva1_ifck",
};
@@ -67,17 +61,10 @@ static struct omap_hwmod_class dsp_hwmod_class = {
.name = "dsp",
};
-static struct omap_hwmod_rst_info omap2420_dsp_resets[] = {
- { .name = "logic", .rst_shift = 0 },
- { .name = "mmu", .rst_shift = 1 },
-};
-
static struct omap_hwmod omap2420_dsp_hwmod = {
.name = "dsp",
.class = &dsp_hwmod_class,
.clkdm_name = "dsp_clkdm",
- .rst_lines = omap2420_dsp_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap2420_dsp_resets),
.main_clk = "dsp_fck",
};
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 79127b3..cc0cfaf 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -44,17 +44,10 @@
*/
/* IVA2 (IVA2) */
-static struct omap_hwmod_rst_info omap2430_iva_resets[] = {
- { .name = "logic", .rst_shift = 0 },
- { .name = "mmu", .rst_shift = 1 },
-};
-
static struct omap_hwmod omap2430_iva_hwmod = {
.name = "iva",
.class = &iva_hwmod_class,
.clkdm_name = "dsp_clkdm",
- .rst_lines = omap2430_iva_resets,
- .rst_lines_cnt = ARRAY_SIZE(omap2430_iva_resets),
.main_clk = "dsp_fck",
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 16/17] ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (14 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 15/17] ARM: OMAP24xx: hwmod: remove reset data from hwmod database Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 17/17] ARM: OMAP2+: PRM: remove redundant system reset code Tero Kristo
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
OMAP4+ prcm struct no longer requires the support for the rstctrl / rstst
offsets, as the data is parsed from DT for all platforms. Remove also
the obsolete hardreset support functions from the hwmod code.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 108 --------------------------------------
arch/arm/mach-omap2/omap_hwmod.h | 4 --
2 files changed, 112 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 974260a..9d7a034 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3069,106 +3069,6 @@ static int _omap2_is_hardreset_asserted(struct omap_hwmod *oh,
oh->prcm.omap2.module_offs, 0);
}
-/**
- * _omap4_assert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to assert hardreset
- * @ohri: hardreset line data
- *
- * Call omap4_prminst_assert_hardreset() with parameters extracted
- * from the hwmod @oh and the hardreset line data @ohri. Only
- * intended for use as an soc_ops function pointer. Passes along the
- * return value from omap4_prminst_assert_hardreset(). XXX This
- * function is scheduled for removal when the PRM code is moved into
- * drivers/.
- */
-static int _omap4_assert_hardreset(struct omap_hwmod *oh,
- struct omap_hwmod_rst_info *ohri)
-{
- if (!oh->clkdm)
- return -EINVAL;
-
- return omap_prm_assert_hardreset(ohri->rst_shift,
- oh->clkdm->pwrdm.ptr->prcm_partition,
- oh->clkdm->pwrdm.ptr->prcm_offs,
- oh->prcm.omap4.rstctrl_offs);
-}
-
-/**
- * _omap4_deassert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to deassert hardreset
- * @ohri: hardreset line data
- *
- * Call omap4_prminst_deassert_hardreset() with parameters extracted
- * from the hwmod @oh and the hardreset line data @ohri. Only
- * intended for use as an soc_ops function pointer. Passes along the
- * return value from omap4_prminst_deassert_hardreset(). XXX This
- * function is scheduled for removal when the PRM code is moved into
- * drivers/.
- */
-static int _omap4_deassert_hardreset(struct omap_hwmod *oh,
- struct omap_hwmod_rst_info *ohri)
-{
- if (!oh->clkdm)
- return -EINVAL;
-
- if (ohri->st_shift)
- pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
- oh->name, ohri->name);
- return omap_prm_deassert_hardreset(ohri->rst_shift, ohri->rst_shift,
- oh->clkdm->pwrdm.ptr->prcm_partition,
- oh->clkdm->pwrdm.ptr->prcm_offs,
- oh->prcm.omap4.rstctrl_offs,
- oh->prcm.omap4.rstctrl_offs +
- OMAP4_RST_CTRL_ST_OFFSET);
-}
-
-/**
- * _omap4_is_hardreset_asserted - call OMAP4 PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to test hardreset
- * @ohri: hardreset line data
- *
- * Call omap4_prminst_is_hardreset_asserted() with parameters
- * extracted from the hwmod @oh and the hardreset line data @ohri.
- * Only intended for use as an soc_ops function pointer. Passes along
- * the return value from omap4_prminst_is_hardreset_asserted(). XXX
- * This function is scheduled for removal when the PRM code is moved
- * into drivers/.
- */
-static int _omap4_is_hardreset_asserted(struct omap_hwmod *oh,
- struct omap_hwmod_rst_info *ohri)
-{
- if (!oh->clkdm)
- return -EINVAL;
-
- return omap_prm_is_hardreset_asserted(ohri->rst_shift,
- oh->clkdm->pwrdm.ptr->
- prcm_partition,
- oh->clkdm->pwrdm.ptr->prcm_offs,
- oh->prcm.omap4.rstctrl_offs);
-}
-
-/**
- * _am33xx_deassert_hardreset - call AM33XX PRM hardreset fn with hwmod args
- * @oh: struct omap_hwmod * to deassert hardreset
- * @ohri: hardreset line data
- *
- * Call am33xx_prminst_deassert_hardreset() with parameters extracted
- * from the hwmod @oh and the hardreset line data @ohri. Only
- * intended for use as an soc_ops function pointer. Passes along the
- * return value from am33xx_prminst_deassert_hardreset(). XXX This
- * function is scheduled for removal when the PRM code is moved into
- * drivers/.
- */
-static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
- struct omap_hwmod_rst_info *ohri)
-{
- return omap_prm_deassert_hardreset(ohri->rst_shift, ohri->st_shift,
- oh->clkdm->pwrdm.ptr->prcm_partition,
- oh->clkdm->pwrdm.ptr->prcm_offs,
- oh->prcm.omap4.rstctrl_offs,
- oh->prcm.omap4.rstst_offs);
-}
-
static int _dt_assert_hardreset(struct omap_hwmod *oh,
struct omap_hwmod_rst_info *ohri)
{
@@ -3984,8 +3884,6 @@ void __init omap_hwmod_init(void)
{
if (cpu_is_omap24xx()) {
soc_ops.wait_target_ready = _omap2xxx_3xxx_wait_target_ready;
- soc_ops.assert_hardreset = _omap2_assert_hardreset;
- soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
} else if (cpu_is_omap34xx()) {
soc_ops.wait_target_ready = _omap2xxx_3xxx_wait_target_ready;
@@ -3997,9 +3895,6 @@ void __init omap_hwmod_init(void)
soc_ops.enable_module = _omap4_enable_module;
soc_ops.disable_module = _omap4_disable_module;
soc_ops.wait_target_ready = _omap4_wait_target_ready;
- soc_ops.assert_hardreset = _omap4_assert_hardreset;
- soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
- soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
soc_ops.init_clkdm = _init_clkdm;
soc_ops.update_context_lost = _omap4_update_context_lost;
soc_ops.get_context_lost = _omap4_get_context_lost;
@@ -4008,9 +3903,6 @@ void __init omap_hwmod_init(void)
soc_ops.enable_module = _omap4_enable_module;
soc_ops.disable_module = _omap4_disable_module;
soc_ops.wait_target_ready = _omap4_wait_target_ready;
- soc_ops.assert_hardreset = _omap4_assert_hardreset;
- soc_ops.deassert_hardreset = _am33xx_deassert_hardreset;
- soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
soc_ops.init_clkdm = _init_clkdm;
} else {
WARN(1, "omap_hwmod: unknown SoC type\n");
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index a6f3ac2..e1f0b76 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -451,10 +451,8 @@ struct omap_hwmod_omap2_prcm {
/**
* struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
* @clkctrl_offs: offset of the PRCM clock control register
- * @rstctrl_offs: offset of the XXX_RSTCTRL register located in the PRM
* @context_offs: offset of the RM_*_CONTEXT register
* @lostcontext_mask: bitmask for selecting bits from RM_*_CONTEXT register
- * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM
* @submodule_wkdep_bit: bit shift of the WKDEP range
* @flags: PRCM register capabilities for this IP block
* @modulemode: allowable modulemodes
@@ -467,8 +465,6 @@ struct omap_hwmod_omap2_prcm {
*/
struct omap_hwmod_omap4_prcm {
u16 clkctrl_offs;
- u16 rstctrl_offs;
- u16 rstst_offs;
u16 context_offs;
u32 lostcontext_mask;
u8 submodule_wkdep_bit;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 17/17] ARM: OMAP2+: PRM: remove redundant system reset code
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
` (15 preceding siblings ...)
2015-09-24 14:26 ` [PATCH 16/17] ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic Tero Kristo
@ 2015-09-24 14:26 ` Tero Kristo
16 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-24 14:26 UTC (permalink / raw)
To: linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
This is now handled via the reset controller and the provided information
from DT, so the legacy support code is no longer needed. OMAP3 version
shall be removed once OMAP3 is also DT only.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/prm2xxx.c | 15 ---------------
arch/arm/mach-omap2/prm33xx.c | 18 ------------------
arch/arm/mach-omap2/prm44xx.c | 1 -
arch/arm/mach-omap2/prminst44xx.c | 20 --------------------
4 files changed, 54 deletions(-)
diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c
index 752018ce..70f711b 100644
--- a/arch/arm/mach-omap2/prm2xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx.c
@@ -101,20 +101,6 @@ static int omap2xxx_pwrst_to_common_pwrst(u8 omap2xxx_pwrst)
}
/**
- * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC
- *
- * Set the DPLL reset bit, which should reboot the SoC. This is the
- * recommended way to restart the SoC. No return value.
- */
-static void omap2xxx_prm_dpll_reset(void)
-{
- omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, WKUP_MOD,
- OMAP2_RM_RSTCTRL);
- /* OCP barrier */
- omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTCTRL);
-}
-
-/**
* omap2xxx_prm_clear_mod_irqs - clear wakeup status bits for a module
* @module: PRM module to clear wakeups from
* @regs: register offset to clear
@@ -216,7 +202,6 @@ static struct prm_ll_data omap2xxx_prm_ll_data = {
.assert_hardreset = &omap2_prm_assert_hardreset,
.deassert_hardreset = &omap2_prm_deassert_hardreset,
.is_hardreset_asserted = &omap2_prm_is_hardreset_asserted,
- .reset_system = &omap2xxx_prm_dpll_reset,
.clear_mod_irqs = &omap2xxx_prm_clear_mod_irqs,
};
diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
index dcb5001..12b15a2 100644
--- a/arch/arm/mach-omap2/prm33xx.c
+++ b/arch/arm/mach-omap2/prm33xx.c
@@ -336,23 +336,6 @@ static int am33xx_check_vcvp(void)
return 0;
}
-/**
- * am33xx_prm_global_warm_sw_reset - reboot the device via warm reset
- *
- * Immediately reboots the device through warm reset.
- */
-static void am33xx_prm_global_warm_sw_reset(void)
-{
- am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK,
- AM33XX_RST_GLOBAL_WARM_SW_MASK,
- AM33XX_PRM_DEVICE_MOD,
- AM33XX_PRM_RSTCTRL_OFFSET);
-
- /* OCP barrier */
- (void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD,
- AM33XX_PRM_RSTCTRL_OFFSET);
-}
-
struct pwrdm_ops am33xx_pwrdm_operations = {
.pwrdm_set_next_pwrst = am33xx_pwrdm_set_next_pwrst,
.pwrdm_read_next_pwrst = am33xx_pwrdm_read_next_pwrst,
@@ -375,7 +358,6 @@ static struct prm_ll_data am33xx_prm_ll_data = {
.assert_hardreset = am33xx_prm_assert_hardreset,
.deassert_hardreset = am33xx_prm_deassert_hardreset,
.is_hardreset_asserted = am33xx_prm_is_hardreset_asserted,
- .reset_system = am33xx_prm_global_warm_sw_reset,
};
int __init am33xx_prm_init(const struct omap_prcm_init_data *data)
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 3076800..76d7e30 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -702,7 +702,6 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
.assert_hardreset = omap4_prminst_assert_hardreset,
.deassert_hardreset = omap4_prminst_deassert_hardreset,
.is_hardreset_asserted = omap4_prminst_is_hardreset_asserted,
- .reset_system = omap4_prminst_global_warm_sw_reset,
.vp_check_txdone = omap4_prm_vp_check_txdone,
.vp_clear_txdone = omap4_prm_vp_clear_txdone,
};
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
index d0b15db..ffed63f 100644
--- a/arch/arm/mach-omap2/prminst44xx.c
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -174,23 +174,3 @@ int omap4_prminst_deassert_hardreset(u8 shift, u8 st_shift, u8 part, s16 inst,
return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
}
-
-
-void omap4_prminst_global_warm_sw_reset(void)
-{
- u32 v;
- s32 inst = omap4_prmst_get_prm_dev_inst();
-
- if (inst == PRM_INSTANCE_UNKNOWN)
- return;
-
- v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, inst,
- OMAP4_PRM_RSTCTRL_OFFSET);
- v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
- omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION,
- inst, OMAP4_PRM_RSTCTRL_OFFSET);
-
- /* OCP barrier */
- v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
- inst, OMAP4_PRM_RSTCTRL_OFFSET);
-}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 07/17] ARM: dts: am4372: add reset data
2015-09-24 14:26 ` [PATCH 07/17] ARM: dts: am4372: " Tero Kristo
@ 2015-09-25 12:57 ` Lokesh Vutla
2015-09-28 8:11 ` Tero Kristo
0 siblings, 1 reply; 22+ messages in thread
From: Lokesh Vutla @ 2015-09-25 12:57 UTC (permalink / raw)
To: Tero Kristo, linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
Hi Tero,
On Thursday 24 September 2015 07:56 PM, Tero Kristo wrote:
> Add reset data for pruss, gfx, wkup-m3 and system reset.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
> arch/arm/boot/dts/am4372.dtsi | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
> index 0447c04a..fcc8d31 100644
> --- a/arch/arm/boot/dts/am4372.dtsi
> +++ b/arch/arm/boot/dts/am4372.dtsi
> @@ -116,12 +116,15 @@
> reg-names = "umem", "dmem";
> ti,hwmods = "wkup_m3";
> ti,pm-firmware = "am335x-pm-firmware.elf";
> + reset-names = "wkup_m3";
> + resets = <&prcm 0x2000 0x10 3 0x14 5>;
> };
>
> prcm: prcm@1f0000 {
> compatible = "ti,am4-prcm";
> reg = <0x1f0000 0x11000>;
> interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
> + #reset-cells = <5>;
>
> prcm_clocks: clocks {
> #address-cells = <1>;
> @@ -130,6 +133,12 @@
>
> prcm_clockdomains: clockdomains {
> };
> +
> + system_reset: system_reset {
> + compatible = "ti,system-reset";
> + reset-names = "system";
> + reset-cells = <&prcm 0x4000 0 0 4 0>;
This should be resets instead of reset-cells.
With this change, reboot is functional on AM437x GP evm.
Thanks and regards,
Lokesh
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 07/17] ARM: dts: am4372: add reset data
2015-09-25 12:57 ` Lokesh Vutla
@ 2015-09-28 8:11 ` Tero Kristo
0 siblings, 0 replies; 22+ messages in thread
From: Tero Kristo @ 2015-09-28 8:11 UTC (permalink / raw)
To: Lokesh Vutla, linux-omap, tony, s-anna, paul; +Cc: linux-arm-kernel
On 09/25/2015 03:57 PM, Lokesh Vutla wrote:
> Hi Tero,
>
> On Thursday 24 September 2015 07:56 PM, Tero Kristo wrote:
>> Add reset data for pruss, gfx, wkup-m3 and system reset.
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> ---
>> arch/arm/boot/dts/am4372.dtsi | 24 ++++++++++++++++++++++++
>> 1 file changed, 24 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
>> index 0447c04a..fcc8d31 100644
>> --- a/arch/arm/boot/dts/am4372.dtsi
>> +++ b/arch/arm/boot/dts/am4372.dtsi
>> @@ -116,12 +116,15 @@
>> reg-names = "umem", "dmem";
>> ti,hwmods = "wkup_m3";
>> ti,pm-firmware = "am335x-pm-firmware.elf";
>> + reset-names = "wkup_m3";
>> + resets = <&prcm 0x2000 0x10 3 0x14 5>;
>> };
>>
>> prcm: prcm@1f0000 {
>> compatible = "ti,am4-prcm";
>> reg = <0x1f0000 0x11000>;
>> interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
>> + #reset-cells = <5>;
>>
>> prcm_clocks: clocks {
>> #address-cells = <1>;
>> @@ -130,6 +133,12 @@
>>
>> prcm_clockdomains: clockdomains {
>> };
>> +
>> + system_reset: system_reset {
>> + compatible = "ti,system-reset";
>> + reset-names = "system";
>> + reset-cells = <&prcm 0x4000 0 0 4 0>;
> This should be resets instead of reset-cells.
> With this change, reboot is functional on AM437x GP evm.
Oops, nasty typo there. Thanks for catching.
-Tero
>
> Thanks and regards,
> Lokesh
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller
2015-09-24 14:26 ` [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller Tero Kristo
@ 2015-10-06 12:06 ` Tony Lindgren
2015-11-30 17:09 ` Tony Lindgren
0 siblings, 1 reply; 22+ messages in thread
From: Tony Lindgren @ 2015-10-06 12:06 UTC (permalink / raw)
To: Tero Kristo; +Cc: paul, linux-omap, linux-arm-kernel
* Tero Kristo <t-kristo@ti.com> [150924 07:30]:
> PRM driver now supports reset controller for the defined reset lines.
> Reset configurations are provided through device tree. Later, functionality
> like hwmod and system reboot will be changed to use the generic framework.
This approach seems good to me in general. This should have the related
reset driver documentation too for the binding though.
Regards,
Tony
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller
2015-10-06 12:06 ` Tony Lindgren
@ 2015-11-30 17:09 ` Tony Lindgren
0 siblings, 0 replies; 22+ messages in thread
From: Tony Lindgren @ 2015-11-30 17:09 UTC (permalink / raw)
To: Tero Kristo; +Cc: paul, linux-omap, linux-arm-kernel
* Tony Lindgren <tony@atomide.com> [151006 05:12]:
> * Tero Kristo <t-kristo@ti.com> [150924 07:30]:
> > PRM driver now supports reset controller for the defined reset lines.
> > Reset configurations are provided through device tree. Later, functionality
> > like hwmod and system reboot will be changed to use the generic framework.
>
> This approach seems good to me in general. This should have the related
> reset driver documentation too for the binding though.
Also, with the initcall changes I just posted, it seems this can become
just a regular device driver that gets initialized at core_initcall level.
Regards,
Tony
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2015-11-30 17:09 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 14:26 [PATCH 00/17] ARM: OMAP2+: reset controller support Tero Kristo
2015-09-24 14:26 ` [PATCH 01/17] ARM: OMAP2+: PRM: add support for reset controller Tero Kristo
2015-10-06 12:06 ` Tony Lindgren
2015-11-30 17:09 ` Tony Lindgren
2015-09-24 14:26 ` [PATCH 02/17] ARM: OMAP2+: hwmod: parse also soc hierarchy for hwmod compatible nodes Tero Kristo
2015-09-24 14:26 ` [PATCH 03/17] ARM: dts: omap3: add reset data Tero Kristo
2015-09-24 14:26 ` [PATCH 04/17] ARM: dts: omap4: " Tero Kristo
2015-09-24 14:26 ` [PATCH 05/17] ARM: dts: omap5: " Tero Kristo
2015-09-24 14:26 ` [PATCH 06/17] ARM: dts: dra7: " Tero Kristo
2015-09-24 14:26 ` [PATCH 07/17] ARM: dts: am4372: " Tero Kristo
2015-09-25 12:57 ` Lokesh Vutla
2015-09-28 8:11 ` Tero Kristo
2015-09-24 14:26 ` [PATCH 08/17] ARM: dts: am33xx: " Tero Kristo
2015-09-24 14:26 ` [PATCH 09/17] ARM: dts: OMAP24xx: " Tero Kristo
2015-09-24 14:26 ` [PATCH 10/17] ARM: OMAP2+: hwmod: parse reset information from DT Tero Kristo
2015-09-24 14:26 ` [PATCH 11/17] ARM: OMAP2+: use system reset info from device tree data Tero Kristo
2015-09-24 14:26 ` [PATCH 12/17] ARM: OMAP4: hwmod_data: remove reset data Tero Kristo
2015-09-24 14:26 ` [PATCH 13/17] ARM: OMAP5: " Tero Kristo
2015-09-24 14:26 ` [PATCH 14/17] ARM: OMAP2: hwmod: AMx3xx: remove redundant reset info Tero Kristo
2015-09-24 14:26 ` [PATCH 15/17] ARM: OMAP24xx: hwmod: remove reset data from hwmod database Tero Kristo
2015-09-24 14:26 ` [PATCH 16/17] ARM: OMAP2+: hwmod: remove obsolete support for some hardreset logic Tero Kristo
2015-09-24 14:26 ` [PATCH 17/17] ARM: OMAP2+: PRM: remove redundant system reset code Tero Kristo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).