Re: [U-Boot] ARM pull request v3

2009-10-16 Thread Dirk Behme
Paulraj, Sandeep wrote:
> 
>> Tom Rix wrote:
>> ...
>>
>>> Olof Johansson (3):
>> ...
>>>SMC911X: Add chip auto detection
>> This is broken [1] and doesn't work without
>>
>> http://git.denx.de/?p=u-boot/u-boot-
>> ti.git;a=commit;h=e7911214d5aee1ba5eb160327d5ff305c9e6ee5a
>>
>> And while last re-organization of u-boot-ti
>>
>> http://git.denx.de/?p=u-boot/u-boot-
>> ti.git;a=commit;h=83fb7d7bb237cc7adae37e0e3328c203fd1b9ad1
>>
>> was lost, but now is there again.
>>
>> Maybe you like to cherry-pick both?
> 
> 
> I'll send out a pull request which will have these 2. I'll do that later 
> today.

Sandeep: What's about this?

Tom: We need this in u-boot-arm before sending the pull request to 
Wolfgang. If we don't get a u-boot-ti pull request, at least we need 
the two above commits from u-boot-ti in u-boot-arm.

Many thanks and best regards

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


Re: [U-Boot] Relocation size penalty calculation

2009-10-16 Thread Graeme Russ
On Thu, Oct 15, 2009 at 3:45 AM, J. William Campbell
 wrote:
> Joakim Tjernlund wrote:
>>
>> Graeme Russ  wrote on 14/10/2009 13:48:27:
>>
>>>
>>> On Wed, Oct 14, 2009 at 6:25 PM, Joakim Tjernlund
>>>  wrote:
>>>

 "J. William Campbell"  wrote on 14/10/2009
 01:48:52:

>
> Joakim Tjernlund wrote:
>
>>
>> Graeme Russ  wrote on 13/10/2009 22:06:56:
>>
>>
>>
>>>
>>> On Tue, Oct 13, 2009 at 10:53 PM, Joakim Tjernlund
>>>  wrote:
>>>
>>>

 Graeme Russ  wrote on 13/10/2009 13:21:05:


>
> On Sun, Oct 11, 2009 at 11:51 PM, Joakim Tjernlund
>  wrote:
>
>
>>
>> Graeme Russ  wrote on 11/10/2009 12:47:19:
>>
>>
>
> [Massive Snip :)]
>
>
>
>>>
>>> So, all that is left are .dynsym and .dynamic ...
>>>  .dynsym
>>>- Contains 70 entries (16 bytes each, 1120 bytes)
>>>- 44 entries mimic those entries in .got which are not
>>> relocated
>>>- 21 entries are the remaining symbols exported from the
>>> linker
>>>  script
>>>- 4 entries are labels defined in inline asm and used in C
>>>
>>>
>>
>> Try adding proper asm declarations. Look at what gcc
>> generates for a function/variable and mimic these.
>>
>>
>
> Thanks - Now .dynsym contains only exports from the linker script
>
>

 :)


>>>
>>>- 1 entry is a NULL entry
>>>
>>>  .dynamic
>>>- 88 bytes
>>>- Array of Elf32_Dyn
>>>- typedef struct {
>>>  Elf32_Sword d_tag;
>>>  union {
>>>  Elf32_Word  d_val;
>>>  Elf32_Addr  d_ptr;
>>>  } d_un;
>>>  } Elf32_Dyn;
>>>- 0x11 entries
>>>  [00] 0x0010, 0x DT_SYMBOLIC, (ignored)
>>>  [01] 0x0004, 0x38059994 DT_HASH, points to .hash
>>>  [02] 0x0005, 0x380595AB DT_STRTAB, points to .dynstr
>>>  [03] 0x0006, 0x3805BDCC DT_SYMTAB, points to .dynsym
>>>  [04] 0x000A, 0x03E6 DT_STRSZ, size of .dynstr
>>>  [05] 0x000B, 0x0010 DT_SYMENT, ???
>>>  [06] 0x0015, 0x DT_DEBUG, ???
>>>  [07] 0x0011, 0x3805A8F4 DT_REL, points to .rel.text
>>>  [08] 0x0012, 0x14D8 DT_RELSZ, ???
>>>
>>>
>>
>> How big DT_REL is
>>
>>
>>>
>>>  [09] 0x0013, 0x0008 DT_RELENT, ???
>>>
>>>
>>
>> hmm, cannot remeber :)
>>
>>
>
> How big an entry in DT_REL is
>
>

 Right, how could I forget :)


>>>
>>>  [0a] 0x0016, 0x DT_TEXTREL, ???
>>>
>>>
>>
>> Oops, you got text relocations. This is generally a bad thing.
>> TEXTREL is commonly caused by asm code that arent truly pic so it
>> needs
>> to modify the .text segment to adjust for relocation.
>> You should get rid of this one. Look for DT_TEXTREL in .o files to
>> find
>> the culprit.
>>
>>
>>
>
> Alas I cannot - The relocations are a result of loading a register
> with a
> return address when calling show_boot_progress in the very early
> stages of
> initialisation prior to the stack becoming available. The x86 does
> not
> allow direct access to the IP so the only way to find the 'current
> execution address' is to 'call' to the next instruction and pop the
> return
> address off the stack
>
>

 hmm, same as ppc but that in it self should not cause a TEXREL,
 should it?
 Ahh, the 'call' is absolute, not relative? I guess there is some way
 around it
 but it is not important ATM I guess.

 Evil idea, skip -fpic et. all and add the full reloc procedure
 to relocate by rewriting directly in TEXT segment. Then you save
 space
 but you need more relocation code. Something like dl_do_reloc from
 uClibc. Wonder how much extra code that would be? Not too much I
 think.



>>>
>>> With the following flags
>>>
>>> PLATFORM_RELFLAGS += -fvisibility=hidden
>>> PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
>>> PLATFORM_LDFLAGS += -pic --emit-relocs -Bsymbolic
>>> -Bsymbolic-functions
>>>
>>> I get no .got, but a lot of R_386_PC32 and R_386_32 relocations. I
>>> think
>>> this

[U-Boot] [PATCH 2/3] cmd_help: General cleanup

2009-10-16 Thread Peter Tyser
Shorten the overly-verbose help message of 'help' and clean up some
redundant ifdefery while we're at it.

Signed-off-by: Peter Tyser 
---
 common/cmd_help.c |   21 +++--
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/common/cmd_help.c b/common/cmd_help.c
index f01d14e..e860dfb 100644
--- a/common/cmd_help.c
+++ b/common/cmd_help.c
@@ -33,25 +33,18 @@ int do_help(cmd_tbl_t * cmdtp, int flag, int argc, char 
*argv[])
 
 U_BOOT_CMD(
help,   CONFIG_SYS_MAXARGS, 1,  do_help,
-   "print online help",
-   "[command ...]\n"
-   "- show help information (for 'command')\n"
-   "'help' prints online help for the monitor commands.\n\n"
-   "Without arguments, it prints a short usage message for all 
commands.\n\n"
-   "To get detailed help information for specific commands you can type\n"
-   "'help' with one or more command names as arguments."
+   "print command description/usage",
+   "\n"
+   "   - print brief description of all commands\n"
+   "help command ...\n"
+   "   - print detailed usage of 'command'"
 );
 
 /* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
-#ifdef  CONFIG_SYS_LONGHELP
 cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
"?",CONFIG_SYS_MAXARGS, 1,  do_help,
"alias for 'help'",
+#ifdef  CONFIG_SYS_LONGHELP
""
-};
-#else
-cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
-   "?",CONFIG_SYS_MAXARGS, 1,  do_help,
-   "alias for 'help'"
-};
 #endif /* CONFIG_SYS_LONGHELP */
+};
-- 
1.6.2.1

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


[U-Boot] [PATCH 1/3] command.c: Break commands out to appropriate cmd_*.c files

2009-10-16 Thread Peter Tyser
command.c should contain common code related to commands, not
miscellaneous command implementations.

Signed-off-by: Peter Tyser 
---
 common/Makefile  |5 +
 common/cmd_echo.c|   58 +
 common/cmd_exit.c|   42 +
 common/cmd_help.c|   57 
 common/cmd_test.c|  151 
 common/cmd_version.c |   40 +
 common/command.c |  233 --
 7 files changed, 353 insertions(+), 233 deletions(-)
 create mode 100644 common/cmd_echo.c
 create mode 100644 common/cmd_exit.c
 create mode 100644 common/cmd_help.c
 create mode 100644 common/cmd_test.c
 create mode 100644 common/cmd_version.c

diff --git a/common/Makefile b/common/Makefile
index 3781738..35af8ae 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -45,7 +45,9 @@ COBJS-y += xyzModem.o
 # core command
 COBJS-y += cmd_boot.o
 COBJS-y += cmd_bootm.o
+COBJS-y += cmd_help.o
 COBJS-y += cmd_nvedit.o
+COBJS-y += cmd_version.o
 
 # environment
 COBJS-y += env_common.o
@@ -84,9 +86,11 @@ COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
 endif
 COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
 COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
+COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o
 COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
 COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
 COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
+COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
 COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
 COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
 COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
@@ -135,6 +139,7 @@ COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
+COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
 COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
 COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
 COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
