From: Tony Prisk <hidden> Date: 2012-07-18 12:37:10
Changed the existing board files to use .restart in there machine
descriptions.
Removed system.h as it only contained an inline for arch_reset()
Added device tree support for the restart controller.
Device tree support for vt8500 is still a work-in-progress.
Signed-off-by: Tony Prisk <redacted>
---
?arch/arm/mach-vt8500/Makefile?????????????? |??? 2 +-
?arch/arm/mach-vt8500/bv07.c???????????????? |??? 3 +
?arch/arm/mach-vt8500/include/mach/restart.h |?? 17 +++++++
?arch/arm/mach-vt8500/include/mach/system.h? |?? 13 -----
?arch/arm/mach-vt8500/restart.c????????????? |?? 64 +++++++++++++++++++++++++++
?arch/arm/mach-vt8500/wm8505_7in.c?????????? |??? 4 +-
?6 files changed, 88 insertions(+), 15 deletions(-)
?create mode 100644 arch/arm/mach-vt8500/include/mach/restart.h
?delete mode 100644 arch/arm/mach-vt8500/include/mach/system.h
?create mode 100644 arch/arm/mach-vt8500/restart.c
Changed the existing board files to use .restart in there machine
Looks like a typo here :)
quoted hunk
descriptions.
Removed system.h as it only contained an inline for arch_reset()
Added device tree support for the restart controller.
Device tree support for vt8500 is still a work-in-progress.
Signed-off-by: Tony Prisk <redacted>
---
arch/arm/mach-vt8500/Makefile | 2 +-
arch/arm/mach-vt8500/bv07.c | 3 +
arch/arm/mach-vt8500/include/mach/restart.h | 17 +++++++
arch/arm/mach-vt8500/include/mach/system.h | 13 -----
arch/arm/mach-vt8500/restart.c | 64 +++++++++++++++++++++++++++
arch/arm/mach-vt8500/wm8505_7in.c | 4 +-
6 files changed, 88 insertions(+), 15 deletions(-)
create mode 100644 arch/arm/mach-vt8500/include/mach/restart.h
delete mode 100644 arch/arm/mach-vt8500/include/mach/system.h
create mode 100644 arch/arm/mach-vt8500/restart.c
@@ -62,6 +63,7 @@ void __init bv07_init(void)elseprintk(KERN_ERR"PMC Hibernation register could not be remapped, not enabling power off!\n");+wmt_setup_restart();vt8500_set_resources();platform_add_devices(devices,ARRAY_SIZE(devices));vt8500_gpio_init();
@@ -69,6 +71,7 @@ void __init bv07_init(void)MACHINE_START(BV07,"Benign BV07 Mini Netbook").atag_offset=0x100,+.restart=wmt_restart,.reserve=vt8500_reserve_mem,.map_io=vt8500_map_io,.init_irq=vt8500_init_irq,
Changed the existing board files to use .restart in there machine
descriptions.
Removed system.h as it only contained an inline for arch_reset()
Added device tree support for the restart controller.
Device tree support for vt8500 is still a work-in-progress.
Signed-off-by: Tony Prisk <redacted>
Looks ok from the point of view that it's technically correct.
Let me make some comments about the style though:
I think it's better to point this to the pmc_base virtual address,
which is what we commonly do for similar scenarios. This also means
changing the phys address constant here to 0xD8130000, i.e. the
same as the one in the device tree.
+ /*
+ * Check if Power Mgmt Controller node is present in device tree. If no
+ * device tree node, use the legacy PMSR value (valid for all current
+ * SoCs).
+ */
+ np = of_find_compatible_node(NULL, NULL, "wmt,prizm-pmc");
+ if (np) {
+ pmc_base = of_iomap(np, 0);
+
+ if (!pmc_base)
+ pr_err("%s:of_iomap(pmc) failed\n", __func__);
+
+ of_node_put(np);
+
+ wmt_restart_reg = (void *)((u32)(pmc_base) + WMT_PRIZM_PMSR_REG);
The type cast is ugly, wrong and uncessary ;-)
It's ugly because you are casting the same address twice, which you should
never need to do.
It's wrong because you use the wrong target type (should be void __iomem *)
and the intermediate type (u32) relies on the code being compiled for 32
bit. This is probably a safe assumption, but if you have to cast between
a pointer and an integer in the kernel, the idiom is to use 'unsigned long'
as the integer type.
It's also unnecessary because
wmt_restart_reg = pmc_base + WMT_PRIZM_PMSR_REG;
has the exact same effect without any of the above disadvantages.
As mentioned, I would not do the calculation here at all but instead
do it below in wmt_restart(), as
if (pmc_base)
writel(1, pmc_base + WMT_PRIZM_PMSR_REG);
Arnd
From: Tony Prisk <hidden> Date: 2012-07-18 13:43:35
Removed system.h as it only contained an inline for arch_reset()
Changed the existing board files to use .restart in machine descriptions.
Added device tree support for the restart controller.
Device tree support for mach-vt8500 is still a work-in-progress.
Change History
v3: style changes.
Signed-off-by: Tony Prisk <redacted>
---
?arch/arm/mach-vt8500/Makefile?????????????? |??? 2 +-
?arch/arm/mach-vt8500/bv07.c???????????????? |??? 3 +
?arch/arm/mach-vt8500/include/mach/restart.h |?? 17 ++++++++
?arch/arm/mach-vt8500/include/mach/system.h? |?? 13 ------
?arch/arm/mach-vt8500/restart.c????????????? |?? 54 +++++++++++++++++++++++++++
?arch/arm/mach-vt8500/wm8505_7in.c?????????? |??? 4 +-
?6 files changed, 78 insertions(+), 15 deletions(-)
?create mode 100644 arch/arm/mach-vt8500/include/mach/restart.h
?delete mode 100644 arch/arm/mach-vt8500/include/mach/system.h
?create mode 100644 arch/arm/mach-vt8500/restart.c
Removed system.h as it only contained an inline for arch_reset()
Changed the existing board files to use .restart in machine descriptions.
Added device tree support for the restart controller.
Device tree support for mach-vt8500 is still a work-in-progress.
Change History
v3: style changes.
The change history of the patch should go below the '---'
line, there is no need to preserve that in the git changelog
in cases like this. For larger patches you may actually
want to preserve it and put it here, but the fact that you
applied style changes is not such a case ;-)
Signed-off-by: Tony Prisk <redacted>
Acked-by: Arnd Bergmann <arnd@arndb.de>
The patch looks good, but you've sent it through a mail client
that mangles the patch into a form that I cannot apply.
Please use git-send-email or use a setup described in
Documentation/email-clients.txt.
The preferred way would actually be a 'git request-pull'
with a public git URL, but patches are also fine
if it's only an occasional bug fix like this.
Arnd
Removed system.h as it only contained an inline for arch_reset()
Changed the existing board files to use .restart in machine descriptions.
Added device tree support for the restart controller.
Device tree support for mach-vt8500 is still a work-in-progress.
Change History
v3: style changes.
Signed-off-by: Tony Prisk <redacted>