From: Daniel Hellstrom <daniel@gaisler.com>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH] SPARC/LEON: power down instruction different of different
Date: Thu, 27 Jan 2011 11:08:21 +0000 [thread overview]
Message-ID: <4D415225.8070000@gaisler.com> (raw)
In-Reply-To: <1296059842-22837-1-git-send-email-daniel@gaisler.com>
Sam Ravnborg wrote:
>On Wed, Jan 26, 2011 at 05:37:22PM +0100, Daniel Hellstrom wrote:
>
>
>>The way a LEON is powered down is implemented differently depending
>>on CHIP type. The AMBA Plug&Play system ID tells revision of GRLIB
>>and CHIP.
>>
>>This is for example needed by the GR-LEON4-ITX board and the UT699.
>>
>>Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>
>>
>
>It is not obvious for me how leon_pmc interact with the existing pmc.c
>implmentation. I guess the latter fails during probe and is thus ignored.
>
>Some comments below - mostly general or nitpick.
>
> Sam
>
>
Ok, I will resend this patch.
Daniel
>
>
>>+
>>+ /* Find System ID: GRLIB build ID and optional CHIP ID */
>>+ pp = of_find_property(rootnp, "systemid", &len);
>>+ if (pp)
>>+ amba_system_id = *(unsigned long *)pp->value;
>>+
>>+ /*Find IRQMP IRQ Controller Registers base address otherwise bail out.*/
>>
>>
>
>If you are going to resubmit then fix this comment (add a space)
>
>
>
>>+ * Copyright (C) 2011 Daniel Hellstrom (daniel@gaisler.com) Aeroflex Gaisler AB
>>+ */
>>+
>>+#include <linux/pm.h>
>>+#include <linux/init.h>
>>+#include <asm/leon.h>
>>+#include <asm/leon_amba.h>
>>
>>
>
>For this number of includes it does not matter.
>But in general we use the inverse christmas tree way.
>Longer lines first. Lines with identical length sorted alphabetically.
>And an empty line between the include groups.
>
>
>
>>+/*
>>+ * CPU idle callback function for systems that need some extra handling
>>+ * See .../arch/sparc/kernel/process.c
>>+ */
>>+void pmc_leon_idle_fixup(void)
>>+{
>>+ /* Prepare an address to a non-cachable region. APB is always
>>+ * none-cachable. One instruction is executed after the Sleep
>>+ * instruction, we make sure to read the bus and throw away the
>>+ * value by accessing a non-cachable area, also we make sure the
>>+ * MMU does not get a TLB miss here by using the MMU BYPASS ASI.
>>+ */
>>+ register unsigned int address = (unsigned int)leon3_irqctrl_regs;
>>+ __asm__ __volatile__ (
>>+ "mov %%g0, %%asr19\n"
>>+ "lda [%0] %1, %%g0\n"
>>+ :
>>+ : "r"(address), "i"(ASI_LEON_BYPASS));
>>+}
>>
>>
>
>Good to see the rasons commented!
>
>
>
>>+
>>+/* This driver is not critical to the boot process, don't care
>>+ * if initialized late.
>>+ */
>>+__initcall(leon_pmc_install);
>>
>>
>
>We do not use __initcall() in new code.
>Use the appropriate initcall from init.h.
>
>A patch to fix up rest of sparc is welcome :-)
>
>
> Sam
>
>
>
>
next prev parent reply other threads:[~2011-01-27 11:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-26 16:37 [PATCH] SPARC/LEON: power down instruction different of different LEONs Daniel Hellstrom
2011-01-27 5:43 ` [PATCH] SPARC/LEON: power down instruction different of Sam Ravnborg
2011-01-27 11:08 ` Daniel Hellstrom [this message]
2011-01-27 11:33 ` [PATCH] SPARC/LEON: power down instruction different of different Daniel Hellstrom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D415225.8070000@gaisler.com \
--to=daniel@gaisler.com \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.