Re: [U-Boot] [PATCH 1/1] ppc4xx: add support for alternate format for ndfc

2010-02-19 Thread Wolfgang Denk
Dear Feng Kan,

In message 4b7dd691.8070...@amcc.com you wrote:
 
 The problem goes back a bit. The ordering you see in the ndfc file has been 
 changed a
 few times, back and forth and cause quite a bit of problem. The define we 
 speak of is
 in the driver/mtd/nand/nand_ecc.c file. The nand_correct_data function uses 
 two ways

Right,  CONFIG_MTD_NAND_ECC_SMC is only ever defined and used in
driver/mtd/nand/nand_ecc.c, but your patch modifies
drivers/mtd/nand/ndfc.c, i. e. a different file - so this #define will
never be seen there.

Either the code needs to be permanently changed, then we don't need
the #ifdef stuff, or it depends on some conditions, then it's unclear
what these might be.

In any case a clear description of the problem you are trying to fix
is needed, and an explanation how your change is supposed to fix this
problem.

Please provide a specific test case that can be used to 1) see the
problem in the unchanged code and 2) verify that it's working after
applying your suggested changes.

 of check ECC correctness. However the ndfc calculate only supports one 
 ordering, although
 both placement method in the patch would work. It also serves to nail down 
 the ordering
 depending on the define is used or not.

I don;t understand what you mean here. Sorry, but I'm afraid you have
to provide a bit more context.

 There is also the following in the code, should you agree, this will also 
 need to be removed
 as well.
 
 /* The PPC4xx NDFC uses Smart Media (SMC) bytes order */
 #ifdef CONFIG_NAND_NDFC
 #define CONFIG_MTD_NAND_ECC_SMC
 #endif

This is in another file (driver/mtd/nand/nand_ecc.c) which is not
touched by your patch. If you think this file needs to be changed as
well, then this change should be part of your patch.  Obviously, the
reason for the need to change has to be explained here as well.

Thanks.

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: w...@denx.de
I say we take off; nuke the site from orbit. It's the only way to be
sure.  - Corporal Hicks, in Aliens
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] extracting u-boot version from Linux

2010-02-19 Thread Wolfgang Denk
Dear Parks, Derek,

In message 
821b2170e9e7f04fa38df7ec21de487119ef6...@vcaexch01.hq.corp.viasat.com you 
wrote:

 I have an c++ application that needs to display various versions of
 system components; u-boot, kernel, O/S flavor, hardware and software
 versions.  I'm struggling with getting the u-boot version and ask for
 your help.  My ideal situation is to have U-boot report (somehow) to
 Linux it's version number and have Linux store it in environment
 variables.  Any thoughts?

When CONFIG_VERSION_VARIABLE is set in your board config file, then
U-Boot will set the ver envrionment variable to the current version
ID string. If you run saveenv at least once, then you can read this
string from the U-Boot environment under Linux, using the fw_getenv
tool / function provided in tools/env/ .

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: w...@denx.de
Everyting looks interesting until you do it. Then you find it's  just
another job. - Terry Pratchett, _Moving Pictures_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3 v3] S5PC100: Memory SubSystem Header file, register description(SROMC).

2010-02-19 Thread ch . naveen
From: Naveen Krishna CH ch.nav...@samsung.com

Memory subsystem of S5PC100 handles SROM, SRAM, OneDRAM, OneNand,
NAND Flash, DDRs.
mem.h is a common place for the register description of Memory subsystem
of S5PC100.
Note: Only SROM related registers are descibed now.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
---
Changes since V1:

1. The header file is renamed to smc.h from mem.h

2. The Macros are renamed according to TRM.
Comments from Minkyu kang are fixed.

Changes since V2:

1. Macros have been modified to be generic.
Comments from Minkyu kang are fixed

 include/asm-arm/arch-s5pc1xx/smc.h |   50 
 1 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-arm/arch-s5pc1xx/smc.h

