All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] [RFC] ARM: shmobile: Add early debugging support using SCIF(A)
Date: Sun, 05 Oct 2014 23:36:00 +0000	[thread overview]
Message-ID: <CANqRtoTJNb7a9J05U0chrGoxBV7e1s6o0Xxeup0p1sOUZhE+vA@mail.gmail.com> (raw)
In-Reply-To: <1412276563-21473-1-git-send-email-geert+renesas@glider.be>

Hi Geert,

Thanks for your patch! Quick comment from my side below:

On Fri, Oct 3, 2014 at 4:02 AM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> Add serial port debug macros for the SCIF(A) serial ports.
> This includes all shmobile SoCs, except for EMEV2.
>
> On SoCs using the legacy machine_desc.map_io(), an identity mapping of
> the SCIF(A) registers must be set up in .map_io(). On all but r8a7779
> this was already done.
>
> On other SoCs, debug_ll_io_init() maps the SCIF(A) registers to a fixed
> virtual address. 0xfdxxxxxx was chosen, as it should lie below
> VMALLOC_END = 0xff000000, and must not conflict with the 2 MiB reserved
> region at PCI_IO_VIRT_BASE = 0xfee00000.
>
> This was derived from the r8a7790 version by Laurent Pinchart.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Tested on r8a7791/koelsch and r8a7740/armadillo.
> Testing on other platforms would be highly appreciated.
>
> Notes:
>   - On armadillo-multiplatform there may be a period while garbage data
>     is output.
>     This happens because sh_mobile_i2c_init() enables and disables its
>     clock during probing. As iic0 and scifa1 share the same parent
>     clock, this causes the scifa1 clock to no longer receive clock
>     ticks.
>     On armadillo-legacy, this is mitigated by the pre-CCF clock driver,
>     which never really disables clocks during boot-up for exactly this
>     reason. Cfr. "One example of this is the handling of the Mackerel
>     serial console output that shares clock with the I2C controller.",
>     in commit 794d78fea51504ba ("drivers: sh: late disabling of clocks
>     V2").
>     I'm wondering whether this can be fixed in the i2c driver? Does it
>     really have to enable and disable the clock?

I've seen this issue on several SoCs actually, and as you describe the
main issue seems to be that there are clock topologies that present
for devices used during boot (like serial) but this clock topology is
not yet managed by software. This does not trigger on all SoCs though.

It is my opinion that it has very little todo with the other devices
that happen to be using the same parent clock. The legacy clock
framework solved this by not allowing clocks to be disabled until all
devices were registered.

Cheers,

/ magnus

WARNING: multiple messages have this Message-ID (diff)
From: magnus.damm@gmail.com (Magnus Damm)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [RFC] ARM: shmobile: Add early debugging support using SCIF(A)
Date: Mon, 6 Oct 2014 08:36:00 +0900	[thread overview]
Message-ID: <CANqRtoTJNb7a9J05U0chrGoxBV7e1s6o0Xxeup0p1sOUZhE+vA@mail.gmail.com> (raw)
In-Reply-To: <1412276563-21473-1-git-send-email-geert+renesas@glider.be>

Hi Geert,

Thanks for your patch! Quick comment from my side below:

On Fri, Oct 3, 2014 at 4:02 AM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> Add serial port debug macros for the SCIF(A) serial ports.
> This includes all shmobile SoCs, except for EMEV2.
>
> On SoCs using the legacy machine_desc.map_io(), an identity mapping of
> the SCIF(A) registers must be set up in .map_io(). On all but r8a7779
> this was already done.
>
> On other SoCs, debug_ll_io_init() maps the SCIF(A) registers to a fixed
> virtual address. 0xfdxxxxxx was chosen, as it should lie below
> VMALLOC_END = 0xff000000, and must not conflict with the 2 MiB reserved
> region at PCI_IO_VIRT_BASE = 0xfee00000.
>
> This was derived from the r8a7790 version by Laurent Pinchart.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Tested on r8a7791/koelsch and r8a7740/armadillo.
> Testing on other platforms would be highly appreciated.
>
> Notes:
>   - On armadillo-multiplatform there may be a period while garbage data
>     is output.
>     This happens because sh_mobile_i2c_init() enables and disables its
>     clock during probing. As iic0 and scifa1 share the same parent
>     clock, this causes the scifa1 clock to no longer receive clock
>     ticks.
>     On armadillo-legacy, this is mitigated by the pre-CCF clock driver,
>     which never really disables clocks during boot-up for exactly this
>     reason. Cfr. "One example of this is the handling of the Mackerel
>     serial console output that shares clock with the I2C controller.",
>     in commit 794d78fea51504ba ("drivers: sh: late disabling of clocks
>     V2").
>     I'm wondering whether this can be fixed in the i2c driver? Does it
>     really have to enable and disable the clock?

I've seen this issue on several SoCs actually, and as you describe the
main issue seems to be that there are clock topologies that present
for devices used during boot (like serial) but this clock topology is
not yet managed by software. This does not trigger on all SoCs though.

It is my opinion that it has very little todo with the other devices
that happen to be using the same parent clock. The legacy clock
framework solved this by not allowing clocks to be disabled until all
devices were registered.

Cheers,

/ magnus

  parent reply	other threads:[~2014-10-05 23:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 19:02 [PATCH] [RFC] ARM: shmobile: Add early debugging support using SCIF(A) Geert Uytterhoeven
2014-10-02 19:02 ` Geert Uytterhoeven
2014-10-03  0:04 ` Khiem Nguyen
2014-10-03  0:04   ` Khiem Nguyen
2014-10-03  7:21   ` Geert Uytterhoeven
2014-10-03  7:21     ` Geert Uytterhoeven
2014-10-03 10:19     ` Khiem Nguyen
2014-10-03 10:19       ` Khiem Nguyen
2014-10-03 11:28       ` Geert Uytterhoeven
2014-10-03 11:28         ` Geert Uytterhoeven
2014-10-05 22:18 ` Laurent Pinchart
2014-10-05 22:18   ` Laurent Pinchart
2014-10-06  6:03   ` Wolfram Sang
2014-10-06  6:03     ` Wolfram Sang
2014-10-06  6:14     ` Magnus Damm
2014-10-06  6:14       ` Magnus Damm
2014-10-06  8:56     ` Geert Uytterhoeven
2014-10-06  8:56       ` Geert Uytterhoeven
2014-10-06  9:01       ` Wolfram Sang
2014-10-06  9:01         ` Wolfram Sang
2014-10-06  9:08   ` Geert Uytterhoeven
2014-10-06  9:08     ` Geert Uytterhoeven
2014-10-07 10:37   ` Ian Molton
2014-10-07 10:37     ` Ian Molton
2014-10-07 11:07     ` Geert Uytterhoeven
2014-10-07 11:07       ` Geert Uytterhoeven
2014-10-07 12:39       ` Geert Uytterhoeven
2014-10-07 12:39         ` Geert Uytterhoeven
2014-10-05 23:36 ` Magnus Damm [this message]
2014-10-05 23:36   ` Magnus Damm
2014-10-06  9:18   ` Geert Uytterhoeven
2014-10-06  9:18     ` Geert Uytterhoeven
2014-10-07 10:49 ` Arnd Bergmann
2014-10-07 10:49   ` Arnd Bergmann
2014-10-07 11:46   ` Geert Uytterhoeven
2014-10-07 11:46     ` Geert Uytterhoeven

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=CANqRtoTJNb7a9J05U0chrGoxBV7e1s6o0Xxeup0p1sOUZhE+vA@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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.