Re: [U-Boot] [PATCH 6/8] arm, davinci, am1808: add lowlevel functions for booting from NOR

2011-09-30 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
> Heiko,
> 
> On Thu, Sep 15, 2011 at 7:59 AM, Heiko Schocher  wrote:
>> Signed-off-by: Heiko Schocher 
>> Cc: Paulraj Sandeep 
>> Cc: Albert ARIBAUD 
>> ---
>>  arch/arm/cpu/arm926ejs/davinci/Makefile|1 +
>>  arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c   |  428 
>> 
>>  .../arm/include/asm/arch-davinci/am1808_lowlevel.h |   44 ++
>>  3 files changed, 473 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c
>>  create mode 100644 arch/arm/include/asm/arch-davinci/am1808_lowlevel.h
>>
>> diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
>> b/arch/arm/cpu/arm926ejs/davinci/Makefile
>> index b38623a..0310957 100644
>> --- a/arch/arm/cpu/arm926ejs/davinci/Makefile
>> +++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
>> @@ -28,6 +28,7 @@ include $(TOPDIR)/config.mk
>>  LIB= $(obj)lib$(SOC).o
>>
>>  COBJS-y+= cpu.o timer.o psc.o
>> +COBJS-$(CONFIG_AM18018_LOWLEVEL)   += am1808_lowlevel.o
> 
> AM18018 - is this intended or just a typo?

Just a typo, thanks for detecting!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH] arm: provide a CONFIG flag for disabling relocation

2011-09-30 Thread Simon Schwarz
On 09/29/2011 06:14 PM, Andreas Bießmann wrote:
[SNIP]
> Simon, who has just finished his bachelor thesis did this test for me (thanks 
> to this way ...).
> It seems using more register for ldmia/stmia does _not_ improve the copy
> time that much. Simon measured 10.8 ms for r9-r10 and 10.65 ms for r3-r10 
> (unfortunately
> I do not know which system he tested, but I guess devkit8000).
>
> best regards
>
> Andreas Bießmann
>
>
Yes, devkit8000.

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


[U-Boot] [PATCHv8] new tool mkenvimage: generates an env image from an arbitrary config file

2011-09-30 Thread David Wagner
This tool takes a key=value configuration file (same as would a `printenv' show)
and generates the corresponding environment image, ready to be flashed.

use case: flash the environment with an external tool

Signed-off-by: David Wagner 
Acked-by; Mike Frysinger 
Tested-by: Thomas Petazzoni 
---

change since v7:

add a missing header (stdlib.h)

 tools/Makefile |5 +
 tools/mkenvimage.c |  271 
 2 files changed, 276 insertions(+), 0 deletions(-)
 create mode 100644 tools/mkenvimage.c

diff --git a/tools/Makefile b/tools/Makefile
index fc741d3..da7caf0 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -66,6 +66,7 @@ BIN_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX)
 BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
 BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
 BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
+BIN_FILES-y += mkenvimage$(SFX)
 BIN_FILES-y += mkimage$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
@@ -89,6 +90,7 @@ OBJ_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes.o
 NOPED_OBJ_FILES-y += kwbimage.o
 NOPED_OBJ_FILES-y += imximage.o
 NOPED_OBJ_FILES-y += omapimage.o
+NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
@@ -184,6 +186,9 @@ $(obj)xway-swap-bytes$(SFX):$(obj)xway-swap-bytes.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
$(HOSTSTRIP) $@
 
+$(obj)mkenvimage$(SFX):$(obj)crc32.o $(obj)mkenvimage.o
+   $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+
 $(obj)mkimage$(SFX):   $(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
new file mode 100644
index 000..ad2c8d3
--- /dev/null
+++ b/tools/mkenvimage.c
@@ -0,0 +1,271 @@
+/*
+ * (C) Copyright 2011 Free Electrons
+ * David Wagner 
+ *
+ * Inspired from envcrc.c:
+ * (C) Copyright 2001
+ * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arse...@tin.it
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define CRC_SIZE sizeof(uint32_t)
+
+static void usage(const char *exec_name)
+{
+   fprintf(stderr, "%s [-h] [-r] [-b] [-p ] "
+  "-s  -o  \n"
+  "\n"
+  "This tool takes a key=value input file (same as would a "
+  "`printenv' show) and generates the corresponding environment "
+  "image, ready to be flashed.\n"
+  "\n"
+  "\tThe input file is in format:\n"
+  "\t\tkey1=value1\n"
+  "\t\tkey2=value2\n"
+  "\t\t...\n"
+  "\t-r : the environment has multiple copies in flash\n"
+  "\t-b : the target is big endian (default is little endian)\n"
+  "\t-p  : fill the image with  bytes instead of "
+  "0xff bytes\n"
+  "\n"
+  "If the input file is \"-\", data is read from standard input\n",
+  exec_name);
+}
+
+int main(int argc, char **argv)
+{
+   uint32_t crc, targetendian_crc;
+   const char *txt_filename = NULL, *bin_filename = NULL;
+   int txt_fd, bin_fd;
+   unsigned char *dataptr, *envptr;
+   unsigned char *filebuf = NULL;
+   unsigned int filesize = 0, envsize = 0, datasize = 0;
+   int bigendian = 0;
+   int redundant = 0;
+   unsigned char padbyte = 0xff;
+
+   int option;
+   int ret = EXIT_SUCCESS;
+
+   struct stat txt_file_stat;
+
+   int fp, ep;
+
+   /* Parse the cmdline */
+   while ((option = getopt(argc, argv, "s:o:rbp:h")) != -1) {
+   switch (option) {
+   case 's':
+   datasize = strtol(optarg, NULL, 0);
+   break;
+   case 'o':
+   bin_filename = strdup(optarg);
+   if (!bin_filename) {
+   fprintf(stderr, "Can't strdup() the output "
+  

Re: [U-Boot] [Resend PATCH V3] mx31: provide readable WEIM CS accessor

2011-09-30 Thread Stefano Babic
On 09/29/2011 05:45 PM, Helmut Raiger wrote:
> setup_weimcs() and some macros are added to support the setup
> for i.MX31 WEIM chip selects. As a compromise between verbosity
> and readability an ASCII-art'ish bit comment is used instead of
> bitfields.
> All i.MX31 boards have been patched to use this approach using a
> helper program to verify the changes.
> 
> Signed-off-by: Helmut Raiger 
> ---
> V2:
>   added sys_proto.h for mx31
>   introduced mxc_setup_weimcs(), which is SOC independent
>   not inlined any more (codesize increased by 60-90 bytes)
> V3:
>   modified register access according to the coding style
> ---

Acked-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
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] [PATCH v2 8/8] arm, davinci: add support for am1808 based enbw_cmc board

2011-09-30 Thread Christian Riesch
Hello Heiko,

On Mon, Sep 19, 2011 at 7:50 AM, Heiko Schocher  wrote:
> - booting from NOR Flash with direct boot method
> - POST support
> - LOGBUF support
>
> Signed-off-by: Heiko Schocher 
> Cc: Paulraj Sandeep 
> Cc: Albert ARIBAUD 
> Cc: Igor Grinberg 
> ---
> - changes for v2
>  - use CONFIG_MACH_TYPE instead setting the MACH_TYPE in
>    board specific code, as Igor Grinberg suggested.
>  - add logversion=2 to default Environment
>
>  board/enbw/enbw_cmc/Makefile   |   51 
>  board/enbw/enbw_cmc/enbw_cmc.c |  570 
> 
>  boards.cfg                     |    1 +
>  include/configs/enbw_cmc.h     |  443 +++
>  4 files changed, 1065 insertions(+), 0 deletions(-)
>  create mode 100644 board/enbw/enbw_cmc/Makefile
>  create mode 100644 board/enbw/enbw_cmc/enbw_cmc.c
>  create mode 100644 include/configs/enbw_cmc.h

[...]

> diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
> new file mode 100644
> index 000..e203089
> --- /dev/null
> +++ b/include/configs/enbw_cmc.h

[...]

> +#define CONFIG_SYS_AM1808_PLL0_PLLM    37      /* PLL0 -> 456 MHz */

With a 24 MHz input frequency this would result in a PLL0 frequency of
24MHz / PREDIV * (CONFIG_SYS_AM1808_PLL0_PLLM + 1), so I guess you
assume a PREDIV of 2 here (PREDIV register value 0x8001). However,
the AM1808 datasheet and the reference guide (section 7.3.10) state
that the default PREDIV is 1 (register value 0x8000) and I don't
see how you set the PREDIV to 2. Am I missing something here?

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


Re: [U-Boot] [PATCH] cfi_flash driver: fixed addressing for 8-bit flash buses.

2011-09-30 Thread Stefan Roese
Aaron,

On Saturday 30 April 2011 21:14:49 Aaron Williams wrote:
> Will do. I've been quite busy lately bringing up a 32-core chip and
> getting ready for a release but I should have some time now.
> 
> I've got some other patches I also need to submit.

Is this patch still on your list for a re-spin? IIRC, it fixes a general 
problem with 8-bit devices. Or is it not needed any more?

Thanks,
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] [PATCH v2 8/8] arm, davinci: add support for am1808 based enbw_cmc board

2011-09-30 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
> Hello Heiko,
> 
> On Mon, Sep 19, 2011 at 7:50 AM, Heiko Schocher  wrote:
>> - booting from NOR Flash with direct boot method
>> - POST support
>> - LOGBUF support
>>
>> Signed-off-by: Heiko Schocher 
>> Cc: Paulraj Sandeep 
>> Cc: Albert ARIBAUD 
>> Cc: Igor Grinberg 
>> ---
>> - changes for v2
>>  - use CONFIG_MACH_TYPE instead setting the MACH_TYPE in
>>board specific code, as Igor Grinberg suggested.
>>  - add logversion=2 to default Environment
>>
>>  board/enbw/enbw_cmc/Makefile   |   51 
>>  board/enbw/enbw_cmc/enbw_cmc.c |  570 
>> 
>>  boards.cfg |1 +
>>  include/configs/enbw_cmc.h |  443 +++
>>  4 files changed, 1065 insertions(+), 0 deletions(-)
>>  create mode 100644 board/enbw/enbw_cmc/Makefile
>>  create mode 100644 board/enbw/enbw_cmc/enbw_cmc.c
>>  create mode 100644 include/configs/enbw_cmc.h
> 
> [...]
> 
>> diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
>> new file mode 100644
>> index 000..e203089
>> --- /dev/null
>> +++ b/include/configs/enbw_cmc.h
> 
> [...]
> 
>> +#define CONFIG_SYS_AM1808_PLL0_PLLM37  /* PLL0 -> 456 MHz */
> 
> With a 24 MHz input frequency this would result in a PLL0 frequency of
> 24MHz / PREDIV * (CONFIG_SYS_AM1808_PLL0_PLLM + 1), so I guess you
> assume a PREDIV of 2 here (PREDIV register value 0x8001). However,

No. The comment is wrong! I fix the comment from PLL0 to PLLC0
in the next patch version, thanks!

> the AM1808 datasheet and the reference guide (section 7.3.10) state
> that the default PREDIV is 1 (register value 0x8000) and I don't
> see how you set the PREDIV to 2. Am I missing something here?

For calculating the resulting frequencies for the used Sysclocks
don;t forget the POSTDIV value

#define CONFIG_SYS_AM1808_PLL0_POSTDIV  1

So the correct calculation is:

(24MHz / PREDIV * (CONFIG_SYS_AM1808_PLL0_PLLM + 1)) / POSTDIV

(And with that, I get 456 MHz ;-)

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 8/8] arm, davinci: add support for am1808 based enbw_cmc board

2011-09-30 Thread Christian Riesch
Hello Heiko,
thanks for your reply.

On Fri, Sep 30, 2011 at 10:46 AM, Heiko Schocher  wrote:
> Christian Riesch wrote:
>> On Mon, Sep 19, 2011 at 7:50 AM, Heiko Schocher  wrote:
>>> - booting from NOR Flash with direct boot method
>>> - POST support
>>> - LOGBUF support
>>>
>>> Signed-off-by: Heiko Schocher 
>>> Cc: Paulraj Sandeep 
>>> Cc: Albert ARIBAUD 
>>> Cc: Igor Grinberg 
>>> ---
>>> - changes for v2
>>>  - use CONFIG_MACH_TYPE instead setting the MACH_TYPE in
>>>    board specific code, as Igor Grinberg suggested.
>>>  - add logversion=2 to default Environment
>>>
>>>  board/enbw/enbw_cmc/Makefile   |   51 
>>>  board/enbw/enbw_cmc/enbw_cmc.c |  570 
>>> 
>>>  boards.cfg                     |    1 +
>>>  include/configs/enbw_cmc.h     |  443 +++
>>>  4 files changed, 1065 insertions(+), 0 deletions(-)
>>>  create mode 100644 board/enbw/enbw_cmc/Makefile
>>>  create mode 100644 board/enbw/enbw_cmc/enbw_cmc.c
>>>  create mode 100644 include/configs/enbw_cmc.h
>>
>> [...]
>>
>>> diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
>>> new file mode 100644
>>> index 000..e203089
>>> --- /dev/null
>>> +++ b/include/configs/enbw_cmc.h
>>
>> [...]
>>
>>> +#define CONFIG_SYS_AM1808_PLL0_PLLM    37      /* PLL0 -> 456 MHz */
>>
>> With a 24 MHz input frequency this would result in a PLL0 frequency of
>> 24MHz / PREDIV * (CONFIG_SYS_AM1808_PLL0_PLLM + 1), so I guess you
>> assume a PREDIV of 2 here (PREDIV register value 0x8001). However,
>
> No. The comment is wrong! I fix the comment from PLL0 to PLLC0
> in the next patch version, thanks!

Ok.

>> the AM1808 datasheet and the reference guide (section 7.3.10) state
>> that the default PREDIV is 1 (register value 0x8000) and I don't
>> see how you set the PREDIV to 2. Am I missing something here?
>
> For calculating the resulting frequencies for the used Sysclocks
> don;t forget the POSTDIV value
>
> #define CONFIG_SYS_AM1808_PLL0_POSTDIV  1
>
> So the correct calculation is:
>
> (24MHz / PREDIV * (CONFIG_SYS_AM1808_PLL0_PLLM + 1)) / POSTDIV
>
> (And with that, I get 456 MHz ;-)

But then you would be running PLL0 with 24MHz *
(CONFIG_SYS_AM1808_PLL0_PLLM + 1) = 912 MHz !? That would be out of
specs since the PLL output frequency must be between 300 and 600 MHz
according to the datasheet.

However, you can't set the PLLM to 37 anyway, since it's only a 5 bit
field, (37 & 0x1f) results in 5, so you only multiply the frequency by
6 in the PLL, resulting in 144MHz PLL frequency.

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


Re: [U-Boot] The command "nand write.yaffs" is not working correctly

2011-09-30 Thread Jin Zhengxiong-R64188
> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On
> Behalf Of Peter Pan
> Sent: Wednesday, September 21, 2011 9:09 AM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] The command "nand write.yaffs" is not working correctly
> 
> I'm recently facing a yaffs2 image write problem in u-boot.
> 
> In u-boot console, I write the yaffs2 image in ram to an already erased nand
> flash with command "nand write.yaffs ${loadaddr} ${nandrootoffset} 
> ${filesize}".
> After that, if I boot using a ramdisk and mount that yaffs2 partition, I can
> only see a folder of "lost+fount". I seems nothing has been written into that
> partition.
> 
> But if now I write this image using "nandwrite -a -o /dev/mtd4 yaffs2.img" and
> mount that partition, it's working.
> 
> Anyone met that problem already? Or if I did anything wrong?

[Jin Zhengxiong-R64188] 
I once met the similar issue with 2011.03 base and fixed it with following 
patch, But 
I didn't do a detail checking for that, FYI...

@@ -499,6 +499,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
return -EINVAL;
}
 
+#ifndef CONFIG_CMD_NAND_YAFFS
if (!need_skip) {
rval = nand_write (nand, offset, length, buffer);
if (rval == 0)
@@ -509,13 +510,12 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
offset, rval);
return rval;
}
-
+#endif
while (left_to_write > 0) {
size_t block_offset = offset & (nand->erasesize - 1);
size_t write_size;
 
WATCHDOG_RESET ();
-
if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
printf ("Skip bad block 0x%08llx\n",
offset & ~(nand->erasesize - 1));
@@ -546,7 +546,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
size_t *length,
ops.oobbuf = ops.datbuf + pagesize;
 
rval = nand->write_oob(nand, offset, &ops);
-   if (!rval)
+   if ( rval != 0)
break;
 
offset += pagesize;


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


Re: [U-Boot] [PATCH v4 1/1] add support for mcf5307

2011-09-30 Thread Jin Zhengxiong-R64188
> -Original Message-
> From: angelo [mailto:angel...@gmail.com]
> Sent: Thursday, September 22, 2011 4:06 AM
> To: U-Boot@lists.denx.de; Jin Zhengxiong-R64188
> Subject: [PATCH v4 1/1] add support for mcf5307
> 
> Add support for mcf5307 cpu.
> 
> Signed-off-by: Angelo Dureghello 
> ---
> 
> Changes for v4:
>  - all previous patches was wrong, some files was missing, for an
>improper usage of git.
> 
>   arch/m68k/cpu/mcf530x/Makefile |   48 +++
>   arch/m68k/cpu/mcf530x/config.mk|   25 
>   arch/m68k/cpu/mcf530x/cpu.c|   48 +++
>   arch/m68k/cpu/mcf530x/cpu.h|   33 +
>   arch/m68k/cpu/mcf530x/cpu_init.c   |  162 +++
>   arch/m68k/cpu/mcf530x/interrupts.c |   42 ++
>   arch/m68k/cpu/mcf530x/speed.c  |   36 +
>   arch/m68k/cpu/mcf530x/start.S  |  253
> 
>   arch/m68k/include/asm/cache.h  |2 +-
>   arch/m68k/include/asm/immap.h  |   22 +++
>   arch/m68k/include/asm/immap_5307.h |   78 +++
>   arch/m68k/include/asm/m5307.h  |  124 ++
>   arch/m68k/include/asm/timer.h  |2 +-
>   include/common.h   |6 +-
>   14 files changed, 876 insertions(+), 5 deletions(-)
>
Hi, Angelo,
I suggest to send all the patchset including the board file changes so that
we can at least test the building. Thanks.

Jason 


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


Re: [U-Boot] [PATCH v2 8/8] arm, davinci: add support for am1808 based enbw_cmc board

2011-09-30 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
> Hello Heiko,
> thanks for your reply.
> 
> On Fri, Sep 30, 2011 at 10:46 AM, Heiko Schocher  wrote:
>> Christian Riesch wrote:
>>> On Mon, Sep 19, 2011 at 7:50 AM, Heiko Schocher  wrote:
 - booting from NOR Flash with direct boot method
 - POST support
 - LOGBUF support

 Signed-off-by: Heiko Schocher 
 Cc: Paulraj Sandeep 
 Cc: Albert ARIBAUD 
 Cc: Igor Grinberg 
 ---
 - changes for v2
  - use CONFIG_MACH_TYPE instead setting the MACH_TYPE in
board specific code, as Igor Grinberg suggested.
  - add logversion=2 to default Environment
[...]
>> #define CONFIG_SYS_AM1808_PLL0_POSTDIV  1
>>
>> So the correct calculation is:
>>
>> (24MHz / PREDIV * (CONFIG_SYS_AM1808_PLL0_PLLM + 1)) / POSTDIV
>>
>> (And with that, I get 456 MHz ;-)
> 
> But then you would be running PLL0 with 24MHz *
> (CONFIG_SYS_AM1808_PLL0_PLLM + 1) = 912 MHz !? That would be out of
> specs since the PLL output frequency must be between 300 and 600 MHz
> according to the datasheet.

Yep, you are right! Fixed

CONFIG_SYS_AM1808_PLL0_PLLM to 18
CONFIG_SYS_AM1808_PLL0_POSTDIV to 0

Thanks!

> However, you can't set the PLLM to 37 anyway, since it's only a 5 bit
> field, (37 & 0x1f) results in 5, so you only multiply the frequency by
> 6 in the PLL, resulting in 144MHz PLL frequency.

Hmm... you are right here also, but I see:

=> md 1c11100
01c11100: 0049 0014 0002 I...
01c0: 0025 8000 8000 8001%...
^
Pllm

strange ...

Thanks for this review!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 09/15 V5] iMX28: Add GPMI NAND driver

2011-09-30 Thread Marek Vasut
Signed-off-by: Marek Vasut 
Cc: Scott Wood 
Cc: Stefano Babic 
Cc: Wolfgang Denk 
Cc: Detlev Zundel 
---
 drivers/mtd/nand/Makefile   |1 +
 drivers/mtd/nand/mxs_nand.c | 1118 +++
 2 files changed, 1119 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/mxs_nand.c

V2: Update comments, drop inlines
V3: Fix descriptor reclamation loop
V4: Trim bogus comments
V5: Remove redundant mxs_nand_aux_size() function (gcc 4.6 finding)

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index b6a7886..aef0d56 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -49,6 +49,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
 COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o
 COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o
+COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o
 COBJS-$(CONFIG_NAND_NDFC) += ndfc.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
 COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