diff --git a/include/asm-arm/arch-s5pc1xx/smc.h 
b/include/asm-arm/arch-s5pc1xx/smc.h
new file mode 100644
index 000..e1a5399
--- /dev/null
+++ b/include/asm-arm/arch-s5pc1xx/smc.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2010 Samsung Electronics
+ * Naveen Krishna Ch ch.nav...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Note: This file contains the register description for Memory subsystem
+ *  (SROM, NAND Flash, OneNand, DDR, OneDRAM) on S5PC1XX.
+ *
+ *  Only SROMC is defined as of now
+ */
+
+#ifndef __ASM_ARCH_SMC_H_
+#define __ASM_ARCH_SMC_H_
+
+#define SMC_DATA16_WIDTH(x)(1((x*4)+0))
+#define SMC_BYTE_ADDR_MODE(x)  (1((x*4)+1))  /* 0- Half-word base address*/
+   /* 1- Byte base address*/
+#define SMC_WAIT_ENABLE(x) (1((x*4)+2))
+#define SMC_BYTE_ENABLE(x) (1((x*4)+3))
+
+#define SMC_BC_TACS(x) (x  28) /* 0clk address set-up */
+#define SMC_BC_TCOS(x) (x  24) /* 4clk chip selection set-up */
+#define SMC_BC_TACC(x) (x  16) /* 14clkaccess cycle */
+#define SMC_BC_TCOH(x) (x  12) /* 1clk chip selection hold */
+#define SMC_BC_TAH(x)  (x  8)  /* 4clk address holding time */
+#define SMC_BC_TACP(x) (x  4)  /* 6clk page mode access cycle */
+#define SMC_BC_PMC(x)  (x  0)  /* normal(1data)page mode configuration */
+
+#ifndef __ASSEMBLY__
+struct s5pc1xx_smc {
+   unsigned intbw;
+   unsigned intbc[6];
+};
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARCH_SMC_H_ */
-- 
1.6.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3 v3] S5PC100: Function to configure the SROMC registers.

2010-02-19 Thread ch . naveen
From: Naveen Krishna CH ch.nav...@samsung.com

Nand Flash, Ethernet, other features might need to configure the
SROMC registers accordingly.
The config_sromc() functions helps with this.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
---
Changes since V1:

1. Funtion config_sromc() is renamed to s5pc1xx_config_sromc().
Comments from Minkyu Kang are fixed

Changes since V2:

1.cpu_is_s5pc100() function is used instead of Macros.

 cpu/arm_cortexa8/s5pc1xx/Makefile  |1 +
 cpu/arm_cortexa8/s5pc1xx/sromc.c   |   53 
 include/asm-arm/arch-s5pc1xx/smc.h |3 ++
 3 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm_cortexa8/s5pc1xx/sromc.c

diff --git a/cpu/arm_cortexa8/s5pc1xx/Makefile 
b/cpu/arm_cortexa8/s5pc1xx/Makefile
index 4f922e6..0a6a9b4 100644
--- a/cpu/arm_cortexa8/s5pc1xx/Makefile
+++ b/cpu/arm_cortexa8/s5pc1xx/Makefile
@@ -34,6 +34,7 @@ SOBJS += reset.o
 COBJS  += clock.o
 COBJS  += cpu_info.o
 COBJS  += timer.o
+COBJS  += sromc.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/cpu/arm_cortexa8/s5pc1xx/sromc.c b/cpu/arm_cortexa8/s5pc1xx/sromc.c
new file mode 100644
index 000..7630367
--- /dev/null
+++ b/cpu/arm_cortexa8/s5pc1xx/sromc.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Samsung Electronics
+ * Naveen Krishna Ch ch.nav...@samsung.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/arch/smc.h
+
+/*
+ * s5pc1xx_config_sromc() - select the proper SROMC Bank and configure the
+ * band width control and bank control registers
+ * srom_bank   - SROM Bank 0 to 5
+ * smc_bw_conf  - SMC Band witdh reg configuration value
+ * smc_bc_conf  - SMC Bank Control reg configuration value
+ */
+void s5pc1xx_config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf)
+{
+   u32 tmp;
+   struct s5pc1xx_smc *srom;
+
+   if (cpu_is_s5pc100())
+   srom = (struct s5pc1xx_smc *)S5PC100_SROMC_BASE;
+   else
+   srom = (struct s5pc1xx_smc *)S5PC110_SROMC_BASE;
+
+   /* Configure SMC_BW register to handle proper SROMC bank */
+   tmp = srom-bw;
+   tmp = ~(0xF  (srom_bank * 4));
+   tmp |= smc_bw_conf;
+   srom-bw = tmp;
+
+   /* Configure SMC_BC register */
+   srom-bc[srom_bank] = smc_bc_conf;
+}
diff --git a/include/asm-arm/arch-s5pc1xx/smc.h 
b/include/asm-arm/arch-s5pc1xx/smc.h
index e1a5399..88f4ffe 100644
--- a/include/asm-arm/arch-s5pc1xx/smc.h
+++ b/include/asm-arm/arch-s5pc1xx/smc.h
@@ -47,4 +47,7 @@ struct s5pc1xx_smc {
 };
 #endif /* __ASSEMBLY__ */
 
+/* Configure the Band Width and Bank Control Regs for required SROMC Bank */
+void s5pc1xx_config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf);
+
 #endif /* __ASM_ARCH_SMC_H_ */
-- 
1.6.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3 v3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-19 Thread ch . naveen
From: Naveen Krishna CH ch.nav...@samsung.com

Add setup for ethernet on SMDKC100, allowing kernel/ramdisk to be
loaded over tftp.

The preinit function will configure GPIO (GPK0CON)  SROMC to look
for environment in SROM Bank 3.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
---
Changes since V1:

1. The CONFIG_BOOTP* and Net config Macros are removed from config header.
Comments from Ben Warren are fixed
2. The GPIO configuration is modified  Macro and Function are renamed.
Comments from Minkyu Kang are fixedChanges since V2

Changes since V2:
1. GPIO configurations function has been implemented.

 board/samsung/smdkc100/smdkc100.c |   39 +
 include/configs/smdkc100.h|   13 +++-
 2 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/board/samsung/smdkc100/smdkc100.c 
b/board/samsung/smdkc100/smdkc100.c
index 15a1a27..946f7af 100644
--- a/board/samsung/smdkc100/smdkc100.c
+++ b/board/samsung/smdkc100/smdkc100.c
@@ -23,10 +23,40 @@
  */
 
 #include common.h
+#include asm/io.h
+#include asm/arch/smc.h
+#include asm/arch/gpio.h
+
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Miscellaneous platform dependent initialisations
+ */
+static void smc9115_pre_init(void)
+{
+   u32 tmp;
+   u32 smc_bw_conf, smc_bc_conf;
+
+   struct s5pc100_gpio *const gpio =
+   (struct s5pc100_gpio *)S5PC100_GPIO_BASE;
+
+   /* gpio configuration GPK0CON */
+   gpio_cfg_pin(gpio-gpio_k0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
+
+   /* Ethernet needs bus width of 16 bits */
+   smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
+   smc_bc_conf = SMC_BC_TACS(0x0) | SMC_BC_TCOS(0x4) | SMC_BC_TACC(0xe) \
+   | SMC_BC_TCOH(0x1) | SMC_BC_TAH(0x4)
+   | SMC_BC_TACP(0x6) | SMC_BC_PMC(0x0);
+
+   /* Select and configure the SROMC bank */
+   s5pc1xx_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
+}
+
 int board_init(void)
 {
+   smc9115_pre_init();
+
gd-bd-bi_arch_number = MACH_TYPE_SMDKC100;
gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
@@ -49,3 +79,12 @@ int checkboard(void)
return 0;
 }
 #endif
+
+int board_eth_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_SMC911X
+   rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+   return rc;
+}
diff --git a/include/configs/smdkc100.h b/include/configs/smdkc100.h
index f12fea3..22e8e95 100644
--- a/include/configs/smdkc100.h
+++ b/include/configs/smdkc100.h
@@ -83,7 +83,7 @@
 #undef CONFIG_CMD_FLASH
 #undef CONFIG_CMD_IMLS
 #undef CONFIG_CMD_NAND
-#undef CONFIG_CMD_NET
+#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
 
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_REGINFO
@@ -235,4 +235,15 @@
 
 #define CONFIG_DOS_PARTITION   1
 
+/*
+ * Ethernet Contoller driver
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X 1   /* we have a SMC9115 on-board   */
+#define CONFIG_SMC911X_16_BIT  1   /* SMC911X_16_BIT Mode  */
+#define CONFIG_SMC911X_BASE0x98800300  /* SMC911X Drive Base   */
+#define CONFIG_ENV_SROM_BANK   3   /* Select SROM Bank-3 for Ethernet*/
+#endif /* CONFIG_CMD_NET */
+
 #endif /* __CONFIG_H */
-- 
1.6.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Wolfgang Denk
Dear Nikumbh, Raj (IE10),

In message 
047570340a9b314187387acc723459acae0...@ie10ev811.global.ds.honeywell.com you 
wrote:
 
 I want to use the u-boot-1.3.4 with the patch from AT91 for my custom
 board based on AT91RM9200 with 32MB SDRAM (MT48LC8M16A2) and 8MB flash
 (AT49BV6416-70TI). I am directly flashing the image to flash location at
 0x1000 (beginning of the flash). But I am not able to see anything
 on my debug port.

 I  want to know if I am doing something wrong.

