Re: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board

2009-11-13 Thread Tom
Albert Aribaud wrote:
> This patch adds initial u-boot support for the Marvell orion5x
> SoC and the LAcie ED Mini V2 board--support is limited to serial,
> flash and environment. Further support will be added as devices
> common with kirkwood are made useable across SoCs.
> 
> Signed-off-by: Albert Aribaud 
> ---
>  Makefile   |3 +
>  board/Marvell/edminiv2/Makefile|   51 +
>  board/Marvell/edminiv2/config.mk   |   25 +++
>  board/Marvell/edminiv2/edminiv2.c  |  165 
>  board/Marvell/edminiv2/edminiv2.h  |   39 
>  cpu/arm926ejs/orion5x/Makefile |   52 +
>  cpu/arm926ejs/orion5x/cpu.c|  339 
> 
>  cpu/arm926ejs/orion5x/dram.c   |   61 ++
>  cpu/arm926ejs/orion5x/mpp.c|   88 
>  cpu/arm926ejs/orion5x/timer.c  |  171 
>  drivers/serial/serial.c|3 +
>  include/asm-arm/arch-orion5x/88f5182.h |   40 
>  include/asm-arm/arch-orion5x/cpu.h |  213 
>  include/asm-arm/arch-orion5x/gpio.h|   53 +
>  include/asm-arm/arch-orion5x/mpp.h |  122 
>  include/asm-arm/arch-orion5x/orion5x.h |   67 +++
>  include/configs/edminiv2.h |  158 +++
>  17 files changed, 1650 insertions(+), 0 deletions(-)
>  create mode 100644 board/Marvell/edminiv2/Makefile
>  create mode 100644 board/Marvell/edminiv2/config.mk
>  create mode 100644 board/Marvell/edminiv2/edminiv2.c
>  create mode 100644 board/Marvell/edminiv2/edminiv2.h
>  create mode 100644 cpu/arm926ejs/orion5x/Makefile
>  create mode 100644 cpu/arm926ejs/orion5x/cpu.c
>  create mode 100644 cpu/arm926ejs/orion5x/dram.c
>  create mode 100644 cpu/arm926ejs/orion5x/mpp.c
>  create mode 100644 cpu/arm926ejs/orion5x/timer.c
>  create mode 100644 include/asm-arm/arch-orion5x/88f5182.h
>  create mode 100644 include/asm-arm/arch-orion5x/cpu.h
>  create mode 100644 include/asm-arm/arch-orion5x/gpio.h
>  create mode 100644 include/asm-arm/arch-orion5x/mpp.h
>  create mode 100644 include/asm-arm/arch-orion5x/orion5x.h
>  create mode 100644 include/configs/edminiv2.h

For this pass, I ran the linux kernel checkpatch.pl against
your patch. I get

total: 180 errors, 26 warnings, 1662 lines checked

In general, the patch should have no errors or warnings.
Please fix the checkpatch issues.

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


[U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board

2009-11-13 Thread Albert Aribaud
This patch adds initial u-boot support for the Marvell orion5x
SoC and the LAcie ED Mini V2 board--support is limited to serial,
flash and environment. Further support will be added as devices
common with kirkwood are made useable across SoCs.

Signed-off-by: Albert Aribaud 
---
 Makefile   |3 +
 board/Marvell/edminiv2/Makefile|   51 +
 board/Marvell/edminiv2/config.mk   |   25 +++
 board/Marvell/edminiv2/edminiv2.c  |  165 
 board/Marvell/edminiv2/edminiv2.h  |   39 
 cpu/arm926ejs/orion5x/Makefile |   52 +
 cpu/arm926ejs/orion5x/cpu.c|  339 
 cpu/arm926ejs/orion5x/dram.c   |   61 ++
 cpu/arm926ejs/orion5x/mpp.c|   88 
 cpu/arm926ejs/orion5x/timer.c  |  171 
 drivers/serial/serial.c|3 +
 include/asm-arm/arch-orion5x/88f5182.h |   40 
 include/asm-arm/arch-orion5x/cpu.h |  213 
 include/asm-arm/arch-orion5x/gpio.h|   53 +
 include/asm-arm/arch-orion5x/mpp.h |  122 
 include/asm-arm/arch-orion5x/orion5x.h |   67 +++
 include/configs/edminiv2.h |  158 +++
 17 files changed, 1650 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/edminiv2/Makefile
 create mode 100644 board/Marvell/edminiv2/config.mk
 create mode 100644 board/Marvell/edminiv2/edminiv2.c
 create mode 100644 board/Marvell/edminiv2/edminiv2.h
 create mode 100644 cpu/arm926ejs/orion5x/Makefile
 create mode 100644 cpu/arm926ejs/orion5x/cpu.c
 create mode 100644 cpu/arm926ejs/orion5x/dram.c
 create mode 100644 cpu/arm926ejs/orion5x/mpp.c
 create mode 100644 cpu/arm926ejs/orion5x/timer.c
 create mode 100644 include/asm-arm/arch-orion5x/88f5182.h
 create mode 100644 include/asm-arm/arch-orion5x/cpu.h
 create mode 100644 include/asm-arm/arch-orion5x/gpio.h
 create mode 100644 include/asm-arm/arch-orion5x/mpp.h
 create mode 100644 include/asm-arm/arch-orion5x/orion5x.h
 create mode 100644 include/configs/edminiv2.h

diff --git a/Makefile b/Makefile
index bcb3fe9..60f9140 100644
--- a/Makefile
+++ b/Makefile
@@ -2951,6 +2951,9 @@ davinci_dm365evm_config : unconfig
 davinci_dm6467evm_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci
 
+edminiv2_config: unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell orion5x
+
 imx27lite_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
 
diff --git a/board/Marvell/edminiv2/Makefile b/board/Marvell/edminiv2/Makefile
new file mode 100644
index 000..2e6d305
--- /dev/null
+++ b/board/Marvell/edminiv2/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := edminiv2.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
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/Marvell/edminiv2/config.mk b/board/Marvell/edminiv2/config.mk
new file mode 100644
index 000..a4ea769
--- /dev/null
+++ b/board/Marvell/edminiv2/config.mk
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# 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,

Re: [U-Boot] SDCARD Support - MPC8315e

2009-11-13 Thread Liu Dave-R63238
> > > Is there a SDCARD support for MPC8315e?
> > 
> > Yes. Have a look the drivers/mmc
> 
> Hm... AFAIK, 8315 chips don't include eSDHC controller.
> 
> (It is still possible to connect SD cards via SPI, but mmc 
> spi driver isn't yet included into U-Boot.)

Anton is right, I was assuming the 8315 has the eSDHC controller
just like 837x. Sorry for that.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] makefiles: fixes for building build tools

2009-11-13 Thread Mike Frysinger
On Friday 13 November 2009 13:53:45 Scott Wood wrote:
> Mike Frysinger wrote:
> > On Wednesday 04 November 2009 19:41:41 Scott Wood wrote:
> >> --- a/rules.mk
> >> +++ b/rules.mk
> >>
> >> +$(HOSTOBJS): $(obj)%.o: %.c
> >> +  $(HOSTCC) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR))
> >> -o $@ $< -c
> >>  +$(NOPEDOBJS): $(obj)%.o: %.c
> >> +  $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F))
> >>  $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c
> >
> > wouldnt these make more sense in config.mk with all the other patterns.
> 
> The static pattern rules won't work unless $(HOSTOBJS)/$(NOPEDOBJS) has
> been filled in by the makefile.  config.mk is included too early for that.
> 
> A non-static pattern won't work unless we can distinguish between
> target, host-pedantic, and host-no-pedantic from the filename or path
>  alone.
> 
> Plus, the name of the file is *rules*.mk. :-)

yes, but so far, all the rules have been in config.mk.  i'm ok with them all 
being in rules.mk ... they should just be together.

i guess a comment above them for now explaining why they arent in the same 
place as all other pattern rules would be nice ...

> > and create a pattern target for creating host executables.
> 
> That would be nice to have, but is orthogonal to what this patch does.
> One thing at a time.

the point was to avoid duplicating everything again.  declaring variables to 
contain the common steps would work as well ...
-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


[U-Boot] Pull request: nand flash next

2009-11-13 Thread Scott Wood
The following changes since commit efe12bcec55c3d77b9ead56e62010d26b66781f3:
  Stefan Roese (1):
ppc4xx: Katmai: Add chip_config command

are available in the git repository at:

  git://git.denx.de/u-boot-nand-flash.git next

Amul Kumar Saha (2):
  Flex-OneNAND driver support
  ENV Variable support for Flex-OneNAND

David Brownell (1):
  NAND: fix "raw" reads with ECC syndrome layouts

Mingkai Hu (2):
  ppc/85xx: make boot from NAND full relocation to RAM
  fsl_elbc_nand: remove the bbt descriptors relocation fixup

Peter Tyser (2):
  cmd_nand: Remove duplicate include
  cmd_nand: Move conditional compilation to Makefile

Sandeep Paulraj (7):
  NAND: Update to support 64 bit device size
  NAND: Correct the "chip_shift" calculation
  NAND: Remove commented out code
  NAND: Subpage shift for ecc_steps equal to 16
  NAND: Updating comments/explanations in the NAND driver
  NAND: Update check condition for nand_read_page_hwecc API
  NAND: Don't walk past end of oobfree[]

 common/Makefile |2 +-
 common/cmd_nand.c   |   12 -
 common/env_onenand.c|   10 +
 cpu/mpc85xx/u-boot-nand.lds |1 -
 drivers/mtd/nand/fsl_elbc_nand.c|4 -
 drivers/mtd/nand/nand_base.c|  145 ++-
 drivers/mtd/nand/nand_bbt.c |   41 ++-
 drivers/mtd/onenand/onenand_base.c  |  742 ++-
 drivers/mtd/onenand/onenand_bbt.c   |   14 +-
 drivers/mtd/onenand/onenand_uboot.c |4 +-
 include/configs/apollon.h   |2 +
 include/linux/mtd/nand.h|2 +-
 include/linux/mtd/onenand.h |   16 +-
 include/linux/mtd/onenand_regs.h|   18 +-
 include/linux/mtd/partitions.h  |4 +-
 include/onenand_uboot.h |   10 +
 16 files changed, 866 insertions(+), 161 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Justin Waters
Peter,

On Fri, 2009-11-13 at 17:10 -0500, Justin Waters wrote:
> Peter,
> 
> On Fri, 2009-11-13 at 16:39 -0500, Peter Tyser wrote:
> > My guess is that somehow the end of u-boot command section is getting
> > corrupted.  Perhaps the editenv patches, etc increase the size of your
> > image such there's an overlap in sections that isn't reported as an
> > error?  Or is the stack above the U-boot image in RAM?  Or malloc pool,
> > etc?
> > If you look at other commands near help (eg exit or test) in your
> > System.map file, do they have the same issues as as 'help'?  Seems fishy
> > that the u-boot command table is near the end of the u-boot image, and
> > you're seeing issues specifically with the end of the u-boot command
> > table.
> > 
> 
> Brilliant.  I removed a couple of commands (USB, in particular), and it
> seems to be working fine.  No garbled messages, no system halt.
> 
> I'll look into this some more on Monday.  It seems to only affect the
> 9261/9G10 family.  Everything works fine on the 9G20 and 9263.
> 
> Thank you for your help!  editenv is a really nice addition, by the way.
> 
> > Best,
> > Peter
> 
> Thanks,
> Justin

Got it.  The problem was with the first stage bootloader, which was
apparently only copying the first 0x33900 bytes of U-Boot into RAM.  The
image containing the editenv changes apparently broke this barrier,
causing the image size to jump up to 0x33A00 (thanks to page alignment).
After changing the value to something larger in AT91 Bootstrap (I picked
0x33C00 since it's a multiple of the page size of the flash), everything
works fine.

I didn't encounter the problem on the 9G20 because it's a smaller image
(no LCD driver), and the 9263 was loading from NAND flash instead of
dataflash.

Thanks again!

-Justin

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


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Justin Waters
Peter,

On Fri, 2009-11-13 at 16:39 -0500, Peter Tyser wrote:
> My guess is that somehow the end of u-boot command section is getting
> corrupted.  Perhaps the editenv patches, etc increase the size of your
> image such there's an overlap in sections that isn't reported as an
> error?  Or is the stack above the U-boot image in RAM?  Or malloc pool,
> etc?
> If you look at other commands near help (eg exit or test) in your
> System.map file, do they have the same issues as as 'help'?  Seems fishy
> that the u-boot command table is near the end of the u-boot image, and
> you're seeing issues specifically with the end of the u-boot command
> table.
> 

Brilliant.  I removed a couple of commands (USB, in particular), and it
seems to be working fine.  No garbled messages, no system halt.

I'll look into this some more on Monday.  It seems to only affect the
9261/9G10 family.  Everything works fine on the 9G20 and 9263.

Thank you for your help!  editenv is a really nice addition, by the way.

> Best,
> Peter

Thanks,
Justin

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


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Peter Tyser
Hi Justin,

> > > > And are you seeing 2 separate issues: 1 where the help output is
> > > > garbled, and 1 where the "help" command can't be ran?
> > > 
> > > Yes, I am seeing two separate issues.  It depends on which commit I use.
> > > If I go back to the "readline" commit, then I get garbled output.  Once
> > > the editenv commit is added back, I get the 'help not found' error.
> > 
> > I'm not sure what to make of this.  I can't figure out how
> > "246c69225c7b962d5c93e92282b78ca9fc5fefee - Add 'editenv' command" would
> > fix the garbled output or cause the help command not to be found.  Its
> > just adding a new command and shouldn't really have any impact on common
> > code.
> 
> Well, editenv doesn't fix the garbled output, it just makes it so you
> can't see it.  The help command issue is what really confuses me.  If I
> just disable the editenv command, running "help" seems to lock up the
> board.  That seems really weird to me, since it seems to disable all of
> the code that was added by the previous patch.  I'm going to dig into
> this a little more.  If I also revert the changes in cread_line,
> everything works fine.
> 
> > Thanks.  If I understand correctly, chronologically you first start
> > having issues when "ecc5500ee487170d8af6ff893fd1e0082380a01a -
> > readline(): Add ability to modify a string buffer" is applied.
> 
> Yes, that's correct.
> 
> > If this is the case, I'd try debugging this issue first before
> > addressing the later 'help not found' issue.
> 
> I agree.  That's the tact that I was trying to take before.
> 
> > Is there any pattern in the garbled output? Could you send an example of
> > it?  Is only the output of 'help' is garbled, everything else is fine?
> 
> So there are three commits in a row:
> 
> ecc5500 - readline(): Add ability to modify a string buffer
> b0fa8e5 - setenv(): Delete 0-length environment variables
> 246c692 - Add 'editenv' command
> 
> After the first commit, the garbled text appears at the end of help.
> After the second, running *help* hangs the board.
> After the third, I get the 'help not found' message.  Although, now that
> I try to reproduce the error, it seems to hang as well.  Possibly
> something still sitting around in memory that was causing the problem?
> 
> > Could you add some debug to print out the value of init_len in
> > common/main.c:cread_line()?  In theory as long as you don't run
> > "editenv" it should always be 0.  Assuming it is always 0, could you try
> > commenting out the following snippet in the same file:
> > 
> >   if (init_len)
> >cread_add_str(buf, init_len, 1, &num, &eol_num, buf, *len);
> > 
> > Then also try commenting out the modification to
> > common/main.c:readline():
> > 
> >   console_buffer[0] = '\0';
> > 
> > Those 2 modifications are all that commit
> > ecc5500ee487170d8af6ff893fd1e0082380a01a added - I'd be curious to know
> > which one caused the problem.
> 
> Definitely the first one.  I can leave the second one in without a
> problem.

What is the value of "init_len"?  It should always be 0 other than when
'editenv' is called.  So I doubt the added code is ever called.

> > 
> > Another interesting data point would be to remove CONFIG_SYS_HUSH_PARSER
> > from the AT91SAM9263-EK u-boot image and see if it breaks in the same
> > way.
> 
> Now things have gotten very interesting... SAM9263 works great without
> hush, but the 9G10 and 9261 (which use the same base code, just slightly
> different configurations) are completely broken.  Also, I can't add hush
> into these boards, or they won't boot.  This error that I see after
> applying your patches seems likely to be a symptom of a larger issue
> with these two boards.  I'm going to try some of the other Atmel boards
> that I have lying around (9260, 9G20).  I'll let you know what I find
> out.

Thanks for the info.

My guess is that somehow the end of u-boot command section is getting
corrupted.  Perhaps the editenv patches, etc increase the size of your
image such there's an overlap in sections that isn't reported as an
error?  Or is the stack above the U-boot image in RAM?  Or malloc pool,
etc?

If I look at my System.map file I see this at the end:

fffd2bbc D __u_boot_cmd_test
fffd2bd4 D __u_boot_cmd_exit
fffd2bec D __u_boot_cmd_help
fffd2c04 D __u_boot_cmd_question_mark
fffd2c1c D __u_boot_cmd_showvar
fffd2c34 A __start___ex_table
fffd2c34 A __stop___ex_table
fffd2c34 A __u_boot_cmd_end
fffd2d00 A __init_begin
fffd2d00 A __init_end
f000 T _start_e500
f18c t switch_as

If you look at other commands near help (eg exit or test) in your
System.map file, do they have the same issues as as 'help'?  Seems fishy
that the u-boot command table is near the end of the u-boot image, and
you're seeing issues specifically with the end of the u-boot command
table.

Best,
Peter

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


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Justin Waters
On Fri, 2009-11-13 at 12:50 -0500, Peter Tyser wrote:
> On Fri, 2009-11-13 at 12:01 -0500, Justin Waters wrote:
> > Hi Peter,
> > 
> > On Fri, 2009-11-13 at 11:50 -0500, Peter Tyser wrote:
> > > Do no commands work for you, or just "help" in particular?
> > 
> > >From what I can tell, just "help".
> 
> Interesting...

I haven't noticed any other issues, but that doesn't mean there aren't
any ;)