diff --git a/common/cmd_echo.c b/common/cmd_echo.c
new file mode 100644
index 000..3ec4d48
--- /dev/null
+++ b/common/cmd_echo.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * 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 
+
+int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int i;
+   int putnl = 1;
+
+   for (i = 1; i < argc; i++) {
+   char *p = argv[i], c;
+
+   if (i > 1)
+   putc(' ');
+   while ((c = *p++) != '\0') {
+   if (c == '\\' && *p == 'c') {
+   putnl = 0;
+   p++;
+   } else {
+   putc(c);
+   }
+   }
+   }
+
+   if (putnl)
+   putc('\n');
+
+   return 0;
+}
+
+U_BOOT_CMD(
+   echo,   CONFIG_SYS_MAXARGS, 1,  do_echo,
+   "echo args to console",
+   "[args..]\n"
+   "- echo args to console; \\c suppresses newline"
+);
diff --git a/common/cmd_exit.c b/common/cmd_exit.c
new file mode 100644
index 000..ed876d8
--- /dev/null
+++ b/common/cmd_exit.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * 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 
+
+int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int r;
+

[U-Boot] [PATCH 3/3] Add 'true' and 'false' commands

2009-10-16 Thread Peter Tyser
These commands are only enabled when the hush shell is enabled and can
be useful in scripts such as:

while true do
echo "Booting OS...";
run $bootcmd;
echo "Booting OS failed";
sleep 10;
done

Signed-off-by: Peter Tyser 
---
This could be added as a hush builtin command if people don't want to
pollute the top-level help listing.  Its debatable if 'false' should
be added also, but I threw it in to be consistent.

 common/cmd_test.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/common/cmd_test.c b/common/cmd_test.c
index 3cdd07b..d886f89 100644
--- a/common/cmd_test.c
+++ b/common/cmd_test.c
@@ -149,3 +149,25 @@ U_BOOT_CMD(
"minimal test like /bin/sh",
"[args..]"
 );
+
+int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   return 1;
+}
+
+U_BOOT_CMD(
+   false,  CONFIG_SYS_MAXARGS, 1,  do_false,
+   "do nothing, unsuccessfully",
+   NULL
+);
+
+int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   return 0;
+}
+
+U_BOOT_CMD(
+   true,   CONFIG_SYS_MAXARGS, 1,  do_true,
+   "do nothing, successfully",
+   NULL
+);
-- 
1.6.2.1

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


[U-Boot] Please pull u-boot-mpc83xx.git

2009-10-16 Thread Kim Phillips
Wolfgang Denk,

Please pull a fix for 8313 rev.2+ networking device trees and a minor
consistency fix:

The following changes since commit cd77dd109c4a439519a78c32eddc42bdebc7a61f:
  Wolfgang Denk (1):
Merge branch 'reloc'

are available in the git repository at:

  git://git.denx.de/u-boot-mpc83xx master

Kim Phillips (1):
  mpc83xx: mpc8313 - handle erratum IPIC1 (TSEC IRQ number swappage)

Paul Gortmaker (1):
  mpc83xx: cosmetic comment update relating to SPD EEPROM

 cpu/mpc83xx/fdt.c |   39 +++
 include/configs/sbc8349.h |2 +-
 include/configs/vme8349.h |2 +-
 3 files changed, 41 insertions(+), 2 deletions(-)

Thanks,

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


