All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
@ 2010-06-05 10:41 Reinhard Meyer
  2010-06-05 14:41 ` Ben Warren
  0 siblings, 1 reply; 10+ messages in thread
From: Reinhard Meyer @ 2010-06-05 10:41 UTC (permalink / raw)
  To: u-boot

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@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@dave-tech.it>
 
 	PPChameleonEVB	PPC405EP
 
-Reinhard Meyer <r.meyer@emk-elektronik.de>
+Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
 
 	TOP860		MPC860T
 	TOP5200		MPC5200
@@ -919,6 +919,10 @@ Julien May <julien.may@miromico.ch>
 
 	HAMMERHEAD		AT32AP7000
 
+Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
+
+	TOP7000		AT32AP7000
+
 Haavard Skinnemoen <haavard.skinnemoen@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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-05 10:41 [U-Boot] [PATCH] add support for EMK TOP7000 CPU module Reinhard Meyer
@ 2010-06-05 14:41 ` Ben Warren
  2010-06-05 18:16   ` Reinhard Meyer
  0 siblings, 1 reply; 10+ messages in thread
From: Ben Warren @ 2010-06-05 14:41 UTC (permalink / raw)
  To: u-boot

Hello Reinhard,

On Sat, Jun 5, 2010 at 3:41 AM, Reinhard Meyer (-VC) <
reinhard.meyer@emk-elektronik.de> wrote:

> 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@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@dave-tech.it>
>
>        PPChameleonEVB  PPC405EP
>
> -Reinhard Meyer <r.meyer@emk-elektronik.de>
> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>
>        TOP860          MPC860T
>        TOP5200         MPC5200
> @@ -919,6 +919,10 @@ Julien May <julien.may@miromico.ch>
>
>        HAMMERHEAD              AT32AP7000
>
> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
> +
> +       TOP7000         AT32AP7000
> +
>  Haavard Skinnemoen <haavard.skinnemoen@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);
>
These appear to be public MAC addresses.  Are these ones that your company
owns and you're guaranteeing to be unique?
<snip>

> +
> +#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;
>
Please return the number of controllers that were successfully initialized.
<snip>

regards,
Ben

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-05 14:41 ` Ben Warren
@ 2010-06-05 18:16   ` Reinhard Meyer
  2010-06-06 11:26     ` Reinhard Meyer
  0 siblings, 1 reply; 10+ messages in thread
From: Reinhard Meyer @ 2010-06-05 18:16 UTC (permalink / raw)
  To: u-boot

Ben Warren schrieb:
> Hello Reinhard,
> 
> On Sat, Jun 5, 2010 at 3:41 AM, Reinhard Meyer (-VC) <
> reinhard.meyer at emk-elektronik.de> wrote:
> 
>> 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@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@dave-tech.it>
>>
>>        PPChameleonEVB  PPC405EP
>>
>> -Reinhard Meyer <r.meyer@emk-elektronik.de>
>> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>>
>>        TOP860          MPC860T
>>        TOP5200         MPC5200
>> @@ -919,6 +919,10 @@ Julien May <julien.may@miromico.ch>
>>
>>        HAMMERHEAD              AT32AP7000
>>
>> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>> +
>> +       TOP7000         AT32AP7000
>> +
>>  Haavard Skinnemoen <haavard.skinnemoen@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);
>>
> These appear to be public MAC addresses.  Are these ones that your company
> owns and you're guaranteeing to be unique?
> <snip>
>
That is our address range.
 
>> +
>> +#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;
>>
> Please return the number of controllers that were successfully initialized.
> <snip>
1) in net/eth.c:
	/* Try board-specific initialization first.  If it fails or isn't
	 * present, try the cpu-specific initialization */
	if (board_eth_init(bis) < 0)
		cpu_eth_init(bis);
that means >=0 OK, <0 error code....
2) most other ports do something like
int board_eth_init(bd_t *bi)
{
	return macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]);
}
where macb_eth_initialize() returns 0 on success...
3) no port seems to return a positive number >0
IF in the future it is required that the function returns the number of interfaces
EVERY port has to be modified :)
> regards,
> Ben