> > > And are you seeing 2 separate issues: 1 where the help output is
> > > garbled, and 1 where the "help" command can't be ran?
> > 
> > Yes, I am seeing two separate issues.  It depends on which commit I use.
> > If I go back to the "readline" commit, then I get garbled output.  Once
> > the editenv commit is added back, I get the 'help not found' error.
> 
> I'm not sure what to make of this.  I can't figure out how
> "246c69225c7b962d5c93e92282b78ca9fc5fefee - Add 'editenv' command" would
> fix the garbled output or cause the help command not to be found.  Its
> just adding a new command and shouldn't really have any impact on common
> code.

Well, editenv doesn't fix the garbled output, it just makes it so you
can't see it.  The help command issue is what really confuses me.  If I
just disable the editenv command, running "help" seems to lock up the
board.  That seems really weird to me, since it seems to disable all of
the code that was added by the previous patch.  I'm going to dig into
this a little more.  If I also revert the changes in cread_line,
everything works fine.

> Thanks.  If I understand correctly, chronologically you first start
> having issues when "ecc5500ee487170d8af6ff893fd1e0082380a01a -
> readline(): Add ability to modify a string buffer" is applied.

Yes, that's correct.

> If this is the case, I'd try debugging this issue first before
> addressing the later 'help not found' issue.

I agree.  That's the tact that I was trying to take before.

> Is there any pattern in the garbled output? Could you send an example of
> it?  Is only the output of 'help' is garbled, everything else is fine?

So there are three commits in a row:

ecc5500 - readline(): Add ability to modify a string buffer
b0fa8e5 - setenv(): Delete 0-length environment variables
246c692 - Add 'editenv' command

After the first commit, the garbled text appears at the end of help.
After the second, running *help* hangs the board.
After the third, I get the 'help not found' message.  Although, now that
I try to reproduce the error, it seems to hang as well.  Possibly
something still sitting around in memory that was causing the problem?

> Could you add some debug to print out the value of init_len in
> common/main.c:cread_line()?  In theory as long as you don't run
> "editenv" it should always be 0.  Assuming it is always 0, could you try
> commenting out the following snippet in the same file:
> 
>   if (init_len)
>cread_add_str(buf, init_len, 1, &num, &eol_num, buf, *len);
> 
> Then also try commenting out the modification to
> common/main.c:readline():
> 
>   console_buffer[0] = '\0';
> 
> Those 2 modifications are all that commit
> ecc5500ee487170d8af6ff893fd1e0082380a01a added - I'd be curious to know
> which one caused the problem.

Definitely the first one.  I can leave the second one in without a
problem.

> 
> Another interesting data point would be to remove CONFIG_SYS_HUSH_PARSER
> from the AT91SAM9263-EK u-boot image and see if it breaks in the same
> way.

Now things have gotten very interesting... SAM9263 works great without
hush, but the 9G10 and 9261 (which use the same base code, just slightly
different configurations) are completely broken.  Also, I can't add hush
into these boards, or they won't boot.  This error that I see after
applying your patches seems likely to be a symptom of a larger issue
with these two boards.  I'm going to try some of the other Atmel boards
that I have lying around (9260, 9G20).  I'll let you know what I find
out.

> Thanks again,
> Peter

Thanks,

Justin

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


[U-Boot] [PATCH] TI: DaVinci: Updating EMAC driver for DM365 and DM646x

2009-11-13 Thread s-paulraj
From: Sandeep Paulraj 

The EMAC IP on DM365 and DM646x is slightly different from
that on DM644x. This patch updates the DaVinci EMAC driver
so that EMAC becomes operational on DM365 in U-Boot.
A flag 'CONFIG_DAVINCI_EMAC_VERSION2' is used in the driver.
This flag will need to be defined in the DM365 config file.

Signed-off-by: Sandeep Paulraj 
---
The same modifications work on DM646x in a slightly older version
of U-Boot. So when enabled this should work on the DM6467 EVM as well.
This has at this point of time not been tested on the DM6467 in the latest
version of U-Boot.
 drivers/net/davinci_emac.c |   79 ++-
 1 files changed, 77 insertions(+), 2 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index fa8cee4..1df98e9 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -107,6 +107,33 @@ static void davinci_eth_mdio_enable(void)
while (adap_mdio->CONTROL & MDIO_CONTROL_IDLE) {;}
 }
 
+/* Read a PHY register via MDIO inteface */
+static int mdio_read(int phy_addr, int reg_num)
+{
+   adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO |
+   MDIO_USERACCESS0_WRITE_READ |
+   ((reg_num & 0x1F) << 21) |
+   ((phy_addr & 0x1F) << 16);
+
+   /* Wait for command to complete */
+   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO);
+
+   return adap_mdio->USERACCESS0 & 0x;
+}
+
+/* Write to a PHY register via MDIO inteface */
+void mdio_write(int phy_addr, int reg_num, unsigned int data)
+{
+   /* Wait for User access register to be ready */
+   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO);
+
+   adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO |
+   MDIO_USERACCESS0_WRITE_WRITE |
+   ((reg_num & 0x1F) << 21) |
+   ((phy_addr & 0x1F) << 16) |
+   (data & 0x);
+}
+
 /*
  * Tries to find an active connected PHY. Returns 1 if address if found.
  * If no active PHY (or more than one PHY) found returns 0.
@@ -248,6 +275,31 @@ static int davinci_mii_phy_write(char *devname, unsigned 
char addr, unsigned cha
 
 #endif
 
+static void emac_gigabit_enable(void)
+{
+   int temp;
+
+   temp = mdio_read(EMAC_MDIO_PHY_NUM, 0);
+
+   if (temp & (1 << 6)) {
+   /*
+* Check if link detected is giga-bit
+* If Gigabit mode detected, enable gigbit in MAC and PHY
+*/
+   adap_emac->MACCONTROL |= EMAC_MACCONTROL_GIGFORCE |
+   EMAC_MACCONTROL_GIGABIT_ENABLE;
+
+   /*
+* The SYS_CLK which feeds the SOC for giga-bit operation
+* does not seem to be enabled after reset as expected.
+* Force enabling SYS_CLK by writing to the PHY
+*/
+   temp = mdio_read(EMAC_MDIO_PHY_NUM, 22);
+   temp |= (1 << 4);
+   mdio_write(EMAC_MDIO_PHY_NUM, 22, temp);
+   }
+}
+
 
 /* Eth device open */
 static int davinci_eth_open(struct eth_device *dev, bd_t *bis)
@@ -261,10 +313,15 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
/* Reset EMAC module and disable interrupts in wrapper */
adap_emac->SOFTRESET = 1;
while (adap_emac->SOFTRESET != 0) {;}
+#if defined(CONFIG_DAVINCI_EMAC_VERSION2)
+   adap_ewrap->SOFTRST = 1;
+   while (adap_ewrap->SOFTRST != 0);
+#else
adap_ewrap->EWCTL = 0;
for (cnt = 0; cnt < 5; cnt++) {
clkdiv = adap_ewrap->EWCTL;
}
+#endif
 
rx_desc = emac_rx_desc;
 
@@ -282,6 +339,10 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
adap_emac->MACADDRLO =
(davinci_eth_mac_addr[5] << 8) |
(davinci_eth_mac_addr[4]);
+#if defined(CONFIG_DAVINCI_EMAC_VERSION2)
+   /* Set the Match and Valid Bits */
+   adap_emac->MACADDRLO |= (1 << 19) | (1 << 20);
+#endif
 
adap_emac->MACHASH1 = 0;
adap_emac->MACHASH2 = 0;
@@ -347,8 +408,15 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1;
adap_mdio->CONTROL = ((clkdiv & 0xff) | MDIO_CONTROL_ENABLE | 
MDIO_CONTROL_FAULT);
 
+#if defined(CONFIG_DAVINCI_EMAC_VERSION2)
+   /* We need to wait for MDIO to start */
+   udelay(1000);
+#endif
+
if (!phy.get_link_speed(active_phy_addr))
return(0);
+   else
+   emac_gigabit_enable();
 
/* Start receive process */
adap_emac->RX0HDP = (u_int32_t)emac_rx_desc;
@@ -411,7 +479,11 @@ static void davinci_eth_close(struct eth_device *dev)
 
/* Reset EMAC module and disable interrupts in wrapper */
adap_emac->

Re: [U-Boot] [PATCH v2] makefiles: fixes for building build tools

2009-11-13 Thread Scott Wood
Mike Frysinger wrote:
> On Wednesday 04 November 2009 19:41:41 Scott Wood wrote:
>> --- a/rules.mk
>> +++ b/rules.mk
>>
>> +$(HOSTOBJS): $(obj)%.o: %.c
>> +$(HOSTCC) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o
>>  $@ $< -c
>>  +$(NOPEDOBJS): $(obj)%.o: %.c
>> +$(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F))
>>  $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c
> 
> wouldnt these make more sense in config.mk with all the other patterns.

The static pattern rules won't work unless $(HOSTOBJS)/$(NOPEDOBJS) has 
been filled in by the makefile.  config.mk is included too early for that.

A non-static pattern won't work unless we can distinguish between 
target, host-pedantic, and host-no-pedantic from the filename or path alone.

Plus, the name of the file is *rules*.mk. :-)

> and create a pattern target for creating host executables. 

That would be nice to have, but is orthogonal to what this patch does. 
One thing at a time.

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


Re: [U-Boot] [PATCH v2] makefiles: fixes for building build tools

2009-11-13 Thread Mike Frysinger
On Wednesday 04 November 2009 19:41:41 Scott Wood wrote:
> --- a/rules.mk
> +++ b/rules.mk
>
> +$(HOSTOBJS): $(obj)%.o: %.c
> + $(HOSTCC) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o
>  $@ $< -c
>  +$(NOPEDOBJS): $(obj)%.o: %.c
> + $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F))
>  $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c

wouldnt these make more sense in config.mk with all the other patterns.  and 
create a pattern target for creating host executables.  you should be able to 
combine all the duplicated patterns in tools/Makefile once you do.
-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] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Peter Tyser
On Fri, 2009-11-13 at 12:01 -0500, Justin Waters wrote:
> Hi Peter,
> 
> On Fri, 2009-11-13 at 11:50 -0500, Peter Tyser wrote:
> > Do no commands work for you, or just "help" in particular?
> 
> >From what I can tell, just "help".

Interesting...

> > And are you seeing 2 separate issues: 1 where the help output is
> > garbled, and 1 where the "help" command can't be ran?
> 
> Yes, I am seeing two separate issues.  It depends on which commit I use.
> If I go back to the "readline" commit, then I get garbled output.  Once
> the editenv commit is added back, I get the 'help not found' error.

I'm not sure what to make of this.  I can't figure out how
"246c69225c7b962d5c93e92282b78ca9fc5fefee - Add 'editenv' command" would
fix the garbled output or cause the help command not to be found.  Its
just adding a new command and shouldn't really have any impact on common
code.

> If I disable editenv and revert the changes to 'cread_line', then the
> error disappears.  It will also work if I disable LONG_HELP and revert
> cread_line.
> 
> > Would it be possible for you to add a bit of debug to diagnose the
> > problem further as I can't seem to reproduce it here?
> 
> Absolutely.  What would you like me to check?

Thanks.  If I understand correctly, chronologically you first start
having issues when "ecc5500ee487170d8af6ff893fd1e0082380a01a -
readline(): Add ability to modify a string buffer" is applied.

If this is the case, I'd try debugging this issue first before
addressing the later 'help not found' issue.

Is there any pattern in the garbled output? Could you send an example of
it?  Is only the output of 'help' is garbled, everything else is fine?

Could you add some debug to print out the value of init_len in
common/main.c:cread_line()?  In theory as long as you don't run
"editenv" it should always be 0.  Assuming it is always 0, could you try
commenting out the following snippet in the same file:

  if (init_len)
   cread_add_str(buf, init_len, 1, &num, &eol_num, buf, *len);

Then also try commenting out the modification to
common/main.c:readline():

  console_buffer[0] = '\0';

Those 2 modifications are all that commit
ecc5500ee487170d8af6ff893fd1e0082380a01a added - I'd be curious to know
which one caused the problem.


Another interesting data point would be to remove CONFIG_SYS_HUSH_PARSER
from the AT91SAM9263-EK u-boot image and see if it breaks in the same
way.

Thanks again,
Peter

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


Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support

2009-11-13 Thread Tom
Gupta, Ajay Kumar wrote:
> Hi,
>> Hi,
>>> Tested USB host functionality on DA830 EVM.
>>>
>>> Signed-off-by: Ajay Kumar Gupta 
>>> Signed-off-by: Swaminathan S 
>>> ---
>> 
>>
>>> --- a/include/usb.h
>>> +++ b/include/usb.h
>>> @@ -183,7 +183,8 @@ struct usb_device {
>>>  #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
>>>   defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
>>>   defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
>>> - defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI)
>>> + defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
>>> + defined(CONFIG_USB_DA8XX)
>>> These are aligned incorrectly (should be 4 spaces rather than a tab)
>> It was originally with tabs only. Are you suggesting to change all 5 lines 
>> to match the alignment ?
>>
>> Tom,
>> What do you think on this one?
> 
>> In general tabs are preferred but I would like to review the entire patchset.
>> When you make changes to a subset of the patches, you must repost the entire
>> patchset.
> 
>> Please repost the entire patchset.
> 
> Ok sure. Shall I post this patch with tabs or with 4-spaces as Nick suggested 
> ?
> 

Just repost it as-is.

Please be aware that this is a USB change.
And though I can provide some input the ack/nak decision is Remy's.

Tom

> Regards,
> Ajay
> 
>> Tom
> 
> 
>> -Ajay
> 
> 

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


Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support

