From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Wan Zongshun <vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Wan Zongshun <mcuos.com-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Daniel Lezcano
<daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/6] ARM: NUC900: Add nuc970 machine support
Date: Tue, 05 Jul 2016 10:09:09 +0200 [thread overview]
Message-ID: <5195754.U9Bku6gEdi@wuerfel> (raw)
In-Reply-To: <577B63EF.6030906-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
On Tuesday, July 5, 2016 3:38:23 PM CEST Wan Zongshun wrote:
> On 2016年06月29日 23:19, Arnd Bergmann wrote:
> >> diff --git a/arch/arm/mach-w90x900/include/mach/nuc970-regs-gcr.h b/arch/arm/mach-w90x900/include/mach/nuc970-regs-gcr.h
> >> new file mode 100644
> >> index 0000000..e7eb653
> >> --- /dev/null
> >> +++ b/arch/arm/mach-w90x900/include/mach/nuc970-regs-gcr.h
> >
> > Can you move the new headers to arch/arm/mach-w90x900/ directly?
> >
> >> +static int __init nuc900_restart_init(void)
> >> +{
> >> + struct device_node *np;
> >> +
> >> + np = of_find_compatible_node(NULL, NULL, "nuvoton,gcr");
> >> + wtcr_addr = of_iomap(np, 0);
> >> + if (!wtcr_addr)
> >> + return -ENODEV;
> >> +
> >> + of_node_put(np);
> >> +
> >> + return 0;
> >> +}
> >
> > Is this a watchdog node? If it is, the restart logic should just
> > move into the watchdog driver.
>
> It is not watchdog node, just be global System control register node.
Ok. Then I'd say it should go into drivers/power/reset/
If you make the the gcr a syscon node, you can probably use the
syscon-reboot driver directly, or as a reference.
> >> + of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
> >
> > We have actually moved away from using the soc_device as using the parent
> > for the other devices, just probe them separately. In fact the soc_device
> > could be handled by a driver in drivers/soc/nuvoton/
>
> Do you think I should add nuc900 soc driver in this folder?
Yes.
> If I want to add nuc900 soc driver in drivers/soc/nuvoton/, can I keep
> my current dts structure no change, or Must I add a new node name soc {}?
>
> I went through the code:soc-realview.c for reference, but I have no idea
> about how to re-structure my dts file to match this type soc driver.
You don't need to change the DT for this, all the driver needs to
do now is to find out the information about the soc and register it
as a soc_device so it shows up in sysfs.
> >> +static const char *nuc970_dt_compat[] __initconst = {
> >> + "nuvoton,nuc970evb",
> >> + NULL,
> >> +};
> >> +
> >> +void nuc970_restart(enum reboot_mode mode, const char *cmd)
> >> +{
> >> + if (wtcr_addr) {
> >> + while (__raw_readl(wtcr_addr + REG_WRPRTR) != 1) {
> >> + __raw_writel(0x59, wtcr_addr + REG_WRPRTR);
> >> + __raw_writel(0x16, wtcr_addr + REG_WRPRTR);
> >> + __raw_writel(0x88, wtcr_addr + REG_WRPRTR);
> >> + }
> >> +
> >> + __raw_writel(1, wtcr_addr + REG_AHBIPRST);
> >> + }
> >
> > Please use writel() instead of __raw_writel().
>
> Does this change apply to all others drivers? or just machine file to
> use writel()?
All drivers. You don't need to immediately change existing drivers, we
can clean them up some other day, but please use readl/writel for new code.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-07-05 8:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-25 10:37 [PATCH 0/6] ARM: NUC900: Add NUC970 SoC support Wan Zongshun
2016-06-25 10:37 ` [PATCH 1/6] ARM: NUC900: Add nuc970 machine support Wan Zongshun
[not found] ` <1466851042-22239-2-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-29 15:19 ` Arnd Bergmann
2016-07-05 7:38 ` Wan Zongshun
[not found] ` <577B63EF.6030906-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-07-05 8:09 ` Arnd Bergmann [this message]
[not found] ` <1466851042-22239-1-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-25 10:37 ` [PATCH 2/6] ARM: dts: nuc900: Add nuc970 dts files Wan Zongshun
2016-06-28 20:56 ` Rob Herring
[not found] ` <1466851042-22239-3-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-29 15:24 ` Arnd Bergmann
2016-06-25 10:37 ` [PATCH 4/6] irqchip: add irqchip driver for nuc900 Wan Zongshun
[not found] ` <1466851042-22239-5-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-29 15:27 ` Arnd Bergmann
2016-07-05 7:47 ` Wan Zongshun
[not found] ` <577B660D.50908-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-07-05 8:09 ` Arnd Bergmann
2016-07-09 3:25 ` Wan Zongshun
[not found] ` <57806E9F.3020407-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-07-09 20:17 ` Arnd Bergmann
2016-07-22 2:37 ` Wan ZongShun
2016-06-30 16:30 ` Jason Cooper
2016-06-25 10:37 ` [PATCH 3/6] Clocksource: add nuc970 clocksource driver Wan Zongshun
[not found] ` <1466851042-22239-4-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-27 19:46 ` Daniel Lezcano
[not found] ` <5771827E.1090609-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-05 8:21 ` Wan Zongshun
[not found] ` <577B6DFF.9000703-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-07-05 10:03 ` Daniel Lezcano
2016-06-29 15:25 ` Arnd Bergmann
2016-06-29 16:10 ` Daniel Lezcano
2016-07-05 7:43 ` Wan Zongshun
2016-06-25 10:37 ` [PATCH 5/6] clk: add Clock driver for nuc970 Wan Zongshun
[not found] ` <1466851042-22239-6-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-29 15:28 ` Arnd Bergmann
2016-06-25 10:37 ` [PATCH 6/6] nuc900: add nuc970 platform defconfig file Wan Zongshun
[not found] ` <1466851042-22239-7-git-send-email-vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.org>
2016-06-29 15:29 ` Arnd Bergmann
2016-06-29 15:32 ` [PATCH 0/6] ARM: NUC900: Add NUC970 SoC support Arnd Bergmann
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=5195754.U9Bku6gEdi@wuerfel \
--to=arnd-r2ngtmty4d4@public.gmane.org \
--cc=daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mcuos.com-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=vw-6ukY98dZOFrYtjvyW6yDsg@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox