sh: add support for SMSC Polaris platform
PATCH 1/2 sh: add support for SMSC Polaris platform
Polaris is an SMSC reference platform with a SH7709S CPU and LAN9118 ethernet controller. This patch adds support for it.
--- arch/sh/boards/Kconfig | 7 ++ arch/sh/boards/Makefile | 1 + arch/sh/boards/board-polaris.c | 160 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 0 deletions(-) create mode 100644 arch/sh/boards/board-polaris.c
arch/sh/boards/Kconfig +7 -0
@@ -261,6 +261,13 @@ config SH_CAYMAN depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103 select SYS_SUPPORTS_PCI +config SH_POLARIS + bool "SMSC Polaris" + select CPU_HAS_IPR_IRQ + depends on CPU_SUBTYPE_SH7709 + help + Select if configuring for an SMSC Polaris development board + endmenu source "arch/sh/boards/mach-r2d/Kconfig"
arch/sh/boards/Makefile +1 -0
@@ -8,3 +8,4 @@ obj-$(CONFIG_SH_URQUELL) += board-urquell.o obj-$(CONFIG_SH_SHMIN) += board-shmin.o obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o obj-$(CONFIG_SH_ESPT) += board-espt.o +obj-$(CONFIG_SH_POLARIS) += board-polaris.o
arch/sh/boards/board-polaris.c new file +160 -0
160 lines not on this page · raw message
Signature · 1 line
1.6.0.6
Hi, Steve.
Quoted 10 lines · On Thu, 19 Mar 2009 10:42:41 +0000 Steve Glendinning…
Polaris is an SMSC reference platform with a SH7709S CPU and LAN9118 ethernet controller. This patch adds support for it.
Signed-off-by Steve Glendinning <[email protected]>--- arch/sh/boards/Kconfig | 7 ++ arch/sh/boards/Makefile | 1 + arch/sh/boards/board-polaris.c | 160 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 0 deletions(-) create mode 100644 arch/sh/boards/board-polaris.c
You forget update of arch/sh/tools/mach-types.
Quoted 34 lines
arch/sh/boards/Kconfig +7
-0@@ -261,6 +261,13 @@ config SH_CAYMAN depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103 select SYS_SUPPORTS_PCI +config SH_POLARIS + bool "SMSC Polaris" + select CPU_HAS_IPR_IRQ + depends on CPU_SUBTYPE_SH7709 + help + Select if configuring for an SMSC Polaris development board + endmenu source "arch/sh/boards/mach-r2d/Kconfig"arch/sh/boards/Makefile +1
-0@@ -8,3 +8,4 @@ obj-$(CONFIG_SH_URQUELL) += board-urquell.o obj-$(CONFIG_SH_SHMIN) += board-shmin.o obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o obj-$(CONFIG_SH_ESPT) += board-espt.o +obj-$(CONFIG_SH_POLARIS) += board-polaris.oarch/sh/boards/board-polaris.c new file +0
-0
arch/sh/boards/board-polaris.c line 2
Quoted 2 lines
arch/sh/boards/board-polaris.c new file +2
-0@@ -0,0 +1,160 @@ +/* +* linux/arch/sh/boards/se/770x/polaris.c
A file pass is wrong.
Quoted 6 lines
arch/sh/boards/board-polaris.c new file +6
-0+* +* June 2006 [email protected] +* +* Polaris-specific resource declaration +* +*/
<snip>
arch/sh/boards/board-polaris.c line 33
Quoted 7 lines
arch/sh/boards/board-polaris.c new file +7
-0+static struct resource smsc911x_resources[] = { + [0 ] = { + .name ="smsc911x-memory" , + .start =PA_EXT5 , + .end =PA_EXT5 +0x1fff , + .flags =IORESOURCE_MEM , + }, [1 ] = {
space prohibited before open square bracket '['
arch/sh/boards/board-polaris.c line 43
Quoted 10 lines
arch/sh/boards/board-polaris.c new file +10
-0+ .name = "smsc911x-irq", + .start = IRQ0_IRQ, + .end = IRQ0_IRQ, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct smsc911x_platform_config smsc911x_config = { + .irq_polarity =SMSC911X_IRQ_POLARITY_ACTIVE_LOW , + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
Please fix white space.
Quoted 4 lines
arch/sh/boards/board-polaris.c new file +4
-0+ .flags = SMSC911X_USE_32BIT, + .phy_interface = PHY_INTERFACE_MODE_MII, +}; +
<snip>
Quoted 16 lines
arch/sh/boards/board-polaris.c new file +16
-0+ +static int __init polaris_initialise (void ) +{ +u16 wcr, bcr_mask; + +printk (KERN_INFO "Configuring Polaris external bus\n" ); + +/* Configure area 5 with 2 wait states */ + wcr =ctrl_inw (WCR2 ); + wcr &= (~AREA5_WAIT_CTRL ); + wcr |= (WAIT_STATES_10 <<10 ); +ctrl_outw (wcr,WCR2 ); + + bcr_mask =ctrl_inw (BCR2 ); + +/* The polaris platform has a DIP switch fitted, whose setting defines
arch/sh/boards/board-polaris.c line 113
Quoted 10 lines
arch/sh/boards/board-polaris.c new file +10
-0+* whether the LAN9118 is to be used in 32-bit mode. We should detect +* its value here and set this accordingly, but for now assume 32-bit */ +#if 0 +/* Configure area 5 for 16-bit access */ + bcr_mask &= ~(1 <<10 ); +#else +/* Configure area 5 for 32-bit access */ + bcr_mask |=1 <<10 ; +#endif +
I think yout should remove this '#if 0' code.
You should change it by the information if this board can acquire the information of the DIP switch.
You had better change it if you cannot do it to be able to control it in Kconfig. In addition, you had better change the change of this line and the change of platform-data of smsc911x to change it.
Best regards,
Nobuhiro
Signature · 2 lines
Nobuhiro Iwamatsu GPG ID : 3170EBE9