Re: [U-Boot] [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.

2009-10-16 Thread Kim Phillips
On Thu, 15 Oct 2009 21:40:43 +0200
Roland Lezuo  wrote:

> On Mon, 2009-10-12 at 11:06 -0500, Kim Phillips wrote:
> > On Wed, 9 Sep 2009 15:28:01 -0500
> > Kumar Gala  wrote:
> > > On Sep 9, 2009, at 1:22 PM, Scott Wood wrote:
> > > > We really should have a u-boot fixup based on SVR.
> > 
> > Roland, is it possible for you to test this u-boot patch?:
> 
> No sorry, I have no MPC8313ERDB at hands. But the patch at least looks
> good...

ok, thanks - I went ahead and applied it anyway; it'll be tested by
the next u-boot release.  I've added your reviewed-by.

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


[U-Boot] [mpc8xxx_spi] help with using mpc8xxxx_spi and M25P40 spi flash

2009-10-16 Thread Richard Retanubun

Hello guys,

This is a derivative of my previous post for adapting mpc8xxx_spi to work with 
mpc8360e spi in cpu-mode.

I'm seeing something funny with using the 'sf probe' command, but not the sspi 
command.

Using 'sspi' command, I got a good response:

=> sspi 0 32 9f
spi_xfer: tx 9f00 [32 of 32] bits
spi_xfer: ... 9f00 written
[0] iR 0 ev 3 <-- [tm] isRead spi->event
[0] spi_xfer: rx 1fffa270 = ff202013
spi_xfer: transfer ended. Value=ff202013
*** spi_xfer: exit
FF202013
=>


When using 'sf probe', only the first tx data got transmitted (verified with 
scope):

sf probe 0:0
spi_xfer: tx 9fffd600 [8 of 8] bits
spi_xfer: ... 9fffd600 written
[0] iR 0 ev 3 <-- [tm] isRead spi->event
[0] spi_xfer: rx  = 0001
spi_xfer: transfer ended. Value=0001
*** spi_xfer: exit
spi_xfer: tx 000102ff [32 of 40] bits
spi_xfer: ... 000102ff written <-- Never got sent out!
[0] iR 0 ev 1 <-- [tm] isRead spi->event
[1] iR 0 ev 1 <-- [tm] isRead spi->event
[2] iR 0 ev 1 <-- [tm] isRead spi->event
...
[1000] iR 0 ev 1
*** spi_xfer: Time out during SPI transfer
spi_xfer: transfer ended. Value=
spi_xfer: tx 03ff [8 of 8] bits
spi_xfer: ... 03ff written <-- Never got sent out!
[0] spi_xfer: rx 1f5b4da8 = 1300
spi_xfer: transfer ended. Value=1300
*** spi_xfer: exit
SF: Got idcode 13 00 00 00 00
Failed to initialize SPI flash at 0:0
=>

On the oscilloscope, even though "spi_xfer: ... 000102ff written" is shown,
I only see the first byte (9f) being sent and the clock stops there, explaining 
the debug printout during getting
rx data that shows the rx buffer never got any data

I have tried replacing the spi->tx = tmpdout statement (and all register access) with 
out_be##(&spi->tx, tmpdout)
in case the compiler is optimizing things out, but this makes no difference.

but if this is true, won't the MPC8349EMDS see this problem also?

What am I missing here?

Modified driver is attached.

Thanks for all the help!

- Richard


/*
 * Copyright (c) 2006 Ben Warren, Qstreams Networks Inc.
 * With help from the common/soft_spi and cpu/mpc8260 drivers
 *
 * 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 

#if defined (CONFIG_MPC8360)
#include 
#endif

#if defined (CONFIG_MPC8360)
#define SPI_EV_LT	(0x80 >> 1)	/* Last char transmitted */
#define SPI_EV_NE	(0x80 >> 6)	/* Receiver Not Empty */
#define SPI_EV_NF	(0x80 >> 7)	/* Transmitter Not Full */

#define SPI_COM_LST	(0x80 >> 1)	/* Last char in frame */

#else
#define SPI_EV_LT	(0x8000 >> 17)	/* Last char transmitted */
#define SPI_EV_NE	(0x8000 >> 22)	/* Receiver Not Empty */
#define SPI_EV_NF	(0x8000 >> 23)	/* Transmitter Not Full */

#define SPI_COM_LST	(0x8000 >> 9)	/* Last char in frame */
#endif

#define SPI_MODE_LOOP	(0x8000 >> 1)	/* Loopback mode */
#define SPI_MODE_CI	(0x8000 >> 2)	/* Clock Invert */
#define SPI_MODE_CP	(0x8000 >> 3)	/* Clock Phase */
#define SPI_MODE_DIV16	(0x8000 >> 4)	/* Input clock divider */
#define SPI_MODE_REV	(0x8000 >> 5)	/* Reverse mode - MSB first */
#define SPI_MODE_MS	(0x8000 >> 6)	/* Always master */
#define SPI_MODE_EN	(0x8000 >> 7)	/* Enable interface */
#define SPI_MODE_OP	(0x8000 >> 17)	/* CPU mode (MPC8360E only) */

#define SPI_TIMEOUT	100

struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
		unsigned int max_hz, unsigned int mode)
{
	struct spi_slave *slave;
#if defined (CONFIG_MPC8360)
	volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR;
	volatile qe_map_t *qe = (volatile qe_map_t *)&im->qe;
	volatile spi_t *spi = (volatile spi_t *)&qe->spi[0];
#endif

	if (!spi_cs_is_valid(bus, cs))
		return NULL;

	slave = malloc(sizeof(struct spi_slave));
	if (!slave)
		return NULL;

	slave->bus = bus;
	slave->cs = cs;

	/*
	 * TODO: Some of the code in spi_init() should probably move
	 * here, or into spi_claim_bus() below.
	 */

#if defined (CONFIG_MPC8360)
	/* Mode must be CPU mode to use this driver */
	spi->mode = SPI_MODE_DIV16 | SPI_MODE_REV | SPI_MODE_MS |
			SPI_MODE_EN | SPI_MODE_OP;

	/* Set speed to (QE_CLK/640) = 625 KHz */
	spi->mode = (spi->mode & 0xfff0) | (4 << 16);
	spi->event = 0xff; /* Clear all SPI events */
	spi->mask = 0x00; /* Mask  all

[U-Boot] [STATUS] Please send your pull requests now...

2009-10-16 Thread Wolfgang Denk
Hello everybody,

I would like to get out a v2009.11-rc in the next few (=1...3) days.
If you have any stuff that should go in, please:

- make sure to send your pull requests now if you are a custodian.

- nudge the responsible custodian to pick up your stuff.


Tom, I'm especially eager to see a pull request for ARM.


Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The one who says it cannot be done should never interrupt the one who
is doing it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request - mpc85xx

2009-10-16 Thread Wolfgang Denk
Dear Kumar Gala,

In message  you wrote:
> The following changes since commit 9efe379a0eb127e616d780533a711f99b52ea64a:
>   Wolfgang Denk (1):
> Merge branch 'master' of git://git.denx.de/u-boot-blackfin
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-mpc85xx master
> 
> Anton Vorontsov (1):
>   mpc85xx: Fix booting on various boards
> 
> Dipen Dudhat (2):
>   ppc/P1_P2_RDB: NAND Boot Support
>   ppc/P1_P2_RDB: On-chip BootROM support
> 
> Paul Gortmaker (3):
>   sbc8641d: fix LAW so board doesn't hang on DDR init
>   mpc8xxx: improve LAW error messages when setting up DDR
>   mpc86xx: delete unused MPC86xx_DDR_SDRAM_CLK_CNTL define
> 
>  MAKEALL|   12 +++
>  Makefile   |   14 +++-
>  board/freescale/p1_p2_rdb/config.mk|   19 
>  board/freescale/p1_p2_rdb/tlb.c|   10 ++
>  board/sbc8641d/law.c   |5 +-
>  cpu/mpc8xxx/ddr/util.c |9 +-
>  include/configs/MPC8610HPCD.h  |2 -
>  include/configs/MPC8641HPCN.h  |2 -
>  include/configs/P1_P2_RDB.h|   87 +++--
>  include/configs/sbc8641d.h |2 -
>  lib_ppc/board.c|8 +-
>  nand_spl/board/freescale/p1_p2_rdb/Makefile|  127 
> 
>  nand_spl/board/freescale/p1_p2_rdb/nand_boot.c |   97 ++
>  13 files changed, 370 insertions(+), 24 deletions(-)
>  create mode 100644 nand_spl/board/freescale/p1_p2_rdb/Makefile
>  create mode 100644 nand_spl/board/freescale/p1_p2_rdb/nand_boot.c

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
America has been discovered before, but it has always been hushed up.
- Oscar Wilde
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] add TI da8xx support: new ethenet driver for da830 EMAC

2009-10-16 Thread Ben Warren
Hi Nick,

Thompson, Nick (GE EntSol, Intelligent Platforms) wrote:
> Add a driver for the DA830 EMAC.
>
> This is very similar to the davinci_emac driver. It has been restructured
> to make it as similar as possible. Potentially the two could be merged,
> but I don't have access to other davinci type platforms to test for
> breakage after the inevitable mangling required.
>
>   
There are enough similarities between this and the in-tree Davinci code 
that it makes no sense to have a different driver.  It also appears like 
you used an older Davinci driver as your source. 

Don't worry so much about not being able to test on other hardware, 
since other people can.  Just try your best to not break anything, and 
post the patches.

As a general comment, please take great care to ensure that no lines 
have more than 78 characters, and that indentation is consistently by 
TAB, with tab width of 8 characters.  Your patch has inconsistent 
indentation and long lines.

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


Re: [U-Boot] imx27lite stability problems.

2009-10-16 Thread Wolfgang Denk
Dear Javier Martin,

In message  you 
wrote:
>
> I could finally test this in an original LogicPD i.mx27 litekit board
> and found the same problems.
> System gets stuck when issuing a ping command.
> 
> - I am using u-boot-arm repository "commit
> 617da90c1dcf65428ddfb63fef897439950bc915" without any modifications.

Can you please use mainline, i. e. the master branch at
git://git.denx.de/u-boot.git instead?

> Please, do you have an idea of what could I be missing?

Well, there is a "Possible iMX27 intermittent Ethernet connection
issue rework" issued by LPD on 7/8/2008; in essence the PHY's
internal 1.8V core regulator may shut off at power up.

To work around this, try and implement the following two hardware
modifications:

1) Populate R841 with a 4.7K resistor. (This forces the internal core
   regulator off for the LAN8700. R841 is located on top of the PCB
   just "above" the LAN8700 IC.

2) Add a jumper wire from U125.5 to C561.1. This connects the on
   board 1.8V rail to the core ensuring that it is always powered.


And no, I don't guarantee you for anything.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Parkinson's Law:  Work expands to fill the time alloted it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] sheevaplug: correct SDRAM address control register value

2009-10-16 Thread Mark Asselstine
The SheevaPlug DevKit is shipped with 4x8 by 1Gb DDR devices in
two banks for a total of 512MB of RAM. Based on this configuration
the existing values for SDRAM address control register are incorrect
and result in random kernel oops as memory is incorrectly accessed
(while for example extracting a large tarball such as a rootfs).
Based on the hardware configuration along with the supporting
documentation from Marvell these are the correct values, as
well this change mimics values previously used in Marvell's own
u-boot git tree for the SheevaPlug.

Other variants of the hardware such as the PogoPlug and TonidoPlug
may have different memory configurations but to properly support
those additional board directories should be maintained or a better
system to support other kwb*.cfg is needed.

Tested on SheevaPlug DevKit.

Signed-off-by: Mark Asselstine 
---
 board/Marvell/sheevaplug/kwbimage.cfg |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/board/Marvell/sheevaplug/kwbimage.cfg 
b/board/Marvell/sheevaplug/kwbimage.cfg
index 6c47d62..61be8c2 100644
--- a/board/Marvell/sheevaplug/kwbimage.cfg
+++ b/board/Marvell/sheevaplug/kwbimage.cfg
@@ -74,11 +74,11 @@ DATA 0xFFD0140C 0x0a33  #  DDR Timing (High)
 # bit12-11: TW2W
 # bit31-13: zero required
 
-DATA 0xFFD01410 0x0099 #  DDR Address Control
-# bit1-0:   01, Cs0width=x16
-# bit3-2:   10, Cs0size=512Mb
-# bit5-4:   01, Cs1width=x16
-# bit7-6:   10, Cs1size=512Mb
+DATA 0xFFD01410 0x00cc #  DDR Address Control
+# bit1-0:   00, Cs0width=reserved
+# bit3-2:   11, Cs0size=1Gb
+# bit5-4:   00, Cs1width=reserved
+# bit7-6:   11, Cs1size=1Gb
 # bit9-8:   00, Cs2width=nonexistent
 # bit11-10: 00, Cs2size =nonexistent
 # bit13-12: 00, Cs3width=nonexistent
-- 
1.5.5.1

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


Re: [U-Boot] [PATCH v3] TQM85xx: enable partition support, sort commands

2009-10-16 Thread Kumar Gala

On Sep 8, 2009, at 3:29 PM, Wolfgang Denk wrote:

> Signed-off-by: Wolfgang Denk 
>
> ---
> v2: Fix building for TQM8548_BE
>
>On TQM8548_BE, building failed like that:
>   Configuring for TQM85xx board...
>   common/libcommon.a(cmd_mtdparts.o): In function  
> `part_validate_eraseblock':
>   /home/wd/git/u-boot/work/common/cmd_mtdparts.c:316: undefined  
> reference to `get_mtd_device_nm'
>   common/libcommon.a(cmd_mtdparts.o): In function  
> `mtd_device_validate':
>   /home/wd/git/u-boot/work/common/cmd_mtdparts.c:706: undefined  
> reference to `get_mtd_device_nm'
>   make: *** [u-boot] Error 1
>
>This was because CONFIG_CMD_MTDPARTS was defined after it was
>used. Move the part that uses it after the #define.
> v3: Fix "undefined reference to `get_mtd_device_nm'" errors for
>non-8548 boards; build-tested with ELDK 4.2 on TQM8540, TQM8541,
>TQM8548, TQM8548_AG, TQM8548_BE, TQM8555 and TQM8560
>
> include/configs/TQM85xx.h |   51 +++ 
> +
> 1 files changed, 28 insertions(+), 23 deletions(-)

We never resolved this.

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


Re: [U-Boot] [PATCH 0/3] enable CONFIG_NET_MULTI for LAN91C96

2009-10-16 Thread Menon, Nishanth
> -Original Message-
> From: Ben Warren [mailto:biggerbadder...@gmail.com]
> Sent: Friday, October 16, 2009 11:30 AM
> Nishanth Menon wrote:
> > Based on the discussion[1] here is the patchset
> >
> > Patchset is based on [2], and tested on SDP3430.
> > Other platforms would be prefered to be
> > build/tested/fixed as required
> >
> > Nishanth Menon (3):
> >   NET: LAN91C96 CONFIG_NET_MULTIify
> >   TI OMAP3: SDP3430 FIX NET_MULTI Warning
> >   LAN91C96: Enable NET_MULTI LAN driver
> >
> >
> On first pass review, this looks great!  There are a few things I'd like
> to do to improve the driver, but it has nothing to do with converting to
> NET_MULTI.
> 
> I'm going to fire up a net-next branch this weekend and will try to
> apply it there.
Gee thanks..

Having very less knowledge on lan91c96 itself, I can help be the guinea pig 
for testing on SDP3430 at least :)

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


Re: [U-Boot] [PATCH 0/3] enable CONFIG_NET_MULTI for LAN91C96

2009-10-16 Thread Ben Warren
Hi Nishanth,

Nishanth Menon wrote:
> Based on the discussion[1] here is the patchset
>
> Patchset is based on [2], and tested on SDP3430.
> Other platforms would be prefered to be
> build/tested/fixed as required
>
> Nishanth Menon (3):
>   NET: LAN91C96 CONFIG_NET_MULTIify
>   TI OMAP3: SDP3430 FIX NET_MULTI Warning
>   LAN91C96: Enable NET_MULTI LAN driver
>
>   
On first pass review, this looks great!  There are a few things I'd like 
to do to improve the driver, but it has nothing to do with converting to 
NET_MULTI.

I'm going to fire up a net-next branch this weekend and will try to 
apply it there.

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


Re: [U-Boot] OMAP3 EVM: Only ONENAND supported, no NAND any more?

2009-10-16 Thread Dirk Behme
Tuma wrote:
> Sorry for my intrusion.
> But why NAND support was "removed"?

It's a question, not a statement.

Was NAND support removed?

Best regards

Dirk

> Maybe you need just reconfigure and build your U-Boot?
> 
> On Friday 16 October 2009 19:29:11 Dirk Behme wrote:
>> Hi,
>>
>> in a private mail someone mentioned that recent U-Boot for OMAP3 EVM
>> has only support for ONENAND. And NAND support was removed? He still
>> has an EVM with NAND.
>>
>> Any idea?
>>
>> Best regards
>>
>> Dirk
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
> 
> 
> 

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


Re: [U-Boot] OMAP3 EVM: Only ONENAND supported, no NAND any more?

2009-10-16 Thread Tuma
Sorry for my intrusion.
But why NAND support was "removed"?
Maybe you need just reconfigure and build your U-Boot?

On Friday 16 October 2009 19:29:11 Dirk Behme wrote:
> Hi,
>
> in a private mail someone mentioned that recent U-Boot for OMAP3 EVM
> has only support for ONENAND. And NAND support was removed? He still
> has an EVM with NAND.
>
> Any idea?
>
> Best regards
>
> Dirk
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



-- 
Software Developer
General Satellite Corp.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] OMAP3 EVM: Only ONENAND supported, no NAND any more?

2009-10-16 Thread Dirk Behme
Hi,

in a private mail someone mentioned that recent U-Boot for OMAP3 EVM 
has only support for ONENAND. And NAND support was removed? He still 
has an EVM with NAND.

Any idea?

Best regards

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


[U-Boot] Pull request - mpc85xx

2009-10-16 Thread Kumar Gala
The following changes since commit 9efe379a0eb127e616d780533a711f99b52ea64a:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-blackfin

are available in the git repository at:

  git://git.denx.de/u-boot-mpc85xx master

Anton Vorontsov (1):
  mpc85xx: Fix booting on various boards

Dipen Dudhat (2):
  ppc/P1_P2_RDB: NAND Boot Support
  ppc/P1_P2_RDB: On-chip BootROM support

Paul Gortmaker (3):
  sbc8641d: fix LAW so board doesn't hang on DDR init
  mpc8xxx: improve LAW error messages when setting up DDR
  mpc86xx: delete unused MPC86xx_DDR_SDRAM_CLK_CNTL define

 MAKEALL|   12 +++
 Makefile   |   14 +++-
 board/freescale/p1_p2_rdb/config.mk|   19 
 board/freescale/p1_p2_rdb/tlb.c|   10 ++
 board/sbc8641d/law.c   |5 +-
 cpu/mpc8xxx/ddr/util.c |9 +-
 include/configs/MPC8610HPCD.h  |2 -
 include/configs/MPC8641HPCN.h  |2 -
 include/configs/P1_P2_RDB.h|   87 +++--
 include/configs/sbc8641d.h |2 -
 lib_ppc/board.c|8 +-
 nand_spl/board/freescale/p1_p2_rdb/Makefile|  127 
 nand_spl/board/freescale/p1_p2_rdb/nand_boot.c |   97 ++
 13 files changed, 370 insertions(+), 24 deletions(-)
 create mode 100644 nand_spl/board/freescale/p1_p2_rdb/Makefile
 create mode 100644 nand_spl/board/freescale/p1_p2_rdb/nand_boot.c
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc85xx: Fix booting on various boards

2009-10-16 Thread Kumar Gala

On Oct 12, 2009, at 2:55 PM, Anton Vorontsov wrote:

> commit 0e870980a64584a591af775bb9c9fe9450124df9 ("8xxx: Removed
> CONFIG_NUM_CPUS from 85xx/86xx") breaks U-Boot on various boards,
> namely the ones that call get_sys_info() from board_early_init_f().
>
> get_sys_info() calls cpu_numcores(), which depends on probecpu()
> being called before. But probecpu() is called after  
> board_early_init_f(),
> and so cpu_numcores() returns random values, which in turn crashes
> get_sys_info().
>
> To fix the issue we place probecpu() before board_early_init_f()
> in an initialization sequence.
>
> Booting on the following boards should be revived now:
> mpc8540ads
> mpc8541cds
> mpc8548cds
> mpc8555cds
> mpc8560ads
> mpc8568mds
> mpc8569mds
> and maybe more.
>
> Signed-off-by: Anton Vorontsov 
> ---
> lib_ppc/board.c |8 +++-
> 1 files changed, 3 insertions(+), 5 deletions(-)

applied to 85xx.

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


Re: [U-Boot] CONFIG_GENERIC_MMC Usage

2009-10-16 Thread Shane Volpe
Sorry for the top post, I forgot to delete it.

Mike,
>if you read the arch-specific init files you'll see that a call is made to
>mmc_initialize() which in turn calls a board-specific board_mmc_init().  your
>board_mmc_init() then calls the driver init functions.  it's the same idiom
>that is used for most U-Boot subsystems now.

Ok, thanks I see the board_mmc_init() call and I also grep'd the board
directory and see the following example:
  board/freescale/mpc837xemds/mpc837xemds.c

That's what I thought, I should add the function board_mmc_init to my
board file and add in all code needed to initialize the MMC hardware
for the PXA270.

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


Re: [U-Boot] CONFIG_GENERIC_MMC Usage

2009-10-16 Thread Mike Frysinger
On Friday 16 October 2009 09:45:20 Shane Volpe wrote:
> Minkyu,

please do not top post

> 1.) Is there any documentation in place (or can someone send me off a
> quick reply) on how to set up the generic mmc driver with a board?

if you read the arch-specific init files you'll see that a call is made to 
mmc_initialize() which in turn calls a board-specific board_mmc_init().  your 
board_mmc_init() then calls the driver init functions.  it's the same idiom 
that is used for most U-Boot subsystems now.

> I'm assuming what I need to do is add code to my board file to
> initialize the MMC hardware.  This was originally done in "
> drivers/mmc/pxa_mmc.c" with mmc_init() well now it is
> mmc_legacy_init().

no, your board should not be doing any driver-specific initialization
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] cmd_nand: Move conditional compilation to Makefile

2009-10-16 Thread Peter Tyser
Hi Vimal,

On Fri, 2009-10-16 at 17:03 +0530, vimal singh wrote:
> Could you please add some description?

I personally think the patch title has plenty of description.  The
change is trivial, and similar changes (with similar
titles/descriptions) have been accepted many times in the past.

Best,
Peter

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


Re: [U-Boot] CONFIG_GENERIC_MMC Usage

2009-10-16 Thread Shane Volpe
Minkyu,
Thank you for the response.  I have only one question remaining:

1.) Is there any documentation in place (or can someone send me off a
quick reply) on how to set up the generic mmc driver with a board?

I'm assuming what I need to do is add code to my board file to
initialize the MMC hardware.  This was originally done in "
drivers/mmc/pxa_mmc.c" with mmc_init() well now it is
mmc_legacy_init().

I'm assuming all I would need to do is remove all the mmc commands
from that code and just *take* the hardware initialization code from
it (check it for accuracy) and add it to my board file, is that
correct?

Regards,
Shane

On Fri, Oct 16, 2009 at 7:57 AM, Minkyu Kang  wrote:
> Dear Shane Volpe
>
> 2009/10/15 Shane Volpe :
>> I have a PXA270 system with U-boot v2009.08 installed, currently this
>> system is successfully using the U-boot mmc interface (legacy) .
>> However, after looking through the u-boot source code, I see there is
>> a new mmc interface (CONFIG_GENERIC_MMC),  should I be using the
>> generic mmc interface?  I have tried it but it does not seem to work,
>> I'm assuming that it probably requires initialization of the MMC
>> hardware in the board files whereas in the legacy mmc system that was
>> done by the (legacy_mmc_init) board specific mmc (pxa_mmc.c) code.
>>
>> Questions regarding the new GENERIC_MMC interface:
>> 1.) Is there any documentation in place (or can someone send me off a
>> quick reply) on how to set up the generic mmc driver with a board?
>> 2.) Is it ready (recommended) to use or is it still under heavy development?
>
> generic mmc interface is ready
>
>> 3.) Does it support SDHC or just SD?
>
> support both of them
>
>>
>> Regards,
>> Shane
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
> 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


Re: [U-Boot] [PATCH 0/5] add TI da8xx support:

2009-10-16 Thread Paulraj, Sandeep


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of Thompson, Nick (GE EntSol, Intelligent Platforms)
> Sent: Friday, October 16, 2009 6:33 AM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH 0/5] add TI da8xx support:
> 
> Patches 1/5 and 2/5 both *still* contain small amounts of wrapping - why
> does outlook even consider that it's okay to mangle my e-mails??? - Please
> excuse the mess.
> 
> I can fix them, but I'm not going to send them again until people have
> had chance to comment on other aspects of the patch set.
> 
> Thanks,
> Nick.
First of all thanks for taking the initiative for submitting this patch set.
I have some comments. I will reply with my comments tomorrow.

Thanks,
Sandeep



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


Re: [U-Boot] imx27lite stability problems.

2009-10-16 Thread javier Martin
2009/9/17 Wolfgang Denk :
> Dear javier Martin
>
>> I would like to help to solve this problems, but I don't know exactly
>> where to begin from. I have been reviewing clock settings. Could this
>> be happening because this board is using 32KHz xtal as reference
>> instead of 26MHz one?
>
> Yes, of course this could be a problem. Is this an original LogicPD
> board?  Did you adapt the code for the different clock speed? What
> exactly did you change?

Dear Wolfgang Denk,
I could finally test this in an original LogicPD i.mx27 litekit board
and found the same problems.
System gets stuck when issuing a ping command.

- I am using u-boot-arm repository "commit
617da90c1dcf65428ddfb63fef897439950bc915" without any modifications.
- arm-linux-gcc toolchains from eldk-arm-4.1.
- I configured u-boot for i.mx27 litekit, compiled and flashed it in
the NOR with a JTAG.


Please, do you have an idea of what could I be missing?


-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Booting automatically a binary image

2009-10-16 Thread Ivan Llopard
I found the problem!, i tried with the environment variables but it didn't
work. In fact, i have not defined CONFIG_AUTOBOOT_DELAY in my config file,
so i couldn't even see any autoboot attemp.

Regards,
Ivan Llopard.

2009/10/16 Detlev Zundel 

> Hi Ivan,
>
> > I'd like to know how to configure u-boot in order to boot automatically a
> > binary image, so when i reset my board i can get my program running.
>
> Documentation sometimes can answer such questions:
>
> http://www.denx.de/wiki/view/DULG/UBootEnvVariables
>
> Check at least 'bootcmd' and 'bootdelay'.
>
> Cheers
>  Detlev
>
> --
> You see, the best way to solve a problem is to rigorously define it in
> terms of other people's problems, and then run away quickly.
>  -- Roland McGrath
> --
> DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] CONFIG_GENERIC_MMC Usage

2009-10-16 Thread Minkyu Kang
Dear Shane Volpe

2009/10/15 Shane Volpe :
> I have a PXA270 system with U-boot v2009.08 installed, currently this
> system is successfully using the U-boot mmc interface (legacy) .
> However, after looking through the u-boot source code, I see there is
> a new mmc interface (CONFIG_GENERIC_MMC),  should I be using the
> generic mmc interface?  I have tried it but it does not seem to work,
> I'm assuming that it probably requires initialization of the MMC
> hardware in the board files whereas in the legacy mmc system that was
> done by the (legacy_mmc_init) board specific mmc (pxa_mmc.c) code.
>
> Questions regarding the new GENERIC_MMC interface:
> 1.) Is there any documentation in place (or can someone send me off a
> quick reply) on how to set up the generic mmc driver with a board?
> 2.) Is it ready (recommended) to use or is it still under heavy development?

generic mmc interface is ready

> 3.) Does it support SDHC or just SD?

support both of them

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

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


Re: [U-Boot] [PATCH 0/5] add TI da8xx support:

2009-10-16 Thread Jerry Van Baren
Hi Nick,

Thompson, Nick (GE EntSol, Intelligent Platforms) wrote:
> Patches 1/5 and 2/5 both *still* contain small amounts of wrapping - why
> does outlook even consider that it's okay to mangle my e-mails??? - Please
> excuse the mess.

Contrary to popular opinion, spam did not kill email.  There are plenty 
of technical solutions to spam.

Outlook + PHBs killed email.  There is no technical solution for that 
combination.


The Hitchhiker's Guide to the Galaxy, in a moment of reasoned lucidity 
which is almost unique among its current tally of five million, nine 
hundred and seventy-three thousand, five hundred and nine pages, says of 
the Sirius Cybernetics Corporation products that "it is very easy to be 
blinded to the essential uselessness of them by the sense of achievement 
you get from getting them to work at all." In other words, - and this is 
the rock-solid principle on which the whole of the Corporation's 
Galaxywide success is founded - their fundamental design flaws are 
completely hidden by their superficial design flaws.

   -- The Hitchhiker's Guide to the Galaxy / Douglas Adams (1952 - 
2001). 1st American ed. New York : Harmony Books, 1980, c1979


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


Re: [U-Boot] [PATCH 2/2] cmd_nand: Move conditional compilation to Makefile

2009-10-16 Thread vimal singh
Could you please add some description?

-vimal

On Thu, Oct 15, 2009 at 9:18 PM, Peter Tyser  wrote:
> Signed-off-by: Peter Tyser 
> ---
>  common/Makefile   |    2 +-
>  common/cmd_nand.c |    4 
>  2 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/common/Makefile b/common/Makefile
> index 35af8ae..ec025ed 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -120,7 +120,7 @@ COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
>  COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
>  COBJS-$(CONFIG_MP) += cmd_mp.o
>  COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
> -COBJS-y += cmd_nand.o
> +COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
>  COBJS-$(CONFIG_CMD_NET) += cmd_net.o
>  COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
>  COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 404ef9c..075a8af 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -10,9 +10,6 @@
>
>  #include 
>  #include 
> -
> -#if defined(CONFIG_CMD_NAND)
> -
>  #include 
>  #include 
>  #include 
> @@ -678,4 +675,3 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
>        "boot from NAND device",
>        "[partition] | [[[loadAddr] dev] offset]"
>  );
> -#endif
> --
> 1.6.2.1
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



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


[U-Boot] Regarding NAND flash support in IMX31

2009-10-16 Thread R Arun Kumar
Hai,

After rechecking all the nand related code, I found that the register
address definition is not proper in imx31_regs.h (there is one #if 0, which
needs to be made #if 1) and found that the *addpart *and *nand -a *and *erase
*are been working. But the file copy been not working, Any help

The log
*
U-Boot 2.0.0-rc9 (Oct 16 2009 - 15:30:39)

Board: Phytec phyCORE-i.MX31
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V
8-bi
t)
Scanning device for bad blocks
got MAC address from EEPROM: 00:08:EE:01:86:71
mx31 cpu clock: 513MHz
ipg clock : 64133247Hz
Malloc space: 0x87b0 -> 0x87f0 (size  4 MB)
Stack space : 0x87af8000 -> 0x87b0 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment
running /env/bin/init...

Hit any key to stop autoboot:  5

type update_kernel nand|nor [] to update kernel into flash
type update_root nand|nor [] to update rootfs into flash

uboot:/
uboot:/ devinfo
devices:
|cs0
|mem
|nor0
||self0
|`env0
|nand0
||nand0.uboot
||`nand0.uboot.bb
||nand0.ubootenv
||`nand0.ubootenv.bb
||nand0.kernel
||`nand0.kernel.bb
|`nand0.root
||`nand0.root.bb
|eth0
|phy0
|ram0
|defaultenv
|filesystem: /
|filesystem: /dev

drivers:
imx_serial
 partition
   smc911x
miiphy
nand_device
  imx_nand
 cfi_flash
   mem
   ram
   rom
   nand_bb
 ramfs
 devfs
uboot:/ erase /dev/nand0.kernel.bb
uboot:/ tftp uImage /dev/nand0.kernel.bb
phy0: Link is up - 100/Full
TFTP from server 192.168.50.247; our IP address is 192.168.50.182
Filename 'uImage'.
Loading: #write: No space left on device
uboot:/


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


[U-Boot] [PATCH 0/5] add TI da8xx support:

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Patches 1/5 and 2/5 both *still* contain small amounts of wrapping - why
does outlook even consider that it's okay to mangle my e-mails??? - Please
excuse the mess.

I can fix them, but I'm not going to send them again until people have
had chance to comment on other aspects of the patch set.

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


Re: [U-Boot] [PATCH 2/5] add TI da8xx support: new arch directory

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Resent due to wrapping in patch 2 (unwrapped patch 1 resent, 3, 4 and 5 seem 
okay)

Create initial contents of the include/asm-arm/arch-da8xx directory:

General hardware definitions.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 include/asm-arm/arch-da8xx/clock.h |   24 +++
 include/asm-arm/arch-da8xx/emac_defs.h |  328 
 include/asm-arm/arch-da8xx/emif_defs.h |   71 +++
 include/asm-arm/arch-da8xx/hardware.h  |  206 
 include/asm-arm/arch-da8xx/i2c_defs.h  |   95 +
 5 files changed, 724 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-da8xx/clock.h 
b/include/asm-arm/arch-da8xx/clock.h
new file mode 100644
index 000..a9b74f4
--- /dev/null
+++ b/include/asm-arm/arch-da8xx/clock.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd.  

+ * 
+ * DA8xx clock include header
+ *
+ * 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 __ASSEMBLER__
+int clk_get(unsigned int id);
+#endif
diff --git a/include/asm-arm/arch-da8xx/emac_defs.h 
b/include/asm-arm/arch-da8xx/emac_defs.h
new file mode 100644
index 000..2da0c41
--- /dev/null
+++ b/include/asm-arm/arch-da8xx/emac_defs.h
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Based on:
+ *
+ * 
+ *
+ * dm644x_emac.h
+ *
+ * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
+ *
+ * Copyright (C) 2005 Texas Instruments.
+ *
+ * 
+ *
+ * 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.
+ * 
+
+ * Modifications:
+ * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
+ *
+ */
+
+#ifndef _DA8XX_EMAC_H_
+#define _DA8XX_EMAC_H_
+
+#include 
+
+#define EMAC_BASE_ADDR DAVINCI_EMAC_CNTRL_REGS_BASE
+#define EMAC_WRAPPER_BASE_ADDR DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE
+#define EMAC_WRAPPER_RAM_ADDR  DAVINCI_EMAC_WRAPPER_RAM_BASE
+#define EMAC_MDIO_BASE_ADDRDAVINCI_MDIO_CNTRL_REGS_BASE
+
+/* MDIO module input frequency */
+#define EMAC_MDIO_BUS_FREQ clk_get(DAVINCI_MDIO_CLKID)
+
+/* MDIO clock output frequency */
+#define EMAC_MDIO_CLOCK_FREQ   200 /* 2.0 MHz */
+
+/* Ethernet Min/Max packet size */
+#define EMAC_MIN_ETHERNET_PKT_SIZE 60
+#define EMAC_MAX_ETHERNET_PKT_SIZE 1518
+#define EMAC_PKT_ALIGN 18  /* 1518 + 18 = 1536 (packet 
aligned on 32 byte boundry) */
+
+/* Number of RX packet buffers
+ * NOTE: Only 1 buffer supported as of now
+ */
+#define EMAC_MAX_RX_BUFFERS10
+
+
+/***
+  Internally used macros ***
+ ***/
+
+#define EMAC_CH_TX 1
+#define EMAC_CH_RX 0
+
+/* Each descriptor occupies 4 words, lets start RX desc's at 0 and
+ * reserve space for 64 descriptors max
+ */
+#define EMAC_RX_DESC_BASE  0x0
+#define EMAC_TX_DESC_BASE  0x1000
+
+/* EMAC Teardown value */
+#define EMAC_TEARDOWN_VALUE0xfffc
+
+/* MII Status Register */
+#define MII_STATUS_REG 1
+
+/* Number of statistics registers */
+#define EMAC_NUM_STATS 36
+
+
+/* EMAC Descriptor */
+typedef volatile struct _emac_desc
+{
+   u_int32_t   next;   /* Pointer t

Re: [U-Boot] [PATCH 1/5] add TI da8xx support: new cpu directory

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Resent due to wrapping in patch 1 (unwrapped patch 2 to follow, 3, 4 an
5 seem okay)

Create initial contents of the cpu/arm926ejs/da8xx directory:

Low level initilisation.
Support for SoC clock, timer and reset functions.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 cpu/arm926ejs/da8xx/Makefile|   53 +
 cpu/arm926ejs/da8xx/clock.c |   58 ++
 cpu/arm926ejs/da8xx/lowlevel_init.S |   73 +
 cpu/arm926ejs/da8xx/reset.S |   77 ++
 cpu/arm926ejs/da8xx/timer.c |  148
+++
 5 files changed, 409 insertions(+), 0 deletions(-)

diff --git a/cpu/arm926ejs/da8xx/Makefile b/cpu/arm926ejs/da8xx/Makefile
new file mode 100644
index 000..76fb7b8
--- /dev/null
+++ b/cpu/arm926ejs/da8xx/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn 
+#
+# 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
+
+LIB= $(obj)lib$(SOC).a
+
+COBJS  = timer.o clock.o
+SOBJS  = reset.o
+
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+SOBJS  += lowlevel_init.o
+endif
+
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+###
##
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+###
##
diff --git a/cpu/arm926ejs/da8xx/clock.c b/cpu/arm926ejs/da8xx/clock.c
new file mode 100644
index 000..25cf4df
--- /dev/null
+++ b/cpu/arm926ejs/da8xx/clock.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.

+ * 
+ * DA8xx clock module
+ *
+ * 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.
+ *


+ */
+
+#include 
+#include 
+
+dv_reg_p sysdiv[9] = {
+REG_P(PLL0_DIV1), REG_P(PLL0_DIV2), REG_P(PLL0_DIV3),
REG_P(PLL0_DIV4),
+REG_P(PLL0_DIV5), REG_P(PLL0_DIV6), REG_P(PLL0_DIV7),
REG_P(PLL0_DIV8),
+REG_P(PLL0_DIV9) };
+
+int clk_get(unsigned int id)
+{
+int pre_div = (REG(PLL0_PREDIV) & 0xff) + 1;
+int pllm = REG(PLL0_PLLM)  + 1;
+int post_div = (REG(PLL0_POSTDIV) & 0xff) + 1;
+int pll_out = CONFIG_SYS_OSCIN_FREQ;
+
+if(id == DAVINCI_AUXCLK_CLKID) 
+goto out;
+
+/* Lets keep this simple. Combining operations can result in 
+ * unexpected approximations
+ */
+pll_out /= pre_div;
+pll_out *= pllm;
+
+if(id == DAVINCI_PLLM_CLKID) 
+goto out;
+
+pll_out /= post_div;
+
+if(id == DAVINCI_PLLC_CLKID) 
+goto out;
+
+pll_out /= (REG(sysdiv[id - 1]) & 0xff) + 1;
+
+out:
+return pll_out;
+}
diff --git a/cpu/arm926ejs/da8xx/lowlevel_init.S
b/cpu/arm926ejs/da8xx/lowlevel_init.S
new file mode 100644
index 000..53f801a
--- /dev/null
+++ b/cpu/arm926ejs/da8xx/lowlevel_init.S
@@ -0,0 +1,73 @@
+/*
+ * Low-level board setup code for TI DA8xx SoC based boards.
+ *
+ * Copyright (C) 2008 Texas Instruments, Inc 
+ * Sekhar Nori 
+ * 
+ * Based on TI DaVinci low level init code. Original copyrights follow.
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Partially based on TI sources, original copyrights follow:
+ */
+
+/*
+ * Board specific setup info
+ *
+ * (C) Copyright 2003

Re: [U-Boot] Booting automatically a binary image

2009-10-16 Thread Detlev Zundel
Hi Ivan,

> I'd like to know how to configure u-boot in order to boot automatically a
> binary image, so when i reset my board i can get my program running.

Documentation sometimes can answer such questions:

http://www.denx.de/wiki/view/DULG/UBootEnvVariables

Check at least 'bootcmd' and 'bootdelay'.

Cheers
  Detlev

-- 
You see, the best way to solve a problem is to rigorously define it in
terms of other people's problems, and then run away quickly.
  -- Roland McGrath
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/5] add TI da8xx support: integration into build system

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Add config, Makefile and common header changes to integrate DA8xx
Support.

Creates a new config target:
make ... da8xx_omapl1_evm_config

Tested build with Sourcery G++ Lite 2009q1-203 tool chain on an
OMAP-L137 EVM board RevE with Rev1.1 DA830 silicon.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 Makefile|4 +
 include/common.h|3 +
 include/configs/da8xx_evm.h |  241 +++

diff --git a/Makefile b/Makefile
index 449099a..26170db 100644
--- a/Makefile
+++ b/Makefile
@@ -2936,6 +2936,10 @@ davinci_dm365evm_config :unconfig
 davinci_dm6467evm_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci
 
+xtract_da8xx = $(subst da8xx_omapl1,da8xx,$(subst _config,,$1))
+da8xx_omapl1_evm_config :  unconfig
+   @$(MKCONFIG) $(call xtract_da8xx,$@) arm arm926ejs da8xx-evm da8xx da8xx
+
 imx27lite_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
 
diff --git a/include/common.h b/include/common.h
index f7c93bf..5c8d609 100644
--- a/include/common.h
+++ b/include/common.h
@@ -107,6 +107,9 @@ typedef volatile unsigned char  vu_char;
 #ifdef CONFIG_BLACKFIN
 #include 
 #endif
+#ifdef CONFIG_DA8XX
+#include 
+#endif
 
 #include 
 #include 
diff --git a/include/configs/da8xx_evm.h b/include/configs/da8xx_evm.h
new file mode 100644
index 000..8bdbb71
--- /dev/null
+++ b/include/configs/da8xx_evm.h
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2008 Texas Instruments, Inc 
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+#include 
+#include 
+
+/*===*/
+/* Board */
+/*===*/
+/* #define  CONFIG_USE_SPIFLASH */
+/* #define  CONFIG_USE_NAND */
+
+/*===*/
+/* SoC Configuration */
+/*===*/
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQ clk_get(DAVINCI_ARM_CLKID) /* Arm Clock */
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE /* use timer 0 */
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID) /* Timer 
Input clock freq */
+#define CONFIG_SYS_HZ  1000
+#undef CONFIG_SKIP_LOWLEVEL_INIT   /* U-Boot is _always_ loaded by a 
bootloader */
+#define CONFIG_SKIP_RELOCATE_UBOOT /* to a proper address, init done */
+
+/*=*/
+/* Memory Info */
+/*=*/
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len 
*/
+#define CONFIG_SYS_GBL_DATA_SIZE   128 /* reserved for initial data */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE  /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  0x0400  /* SDRAM size 64MB */
+#define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM_1/* memtest start 
address */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 16*1024*1024)   /* 16MB 
RAM test */
+#define CONFIG_NR_DRAM_BANKS   1   /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024)  /* regular stack */
+#define SDRAM_4BANKS_10COLS/* TODO: Update this! */
+
+/**/
+/* 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) /* Input clock to 
NS16550 */
+#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 }
+
+/*===*/
+/* I2C Configuration */
+/*===*/
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_DAVINCI_I2C
+#define CONFIG_SYS_I2C_SPEED   25000   /* 100Kbps won't work, 
silicon bug */
+#defi

