Skip to contentSkip to conversation

Marvell Kirkwood family SOC support

PATCH Superseded Prafulla Wadaskar 1 participant 1 message May 3, 2009

Subsystems (2)

v5 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 Marvell Kirkwood family SOC support

Kirkwood family controllers are highly integrated SOCs based on Feroceon-88FR131/Sheeva-88SV131 cpu core.

SOC versions supported:-
1) 88F6281-A0 define CONFIG_KW88F6281_A0
2) 88F6192-A0 define CONFIG_KW88F6192_A0

Other supported features:-
1) get_random_hex() fucntion
2) SPI port controller driver
3) PCI Express port initialization

Contributors:
Yotam Admon <[email protected]>
Michael Blostein <michaelbl at marvell.com

---
Change log:
v2: crated arch-kirkwood and moved some header files there renamed and moved spi.c to drivers/spi/
renamed and moved serial.c to drivers/serial/ doimage utility removed
soc_init.S renamed as lowlevel_init.S
debug prints removed

v3: lowlevel_init.S converted to lowlevel_init.c removed BITxx macros, removed entire assembly code Added CONFIG_ARCH_LOWLEVE_INIT support for arm926ejs core updated as per review commens for v2

v4: updated as per review comments for v3 print_cpuinfo used to display Soc info arch_misc_init support created and used for lib_arm mandatory readl/write macros used
asm/cache.h asm/arch/spi.h asm//arch/serial.h created and used

v5: updated as per review comments for v4
cosmetic updates, arch_misc_init and arch_cpu_init used
start.S updated to call arch_lowlevel_init in case if lowlevl_init is skipped bug fix in cpu.c

 cpu/arm926ejs/kirkwood/Makefile           |   50 +++++
 cpu/arm926ejs/kirkwood/config.mk          |   25 +++
 cpu/arm926ejs/kirkwood/cpu.c              |  287 +++++++++++++++++++++++++++++
 cpu/arm926ejs/kirkwood/cpu.h              |   99 ++++++++++
 cpu/arm926ejs/kirkwood/dram.c             |   57 ++++++
 cpu/arm926ejs/kirkwood/lowlevel_init.S    |   43 +++++
 cpu/arm926ejs/kirkwood/timer.c            |  159 ++++++++++++++++
 cpu/arm926ejs/start.S                     |    9 +-
 drivers/serial/Makefile                   |    1 +
 drivers/serial/kirkwood_serial.c          |  128 +++++++++++++
 drivers/spi/Makefile                      |    1 +
 drivers/spi/kirkwood_spi.c                |  167 +++++++++++++++++
 include/asm-arm/arch-kirkwood/kirkwood.h  |  118 ++++++++++++
 include/asm-arm/arch-kirkwood/kw88f6192.h |   37 ++++
 include/asm-arm/arch-kirkwood/kw88f6281.h |   37 ++++
 include/asm-arm/arch-kirkwood/serial.h    |   89 +++++++++
 include/asm-arm/arch-kirkwood/spi.h       |   39 ++++
 include/asm-arm/cache.h                   |   49 +++++
 include/asm-arm/config.h                  |    4 +
 include/common.h                          |    1 +
 lib_arm/board.c                           |    4 +
 21 files changed, 1402 insertions(+), 2 deletions(-)
 create mode 100644 cpu/arm926ejs/kirkwood/Makefile
 create mode 100644 cpu/arm926ejs/kirkwood/config.mk
 create mode 100644 cpu/arm926ejs/kirkwood/cpu.c
 create mode 100644 cpu/arm926ejs/kirkwood/cpu.h
 create mode 100644 cpu/arm926ejs/kirkwood/dram.c
 create mode 100644 cpu/arm926ejs/kirkwood/lowlevel_init.S
 create mode 100644 cpu/arm926ejs/kirkwood/timer.c
 create mode 100644 drivers/serial/kirkwood_serial.c
 create mode 100644 drivers/spi/kirkwood_spi.c
 create mode 100644 include/asm-arm/arch-kirkwood/kirkwood.h
 create mode 100644 include/asm-arm/arch-kirkwood/kw88f6192.h
 create mode 100644 include/asm-arm/arch-kirkwood/kw88f6281.h
 create mode 100644 include/asm-arm/arch-kirkwood/serial.h
 create mode 100644 include/asm-arm/arch-kirkwood/spi.h
 create mode 100644 include/asm-arm/cache.h
