diff options
| author | Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org> | 2026-06-17 21:17:16 +0200 |
|---|---|---|
| committer | Greg Ungerer <gerg@kernel.org> | 2026-08-11 16:17:10 +1000 |
| commit | de0dab22cbf6943d0f12f3b1e2eb1bbdd807f039 (patch) | |
| tree | 7c70ad0c182e484fcf46386e5fd1288459345f0a /arch | |
| parent | b47eeaa48ee5f28213056a749cb02ebdcb1d42bd (diff) | |
| download | linux-next-de0dab22cbf6943d0f12f3b1e2eb1bbdd807f039.tar.gz linux-next-de0dab22cbf6943d0f12f3b1e2eb1bbdd807f039.zip | |
m68k: coldfire/5441x: register mcf-rcm-reset platform device
Add SoC-level registration of the mcf-rcm-reset platform device so the
power_on_reason sysfs attribute is created on every MCF5441x board
without per-board boilerplate.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/m68k/coldfire/m5441x.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/m68k/coldfire/m5441x.c b/arch/m68k/coldfire/m5441x.c index 5b5e09ecf487..ad3d0021578f 100644 --- a/arch/m68k/coldfire/m5441x.c +++ b/arch/m68k/coldfire/m5441x.c @@ -11,6 +11,7 @@ #include <linux/init.h> #include <linux/io.h> #include <linux/clk.h> +#include <linux/platform_device.h> #include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> @@ -242,6 +243,30 @@ static void __init m5441x_fec_init(void) mcf_write8(0x03, MCFGPIO_PAR_FEC); } +/* + * Reset Controller Module status register. Exposed to userspace as + * /sys/devices/platform/mcf-rcm-reset/power_on_reason by the mcf-rcm-reset + * driver (drivers/power/reset/mcf-rcm-reset.c). + */ +static struct resource m5441x_rcm_resource[] = { + { + .start = MCF_RSR, + .end = MCF_RSR, + .flags = IORESOURCE_MEM, + }, +}; + +static int __init m5441x_rcm_init(void) +{ + struct platform_device *pdev; + + pdev = platform_device_register_simple("mcf-rcm-reset", -1, + m5441x_rcm_resource, + ARRAY_SIZE(m5441x_rcm_resource)); + return PTR_ERR_OR_ZERO(pdev); +} +arch_initcall(m5441x_rcm_init); + void __init config_BSP(char *commandp, int size) { m5441x_clk_init(); |