2009-11-13 Thread Gupta, Ajay Kumar
Hi,
> Hi,
>> Tested USB host functionality on DA830 EVM.
>>
>> Signed-off-by: Ajay Kumar Gupta 
>> Signed-off-by: Swaminathan S 
>> ---
>
> 
>
>> --- a/include/usb.h
>> +++ b/include/usb.h
>> @@ -183,7 +183,8 @@ struct usb_device {
>>  #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
>>   defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
>>   defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
>> - defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI)
>> + defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
>> + defined(CONFIG_USB_DA8XX)
>
>> These are aligned incorrectly (should be 4 spaces rather than a tab)
> It was originally with tabs only. Are you suggesting to change all 5 lines to 
> match the alignment ?
>
> Tom,
> What do you think on this one?

>In general tabs are preferred but I would like to review the entire patchset.
>When you make changes to a subset of the patches, you must repost the entire
>patchset.

>Please repost the entire patchset.

Ok sure. Shall I post this patch with tabs or with 4-spaces as Nick suggested ?

Regards,
Ajay

>Tom


>
> -Ajay


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


Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support

2009-11-13 Thread Tom
Gupta, Ajay Kumar wrote:
> Hi,
>> Tested USB host functionality on DA830 EVM.
>>
>> Signed-off-by: Ajay Kumar Gupta 
>> Signed-off-by: Swaminathan S 
>> ---
> 
> 
> 
>> --- a/include/usb.h
>> +++ b/include/usb.h
>> @@ -183,7 +183,8 @@ struct usb_device {
>>  #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
>>   defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
>>   defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
>> - defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI)
>> + defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
>> + defined(CONFIG_USB_DA8XX)
> 
>> These are aligned incorrectly (should be 4 spaces rather than a tab)
> It was originally with tabs only. Are you suggesting to change all 5 lines to 
> match the alignment ?
> 
> Tom,
> What do you think on this one?

In general tabs are preferred but I would like to review the entire patchset.
When you make changes to a subset of the patches, you must repost the entire 
patchset.

Please repost the entire patchset.

Tom


> 
> -Ajay

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


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Justin Waters
Hi Peter,

On Fri, 2009-11-13 at 11:50 -0500, Peter Tyser wrote:
> Do no commands work for you, or just "help" in particular?

>From what I can tell, just "help".

> And are you seeing 2 separate issues: 1 where the help output is
> garbled, and 1 where the "help" command can't be ran?

Yes, I am seeing two separate issues.  It depends on which commit I use.
If I go back to the "readline" commit, then I get garbled output.  Once
the editenv commit is added back, I get the 'help not found' error.

If I disable editenv and revert the changes to 'cread_line', then the
error disappears.  It will also work if I disable LONG_HELP and revert
cread_line.

> Would it be possible for you to add a bit of debug to diagnose the
> problem further as I can't seem to reproduce it here?

Absolutely.  What would you like me to check?

> Thanks,
> Peter

-Justin

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


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Peter Tyser
On Fri, 2009-11-13 at 11:10 -0500, Justin Waters wrote:
> It looks like the "help" command is broken on the AT91SAM9G10-EK on
> 2009.11-rc1.  I get the following message any time I try to run it:
> 
> Unknown command 'help' - try 'help'
> 
> I've bisected the issue, and it looks like it started with the addition
> of the "editenv" command (commit
> 246c69225c7b962d5c93e92282b78ca9fc5fefee).  
> 
> After some further digging, I found some weirdness with the help command
> beginning with the lead-up work to the editenv commit. Strange
> characters where being printed to the console whenever the help command
> was run.  This issue started with commit
> ecc5500ee487170d8af6ff893fd1e0082380a01a, readline(): Add ability to
> modify a string buffer.
> 
> I've also tested the AT91SAM9263-EK, and everything looks great.  I
> believe the difference is related to the fact that the 9G10 does not use
> hush, while the 9263 does. Indeed, if you look at the main loop,
> non-hush systems use "readline" (which is indirectly modified by the
> aforementioned commits), while hush systems do not.
> 
> I'm not really sure what would be the best way to fix this.  Any ideas?

Hi Justin,
Thanks for reporting the issue.  I tested the changes with/without Hush
when I submitted the patches and the current top-of-tree U-Boot code
seems to work on my XPedite5370 (MPC8572-based) board here without Hush
enabled.

Do no commands work for you, or just "help" in particular?

And are you seeing 2 separate issues: 1 where the help output is
garbled, and 1 where the "help" command can't be ran?

Would it be possible for you to add a bit of debug to diagnose the
problem further as I can't seem to reproduce it here?

Thanks,
Peter

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


Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support

2009-11-13 Thread Gupta, Ajay Kumar
Hi,
> Tested USB host functionality on DA830 EVM.
>
> Signed-off-by: Ajay Kumar Gupta 
> Signed-off-by: Swaminathan S 
> ---



> --- a/include/usb.h
> +++ b/include/usb.h
> @@ -183,7 +183,8 @@ struct usb_device {
>  #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
>   defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
>   defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
> - defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI)
> + defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
> + defined(CONFIG_USB_DA8XX)

> These are aligned incorrectly (should be 4 spaces rather than a tab)
It was originally with tabs only. Are you suggesting to change all 5 lines to 
match the alignment ?

Tom,
What do you think on this one?

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


Re: [U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Tom
Justin Waters wrote:
> It looks like the "help" command is broken on the AT91SAM9G10-EK on
> 2009.11-rc1.  I get the following message any time I try to run it:
> 
> Unknown command 'help' - try 'help'
> 
> I've bisected the issue, and it looks like it started with the addition
> of the "editenv" command (commit
> 246c69225c7b962d5c93e92282b78ca9fc5fefee).  
> 
> After some further digging, I found some weirdness with the help command
> beginning with the lead-up work to the editenv commit. Strange
> characters where being printed to the console whenever the help command
> was run.  This issue started with commit
> ecc5500ee487170d8af6ff893fd1e0082380a01a, readline(): Add ability to
> modify a string buffer.
> 
> I've also tested the AT91SAM9263-EK, and everything looks great.  I
> believe the difference is related to the fact that the 9G10 does not use
> hush, while the 9263 does. Indeed, if you look at the main loop,
> non-hush systems use "readline" (which is indirectly modified by the
> aforementioned commits), while hush systems do not.
> 
> I'm not really sure what would be the best way to fix this.  Any ideas?
> 

What is the impact of just reverting the commits ?
Tom

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

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


[U-Boot] Help command broken on AT91SAM9G10-EK

2009-11-13 Thread Justin Waters
It looks like the "help" command is broken on the AT91SAM9G10-EK on
2009.11-rc1.  I get the following message any time I try to run it:

Unknown command 'help' - try 'help'

I've bisected the issue, and it looks like it started with the addition
of the "editenv" command (commit
246c69225c7b962d5c93e92282b78ca9fc5fefee).  

After some further digging, I found some weirdness with the help command
beginning with the lead-up work to the editenv commit. Strange
characters where being printed to the console whenever the help command
was run.  This issue started with commit
ecc5500ee487170d8af6ff893fd1e0082380a01a, readline(): Add ability to
modify a string buffer.

I've also tested the AT91SAM9263-EK, and everything looks great.  I
believe the difference is related to the fact that the 9G10 does not use
hush, while the 9263 does. Indeed, if you look at the main loop,
non-hush systems use "readline" (which is indirectly modified by the
aforementioned commits), while hush systems do not.

I'm not really sure what would be the best way to fix this.  Any ideas?

-Justin Waters

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


[U-Boot] EHCI hub not powering on port

2009-11-13 Thread Florian Fainelli
Hi all,

I am trying to make u-boot work with my EHCI controler and everything goes well 
up to when it comes to powering on the port:

Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... New Device 0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 
0x40
set address 1
usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length 0x0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 
0x12
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 
0x9
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 
0x19
get_conf_no 0 Result 25, wLength 25
if 0, ep 0
##EP epmaxpacketin[1] = 8
set configuration 1
usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length 0x0
new device strings: Mfr=1, Product=2, SerialNumber=0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x300 index 0x0 length 
0xFF
USB device number 1 default language ID 0x1
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x301 index 0x1 length 
0xFF
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x302 index 0x1 length 
0xFF
Manufacturer u-boot
Product  EHCI Host Controller
SerialNumber
USB hub found
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0 length 
0x4
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0 length 
0x8
1 ports detected
individual port power switching
standalone hub
individual port over-current protection
power on to power good time: 20ms
hub controller current requirement: 0mA
port 1 is removable
usb_control_msg: request: 0x0, requesttype: 0xA0, value 0x0 index 0x0 length 0x4
get_hub_status returned status 0001, change 0901
local power source is lost (inactive)
no over-current condition exists
enabling power on all ports
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x1 length 0x0
port 1 returns 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4
Port 1 Status 0502 Change 
1 USB Device(s) found
   scanning bus for storage devices... 0 Storage Device(s) found


According to the USB 2.0 specification paragraph 11.11, this is the correct 
behavior since both HUB_STATUS_LOCAL_POWER in wHubStatus and 
HUB_CHANGE_LOCAL_POWER in wHubChange are set. Issuing a port power feature to 
the port would have no effect.

Has anyone already met similar problems with EHCI hubs integrated to EHCI 
controllers ?

Thank you very much in advance.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/4] ppc/85xx: Remove CONFIG_SYS_DDR_TLB_START

2009-11-13 Thread Kumar Gala
Now that we dynamically determine TLB CAM entries to use we dont need
CONFIG_SYS_DDR_TLB_START anymore.

Signed-off-by: Kumar Gala 
---
 include/configs/MPC8572DS.h |1 -
 include/configs/P1_P2_RDB.h |2 --
 include/configs/P2020DS.h   |1 -
 3 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index 0e7745c..a274815 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -98,7 +98,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_SYS_PCIE1_ADDR  (CONFIG_SYS_CCSRBAR+0xa000)
 
 /* DDR Setup */
-#define CONFIG_SYS_DDR_TLB_START 9
 #define CONFIG_VERY_BIG_RAM
 #define CONFIG_FSL_DDR2
 #undef CONFIG_FSL_DDR_INTERACTIVE
diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
index e2930c1..6315bbd 100644
--- a/include/configs/P1_P2_RDB.h
+++ b/include/configs/P1_P2_RDB.h
@@ -149,8 +149,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_DDR_ERR_DIS 0x
 #define CONFIG_SYS_DDR_SBE 0x00FF
 
-#define CONFIG_SYS_DDR_TLB_START 9
-
 /*
  * Memory map
  *
diff --git a/include/configs/P2020DS.h b/include/configs/P2020DS.h
index 9574fca..7a6b623 100644
--- a/include/configs/P2020DS.h
+++ b/include/configs/P2020DS.h
@@ -101,7 +101,6 @@ extern unsigned long calculate_board_ddr_clk(unsigned long 
dummy);
 #define CONFIG_SYS_PCIE1_ADDR  (CONFIG_SYS_CCSRBAR+0xa000)
 
 /* DDR Setup */
-#define CONFIG_SYS_DDR_TLB_START 9
 #define CONFIG_VERY_BIG_RAM
 #define CONFIG_FSL_DDR31
 #undef CONFIG_FSL_DDR_INTERACTIVE
-- 
1.6.0.6

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


[U-Boot] [PATCH 4/4] ppc/85xx: Make flash TLB entry determined at runtime on FSL boards

2009-11-13 Thread Kumar Gala
Rather than hard coding which TLB entry the FLASH is mapped with we can
use find_tlb_idx to determine the entry.

Signed-off-by: Kumar Gala 
---
 board/freescale/mpc8536ds/mpc8536ds.c |2 +-
 board/freescale/mpc8572ds/mpc8572ds.c |2 +-
 board/freescale/p1_p2_rdb/p1_p2_rdb.c |2 +-
 board/freescale/p2020ds/p2020ds.c |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/freescale/mpc8536ds/mpc8536ds.c 
