linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH NEXT 3/4] powerpc/pasemi: Add Nemo board device init code.
@ 2017-12-31 22:08 Darren Stevens
  2018-05-03 13:06 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Stevens @ 2017-12-31 22:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Christian Zigotzky

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

  AmigaOS...........: http://yam.ch/
  Unix/MacOS/Windows: http://www.mozilla.com/thunderbird/

General information about MIME can be found at:
http://en.wikipedia.org/wiki/MIME

[-- Attachment #2: Type: text/plain, Size: 297 bytes --]

    Add routines for Nemo specific devices to init at boot time, these
    being board level power-off and SB600's rtc.
    
    Also add a run time variable to prevent these being activated
    if we boot on a reference board.
    
    Signed-off-by: Darren Stevens <Darren@stevens-zone.net>

---

[-- Attachment #3: devs.patch --]
[-- Type: text/plain, Size: 1563 bytes --]

diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index c583c17..8d3664f 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -73,6 +73,19 @@ static void __noreturn pas_restart(char *cmd)
 		out_le32(reset_reg, 0x6000000);
 }
 
+#ifdef CONFIG_PPC_PASEMI_NEMO
+/* A flag to indicate we are running on Nemo */
+static bool nemo_board = false;
+
+void pas_shutdown(void)
+{
+	/* Set the PLD bit that makes the SB600 think the power button is being pressed */
+	void __iomem *pld_map = ioremap(0xf5000000,4096);
+	while (1)
+		out_8(pld_map+7,0x01);
+}
+#endif
+
 #ifdef CONFIG_SMP
 static arch_spinlock_t timebase_lock;
 static unsigned long timebase;
@@ -492,6 +505,20 @@ static inline void pasemi_pcmcia_init(void)
 	{},
 };
 
+#ifdef CONFIG_PPC_PASEMI_NEMO
+static struct resource rtc_resource[] = {{
+	.name = "rtc",
+	.start = 0x70,
+	.end = 0x71,
+	.flags = IORESOURCE_IO,
+}, {
+	.name = "rtc",
+	.start = 8,
+	.end = 8,
+	.flags = IORESOURCE_IRQ,
+}};
+#endif
+
 static int __init pasemi_publish_devices(void)
 {
 	pasemi_pcmcia_init();
@@ -499,6 +526,14 @@ static int __init pasemi_publish_devices(void)
 	/* Publish OF platform devices for SDC and other non-PCI devices */
 	of_platform_bus_probe(NULL, pasemi_bus_ids, NULL);
 
+#ifdef CONFIG_PPC_PASEMI_NEMO
+	/*
+	 * Activate the SB600's rtc
+	 */
+	if (nemo_board)
+		platform_device_register_simple("rtc_cmos", -1, rtc_resource, 2);
+#endif
+
 	return 0;
 }
 machine_device_initcall(pasemi, pasemi_publish_devices);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH NEXT 3/4] powerpc/pasemi: Add Nemo board device init code.
  2017-12-31 22:08 [PATCH NEXT 3/4] powerpc/pasemi: Add Nemo board device init code Darren Stevens
@ 2018-05-03 13:06 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-05-03 13:06 UTC (permalink / raw)
  To: Darren Stevens, linuxppc-dev; +Cc: Christian Zigotzky

Darren Stevens <darren@stevens-zone.net> writes:

> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
> index c583c17..8d3664f 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -73,6 +73,19 @@ static void __noreturn pas_restart(char *cmd)
>  		out_le32(reset_reg, 0x6000000);
>  }
>  
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +/* A flag to indicate we are running on Nemo */
> +static bool nemo_board = false;
> +
> +void pas_shutdown(void)
> +{
> +	/* Set the PLD bit that makes the SB600 think the power button is being pressed */
> +	void __iomem *pld_map = ioremap(0xf5000000,4096);

I guess that's not in the device tree anywhere?

> +	while (1)
> +		out_8(pld_map+7,0x01);
> +}
> +#endif
> +
>  #ifdef CONFIG_SMP
>  static arch_spinlock_t timebase_lock;
>  static unsigned long timebase;
> @@ -492,6 +505,20 @@ static inline void pasemi_pcmcia_init(void)
>  	{},
>  };
>  
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +static struct resource rtc_resource[] = {{
> +	.name = "rtc",
> +	.start = 0x70,
> +	.end = 0x71,
> +	.flags = IORESOURCE_IO,
> +}, {
> +	.name = "rtc",
> +	.start = 8,
> +	.end = 8,
> +	.flags = IORESOURCE_IRQ,
> +}};
> +#endif

Same question?

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-03 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-31 22:08 [PATCH NEXT 3/4] powerpc/pasemi: Add Nemo board device init code Darren Stevens
2018-05-03 13:06 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).