Skip to contentSkip to conversation

mpic: add support for Time-Of-Day-Clock (TODC)

PATCH In review Mark A. Greer 3 participants 6 messages Jun 19, 2006 – Jun 21, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpic: add support for Time-Of-Day-Clock (TODC)

[Forgot to cc: linuxppc-dev the first time]

The todc code from arch/ppc supports many todc/rtc chips and is needed in arch/powerpc. This patch adds the todc code to arch/powerpc.

--

 arch/powerpc/Kconfig         |    6 
 arch/powerpc/sysdev/Makefile |    1 
 arch/powerpc/sysdev/todc.c   |  397 +++++++++++++++++++++++++++++++++++
 include/asm-powerpc/todc.h   |  487 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 891 insertions(+)

--

arch/powerpc/Kconfig +6 -0
index 4ef2478..39ac8fd 100644
@@ -543,6 +543,12 @@ config TAU_AVERAGE
 	  /proc/cpuinfo.
 
 	  If in doubt, say N here.
+
+config PPC_TODC
+	depends on EMBEDDED6xx
+	bool "Generic Time-of-day Clock (TODC) support"
+	---help---
+	  This adds support for many TODC/RTC chips.
 endmenu
 
 source arch/powerpc/platforms/embedded6xx/Kconfig
arch/powerpc/sysdev/Makefile +1 -0
index cef95b0..8b0dd5f 100644
@@ -12,3 +12,4 @@ obj-$(CONFIG_U3_DART)		+= dart_iommu.o
 obj-$(CONFIG_MMIO_NVRAM)	+= mmio_nvram.o
 obj-$(CONFIG_PPC_83xx)		+= ipic.o
 obj-$(CONFIG_FSL_SOC)		+= fsl_soc.o
+obj-$(CONFIG_PPC_TODC)		+= todc.o
arch/powerpc/sysdev/todc.c new file +397 -0

397 lines not on this page · raw message

include/asm-powerpc/todc.h new file +487 -0

487 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Mark A. Greer

+ * In order to break the assumption that the RTC and NVRAM are accessed by
+ * the same mechanism, you need to explicitly set 'ppc_md.rtc_read_val' and
+ * 'ppc_md.rtc_write_val', otherwise the values of 'ppc_md.rtc_read_val'
+ * and 'ppc_md.rtc_write_val' will be used.

I'm guessing the second references should be "nvram_read/write_val" instead.

-Hollis

#2 lore raw
Quoted 9 lines · Hollis Blanchard
Quoted 5 lines · Mark A. Greer

+ * In order to break the assumption that the RTC and NVRAM are accessed by
+ * the same mechanism, you need to explicitly set 'ppc_md.rtc_read_val' and
+ * 'ppc_md.rtc_write_val', otherwise the values of 'ppc_md.rtc_read_val'
+ * and 'ppc_md.rtc_write_val' will be used.

I'm guessing the second references should be "nvram_read/write_val" instead.

Hrm, yeah, the sentence would make sense then.

I'll repost the patch.

Mark

#3 lore raw
In reply to Mark A. Greer

[This is a complete replacement for the earlier patch.]

The todc code from arch/ppc supports many todc/rtc chips and is needed in arch/powerpc. This patch adds the todc code to arch/powerpc.

--

 arch/powerpc/Kconfig         |    6 
 arch/powerpc/sysdev/Makefile |    1 
 arch/powerpc/sysdev/todc.c   |  392 ++++++++++++++++++++++++++++++++++
 include/asm-powerpc/todc.h   |  487 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 886 insertions(+)

--

arch/powerpc/Kconfig +6 -0
index 4ef2478..39ac8fd 100644
@@ -543,6 +543,12 @@ config TAU_AVERAGE
 	  /proc/cpuinfo.
 
 	  If in doubt, say N here.
+
+config PPC_TODC
+	depends on EMBEDDED6xx
+	bool "Generic Time-of-day Clock (TODC) support"
+	---help---
+	  This adds support for many TODC/RTC chips.
 endmenu
 
 source arch/powerpc/platforms/embedded6xx/Kconfig
arch/powerpc/sysdev/Makefile +1 -0
index cef95b0..8b0dd5f 100644
@@ -12,3 +12,4 @@ obj-$(CONFIG_U3_DART)		+= dart_iommu.o
 obj-$(CONFIG_MMIO_NVRAM)	+= mmio_nvram.o
 obj-$(CONFIG_PPC_83xx)		+= ipic.o
 obj-$(CONFIG_FSL_SOC)		+= fsl_soc.o
+obj-$(CONFIG_PPC_TODC)		+= todc.o
arch/powerpc/sysdev/todc.c new file +392 -0

392 lines not on this page · raw message

include/asm-powerpc/todc.h new file +487 -0

487 lines not on this page · raw message

#4 lore raw
In reply to Mark A. Greer
Quoted 4 lines · Mark A. Greer

[Forgot to cc: linuxppc-dev the first time]

The todc code from arch/ppc supports many todc/rtc chips and is needed in arch/powerpc. This patch adds the todc code to arch/powerpc.

Question... what does it have to do with mpic ? :)

Ben.

#5 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 4 lines · Mark A. Greer

[Forgot to cc: linuxppc-dev the first time]

The todc code from arch/ppc supports many todc/rtc chips and is needed in arch/powerpc. This patch adds the todc code to arch/powerpc.

Question... what does it have to do with mpic ? :)

Oops, nothing. Cut & paste error. Should read:

[PATCH] todc: add support for Time-Of-Day-Clock (TODC)

or something like that.

Mark