new file mode 100644
index 000..ce2a326
--- /dev/null
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -0,0 +1,1118 @@
+/*
+ * Freescale i.MX28 NAND flash driver
+ *
+ * Copyright (C) 2011 Marek Vasut 
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * Based on code from LTIB:
+ * Freescale GPMI NFC NAND Flash Driver
+ *
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
+ * Copyright (C) 2008 Embedded Alley Solutions, Inc.
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#defineMXS_NAND_DMA_DESCRIPTOR_COUNT   4
+
+#defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE  512
+#defineMXS_NAND_METADATA_SIZE  10
+
+#defineMXS_NAND_COMMAND_BUFFER_SIZE32
+
+#defineMXS_NAND_BCH_TIMEOUT1
+
+struct mxs_nand_info {
+   int cur_chip;
+
+   uint32_tcmd_queue_len;
+
+   uint8_t *cmd_buf;
+   uint8_t *data_buf;
+   uint8_t *oob_buf;
+
+   uint8_t marking_block_bad;
+   uint8_t raw_oob_mode;
+
+   /* Functions with altered behaviour */
+   int (*hooked_read_oob)(struct mtd_info *mtd,
+   loff_t from, struct mtd_oob_ops *ops);
+   int (*hooked_write_oob)(struct mtd_info *mtd,
+   loff_t to, struct mtd_oob_ops *ops);
+   int (*hooked_block_markbad)(struct mtd_info *mtd,
+   loff_t ofs);
+
+   /* DMA descriptors */
+   struct mxs_dma_desc **desc;
+   uint32_tdesc_index;
+};
+
+struct nand_ecclayout fake_ecc_layout;
+
+static struct mxs_dma_desc *mxs_nand_get_dma_desc(struct mxs_nand_info *info)
+{
+   struct mxs_dma_desc *desc;
+
+   if (info->desc_index >= MXS_NAND_DMA_DESCRIPTOR_COUNT) {
+   printf("MXS NAND: Too many DMA descriptors requested\n");
+   return NULL;
+   }
+
+   desc = info->desc[info->desc_index];
+   info->desc_index++;
+
+   return desc;
+}
+
+static void mxs_nand_return_dma_descs(struct mxs_nand_info *info)
+{
+   int i;
+   struct mxs_dma_desc *desc;
+
+   for (i = 0; i < info->desc_index; i++) {
+   desc = info->desc[i];
+   memset(desc, 0, sizeof(struct mxs_dma_desc));
+   desc->address = (dma_addr_t)desc;
+   }
+
+   info->desc_index = 0;
+}
+
+static uint32_t mxs_nand_ecc_chunk_cnt(uint32_t page_data_size)
+{
+   return page_data_size / MXS_NAND_CHUNK_DATA_CHUNK_SIZE;
+}
+
+static uint32_t mxs_nand_ecc_size_in_bits(uint32_t ecc_strength)
+{
+   return ecc_strength * 13;
+}
+
+static uint32_t mxs_nand_aux_status_offset(void)
+{
+   return (MXS_NAND_METADATA_SIZE + 0x3) & ~0x3;
+}
+
+static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size,
+   uint32_t page_oob_size)
+{
+   if (page_data_size == 2048)
+   return 8;
+
+   if (page_data_size == 4096) {
+   if (page_oob_size == 128)
+  

Re: [U-Boot] [PATCH V2] I2C: Add i2c_get/set_speed() to mxc_i2c.c

2011-09-30 Thread Heiko Schocher
Hello Stefano,

Marek Vasut wrote:
> Signed-off-by: Marek Vasut 
> Cc: Stefano Babic 
> Cc: Heiko Schocher 
> ---
>  drivers/i2c/mxc_i2c.c |   31 +++
>  1 files changed, 23 insertions(+), 8 deletions(-)
> 
> V2: Drop redundant newline

Could you Ack this patch, or do you want to apply it, so
you can add my:

Acked-by: Heiko Schocher 

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/4] smdkv310 modifications

2011-09-30 Thread Minkyu Kang
Dear Chander Kashyap,

On 21 September 2011 16:25, Chander Kashyap  wrote:
> These patches does the following things:
> uses CONFIG_MACH_TYPE generic macro to initialize machine id.
> Uses get_ram_size () to initialize DRAM bank size to accurate value
> Migrates mmc spl support from mmc_spl framework to spl framework
> Replace hardcoded value with a macro and removes typedef in
> board/samsung/smdkv310/mmc_boot.c file.
>
> Chander Kashyap (4):
>  SMDKV310: Initialize board id using CONFIG_MACH_TYPE
>  SMDKV310: use get_ram_size() to validate dram size
>  smdkv310: use spl framework for mmc spl
>  smdkv310: use macro for mmc data read function address
>
>  board/samsung/smdkv310/Makefile                    |   19 -
>  .../board => board}/samsung/smdkv310/mmc_boot.c    |   15 ++--
>  board/samsung/smdkv310/smdkv310.c                  |   13 ++-
>  .../samsung/smdkv310/tools/mkv310_image.c          |    0
>  include/configs/smdkv310.h                         |    8 ++-
>  mmc_spl/board/samsung/smdkv310/Makefile            |  106 
> 
>  mmc_spl/board/samsung/smdkv310/u-boot.lds          |   88 
>  7 files changed, 41 insertions(+), 208 deletions(-)
>  rename {mmc_spl/board => board}/samsung/smdkv310/mmc_boot.c (83%)
>  rename {mmc_spl/board => board}/samsung/smdkv310/tools/mkv310_image.c (100%)
>  delete mode 100644 mmc_spl/board/samsung/smdkv310/Makefile
>  delete mode 100644 mmc_spl/board/samsung/smdkv310/u-boot.lds
>

applied to u-boot-samsung

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] GCC4.6: Squash warning in nand_bbt.c

2011-09-30 Thread Marek Vasut
nand_bbt.c: In function ‘search_bbt’:
nand_bbt.c:465:6: warning: variable ‘bits’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
Cc: Scott Wood 
---
 drivers/mtd/nand/nand_bbt.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 521ddde..ded652b 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -462,7 +462,7 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, 
struct nand_bbt_descr
 {
struct nand_chip *this = mtd->priv;
int i, chips;
-   int bits, startblock, block, dir;
+   int startblock, block, dir;
int scanlen = mtd->writesize + mtd->oobsize;
int bbtblocks;
int blocktopage = this->bbt_erase_shift - this->page_shift;
@@ -486,9 +486,6 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, 
struct nand_bbt_descr
bbtblocks = mtd->size >> this->bbt_erase_shift;
}
 