Best Regards, Reinhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reinhard_meyer.vcf
Type: text/x-vcard
Size: 370 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100605/83621fd1/attachment.vcf 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-05 18:16   ` Reinhard Meyer
@ 2010-06-06 11:26     ` Reinhard Meyer
  2010-06-06 11:42       ` Wolfgang Denk
  0 siblings, 1 reply; 10+ messages in thread
From: Reinhard Meyer @ 2010-06-06 11:26 UTC (permalink / raw)
  To: u-boot

Hello,

is this patch going to be accepted, or is someone insisting that only
my port shall return the number of controllers initialized?

Reinhard Meyer schrieb:
> Ben Warren schrieb:
>> Hello Reinhard,
>>
>> On Sat, Jun 5, 2010 at 3:41 AM, Reinhard Meyer (-VC) <
>> reinhard.meyer at emk-elektronik.de> wrote:
>>
>>> 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@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@dave-tech.it>
>>>
>>>        PPChameleonEVB  PPC405EP
>>>
>>> -Reinhard Meyer <r.meyer@emk-elektronik.de>
>>> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>>>
>>>        TOP860          MPC860T
>>>        TOP5200         MPC5200
>>> @@ -919,6 +919,10 @@ Julien May <julien.may@miromico.ch>
>>>
>>>        HAMMERHEAD              AT32AP7000
>>>
>>> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>>> +
>>> +       TOP7000         AT32AP7000
>>> +
>>>  Haavard Skinnemoen <haavard.skinnemoen@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);
>>>
>> These appear to be public MAC addresses.  Are these ones that your company
>> owns and you're guaranteeing to be unique?
>> <snip>
>>
> That is our address range.
>  
>>> +
>>> +#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;
>>>
>> Please return the number of controllers that were successfully initialized.
>> <snip>
> 1) in net/eth.c:
> 	/* Try board-specific initialization first.  If it fails or isn't
> 	 * present, try the cpu-specific initialization */
> 	if (board_eth_init(bis) < 0)
> 		cpu_eth_init(bis);
> that means >=0 OK, <0 error code....
> 2) most other ports do something like
> int board_eth_init(bd_t *bi)
> {
> 	return macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]);
> }
> where macb_eth_initialize() returns 0 on success...
> 3) no port seems to return a positive number >0
> IF in the future it is required that the function returns the number of interfaces
> EVERY port has to be modified :)
>> regards,
>> Ben
> 
> Best Regards, Reinhard
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-06 11:26     ` Reinhard Meyer
@ 2010-06-06 11:42       ` Wolfgang Denk
  2010-06-06 11:45         ` Reinhard Meyer
  2010-06-06 11:52         ` Reinhard Meyer
  0 siblings, 2 replies; 10+ messages in thread
From: Wolfgang Denk @ 2010-06-06 11:42 UTC (permalink / raw)
  To: u-boot

Dear "Reinhard Meyer (-VC)",

In message <4C0B85D8.4070508@emk-elektronik.de> you wrote:
> 
> is this patch going to be accepted, or is someone insisting that only
> my port shall return the number of controllers initialized?

I don't understand what you mean by "only my port". Ben's comment that
board_eth_init() is supposed to retrurn the number of  successfully
initialized controllers has been standard policy for a pretty long
time, and many boards do so.

Eventually the boards you compared against are older ones, and have
not been maintained well, so they misbehave in this regard?

Best regards,

Wolfgang Denk

-- 
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
Testing can show the presense of bugs, but not their absence.
                                                   -- Edsger Dijkstra

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-06 11:42       ` Wolfgang Denk
@ 2010-06-06 11:45         ` Reinhard Meyer
  2010-06-06 11:52         ` Reinhard Meyer
  1 sibling, 0 replies; 10+ messages in thread
From: Reinhard Meyer @ 2010-06-06 11:45 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk schrieb:
> Dear "Reinhard Meyer (-VC)",
> 
> In message <4C0B85D8.4070508@emk-elektronik.de> you wrote:
>> is this patch going to be accepted, or is someone insisting that only
>> my port shall return the number of controllers initialized?
> 
> I don't understand what you mean by "only my port". Ben's comment that
> board_eth_init() is supposed to retrurn the number of  successfully
> initialized controllers has been standard policy for a pretty long
> time, and many boards do so.
> 
> Eventually the boards you compared against are older ones, and have
> not been maintained well, so they misbehave in this regard?
> 
> Best regards,
> 
> Wolfgang Denk
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-06 11:42       ` Wolfgang Denk
  2010-06-06 11:45         ` Reinhard Meyer
@ 2010-06-06 11:52         ` Reinhard Meyer
  2010-06-06 12:09           ` Reinhard Meyer
                             ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Reinhard Meyer @ 2010-06-06 11:52 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk schrieb:
> Dear "Reinhard Meyer (-VC)",
> 
> In message <4C0B85D8.4070508@emk-elektronik.de> you wrote:
>> is this patch going to be accepted, or is someone insisting that only
>> my port shall return the number of controllers initialized?
> 
> I don't understand what you mean by "only my port". Ben's comment that
> board_eth_init() is supposed to retrurn the number of  successfully
> initialized controllers has been standard policy for a pretty long
> time, and many boards do so.
> 
> Eventually the boards you compared against are older ones, and have
> not been maintained well, so they misbehave in this regard?
> 
> Best regards,
> 
> Wolfgang Denk
> 

Hello Wolfgang,

Is that documented somewhere? I see that the calling function in net.c
does NOT care about any positive interger result. Will it care sometime
in the future? :)

The second problem is that I cannot seem to undo my previous commit in my
tree, so any changes I do to my source would come out as a second patch.
Would that be accepted?

