From: Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org
Cc: michal.simek-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
john.williams-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org
Subject: [PATCH 1/1] microblaze: Added fdt chosen capability for timer
Date: Thu, 10 Nov 2011 14:10:23 +0100 [thread overview]
Message-ID: <1320930623-15060-3-git-send-email-monstr@monstr.eu> (raw)
In-Reply-To: <1320930623-15060-2-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
From: "Peter A. G. Crosthwaite" <peter.crosthwaite-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org>
This lets a dts author flag a particular timer in the system as the system timer.
If the chosen node contains a "system-timer=<&foo>" entry than that handle will
be used to determine the system timer. In no such entry exists then the first
found timer will be used (current behaviour).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org>
Signed-off-by: Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
---
arch/microblaze/kernel/timer.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index 91804cd..c289412 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -267,11 +267,15 @@ void __init time_init(void)
NULL
};
- for (i = 0; timer_list[i] != NULL; i++) {
+ prop = of_get_property(of_chosen, "system-timer", NULL);
+ if (prop)
+ timer = of_find_node_by_phandle(be32_to_cpup(prop));
+ else
+ printk(KERN_INFO "No chosen timer found, using default\n");
+
+ for (i = 0; timer_list[i] != NULL && !timer; i++)
timer = of_find_compatible_node(NULL, NULL, timer_list[i]);
- if (timer)
- break;
- }
+
BUG_ON(!timer);
timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
--
1.7.5.4
next prev parent reply other threads:[~2011-11-10 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 13:10 [PATCH 0/1] How to choose system timer? Michal Simek
[not found] ` <1320930623-15060-1-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2011-11-10 13:10 ` Michal Simek
[not found] ` <1320930623-15060-2-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2011-11-10 13:10 ` Michal Simek [this message]
[not found] ` <1320930623-15060-3-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2011-11-10 14:21 ` [PATCH 1/1] microblaze: Added fdt chosen capability for timer John Williams
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=1320930623-15060-3-git-send-email-monstr@monstr.eu \
--to=monstr-psz03upnqpehxe+lvdladg@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=john.williams-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org \
--cc=michal.simek-g5w7nrANp4BDPfheJLI6IQ@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