b/board/freescale/mpc8536ds/mpc8536ds.c
index ce40cdb..f8292cf 100644
--- a/board/freescale/mpc8536ds/mpc8536ds.c
+++ b/board/freescale/mpc8536ds/mpc8536ds.c
@@ -313,7 +313,7 @@ void pci_init_board(void)
 int board_early_init_r(void)
 {
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-   const u8 flash_esel = 1;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
 
/*
 * Remap Boot flash + PROMJET region to caching-inhibited
diff --git a/board/freescale/mpc8572ds/mpc8572ds.c 
b/board/freescale/mpc8572ds/mpc8572ds.c
index 556846a..64e164b 100644
--- a/board/freescale/mpc8572ds/mpc8572ds.c
+++ b/board/freescale/mpc8572ds/mpc8572ds.c
@@ -264,7 +264,7 @@ void pci_init_board(void)
 int board_early_init_r(void)
 {
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-   const u8 flash_esel = 2;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
 
/*
 * Remap Boot flash + PROMJET region to caching-inhibited
diff --git a/board/freescale/p1_p2_rdb/p1_p2_rdb.c 
b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
index 4c03468..3af660e 100644
--- a/board/freescale/p1_p2_rdb/p1_p2_rdb.c
+++ b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
@@ -131,7 +131,7 @@ int checkboard (void)
 int board_early_init_r(void)
 {
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-   const u8 flash_esel = 2;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
 
/*
 * Remap Boot flash region to caching-inhibited
diff --git a/board/freescale/p2020ds/p2020ds.c 
b/board/freescale/p2020ds/p2020ds.c
index aecb7aa..599caa2 100644
--- a/board/freescale/p2020ds/p2020ds.c
+++ b/board/freescale/p2020ds/p2020ds.c
@@ -298,7 +298,7 @@ void pci_init_board(void)
 int board_early_init_r(void)
 {
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
-   const u8 flash_esel = 2;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
 
/*
 * Remap Boot flash + PROMJET region to caching-inhibited
-- 
1.6.0.6

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


[U-Boot] [PATCH 2/4] ppc/85xx: Make SPD DDR TLB setup code use dynamic entry allocation

2009-11-13 Thread Kumar Gala
Now that we track which TLB CAM entries are used we can allocate
entries on the fly.  Change the SPD DDR TLB setup code to assume
we use at most 8 TLBs (or the number free, which ever is fewer).

Signed-off-by: Kumar Gala 
---
 cpu/mpc85xx/tlb.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 54339c4..fb10e27 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -225,14 +225,10 @@ void init_addr_map(void)
 }
 #endif
 
-#ifndef CONFIG_SYS_DDR_TLB_START
-#define CONFIG_SYS_DDR_TLB_START 8
-#endif
-
 unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
 {
+   int i;
unsigned int tlb_size;
-   unsigned int ram_tlb_index = CONFIG_SYS_DDR_TLB_START;
unsigned int ram_tlb_address = (unsigned int)CONFIG_SYS_DDR_SDRAM_BASE;
unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xf;
u64 size, memsize = (u64)memsize_in_meg << 20;
@@ -242,10 +238,14 @@ unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
/* Convert (4^max) kB to (2^max) bytes */
max_cam = max_cam * 2 + 10;
 
-   for (; size && ram_tlb_index < 16; ram_tlb_index++) {
+   for (i = 0; size && i < 8; i++) {
+   int ram_tlb_index = find_free_tlbcam();
u32 camsize = __ilog2_u64(size) & ~1U;
u32 align = __ilog2(ram_tlb_address) & ~1U;
 
+   if (ram_tlb_index == -1)
+   break;
+
if (align == -2) align = max_cam;
if (camsize > align)
camsize = align;
-- 
1.6.0.6

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


[U-Boot] [PATCH 1/4] ppc/85xx: Add tracking of TLB CAM usage

2009-11-13 Thread Kumar Gala
We need to track which TLB CAM entries are used to allow us to
"dynamically" allocate entries later in the code.  For example the SPD
DDR code today hard codes which TLB entries it uses.  We can now make
that pick entries that are free.

Signed-off-by: Kumar Gala 
---
 cpu/mpc85xx/cpu_init.c|1 +
 cpu/mpc85xx/tlb.c |   62 +
 include/asm-ppc/config.h  |7 
 include/asm-ppc/global_data.h |3 ++
 include/asm-ppc/mmu.h |2 +
 5 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 16ce82c..006f36e 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -246,6 +246,7 @@ void cpu_init_f (void)
 #ifdef CONFIG_FSL_CORENET
corenet_tb_init();
 #endif
+   init_used_tlb_cams();   
 }
 
 
diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index ea5deb2..54339c4 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -56,12 +56,72 @@ void init_tlbs(void)
 }
 
 #ifndef CONFIG_NAND_SPL
+static inline void use_tlb_cam(u8 idx)
+{
+   int i = idx / 32;
+   int bit = idx % 32;
+
+   gd->used_tlb_cams[i] |= (1 << bit); 
+}
+
+static inline void free_tlb_cam(u8 idx)
+{
+   int i = idx / 32;
+   int bit = idx % 32;
+
+   gd->used_tlb_cams[i] &= ~(1 << bit);
+}
+
+void init_used_tlb_cams(void)
+{
+   int i;
+   unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff;
+
+   for (i = 0; i < ((CONFIG_SYS_NUM_TLBCAMS+31)/32); i++)
+   gd->used_tlb_cams[i] = 0;
+
+   /* walk all the entries */
+   for (i = 0; i < num_cam; i++) {
+   u32 _mas1;
+
+   mtspr(MAS0, FSL_BOOKE_MAS0(1, i, 0));
+
+   asm volatile("tlbre;isync");
+   _mas1 = mfspr(MAS1);
+
+   /* if the entry isn't valid skip it */
+   if ((_mas1 & MAS1_VALID))
+   use_tlb_cam(i);
+   }
+}
+
+int find_free_tlbcam(void)
+{
+   int i;
+   u32 idx;
+
+   for (i = 0; i < ((CONFIG_SYS_NUM_TLBCAMS+31)/32); i++) {
+   idx = ffz(gd->used_tlb_cams[i]);
+
+   if (idx == 32)
+   continue;
+   }
+
+   if (idx >= CONFIG_SYS_NUM_TLBCAMS)
+   return -1;
+
+   return idx;
+}
+
 void set_tlb(u8 tlb, u32 epn, u64 rpn,
 u8 perms, u8 wimge,
 u8 ts, u8 esel, u8 tsize, u8 iprot)
 {
u32 _mas0, _mas1, _mas2, _mas3, _mas7;
 
+   if (tlb == 1)
+   use_tlb_cam(esel);
+
_mas0 = FSL_BOOKE_MAS0(tlb, esel, 0);
_mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize);
_mas2 = FSL_BOOKE_MAS2(epn, wimge);
@@ -80,6 +140,8 @@ void disable_tlb(u8 esel)
 {
u32 _mas0, _mas1, _mas2, _mas3, _mas7;
 
+   free_tlb_cam(esel);
+
_mas0 = FSL_BOOKE_MAS0(1, esel, 0);
_mas1 = 0;
_mas2 = 0;
diff --git a/include/asm-ppc/config.h b/include/asm-ppc/config.h
index d5f82b4..796707e 100644
--- a/include/asm-ppc/config.h
+++ b/include/asm-ppc/config.h
@@ -63,6 +63,13 @@
 #define CONFIG_TSECV2
 #endif
 
+/* Number of TLB CAM entries we have on FSL Book-E chips */
+#if defined(CONFIG_E500MC)
+#define CONFIG_SYS_NUM_TLBCAMS 64
+#elif defined(CONFIG_E500)
+#define CONFIG_SYS_NUM_TLBCAMS 16
+#endif
+
 /* Relocation to SDRAM works on all PPC boards */
 #define CONFIG_RELOC_FIXUP_WORKS
 
diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h
index 55e7e20..3f11918 100644
--- a/include/asm-ppc/global_data.h
+++ b/include/asm-ppc/global_data.h
@@ -107,6 +107,9 @@ typedef struct  global_data {
 #if defined(CONFIG_FSL_LAW)
u32 used_laws;
 #endif
+#if defined(CONFIG_E500)
+   u32 used_tlb_cams[(CONFIG_SYS_NUM_TLBCAMS+31)/32];
+#endif
 #if defined(CONFIG_MPC5xxx)
unsigned long   ipb_clk;
unsigned long   pci_clk;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index ec22a50..fd10249 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -479,6 +479,8 @@ extern void disable_tlb(u8 esel);
 extern void invalidate_tlb(u8 tlb);
 extern void init_tlbs(void);
 extern int find_tlb_idx(void *addr, u8 tlbsel);
+extern void init_used_tlb_cams(void);
+extern int find_free_tlbcam(void);
 
 extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
-- 
1.6.0.6

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


Re: [U-Boot] SDCARD Support - MPC8315e

2009-11-13 Thread Anton Vorontsov
On Fri, Nov 13, 2009 at 10:05:11PM +0800, Liu Dave-R63238 wrote:
> > Is there a SDCARD support for MPC8315e?
> 
> Yes. Have a look the drivers/mmc

Hm... AFAIK, 8315 chips don't include eSDHC controller.

(It is still possible to connect SD cards via SPI, but mmc spi
driver isn't yet included into U-Boot.)

Thanks,

-- 
Anton Vorontsov
email: cbouatmai...@gmail.com
irc://irc.freenode.net/bd2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request - mpc85xx (for v2009.11)(updated)

2009-11-13 Thread Kumar Gala
The following changes since commit 4f127980e0d4ba179b4628ebf8e8642210731055:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-net

are available in the git repository at:

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

Dave Liu (1):
  fsl-ddr: Fix the chip-select interleaving issue

Kumar Gala (1):
  ppc/85xx: Fix how we determine the number of CAM entries

 cpu/mpc85xx/tlb.c |4 ++--
 cpu/mpc8xxx/ddr/options.c |7 +++
 2 files changed, 5 insertions(+), 6 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ppc/85xx: Fix how we determine the number of CAM entries

2009-11-13 Thread Kumar Gala
We were incorrectly use the max CAM size as the number of entries in
the array for setting up the addrmap.  We should be using the NENTRY
field which is the low 12-bits of TLB1CFG.

Signed-off-by: Kumar Gala 
---
 cpu/mpc85xx/tlb.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 6e94c23..ea5deb2 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -132,10 +132,10 @@ int find_tlb_idx(void *addr, u8 tlbsel)
 void init_addr_map(void)
 {
int i;
-   unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
+   unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff;
 
/* walk all the entries */
-   for (i = 0; i < max_cam; i++) {
+   for (i = 0; i < num_cam; i++) {
unsigned long epn;
u32 tsize, _mas1;
phys_addr_t rpn;
-- 
1.6.0.6

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


Re: [U-Boot] SDCARD Support - MPC8315e

2009-11-13 Thread Marcos Cunha
I had the u-boot 1.3.2 and that version didn't have these code.

I get the git source tree.

Thanks.



Liu Dave-R63238 wrote:
>> Is there a SDCARD support for MPC8315e?
>> 
>
> Yes. Have a look the drivers/mmc
>
>   


-- 
cid:image002.gif@01C8B04F.DE139770

*Marcos Aurélio pinto cunha, PMP
Engenheiro eletricista / electrical engineer
***

cid:image002.gif@01C8B04F.DE139770

cid:image003.gif@01C8B04F.DE139770



Fone: +55 (85) 3216.7934
Fax: +55 (85) 3216.7864

Skype: marcos.cunha.ufc


*ISO 9001 : 2000 - CMMI3***



*www.atlantico.com.br ***

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


Re: [U-Boot] Please pull u-boot-ppc4xx/next

2009-11-13 Thread Wolfgang Grandegger
Hi Stefan,

Stefan Roese wrote:
> Hi Matthias,
> 
> On Wednesday 11 November 2009 22:12:06 Matthias Fuchs wrote:
>>> please pull some updates for "next". Thanks.
>>>
>>>
>>> The following changes since commit
>>> cd12f615e4dd1dd24caab93f4157894783c6c1c0: Wolfgang Grandegger (1):
>>> mpc52xx: add support for the IPEK01 board
>>>
>>> are available in the git repository at:
>>>
>>>   git://www.denx.de/git/u-boot-ppc4xx.git next
>>>
>>> Matthias Fuchs (1):
>>>   ppc4xx: Add UBI support to PLU405 boards
>> What happened to the others? ".. init coupler..." etc.
> 
> As you know, these patches depend on the sja1000 CAN header:
> 
> [PATCH 1/2] Add minimal SJA1000 header for basic CAN mode
> 
> And I'm not sure what the current status of this header is. Wolfgang 
> Grandegger (added to Cc) also introduced some new CAN stuff. We don't want to 
> add multiple headers of course.

My stuff was sent as RFC. It's on hold now as there was little feedback.

> So how should we continue here? I understand that your patches depending on 
> this sja1000 header are bugfixes:
> 
> [PATCH 2/2 V3] ppc4xx: Initialize magnetic couplers in PLU405
> [PATCH] ppc4xx: Initialize magnetic coupler on VOM405 boards
> 
> And you introduced this header on the explicit proposal from Wolfgang Denk. 
> So 
> I would vote for adding your bug fix patches with your sja1000 header right 
> now. We should remove this header again, when the CAN support from Wolfgang 
> Grandegger hits mainline.

Yep.

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


Re: [U-Boot] [PATCH v3] DA8xx: Add MUSB host support

2009-11-13 Thread Nick Thompson
On 13/11/09 13:05, Ajay Kumar Gupta wrote:
> Tested USB host functionality on DA830 EVM.
> 
> Signed-off-by: Ajay Kumar Gupta 
> Signed-off-by: Swaminathan S 
> ---
> Patch has updated licensing header.Other patch in series has no update
> so not reposting them untill I get any rework comment.
> 
>  drivers/usb/musb/Makefile |1 +
>  drivers/usb/musb/da8xx.c  |  143 
> +
>  drivers/usb/musb/da8xx.h  |   84 ++
>  include/usb.h |3 +-
>  4 files changed, 230 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/usb/musb/da8xx.c
>  create mode 100644 drivers/usb/musb/da8xx.h
> 

> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> new file mode 100644
> index 000..3e4694f
> --- /dev/null
> +++ b/drivers/usb/musb/da8xx.c

> +int musb_platform_init(void)
> +{
> + u32  revision;
> +
> + /* enable psc for usb2.0 */
> + lpsc_on(33);
> +
> + /* enable usb vbus */
> + enable_vbus();
> +
> + /* reset the controller */
> + writel(0x1, (DA8XX_USB_OTG_BASE + DA8XX_USB_CTRL_REG));
> + udelay(5000);
> +
> + /* start the on-chip usb phy and its pll */
> + if (phy_on() == 0)
> + return -1;
> +
> + /* Returns zero if e.g. not clocked */
> + revision = readl(DA8XX_USB_OTG_BASE + DA8XX_USB_VERSION_REG);
> + if (revision == 0)
> + return -1;
> +
> + /* Disable all interrupts */
> + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
> + DA8XX_USB_RXINT_MASK),
> + (DA8XX_USB_OTG_BASE + DA8XX_USB_INT_MASK_SET_REG));

This last line should have one less alignment space.

You still have a good collection of OTG + offset #defines here and below.
Could you please add a C struct and pointer instead.

> + return 0;
> +}
> +
> +/*
> + * This function performs DA8xx platform specific deinitialization for usb0.
> + */
> +void musb_platform_deinit(void)
> +{
> + /* Turn of the phy */
> + phy_off();
> +
> + /* flush any interrupts */
> + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
> + DA8XX_USB_RXINT_MASK),
> + (DA8XX_USB_OTG_BASE + DA8XX_USB_INT_MASK_CLR_REG));
> + writel(0, (DA8XX_USB_OTG_BASE + DA8XX_USB_EOI_REG));
> +}
> diff --git a/drivers/usb/musb/da8xx.h b/drivers/usb/musb/da8xx.h
> new file mode 100644
> index 000..c3e9c77
> --- /dev/null
> +++ b/drivers/usb/musb/da8xx.h
> +#ifndef __DA8XX_MUSB_H__
> +#define __DA8XX_MUSB_H__
> +
> +#include "musb_core.h"
> +
> +/* extern functions */
> +extern void lpsc_on(unsigned int id);

Already defined in hardware.h (inherited here from davinci.h)

> +
> +/* Base address of da8xx usb0 wrapper */
> +#define DA8XX_USB_OTG_BASE  0x01E0
> +
> +/* Base address of da8xx musb core */
> +#define DA8XX_USB_OTG_CORE_BASE (DA8XX_USB_OTG_BASE + 0x400)
> +
> +/* Timeout for DA8xx usb module */
> +#define DA8XX_USB_OTG_TIMEOUT 0x3FF
> +
> +/* For now include usb OTG module registers here */
> +#define DA8XX_USB_VERSION_REG0x00
> +#define DA8XX_USB_CTRL_REG   0x04
> +#define DA8XX_USB_INT_MASK_SET_REG   0x30
> +#define DA8XX_USB_INT_MASK_CLR_REG   0x34
> +#define DA8XX_USB_EOI_REG0x3c

These should be removed in favour of struct members.

> +
> +#define DA8XX_USB_TX_ENDPTS_MASK  0x1f /* ep0 + 4 tx */
> +#define DA8XX_USB_RX_ENDPTS_MASK  0x1e /* 4 rx */
> +#define DA8XX_USB_TXINT_SHIFT  0
> +#define DA8XX_USB_RXINT_SHIFT  8
> +
> +#define DA8XX_USB_USBINT_MASK  0x01ff  /* 8 Mentor, DRVVBUS */
> +#define DA8XX_USB_TXINT_MASK \
> + (DA8XX_USB_TX_ENDPTS_MASK << DA8XX_USB_TXINT_SHIFT)
> +#define DA8XX_USB_RXINT_MASK \
> + (DA8XX_USB_RX_ENDPTS_MASK << DA8XX_USB_RXINT_SHIFT)
> +
> +/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */
> +#define CFGCHIP2_PHYCLKGD(1 << 17)
> +#define CFGCHIP2_VBUSSENSE   (1 << 16)
> +#define CFGCHIP2_RESET   (1 << 15)
> +#define CFGCHIP2_OTGMODE (3 << 13)
> +#define CFGCHIP2_NO_OVERRIDE (0 << 13)
> +#define CFGCHIP2_FORCE_HOST  (1 << 13)
> +#define CFGCHIP2_FORCE_DEVICE(2 << 13)
> +#define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13)
> +#define CFGCHIP2_USB1PHYCLKMUX   (1 << 12)
> +#define CFGCHIP2_USB2PHYCLKMUX   (1 << 11)
> +#define CFGCHIP2_PHYPWRDN(1 << 10)
> +#define CFGCHIP2_OTGPWRDN(1 << 9)
> +#define CFGCHIP2_DATPOL  (1 << 8)
> +#define CFGCHIP2_USB1SUSPENDM(1 << 7)
> +#define CFGCHIP2_PHY_PLLON   (1 << 6)/* override PLL suspend */
> +#define CFGCHIP2_SESENDEN(1 << 5)/* Vsess_end comparator */
> +#define CFGCHIP2_VBDTCTEN(1 << 4)/* Vbus comparator */
> +#define CFGCHIP2_REFFREQ (0xf << 0)
> +#define CFGCHIP2_REFFREQ_12MHZ   (1 << 0)
> +#define CFGCHIP2_REFFREQ_24MHZ   (2 << 0)
> +#define CFGCHIP2_REFFREQ_48MHZ   (3 << 0)
> +
> +#

Re: [U-Boot] SDCARD Support - MPC8315e

2009-11-13 Thread Liu Dave-R63238
> Is there a SDCARD support for MPC8315e?

Yes. Have a look the drivers/mmc
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support

2009-11-13 Thread Tom
Paulraj, Sandeep wrote:
> Ajay,
> 
> We have a problem with your licensing
> 
>> Subject: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support
>>
>> Tested USB host functionality on DA830 EVM.
>>
>> Signed-off-by: Ajay Kumar Gupta 
>> Signed-off-by: Swaminathan S 
>> ---
>>  drivers/usb/musb/Makefile |1 +
>>  drivers/usb/musb/da8xx.c  |  138
>> +
>>  drivers/usb/musb/da8xx.h  |   79 ++
>>  include/usb.h |3 +-
>>  4 files changed, 220 insertions(+), 1 deletions(-)
>>  create mode 100644 drivers/usb/musb/da8xx.c
>>  create mode 100644 drivers/usb/musb/da8xx.h
>>
>> diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
>> index 09e0a5f..eb4d8fd 100644
>> --- a/drivers/usb/musb/Makefile
>> +++ b/drivers/usb/musb/Makefile
>> @@ -27,6 +27,7 @@ LIB:= $(obj)libusb_musb.a
>>
>>  COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
>>  COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
>> +COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
>>
>>  COBJS   := $(COBJS-y)
>>  SRCS:= $(COBJS:.o=.c)
>> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
>> new file mode 100644
>> index 000..5b02e33
>> --- /dev/null
>> +++ b/drivers/usb/musb/da8xx.c
>> @@ -0,0 +1,138 @@
>> +/*
>> + * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
>> + *
>> + * Author: Ajay Kumar Gupta 
>> + *
>> + * Based on drivers/usb/musb/davinci.c
>> + *
>> + * Copyright (c) 2009 Texas Instruments Incorporated
>> + *
>> + * This package is free software;  you can redistribute it and/or
>> + * modify it under the terms of the license found in the file
>> + * named COPYING that should have accompanied this file.
>> + *
>> + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
>> + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
>> + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
> 
> This is not going to work. I have discussed offline with Wolfgang and Tom.
> This is going to probably get a NAK from both of them unless they have had a 
> change of heart in the last month.
> I know what you have done is in response to a possible U-Boot moving to GPL 
> v3.

The link you read is http://www.denx.de/wiki/U-Boot/Patches

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


[U-Boot] SDCARD Support - MPC8315e

2009-11-13 Thread Marcos Cunha
Dears,

Is there a SDCARD support for MPC8315e?

Best Regards.

-- 
cid:image002.gif@01C8B04F.DE139770

*Marcos Aurélio pinto cunha, PMP
Engenheiro eletricista / electrical engineer
***

cid:image002.gif@01C8B04F.DE139770

cid:image003.gif@01C8B04F.DE139770



Fone: +55 (85) 3216.7934
Fax: +55 (85) 3216.7864

Skype: marcos.cunha.ufc


*ISO 9001 : 2000 - CMMI3***



*www.atlantico.com.br ***

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


[U-Boot] [PATCH v3] DA8xx: Add MUSB host support

2009-11-13 Thread Ajay Kumar Gupta
Tested USB host functionality on DA830 EVM.

Signed-off-by: Ajay Kumar Gupta 
Signed-off-by: Swaminathan S 
---
Patch has updated licensing header.Other patch in series has no update
so not reposting them untill I get any rework comment.

 drivers/usb/musb/Makefile |1 +
 drivers/usb/musb/da8xx.c  |  143 +
 drivers/usb/musb/da8xx.h  |   84 ++
 include/usb.h |3 +-
 4 files changed, 230 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/da8xx.c
 create mode 100644 drivers/usb/musb/da8xx.h

diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 09e0a5f..eb4d8fd 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libusb_musb.a
 
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
new file mode 100644
index 000..3e4694f
--- /dev/null
+++ b/drivers/usb/musb/da8xx.c
@@ -0,0 +1,143 @@
+/*
+ * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
+ *
+ * Author: Ajay Kumar Gupta 
+ *
+ * Based on drivers/usb/musb/davinci.c
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated
+ *
+ * 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 "da8xx.h"
+
+/* MUSB platform configuration */
+struct musb_config musb_cfg = {
+   (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
+   DA8XX_USB_OTG_TIMEOUT,
+   0
+};
+
+/*
+ * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
+ */
+static void enable_vbus(void)
+{
+   u32 value;
+
+   /* configure GPIO bank4 pin 15 in output direction */
+   value = readl(&davinci_gpio_bank45->dir);
+   writel((value & (~DA8XX_USB_VBUS_GPIO)), &davinci_gpio_bank45->dir);
+
+   /* set GPIO bank4 pin 15 high to drive VBUS */
+   value = readl(&davinci_gpio_bank45->set_data);
+   writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45->set_data);
+}
+
+/*
+ * Enable the usb0 phy. This initialization procedure is explained in
+ * the DA8xx USB user guide document.
+ */
+static u8 phy_on(void)
+{
+   u32 timeout;
+   u32 cfgchip2;
+
+   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
+
+   cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN |
+ CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
+   cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
+   CFGCHIP2_REFFREQ_24MHZ;
+
+   writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
+
+   /* wait until the usb phy pll locks */
+   timeout = musb_cfg.timeout;
+   while (timeout--)
+   if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
+   return 1;
+
+   /* USB phy was not turned on */
+   return 0;
+}
+
+/*
+ * Disable the usb phy
+ */
+static void phy_off(void)
+{
+   u32 cfgchip2;
+
+   /*
+* Power down the on-chip PHY.
+*/
+   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
+   cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
+   cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
+   writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
+}
+
+/*
+ * This function performs DA8xx platform specific initialization for usb0.
+ */
+int musb_platform_init(void)
+{
+   u32  revision;
+
+   /* enable psc for usb2.0 */
+   lpsc_on(33);
+
+   /* enable usb vbus */
+   enable_vbus();
+
+   /* reset the controller */
+   writel(0x1, (DA8XX_USB_OTG_BASE + DA8XX_USB_CTRL_REG));
+   udelay(5000);
+
+   /* start the on-chip usb phy and its pll */
+   if (phy_on() == 0)
+   return -1;
+
+   /* Returns zero if e.g. not clocked */
+   revision = readl(DA8XX_USB_OTG_BASE + DA8XX_USB_VERSION_REG);
+   if (revision == 0)
+   return -1;
+
+   /* Disable all interrupts */
+   writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
+   DA8XX_USB_RXINT_MASK),
+   (DA8XX_USB_OTG_BASE + DA8XX_USB_INT_MASK_SET_REG));
+   return 0;
+}
+
+/*
+ * This function performs DA8xx platform

Re: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support

2009-11-13 Thread Gupta, Ajay Kumar
Hi,

> -Original Message-
> From: Paulraj, Sandeep
> Sent: Friday, November 13, 2009 5:36 PM
> To: Gupta, Ajay Kumar; u-boot@lists.denx.de; Tom
> Cc: Subbrathnam, Swaminathan; Wolfgang Denk
> Subject: RE: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support
> 
> 
> Ajay,
> 
> We have a problem with your licensing
> 
> > Subject: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support
> >
> > Tested USB host functionality on DA830 EVM.
> >
> > Signed-off-by: Ajay Kumar Gupta 
> > Signed-off-by: Swaminathan S 
> > ---
> >  drivers/usb/musb/Makefile |1 +
> >  drivers/usb/musb/da8xx.c  |  138
> > +
> >  drivers/usb/musb/da8xx.h  |   79 ++
> >  include/usb.h |3 +-
> >  4 files changed, 220 insertions(+), 1 deletions(-)
> >  create mode 100644 drivers/usb/musb/da8xx.c
> >  create mode 100644 drivers/usb/musb/da8xx.h
> >
> > diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
> > index 09e0a5f..eb4d8fd 100644
> > --- a/drivers/usb/musb/Makefile
> > +++ b/drivers/usb/musb/Makefile
> > @@ -27,6 +27,7 @@ LIB   := $(obj)libusb_musb.a
> >
> >  COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
> >  COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
> > +COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
> >
> >  COBJS  := $(COBJS-y)
> >  SRCS   := $(COBJS:.o=.c)
> > diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> > new file mode 100644
> > index 000..5b02e33
> > --- /dev/null
> > +++ b/drivers/usb/musb/da8xx.c
> > @@ -0,0 +1,138 @@
> > +/*
> > + * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
> > + *
> > + * Author: Ajay Kumar Gupta 
> > + *
> > + * Based on drivers/usb/musb/davinci.c
> > + *
> > + * Copyright (c) 2009 Texas Instruments Incorporated
> > + *
> > + * This package is free software;  you can redistribute it and/or
> > + * modify it under the terms of the license found in the file
> > + * named COPYING that should have accompanied this file.
> > + *
> > + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
> > + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
> > + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
> 
> This is not going to work. I have discussed offline with Wolfgang and Tom.
> This is going to probably get a NAK from both of them unless they have had
> a change of heart in the last month.
> I know what you have done is in response to a possible U-Boot moving to
> GPL v3.

Hi Sandeep,

I will discuss it internally and would post updated version.

Regards,
Ajay
> 
> 
> > + *
> > + */
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include "da8xx.h"
> > +
> > +/* MUSB platform configuration */
> > +struct musb_config musb_cfg = {
> > +   (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
> > +   DA8XX_USB_OTG_TIMEOUT,
> > +   0
> > +};
> > +
> > +/*
> > + * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
> > + */
> > +static void enable_vbus(void)
> > +{
> > +   u32 value;
> > +
> > +   /* configure GPIO bank4 pin 15 in output direction */
> > +   value = readl(&davinci_gpio_bank45->dir);
> > +   writel((value & (~DA8XX_USB_VBUS_GPIO)), &davinci_gpio_bank45->dir);
> > +
> > +   /* set GPIO bank4 pin 15 high to drive VBUS */
> > +   value = readl(&davinci_gpio_bank45->set_data);
> > +   writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45-
> > >set_data);
> > +}
> > +
> > +/*
> > + * Enable the usb0 phy. This initialization procedure is explained in
> > + * the DA8xx USB user guide document.
> > + */
> > +static u8 phy_on(void)
> > +{
> > +   u32 timeout;
> > +   u32 cfgchip2;
> > +
> > +   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
> > +
> > +   cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN
> > |
> > + CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
> > +   cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN |
> > CFGCHIP2_PHY_PLLON |
> > +   CFGCHIP2_REFFREQ_24MHZ;
> > +
> > +   writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
> > +
> > +   /* wait until the usb phy pll locks */
> > +   timeout = musb_cfg.timeout;
> > +   while (timeout--)
> > +   if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
> > +   return 1;
> > +
> > +   /* USB phy was not turned on */
> > +   return 0;
> > +}
> > +
> > +/*
> > + * Disable the usb phy
> > + */
> > +static void phy_off(void)
> > +{
> > +   u32 cfgchip2;
> > +
> > +   /*
> > +* Power down the on-chip PHY.
> > +*/
> > +   cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
> > +   cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
> > +   cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
> > +   writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
> > +}
> > +
> > +/*
> > + * This function performs DA8xx platform specific initialization for
> > usb0.
> > + */
> > +int musb_platform_init(void)
> > +{
> > +   u32  revision;
> > +
> > +   /* enable psc for usb2.0 */
> > +   lpsc_o

Re: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support

2009-11-13 Thread Paulraj, Sandeep

Ajay,

We have a problem with your licensing

> Subject: [U-Boot] [PATCH 3/4 v2] DA8xx: Add MUSB host support
> 
> Tested USB host functionality on DA830 EVM.
> 
> Signed-off-by: Ajay Kumar Gupta 
> Signed-off-by: Swaminathan S 
> ---
>  drivers/usb/musb/Makefile |1 +
>  drivers/usb/musb/da8xx.c  |  138
> +
>  drivers/usb/musb/da8xx.h  |   79 ++
>  include/usb.h |3 +-
>  4 files changed, 220 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/usb/musb/da8xx.c
>  create mode 100644 drivers/usb/musb/da8xx.h
> 
> diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
> index 09e0a5f..eb4d8fd 100644
> --- a/drivers/usb/musb/Makefile
> +++ b/drivers/usb/musb/Makefile
> @@ -27,6 +27,7 @@ LIB := $(obj)libusb_musb.a
> 
>  COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
>  COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
> +COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
> 
>  COBJS:= $(COBJS-y)
>  SRCS := $(COBJS:.o=.c)
> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> new file mode 100644
> index 000..5b02e33
> --- /dev/null
> +++ b/drivers/usb/musb/da8xx.c
> @@ -0,0 +1,138 @@
> +/*
> + * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
> + *
> + * Author: Ajay Kumar Gupta 
> + *
> + * Based on drivers/usb/musb/davinci.c
> + *
> + * Copyright (c) 2009 Texas Instruments Incorporated
> + *
> + * This package is free software;  you can redistribute it and/or
> + * modify it under the terms of the license found in the file
> + * named COPYING that should have accompanied this file.
> + *
> + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
> + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

This is not going to work. I have discussed offline with Wolfgang and Tom.
This is going to probably get a NAK from both of them unless they have had a 
change of heart in the last month.
I know what you have done is in response to a possible U-Boot moving to GPL v3.


> + *
> + */
> +#include 
> +#include 
> +#include 
> +
> +#include "da8xx.h"
> +
> +/* MUSB platform configuration */
> +struct musb_config musb_cfg = {
> + (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
> + DA8XX_USB_OTG_TIMEOUT,
> + 0
> +};
> +
> +/*
> + * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
> + */
> +static void enable_vbus(void)
> +{
> + u32 value;
> +
> + /* configure GPIO bank4 pin 15 in output direction */
> + value = readl(&davinci_gpio_bank45->dir);
> + writel((value & (~DA8XX_USB_VBUS_GPIO)), &davinci_gpio_bank45->dir);
> +
> + /* set GPIO bank4 pin 15 high to drive VBUS */
> + value = readl(&davinci_gpio_bank45->set_data);
> + writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45-
> >set_data);
> +}
> +
> +/*
> + * Enable the usb0 phy. This initialization procedure is explained in
> + * the DA8xx USB user guide document.
> + */
> +static u8 phy_on(void)
> +{
> + u32 timeout;
> + u32 cfgchip2;
> +
> + cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
> +
> + cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN
> |
> +   CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
> + cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN |
> CFGCHIP2_PHY_PLLON |
> + CFGCHIP2_REFFREQ_24MHZ;
> +
> + writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
> +
> + /* wait until the usb phy pll locks */
> + timeout = musb_cfg.timeout;
> + while (timeout--)
> + if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
> + return 1;
> +
> + /* USB phy was not turned on */
> + return 0;
> +}
> +
> +/*
> + * Disable the usb phy
> + */
> +static void phy_off(void)
> +{
> + u32 cfgchip2;
> +
> + /*
> +  * Power down the on-chip PHY.
> +  */
> + cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
> + cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
> + cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
> + writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
> +}
> +
> +/*
> + * This function performs DA8xx platform specific initialization for
> usb0.
> + */
> +int musb_platform_init(void)
> +{
> + u32  revision;
> +
> + /* enable psc for usb2.0 */
> + lpsc_on(33);
> +
> + /* enable usb vbus */
> + enable_vbus();
> +
> + /* reset the controller */
> + writel(0x1, (DA8XX_USB_OTG_BASE + DA8XX_USB_CTRL_REG));
> + udelay(5000);
> +
> + /* start the on-chip usb phy and its pll */
> + if (phy_on() == 0)
> + return -1;
> +
> + /* Returns zero if e.g. not clocked */
> + revision = readl(DA8XX_USB_OTG_BASE + DA8XX_USB_VERSION_REG);
> + if (revision == 0)
> + return -1;
> +
> + /* Disable all interrupts */
> + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
> +

[U-Boot] [PATCH 3/3] ppc4xx: Consolidate pci_master_init() function

2009-11-13 Thread Stefan Roese
This patch removes the duplicted implementations of the pci_master_init()
function by introducing a weak default function for it. It can be
overridden by a board specific version.

Signed-off-by: Stefan Roese 
---
 board/amcc/bamboo/bamboo.c|   21 -
 board/amcc/sequoia/sequoia.c  |   17 -
 board/amcc/yosemite/yosemite.c|   21 -
 board/esd/du440/du440.c   |   17 -
 board/esd/pmc440/pmc440.c |   18 ++
 board/gdsys/gdppc440etx/gdppc440etx.c |   21 -
 board/korat/korat.c   |   17 -
 board/lwmon5/lwmon5.c |   21 -
 board/netstal/hcu5/hcu5.c |   21 +++--
 board/pcs440ep/pcs440ep.c |   21 -
 cpu/ppc4xx/4xx_pci.c  |   18 ++
 include/asm-ppc/4xx_pci.h |1 +
 12 files changed, 32 insertions(+), 182 deletions(-)

diff --git a/board/amcc/bamboo/bamboo.c b/board/amcc/bamboo/bamboo.c
index 7c34c44..c90f86b 100644
--- a/board/amcc/bamboo/bamboo.c
+++ b/board/amcc/bamboo/bamboo.c
@@ -466,27 +466,6 @@ phys_size_t initdram (int board_type)
 #endif
 }
 
-/*
- *  pci_master_init
- *
- /
-#if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT)
-void pci_master_init(struct pci_controller *hose)
-{
-   unsigned short temp_short;
-
-   
/*--+
- | Write the PowerPC440 EP PCI Configuration regs.
- |   Enable PowerPC440 EP to be a master on the PCI bus (PMM).
- |   Enable PowerPC440 EP to act as a PCI memory target (PTM).
- 
+--*/
-   pci_read_config_word(0, PCI_COMMAND, &temp_short);
-   pci_write_config_word(0, PCI_COMMAND,
- temp_short | PCI_COMMAND_MASTER |
- PCI_COMMAND_MEMORY);
-}
-#endif /* defined(CONFIG_PCI) && 
defined(CONFIG_SYS_PCI_MASTER_INIT) */
-
 /*+
   | is_powerpc440ep_pass1.
   
+*/
diff --git a/board/amcc/sequoia/sequoia.c b/board/amcc/sequoia/sequoia.c
index 8c0a647..cb34c9d 100644
--- a/board/amcc/sequoia/sequoia.c
+++ b/board/amcc/sequoia/sequoia.c
@@ -370,23 +370,6 @@ void board_pci_fixup_irq(struct pci_controller *hose, 
pci_dev_t dev)
 }
 #endif
 
