Skip to contentSkip to conversation

ARM: w90x900: add common nuc9xx.h

PATCH New Russell King - ARM Linux 2 participants 4 messages Nov 18, 2011 – Nov 25, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: w90x900: add common nuc9xx.h

Rather than having separate extern declarations in nuc9*.h, provide a common header file containing these definitions.

---
This is a preparatory patch for fixing w90x900 for the restart changes, and is the last patch which is currently in linux-next without any appropriate acks.

 arch/arm/mach-w90x900/irq.c    |    2 ++
 arch/arm/mach-w90x900/nuc910.h |    9 +--------
 arch/arm/mach-w90x900/nuc950.h |    9 +--------
 arch/arm/mach-w90x900/nuc960.h |    9 +--------
 arch/arm/mach-w90x900/nuc9xx.h |   23 +++++++++++++++++++++++
 arch/arm/mach-w90x900/time.c   |    2 ++
 6 files changed, 30 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm/mach-w90x900/nuc9xx.h
arch/arm/mach-w90x900/irq.c +2 -0
index 7bf143c..b466e24 100644
@@ -28,6 +28,8 @@
 #include <mach/hardware.h>
 #include <mach/regs-irq.h>
 
+#include "nuc9xx.h"
+
 struct group_irq {
 	unsigned long		gpen;
 	unsigned int		enabled;
arch/arm/mach-w90x900/nuc910.h +1 -8
index 83e9ba5..b14c71a 100644
@@ -12,14 +12,7 @@
  * published by the Free Software Foundation.
  *
  */
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"
 
 /* extern file from nuc910.c */
 
arch/arm/mach-w90x900/nuc950.h +1 -8
index 98a1148..6e9de30 100644
@@ -12,14 +12,7 @@
  * published by the Free Software Foundation.
  *
  */
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"
 
 /* extern file from nuc950.c */
 
arch/arm/mach-w90x900/nuc960.h +1 -8
index f0c07cb..9f6df9a 100644
@@ -12,14 +12,7 @@
  * published by the Free Software Foundation.
  *
  */
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"
 
 /* extern file from nuc960.c */
 
arch/arm/mach-w90x900/nuc9xx.h new file +23 -0
new file mode 100644
index 0000000..847c4f3
@@ -0,0 +1,23 @@
+/*
+ * arch/arm/mach-w90x900/nuc9xx.h
+ *
+ * Copied from nuc910.h, which had:
+ *
+ * Copyright (c) 2008 Nuvoton corporation
+ *
+ * Header file for NUC900 CPU support
+ *
+ * Wan ZongShun <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+struct map_desc;
+struct sys_timer;
+
+/* core initialisation functions */
+
+extern void nuc900_init_irq(void);
+extern struct sys_timer nuc900_timer;
arch/arm/mach-w90x900/time.c +2 -0
index a2c4e2d..fa27c49 100644
@@ -33,6 +33,8 @@
 #include <mach/map.h>
 #include <mach/regs-timer.h>
 
+#include "nuc9xx.h"
+
 #define RESETINT	0x1f
 #define PERIOD		(0x01 << 27)
 #define ONESHOT		(0x00 << 27)
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/1 ARM: w90x900: add common nuc9xx.h

2011/11/19 Russell King - ARM Linux <[email protected]>:

Quoted 4 lines

Rather than having separate extern declarations in nuc9*.h, provide a common header file containing these definitions.

Quoted 133 lines

---
This is a preparatory patch for fixing w90x900 for the restart changes, and is the last patch which is currently in linux-next without any appropriate acks.

?arch/arm/mach-w90x900/irq.c ? ?| ? ?2 ++
?arch/arm/mach-w90x900/nuc910.h | ? ?9 +--------
?arch/arm/mach-w90x900/nuc950.h | ? ?9 +--------
?arch/arm/mach-w90x900/nuc960.h | ? ?9 +--------
?arch/arm/mach-w90x900/nuc9xx.h | ? 23 +++++++++++++++++++++++
?arch/arm/mach-w90x900/time.c ? | ? ?2 ++

?6 files changed, 30 insertions(+), 24 deletions(-) ?create mode 100644 arch/arm/mach-w90x900/nuc9xx.h

arch/arm/mach-w90x900/irq.c +0 -0
index 7bf143c..b466e24 100644
@@ -28,6 +28,8 @@

?#include <mach/hardware.h>
?#include <mach/regs-irq.h>

arch/arm/mach-w90x900/irq.c +2 -0
+#include "nuc9xx.h"
+

?struct group_irq {
? ? ? ?unsigned long ? ? ? ? ? gpen;
? ? ? ?unsigned int ? ? ? ? ? ?enabled;

arch/arm/mach-w90x900/nuc910.h +0 -0
index 83e9ba5..b14c71a 100644
@@ -12,14 +12,7 @@

?* published by the Free Software Foundation.
?*
?*/

arch/arm/mach-w90x900/nuc910.h +1 -8
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"

?/* extern file from nuc910.c */

arch/arm/mach-w90x900/nuc950.h +0 -0
index 98a1148..6e9de30 100644
@@ -12,14 +12,7 @@

?* published by the Free Software Foundation.
?*
?*/

arch/arm/mach-w90x900/nuc950.h +1 -8
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"

?/* extern file from nuc950.c */

arch/arm/mach-w90x900/nuc960.h +0 -0
index f0c07cb..9f6df9a 100644
@@ -12,14 +12,7 @@

?* published by the Free Software Foundation.
?*
?*/

arch/arm/mach-w90x900/nuc960.h +1 -8
-
-struct map_desc;
-struct sys_timer;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+#include "nuc9xx.h"

?/* extern file from nuc960.c */

arch/arm/mach-w90x900/nuc9xx.h new file +23 -0
new file mode 100644
index 0000000..847c4f3
@@ -0,0 +1,23 @@
+/*
+ * arch/arm/mach-w90x900/nuc9xx.h
+ *
+ * Copied from nuc910.h, which had:
+ *
+ * Copyright (c) 2008 Nuvoton corporation
+ *
+ * Header file for NUC900 CPU support
+ *
+ * Wan ZongShun <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+struct map_desc;
+struct sys_timer;
+
+/* core initialisation functions */
+
+extern void nuc900_init_irq(void);
+extern struct sys_timer nuc900_timer;
arch/arm/mach-w90x900/time.c +0 -0
index a2c4e2d..fa27c49 100644
@@ -33,6 +33,8 @@

?#include <mach/map.h>
?#include <mach/regs-timer.h>

arch/arm/mach-w90x900/time.c +2 -0
+#include "nuc9xx.h"
+

?#define RESETINT ? ? ? 0x1f
?#define PERIOD ? ? ? ? (0x01 << 27)
?#define ONESHOT ? ? ? ? ? ? ? ?(0x00 << 27)
--
1.7.4.4

Signature · 2 lines
Wan ZongShun.
www.mcuos.com
#2 lore raw

PATCH 1/1 ARM: w90x900: add common nuc9xx.h

Quoted 7 lines · Wan ZongShun

2011/11/19 Russell King - ARM Linux <[email protected]>:

Quoted 4 lines

Rather than having separate extern declarations in nuc9*.h, provide a common header file containing these definitions.

Thanks.

Here's the follow-on patch for w90x900 for the restart fixups. Ack?

8<=====
ARM: restart: w90x900: use new restart hook

Hook these platforms restart code into the new restart hook rather than using arch_reset().

---
 arch/arm/mach-w90x900/cpu.c                 |   16 ++++++++++++++++
 arch/arm/mach-w90x900/include/mach/system.h |   17 -----------------
 arch/arm/mach-w90x900/mach-nuc910evb.c      |    1 +
 arch/arm/mach-w90x900/mach-nuc950evb.c      |    1 +
 arch/arm/mach-w90x900/mach-nuc960evb.c      |    1 +
 arch/arm/mach-w90x900/nuc9xx.h              |    1 +
 6 files changed, 20 insertions(+), 17 deletions(-)
arch/arm/mach-w90x900/cpu.c +16 -0
index 0a235e5..604e1db 100644
@@ -33,9 +33,11 @@
 #include <mach/regs-serial.h>
 #include <mach/regs-clock.h>
 #include <mach/regs-ebi.h>
+#include <mach/regs-timer.h>
 
 #include "cpu.h"
 #include "clock.h"
+#include "nuc9xx.h"
 
 /* Initial IO mappings */
 
@@ -222,3 +224,17 @@ void __init nuc900_init_clocks(void)
 	clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
 }
 
+#define	WTCR	(TMR_BA + 0x1C)
+#define	WTCLK	(1 << 10)
+#define	WTE	(1 << 7)
+#define	WTRE	(1 << 1)
+
+void nuc9xx_restart(char mode, const char *cmd)
+{
+	if (mode == 's') {
+		/* Jump into ROM@address 0 */
+		soft_restart(0);
+	} else {
+		__raw_writel(WTE | WTRE | WTCLK, WTCR);
+	}
+}
arch/arm/mach-w90x900/include/mach/system.h +0 -17
index 68875a1..001a2f9 100644
@@ -14,28 +14,11 @@
  * (at your option) any later version.
  *
  */
-
-#include <linux/io.h>
-#include <asm/proc-fns.h>
-#include <mach/map.h>
-#include <mach/regs-timer.h>
-
-#define	WTCR	(TMR_BA + 0x1C)
-#define	WTCLK	(1 << 10)
-#define	WTE	(1 << 7)
-#define	WTRE	(1 << 1)
-
 static void arch_idle(void)
 {
 }
 
 static void arch_reset(char mode, const char *cmd)
 {
-	if (mode == 's') {
-		/* Jump into ROM@address 0 */
-		soft_restart(0);
-	} else {
-		__raw_writel(WTE | WTRE | WTCLK, WTCR);
-	}
 }
 
arch/arm/mach-w90x900/mach-nuc910evb.c +1 -0
index 31c1090..b4243e4 100644
@@ -38,4 +38,5 @@ MACHINE_START(W90P910EVB, "W90P910EVB")
 	.init_irq	= nuc900_init_irq,
 	.init_machine	= nuc910evb_init,
 	.timer		= &nuc900_timer,
+	.restart	= nuc9xx_restart,
 MACHINE_END
arch/arm/mach-w90x900/mach-nuc950evb.c +1 -0
index 4062e55..067d8f9 100644
@@ -41,4 +41,5 @@ MACHINE_START(W90P950EVB, "W90P950EVB")
 	.init_irq	= nuc900_init_irq,
 	.init_machine	= nuc950evb_init,
 	.timer		= &nuc900_timer,
+	.restart	= nuc9xx_restart,
 MACHINE_END
arch/arm/mach-w90x900/mach-nuc960evb.c +1 -0
index 0ab9995..cbb3adc 100644
@@ -38,4 +38,5 @@ MACHINE_START(W90N960EVB, "W90N960EVB")
 	.init_irq	= nuc900_init_irq,
 	.init_machine	= nuc960evb_init,
 	.timer		= &nuc900_timer,
+	.restart	= nuc9xx_restart,
 MACHINE_END
arch/arm/mach-w90x900/nuc9xx.h +1 -0
index 847c4f3..91acb40 100644
@@ -21,3 +21,4 @@ struct sys_timer;
 
 extern void nuc900_init_irq(void);
 extern struct sys_timer nuc900_timer;
+extern void nuc9xx_restart(char, const char *);
Signature · 1 line
1.7.4.4
#3 lore raw

PATCH 1/1 ARM: w90x900: add common nuc9xx.h

2011/11/25 Russell King - ARM Linux <[email protected]>:

Quoted 13 lines · Wan ZongShun
Quoted 7 lines

2011/11/19 Russell King - ARM Linux <[email protected]>:

Quoted 4 lines

Rather than having separate extern declarations in nuc9*.h, provide a common header file containing these definitions.

Thanks.

Here's the follow-on patch for w90x900 for the restart fixups. ?Ack?

Quoted 7 lines

8<=====
ARM: restart: w90x900: use new restart hook

Hook these platforms restart code into the new restart hook rather than using arch_reset().

Thanks!

Quoted 120 lines

---

?arch/arm/mach-w90x900/cpu.c ? ? ? ? ? ? ? ? | ? 16 ++++++++++++++++
?arch/arm/mach-w90x900/include/mach/system.h | ? 17 -----------------
?arch/arm/mach-w90x900/mach-nuc910evb.c ? ? ?| ? ?1 +
?arch/arm/mach-w90x900/mach-nuc950evb.c ? ? ?| ? ?1 +
?arch/arm/mach-w90x900/mach-nuc960evb.c ? ? ?| ? ?1 +
?arch/arm/mach-w90x900/nuc9xx.h ? ? ? ? ? ? ?| ? ?1 +

?6 files changed, 20 insertions(+), 17 deletions(-)

arch/arm/mach-w90x900/cpu.c +0 -0
index 0a235e5..604e1db 100644
@@ -33,9 +33,11 @@

?#include <mach/regs-serial.h>
?#include <mach/regs-clock.h>
?#include <mach/regs-ebi.h>
+#include <mach/regs-timer.h>

?#include "cpu.h"
?#include "clock.h"
+#include "nuc9xx.h"

?/* Initial IO mappings */

arch/arm/mach-w90x900/cpu.c +14 -0
@@ -222,3 +224,17 @@ void __init nuc900_init_clocks(void)
 ? ? ? ?clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
 ?}
 
