14 Apr, 2017
2 commits
-
The Gemini (SL3516) SoC has a special power controller block
that only deal with shutting down the system.If you do not register a driver and activate the block, the
power button on the systems utilizing this SoC will do an
uncontrolled power cut, which is why it is important to have
a special poweroff driver.The most basic functionality is to just shut down the system
by writing a special bit in the control register after the
system has reached pm_poweroff.It also handles the poweroff from a button or other sources:
When the poweroff button is pressed, or a signal is sent to
poweroff from an infrared remote control, or when the RTC
fires a special alarm (!) the system emits an interrupt.
At this point, Linux must acknowledge the interrupt and
proceed to do an orderly shutdown of the system.After adding this driver, pressing the poweroff button gives
this dmesg:root@gemini:/
root@gemini:/ gemini-poweroff 4b000000.power-controller:
poweroff button pressedcalling shutdown scripts..
setting /dev/rtc0 from system time
unmounting file systems...
umount: tmpfs busy - remounted read-only
umount: can't unmount /: Invalid argument
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system poweroff
uhci_hcd 0000:00:09.1: HCRESET not completed yet!
uhci_hcd 0000:00:09.0: HCRESET not completed yet!
reboot: Power down
gemini-poweroff 4b000000.power-controller: Gemini power offCc: Janos Laube
Cc: Paulius Zaleckas
Cc: Hans Ulli Kroll
Cc: Florian Fainelli
Cc: linux-pm@vger.kernel.org
Cc: Sebastian Reichel
Signed-off-by: Linus Walleij
Signed-off-by: Sebastian Reichel -
Make the syscon-poweroff driver accept value and mask instead of
just value.Prior to this patch, the property name for the value was 'mask'. If
only the mask property is defined on a node, maintain compatibility
by using it as the value.Signed-off-by: Guy Shapiro
Acked-by: Rob Herring
Signed-off-by: Sebastian Reichel
19 Jan, 2017
2 commits
-
commit eacd8d09db7f ("power/reset: at91-reset: remove useless
at91_reset_platform_probe()") removed non DT probe support but forgot to
remove the now useless id_table. Do that now.Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel -
Add samx7 support. It is lacking a few bits and needs a new reset function.
Signed-off-by: Szemző András
Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel
17 Jan, 2017
1 commit
-
LPDDR memories can only handle up to 400 uncontrolled power off. Ensure the
proper power off sequence is used before shutting down the platform.Cc: # 4.4+
Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel
26 Dec, 2016
1 commit
-
ktime_set(S,N) was required for the timespec storage type and is still
useful for situations where a Seconds and Nanoseconds part of a time value
needs to be converted. For anything where the Seconds argument is 0, this
is pointless and can be replaced with a simple assignment.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
19 Oct, 2016
4 commits
-
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/power/reset/zx-reboot.ko | grep alias
$After this patch:
$ modinfo drivers/power/reset/zx-reboot.ko | grep alias
alias: of:N*T*Czte,sysctrlC*
alias: of:N*T*Czte,sysctrlSigned-off-by: Javier Martinez Canillas
Signed-off-by: Sebastian Reichel -
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/power/reset/syscon-reboot-mode.ko | grep alias
$After this patch:
$ modinfo drivers/power/reset/syscon-reboot-mode.ko | grep alias
alias: of:N*T*Csyscon-reboot-modeC*
alias: of:N*T*Csyscon-reboot-modeSigned-off-by: Javier Martinez Canillas
Signed-off-by: Sebastian Reichel -
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/power/reset/at91-poweroff.ko | grep alias
$After this patch:
$ modinfo drivers/power/reset/at91-poweroff.ko | grep alias
alias: of:N*T*Catmel,at91sam9x5-shdwcC*
alias: of:N*T*Catmel,at91sam9x5-shdwc
alias: of:N*T*Catmel,at91sam9rl-shdwcC*
alias: of:N*T*Catmel,at91sam9rl-shdwc
alias: of:N*T*Catmel,at91sam9260-shdwcC*
alias: of:N*T*Catmel,at91sam9260-shdwcSigned-off-by: Javier Martinez Canillas
Signed-off-by: Sebastian Reichel -
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/power/reset/at91-reset.ko | grep alias
$After this patch:
$ modinfo drivers/power/reset/at91-reset.ko | grep alias
alias: of:N*T*Catmel,sama5d3-rstcC*
alias: of:N*T*Catmel,sama5d3-rstc
alias: of:N*T*Catmel,at91sam9g45-rstcC*
alias: of:N*T*Catmel,at91sam9g45-rstc
alias: of:N*T*Catmel,at91sam9260-rstcC*
alias: of:N*T*Catmel,at91sam9260-rstc
alias: platform:at91-sam9g45-reset
alias: platform:at91-sam9260-resetSigned-off-by: Javier Martinez Canillas
Signed-off-by: Sebastian Reichel
18 Oct, 2016
1 commit
-
Add a driver which allows powering off the system via an Intel PIIX4
southbridge, by entering the PIIX4 SOff state. This is useful on the
MIPS Malta development board, where it will power down the FPGA based
board until its ON/NMI button is pressed, or the QEMU implementation of
the MIPS Malta board where it will cause QEMU to exit.Signed-off-by: Paul Burton
Cc: Sebastian Reichel
Cc: Dmitry Eremin-Solenikov
Cc: David Woodhouse
Cc: linux-pm@vger.kernel.org
Signed-off-by: Sebastian Reichel
20 Sep, 2016
4 commits
-
This patch removes support for STiH415/6 SoC's from the
st-poweroff driver, as support for these platforms is
being removed from the kernel.Signed-off-by: Peter Griffin
Cc:
Signed-off-by: Sebastian Reichel -
Free memory mapping, if probe is not successful.
Signed-off-by: Arvind Yadav
Signed-off-by: Sebastian Reichel -
Free memory mapping, if probe is not successful.
Signed-off-by: Arvind Yadav
Signed-off-by: Sebastian Reichel -
A dev_err message spans two lines and the literal string is missing
a white space between words. Add the white space.Signed-off-by: Colin Ian King
Signed-off-by: Sebastian Reichel
16 Aug, 2016
3 commits
-
Power Supply Fixes for 4.8 cycle
-
Use the managed resource version of reboot_mode_register().
Signed-off-by: Bjorn Andersson
Tested-by: John Stultz
Signed-off-by: Sebastian Reichel -
Provide managed resource version of reboot_mode_register() and
reboot_mode_unregister() to simplify implementations.Signed-off-by: Bjorn Andersson
Tested-by: John Stultz
Signed-off-by: Sebastian Reichel
13 Aug, 2016
2 commits
-
Free memory mapping, if probe is not successful.
Fixes: 4a9b37371822 ("power: reset: move hisilicon reboot code")
Signed-off-by: Arvind Yadav
Signed-off-by: Sebastian Reichel -
commit 4fcd504edbf7 ("power: reset: add reboot mode driver") uses api from
syscon, and syscon uses ioremap/iounmap which depends on HAS_IOMEM, so
let's depend on MFD_SYSCON instead of selecting it directly to avoid the
um-allyesconfig like build error on archs that without iomem:drivers/mfd/syscon.c: In function 'of_syscon_register':
drivers/mfd/syscon.c:67:9: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
base = ioremap(res.start, resource_size(&res));
^
drivers/mfd/syscon.c:67:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
base = ioremap(res.start, resource_size(&res));
^
drivers/mfd/syscon.c:109:2: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
iounmap(base);
^Reported-by: Kbuild test robot
Fixes: 4fcd504edbf7("power: reset: add reboot mode driver")
Signed-off-by: Andy Yan
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Sebastian Reichel
02 Aug, 2016
2 commits
-
Pull ARM SoC driver updates from Olof Johansson:
"Driver updates for ARM SoCs.A slew of changes this release cycle. The reset driver tree, that we
merge through arm-soc for historical reasons, is also sizable this
time around.Among the changes:
- clps711x: Treewide changes to compatible strings, merged here for simplicity.
- Qualcomm: SCM firmware driver cleanups, move to platform driver
- ux500: Major cleanups, removal of old mach-specific infrastructure.
- Atmel external bus memory driver
- Move of brcmstb platform to the rest of bcm
- PMC driver updates for tegra, various fixes and improvements
- Samsung platform driver updates to support 64-bit Exynos platforms
- Reset controller cleanups moving to devm_reset_controller_register() APIs
- Reset controller driver for Amlogic Meson
- Reset controller driver for Hisilicon hi6220
- ARM SCPI power domain support"* tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (100 commits)
ARM: ux500: consolidate base platform files
ARM: ux500: move soc_id driver to drivers/soc
ARM: ux500: call ux500_setup_id later
ARM: ux500: consolidate soc_device code in id.c
ARM: ux500: remove cpu_is_u* helpers
ARM: ux500: use CLK_OF_DECLARE()
ARM: ux500: move l2x0 init to .init_irq
mfd: db8500 stop passing around platform data
ASoC: ab8500-codec: remove platform data based probe
ARM: ux500: move ab8500_regulator_plat_data into driver
ARM: ux500: remove unused regulator data
soc: raspberrypi-power: add CONFIG_OF dependency
firmware: scpi: add CONFIG_OF dependency
video: clps711x-fb: Changing the compatibility string to match with the smallest supported chip
input: clps711x-keypad: Changing the compatibility string to match with the smallest supported chip
pwm: clps711x: Changing the compatibility string to match with the smallest supported chip
serial: clps711x: Changing the compatibility string to match with the smallest supported chip
irqchip: clps711x: Changing the compatibility string to match with the smallest supported chip
clocksource: clps711x: Changing the compatibility string to match with the smallest supported chip
clk: clps711x: Changing the compatibility string to match with the smallest supported chip
... -
Pull ARM SoC cleanups from Olof Johansson:
"The cleanup branch keeps going down in size as we've completed a lot
of the major legacy platform removals and conversions.A handful of changes this time around, some of the themes or larger
sets are:- A bunch of i.MX cleanups around platform detection, init call cleanups
- Misc fixes of missing/implicit includes
- Removal of ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB"* tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (40 commits)
ARM: mps2: fix typo
ARM: s3c64xx: avoid warning about 'struct device_node'
bus: mvebu-mbus: make mvebu_mbus_syscore_ops static
bus: mvebu-mbus: fix __iomem on register pointers
ARM: tegra: Remove board_init_funcs array
ARM: iop: Fix indentation
ARM: imx: remove cpu_is_mx*()
ARM: imx: remove last call to cpu_is_mx5*
ARM: imx: rework mx27_pm_init() call
ARM: imx: deconstruct mx3_idle
ARM: imx: deconstruct mxc_rnga initialization
ARM: imx: remove cpu_is_mx1 check
ARM: i.MX: Do not explicitly call l2x0_of_init()
ARM: i.MX: system.c: Tweak prefetch settings for performance
ARM: i.MX: system.c: Replace magic numbers
ARM: i.MX: system.c: Remove redundant errata 752271 code
ARM: i.MX: system.c: Convert goto to if statement
ARM: Kirkwood: fix kirkwood_pm_init() declaration/type
ARM: Kirkwood: make kirkwood_disable_mbus_error_propagation() static
ARM: orion5x: make orion5x_legacy_handle_irq static
...
06 Jul, 2016
1 commit
-
This driver parses the reboot commands like "reboot bootloader"
and "reboot recovery" to get a boot mode described in the
device tree , then call the write interfae to store the boot
mode in some place like special register or sram, which can
be read by the bootloader after system reboot, then the bootloader
can take different action according to the mode stored.This is commonly used on Android based devices, in order to
reboot the device into fastboot or recovery mode.Reviewed-by: Matthias Brugger
Reviewed-by: Moritz Fischer
Tested-by: John Stultz
Acked-by: John Stultz
Signed-off-by: Andy Yan
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Sebastian Reichel
13 Jun, 2016
1 commit
-
The dev_attr_active is not exported or defined to be used
outside the driver, so make it static to avoid the following
warning:drivers/power/reset/vexpress-poweroff.c:77:1: warning: symbol 'dev_attr_active' was not declared. Should it be static?
Cc: Liviu Dudau
Cc: Lorenzo Pieralisi
Signed-off-by: Ben Dooks
Signed-off-by: Sudeep Holla
10 Jun, 2016
1 commit
-
The syscon_poweroff() function is not exported or declared for
usage elsewhere, so make it static to avoid the folloiwing warning:drivers/power/reset/syscon-poweroff.c:33:6: warning: symbol 'syscon_poweroff' was not declared. Should it be static?
Signed-off-by: Ben Dooks
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Sebastian Reichel
07 Jun, 2016
1 commit
-
This driver supports reset on both BCM21664 and BCM23550.
Code is being moved from arch/arm/mach-bcm/board_bcm21664.cSigned-off-by: Chris Brand
Acked-By: Sebastian Reichel
Signed-off-by: Florian Fainelli
03 Jun, 2016
1 commit
-
Enable the COMPILE_TEST to get build coverage, except on platforms
!HAS_IOMEM (required by selected MFD_SYSCON).Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Sebastian Reichel
10 Apr, 2016
1 commit
-
Sama5d2 SoC has a completely new shutdown controller with new features and
register layout. It thus makes sense to add a new driver for this new
peripheral.This driver is Device Tree only and handles events from the wake-up pin and
the RTC.
As the register layout may change in the future, so some values are encoded
in a configuration structure.Signed-off-by: Nicolas Ferre
Acked-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel
15 Feb, 2016
2 commits
-
Not every arch has io memory.
So, unbreak the build by fixing the dependencies.Signed-off-by: Richard Weinberger
Signed-off-by: Sebastian Reichel -
While this driver is named after the Versatile family of
boards (ARM reference designs) the machine actually called
Versatile was not supported. This patch makes the driver
handle also that machine. We augment the register names for
the reset to *VERSATILE* as well since it is the same
register offsets for Versatile and RealView.Cc: Rob Herring
Signed-off-by: Linus Walleij
Signed-off-by: Sebastian Reichel
05 Dec, 2015
1 commit
-
for_each_matching_node performs an of_node_get on each iteration, so
a break out of the loop requires an of_node_put.A simplified version of the semantic patch that fixes this problem is as
follows (http://coccinelle.lip6.fr)://
@@
expression e,e1;
local idexpression np;
@@for_each_matching_node(np, e1) {
... when != of_node_put(np)
when != e = np
(
return np;
|
+ of_node_put(np);
? return ...;
)
...
}
//Signed-off-by: Julia Lawall
Signed-off-by: Sebastian Reichel
22 Sep, 2015
6 commits
-
This diver doesn't applies only on SAM9 SoC families but on SAMA5 families
as well.Signed-off-by: Nicolas Ferre
Signed-off-by: Sebastian Reichel -
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
hang") added a workaround for the slow clock as it is not properly handled
by its users.Get and use the slow clock as it is necessary for the at91 shutdown
controller.Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel -
It was not possible to compile at91-poweroff as a module. Implement
.remove() to allow it. Also switch to module_platform_driver_probe() as it
is not hotpluggable.Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel -
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
hang") added a workaround for the slow clock as it is not properly handled
by its users.Get and use the slow clock as it is necessary for the at91 reset
controller.Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel -
It was not possible to compile at91-reset as a module. Implement .remove()
to allow it. Also switch to module_platform_driver_probe() as it is not
hotpluggable.Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel -
Since all the at91 platforms are now DT only, at91_reset_platform_probe()
is now useless, remove it.Signed-off-by: Alexandre Belloni
Signed-off-by: Sebastian Reichel
27 Jul, 2015
1 commit
-
Including ARM related header file cause build failure
in i386 build because COMILE_TEST also involve building
zx driver. Remove the unnecessary include file.Signed-off-by: Jun Nie
Signed-off-by: Sebastian Reichel
24 Jul, 2015
1 commit
-
Register with kernel restart handler instead of setting arm_pm_restart
directly.Signed-off-by: Jun Nie
Signed-off-by: Sebastian Reichel
21 Jul, 2015
1 commit
-
This patch introduces a new compatible string: "atmel,sama5d3-rstc" and
new reset function for sama5d3 and later chips.As in sama5d3 or later chips, we don't have to shutdown the DDR
controller before reset. Shutdown the DDR controller before reset is a
workaround to avoid DDR signal driving the bus, but since sama5d3 and
later chips there is no such a conflict.So in this patch:
1. the sama5d3 reset function only need to write the rstc register
and return.
2. we can remove the code related with sama5d3 DDR controller as
we don't use it at all.Signed-off-by: Josh Wu
Acked-by: Nicolas Ferre
Acked-by: Alexandre Belloni
Reviewed-by: Guenter Roeck
Signed-off-by: Sebastian Reichel