* [U-Boot] [PATCH v2 1/8] arm/km: introduce and manage bootcount environment variable
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-03 14:13 ` [U-Boot] [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded printouts Valentin Longchamp
` (6 subsequent siblings)
7 siblings, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
This environment variable is used to set the bootcount address
for the kernel.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
- taken Wolfgang Denk's comments into account
board/keymile/km_arm/km_arm.c | 14 ++++++++++++++
include/configs/km_arm.h | 3 +++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index c772ee2..f147f1f 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -145,6 +145,17 @@ int initialize_unit_leds(void)
return 0;
}
+#if defined(CONFIG_BOOTCOUNT_LIMIT)
+void set_bootcount_addr(void)
+{
+ uchar buf[32];
+ unsigned int bootcountaddr;
+ bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR;
+ sprintf((char *)buf, "0x%x", bootcountaddr);
+ setenv("bootcountaddr", (char *)buf);
+}
+#endif
+
int misc_init_r(void)
{
char *str;
@@ -215,6 +226,9 @@ int board_init(void)
int last_stage_init(void)
{
set_km_env();
+#if defined(CONFIG_BOOTCOUNT_LIMIT)
+ set_bootcount_addr();
+#endif
return 0;
}
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 70113d4..89f9d35 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -64,6 +64,9 @@
#define CONFIG_KM_KERNEL_ADDR 0x2000000 /* 4096KBytes */
#define CONFIG_KM_DEF_ENV_CPU \
+ "addbootcount=" \
+ "setenv bootargs ${bootargs} " \
+ "bootcountaddr=${bootcountaddr}\0" \
"addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
"boot=bootm ${actual_kernel_addr} - -\0" \
"cramfsloadfdt=echo \\\\c\0" \
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded printouts
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
2011-05-03 14:13 ` [U-Boot] [PATCH v2 1/8] arm/km: introduce and manage bootcount environment variable Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-03 14:13 ` [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM Valentin Longchamp
` (5 subsequent siblings)
7 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
From: Holger Brunck <holger.brunck@keymile.com>
last_stage_init is not available for arm platforms. So move
the calls to set_km_var and set_bootcount_addr to misc_init_r
and remove this function.
Additionally some unneeded printouts were removed.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
board/keymile/km_arm/km_arm.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index f147f1f..4049a4e 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -161,11 +161,6 @@ int misc_init_r(void)
char *str;
int mach_type;
- puts("Piggy:");
- if (ethernet_present() == 0)
- puts (" not");
- puts(" present\n");
-
str = getenv("mach_type");
if (str != NULL) {
mach_type = simple_strtoul(str, NULL, 10);
@@ -174,7 +169,10 @@ int misc_init_r(void)
}
initialize_unit_leds();
-
+ set_km_env();
+#if defined(CONFIG_BOOTCOUNT_LIMIT)
+ set_bootcount_addr();
+#endif
return 0;
}
@@ -193,7 +191,6 @@ int board_early_init_f(void)
writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
tmp = readl(KW_GPIO0_BASE + 4);
writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
- printf("KM: setting NAND mode\n");
#if defined(CONFIG_SOFT_I2C)
/* init the GPIO for I2C Bitbang driver */
@@ -223,15 +220,6 @@ int board_init(void)
return 0;
}
-int last_stage_init(void)
-{
- set_km_env();
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
- set_bootcount_addr();
-#endif
- return 0;
-}
-
#if defined(CONFIG_CMD_SF)
int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded printouts
2011-05-03 14:13 ` [U-Boot] [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded printouts Valentin Longchamp
@ 2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-04 7:43 ` Valentin Longchamp
0 siblings, 1 reply; 23+ messages in thread
From: Prafulla Wadaskar @ 2011-05-04 7:30 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
> Sent: Tuesday, May 03, 2011 7:43 PM
> To: u-boot at lists.denx.de
> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
> Wolfgang Denk; Detlev Zundel
> Subject: [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded
> printouts
>
> From: Holger Brunck <holger.brunck@keymile.com>
>
> last_stage_init is not available for arm platforms. So move
> the calls to set_km_var and set_bootcount_addr to misc_init_r
> and remove this function.
>
> Additionally some unneeded printouts were removed.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Detlev Zundel <dzu@denx.de>
> ---
> Changes for v2:
> - split up first large patch series to three independent smaller
> patch series
>
> board/keymile/km_arm/km_arm.c | 20 ++++----------------
> 1 files changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/board/keymile/km_arm/km_arm.c
> b/board/keymile/km_arm/km_arm.c
> index f147f1f..4049a4e 100644
> --- a/board/keymile/km_arm/km_arm.c
> +++ b/board/keymile/km_arm/km_arm.c
> @@ -161,11 +161,6 @@ int misc_init_r(void)
> char *str;
> int mach_type;
>
> - puts("Piggy:");
> - if (ethernet_present() == 0)
> - puts (" not");
> - puts(" present\n");
> -
> str = getenv("mach_type");
> if (str != NULL) {
> mach_type = simple_strtoul(str, NULL, 10);
> @@ -174,7 +169,10 @@ int misc_init_r(void)
> }
>
> initialize_unit_leds();
> -
> + set_km_env();
> +#if defined(CONFIG_BOOTCOUNT_LIMIT)
> + set_bootcount_addr();
> +#endif
> return 0;
> }
>
> @@ -193,7 +191,6 @@ int board_early_init_f(void)
> writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
> tmp = readl(KW_GPIO0_BASE + 4);
> writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
> - printf("KM: setting NAND mode\n");
>
> #if defined(CONFIG_SOFT_I2C)
> /* init the GPIO for I2C Bitbang driver */
> @@ -223,15 +220,6 @@ int board_init(void)
> return 0;
> }
>
> -int last_stage_init(void)
> -{
> - set_km_env();
> -#if defined(CONFIG_BOOTCOUNT_LIMIT)
> - set_bootcount_addr();
> -#endif
> - return 0;
> -}
This patch can be merged with 1/8 since you are undoing the changes done there. BTW: what is purpose?
Regards..
Prafulla ..
^ permalink raw reply [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded printouts
2011-05-04 7:30 ` Prafulla Wadaskar
@ 2011-05-04 7:43 ` Valentin Longchamp
0 siblings, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-04 7:43 UTC (permalink / raw)
To: u-boot
Prafulla Wadaskar wrote:
>
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
>> Sent: Tuesday, May 03, 2011 7:43 PM
>> To: u-boot at lists.denx.de
>> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
>> Wolfgang Denk; Detlev Zundel
>> Subject: [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded
>> printouts
>>
>> From: Holger Brunck <holger.brunck@keymile.com>
>>
>> last_stage_init is not available for arm platforms. So move
>> the calls to set_km_var and set_bootcount_addr to misc_init_r
>> and remove this function.
>>
>> Additionally some unneeded printouts were removed.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> ---
>> Changes for v2:
>> - split up first large patch series to three independent smaller
>> patch series
>>
>> board/keymile/km_arm/km_arm.c | 20 ++++----------------
>> 1 files changed, 4 insertions(+), 16 deletions(-)
>>
>> diff --git a/board/keymile/km_arm/km_arm.c
>> b/board/keymile/km_arm/km_arm.c
>> index f147f1f..4049a4e 100644
>> --- a/board/keymile/km_arm/km_arm.c
>> +++ b/board/keymile/km_arm/km_arm.c
>> @@ -161,11 +161,6 @@ int misc_init_r(void)
>> char *str;
>> int mach_type;
>>
>> - puts("Piggy:");
>> - if (ethernet_present() == 0)
>> - puts (" not");
>> - puts(" present\n");
>> -
>> str = getenv("mach_type");
>> if (str != NULL) {
>> mach_type = simple_strtoul(str, NULL, 10);
>> @@ -174,7 +169,10 @@ int misc_init_r(void)
>> }
>>
>> initialize_unit_leds();
>> -
>> + set_km_env();
>> +#if defined(CONFIG_BOOTCOUNT_LIMIT)
>> + set_bootcount_addr();
>> +#endif
>> return 0;
>> }
>>
>> @@ -193,7 +191,6 @@ int board_early_init_f(void)
>> writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
>> tmp = readl(KW_GPIO0_BASE + 4);
>> writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
>> - printf("KM: setting NAND mode\n");
>>
>> #if defined(CONFIG_SOFT_I2C)
>> /* init the GPIO for I2C Bitbang driver */
>> @@ -223,15 +220,6 @@ int board_init(void)
>> return 0;
>> }
>>
>> -int last_stage_init(void)
>> -{
>> - set_km_env();
>> -#if defined(CONFIG_BOOTCOUNT_LIMIT)
>> - set_bootcount_addr();
>> -#endif
>> - return 0;
>> -}
>
> This patch can be merged with 1/8 since you are undoing the changes done there. BTW: what is purpose?
>
Yes I agree, they can be merged. You mean the purpose of the bootcounter
env variable ? Well, we have a bootcounter that is placed at a certain
reserved memory address, and we compute the address so that we can give
it to the kernel as a parameter (that's how we have done it on kirkwood
since we don't have a reserved SRAM for such things).
Regards
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
2011-05-03 14:13 ` [U-Boot] [PATCH v2 1/8] arm/km: introduce and manage bootcount environment variable Valentin Longchamp
2011-05-03 14:13 ` [U-Boot] [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded printouts Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-03 14:13 ` [U-Boot] [PATCH v2 4/8] arm/km: disable ls (through jffs2 support) Valentin Longchamp
` (4 subsequent siblings)
7 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
This RAM is used on mgcoge3un and needs other initialization values
for the SDRAM controller.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
board/keymile/km_arm/kwbimage-memphis.cfg | 197 +++++++++++++++++++++++++++++
1 files changed, 197 insertions(+), 0 deletions(-)
create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg
diff --git a/board/keymile/km_arm/kwbimage-memphis.cfg b/board/keymile/km_arm/kwbimage-memphis.cfg
new file mode 100644
index 0000000..2faaf2b
--- /dev/null
+++ b/board/keymile/km_arm/kwbimage-memphis.cfg
@@ -0,0 +1,197 @@
+#
+# (C) Copyright 2010
+# Heiko Schocher, DENX Software Engineering, hs at denx.de.
+#
+# (C) Copyright 2011
+# Valentin Longchamp, Keymile AG, valentin.longchamp at keymile.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.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# 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
+
+DATA 0xFFD10000 0x01112222 # MPP Control 0 Register
+# bit 3-0: MPPSel0 2, NF_IO[2]
+# bit 7-4: MPPSel1 2, NF_IO[3]
+# bit 12-8: MPPSel2 2, NF_IO[4]
+# bit 15-12: MPPSel3 2, NF_IO[5]
+# bit 19-16: MPPSel4 1, NF_IO[6]
+# bit 23-20: MPPSel5 1, NF_IO[7]
+# bit 27-24: MPPSel6 1, SYSRST_O
+# bit 31-28: MPPSel7 0, GPO[7]
+
+DATA 0xFFD10004 0x03303300
+
+DATA 0xFFD10008 0x00001100 # MPP Control 2 Register
+# bit 3-0: MPPSel16 0, GPIO[16]
+# bit 7-4: MPPSel17 0, GPIO[17]
+# bit 12-8: MPPSel18 1, NF_IO[0]
+# bit 15-12: MPPSel19 1, NF_IO[1]
+# bit 19-16: MPPSel20 0, GPIO[20]
+# bit 23-20: MPPSel21 0, GPIO[21]
+# bit 27-24: MPPSel22 0, GPIO[22]
+# bit 31-28: MPPSel23 0, GPIO[23]
+
+DATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register
+DATA 0xFFD20134 0x66666666 # L2 RAM Timing 0 Register
+DATA 0xFFD20138 0x66666666 # L2 RAM Timing 1 Register
+DATA 0xFFD20154 0x00000200 # CPU RAM Management Control3 Register
+DATA 0xFFD2014C 0x00001C00 # CPU RAM Management Control1 Register
+DATA 0xFFD20148 0x00000001 # CPU RAM Management Control0 Register
+
+#Dram initalization
+DATA 0xFFD01400 0x430004E0 # SDRAM Configuration Register
+# bit13-0: 0x4E0 (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 0x38543000 # DDR Controller Control Low
+# bit 3-0: 0 reserved
+# 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=4 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 8= CL+4, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM
+# bit30-28: 3 required
+# bit31: 0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x2302433E # DDR Timing (Low) (active cycles value +1)
+# bit3-0: TRAS lsbs
+# 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 0x00000A3E # DDR Timing (High)
+# bit6-0: TRFC
+# bit8-7: TR2R
+# bit10-9: TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x00000001 # DDR Address Control
+# bit1-0: 01, Cs0width=x16
+# bit3-2: 00, Cs0size=2Gb
+# 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 0x00000652 # DDR Mode
+DATA 0xFFD01420 0x00000006 # DDR Extended Mode
+# bit0: 0, DDR DLL enabled
+# bit1: 1, DDR drive strenght reduced
+# bit2: 1, DDR ODT control lsd disabled
+# bit5-3: 000, required
+# bit6: 0, DDR ODT control msb disabled
+# bit9-7: 000, required
+# bit10: 0, differential DQS enabled
+# bit11: 0, required
+# bit12: 0, DDR output buffer enabled
+# bit31-13: 0 required
+
+DATA 0xFFD01424 0x0000F17F # DDR Controller Control High
+# bit2-0: 111, required
+# bit3 : 1 , MBUS Burst Chop disabled
+# bit6-4: 111, required
+# bit7 : 0
+# bit8 : 1 , add a sample stage
+# 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 0x00084520 # DDR2 SDRAM Timing Low
+# bit3-0 : 0000, required
+# bit7-4 : 0010, M_ODT assertion 2 cycles after read
+# bit11-8 : 1001, M_ODT de-assertion 5 cycles after read
+# bit15-12: 0100, internal ODT assertion 4 cycles after read
+# bit19-16: 1000, internal ODT de-assertion 8 cycles after read
+# bit31-20: 0 , required
+
+DATA 0xFFD0147c 0x00008451 # DDR2 SDRAM Timing High
+# bit3-0 : 0001, M_ODT assertion same cycle as write
+# bit7-4 : 0101, M_ODT de-assertion x cycles after write
+# bit11-8 : 0100, internal ODT assertion x cycles after write
+# bit15-12: 1000, internal ODT de-assertion x cycles after write
+
+DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0
+DATA 0xFFD01504 0x0FFFFFF1 # 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: 0x0F, Size (i.e. 256MB)
+
+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: 0, ODT0Rd, MODT[0] not 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: 00, ODT1 controlled by register
+# bit31-4: zero, required
+
+DATA 0xFFD0149C 0x0000F801 # CPU ODT Control
+# bit3-0: 1, ODT0Rd, Internal ODT asserted during read from DRAM bank0
+# bit7-4: 0, ODT0Wr, Internal ODT not asserted during write to DRAM bank0
+# bit9-8: 0, ODTEn, controlled by ODT0Rd and ODT0Wr
+# bit11-10:2, DQ_ODTSel. ODT select turned on, 75 ohm
+# bit13-12:3, STARTBURST ODT buffer selected, 50 ohm
+# bit14 :1, STARTBURST ODT enabled
+# bit15 :1, Use ODT Block
+
+DATA 0xFFD01480 0x00000001 # DDR Initialization Control
+# bit0=1, enable DDR init upon this register write
+
+# End of Header extension
+DATA 0x0 0x0
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM
2011-05-03 14:13 ` [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM Valentin Longchamp
@ 2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-04 8:07 ` Valentin Longchamp
0 siblings, 1 reply; 23+ messages in thread
From: Prafulla Wadaskar @ 2011-05-04 7:30 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
> Sent: Tuesday, May 03, 2011 7:43 PM
> To: u-boot at lists.denx.de
> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
> Wolfgang Denk; Detlev Zundel
> Subject: [PATCH v2 3/8] arm/km: add BootROM config file for memphis
> SDRAM
>
> This RAM is used on mgcoge3un and needs other initialization values
> for the SDRAM controller.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Detlev Zundel <dzu@denx.de>
> ---
> Changes for v2:
> - split up first large patch series to three independent smaller
> patch series
>
> board/keymile/km_arm/kwbimage-memphis.cfg | 197
> +++++++++++++++++++++++++++++
> 1 files changed, 197 insertions(+), 0 deletions(-)
> create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg
>
You are just adding file here, whereas it is not being used. Is it like dead code to me.
Regards..
Prafulla . .
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM
2011-05-04 7:30 ` Prafulla Wadaskar
@ 2011-05-04 8:07 ` Valentin Longchamp
2011-05-04 22:22 ` Wolfgang Denk
0 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-04 8:07 UTC (permalink / raw)
To: u-boot
Prafulla Wadaskar wrote:
>
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
>> Sent: Tuesday, May 03, 2011 7:43 PM
>> To: u-boot at lists.denx.de
>> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
>> Wolfgang Denk; Detlev Zundel
>> Subject: [PATCH v2 3/8] arm/km: add BootROM config file for memphis
>> SDRAM
>>
>> This RAM is used on mgcoge3un and needs other initialization values
>> for the SDRAM controller.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> ---
>> Changes for v2:
>> - split up first large patch series to three independent smaller
>> patch series
>>
>> board/keymile/km_arm/kwbimage-memphis.cfg | 197
>> +++++++++++++++++++++++++++++
>> 1 files changed, 197 insertions(+), 0 deletions(-)
>> create mode 100644 board/keymile/km_arm/kwbimage-memphis.cfg
>>
>
> You are just adding file here, whereas it is not being used. Is it like dead code to me.
>
Yes, it is not used with the u-boot build system, we have a small script
that wraps around it.
It is used by the mgcoge3un board, that is later introduced with this
series.
Your remark makes me think I have a few things to change in our marvell
boards config:
1) We currently define CONFIG_SYS_KWD_CONFIG in
include/configs/keymile-common.h, although this is stricly used by our
marvell/kirkwood designs -> we shoud move this definition to
include/configs/km_arm.h
2) I should add redefine CONFIG_SYS_KWD_CONFIG to this
kwbiamge-memphis.cfg for mgcoge3un board
Now I have a question about the marvell boards build: I see in the
Makefile that there is a rule about this kwb file, which is exactly what
we do in our additionnal build script:
$(obj)u-boot.kwb: $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $
How do you use it (because I think it is not called by the default make
command) ?
Regards
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp@keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM
2011-05-04 8:07 ` Valentin Longchamp
@ 2011-05-04 22:22 ` Wolfgang Denk
2011-05-05 6:28 ` Valentin Longchamp
0 siblings, 1 reply; 23+ messages in thread
From: Wolfgang Denk @ 2011-05-04 22:22 UTC (permalink / raw)
To: u-boot
Dear Valentin Longchamp,
In message <4DC1092E.4080804@keymile.com> you wrote:
>
> > You are just adding file here, whereas it is not being used. Is it like dead code to me.
>
> Yes, it is not used with the u-boot build system, we have a small script
> that wraps around it.
As this "small script" is neither available here this _is_ dead code
and will not be accepted.
> It is used by the mgcoge3un board, that is later introduced with this
> series.
Then please add it together with this board, then.
> Now I have a question about the marvell boards build: I see in the
> Makefile that there is a rule about this kwb file, which is exactly what
> we do in our additionnal build script:
Please either get rid of this "additionnal build script", or move it's
function into the mainline U-Boot code.
(Note: this might even be considered as a GPL violation which
requires to include "scripts used to control compilation").
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
No question is too silly to ask. Of course, some questions are too
silly to to answer... - L. Wall & R. L. Schwartz, _Programming Perl_
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM
2011-05-04 22:22 ` Wolfgang Denk
@ 2011-05-05 6:28 ` Valentin Longchamp
0 siblings, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-05 6:28 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> Dear Valentin Longchamp,
>
> In message <4DC1092E.4080804@keymile.com> you wrote:
>>> You are just adding file here, whereas it is not being used. Is it like dead code to me.
>> Yes, it is not used with the u-boot build system, we have a small script
>> that wraps around it.
>
> As this "small script" is neither available here this _is_ dead code
> and will not be accepted.
Yes I completely agree. That's why we have some other config files that
were initially posted for mainline inclusion and removed for this patch
series.
>
>> It is used by the mgcoge3un board, that is later introduced with this
>> series.
>
> Then please add it together with this board, then.
That's what I have done in the v3 series posted yesterday.
>
>> Now I have a question about the marvell boards build: I see in the
>> Makefile that there is a rule about this kwb file, which is exactly what
>> we do in our additionnal build script:
>
> Please either get rid of this "additionnal build script", or move it's
> function into the mainline U-Boot code.
I agree once again. I have asked Prafulla for additionnal information
about the mkimage usage in the standard u-boot Makefile (because this is
new for us in u-boot). If we can use this, we then can simplify the
given build script (or even get rid of it). I first have to clarify
things about this build script with my colleagues.
>
> (Note: this might even be considered as a GPL violation which
> requires to include "scripts used to control compilation").
>
Well, no violation intended here. This script can be published. But I
have to clarify with my colleagues why exactly we have to script
additionally to the standard u-boot Makefile (it may only be legacy
because we used to work with an old u-boot before our mainlining effort).
Best Regards
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 4/8] arm/km: disable ls (through jffs2 support)
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
` (2 preceding siblings ...)
2011-05-03 14:13 ` [U-Boot] [PATCH v2 3/8] arm/km: add BootROM config file for memphis SDRAM Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-03 14:13 ` [U-Boot] [PATCH v2 5/8] arm/km: add second serial interface for kirkwood Valentin Longchamp
` (3 subsequent siblings)
7 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
This is not supported on our km-arm boards since we have defined
CONFIG_SYS_NO_FLASH for our NAND Flash chip.
With CONFIG_CMD_JFFS2, the ls command is present and works very badly
on our km-arm boards.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
include/configs/km_arm.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 89f9d35..a8a4d77 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -248,6 +248,7 @@ int get_scl (void);
#if defined(CONFIG_SYS_NO_FLASH)
#define CONFIG_KM_UBI_PARTITION_NAME "ubi0"
#undef CONFIG_FLASH_CFI_MTD
+#undef CONFIG_CMD_JFFS2
#undef CONFIG_JFFS2_CMDLINE
#endif
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 4/8] arm/km: disable ls (through jffs2 support)
2011-05-03 14:13 ` [U-Boot] [PATCH v2 4/8] arm/km: disable ls (through jffs2 support) Valentin Longchamp
@ 2011-05-04 7:30 ` Prafulla Wadaskar
0 siblings, 0 replies; 23+ messages in thread
From: Prafulla Wadaskar @ 2011-05-04 7:30 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
> Sent: Tuesday, May 03, 2011 7:43 PM
> To: u-boot at lists.denx.de
> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
> Wolfgang Denk; Detlev Zundel
> Subject: [PATCH v2 4/8] arm/km: disable ls (through jffs2 support)
>
> This is not supported on our km-arm boards since we have defined
> CONFIG_SYS_NO_FLASH for our NAND Flash chip.
>
> With CONFIG_CMD_JFFS2, the ls command is present and works very badly
> on our km-arm boards.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Detlev Zundel <dzu@denx.de>
> ---
> Changes for v2:
> - split up first large patch series to three independent smaller
> patch series
>
> include/configs/km_arm.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
> index 89f9d35..a8a4d77 100644
> --- a/include/configs/km_arm.h
> +++ b/include/configs/km_arm.h
> @@ -248,6 +248,7 @@ int get_scl (void);
> #if defined(CONFIG_SYS_NO_FLASH)
> #define CONFIG_KM_UBI_PARTITION_NAME "ubi0"
> #undef CONFIG_FLASH_CFI_MTD
> +#undef CONFIG_CMD_JFFS2
> #undef CONFIG_JFFS2_CMDLINE
> #endif
>
Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
Regards..
Prafulla . .
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 5/8] arm/km: add second serial interface for kirkwood
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
` (3 preceding siblings ...)
2011-05-03 14:13 ` [U-Boot] [PATCH v2 4/8] arm/km: disable ls (through jffs2 support) Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-03 14:13 ` [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un Valentin Longchamp
` (2 subsequent siblings)
7 siblings, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
From: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
include/configs/km_arm.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index a8a4d77..06f91fe 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -92,6 +92,7 @@
#define CONFIG_SYS_NS16550_REG_SIZE (-4)
#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_TCLK
#define CONFIG_SYS_NS16550_COM1 KW_UART0_BASE
+#define CONFIG_SYS_NS16550_COM2 KW_UART1_BASE
/*
* Serial Port configuration
@@ -136,7 +137,12 @@
#define BOOTFLASH_START 0x0
+/* Kirkwood has two serial IF */
+#if (CONFIG_CONS_INDEX == 2)
+#define CONFIG_KM_CONSOLE_TTY "ttyS1"
+#else
#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+#endif
/* size in bytes reserved for initial data */
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
` (4 preceding siblings ...)
2011-05-03 14:13 ` [U-Boot] [PATCH v2 5/8] arm/km: add second serial interface for kirkwood Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-03 14:13 ` [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un Valentin Longchamp
2011-05-03 14:13 ` [U-Boot] [PATCH v2 8/8] arm/km: update mgcoge3un board support Valentin Longchamp
7 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
From: Holger Brunck <holger.brunck@keymile.com>
The mgcoge2un target was only an intermediate step to mgcoge3un.
For this reason the mgcoge2un support was moved to mgcoge3un,
because it isn't needed to support both targets.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
MAINTAINERS | 8 ++++----
boards.cfg | 2 +-
include/configs/{mgcoge2un.h => mgcoge3un.h} | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
rename include/configs/{mgcoge2un.h => mgcoge3un.h} (92%)
diff --git a/MAINTAINERS b/MAINTAINERS
index e2a4ba9..2dd1f8d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -429,14 +429,11 @@ Heiko Schocher <hs@denx.de>
kmeter1 MPC8360
kmsupx5 MPC8321
mgcoge MPC8247
- mgcoge2ne MPC8247
- mgcoge2un ARM926EJS (Kirkwood SoC)
+ mgcoge3ne MPC8247
mucmc52 MPC5200
muas3001 MPC8270
municse MPC5200
sc3 PPC405GP
- suen3 ARM926EJS (Kirkwood SoC)
- suen8 ARM926EJS (Kirkwood SoC)
suvd3 MPC8321
tuda1 MPC8321
tuxa1 MPC8321
@@ -814,6 +811,9 @@ Jens Scharsig <esw@bus-elektronik.de>
Heiko Schocher <hs@denx.de>
magnesium i.MX27
+ mgcoge3un ARM926EJS (Kirkwood SoC)
+ suen3 ARM926EJS (Kirkwood SoC)
+ suen8 ARM926EJS (Kirkwood SoC)
Robert Schwebel <r.schwebel@pengutronix.de>
diff --git a/boards.cfg b/boards.cfg
index 2b0900a..2d36c52 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -105,7 +105,7 @@ davinci_sffsdr arm arm926ejs sffsdr davinci
davinci_sonata arm arm926ejs sonata davinci davinci
suen3 arm arm926ejs km_arm keymile kirkwood
suen8 arm arm926ejs km_arm keymile kirkwood
-mgcoge2un arm arm926ejs km_arm keymile kirkwood
+mgcoge3un arm arm926ejs km_arm keymile kirkwood
guruplug arm arm926ejs - Marvell kirkwood
mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood
openrd_base arm arm926ejs - Marvell kirkwood
diff --git a/include/configs/mgcoge2un.h b/include/configs/mgcoge3un.h
similarity index 92%
rename from include/configs/mgcoge2un.h
rename to include/configs/mgcoge3un.h
index d3c7bdc..0d19da4 100644
--- a/include/configs/mgcoge2un.h
+++ b/include/configs/mgcoge3un.h
@@ -31,8 +31,8 @@
/* for linking errors see
* http://lists.denx.de/pipermail/u-boot/2009-July/057350.html */
-#ifndef _CONFIG_MGCOGE2UN_H
-#define _CONFIG_MGCOGE2UN_H
+#ifndef _CONFIG_MGCOGE3UN_H
+#define _CONFIG_MGCOGE3UN_H
/* include common defines/options for all arm based Keymile boards */
#include "km_arm.h"
@@ -40,9 +40,9 @@
/*
* Version number information
*/
-#define CONFIG_IDENT_STRING "\nKeymile MGCOGE2UN"
-
-#define CONFIG_HOSTNAME mgcoge2un
+#define CONFIG_IDENT_STRING "\nKeymile MGCOGE3UN"
+#define CONFIG_HOSTNAME mgcoge3un
+#define CONFIG_MGCOGE3UN
#define KM_IVM_BUS "pca9547:70:9" /* I2C2 (Mux-Port 1)*/
#define KM_ENV_BUS "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
2011-05-03 14:13 ` [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un Valentin Longchamp
@ 2011-05-04 7:30 ` Prafulla Wadaskar
2011-05-04 8:35 ` Valentin Longchamp
0 siblings, 1 reply; 23+ messages in thread
From: Prafulla Wadaskar @ 2011-05-04 7:30 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
> Sent: Tuesday, May 03, 2011 7:43 PM
> To: u-boot at lists.denx.de
> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
> Wolfgang Denk; Detlev Zundel
> Subject: [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
>
> From: Holger Brunck <holger.brunck@keymile.com>
>
> The mgcoge2un target was only an intermediate step to mgcoge3un.
> For this reason the mgcoge2un support was moved to mgcoge3un,
> because it isn't needed to support both targets.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Detlev Zundel <dzu@denx.de>
> ---
> Changes for v2:
> - split up first large patch series to three independent smaller
> patch series
>
> MAINTAINERS | 8 ++++----
> boards.cfg | 2 +-
> include/configs/{mgcoge2un.h => mgcoge3un.h} | 10 +++++-----
> 3 files changed, 10 insertions(+), 10 deletions(-)
> rename include/configs/{mgcoge2un.h => mgcoge3un.h} (92%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e2a4ba9..2dd1f8d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -429,14 +429,11 @@ Heiko Schocher <hs@denx.de>
> kmeter1 MPC8360
> kmsupx5 MPC8321
> mgcoge MPC8247
> - mgcoge2ne MPC8247
> - mgcoge2un ARM926EJS (Kirkwood SoC)
> + mgcoge3ne MPC8247
> mucmc52 MPC5200
> muas3001 MPC8270
> municse MPC5200
> sc3 PPC405GP
> - suen3 ARM926EJS (Kirkwood SoC)
> - suen8 ARM926EJS (Kirkwood SoC)
> suvd3 MPC8321
> tuda1 MPC8321
> tuxa1 MPC8321
> @@ -814,6 +811,9 @@ Jens Scharsig <esw@bus-elektronik.de>
> Heiko Schocher <hs@denx.de>
>
> magnesium i.MX27
> + mgcoge3un ARM926EJS (Kirkwood SoC)
> + suen3 ARM926EJS (Kirkwood SoC)
> + suen8 ARM926EJS (Kirkwood SoC)
>
> Robert Schwebel <r.schwebel@pengutronix.de>
>
> diff --git a/boards.cfg b/boards.cfg
> index 2b0900a..2d36c52 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -105,7 +105,7 @@ davinci_sffsdr arm arm926ejs
> sffsdr davinci
> davinci_sonata arm arm926ejs sonata
> davinci davinci
> suen3 arm arm926ejs km_arm
> keymile kirkwood
> suen8 arm arm926ejs km_arm
> keymile kirkwood
> -mgcoge2un arm arm926ejs km_arm
> keymile kirkwood
> +mgcoge3un arm arm926ejs km_arm
> keymile kirkwood
> guruplug arm arm926ejs -
How are you addressing builds different boards in the same code?
You can have some common code using features of boards.cfg
Check top comments in boards.cfg
Regards..
Prafulla . .
^ permalink raw reply [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
2011-05-04 7:30 ` Prafulla Wadaskar
@ 2011-05-04 8:35 ` Valentin Longchamp
2011-05-04 22:17 ` Wolfgang Denk
0 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-04 8:35 UTC (permalink / raw)
To: u-boot
Prafulla Wadaskar wrote:
>
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
>> Sent: Tuesday, May 03, 2011 7:43 PM
>> To: u-boot at lists.denx.de
>> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
>> Wolfgang Denk; Detlev Zundel
>> Subject: [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
>>
>> From: Holger Brunck <holger.brunck@keymile.com>
>>
>> The mgcoge2un target was only an intermediate step to mgcoge3un.
>> For this reason the mgcoge2un support was moved to mgcoge3un,
>> because it isn't needed to support both targets.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> ---
>> Changes for v2:
>> - split up first large patch series to three independent smaller
>> patch series
>>
>> MAINTAINERS | 8 ++++----
>> boards.cfg | 2 +-
>> include/configs/{mgcoge2un.h => mgcoge3un.h} | 10 +++++-----
>> 3 files changed, 10 insertions(+), 10 deletions(-)
>> rename include/configs/{mgcoge2un.h => mgcoge3un.h} (92%)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index e2a4ba9..2dd1f8d 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -429,14 +429,11 @@ Heiko Schocher <hs@denx.de>
>> kmeter1 MPC8360
>> kmsupx5 MPC8321
>> mgcoge MPC8247
>> - mgcoge2ne MPC8247
>> - mgcoge2un ARM926EJS (Kirkwood SoC)
>> + mgcoge3ne MPC8247
>> mucmc52 MPC5200
>> muas3001 MPC8270
>> municse MPC5200
>> sc3 PPC405GP
>> - suen3 ARM926EJS (Kirkwood SoC)
>> - suen8 ARM926EJS (Kirkwood SoC)
>> suvd3 MPC8321
>> tuda1 MPC8321
>> tuxa1 MPC8321
>> @@ -814,6 +811,9 @@ Jens Scharsig <esw@bus-elektronik.de>
>> Heiko Schocher <hs@denx.de>
>>
>> magnesium i.MX27
>> + mgcoge3un ARM926EJS (Kirkwood SoC)
>> + suen3 ARM926EJS (Kirkwood SoC)
>> + suen8 ARM926EJS (Kirkwood SoC)
>>
>> Robert Schwebel <r.schwebel@pengutronix.de>
>>
>> diff --git a/boards.cfg b/boards.cfg
>> index 2b0900a..2d36c52 100644
>> --- a/boards.cfg
>> +++ b/boards.cfg
>> @@ -105,7 +105,7 @@ davinci_sffsdr arm arm926ejs
>> sffsdr davinci
>> davinci_sonata arm arm926ejs sonata
>> davinci davinci
>> suen3 arm arm926ejs km_arm
>> keymile kirkwood
>> suen8 arm arm926ejs km_arm
>> keymile kirkwood
>> -mgcoge2un arm arm926ejs km_arm
>> keymile kirkwood
>> +mgcoge3un arm arm926ejs km_arm
>> keymile kirkwood
>> guruplug arm arm926ejs -
>
> How are you addressing builds different boards in the same code?
> You can have some common code using features of boards.cfg
> Check top comments in boards.cfg
>
This is a discussion we have already had for our ppc boards
(http://lists.denx.de/pipermail/u-boot/2011-May/091873.html).
The current differences between our kirkwood boards are not many, but
since we have new boards coming where the difference number is going to
grow, it is going to be hard to keep many (even 2) boards in one single
file. That why we prefer to have the differences (and common source code
we have to maintain, I agree as well) in .h source files than in the
boards.cfg file.
Regards
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
2011-05-04 8:35 ` Valentin Longchamp
@ 2011-05-04 22:17 ` Wolfgang Denk
2011-05-05 6:18 ` Valentin Longchamp
0 siblings, 1 reply; 23+ messages in thread
From: Wolfgang Denk @ 2011-05-04 22:17 UTC (permalink / raw)
To: u-boot
Dear Valentin Longchamp,
In message <4DC10FEC.1050200@keymile.com> you wrote:
>
> The current differences between our kirkwood boards are not many, but
> since we have new boards coming where the difference number is going to
> grow, it is going to be hard to keep many (even 2) boards in one single
> file. That why we prefer to have the differences (and common source code
> we have to maintain, I agree as well) in .h source files than in the
> boards.cfg file.
Oops. Common _source_ code in ".h source files" ?
Please don't. Header files are NOT intended for any real source code
(with th exception of some usually smallish inline fnctions and such).
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
"In matrimony, to hesitate is sometimes to be saved." - Butler
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un
2011-05-04 22:17 ` Wolfgang Denk
@ 2011-05-05 6:18 ` Valentin Longchamp
0 siblings, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-05 6:18 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk,
Wolfgang Denk wrote:
> Dear Valentin Longchamp,
>
> In message <4DC10FEC.1050200@keymile.com> you wrote:
>> The current differences between our kirkwood boards are not many, but
>> since we have new boards coming where the difference number is going to
>> grow, it is going to be hard to keep many (even 2) boards in one single
>> file. That why we prefer to have the differences (and common source code
>> we have to maintain, I agree as well) in .h source files than in the
>> boards.cfg file.
>
> Oops. Common _source_ code in ".h source files" ?
>
> Please don't. Header files are NOT intended for any real source code
> (with th exception of some usually smallish inline fnctions and such).
>
Well, the _source_ code expression is a language abuse in this case.
There is no real source code in these files, only some defines, and I
have even reduced the number of them in the last iteration of the patch
series.
Best Regards
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
` (5 preceding siblings ...)
2011-05-03 14:13 ` [U-Boot] [PATCH v2 6/8] arm/km: rename mgcoge2un to mgcoge3un Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
2011-05-04 6:58 ` Prafulla Wadaskar
2011-05-03 14:13 ` [U-Boot] [PATCH v2 8/8] arm/km: update mgcoge3un board support Valentin Longchamp
7 siblings, 1 reply; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
From: Holger Brunck <holger.brunck@keymile.com>
The reason we need this is that we have the gig port on mgcoge3un
connected using a back-to-back pair of PHYs. There are no magnetics and
because of that the port has to be run with a fixd configuration and
auto-negotiation must be disabled. In the default mode the egiga driver
uses autoneg to determine port speed - which defaults to 1G (we need
100M full duplex).
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
drivers/net/mvgbe.h | 2 ++
include/configs/mgcoge3un.h | 25 +++++++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h
index 3de98d0..d8a5429 100644
--- a/drivers/net/mvgbe.h
+++ b/drivers/net/mvgbe.h
@@ -84,6 +84,7 @@
MVGBE_TX_BURST_SIZE_16_64BIT)
/* Default port serial control value */
+#ifndef PORT_SERIAL_CONTROL_VALUE
#define PORT_SERIAL_CONTROL_VALUE ( \
MVGBE_FORCE_LINK_PASS | \
MVGBE_DIS_AUTO_NEG_FOR_DUPLX | \
@@ -101,6 +102,7 @@
MVGBE_CLR_EXT_LOOPBACK | \
MVGBE_SET_FULL_DUPLEX_MODE | \
MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX)
+#endif
/* Tx WRR confoguration macros */
#define PORT_MAX_TRAN_UNIT 0x24 /* MTU register (default) 9KByte */
diff --git a/include/configs/mgcoge3un.h b/include/configs/mgcoge3un.h
index 0d19da4..6ddddf8 100644
--- a/include/configs/mgcoge3un.h
+++ b/include/configs/mgcoge3un.h
@@ -48,6 +48,31 @@
#define KM_ENV_BUS "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
/*
+ * mgcoge3un has a fixed link to the marvell switch
+ * with 100MB full duplex and autoneg off, for this
+ * reason we have to change the default settings
+ */
+#define PORT_SERIAL_CONTROL_VALUE ( \
+ MVGBE_FORCE_LINK_PASS | \
+ MVGBE_DIS_AUTO_NEG_FOR_DUPLX | \
+ MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL | \
+ MVGBE_ADV_NO_FLOW_CTRL | \
+ MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
+ MVGBE_FORCE_BP_MODE_NO_JAM | \
+ (1 << 9) /* Reserved bit has to be 1 */ | \
+ MVGBE_DO_NOT_FORCE_LINK_FAIL | \
+ MVGBE_DIS_AUTO_NEG_SPEED_GMII | \
+ MVGBE_DTE_ADV_0 | \
+ MVGBE_MIIPHY_MAC_MODE | \
+ MVGBE_AUTO_NEG_NO_CHANGE | \
+ MVGBE_MAX_RX_PACKET_1552BYTE | \
+ MVGBE_CLR_EXT_LOOPBACK | \
+ MVGBE_SET_FULL_DUPLEX_MODE | \
+ MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX |\
+ MVGBE_SET_GMII_SPEED_TO_10_100 |\
+ MVGBE_SET_MII_SPEED_TO_100)
+
+/*
* Default environment variables
*/
#define CONFIG_EXTRA_ENV_SETTINGS \
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread* [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un
2011-05-03 14:13 ` [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un Valentin Longchamp
@ 2011-05-04 6:58 ` Prafulla Wadaskar
2011-05-04 8:08 ` Valentin Longchamp
2011-05-04 22:15 ` Wolfgang Denk
0 siblings, 2 replies; 23+ messages in thread
From: Prafulla Wadaskar @ 2011-05-04 6:58 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
> Sent: Tuesday, May 03, 2011 7:43 PM
> To: u-boot at lists.denx.de
> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
> Wolfgang Denk; Detlev Zundel
> Subject: [PATCH v2 7/8] arm/km: change default settings for egiga on
> mgcoge3un
>
> From: Holger Brunck <holger.brunck@keymile.com>
>
> The reason we need this is that we have the gig port on mgcoge3un
> connected using a back-to-back pair of PHYs. There are no magnetics and
> because of that the port has to be run with a fixd configuration and
> auto-negotiation must be disabled. In the default mode the egiga driver
> uses autoneg to determine port speed - which defaults to 1G (we need
> 100M full duplex).
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Detlev Zundel <dzu@denx.de>
> ---
> Changes for v2:
> - split up first large patch series to three independent smaller
> patch series
>
> drivers/net/mvgbe.h | 2 ++
> include/configs/mgcoge3un.h | 25 +++++++++++++++++++++++++
It will be good if you split this patch, the mvgbe.h change would be generic, independent and can be merged faster.
mgcoge3un.h changes would be part of your new board config.
Regards..
Prafulla ..
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un
2011-05-04 6:58 ` Prafulla Wadaskar
@ 2011-05-04 8:08 ` Valentin Longchamp
2011-05-04 22:15 ` Wolfgang Denk
1 sibling, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-04 8:08 UTC (permalink / raw)
To: u-boot
Prafulla Wadaskar wrote:
>
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
>> Sent: Tuesday, May 03, 2011 7:43 PM
>> To: u-boot at lists.denx.de
>> Cc: Prafulla Wadaskar; holger.brunck at keymile.com; Valentin Longchamp;
>> Wolfgang Denk; Detlev Zundel
>> Subject: [PATCH v2 7/8] arm/km: change default settings for egiga on
>> mgcoge3un
>>
>> From: Holger Brunck <holger.brunck@keymile.com>
>>
>> The reason we need this is that we have the gig port on mgcoge3un
>> connected using a back-to-back pair of PHYs. There are no magnetics and
>> because of that the port has to be run with a fixd configuration and
>> auto-negotiation must be disabled. In the default mode the egiga driver
>> uses autoneg to determine port speed - which defaults to 1G (we need
>> 100M full duplex).
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> ---
>> Changes for v2:
>> - split up first large patch series to three independent smaller
>> patch series
>>
>> drivers/net/mvgbe.h | 2 ++
>> include/configs/mgcoge3un.h | 25 +++++++++++++++++++++++++
>
> It will be good if you split this patch, the mvgbe.h change would be generic, independent and can be merged faster.
>
> mgcoge3un.h changes would be part of your new board config.
>
Ok, I agree, I will split them.
Regards
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un
2011-05-04 6:58 ` Prafulla Wadaskar
2011-05-04 8:08 ` Valentin Longchamp
@ 2011-05-04 22:15 ` Wolfgang Denk
1 sibling, 0 replies; 23+ messages in thread
From: Wolfgang Denk @ 2011-05-04 22:15 UTC (permalink / raw)
To: u-boot
Dear Prafulla Wadaskar,
In message <F766E4F80769BD478052FB6533FA745D19FAC25C77@SC-VEXCH4.marvell.com> you wrote:
>
> It will be good if you split this patch, the mvgbe.h change would be generi=
> c, independent and can be merged faster.
>
> mgcoge3un.h changes would be part of your new board config.
When requesting changes like here, could you (and all other
custodians!) please update the patch state (to "Changes Requested") in
PatchWork?
Thanks!
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
Where people stand is not as important as which way they face.
- Terry Pratchett & Stephen Briggs, _The Discworld Companion_
^ permalink raw reply [flat|nested] 23+ messages in thread
* [U-Boot] [PATCH v2 8/8] arm/km: update mgcoge3un board support
2011-05-03 14:13 [U-Boot] [PATCH v2 0/8] keymile arm boards update, part 2 Valentin Longchamp
` (6 preceding siblings ...)
2011-05-03 14:13 ` [U-Boot] [PATCH v2 7/8] arm/km: change default settings for egiga on mgcoge3un Valentin Longchamp
@ 2011-05-03 14:13 ` Valentin Longchamp
7 siblings, 0 replies; 23+ messages in thread
From: Valentin Longchamp @ 2011-05-03 14:13 UTC (permalink / raw)
To: u-boot
From: Holger Brunck <holger.brunck@keymile.com>
Add wait for the GPIO line connected to mgcoge3ne before
starting mgcoge3un. A board specific ethernet present function
was added, because on this board ethernet is always present.
The BOCO FPGA access was enhanced and changed to use register
definitions.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
- split up first large patch series to three independent smaller
patch series
board/keymile/km_arm/km_arm.c | 80 +++++++++++++++++++++++++++++++++-------
1 files changed, 66 insertions(+), 14 deletions(-)
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 4049a4e..d86acc9 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -41,6 +41,16 @@
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * BOCO FPGA definitions
+ */
+#define BOCO 0x10
+#define REG_CTRL_H 0x02
+#define MASK_WRL_UNITRUN 0x01
+#define MASK_RBX_PGY_PRESENT 0x40
+#define REG_IRQ_CIRQ2 0x2d
+#define MASK_RBI_DEFECT_16 0x01
+
/* Multi-Purpose Pins Functionality configuration */
u32 kwmpp_config[] = {
MPP0_NF_IO2,
@@ -102,43 +112,64 @@ u32 kwmpp_config[] = {
0
};
+#if defined(CONFIG_MGCOGE3UN)
+/*
+ * Wait for startup OK from mgcoge3ne
+ */
+int startup_allowed(void)
+{
+ unsigned char buf;
+
+ /*
+ * Read CIRQ16 bit (bit 0)
+ */
+ if (i2c_read(BOCO, REG_IRQ_CIRQ2, 1, &buf, 1) != 0)
+ printf("%s: Error reading Boco\n", __func__);
+ else
+ if ((buf & MASK_RBI_DEFECT_16) == MASK_RBI_DEFECT_16)
+ return 1;
+ return 0;
+}
+
+/*
+ * mgcoge3un has always ethernet present. Its connected to the 6061 switch
+ * and provides ICNev and piggy4 connections.
+ */
+int ethernet_present(void)
+{
+ return 1;
+}
+#else
int ethernet_present(void)
{
uchar buf;
int ret = 0;
- if (i2c_read(0x10, 2, 1, &buf, 1) != 0) {
+ if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
printf("%s: Error reading Boco\n", __func__);
return -1;
}
- if ((buf & 0x40) == 0x40)
+ if ((buf & MASK_RBX_PGY_PRESENT) == MASK_RBX_PGY_PRESENT)
ret = 1;
return ret;
}
+#endif
int initialize_unit_leds(void)
{
/*
- * init the unit LEDs
- * per default they all are
+ * Init the unit LEDs per default they all are
* ok apart from bootstat
- * LED connected through BOCO
- * BOCO lies at the address 0x10
- * LEDs are in the block CTRL_H (addr 0x02)
- * BOOTSTAT LED is the first 0x01
*/
- #define BOCO 0x10
- #define CTRL_H 0x02
- #define APPLEDMASK 0x01
uchar buf;
- if (i2c_read(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+ if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
printf("%s: Error reading Boco\n", __func__);
return -1;
}
- buf |= APPLEDMASK;
- if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+ buf |= MASK_WRL_UNITRUN;
+ if (i2c_write(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
printf("%s: Error writing Boco\n", __func__);
return -1;
}
@@ -167,6 +198,27 @@ int misc_init_r(void)
printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
gd->bd->bi_arch_number = mach_type;
}
+#if defined(CONFIG_MGCOGE3UN)
+ char *wait_for_ne;
+ wait_for_ne = getenv("waitforne");
+ if (wait_for_ne != NULL) {
+ if (strcmp(wait_for_ne, "true") == 0) {
+ int cnt = 0;
+ puts("NE go: ");
+ while (startup_allowed() == 0) {
+ udelay(200000);
+ cnt++;
+ if (cnt == 5)
+ puts("wait\b\b\b\b");
+ if (cnt == 10) {
+ cnt = 0;
+ puts(" \b\b\b\b");
+ }
+ }
+ puts("OK\n");
+ }
+ }
+#endif
initialize_unit_leds();
set_km_env();
--
1.7.0.5
^ permalink raw reply related [flat|nested] 23+ messages in thread