Skip to contentSkip to conversation

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

PATCH Superseded Hugo Villeneuve 2 participants 3 messages Jun 5, 2008 – Jun 6, 2008 Kbuild

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 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).

Changes between V5 and V6:
-New email address for contributor.
-Init of EMIF-A CS3 address space to load FPGA.
-Dynamic parsing of MAC address in EEPROM.
-Add boot delay of 5 sec.
-Use NFS for Linux boot command.
-Add relocate flag for command history.

---

 CREDITS                           |    5 +
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/davinci/sffsdr/Makefile     |   51 +++++++
 board/davinci/sffsdr/board_init.S |   32 ++++
 board/davinci/sffsdr/config.mk    |   42 ++++++
 board/davinci/sffsdr/sffsdr.c     |  288 +++++++++++++++++++++++++++++++++++++
 board/davinci/sffsdr/u-boot.lds   |   52 +++++++
 include/asm-arm/mach-types.h      |   13 ++
 include/configs/davinci_sffsdr.h  |  177 +++++++++++++++++++++++
 10 files changed, 664 insertions(+), 0 deletions(-)
CREDITS +5 -0
index e84ef38..b855904 100644
@@ -533,3 +533,8 @@ N: Timo Tuunainen
 E: timo.tuunainen at sysart.fi
 D: Support for Artila M-501 starter kit
 W: http://www.sysart.fi/
+
+N: Philip Balister
+E: philip at opensdr.com
+D: Port to Lyrtech SFFSDR development board.
+W: www.opensdr.com
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 +51 -0

51 lines not on this page · raw message

board/davinci/sffsdr/board_init.S new file +32 -0
new file mode 100644
index 0000000..84ecd96
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ *
+ * 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
+ * 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 +42 -0

42 lines not on this page · raw message

board/davinci/sffsdr/sffsdr.c new file +288 -0

288 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 v6 1/1 ARM: Add support for Lyrtech SFF-SDR board (ARM926EJS)

Quoted 17 lines · Hugo Villeneuve

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

Changes between V5 and V6:
-New email address for contributor.
-Init of EMIF-A CS3 address space to load FPGA.
-Dynamic parsing of MAC address in EEPROM.
-Add boot delay of 5 sec.
-Use NFS for Linux boot command.
-Add relocate flag for command history.

---

 CREDITS                           |    5 +

board/davinci/sffsdr/sffsdr.c line 171

Quoted 8 lines
board/davinci/sffsdr/sffsdr.c new file +8 -0
+	/* Set the Bus Priority Register to appropriate value */
+	REG(VBPR) = 0x20;
+
+	timer_init();
+
+	return(0);
+}
+

Is it possible that you add a documentiation about the EEPROM content?

Quoted 31 lines
board/davinci/sffsdr/sffsdr.c new file +31 -0
+/* Read ethernet MAC address from Integrity data structure inside EEPROM. */
+int read_mac_address(uint8_t *buf)
+{
+	u_int32_t value, mac[2], address;
+
+	/* Read Integrity data structure checkword. */
+	if (i2c_read(CFG_I2C_EEPROM_ADDR, INTEGRITY_CHECKWORD_OFFSET,
+		     CFG_I2C_EEPROM_ADDR_LEN, (uint8_t *) &value, 4)) {
+		printf("Read from EEPROM @ 0x%02x failed\n",
+		       CFG_I2C_EEPROM_ADDR);
+		return 1;
+	}
+	if (value != INTEGRITY_CHECKWORD_VALUE)
+		return 1;
+
+	/* Read SYSCFG structure offset. */
+	if (i2c_read(CFG_I2C_EEPROM_ADDR, INTEGRITY_SYSCFG_OFFSET,
+		     CFG_I2C_EEPROM_ADDR_LEN, (uint8_t *) &value, 4)) {
+		printf("Read from EEPROM @ 0x%02x failed\n",
+		       CFG_I2C_EEPROM_ADDR);
+		return 1;
+	}
+	address = 0x800 + (int) value; /* Address where SYSCFG structure
+					* is located. */
+
+ * 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,

board/davinci/sffsdr/sffsdr.c

Quoted 10 lines
board/davinci/sffsdr/sffsdr.c new file +10 -0
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+#include <asm/sizes.h>
+
+/*=======*/
+/* Board */
+/*=======*/

If Possible use this kind of comment style
/*
*
*/

I'll ack this too

Quoted 42 lines
include/configs/davinci_sffsdr.h new file +42 -0
+#define SFFSDR
+#define CFG_NAND_LARGEPAGE
+#define CFG_USE_NAND
+/*===================*/
+/* SoC Configuration */
+/*===================*/
+#define CONFIG_ARM926EJS			/* arm926ejs CPU core */
+#define CONFIG_SYS_CLK_FREQ	297000000	/* Arm Clock frequency */
+#define CFG_TIMERBASE		0x01c21400	/* use timer 0 */
+#define CFG_HZ_CLOCK		27000000	/* Timer Input clock freq */
+#define CFG_HZ			1000
+/*==================================================*/
+/* EEPROM definitions for Atmel 24LC64 EEPROM chip  */
+/*==================================================*/
+#define CFG_I2C_EEPROM_ADDR_LEN		2
+#define CFG_I2C_EEPROM_ADDR		0x50
+#define CFG_EEPROM_PAGE_WRITE_BITS	5
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS	20
+/*=============*/
+/* Memory Info */
+/*=============*/
+#define CFG_MALLOC_LEN		(0x10000 + 256*1024)	/* malloc() len */
+#define CFG_GBL_DATA_SIZE	128		/* reserved for initial data */
+#define CFG_MEMTEST_START	0x80000000	/* memtest start address */
+#define CFG_MEMTEST_END		0x81000000	/* 16MB RAM test */
+#define CONFIG_NR_DRAM_BANKS	1		/* we have 1 bank of DRAM */
+#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
+#define CFG_PROMPT_HUSH_PS2	"> "
+#define CONFIG_CMDLINE_EDITING
+#define CFG_LONGHELP
+#define CONFIG_CRC32_VERIFY
+#define CONFIG_MX_CYCLIC
+/*===================*/
+/* Linux Information */
+/*===================*/
+#define LINUX_BOOT_PARAM_ADDR	0x80000100
+#define CONFIG_CMDLINE_TAG

include/configs/davinci_sffsdr.h

Quoted 10 lines
include/configs/davinci_sffsdr.h new file +10 -0
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_BOOTARGS			\
+	"mem=56M "			\
+	"console=ttyS0,115200n8 "	\
+	"root=/dev/nfs rw noinitrd ip=dhcp "	\
+	"nfsroot=${serverip}:/nfsroot/sffsdr "	\
+	"nwhwconf=device:eth0,hwaddr:${ethaddr}"
+#define CONFIG_BOOTCOMMAND	\
+	"nand read 87A00000 100000 300000;"	\
+	"bootelf 87A00000"

Could you align it or I will do it when I'll apply the patch, If it's ok with you.

Best Regards,
J.

#2 lore raw

PATCH v6 1/1 ARM: Add support for Lyrtech SFF-SDRboard (ARM926EJS)

Quoted 17 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 16 lines · Hugo Villeneuve

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

Changes between V5 and V6:
-New email address for contributor.
-Init of EMIF-A CS3 address space to load FPGA.
-Dynamic parsing of MAC address in EEPROM.
-Add boot delay of 5 sec.
-Use NFS for Linux boot command.
-Add relocate flag for command history.

---

Quoted 10 lines

board/davinci/sffsdr/sffsdr.c line 171

Quoted 8 lines
 CREDITS                           |    5 +
board/davinci/sffsdr/sffsdr.c new file +7 -0
+	/* Set the Bus Priority Register to appropriate value */
+	REG(VBPR) = 0x20; +
+	timer_init();
+
+	return(0);
+}
+

Is it possible that you add a documentiation about the EEPROM content?

Hi Jean-Christophe,
unfortunately, I don?t have the data structure of the EEPROM, only the algorithym to parse it to find the MAC address.

Quoted 8 lines

include/configs/davinci_sffsdr.h line 29

Quoted 4 lines
include/configs/davinci_sffsdr.h new file +4 -0
+
+/*=======*/
+/* Board */
+/*=======*/

If Possible use this kind of comment style
/*
*
*/

Ok, I fixed it.

Quoted 6 lines
Quoted 6 lines
include/configs/davinci_sffsdr.h new file +6 -0
+#define LINUX_BOOT_PARAM_ADDR	0x80000100
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_BOOTARGS			\
+	"mem=56M "			\
+	"console=ttyS0,115200n8 "	\
Quoted 8 lines

include/configs/davinci_sffsdr.h line 151

Quoted 6 lines
include/configs/davinci_sffsdr.h new file +6 -0
+	"root=/dev/nfs rw noinitrd ip=dhcp "	\
+	"nfsroot=${serverip}:/nfsroot/sffsdr "	\
+	"nwhwconf=device:eth0,hwaddr:${ethaddr}"
+#define CONFIG_BOOTCOMMAND	\
+	"nand read 87A00000 100000 300000;"	\
+	"bootelf 87A00000"

Could you align it or I will do it when I'll apply the patch, If it's ok with you.

Since I?m not sure how you want it to be aligned, please go ahead and do it when you apply the patch as you suggested.

I?m sending updated patch after this mail.

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