-#if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT)
-void pci_master_init(struct pci_controller *hose)
-{
-   unsigned short temp_short;
-
-   /*
-* Write the PowerPC440 EP PCI Configuration regs.
-* Enable PowerPC440 EP to be a master on the PCI bus (PMM).
-* Enable PowerPC440 EP to act as a PCI memory target (PTM).
-*/
-   pci_read_config_word(0, PCI_COMMAND, &temp_short);
-   pci_write_config_word(0, PCI_COMMAND,
- temp_short | PCI_COMMAND_MASTER |
- PCI_COMMAND_MEMORY);
-}
-#endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT) */
-
 #if defined(CONFIG_POST)
 /*
  * Returns 1 if keys pressed to start the power-on long-running tests
diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c
index b6f8b70..98c1f3b 100644
--- a/board/amcc/yosemite/yosemite.c
+++ b/board/amcc/yosemite/yosemite.c
@@ -353,27 +353,6 @@ phys_size_t initdram(int board)
 }
 
 /*
- *  pci_master_init
- *
- /
-#if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT)
-void pci_master_init(struct pci_controller *hose)
-{
-   unsigned short temp_short;
-
-   
/*--+
- | Write the PowerPC440 EP PCI Configuration regs.
- |   Enable PowerPC440 EP to be a master on the PCI bus (PMM).
- |   Enable PowerPC440 EP to act as a PCI memory target (PTM).
- 
+--*/
-   pci_read_config_word(0, PCI_COMMAND, &temp_short);
-   pci_write_config_word(0, PCI_COMMAND,
- temp_short | PCI_COMMAND_MASTER |
- PCI_COMMAND_MEMORY);
-}
-#endif /* defined(CONFIG_PCI) && 
defined(CONFIG_SYS_PCI_MASTER_INIT) */
-
-/*
  *  hw_watchdog_reset
  *
  * This routine is called to reset (keep alive) the wa

[U-Boot] [PATCH 2/3] ppc4xx: Consolidate pci_pre_init() function

2009-11-13 Thread Stefan Roese
This patch removes the duplicted implementations of the pci_pre_init()
function by introducing a weak default function for it. This weak default
has a different implementation for some PPC variants. It can be
overridden by a board specific version.

Signed-off-by: Stefan Roese 
---
 board/amcc/bamboo/bamboo.c|   55 --
 board/amcc/ebony/ebony.c  |   31 
 board/amcc/katmai/katmai.c|   31 
 board/amcc/kilauea/kilauea.c  |   19 -
 board/amcc/luan/luan.c|   33 -
 board/amcc/makalu/makalu.c|   19 -
 board/amcc/ocotea/ocotea.c|   32 -
 board/amcc/sequoia/sequoia.c  |   59 +---
 board/amcc/taishan/taishan.c  |   31 
 board/amcc/yosemite/yosemite.c|   55 --
 board/amcc/yucca/yucca.c  |   31 
 board/esd/du440/du440.c   |   54 --
 board/esd/pmc440/pmc440.c |   60 +---
 board/gdsys/gdppc440etx/gdppc440etx.c |   49 +
 board/korat/korat.c   |   60 +---
 board/lwmon5/lwmon5.c |   55 --
 board/pcs440ep/pcs440ep.c |   55 --
 board/prodrive/alpr/alpr.c|   34 ++---
 board/prodrive/p3p440/p3p440.c|   31 
 board/sandburst/common/sb_common.c|   32 -
 board/xes/xpedite1000/xpedite1000.c   |3 +-
 cpu/ppc4xx/4xx_pci.c  |  125 +++--
 cpu/ppc4xx/cpu.c  |2 +-
 include/asm-ppc/4xx_pci.h |5 ++
 include/configs/PMC440.h  |1 +
 include/configs/korat.h   |1 +
 include/configs/sequoia.h |1 +
 include/ppc440.h  |3 +-
 28 files changed, 130 insertions(+), 837 deletions(-)

diff --git a/board/amcc/bamboo/bamboo.c b/board/amcc/bamboo/bamboo.c
index 3ffdac8..7c34c44 100644
--- a/board/amcc/bamboo/bamboo.c
+++ b/board/amcc/bamboo/bamboo.c
@@ -467,61 +467,6 @@ phys_size_t initdram (int board_type)
 }
 
 /*
- *  pci_pre_init
- *
- *  This routine is called just prior to registering the hose and gives
- *  the board the opportunity to check things. Returning a value of zero
- *  indicates that things are bad & PCI initialization should be aborted.
- *
- * Different boards may wish to customize the pci controller structure
- * (add regions, override default access routines, etc) or perform
- * certain pre-initialization actions.
- *
- /
-#if defined(CONFIG_PCI)
-int pci_pre_init(struct pci_controller *hose)
-{
-   unsigned long addr;
-
-   
/*-+
- | Set priority for all PLB3 devices to 0.
- | Set PLB3 arbiter to fair mode.
- 
+-*/
-   mfsdr(SD0_AMP1, addr);
-   mtsdr(SD0_AMP1, (addr & 0x00FF) | 0xFF00);
-   addr = mfdcr(PLB3_ACR);
-   mtdcr(PLB3_ACR, addr | 0x8000);
-
-   
/*-+
- | Set priority for all PLB4 devices to 0.
- 
+-*/
-   mfsdr(SD0_AMP0, addr);
-   mtsdr(SD0_AMP0, (addr & 0x00FF) | 0xFF00);
-   addr = mfdcr(PLB4_ACR) | 0xa000;/* Was 0x8 */
-   mtdcr(PLB4_ACR, addr);
-
-   
/*-+
- | Set Nebula PLB4 arbiter to fair mode.
- 
+-*/
-   /* Segment0 */
-   addr = (mfdcr(PLB0_ACR) & ~PLB0_ACR_PPM_MASK) | PLB0_ACR_PPM_FAIR;
-   addr = (addr & ~PLB0_ACR_HBU_MASK) | PLB0_ACR_HBU_ENABLED;
-   addr = (addr & ~PLB0_ACR_RDP_MASK) | PLB0_ACR_RDP_4DEEP;
-   addr = (addr & ~PLB0_ACR_WRP_MASK) | PLB0_ACR_WRP_2DEEP;
-   mtdcr(PLB0_ACR, addr);
-
-   /* Segment1 */
-   addr = (mfdcr(PLB1_ACR) & ~PLB1_ACR_PPM_MASK) | PLB1_ACR_PPM_FAIR;
-   addr = (addr & ~PLB1_ACR_HBU_MASK) | PLB1_ACR_HBU_ENABLED;
-   addr = (addr & ~PLB1_ACR_RDP_MASK) | PLB1_ACR_RDP_4DEEP;
-   addr = (addr & ~PLB1_ACR_WRP_MASK) | PLB1_ACR_WRP_2DEEP;
-   mtdcr(PLB1_ACR, addr);
-
-   return 1;
-}
-#endif /* defined(CONFIG_PCI) */
-
-/*
  *  pci_master_init
  *
  /
diff --git a/board/amcc/ebony/ebony.c b/board/amcc/ebony/ebony.c
index e4d168f..923dbca 100644
--- a/board/amcc/ebony/ebony.c
+++ b/board/amcc/ebony/ebony.c
@@ -164,34 +164,3 @@ long int 

Re: [U-Boot] redundant code in common/cmd_i2c.

2009-11-13 Thread Heiko Schocher
Hello Detlev,

Detlev Zundel wrote:
>> Hello PratapChandu,
>>
>> PratapChandu wrote:
>>> The following code fragment in the file common/cmd_i2c.c  seems to be 
>>> redundant.
>>> Is not good to delete  ?
>>>
>>> Line 330 - 336 is like below
>>>
>>> #if 0
>>> for (timeout = 0; timeout < 10; timeout++) {
>>> udelay(2000);
>>> if (i2c_probe(chip) == 0)
>>> break;
>>> }
>>> #endif
>> Yes, this seems to be dead code. Please provide a patch for removing
>> it.
> 
> Ah uh, check the comment above which is directly related to this piece
> of code.  if you remove only the code, you have a dangling comment.
> Maybe this was meant to be an option but nobody cared to make it
> optional?

Yep, you are right, a patch schould fix the comment too, or (maybe better?)
make this as an option configurable ...

> Actually I do not know if this was ever used, but we should try to do
> the change consistently.

Yep.

Thanks for detecting this!

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] omap3evm: Add board revision function

2009-11-13 Thread Gupta, Ajay Kumar
Somehow the local patch got sent to the list. 
Apologies for it.

Please find the correct patch attached.

Regards,
Ajay 

> -Original Message-
> From: Gupta, Ajay Kumar
> Sent: Friday, November 13, 2009 3:24 PM
> To: u-boot@lists.denx.de
> Cc: Gupta, Ajay Kumar; Hiremath, Vaibhav; Premi, Sanjeev
> Subject: [PATCH] omap3evm: Add board revision function
> 
> Hi Vaibhav/Sanjeev,
> 
> Please review this which I plan to submit today.
> 
> It almost same as submited on lo.
> 
> Regards,
> Ajay
> 
> Added function to differentiate between the OMAP3EVM revisions. The
> chip-id of the ethernet PHY is being used for this purpose.
> 
> Rev A to D : 0x0115
> Rev >= E   : 0x9220
> 
> Signed-off-by: Vaibhav Hiremath 
> Signed-off-by: Sanjeev Premi 
> Signed-off-by: Ajay Kumar Gupta 
> ---
> Created against denx's u-boot master branch.
>  board/ti/evm/evm.c |   29 +
>  board/ti/evm/evm.h |   14 ++
>  2 files changed, 43 insertions(+), 0 deletions(-)
> 
> diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
> index 0718a08..6eacc00 100644
> --- a/board/ti/evm/evm.c
> +++ b/board/ti/evm/evm.c
> @@ -37,6 +37,33 @@
>  #include 
>  #include "evm.h"
> 
> +static u8 omap3_evm_version;
> +
> +u8 get_omap3_evm_rev(void)
> +{
> + return omap3_evm_version;
> +}
> +
> +static void omap3_evm_get_revision(void)
> +{
> + unsigned int smsc_id;
> +
> + /* Ethernet PHY ID is stored at ID_REV register */
> + smsc_id = readl(CONFIG_SMC911X_BASE + 0x50) & 0x;
> + printf("Read back SMSC id 0x%x\n", smsc_id);
> +
> + switch (smsc_id) {
> + /* SMSC9115 chipset */
> + case 0x0115:
> + omap3_evm_version = OMAP3EVM_BOARD_GEN_1;
> + break;
> + /* SMSC 9220 chipset */
> + case 0x9220:
> + default:
> + omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
> +   }
> +}
> +
>  /*
>   * Routine: board_init
>   * Description: Early hardware init.
> @@ -45,6 +72,8 @@ int board_init(void)
>  {
>   DECLARE_GLOBAL_DATA_PTR;
> 
> + omap3_evm_get_revision();
> +
>   gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
>   /* board id for Linux */
>   gd->bd->bi_arch_number = MACH_TYPE_OMAP3EVM;
> diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h
> index 37da29d..e2581f6 100644
> --- a/board/ti/evm/evm.h
> +++ b/board/ti/evm/evm.h
> @@ -33,6 +33,20 @@ const omap3_sysinfo sysinfo = {
>  #endif
>  };
> 
> +/*
> + * OMAP35x EVM revision
> + * Run time detection of EVM revision is done by reading Ethernet
> + * PHY ID -
> + *  GEN_1   = 0x0115
> + *  GEN_2   = 0x9220
> + */
> +enum {
> + OMAP3EVM_BOARD_GEN_1 = 0,   /* EVM Rev between  A - D */
> + OMAP3EVM_BOARD_GEN_2,   /* EVM Rev >= Rev E */
> +};
> +
> +u8 get_omap3_evm_rev(void);
> +
>  static void setup_net_chip(void);
> 
>  /*
> --
> 1.6.2.4



0001-omap3evm-Add-board-revision-function.patch
Description: 0001-omap3evm-Add-board-revision-function.patch
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Invitation to connect on LinkedIn

2009-11-13 Thread praveen garaga
LinkedIn




   
I'd like to add you to my professional network on LinkedIn.

- praveen

Confirm that you know praveen garaga
https://www.linkedin.com/e/isd/859852854/kHjqICy1/

Every day, millions of professionals like praveen garaga use LinkedIn to 
connect with colleagues, find experts, and explore opportunities.



 
--
(c) 2009, LinkedIn Corporation

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


[U-Boot] [PATCH] omap3evm: Add board revision function

2009-11-13 Thread Ajay Kumar Gupta
Hi Vaibhav/Sanjeev,

Please review this which I plan to submit today.

It almost same as submited on lo.

Regards,
Ajay

Added function to differentiate between the OMAP3EVM revisions. The
chip-id of the ethernet PHY is being used for this purpose.

Rev A to D : 0x0115
Rev >= E   : 0x9220

Signed-off-by: Vaibhav Hiremath 
Signed-off-by: Sanjeev Premi 
Signed-off-by: Ajay Kumar Gupta 
---
Created against denx's u-boot master branch.
 board/ti/evm/evm.c |   29 +
 board/ti/evm/evm.h |   14 ++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 0718a08..6eacc00 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -37,6 +37,33 @@
 #include 
 #include "evm.h"
 
+static u8 omap3_evm_version;
+
+u8 get_omap3_evm_rev(void)
+{
+   return omap3_evm_version;
+}
+
+static void omap3_evm_get_revision(void)
+{
+   unsigned int smsc_id;
+
+   /* Ethernet PHY ID is stored at ID_REV register */
+   smsc_id = readl(CONFIG_SMC911X_BASE + 0x50) & 0x;
+   printf("Read back SMSC id 0x%x\n", smsc_id);
+
+   switch (smsc_id) {
+   /* SMSC9115 chipset */
+   case 0x0115:
+   omap3_evm_version = OMAP3EVM_BOARD_GEN_1;
+   break;
+   /* SMSC 9220 chipset */
+   case 0x9220:
+   default:
+   omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
+   }
+}
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -45,6 +72,8 @@ int board_init(void)
 {
DECLARE_GLOBAL_DATA_PTR;
 
+   omap3_evm_get_revision();
+
gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
/* board id for Linux */
gd->bd->bi_arch_number = MACH_TYPE_OMAP3EVM;
diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h
index 37da29d..e2581f6 100644
--- a/board/ti/evm/evm.h
+++ b/board/ti/evm/evm.h
@@ -33,6 +33,20 @@ const omap3_sysinfo sysinfo = {
 #endif
 };
 
+/*
+ * OMAP35x EVM revision
+ * Run time detection of EVM revision is done by reading Ethernet
+ * PHY ID -
+ *  GEN_1   = 0x0115
+ *  GEN_2   = 0x9220
+ */
+enum {
+   OMAP3EVM_BOARD_GEN_1 = 0,   /* EVM Rev between  A - D */
+   OMAP3EVM_BOARD_GEN_2,   /* EVM Rev >= Rev E */
+};
+
+u8 get_omap3_evm_rev(void);
+
 static void setup_net_chip(void);
 
 /*
-- 
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] fsl-ddr: Fix power-down and ODT timing settings

2009-11-13 Thread Liu Dave-R63238
> 1. TIMING_CFG_0[ACT_PD_EXIT] was set to 6 clocks, but
>It should be set to tXP parameter, tXP=max(3CK, 7.5ns)
> 2. TIMING_CFG_0[PRE_PD_EXIT] was set to 6 clocks, but
>It should be set to tXP (if MR0[A12]=1) else to tXPDLL parameter
>We are setting the mode register MR0[A12]='1'
> 3. TIMING_CFG_5[RODT_ON] should be set to WL-2
> 4. TIMING_CFG_5[RODT_OFF] should be set to WL-1
> 5. TIMING_CFG_5[WODT_ON] should be set to WL-2
> 6. TIMING_CFG_5[WODT_OFF] should be set to WL-1
> 
> ps: WL=TIMING_CFG_2[WR_LAT]
> 
> The original work was finished by Mazyar Razzaz and Travis Wheatley.
> 
> Signed-off-by: Dave Liu 
> Signed-off-by: Travis Wheatley 

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


[U-Boot] [PATCH] fsl-ddr: Fix power-down and ODT timing settings

2009-11-13 Thread Dave Liu
1. TIMING_CFG_0[ACT_PD_EXIT] was set to 6 clocks, but
   It should be set to tXP parameter, tXP=max(3CK, 7.5ns)
2. TIMING_CFG_0[PRE_PD_EXIT] was set to 6 clocks, but
   It should be set to tXP (if MR0[A12]=1) else to tXPDLL parameter
   We are setting the mode register MR0[A12]='1'
3. TIMING_CFG_5[RODT_ON] should be set to WL-2
4. TIMING_CFG_5[RODT_OFF] should be set to WL-1
5. TIMING_CFG_5[WODT_ON] should be set to WL-2
6. TIMING_CFG_5[WODT_OFF] should be set to WL-1

ps: WL=TIMING_CFG_2[WR_LAT]

The original work was finished by Mazyar Razzaz and Travis Wheatley.

Signed-off-by: Dave Liu 
Signed-off-by: Travis Wheatley 
---
 cpu/mpc8xxx/ddr/ctrl_regs.c |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/cpu/mpc8xxx/ddr/ctrl_regs.c b/cpu/mpc8xxx/ddr/ctrl_regs.c
index 2505041..2736006 100644
--- a/cpu/mpc8xxx/ddr/ctrl_regs.c
+++ b/cpu/mpc8xxx/ddr/ctrl_regs.c
@@ -188,12 +188,13 @@ static void set_timing_cfg_0(fsl_ddr_cfg_regs_t *ddr)
 * The DDR3 spec has not tXARD,
 * we use the tXP instead of it.
 * tXP=max(3nCK, 7.5ns) for DDR3.
-* we use the tXP=6
 * spec has not the tAXPD, we use
 * tAXPD=8, need design to confirm.
 */
-   act_pd_exit_mclk = 6;
-   pre_pd_exit_mclk = 6;
+   int tXP = max((get_memory_clk_period_ps() * 3), 7500); /* unit=ps */
+   act_pd_exit_mclk = picos_to_mclk(tXP);
+   /* Mode register MR0[A12] is '1' - fast exit */
+   pre_pd_exit_mclk = act_pd_exit_mclk;
taxpd_mclk = 8;
tmrd_mclk = 4;
 #else /* CONFIG_FSL_DDR2 */
@@ -962,10 +963,12 @@ static void set_timing_cfg_5(fsl_ddr_cfg_regs_t *ddr)
unsigned int wodt_off = 0;  /* Write to ODT off */
 
 #if defined(CONFIG_FSL_DDR3)
-   rodt_on = 3;/*  2 clocks */
-   rodt_off = 4;   /*  4 clocks */
-   wodt_on = 2;/*  1 clocks */
-   wodt_off = 4;   /*  4 clocks */
+   int wl = compute_cas_write_latency();
+
+   rodt_on = wl - 2;
+   rodt_off = wl - 1;
+   wodt_on = wl - 2;
+   wodt_off = wl - 1;
 #endif
 
ddr->timing_cfg_5 = (0
-- 
1.6.4

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


Re: [U-Boot] [PATCH ARM] Add a unified s3c24x0 header file

2009-11-13 Thread kevin.morf...@fearnside-systems.co.uk


Minkyu Kang wrote:
> Dear Kevin Morifitt,
> 
> 2009/11/13 kevin.morf...@fearnside-systems.co.uk
> :
>> Hi Minky
>>
>>
>> Minkyu Kang wrote:
>>> Dear Kevin Morfitt
>>>
>>> 2009/11/10 kevin.morf...@fearnside-systems.co.uk
>>> :
 This patch adds a unified s3c24x0 cpu header file that selects the header
 file for the specific s3c24x0 cpu from the SOC and CPU configs defined in
 board config file. This removes the current chain of s3c24-type #ifdef's
 from the s3c24x0 code.

 Signed-off-by: Kevin Morfitt 



  #include 
  #include 
 -#include 
 +#include 
  #include 
>>> patch failed at s3c2410_nand.c
>>>
>>> patching file drivers/mtd/nand/s3c2410_nand.c
>>> Hunk #1 FAILED at 26.
>>> 1 out of 1 hunk FAILED -- saving rejects to file
>>> drivers/mtd/nand/s3c2410_nand.c.rej
>>>
>>> please check it
>> This patch assumes that my previous patch,
>> [U-Boot] [PATCH ARM] Update the s3c2410 nand driver from linux-2.6.31.5 had
>> already been applied.
>>
>> Would you like me to re-base this one to the current u-boot-samsung, or wait
>> until you've looked at [U-Boot] [PATCH ARM] Update the s3c2410 nand driver
>> from linux-2.6.31.5?
> 
> applied where?
> I couldn't find :(

It's not been accepted yet, I submitted it on 5th November, see 
http://lists.denx.de/pipermail/u-boot/2009-November/063866.html.

> 
>> Kevin
>>
  #if defined(CONFIG_S3C2410_NAND_HWECC) && 
 defined(CONFIG_SYS_NAND_LARGEPAGE)
 diff --git a/drivers/rtc/s3c24x0_rtc.c b/drivers/rtc/s3c24x0_rtc.c
 index 2d78f93..04de5ca 100644
 --- a/drivers/rtc/s3c24x0_rtc.c
 +++ b/drivers/rtc/s3c24x0_rtc.c
 @@ -30,11 +30,7 @@

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


Re: [U-Boot] [PATCH] S3C6400/SMDK6400: fix stack_setup in start.S

2009-11-13 Thread Minkyu Kang
Dear Seunghyeon Rhee,

2009/11/13 이승현 :
> Fix stack_setup to place the stack on the correct address in DRAM
> accroding to U-Boot standard and remove conditional compilation by
> CONFIG_MEMORY_UPPER_CODE macro that is not necessry. This macro
> was introduced and used only by this board for some unclear reason.
>
> The definition of this macro is also removed because it's not
> referenced elsewhere.
>
> Signed-off-by: Seunghyeon Rhee 
> ---
>  cpu/arm1176/start.S        |    7 +--
>  include/configs/smdk6400.h |    2 --
>  2 files changed, 1 insertions(+), 8 deletions(-)
>
> diff --git a/cpu/arm1176/start.S b/cpu/arm1176/start.S
> index cb891df..1ecb3b9 100644
> --- a/cpu/arm1176/start.S
> +++ b/cpu/arm1176/start.S
> @@ -241,16 +241,11 @@ mmu_enable:
>  skip_hw_init:
>        /* Set up the stack                                                 */
>  stack_setup:
> -#ifdef CONFIG_MEMORY_UPPER_CODE
> -       ldr     sp, =(CONFIG_SYS_UBOOT_BASE + CONFIG_SYS_UBOOT_SIZE - 0xc)
> -#else
> -       ldr     r0, _TEXT_BASE          /* upper 128 KiB: relocated uboot   */
> +       ldr     r0, =CONFIG_SYS_UBOOT_BASE      /* base of copy in DRAM     */
>        sub     r0, r0, #CONFIG_SYS_MALLOC_LEN  /* malloc area                 
>      */
>        sub     r0, r0, #CONFIG_SYS_GBL_DATA_SIZE /* bdinfo                    
>     */
>        sub     sp, r0, #12             /* leave 3 words for abort-stack    */
>
> -#endif
> -
>  clear_bss:
>        ldr     r0, _bss_start          /* find start of bss segment        */
>        ldr     r1, _bss_end            /* stop here                        */
> diff --git a/include/configs/smdk6400.h b/include/configs/smdk6400.h
> index f6e1221..f644cd2 100644
> --- a/include/configs/smdk6400.h
> +++ b/include/configs/smdk6400.h
> @@ -49,8 +49,6 @@
>  #define CONFIG_ENABLE_MMU
>  #endif
>
> -#define CONFIG_MEMORY_UPPER_CODE
> -
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_CMDLINE_TAG
>  #define CONFIG_INITRD_TAG
> --
> 1.6.2.5
>

applied to u-boot-samsung

At next time,
if you resend the patch, please send next version patch.

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 ARM] Add a unified s3c24x0 header file

2009-11-13 Thread Minkyu Kang
Dear Kevin Morifitt,

2009/11/13 kevin.morf...@fearnside-systems.co.uk
:
> Hi Minky
>
>
> Minkyu Kang wrote:
>> Dear Kevin Morfitt
>>
>> 2009/11/10 kevin.morf...@fearnside-systems.co.uk
>> :
>>> This patch adds a unified s3c24x0 cpu header file that selects the header
>>> file for the specific s3c24x0 cpu from the SOC and CPU configs defined in
>>> board config file. This removes the current chain of s3c24-type #ifdef's
>>> from the s3c24x0 code.
>>>
>>> Signed-off-by: Kevin Morfitt 
>>> ---
>>>  board/mpl/vcma9/vcma9.c                    |    2 +-
>>>  board/mpl/vcma9/vcma9.h                    |    2 +-
>>>  board/samsung/smdk2400/smdk2400.c          |    2 +-
>>>  board/samsung/smdk2410/smdk2410.c          |    2 +-
>>>  board/sbc2410x/sbc2410x.c                  |    2 +-
>>>  board/trab/cmd_trab.c                      |    2 +-
>>>  board/trab/rs485.c                         |    2 +-
>>>  board/trab/rs485.h                         |    2 +-
>>>  board/trab/trab.c                          |    2 +-
>>>  board/trab/trab_fkt.c                      |    2 +-
>>>  board/trab/tsc2000.c                       |    2 +-
>>>  board/trab/vfd.c                           |    2 +-
>>>  cpu/arm920t/s3c24x0/interrupts.c           |    6 +-
>>>  cpu/arm920t/s3c24x0/speed.c                |   13 +++--
>>>  cpu/arm920t/s3c24x0/timer.c                |   15 +++
>>>  cpu/arm920t/s3c24x0/usb.c                  |   17 +++--
>>>  cpu/arm920t/s3c24x0/usb_ohci.c             |   11 +++
>>>  cpu/arm920t/start.S                        |    4 ++--
>>>  drivers/i2c/s3c24x0_i2c.c                  |    6 +-
>>>  drivers/mtd/nand/s3c2410_nand.c            |    2 +-
>>>  drivers/rtc/s3c24x0_rtc.c                  |    6 +-
>>>  drivers/serial/serial_s3c24x0.c            |    6 +-
>>>  drivers/usb/host/ohci-hcd.c                |    3 +--
>>>  include/asm-arm/arch-s3c24x0/s3c24x0_cpu.h |   27 
>>> +++
>>>  include/common.h                           |    5 +++--
>>>  include/configs/VCMA9.h                    |    7 ---
>>>  include/configs/sbc2410x.h                 |    7 ---
>>>  include/configs/smdk2400.h                 |    7 ---
>>>  include/configs/smdk2410.h                 |    7 ---
>>>  include/configs/trab.h                     |    9 +
>>>  30 files changed, 87 insertions(+), 95 deletions(-)
>>>  create mode 100644 include/asm-arm/arch-s3c24x0/s3c24x0_cpu.h
>>>
>>> diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c
>>> index f3bd288..1835677 100644
>>> --- a/board/mpl/vcma9/vcma9.c
>>> +++ b/board/mpl/vcma9/vcma9.c
>>> @@ -27,7 +27,7 @@
>>>
>>>  #include 
>>>  #include 
>>> -#include 
>>> +#include 
>>>  #include 
>>>  #include 
>>>
>>> diff --git a/board/mpl/vcma9/vcma9.h b/board/mpl/vcma9/vcma9.h
>>> index 2c4305c..94fd2fa 100644
>>> --- a/board/mpl/vcma9/vcma9.h
>>> +++ b/board/mpl/vcma9/vcma9.h
>>> @@ -25,7 +25,7 @@
>>>  * Global routines used for VCMA9
>>>  */
>>>
>>> -#include 
>>> +#include 
>>>
>>>  extern int  mem_test(unsigned long start, unsigned long ramsize,int mode);
>>>
>>> diff --git a/board/samsung/smdk2400/smdk2400.c 
>>> b/board/samsung/smdk2400/smdk2400.c
>>> index be0c70a..1294d3f 100644
>>> --- a/board/samsung/smdk2400/smdk2400.c
>>> +++ b/board/samsung/smdk2400/smdk2400.c
>>> @@ -27,7 +27,7 @@
>>>
>>>  #include 
>>>  #include 
>>> -#include 
>>> +#include 
>>>
>>>  DECLARE_GLOBAL_DATA_PTR;
>>>
>>> diff --git a/board/samsung/smdk2410/smdk2410.c 
>>> b/board/samsung/smdk2410/smdk2410.c
>>> index a8cf287..5d1a8bb 100644
>>> --- a/board/samsung/smdk2410/smdk2410.c
>>> +++ b/board/samsung/smdk2410/smdk2410.c
>>> @@ -27,7 +27,7 @@
>>>
>>>  #include 
>>>  #include 
>>> -#include 
>>> +#include 
>>>
>>>  DECLARE_GLOBAL_DATA_PTR;
>>>
>>> diff --git a/board/sbc2410x/sbc2410x.c b/board/sbc2410x/sbc2410x.c
>>> index 6768c02..3a93677 100644
>>> --- a/board/sbc2410x/sbc2410x.c
>>> +++ b/board/sbc2410x/sbc2410x.c
>>> @@ -30,7 +30,7 @@
>>>
>>>  #include 
>>>  #include 
>>> -#include 
>>> +#include 
>>>
>>>  #if defined(CONFIG_CMD_NAND)
>>>  #include 
>>> diff --git a/board/trab/cmd_trab.c b/board/trab/cmd_trab.c
>>> index a01ffcc..472d7d8 100644
>>> --- a/board/trab/cmd_trab.c
>>> +++ b/board/trab/cmd_trab.c
>>> @@ -25,7 +25,7 @@
>>>
>>>  #include 
>>>  #include 
>>> -#include 
>>> +#include 
>>>  #include 
>>>
>>>  /*
>>> diff --git a/board/trab/rs485.c b/board/trab/rs485.c
>>> index f402c59..ad0c136 100644
>>> --- a/board/trab/rs485.c
>>> +++ b/board/trab/rs485.c
>>> @@ -22,7 +22,7 @@
>>>  */
>>>
>>>  #include 
>>> -#include 
>>> +#include 
>>>  #include "rs485.h"
>>>
>>>  static void rs485_setbrg (void);
>>> diff --git a/board/trab/rs485.h b/board/trab/rs485.h
>>> index 4a2d83f..16d69bb 100644
>>> --- a/board/trab/rs485.h
>>> +++ b/board/trab/rs485.h
>>> @@ -24,7 +24,7 @@
>>>  #ifndef _RS485_H_
>>>  #define _RS485_H_
>>>
>>

Re: [U-Boot] [PATCH ARM] Add a unified s3c24x0 header file

2009-11-13 Thread kevin.morf...@fearnside-systems.co.uk
Hi Minky


Minkyu Kang wrote:
> Dear Kevin Morfitt
> 
> 2009/11/10 kevin.morf...@fearnside-systems.co.uk
> :
>> This patch adds a unified s3c24x0 cpu header file that selects the header
>> file for the specific s3c24x0 cpu from the SOC and CPU configs defined in
>> board config file. This removes the current chain of s3c24-type #ifdef's
>> from the s3c24x0 code.
>>
>> Signed-off-by: Kevin Morfitt 
>> ---
>>  board/mpl/vcma9/vcma9.c|2 +-
>>  board/mpl/vcma9/vcma9.h|2 +-
>>  board/samsung/smdk2400/smdk2400.c  |2 +-
>>  board/samsung/smdk2410/smdk2410.c  |2 +-
>>  board/sbc2410x/sbc2410x.c  |2 +-
>>  board/trab/cmd_trab.c  |2 +-
>>  board/trab/rs485.c |2 +-
>>  board/trab/rs485.h |2 +-
>>  board/trab/trab.c  |2 +-
>>  board/trab/trab_fkt.c  |2 +-
>>  board/trab/tsc2000.c   |2 +-
>>  board/trab/vfd.c   |2 +-
>>  cpu/arm920t/s3c24x0/interrupts.c   |6 +-
>>  cpu/arm920t/s3c24x0/speed.c|   13 +++--
>>  cpu/arm920t/s3c24x0/timer.c|   15 +++
>>  cpu/arm920t/s3c24x0/usb.c  |   17 +++--
>>  cpu/arm920t/s3c24x0/usb_ohci.c |   11 +++
>>  cpu/arm920t/start.S|4 ++--
>>  drivers/i2c/s3c24x0_i2c.c  |6 +-
>>  drivers/mtd/nand/s3c2410_nand.c|2 +-
>>  drivers/rtc/s3c24x0_rtc.c  |6 +-
>>  drivers/serial/serial_s3c24x0.c|6 +-
>>  drivers/usb/host/ohci-hcd.c|3 +--
>>  include/asm-arm/arch-s3c24x0/s3c24x0_cpu.h |   27 
>> +++
>>  include/common.h   |5 +++--
>>  include/configs/VCMA9.h|7 ---
>>  include/configs/sbc2410x.h |7 ---
>>  include/configs/smdk2400.h |7 ---
>>  include/configs/smdk2410.h |7 ---
>>  include/configs/trab.h |9 +
>>  30 files changed, 87 insertions(+), 95 deletions(-)
>>  create mode 100644 include/asm-arm/arch-s3c24x0/s3c24x0_cpu.h
>>
>> diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c
>> index f3bd288..1835677 100644
>> --- a/board/mpl/vcma9/vcma9.c
>> +++ b/board/mpl/vcma9/vcma9.c
>> @@ -27,7 +27,7 @@
>>
>>  #include 
>>  #include 
>> -#include 
>> +#include 
>>  #include 
>>  #include 
>>
>> diff --git a/board/mpl/vcma9/vcma9.h b/board/mpl/vcma9/vcma9.h
>> index 2c4305c..94fd2fa 100644
>> --- a/board/mpl/vcma9/vcma9.h
>> +++ b/board/mpl/vcma9/vcma9.h
>> @@ -25,7 +25,7 @@
>>  * Global routines used for VCMA9
>>  
>> */
>>
>> -#include 
>> +#include 
>>
>>  extern int  mem_test(unsigned long start, unsigned long ramsize,int mode);
>>
>> diff --git a/board/samsung/smdk2400/smdk2400.c 
>> b/board/samsung/smdk2400/smdk2400.c
>> index be0c70a..1294d3f 100644
>> --- a/board/samsung/smdk2400/smdk2400.c
>> +++ b/board/samsung/smdk2400/smdk2400.c
>> @@ -27,7 +27,7 @@
>>
>>  #include 
>>  #include 
>> -#include 
>> +#include 
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> diff --git a/board/samsung/smdk2410/smdk2410.c 
>> b/board/samsung/smdk2410/smdk2410.c
>> index a8cf287..5d1a8bb 100644
>> --- a/board/samsung/smdk2410/smdk2410.c
>> +++ b/board/samsung/smdk2410/smdk2410.c
>> @@ -27,7 +27,7 @@
>>
>>  #include 
>>  #include 
>> -#include 
>> +#include 
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> diff --git a/board/sbc2410x/sbc2410x.c b/board/sbc2410x/sbc2410x.c
>> index 6768c02..3a93677 100644
>> --- a/board/sbc2410x/sbc2410x.c
>> +++ b/board/sbc2410x/sbc2410x.c
>> @@ -30,7 +30,7 @@
>>
>>  #include 
>>  #include 
>> -#include 
>> +#include 
>>
>>  #if defined(CONFIG_CMD_NAND)
>>  #include 
>> diff --git a/board/trab/cmd_trab.c b/board/trab/cmd_trab.c
>> index a01ffcc..472d7d8 100644
>> --- a/board/trab/cmd_trab.c
>> +++ b/board/trab/cmd_trab.c
>> @@ -25,7 +25,7 @@
>>
>>  #include 
>>  #include 
>> -#include 
>> +#include 
>>  #include 
>>
>>  /*
>> diff --git a/board/trab/rs485.c b/board/trab/rs485.c
>> index f402c59..ad0c136 100644
>> --- a/board/trab/rs485.c
>> +++ b/board/trab/rs485.c
>> @@ -22,7 +22,7 @@
>>  */
>>
>>  #include 
>> -#include 
>> +#include 
>>  #include "rs485.h"
>>
>>  static void rs485_setbrg (void);
>> diff --git a/board/trab/rs485.h b/board/trab/rs485.h
>> index 4a2d83f..16d69bb 100644
>> --- a/board/trab/rs485.h
>> +++ b/board/trab/rs485.h
>> @@ -24,7 +24,7 @@
>>  #ifndef _RS485_H_
>>  #define _RS485_H_
>>
>> -#include 
>> +#include 
>>
>>  int rs485_init (void);
>>  int rs485_getc (void);
>> diff --git a/board/trab/trab.c b/board/trab/trab.c
>> index f8836ff..71fd22c 100644
>> --- a/board/trab/trab.c
>> +++ b/board/trab/tra

[U-Boot] [PATCH v2] crc32: Impl. linux optimized crc32()

2009-11-13 Thread Joakim Tjernlund
Ported over the more efficient linux crc32() function.
A quick comparsion on ppc:
After changing the old crc32 to do 4 bytes in the
inner loop to be able to compare with new version one can note:
- old inner loop has 61 insn, new has 19 insn.
- new crc32 does one 32 bit load of data to crc while
  the old does four 8 bits loads.
- size is bit bigger for the new crc32:
  1392(old) 1416(new) of text. The is because the new version
  shares code with crc32_no_comp() instead of duplicating code.
- about 33% faster on ppc:
  New > crc 0 0xfff -> 39 secs
  Old > crc 0 0xfff -> 60 secs

Signed-off-by: Joakim Tjernlund 
---

 Resending a new patch with all the improvents included.
 Forget the previous versions.

 lib_generic/crc32.c |  196 +--
 1 files changed, 111 insertions(+), 85 deletions(-)

diff --git a/lib_generic/crc32.c b/lib_generic/crc32.c
index b27048c..770ea38 100644
--- a/lib_generic/crc32.c
+++ b/lib_generic/crc32.c
@@ -13,6 +13,8 @@
 #else
 #include 
 #endif
+#include 
+#include 
 
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
 #include 
@@ -52,6 +54,7 @@ local void make_crc_table OF((void));
   the information needed to generate CRC's on data a byte at a time for all
   combinations of CRC register values and incoming bytes.
 */
+#define tole(x) __cpu_to_le32(x)
 local void make_crc_table()
 {
   uint32_t c;
@@ -70,7 +73,7 @@ local void make_crc_table()
 c = (uLong)n;
 for (k = 0; k < 8; k++)
   c = c & 1 ? poly ^ (c >> 1) : c >> 1;
-crc_table[n] = c;
+crc_table[n] = tole(c);
   }
   crc_table_empty = 0;
 }