We don't know your hardware or the changes you might have made to the
code to adapt it for your hardware.

Also, U-Boot 1.3.4 is very old.

Please update to a current version (top of tree recommended) and try
again.

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: w...@denx.de
I am an atheist, thank God!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Nikumbh, Raj (IE10)
I am using JTAG port with SAM-ICE.

 

Regards

Raj Nikumbh   

 



From: Drasko DRASKOVIC [mailto:drasko.drasko...@gmail.com] 
Sent: Friday, February 19, 2010 5:41 PM
To: Nikumbh, Raj (IE10)
Cc: u-boot@lists.denx.de
Subject: Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

 

 

On Fri, Feb 19, 2010 at 11:30 AM, Nikumbh, Raj (IE10)
raj.niku...@honeywell.com wrote:



I want to use the u-boot-1.3.4 with the patch from AT91 for my custom
board based on AT91RM9200 with 32MB SDRAM (MT48LC8M16A2) and 8MB flash
(AT49BV6416-70TI). I am directly flashing the image to flash location at
0x1000 (beginning of the flash). But I am not able to see anything
on my debug port.


Which debug port?

 

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Drasko DRASKOVIC
On Fri, Feb 19, 2010 at 11:30 AM, Nikumbh, Raj (IE10) 
raj.niku...@honeywell.com wrote:



 I want to use the u-boot-1.3.4 with the patch from AT91 for my custom
 board based on AT91RM9200 with 32MB SDRAM (MT48LC8M16A2) and 8MB flash
 (AT49BV6416-70TI). I am directly flashing the image to flash location at
 0x1000 (beginning of the flash). But I am not able to see anything
 on my debug port.


Which debug port?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Drasko DRASKOVIC
On Fri, Feb 19, 2010 at 1:16 PM, Nikumbh, Raj (IE10) 
raj.niku...@honeywell.com wrote:

  I am using JTAG port with SAM-ICE.

Can't you stop your uC at reset addr and step to see if you go to _start or
hit some exception?
I guess you connect GDB to JTAG via monitor and disassemble what you have
burned at 0x0 , then compare to startup.S of U-Boot?
Also, check if your flashing went well by fumping flash image.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] small but important doc patch

2010-02-19 Thread Frans Meulenbroeks
Dear all,

Attached a patch for doc/README.mpc8536ds.
This patch corrects small mistake in the register list.
These registers are 32 bits and this one starts at c not e

When using the ...c address I can boot from sd, when using the ...e
address I cannot.

*** README.mpc8536ds.orig   2010-02-18 15:29:07.0 +0100
--- README.mpc8536ds2010-02-19 11:25:22.0 +0100
***
*** 98,104 
| 0x90-0x93 | 0xFF72 | Config Addr 3   |
| 0x94-0x97 | 0x8001 | Config Data 3   |

!   | 0x98-0x9b | 0xFF72e40e | Config Addr 4   |
| 0x9c-0x9f | 0x0040 | Config Data 4   |

| 0xa0-0xa3 | 0x4001 | Config Addr 5   |
--- 98,104 
| 0x90-0x93 | 0xFF72 | Config Addr 3   |
| 0x94-0x97 | 0x8001 | Config Data 3   |

!   | 0x98-0x9b | 0xFF72e40c | Config Addr 4   |
| 0x9c-0x9f | 0x0040 | Config Data 4   |

| 0xa0-0xa3 | 0x4001 | Config Addr 5   |

Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Maxim Podbereznyi
Did you pull BMS pin to GND? Do you mean DBGU pins by debug port?

2010/2/19 Nikumbh, Raj (IE10) raj.niku...@honeywell.com



 I want to use the u-boot-1.3.4 with the patch from AT91 for my custom
 board based on AT91RM9200 with 32MB SDRAM (MT48LC8M16A2) and 8MB flash
 (AT49BV6416-70TI). I am directly flashing the image to flash location at
 0x1000 (beginning of the flash). But I am not able to see anything
 on my debug port.



 I  want to know if I am doing something wrong.


 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Nikumbh, Raj (IE10)
Yeah I did pull it down at the startup. And I meant the same DBGU pins.

 

Regards

Raj Nikumbh   

 



From: Maxim Podbereznyi [mailto:lisar...@gmail.com] 
Sent: Friday, February 19, 2010 7:41 PM
To: Nikumbh, Raj (IE10)
Cc: u-boot@lists.denx.de
Subject: Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

 