+#define ? ? ? ?WTCR ? ?(TMR_BA + 0x1C)
+#define ? ? ? ?WTCLK ? (1 << 10)
+#define ? ? ? ?WTE ? ? (1 << 7)
+#define ? ? ? ?WTRE ? ?(1 << 1)
+
+void nuc9xx_restart(char mode, const char *cmd)
+{
+ ? ? ? if (mode == 's') {
+ ? ? ? ? ? ? ? /* Jump into ROM at address 0 */
+ ? ? ? ? ? ? ? soft_restart(0);
+ ? ? ? } else {
+ ? ? ? ? ? ? ? __raw_writel(WTE | WTRE | WTCLK, WTCR);
+ ? ? ? }
+}
arch/arm/mach-w90x900/include/mach/system.h +0 -0
index 68875a1..001a2f9 100644
@@ -14,28 +14,11 @@

?* (at your option) any later version.
?*
?*/

arch/arm/mach-w90x900/include/mach/system.h +0 -11
-
-#include <linux/io.h>
-#include <asm/proc-fns.h>
-#include <mach/map.h>
-#include <mach/regs-timer.h>
-
-#define ? ? ? ?WTCR ? ?(TMR_BA + 0x1C)
-#define ? ? ? ?WTCLK ? (1 << 10)
-#define ? ? ? ?WTE ? ? (1 << 7)
-#define ? ? ? ?WTRE ? ?(1 << 1)
-