@@ -78,59 +81,73 @@ local void make_crc_table()
 /* 
  * Table of CRC-32's of all single-byte values (made by make_crc_table)
  */
+#define tole(x) __constant_cpu_to_le32(x)
+
 local const uint32_t crc_table[256] = {
-  0xL, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
-  0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
-  0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
-  0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
-  0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
-  0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
-  0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
-  0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
-  0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
-  0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
-  0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
-  0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
-  0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
-  0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
-  0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
-  0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
-  0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
-  0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
-  0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
-  0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
-  0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
-  0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
-  0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
-  0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
-  0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
-  0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
-  0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
-  0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
-  0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
-  0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
-  0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
-  0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
-  0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
-  0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
-  0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
-  0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
-  0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
-  0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
-  0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
-  0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
-  0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
-  0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
-  0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
-  0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
-  0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
-  0xd70dd2eeL, 0

Re: [U-Boot] [PATCH] usb: write command for RAW partition.

2009-11-13 Thread Mahavir Jain
Hi,

Any feedback or comments on this...?

Thanks
Mahavir


On Mon, 2009-11-02 at 22:52 -0800, Mahavir Jain wrote:
> This patch implements write support to usb device with raw partition.
> It will be useful for filesystem write support to usb device from
> u-boot in future.
> 
> Tested with writing kernel image to raw usb disk & booting with usb
> read command into ram.
> 
> [Note:  run usb part to get info about start sector & number of
> sectors on a partition for usb write operation.]
> 
> Signed-off-by: Mahavir Jain 
> ---
>  common/cmd_usb.c |   24 
>  common/usb_storage.c |   99 
> ++
>  2 files changed, 123 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_usb.c b/common/cmd_usb.c
> index 7b8ee6b..1acb6fc 100644
> --- a/common/cmd_usb.c
> +++ b/common/cmd_usb.c
> @@ -642,6 +642,28 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char 
> *argv[])
>   return 1;
>   }
>   }
> + if (strcmp(argv[1], "write") == 0) {
> + if (usb_stor_curr_dev < 0) {
> + printf("no current device selected\n");
> + return 1;
> + }
> + if (argc == 5) {
> + unsigned long addr = simple_strtoul(argv[2], NULL, 16);
> + unsigned long blk  = simple_strtoul(argv[3], NULL, 16);
> + unsigned long cnt  = simple_strtoul(argv[4], NULL, 16);
> + unsigned long n;
> + printf("\nUSB write: device %d block # %ld, count %ld"
> + " ... ", usb_stor_curr_dev, blk, cnt);
> + stor_dev = usb_stor_get_dev(usb_stor_curr_dev);
> + n = stor_dev->block_write(usb_stor_curr_dev, blk, cnt,
> + (ulong *)addr);
> + printf("%ld blocks write: %s\n", n,
> + (n == cnt) ? "OK" : "ERROR");
> + if (n == cnt)
> + return 0;
> + return 1;
> + }
> + }
>   if (strncmp(argv[1], "dev", 3) == 0) {
>   if (argc == 3) {
>   int dev = (int)simple_strtoul(argv[2], NULL, 10);
> @@ -687,6 +709,8 @@ U_BOOT_CMD(
>   " devices\n"
>   "usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
>   "to memory address `addr'"
> + "usb write addr blk# cnt - write `cnt' blocks starting at block 
> `blk#'\n"
> + "from memory address `addr'"
>  );
>  
> 
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index 19613f2..ed5b3f3 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -168,6 +168,8 @@ int usb_storage_probe(struct usb_device *dev, unsigned 
> int ifnum,
> struct us_data *ss);
>  unsigned long usb_stor_read(int device, unsigned long blknr,
>   unsigned long blkcnt, void *buffer);
> +unsigned long usb_stor_write(int device, unsigned long blknr,
> +  unsigned long blkcnt, const void *buffer);
>  struct usb_device * usb_get_dev_index(int index);
>  void uhci_show_temp_int_td(void);
>  
> @@ -227,6 +229,7 @@ int usb_stor_scan(int mode)
>   usb_dev_desc[i].dev = i;
>   usb_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
>   usb_dev_desc[i].block_read = usb_stor_read;
> + usb_dev_desc[i].block_write = usb_stor_write;
>   }
>  
>   usb_max_devs = 0;
> @@ -964,6 +967,22 @@ static int usb_read_10(ccb *srb, struct us_data *ss, 
> unsigned long start,
>   return ss->transport(srb, ss);
>  }
>  
> +static int usb_write_10(ccb *srb, struct us_data *ss, unsigned long start,
> + unsigned short blocks)
> +{
> + memset(&srb->cmd[0], 0, 12);
> + srb->cmd[0] = SCSI_WRITE10;
> + srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff;
> + srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff;
> + srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff;
> + srb->cmd[5] = ((unsigned char) (start)) & 0xff;
> + srb->cmd[7] = ((unsigned char) (blocks >> 8)) & 0xff;
> + srb->cmd[8] = (unsigned char) blocks & 0xff;
> + srb->cmdlen = 12;
> + USB_STOR_PRINTF("write10: start %lx blocks %x\n", start, blocks);
> + return ss->transport(srb, ss);
> +}
> +
>  
>  #ifdef CONFIG_USB_BIN_FIXUP
>  /*
> @@ -1065,6 +1084,86 @@ retry_it:
>   return blkcnt;
>  }
>  
> +#define USB_MAX_WRITE_BLK 20
> +
> +unsigned long usb_stor_write(int device, unsigned long blknr,
> + unsigned long blkcnt, const void *buffer)
> +{
> + unsigned long start, blks, buf_addr;
> + unsigned short smallblks;
> + struct usb_device *dev;
> + int retry, i;
> + ccb *srb = &usb_ccb;
> +
> + if (blkcnt == 0)
> + return 0;
> +
> + device &= 0xff;
> + /* Setup  device */
> +  

[U-Boot] [PATCH] fix flash_sect_erase() to display correct message

2009-11-13 Thread 이승현
flash_sect_erase() displays message "Erased #N sectors" even when
there are some protected sectors found and command "erase" fail.

Signed-off-by: Seunghyeon Rhee 
---
 common/cmd_flash.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 3773412..b3d982f 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -451,7 +451,10 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
rcode = flash_erase (info, s_first[bank], 
s_last[bank]);
}
}
-   printf ("Erased %d sectors\n", erased);
+   if (rcode == ERR_PROTECTED)
+   printf ("Not erased - protected sector(s) found\n");
+   else
+   printf ("Erased %d sectors\n", erased);
} else if (rcode == 0) {
puts ("Error: start and/or end address"
" not on sector boundary\n");
-- 
1.6.2.5



---
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007  F +82-2-6442-6462
M +82-10-2790-0657
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot