All of lore.kernel.org
 help / color / mirror / Atom feed
From: buytenh@wantstofly.org (Lennert Buytenhek)
To: linux-arm-kernel@lists.infradead.org
Subject: net{space,xbig} TCLK determination
Date: Wed, 20 Oct 2010 10:57:20 +0200	[thread overview]
Message-ID: <20101020085720.GA12979@mail.wantstofly.org> (raw)
In-Reply-To: <20101020084826.GK29120@kw.sim.vm.gnt>

On Wed, Oct 20, 2010 at 08:48:26AM +0000, Simon Guinot wrote:

> Hi Lennert,

Hi Simon,


> > The net{space,xbig} board support files have this:
> > 
> > 	static void netspace_v2_timer_init(void)
> > 	{
> > 		kirkwood_tclk = 166666667;
> > 		orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
> > 	}
> > 
> > This is a pretty ugly hack -- if kirkwood_find_tclk() is not
> > determining the right TCLK on these boards, then that would be the
> > real bug, and it should be fixed there, and not by putting hacks
> > like these in board support files.
> 
> In the Marvell LSP, TCLK detection is based on the Sample at Reset
> Register bit 21. There is no description about this bit usage in the
> Kirkwood functional specification document.
> The given result _seems_ to be correct for the boards on my desk, but
> I have no idea how this way is reliable...
> 
> I simply don't have the needed platform knowledge to solve this issue.
> So, if you want me to fix kirkwood_find_tclk(), you will have to give
> more hints.

This came up when the upstream kirkwood port was initially done, and
the reliable method of detecting TCLK is based on a register that is
internal use only, so what kirkwood_find_tclk() currently does is an
approximation of that using other registers that _are_ public.

If the LSP uses the SaR register, then I don't see why the upstream
kernel shouldn't be doing that as well.  The mv78xx0 port in the
upstream kernel uses that method too (see mach-mv78xx0/common.c,
get_*clk() functions).


> The lacie_v2_timer_init() function is maybe a ugly hack but that is
> the only I found. My concern was to avoid breaking TCLK detection for
> other boards.

Makes sense.


thanks,
Lennert

  reply	other threads:[~2010-10-20  8:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20  5:08 net{space,xbig} TCLK determination Lennert Buytenhek
2010-10-20  8:48 ` Simon Guinot
2010-10-20  8:57   ` Lennert Buytenhek [this message]
2010-10-21  7:45     ` [PATCH 1/2] [ARM] Kirkwood: enhance TLCK detection Simon Guinot
2010-10-21  7:45       ` [PATCH 2/2] [ARM] Kirkwood: fix timer initialization for LaCie boards Simon Guinot
2010-10-21  7:53         ` Lennert Buytenhek
2010-10-21  7:53       ` [PATCH 1/2] [ARM] Kirkwood: enhance TLCK detection Lennert Buytenhek
2010-10-21  8:11         ` Saeed Bishara
2010-10-21  9:58           ` Lennert Buytenhek
2010-10-21 11:03             ` Saeed Bishara
2010-10-21 14:10               ` Lennert Buytenhek
2010-10-21  7:56       ` Saeed Bishara
2010-10-21  9:49         ` Simon Guinot
2010-10-21  9:42     ` [PATCH v2 1/2] [ARM] Kirkwood: enhance TCLK detection Simon Guinot
2010-10-21  9:42       ` [PATCH v2 2/2] [ARM] Kirkwood: fix timer initialization for LaCie boards Simon Guinot
2010-10-21 13:54       ` [PATCH v2 1/2] [ARM] Kirkwood: enhance TCLK detection Simon Guinot
2010-10-21 14:11       ` Lennert Buytenhek

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=20101020085720.GA12979@mail.wantstofly.org \
    --to=buytenh@wantstofly.org \
    --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.