netspace_v2: fixes and features
cover netspace_v2: fixes and features
From: Simon Guinot <[email protected]>
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
Signature · 1 line
1.7.5.1
PATCH 1/3 netspace_v2: fix SDRAM configuration
From: Simon Guinot <[email protected]>
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.
--- 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
board/LaCie/netspace_v2/kwbimage-is2.cfg new file +162 -0
@@ -0,0 +1,162 @@ +# +# Copyright (C) 2011 Simon Guinot <[email protected]> +# +# Based on Kirkwood support: +# (C) Copyright 2009 +# Marvell Semiconductor <www.marvell.com> +# Written-by: Prafulla Wadaskar <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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
board/LaCie/netspace_v2/kwbimage.cfg +2 -2
@@ -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
include/configs/netspace_v2.h +6 -1
@@ -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 */
Signature · 1 line
1.7.5.1
PATCH 1/3 netspace_v2: fix SDRAM configuration
Quoted 23 lines
-----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 configurationFrom: Simon Guinot <[email protected]>
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.
Quoted 9 lines
Signed-off-by Simon Guinot <[email protected]>--- 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 . . .
PATCH 2/3 netspace_v2: enable I2C EEPROM support
In reply to Simon GuinotFrom: Simon Guinot <[email protected]>
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.
--- include/configs/netspace_v2.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
include/configs/netspace_v2.h +11 -0
@@ -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
Signature · 1 line
1.7.5.1
PATCH 2/3 netspace_v2: enable I2C EEPROM support
Quoted 41 lines
-----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 supportFrom: Simon Guinot <[email protected]>
An I2C EEPROM HT24LC04 (512B) is available on the
netspace_v2board
(and parents). This EEPROM hold data such as Ethernet MAC addresses
and power flags.Signed-off-by Simon Guinot <[email protected]>--- include/configs/netspace_v2.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)include/configs/netspace_v2.h +7
-0@@ -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 */
+#defineCONFIG_SYS_I2C_EEPROM_ADDR_LEN1 /* 8-bit device
address */
include/configs/netspace_v2.h
Quoted 7 lines
include/configs/netspace_v2.h +3
-1+#endif /* CONFIG_CMD_I2C */ + +/* * File systems support */ #define CONFIG_CMD_EXT2 --
Applied to u-boot-marvell.git master branch
Regards..
Prafulla . . .
PATCH 3/3 netspace_v2: Read Ethernet MAC address from EEPROM
In reply to Simon GuinotFrom: Simon Guinot <[email protected]>
--- 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
arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s deleted +0 -0
board/LaCie/netspace_v2/netspace_v2.c +43 -0
55 lines not on this page · raw message
include/configs/netspace_v2.h +1 -0
@@ -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
Signature · 1 line
1.7.5.1
PATCH 3/3 netspace_v2: Read Ethernet MAC address from EEPROM
Hi Prafulla,
Quoted 8 lines · Simon Guinot
From: Simon Guinot <[email protected]>
Signed-off-by Simon Guinot <[email protected]>--- 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
Quoted 84 lines
arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s deleted +0
-0board/LaCie/netspace_v2/netspace_v2.c +43
-0@@ -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;include/configs/netspace_v2.h +1
-0@@ -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 Signature · 6 lines
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
PATCH 3/3 netspace_v2: Read Ethernet MAC address from EEPROM
Quoted 18 lines
-----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 EEPROMHi Prafulla,
Quoted 5 lines · Simon Guinot
From: Simon Guinot <[email protected]>
Signed-off-by Simon Guinot <[email protected]>--- board/LaCie/netspace_v2/netspace_v2.c | 43
Quoted 7 lines
+++++++++++++++++++++++++
Quoted 3 lines
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 . . .
PATCH v2 1/1 netspace_v2: Read Ethernet MAC address from EEPROM
From: Simon Guinot <[email protected]>
---
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(-)
board/LaCie/netspace_v2/netspace_v2.c +43 -0
@@ -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;
include/configs/netspace_v2.h +1 -0
@@ -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
Signature · 1 line
1.7.5.1
PATCH v2 1/1 netspace_v2: Read Ethernet MAC address from EEPROM
Hi Prafulla,
Quoted 5 lines · Simon Guinot
From: Simon Guinot <[email protected]>
Signed-off-by Simon Guinot <[email protected]>---
Quoted 7 lines
Changes in v2:
- fix asm-offsets.s removal
- make MAC address setup conditional toCONFIG_SYS_I2C_EEPROM_ADDRboard/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
Quoted 81 lines
board/LaCie/netspace_v2/netspace_v2.c +43
-0@@ -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;include/configs/netspace_v2.h +1
-0@@ -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 Signature · 6 lines
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
PATCH v2 1/1 netspace_v2: Read Ethernet MAC address from EEPROM
Quoted 21 lines
-----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 EEPROMHi Prafulla,
Quoted 8 lines · Simon Guinot
From: Simon Guinot <[email protected]>
Signed-off-by Simon Guinot <[email protected]>---
Changes in v2:
- fix asm-offsets.s removal
- make MAC address setup conditional to
Quoted 8 lines
CONFIG_SYS_I2C_EEPROM_ADDRQuoted 2 lines
board/LaCie/netspace_v2/netspace_v2.c | 43+++++++++++++++++++++++++++++++++
Quoted 2 lines
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 . .
PATCH v2 1/1 netspace_v2: Read Ethernet MAC address from EEPROM
In reply to Simon GuinotQuoted 110 lines
-----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 EEPROMHi Prafulla,
Quoted 8 lines · Simon Guinot
From: Simon Guinot <[email protected]>
Signed-off-by Simon Guinot <[email protected]>---
Changes in v2:
- fix asm-offsets.s removal
- make MAC address setup conditional to
CONFIG_SYS_I2C_EEPROM_ADDRQuoted 2 lines
board/LaCie/netspace_v2/netspace_v2.c | 43+++++++++++++++++++++++++++++++++
Quoted 2 lines
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
Review
Quoted 2 lines
(quoted diff) +0
-0
b/board/LaCie/netspace_v2/netspace_v2.cQuoted 12 lines
index 7c4b15e..6938a43 100644
board/LaCie/netspace_v2/netspace_v2.c +1
-0@@ -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> board/LaCie/netspace_v2/netspace_v2.c int board_init(void) · line 95
Quoted 6 lines
board/LaCie/netspace_v2/netspace_v2.c +3
-0@@ -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)Quoted 10 lines
board/LaCie/netspace_v2/netspace_v2.c +10
-0+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,board/LaCie/netspace_v2/netspace_v2.c int board_init(void)
Quoted 10 lines
board/LaCie/netspace_v2/netspace_v2.c +10
-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 EEPROMdata\n",
Review
Quoted 23 lines
board/LaCie/netspace_v2/netspace_v2.c +19
-0+ 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;(quoted diff) +0
-0
b/include/configs/netspace_v2.hinclude/configs/netspace_v2.h line 90
Quoted 8 lines
index bb27ed7..1ddf4b4 100644
include/configs/netspace_v2.h +1
-0@@ -87,6 +87,7 @@* Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */
Quoted 7 lines
include/configs/netspace_v2.h line 91
Quoted 1 line
include/configs/netspace_v2.h +0
-0#define CONFIG_MVGBE_PORTS {1, 0}/* enable port 0 only */
Quoted 5 lines
include/configs/netspace_v2.h +0
-1#define CONFIG_NETCONSOLE #endif --1.7.5.1
Applied to u-boot-marvell.git master branch
Regards..
Prafulla . . .