Skip to contentSkip to conversation

: Add support for the RDC R-321x SoC

PATCH Superseded Florian Fainelli 2 participants 2 messages Oct 16, 2007 – Oct 25, 2007 x86

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 : Add support for the RDC R-321x SoC

This patch adds support for the RDC R-321x system-on-chip, also known as R-861x-(G). It uses the generic GPIO API and has support for the on-chip hardware watchdog.

---
 arch/i386/Kconfig                           |   13 ++-
 arch/i386/Makefile                          |    5 +
 arch/x86/mach-rdc321x/Makefile              |    5 +
 arch/x86/mach-rdc321x/gpio.c                |   91 +++++++++
 arch/x86/mach-rdc321x/platform.c            |   68 +++++++
 arch/x86/mach-rdc321x/wdt.c                 |  275 
+++++++++++++++++++++++++++
 include/asm-x86/mach-rdc321x/gpio.h         |   56 ++++++
 include/asm-x86/mach-rdc321x/rdc321x_defs.h |    6 +
 include/asm-x86/timex.h                     |    2 +
 9 files changed, 520 insertions(+), 1 deletions(-)
 create mode 100644 arch/x86/mach-rdc321x/Makefile
 create mode 100644 arch/x86/mach-rdc321x/gpio.c
 create mode 100644 arch/x86/mach-rdc321x/platform.c
 create mode 100644 arch/x86/mach-rdc321x/wdt.c
 create mode 100644 include/asm-x86/mach-rdc321x/gpio.h
 create mode 100644 include/asm-x86/mach-rdc321x/rdc321x_defs.h
arch/i386/Kconfig +12 -1
index 501fd6d..95a75c9 100644
@@ -170,6 +170,17 @@ config X86_NUMAQ
 	  You will need a new lynxer.elf file to flash your firmware with - send
 	  email to <[email protected]>.
 
+config X86_RDC321X
+	bool "RDC R-321x SoC"
+	select M486
+	select X86_REBOOTFIXUPS
+	select GENERIC_GPIO
+	select LEDS_GPIO
+	help
+	  This option is needed for RDC R-321x system-on-chip, also known
+	  as R-8610-(G).
+	  If you don't have one of these chips, you should say N here.
+
 config X86_SUMMIT
 	bool "Summit/EXA (IBM x440)"
 	depends on SMP
@@ -463,7 +474,7 @@ config X86_REBOOTFIXUPS
 	  system.
 
 	  Currently, the only fixup is for the Geode machines using
-	  CS5530A and CS5536 chipsets.
+	  CS5530A and CS5536 chipsets and the RDC R-321x SoC.
 
 	  Say Y if you want to enable the fixup. Currently, it's safe to
 	  enable this option even if you don't need it.
arch/i386/Makefile +5 -0
index 5e50dbf..ce4db23 100644
@@ -82,6 +82,11 @@ mcore-$(CONFIG_X86_NUMAQ)	:= arch/x86/mach-default
 mflags-$(CONFIG_X86_BIGSMP)	:= -Iinclude/asm-x86/mach-bigsmp
 mcore-$(CONFIG_X86_BIGSMP)	:= arch/x86/mach-default
 
+# RDC R-321x subarch support
+mflags-$(CONFIG_X86_RDC321X)	:= -Iinclude/asm-x86/mach-rdc321x
+mcore-$(CONFIG_X86_RDC321X)	:= arch/x86/mach-default
+core-$(CONFIG_X86_RDC321X)	+= arch/x86/mach-rdc321x/
+
 #Summit subarch support
 mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-x86/mach-summit
 mcore-$(CONFIG_X86_SUMMIT)  := arch/x86/mach-default
arch/x86/mach-rdc321x/Makefile new file +5 -0
new file mode 100644
index 0000000..1faac81
@@ -0,0 +1,5 @@
+#
+# Makefile for the RDC321x specific parts of the kernel
+#
+obj-$(CONFIG_X86_RDC321X)        := gpio.o platform.o wdt.o
+
arch/x86/mach-rdc321x/gpio.c new file +91 -0

91 lines not on this page · raw message

arch/x86/mach-rdc321x/platform.c new file +68 -0

68 lines not on this page · raw message

arch/x86/mach-rdc321x/wdt.c new file +275 -0

275 lines not on this page · raw message

include/asm-x86/mach-rdc321x/gpio.h new file +56 -0

56 lines not on this page · raw message

include/asm-x86/mach-rdc321x/rdc321x_defs.h new file +6 -0
new file mode 100644
index 0000000..838ba8f
@@ -0,0 +1,6 @@
+#define PFX	"rdc321x: "
+
+/* General purpose configuration and data registers */
+#define RDC3210_CFGREG_ADDR     0x0CF8
+#define RDC3210_CFGREG_DATA     0x0CFC
+#define RDC_MAX_GPIO		0x3A
include/asm-x86/timex.h +2 -0
index 39a21ab..27cfd6c 100644
@@ -7,6 +7,8 @@
 
 #ifdef CONFIG_X86_ELAN
 #  define PIT_TICK_RATE 1189200 /* AMD Elan has different frequency! */
+#elif defined(CONFIG_X86_RDC321X)
+#  define PIT_TICK_RATE 1041667 /* Underlying HZ for R8610 */
 #else
 #  define PIT_TICK_RATE 1193182 /* Underlying HZ */
 #endif
#1 lore raw

arch/x86/mach-rdc321x/wdt.c line 69

Quoted 8 lines · On Tue, 16 Oct 2007 13:41:31 +0200 Florian Fainelli…
arch/x86/mach-rdc321x/wdt.c new file +8 -0
+static struct {
+	struct completion stop;
+	volatile int running;
+	struct timer_list timer;
+	volatile int queue;
+	int default_ticks;
+	unsigned long inuse;
+} rdc321x_wdt_device;

Why the volatiles? If these actually help then it's probably an indication that something is wrong in the implementation.

Documentation/volatile-considered-harmful.txt has some details.