Did you pull BMS pin to GND? Do you mean DBGU pins by debug port?

2010/2/19 Nikumbh, Raj (IE10) raj.niku...@honeywell.com



I want to use the u-boot-1.3.4 with the patch from AT91 for my custom
board based on AT91RM9200 with 32MB SDRAM (MT48LC8M16A2) and 8MB flash
(AT49BV6416-70TI). I am directly flashing the image to flash location at
0x1000 (beginning of the flash). But I am not able to see anything
on my debug port.



I  want to know if I am doing something wrong.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

 

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] added i2c read function

2010-02-19 Thread Frans Meulenbroeks
Dear all,

The patch below adds a command i2c read which reads from i2c to memory.

That way the value read can be used in later itest commands to control
the boot process.

I've tried to stay as close as possible to the i2c md command as far
as command syntax concerns.
main differences wrt the command syntax:

- length is mandatory
- additional argument memaddr
- no repeat possibility (it didn't seem too useful to me and only uses bytes)

While doing so I also have expanded the subcommand names to their full
length instead of going to two character abbreviations
(otherwise read and reset would clash). I saw other places also use
longer commands.

(actually personally I would have used strcmp instead of strncmp, but
it seems most other files in common use strncmp, so I left that part
as is).

Feel free to comment.

Frans

PS: unfortunately git send-email does not pass our corp firewall and
doing the patch as attachement is rejected by the mailing list.
If there are problems with the patch, just drop me a note and I'll
resend from home.

Frans.

From 389fa8835e397c35058a17991b380ae20b6915d1 Mon Sep 17 00:00:00 2001
From:Frans Meulenbroeks fransmeulenbro...@gmail.com
Date: Fri, 19 Feb 2010 13:39:21 +0100
Subject: [PATCH] cmd_i2c.c: added command to read to memory

Added a new function i2c read to read to memory.
That way it becomes possible to test against a value and
use that to influence the boot process.

Design decision was to stay close to the i2c md command with
respect to command syntax.

Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com
---
 common/cmd_i2c.c |   76 -
 1 files changed, 68 insertions(+), 8 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 62cbd33..0100aa9 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -150,6 +150,64 @@ int i2c_set_bus_speed(unsigned int)

 /*
  * Syntax:
+ * i2c read {i2c_chip} {devaddr}{.0, .1, .2} {len} {memaddr}
+ */
+
+int do_i2c_read ( cmd_tbl_t *cmdtp, int argc, char *argv[])
+{
+   u_char  chip;
+   uintdevaddr, alen, length;
+   u_char  *memaddr;
+   int j;
+
+   if (argc != 5) {
+   cmd_usage(cmdtp);
+   return 1;
+   }
+
+   /*
+* I2C chip address
+*/
+   chip = simple_strtoul(argv[1], NULL, 16);
+
+   /*
+* I2C data address within the chip.  This can be 1 or
+* 2 bytes long.  Some day it might be 3 bytes long :-).
+*/
+   devaddr = simple_strtoul(argv[2], NULL, 16);
+   alen = 1;
+   for (j = 0; j  8; j++) {
+   if (argv[2][j] == '.') {
+   alen = argv[2][j+1] - '0';
+   if (alen  4) {
+   cmd_usage(cmdtp);
+   return 1;
+   }
+   break;
+   } else if (argv[2][j] == '\0')
+   break;
+   }
+
+   /*
+* Length is the number of objects, not number of bytes.
+*/
+   length = simple_strtoul(argv[3], NULL, 16);
+
+   /*
+* memaddr is the address where to store things in memory
+*/
+   memaddr = (u_char *)simple_strtoul(argv[4], NULL, 16);
+
+   if (i2c_read(chip, devaddr, alen, memaddr, length) != 0)
+   {
+   puts (Error reading the chip.\n);
+   return 1;
+   }
+   return 0;
+}
+
+/*
+ * Syntax:
  * i2c md {i2c_chip} {addr}{.0, .1, .2} {len}
  */
 #define DISP_LINE_LEN  16
@@ -1249,15 +1306,17 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int
argc, char *argv[])
argv++;

 #if defined(CONFIG_I2C_MUX)
-   if (!strncmp(argv[0], bu, 2))
+   if (!strcmp(argv[0], bus, 3))
return do_i2c_add_bus(cmdtp, flag, argc, argv);
 #endif  /* CONFIG_I2C_MUX */
-   if (!strncmp(argv[0], sp, 2))
+   if (!strncmp(argv[0], speed, 5))
return do_i2c_bus_speed(cmdtp, flag, argc, argv);
 #if defined(CONFIG_I2C_MULTI_BUS)
-   if (!strncmp(argv[0], de, 2))
+   if (!strncmp(argv[0], dev, 3))
return do_i2c_bus_num(cmdtp, flag, argc, argv);
 #endif  /* CONFIG_I2C_MULTI_BUS */
+   if (!strncmp(argv[0], read, 4))
+   return do_i2c_read(cmdtp, argc, argv);
if (!strncmp(argv[0], md, 2))
return do_i2c_md(cmdtp, flag, argc, argv);
if (!strncmp(argv[0], mm, 2))
@@ -1266,18 +1325,18 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int
argc, char *argv[])
return do_i2c_mw(cmdtp, flag, argc, argv);
if (!strncmp(argv[0], nm, 2))
return mod_i2c_mem (cmdtp, 0, flag, argc, argv);
-   if (!strncmp(argv[0], cr, 2))
+   if (!strncmp(argv[0], crc, 3))
return do_i2c_crc(cmdtp, flag, argc, argv);
-   if (!strncmp(argv[0], pr, 2))
+   if (!strncmp(argv[0], probe, 5))
return do_i2c_probe(cmdtp, flag, argc, argv);
-   if 

[U-Boot] [PATCH] fix expression handling in itest

2010-02-19 Thread Frans Meulenbroeks
Dear all,

Attached is a patch for cmd_itest.c
This fixes data access for .b and .w
If there are issues applying the patch feel free to mail me and I will
resent from home.
And of course I am open to comments.

There is one note: the evalexp function returns a long.
For .b and .w access I choose to return an unsigned char resp unsigned
short casted to long.
It is my impression that would be desirable, but if not, feel free to change
(and it might also be desirable to change the long to unsigned long,
but as that ripples up to the caller, I decided not to touch that
part.

Best regards, Frans.

From 93143ca97f1cd10a7ddf04c15e2dc9e1b2f10317 Mon Sep 17 00:00:00 2001
From: Frans Meulenbroeks fransmeulenbro...@gmail.com
Date: Fri, 19 Feb 2010 14:50:53 +0100
Subject: [PATCH] cmd_itest.c: fix pointer dereferencing

fix pointer dereferencing
if the size is .b and .w an 8 or 16 bit access is done.

Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com
---
 common/cmd_itest.c |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/common/cmd_itest.c b/common/cmd_itest.c
index 5b301bf..d0ef747 100644
--- a/common/cmd_itest.c
+++ b/common/cmd_itest.c
@@ -66,17 +66,23 @@ op_tbl_t op_table [] = {

 static long evalexp(char *s, int w)
 {
-   long l, *p;
+   long l = 0; /* default return value */
+   long *p;

+   
/* if the parameter starts with a * then assume is a pointer to the
value we want */
if (s[0] == '*') {
p = (long *)simple_strtoul(s[1], NULL, 16);
-   l = *p;
+   switch (w) {
+   case 1: return((long)(*(unsigned char *)p));
+   case 2: return((long)(*(unsigned short *)p));
+   case 4: return(*p);
+   }
} else {
l = simple_strtoul(s, NULL, 16);
}
-
return (l  ((1  (w * 8)) - 1));
+
 }

 static char * evalstr(char *s)
-- 
1.5.4.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] small but important doc patch

2010-02-19 Thread Fleming Andy-AFLEMING

On Feb 19, 2010, at 4:59, Frans Meulenbroeks fransmeulenbro...@gmail.com 
  wrote:

 Dear all,

 Attached a patch for doc/README.mpc8536ds.
 This patch corrects small mistake in the register list.
 These registers are 32 bits and this one starts at c not e

 When using the ...c address I can boot from sd, when using the ...e
 address I cannot.

 *** README.mpc8536ds.orig2010-02-18 15:29:07.0 +0100
 --- README.mpc8536ds2010-02-19 11:25:22.0 +0100
 ***
 *** 98,104 
 | 0x90-0x93 | 0xFF72 | Config Addr 3   |
 | 0x94-0x97 | 0x8001 | Config Data 3   |
 
 !| 0x98-0x9b | 0xFF72e40e | Config Addr 4   |
 | 0x9c-0x9f | 0x0040 | Config Data 4   |


Please create patches using git, if possible.  At least use diff -u,  
so it can be applied as a patch


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] added i2c read function

