[U-Boot] [PATCH] add support for EMK TOP7000 CPU module

Reinhard Meyer (-VC) reinhard.meyer at emk-elektronik.de
Sat Jun 5 12:41:04 CEST 2010


Add support for EMK TOP7000 CPU module

Specifics:

1) create subdir board/emk/top7000 and files in it
2) create include/configs/top7000.h
3) update board/emk/common/vpd.c
4) add call to misc_init_r() to arch/avr32/lib/board.c
5) create arch/avr32/include/asm/unaligned.h to
   fix zlib.c compilation problem
6) update Makefile, MAINTAINERS, MAKEALL

Signed-off-by: Reinhard Meyer <info at emk-elektronik.de>

---
 MAINTAINERS                        |    6 +-
 MAKEALL                            |    3 +-
 Makefile                           |    3 +
 arch/avr32/include/asm/unaligned.h |    1 +
 arch/avr32/lib/board.c             |    5 +
 board/emk/common/vpd.c             |   56 +++++++++-
 board/emk/top7000/Makefile         |   41 +++++++
 board/emk/top7000/config.mk        |    3 +
 board/emk/top7000/top7000.c        |  169 ++++++++++++++++++++++++++++
 board/emk/top7000/u-boot.lds       |   72 ++++++++++++
 include/configs/top7000.h          |  216 ++++++++++++++++++++++++++++++++++++
 11 files changed, 570 insertions(+), 5 deletions(-)
 create mode 100644 arch/avr32/include/asm/unaligned.h
 create mode 100644 board/emk/top7000/Makefile
 create mode 100644 board/emk/top7000/config.mk
 create mode 100644 board/emk/top7000/top7000.c
 create mode 100644 board/emk/top7000/u-boot.lds
 create mode 100644 include/configs/top7000.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 7a13d28..a361be1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -311,7 +311,7 @@ Andrea "llandre" Marson <andrea.marson at dave-tech.it>
 
 	PPChameleonEVB	PPC405EP
 
-Reinhard Meyer <r.meyer at emk-elektronik.de>
+Reinhard Meyer <reinhard.meyer at emk-elektronik.de>
 
 	TOP860		MPC860T
 	TOP5200		MPC5200
@@ -919,6 +919,10 @@ Julien May <julien.may at miromico.ch>
 
 	HAMMERHEAD		AT32AP7000
 
+Reinhard Meyer <reinhard.meyer at emk-elektronik.de>
+
+	TOP7000		AT32AP7000
+
 Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
 
 	ATSTK1000	AT32AP7xxx
diff --git a/MAKEALL b/MAKEALL
index 2527352..3a80041 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -873,7 +873,8 @@ LIST_avr32="		\
 	atngw100	\
 	favr-32-ezkit	\
 	hammerhead	\
-	mimc200		\
+	mimc200		\
+	top7000		\
 "
 
 #########################################################################
diff --git a/Makefile b/Makefile
index c26e491..e57a4ca 100644
--- a/Makefile
+++ b/Makefile
@@ -3549,6 +3549,9 @@ hammerhead_config	:	unconfig
 mimc200_config		:	unconfig
 	@$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 mimc at32ap700x
 
+top7000_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) avr32 at32ap top7000 emk at32ap700x
+
 #========================================================================
 # SH3 (SuperH)
 #========================================================================
diff --git a/arch/avr32/include/asm/unaligned.h b/arch/avr32/include/asm/unaligned.h
new file mode 100644
index 0000000..6cecbbb
--- /dev/null
+++ b/arch/avr32/include/asm/unaligned.h
@@ -0,0 +1 @@
+#include <asm-generic/unaligned.h>
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 917ed6c..6be5ab0
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -337,6 +337,11 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	jumptable_init();
 	console_init_r();
 
+#if defined(CONFIG_MISC_INIT_R)
+	/* miscellaneous platform dependent initialisations */
+	misc_init_r();
+#endif
+
 	s = getenv("loadaddr");
 	if (s)
 		load_addr = simple_strtoul(s, NULL, 16);
diff --git a/board/emk/common/vpd.c b/board/emk/common/vpd.c
index c2af219..a6c456b
--- a/board/emk/common/vpd.c
+++ b/board/emk/common/vpd.c
@@ -1,6 +1,6 @@
 /*
- * (C) Copyright 2003
- * Reinhard Meyer, EMK Elektronik GmbH, r.meyer at emk-elektronik.de
+ * (C) Copyright 2003-2010
+ * EMK Elektronik GmbH & Co. KG, reinhard.meyer at emk-elektronik.de
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,7 +22,8 @@
  */
 
 #include <common.h>