cpu/arm926ejs/kirkwood/Makefile new file +50 -0
new file mode 100644
index 0000000..db41d7c
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Prafulla Wadaskar <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).a
+
+COBJS-y	= dram.o
+COBJS-y	+= cpu.o
+COBJS-y	+= timer.o
+
+SOBJS	= lowlevel_init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
cpu/arm926ejs/kirkwood/config.mk new file +25 -0
new file mode 100644
index 0000000..000eeb4
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Prafulla Wadaskar <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+PLATFORM_CPPFLAGS += -march=armv5te
cpu/arm926ejs/kirkwood/cpu.c new file +287 -0

287 lines not on this page · raw message

cpu/arm926ejs/kirkwood/cpu.h new file +99 -0

99 lines not on this page · raw message

cpu/arm926ejs/kirkwood/dram.c new file +57 -0

57 lines not on this page · raw message

cpu/arm926ejs/kirkwood/lowlevel_init.S new file +43 -0

43 lines not on this page · raw message

cpu/arm926ejs/kirkwood/timer.c new file +159 -0

159 lines not on this page · raw message

cpu/arm926ejs/start.S +7 -2
index ed4932a..bdbb7e0 100644
@@ -139,7 +139,7 @@ reset:
 	 * we do sys-critical inits only at reboot,
 	 * not when booting from ram!
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#if !defined (CONFIG_SKIP_LOWLEVEL_INIT) || defined (CONFIG_ARCH_LOWLEVEL_INIT)
 	bl	cpu_init_crit
 #endif
 
@@ -201,7 +201,7 @@ _start_armboot:
  *
  *************************************************************************
  */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#if !defined (CONFIG_SKIP_LOWLEVEL_INIT) || defined (CONFIG_ARCH_LOWLEVEL_INIT)
 cpu_init_crit:
 	/*
 	 * flush v4 I/D caches
@@ -224,7 +224,12 @@ cpu_init_crit:
 	 * Go setup Memory and board specific bits prior to relocation.
 	 */
 	mov	ip, lr		/* perserve link reg across call */
+#ifdef CONFIG_ARCH_LOWLEVEL_INIT
+	bl	arch_lowlevel_init	/* go setup arch specific init */
+#endif /* CONFIG_ARCH_LOWLEVEL_INIT */
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 	bl	lowlevel_init	/* go setup pll,mux,memory */
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 	mov	lr, ip		/* restore link */
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
drivers/serial/Makefile +1 -0
index 14c818d..9174ec6 100644
@@ -28,6 +28,7 @@ LIB	:= $(obj)libserial.a
 COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
 COBJS-$(CONFIG_AT91RM9200_USART) += at91rm9200_usart.o
 COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
+COBJS-$(CONFIG_KIRKWOOD_SERIAL) += kirkwood_serial.o
 COBJS-$(CONFIG_MCFUART) += mcfuart.o
 COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
 COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
drivers/serial/kirkwood_serial.c new file +128 -0

128 lines not on this page · raw message

drivers/spi/Makefile +1 -0
index 1350f3e..7ffa47d 100644
@@ -28,6 +28,7 @@ LIB	:= $(obj)libspi.a
 COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
 COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
+COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
drivers/spi/kirkwood_spi.c new file +167 -0

167 lines not on this page · raw message

include/asm-arm/arch-kirkwood/kirkwood.h new file +118 -0

118 lines not on this page · raw message

include/asm-arm/arch-kirkwood/kw88f6192.h new file +37 -0
new file mode 100644
index 0000000..000fc16
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <[email protected]>
+ *
+ * Header file for Feroceon CPU core 88FR131 Based KW88F6192 SOC.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CONFIG_KW88F6192_H
+#define _CONFIG_KW88F6192_H
+
+/* SOC specific definations */
+#define KW88F6192_REGS_PHYS_BASE	0xf1000000
+#define KW_REGS_PHY_BASE		KW88F6192_REGS_PHYS_BASE
+
+/* TCLK Core Clock defination */
+#define CONFIG_SYS_TCLK         166000000 /* 166MHz */
+
+#endif /* _CONFIG_KW88F6192_H */
include/asm-arm/arch-kirkwood/kw88f6281.h new file +37 -0
new file mode 100644
index 0000000..270d931
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <[email protected]>
+ *
+ * Header file for Feroceon CPU core 88FR131 Based KW88F6281 SOC.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _ASM_ARCH_KW88F6281_H
+#define _ASM_ARCH_KW88F6281_H
+
+/* SOC specific definations */
+#define KW88F6281_REGS_PHYS_BASE	0xf1000000
+#define KW_REGS_PHY_BASE		KW88F6281_REGS_PHYS_BASE
+
+/* TCLK Core Clock defination*/
+#define CONFIG_SYS_TCLK         200000000 /* 200MHz */
+
+#endif /* _ASM_ARCH_KW88F6281_H */
include/asm-arm/arch-kirkwood/serial.h new file +89 -0

89 lines not on this page · raw message

include/asm-arm/arch-kirkwood/spi.h new file +39 -0
new file mode 100644
index 0000000..0fd9131
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <[email protected]>
+ *
+ * Derived from drivers/spi/mpc8xxx_spi.c
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __KW_SPI_H__
+#define __KW_SPI_H__
+
+/* SPI Registers on kirkwood SOC */
+#define KW_REG_SPI_CTRL		KW_REGISTER(0x10600)
+#define KW_REG_SPI_CONFIG	KW_REGISTER(0x10604)
+#define KW_REG_SPI_DATA_OUT	KW_REGISTER(0x10608)
+#define KW_REG_SPI_DATA_IN	KW_REGISTER(0x1060c)
+#define KW_REG_SPI_IRQ_CAUSE	KW_REGISTER(0x10610)
+#define KW_REG_SPI_IRQ_MASK	KW_REGISTER(0x10614)
+
+#define KW_SPI_TIMEOUT		10000
+#endif __KW_SPI_H__
include/asm-arm/cache.h new file +49 -0

49 lines not on this page · raw message

include/asm-arm/config.h +4 -0
index 049c44e..5d52f15 100644
@@ -21,4 +21,8 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#if defined (CONFIG_KIRKWOOD)
+#include <asm-arm/arch-kirkwood/kirkwood.h>
+#endif /* CONFIG_KIRKWOOD */
+
 #endif
include/common.h +1 -0
index 30fff7d..9e4b859 100644
@@ -294,6 +294,7 @@ void	pciinfo	      (int, int);
 #endif
 #endif
 
+int	arch_misc_init (void);
 int	misc_init_f   (void);
 int	misc_init_r   (void);
 
lib_arm/board.c +4 -0
index 5d05d9b..b8db60d 100644
@@ -393,6 +393,10 @@ void start_armboot (void)
 
 	console_init_r ();	/* fully init console as a device */
 
+#if defined(CONFIG_ARCH_MISC_INIT)
+	/* miscellaneous arch dependent initialisations */
+	arch_misc_init ();
+#endif
 #if defined(CONFIG_MISC_INIT_R)
 	/* miscellaneous platform dependent initialisations */
 	misc_init_r ();
Signature · 1 line
1.5.3.4