From: Rob Herring <robherring2@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/3] config: consolidate CONFIG_SYS_HZ definition
Date: Fri, 4 Oct 2013 08:40:03 -0500 [thread overview]
Message-ID: <1380894005-18769-2-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1380894005-18769-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
According to the README, CONFIG_SYS_HZ must be 1000 and most platforms
follow that. In preparation to remove CONFIG_SYS_HZ from all these
platforms, provide a common definition. The platforms which use a value
other than 1000 will get build warning now. These configs are:
include/configs/M5271EVB.h:#define CONFIG_SYS_HZ 1000000
include/configs/balloon3.h:#define CONFIG_SYS_HZ 3250000 /* Timer @ 3250000 Hz */
include/configs/idmr.h:#define CONFIG_SYS_HZ (50000000 / 64)
include/configs/mini2440.h:#define CONFIG_SYS_HZ 1562500
include/configs/mx1ads.h:#define CONFIG_SYS_HZ 3686400
include/configs/omap3_zoom2.h:#define CONFIG_SYS_HZ ((V_SCLK) / (2 << CONFIG_SYS_PTV))
include/configs/omap730p2.h:#define CONFIG_SYS_HZ ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
include/configs/palmld.h:#define CONFIG_SYS_HZ 3250000 /* Timer @ 3250000 Hz */
include/configs/palmtc.h:#define CONFIG_SYS_HZ 3686400 /* Timer @ 3686400 Hz */
include/configs/rsk7203.h:#define CONFIG_SYS_HZ (CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER)
include/configs/rsk7264.h:#define CONFIG_SYS_HZ (CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER)
include/configs/rsk7269.h:#define CONFIG_SYS_HZ (CONFIG_SYS_CLK_FREQ / CMT_CLK_DIVIDER)
include/configs/scb9328.h:#define CONFIG_SYS_HZ 3686400 /* incrementer freq: 3.6864 MHz */
include/configs/versatile.h:#define CONFIG_SYS_HZ (1000000 / 256)
include/configs/zipitz2.h:#define CONFIG_SYS_HZ 3250000 /* Timer @ 3250000 Hz */
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
v3:
- move warning to lib/time.c
- split to 3 patches
v2:
- Add warning for boards defining CONFIG_SYS_HZ. Boards using value
other than 1000 will now generate warnings.
- Change KAREF, METROBOX, and MVBLUE to use 1000. Appeared to be a
typo.
- Convert a few more boards to remove CONFIG_SYS_HZ that were missed in
v1.
include/config_fallbacks.h | 4 ++++
lib/time.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index e59ee96..4c25289 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -53,4 +53,8 @@
#define HAVE_BLOCK_DEVICE
#endif
+#ifndef CONFIG_SYS_HZ
+#define CONFIG_SYS_HZ 1000
+#endif
+
#endif /* __CONFIG_FALLBACKS_H */
diff --git a/lib/time.c b/lib/time.c
index 68b8ff4..6514835 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -8,6 +8,10 @@
#include <common.h>
#include <watchdog.h>
+#if CONFIG_SYS_HZ != 1000
+#warning "CONFIG_SYS_HZ must be 1000 and should not be defined by platforms"
+#endif
+
#ifndef CONFIG_WD_PERIOD
# define CONFIG_WD_PERIOD (10 * 1000 * 1000) /* 10 seconds default*/
#endif
--
1.8.1.2
next prev parent reply other threads:[~2013-10-04 13:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-08 19:54 [U-Boot] [PATCH] config: consolidate CONFIG_SYS_HZ definition Rob Herring
2013-09-09 14:06 ` Wolfgang Denk
2013-09-09 15:02 ` Rob Herring
2013-09-09 15:41 ` Wolfgang Denk
2013-09-19 19:06 ` Tom Rini
2013-09-19 21:02 ` Rob Herring
2013-09-19 22:13 ` Tom Rini
2013-09-21 20:03 ` [U-Boot] [PATCH v2] " Rob Herring
2013-10-04 13:40 ` [U-Boot] [PATCH v3 0/3] Consolidate " Rob Herring
2013-10-04 13:40 ` Rob Herring [this message]
2013-10-04 13:40 ` [U-Boot] [PATCH v3 2/3] config: remove platform CONFIG_SYS_HZ definition part 1/2 Rob Herring
2013-10-04 13:40 ` [U-Boot] [PATCH v3 3/3] config: remove platform CONFIG_SYS_HZ definition part 2/2 Rob Herring
2013-11-04 21:31 ` [U-Boot] [PATCH v3 0/3] Consolidate CONFIG_SYS_HZ definition Tom Rini
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=1380894005-18769-2-git-send-email-robherring2@gmail.com \
--to=robherring2@gmail.com \
--cc=u-boot@lists.denx.de \
/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.