Or do you know what must be done that GIT will issue a new patch with the
current and the new changes in one patch?

I generate the patches by
<after editing>:
git commit -m <message>
git format-patch origin

what to do to return to <after editing>, do new edits and generate a new,
single patch?

Best Regards, Reinhard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-06 11:52         ` Reinhard Meyer
@ 2010-06-06 12:09           ` Reinhard Meyer
  2010-06-06 12:16           ` Wolfgang Denk
  2010-06-06 13:23           ` Ben Warren
  2 siblings, 0 replies; 10+ messages in thread
From: Reinhard Meyer @ 2010-06-06 12:09 UTC (permalink / raw)
  To: u-boot

Reinhard Meyer (-VC) schrieb:
> Wolfgang Denk schrieb:
>> Dear "Reinhard Meyer (-VC)",
>> The second problem is that I cannot seem to undo my previous commit in my
> tree, so any changes I do to my source would come out as a second patch.
> Would that be accepted?
> 
> Or do you know what must be done that GIT will issue a new patch with the
> current and the new changes in one patch?
> 
> I generate the patches by
> <after editing>:
> git commit -m <message>
> git format-patch origin
> 
> what to do to return to <after editing>, do new edits and generate a new,
> single patch?
> 
A "git reset --soft HEAD^" followed by "git add" of all newly
changed files does the trick...
> Best Regards, Reinhard
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-06 11:52         ` Reinhard Meyer
  2010-06-06 12:09           ` Reinhard Meyer
@ 2010-06-06 12:16           ` Wolfgang Denk
  2010-06-06 13:23           ` Ben Warren
  2 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2010-06-06 12:16 UTC (permalink / raw)
  To: u-boot

Dear "Reinhard Meyer (-VC)",

In message <4C0B8BE7.7090108@emk-elektronik.de> you wrote:
>
> Is that documented somewhere? I see that the calling function in net.c

Probably only in the mailing list archives...

> does NOT care about any positive interger result. Will it care sometime
> in the future? :)
> 
> The second problem is that I cannot seem to undo my previous commit in my
> tree, so any changes I do to my source would come out as a second patch.
> Would that be accepted?

No. Why cannot you "git rebase -i" your tree (resp. your development
branch) and squash the commits in question?

> Or do you know what must be done that GIT will issue a new patch with the
> current and the new changes in one patch?

Squash the commits into one?

> what to do to return to <after editing>, do new edits and generate a new,
> single patch?

man git-rebase

Best regards,

Wolfgang Denk

-- 
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
He is truly wise who gains wisdom from another's mishap.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
  2010-06-06 11:52         ` Reinhard Meyer
  2010-06-06 12:09           ` Reinhard Meyer
  2010-06-06 12:16           ` Wolfgang Denk
@ 2010-06-06 13:23           ` Ben Warren
  2 siblings, 0 replies; 10+ messages in thread
From: Ben Warren @ 2010-06-06 13:23 UTC (permalink / raw)
  To: u-boot

Hello Reinhard,

On Sun, Jun 6, 2010 at 4:52 AM, Reinhard Meyer (-VC) <
reinhard.meyer@emk-elektronik.de> wrote:

> Wolfgang Denk schrieb:
> > Dear "Reinhard Meyer (-VC)",
> >
> > In message <4C0B85D8.4070508@emk-elektronik.de> you wrote:
> >> is this patch going to be accepted, or is someone insisting that only
> >> my port shall return the number of controllers initialized?
> >
> > I don't understand what you mean by "only my port". Ben's comment that
> > board_eth_init() is supposed to retrurn the number of  successfully
> > initialized controllers has been standard policy for a pretty long
> > time, and many boards do so.
> >
> > Eventually the boards you compared against are older ones, and have
> > not been maintained well, so they misbehave in this regard?
> >
> > Best regards,
> >
> > Wolfgang Denk
> >
>
> Hello Wolfgang,
>
> Is that documented somewhere? I see that the calling function in net.c
> does NOT care about any positive interger result. Will it care sometime
> in the future? :)
>
> Yes, it's documented (doc/README.drivers.eth).  Maybe it will get used in
the future.  That's why I politely asked to to make a simple change. It
wasn't an arbitrary request, and most boards (maybe not most MACB-using
ones) do it properly.

regards,
Ben

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-06-06 13:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-05 10:41 [U-Boot] [PATCH] add support for EMK TOP7000 CPU module Reinhard Meyer
2010-06-05 14:41 ` Ben Warren
2010-06-05 18:16   ` Reinhard Meyer
2010-06-06 11:26     ` Reinhard Meyer
2010-06-06 11:42       ` Wolfgang Denk
2010-06-06 11:45         ` Reinhard Meyer
2010-06-06 11:52         ` Reinhard Meyer
2010-06-06 12:09           ` Reinhard Meyer
2010-06-06 12:16           ` Wolfgang Denk
2010-06-06 13:23           ` Ben Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.