Re: [PATCH v3 2/2] m68k: coldfire/5441x: register mcf-rcm-reset platform device
Greg Ungerer <[email protected]> Tue, 21 Jul 2026 09:35:05 +1000
| Newsgroups | org.kernel.vger.linux-m68k,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <[email protected]> |
Hi Jean-Michel, On 18/6/26 05:17, Jean-Michel Hautbois wrote: > 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 <[email protected]> Applied to m68knommu git tree, for-next branch. Thanks Greg > --- > arch/m68k/coldfire/m5441x.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/arch/m68k/coldfire/m5441x.c b/arch/m68k/coldfire/m5441x.c > index 7a25cfc7ac07..852e52d95eaf 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> > @@ -239,6 +240,30 @@ static void __init m5441x_fec_init(void) > __raw_writeb(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(); >