From: Arnd Bergmann <arnd@arndb.de>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk,
linux-sh@vger.kernel.org, lethal@linux-sh.org,
linux-kernel@vger.kernel.org, rjw@sisk.pl, horms@verge.net.au,
olof@lixom.net
Subject: Re: [PATCH 01/02] mach-shmobile: Emma Mobile EV2 SoC base support
Date: Tue, 8 May 2012 19:35:53 +0000 [thread overview]
Message-ID: <201205081935.54082.arnd@arndb.de> (raw)
In-Reply-To: <CANqRtoRqiFQEH+xaC9WtHy3v2rAHOZBNPTffOVQoDNuPb9H4-A@mail.gmail.com>
On Tuesday 08 May 2012, Magnus Damm wrote:
> >> +void __init emev2_clock_init(void)
> >> +{
> >> + int k, ret = 0;
> >> +
> >> + /* setup STI timer to run on 37.768 kHz and deassert reset */
> >> + __raw_writel(0, STI_CLKSEL);
> >> + __raw_writel(1, STI_RSTCTRL);
> >> +
> >> + /* deassert reset for UART0->UART3 */
> >> + __raw_writel(2, USIAU0_RSTCTRL);
> >> + __raw_writel(2, USIBU1_RSTCTRL);
> >> + __raw_writel(2, USIBU2_RSTCTRL);
> >> + __raw_writel(2, USIBU3_RSTCTRL);
> >
> > Better use iowrite32 or writel or writel_relaxed here, but not __raw_*.
>
> Ok. Would you like us to convert exiting code for other SoCs as well?
In the long run yes, but there is no need to hurry. I just want to stop
more of this from getting added because at some point we might have to
change it all.
> >> --- 0003/arch/arm/mach-shmobile/include/mach/common.h
> >> +++ work/arch/arm/mach-shmobile/include/mach/common.h 2012-05-03 20:45:56.000000000 +0900
> >> @@ -85,4 +85,10 @@ extern void r8a7779_secondary_init(unsig
> >> extern int r8a7779_boot_secondary(unsigned int cpu);
> >> extern void r8a7779_smp_prepare_cpus(void);
> >>
> >> +extern void emev2_init_irq(void);
> >> +extern void emev2_map_io(void);
> >> +extern void emev2_add_early_devices(void);
> >> +extern void emev2_add_standard_devices(void);
> >> +extern void emev2_clock_init(void);
> >> +
> >> #endif /* __ARCH_MACH_COMMON_H */
> >
> > I would feel more comfortable with a separate header for this than putting
> > it into the same file as everything else, but it's not important to me.
>
> I've been thinking about something along those lines myself too.
>
> Perhaps I can also move the existing soc symbols in common.h into
> separate per-soc header files, like for instance moving the sh7372
> symbols to sh7372.h. Not sure if we have enough time for the upcoming
> merge window though, when do you need the code?
Hard to say. Depends on whether there will be an -rc7. Sooner is better,
but again I care more about the new stuff here than about changing the
existing bits.
> >> +static struct map_desc emev2_io_desc[] __initdata = {
> >> + /* 128K entity map for 0xe0020000 (GIC) */
> >> + {
> >> + .virtual = 0xe0020000,
> >> + .pfn = __phys_to_pfn(0xe0020000),
> >> + .length = SZ_128K,
> >> + .type = MT_UNCACHED
> >> + },
> >> + /* 128K entity map for 0xe0100000 (SMU) */
> >> + {
> >> + .virtual = 0xe0100000,
> >> + .pfn = __phys_to_pfn(0xe0100000),
> >> + .length = SZ_128K,
> >> + .type = MT_DEVICE
> >> + },
> >> +};
> >> +
> >> +void __init emev2_map_io(void)
> >> +{
> >> + iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
> >> +}
>
> As you said, this iotable can most likely go away too. The only valid
> use case I can think of (which is not included above) is our early
> platform driver based console. Basically, it's the 8250_em driver
> being probed as early as possible. This allows us to get console
> output at MACHINE->init_early() timing. To get that working we rely on
> having entity mappings in our iotable so ioremap() can give us those
> early on. Something does however seem busted with the early ioremap()
> - but I need to spend more time to investigate that. And this is
> totally untested with DT, so it needs more work in general.
Do you actually need to do anything at init_early() or map_io() time
that needs debugging these days?
We already have too many different ways of doing early console output,
but if you cannot use the drivers/tty/serial/8250/8250_early.c code,
maybe it makes sense to just move the map_io() call for your 8250
port into that driver.
> I intend to post some SMP support patch together with some DT support
> tomorrow. I also have some GPIO code and some board-level network
> support. Ideally I'd like to go DT-only, but I'm a bit unsure how to
> tie in the SMP bits in a DT-only scenario. And we still have the
> clocks.
Don't worry about SMP and clocks for now for moving to DT, just do
the easy bits that are directly connected to the SoC and that have
existing bindings or those that can be trivially added.
Arnd
next prev parent reply other threads:[~2012-05-08 19:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 14:46 [PATCH 00/02] mach-shmobile: Emma Mobile EV2 - first shot Magnus Damm
2012-05-03 14:46 ` [PATCH 01/02] mach-shmobile: Emma Mobile EV2 SoC base support Magnus Damm
2012-05-04 13:07 ` Arnd Bergmann
2012-05-04 19:47 ` Arnd Bergmann
2012-05-08 16:56 ` Magnus Damm
2012-05-08 19:35 ` Arnd Bergmann [this message]
2012-05-03 14:47 ` [PATCH 02/02] mach-shmobile: KZM9D board prototype support Magnus Damm
2012-05-04 13:14 ` Arnd Bergmann
2012-05-03 19:23 ` [PATCH 00/02] mach-shmobile: Emma Mobile EV2 - first shot Rafael J. Wysocki
2012-05-04 19:57 ` Arnd Bergmann
2012-05-04 21:16 ` Rafael J. Wysocki
2012-05-05 7:22 ` Arnd Bergmann
2012-05-05 19:08 ` Rafael J. Wysocki
2012-05-05 19:21 ` Arnd Bergmann
2012-05-05 19:30 ` Rafael J. Wysocki
2012-05-05 19:50 ` Arnd Bergmann
2012-05-06 14:23 ` Magnus Damm
2012-05-08 20:12 ` Arnd Bergmann
2012-05-09 7:57 ` Geert Uytterhoeven
2012-05-09 8:12 ` Magnus Damm
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=201205081935.54082.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=horms@verge.net.au \
--cc=lethal@linux-sh.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=olof@lixom.net \
--cc=rjw@sisk.pl \
/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