-   /* Number of bits for each erase block in the bbt */
-   bits = td->options & NAND_BBT_NRBITS_MSK;
-
for (i = 0; i < chips; i++) {
/* Reset version information */
td->version[i] = 0;
-- 
1.7.5.4

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


[U-Boot] [PATCH 2/5] GCC4,6: Squash warning in cmd_nand.c

2011-09-30 Thread Marek Vasut
cmd_nand.c: In function ‘do_nand’:
cmd_nand.c:490:7: warning: variable ‘chip’ set but not used
[-Wunused-but-set-variable]
cmd_nand.c:489:7: warning: variable ‘part’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
Cc: Scott Wood 
---
 common/cmd_nand.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index f42ea5b..3e12a36 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -486,8 +486,6 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
int scrub_yes = argc > 2 && !strcmp("-y", argv[2]);
int o = (clean || scrub_yes) ? 3 : 2;
int scrub = !strncmp(cmd, "scrub", 5);
-   int part = 0;
-   int chip = 0;
int spread = 0;
int args = 2;
const char *scrub_warn =
@@ -505,10 +503,8 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
if (!strcmp(&cmd[5], ".spread")) {
spread = 1;
} else if (!strcmp(&cmd[5], ".part")) {
-   part = 1;
args = 1;
} else if (!strcmp(&cmd[5], ".chip")) {
-   chip = 1;
args = 0;
} else {
goto usage;
-- 
1.7.5.4

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


[U-Boot] [PATCH 3/5] GCC4.6: Squash warning in vmt.c

2011-09-30 Thread Marek Vasut
vmt.c: In function ‘ubi_free_volume’:
vmt.c:681:6: warning: variable ‘err’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
---
 drivers/mtd/ubi/vmt.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 061da64..ce9fec7 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -678,12 +678,10 @@ out_cdev:
  */
 void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
 {
-   int err;
-
dbg_msg("free volume %d", vol->vol_id);
 
ubi->volumes[vol->vol_id] = NULL;
-   err = ubi_destroy_gluebi(vol);
+   ubi_destroy_gluebi(vol);
cdev_del(&vol->cdev);
volume_sysfs_close(vol);
 }
-- 
1.7.5.4

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


[U-Boot] [PATCH 5/5] GCC4.6: Squash warning in lzo1x_decompress.c

2011-09-30 Thread Marek Vasut
lzo1x_decompress.c: In function ‘parse_header’:
lzo1x_decompress.c:35:5: warning: variable ‘level’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
---
 lib/lzo/lzo1x_decompress.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/lzo/lzo1x_decompress.c b/lib/lzo/lzo1x_decompress.c
index 09bdc8f..e6ff708 100644
--- a/lib/lzo/lzo1x_decompress.c
+++ b/lib/lzo/lzo1x_decompress.c
@@ -32,7 +32,6 @@ static const unsigned char lzop_magic[] = {
 
 static inline const unsigned char *parse_header(const unsigned char *src)
 {
-   u8 level = 0;
u16 version;
int i;
 
@@ -47,7 +46,7 @@ static inline const unsigned char *parse_header(const 
unsigned char *src)
version = get_unaligned_be16(src);
src += 7;
if (version >= 0x0940)
-   level = *src++;
+   src++;
if (get_unaligned_be32(src) & HEADER_HAS_FILTER)
src += 4; /* filter info */
 
-- 
1.7.5.4

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


[U-Boot] [PATCH 4/5] GCC4.6: Squash warning in cmd_ubi.c:

2011-09-30 Thread Marek Vasut
cmd_ubi.c: In function ‘ubi_volume_read’:
cmd_ubi.c:319:9: warning: variable ‘count_save’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
---
 common/cmd_ubi.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index 629758f..8c1bc23 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -316,7 +316,6 @@ static int ubi_volume_write(char *volume, void *buf, size_t 
size)
 static int ubi_volume_read(char *volume, char *buf, size_t size)
 {
int err, lnum, off, len, tbuf_size;
-   size_t count_save = size;
void *tbuf;
unsigned long long tmp;
struct ubi_volume *vol;
@@ -347,7 +346,7 @@ static int ubi_volume_read(char *volume, char *buf, size_t 
size)
if (vol->corrupted)
printf("read from corrupted volume %d", vol->vol_id);
if (offp + size > vol->used_bytes)
-   count_save = size = vol->used_bytes - offp;
+   size = vol->used_bytes - offp;
 
tbuf_size = vol->usable_leb_size;
if (size < tbuf_size)
-- 
1.7.5.4

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


Re: [U-Boot] [PATCH 2/5] GCC4,6: Squash warning in cmd_nand.c

2011-09-30 Thread Marek Vasut
On Friday, September 30, 2011 12:13:23 PM Marek Vasut wrote:
> cmd_nand.c: In function ‘do_nand’:
> cmd_nand.c:490:7: warning: variable ‘chip’ set but not used
> [-Wunused-but-set-variable]
> cmd_nand.c:489:7: warning: variable ‘part’ set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Marek Vasut 
> Cc: Scott Wood 
> ---
>  common/cmd_nand.c |4 
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 

This even looks like .part and .chip has no effect at all ... am I right ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/5 V2] GCC4.6: Squash warning in vmt.c

2011-09-30 Thread Marek Vasut
vmt.c: In function ‘ubi_free_volume’:
vmt.c:681:6: warning: variable ‘err’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
---
 drivers/mtd/ubi/ubi.h |7 ++-
 drivers/mtd/ubi/vmt.c |4 +---
 2 files changed, 7 insertions(+), 4 deletions(-)

V2: Convert ubi_destroy_gluebi() to inline fn

diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index bf77a15..14c3a5f 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -467,7 +467,12 @@ int ubi_destroy_gluebi(struct ubi_volume *vol);
 void ubi_gluebi_updated(struct ubi_volume *vol);
 #else
 #define ubi_create_gluebi(ubi, vol) 0
-#define ubi_destroy_gluebi(vol) 0
+
+static inline int ubi_destroy_gluebi(struct ubi_volume *vol)
+{
+   return 0;
+}
+
 #define ubi_gluebi_updated(vol)
 #endif
 
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 061da64..ce9fec7 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -678,12 +678,10 @@ out_cdev:
  */
 void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
 {
-   int err;
-
dbg_msg("free volume %d", vol->vol_id);
 
ubi->volumes[vol->vol_id] = NULL;
-   err = ubi_destroy_gluebi(vol);
+   ubi_destroy_gluebi(vol);
cdev_del(&vol->cdev);
volume_sysfs_close(vol);
 }
-- 
1.7.5.4

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


[U-Boot] [PATCH 0/2] devkit8000: add spl mmc boot

2011-09-30 Thread Simon Schwarz
Add MMC booting to devkit8000 SPL.

Based on: u-boot-ti/next

Simon Schwarz (2):
  devkit8000: protect board_mmc_init
  devkit8000: Add config to enable SPL MMC boot

 board/timll/devkit8000/devkit8000.c |2 +-
 include/configs/devkit8000.h|5 +
 2 files changed, 6 insertions(+), 1 deletions(-)

-- 
1.7.4.1

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


[U-Boot] [PATCH 1/2] devkit8000: protect board_mmc_init

2011-09-30 Thread Simon Schwarz
This function is also defined in omap-common/spl_mmc.de so the implementation
in devkit8000.c was protected by a ifdef.

Signed-off-by: Simon Schwarz 
---
 board/timll/devkit8000/devkit8000.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/timll/devkit8000/devkit8000.c 
b/board/timll/devkit8000/devkit8000.c
index 9124569..dc99afb 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -125,7 +125,7 @@ void set_muxconf_regs(void)
MUX_DEVKIT8000();
 }
 
-#ifdef CONFIG_GENERIC_MMC
+#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
 int board_mmc_init(bd_t *bis)
 {
omap_mmc_init(0);
-- 
1.7.4.1

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


[U-Boot] [PATCH 2/2] devkit8000: Add config to enable SPL MMC boot

2011-09-30 Thread Simon Schwarz
Add MMC boot configs to devkit8000 config.

Signed-off-by: Simon Schwarz 
---
 include/configs/devkit8000.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 5d1014b..cb68169 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -325,7 +325,12 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_POWER_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SPL_FAT_SUPPORT
 #define CONFIG_SPL_LDSCRIPT"$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME"u-boot.img"
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION1
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x6 */
 
 #define CONFIG_SPL_TEXT_BASE   0x4020 /*CONFIG_SYS_SRAM_START*/
 #define CONFIG_SPL_MAX_SIZE0xB400  /* 45 K */
-- 
1.7.4.1

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


[U-Boot] U-Boot X86 bootstart

2011-09-30 Thread Ondra Kupka
Hello,

I've been digging a bit in X86 bootstart asm code and found possibly wrong
code, as far as I understand:

In u-boot/arch/x86/cpu/start.S, there is piece of code to disable caches:

/* Turn of cache (this might require a 486-class CPU) */
movl%cr0, %eax
orl $(X86_CR0_NW | X86_CR0_CD), %eax
movl%eax, %cr0
wbinvd

, which perfectly makes sense to me. What doesn't really make sense then is:

/* Turn of cache (this might require a 486-class CPU) */
movl%cr0, %eax
orl $(X86_CR0_NW & X86_CR0_CD), %eax- AND HERE???
movl%eax, %cr0
wbinvd

in start16.S of the same directory.

Is is wrong or not?

Thanks a lot,
Ondrej Kupka
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot X86 bootstart

2011-09-30 Thread Marek Vasut
On Friday, September 30, 2011 01:06:04 PM Ondra Kupka wrote:
> Hello,
> 
> I've been digging a bit in X86 bootstart asm code and found possibly wrong
> code, as far as I understand:
> 
> In u-boot/arch/x86/cpu/start.S, there is piece of code to disable caches:
> 
> /* Turn of cache (this might require a 486-class CPU) */
> movl%cr0, %eax
> orl $(X86_CR0_NW | X86_CR0_CD), %eax
> movl%eax, %cr0
> wbinvd
> 
> , which perfectly makes sense to me. What doesn't really make sense then
> is:
> 
> /* Turn of cache (this might require a 486-class CPU) */
> movl%cr0, %eax
> orl $(X86_CR0_NW & X86_CR0_CD), %eax- AND HERE???
> movl%eax, %cr0
> wbinvd
> 
> in start16.S of the same directory.
> 
> Is is wrong or not?
> 
> Thanks a lot,
> Ondrej Kupka

Ccing Graeme, cheers

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


[U-Boot] [PATCH 0/6] omap3evm: Clean-up and add new configurations

2011-09-30 Thread Sanjeev Premi
At the base level, this patchset does following:
 - Extract common/generic configurations from
   omap3_evm_config.h to create omap3_evm_common_config.h

 - Add new config targets that build much smaller u-boot
   customized for the boot devices - MMC/SD or NAND.

In the process, config options were re-organized to bring
similar options together along with general clean-up.

Specially, configs in this format
  #define CONFIG_FEAT_XYZ  1
were changed to
  #define CONFIG_FEAT_XYZ

The patch for regoranizing the config options and splitting
them appear to be quite big changes... not easy to compare.
These patches were created after squasing many incremental
commits. These commits (before squash) are available in the
pastebin for reference (as indicated in respective patches).

An earlier version of patchset was discussed on this list
almost an year ago. However, rework got delayed for various
reasons.
  [1] http://marc.info/?l=u-boot&m=128828487429161&w=2
  [2] http://marc.info/?l=u-boot&m=128818733126234&w=2

This patchset was created against u-boot-ti/next branch
assuming that following patch has been applied:
  http://marc.info/?l=u-boot&m=131713568506472&w=2

Sanjeev Premi (6):
  omap3evm: Reorder related config options
  omap3evm: Prepare to split configuration
  omap3evm: move common config options to new file
  omap3evm: Add (quick) configuration for MMC/SD only
  omap3evm: Add (quick) configuration for NAND only
  omap3evm: fix errors caused by multiple definitions

 boards.cfg |2 +
 include/configs/omap3_evm.h|  336 ++--
 include/configs/omap3_evm_common.h |  292 +++
 include/configs/omap3_evm_quick_mmc.h  |   91 +
 include/configs/omap3_evm_quick_nand.h |   78 
 5 files changed, 521 insertions(+), 278 deletions(-)
 create mode 100644 include/configs/omap3_evm_common.h
 create mode 100644 include/configs/omap3_evm_quick_mmc.h
 create mode 100644 include/configs/omap3_evm_quick_nand.h

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


[U-Boot] [PATCH 2/6] omap3evm: Prepare to split configuration

2011-09-30 Thread Sanjeev Premi
This patch marks the beginning of steps that would
lead to clean and easy split of the configuration
file. Common portion can then be re-used by other
configurations.

Signed-off-by: Sanjeev Premi 
---

 Since the patch changes most of the file contents, it may
 not be easy to review. This sequence on individual patches
 that were squashed to make this change can be viewed at:
   http://pastebin.com/0utWswst
 
 Since, this was a set of patches with no real change in
 functionality, i didn't post them to the list.


 include/configs/omap3_evm.h |  424 +++
 1 files changed, 227 insertions(+), 197 deletions(-)

 include/configs/omap3_evm.h |  194 +--
 1 files changed, 132 insertions(+), 62 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 30240d7..00f7477 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -1,6 +1,8 @@
 /*
- * (C) Copyright 2006-2008
- * Texas Instruments.
+ * Configuration settings for the TI OMAP3 EVM board.
+ *
+ * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
  * Author :
  * Manikandan Pillai 
  * Derived from Beagle Board and 3430 SDP code by
@@ -9,8 +11,6 @@
  *
  * Manikandan Pillai 
  *
- * Configuration settings for the TI OMAP3 EVM board.
- *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -30,11 +30,130 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef __OMAP3EVM_CONFIG_H
+#define __OMAP3EVM_CONFIG_H
+
+#include 
+#include 
+
+/* 
=
+ * This section holds the common definitions that correspond to the
+ * current default configuration - omap3_evm_config
+ * 
=
+ */
+
+/* 
+ * Supported U-boot commands
+ * 
+ */
+
+/* Default commands to include */
+#include 
+
+#define CONFIG_CMD_EXT2/* EXT2 Support */
+#define CONFIG_CMD_FAT /* FAT support  */
+#define CONFIG_CMD_JFFS2   /* JFFS2 Support*/
+
+#define CONFIG_CMD_I2C /* I2C serial bus support   */
+#define CONFIG_CMD_MMC /* MMC support  */
+#define CONFIG_CMD_NAND/* NAND support */
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+
+#undef CONFIG_CMD_FLASH/* flinfo, erase, protect   */
+#undef CONFIG_CMD_FPGA /* FPGA configuration Support   */
+#undef CONFIG_CMD_IMI  /* iminfo   */
+#undef CONFIG_CMD_IMLS /* List all found images*/
+
+/* 
+ * Supported U-boot features
+ * 
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_HUSH_PARSER
+
+/* Display CPU and Board information */
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+
+/* Add auto-completion support */
+#define CONFIG_AUTO_COMPLETE
+
+/* 
+ * Supported hardware
+ * 
+ */
+
+/* MMC */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_OMAP_HSMMC
+#define CONFIG_DOS_PARTITION
+
+/* USB
+ *
+ * Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
+ * Enable CONFIG_MUSB_UDD for Device functionalities.
+ */
+#define CONFIG_USB_OMAP3
+#define CONFIG_MUSB_HCD
+/* #define CONFIG_MUSB_UDC */
+
+/* 
-
+ * Default environment
+ * 
-
+ */
+#define CONFIG_BOOTDELAY   10
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "loadaddr=0x8200\0" \
+   "usbtty=cdc_acm\0" \
+   "mmcdev=0\0" \
+   "memsize=128M\0" \
+   "console=ttyO0,115200n8\0" \
+   "mmcargs=setenv bootargs console=${console} " \
+   "mem=${memsize}\0 " \
+   "root=/dev/mmcblk0p2 rw " \
+   "rootfstype=ext3 rootwait\0" \
+   "nandargs=setenv bootargs console=${console} " \
+   "mem=${memsize}\0 " \
+   "root=/dev/mtdblock4 rw " \
+   "rootfstype=jffs2\0" \
+   "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+   "bootscript=echo Running bootscript from mmc ...; " \
+   "source ${loadaddr}\0" \
+   "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+   "mmcb

[U-Boot] [PATCH 1/6] omap3evm: Reorder related config options

2011-09-30 Thread Sanjeev Premi
This patch brings related config options together.
Most config options won't be evaluated for numerical
value, but they are being set to 1. This patch also
removes these occurences.

i.e. definition similar to
  #define CONFIG_FEAT_XYZ  1
were changed to
  #define CONFIG_FEAT_XYZ

Some formatting changes were also done for consistent
look-n-feel after the movement.

The patch doesn't make/include any other functional
change.

Signed-off-by: Sanjeev Premi 
---

 Since the patch changes most of the file contents, it may
 not be easy to review. This sequence on individual patches
 that were squashed to make this change can be viewed at:
   http://pastebin.com/qQE1uHNg
 
 Since, there were too many small patches with no real
 change in functionality, i didn't post them to the list.


 include/configs/omap3_evm.h |  424 +++
 1 files changed, 227 insertions(+), 197 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index c399515..30240d7 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -36,42 +36,80 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_OMAP1   /* in a TI OMAP core */
-#define CONFIG_OMAP34XX1   /* which is a 34XX */
-#define CONFIG_OMAP34301   /* which is in a 3430 */
-#define CONFIG_OMAP3_EVM   1   /* working with EVM */
+#define CONFIG_OMAP/* This is TI OMAP core */
+#define CONFIG_OMAP34XX/* belonging to 34XX family */
+#define CONFIG_OMAP3430/* which is in a 3430 */
 
-#define CONFIG_SDRC/* The chip has SDRC controller */
+#define CONFIG_SDRC/* The chip has SDRC controller */
 
-#include   /* get chip and board defs */
-#include 
+#define CONFIG_OMAP3_EVM   /* This is a OMAP3 EVM */
+#define CONFIG_OMAP3_MICRON_DDR/* with MICRON DDR part */
+#define CONFIG_TWL4030_POWER   /* with TWL4030 PMIC */
 
 /*
- * Display CPU and Board information
+ * Get cpu and chip specific definitions
  */
-#define CONFIG_DISPLAY_CPUINFO 1
-#define CONFIG_DISPLAY_BOARDINFO   1
+#include 
+#include 
+
+#undef CONFIG_USE_IRQ  /* no support for IRQs */
 
-/* Clock Defines */
+/*
+ * Clock related definitions
+ */
 #define V_OSCK 2600/* Clock output from T2 */
 #define V_SCLK (V_OSCK >> 1)
 
-#undef CONFIG_USE_IRQ  /* no support for IRQs */
-#define CONFIG_MISC_INIT_R
+/*
+ * OMAP3 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE   OMAP34XX_GPT2
+#define CONFIG_SYS_PTV 2   /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ  1000
+
+/* Size of environment - 128KB */
+#define CONFIG_ENV_SIZE(128 << 10)
 
-#define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
-#define CONFIG_SETUP_MEMORY_TAGS   1
-#define CONFIG_INITRD_TAG  1
-#define CONFIG_REVISION_TAG1
+/* Size of malloc pool */
+#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (128 << 10))
 
 /*
- * Size of malloc() pool
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
  */
-#define CONFIG_ENV_SIZE(128 << 10) /* 128 KiB */
-   /* Sector */
-#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (128 << 10))
+#define CONFIG_STACKSIZE   (128 << 10) /* regular stack 128 KiB */
+#ifdef CONFIG_USE_IRQ
+#define CONFIG_STACKSIZE_IRQ   (4 << 10)   /* IRQ stack 4 KiB */
+#define CONFIG_STACKSIZE_FIQ   (4 << 10)   /* FIQ stack 4 KiB */
+#endif
+
 /*
+ * Physical Memory Map
+ * Note 1: CS1 may or may not be populated
+ * Note 2: SDRAM size is expected to be at least 32MB
+ */
+#define CONFIG_NR_DRAM_BANKS   2
+#define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
+#define PHYS_SDRAM_1_SIZE  (32 << 20)
+#define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
+
+/* SDRAM Bank Allocation method */
+#define SDRC_R_B_C
+
+/* Limits for memtest */
+#define CONFIG_SYS_MEMTEST_START   (OMAP34XX_SDRC_CS0)
+#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
+   0x01F0) /* 31MB */
+
+/* Default load address */
+#define CONFIG_SYS_LOAD_ADDR   (OMAP34XX_SDRC_CS0)
+
+/* 
-
  * Hardware drivers
+ * 
-
  */
 
 /*
@@ -88,29 +126,88 @@
  * select serial console configuration
  */
 #define CONFIG_CONS_INDEX  1
-#define CONFIG_SYS_NS16550_CO

[U-Boot] [PATCH 3/6] omap3evm: move common config options to new file

2011-09-30 Thread Sanjeev Premi
This patch moves common config options to a new
file. Common options can now be included in other
board configs for this evm.

Signed-off-by: Sanjeev Premi 
---
 include/configs/omap3_evm.h|  340 +--
 include/configs/omap3_evm_common.h |  287 ++
 2 files changed, 297 insertions(+), 330 deletions(-)
 create mode 100644 include/configs/omap3_evm_common.h

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 00f7477..824c6dd 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -36,27 +36,19 @@
 #include 
 #include 
 
-/* 
=
- * This section holds the common definitions that correspond to the
- * current default configuration - omap3_evm_config
- * 
=
- */
-
 /* 
  * Supported U-boot commands
  * 
  */
-
-/* Default commands to include */
 #include 
 
-#define CONFIG_CMD_EXT2/* EXT2 Support */
-#define CONFIG_CMD_FAT /* FAT support  */
-#define CONFIG_CMD_JFFS2   /* JFFS2 Support*/
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_JFFS2
 
-#define CONFIG_CMD_I2C /* I2C serial bus support   */
-#define CONFIG_CMD_MMC /* MMC support  */
-#define CONFIG_CMD_NAND/* NAND support */
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_NAND
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_PING
 
@@ -103,328 +95,16 @@
 /* #define CONFIG_MUSB_UDC */
 
 /* 
-
- * Default environment
- * 
-
- */
-#define CONFIG_BOOTDELAY   10
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-   "loadaddr=0x8200\0" \
-   "usbtty=cdc_acm\0" \
-   "mmcdev=0\0" \
-   "memsize=128M\0" \
-   "console=ttyO0,115200n8\0" \
-   "mmcargs=setenv bootargs console=${console} " \
-   "mem=${memsize}\0 " \
-   "root=/dev/mmcblk0p2 rw " \
-   "rootfstype=ext3 rootwait\0" \
-   "nandargs=setenv bootargs console=${console} " \
-   "mem=${memsize}\0 " \
-   "root=/dev/mtdblock4 rw " \
-   "rootfstype=jffs2\0" \
-   "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-   "bootscript=echo Running bootscript from mmc ...; " \
-   "source ${loadaddr}\0" \
-   "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
-   "bootm ${loadaddr}\0" \
-   "nandboot=echo Booting from nand ...; " \
-   "run nandargs; " \
-   "onenand read ${loadaddr} 28 40; " \
-   "bootm ${loadaddr}\0" \
-
-#define CONFIG_BOOTCOMMAND \
-   "if mmc rescan ${mmcdev}; then " \
-   "if run loadbootscript; then " \
-   "run bootscript; " \
-   "else " \
-   "if run loaduimage; then " \
-   "run mmcboot; " \
-   "else run nandboot; " \
-   "fi; " \
-   "fi; " \
-   "else run nandboot; fi"
-
-/* 
=
- * This section holds the common definitions that can be used by
- * all OMAP3EVM based configurations.
- * 
=
- */
-
-/*
- * High level configuration options
- */
-#define CONFIG_OMAP/* This is TI OMAP core */
-#define CONFIG_OMAP34XX/* belonging to 34XX family */
-#define CONFIG_OMAP3430/* which is in a 3430 */
-
-#define CONFIG_SDRC/* The chip has SDRC controller */
-
-#define CONFIG_OMAP3_EVM   /* This is a OMAP3 EVM */
-#define CONFIG_OMAP3_MICRON_DDR/* with MICRON DDR part */
-#define CONFIG_TWL4030_POWER   /* with TWL4030 PMIC */
-
-#undef CONFIG_USE_IRQ  /* no support for IRQs */
-
-/*
- * Clock related definitions
- */
-#define V_OSCK 2600/* Clock output from T2 */
-#define V_SCLK (V_OSCK >> 1)
-
-/*
- * OMAP3 has 12 GP timers, they can be driven by the system clock
- * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
- * This rate is divided by a local divisor.
- */
-#define CONFIG_SYS_TIMERBASE   OMAP34XX_GPT2
-#define CONFIG_SYS_PTV 2   /* Divisor: 2^(PTV+1) 

[U-Boot] [PATCH 4/6] omap3evm: Add (quick) configuration for MMC/SD only

2011-09-30 Thread Sanjeev Premi
Add an optimized board configuration that only
supports boot from MMC/SD.

Signed-off-by: Sanjeev Premi 
---

 This patch was tested on OMAP3EVM Rev G.

 boards.cfg|1 +
 include/configs/omap3_evm_quick_mmc.h |   91 +
 2 files changed, 92 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/omap3_evm_quick_mmc.h

diff --git a/boards.cfg b/boards.cfg
index 8a5bfc1..4277daf 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -174,6 +174,7 @@ omap3_zoom1  arm armv7   zoom1  
 logicpd
 omap3_zoom2  arm armv7   zoom2   
logicpdomap3
 omap3_beagle arm armv7   beagle  ti
 omap3
 omap3_evmarm armv7   evm ti
 omap3
+omap3_evm_quick_mmc  arm armv7   evm ti
 omap3
 omap3_sdp3430arm armv7   sdp3430 ti
 omap3
 devkit8000   arm armv7   devkit8000  timll 
 omap3
 omap4_panda  arm armv7   panda   ti
 omap4
diff --git a/include/configs/omap3_evm_quick_mmc.h 
b/include/configs/omap3_evm_quick_mmc.h
new file mode 100644
index 000..8e4467e
--- /dev/null
+++ b/include/configs/omap3_evm_quick_mmc.h
@@ -0,0 +1,91 @@
+/*
+ * Configuration settings for quick boot from MMC on OMAP3 EVM.
+ *
+ * Copyright (C) 2006-2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Author :
+ * Sanjeev Premi 
+ *
+ * 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 "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __OMAP3_EVM_QUICK_MMC_H
+#define __OMAP3_EVM_QUICK_MMC_H
+
+#include 
+#include 
+
+/* 
+ * Supported U-boot commands
+ * 
+ */
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_FAT
+
+/*
+ * Board revision is detected by probing the Ethernet chip.
+ *
+ * When revision is statically configured via CONFIG_STATIC_BOARD_REV,
+ * this option can be removed. Generated binary is leaner by ~16Kbytes.
+ */
+#define CONFIG_CMD_NET
+
+/* 
+ * Supported U-boot features
+ * 
+ */
+#define CONFIG_SILENT_CONSOLE
+#define CONFIG_ENV_IS_NOWHERE
+
+/* 
+ * Supported hardware
+ * 
+ */
+
+/* MMC */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_OMAP_HSMMC
+#define CONFIG_DOS_PARTITION
+
+/* 
-
+ * Include common board configuration
+ * 
-
+ */
+#include "omap3_evm_common.h"
+
+/* 
-
+ * Default environment
+ * 
-
+ */
+#define CONFIG_BOOTDELAY   0
+
+#define CONFIG_EXTRA_ENV_SETTINGS  \
+   "verify=no\0"   \
+   "silent=1"
+
+#define CONFIG_BOOTCOMMAND \
+   "mmc rescan 0; "\
+   "fatload mmc 0 0x8200 uImage; " \
+   "bootm 0x8200;"
+
+/*
+ * Update the bootargs as necessary e.g. size of memory, partition and fstype
+ */
+#define CONFIG_BOOTARGS\
+   "quiet "\
+   "console=ttyO0,115200n8 "   \
+   "mem=128M " \
+   "noinitrd " \
+   "root=/dev/mmcblk0p2 rw "   \
+   "rootfstype=ext2 rootwait"
+
+#endif /* __OMAP3_EVM_QUICK_MMC_H */
-- 
1.7.0.4

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


[U-Boot] [PATCH 5/6] omap3evm: Add (quick) configuration for NAND only

2011-09-30 Thread Sanjeev Premi
Add an optimized board configuration that only
supports boot from NAND.

Signed-off-by: Sanjeev Premi 
---

 This configuration has been compile tested. The patch is currently
 under test. Will update the status shortly.

 boards.cfg |1 +
 include/configs/omap3_evm_quick_nand.h |   78 
 2 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/omap3_evm_quick_nand.h

diff --git a/boards.cfg b/boards.cfg
index 4277daf..c6adb10 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -175,6 +175,7 @@ omap3_zoom2  arm armv7   zoom2  
 logicpd
 omap3_beagle arm armv7   beagle  ti
 omap3
 omap3_evmarm armv7   evm ti
 omap3
 omap3_evm_quick_mmc  arm armv7   evm ti
 omap3
+omap3_evm_quick_nand arm armv7   evm ti
 omap3
 omap3_sdp3430arm armv7   sdp3430 ti
 omap3
 devkit8000   arm armv7   devkit8000  timll 
 omap3
 omap4_panda  arm armv7   panda   ti
 omap4
diff --git a/include/configs/omap3_evm_quick_nand.h 
b/include/configs/omap3_evm_quick_nand.h
new file mode 100644
index 000..54dc1f1
--- /dev/null
+++ b/include/configs/omap3_evm_quick_nand.h
@@ -0,0 +1,78 @@
+/*
+ * Configuration settings for quick boot from NAND on OMAP3 EVM.
+ *
+ * Copyright (C) 2006-2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Author :
+ * Sanjeev Premi 
+ *
+ * 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 "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __OMAP3_EVM_QUICK_NAND_H
+#define __OMAP3_EVM_QUICK_NAND_H
+
+#include 
+#include 
+
+/* 
+ * Supported U-boot commands
+ * 
+ */
+#define CONFIG_CMD_NAND
+
+/*
+ * Board revision is detected by probing the Ethernet chip.
+ *
+ * When revision is statically configured via CONFIG_STATIC_BOARD_REV,
+ * this option can be removed. Generated binary is leaner by ~16Kbytes.
+ */
+#define CONFIG_CMD_NET
+
+/* 
+ * Supported U-boot features
+ * 
+ */
+#define CONFIG_SILENT_CONSOLE
+#define CONFIG_ENV_IS_NOWHERE
+
+/* 
-
+ * Include common board configuration
+ * 
-
+ */
+#include "omap3_evm_common.h"
+
+/* 
-
+ * Default environment
+ * 
-
+ */
+#define CONFIG_BOOTDELAY   0
+
+#define CONFIG_EXTRA_ENV_SETTINGS  \
+   "verify=no\0"   \
+   "silent=1"
+
+#define CONFIG_BOOTCOMMAND \
+   "nand read.i 0x8000 28 50; "\
+   "bootm 0x8000;"
+
+/*
+ * Update the bootargs as necessary e.g. size of memory, partition and fstype
+ */
+#define CONFIG_BOOTARGS\
+   "quiet "\
+   "console=ttyO0,115200n8 "   \
+   "mem=128M " \
+   "noinitrd " \
+   "root=/dev/mtdblock4 rw "   \
+   "rootfstype=jffs2 "
+
+#endif /* __OMAP3_EVM_QUICK_NAND_H */
-- 
1.7.0.4

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


[U-Boot] [PATCH 6/6] omap3evm: fix errors caused by multiple definitions

2011-09-30 Thread Sanjeev Premi
Fix these errors when building with recently added
omap3_evm_quick_nand_config:

env_nowhere.o: In function `env_relocate_spec':
/home/premi/u-boot/common/env_nowhere.c:40: multiple definition
 of `env_relocate_spec'
env_nand.o:/home/premi/u-boot/common/env_nand.c:416: first defi
ned here
env_nowhere.o: In function `env_get_char_spec':
/home/premi/u-boot/common/env_nowhere.c:44: multiple definition
 of `env_get_char_spec'
env_nand.o:/home/premi/u-boot/common/env_nand.c:77: first defin
ed here
env_nowhere.o: In function `env_init':
/home/premi/u-boot/common/env_nowhere.c:54: multiple definition
 of `env_init'
env_nand.o:/home/premi/u-boot/common/env_nand.c:144: first defi
ned here
env_nowhere.o: In function `env_relocate_spec':
/home/premi/u-boot/common/env_nowhere.c:40: multiple definition
 of `env_ptr'
env_nand.o:/home/premi/u-boot/common/env_nand.c:77: first defin
ed here

Signed-off-by: Sanjeev Premi 
---
 include/configs/omap3_evm_common.h |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/configs/omap3_evm_common.h 
b/include/configs/omap3_evm_common.h
index baa74bf..7a5f602 100644
--- a/include/configs/omap3_evm_common.h
+++ b/include/configs/omap3_evm_common.h
@@ -239,15 +239,20 @@
 
 #define CONFIG_NAND_OMAP_GPMC
 #define GPMC_NAND_ECC_LP_x16_LAYOUT
-#define CONFIG_ENV_IS_IN_NAND
 #define CONFIG_ENV_OFFSET  SMNAND_ENV_OFFSET
 #elif defined(CONFIG_CMD_ONENAND)
 #define CONFIG_SYS_FLASH_BASE  PISMO1_ONEN_BASE
 #define CONFIG_SYS_ONENAND_BASEONENAND_MAP
+#endif
 
+#if !defined(CONFIG_ENV_IS_NOWHERE)
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_ENV_IS_IN_NAND
+#elif defined(CONFIG_CMD_ONENAND)
 #define CONFIG_ENV_IS_IN_ONENAND
 #define CONFIG_ENV_OFFSET  ONENAND_ENV_OFFSET
 #endif
+#endif /* CONFIG_ENV_IS_NOWHERE */
 
 #define CONFIG_ENV_ADDRCONFIG_ENV_OFFSET
 
-- 
1.7.0.4

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


[U-Boot] [PATCH 0/6] da850: add board specific functions

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

There are two boards AM18xx and L138 both of which are based
on da850 SOC. AM18xx boards have mac address stored in I2C
EEPROM and they have spi flash manufactured by WINBOND. L138
boards store mac address in SPI flash and they have SPI flash
manufactured by ST Microelectronics.Due to these differences,
instead of one config file, two config files are introduced
to manage configs specific to board types.

Nagabhushana Netagunte (6):
  da850: add new config file for AM18xx
  da850: rename config file to represent OMAP-L138
  da850: pass board revision info to kernel
  da850: revert cache disable patch
  da850: add support to read mac address from spi flash
  da850: read MAC address from I2C EEPROM on AM18xx EVM

 board/davinci/da8xxevm/da850evm.c |   76 +++-
 boards.cfg|3 +-
 include/configs/da850_am18xxevm.h |  253 +
 include/configs/da850_l138evm.h   |  246 
 include/configs/da850evm.h|  249 
 5 files changed, 576 insertions(+), 251 deletions(-)
 create mode 100644 include/configs/da850_am18xxevm.h
 create mode 100644 include/configs/da850_l138evm.h
 delete mode 100644 include/configs/da850evm.h

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


[U-Boot] [PATCH 2/6] da850: rename config file to represent OMAP-L138

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

rename config file da850evm.h as da850_l138evm.h to represent omap
l138 board based on da850 SOC. L138 boards dont have WINBOND SPI
flash, corresponding config is removed. Appropriate changes are made
in boards.cfg for building.

Signed-off-by: Nagabhushana Netagunte 
---
 boards.cfg  |2 +-
 include/configs/da850_l138evm.h |  248 ++
 include/configs/da850evm.h  |  249 ---
 3 files changed, 249 insertions(+), 250 deletions(-)
 create mode 100644 include/configs/da850_l138evm.h
 delete mode 100644 include/configs/da850evm.h

diff --git a/boards.cfg b/boards.cfg
index d437341..7c7b4e0 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -115,7 +115,7 @@ pm9261   arm arm926ejs   pm9261 
 ronetix
 pm9263   arm arm926ejs   pm9263  
ronetixat91pm9263:AT91SAM9263
 pm9g45   arm arm926ejs   pm9g45  
ronetixat91pm9g45:AT91SAM9G45
 da830evm arm arm926ejs   da8xxevm
davincidavinci
-da850evm arm arm926ejs   da8xxevm
davincidavinci
+da850_l138evmarm arm926ejs   da8xxevm
davincidavinci
 da850_am18xxevm  arm arm926ejs   da8xxevm
davincidavinci
 hawkboardarm arm926ejs   da8xxevm
davincidavinci
 hawkboard_nand   arm arm926ejs   da8xxevm
davincidavinci hawkboard:NAND_U_BOOT
diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
new file mode 100644
index 000..347893c
--- /dev/null
+++ b/include/configs/da850_l138evm.h
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on davinci_dvevm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_USE_SPIFLASH
+
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_DA850_EVM
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE   0xc108
+#define CONFIG_SYS_ICACHE_OFF
+#define CONFIG_SYS_DCACHE_OFF
+#define CONFIG_SYS_L2CACHE_OFF
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  (64 << 20) /* SDRAM size 64MB */
+#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
+
+/* memtest start addr */
+#define CONFIG_SYS_MEMTEST_START   (PHYS_SDRAM_1 + 0x200)
+
+/* memtest will be run on 16MB */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x200 + 16*1024*1024)
+
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX  1   /* use UART0 for console */
+#define CONFIG_BAUDRATE115200  /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_DAVINCI_SPI
+#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
+#define CONFIG_SY

[U-Boot] [PATCH 4/6] da850: revert cache disable patch

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

revert commit bd65d006a6088bcb857e079447d7549e2cd7054d as cache
disabling is no more needed. Subsequent patches to new cache
management framework has fixed EMAC issue with cache coherency.

Signed-off-by: Nagabhushana Netagunte 
---
 include/configs/da850_l138evm.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
index 347893c..0bd630f 100644
--- a/include/configs/da850_l138evm.h
+++ b/include/configs/da850_l138evm.h
@@ -43,9 +43,6 @@
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE   0xc108
-#define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_L2CACHE_OFF
 
 /*
  * Memory Info
-- 
1.6.2.4

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


[U-Boot] [PATCH 5/6] da850: add support to read mac address from spi flash

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

add support to read mac address from spi flash if env variable
is not set. This is supported only on L138 boards based on da850
SOC. Introduced a macro CONFIG_MAC_ADDR_IN_SPIFLASH indicating
where to look mac address for.

Signed-off-by: Manjunathappa, Prakash 
Signed-off-by: Nagabhushana Netagunte 
---
 board/davinci/da8xxevm/da850evm.c |   63 +
 include/configs/da850_l138evm.h   |1 +
 2 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 29cee37..31ab0d6 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -25,10 +25,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -166,6 +169,44 @@ const struct pinmux_config nor_pins[] = {
 #endif
 #endif /* CONFIG_DRIVER_TI_EMAC */
 
+#define CFG_MAC_ADDR_SPI_BUS   0
+#define CFG_MAC_ADDR_SPI_CS0
+#define CFG_MAC_ADDR_SPI_MAX_HZCONFIG_SF_DEFAULT_SPEED
+#define CFG_MAC_ADDR_SPI_MODE  SPI_MODE_3
+
+#define CFG_MAC_ADDR_OFFSET(flash->size - SZ_64K)
+
+#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
+static int get_mac_addr(u8 *addr)
+{
+   struct spi_flash *flash;
+   int ret;
+
+
+   flash = spi_flash_probe(CFG_MAC_ADDR_SPI_BUS, CFG_MAC_ADDR_SPI_CS,
+   CFG_MAC_ADDR_SPI_MAX_HZ, CFG_MAC_ADDR_SPI_MODE);
+   if (!flash) {
+   printf(" Error - unable to probe SPI flash.\n");
+   ret = -1;
+   goto err_probe;
+   }
+
+   ret = spi_flash_read(flash, CFG_MAC_ADDR_OFFSET, 6, addr);
+   if (ret) {
+   printf("Error - unable to read MAC address from SPI flash.\n");
+   goto err_read;
+   }
+
+err_read:
+   /* cannot call free currently since the free function calls free() for
+* spi_flash structure though it is not directly allocated through
+* malloc()
+*/
+err_probe:
+   return ret;
+}
+#endif
+
 void dsp_lpsc_on(unsigned domain, unsigned int id)
 {
dv_reg_p mdstat, mdctl, ptstat, ptcmd;
@@ -220,7 +261,29 @@ static void dspwake(void)
 
 int misc_init_r(void)
 {
+   uint8_t enetaddr[8];
+   uchar buff[8];
+   int ret;
+
dspwake();
+
+#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
+   if (!eth_getenv_enetaddr("ethaddr", buff)) {
+   ret = get_mac_addr(buff);
+   if (ret != 0)
+   return -EINVAL;
+
+   if (is_multicast_ether_addr(buff) ||
+   is_zero_ether_addr(buff)) {
+   printf("Invalid MAC address read.\n");
+   return -EINVAL;
+   }
+
+   sprintf((char *)enetaddr, "%pM", buff);
+
+   eth_setenv_enetaddr("ethaddr", enetaddr);
+   }
+#endif
return 0;
 }
 
diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
index 0bd630f..9e4a652 100644
--- a/include/configs/da850_l138evm.h
+++ b/include/configs/da850_l138evm.h
@@ -172,6 +172,7 @@
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CRC32_VERIFY
 #define CONFIG_MX_CYCLIC
+#define CONFIG_MAC_ADDR_IN_SPIFLASH
 
 /*
  * Linux Information
-- 
1.6.2.4

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


[U-Boot] [PATCH 3/6] da850: pass board revision info to kernel

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

there are two boards based on da850 SOC - OMAP-L138 and AM18xx.
In order to differentiate between these two boards, revision id
is passed to kernel via second byte of ATAG_REVISION.

Signed-off-by: Manjunathappa, Prakash 
Signed-off-by: Nagabhushana Netagunte 
---
 board/davinci/da8xxevm/da850evm.c |6 +-
 include/configs/da850_am18xxevm.h |1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 46924d3..29cee37 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -249,6 +249,8 @@ static const struct lpsc_resource lpsc[] = {
 #define CONFIG_DA850_EVM_MAX_CPU_CLK   3
 #endif
 
+#define REV_AM18XX_EVM 0x100
+
 /*
  * get_board_rev() - setup to pass kernel board revision information
  * Returns:
@@ -274,7 +276,9 @@ u32 get_board_rev(void)
rev = 2;
else if (maxcpuclk >= 37200)
rev = 1;
-
+#ifdef CONFIG_DA850_AM18XX_EVM
+   rev |= REV_AM18XX_EVM;
+#endif
return rev;
 }
 
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
index 92b83ff..29d580b 100644
--- a/include/configs/da850_am18xxevm.h
+++ b/include/configs/da850_am18xxevm.h
@@ -43,6 +43,7 @@
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE   0xc108
+#define CONFIG_DA850_AM18XX_EVM
 
 /*
  * Memory Info
-- 
1.6.2.4

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


[U-Boot] [PATCH 6/6] da850: read MAC address from I2C EEPROM on AM18xx EVM

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

The AM18xx EVM contains MAC address in I2C EEPROM. Introduced
a new macro CONFIG_MAC_ADDR_IN_EEPROM to where to look for mac
address. This patch reads MAC address from I2C EEPROM and updates
environment variable.

Signed-off-by: Manjunathappa, Prakash 
Signed-off-by: Nagabhushana Netagunte 
---
 board/davinci/da8xxevm/da850evm.c |9 -
 include/configs/da850_am18xxevm.h |7 +++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 31ab0d6..bcdaf2b 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -267,8 +267,9 @@ int misc_init_r(void)
 
dspwake();
 
-#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
+#if defined(CONFIG_MAC_ADDR_IN_SPIFLASH) || defined(CONFIG_MAC_ADDR_IN_EEPROM)
if (!eth_getenv_enetaddr("ethaddr", buff)) {
+#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
ret = get_mac_addr(buff);
if (ret != 0)
return -EINVAL;
@@ -282,6 +283,12 @@ int misc_init_r(void)
sprintf((char *)enetaddr, "%pM", buff);
 
eth_setenv_enetaddr("ethaddr", enetaddr);
+#else
+   /* Read Ethernet MAC address from EEPROM */
+   if (dvevm_read_mac_address(enetaddr))
+   /* Set Ethernet MAC address from EEPROM */
+   davinci_sync_env_enetaddr(enetaddr);
+#endif
}
 #endif
return 0;
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
index 29d580b..b525f14 100644
--- a/include/configs/da850_am18xxevm.h
+++ b/include/configs/da850_am18xxevm.h
@@ -93,6 +93,12 @@
 #define CONFIG_SYS_I2C_EXPANDER_ADDR   0x20
 
 /*
+ * I2C EEPROM definitions EEPROM chip
+ */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
+
+/*
  * Flash & Environment
  */
 #ifdef CONFIG_USE_NAND
@@ -173,6 +179,7 @@
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CRC32_VERIFY
 #define CONFIG_MX_CYCLIC
+#define CONFIG_MAC_ADDR_IN_EEPROM
 
 /*
  * Linux Information
-- 
1.6.2.4

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


[U-Boot] [PATCH 1/6] da850: add new config file for AM18xx

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

add new configuration file da850_am18xxevm.h for AM18xx boards
which are based on da850 SOC. AM18xx has WINBOND spi flash which
is indicated in the config file. And make appropriate changes in
board.cfg for building.

Signed-off-by: Nagabhushana Netagunte 
---
 boards.cfg|1 +
 include/configs/da850_am18xxevm.h |  245 +
 2 files changed, 246 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/da850_am18xxevm.h

diff --git a/boards.cfg b/boards.cfg
index 674e790..d437341 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -116,6 +116,7 @@ pm9263   arm arm926ejs   pm9263 
 ronetix
 pm9g45   arm arm926ejs   pm9g45  
ronetixat91pm9g45:AT91SAM9G45
 da830evm arm arm926ejs   da8xxevm
davincidavinci
 da850evm arm arm926ejs   da8xxevm
davincidavinci
+da850_am18xxevm  arm arm926ejs   da8xxevm
davincidavinci
 hawkboardarm arm926ejs   da8xxevm
davincidavinci
 hawkboard_nand   arm arm926ejs   da8xxevm
davincidavinci hawkboard:NAND_U_BOOT
 hawkboard_uart   arm arm926ejs   da8xxevm
davincidavinci hawkboard:UART_U_BOOT
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
new file mode 100644
index 000..92b83ff
--- /dev/null
+++ b/include/configs/da850_am18xxevm.h
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on davinci_dvevm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_USE_SPIFLASH
+
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_DA850_EVM
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE   0xc108
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  (64 << 20) /* SDRAM size 64MB */
+#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
+
+/* memtest start addr */
+#define CONFIG_SYS_MEMTEST_START   (PHYS_SDRAM_1 + 0x200)
+
+/* memtest will be run on 16MB */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x200 + 16*1024*1024)
+
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX  1   /* use UART0 for console */
+#define CONFIG_BAUDRATE115200  /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_WINBOND
+#define CONFIG_DAVINCI_SPI
+#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
+#define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
+#define CONFIG_SF_DEFAULT_SPEED3000
+#define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
+
+/*
+ * I2C Configuration
+ */
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_DAVINCI_I2C
+#define CONFIG_SYS_I2C_SPEED   25000
+#define CONFIG_S

[U-Boot] [PATCH] da830: add support to read mac addr from EEPROM

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

da830 boards have mac address stored in I2C EEPROM. This patch
adds support to restore mac address from EEPROM if environment variable
'ethaddr' is not set.

Signed-off-by: Sudhakar Rajashekhara 
Signed-off-by: Nagabhushana Netagunte 
---
 board/davinci/da8xxevm/da830evm.c |   20 
 include/configs/da830evm.h|1 +
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
index 0650653..69ed293 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -188,6 +188,26 @@ int board_init(void)
 
 #define PHY_SW_I2C_ADDR0x5f /* Address of PHY on i2c bus */
 
+int misc_init_r(void)
+{
+   uint8_t eeprom_enetaddr[6];
+   uint8_t val[2];
+
+   if (!eth_getenv_enetaddr("ethaddr", eeprom_enetaddr)) {
+   /* Read Ethernet MAC address from EEPROM if available. */
+   if (dvevm_read_mac_address(eeprom_enetaddr))
+   /* Set Ethernet MAC address from EEPROM */
+   davinci_sync_env_enetaddr(eeprom_enetaddr);
+   }
+
+   val[0] = 0x01;
+   val[1] = 0x23;
+
+   if (i2c_write(PHY_SW_I2C_ADDR, 0, 0, val, 2))
+   printf("Ethernet switch start failed!\n");
+
+}
+
 /*
  * Initializes on-board ethernet controllers.
  */
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 66fdea2..a451513 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -160,6 +160,7 @@
 /*
  * U-Boot general configuration
  */
+#define CONFIG_MISC_INIT_R
 #undef CONFIG_USE_IRQ  /* No IRQ/FIQ in U-Boot */
 #undef CONFIG_MISC_INIT_R
 #undef CONFIG_BOOTDELAY
-- 
1.6.2.4

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


Re: [U-Boot] [PATCH 2/2] Makefile: remove mx31pdk exception

2011-09-30 Thread Fabio Estevam
Hi Wolfgang,

On Tue, Aug 30, 2011 at 7:52 AM, Stefano Babic  wrote:
> An entry in the main Makefile for the mx31pdk board is not
> necessary, and the board is added to boards.cfg as all
> other targets.
>
> Signed-off-by: Stefano Babic 
> CC: Wolfgang Denk 
> ---
>  Makefile   |   10 --
>  boards.cfg |    2 ++
>  2 files changed, 2 insertions(+), 10 deletions(-)

Any issue with this patch? I haven't seen it applied yet.

Regards,

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


[U-Boot] [PATCH 0/4] davinci: addition of emac features

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

These patches add features relating davinci emac driver.

First patch adds more features for EMAC-PHY auto-negotiation.
Second patch adds support for RMII in da830. Patch no.3
adds support in emac driver to work with any of the active
PHYs. Last patch removes config CONFIG_EMAC_MDIO_PHY_NUM
which becomes obsolete due to patch number 3.

Nagabhushana Netagunte (4):
  davinci: emac: add new features to autonegotiate for EMAC
  da830: emac: add support for RMII
  davinci: emac: add support for more than 1 PHYs
  davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM

 arch/arm/cpu/arm926ejs/davinci/et1011c.c  |6 +-
 arch/arm/include/asm/arch-davinci/emac_defs.h |4 -
 drivers/net/davinci_emac.c|  206 -
 include/configs/da830evm.h|2 +-
 include/configs/da850_am18xxevm.h |2 +-
 include/configs/da850_l138evm.h   |2 +-
 include/configs/davinci_dm365evm.h|1 -
 include/configs/davinci_dm6467Tevm.h  |1 -
 include/configs/davinci_dm6467evm.h   |1 -
 include/configs/davinci_dvevm.h   |1 -
 include/configs/davinci_schmoogie.h   |1 -
 include/configs/davinci_sffsdr.h  |1 -
 include/configs/davinci_sonata.h  |1 -
 include/configs/ea20.h|1 -
 include/configs/hawkboard.h   |1 -
 include/miiphy.h  |   67 -
 16 files changed, 203 insertions(+), 95 deletions(-)

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


[U-Boot] [PATCH 2/4] da830: emac: add support for RMII

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

add support for RMII in davinci EMAC driver for da830. da850 RMII support
existed already in the driver. New configs are added to extend this support
for da830.

Signed-off-by: Sudhakar Rajashekhara 
Signed-off-by: Nagabhushana Netagunte 
---
 drivers/net/davinci_emac.c|6 +++---
 include/configs/da830evm.h|1 +
 include/configs/da850_am18xxevm.h |1 +
 include/configs/da850_l138evm.h   |1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index be3aabf..0d67a06 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -246,7 +246,7 @@ static int gen_get_link_speed(int phy_addr)
if (davinci_eth_phy_read(phy_addr, MII_STATUS_REG, &tmp) &&
(tmp & 0x04)) {
 #if defined(CONFIG_DRIVER_TI_EMAC_USE_RMII) && \
-   defined(CONFIG_MACH_DAVINCI_DA850_EVM)
+   defined(CONFIG_MACH_DAVINCI_DA8XX_EVM)
davinci_eth_phy_read(phy_addr, MII_LPA, &tmp);
 
/* Speed doesn't matter, there is no setting for it in EMAC. */
@@ -381,7 +381,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
 #endif
 
 #if defined(CONFIG_DRIVER_TI_EMAC_USE_RMII) && \
-   defined(CONFIG_MACH_DAVINCI_DA850_EVM)
+   defined(CONFIG_MACH_DAVINCI_DA8XX_EVM)
adap_ewrap->c0rxen = adap_ewrap->c1rxen = adap_ewrap->c2rxen = 0;
adap_ewrap->c0txen = adap_ewrap->c1txen = adap_ewrap->c2txen = 0;
adap_ewrap->c0miscen = adap_ewrap->c1miscen = adap_ewrap->c2miscen = 0;
@@ -541,7 +541,7 @@ static void davinci_eth_close(struct eth_device *dev)
 #endif
 
 #if defined(CONFIG_DRIVER_TI_EMAC_USE_RMII) && \
-   defined(CONFIG_MACH_DAVINCI_DA850_EVM)
+   defined(CONFIG_MACH_DAVINCI_DA8XX_EVM)
adap_ewrap->c0rxen = adap_ewrap->c1rxen = adap_ewrap->c2rxen = 0;
adap_ewrap->c0txen = adap_ewrap->c1txen = adap_ewrap->c2txen = 0;
adap_ewrap->c0miscen = adap_ewrap->c1miscen = adap_ewrap->c2miscen = 0;
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index a451513..b61443a 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -36,6 +36,7 @@
 #define CONFIG_MACH_DAVINCI_DA830_EVM
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_MACH_DAVINCI_DA8XX_EVM
 #define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ  2400
 #define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
index b525f14..8a65956 100644
--- a/include/configs/da850_am18xxevm.h
+++ b/include/configs/da850_am18xxevm.h
@@ -36,6 +36,7 @@
 #define CONFIG_MACH_DAVINCI_DA850_EVM
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_MACH_DAVINCI_DA8XX_EVM
 #define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ  2400
 #define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
index 9e4a652..afe00e8 100644
--- a/include/configs/da850_l138evm.h
+++ b/include/configs/da850_l138evm.h
@@ -36,6 +36,7 @@
 #define CONFIG_MACH_DAVINCI_DA850_EVM
 #define CONFIG_ARM926EJS   /* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_MACH_DAVINCI_DA8XX_EVM
 #define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ  2400
 #define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
-- 
1.6.2.4

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


[U-Boot] [PATCH 3/4] davinci: emac: add support for more than 1 PHYs

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

add support for more than 1 PHYs. Many of the davinci platforms have more
than 1 PHYs on thier board. This patch extends support in davinci emac
driver for upto 3 PHYs.

Signed-off-by: Sudhakar Rajashekhara 
Signed-off-by: Nagabhushana Netagunte 
---
 drivers/net/davinci_emac.c |  148 +++-
 1 files changed, 90 insertions(+), 58 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 0d67a06..ed8fbfe 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -81,9 +81,12 @@ static int   emac_rx_queue_active = 0;
 static unsigned char   emac_rx_buffers[EMAC_MAX_RX_BUFFERS * 
(EMAC_MAX_ETHERNET_PKT_SIZE + EMAC_PKT_ALIGN)];
 
 /* PHY address for a discovered PHY (0xff - not found) */
-static volatile u_int8_t   active_phy_addr = 0xff;
+static volatile u_int8_t   active_phy_addr[3] = { 0xff, 0xff, 0xff };
 
-phy_t  phy;
+/* number of PHY found active */
+static volatile u_int8_t   num_phy;
+
+phy_t  phy[3];
 
 static int davinci_eth_set_mac_addr(struct eth_device *dev)
 {
@@ -147,27 +150,30 @@ static int davinci_eth_phy_detect(void)
 {
u_int32_t   phy_act_state;
int i;
+   int j;
+   unsigned intcount = 0;
+
+   active_phy_addr[0] = 0xff;
+   active_phy_addr[1] = 0xff;
+   active_phy_addr[2] = 0xff;
 
-   active_phy_addr = 0xff;
+   udelay(1000);
+   phy_act_state = readl(&adap_mdio->ALIVE);
 
-   phy_act_state = readl(&adap_mdio->ALIVE) & EMAC_MDIO_PHY_MASK;
if (phy_act_state == 0)
-   return(0);  /* No active PHYs */
+   return 0;   /* No active PHYs */
 
debug_emac("davinci_eth_phy_detect(), ALIVE = 0x%08x\n", phy_act_state);
 
-   for (i = 0; i < 32; i++) {
+   for (i = 0, j = 0; i < 32; i++)
if (phy_act_state & (1 << i)) {
-   if (phy_act_state & ~(1 << i))
-   return(0);  /* More than one PHY */
-   else {
-   active_phy_addr = i;
-   return(1);
-   }
+   count++;
+   active_phy_addr[j++] = i;
}
-   }
 
-   return(0);  /* Just to make GCC happy */
+   num_phy = count;
+
+   return count;
 }
 
 
@@ -236,7 +242,18 @@ static int gen_is_phy_connected(int phy_addr)
 {
u_int16_t   dummy;
 
-   return(davinci_eth_phy_read(phy_addr, MII_PHYSID1, &dummy));
+   return davinci_eth_phy_read(phy_addr, PHY_PHYIDR1, &dummy);
+}
+
+static int get_active_phy(void)
+{
+   int i;
+
+   for (i = 0; i < num_phy; i++)
+   if (phy[i].get_link_speed(active_phy_addr[i]))
+   return i;
+
+   return -1;  /* Return error if no link */
 }
 
 static int gen_get_link_speed(int phy_addr)
@@ -362,6 +379,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
dv_reg_paddr;
u_int32_t   clkdiv, cnt;
volatile emac_desc  *rx_desc;
+   int index;
 
debug_emac("+ emac_open\n");
 
@@ -460,7 +478,8 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
/* We need to wait for MDIO to start */
udelay(1000);
 
-   if (!phy.get_link_speed(active_phy_addr))
+   index = get_active_phy();
+   if (index == -1)
return(0);
 
emac_gigabit_enable();
@@ -559,12 +578,12 @@ static int davinci_eth_send_packet (struct eth_device 
*dev,
volatile void *packet, int length)
 {
int ret_status = -1;
-
+   int index;
tx_send_loop = 0;
 
-   /* Return error if no link */
-   if (!phy.get_link_speed (active_phy_addr)) {
-   printf ("WARN: emac_send_packet: No link\n");
+   index = get_active_phy();
+   if (index == -1) {
+   printf(" WARN: emac_send_packet: No link\n");
return (ret_status);
}
 
@@ -588,7 +607,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
 
/* Wait for packet to complete or link down */
while (1) {
-   if (!phy.get_link_speed (active_phy_addr)) {
+   if (!phy[index].get_link_speed(active_phy_addr[index])) {
davinci_eth_ch_teardown (EMAC_CH_TX);
return (ret_status);
}
@@ -685,6 +704,7 @@ int davinci_emac_initialize(void)
u_int32_t   phy_id;
u_int16_t   tmp;
int i;
+   int ret;
struct eth_device *dev;
 
dev = malloc(sizeof *dev);
@@ -709,7 +729,7 @@ int davinci_emac_initialize(void)
for (i = 

[U-Boot] [PATCH 1/4] davinci: emac: add new features to autonegotiate for EMAC

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

add more features like DUPLEX, 100MB link speed etc to auto negotiate
in EMAC driver. EMAC controller autonegotiates for these features with
PHYs which are on the board.

Signed-off-by: Sudhakar Rajashekhara 
Signed-off-by: Nagabhushana Netagunte 
---
 drivers/net/davinci_emac.c |   38 +
 include/miiphy.h   |   67 +++-
 2 files changed, 98 insertions(+), 7 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index c0b8929..be3aabf 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -279,20 +279,46 @@ static int gen_get_link_speed(int phy_addr)
 static int gen_auto_negotiate(int phy_addr)
 {
u_int16_t   tmp;
+   u_int16_t   val;
+   unsigned long   cntr = 0;
 
-   if (!davinci_eth_phy_read(phy_addr, MII_BMCR, &tmp))
+   if (!davinci_eth_phy_read(phy_addr, PHY_BMCR, &tmp))
+   return 0;
+
+   val = tmp | PHY_BMCR_DPLX | PHY_BMCR_AUTON |
+   PHY_BMCR_100MB;
+   davinci_eth_phy_write(phy_addr, PHY_BMCR, val);
+
+   if (!davinci_eth_phy_read(phy_addr, PHY_ANAR, &val))
+   return 0;
+
+   val |= (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX | PHY_ANLPAR_10FD |
+   PHY_ANLPAR_10);
+   davinci_eth_phy_write(phy_addr, PHY_ANAR, val);
+
+   if (!davinci_eth_phy_read(phy_addr, PHY_BMCR, &tmp))
return(0);
 
/* Restart Auto_negotiation  */
-   tmp |= BMCR_ANENABLE;
-   davinci_eth_phy_write(phy_addr, MII_BMCR, tmp);
+   tmp |= PHY_BMCR_RST_NEG;
+   davinci_eth_phy_write(phy_addr, PHY_BMCR, tmp);
 
/*check AutoNegotiate complete */
-   udelay (1);
-   if (!davinci_eth_phy_read(phy_addr, MII_BMSR, &tmp))
+   do {
+   udelay(4);
+   if (!davinci_eth_phy_read(phy_addr, PHY_BMSR, &tmp))
+   return 0;
+
+   if (tmp & PHY_BMSR_AUTN_COMP)
+   break;
+
+   cntr++;
+   } while (cntr < 200);
+
+   if (!davinci_eth_phy_read(phy_addr, PHY_BMSR, &tmp))
return(0);
 
-   if (!(tmp & BMSR_ANEGCOMPLETE))
+   if (!(tmp & PHY_BMSR_AUTN_COMP))
return(0);
 
return(gen_get_link_speed(phy_addr));
diff --git a/include/miiphy.h b/include/miiphy.h
index 7e70cf8..a9be741 100644
--- a/include/miiphy.h
+++ b/include/miiphy.h
@@ -118,7 +118,72 @@ int bb_miiphy_write(const char *devname, unsigned char 
addr,
 #define FULL   44
 
 /* phy register offsets */
-#define MII_MIPSCR 0x11
+#define PHY_BMCR   0x00
+#define PHY_BMSR   0x01
+#define PHY_PHYIDR10x02
+#define PHY_PHYIDR20x03
+#define PHY_ANAR   0x04
+#define PHY_ANLPAR 0x05
+#define PHY_ANER   0x06
+#define PHY_ANNPTR 0x07
+#define PHY_ANLPNP 0x08
+#define PHY_1000BTCR   0x09
+#define PHY_1000BTSR   0x0A
+#define PHY_EXSR   0x0F
+#define PHY_PHYSTS 0x10
+#define PHY_MIPSCR 0x11
+#define PHY_MIPGSR 0x12
+#define PHY_DCR0x13
+#define PHY_FCSCR  0x14
+#define PHY_RECR   0x15
+#define PHY_PCSR   0x16
+#define PHY_LBR0x17
+#define PHY_10BTSCR0x18
+#define PHY_PHYCTRL0x19
+
+/* PHY BMCR */
+#define PHY_BMCR_RESET 0x8000
+#define PHY_BMCR_LOOP  0x4000
+#define PHY_BMCR_100MB 0x2000
+#define PHY_BMCR_AUTON 0x1000
+#define PHY_BMCR_POWD  0x0800
+#define PHY_BMCR_ISO   0x0400
+#define PHY_BMCR_RST_NEG   0x0200
+#define PHY_BMCR_DPLX  0x0100
+#define PHY_BMCR_COL_TST   0x0080
+
+#define PHY_BMCR_SPEED_MASK0x2040
+#define PHY_BMCR_1000_MBPS 0x0040
+#define PHY_BMCR_100_MBPS  0x2000
+#define PHY_BMCR_10_MBPS   0x
+
+/* phy BMSR */
+#define PHY_BMSR_100T4 0x8000
+#define PHY_BMSR_100TXF0x4000
+#define PHY_BMSR_100TXH0x2000
+#define PHY_BMSR_10TF  0x1000
+#define PHY_BMSR_10TH  0x0800
+#define PHY_BMSR_EXT_STAT  0x0100
+#define PHY_BMSR_PRE_SUP   0x0040
+#define PHY_BMSR_AUTN_COMP 0x0020
+#define PHY_BMSR_RF0x0010
+#define PHY_BMSR_AUTN_ABLE 0x0008
+#define PHY_BMSR_LS0x0004
+#define PHY_BMSR_JD0x0002
+#define PHY_BMSR_EXT   0x0001
+
+/*phy ANLPAR */
+#define PHY_ANLPAR_NP  0x8000
+#define PHY_ANLPAR_ACK 0x4000
+#define PHY_ANLPAR_RF  0x2000
+#define PHY_ANLPAR_ASYMP   0x0800
+#define PHY_ANLPAR_PAUSE   0x0400
+#define PHY_ANLPAR_T4  0x0200
+#define PHY_ANLPAR_TXFD0x0100
+#define PHY_ANLPAR_TX  0x0080
+#define PHY_ANLPAR_10FD   

[U-Boot] [PATCH 4/4] davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

remove macro CONFIG_EMAC_MDIO_PHY_NUM and depending macro EMAC_MDIO_PHY_NUM
as they are no longer needed with the support for more than 1 PHYs in davinci
emac driver.davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM

Signed-off-by: Nagabhushana Netagunte 
---
 arch/arm/cpu/arm926ejs/davinci/et1011c.c  |6 ++
 arch/arm/include/asm/arch-davinci/emac_defs.h |4 
 drivers/net/davinci_emac.c|   14 +++---
 include/configs/da830evm.h|1 -
 include/configs/da850_am18xxevm.h |1 -
 include/configs/da850_l138evm.h   |1 -
 include/configs/davinci_dm365evm.h|1 -
 include/configs/davinci_dm6467Tevm.h  |1 -
 include/configs/davinci_dm6467evm.h   |1 -
 include/configs/davinci_dvevm.h   |1 -
 include/configs/davinci_schmoogie.h   |1 -
 include/configs/davinci_sffsdr.h  |1 -
 include/configs/davinci_sonata.h  |1 -
 include/configs/ea20.h|1 -
 include/configs/hawkboard.h   |1 -
 15 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/et1011c.c 
b/arch/arm/cpu/arm926ejs/davinci/et1011c.c
index da07345..df35e44 100644
--- a/arch/arm/cpu/arm926ejs/davinci/et1011c.c
+++ b/arch/arm/cpu/arm926ejs/davinci/et1011c.c
@@ -39,11 +39,9 @@ int et1011c_get_link_speed(int phy_addr)
u_int16_t   data;
 
if (davinci_eth_phy_read(phy_addr, MII_STATUS_REG, &data) && (data & 
0x04)) {
-   davinci_eth_phy_read(EMAC_MDIO_PHY_NUM,
-   MII_PHY_CONFIG_REG, &data);
+   davinci_eth_phy_read(phy_addr, MII_PHY_CONFIG_REG, &data);
/* Enable 125MHz clock sourced from PHY */
-   davinci_eth_phy_write(EMAC_MDIO_PHY_NUM,
-   MII_PHY_CONFIG_REG,
+   davinci_eth_phy_write(phy_addr, MII_PHY_CONFIG_REG,
data | PHY_SYS_CLK_EN);
return (1);
}
diff --git a/arch/arm/include/asm/arch-davinci/emac_defs.h 
b/arch/arm/include/asm/arch-davinci/emac_defs.h
index 4a4ee04..21e1fd7 100644
--- a/arch/arm/include/asm/arch-davinci/emac_defs.h
+++ b/arch/arm/include/asm/arch-davinci/emac_defs.h
@@ -84,10 +84,6 @@
 #define EMAC_MDIO_CLOCK_FREQ   200 /* 2.0 MHz */
 #endif
 
-/* PHY mask - set only those phy number bits where phy is/can be connected */
-#define EMAC_MDIO_PHY_NUM   CONFIG_EMAC_MDIO_PHY_NUM
-#define EMAC_MDIO_PHY_MASK  (1 << EMAC_MDIO_PHY_NUM)
-
 /* Ethernet Min/Max packet size */
 #define EMAC_MIN_ETHERNET_PKT_SIZE 60
 #define EMAC_MAX_ETHERNET_PKT_SIZE 1518
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index ed8fbfe..2af7026 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -48,9 +48,9 @@ unsigned int  emac_dbg = 0;
 #define debug_emac(fmt,args...)if (emac_dbg) printf(fmt,##args)
 
 #ifdef DAVINCI_EMAC_GIG_ENABLE
-#define emac_gigabit_enable()  davinci_eth_gigabit_enable()
+#define emac_gigabit_enable(phy_addr)  davinci_eth_gigabit_enable(phy_addr)
 #else
-#define emac_gigabit_enable()  /* no gigabit to enable */
+#define emac_gigabit_enable(phy_addr)  /* no gigabit to enable */
 #endif
 
 static void davinci_eth_mdio_enable(void);
@@ -355,11 +355,11 @@ static int davinci_mii_phy_write(const char *devname, 
unsigned char addr, unsign
 }
 #endif
 
-static void  __attribute__((unused)) davinci_eth_gigabit_enable(void)
+static void  __attribute__((unused)) davinci_eth_gigabit_enable(int phy_addr)
 {
u_int16_t data;
 
-   if (davinci_eth_phy_read(EMAC_MDIO_PHY_NUM, 0, &data)) {
+   if (davinci_eth_phy_read(phy_addr, 0, &data)) {
if (data & (1 << 6)) { /* speed selection MSB */
/*
 * Check if link detected is giga-bit
@@ -482,7 +482,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
if (index == -1)
return(0);
 
-   emac_gigabit_enable();
+   emac_gigabit_enable(active_phy_addr[index]);
 
/* Start receive process */
writel((u_int32_t)emac_rx_desc, &adap_emac->RX0HDP);
@@ -587,7 +587,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
return (ret_status);
}
 
-   emac_gigabit_enable();
+   emac_gigabit_enable(active_phy_addr[index]);
 
/* Check packet size and if < EMAC_MIN_ETHERNET_PKT_SIZE, pad it up */
if (length < EMAC_MIN_ETHERNET_PKT_SIZE) {
@@ -612,7 +612,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
return (ret_status);
}
 
-   emac_gigabit_enable();
+   emac_gigabit_enable(active_phy_addr[index]);
 
if (readl(&adap_emac->TXINTSTATRAW) & 0x01) {
   

[U-Boot] [PATCH] dm644X: revert cache disable patch

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

revert commit 913a39e9aa4d935948d41cd727d53f5878414a77 as cache
disabling is no more needed. Subsequent patches to new cache
management framework has fixed EMAC issue with cache coherency.

Signed-off-by: Nagabhushana Netagunte 
---
 include/configs/davinci_dvevm.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h
index d13ccb5..50e9e3e 100644
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -59,9 +59,6 @@
 #define CONFIG_SYS_HZ_CLOCK2700/* Timer Input clock 
freq */
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SOC_DM644X
-#define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_L2CACHE_OFF
 /**/
 /* EEPROM definitions for Atmel 24C256BN SEEPROM chip */
 /* on Sonata/DV_EVM board. No EEPROM on schmoogie.*/
-- 
1.6.2.4

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


[U-Boot] [PATCH] dm36x: revert cache disable patch

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

revert commit 98c19aff9524e1d0dd6bf39bf7bde5644f121feb as cache
disabling is no more needed. Subsequent patches to new cache
management framework has fixed EMAC issue with cache coherency.

Signed-off-by: Nagabhushana Netagunte 
---
 include/configs/davinci_dm365evm.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/configs/davinci_dm365evm.h 
b/include/configs/davinci_dm365evm.h
index f80de3d..ac3fda2 100644
--- a/include/configs/davinci_dm365evm.h
+++ b/include/configs/davinci_dm365evm.h
@@ -33,9 +33,6 @@
 #define CONFIG_SYS_HZ_CLOCK2400/* timer0 freq */
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SOC_DM365
-#define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_L2CACHE_OFF
 
 /* Memory Info */
 #define CONFIG_NR_DRAM_BANKS   1
-- 
1.6.2.4

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


[U-Boot] [PATCH RFC 3/4] env: implement selective "env default"

2011-09-30 Thread Gerlando Falauto

Signed-off-by: Gerlando Falauto 
---
 README   |2 ++
 common/cmd_nvedit.c  |   38 --
 common/env_common.c  |   13 +
 include/config_cmd_all.h |1 +
 include/environment.h|5 +
 5 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/README b/README
index a43da97..4b28854 100644
--- a/README
+++ b/README
@@ -705,6 +705,8 @@ The following options need to be configured:
CONFIG_CMD_CONSOLEconinfo
CONFIG_CMD_CRC32* crc32
CONFIG_CMD_DATE * support for RTC, date/time...
+   CONFIG_CMD_DEFAULTENV_VARS
+   * Reset individual variables to default
CONFIG_CMD_DHCP * DHCP support
CONFIG_CMD_DIAG * Diagnostics
CONFIG_CMD_DS4510   * ds4510 I2C gpio commands
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 506a251..8636004 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -615,13 +615,36 @@ int envmatch(uchar *s1, int i2)
return -1;
 }
 
-static int do_env_default(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
+static int do_env_default(cmd_tbl_t *cmdtp, int __flag, int argc, char * const 
argv[])
 {
-   if ((argc != 2) || (strcmp(argv[1], "-f") != 0))
-   return cmd_usage(cmdtp);
-
-   set_default_env("## Resetting to default environment\n");
-   return 0;
+   int all = 0, flag = 0;
+   debug("Initial value for argc=%d\n", argc);
+   while (--argc > 0 && **++argv == '-') {
+   char *arg = *argv;
+   while (*++arg) {
+   switch (*arg) {
+   case 'a':   /* default all */
+   all = 1;
+   break;
+   case 'f':   /* force */
+   flag |= H_FORCE;
+   break;
+   default:
+   return cmd_usage(cmdtp);
+   }
+   }
+   }
+   debug("Final value for argc=%d\n", argc);
+   if (all && (argc == 0)) {
+   /* Reset the whole environment */
+   set_default_env("## Resetting to default environment\n");
+   return 0;
+   } else if (!all && (argc > 0)) {
+   /* Reset individual variables */
+   env_default_vars(argc, argv);
+   return 0;
+   }
+   return cmd_usage(cmdtp);
 }
 
 static int do_env_delete(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
@@ -947,6 +970,9 @@ U_BOOT_CMD(
"ask name [message] [size] - ask for environment variable\nenv "
 #endif
"default -f - reset default environment\n"
+#if defined(CONFIG_CMD_DEFAULTENV_VARS)
+   "env default var [...] - reset variable(s) to their default value\n"
+#endif
 #if defined(CONFIG_CMD_EDITENV)
"env edit name - edit environment variable\n"
 #endif
diff --git a/common/env_common.c b/common/env_common.c
index 7e1d824..c2769a8 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -207,6 +207,19 @@ void set_default_env(const char *s)
gd->flags |= GD_FLG_ENV_READY;
 }
 
+#ifdef CONFIG_CMD_DEFAULTENV_VARS
+
+/* [re]set individual variables to their value in the default environment */
+int env_default_vars(int nvars, char * const vars[])
+{
+   /* Special use-case: import from default environment
+  (and use \0 as a separator) */
+   return himport_ex(&env_htab, (const char *)default_environment, 
sizeof(default_environment), '\0', H_NOCLEAR,
+nvars, vars, env_check_apply);
+}
+
+#endif /* CONFIG_CMD_DEFAULTENV_VARS */
+
 /*
  * Check if CRC is valid and (if yes) import the environment.
  * Note that "buf" may or may not be aligned.
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 9716f9c..e728eae 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -25,6 +25,7 @@
 #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */
 #define CONFIG_CMD_CONSOLE /* coninfo  */
 #define CONFIG_CMD_DATE/* support for RTC, date/time...*/
+#define CONFIG_CMD_DEFAULTENV_VARS /* default individ variables */
 #define CONFIG_CMD_DHCP/* DHCP Support */
 #define CONFIG_CMD_DIAG/* Diagnostics  */
 #define CONFIG_CMD_DISPLAY /* Display support  */
diff --git a/include/environment.h b/include/environment.h
index 02c3488..7555c3b 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -171,6 +171,11 @@ void env_crc_update (void);
 /* [re]set to the default environment */
 void set_default_env(const char *s);
 
+#ifdef CONFIG_CMD_DEFAULTENV_VARS
+/* [re]set individual variables to their value in the defaul

[U-Boot] [PATCH RFC 4/4] env: implement "env import -n var[, var...]"

2011-09-30 Thread Gerlando Falauto
Implemented selective importing of variables in
env import

Signed-off-by: Gerlando Falauto 
---
 common/cmd_nvedit.c |   31 ++-
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 8636004..757a088 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -804,15 +804,18 @@ sep_err:
  * size:   length of input data; if missing, proper '\0'
  * termination is mandatory
  */
-static int do_env_import(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
+#define MAX_NVARS 16
+static int do_env_import(cmd_tbl_t *cmdtp, int __flag, int argc, char * const 
argv[])
 {
char*cmd, *addr;
charsep = '\n';
int chk = 0;
int fmt = 0;
-   int del = 0;
+   int flag = H_NOCLEAR;
size_t  size;
-
+   char*vars[MAX_NVARS];
+   int nvars = 0;
+   char*s;
cmd = *argv;
 
while (--argc > 0 && **++argv == '-') {
@@ -836,7 +839,24 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv
sep = '\n';
break;
case 'd':
-   del = 1;
+   flag &= ~H_NOCLEAR;
+   break;
+   case 'f':
+   flag |= H_FORCE;
+   break;
+   case 'n':
+   s = *++argv;
+   argc--;
+   do {
+   if (nvars >= MAX_NVARS)
+   {
+   printf("No more than %d 
variables can be imported at a single time\n", MAX_NVARS);
+   return 1;
+   }
+   vars[nvars++] = strsep(&s, ",");
+   debug("Considering variable %s\n", 
vars[nvars-1]);
+   } while (s);
+   debug("Importing a total of %d variables\n", 
nvars);
break;
default:
return cmd_usage(cmdtp);
@@ -887,7 +907,8 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv
addr = (char *)ep->data;
}
 
-   if (himport_r(&env_htab, addr, size, sep, del ? 0 : H_NOCLEAR) == 0) {
+   if (himport_ex(&env_htab, addr, size, sep, flag, 
+  nvars, vars, NULL) == 0) {
error("Environment import failed: errno = %d\n", errno);
return 1;
}
-- 
1.7.1

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


[U-Boot] [PATCH RFC 0/4] Reworking of env

2011-09-30 Thread Gerlando Falauto
Hi all,

trying to follow Wolfgang Denk's suggestion in
http://lists.denx.de/pipermail/u-boot/2011-September/102118.html:

>I agree that it makes sense to generalize and clean up this interface.
>It makes sense to select individual variables, and it makes sense to
>unify the "-f" handling to enforce actions on protected variables
>(while without "-f" only actions on the "normal" variables should be
>done).

>I can even imagine introducing a new variable that contains the name
>of the write-protected variables (and probably other properties, like
>being excluded from saveenv, etc.) - this has been discussed a number
>of times before, now we have the code base in place to actually
>implement it.

>All we need to do is extend the struct entry (in "include/search.h")
>by an "int flags"), and we can there register properties like
>read-only, don't-save etc.  In a first step this could be added
>transparently - so we could remove all the special handling of
>"ethaddr", "serial#" etc. in common/cmd_nvedit.c; then we could unify
>this to include "eth1addr" etc as well; then  we could extend it to
>read the names of such variables and their properties from a variable,
>etc.

here I am proposing a set of changes in the behaviour of the environment 
import/set_to_default functions.

Since a PATCH-er is worth a thousand words, I decided to take the risk 
and implement it first so to get your feedback on code rather than words...

===
PATCH 1
===
The most shocking change lies in the "new" himport_ex() function, which
has 3 new arguments:

1-2) "nvars", "vars", number and list of variables to take into account (0 
means ALL)

3) "apply" callback function which is in charge of checking whether a 
variable can be overwritten, and possibly immediately apply the changes. 
This parameter would be either set to NULL (in which case nothing should 
change wrt to the past -- i.e. environment is blindly imported) or to 
"env_check_apply()" function, whose code was taken away from _do_env_set().
This would be useful, for instance, for "baudrate" or "stdin,stderr,stdout", 
whose changes would not otherwise be effective until the next reboot.

The idea is that there should be a single place where all the checks are
to be performed. So the same function env_check_apply() is called from 
_do_env_set() as well (thus keeping the previous behavior).

I know we're talking about heavy changes here... this is a just a draft -- 
I would just like some feedback about the whole idea, before putting more 
time into it.

===
PATCH 2
===
Here I added the same behaviour when deleting variables.
Not quite sure whether this makes sense or not.

===
PATCH 3
===
Here I added the code for setting to default individual variables

===
PATCH 4
===
Here I implemented the code for importing individual variables
(and also taking into account "-f" for forcing).

Thank you for your patience,
Gerlando Falauto

Gerlando Falauto (4):
  Groundwork for generalization of env interface
  env: check and apply changes on delete/destroy
  env: implement selective "env default"
  env: implement "env import -n var[,var...]"

 README   |2 +
 common/cmd_nvedit.c  |  221 +++--
 common/env_common.c  |   28 ++-
 include/config_cmd_all.h |1 +
 include/environment.h|7 ++
 include/search.h |   19 -
 lib/hashtable.c  |   67 +--
 7 files changed, 266 insertions(+), 79 deletions(-)

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


[U-Boot] [PATCH RFC 2/4] env: check and apply changes on delete/destroy

2011-09-30 Thread Gerlando Falauto

Signed-off-by: Gerlando Falauto 
---
 common/cmd_nvedit.c |2 +-
 include/search.h|6 --
 lib/hashtable.c |   19 +--
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 05e365a..506a251 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -365,7 +365,7 @@ int _do_env_set (int flag, int argc, char * const argv[])
 
/* Delete only ? */
if ((argc < 3) || argv[2] == NULL) {
-   int rc = hdelete_r(name, &env_htab);
+   int rc = hdelete_r(name, &env_htab, NULL);
return !rc;
}
 
diff --git a/include/search.h b/include/search.h
index 4d5b082..cb30b67 100644
--- a/include/search.h
+++ b/include/search.h
@@ -68,7 +68,8 @@ struct hsearch_data {
 extern int hcreate_r(size_t __nel, struct hsearch_data *__htab);
 
 /* Destroy current internal hashing table.  */
-extern void hdestroy_r(struct hsearch_data *__htab);
+extern void hdestroy_r(struct hsearch_data *__htab,
+  apply_cb apply);
 
 /*
  * Search for entry matching ITEM.key in internal hash table.  If
@@ -93,7 +94,8 @@ extern int hstrstr_r(const char *__match, int __last_idx, 
ENTRY ** __retval,
struct hsearch_data *__htab);
 
 /* Search and delete entry matching ITEM.key in internal hash table. */
-extern int hdelete_r(const char *__key, struct hsearch_data *__htab);
+extern int hdelete_r(const char *__key, struct hsearch_data *__htab,
+apply_cb apply);
 
 extern ssize_t hexport_r(struct hsearch_data *__htab,
 const char __sep, char **__resp, size_t __size);
diff --git a/lib/hashtable.c b/lib/hashtable.c
index b088168..1b65b43 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -140,7 +140,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab)
  * be freed and the local static variable can be marked as not used.
  */
 
-void hdestroy_r(struct hsearch_data *htab)
+void hdestroy_r(struct hsearch_data *htab,
+   int(*apply)(const char *, const char *, const char *, int))
 {
int i;
 
@@ -154,7 +155,10 @@ void hdestroy_r(struct hsearch_data *htab)
for (i = 1; i <= htab->size; ++i) {
if (htab->table[i].used > 0) {
ENTRY *ep = &htab->table[i].entry;
-
+   if (apply != NULL) {
+   /* deletion is always forced */
+   apply(ep->key, ep->data, NULL, H_FORCE);
+   }
free((void *)ep->key);
free(ep->data);
}
@@ -399,7 +403,8 @@ int hsearch_r(ENTRY item, ACTION action, ENTRY ** retval,
  * do that.
  */
 
-int hdelete_r(const char *key, struct hsearch_data *htab)
+int hdelete_r(const char *key, struct hsearch_data *htab,
+ int(*apply)(const char *, const char *, const char *, int))
 {
ENTRY e, *ep;
int idx;
@@ -415,7 +420,9 @@ int hdelete_r(const char *key, struct hsearch_data *htab)
 
/* free used ENTRY */
debug("hdelete: DELETING key \"%s\"\n", key);
-
+   if (apply != NULL) {
+   apply(ep->key, ep->data, NULL, H_FORCE);
+   }
free((void *)ep->key);
free(ep->data);
htab->table[idx].used = -1;
@@ -678,7 +685,7 @@ int himport_ex(struct hsearch_data *htab,
debug("Destroy Hash Table: %p table = %p\n", htab,
   htab->table);
if (htab->table)
-   hdestroy_r(htab);
+   hdestroy_r(htab, apply);
}
 
/*
@@ -744,7 +751,7 @@ int himport_ex(struct hsearch_data *htab,
if (!process_var(name, nvars, vars))
continue;
 
-   if (hdelete_r(name, htab) == 0)
+   if (hdelete_r(name, htab, apply) == 0)
debug("DELETE ERROR 
##\n");
 
continue;
-- 
1.7.1

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


[U-Boot] [PATCH RFC 1/4] Groundwork for generalization of env interface

2011-09-30 Thread Gerlando Falauto

Signed-off-by: Gerlando Falauto 
---
 common/cmd_nvedit.c   |  150 ++---
 common/env_common.c   |   15 -
 include/environment.h |2 +
 include/search.h  |   13 
 lib/hashtable.c   |   48 
 5 files changed, 169 insertions(+), 59 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index e8b116d..05e365a 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -194,32 +194,23 @@ static int do_env_grep (cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[
 #endif
 
 /*
- * Set a new environment variable,
- * or replace or delete an existing one.
+ * Performs consistency checking before setting, replacing,
+ * or deleting an environment variable, then (if successful)
+ * apply the changes to internals so to make them effective.
+ * Code for this function was taken out of _do_env_set(),
+ * which now calls it.
+ * Also called as a callback function by himport_ex().
+ * Returns 0 in case of success, 1 in case of failure.
+ * When (flag & H_FORCE) is set, force overwriting of
+ * write-once variables.
  */
 
-int _do_env_set (int flag, int argc, char * const argv[])
+int env_check_apply(const char *name, const char *oldval,
+   const char *newval, int flag)
 {
bd_t  *bd = gd->bd;
-   int   i, len;
+   int   i;
int   console = -1;
-   char  *name, *value, *s;
-   ENTRY e, *ep;
-
-   name = argv[1];
-
-   if (strchr(name, '=')) {
-   printf("## Error: illegal character '=' in variable name 
\"%s\"\n", name);
-   return 1;
-   }
-
-   env_id++;
-   /*
-* search if variable with this name already exists
-*/
-   e.key = name;
-   e.data = NULL;
-   hsearch_r(e, FIND, &ep, &env_htab);
 
/* Check for console redirection */
if (strcmp(name, "stdin") == 0)
@@ -230,22 +221,22 @@ int _do_env_set (int flag, int argc, char * const argv[])
console = stderr;
 
if (console != -1) {
-   if (argc < 3) { /* Cannot delete it! */
+   if ((newval == NULL) || (*newval == '\0')) {/* 
Cannot delete it! */
printf("Can't delete \"%s\"\n", name);
return 1;
}
 
 #ifdef CONFIG_CONSOLE_MUX
-   i = iomux_doenv(console, argv[2]);
+   i = iomux_doenv(console, newval);
if (i)
return i;
 #else
/* Try assigning specified device */
-   if (console_assign(console, argv[2]) < 0)
+   if (console_assign(console, newval) < 0)
return 1;
 
 #ifdef CONFIG_SERIAL_MULTI
-   if (serial_assign(argv[2]) < 0)
+   if (serial_assign(newval) < 0)
return 1;
 #endif
 #endif /* CONFIG_CONSOLE_MUX */
@@ -255,23 +246,27 @@ int _do_env_set (int flag, int argc, char * const argv[])
 * Some variables like "ethaddr" and "serial#" can be set only
 * once and cannot be deleted; also, "ver" is readonly.
 */
-   if (ep) {   /* variable exists */
+   if (oldval != NULL) { /* variable exists */
 #ifndef CONFIG_ENV_OVERWRITE
-   if ((strcmp(name, "serial#") == 0) ||
+   if ( ((flag & H_FORCE) == 0) &&
+   ((strcmp(name, "serial#") == 0) ||
((strcmp(name, "ethaddr") == 0)
 #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
-&& (strcmp(ep->data, MK_STR(CONFIG_ETHADDR)) != 0)
+&& (strcmp(oldval, MK_STR(CONFIG_ETHADDR)) != 0)
 #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */
) ) {
printf("Can't overwrite \"%s\"\n", name);
return 1;
}
 #endif
+   }
+   if ((oldval != NULL) /* variable exists */
+   || ((flag & H_NOCLEAR) == 0)) { /* or we are in a scratched-out 
environment */
/*
 * Switch to new baudrate if new baudrate is supported
 */
if (strcmp(name, "baudrate") == 0) {
-   int baudrate = simple_strtoul(argv[2], NULL, 10);
+   int baudrate = simple_strtoul(newval, NULL, 10);
int i;
for (i = 0; i < N_BAUDRATES; ++i) {
if (baudrate == baudrate_table[i])
@@ -282,6 +277,10 @@ int _do_env_set (int flag, int argc, char * const argv[])
baudrate);
return 1;
}
+   if (gd->baudrate == baudrate) {
+   /* In case of unchanged baudrate, let's just 
say it's OK */
+   return 0;
+   }
printf ("## Swit

[U-Boot] [PATCH v2] feature additions and fixes for da830

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

Changes from last submission:-

This patch series had 5 patches. 3 patches got accepted.
One patch relating to disabling cache is dropped as we
dont need that patch anymore. The patch which remained
in this series adds NAND boot mode for da830. Comment 
relating this patch is also addressed.


Nagabhushana Netagunte (1):
  da830: add support for NAND boot mode

 board/davinci/da8xxevm/da830evm.c |   63 +
 include/configs/da830evm.h|4 ++-
 2 files changed, 66 insertions(+), 1 deletions(-)

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


[U-Boot] [PATCH v2] da830: add support for NAND boot mode

2011-09-30 Thread nagabhushana.netagunte
From: Nagabhushana Netagunte 

Add support for enabling NAND boot mode in configuration file and
add correspanding pinmux support, nand initialize function in board file.
Since the environment variable are stored in first block
CONFIG_ENV_OFFSET is set to offset 0 from (512 << 10) and also the
size required for environment variables not more than 10KB
the CONFIG_ENV_SIZE is set to 10KB from (512 << 10).

Signed-off-by: Sudhakar Rajashekhara 
Signed-off-by: Nagabhushana Netagunte 
---
 board/davinci/da8xxevm/da830evm.c |   63 +
 include/configs/da830evm.h|4 ++-
 2 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
index 69ed293..b876ada 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -40,6 +40,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -98,6 +100,56 @@ static const struct pinmux_config i2c_pins[] = {
{ pinmux(8), 2, 4 }
 };
 
+#ifdef CONFIG_USE_NAND
+/* NAND pin muxer settings */
+const struct pinmux_config aemif_pins[] = {
+   { pinmux(13), 1, 6 },
+   { pinmux(13), 1, 7 },
+   { pinmux(14), 1, 0 },
+   { pinmux(14), 1, 1 },
+   { pinmux(14), 1, 2 },
+   { pinmux(14), 1, 3 },
+   { pinmux(14), 1, 4 },
+   { pinmux(14), 1, 5 },
+   { pinmux(14), 1, 6 },
+   { pinmux(14), 1, 7 },
+   { pinmux(15), 1, 0 },
+   { pinmux(15), 1, 1 },
+   { pinmux(15), 1, 2 },
+   { pinmux(15), 1, 3 },
+   { pinmux(15), 1, 4 },
+   { pinmux(15), 1, 5 },
+   { pinmux(15), 1, 6 },
+   { pinmux(15), 1, 7 },
+   { pinmux(16), 1, 0 },
+   { pinmux(16), 1, 1 },
+   { pinmux(16), 1, 2 },
+   { pinmux(16), 1, 3 },
+   { pinmux(16), 1, 4 },
+   { pinmux(16), 1, 5 },
+   { pinmux(16), 1, 6 },
+   { pinmux(16), 1, 7 },
+   { pinmux(17), 1, 0 },
+   { pinmux(17), 1, 1 },
+   { pinmux(17), 1, 2 },
+   { pinmux(17), 1, 3 },
+   { pinmux(17), 1, 4 },
+   { pinmux(17), 1, 5 },
+   { pinmux(17), 1, 6 },
+   { pinmux(17), 1, 7 },
+   { pinmux(18), 1, 0 },
+   { pinmux(18), 1, 1 },
+   { pinmux(18), 1, 2 },
+   { pinmux(18), 1, 3 },
+   { pinmux(18), 1, 4 },
+   { pinmux(18), 1, 5 },
+   { pinmux(18), 1, 6 },
+   { pinmux(18), 1, 7 },
+   { pinmux(10), 1, 0 }
+};
+#endif
+
+
 /* USB0_DRVVBUS pin muxer settings */
 static const struct pinmux_config usb_pins[] = {
{ pinmux(9), 1, 1 }
@@ -114,6 +166,7 @@ static const struct pinmux_resource pinmuxes[] = {
 #endif
 #ifdef CONFIG_USE_NAND
PINMUX_ITEM(emifa_nand_pins),
+   PINMUX_ITEM(aemif_pins),
 #endif
 #if defined(CONFIG_DRIVER_TI_EMAC)
PINMUX_ITEM(emac_pins),
@@ -184,6 +237,16 @@ int board_init(void)
return(0);
 }
 
+
+#ifdef CONFIG_NAND_DAVINCI
+int board_nand_init(struct nand_chip *nand)
+{
+   davinci_nand_init(nand);
+
+   return 0;
+}
+#endif
+
 #if defined(CONFIG_DRIVER_TI_EMAC)
 
 #define PHY_SW_I2C_ADDR0x5f /* Address of PHY on i2c bus */
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index eaf40ea..0b76dfb 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -106,8 +106,10 @@
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND  /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_OFFSET  (512 << 10)
-#define CONFIG_ENV_SIZE(512 << 10)
+#define CONFIG_ENV_SIZE(10 << 10) /* 10KB */
+#define CONFIG_SYS_NAND_USE_FLASH_BBT
 #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
+#define CONFIG_SYS_NAND_PAGE_2K
 #define CONFIG_SYS_NAND_CS 3
 #define CONFIG_SYS_NAND_BASE   DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
 #define CONFIG_SYS_NAND_PAGE_2K
-- 
1.6.2.4

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


Re: [U-Boot] U-Boot X86 bootstart

2011-09-30 Thread Graeme Russ
Hi Ondrej Kupka

On 30/09/11 21:06, Ondra Kupka wrote:
> Hello,
> 
> I've been digging a bit in X86 bootstart asm code and found possibly wrong
> code, as far as I understand:
> 
> In u-boot/arch/x86/cpu/start.S, there is piece of code to disable caches:
> 
> /* Turn of cache (this might require a 486-class CPU) */ 
> movl%cr0, %eax
> orl $(X86_CR0_NW | X86_CR0_CD), %eax
> movl%eax, %cr0
> wbinvd
> 
> , which perfectly makes sense to me. What doesn't really make sense then is:
>  
> /* Turn of cache (this might require a 486-class CPU) */
> movl%cr0, %eax
> orl $(X86_CR0_NW & X86_CR0_CD), %eax- AND HERE???
> movl%eax, %cr0
> wbinvd
> 
> in start16.S of the same directory.
> 
> Is is wrong or not?

Nice catch :) At least one of them is wrong - I'll sort out a patch (unless
you want to submit a patch yourself that is)

> 
> Thanks a lot,
> Ondrej Kupka

Thank you

Regards,

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


Re: [U-Boot] [PATCH V2] I2C: Add i2c_get/set_speed() to mxc_i2c.c

2011-09-30 Thread Stefano Babic
On 09/30/2011 11:56 AM, Heiko Schocher wrote:
> Hello Stefano,
> 
> Marek Vasut wrote:
>> Signed-off-by: Marek Vasut 
>> Cc: Stefano Babic 
>> Cc: Heiko Schocher 
>> ---
>>  drivers/i2c/mxc_i2c.c |   31 +++
>>  1 files changed, 23 insertions(+), 8 deletions(-)
>>
>> V2: Drop redundant newline
> 
> Could you Ack this patch, or do you want to apply it, so
> you can add my:
> 
> Acked-by: Heiko Schocher 
> 

Thanks, Heiko - I will apply directly to u-boot-imx.

bye,
Stefano


-- 
=
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] [PATCH] I2C: Add i2c_get/set_bus_speed() to mxc_i2c.c

2011-09-30 Thread Stefano Babic
On 09/27/2011 06:29 PM, Marek Vasut wrote:
> Signed-off-by: Marek Vasut 
> Cc: Stefano Babic 
> Cc: Heiko Schocher 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
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] The command "nand write.yaffs" is not working correctly

2011-09-30 Thread Peter Pan
Thank you, Zhengxiong.

The patch seems reasonable. My nand flash has no bad block currently. That
need_skip will skip the oob write part.

I will check that after the golden holiday.
在 2011-9-30 下午5:10,"Jin Zhengxiong-R64188" 写道:
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
On
>> Behalf Of Peter Pan
>> Sent: Wednesday, September 21, 2011 9:09 AM
>> To: u-boot@lists.denx.de
>> Subject: [U-Boot] The command "nand write.yaffs" is not working correctly
>>
>> I'm recently facing a yaffs2 image write problem in u-boot.
>>
>> In u-boot console, I write the yaffs2 image in ram to an already erased
nand
>> flash with command "nand write.yaffs ${loadaddr} ${nandrootoffset}
${filesize}".
>> After that, if I boot using a ramdisk and mount that yaffs2 partition, I
can
>> only see a folder of "lost+fount". I seems nothing has been written into
that
>> partition.
>>
>> But if now I write this image using "nandwrite -a -o /dev/mtd4
yaffs2.img" and
>> mount that partition, it's working.
>>
>> Anyone met that problem already? Or if I did anything wrong?
>
> [Jin Zhengxiong-R64188]
> I once met the similar issue with 2011.03 base and fixed it with following
patch, But
> I didn't do a detail checking for that, FYI...
>
> @@ -499,6 +499,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t
offset, size_t *length,
> return -EINVAL;
> }
>
> +#ifndef CONFIG_CMD_NAND_YAFFS
> if (!need_skip) {
> rval = nand_write (nand, offset, length, buffer);
> if (rval == 0)
> @@ -509,13 +510,12 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t
offset, size_t *length,
> offset, rval);
> return rval;
> }
> -
> +#endif
> while (left_to_write > 0) {
> size_t block_offset = offset & (nand->erasesize - 1);
> size_t write_size;
>
> WATCHDOG_RESET ();
> -
> if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
> printf ("Skip bad block 0x%08llx\n",
> offset & ~(nand->erasesize - 1));
> @@ -546,7 +546,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t
offset, size_t *length,
> ops.oobbuf = ops.datbuf + pagesize;
>
> rval = nand->write_oob(nand, offset, &ops);
> - if (!rval)
> + if ( rval != 0)
> break;
>
> offset += pagesize;
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] da830: emac: add support for RMII

2011-09-30 Thread Mike Frysinger
On Friday, September 30, 2011 07:57:10 nagabhushana.netagu...@ti.com wrote:
> --- a/drivers/net/davinci_emac.c
> +++ b/drivers/net/davinci_emac.c
> @@ -246,7 +246,7 @@ static int gen_get_link_speed(int phy_addr)
>   if (davinci_eth_phy_read(phy_addr, MII_STATUS_REG, &tmp) &&
>   (tmp & 0x04)) {
>  #if defined(CONFIG_DRIVER_TI_EMAC_USE_RMII) && \

there's a common CONFIG_RMII symbol already ...

> - defined(CONFIG_MACH_DAVINCI_DA850_EVM)
> + defined(CONFIG_MACH_DAVINCI_DA8XX_EVM)

maybe it's just me, but board level defines in an emac driver make no sense
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] da830: add support to read mac addr from EEPROM

2011-09-30 Thread Mike Frysinger
On Friday, September 30, 2011 07:39:59 nagabhushana.netagu...@ti.com wrote:
> --- a/board/davinci/da8xxevm/da830evm.c
> +++ b/board/davinci/da8xxevm/da830evm.c

this code looks fine ...

> --- a/include/configs/da830evm.h
> +++ b/include/configs/da830evm.h
>
> +#define CONFIG_MISC_INIT_R
>  #undef CONFIG_MISC_INIT_R

but NAK on this since i'm pretty sure this isn't doing what you're expecting
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/6] da850: add support to read mac address from spi flash

2011-09-30 Thread Mike Frysinger
On Friday, September 30, 2011 07:24:26 nagabhushana.netagu...@ti.com wrote:
> + if (is_multicast_ether_addr(buff) ||
> + is_zero_ether_addr(buff)) {

NAK: use is_valid_ether_addr()

> + sprintf((char *)enetaddr, "%pM", buff);
> +
> + eth_setenv_enetaddr("ethaddr", enetaddr);

NAK: eth_setenv_enetaddr() does the sprintf for you
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] GCC4.6: Squash warning in cmd_ubi.c:

2011-09-30 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/5] GCC4.6: Squash warning in lzo1x_decompress.c

2011-09-30 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] GCC4,6: Squash warning in cmd_nand.c

2011-09-30 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] GCC4.6: Squash warning in vmt.c

2011-09-30 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5 V2] GCC4.6: Squash warning in vmt.c

2011-09-30 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] GCC4.6: Squash warning in nand_bbt.c

2011-09-30 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] I2C: mv_i2c: fix multi-bus init issue

2011-09-30 Thread Lei Wen
When enable the multi-bus, the current_bus is not inited in the original
implementation, which make the i2c operation unpredicatable.

Signed-off-by: Lei Wen 
---
 drivers/i2c/mv_i2c.c |   42 --
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c
index 8eb30e7..729c60a 100644
--- a/drivers/i2c/mv_i2c.c
+++ b/drivers/i2c/mv_i2c.c
@@ -67,6 +67,27 @@ struct mv_i2c {
 };
 
 static struct mv_i2c *base;
+static void i2c_board_init(struct mv_i2c *base)
+{
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+   u32 icr;
+   /*
+* call board specific i2c bus reset routine before accessing the
+* environment, which might be in a chip on that bus. For details
+* about this problem see doc/I2C_Edge_Conditions.
+*
+* disable I2C controller first, otherwhise it thinks we want to
+* talk to the slave port...
+*/
+   icr = readl(&base->icr);
+   writel(readl(&base->icr) & ~(ICR_SCLE | ICR_IUE), &base->icr);
+
+   i2c_init_board();
+
+   writel(icr, &base->icr);
+#endif
+}
+
 #ifdef CONFIG_I2C_MULTI_BUS
 static u32 i2c_regs[CONFIG_MV_I2C_NUM] = CONFIG_MV_I2C_REG;
 static unsigned int bus_initialized[CONFIG_MV_I2C_NUM];
@@ -83,7 +104,7 @@ int i2c_set_bus_num(unsigned int bus)
current_bus = bus;
 
if (!bus_initialized[current_bus]) {
-   i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+   i2c_board_init(base);
bus_initialized[current_bus] = 1;
}
 
@@ -264,28 +285,13 @@ i2c_transfer_finish:
 void i2c_init(int speed, int slaveaddr)
 {
 #ifdef CONFIG_I2C_MULTI_BUS
+   current_bus = 0;
base = (struct mv_i2c *)i2c_regs[current_bus];
 #else
base = (struct mv_i2c *)CONFIG_MV_I2C_REG;
 #endif
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-   u32 icr;
-   /*
-* call board specific i2c bus reset routine before accessing the
-* environment, which might be in a chip on that bus. For details
-* about this problem see doc/I2C_Edge_Conditions.
-*
-* disable I2C controller first, otherwhise it thinks we want to
-* talk to the slave port...
-*/
-   icr = readl(&base->icr);
-   writel(readl(&base->icr) & ~(ICR_SCLE | ICR_IUE), &base->icr);
-
-   i2c_init_board();
-
-   writel(icr, &base->icr);
-#endif
+   i2c_board_init(base);
 }
 
 /*
-- 
1.7.0.4

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


[U-Boot] ubifs: memory possibly not freed

2011-09-30 Thread Renaud Barbier
Looking at the function ubifs_finddir in the file fs/ubifs/ubifs.c,
I was wondering if some memory had not been freed before
the function returns.


287 static int ubifs_finddir(struct super_block *sb, char *dirname,
288  unsigned long root_inum, unsigned long *inum)
289 {
...

299 file = kzalloc(sizeof(struct file), 0);
300 dentry = kzalloc(sizeof(struct dentry), 0);
301 dir = kzalloc(sizeof(struct inode), 0);


336 if ((strncmp(dirname, (char *)dent->name, nm.len) == 
0) &&
337 (strlen(dirname) == nm.len)) {
338 *inum = le64_to_cpu(dent->inum);
339 return 1;
340 }

Line 339 returns without freeing file, dentry and dir.

Maybe wrong but could somebody check that.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] I2C: mv_i2c: fix build issue when enable debug option

2011-09-30 Thread Lei Wen
When DEBUG_I2C is open, the following build issue would shows up.

mv_i2c.c: In function 'i2c_transfer':
mv_i2c.c:257: error: 'ISR' undeclared (first use in this function)
mv_i2c.c:257: error: (Each undeclared identifier is reported only once
mv_i2c.c:257: error: for each function it appears in.)

Signed-off-by: Lei Wen 
---
 drivers/i2c/mv_i2c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c
index dcbe1ae..8eb30e7 100644
--- a/drivers/i2c/mv_i2c.c
+++ b/drivers/i2c/mv_i2c.c
@@ -253,7 +253,7 @@ transfer_error_bus_busy:
ret = -6; goto i2c_transfer_finish;
 
 i2c_transfer_finish:
-   PRINTD(("i2c_transfer: ISR: 0x%04x\n", ISR));
+   PRINTD(("i2c_transfer: ISR: 0x%04x\n", readl(&base->isr)));
i2c_reset();
return ret;
 }
-- 
1.7.0.4

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


[U-Boot] The Brand Magazine London - we have been listening to you!

2011-09-30 Thread The Brand Magazine London
Hi there

You may know SKS Media already from the various luxury and high net worth 
titles we represent for advertising. We have been listening very closely to 
organisations in your sector and what you would like to see as an advertising 
vehicle over the last two years, and we're proud to announce the arrival of The 
Brand Magazine London, already launched in social networks, and arriving for 
iPAD Q1 2012 with hard copy thereafter. The Brand Magazine London leverages 
everything we know about high net worth advertising for your business to 
benefit, and is already starting to be seen at a fair proportion of high net 
worth areas on the web.

Many have mentioned previously in our surveys that it would be of interest to 
have a high net worth advertising vehicle which reaches the top 10% of the AB1 
demographic for maximum advertising return, but which could stay easily in 
budget, also with a performance element attached. And so here it is!

Thus, for you to increase your sales revenues using this new channel, we'd like 
to propose an A4 sized ad in the iPAD edition Q1 2012 with clickthroughs, 
offpage tracking and response monitoring, plus access for you to The Brand 
Magazine at social networks. We know this is a new title for you, and so we 
have kept the entry fee down to just £500.00 (you supply the A4 ad, with 
embedded fonts), plus 50p per response we send you from your ad. Simple enough?!

If you are interested in joining us for the above launch edition at the special 
rate while it is still available, please respond to this email with the words 
'Consider Us', accepting the Terms & Conditions (link below), whereupon I will 
forward your interest to the Editor-at-Large for her consideration.

Thanks for your time in review, and we hope to be working with you soon!

Kind regards

Chris Brown

at SKS for The Brand Magazine London

T: +44 (0)203 28 68 737 ddi / Booking line +44 (0) 843 289 5568
F: +44 (0)207 183 4752

or via Accounts team in London at +44 (0)207 60 70 717 ddi


 The Brand Magazine London STOP PRESS 

Top recent welcomes to: Seasons Luxury Holidays, Pearl Motor Yachts, Le Meurice 
Paris, Radisson Blu Zurich, Bang & Olufsen, Denis Island

Terms & Conditions: 
http://www.sksmedia.co.uk/thebrand/The%20Brand%20Magazine%20London%20Terms.htm


Please do JOIN US:

Linkedin Group: 
http://www.linkedin.com/groups/Brand-Magazine-add-profile-as-3601971?trk=myg_ugrp_ovr

Facebook Group: http://www.facebook.com/groups/121779117880645

Twitter: http://twitter.com/#!/thebrandmagaz



** You were subscribed to this list via one of our discerning luxury partner 
networks. 

** If you feel you have received this email in error, please simply hit REPLY 
and SEND. Thanks!



<<100x100logo.jpg>>___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] x86: turn off cache: set control register properly

2011-09-30 Thread Ondrej Kupka
Bits should be ORed when they are supposed to be added together

Cc: Graeme Russ 
Signed-off-by: Ondrej Kupka 
---
 arch/x86/cpu/start16.S |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S
index 3d3017a..9dabff2 100644
--- a/arch/x86/cpu/start16.S
+++ b/arch/x86/cpu/start16.S
@@ -50,7 +50,7 @@ board_init16_ret:
 
/* Turn of cache (this might require a 486-class CPU) */
movl%cr0, %eax
-   orl $(X86_CR0_NW & X86_CR0_CD), %eax
+   orl $(X86_CR0_NW | X86_CR0_CD), %eax
movl%eax, %cr0
wbinvd
 
-- 
1.7.4.1

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


Re: [U-Boot] [PATCH] omap: TWL4030 Bump VMMC1 interface voltage from 3V to 3.15V

2011-09-30 Thread Steve Sakoman
On Wed, Sep 28, 2011 at 9:47 AM, Ash Charles  wrote:
> MMC interfaces are specified to be 3.3V compatible with an operating
> voltage range of 3.1V to 3.5V for SD cards. This change affects
> hardware using TWL4030 (TPS6595x) PMICs and should improve the
> reliability when communicating with marginally-spec'd MMC devices.
> 3.15V is the highest possible level for this chip.  This patch
> has been tested on a Gumstix Overo board.
>
> Signed-off-by: Ash Charles 

Tested-by: Steve Sakoman 

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


[U-Boot] omap: overo: Configure mux for gpio10

2011-09-30 Thread Steve Sakoman
This pad was previously configured for sysclkout_1.  This patch changes
the configuration to gpio_10 to reduce radiated noise from the 26Mhz
clock, as well as make the pin more generally useful.

Signed-off-by: Steve Sakoman 
---

diff --git a/board/overo/overo.h b/board/overo/overo.h
index d394f90..42ef1b1 100644
--- a/board/overo/overo.h
+++ b/board/overo/overo.h
@@ -290,7 +290,7 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(SYS_BOOT5),  (IEN  | PTD | DIS | M4)) /*GPIO_7*/\
MUX_VAL(CP(SYS_BOOT6),  (IDIS | PTD | DIS | M4)) /*GPIO_8*/\
MUX_VAL(CP(SYS_OFF_MODE),   (IEN  | PTD | DIS | M0)) 
/*SYS_OFF_MODE*/\
-   MUX_VAL(CP(SYS_CLKOUT1),(IEN  | PTD | DIS | M0)) 
/*SYS_CLKOUT1*/\
+   MUX_VAL(CP(SYS_CLKOUT1),(IEN  | PTU | EN  | M4)) /*GPIO_10*/\
MUX_VAL(CP(SYS_CLKOUT2),(IEN  | PTU | EN  | M4)) /*GPIO_186*/\
MUX_VAL(CP(ETK_CLK_ES2),(IEN  | PTU | EN  | M2)) /*MMC3_CLK*/\
MUX_VAL(CP(ETK_CTL_ES2),(IEN  | PTU | EN  | M2)) /*MMC3_CMD*/\
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] omap: overo: Disable pull-ups on camera PCLK, HS and VS signals

2011-09-30 Thread Steve Sakoman
The level shifters used on the Caspa camera module have a 4k output
impedance. Combined with the 100uA pull-up resistors in the OMAP3,
this raises the ground level to 400mV. Adding crosstalk between the
pixel clock and the HS/VS signals on the flat cable (a ground line in
between would have been nice), logic 0 levels can raise up to 650mV.
This exceeds the camera input pins VIL maximum voltage.  This change
suggested-by Laurent Pinchart

Signed-off-by: Steve Sakoman 
---

diff --git a/board/overo/overo.h b/board/overo/overo.h
index 42ef1b1..915f15b 100644
--- a/board/overo/overo.h
+++ b/board/overo/overo.h
@@ -160,10 +160,10 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(DSS_DATA22), (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\
MUX_VAL(CP(DSS_DATA23), (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\
  /*CAMERA*/\
-   MUX_VAL(CP(CAM_HS), (IEN  | PTU | EN  | M0)) /*CAM_HS */\
-   MUX_VAL(CP(CAM_VS), (IEN  | PTU | EN  | M0)) /*CAM_VS */\
+   MUX_VAL(CP(CAM_HS), (IEN  | PTU | DIS | M0)) /*CAM_HS */\
+   MUX_VAL(CP(CAM_VS), (IEN  | PTU | DIS | M0)) /*CAM_VS */\
MUX_VAL(CP(CAM_XCLKA),  (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\
-   MUX_VAL(CP(CAM_PCLK),   (IEN  | PTU | EN  | M0)) /*CAM_PCLK*/\
+   MUX_VAL(CP(CAM_PCLK),   (IEN  | PTU | DIS | M0)) /*CAM_PCLK*/\
MUX_VAL(CP(CAM_FLD),(IDIS | PTD | DIS | M4)) /*CAM_FLD*/\
MUX_VAL(CP(CAM_D0), (IEN  | PTD | DIS | M0)) /*CAM_D0*/\
MUX_VAL(CP(CAM_D1), (IEN  | PTD | DIS | M0)) /*CAM_D1*/\
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/13] BeagleBoard: config: Switch console to ttyO2

2011-09-30 Thread Steve Sakoman
On Mon, Aug 15, 2011 at 7:47 PM, Joel A Fernandes  wrote:
> Signed-off-by: Koen Kooi 
> Signed-off-by: Joel A Fernandes 
> ---
>  include/configs/omap3_beagle.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
> index 038fb5b..6e66100 100644
> --- a/include/configs/omap3_beagle.h
> +++ b/include/configs/omap3_beagle.h
> @@ -200,7 +200,7 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>        "loadaddr=0x8200\0" \
>        "usbtty=cdc_acm\0" \
> -       "console=ttyS2,115200n8\0" \
> +       "console=ttyO2,115200n8\0" \
>        "mpurate=auto\0" \
>        "buddy=none "\
>        "vram=12M\0" \

Any status on this patch?  It doesn't seem to have made it into v2011.09

FWIW:

Tested-by: Steve Sakoman 

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


[U-Boot] omap: overo: Use ubifs instead of jffs2 for nand

2011-09-30 Thread Steve Sakoman
Signed-off-by: Steve Sakoman 
---

diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 9a8ef06..8114194 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -164,8 +164,8 @@
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 rw\0" \
"mmcrootfstype=ext3 rootwait\0" \
-   "nandroot=/dev/mtdblock4 rw\0" \
-   "nandrootfstype=jffs2\0" \
+   "nandroot=ubi0:rootfs ubi.mtd=4\0" \
+   "nandrootfstype=ubifs\0" \
"mmcargs=setenv bootargs console=${console} " \
"${optargs} " \
"mpurate=${mpurate} " \
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] omap: overo: Use ubifs instead of jffs2 for nand

2011-09-30 Thread Ash Charles
On Fri, Sep 30, 2011 at 12:20 PM, Steve Sakoman  wrote:
> Signed-off-by: Steve Sakoman 
Tested-by: Ash Charles 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] omap: beagle: Use ubifs instead of jffs2 for nand boot

2011-09-30 Thread Steve Sakoman
Signed-off-by: Steve Sakoman 
---

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 2c0f5a5..a92ffdf 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -227,8 +227,8 @@
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 rw\0" \
"mmcrootfstype=ext3 rootwait\0" \
-   "nandroot=/dev/mtdblock4 rw\0" \
-   "nandrootfstype=jffs2\0" \
+   "nandroot=ubi0:rootfs ubi.mtd=4\0" \
+   "nandrootfstype=ubifs\0" \
"ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x8100,64M\0" \
"ramrootfstype=ext2\0" \
"mmcargs=setenv bootargs console=${console} " \
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] omap: beagle: Use ubifs instead of jffs2 for nand boot

2011-09-30 Thread Kooi, Koen
On Fri, Sep 30, 2011 at 21:29:11, Steve Sakoman wrote:
> Subject: [PATCH] omap: beagle: Use ubifs instead of jffs2 for
> nand boot
>
> Signed-off-by: Steve Sakoman 
> ---
>
> diff --git a/include/configs/omap3_beagle.h
> b/include/configs/omap3_beagle.h
> index 2c0f5a5..a92ffdf 100644
> --- a/include/configs/omap3_beagle.h
> +++ b/include/configs/omap3_beagle.h
> @@ -227,8 +227,8 @@
>   "mmcdev=0\0" \
>   "mmcroot=/dev/mmcblk0p2 rw\0" \
>   "mmcrootfstype=ext3 rootwait\0" \
> - "nandroot=/dev/mtdblock4 rw\0" \
> - "nandrootfstype=jffs2\0" \
> + "nandroot=ubi0:rootfs ubi.mtd=4\0" \
> + "nandrootfstype=ubifs\0" \

IIRC all beagle builds use 'beagleboard-rootfs' as ubi name, but I need to 
double check.

In any case, this is already a massive improvement, so:

Acked-by: Koen Kooi 

Regards,

Koen
Texas Instruments Limited, 800 Pavilion Drive, Northampton, NN4 7YL. Registered 
in England & Wales under company number 00574102



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


Re: [U-Boot] [PATCH] omap: beagle: Use ubifs instead of jffs2 for nand boot

2011-09-30 Thread Steve Sakoman
On Fri, Sep 30, 2011 at 12:32 PM, Kooi, Koen  wrote:
> On Fri, Sep 30, 2011 at 21:29:11, Steve Sakoman wrote:
>> Subject: [PATCH] omap: beagle: Use ubifs instead of jffs2 for
>> nand boot
>>
>> Signed-off-by: Steve Sakoman 
>> ---
>>
>> diff --git a/include/configs/omap3_beagle.h
>> b/include/configs/omap3_beagle.h
>> index 2c0f5a5..a92ffdf 100644
>> --- a/include/configs/omap3_beagle.h
>> +++ b/include/configs/omap3_beagle.h
>> @@ -227,8 +227,8 @@
>>       "mmcdev=0\0" \
>>       "mmcroot=/dev/mmcblk0p2 rw\0" \
>>       "mmcrootfstype=ext3 rootwait\0" \
>> -     "nandroot=/dev/mtdblock4 rw\0" \
>> -     "nandrootfstype=jffs2\0" \
>> +     "nandroot=ubi0:rootfs ubi.mtd=4\0" \
>> +     "nandrootfstype=ubifs\0" \
>
> IIRC all beagle builds use 'beagleboard-rootfs' as ubi name, but I need to 
> double check.
>
> In any case, this is already a massive improvement, so:
>
> Acked-by: Koen Kooi 

I do generic omap kernel & rootfs builds, so it seemed better to do a
non machine specific ubi name.

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


[U-Boot] [PATCH 4/4] tegra2: Add support for Ventana

2011-09-30 Thread Stephen Warren
Ventana is a board which is very similar to Seaboard. Support it by
re-using board/nvidia/seaboard/seaboard.c with minor run-time conditionals.

Signed-off-by: Stephen Warren 
---
 board/nvidia/seaboard/seaboard.c |   11 ++-
 board/nvidia/ventana/Makefile|   55 ++
 boards.cfg   |1 +
 include/configs/ventana.h|   55 ++
 4 files changed, 120 insertions(+), 2 deletions(-)
 create mode 100644 board/nvidia/ventana/Makefile
 create mode 100644 include/configs/ventana.h

diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 37edbca..775b980 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -31,10 +31,10 @@
 #include "../common/board.h"
 
 /*
- * Routine: gpio_config_uart
+ * Routine: gpio_config_uart_seaboard
  * Description: Force GPIO_PI3 low on Seaboard so UART4 works.
  */
-void gpio_config_uart(void)
+void gpio_config_uart_seaboard(void)
 {
int gp = GPIO_PI3;
struct gpio_ctlr *gpio = (struct gpio_ctlr *)NV_PA_GPIO_BASE;
@@ -55,6 +55,13 @@ void gpio_config_uart(void)
writel(val, &bank->gpio_dir_out[GPIO_PORT(gp)]);
 }
 
+void gpio_config_uart(void)
+{
+   if (machine_is_ventana())
+   return;
+   gpio_config_uart_seaboard();
+}
+
 #ifdef CONFIG_TEGRA2_MMC
 /*
  * Routine: gpio_config_mmc
diff --git a/board/nvidia/ventana/Makefile b/board/nvidia/ventana/Makefile
new file mode 100644
index 000..029673f
--- /dev/null
+++ b/board/nvidia/ventana/Makefile
@@ -0,0 +1,55 @@
+#
+#  (C) Copyright 2010,2011
+#  NVIDIA Corporation 
+#
+#
+#  See file CREDITS for list of people who contributed to this
+#  project.
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of
+#  the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+#  MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  += ../seaboard/seaboard.o
+COBJS  += ../common/board.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/boards.cfg b/boards.cfg
index d32ff7e..bc990e9 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -185,6 +185,7 @@ s5pc210_universalarm armv7   
universal_c210  samsung
 smdkv310arm armv7   smdkv310
samsungs5pc2xx
 harmony  arm armv7   harmony 
nvidia tegra2
 seaboard arm armv7   seaboard
nvidia tegra2
+ventana  arm armv7   ventana 
nvidia tegra2
 u8500_href   arm armv7   u8500   
st-ericssonu8500
 actux1_4_16  arm ixp actux1  - 
 -   actux1:FLASH2X2
 actux1_8_16  arm ixp actux1  - 
 -   actux1:FLASH1X8
diff --git a/include/configs/ventana.h b/include/configs/ventana.h
new file mode 100644
index 000..afd6ff6
--- /dev/null
+++ b/include/configs/ventana.h
@@ -0,0 +1,55 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation 
+ *
+ * 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 Lice

[U-Boot] [PATCH 2/4] tegra2: Call gpio_request for SDMMC GPIOs

2011-09-30 Thread Stephen Warren
Without this, the GPIO_CNF register will not be programmed, and hence the
GPIO signals will not reach the pins; the pinmux's configured function
will be routed to the pins instead.

Signed-off-by: Stephen Warren 
---
 board/nvidia/seaboard/seaboard.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index bc67d0f..578d909 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -62,9 +62,11 @@ void gpio_config_uart(void)
 void gpio_config_mmc(void)
 {
/* Set EN_VDDIO_SD (GPIO I6) */
+   gpio_request(GPIO_PI6, "SDMMC4 power");
gpio_direction_output(GPIO_PI6, 1);
 
/* Config pin as GPI for Card Detect (GPIO I5) */
+   gpio_request(GPIO_PI5, "SDMMC4 card detect");
gpio_direction_input(GPIO_PI5);
 }
 
-- 
1.7.0.4

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


[U-Boot] [PATCH 3/4] tegra2: Enable second SD port (J5) on Harmony

2011-09-30 Thread Stephen Warren
Seaboard uses SDMMC4, SDMMC3. Harmony uses SDMMC4, SDMMC2. Move
board_init_mmc and gpio_config_mmc into board-specific files, so boards
can choose which ports to set up. Split clock_init_mmc and pin_mux_mmc
into per-port functions, and export them for use by boards.

Signed-off-by: Stephen Warren 
---
 board/nvidia/common/board.c  |   77 --
 board/nvidia/common/board.h  |8 +++-
 board/nvidia/harmony/harmony.c   |   56 +--
 board/nvidia/seaboard/seaboard.c |   23 +++
 drivers/mmc/tegra2_mmc.c |   18 +
 5 files changed, 148 insertions(+), 34 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 8033612..6c09a4c 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -102,20 +102,37 @@ static void pin_mux_uart(void)
 
 #ifdef CONFIG_TEGRA2_MMC
 /*
- * Routine: clock_init_mmc
- * Description: init the PLL and clocks for the SDMMC controllers
+ * Routine: clock_init_mmc4
+ * Description: init the PLL and clocks for SDMMC4 controller
  */
-static void clock_init_mmc(void)
+void clock_init_mmc4(void)
 {
clock_start_periph_pll(PERIPH_ID_SDMMC4, CLOCK_ID_PERIPH, 2000);
+}
+
+/*
+ * Routine: clock_init_mmc3
+ * Description: init the PLL and clocks for SDMMC3 controller
+ */
+void clock_init_mmc3(void)
+{
clock_start_periph_pll(PERIPH_ID_SDMMC3, CLOCK_ID_PERIPH, 2000);
 }
 
 /*
- * Routine: pin_mux_mmc
- * Description: setup the pin muxes/tristate values for the SDMMC(s)
+ * Routine: clock_init_mmc2
+ * Description: init the PLL and clocks for SDMMC2 controller
  */
-static void pin_mux_mmc(void)
+void clock_init_mmc2(void)
+{
+   clock_start_periph_pll(PERIPH_ID_SDMMC2, CLOCK_ID_PERIPH, 2000);
+}
+
+/*
+ * Routine: pin_mux_mmc4
+ * Description: setup the pin muxes/tristate values for SDMMC4
+ */
+void pin_mux_mmc4(void)
 {
/* SDMMC4: config 3, x8 on 2nd set of pins */
pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
@@ -125,7 +142,14 @@ static void pin_mux_mmc(void)
pinmux_tristate_disable(PINGRP_ATB);
pinmux_tristate_disable(PINGRP_GMA);
pinmux_tristate_disable(PINGRP_GME);
+}
 
+/*
+ * Routine: pin_mux_mmc3
+ * Description: setup the pin muxes/tristate values for SDMMC3
+ */
+void pin_mux_mmc3(void)
+{
/* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
@@ -135,6 +159,25 @@ static void pin_mux_mmc(void)
pinmux_tristate_disable(PINGRP_SDD);
pinmux_tristate_disable(PINGRP_SDB);
 }
+
+/*
+ * Routine: pin_mux_mmc2
+ * Description: setup the pin muxes/tristate values for SDMMC2
+ */
+void pin_mux_mmc2(void)
+{
+   /* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
+   pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
+   pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
+
+   pinmux_tristate_disable(PINGRP_DTA);
+   pinmux_tristate_disable(PINGRP_DTD);
+
+   /* For power GPIO PI6 */
+   pinmux_tristate_disable(PINGRP_ATA);
+   /* For power GPIO PT3 */
+   pinmux_tristate_disable(PINGRP_DTB);
+}
 #endif
 
 /*
@@ -152,28 +195,6 @@ int board_init(void)
return 0;
 }
 
-#ifdef CONFIG_TEGRA2_MMC
-/* this is a weak define that we are overriding */
-int board_mmc_init(bd_t *bd)
-{
-   debug("board_mmc_init called\n");
-   /* Enable clocks, muxes, etc. for SDMMC controllers */
-   clock_init_mmc();
-   pin_mux_mmc();
-   gpio_config_mmc();
-
-   debug("board_mmc_init: init eMMC\n");
-   /* init dev 0, eMMC chip, with 8-bit bus */
-   tegra2_mmc_init(0, 8);
-
-   debug("board_mmc_init: init SD slot\n");
-   /* init dev 1, SD slot, with 4-bit bus */
-   tegra2_mmc_init(1, 4);
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 344e702..eee475d 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -26,7 +26,13 @@
 
 void tegra2_start(void);
 void gpio_config_uart(void);
-void gpio_config_mmc(void);
+void clock_init_mmc4(void);
+void clock_init_mmc3(void);
+void clock_init_mmc2(void);
+void pin_mux_mmc4(void);
+void pin_mux_mmc3(void);
+void pin_mux_mmc2(void);
 int tegra2_mmc_init(int dev_index, int bus_width);
+int tegra2_mmc_index(struct mmc *mmc);
 
 #endif /* BOARD_H */
diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index cbb30d6..228ae2e 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -23,10 +23,13 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #ifdef CONFIG_TEGRA2_MMC
 #include 
 #endif
+#include "../common/board.h"
 
 /*
  * Routine: gpio_config_uart
@@ -43,18 +46,61 @@ void gpio_config_uart(void)
  */
 void gpio_config_mmc(void)
 {
-   /* Not implemented for now */
+ 

[U-Boot] [PATCH 1/4] tegra2: Seaboard's MMC has an 8-bit bus

2011-09-30 Thread Stephen Warren
Modify board_mmc_init to configure SDMMC4 for an 8-bit bus, since that's
what is wired up on the board.

Signed-off-by: Stephen Warren 
---
Note: These patches build on various Tegra2-related patches recently posted
by Simon Glass; see v2 of the 6-entry patchset shown at:
http://patchwork.ozlabs.org/project/uboot/list/?submitter=6170&state=1&q=tegra2

 board/nvidia/common/board.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index d13537d..8033612 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -163,8 +163,8 @@ int board_mmc_init(bd_t *bd)
gpio_config_mmc();
 
debug("board_mmc_init: init eMMC\n");
-   /* init dev 0, eMMC chip, with 4-bit bus */
-   tegra2_mmc_init(0, 4);
+   /* init dev 0, eMMC chip, with 8-bit bus */
+   tegra2_mmc_init(0, 8);
 
debug("board_mmc_init: init SD slot\n");
/* init dev 1, SD slot, with 4-bit bus */
-- 
1.7.0.4

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


[U-Boot] [PATCH 1/2] image: Support relative-addresses property in FIT images

2011-09-30 Thread Stephen Warren
uImage files contain absolute "load" and "entry" addresses. Such a concept
is incompatible with using the same kernel image on multiple SoCs, each with
a potentially different SDRAM base. To support that, augment the FIT image
syntax with a "relative-addresses" property, which indicates that the "load"
and "entry" properties are an offset from SDRAM, rather than an absolute
address.

In theory, a similar change could be made to the legacy uImage format.
However, representing the a "relative-addresses" flag in that format is
problematic, so I have ignored that possibility for now.

Signed-off-by: Stephen Warren 
---
 common/image.c|   14 ++
 doc/uImage.FIT/source_file_format.txt |3 +++
 include/image.h   |1 +
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/common/image.c b/common/image.c
index d38ce4a..e62fc76 100644
--- a/common/image.c
+++ b/common/image.c
@@ -2299,6 +2299,13 @@ int fit_image_get_load (const void *fit, int noffset, 
ulong *load)
}
 
*load = uimage_to_cpu (*data);
+
+#ifndef USE_HOSTCC
+   data = fdt_getprop(fit, noffset, FIT_REL_ADDRS_PROP, &len);
+   if (data != NULL)
+   *load += getenv_bootm_low();
+#endif
+
return 0;
 }
 
@@ -2327,6 +2334,13 @@ int fit_image_get_entry (const void *fit, int noffset, 
ulong *entry)
}
 
*entry = uimage_to_cpu (*data);
+
+#ifndef USE_HOSTCC
+   data = fdt_getprop(fit, noffset, FIT_REL_ADDRS_PROP, &len);
+   if (data != NULL)
+   *entry += getenv_bootm_low();
+#endif
+
return 0;
 }
 
diff --git a/doc/uImage.FIT/source_file_format.txt 
b/doc/uImage.FIT/source_file_format.txt
index 6d20707..c2ae67e 100644
--- a/doc/uImage.FIT/source_file_format.txt
+++ b/doc/uImage.FIT/source_file_format.txt
@@ -183,6 +183,9 @@ the '/images' node should have the following layout:
   Optional nodes:
   - hash@1 : Each hash sub-node represents separate hash or checksum
 calculated for node's data according to specified algorithm.
+  - relative-addresses : Indicates the the values of the load and entry
+properties are to be interpreted as relative to the base of SDRAM, rather
+than as an absolute values.
 
 
 5) Hash nodes
diff --git a/include/image.h b/include/image.h
index 352e4a0..aefba5d 100644
--- a/include/image.h
+++ b/include/image.h
@@ -538,6 +538,7 @@ static inline int image_check_target_arch (const 
image_header_t *hdr)
 #define FIT_COMP_PROP  "compression"
 #define FIT_ENTRY_PROP "entry"
 #define FIT_LOAD_PROP  "load"
+#define FIT_REL_ADDRS_PROP "relative-addresses"
 
 /* configuration node */
 #define FIT_KERNEL_PROP"kernel"
-- 
1.7.0.4

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


[U-Boot] [PATCH 2/2] tegra2: Enable new image format (FIT)

2011-09-30 Thread Stephen Warren
Signed-off-by: Stephen Warren 
---
 include/configs/tegra2-common.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 73e0f05..22ac2f2 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -48,6 +48,7 @@
 
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
 #define CONFIG_OF_LIBFDT   /* enable passing of devicetree */
+#define CONFIG_FIT /* enable new image format */
 
 /* Environment */
 #define CONFIG_ENV_IS_NOWHERE
-- 
1.7.0.4

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


[U-Boot] Pull request: u-boot-arm/master

2011-09-30 Thread Albert ARIBAUD
Hi Wolfgang,

I have moved the contents of u-boot-arm/next to u-boot-arm/master, and 
therefore...

The following changes since commit 1d5e7fb403257d62f0f2419cb83fdf6b0f02f215:

   Prepare v2011.09 (2011-09-29 21:11:15 +0200)

are available in the git repository at:
   git://git.denx.de/u-boot-arm.git master

Ajay Bhargav (5):
   gpio: Add GPIO driver framework for Marvell SoCs
   gpio: Add GPIO driver for Marvell SoC Armada100
   net: Adds Fast Ethernet Controller driver for Armada100
   Armada100: Enable Ethernet support for GplugD
   Armada100: Enable 88E3015 PHY support for GplugD

Aneesh V (1):
   omap4: update maintainer for omap4 boards

Balaji T K (2):
   mmc: omap: enable high capacity
   mmc: omap: config VMMC, MMC1_PBIAS

Fabio Estevam (25):
   ARM: mx25: Print the silicon revison
   ARM: mx25: Print the source of reset
   MX31: mx31pdk: Remove nand_spl config.mk file
   MX31: Improve readability for reset cause
   mx31pdk: Change the prompt as per other i.MX boards
   MX25: tx25: Avoid the usage of extern in C file
   MX25: Add initial support for MX25PDK
   MX31: Disable watchdog during low-power modes
   mx31pdk: Remove dram_init_banksize()
   mx25pdk: Remove dram_init_banksize()
   mx31ads: Remove dram_init_banksize()
   imx31_litekit: Remove dram_init_banksize()
   mx31pdk: Place machine ID into board config
   mx25pdk: Place machine ID into board config
   mx31ads: Place machine ID into board config
   imx31_litekit: Place machine ID into board config
   mx51evk: Place machine ID into board config
   mx53loco: Place machine ID into board config
   mx53smd: Place machine ID into board config
   mx53ard: Place machine ID into board config
   mx53evk: Place machine ID into board config
   zmx25: Remove dram_init_banksize()
   zmx25: Place machine ID into board config
   zmx25: Fix build warning due to 'get_reset_cause' defined but not 
used
   vision2: Place machine ID into board config

Heiko Schocher (16):
   i2c, davinci: add i2c set speed
   net, davinci_emac: add KSZ8864 switch
   net, davinci_emac: make less verbose - turn printf() into debug()
   net, davinci_emac: let the EMAC detect the PHYs
   arm, davinci: move davinci_timer in header file
   arm, davinci: add missing timer baseaddresses for !DA8xx cpu
   arm, davinci: add internal WDT support for AM1808 cpus
   arm, davinci: add RTC base addr
   rtc, davinci: add support for davinci internal RTC
   arm, davinci: add SYSCFG1 base and register struct
   arm, davinci: add some missing defines in hardware.h
   arm, davinci, am1808, gpio: add missing defines for bank 8
   arm, davinci: add ddr2 definition
   arm, davinci: add NOR Boot Configuration Word
   arm, davinci, am1808: add lowlevel functions for booting from NOR
   arm, davinci, da8xx: add cpuinfo

Jason Liu (1):
   cosmetic: fsl_pmic: cosmetic for the help message

Joe Hershberger (1):
   omap4_panda: Ignore omap4 SPL called MLO

Marek Vasut (19):
   EfikaMX: Adjust undocumented magic constant in config file
   FEC: Use proper accessor to read register in debug call
   FEC: Use defined constant instead of magic number
   FEC: Kill mode select FIXME's
   FEC: Add RMII mode support
   FEC: Allow selection of MII mode via CONFIG_FEC_XCV_TYPE
   FEC: Abstract access to fec->eth in MII operations
   FEC: Allow multiple FECes
   FEC: Allow registering MII postconfiguration callback
   FEC: Add timeout for chip reset
   FEC: Squish "got MAC from fuse" message, make it debug()
   FEC: Move imx_get_mac_from_fuse() definition to fec_mxc.h
   MX5: Modify the PLL decoding algorithm
   MX5: Add AHB clock reporting and fix IPG clock reporting
   MX5: Clean up the output of "clocks" command
   I2C: mxc_i2c rework
   ATA: Squash warnings in mxc_ata.
   EfikaMX: Add imximage config for Efika SB
   EfikaSB: Add preliminary EfikaSB support

Philip Balister (2):
   OMAP3: Overo: Update GPMC timing for ethernet chip
   overo: Set IEN on GPMC_CLK to support synchronous clocking.

Sandeep Paulraj (1):
   devkit8000: Fix build break

Sanjeev Premi (2):
   omap3: Fix compile warning
   omap3evm: env: Fix default console

Simon Schwarz (9):
   omap-common/omap4: relocate early UART clock setup
   omap3: Configure RAM bank 0 if in SPL
   omap-common: add nand spl support
   spl: add NAND Library to new SPL
   spl: Add POWER library to new spl
   omap3: new SPL structure support
   devkit8000: Add nand-spl support for new SPL
   omap3: implement boot parameter saving
   omap-common: reorganize spl.c

Thomas Weber (1):
   Devkit8000: Change console from ttyS2 to ttyO2

  .gitignore |1 +
  MAINTAINERS

Re: [U-Boot] [PATCH] x86: turn off cache: set control register properly

2011-09-30 Thread Marek Vasut
On Friday, September 30, 2011 08:27:07 PM Ondrej Kupka wrote:
> Bits should be ORed when they are supposed to be added together
> 
> Cc: Graeme Russ 
> Signed-off-by: Ondrej Kupka 
> ---
>  arch/x86/cpu/start16.S |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S
> index 3d3017a..9dabff2 100644
> --- a/arch/x86/cpu/start16.S
> +++ b/arch/x86/cpu/start16.S
> @@ -50,7 +50,7 @@ board_init16_ret:
> 
>   /* Turn of cache (this might require a 486-class CPU) */
>   movl%cr0, %eax
> - orl $(X86_CR0_NW & X86_CR0_CD), %eax
> + orl $(X86_CR0_NW | X86_CR0_CD), %eax
>   movl%eax, %cr0
>   wbinvd

Dear Ondrej Kupka,

Can we make this into some macro so we'd avoid such errors in the future ?

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


Re: [U-Boot] [PATCH] x86: turn off cache: set control register properly

2011-09-30 Thread Ondra Kupka
Dear Marek,

I am not really sure it would bring any advantage since it is used only on 2
places as far as I know and the meaning of those few lines of code is very
clear and commented...

Regards,
Ondra K.

On Fri, Sep 30, 2011 at 10:24 PM, Marek Vasut  wrote:

> On Friday, September 30, 2011 08:27:07 PM Ondrej Kupka wrote:
> > Bits should be ORed when they are supposed to be added together
> >
> > Cc: Graeme Russ 
> > Signed-off-by: Ondrej Kupka 
> > ---
> >  arch/x86/cpu/start16.S |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S
> > index 3d3017a..9dabff2 100644
> > --- a/arch/x86/cpu/start16.S
> > +++ b/arch/x86/cpu/start16.S
> > @@ -50,7 +50,7 @@ board_init16_ret:
> >
> >   /* Turn of cache (this might require a 486-class CPU) */
> >   movl%cr0, %eax
> > - orl $(X86_CR0_NW & X86_CR0_CD), %eax
> > + orl $(X86_CR0_NW | X86_CR0_CD), %eax
> >   movl%eax, %cr0
> >   wbinvd
>
> Dear Ondrej Kupka,
>
> Can we make this into some macro so we'd avoid such errors in the future ?
>
> Cheers
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] x86: turn off cache: set control register properly

2011-09-30 Thread Marek Vasut
On Friday, September 30, 2011 10:56:03 PM Ondra Kupka wrote:
> Dear Marek,
> 
> I am not really sure it would bring any advantage since it is used only on
> 2 places as far as I know and the meaning of those few lines of code is
> very clear and commented...
> 
> Regards,
> Ondra K.

Dear Ondrej Kupka,

Please STOP TOP-POSTING !!

Otherwise ok.

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


Re: [U-Boot] [PATCH 3/4] davinci: emac: add support for more than 1 PHYs

2011-09-30 Thread Laurence Withers
On Fri, Sep 30, 2011 at 05:27:11PM +0530, nagabhushana.netagu...@ti.com wrote:
> add support for more than 1 PHYs. Many of the davinci platforms have more
> than 1 PHYs on thier board. This patch extends support in davinci emac
> driver for upto 3 PHYs.

As a nitpick, there is a typo in "thier", which should be "their".

But a real question: where does the number 3 come from? It seems rather
arbitrary, at least without any explanatory comments. The MDIO interface can
support up to 31 devices, so perhaps you should allow for that many PHYs?
(Or perhaps a limit configurable with a #define, as it would seem wasteful
to allocate memory for 31 phy_t structures when I doubt there are any boards
that could truly take advantage of that).

Bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] davinci: emac: add new features to autonegotiate for EMAC

2011-09-30 Thread Laurence Withers
On Fri, Sep 30, 2011 at 05:27:09PM +0530, nagabhushana.netagu...@ti.com wrote:
> From: Nagabhushana Netagunte 
> 
> add more features like DUPLEX, 100MB link speed etc to auto negotiate
> in EMAC driver. EMAC controller autonegotiates for these features with
> PHYs which are on the board.
> 
> Signed-off-by: Sudhakar Rajashekhara 
> Signed-off-by: Nagabhushana Netagunte 

I tried this on a board I am developing with an OMAP-L138. I have a managed
switch and tried a few different port settings (auto negotiate enabled and
disabled etc.) with no problems at all. If you like, please feel free to add:

Tested-by: Laurence Withers 

Bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Can you help me?

2011-09-30 Thread Philip Y Wong
I am Sgt John Adams of the US Army base in Iraq for peace keeping I found your 
contact detail in a address journal am seeking your assistance to evacuate the 
sum of $25,000,000 to you as long as I am assured that it will be safe in your 
care until I complete my service here in Iraq. This is not stolen money and  
there are no dangers involved. I count on your understanding. 

Please reply me on my private email address:- sgtjohna...@gmail.com
Sgt John Adams

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


Re: [U-Boot] [PATCH 4/6] da850: revert cache disable patch

2011-09-30 Thread Laurence Withers
On Fri, Sep 30, 2011 at 04:54:25PM +0530, nagabhushana.netagu...@ti.com wrote:
> From: Nagabhushana Netagunte 
> 
> revert commit bd65d006a6088bcb857e079447d7549e2cd7054d as cache
> disabling is no more needed. Subsequent patches to new cache
> management framework has fixed EMAC issue with cache coherency.
> 
> Signed-off-by: Nagabhushana Netagunte 
> ---
>  include/configs/da850_l138evm.h |3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
> index 347893c..0bd630f 100644
> --- a/include/configs/da850_l138evm.h
> +++ b/include/configs/da850_l138evm.h
> @@ -43,9 +43,6 @@
>  #define CONFIG_SYS_HZ1000
>  #define CONFIG_SKIP_LOWLEVEL_INIT
>  #define CONFIG_SYS_TEXT_BASE 0xc108
> -#define CONFIG_SYS_ICACHE_OFF
> -#define CONFIG_SYS_DCACHE_OFF
> -#define CONFIG_SYS_L2CACHE_OFF
>  
>  /*
>   * Memory Info

Am I correct in thinking that what you mean is that caches are now disabled
by default, and therefore you don't need to explicitly disable them? I guess
so, since I couldn't find any posted patches to fix the EMAC driver (though I
would be very glad if I was wrong about this!).

If so, we haven't actually "fixed EMAC issue with cache coherency" - the
driver is still broken if caches are enabled, and the commit message should
reflect that. The same would apply to the dm644X and dm36x cache disable
patches.

Bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH RFC 4/4] env: implement "env import -n var[, var...]"

2011-09-30 Thread Mike Frysinger
On Friday, September 30, 2011 08:04:58 Gerlando Falauto wrote:
> + if (nvars >= MAX_NVARS)
> + {

that brace needs to be cuddled
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Tell git to ignore asm-offsets.s

2011-09-30 Thread Laurence Withers
The generated file asm-offsets.s may be found at various depths in the
arch subdirectories, so simply ignore it throughout the tree.

Signed-off-by: Laurence Withers 
---
 .gitignore |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 2a82cd9..e85d461 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,8 +45,7 @@
 /reloc_off
 
 /include/generated/
-/lib/asm-offsets.s
-/arch/*/cpu/asm-offsets.s
+asm-offsets.s
 
 # stgit generated dirs
 patches-*
-- 
1.7.2.5

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


Re: [U-Boot] Application of patch submitted during the previous Merge Window

2011-09-30 Thread Mike Frysinger
On Sunday, September 25, 2011 15:55:07 Wolfgang Denk wrote:
> Using gerrit?  Hm... All my work in this context is e-mail based, and
> I think many others work in a similar way.  Web-based tools may be
> more "modern", but I have to admit that I am not convinced that they
> are any more helpful or efficient.

gerrit is also pretty bad at a few critical things:
 - patch dependencies
 - keeping feedback visible across patchsets
 - retaining formatting of messages
 - the status e-mail's that get sent out

i'm not a general gerrit hater (there are things it does well), i just find 
these bits to not work well for development styles that are heavily based on 
e-mail lists
-mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >