sparc: Move SYS_SPARC_NWINDOWS to Kconfig

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 04dc08f..1d1347b 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -12,6 +12,15 @@
 	bool
 	select LEON
 
+config SYS_SPARC_NWINDOWS
+	int "Number of SPARC register windows"
+	range 2 32
+	default "8"
+	help
+	  Specify the number of SPARC register windows implemented by this
+	  processor. A SPARC implementation can have from 2 to 32 windows.
+	  If unsure, choose 8.
+
 choice
 	prompt "Board select"
 	optional
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 2031149..1566010 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -20,6 +20,11 @@
 #define CONFIG_AMBAPP_IOAREA AMBA_DEFAULT_IOAREA
 #endif
 
+/* Default number of SPARC register windows */
+#ifndef CONFIG_SYS_SPARC_NWINDOWS
+#define CONFIG_SYS_SPARC_NWINDOWS 8
+#endif
+
 /* Entry for traps which jump to a programmer-specified trap handler.  */
 #define TRAPR(H)  \
 	wr	%g0, 0xfe0, %psr; \