Skip to contentSkip to conversation

ARM: mach-shmobile: Kota2 SCIFA2 and SMSC911X support

PATCH In review Magnus Damm 2 participants 3 messages Aug 18, 2011 – Nov 4, 2011

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/7 ARM: mach-shmobile: Kota2 SCIFA2 and SMSC911X support

From: Magnus Damm <[email protected]>

Kota2 base board support including the on-chip SCIFA2 serial console and the on-board SMSC911X ethernet port.

The s73a0 SMP bits are also updated to include Kota2.

---

Needs the mach-type entry for Kota2 to build.

 arch/arm/mach-shmobile/Kconfig       |    7 +
 arch/arm/mach-shmobile/Makefile      |    1 
 arch/arm/mach-shmobile/board-kota2.c |  168 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-shmobile/platsmp.c     |   10 +-
 4 files changed, 182 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/Kconfig +7 -0
@@ -69,6 +69,11 @@ config MACH_MACKEREL
 	depends on ARCH_SH7372
 	select ARCH_REQUIRE_GPIOLIB
 
+config MACH_KOTA2
+	bool "KOTA2 board"
+	select ARCH_REQUIRE_GPIOLIB
+	depends on ARCH_SH73A0
+
 comment "SH-Mobile System Configuration"
 
 menu "Memory configuration"
@@ -78,6 +83,7 @@ config MEMORY_START
 	default "0x50000000" if MACH_G3EVM
 	default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
 				MACH_MACKEREL
+	default "0x41000000" if MACH_KOTA2
 	default "0x00000000"
 	---help---
 	  Tweak this only when porting to a new machine which does not
@@ -89,6 +95,7 @@ config MEMORY_SIZE
 	default "0x08000000" if MACH_G3EVM
 	default "0x08000000" if MACH_G4EVM
 	default "0x20000000" if MACH_AG5EVM
+	default "0x1e000000" if MACH_KOTA2
 	default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
 	default "0x04000000"
 	help
arch/arm/mach-shmobile/Makefile +1 -0
@@ -41,6 +41,7 @@ obj-$(CONFIG_MACH_G4EVM)	+= board-g4evm.
 obj-$(CONFIG_MACH_AP4EVB)	+= board-ap4evb.o
 obj-$(CONFIG_MACH_AG5EVM)	+= board-ag5evm.o
 obj-$(CONFIG_MACH_MACKEREL)	+= board-mackerel.o
+obj-$(CONFIG_MACH_KOTA2)	+= board-kota2.o
 
 # Framework support
 obj-$(CONFIG_SMP)		+= $(smp-y)
arch/arm/mach-shmobile/board-kota2.c new file +168 -0

168 lines not on this page · raw message

arch/arm/mach-shmobile/platsmp.c +6 -4
@@ -21,9 +21,11 @@
 #include <asm/mach-types.h>
 #include <mach/common.h>
 
+#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2())
+
 static unsigned int __init shmobile_smp_get_core_count(void)
 {
-	if (machine_is_ag5evm())
+	if (is_sh73a0())
 		return sh73a0_get_core_count();
 
 	return 1;
@@ -31,7 +33,7 @@ static unsigned int __init shmobile_smp_
 
 static void __init shmobile_smp_prepare_cpus(void)
 {
-	if (machine_is_ag5evm())
+	if (is_sh73a0())
 		sh73a0_smp_prepare_cpus();
 }
 
@@ -39,13 +41,13 @@ void __cpuinit platform_secondary_init(u
 {
 	trace_hardirqs_off();
 
-	if (machine_is_ag5evm())
+	if (is_sh73a0())
 		sh73a0_secondary_init(cpu);
 }
 
 int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
-	if (machine_is_ag5evm())
+	if (is_sh73a0())
 		return sh73a0_boot_secondary(cpu);
 
 	return -ENOSYS;
#1 lore raw

arch/arm/mach-shmobile/board-kota2.c line 157

Quoted 7 lines · Magnus Damm
arch/arm/mach-shmobile/board-kota2.c new file +7 -0
+static void __init kota2_timer_init(void)
+{
+	sh73a0_clock_init();
+	shmobile_timer.init();
+	return;
+}
+

Pointless return.

Quoted 5 lines
arch/arm/mach-shmobile/platsmp.c +0 -0
@@ -21,9 +21,11 @@
 #include <asm/mach-types.h>
 #include <mach/common.h>

arch/arm/mach-shmobile/platsmp.c line 31

Quoted 10 lines
arch/arm/mach-shmobile/platsmp.c +3 -1
 
+#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2())
+
 static unsigned int __init shmobile_smp_get_core_count(void)
 {
-	if (machine_is_ag5evm())
+	if (is_sh73a0())
 		return sh73a0_get_core_count();
 
 	return 1;

No. If you want to do this then simply do what the other platforms are doing and construct a cpu.h, then you can centrally define things and use cpu_is_xxx() outright. Making CPU inferences from mach type is just asking for trouble.

#2 lore raw
In reply to Magnus Damm
Quoted 24 lines · Paul Mundt

arch/arm/mach-shmobile/board-kota2.c line 157

Quoted 7 lines · Magnus Damm
arch/arm/mach-shmobile/board-kota2.c new file +7 -0
+static void __init kota2_timer_init(void)
+{
+	sh73a0_clock_init();
+	shmobile_timer.init();
+	return;
+}
+

Pointless return.

Quoted 14 lines
arch/arm/mach-shmobile/platsmp.c +3 -1
@@ -21,9 +21,11 @@
 #include <asm/mach-types.h>
 #include <mach/common.h>
 
+#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2())
+
 static unsigned int __init shmobile_smp_get_core_count(void)
 {
-	if (machine_is_ag5evm())
+	if (is_sh73a0())
 		return sh73a0_get_core_count();
 
Quoted 6 lines

arch/arm/mach-shmobile/platsmp.c line 31

Quoted 1 line
arch/arm/mach-shmobile/platsmp.c +0 -0
 	return 1;

No. If you want to do this then simply do what the other platforms are doing and construct a cpu.h, then you can centrally define things and use cpu_is_xxx() outright. Making CPU inferences from mach type is just asking for trouble.

I don't see any updates to this series that address any of these issues, even after I went to all of the trouble of setting them up in a topic branch for incremental fixing.

I'll merge the topic branch for now, but don't expect this to happen again if I don't see cleanup patches or the same lazy-ass approach is taken for any additional boards.