2010-02-19 Thread Detlev Zundel
Hi Frans,

 The patch below adds a command i2c read which reads from i2c to memory.

Thanks for picking up the hint! ;)

 That way the value read can be used in later itest commands to control
 the boot process.

 I've tried to stay as close as possible to the i2c md command as far
 as command syntax concerns.
 main differences wrt the command syntax:

 - length is mandatory
 - additional argument memaddr
 - no repeat possibility (it didn't seem too useful to me and only uses bytes)

 While doing so I also have expanded the subcommand names to their full
 length instead of going to two character abbreviations
 (otherwise read and reset would clash). I saw other places also use
 longer commands.

 (actually personally I would have used strcmp instead of strncmp, but
 it seems most other files in common use strncmp, so I left that part
 as is).

Well actually if you _do_ touch this place, why not convert it to use
cmd_tbl which does all this handling for you?  For an example, look at
common/cmd_bootm.c around line 465.

 PS: unfortunately git send-email does not pass our corp firewall and
 doing the patch as attachement is rejected by the mailing list.
 If there are problems with the patch, just drop me a note and I'll
 resend from home.

Even after manually stripping the header and the introductory text, the
patch is damaged:

[...@pollux u-boot-testing (master)]$ git am ~/p01
Applying: cmd_i2c.c: added command to read to memory
fatal: corrupt patch at line 75
Patch failed at 0001 cmd_i2c.c: added command to read to memory
When you have resolved this problem run git am --resolved.
If you would prefer to skip this patch, instead run git am --skip.
To restore the original branch and stop patching run git am --abort.

Cheers
  Detlev

-- 
Programming X-Windows is like trying to find the square root of pi
using roman numerals.
  -- The UNIX Haters Handbook
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Taskit Portux920T port - Some issues

2010-02-19 Thread Detlev Zundel
Hi,

 Hi, we are Enrico  Luca.

Hi Enrico and Luca, welcome aboard!

 We have tried to port u-boot to a Portux920T MiniPC.
 It seems we are successful, in fact u-boot brings up the device with no
 error and can boot a linux kernel.
 Ethernet driver works, dhcp works and major problems are present.

Congratulations!  Do you realize that only yesterday there was another
posting of a port to this board?  In that other port NOR flash support
wasn't even tried ;)

 The only thing we can't get right is flash programming. We are trying to use
 CFI flash driver that shows evident timing issues, at least in our opinion.
 When running saveenv more than once we get the typical Flash not erased
 error, while running cp.b (for example) does not give us any problem.
 Running a bootm kerneladdr initaddr command it frequently gives us a No
 boot image - CRC error, but running it another time, without rebooting the
 machine, results in a successful boot.

So in essence you see read errors without any writing, correct?  In this
case I would not suspect the CFI driver at all, because it is not
involved, but rather point the finger to the RAM initialization.  Are
you 100% sure that this is correct?  Maybe compare with the other posted
port.

So in essence I suggest, you compare your work with the other work and
work out where to go from there.  You may even ask Achim Ehrlic
directly, after all he works at Taskit, so he may be able to help you
efficiently :)

[...]

 Thank you in advance for reading this mail

Thanks for improving U-Boot :)

Cheers
  Detlev

-- 
#!/usr/bin/perl
$c=print\\#\!\/usr\/bin\/perl\
\\\$c\=\.quotemeta\(\$c\)\.\;\\n\$c;\;
print#!/usr/bin/perl\n\$c=\.quotemeta($c).\;\n$c;;
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-19 Thread Philippe De Muyter
Hello

I have a problem : my (coldfire) linux kernel does not reuse the mac
addresses known by u-boot as ethaddr and eth1addr.

I have read doc/README.enetaddr, that states :

struct bd_info [...]
are temporary copies of the MAC address only for the
purpose of passing this information to an OS kernel we are about
to boot.

but I see no field in bd_info that could be set before booting linux.

I thought that the address of the environment zone could be given
to linux, but I do not see where either.

So what's the recommended/supported way to inform the kernel of the mac
addresses of all the ethernet interfaces ?

Philippe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] ppc4xx: add support for alternate format for ndfc

2010-02-19 Thread Feng Kan
Hi Stefan:

Agreed the ordering is working now. Previously the ordering is 213 and with
CONFIG_MTD_NAND_ECC_SMC defined, wrong ECC error bit position was calculated.
What about the boards that are now stuck on the 213 ordering. Also in linux,
the ordering is not fixed down as in u-boot. Hmm, perhaps that is another
approach to the problem. Fix the ordering in linux?

Feng

On 02/18/2010 11:57 PM, Stefan Roese wrote:
 Hi Feng,

 On Thursday 18 February 2010 23:25:13 f...@amcc.com wrote:
 From: Feng Kanf...@amcc.com

 This is to lock down the ordering in the correction routine against
 the calculate routine. Otherwise, incorrect define would cause ECC errors.

 It was my impression that we (finally) had done this ordering correct. The
 last changes were upon your request:

 68e74567cf317318df52dbcb2ac170ffc5e7758a:
  ppc4xx: Fix ECC Correction bug with SMC ordering for NDFC driver

 I don't see how this patch should fix a potential problem. Please explain
 which problem exactly is fixed with this change. As Wolfgang already
 mentioned, CONFIG_MTD_NAND_ECC_SMC will not be set in this file.

 Cheers,
 Stefan

 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] extracting u-boot version from Linux

2010-02-19 Thread Michael Zaidman
On Fri, Feb 19, 2010 at 10:50 AM, Wolfgang Denk w...@denx.de wrote:
 Dear Parks, Derek,

 In message 
 821b2170e9e7f04fa38df7ec21de487119ef6...@vcaexch01.hq.corp.viasat.com you 
 wrote:

 I have an c++ application that needs to display various versions of
 system components; u-boot, kernel, O/S flavor, hardware and software
 versions.  I'm struggling with getting the u-boot version and ask for
 your help.  My ideal situation is to have U-boot report (somehow) to
 Linux it's version number and have Linux store it in environment
 variables.  Any thoughts?

 When CONFIG_VERSION_VARIABLE is set in your board config file, then
 U-Boot will set the ver envrionment variable to the current version
 ID string. If you run saveenv at least once, then you can read this
 string from the U-Boot environment under Linux, using the fw_getenv
 tool / function provided in tools/env/ .


It is possible also to pass U-Boot version to Linux by adding it to
the bootargs as additional argument unrecognized by Linux.
Afterwards, it can be retrieved from /proc/cmdline.

Regards,
Michael
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AT91RM9200 boots from NOR Flash or not

2010-02-19 Thread Maxim Podbereznyi
OK, then can you explain what software do you flash? Does rm9200 u-boot
setup PLL? Because if it is not then you will never see anything at DBGU
pins. Another problem can be with your RC filters for PLL. Did you use the
same quartz as in the Atmel design? If not then you must calculate RC
filters and change them on your board.

BTW, if your SDRAM does not work then u-boot will never start :)

2010/2/19 Nikumbh, Raj (IE10) raj.niku...@honeywell.com

  Yeah I did pull it down at the startup. And I meant the same DBGU pins.



 *Regards*

 *Raj Nikumbh   *


   --

 *From:* Maxim Podbereznyi [mailto:lisar...@gmail.com]
 *Sent:* Friday, February 19, 2010 7:41 PM
 *To:* Nikumbh, Raj (IE10)
 *Cc:* u-boot@lists.denx.de
 *Subject:* Re: [U-Boot] AT91RM9200 boots from NOR Flash or not



 Did you pull BMS pin to GND? Do you mean DBGU pins by debug port?

 2010/2/19 Nikumbh, Raj (IE10) raj.niku...@honeywell.com



 I want to use the u-boot-1.3.4 with the patch from AT91 for my custom
 board based on AT91RM9200 with 32MB SDRAM (MT48LC8M16A2) and 8MB flash
 (AT49BV6416-70TI). I am directly flashing the image to flash location at
 0x1000 (beginning of the flash). But I am not able to see anything
 on my debug port.



 I  want to know if I am doing something wrong.


 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-19 Thread Maxim Podbereznyi
Hi Philippe!

May be it is a little bit tricky but you can just read the u-boot
environment from you Linux driver and use the ethaddr variable. I did the
same for osk5912

2010/2/19 Philippe De Muyter p...@macqel.be

 Hello

 I have a problem : my (coldfire) linux kernel does not reuse the mac
 addresses known by u-boot as ethaddr and eth1addr.

 I have read doc/README.enetaddr, that states :

struct bd_info [...]
are temporary copies of the MAC address only for the
purpose of passing this information to an OS kernel we are about
to boot.

 but I see no field in bd_info that could be set before booting linux.

 I thought that the address of the environment zone could be given
 to linux, but I do not see where either.

 So what's the recommended/supported way to inform the kernel of the mac
 addresses of all the ethernet interfaces ?

 Philippe
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot