aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.org>2013-02-01 09:11:06 +0800
committerGuodong Xu <guodong.xu@linaro.org>2013-02-01 09:11:06 +0800
commit7f97b035c5931d785690ef61ac6dc48f66210da6 (patch)
treef4271e11ec9d0aaf6c19802cbb041cb0bc7f702c
parent89ba3992d94815f19a370fdbb3c4113a01cefd10 (diff)
parentd383fdce437896fd876ce87d3cfb848af165ff57 (diff)
Merge remote-tracking branch 'origin/topic/rtc' into local-m1-candidiatem1-release-candidate-0201
-rw-r--r--arch/arm/boot/dts/hi3620.dtsi9
-rw-r--r--arch/arm/boot/dts/hi4511.dts4
-rw-r--r--drivers/rtc/rtc-pl031.c8
3 files changed, 18 insertions, 3 deletions
diff --git a/arch/arm/boot/dts/hi3620.dtsi b/arch/arm/boot/dts/hi3620.dtsi
index 9acc9fface5c..7f78f3a6bdae 100644
--- a/arch/arm/boot/dts/hi3620.dtsi
+++ b/arch/arm/boot/dts/hi3620.dtsi
@@ -517,6 +517,15 @@
};
};
+ rtc0: rtc@fc804000 {
+ compatible = "arm,rtc-pl031", "arm,primecell";
+ reg = <0xfc804000 0x1000>;
+ interrupts = <0 9 0x4>;
+ clocks = <&pclk>; /* need to be replaced by rtcclk */
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
l2: l2-cache {
compatible = "arm,pl310-cache";
reg = <0xfc100000 0x100000>;
diff --git a/arch/arm/boot/dts/hi4511.dts b/arch/arm/boot/dts/hi4511.dts
index 4d1ca19b4ffc..ffbb646f1de1 100644
--- a/arch/arm/boot/dts/hi4511.dts
+++ b/arch/arm/boot/dts/hi4511.dts
@@ -99,6 +99,10 @@
status = "ok";
};
+ rtc0: rtc@fc804000 {
+ status = "ok";
+ };
+
gpio0: gpio@fc806000 {
status = "ok";
};
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 08378e3cc21c..10c1a3454e48 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -44,6 +44,7 @@
#define RTC_YMR 0x34 /* Year match register */
#define RTC_YLR 0x38 /* Year data load register */
+#define RTC_CR_EN (1 << 0) /* counter enable bit */
#define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */
#define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */
@@ -320,7 +321,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
struct pl031_local *ldata;
struct pl031_vendor_data *vendor = id->data;
struct rtc_class_ops *ops = &vendor->ops;
- unsigned long time;
+ unsigned long time, data;
ret = amba_request_regions(adev, NULL);
if (ret)
@@ -345,10 +346,11 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev));
dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev));
+ data = readl(ldata->base + RTC_CR);
/* Enable the clockwatch on ST Variants */
if (vendor->clockwatch)
- writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
- ldata->base + RTC_CR);
+ data |= RTC_CR_CWEN;
+ writel(data | RTC_CR_EN, ldata->base + RTC_CR);
/*
* On ST PL031 variants, the RTC reset value does not provide correct