?static void arch_idle(void)
?{
?}

?static void arch_reset(char mode, const char *cmd) ?{
- ? ? ? if (mode == 's') {
- ? ? ? ? ? ? ? /* Jump into ROM at address 0 */
- ? ? ? ? ? ? ? soft_restart(0);
- ? ? ? } else {
- ? ? ? ? ? ? ? __raw_writel(WTE | WTRE | WTCLK, WTCR);
- ? ? ? }
?}

arch/arm/mach-w90x900/mach-nuc910evb.c +1 -0
index 31c1090..b4243e4 100644
@@ -38,4 +38,5 @@ MACHINE_START(W90P910EVB, "W90P910EVB")
 ? ? ? ?.init_irq ? ? ? = nuc900_init_irq,
 ? ? ? ?.init_machine ? = nuc910evb_init,
 ? ? ? ?.timer ? ? ? ? ?= &nuc900_timer,
+ ? ? ? .restart ? ? ? ?= nuc9xx_restart,

?MACHINE_END

arch/arm/mach-w90x900/mach-nuc950evb.c +1 -0
index 4062e55..067d8f9 100644
@@ -41,4 +41,5 @@ MACHINE_START(W90P950EVB, "W90P950EVB")
 ? ? ? ?.init_irq ? ? ? = nuc900_init_irq,
 ? ? ? ?.init_machine ? = nuc950evb_init,
 ? ? ? ?.timer ? ? ? ? ?= &nuc900_timer,
+ ? ? ? .restart ? ? ? ?= nuc9xx_restart,

?MACHINE_END

arch/arm/mach-w90x900/mach-nuc960evb.c +1 -0
index 0ab9995..cbb3adc 100644
@@ -38,4 +38,5 @@ MACHINE_START(W90N960EVB, "W90N960EVB")
 ? ? ? ?.init_irq ? ? ? = nuc900_init_irq,
 ? ? ? ?.init_machine ? = nuc960evb_init,
 ? ? ? ?.timer ? ? ? ? ?= &nuc900_timer,
+ ? ? ? .restart ? ? ? ?= nuc9xx_restart,

?MACHINE_END

arch/arm/mach-w90x900/nuc9xx.h +1 -1
index 847c4f3..91acb40 100644
@@ -21,3 +21,4 @@ struct sys_timer;
 
 ?extern void nuc900_init_irq(void);
 ?extern struct sys_timer nuc900_timer;
+extern void nuc9xx_restart(char, const char *);
--

1.7.4.4

Signature · 2 lines
Wan ZongShun.
www.mcuos.com