* [U-Boot] [PATCH 0/3] netspace_v2: fixes and features
@ 2011-10-31 13:58 Simon Guinot
2011-10-31 13:58 ` [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration Simon Guinot
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Simon Guinot @ 2011-10-31 13:58 UTC (permalink / raw)
To: u-boot
From: Simon Guinot <simon.guinot@sequanux.org>
This patch series provides some bug fixes and features for the
Network Space v2 machine (and parents).
Simon Guinot (3):
netspace_v2: fix SDRAM configuration
netspace_v2: enable I2C EEPROM support
netspace_v2: Read Ethernet MAC address from EEPROM
board/LaCie/netspace_v2/kwbimage-is2.cfg | 162 +++++++++++++++++++++++++
board/LaCie/netspace_v2/kwbimage.cfg | 4 +-
board/LaCie/netspace_v2/netspace_v2.c | 43 +++++++
include/configs/netspace_v2.h | 19 +++-
4 files changed, 225 insertions(+), 3 deletions(-)
delete mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s
create mode 100644 board/LaCie/netspace_v2/kwbimage-is2.cfg
--
1.7.5.1
^ permalink raw reply [flat|nested] 12+ messages in thread* [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration 2011-10-31 13:58 [U-Boot] [PATCH 0/3] netspace_v2: fixes and features Simon Guinot @ 2011-10-31 13:58 ` Simon Guinot 2011-11-01 7:36 ` Prafulla Wadaskar 2011-10-31 13:58 ` [U-Boot] [PATCH 2/3] netspace_v2: enable I2C EEPROM support Simon Guinot 2011-10-31 13:58 ` [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM Simon Guinot 2 siblings, 1 reply; 12+ messages in thread From: Simon Guinot @ 2011-10-31 13:58 UTC (permalink / raw) To: u-boot From: Simon Guinot <simon.guinot@sequanux.org> Network Space (Max) v2 and Internet Space v2 boards have different SDRAM configuration and size: respectively 256MB (DDR2??1Gb, 128Mbx8 organisation) and 128MB (DDR2??512Mb, 64Mbx8 organisation). To handle the differences, this patch add a dedicated kwimage.cfg file for Internet Space v2. Additionnaly the number of SDRAM banks is fixed. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> --- board/LaCie/netspace_v2/kwbimage-is2.cfg | 162 ++++++++++++++++++++++++++++++ board/LaCie/netspace_v2/kwbimage.cfg | 4 +- include/configs/netspace_v2.h | 7 +- 3 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 board/LaCie/netspace_v2/kwbimage-is2.cfg diff --git a/board/LaCie/netspace_v2/kwbimage-is2.cfg b/board/LaCie/netspace_v2/kwbimage-is2.cfg new file mode 100644 index 0000000..590720a --- /dev/null +++ b/board/LaCie/netspace_v2/kwbimage-is2.cfg @@ -0,0 +1,162 @@ +# +# Copyright (C) 2011 Simon Guinot <sguinot@lacie.com> +# +# Based on Kirkwood support: +# (C) Copyright 2009 +# Marvell Semiconductor <www.marvell.com> +# Written-by: Prafulla Wadaskar <prafulla@marvell.com> +# +# 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. +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi # Boot from SPI flash + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1B1B1B9B + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000618 # DDR Configuration register +# bit13-0: 0xa00 (2560 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x35143000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 8= CL+3, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x11012228 # DDR Timing (Low) (active cycles value +1) +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000A19 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x00000008 # DDR Address Control +# bit1-0: 00, Cs0width=x8 +# bit3-2: 10, Cs0size=512Mb +# bit5-4: 00, Cs2width=nonexistent +# bit7-6: 00, Cs1size =nonexistent +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000632 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000004 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 1, DDR drive strenght reduced +# bit2: 1, DDR ODT control lsd enabled +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, enabled +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F07F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 1 , D2P Latency enabled +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x07, Size (i.e. 128MB) + +DATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00010000 # DDR ODT Control (Low) +# bit3-0: 1, ODT0Rd, MODT[0] asserted during read from DRAM CS0 +# bit19-16:1, ODT0Wr, MODT[0] asserted during write to DRAM CS0 + +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required + +DATA 0xFFD0149C 0x0000E40F # CPU ODT Control +# bit3-0: 1, ODT0Rd, Internal ODT asserted during read from DRAM bank0 +# bit7-4: 1, ODT0Wr, Internal ODT asserted during write to DRAM bank0 +# bit11-10:1, DQ_ODTSel. ODT select turned on + +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/board/LaCie/netspace_v2/kwbimage.cfg b/board/LaCie/netspace_v2/kwbimage.cfg index 361feeb..7e53649 100644 --- a/board/LaCie/netspace_v2/kwbimage.cfg +++ b/board/LaCie/netspace_v2/kwbimage.cfg @@ -69,8 +69,8 @@ DATA 0xFFD0140C 0x00000A19 # DDR Timing (High) # bit12-11: TW2W # bit31-13: zero required -DATA 0xFFD01410 0x0000CCCC # DDR Address Control -# bit1-0: 01, Cs0width=x16 +DATA 0xFFD01410 0x0000000C # DDR Address Control +# bit1-0: 00, Cs0width=x8 # bit3-2: 11, Cs0size=1Gb # bit5-4: 00, Cs2width=nonexistent # bit7-6: 00, Cs1size =nonexistent diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h index 82a1233..5790602 100644 --- a/include/configs/netspace_v2.h +++ b/include/configs/netspace_v2.h @@ -60,11 +60,16 @@ */ #define CONFIG_SYS_TCLK 166000000 /* 166MHz */ +#define CONFIG_NR_DRAM_BANKS 1 +#ifdef CONFIG_INETSPACE_V2 +/* Different SDRAM configuration and size for Internet Space v2 */ +#define CONFIG_SYS_KWD_CONFIG ($(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-is2.cfg) +#endif + /* * mv-common.h should be defined after CMD configs since it used them * to enable certain macros */ -#define CONFIG_NR_DRAM_BANKS 2 #include "mv-common.h" /* Remove or override few declarations from mv-common.h */ -- 1.7.5.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration 2011-10-31 13:58 ` [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration Simon Guinot @ 2011-11-01 7:36 ` Prafulla Wadaskar 0 siblings, 0 replies; 12+ messages in thread From: Prafulla Wadaskar @ 2011-11-01 7:36 UTC (permalink / raw) To: u-boot > -----Original Message----- > From: Simon Guinot [mailto:simon at sequanux.org] > Sent: Monday, October 31, 2011 7:29 PM > To: Prafulla Wadaskar > Cc: u-boot at lists.denx.de; Simon Guinot > Subject: [PATCH 1/3] netspace_v2: fix SDRAM configuration > > From: Simon Guinot <simon.guinot@sequanux.org> > > Network Space (Max) v2 and Internet Space v2 boards have > different > SDRAM configuration and size: respectively 256MB (DDR2??1Gb, > 128Mbx8 > organisation) and 128MB (DDR2??512Mb, 64Mbx8 organisation). To > handle > the differences, this patch add a dedicated kwimage.cfg file > for > Internet Space v2. > > Additionnaly the number of SDRAM banks is fixed. > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > --- > board/LaCie/netspace_v2/kwbimage-is2.cfg | 162 > ++++++++++++++++++++++++++++++ > board/LaCie/netspace_v2/kwbimage.cfg | 4 +- > include/configs/netspace_v2.h | 7 +- > 3 files changed, 170 insertions(+), 3 deletions(-) > create mode 100644 board/LaCie/netspace_v2/kwbimage-is2.cfg > Applied to u-boot-marvell.git master branch Regards.. Prafulla . . . ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] netspace_v2: enable I2C EEPROM support 2011-10-31 13:58 [U-Boot] [PATCH 0/3] netspace_v2: fixes and features Simon Guinot 2011-10-31 13:58 ` [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration Simon Guinot @ 2011-10-31 13:58 ` Simon Guinot 2011-11-01 7:36 ` Prafulla Wadaskar 2011-10-31 13:58 ` [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM Simon Guinot 2 siblings, 1 reply; 12+ messages in thread From: Simon Guinot @ 2011-10-31 13:58 UTC (permalink / raw) To: u-boot From: Simon Guinot <simon.guinot@sequanux.org> An I2C EEPROM HT24LC04 (512B) is available on the netspace_v2 board (and parents). This EEPROM hold data such as Ethernet MAC addresses and power flags. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> --- include/configs/netspace_v2.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h index 5790602..bb27ed7 100644 --- a/include/configs/netspace_v2.h +++ b/include/configs/netspace_v2.h @@ -108,6 +108,17 @@ #define CONFIG_KIRKWOOD_GPIO /* + * Enable I2C support + */ +#ifdef CONFIG_CMD_I2C +/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */ +#define CONFIG_CMD_EEPROM +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 +#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */ +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */ +#endif /* CONFIG_CMD_I2C */ + +/* * File systems support */ #define CONFIG_CMD_EXT2 -- 1.7.5.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] netspace_v2: enable I2C EEPROM support 2011-10-31 13:58 ` [U-Boot] [PATCH 2/3] netspace_v2: enable I2C EEPROM support Simon Guinot @ 2011-11-01 7:36 ` Prafulla Wadaskar 0 siblings, 0 replies; 12+ messages in thread From: Prafulla Wadaskar @ 2011-11-01 7:36 UTC (permalink / raw) To: u-boot > -----Original Message----- > From: Simon Guinot [mailto:simon at sequanux.org] > Sent: Monday, October 31, 2011 7:29 PM > To: Prafulla Wadaskar > Cc: u-boot at lists.denx.de; Simon Guinot > Subject: [PATCH 2/3] netspace_v2: enable I2C EEPROM support > > From: Simon Guinot <simon.guinot@sequanux.org> > > An I2C EEPROM HT24LC04 (512B) is available on the netspace_v2 > board > (and parents). This EEPROM hold data such as Ethernet MAC > addresses > and power flags. > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > --- > include/configs/netspace_v2.h | 11 +++++++++++ > 1 files changed, 11 insertions(+), 0 deletions(-) > > diff --git a/include/configs/netspace_v2.h > b/include/configs/netspace_v2.h > index 5790602..bb27ed7 100644 > --- a/include/configs/netspace_v2.h > +++ b/include/configs/netspace_v2.h > @@ -108,6 +108,17 @@ > #define CONFIG_KIRKWOOD_GPIO > > /* > + * Enable I2C support > + */ > +#ifdef CONFIG_CMD_I2C > +/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */ > +#define CONFIG_CMD_EEPROM > +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 > +#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page > size */ > +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device > address */ > +#endif /* CONFIG_CMD_I2C */ > + > +/* > * File systems support > */ > #define CONFIG_CMD_EXT2 > -- Applied to u-boot-marvell.git master branch Regards.. Prafulla . . . ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM 2011-10-31 13:58 [U-Boot] [PATCH 0/3] netspace_v2: fixes and features Simon Guinot 2011-10-31 13:58 ` [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration Simon Guinot 2011-10-31 13:58 ` [U-Boot] [PATCH 2/3] netspace_v2: enable I2C EEPROM support Simon Guinot @ 2011-10-31 13:58 ` Simon Guinot 2011-11-05 12:29 ` Simon Guinot 2 siblings, 1 reply; 12+ messages in thread From: Simon Guinot @ 2011-10-31 13:58 UTC (permalink / raw) To: u-boot From: Simon Guinot <simon.guinot@sequanux.org> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> --- board/LaCie/netspace_v2/netspace_v2.c | 43 +++++++++++++++++++++++++ include/configs/netspace_v2.h | 1 + 2 files changed, 44 insertions(+), 0 deletions(-) delete mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s diff --git a/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s b/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s deleted file mode 100644 index e69de29..0000000 diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index 7c4b15e..a7717b9 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -24,6 +24,7 @@ #include <miiphy.h> #include <netdev.h> #include <command.h> +#include <i2c.h> #include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> @@ -89,6 +90,48 @@ int board_init(void) return 0; } +int misc_init_r(void) +{ +#ifdef CONFIG_CMD_I2C + if (!getenv("ethaddr")) { + ushort version; + uchar mac[6]; + int ret; + + /* I2C-0 for on-board EEPROM */ + i2c_set_bus_num(0); + + /* Check layout version for EEPROM data */ + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, + (uchar *) &version, 2); + if (ret != 0) { + printf("Error: failed to read I2C EEPROM @%02x\n", + CONFIG_SYS_I2C_EEPROM_ADDR); + return ret; + } + version = be16_to_cpu(version); + if (version < 1 || version > 3) { + printf("Error: unknown version %d for EEPROM data\n", + version); + return -1; + } + + /* Read Ethernet MAC address from EEPROM */ + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 2, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, mac, 6); + if (ret != 0) { + printf("Error: failed to read I2C EEPROM @%02x\n", + CONFIG_SYS_I2C_EEPROM_ADDR); + return ret; + } + eth_setenv_enetaddr("ethaddr", mac); + } +#endif /* CONFIG_CMD_I2C */ + + return 0; +} + void mv_phy_88e1116_init(char *name) { u16 reg; diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h index bb27ed7..1ddf4b4 100644 --- a/include/configs/netspace_v2.h +++ b/include/configs/netspace_v2.h @@ -87,6 +87,7 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */ #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ #define CONFIG_NETCONSOLE #endif -- 1.7.5.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM 2011-10-31 13:58 ` [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM Simon Guinot @ 2011-11-05 12:29 ` Simon Guinot 2011-11-08 8:28 ` Prafulla Wadaskar 0 siblings, 1 reply; 12+ messages in thread From: Simon Guinot @ 2011-11-05 12:29 UTC (permalink / raw) To: u-boot Hi Prafulla, On Mon, Oct 31, 2011 at 02:58:36PM +0100, Simon Guinot wrote: > From: Simon Guinot <simon.guinot@sequanux.org> > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > --- > board/LaCie/netspace_v2/netspace_v2.c | 43 +++++++++++++++++++++++++ > include/configs/netspace_v2.h | 1 + > 2 files changed, 44 insertions(+), 0 deletions(-) > delete mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s Do you want me to repost this patch with some modifications ? Regards, Simon > > diff --git a/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s b/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s > deleted file mode 100644 > index e69de29..0000000 > diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c > index 7c4b15e..a7717b9 100644 > --- a/board/LaCie/netspace_v2/netspace_v2.c > +++ b/board/LaCie/netspace_v2/netspace_v2.c > @@ -24,6 +24,7 @@ > #include <miiphy.h> > #include <netdev.h> > #include <command.h> > +#include <i2c.h> > #include <asm/arch/cpu.h> > #include <asm/arch/kirkwood.h> > #include <asm/arch/mpp.h> > @@ -89,6 +90,48 @@ int board_init(void) > return 0; > } > > +int misc_init_r(void) > +{ > +#ifdef CONFIG_CMD_I2C > + if (!getenv("ethaddr")) { > + ushort version; > + uchar mac[6]; > + int ret; > + > + /* I2C-0 for on-board EEPROM */ > + i2c_set_bus_num(0); > + > + /* Check layout version for EEPROM data */ > + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, > + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, > + (uchar *) &version, 2); > + if (ret != 0) { > + printf("Error: failed to read I2C EEPROM @%02x\n", > + CONFIG_SYS_I2C_EEPROM_ADDR); > + return ret; > + } > + version = be16_to_cpu(version); > + if (version < 1 || version > 3) { > + printf("Error: unknown version %d for EEPROM data\n", > + version); > + return -1; > + } > + > + /* Read Ethernet MAC address from EEPROM */ > + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 2, > + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, mac, 6); > + if (ret != 0) { > + printf("Error: failed to read I2C EEPROM @%02x\n", > + CONFIG_SYS_I2C_EEPROM_ADDR); > + return ret; > + } > + eth_setenv_enetaddr("ethaddr", mac); > + } > +#endif /* CONFIG_CMD_I2C */ > + > + return 0; > +} > + > void mv_phy_88e1116_init(char *name) > { > u16 reg; > diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h > index bb27ed7..1ddf4b4 100644 > --- a/include/configs/netspace_v2.h > +++ b/include/configs/netspace_v2.h > @@ -87,6 +87,7 @@ > * Ethernet Driver configuration > */ > #ifdef CONFIG_CMD_NET > +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */ > #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ > #define CONFIG_NETCONSOLE > #endif > -- > 1.7.5.1 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://lists.denx.de/pipermail/u-boot/attachments/20111105/6c244b2b/attachment.pgp ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM 2011-11-05 12:29 ` Simon Guinot @ 2011-11-08 8:28 ` Prafulla Wadaskar 2011-11-08 21:31 ` [U-Boot] [PATCH v2] " Simon Guinot 0 siblings, 1 reply; 12+ messages in thread From: Prafulla Wadaskar @ 2011-11-08 8:28 UTC (permalink / raw) To: u-boot > -----Original Message----- > From: Simon Guinot [mailto:simon at sequanux.org] > Sent: Saturday, November 05, 2011 6:00 PM > To: Prafulla Wadaskar > Cc: u-boot at lists.denx.de; Simon Guinot > Subject: Re: [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet > MAC address from EEPROM > > Hi Prafulla, > > On Mon, Oct 31, 2011 at 02:58:36PM +0100, Simon Guinot wrote: > > From: Simon Guinot <simon.guinot@sequanux.org> > > > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > > --- > > board/LaCie/netspace_v2/netspace_v2.c | 43 > +++++++++++++++++++++++++ > > include/configs/netspace_v2.h | 1 + > > 2 files changed, 44 insertions(+), 0 deletions(-) > > delete mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm- > offsets.s > > Do you want me to repost this patch with some modifications ? Since asm-offsets.s is already removed Please resend the patch with re-syncing with u-boot-marvell.git Regards.. Prafulla . . . ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v2] netspace_v2: Read Ethernet MAC address from EEPROM 2011-11-08 8:28 ` Prafulla Wadaskar @ 2011-11-08 21:31 ` Simon Guinot 2011-11-16 10:32 ` Simon Guinot 0 siblings, 1 reply; 12+ messages in thread From: Simon Guinot @ 2011-11-08 21:31 UTC (permalink / raw) To: u-boot From: Simon Guinot <simon.guinot@sequanux.org> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> --- Changes in v2: - fix asm-offsets.s removal - make MAC address setup conditional to CONFIG_SYS_I2C_EEPROM_ADDR board/LaCie/netspace_v2/netspace_v2.c | 43 +++++++++++++++++++++++++++++++++ include/configs/netspace_v2.h | 1 + 2 files changed, 44 insertions(+), 0 deletions(-) diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index 7c4b15e..6938a43 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -24,6 +24,7 @@ #include <miiphy.h> #include <netdev.h> #include <command.h> +#include <i2c.h> #include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> @@ -89,6 +90,48 @@ int board_init(void) return 0; } +int misc_init_r(void) +{ +#if defined(CONFIG_CMD_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) + if (!getenv("ethaddr")) { + ushort version; + uchar mac[6]; + int ret; + + /* I2C-0 for on-board EEPROM */ + i2c_set_bus_num(0); + + /* Check layout version for EEPROM data */ + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, + (uchar *) &version, 2); + if (ret != 0) { + printf("Error: failed to read I2C EEPROM @%02x\n", + CONFIG_SYS_I2C_EEPROM_ADDR); + return ret; + } + version = be16_to_cpu(version); + if (version < 1 || version > 3) { + printf("Error: unknown version %d for EEPROM data\n", + version); + return -1; + } + + /* Read Ethernet MAC address from EEPROM */ + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 2, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, mac, 6); + if (ret != 0) { + printf("Error: failed to read I2C EEPROM @%02x\n", + CONFIG_SYS_I2C_EEPROM_ADDR); + return ret; + } + eth_setenv_enetaddr("ethaddr", mac); + } +#endif /* CONFIG_CMD_I2C && CONFIG_SYS_I2C_EEPROM_ADDR */ + + return 0; +} + void mv_phy_88e1116_init(char *name) { u16 reg; diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h index bb27ed7..1ddf4b4 100644 --- a/include/configs/netspace_v2.h +++ b/include/configs/netspace_v2.h @@ -87,6 +87,7 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */ #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ #define CONFIG_NETCONSOLE #endif -- 1.7.5.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v2] netspace_v2: Read Ethernet MAC address from EEPROM 2011-11-08 21:31 ` [U-Boot] [PATCH v2] " Simon Guinot @ 2011-11-16 10:32 ` Simon Guinot 2011-11-16 12:25 ` Prafulla Wadaskar 2011-11-21 10:34 ` Prafulla Wadaskar 0 siblings, 2 replies; 12+ messages in thread From: Simon Guinot @ 2011-11-16 10:32 UTC (permalink / raw) To: u-boot Hi Prafulla, On Tue, Nov 08, 2011 at 10:31:14PM +0100, Simon Guinot wrote: > From: Simon Guinot <simon.guinot@sequanux.org> > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > --- > > Changes in v2: > - fix asm-offsets.s removal > - make MAC address setup conditional to CONFIG_SYS_I2C_EEPROM_ADDR > > board/LaCie/netspace_v2/netspace_v2.c | 43 +++++++++++++++++++++++++++++++++ > include/configs/netspace_v2.h | 1 + > 2 files changed, 44 insertions(+), 0 deletions(-) Do you want me for some other modifications on this patch ? Regards, Simon > > diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c > index 7c4b15e..6938a43 100644 > --- a/board/LaCie/netspace_v2/netspace_v2.c > +++ b/board/LaCie/netspace_v2/netspace_v2.c > @@ -24,6 +24,7 @@ > #include <miiphy.h> > #include <netdev.h> > #include <command.h> > +#include <i2c.h> > #include <asm/arch/cpu.h> > #include <asm/arch/kirkwood.h> > #include <asm/arch/mpp.h> > @@ -89,6 +90,48 @@ int board_init(void) > return 0; > } > > +int misc_init_r(void) > +{ > +#if defined(CONFIG_CMD_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) > + if (!getenv("ethaddr")) { > + ushort version; > + uchar mac[6]; > + int ret; > + > + /* I2C-0 for on-board EEPROM */ > + i2c_set_bus_num(0); > + > + /* Check layout version for EEPROM data */ > + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, > + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, > + (uchar *) &version, 2); > + if (ret != 0) { > + printf("Error: failed to read I2C EEPROM @%02x\n", > + CONFIG_SYS_I2C_EEPROM_ADDR); > + return ret; > + } > + version = be16_to_cpu(version); > + if (version < 1 || version > 3) { > + printf("Error: unknown version %d for EEPROM data\n", > + version); > + return -1; > + } > + > + /* Read Ethernet MAC address from EEPROM */ > + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 2, > + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, mac, 6); > + if (ret != 0) { > + printf("Error: failed to read I2C EEPROM @%02x\n", > + CONFIG_SYS_I2C_EEPROM_ADDR); > + return ret; > + } > + eth_setenv_enetaddr("ethaddr", mac); > + } > +#endif /* CONFIG_CMD_I2C && CONFIG_SYS_I2C_EEPROM_ADDR */ > + > + return 0; > +} > + > void mv_phy_88e1116_init(char *name) > { > u16 reg; > diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h > index bb27ed7..1ddf4b4 100644 > --- a/include/configs/netspace_v2.h > +++ b/include/configs/netspace_v2.h > @@ -87,6 +87,7 @@ > * Ethernet Driver configuration > */ > #ifdef CONFIG_CMD_NET > +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */ > #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ > #define CONFIG_NETCONSOLE > #endif > -- > 1.7.5.1 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://lists.denx.de/pipermail/u-boot/attachments/20111116/1b06a305/attachment.pgp ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v2] netspace_v2: Read Ethernet MAC address from EEPROM 2011-11-16 10:32 ` Simon Guinot @ 2011-11-16 12:25 ` Prafulla Wadaskar 2011-11-21 10:34 ` Prafulla Wadaskar 1 sibling, 0 replies; 12+ messages in thread From: Prafulla Wadaskar @ 2011-11-16 12:25 UTC (permalink / raw) To: u-boot > -----Original Message----- > From: Simon Guinot [mailto:simon at sequanux.org] > Sent: Wednesday, November 16, 2011 4:02 PM > To: Prafulla Wadaskar > Cc: u-boot at lists.denx.de > Subject: Re: [U-Boot] [PATCH v2] netspace_v2: Read Ethernet MAC > address from EEPROM > > Hi Prafulla, > > On Tue, Nov 08, 2011 at 10:31:14PM +0100, Simon Guinot wrote: > > From: Simon Guinot <simon.guinot@sequanux.org> > > > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > > --- > > > > Changes in v2: > > - fix asm-offsets.s removal > > - make MAC address setup conditional to > CONFIG_SYS_I2C_EEPROM_ADDR > > > > board/LaCie/netspace_v2/netspace_v2.c | 43 > +++++++++++++++++++++++++++++++++ > > include/configs/netspace_v2.h | 1 + > > 2 files changed, 44 insertions(+), 0 deletions(-) > > Do you want me for some other modifications on this patch ? No I will pull it. Regards.. Prafulla . . ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v2] netspace_v2: Read Ethernet MAC address from EEPROM 2011-11-16 10:32 ` Simon Guinot 2011-11-16 12:25 ` Prafulla Wadaskar @ 2011-11-21 10:34 ` Prafulla Wadaskar 1 sibling, 0 replies; 12+ messages in thread From: Prafulla Wadaskar @ 2011-11-21 10:34 UTC (permalink / raw) To: u-boot > -----Original Message----- > From: Simon Guinot [mailto:simon at sequanux.org] > Sent: Wednesday, November 16, 2011 4:02 PM > To: Prafulla Wadaskar > Cc: u-boot at lists.denx.de > Subject: Re: [U-Boot] [PATCH v2] netspace_v2: Read Ethernet MAC > address from EEPROM > > Hi Prafulla, > > On Tue, Nov 08, 2011 at 10:31:14PM +0100, Simon Guinot wrote: > > From: Simon Guinot <simon.guinot@sequanux.org> > > > > Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> > > --- > > > > Changes in v2: > > - fix asm-offsets.s removal > > - make MAC address setup conditional to > CONFIG_SYS_I2C_EEPROM_ADDR > > > > board/LaCie/netspace_v2/netspace_v2.c | 43 > +++++++++++++++++++++++++++++++++ > > include/configs/netspace_v2.h | 1 + > > 2 files changed, 44 insertions(+), 0 deletions(-) > > Do you want me for some other modifications on this patch ? > > Regards, > > Simon > > > > > diff --git a/board/LaCie/netspace_v2/netspace_v2.c > b/board/LaCie/netspace_v2/netspace_v2.c > > index 7c4b15e..6938a43 100644 > > --- a/board/LaCie/netspace_v2/netspace_v2.c > > +++ b/board/LaCie/netspace_v2/netspace_v2.c > > @@ -24,6 +24,7 @@ > > #include <miiphy.h> > > #include <netdev.h> > > #include <command.h> > > +#include <i2c.h> > > #include <asm/arch/cpu.h> > > #include <asm/arch/kirkwood.h> > > #include <asm/arch/mpp.h> > > @@ -89,6 +90,48 @@ int board_init(void) > > return 0; > > } > > > > +int misc_init_r(void) > > +{ > > +#if defined(CONFIG_CMD_I2C) && > defined(CONFIG_SYS_I2C_EEPROM_ADDR) > > + if (!getenv("ethaddr")) { > > + ushort version; > > + uchar mac[6]; > > + int ret; > > + > > + /* I2C-0 for on-board EEPROM */ > > + i2c_set_bus_num(0); > > + > > + /* Check layout version for EEPROM data */ > > + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, > > + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, > > + (uchar *) &version, 2); > > + if (ret != 0) { > > + printf("Error: failed to read I2C EEPROM @%02x\n", > > + CONFIG_SYS_I2C_EEPROM_ADDR); > > + return ret; > > + } > > + version = be16_to_cpu(version); > > + if (version < 1 || version > 3) { > > + printf("Error: unknown version %d for EEPROM > data\n", > > + version); > > + return -1; > > + } > > + > > + /* Read Ethernet MAC address from EEPROM */ > > + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 2, > > + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, mac, 6); > > + if (ret != 0) { > > + printf("Error: failed to read I2C EEPROM @%02x\n", > > + CONFIG_SYS_I2C_EEPROM_ADDR); > > + return ret; > > + } > > + eth_setenv_enetaddr("ethaddr", mac); > > + } > > +#endif /* CONFIG_CMD_I2C && CONFIG_SYS_I2C_EEPROM_ADDR */ > > + > > + return 0; > > +} > > + > > void mv_phy_88e1116_init(char *name) > > { > > u16 reg; > > diff --git a/include/configs/netspace_v2.h > b/include/configs/netspace_v2.h > > index bb27ed7..1ddf4b4 100644 > > --- a/include/configs/netspace_v2.h > > +++ b/include/configs/netspace_v2.h > > @@ -87,6 +87,7 @@ > > * Ethernet Driver configuration > > */ > > #ifdef CONFIG_CMD_NET > > +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to > initialize MAC address */ > > #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only > */ > > #define CONFIG_NETCONSOLE > > #endif > > -- > > 1.7.5.1 > > Applied to u-boot-marvell.git master branch Regards.. Prafulla . . . ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-11-21 10:34 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-31 13:58 [U-Boot] [PATCH 0/3] netspace_v2: fixes and features Simon Guinot 2011-10-31 13:58 ` [U-Boot] [PATCH 1/3] netspace_v2: fix SDRAM configuration Simon Guinot 2011-11-01 7:36 ` Prafulla Wadaskar 2011-10-31 13:58 ` [U-Boot] [PATCH 2/3] netspace_v2: enable I2C EEPROM support Simon Guinot 2011-11-01 7:36 ` Prafulla Wadaskar 2011-10-31 13:58 ` [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM Simon Guinot 2011-11-05 12:29 ` Simon Guinot 2011-11-08 8:28 ` Prafulla Wadaskar 2011-11-08 21:31 ` [U-Boot] [PATCH v2] " Simon Guinot 2011-11-16 10:32 ` Simon Guinot 2011-11-16 12:25 ` Prafulla Wadaskar 2011-11-21 10:34 ` Prafulla Wadaskar
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.