Skip to contentSkip to conversation

ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

PATCH Superseded Hugo Villeneuve 3 participants 6 messages May 21, 2008 – Jul 8, 2008 Kbuild

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

ARM: This patch adds support for the Lyrtech SFF-SDR board, based on the TI DaVinci architecture (ARM926EJS).

---

 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/davinci/sffsdr/Makefile     |   52 +++++++++
 board/davinci/sffsdr/board_init.S |   29 +++++
 board/davinci/sffsdr/config.mk    |   24 ++++
 board/davinci/sffsdr/dv_board.c   |  212 +++++++++++++++++++++++++++++++++++++
 board/davinci/sffsdr/u-boot.lds   |   52 +++++++++
 include/asm-arm/mach-types.h      |   13 +++
 include/configs/davinci_sffsdr.h  |  177 +++++++++++++++++++++++++++++++
 9 files changed, 563 insertions(+), 0 deletions(-)
MAKEALL +1 -0
index 37b4334..f53ceec 100755
@@ -496,6 +496,7 @@ LIST_ARM9="			\
 	voiceblue		\
 	davinci_dvevm		\
 	davinci_schmoogie	\
+	davinci_sffsdr		\
 	davinci_sonata		\
 "
 
Makefile +3 -0
index 6548f8e..05d90aa 100644
@@ -2408,6 +2408,9 @@ davinci_dvevm_config :	unconfig
 davinci_schmoogie_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs schmoogie davinci davinci
 
+davinci_sffsdr_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs sffsdr davinci davinci
+
 davinci_sonata_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs sonata davinci davinci
 
board/davinci/sffsdr/Makefile new file +52 -0

52 lines not on this page · raw message

board/davinci/sffsdr/board_init.S new file +29 -0
new file mode 100644
index 0000000..22d8adc
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2007 Sergey Kubushyn <[email protected]>
+ *
+ * Board-specific low level initialization code. Called at the very end
+ * of cpu/arm926ejs/davinci/lowlevel_init.S. Just returns if there is no
+ * initialization required.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <config.h>
+
+.globl	dv_board_init
+dv_board_init:
+
+	mov	pc, lr
board/davinci/sffsdr/config.mk new file +24 -0
new file mode 100644
index 0000000..e8a329c
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+# David Mueller, ELSOFT AG, <[email protected]>
+#
+# Lyrtech SFF SDR board (ARM926EJS) cpu
+# see http://www.lyrtech.com/ for more information on Lyrtech
+#
+# SFF SDR board has 1 bank of 128 MB DDR RAM
+# Physical Address:
+# 8000'0000 to 87FF'FFFF
+#
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+#
+# Integrity kernel is expected to be at 8000'0000, entry 8000'00D0,
+# up to 81FF'FFFF (uses up to 32 MB of memory for text, heap, etc).
+#
+# we load ourself to 8400'0000
+#
+#
+
+# Provide at least 32MB spacing between us and the Integrity kernel image
+TEXT_BASE = 0x84000000
board/davinci/sffsdr/dv_board.c new file +212 -0

212 lines not on this page · raw message

board/davinci/sffsdr/u-boot.lds new file +52 -0

52 lines not on this page · raw message

include/asm-arm/mach-types.h +13 -0
index aaf2ea2..b347857 100644
@@ -1595,6 +1595,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_P300                 1602
 #define MACH_TYPE_XDACOMET             1603
 #define MACH_TYPE_DEXFLEX2             1604
+#define MACH_TYPE_SFFSDR               1657
 
 #ifdef CONFIG_ARCH_EBSA110
 # ifdef machine_arch_type
@@ -16500,6 +16501,18 @@ extern unsigned int __machine_arch_type;
 # define machine_is_schmoogie()	(0)
 #endif
 
+#ifdef CONFIG_MACH_SFFSDR
+# ifdef machine_arch_type
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_SFFSDR
+# endif
+# define machine_is_sffsdr()	(machine_arch_type == MACH_TYPE_SFFSDR)
+#else
+# define machine_is_sffsdr()	(0)
+#endif
+
 #ifdef CONFIG_MACH_AZTOOL
 # ifdef machine_arch_type
 #  undef machine_arch_type
include/configs/davinci_sffsdr.h new file +177 -0

177 lines not on this page · raw message