[U-Boot] [PATCH 4/5] add TI da8xx support: new ethenet driver for da830 EMAC

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Add a driver for the DA830 EMAC.

This is very similar to the davinci_emac driver. It has been restructured
to make it as similar as possible. Potentially the two could be merged,
but I don't have access to other davinci type platforms to test for
breakage after the inevitable mangling required.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 drivers/net/Makefile |1 +
 drivers/net/da8xx_emac.c |  654 ++
 2 files changed, 655 insertions(+), 0 deletions(-)

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index be5c484..9cbe736 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -68,6 +68,7 @@ COBJS-$(CONFIG_DRIVER_SMC9) += smc9.o
 COBJS-$(CONFIG_SMC911X) += smc911x.o
 COBJS-$(CONFIG_TIGON3) += tigon3.o bcm570x_autoneg.o 5701rls.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
+COBJS-$(CONFIG_DRIVER_DA8XX_EMAC) += da8xx_emac.o
 COBJS-$(CONFIG_TSEC_ENET) += tsec.o
 COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
 COBJS-$(CONFIG_ULI526X) += uli526x.o
diff --git a/drivers/net/da8xx_emac.c b/drivers/net/da8xx_emac.c
new file mode 100644
index 000..e1d232f
--- /dev/null
+++ b/drivers/net/da8xx_emac.c
@@ -0,0 +1,654 @@
+/*
+ * Ethernet driver for TI OMAP-L1x/DA8xx chips.
+ *
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. 
+ * 
+ * Much of this is very similar to the davinci_emac driver. Possibly they
+ * could be merged, but I have no access to non DA8xx platforms
+ * and can't test for breakage after the inevitable mangling.
+ * 
+ * Code base is not new. Original copyright follows:
+ *
+ * 
+ *
+ * Ethernet driver for TI TMS320DM644x (DaVinci) chips.
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Parts shamelessly stolen from TI's dm644x_emac.c. Original copyright
+ * follows:
+ *
+ * 
+ *
+ * dm644x_emac.c
+ *
+ * TI DaVinci (DM644X) EMAC peripheral driver source for DV-EVM
+ *
+ * Copyright (C) 2005 Texas Instruments.
+ *
+ * 
+ *
+ * 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.
+ * 
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef CONFIG_DRIVER_DA8XX_EMAC
+
+#ifdef CONFIG_CMD_NET
+
+unsigned int   emac_dbg = 0;
+#define debug_emac(fmt,args...)if (emac_dbg) printf(fmt,##args)
+
+/* Internal static functions */
+static int da8xx_eth_open (struct eth_device *dev, bd_t *bis);
+static void da8xx_eth_close (struct eth_device *dev);
+static int da8xx_eth_send_packet (struct eth_device *dev, volatile void 
*packet, int length);
+static int da8xx_eth_rcv_packet (struct eth_device *dev);
+static void da8xx_eth_mdio_enable(void);
+
+static int gen_init_phy(int phy_addr);
+static int gen_is_phy_connected(int phy_addr);
+static int gen_get_link_speed(int phy_addr);
+static int gen_auto_negotiate(int phy_addr);
+
+/* mac address for EMAC registers only (not packet data) */
+static u_int8_t da8xx_eth_mac_addr[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00 };
+
+/*
+ * This function must be called before emac_open() if you want to override
+ * the default mac address.
+ */
+void da8xx_eth_set_mac_addr(const u_int8_t *addr)
+{
+   int i;
+
+   for (i = 0; i < sizeof (da8xx_eth_mac_addr); i++) {
+   da8xx_eth_mac_addr[i] = addr[i];
+   }
+}
+
+/* EMAC Addresses */
+static volatile emac_regs  *adap_emac = (emac_regs *)EMAC_BASE_ADDR;
+static volatile ewrap_regs *adap_ewrap = (ewrap_regs 
*)EMAC_WRAPPER_BASE_ADDR;
+static volatile mdio_regs  *adap_mdio = (mdio_regs *)EMAC_MDIO_BASE_ADDR;
+
+/* EMAC descriptors */
+static volatile emac_desc  *emac_rx_desc = (emac_desc 
*)(EMAC_WRAPPER_RAM_ADDR + EMAC_RX_DESC_BASE);
+static volatile emac_desc  *emac_tx_desc = (emac_desc 
*)(EMAC_WRAPPER_RAM_ADDR + EMAC_TX_DESC_BASE);
+static volatile emac_desc  *emac_rx_active_head = 0;
+static volatile emac_desc  *emac_rx_active_tail = 0;
+static int emac_rx_queue_active = 0;
+
+/* Receive packet buffers */
+static unsigned char   emac_rx_buffers[EMAC_MAX_RX_BUFFERS * 
(EMAC_MAX_ETHER

[U-Boot] [PATCH 3/5] add TI da8xx support: new board directory for spectrum digital EVM

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Create initial contents of the board/da8xx/da8xx-evm directory:

Low level board initialisation.
Board level initilisation.
Linker control.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 board/da8xx/da8xx-evm/Makefile |   52 ++
 board/da8xx/da8xx-evm/board_init.S |   29 +++
 board/da8xx/da8xx-evm/config.mk|   30 
 board/da8xx/da8xx-evm/dv_board.c   |  330 
 board/da8xx/da8xx-evm/u-boot.lds   |   52 ++
 5 files changed, 493 insertions(+), 0 deletions(-)

diff --git a/board/da8xx/da8xx-evm/Makefile b/board/da8xx/da8xx-evm/Makefile
new file mode 100644
index 000..fa00138
--- /dev/null
+++ b/board/da8xx/da8xx-evm/Makefile
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn 
+#
+# 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
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := dv_board.o
+SOBJS  := board_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak *~ .depend
+
+#
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/da8xx/da8xx-evm/board_init.S 
b/board/da8xx/da8xx-evm/board_init.S
new file mode 100644
index 000..22d8adc
--- /dev/null
+++ b/board/da8xx/da8xx-evm/board_init.S
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Board-specific low level initialization code. Called at the very end
+ * of cpu/arm926ejs/davinci/lowlevel_init.S. Just returns if there is no
+ * initialization required.
+ *
+ * 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 
+
+.globl dv_board_init
+dv_board_init:
+
+   mov pc, lr
diff --git a/board/da8xx/da8xx-evm/config.mk b/board/da8xx/da8xx-evm/config.mk
new file mode 100644
index 000..56de37a
--- /dev/null
+++ b/board/da8xx/da8xx-evm/config.mk
@@ -0,0 +1,30 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, 
+# David Mueller, ELSOFT AG, 
+#
+# (C) Copyright 2003
+# Texas Instruments, 
+# Swaminathan 
+#
+# Copyright (C) 2007 Sergey Kubushyn 
+#
+# (C) Copyright 2008
+# Sekhar Nori, Texas Instruments, Inc. 
+#
+# Texas Instruments DA8xx EVM board (ARM925EJS) cpu
+# see http://www.ti.com/ for more information on Texas Instruments
+#
+# DA8xx EVM has 1 bank of 64 MB SDRAM (2 16Meg x16 chips).
+# Physical Address:
+# C000' to C400'
+#
+# Linux-Kernel is expected to be at C000'8000, entry C000'8000
+# (mem base + reserved)
+#
+# we load ourself to C108 '
+#
+#
+
+#Provide at least 16MB spacing between us and the Linux Kernel image
+TEXT_BASE = 0xC108
diff --git a/board/da8xx/da8xx-evm/dv_board.c b/board/da8xx/da8xx-evm/dv_board.c
new file mode 100644
index 000..b551bc5
--- /dev/null
+++ b/board/da8xx/da8xx-evm/dv_board.c
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. 
+ *
+ * Use the board_eth_init hook to initialise the ethernet in the
+ * correct order. (Has to wait until after call to miiphy_init().)
+ *
+ * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.  
+ * 
+ * Modified for DA8xx EVM. 
+ *
+

[U-Boot] [PATCH 2/5] add TI da8xx support: new arch directory

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Create initial contents of the include/asm-arm/arch-da8xx directory:

General hardware definitions.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 include/asm-arm/arch-da8xx/clock.h |   24 +++
 include/asm-arm/arch-da8xx/emac_defs.h |  328

 include/asm-arm/arch-da8xx/emif_defs.h |   71 +++
 include/asm-arm/arch-da8xx/hardware.h  |  206 
 include/asm-arm/arch-da8xx/i2c_defs.h  |   95 +
 5 files changed, 724 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-da8xx/clock.h
b/include/asm-arm/arch-da8xx/clock.h
new file mode 100644
index 000..a9b74f4
--- /dev/null
+++ b/include/asm-arm/arch-da8xx/clock.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd.

+ * 
+ * DA8xx clock include header
+ *
+ * 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 __ASSEMBLER__
+int clk_get(unsigned int id);
+#endif
diff --git a/include/asm-arm/arch-da8xx/emac_defs.h
b/include/asm-arm/arch-da8xx/emac_defs.h
new file mode 100644
index 000..2da0c41
--- /dev/null
+++ b/include/asm-arm/arch-da8xx/emac_defs.h
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Based on:
+ *
+ *


+ *
+ * dm644x_emac.h
+ *
+ * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
+ *
+ * Copyright (C) 2005 Texas Instruments.
+ *
+ *


+ *
+ * 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.
+ *


+
+ * Modifications:
+ * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
+ *
+ */
+
+#ifndef _DA8XX_EMAC_H_
+#define _DA8XX_EMAC_H_
+
+#include 
+
+#define EMAC_BASE_ADDR
DAVINCI_EMAC_CNTRL_REGS_BASE
+#define EMAC_WRAPPER_BASE_ADDR
DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE
+#define EMAC_WRAPPER_RAM_ADDR  DAVINCI_EMAC_WRAPPER_RAM_BASE
+#define EMAC_MDIO_BASE_ADDR
DAVINCI_MDIO_CNTRL_REGS_BASE
+
+/* MDIO module input frequency */
+#define EMAC_MDIO_BUS_FREQ
clk_get(DAVINCI_MDIO_CLKID)
+
+/* MDIO clock output frequency */
+#define EMAC_MDIO_CLOCK_FREQ   200 /* 2.0 MHz */
+
+/* Ethernet Min/Max packet size */
+#define EMAC_MIN_ETHERNET_PKT_SIZE 60
+#define EMAC_MAX_ETHERNET_PKT_SIZE 1518
+#define EMAC_PKT_ALIGN 18  /* 1518 + 18 = 1536
(packet aligned on 32 byte boundry) */
+
+/* Number of RX packet buffers
+ * NOTE: Only 1 buffer supported as of now
+ */
+#define EMAC_MAX_RX_BUFFERS10
+
+
+/***
+  Internally used macros ***
+ ***/
+
+#define EMAC_CH_TX 1
+#define EMAC_CH_RX 0
+
+/* Each descriptor occupies 4 words, lets start RX desc's at 0 and
+ * reserve space for 64 descriptors max
+ */
+#define EMAC_RX_DESC_BASE  0x0
+#define EMAC_TX_DESC_BASE  0x1000
+
+/* EMAC Teardown value */
+#define EMAC_TEARDOWN_VALUE0xfffc
+
+/* MII Status Register */
+#define MII_STATUS_REG 1
+
+/* Number of statistics registers */
+#define EMAC_NUM_STATS 36
+
+
+/* EMAC Descriptor */
+typedef volatile struct _emac_desc
+{
+   u_int32_t   next;   /* Pointer to next descriptor in
chain */
+   u_int8_t*buffer;/* Pointer to data buffer */
+   u_int32_t   buff_off_len;   /* Buffer Offset(M

[U-Boot] [PATCH 1/5] add TI da8xx support: new cpu directory

2009-10-16 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)
Create initial contents of the cpu/arm926ejs/da8xx directory:

Low level initilisation.
Support for SoC clock, timer and reset functions.

Signed-off-by: Nick Thompson 
---
Applies to u-boot-ti

 cpu/arm926ejs/da8xx/Makefile|   53 +
 cpu/arm926ejs/da8xx/clock.c |   58 ++
 cpu/arm926ejs/da8xx/lowlevel_init.S |   73 +
 cpu/arm926ejs/da8xx/reset.S |   77 ++
 cpu/arm926ejs/da8xx/timer.c |  148
+++
 5 files changed, 409 insertions(+), 0 deletions(-)

diff --git a/cpu/arm926ejs/da8xx/Makefile b/cpu/arm926ejs/da8xx/Makefile
new file mode 100644
index 000..76fb7b8
--- /dev/null
+++ b/cpu/arm926ejs/da8xx/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn 
+#
+# 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
+
+LIB= $(obj)lib$(SOC).a
+
+COBJS  = timer.o clock.o
+SOBJS  = reset.o
+
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+SOBJS  += lowlevel_init.o
+endif
+
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+###
##
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+###
##
diff --git a/cpu/arm926ejs/da8xx/clock.c b/cpu/arm926ejs/da8xx/clock.c
new file mode 100644
index 000..25cf4df
--- /dev/null
+++ b/cpu/arm926ejs/da8xx/clock.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.

+ * 
+ * DA8xx clock module
+ *
+ * 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.
+ *


+ */
+
+#include 
+#include 
+
+dv_reg_p sysdiv[9] = {
+REG_P(PLL0_DIV1), REG_P(PLL0_DIV2), REG_P(PLL0_DIV3),
REG_P(PLL0_DIV4),
+REG_P(PLL0_DIV5), REG_P(PLL0_DIV6), REG_P(PLL0_DIV7),
REG_P(PLL0_DIV8),
+REG_P(PLL0_DIV9) };
+
+int clk_get(unsigned int id)
+{
+int pre_div = (REG(PLL0_PREDIV) & 0xff) + 1;
+int pllm = REG(PLL0_PLLM)  + 1;
+int post_div = (REG(PLL0_POSTDIV) & 0xff) + 1;
+int pll_out = CONFIG_SYS_OSCIN_FREQ;
+
+if(id == DAVINCI_AUXCLK_CLKID) 
+goto out;
+
+/* Lets keep this simple. Combining operations can result in 
+ * unexpected approximations
+ */
+pll_out /= pre_div;
+pll_out *= pllm;
+
+if(id == DAVINCI_PLLM_CLKID) 
+goto out;
+
+pll_out /= post_div;
+
+if(id == DAVINCI_PLLC_CLKID) 
+goto out;
+
+pll_out /= (REG(sysdiv[id - 1]) & 0xff) + 1;
+
+out:
+return pll_out;
+}
diff --git a/cpu/arm926ejs/da8xx/lowlevel_init.S
b/cpu/arm926ejs/da8xx/lowlevel_init.S
new file mode 100644
index 000..53f801a
--- /dev/null
+++ b/cpu/arm926ejs/da8xx/lowlevel_init.S
@@ -0,0 +1,73 @@
+/*
+ * Low-level board setup code for TI DA8xx SoC based boards.
+ *
+ * Copyright (C) 2008 Texas Instruments, Inc 
+ * Sekhar Nori 
+ * 
+ * Based on TI DaVinci low level init code. Original copyrights follow.
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Partially based on TI sources, original copyrights follow:
+ */
+
+/*
+ * Board specific setup info
+ *
+ * (C) Copyright 2003
+ * Texas Instruments, 
+ * Kshitij Gupta 
+ *
+ * Modified for OMAP 1610 H2 board by

[U-Boot] [PATCH] ppc4xx: Update flash size in reg property of the NOR flash node

2009-10-16 Thread Stefan Roese
Till now only the ranges in the ebc node are updated with the values
currently configured in the PPC4xx EBC controller. With this patch now
the NOR flash size is updated in the device tree blob as well.

Signed-off-by: Stefan Roese 
Cc: Wolfgang Denk 
---
 cpu/ppc4xx/fdt.c |   33 ++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index 496e028..adf9d87 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -43,9 +43,19 @@ void __ft_board_setup(void *blob, bd_t *bd)
u32 ranges[EBC_NUM_BANKS * 4];
u32 *p = ranges;
char *ebc_path = "/plb/opb/ebc";
+   char nor_path[16];
+   char path[32];
+   u32 *reg;
+   int offset;
+   int len;
+   struct fdt_property *prop;
 
ft_cpu_setup(blob, bd);
 
+   /* Some 405 PPC's have EBC as direct PLB child in the dts */
+   if (fdt_path_offset(blob, ebc_path) < 0)
+   strcpy(ebc_path, "/plb/ebc");
+
/*
 * Read 4xx EBC bus bridge registers to get mappings of the
 * peripheral banks into the OPB/PLB address space
@@ -59,12 +69,29 @@ void __ft_board_setup(void *blob, bd_t *bd)
*p++ = 0;
*p++ = bxcr & EBC_BXCR_BAS_MASK;
*p++ = EBC_BXCR_BANK_SIZE(bxcr);
+
+   /* Try to update reg property in nor flash node too */
+   strcpy(path, ebc_path);
+   sprintf(nor_path, "/nor_fl...@%d,0", i);
+   strcat(path, nor_path);
+   offset = fdt_path_offset(blob, path);
+   prop = fdt_get_property_w(blob, offset, "reg", &len);
+   /* if prop == NULL then this is no NOR FLASH node */
+   if (prop == NULL)
+   continue;
+
+   reg = (u32 *)&prop->data[0];
+   reg[2] = EBC_BXCR_BANK_SIZE(bxcr);
+   rc = fdt_find_and_setprop(blob, path, "reg", reg,
+ 3 * sizeof(u32), 1);
+   if (rc) {
+   printf("Unable to update property NOR mappings"
+  ", err=%s\n", fdt_strerror(rc));
+   continue;
+   }
}
}
 
-   /* Some 405 PPC's have EBC as direct PLB child in the dts */
-   if (fdt_path_offset(blob, "/plb/opb/ebc") < 0)
-   strcpy(ebc_path, "/plb/ebc");
rc = fdt_find_and_setprop(blob, ebc_path, "ranges", ranges,
  (p - ranges) * sizeof(u32), 1);
if (rc) {
-- 
1.6.4.4

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