-
+#include <command.h>
+
 /*****************************************************************************
  * read "factory" part of EEPROM and set some environment variables
  *****************************************************************************/
@@ -70,6 +71,10 @@ void read_factory_r (void)
 		/* search for our specific entry */
 		if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
 			setenv ("ethaddr", (char *)(buf + 19));
+#if defined(CONFIG_TOP7000)
+		} else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ", 20)) {
+			setenv ("eth1addr", (char *)(buf + 20));
+#endif
 		} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
 			setenv ("serial#", (char *)(buf + 15));
 		} else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
@@ -77,3 +82,48 @@ void read_factory_r (void)
 		}
 	}
 }
+
+#if defined(CONFIG_TOP7000)
+int do_vpd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	uchar buf[512];
+	uchar *p;
+	int i;
+	u_int addr;
+
+	if (argc != 3)
+		return 1;
+
+	p = buf+2;
+	i = simple_strtoul(argv[1], NULL, 10);
+	if (i<1 || i>32766)
+		return 1;
+
+	addr=(i-1)*2;
+
+	p+=sprintf((char*)p,
+		"[RLA/lan/Ethernet] 00:80:d9:0d:%02x:%02x\n",
+		addr/256, addr%256);
+	addr++;
+	p+=sprintf((char*)p,
+		"[RLA/lan2/Ethernet] 00:80:d9:0d:%02x:%02x\n",
+		addr/256, addr%256);
+	p+=sprintf((char*)p, "[BOARD/SERIAL] %05d\n", i);
+	p+=sprintf((char*)p, "[BOARD/TYPE] %s\n", argv[2]);
+
+	i = p-buf-2;
+	buf[0]=i;
+	buf[1]=i>>8;
+	if (eeprom_write (CONFIG_SYS_I2C_FACT_ADDR,
+			CONFIG_SYS_FACT_OFFSET, buf, i+2)) {
+		printf ("cannot write factory configuration\n");
+		return 1;
+	}
+
+	return 0;
+}
+
+U_BOOT_CMD(vpd, 3, 0, do_vpd,
+	"enter vital product data",
+	"serialnumber type");
+#endif
diff --git a/board/emk/top7000/Makefile b/board/emk/top7000/Makefile
new file mode 100644
index 0000000..1fcf08b
--- /dev/null
+++ b/board/emk/top7000/Makefile
@@ -0,0 +1,41 @@
+#
+# (C) Copyright 2010
+# EMK Elektronik GmbH & Co. KG, reinhard.meyer at emk-elektronik.de
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB	:= $(obj)lib$(BOARD).a
+
+COBJS	:= $(BOARD).o ../common/vpd.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/emk/top7000/config.mk b/board/emk/top7000/config.mk
new file mode 100644
index 0000000..9a794e5
--- /dev/null
+++ b/board/emk/top7000/config.mk
@@ -0,0 +1,3 @@
+TEXT_BASE		= 0x00000000
+PLATFORM_RELFLAGS	+= -ffunction-sections -fdata-sections
+PLATFORM_LDFLAGS	+= --gc-sections
diff --git a/board/emk/top7000/top7000.c b/board/emk/top7000/top7000.c
new file mode 100644
index 0000000..bdc63cd
--- /dev/null
+++ b/board/emk/top7000/top7000.c
@@ -0,0 +1,169 @@
+/*
+ * (C) Copyright 2010
+ * EMK Elektronik GmbH & Co. KG, reinhard.meyer at emk-elektronik.de
+ *
+ * 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 <common.h>
+
+#include <asm/io.h>
+#include <asm/sdram.h>
+#include <asm/arch/clk.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/hmatrix.h>
+#include <asm/arch/portmux.h>
+#include <netdev.h>
+#include <i2c.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const struct sdram_config sdram_config = {
+	.data_bits	= SDRAM_DATA_16BIT,
+	.row_bits	= 13,
+	.col_bits	= 9,
+	.bank_bits	= 2,
+	.cas		= 3,
+	.twr		= 2,
+	.trc		= 7,
+	.trp		= 2,
+	.trcd		= 2,
+	.tras		= 5,
+	.txsr		= 5,
+	/* 7.81 us */
+	.refresh_period	= (781 * (SDRAMC_BUS_HZ / 1000)) / 100000,
+};
+
+int board_early_init_f(void)
+{
+	/* Enable SDRAM in the EBI mux */
+	hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE));
+
+	/* 16 data, 26 address lines */
+	portmux_enable_ebi(16, 26, 0, PORTMUX_DRIVE_HIGH);
+	portmux_enable_usart1(PORTMUX_DRIVE_MIN);
+
+#if defined(CONFIG_MACB)
+	portmux_enable_macb0(PORTMUX_MACB_MII, PORTMUX_DRIVE_HIGH);
+	portmux_enable_macb1(PORTMUX_MACB_MII, PORTMUX_DRIVE_HIGH);
+#endif
+#if defined(CONFIG_MMC)
+	portmux_enable_mmci(0, PORTMUX_MMCI_4BIT, PORTMUX_DRIVE_LOW);
+#endif
+#if defined(CONFIG_ATMEL_SPI)
+	portmux_enable_spi0(1 << 0, PORTMUX_DRIVE_LOW);
+#endif
+#ifdef CONFIG_CMD_I2C
+	/* set SCL and SDA to open drain gpio */
+	portmux_select_gpio(PORTMUX_PORT_A,(1<<SDA_PIN),
+		PORTMUX_DIR_OUTPUT|PORTMUX_INIT_LOW|PORTMUX_OPEN_DRAIN);
+	portmux_select_gpio(PORTMUX_PORT_A,(1<<SCL_PIN),
+		PORTMUX_DIR_OUTPUT|PORTMUX_INIT_LOW|PORTMUX_OPEN_DRAIN);
+	/* initialize i2c. note: params ignored in SOFT I2C */
+	i2c_init(0, 0);
+#endif
+	return 0;
+}
+
+phys_size_t initdram(int board_type)
+{
+	unsigned long expected_size;
+	unsigned long actual_size;
+	void *sdram_base;
+
+	sdram_base = map_physmem(EBI_SDRAM_BASE, EBI_SDRAM_SIZE, MAP_NOCACHE);
+
+	expected_size = sdram_init(sdram_base, &sdram_config);
+	actual_size = get_ram_size(sdram_base, expected_size);
+
+	unmap_physmem(sdram_base, EBI_SDRAM_SIZE);
+
+	if (expected_size != actual_size)
+		printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
+				actual_size >> 20, expected_size >> 20);
+
+	return actual_size;
+}
+
+int board_early_init_r(void)
+{
+	gd->bd->bi_phy_id[0] = 0x01;
+	gd->bd->bi_phy_id[1] = 0x03;
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	/* read 'factory' part of EEPROM */
+	extern void read_factory_r(void);
+	read_factory_r();
+	return 0;
+}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bi)
+{
+	macb_eth_initialize(0,
+		(void *)MACB0_BASE, bi->bi_phy_id[0]);
+	macb_eth_initialize(1,
+		(void *)MACB1_BASE, bi->bi_phy_id[1]);
+	return 0;
+}
+#endif
+
+/* SPI chip select control */
+#ifdef CONFIG_ATMEL_SPI
+#include <spi.h>
+
+#define DATAFLASH_CS_PIN	GPIO_PIN_PA(3)
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+	return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+	gpio_set_value(DATAFLASH_CS_PIN, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	gpio_set_value(DATAFLASH_CS_PIN, 1);
+}
+#endif /* CONFIG_ATMEL_SPI */
+
+/* I2C access functions */
+#ifdef CONFIG_CMD_I2C
+
+int iic_read(void)
+{
+	return pio_get_input_value(GPIO_PIN_PA(SDA_PIN));
+}
+
+void iic_sda(int bit)
+{
+	pio_set_output_value(GPIO_PIN_PA(SDA_PIN),bit);
+}
+
+void iic_scl(int bit)
+{
+	pio_set_output_value(GPIO_PIN_PA(SCL_PIN),bit);
+}
+
+#endif /* CONFIG_CMD_I2C */
diff --git a/board/emk/top7000/u-boot.lds b/board/emk/top7000/u-boot.lds
new file mode 100644
index 0000000..ffa119b
--- /dev/null
+++ b/board/emk/top7000/u-boot.lds
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2010
+ * EMK Elektronik GmbH & Co. KG, reinhard.meyer at emk-elektronik.de
+ *
+ * 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
+ */
+OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
+OUTPUT_ARCH(avr32)
+ENTRY(_start)
+
+SECTIONS
+{
+	. = 0;
+	_text = .;
+	.text : {
+		*(.exception.text)
+		*(.text)
+		*(.text.*)
+	}
+	_etext = .;
+
+	.rodata : {
+		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+	}
+
+	. = ALIGN(8);
+	_data = .;
+	.data : {
+		*(.data)
+		*(.data.*)
+	}
+
+	. = ALIGN(4);
+	__u_boot_cmd_start = .;
+	.u_boot_cmd : {
+		KEEP(*(.u_boot_cmd))
+	}
+	__u_boot_cmd_end = .;
+
+	. = ALIGN(4);
+	_got = .;
+	.got : {
+		*(.got)
+	}
+	_egot = .;
+
+	. = ALIGN(8);
+	_edata = .;
+
+	.bss : {
+		*(.bss)
+		*(.bss.*)
+	}
+	. = ALIGN(8);
+	_end = .;
+}
diff --git a/include/configs/top7000.h b/include/configs/top7000.h
new file mode 100644
index 0000000..c29fa00
--- /dev/null
+++ b/include/configs/top7000.h
@@ -0,0 +1,216 @@
+/*
+ * (C) Copyright 2010
+ * EMK Elektronik GmbH & Co. KG, reinhard.meyer at emk-elektronik.de
+ *
+ * Configuration settings for the TOP7000 CPU Module
+ *
+ * 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
+ */
+
+/*
+ * TOP7000 features/differences to ATNGW100:
+ *
+ * parallel FLASH upto 64MB (typically S29GL128/256/512Pxxxx)
+ * no serial FLASH (SPI not used)
+ * optional micro SD card for root and user file systems
+ * VPD and environment in I2C EEPROM
+ * kernel as image in parallel FLASH
+ *
+ * parallel FLASH partitioning:
+ *  00000000-00020000 128k    U-Boot
+ *  00020000-00200000 2M-128k kernel
+ *  00200000-end      root file system
+ */
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/arch/memory-map.h>
+
+#define CONFIG_AVR32		1
+#define CONFIG_AT32AP		1
+#define CONFIG_AT32AP7000	1
+#define CONFIG_TOP7000		1
+
+#define CONFIG_SYS_HZ		1000
+
+/*
+ * Set up the PLL to run at 140 MHz, the CPU to run at the PLL
+ * frequency, the HSB and PBB busses to run at 1/2 the PLL frequency
+ * and the PBA bus to run at 1/4 the PLL frequency.
+ */
+#define CONFIG_PLL			1
+#define CONFIG_SYS_POWER_MANAGER	1
+#define CONFIG_SYS_OSC0_HZ		20000000
+#define CONFIG_SYS_PLL0_DIV		1
+#define CONFIG_SYS_PLL0_MUL		7
+#define CONFIG_SYS_PLL0_SUPPRESS_CYCLES	16
+#define CONFIG_SYS_CLKDIV_CPU		0
+#define CONFIG_SYS_CLKDIV_HSB		1
+#define CONFIG_SYS_CLKDIV_PBA		2
+#define CONFIG_SYS_CLKDIV_PBB		1
+
+/*
+ * The PLLOPT register controls the PLL like this:
+ *   icp = PLLOPT<2>
+ *   ivco = PLLOPT<1:0>
+ *
+ * We want icp=1 (default) and ivco=0 (80-160 MHz) or ivco=2 (150-240MHz).
+ */
+#define CONFIG_SYS_PLL0_OPT		0x04
+
+#define CONFIG_USART1			1
+
+/* User serviceable stuff */
+#define CONFIG_DOS_PARTITION		1
+
+#define CONFIG_CMDLINE_TAG		1
+#define CONFIG_SETUP_MEMORY_TAGS	1
+#define CONFIG_INITRD_TAG		1
+
+#define CONFIG_STACKSIZE		(2048)
+
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_BOOTARGS	"console=ttyS0 root=/dev/mtdblock2 rootfstype=jffs2"
+#define CONFIG_BOOTCOMMAND		"bootm 0xa0020000"
+
+/*
+ * Only interrupt autoboot if <space> is pressed. Otherwise, garbage
+ * data on the serial line may interrupt the boot sequence.
+ */
+#define CONFIG_BOOTDELAY		1
+#define CONFIG_AUTOBOOT			1
+#define CONFIG_AUTOBOOT_KEYED		1
+#define CONFIG_AUTOBOOT_PROMPT "Press SPACE to abort autoboot in %d seconds\n", bootdelay
+#define CONFIG_AUTOBOOT_DELAY_STR	"d"
+#define CONFIG_AUTOBOOT_STOP_STR	" "
+
+#define CONFIG_NET_MULTI		1
+
+/*
+ * BOOTP/DHCP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+
+#define CONFIG_DOS_PARTITION		1
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_I2C
+
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_SOURCE
+#undef CONFIG_CMD_XIMG
+
+#define CONFIG_ATMEL_USART		1
+#define CONFIG_MACB			1
+#define CONFIG_PORTMUX_PIO		1
+#define CONFIG_SYS_NR_PIOS		5
+#define CONFIG_SYS_HSDRAMC		1
+#define CONFIG_MMC			1
+#define CONFIG_ATMEL_MCI		1
+
+#define CONFIG_SYS_DCACHE_LINESZ	32
+#define CONFIG_SYS_ICACHE_LINESZ	32
+
+#define CONFIG_NR_DRAM_BANKS		1
+
+#define CONFIG_SYS_FLASH_CFI		1
+#define CONFIG_FLASH_CFI_DRIVER		1
+#define CONFIG_SYS_FLASH_EMPTY_INFO	1
+
+/* I2C configuration */
+#define CONFIG_SOFT_I2C			1
+#define CONFIG_SYS_I2C_SPEED		400000
+#define CONFIG_SYS_I2C_SLAVE		0x7F
+#define SDA_PIN				6
+#define SCL_PIN				7
+#define I2C_SOFT_DECLARATIONS		int iic_read(void);\
+					void iic_sda(int);\
+					void iic_scl(int);
+#define I2C_ACTIVE
+#define I2C_TRISTATE
+#define I2C_READ			iic_read()
+#define I2C_SDA(bit)			iic_sda(bit)
+#define I2C_SCL(bit)			iic_scl(bit)
+#define I2C_DELAY			udelay(3)
+
+/* EEPROM configuration */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	70
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
+#define CONFIG_SYS_EEPROM_SIZE		0x2000
+#define CONFIG_SYS_I2C_EEPROM_ADDR	0x57
+#define CONFIG_MISC_INIT_R
+
+/* Environment settings */
+#define CONFIG_ENV_IS_IN_EEPROM	1
+#define CONFIG_ENV_OFFSET		0x1000
+#define CONFIG_ENV_SIZE			0x0700
+#define CONFIG_ENV_OVERWRITE
+
+/* VPD settings */
+#define CONFIG_SYS_I2C_FACT_ADDR	0x57
+#define CONFIG_SYS_FACT_OFFSET		0x1800
+#define CONFIG_SYS_FACT_SIZE		0x0800
+
+/* MAX 64MB S29GL512Pxxx, 512 sectors */
+#define CONFIG_SYS_FLASH_BASE		0x00000000
+#define CONFIG_SYS_FLASH_SIZE		0x4000000
+#define CONFIG_SYS_MAX_FLASH_BANKS	1
+#define CONFIG_SYS_MAX_FLASH_SECT	512
+
+#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
+
+#define CONFIG_SYS_INTRAM_BASE		INTERNAL_SRAM_BASE
+#define CONFIG_SYS_INTRAM_SIZE		INTERNAL_SRAM_SIZE
+#define CONFIG_SYS_SDRAM_BASE		EBI_SDRAM_BASE
+
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INTRAM_BASE + CONFIG_SYS_INTRAM_SIZE)
+
+#define CONFIG_SYS_MALLOC_LEN		(256*1024)
+#define CONFIG_SYS_DMA_ALLOC_LEN	(16384)
+
+/* Allow 4MB for the kernel run-time image */
+#define CONFIG_SYS_LOAD_ADDR		(EBI_SDRAM_BASE + 0x00400000)
+#define CONFIG_SYS_BOOTPARAMS_LEN	(16 * 1024)
+
+/* Other configuration settings that shouldn't have to change all that often */
+#define CONFIG_SYS_PROMPT		"top7000> "
+#define CONFIG_SYS_CBSIZE		256
+#define CONFIG_SYS_MAXARGS		16
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_LONGHELP		1
+
+#define CONFIG_SYS_MEMTEST_START	EBI_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 0x1f00000)
+
+#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 38400, 19200, 9600, 2400 }
+
+#endif /* __CONFIG_H */
-- 
1.5.6.5




More information about the U-Boot mailing list