Add support for additional reset causes and the proper compatibility
string for sam9x60 SoC. The restart function is the same as the samx7.
Signed-off-by: Nicolas Ferre <[email protected]>
Reviewed-by: Alexandre Belloni <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
commit eacd8d09db ("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 <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Add samx7 support. It is lacking a few bits and needs a new reset function.
Signed-off-by: Szemző András <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
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-reset
Signed-off-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
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):
// <smpl>
@@
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 ...;
)
...
}
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
This diver doesn't applies only on SAM9 SoC families but on SAMA5 families
as well.
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Commit dca1a4b5ff ("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 <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
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 <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Since all the at91 platforms are now DT only, at91_reset_platform_probe()
is now useless, remove it.
Signed-off-by: Alexandre Belloni <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
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 <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
The platform_device_id is not modified by the driver and core uses it as
const.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
In case of error, the function devm_ioremap() returns NULL
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
Fixes: ecfe64d8c5 ("power: reset: Add AT91 reset driver")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Fix the passing of big endian data to routines that will be writing
it to the bus in the wrong order.
Signed-off-by: Ben Dooks <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)
Signed-off-by: Fabian Frederick <[email protected]>
[for vexpress]
Acked-by: Sudeep Holla <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Register with kernel restart handler instead of setting arm_pm_restart
directly. Register with high priority since the driver unconditionally
overwrites other restart handlers if instantiated.
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Move the (DDR) SDRAM controller headers to include/soc/at91 to remove the
dependency on mach/ headers from the at91-reset driver.
Signed-off-by: Alexandre Belloni <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
In the case of at91sam9g45_restart(), the driver is writing
AT91_DDRSDRC_LPCB_POWER_DOWN to AT91_DDRSDRC_RTR, this should actually be
AT91_DDRSDRC_LPR.
Signed-off-by: Alexandre Belloni <[email protected]>
Acked-by: Sebastian Reichel <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
Implement the reset behaviour of the various AT91 SoCS in drivers/power/reset.
It used to be (and still is) located in arch/arm/mach-at91, and in order to
preserve bisectability is not removed yet, but every board should be converted
to use this driver instead.
Signed-off-by: Maxime Ripard <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>