#1 lore raw

PATCH 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

Quoted 21 lines
board/davinci/sffsdr/Makefile new file +20 -0
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn <[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

board/davinci/sffsdr/Makefile line 30

Quoted 10 lines
board/davinci/sffsdr/Makefile new file +10 -0
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	:= dv_board.o

please use $(BOARD).o

Quoted 25 lines
board/davinci/sffsdr/Makefile new file +25 -0
+SOBJS	:= board_init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak *~ .depend
+
+#########################################################################
+ * ----------------------------------------------------------------------------
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/emac_defs.h>
+
+DECLARE_GLOBAL_DATA_PTR;

board/davinci/sffsdr/Makefile

Quoted 10 lines
board/davinci/sffsdr/Makefile new file +10 -0
+
+extern void	timer_init(void);
+extern int	eth_hw_init(void);
+extern phy_t	phy;
+
+
+/* Works on Always On power domain only (no PD argument) */
+void lpsc_on(unsigned int id)
+{
+	dv_reg_p	mdstat, mdctl;

^^^^^^^
please use space instead of tab

Quoted 20 lines
board/davinci/sffsdr/dv_board.c new file +20 -0
+
+	if (id >= DAVINCI_LPSC_GEM)
+		return;			/* Don't work on DSP Power Domain */
+
+	mdstat = REG_P(PSC_MDSTAT_BASE + (id * 4));
+	mdctl = REG_P(PSC_MDCTL_BASE + (id * 4));
+
+	while (REG(PSC_PTSTAT) & 0x01);
+
+	if ((*mdstat & 0x1f) == 0x03)
+		return;			/* Already on and enabled */
+
+	*mdctl |= 0x03;
+
+	/* Special treatment for some modules as for sprue14 p.7.4.2 */
+	if ((id == DAVINCI_LPSC_VPSSSLV) ||
+	    (id == DAVINCI_LPSC_EMAC) ||
+	    (id == DAVINCI_LPSC_EMAC_WRAPPER) ||
+	    (id == DAVINCI_LPSC_MDIO) ||
+	    (id == DAVINCI_LPSC_USB) ||

board/davinci/sffsdr/dv_board.c line 72

Quoted 10 lines
board/davinci/sffsdr/dv_board.c new file +10 -0
+	    (id == DAVINCI_LPSC_ATA) ||
+	    (id == DAVINCI_LPSC_VLYNQ) ||
+	    (id == DAVINCI_LPSC_UHPI) ||
+	    (id == DAVINCI_LPSC_DDR_EMIF) ||
+	    (id == DAVINCI_LPSC_AEMIF) ||
+	    (id == DAVINCI_LPSC_MMC_SD) ||
+	    (id == DAVINCI_LPSC_MEMSTICK) ||
+	    (id == DAVINCI_LPSC_McBSP) ||
+	    (id == DAVINCI_LPSC_GPIO))
+		* mdctl |= 0x200;

Please use switch instead of this long if

board/davinci/sffsdr/dv_board.c line 82

Quoted 10 lines
board/davinci/sffsdr/dv_board.c new file +10 -0
+
+	REG(PSC_PTCMD) = 0x01;
+
+	while (REG(PSC_PTSTAT) & 0x03);
+	while ((*mdstat & 0x1f) != 0x03);	/* Probably an overkill... */
+}
+
+void dsp_on(void)
+{
+	int	i;

please use spacr

Quoted 21 lines
board/davinci/sffsdr/dv_board.c new file +21 -0
+
+	if (REG(PSC_PDSTAT1) & 0x1f)
+		return;			/* Already on */
+
+	REG(PSC_GBLCTL) |= 0x01;
+	REG(PSC_PDCTL1) |= 0x01;
+	REG(PSC_PDCTL1) &= ~0x100;
+	REG(PSC_MDCTL_BASE + (DAVINCI_LPSC_GEM * 4)) |= 0x03;
+	REG(PSC_MDCTL_BASE + (DAVINCI_LPSC_GEM * 4)) &= 0xfffffeff;
+	REG(PSC_MDCTL_BASE + (DAVINCI_LPSC_IMCOP * 4)) |= 0x03;
+	REG(PSC_MDCTL_BASE + (DAVINCI_LPSC_IMCOP * 4)) &= 0xfffffeff;
+	REG(PSC_PTCMD) = 0x02;
+
+	for (i = 0; i < 100; i++) {
+		if (REG(PSC_EPCPR) & 0x02)
+			break;
+	}
+
+	REG(PSC_CHP_SHRTSW) = 0x01;
+	REG(PSC_PDCTL1) |= 0x100;
+	REG(PSC_EPCCR) = 0x02;

board/davinci/sffsdr/dv_board.c line 113

Quoted 10 lines
board/davinci/sffsdr/dv_board.c new file +10 -0
+
+	for (i = 0; i < 100; i++) {
+		if (!(REG(PSC_PTSTAT) & 0x02))
+			break;
+	}
+
+	REG(PSC_GBLCTL) &= ~0x1f;
+}
+
+

please remove empty ligne

board/davinci/sffsdr/dv_board.c line 164

Quoted 11 lines
board/davinci/sffsdr/dv_board.c new file +11 -0
+int board_init(void)
+	timer_init();
+
+	return(0);
+}
+
+int misc_init_r(void)
+{
+	u_int8_t	tmp[20], buf[10];
+	int		i = 0;
+	int		clk = 0;

please use space

Quoted 23 lines
include/configs/davinci_sffsdr.h new file +22 -0
+
+	clk = ((REG(PLL2_PLLM) + 1) * 27) / ((REG(PLL2_DIV2) & 0x1f) + 1);
+
+	printf("ARM Clock: %dMHz\n", ((REG(PLL1_PLLM) + 1) * 27) / 2);
+	printf("DDR Clock: %dMHz\n", (clk / 2));
 
+/*==============================*/
+#undef CONFIG_USE_IRQ                  /* No IRQ/FIQ in U-Boot */
+#define CONFIG_MISC_INIT_R
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTFILE		"uImage"	/* Boot file name */
+#define CFG_PROMPT		"U-Boot > "	/* Monitor Command Prompt */
+#define CFG_CBSIZE		1024		/* Console I/O Buffer Size  */
+/* Print buffer size */
+#define CFG_PBSIZE		(CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+#define CFG_MAXARGS		16		/* max number of command args */
+#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size */
+#define CFG_LOAD_ADDR		0x80700000	/* Default Linux kernel
+						 * load address. */
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE		/* Won't work with hush so far,
+					 * may be later */
+#define CFG_HUSH_PARSER

include/configs/davinci_sffsdr.h line 140

Quoted 10 lines
include/configs/davinci_sffsdr.h new file +10 -0
+#define CFG_PROMPT_HUSH_PS2	"> "
+#define CONFIG_CMDLINE_EDITING
+#define CFG_LONGHELP
+#define CONFIG_CRC32_VERIFY
+#define CONFIG_MX_CYCLIC
+/*
+ * Define this to load an Integrity kernel.
+ *
+#define CONFIG_CMD_ELF
+ */

If no need please remove

include/configs/davinci_sffsdr.h line 150

Quoted 10 lines
include/configs/davinci_sffsdr.h new file +9 -0
+
+/*===================*/
+/* Linux Information */
 
+#define LINUX_BOOT_PARAM_ADDR	0x80000100
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_BOOTARGS							\
+	"mem=56M console=ttyS0,115200n8 root=/dev/hda1 rw noinitrd ip=dhcp"
+#define CONFIG_BOOTCOMMAND	"setenv setboot setenv bootargs \\$(bootargs) video=dm64xxfb:output=\\$(videostd);run setboot"

please split it too long

Quoted 16 lines
include/configs/davinci_sffsdr.h new file +16 -0
+
+/*=================*/
+/* U-Boot commands */
+/*=================*/
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA

include/configs/davinci_sffsdr.h line 176

Quoted 10 lines
include/configs/davinci_sffsdr.h new file +10 -0
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+/*=======================*/
+/* KGDB support (if any) */
+/*=======================*/
+#ifdef CONFIG_CMD_KGDB
+#define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
+#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use */
+#endif

Best Regards,
J.

#2 lore raw

PATCH 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

In reply to Hugo Villeneuve
Quoted 7 lines · In message <[email protected]> you…

ARM: This patch adds support for the Lyrtech SFF-SDR board, based on the TI DaVinci architecture (ARM926EJS).

---

Quoted 10 lines
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/davinci/sffsdr/Makefile     |   52 +++++++++
 board/davinci/sffsdr/board_init.S |   29 +++++
 board/davinci/sffsdr/config.mk    |   24 ++++
 board/davinci/sffsdr/dv_board.c   |  212 +++++++++++++++++++++++++++++++++++++
 board/davinci/sffsdr/u-boot.lds   |   52 +++++++++
 include/asm-arm/mach-types.h      |   13 +++
 include/configs/davinci_sffsdr.h  |  177 +++++++++++++++++++++++++++++++
 9 files changed, 563 insertions(+), 0 deletions(-)

Applied [with minor fix in the board Makefile], thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Do we define evil as the absence of goodness? It seems only  logical
that shit happens--we discover this by the process of elimination."
                                                        -- Larry Wall
#3 lore raw

PATCH 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

Quoted 22 lines · wd at denx.de

In message <[email protected]> you

Quoted 16 lines · wrote:

ARM: This patch adds support for the Lyrtech SFF-SDR board, based on the TI DaVinci architecture (ARM926EJS).

 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/davinci/sffsdr/Makefile     |   52 +++++++++
 board/davinci/sffsdr/board_init.S |   29 +++++
 board/davinci/sffsdr/config.mk    |   24 ++++
 board/davinci/sffsdr/dv_board.c   |  212
 +++++++++++++++++++++++++++++++++++++
 board/davinci/sffsdr/u-boot.lds   |   52 +++++++++
 include/asm-arm/mach-types.h      |   13 +++
 include/configs/davinci_sffsdr.h  |  177
Quoted 2 lines

+++++++++++++++++++++++++++++++ 9 files changed, 563 insertions(+), 0 deletions(-)

Quoted 2 lines

Applied [with minor fix in the board Makefile], thanks. Wolfgang Denk

Wolfgang and/or Jean-Christophe,
I can see that you have applied V2 of my patch, but the latest patch that I sent with all the errors and the style issues fixed was V8. I will re-send the patch V8 in a few minutes so can you please use this latest version instead?

Thank-you, Hugo V.

Hugo Villeneuve
Hardware developer | Concepteur mat?riel
Lyrtech
Phone/T?l. : (1) (418) 877-4644 #2395
Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/T?l?c. : (1) (418) 877-7710
www.lyrtech.com
Infinite possibilities...TM

#4 lore raw

PATCH 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

Quoted 4 lines · In message <42848A5C5A0D1E47B026E644DD49B08E02806456@mail> you wrote:

Wolfgang and/or Jean-Christophe,
I can see that you have applied V2 of my patch, but the latest patch that I
sent with all the errors and the style issues fixed was V8. I will re-send

I dodn't find this in my list, then. Sorry.

Quoted 2 lines

the patch V8 in a few minutes so can you please use this latest version in
stead?

Please make sure to rebase the patch so it applies against the *current* version in the git repository, i. e. just esending an old patch that is based on previous versions is not useful.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Politician:  An  eel  in  the  fundamental   mud   upon   which   the
superstructure  of  organized  society is reared. When he wriggles he
mistakes the agitation of his tail for the trembling of the  edifice.
As  compared with the statesman, he suffers the disadvantage of being
alive.                                               - Ambrose Bierce
#5 lore raw

PATCH 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

Quoted 7 lines · wd at denx.de
Quoted 5 lines · In message <42848A5C5A0D1E47B026E644DD49B08E02806456@mail> you wrote:

Wolfgang and/or Jean-Christophe,
I can see that you have applied V2 of my patch, but the latest patch
that I sent with all the errors and the style issues fixed was V8.
I will re-send

Quoted 8 lines

I dodn't find this in my list, then. Sorry.

Quoted 2 lines

the patch V8 in a few minutes so can you please use this latest
version in stead?

Please make sure to rebase the patch so it applies against the *current* version in the git repository, i. e. just esending an old patch that is based on previous versions is not useful.

Understood, I?m rebasing right now :)

Hugo V.

Hugo Villeneuve
Hardware developer | Concepteur mat?riel
Lyrtech
Phone/T?l. : (1) (418) 877-4644 #2395
Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/T?l?c. : (1) (418) 877-7710
www.lyrtech.com
Infinite possibilities...TM