Re: [U-Boot] [STATUS] ARM - many build problems

2012-07-09 Thread Wolfgang Denk
Dear Thierry Reding,

In message <20120709061003.ga10...@avionic-0098.mockup.avionic-design.de> you 
wrote:
> 
> These have been fixed in tegra/master by the following commit:
> 
>   commit 329b71b234fd2dcc60a1369d411e4b55a8117df9
>   Author: Stephen Warren 
>   Date:   Fri Jun 8 12:28:17 2012 +

Thanks for the pointer.  I was aware of that patch, but didn't see the
relation from the subject.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"One day," said a dull voice from down below, "I'm going to  be  back
in  form again and you're going to be very sorry you said that. For a
very long time. I might even go so far as to make even more Time just
for you to be sorry in."  - Terry Pratchett, _Small Gods_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] fdt: send all dtc output to stderr

2012-07-09 Thread Wolfgang Denk
Dear Stephen Warren,

In message <1339194497-24208-1-git-send-email-swar...@wwwdotorg.org> you wrote:
> From: Stephen Warren 
> 
> Commit 896bbb5 "fdt: avoid bad MAKEALL status" added logic to capture
> the result code from dtc by echoing $? to stdout and capturing it using
> $(). However, dtc emits some diagnostics to stderr and some to stdout.
> The diagnostics send to stdout ended up getting captured via $() rather
> than being echo'd to the user. This caused those diagnostics to be passed
> to the exit command, which would then fail with the following cryptic
> error message:
> 
> /bin/sh: line 1: exit: too many arguments
> 
> Solve this by redirecting all dtc output to stderr so that $() does not
> capture it. This allows the user to see the actual error message from dtc.
> 
> Cc: Wolfgang Denk 
> Cc: Simon Glass 
> Cc: albert.u.b...@aribaud.net
> Cc: Tom Warren 
> Signed-off-by: Stephen Warren 
> ---
>  dts/Makefile |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Be wiser than other people if you can, but do not tell them so.
   -- Philip Earl of Chesterfield
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 7/8] arm/davinci: spl - boot device selection

2012-07-09 Thread Mikhail Kshevetskiy
On Mon, 9 Jul 2012 11:39:14 +0530
Prabhakar Lad  wrote:

> Hi Mikhail,
> 
> On Mon, Jul 9, 2012 at 9:01 AM, Mikhail Kshevetskiy
>  wrote:
> > This patch allow us to have a universal spl that detects a boot
> > device and select a corresponding boot algorithm for main u-boot part
> > (SOC_DA8XX only)
> >
> > This patch create copy copy of drivers/mtd/nand/nand_spl_load.c and
> > drivers/mtd/spi/spi_spl_load.c for the following reasons:
> >  * avoid jump to main u-boot code just after its loading (required
> >for the next patch: spl - add compressed u-boot image support)
> >  * makes a structure similar to omap3 sources
> >
> > Signed-off-by: Mikhail Kshevetskiy 
> > ---
> > Change for v2:
> >  * fix checkpatch warnings
> >  * defines for constants
> >  * use readl() to read a BOOTCFG_REG
> >  * improve patch description
> > ---
> >  arch/arm/cpu/arm926ejs/davinci/Makefile  |5 ++
> >  arch/arm/cpu/arm926ejs/davinci/spl.c |   91
> > +++--- arch/arm/cpu/arm926ejs/davinci/spl_mmc.c |
> > 39 ++ arch/arm/cpu/arm926ejs/davinci/spl_nand.c|   11 +++
> >  arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c   |   25 ++
> >  arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c  |   42 ++
> >  arch/arm/include/asm/arch-davinci/davinci_boot.h |   50 
> >  include/configs/cam_enc_4xx.h|   12 +--
> >  include/configs/da850evm.h   |   19 +++--
> >  include/configs/hawkboard.h  |   11 +--
> >  10 files changed, 275 insertions(+), 30 deletions(-)
> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_mmc.c
> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c
> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c
> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c
> >  create mode 100644 arch/arm/include/asm/arch-davinci/davinci_boot.h
> >
> > diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile
> > b/arch/arm/cpu/arm926ejs/davinci/Makefile index da7efac..12bd37a 100644
> > --- a/arch/arm/cpu/arm926ejs/davinci/Makefile
> > +++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
> > @@ -40,6 +40,11 @@ ifdef CONFIG_SPL_BUILD
> >  COBJS-y+= spl.o
> >  COBJS-$(CONFIG_SOC_DM365)  += dm365_lowlevel.o
> >  COBJS-$(CONFIG_SOC_DA8XX)  += da850_lowlevel.o
> > +
> > +COBJS-$(CONFIG_SPL_NAND_SUPPORT)   += spl_nand.o
> > +COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT)  += spl_spi_flash.o
> > +COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
> > +COBJS-$(CONFIG_SPL_MMC_SUPPORT)+= spl_mmc.o
> >  endif
> >
> >  SOBJS  = reset.o
> > diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c
> > b/arch/arm/cpu/arm926ejs/davinci/spl.c index 74632e5..50b4bbc 100644
> > --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> > +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> > @@ -25,9 +25,11 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >
> >  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >
> > @@ -72,25 +74,92 @@ void board_init_f(ulong dummy)
> > relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
> >  }
> >
> > +u32 davinci_boot_device(void){
> > +#ifdef CONFIG_SOC_DA8XX
> > +   u32 bootmode = readl(BOOTCFG_REG) & BOOTCFG_REG_DEVICE_MASK;
> > +   switch (bootmode) {
> > +   case BOOTCFG_DEVICE_NAND8:
> > +   case BOOTCFG_DEVICE_NAND16:
> > +   return BOOT_DEVICE_TYPE_NAND;
> > +   case BOOTCFG_DEVICE_SPI0_FLASH:
> > +   case BOOTCFG_DEVICE_SPI1_FLASH:
> > +   return BOOT_DEVICE_TYPE_SPI_FLASH;
> > +   case BOOTCFG_DEVICE_UART0:
> > +   case BOOTCFG_DEVICE_UART1:
> > +   case BOOTCFG_DEVICE_UART2:
> > +   return BOOT_DEVICE_TYPE_UART;
> > +   case BOOTCFG_DEVICE_MMC_OR_SD0:
> > +   return BOOT_DEVICE_TYPE_MMC;
> > +   default:
> > +   return BOOT_DEVICE_TYPE_NONE;
> > +   }
> > +#else
> > +#ifdef
> > +#endif CONFIG_SPL_NAND_SUPPORT
> > +   return BOOT_DEVICE_TYPE_NAND;
> > +#endif
> > +#ifdef BOOT_DEVICE_SPI_FLASH
> > +   return BOOT_DEVICE_TYPE_SPI_FLASH;
> > +#endif
> > +#ifdef CONFIG_SPL_YMODEM_SUPPORT
> > +   return BOOT_DEVICE_TYPE_UART;
> > +#endif
> > +#ifdef CONFIG_SPL_MMC_SUPPORT
> > +   return BOOT_DEVICE_TYPE_MMC;
> > +#endif
> > +}
> > +
> >  void board_init_r(gd_t *id, ulong dummy)
> >  {
> > -#ifdef CONFIG_SPL_NAND_LOAD
> > -   nand_init();
> > -   puts("Nand boot...\n");
> > -   nand_boot();
> > -#endif
> > -#ifdef CONFIG_SPL_SPI_LOAD
> > -   mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
> > -   CONFIG_SYS_MALLOC_LEN);
> > +   u32 boot_device;
> > +   void (*uboot)(void) __noreturn;
> > +
> > +   mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
> > +   CONFIG_SYS_SPL_MALLOC_SIZE);
> >
> > gd = &gdata;
> > gd->bd = &bdata;
> > gd->fla

Re: [U-Boot] [PATCH 1/1] igep0020: set OMAP MUX mcspi1_cs2 pin to GPIO 176 mode

2012-07-09 Thread Enric Balletbò i Serra
Hi Javier,

2012/7/3 Javier Martinez Canillas 

> According to the IGEPv2 Rev.C data-sheet the LAN9221i pin 14 (IRQ) is
> connected to the OMAP3730 mcspi1_cs2 pin. Since this omap mux pin acts
> as an IRQ line, it has to be configured as an input GPIO.
>
> IGEPv2 platform code sets the smsc911x_cfg->gpio_irq to GPIO 176 but
> since the mux pin default mode is MODE7 (safe_mode) the driver fails
> when trying to register the IRQ:
>
> [1.994598] smsc911x: Driver version 2008-10-21
> [3.704162] irq 272: nobody cared (try booting with the "irqpoll"
> option)
> [3.711364] [] (unwind_backtrace+0x0/0xf0) from []
> (__report_bad_irq+0x20/0xbc)
> [3.720916] [] (__report_bad_irq+0x20/0xbc) from []
> (note_interrupt+0x1d8/0x238)
> [3.730560] [] (note_interrupt+0x1d8/0x238) from []
> (handle_irq_event_percpu+0xc0/0x260)
> [3.740936] [] (handle_irq_event_percpu+0xc0/0x260) from
> [] (handle_irq_event+0x3c/0x5c)
> [3.751312] [] (handle_irq_event+0x3c/0x5c) from []
> (handle_level_irq+0xac/0x10c)
> [3.761047] [] (handle_level_irq+0xac/0x10c) from
> [] (generic_handle_irq+0x30/0x48)
> [3.770935] [] (generic_handle_irq+0x30/0x48) from
> [] (gpio_irq_handler+0x180/0x1d4)
> [3.780944] [] (gpio_irq_handler+0x180/0x1d4) from
> [] (generic_handle_irq+0x30/0x48)
> [3.790954] [] (generic_handle_irq+0x30/0x48) from
> [] (handle_IRQ+0x4c/0xac)
> [3.800231] [] (handle_IRQ+0x4c/0xac) from []
> (omap3_intc_handle_irq+0x60/0x74)
> [3.809783] [] (omap3_intc_handle_irq+0x60/0x74) from
> [] (__irq_svc+0x44/0x60)
> [3.819213] Exception stack(0xee42fde0 to 0xee42fe28)
> [3.824554] fde0: 0001 0001   6013 c06cce14
> c06cce14 0110
> [3.833190] fe00:  c06ccdf4 6013 ee41d000 fb058064 ee42fe28
> c0089e08 c04976b4
> [3.841796] fe20: 2013 
> [3.845489] [] (__irq_svc+0x44/0x60) from []
> (_raw_spin_unlock_irqrestore+0x34/0x44)
> [3.855499] [] (_raw_spin_unlock_irqrestore+0x34/0x44) from
> [] (__setup_irq+0x1b8/0x3f0)
> [3.865875] [] (__setup_irq+0x1b8/0x3f0) from []
> (request_threaded_irq+0xb8/0x140)
> [3.875701] [] (request_threaded_irq+0xb8/0x140) from
> [] (smsc911x_drv_probe+0x75c/0x11a4)
> [3.886260] [] (smsc911x_drv_probe+0x75c/0x11a4) from
> [] (platform_drv_probe+0x18/0x1c)
> [3.896545] [] (platform_drv_probe+0x18/0x1c) from
> [] (driver_probe_device+0x90/0x210)
> [3.906707] [] (driver_probe_device+0x90/0x210) from
> [] (__driver_attach+0x94/0x98)
> [3.916625] [] (__driver_attach+0x94/0x98) from []
> (bus_for_each_dev+0x50/0x7c)
> [3.926177] [] (bus_for_each_dev+0x50/0x7c) from []
> (bus_add_driver+0x184/0x248)
> [3.935821] [] (bus_add_driver+0x184/0x248) from []
> (driver_register+0x78/0x12c)
> [3.945465] [] (driver_register+0x78/0x12c) from []
> (do_one_initcall+0x34/0x178)
> [3.955108] [] (do_one_initcall+0x34/0x178) from []
> (kernel_init+0xfc/0x1c0)
> [3.964385] [] (kernel_init+0xfc/0x1c0) from []
> (kernel_thread_exit+0x0/0x8)
> [3.973632] handlers:
> [3.976043] [] smsc911x_irqhandler
> [3.980560] Disabling IRQ #272
>
> Signed-off-by: Javier Martinez Canillas 
> ---
>  board/isee/igep0020/igep0020.h |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/board/isee/igep0020/igep0020.h
> b/board/isee/igep0020/igep0020.h
> index 3d6e15f..eb1aa30 100644
> --- a/board/isee/igep0020/igep0020.h
> +++ b/board/isee/igep0020/igep0020.h
> @@ -143,5 +143,6 @@ static void setup_net_chip(void);
> MUX_VAL(CP(SYS_BOOT5),  (IEN  | PTD | DIS | M4)) /* GPIO_7 */\
> MUX_VAL(CP(SYS_BOOT6),  (IEN  | PTD | DIS | M4)) /* GPIO_8 */\
> MUX_VAL(CP(SDRC_CKE0),  (IDIS | PTU | EN  | M0)) /* SDRC_CKE0
> */\
> -   MUX_VAL(CP(SDRC_CKE1),  (IDIS | PTU | EN  | M0)) /* SDRC_CKE1
> */
> +   MUX_VAL(CP(SDRC_CKE1),  (IDIS | PTU | EN  | M0)) /* SDRC_CKE1
> */\
> +   MUX_VAL(CP(MCSPI1_CS2), (IEN  | PTD | DIS | M4)) /*
> GPIO_176-ETH IRQ */
>  #endif
> --
> 1.7.7.6
>
>
I'm not sure if this is the correct place to do this.

This was discussed for a long, the main question is who must set the pin
muxer ?

In my opinion u-boot only should set mux for the pins that it is using and
I think u-boot is not using this IRQ pin for ethernet driver (not sure, I
need to check). At kernel level of course the driver uses this pin. In my
opinion the kernel should guarantees that this pin is muxed correctly, not
u-boot.

Any other opinion ? How this is solved in others boards ?

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


Re: [U-Boot] [PATCH 1/3] fdt: Add board specific dts inclusion

2012-07-09 Thread Michal Simek

On 07/04/2012 10:25 PM, Stephan Linz wrote:

Some architectures, for example Microblaze, doesn't need a
splitted device tree because every Microblaze hw design is
different. The individuell Microblaze device tree will be
auto generated by FPGA design tools and could be used directly
with dtc.

The auto generated dts for Microblaze can not processed by CPP.
Unfortunately that is the default procedure in U-Boot to merge
a splitted device tree (substitution of ARCH_CPU_DTS).

Microblaze will never use the ARCH_CPU_DTS substitution and we
introduce the new board specific substitution variable BOARD_DTS
that points into vendor/board/dts subdir with the file name
of CONFIG_DEFAULT_DEVICE_TREE. The common dts file in vendor/dts
subdir (defined by CONFIG_DEFAULT_DEVICE_TREE) contain a single
include line that can processed by CPP:

 /include/ BOARD_DTS

Signed-off-by: Stephan Linz
---
  dts/Makefile |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dts/Makefile b/dts/Makefile
index 914e479..b1f47a1 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -36,7 +36,8 @@ $(error Your architecture does not have device tree support 
enabled. \
  Please define CONFIG_ARCH_DEVICE_TREE))

  # We preprocess the device tree file provide a useful define
-DTS_CPPFLAGS := 
-DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\"
+DTS_CPPFLAGS := 
-DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" \
+   
-DBOARD_DTS=\"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\"

  all:  $(obj).depend $(LIB)



Ok. Have tested this.
Simon can you give your ACK for this patch?

Tested-by: Michal Simek 

I think I can add this one to my microblaze custodian tree.

Thanks,
Michal



--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM CONFIG_OF_CONTROL status

2012-07-09 Thread Michal Simek

On 07/04/2012 10:27 PM, Stephan Linz wrote:

Am Mittwoch, den 04.07.2012, 08:24 +0200 schrieb Michal Simek:

On 07/03/2012 10:22 PM, Stephan Linz wrote:

Am Dienstag, den 03.07.2012, 12:21 -0700 schrieb Simon Glass:

Hi,

On Sun, Jul 1, 2012 at 10:43 PM, Michal Simek   wrote:


2012/6/29 Stephan Linz:

Am Freitag, den 29.06.2012, 10:18 +0200 schrieb Michal Simek:

On 06/29/2012 04:32 AM, Simon Glass wrote:

Hi,

--snip--







Well there is no inherent problem with having multiple include files,
except that it is hard to support with the old dtc when there are in
different subdirs.

As a workaround, how about putting the include files in the
board/vendor/dts subdir as well for now?


Hi,

good idea -- but they cannot be used directly. The substitution variable
ARCH_CPU_DTS is already reserved for dtsi in arch/cpu. The Microblaze
architecture needs a board specific dts onyl. That's why I think the new
substitution variable BOARD_DTS can be a option to solve the CPP problem
today and handle the dtc -i in the future.

BOARD_DTS can point to anything below board/vendor and perhaps with a
new configuration option similar to CONFIG_DEFAULT_DEVICE_TREE the
substitution could be affected with freely selectable file name instead
of DEVICE_TREE only.



ok.

Stephan: go ahead and create proper patch with empty dts/dtsi files.


Hi Michal,

see my patch set, that I've already submitted. The patches are based on
your patch set from last week. I've create a bundle on patchwork:

http://patchwork.ozlabs.org/bundle/rexut/microblaze-fdt/

Further you will need a QnD hack to avoid a compilation error due to
type conflicts (I've not explored here, not yet):

In file included from key_matrix.c:28:
include/malloc.h:364: error: conflicting types for 'memset'
include/linux/string.h:71: error: previous declaration of 'memset' was
here
include/malloc.h:365: error: conflicting types for 'memcpy'
include/linux/string.h:74: error: previous declaration of 'memcpy' was
here


Here is the QnD hack:


diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 5c831b2..5efeeb3 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -32,7 +32,7 @@ COBJS-y += keyboard.o pc_keyb.o
COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
endif
COBJS-y += input.o
-COBJS-$(CONFIG_OF_CONTROL) += key_matrix.o
+#COBJS-$(CONFIG_OF_CONTROL) += key_matrix.o

COBJS  := $(COBJS-y)
SRCS   := $(COBJS:.o=.c)


Yes, I have seen this too. I did this.

diff --git a/drivers/input/key_matrix.c b/drivers/input/key_matrix.c
index 84b898f..804a761 100644 (file)
--- a/drivers/input/key_matrix.c
+++ b/drivers/input/key_matrix.c
@@ -25,7 +25,7 @@

 #include 
 #include 
-#include 
+//#include 
 #include 


Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM CONFIG_OF_CONTROL status

2012-07-09 Thread Michal Simek

On 07/05/2012 05:34 PM, Stephen Warren wrote:

On 07/04/2012 12:02 AM, Michal Simek wrote:
...

What is the problem to add the latest dtc?


To really make use of device tree you need a recent dtc, but we've had
pushback requiring a recent dtc because people may not have it
installed. I asked Wolfgang a while back whether we could just put a
copy of dtc into the U-Boot source tree to avoid this issue, just like
the kernel did, but simply haven't received any response. Perhaps the
best thing is to just send a patch to do this; patches often get more
responses than non-patch email.


Yeah. When you send the patch, please cc me. I will test it with microblaze.

Thanks,
Michal


--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 7/8] arm/davinci: spl - boot device selection

2012-07-09 Thread Prabhakar Lad
Hi Mikhail,

On Mon, Jul 9, 2012 at 12:34 PM, Mikhail Kshevetskiy
 wrote:
> On Mon, 9 Jul 2012 11:39:14 +0530
> Prabhakar Lad  wrote:
>
>> Hi Mikhail,
>>
>> On Mon, Jul 9, 2012 at 9:01 AM, Mikhail Kshevetskiy
>>  wrote:
>> > This patch allow us to have a universal spl that detects a boot
>> > device and select a corresponding boot algorithm for main u-boot part
>> > (SOC_DA8XX only)
>> >
>> > This patch create copy copy of drivers/mtd/nand/nand_spl_load.c and
>> > drivers/mtd/spi/spi_spl_load.c for the following reasons:
>> >  * avoid jump to main u-boot code just after its loading (required
>> >for the next patch: spl - add compressed u-boot image support)
>> >  * makes a structure similar to omap3 sources
>> >
>> > Signed-off-by: Mikhail Kshevetskiy 
>> > ---
>> > Change for v2:
>> >  * fix checkpatch warnings
>> >  * defines for constants
>> >  * use readl() to read a BOOTCFG_REG
>> >  * improve patch description
>> > ---
>> >  arch/arm/cpu/arm926ejs/davinci/Makefile  |5 ++
>> >  arch/arm/cpu/arm926ejs/davinci/spl.c |   91
>> > +++--- arch/arm/cpu/arm926ejs/davinci/spl_mmc.c |
>> > 39 ++ arch/arm/cpu/arm926ejs/davinci/spl_nand.c|   11 +++
>> >  arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c   |   25 ++
>> >  arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c  |   42 ++
>> >  arch/arm/include/asm/arch-davinci/davinci_boot.h |   50 
>> >  include/configs/cam_enc_4xx.h|   12 +--
>> >  include/configs/da850evm.h   |   19 +++--
>> >  include/configs/hawkboard.h  |   11 +--
>> >  10 files changed, 275 insertions(+), 30 deletions(-)
>> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_mmc.c
>> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c
>> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c
>> >  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c
>> >  create mode 100644 arch/arm/include/asm/arch-davinci/davinci_boot.h
>> >
>> > diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile
>> > b/arch/arm/cpu/arm926ejs/davinci/Makefile index da7efac..12bd37a 100644
>> > --- a/arch/arm/cpu/arm926ejs/davinci/Makefile
>> > +++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
>> > @@ -40,6 +40,11 @@ ifdef CONFIG_SPL_BUILD
>> >  COBJS-y+= spl.o
>> >  COBJS-$(CONFIG_SOC_DM365)  += dm365_lowlevel.o
>> >  COBJS-$(CONFIG_SOC_DA8XX)  += da850_lowlevel.o
>> > +
>> > +COBJS-$(CONFIG_SPL_NAND_SUPPORT)   += spl_nand.o
>> > +COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT)  += spl_spi_flash.o
>> > +COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
>> > +COBJS-$(CONFIG_SPL_MMC_SUPPORT)+= spl_mmc.o
>> >  endif
>> >
>> >  SOBJS  = reset.o
>> > diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> > b/arch/arm/cpu/arm926ejs/davinci/spl.c index 74632e5..50b4bbc 100644
>> > --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> > +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> > @@ -25,9 +25,11 @@
>> >  #include 
>> >  #include 
>> >  #include 
>> > +#include 
>> >  #include 
>> >  #include 
>> >  #include 
>> > +#include 
>> >
>> >  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>> >
>> > @@ -72,25 +74,92 @@ void board_init_f(ulong dummy)
>> > relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
>> >  }
>> >
>> > +u32 davinci_boot_device(void){
>> > +#ifdef CONFIG_SOC_DA8XX
>> > +   u32 bootmode = readl(BOOTCFG_REG) & BOOTCFG_REG_DEVICE_MASK;
>> > +   switch (bootmode) {
>> > +   case BOOTCFG_DEVICE_NAND8:
>> > +   case BOOTCFG_DEVICE_NAND16:
>> > +   return BOOT_DEVICE_TYPE_NAND;
>> > +   case BOOTCFG_DEVICE_SPI0_FLASH:
>> > +   case BOOTCFG_DEVICE_SPI1_FLASH:
>> > +   return BOOT_DEVICE_TYPE_SPI_FLASH;
>> > +   case BOOTCFG_DEVICE_UART0:
>> > +   case BOOTCFG_DEVICE_UART1:
>> > +   case BOOTCFG_DEVICE_UART2:
>> > +   return BOOT_DEVICE_TYPE_UART;
>> > +   case BOOTCFG_DEVICE_MMC_OR_SD0:
>> > +   return BOOT_DEVICE_TYPE_MMC;
>> > +   default:
>> > +   return BOOT_DEVICE_TYPE_NONE;
>> > +   }
>> > +#else
>> > +#ifdef
>> > +#endif CONFIG_SPL_NAND_SUPPORT
>> > +   return BOOT_DEVICE_TYPE_NAND;
>> > +#endif
>> > +#ifdef BOOT_DEVICE_SPI_FLASH
>> > +   return BOOT_DEVICE_TYPE_SPI_FLASH;
>> > +#endif
>> > +#ifdef CONFIG_SPL_YMODEM_SUPPORT
>> > +   return BOOT_DEVICE_TYPE_UART;
>> > +#endif
>> > +#ifdef CONFIG_SPL_MMC_SUPPORT
>> > +   return BOOT_DEVICE_TYPE_MMC;
>> > +#endif
>> > +}
>> > +
>> >  void board_init_r(gd_t *id, ulong dummy)
>> >  {
>> > -#ifdef CONFIG_SPL_NAND_LOAD
>> > -   nand_init();
>> > -   puts("Nand boot...\n");
>> > -   nand_boot();
>> > -#endif
>> > -#ifdef CONFIG_SPL_SPI_LOAD
>> > -   mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
>> > -   CONFIG_SYS_MALLOC_LEN);
>> > +   u32 boot_device;
>> > +   void (*uboot)(void) __noretur

Re: [U-Boot] [PATCH v2 0/4] Board support and feature for LaCie devices

2012-07-09 Thread Simon Guinot
On Wed, Jun 06, 2012 at 01:16:49AM +0200, Simon Guinot wrote:
> Changes for v2:
>  - Move board support and feature into a separate patch set.
>  - Move mach-types update into a separate patch.
> 
> Simon Guinot (4):
>   lacie_kw: add support for EFI partitions
>   ARM: add netspace_mini_v2 to mach-types.h
>   ARM: add support for Network Space v2 Lite and Mini
>   ARM: add support for d2 Network v2
> 
>  arch/arm/include/asm/mach-types.h |   13 +++
>  board/LaCie/common/common.c   |   36 ++-
>  board/LaCie/common/common.h   |1 +
>  board/LaCie/netspace_v2/kwbimage-ns2l.cfg |  162 
> +
>  board/LaCie/netspace_v2/netspace_v2.c |4 +
>  boards.cfg|3 +
>  include/configs/lacie_kw.h|   42 ++--
>  7 files changed, 252 insertions(+), 9 deletions(-)
>  create mode 100644 board/LaCie/netspace_v2/kwbimage-ns2l.cfg

Hi Prafulla,

Could you please pick up this patches.

Simon

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


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


Re: [U-Boot] [PATCH 1/5] microblaze: Add gpio.h

2012-07-09 Thread Michal Simek
2012/6/29 Michal Simek :
> Gpio support is not implemented yet. Adding it because of fdtdec.
>
> Signed-off-by: Michal Simek 
> ---
>  arch/microblaze/include/asm/gpio.h |   41 
> 
>  1 files changed, 41 insertions(+), 0 deletions(-)
>  create mode 100644 arch/microblaze/include/asm/gpio.h
>
> diff --git a/arch/microblaze/include/asm/gpio.h 
> b/arch/microblaze/include/asm/gpio.h
> new file mode 100644
> index 000..883f4d4
> --- /dev/null
> +++ b/arch/microblaze/include/asm/gpio.h
> @@ -0,0 +1,41 @@
> +#ifndef _ASM_MICROBLAZE_GPIO_H_
> +#define _ASM_MICROBLAZE_GPIO_H_
> +
> +#include 
> +
> +static inline int gpio_request(unsigned gpio, const char *label)
> +{
> +   return 0;
> +}
> +
> +static inline int gpio_free(unsigned gpio)
> +{
> +   return 0;
> +}
> +
> +static inline int gpio_direction_input(unsigned gpio)
> +{
> +   return 0;
> +}
> +
> +static inline int gpio_direction_output(unsigned gpio, int value)
> +{
> +   return 0;
> +}
> +
> +static inline int gpio_get_value(unsigned gpio)
> +{
> +   return 0;
> +}
> +
> +static inline int gpio_set_value(unsigned gpio, int value)
> +{
> +   return 0;
> +}
> +
> +static inline int gpio_is_valid(int number)
> +{
> +   return 0;
> +}
> +#endif
> +
> --

Applied to microblaze custodian branch.

Michal

-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] microblaze: Move individual board linker scripts to common script in cpu tree.

2012-07-09 Thread Michal Simek
2012/6/29 Michal Simek :
> Unification for all microblaze boards.
>
> Signed-off-by: Michal Simek 
> ---
>  arch/microblaze/config.mk  |2 +
>  arch/microblaze/cpu/u-boot.lds |   71 
> 
>  board/xilinx/microblaze-generic/u-boot.lds |   71 
> 
>  3 files changed, 73 insertions(+), 71 deletions(-)
>  create mode 100644 arch/microblaze/cpu/u-boot.lds
>  delete mode 100644 board/xilinx/microblaze-generic/u-boot.lds
>
> diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
> index abea70b..aca79e2 100644
> --- a/arch/microblaze/config.mk
> +++ b/arch/microblaze/config.mk
> @@ -29,3 +29,5 @@ CROSS_COMPILE ?= mb-
>  CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
>
>  PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
> +
> +LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
> diff --git a/arch/microblaze/cpu/u-boot.lds b/arch/microblaze/cpu/u-boot.lds
> new file mode 100644
> index 000..ee41145
> --- /dev/null
> +++ b/arch/microblaze/cpu/u-boot.lds
> @@ -0,0 +1,71 @@
> +/*
> + * (C) Copyright 2004 Atmark Techno, Inc.
> + *
> + * Yasushi SHOJI 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +OUTPUT_ARCH(microblaze)
> +ENTRY(_start)
> +
> +SECTIONS
> +{
> +   .text ALIGN(0x4):
> +   {
> +   __text_start = .;
> +   arch/microblaze/cpu/start.o (.text)
> +   *(.text)
> +   __text_end = .;
> +   }
> +
> +   .rodata ALIGN(0x4):
> +   {
> +   __rodata_start = .;
> +   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
> +   __rodata_end = .;
> +   }
> +
> +   .data ALIGN(0x4):
> +   {
> +   __data_start = .;
> +   *(.data)
> +   __data_end = .;
> +   }
> +
> +   .u_boot_cmd ALIGN(0x4):
> +   {
> +   . = .;
> +   __u_boot_cmd_start = .;
> +   *(.u_boot_cmd)
> +   __u_boot_cmd_end = .;
> +   }
> +
> +   .bss ALIGN(0x4):
> +   {
> +   __bss_start = .;
> +   *(.sbss)
> +   *(.scommon)
> +   *(.bss)
> +   *(COMMON)
> +   . = ALIGN(4);
> +   __bss_end = .;
> +   }
> +   __end = . ;
> +}
> diff --git a/board/xilinx/microblaze-generic/u-boot.lds 
> b/board/xilinx/microblaze-generic/u-boot.lds
> deleted file mode 100644
> index ee41145..000
> --- a/board/xilinx/microblaze-generic/u-boot.lds
> +++ /dev/null
> @@ -1,71 +0,0 @@
> -/*
> - * (C) Copyright 2004 Atmark Techno, Inc.
> - *
> - * Yasushi SHOJI 
> - *
> - * See file CREDITS for list of people who contributed to this
> - * project.
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License as
> - * published by the Free Software Foundation; either version 2 of
> - * the License, or (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> - * MA 02111-1307 USA
> - */
> -
> -OUTPUT_ARCH(microblaze)
> -ENTRY(_start)
> -
> -SECTIONS
> -{
> -   .text ALIGN(0x4):
> -   {
> -   __text_start = .;
> -   arch/microblaze/cpu/start.o (.text)
> -   *(.text)
> -   __text_end = .;
> -   }
> -
> -   .rodata ALIGN(0x4):
> -   {
> -   __rodata_start = .;
> -   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
> -   __rodata_end = .;
> -   }
> -
> -   .data ALIGN(0x4):
> -   {
> -   __data_start = .;
> -   *(.data)
> -   __data_end = .;
> -   }
> -
> -   .u_boot_cmd ALIGN(0x4):
> -   {
> -   . = .;
> -

Re: [U-Boot] [PATCH 3/5] microblaze: Add support for device tree driven board configuration

2012-07-09 Thread Michal Simek
2012/6/29 Michal Simek :
> This is minimum code required to be able to use device-tree
> for u-boot initialization.
> Currently only for device driver initialization.
>
> Linker script change ensures DTB to be aligned
> for both options CONFIG_OF_EMBED and CONFIG_OF_SEPARATE.
>
> Signed-off-by: Michal Simek 
> CC: Simon Glass 
> ---
>  arch/microblaze/config.mk |2 ++
>  arch/microblaze/cpu/u-boot.lds|1 +
>  arch/microblaze/include/asm/global_data.h |1 +
>  arch/microblaze/lib/board.c   |   23 +++
>  4 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
> index aca79e2..b4935f0 100644
> --- a/arch/microblaze/config.mk
> +++ b/arch/microblaze/config.mk
> @@ -31,3 +31,5 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
>  PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
>
>  LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
> +
> +CONFIG_ARCH_DEVICE_TREE := microblaze
> diff --git a/arch/microblaze/cpu/u-boot.lds b/arch/microblaze/cpu/u-boot.lds
> index ee41145..d033a28 100644
> --- a/arch/microblaze/cpu/u-boot.lds
> +++ b/arch/microblaze/cpu/u-boot.lds
> @@ -45,6 +45,7 @@ SECTIONS
> .data ALIGN(0x4):
> {
> __data_start = .;
> +   dts/libdts.o (.data)
> *(.data)
> __data_end = .;
> }
> diff --git a/arch/microblaze/include/asm/global_data.h 
> b/arch/microblaze/include/asm/global_data.h
> index 6e8537c..e802e4e 100644
> --- a/arch/microblaze/include/asm/global_data.h
> +++ b/arch/microblaze/include/asm/global_data.h
> @@ -43,6 +43,7 @@ typedef   struct  global_data {
> unsigned long   precon_buf_idx; /* Pre-Console buffer index */
>  #endif
> unsigned long   env_addr;   /* Address  of Environment struct */
> +   const void  *fdt_blob;  /* Our device tree, NULL if none */
> unsigned long   env_valid;  /* Checksum of Environment valid? */
> unsigned long   fb_base;/* base address of frame buffer */
> void**jt;   /* jump table */
> diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
> index f3679d5..59d39a0 100644
> --- a/arch/microblaze/lib/board.c
> +++ b/arch/microblaze/lib/board.c
> @@ -32,6 +32,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -68,6 +69,9 @@ typedef int (init_fnc_t) (void);
>
>  init_fnc_t *init_sequence[] = {
> env_init,
> +#ifdef CONFIG_OF_CONTROL
> +   fdtdec_check_fdt,
> +#endif
> serial_init,
> console_init_f,
>  #ifdef CONFIG_SYS_GPIO_0
> @@ -110,6 +114,17 @@ void board_init (void)
>
> monitor_flash_len = __end - __text_start;
>
> +#ifdef CONFIG_OF_EMBED
> +   /* Get a pointer to the FDT */
> +   gd->fdt_blob = _binary_dt_dtb_start;
> +#elif defined CONFIG_OF_SEPARATE
> +   /* FDT is at end of image */
> +   gd->fdt_blob = (void *)__end;
> +#endif
> +   /* Allow the early environment to override the fdt address */
> +   gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
> +   (uintptr_t)gd->fdt_blob);
> +
> /*
>  * The Malloc area is immediately below the monitor copy in DRAM
>  * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
> @@ -124,6 +139,14 @@ void board_init (void)
> }
> }
>
> +#ifdef CONFIG_OF_CONTROL
> +   /* For now, put this check after the console is ready */
> +   if (fdtdec_prepare_fdt()) {
> +   panic("** CONFIG_OF_CONTROL defined but no FDT - please see "
> +   "doc/README.fdt-control");
> +   }
> +#endif
> +
> puts ("SDRAM :\n");
> printf ("\t\tIcache:%s\n", icache_status() ? "ON" : "OFF");
> printf ("\t\tDcache:%s\n", dcache_status() ? "ON" : "OFF");
> --
> 1.7.0.4
>

Reject. v2 will add one more puts.

Michal

-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] igep0020: set OMAP MUX mcspi1_cs2 pin to GPIO 176 mode

2012-07-09 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/09/2012 12:32 AM, Enric Balletbò i Serra wrote:
> Hi Javier,
> 
> 2012/7/3 Javier Martinez Canillas  >
> 
> According to the IGEPv2 Rev.C data-sheet the LAN9221i pin 14 (IRQ)
> is connected to the OMAP3730 mcspi1_cs2 pin. Since this omap mux
> pin acts as an IRQ line, it has to be configured as an input GPIO.
> 
> IGEPv2 platform code sets the smsc911x_cfg->gpio_irq to GPIO 176
> but since the mux pin default mode is MODE7 (safe_mode) the driver
> fails when trying to register the IRQ:
> 
> [1.994598] smsc911x: Driver version 2008-10-21 [3.704162]
> irq 272: nobody cared (try booting with the "irqpoll" option) [
> 3.711364] [] (unwind_backtrace+0x0/0xf0) from 
> [] (__report_bad_irq+0x20/0xbc) [3.720916]
> [] (__report_bad_irq+0x20/0xbc) from []
> (note_interrupt+0x1d8/0x238) [3.730560] []
> (note_interrupt+0x1d8/0x238) from []
> (handle_irq_event_percpu+0xc0/0x260) [3.740936] []
> (handle_irq_event_percpu+0xc0/0x260) from []
> (handle_irq_event+0x3c/0x5c) [3.751312] []
> (handle_irq_event+0x3c/0x5c) from []
> (handle_level_irq+0xac/0x10c) [3.761047] []
> (handle_level_irq+0xac/0x10c) from []
> (generic_handle_irq+0x30/0x48) [3.770935] []
> (generic_handle_irq+0x30/0x48) from []
> (gpio_irq_handler+0x180/0x1d4) [3.780944] []
> (gpio_irq_handler+0x180/0x1d4) from []
> (generic_handle_irq+0x30/0x48) [3.790954] []
> (generic_handle_irq+0x30/0x48) from []
> (handle_IRQ+0x4c/0xac) [3.800231] []
> (handle_IRQ+0x4c/0xac) from [] 
> (omap3_intc_handle_irq+0x60/0x74) [3.809783] []
> (omap3_intc_handle_irq+0x60/0x74) from []
> (__irq_svc+0x44/0x60) [3.819213] Exception stack(0xee42fde0 to
> 0xee42fe28) [3.824554] fde0: 0001 0001 
>  6013 c06cce14 c06cce14 0110 [3.833190] fe00:
>  c06ccdf4 6013 ee41d000 fb058064 ee42fe28 c0089e08
> c04976b4 [3.841796] fe20: 2013  [3.845489]
> [] (__irq_svc+0x44/0x60) from [] 
> (_raw_spin_unlock_irqrestore+0x34/0x44) [3.855499] []
> (_raw_spin_unlock_irqrestore+0x34/0x44) from []
> (__setup_irq+0x1b8/0x3f0) [3.865875] []
> (__setup_irq+0x1b8/0x3f0) from []
> (request_threaded_irq+0xb8/0x140) [3.875701] []
> (request_threaded_irq+0xb8/0x140) from []
> (smsc911x_drv_probe+0x75c/0x11a4) [3.886260] []
> (smsc911x_drv_probe+0x75c/0x11a4) from []
> (platform_drv_probe+0x18/0x1c) [3.896545] []
> (platform_drv_probe+0x18/0x1c) from []
> (driver_probe_device+0x90/0x210) [3.906707] []
> (driver_probe_device+0x90/0x210) from []
> (__driver_attach+0x94/0x98) [3.916625] []
> (__driver_attach+0x94/0x98) from []
> (bus_for_each_dev+0x50/0x7c) [3.926177] []
> (bus_for_each_dev+0x50/0x7c) from []
> (bus_add_driver+0x184/0x248) [3.935821] []
> (bus_add_driver+0x184/0x248) from []
> (driver_register+0x78/0x12c) [3.945465] []
> (driver_register+0x78/0x12c) from []
> (do_one_initcall+0x34/0x178) [3.955108] []
> (do_one_initcall+0x34/0x178) from []
> (kernel_init+0xfc/0x1c0) [3.964385] []
> (kernel_init+0xfc/0x1c0) from []
> (kernel_thread_exit+0x0/0x8) [3.973632] handlers: [
> 3.976043] [] smsc911x_irqhandler [3.980560] Disabling
> IRQ #272
> 
> Signed-off-by: Javier Martinez Canillas  > --- board/isee/igep0020/igep0020.h |
> 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/board/isee/igep0020/igep0020.h 
> b/board/isee/igep0020/igep0020.h index 3d6e15f..eb1aa30 100644 ---
> a/board/isee/igep0020/igep0020.h +++
> b/board/isee/igep0020/igep0020.h @@ -143,5 +143,6 @@ static void
> setup_net_chip(void); MUX_VAL(CP(SYS_BOOT5),  (IEN  | PTD | DIS
> | M4)) /* GPIO_7 */\ MUX_VAL(CP(SYS_BOOT6),  (IEN  | PTD | DIS
> | M4)) /* GPIO_8 */\ MUX_VAL(CP(SDRC_CKE0),  (IDIS | PTU | EN
> | M0)) /* SDRC_CKE0 */\ -   MUX_VAL(CP(SDRC_CKE1),  (IDIS |
> PTU | EN  | M0)) /* SDRC_CKE1 */ +   MUX_VAL(CP(SDRC_CKE1),
> (IDIS | PTU | EN  | M0)) /* SDRC_CKE1 */\ +
> MUX_VAL(CP(MCSPI1_CS2), (IEN  | PTD | DIS | M4)) /* 
> GPIO_176-ETH IRQ */ #endif -- 1.7.7.6
> 
> 
> I'm not sure if this is the correct place to do this.
> 
> This was discussed for a long, the main question is who must set
> the pin muxer ?
> 
> In my opinion u-boot only should set mux for the pins that it is
> using and I think u-boot is not using this IRQ pin for ethernet
> driver (not sure, I need to check). At kernel level of course the
> driver uses this pin. In my opinion the kernel should guarantees
> that this pin is muxed correctly, not u-boot.
> 
> Any other opinion ? How this is solved in others boards ?

The kernel must be ensuring the correct muxing.  If we don't need
something configured U-Boot should not configure it in general.  In
practice there is a lot of mux setup that has been done in U-Boot in
the past.  A quick read says we don't need the IRQ pin in U-Boot
currently so we shouldn't set it, so barring a correction

Re: [U-Boot] [PATCH v5] arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0

2012-07-09 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/07/2012 12:14 AM, Tetsuyuki Kobayashi wrote:
> save_boot_params_default() in cpu.c accesses uninitialized stack
> area when it compiled with -O0 (not optimized). This patch removes
> save_boot_params_default() and put the equivalent in start.S
> 
> Signed-off-by: Tetsuyuki Kobayashi 

Acked-by: Tom Rini 

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP+pyHAAoJENk4IS6UOR1Ww6sP/iFYvofEDFPBjHEZtfOFqmHU
+D49nDI24nlA68WlD12s3muteEAS3fsyxs74wHKbBpz0vIph0twCM41i78khzBoJ
Rore4b380dGwU3RJD4pZ++RELrTyrlTVLo3aQg0rp7K+KaCms5YByftBqwhIeI3r
fw1zIO2mFCY5uz3PPxjwO8++vcaH/Fk1G6MNRaz4RgnG/dZx6tQVEtuQbTmyltrM
mJiBypZU7FCHxEnBbfBkJerrTxEbM/chZQEy3QFMYpfs3JEx4QqFwSN6i8YV3yKQ
AmeB+BbAfU+tm8xxTfnXKZOCP50i70Tir+42XV4PJ6PY9qfOriDaVl9V1bP/8FK3
rZodkAqc5V0ieRbeBIYouJhrPKMQ1b3uZ8FsSV3uU7HvWx4Rjy/yP5T0dW/j52cy
+TFd1ZH/B2wUU1ihSfV2r80v9+tQ59KYeBUjN0i2pdnAdk/ELbyREKakYM1vWyUN
g4UaR6YTtx+SJH48nbgzoLgyYeyWCZKJrNbJRSQ7CckcluoHHeTbTnY3bYAbntJm
jMwdBeBUjZcxz123ca1lFY5elJiPu2mCDbNDv4J1pw1bqfEc7WY1xm73hZ6YIr1X
JmyyIOyXhOPDad3A3Th93bwbLbtV38GqXMspJ4aXkT+j9IW/RdK9tKWtQZ5cIcE5
abwLAFb/jiGpxmSuEo3g
=6jT2
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] USB detection

2012-07-09 Thread Manukumar
hello
I checked with the hardware spec
in that
P1020RDB: having connection like 
P1012processor -> PHY -> HUB -> ports

whereas in custom board
P1012processor -> phy -> port(single usb port)

In uboot source code initializing sequence of u-boot
is below:
1.usb_init()
2.usb_scan_devices()
3.usb_new_device(dev)
4.usb_hub_probe(dev, 0)
5.usb_hub_configure(dev)


how can we do this in u-boot source code

manukumar
signal-networks


On Thu, 2012-07-05 at 13:45 +0200, Albert ARIBAUD wrote:
> Hi Manukumar,
> 
> On Thu, 05 Jul 2012 15:57:49 +0530, Manukumar
>  wrote:
> > Hello,
> > 
> > I have connected USB hard disk to P1020RB 
> 
> Which board is this? Neither "git grep -i P1020RB" nor "find . iname
> '*P1020RB*'" yield any result.
> 
> > and in command prompt(u-boot) i used
> > command
> > => usb start
> > (Re)start USB...
> > USB:   Register 10011 NbrPorts 1
> > USB EHCI 1.00
> > scanning bus for devices... 3 USB Device(s) found
> >scanning bus for storage devices... 1 Storage Device(s) found
> > 
> > => usb dev
> > 
> > USB device 0: Vendor: Seagate  Rev: 0130 Prod: Portable
> > Type: Hard Disk
> > Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
> > 
> > and USB got detected.
> > 
> > but If i used the same command in our custom board
> > => usb start
> > (Re)start USB...
> > USB:   Register 10011 NbrPorts 1
> > USB EHCI 1.00
> > scanning bus for devices... 1 USB Device(s) found
> >scanning bus for storage devices... 0 Storage Device(s) found
> > 
> > => usb dev
> > 
> > USB device -1: device type unknown
> > 
> > 
> > How do resolve this issue and why the device is not detecting my USB
> > hard disk.?
> 
> Considering that you're trying this on a custom board, and assuming
> "P1020RB" is a nickname for a board supported in mainline U-Boot, there
> are two possibilities:
> 
> 1) the custom board uses exactly the same U-Boot (source, configuration
> and binaries) as P1020RB, and the issue is in HW, in which case we can
> barely help;
> 
> 2) the custom board uses a custom U-Boot, and we can barely help too,
> as this issue is not about (recent) mainline U-Boot code.
> 
> > manukumar
> > signal-networks
> 
> Amicalement,



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


Re: [U-Boot] [PATCH V2 7/8] arm/davinci: spl - boot device selection

2012-07-09 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/08/2012 08:31 PM, Mikhail Kshevetskiy wrote:
> This patch allow us to have a universal spl that detects a boot 
> device and select a corresponding boot algorithm for main u-boot
> part (SOC_DA8XX only)
> 
> This patch create copy copy of drivers/mtd/nand/nand_spl_load.c
> and drivers/mtd/spi/spi_spl_load.c for the following reasons: *
> avoid jump to main u-boot code just after its loading (required for
> the next patch: spl - add compressed u-boot image support) * makes
> a structure similar to omap3 sources

Figuring out how to properly re-use in both cases is something we need
to work towards, for both these cases and the ymodem UART case as
well.  I think we need to first split this series up into:
- - DDR and UART bugfixes (1, 2, 3) which can go in today
- - SPI (4, 5) which needs to be reviewed by the SPI maintainer
- - MMC+SPL+no partition table support bugfix which can go in today
- - SPL rework to be like, and possibly directly re-use omap-common SPL
files (first move to arch/arm/lib, second switch existing callers to
use, third add support for that ymodem loader, etc).

Thanks!

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP+p6GAAoJENk4IS6UOR1WBY8P+wQmlG3k4TkzB9NrfzOz/ctx
SxRWHk/UPrgs7Cq+fhHBs2ghuHDZkEA2GXrL6R2ogUkjnKPqQsoZ5S4LGBkyCJcz
e0PNsphQPSTAfhKNkLNx7v4wQXN4bfJ4rF5tUe7nY+s+IY1D88TwbvMTtqYpqoDP
IeGaWwGaogw/O3oyYyMLdW8SCzXTx9GwNIU/XRKdHTePa7pyQY/RyBICx1lzjgpe
vadG4DIxx5cu6555FXfQGE8iJZLLzvzffZyiKANWSmSG0v1PAQKU8QaBPvQZhu1q
VeFnubTSaLiDMQCd/22x9JCewbWMXOYpBLBP0LqdKKYVzp/D1tl8CUggL4qZI2g5
jtrbPzcnzgxzhGIJfXVZFh4tF/lZ9UlOTSpo2CTAz6vZh8iOeD2mwyEmKmduqISy
Kt0aM7rPwbffq5uaA8VqOuDUt13EPJl/ah6BihmEemwqQgF3ZAoRMVT8Ne4KqBGA
cp/65YKyZjoljzDNcNcY/SRy7KbGLNBvRYg1NGRkwVllZLLqAcbvTChm8pAA0dAm
TNzZDjuVXAkyQzY6WUm/55xcR9RYH5tDq5ixg65m0ZkSkAryMAT/2UyRwtvzI+ZU
F6Jc9fAQp4csxykqMFwL45F2Tmbay47hxftkomOXOuGJG40NQgyxZNDGq62kBBDg
FR4YBY3v5NqJfKRchpzK
=sPWS
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 01/12] microblaze: board: Remove compilation warning

2012-07-09 Thread Michal Simek
Variable is used when CONFIG_SYS_FLASH_CHECKSUM is used.

Warning log:
board.c: In function 'board_init':
board.c:101: warning: unused variable 's'

Signed-off-by: Michal Simek 
---
 arch/microblaze/lib/board.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index a8ed7ce..4146f5c 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -98,7 +98,6 @@ void board_init (void)
gd = (gd_t *) (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET);
bd = (bd_t *) (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET \
- GENERATED_BD_INFO_SIZE);
-   char *s;
 #if defined(CONFIG_CMD_FLASH)
ulong flash_size = 0;
 #endif
@@ -157,9 +156,9 @@ void board_init (void)
puts ("Flash: ");
bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
if (0 < (flash_size = flash_init ())) {
-   bd->bi_flashsize = flash_size;
-   bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
+   char *s;
+
print_size (flash_size, "");
/*
 * Compute and print flash CRC if flashchecksum is set to 'y'
@@ -176,6 +175,8 @@ void board_init (void)
 # else /* !CONFIG_SYS_FLASH_CHECKSUM */
print_size (flash_size, "\n");
 # endif /* CONFIG_SYS_FLASH_CHECKSUM */
+   bd->bi_flashsize = flash_size;
+   bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
} else {
puts ("Flash init FAILED");
bd->bi_flashstart = 0;
-- 
1.7.0.4

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


[U-Boot] [PATCH 03/12] microblaze: intc: Clear interrupt code

2012-07-09 Thread Michal Simek
Clear and prepare for device-tree driven configuration.
Remove CONFIG_SYS_INTC_0 definition
Use dynamic allocation instead of static.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/interrupts.c  |   88 ++---
 arch/microblaze/cpu/start.S   |2 -
 arch/microblaze/cpu/timer.c   |2 -
 arch/microblaze/include/asm/microblaze_intc.h |3 +
 arch/microblaze/lib/board.c   |6 +--
 include/configs/microblaze-generic.h  |1 -
 6 files changed, 54 insertions(+), 48 deletions(-)

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index e7ca859..ee67082 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -48,20 +49,19 @@ int disable_interrupts (void)
return (msr & 0x2) != 0;
 }
 
-#ifdef CONFIG_SYS_INTC_0
-
-static struct irq_action vecs[CONFIG_SYS_INTC_0_NUM];
+static struct irq_action *vecs;
+static u32 irq_no;
 
 /* mapping structure to interrupt controller */
-microblaze_intc_t *intc = (microblaze_intc_t *) (CONFIG_SYS_INTC_0_ADDR);
+microblaze_intc_t *intc;
 
 /* default handler */
-void def_hdlr (void)
+static void def_hdlr(void)
 {
puts ("def_hdlr\n");
 }
 
-void enable_one_interrupt (int irq)
+static void enable_one_interrupt(int irq)
 {
int mask;
int offset = 1;
@@ -76,7 +76,7 @@ void enable_one_interrupt (int irq)
 #endif
 }
 
-void disable_one_interrupt (int irq)
+static void disable_one_interrupt(int irq)
 {
int mask;
int offset = 1;
@@ -96,7 +96,7 @@ void install_interrupt_handler (int irq, interrupt_handler_t 
* hdlr, void *arg)
 {
struct irq_action *act;
/* irq out of range */
-   if ((irq < 0) || (irq > CONFIG_SYS_INTC_0_NUM)) {
+   if ((irq < 0) || (irq > irq_no)) {
puts ("IRQ out of range\n");
return;
}
@@ -114,7 +114,7 @@ void install_interrupt_handler (int irq, 
interrupt_handler_t * hdlr, void *arg)
 }
 
 /* initialization interrupt controller - hardware */
-void intc_init (void)
+static void intc_init(void)
 {
intc->mer = 0;
intc->ier = 0;
@@ -127,18 +127,33 @@ void intc_init (void)
 #endif
 }
 
-int interrupts_init (void)
+int interrupts_init(void)
 {
int i;
-   /* initialize irq list */
-   for (i = 0; i < CONFIG_SYS_INTC_0_NUM; i++) {
-   vecs[i].handler = (interrupt_handler_t *) def_hdlr;
-   vecs[i].arg = (void *)i;
-   vecs[i].count = 0;
+
+#if defined(CONFIG_SYS_INTC_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
+   intc = (microblaze_intc_t *) (CONFIG_SYS_INTC_0_ADDR);
+   irq_no = CONFIG_SYS_INTC_0_NUM;
+#endif
+   if (irq_no) {
+   vecs = calloc(1, sizeof(struct irq_action) * irq_no);
+   if (vecs == NULL) {
+   puts("Interrupt vector allocation failed\n");
+   return -1;
+   }
+
+   /* initialize irq list */
+   for (i = 0; i < irq_no; i++) {
+   vecs[i].handler = (interrupt_handler_t *) def_hdlr;
+   vecs[i].arg = (void *)i;
+   vecs[i].count = 0;
+   }
+   /* initialize intc controller */
+   intc_init();
+   enable_interrupts();
+   } else {
+   puts("Undefined interrupt controller\n");
}
-   /* initialize intc controller */
-   intc_init ();
-   enable_interrupts ();
return 0;
 }
 
@@ -172,33 +187,30 @@ void interrupt_handler (void)
printf ("Interrupt handler on %x line, r14 %x\n", irqs, value);
 #endif
 }
-#endif
 
 #if defined(CONFIG_CMD_IRQ)
-#ifdef CONFIG_SYS_INTC_0
-int do_irqinfo (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, const char *argv[])
 {
int i;
struct irq_action *act = vecs;
 
-   puts ("\nInterrupt-Information:\n\n"
- "Nr  Routine   Arg   Count\n"
- "-\n");
-
-   for (i = 0; i < CONFIG_SYS_INTC_0_NUM; i++) {
-   if (act->handler != (interrupt_handler_t*) def_hdlr) {
-   printf ("%02d  %08x  %08x  %d\n", i,
-   (int)act->handler, (int)act->arg, act->count);
+   if (irq_no) {
+   puts("\nInterrupt-Information:\n\n"
+ "Nr  Routine   Arg   Count\n"
+ "-\n");
+
+   for (i = 0; i < irq_no; i++) {
+   if (act->handler != (interrupt_handler_t *) def_hdlr) {
+   printf("%02d  %08x  %08x  %d\n", i,
+   (int)act->handler, (int)act->arg,
+   act-

[U-Boot] [PATCH 04/12] microblaze: intc: Registering interrupt should return value

2012-07-09 Thread Michal Simek
Return value to find out if un/registration was succesful.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/interrupts.c  |   15 +--
 arch/microblaze/include/asm/microblaze_intc.h |2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index ee67082..871cefb 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -92,13 +92,13 @@ static void disable_one_interrupt(int irq)
 }
 
 /* adding new handler for interrupt */
-void install_interrupt_handler (int irq, interrupt_handler_t * hdlr, void *arg)
+int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, void *arg)
 {
struct irq_action *act;
/* irq out of range */
if ((irq < 0) || (irq > irq_no)) {
puts ("IRQ out of range\n");
-   return;
+   return -1;
}
act = &vecs[irq];
if (hdlr) { /* enable */
@@ -106,11 +106,14 @@ void install_interrupt_handler (int irq, 
interrupt_handler_t * hdlr, void *arg)
act->arg = arg;
act->count = 0;
enable_one_interrupt (irq);
-   } else {/* disable */
-   act->handler = (interrupt_handler_t *) def_hdlr;
-   act->arg = (void *)irq;
-   disable_one_interrupt (irq);
+   return 0;
}
+
+   /* Disable */
+   act->handler = (interrupt_handler_t *) def_hdlr;
+   act->arg = (void *)irq;
+   disable_one_interrupt(irq);
+   return 1;
 }
 
 /* initialization interrupt controller - hardware */
diff --git a/arch/microblaze/include/asm/microblaze_intc.h 
b/arch/microblaze/include/asm/microblaze_intc.h
index 6142b9c..359efe4 100644
--- a/arch/microblaze/include/asm/microblaze_intc.h
+++ b/arch/microblaze/include/asm/microblaze_intc.h
@@ -39,7 +39,7 @@ struct irq_action {
int count; /* number of interrupt */
 };
 
-void install_interrupt_handler (int irq, interrupt_handler_t * hdlr,
+int install_interrupt_handler(int irq, interrupt_handler_t *hdlr,
   void *arg);
 
 int interrupts_init(void);
-- 
1.7.0.4

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


[U-Boot] [PATCH 05/12] microblaze: intc: Coding style cleanup

2012-07-09 Thread Michal Simek
Just coding style cleanup.
Remove unneeded externs.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/interrupts.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index 871cefb..79ee96a 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -32,15 +32,12 @@
 
 #undef DEBUG_INT
 
-extern void microblaze_disable_interrupts (void);
-extern void microblaze_enable_interrupts (void);
-
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
MSRSET(0x2);
 }
 
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
unsigned int msr;
 
@@ -58,20 +55,21 @@ microblaze_intc_t *intc;
 /* default handler */
 static void def_hdlr(void)
 {
-   puts ("def_hdlr\n");
+   puts("def_hdlr\n");
 }
 
 static void enable_one_interrupt(int irq)
 {
int mask;
int offset = 1;
+
offset <<= irq;
mask = intc->ier;
intc->ier = (mask | offset);
 #ifdef DEBUG_INT
-   printf ("Enable one interrupt irq %x - mask %x,ier %x\n", offset, mask,
+   printf("Enable one interrupt irq %x - mask %x,ier %x\n", offset, mask,
intc->ier);
-   printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+   printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
 #endif
 }
@@ -80,13 +78,14 @@ static void disable_one_interrupt(int irq)
 {
int mask;
int offset = 1;
+
offset <<= irq;
mask = intc->ier;
intc->ier = (mask & ~offset);
 #ifdef DEBUG_INT
-   printf ("Disable one interrupt irq %x - mask %x,ier %x\n", irq, mask,
+   printf("Disable one interrupt irq %x - mask %x,ier %x\n", irq, mask,
intc->ier);
-   printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+   printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
 #endif
 }
@@ -95,9 +94,10 @@ static void disable_one_interrupt(int irq)
 int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, void *arg)
 {
struct irq_action *act;
+
/* irq out of range */
if ((irq < 0) || (irq > irq_no)) {
-   puts ("IRQ out of range\n");
+   puts("IRQ out of range\n");
return -1;
}
act = &vecs[irq];
@@ -125,7 +125,7 @@ static void intc_init(void)
/* XIntc_Start - hw_interrupt enable and all interrupt enable */
intc->mer = 0x3;
 #ifdef DEBUG_INT
-   printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+   printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
 #endif
 }
@@ -160,7 +160,7 @@ int interrupts_init(void)
return 0;
 }
 
-void interrupt_handler (void)
+void interrupt_handler(void)
 {
int irqs = intc->ivr;   /* find active interrupt */
int mask = 1;
-- 
1.7.0.4

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


[U-Boot] [PATCH 06/12] microblaze: intc: Add device-tree driver configuration

2012-07-09 Thread Michal Simek
Read configuration from DTB.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/interrupts.c |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index 79ee96a..98c9110 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -29,6 +29,9 @@
 #include 
 #include 
 #include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #undef DEBUG_INT
 
@@ -134,10 +137,26 @@ int interrupts_init(void)
 {
int i;
 
+#ifndef CONFIG_OF_CONTROL
 #if defined(CONFIG_SYS_INTC_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
intc = (microblaze_intc_t *) (CONFIG_SYS_INTC_0_ADDR);
irq_no = CONFIG_SYS_INTC_0_NUM;
 #endif
+#else
+   int temp;
+   int offset = 0;
+
+   offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset,
+   "xlnx,xps-intc-1.00.a");
+   if (offset > 0) {
+   temp = fdtdec_get_addr(gd->fdt_blob, offset, "reg");
+   if (temp != FDT_ADDR_T_NONE) {
+   intc = (microblaze_intc_t *)temp;
+   irq_no = fdtdec_get_int(gd->fdt_blob, offset,
+   "xlnx,num-intr-inputs", 0);
+   }
+   }
+#endif
if (irq_no) {
vecs = calloc(1, sizeof(struct irq_action) * irq_no);
if (vecs == NULL) {
-- 
1.7.0.4

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


[U-Boot] [PATCH 07/12] microblaze: Move __udelay implementation

2012-07-09 Thread Michal Simek
Move __udelay to the timer code because of unification.
And clean coding style because of checkpatch.pl.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/timer.c  |   19 +++
 arch/microblaze/lib/Makefile |1 -
 arch/microblaze/lib/time.c   |   42 --
 3 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index ae4ffe0..cc6b897 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -41,6 +41,25 @@ ulong get_timer (ulong base)
 #endif
 
 #ifdef CONFIG_SYS_TIMER_0
+void __udelay(unsigned long usec)
+{
+   int i;
+
+   i = get_timer(0);
+   while ((get_timer(0) - i) < (usec / 1000))
+   ;
+}
+#else
+void __udelay(unsigned long usec)
+{
+   unsigned int i;
+
+   for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 1000); i++)
+   ;
+}
+#endif
+
+#ifdef CONFIG_SYS_TIMER_0
 microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
 
 void timer_isr (void *arg)
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index de0a7d3..7730695 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -29,7 +29,6 @@ SOBJS-y   +=
 
 COBJS-y+= board.o
 COBJS-y+= bootm.o
-COBJS-y+= time.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
diff --git a/arch/microblaze/lib/time.c b/arch/microblaze/lib/time.c
index da016a0..e69de29 100644
--- a/arch/microblaze/lib/time.c
+++ b/arch/microblaze/lib/time.c
@@ -1,42 +0,0 @@
-/*
- * (C) Copyright 2007 Michal Simek
- * (C) Copyright 2004 Atmark Techno, Inc.
- *
- * Michal  SIMEK 
- * Yasushi SHOJI 
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include 
-
-#ifdef CONFIG_SYS_TIMER_0
-void __udelay (unsigned long usec)
-{
-   int i;
-   i = get_timer (0);
-   while ((get_timer (0) - i) < (usec / 1000)) ;
-}
-#else
-void __udelay (unsigned long usec)
-{
-   unsigned int i;
-   for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 1000); i++);
-}
-#endif
-- 
1.7.0.4

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


[U-Boot] [PATCH 08/12] microblaze: timer: Prepare for device-tree initialization

2012-07-09 Thread Michal Simek
microblaze: Fix CONFIG_SYS_HZ usage in board config

Do not use hardcoded value. Use CONFIG_SYS_HZ instead.
Separate static configuration to single block.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/timer.c|   69 ---
 arch/microblaze/include/asm/microblaze_timer.h |3 +
 arch/microblaze/lib/board.c|5 --
 include/configs/microblaze-generic.h   |   12 +
 4 files changed, 41 insertions(+), 48 deletions(-)

diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index cc6b897..dfaaaf5 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -27,42 +27,30 @@
 #include 
 
 volatile int timestamp = 0;
+microblaze_timer_t *tmr;
 
-#ifdef CONFIG_SYS_TIMER_0
 ulong get_timer (ulong base)
 {
-   return (timestamp - base);
+   if (tmr)
+   return timestamp - base;
+   return timestamp++ - base;
 }
-#else
-ulong get_timer (ulong base)
-{
-   return (timestamp++ - base);
-}
-#endif
 
-#ifdef CONFIG_SYS_TIMER_0
 void __udelay(unsigned long usec)
 {
-   int i;
+   u32 i;
 
-   i = get_timer(0);
-   while ((get_timer(0) - i) < (usec / 1000))
-   ;
+   if (tmr) {
+   i = get_timer(0);
+   while ((get_timer(0) - i) < (usec / 1000))
+   ;
+   } else {
+   for (i = 0; i < (usec * XILINX_CLOCK_FREQ / 1000); i++)
+   ;
+   }
 }
-#else
-void __udelay(unsigned long usec)
-{
-   unsigned int i;
 
-   for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 1000); i++)
-   ;
-}
-#endif
-
-#ifdef CONFIG_SYS_TIMER_0
-microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
-
-void timer_isr (void *arg)
+static void timer_isr(void *arg)
 {
timestamp++;
tmr->control = tmr->control | TIMER_INTERRUPT;
@@ -70,15 +58,30 @@ void timer_isr (void *arg)
 
 int timer_init (void)
 {
-   tmr->loadreg = CONFIG_SYS_TIMER_0_PRELOAD;
-   tmr->control = TIMER_INTERRUPT | TIMER_RESET;
-   tmr->control =
-   TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;
-   timestamp = 0;
-   install_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void 
*)tmr);
+   u32 irq = 0;
+   u32 preload = 0;
+   u32 ret = 0;
+
+#if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
+   preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;
+   irq = CONFIG_SYS_TIMER_0_IRQ;
+   tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
+#endif
+
+   if (tmr && irq && preload) {
+   tmr->loadreg = preload;
+   tmr->control = TIMER_INTERRUPT | TIMER_RESET;
+   tmr->control = TIMER_ENABLE | TIMER_ENABLE_INTR |\
+   TIMER_RELOAD | TIMER_DOWN_COUNT;
+   timestamp = 0;
+   ret = install_interrupt_handler (irq, timer_isr, (void *)tmr);
+   if (ret)
+   tmr = NULL;
+   }
+
+   /* No problem if timer is not found/initialized */
return 0;
 }
-#endif
 
 /*
  * This function is derived from PowerPC code (read timebase as long long).
diff --git a/arch/microblaze/include/asm/microblaze_timer.h 
b/arch/microblaze/include/asm/microblaze_timer.h
index 844c8db..28e8b02 100644
--- a/arch/microblaze/include/asm/microblaze_timer.h
+++ b/arch/microblaze/include/asm/microblaze_timer.h
@@ -39,3 +39,6 @@ typedef volatile struct microblaze_timer_t {
int loadreg; /* load register TLR */
int counter; /* timer/counter register */
 } microblaze_timer_t;
+
+int timer_init(void);
+
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 8cf4266..ddbc862 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -40,9 +40,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
-#ifdef CONFIG_SYS_TIMER_0
-extern int timer_init (void);
-#endif
 #ifdef CONFIG_SYS_FSL_2
 extern void fsl_init2 (void);
 #endif
@@ -72,9 +69,7 @@ init_fnc_t *init_sequence[] = {
gpio_init,
 #endif
interrupts_init,
-#ifdef CONFIG_SYS_TIMER_0
timer_init,
-#endif
 #ifdef CONFIG_SYS_FSL_2
fsl_init2,
 #endif
diff --git a/include/configs/microblaze-generic.h 
b/include/configs/microblaze-generic.h
index 44934eb..9f90107 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -102,19 +102,11 @@
 #endif
 
 /* timer */
-#ifdef XILINX_TIMER_BASEADDR
-# if (XILINX_TIMER_IRQ != -1)
-#  define CONFIG_SYS_TIMER_0   1
+#if defined(XILINX_TIMER_BASEADD) && defined(XILINX_TIMER_IRQ)
 #  define CONFIG_SYS_TIMER_0_ADDR  XILINX_TIMER_BASEADDR
 #  define CONFIG_SYS_TIMER_0_IRQ   XILINX_TIMER_IRQ
-#  define FREQUENCEXILINX_CLOCK_FREQ
-#  define CONFIG_SYS_TIMER_0_PRELOAD   ( FREQUENCE/1000 )
-# endif
-#elif XILINX_CLOCK_FREQ
-# de

[U-Boot] [PATCH 09/12] microblaze: timer: Add device-tree driver configuration

2012-07-09 Thread Michal Simek
Read configuration from DTB.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/timer.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index dfaaaf5..91ca42b 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -25,6 +25,9 @@
 #include 
 #include 
 #include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 volatile int timestamp = 0;
 microblaze_timer_t *tmr;
@@ -62,11 +65,33 @@ int timer_init (void)
u32 preload = 0;
u32 ret = 0;
 
+#ifndef CONFIG_OF_CONTROL
 #if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;
irq = CONFIG_SYS_TIMER_0_IRQ;
tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
 #endif
+#else
+   int temp;
+   int offset = 0;
+
+   offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset,
+   "xlnx,xps-timer-1.00.a");
+   if (offset > 0) {
+   temp = fdtdec_get_addr(gd->fdt_blob, offset, "reg");
+   if (temp != FDT_ADDR_T_NONE) {
+   tmr = (microblaze_timer_t *)temp;
+   irq = fdtdec_get_int(gd->fdt_blob, offset,
+   "interrupts", -1);
+   if (irq == -1)
+   panic("Connect IRQ to system timer\n");
+   /* Set default clock frequency */
+   temp = fdtdec_get_int(gd->fdt_blob, offset,
+   "clock-frequency", 0);
+   preload = temp / CONFIG_SYS_HZ;
+   }
+   }
+#endif
 
if (tmr && irq && preload) {
tmr->loadreg = preload;
-- 
1.7.0.4

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


[U-Boot] [PATCH 10/12] microblaze: Call serial multi initialization

2012-07-09 Thread Michal Simek
Signed-off-by: Michal Simek 
---
 arch/microblaze/lib/board.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index ddbc862..37ec665 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -118,6 +119,10 @@ void board_init (void)
 */
mem_malloc_init (CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);
 
+#ifdef CONFIG_SERIAL_MULTI
+   serial_initialize();
+#endif
+
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
WATCHDOG_RESET ();
if ((*init_fnc_ptr) () != 0) {
-- 
1.7.0.4

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


[U-Boot] [PATCH 11/12] microblaze: Clean microblaze initialization

2012-07-09 Thread Michal Simek
Move board specific function to board_init function in board/ folder
Remove externs from generic board.c
Use board_init_f function in board.c file.

Signed-off-by: Michal Simek 
---
 arch/microblaze/cpu/start.S|2 +-
 arch/microblaze/lib/board.c|   17 +++--
 .../xilinx/microblaze-generic/microblaze-generic.c |   10 ++
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index 8a2f634..8564c4e 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -149,7 +149,7 @@ clear_bss:
cmp r6, r5, r4 /* check if we have reach the end */
bneir6, 2b
 3: /* jumping to board_init */
-   braiboard_init
+   braiboard_init_f
 1: bri 1b
 
 /*
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 37ec665..1dee830 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -38,13 +38,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SYS_GPIO_0
-extern int gpio_init (void);
-#endif
-#ifdef CONFIG_SYS_FSL_2
-extern void fsl_init2 (void);
-#endif
-
 /*
  * All attempts to come up with a "common" initialization sequence
  * that works for all boards and architectures failed: some of the
@@ -66,20 +59,14 @@ init_fnc_t *init_sequence[] = {
 #endif
serial_init,
console_init_f,
-#ifdef CONFIG_SYS_GPIO_0
-   gpio_init,
-#endif
interrupts_init,
timer_init,
-#ifdef CONFIG_SYS_FSL_2
-   fsl_init2,
-#endif
NULL,
 };
 
 unsigned long monitor_flash_len;
 
-void board_init (void)
+void board_init_f(ulong not_used)
 {
bd_t *bd;
init_fnc_t **init_fnc_ptr;
@@ -189,6 +176,8 @@ void board_init (void)
/* Initialize the console (after the relocation and devices init) */
console_init_r();
 
+   board_init();
+
/* Initialize from environment */
load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c 
b/board/xilinx/microblaze-generic/microblaze-generic.c
index 4a719ba..608fb20 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifdef CONFIG_SYS_GPIO_0
@@ -69,6 +71,14 @@ int fsl_init2 (void) {
 }
 #endif
 
+void board_init(void)
+{
+   gpio_init();
+#ifdef CONFIG_SYS_FSL_2
+   fsl_init2();
+#endif
+}
+
 int board_eth_init(bd_t *bis)
 {
int ret = 0;
-- 
1.7.0.4

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


[U-Boot] [PATCH 12/12] microblaze: board: Use bi_flashstart instead of CONFIG_SYS_FLASH_BASE

2012-07-09 Thread Michal Simek
Prepare for device-tree driven configuration.

Signed-off-by: Michal Simek 
---
 arch/microblaze/lib/board.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 1dee830..03ebc97 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -134,7 +134,8 @@ void board_init_f(ulong not_used)
 #if defined(CONFIG_CMD_FLASH)
puts ("Flash: ");
bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
-   if (0 < (flash_size = flash_init ())) {
+   flash_size = flash_init();
+   if (bd->bi_flashstart && flash_size > 0) {
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
char *s;
 
@@ -147,7 +148,8 @@ void board_init_f(ulong not_used)
s = getenv ("flashchecksum");
if (s && (*s == 'y')) {
printf ("  CRC: %08X",
-   crc32 (0, (const unsigned char *) 
CONFIG_SYS_FLASH_BASE, flash_size)
+   crc32(0, (const u8 *)bd->bi_flashstart,
+   flash_size)
);
}
putc ('\n');
@@ -155,7 +157,7 @@ void board_init_f(ulong not_used)
print_size (flash_size, "\n");
 # endif /* CONFIG_SYS_FLASH_CHECKSUM */
bd->bi_flashsize = flash_size;
-   bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
+   bd->bi_flashoffset = bd->bi_flashstart + flash_size;
} else {
puts ("Flash init FAILED");
bd->bi_flashstart = 0;
-- 
1.7.0.4

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


[U-Boot] [PATCH 02/12] microblaze: Remove extern from board.c

2012-07-09 Thread Michal Simek
eth_init() is defined at include/net.h.

Signed-off-by: Michal Simek 
---
 arch/microblaze/lib/board.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 4146f5c..1cf895b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -42,10 +42,6 @@ extern int gpio_init (void);
 #ifdef CONFIG_SYS_INTC_0
 extern int interrupts_init (void);
 #endif
-
-#if defined(CONFIG_CMD_NET)
-extern int eth_init (bd_t * bis);
-#endif
 #ifdef CONFIG_SYS_TIMER_0
 extern int timer_init (void);
 #endif
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH 1/3] MX28: SPI: Refactor spi_xfer a bit

2012-07-09 Thread Stefano Babic
On 09/07/2012 03:33, Marek Vasut wrote:
> This makes it easier to adapt for addition of DMA support.
> 
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Otavio Salvador 
> Cc: Stefano Babic 
> Cc: Wolfgang Denk 
> ---
>  drivers/spi/mxs_spi.c |   31 +--
>  1 file changed, 21 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> index 7859536..a47b25b 100644
> --- a/drivers/spi/mxs_spi.c
> +++ b/drivers/spi/mxs_spi.c
> @@ -146,20 +146,31 @@ int spi_xfer(struct spi_slave *slave, unsigned int 
> bitlen,
>   struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave);
>   struct mx28_ssp_regs *ssp_regs = mxs_slave->regs;
>   int len = bitlen / 8;
> - const char *tx = dout;
> - char *rx = din;
>   char dummy;
> + int write = 0;
> + char *data = NULL;
>  
>   if (bitlen == 0) {
>   if (flags & SPI_XFER_END) {
> - rx = &dummy;
> + din = (void *)&dummy;
>   len = 1;
>   } else
>   return 0;
>   }
>  
> - if (!rx && !tx)
> + if (din && dout) {
> + /* Half-duplex only */
> + return -EINVAL;
> + } else if (!din && !dout) {
> + /* No data */
>   return 0;
> + } else if (dout) {
> + data = (char *)dout;
> + write = 1;
> + } else if (din) {
> + data = (char *)din;
> + write = 0;
> + }

You do not need this if-then-else chain. I think is more readable with :

if (din && dout) {
/* Half-duplex only */
return -EINVAL;
}
if (!din && !dout) {
/* No data */
return 0;
}


Best regards,
Stefano Babic


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

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


Re: [U-Boot] [PATCH 1/3] MX28: SPI: Refactor spi_xfer a bit

2012-07-09 Thread Marek Vasut
Dear Stefano Babic,

> On 09/07/2012 03:33, Marek Vasut wrote:
> > This makes it easier to adapt for addition of DMA support.
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Fabio Estevam 
> > Cc: Otavio Salvador 
> > Cc: Stefano Babic 
> > Cc: Wolfgang Denk 
> > ---

[...]

> You do not need this if-then-else chain. I think is more readable with :

I think you're right ;-)

>   if (din && dout) {
>   /* Half-duplex only */
>   return -EINVAL;
>   }
>   if (!din && !dout) {
>   /* No data */
>   return 0;
>   }
> 
> 
> Best regards,
> Stefano Babic

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


[U-Boot] [PATCH 1/3 V2] MX28: SPI: Refactor spi_xfer a bit

2012-07-09 Thread Marek Vasut
This makes it easier to adapt for addition of DMA support.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Otavio Salvador 
Cc: Stefano Babic 
Cc: Wolfgang Denk 
---
 drivers/spi/mxs_spi.c |   32 ++--
 1 file changed, 22 insertions(+), 10 deletions(-)

V2: Kill the if-elseif-elseif-else chain

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 7859536..a21b02b 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -146,21 +146,33 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave);
struct mx28_ssp_regs *ssp_regs = mxs_slave->regs;
int len = bitlen / 8;
-   const char *tx = dout;
-   char *rx = din;
char dummy;
+   int write = 0;
+   char *data = NULL;
 
if (bitlen == 0) {
if (flags & SPI_XFER_END) {
-   rx = &dummy;
+   din = (void *)&dummy;
len = 1;
} else
return 0;
}
 
-   if (!rx && !tx)
+   /* Half-duplex only */
+   if (din && dout)
+   return -EINVAL;
+   /* No data */
+   if (!din && !dout)
return 0;
 
+   if (dout) {
+   data = (char *)dout;
+   write = 1;
+   } else if (din) {
+   data = (char *)din;
+   write = 0;
+   }
+
if (flags & SPI_XFER_BEGIN)
mxs_spi_start_xfer(ssp_regs);
 
@@ -171,7 +183,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
if ((flags & SPI_XFER_END) && !len)
mxs_spi_end_xfer(ssp_regs);
 
-   if (tx)
+   if (write)
writel(SSP_CTRL0_READ, &ssp_regs->hw_ssp_ctrl0_clr);
else
writel(SSP_CTRL0_READ, &ssp_regs->hw_ssp_ctrl0_set);
@@ -184,20 +196,20 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
return -ETIMEDOUT;
}
 
-   if (tx)
-   writel(*tx++, &ssp_regs->hw_ssp_data);
+   if (write)
+   writel(*data++, &ssp_regs->hw_ssp_data);
 
writel(SSP_CTRL0_DATA_XFER, &ssp_regs->hw_ssp_ctrl0_set);
 
-   if (rx) {
+   if (!write) {
if (mx28_wait_mask_clr(&ssp_regs->hw_ssp_status_reg,
SSP_STATUS_FIFO_EMPTY, MXS_SPI_MAX_TIMEOUT)) {
printf("MXS SPI: Timeout waiting for data\n");
return -ETIMEDOUT;
}
 
-   *rx = readl(&ssp_regs->hw_ssp_data);
-   rx++;
+   *data = readl(&ssp_regs->hw_ssp_data);
+   data++;
}
 
if (mx28_wait_mask_clr(&ssp_regs->hw_ssp_ctrl0_reg,
-- 
1.7.10.4

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


[U-Boot] [PATCH 2/3 RESEND] MX28: SPI: Pull out the PIO transfer function

2012-07-09 Thread Marek Vasut
Pull out all the PIO transfer logic into separate function,
so DMA can be added.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Otavio Salvador 
Cc: Stefano Babic 
Cc: Wolfgang Denk 
---
 drivers/spi/mxs_spi.c |   74 +++--
 1 file changed, 41 insertions(+), 33 deletions(-)

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index a21b02b..1733203 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -140,47 +140,19 @@ static void mxs_spi_end_xfer(struct mx28_ssp_regs 
*ssp_regs)
writel(SSP_CTRL0_IGNORE_CRC, &ssp_regs->hw_ssp_ctrl0_set);
 }
 
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
-   const void *dout, void *din, unsigned long flags)
+static int mxs_spi_xfer_pio(struct mxs_spi_slave *slave,
+   char *data, int length, int write, unsigned long flags)
 {
-   struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave);
-   struct mx28_ssp_regs *ssp_regs = mxs_slave->regs;
-   int len = bitlen / 8;
-   char dummy;
-   int write = 0;
-   char *data = NULL;
-
-   if (bitlen == 0) {
-   if (flags & SPI_XFER_END) {
-   din = (void *)&dummy;
-   len = 1;
-   } else
-   return 0;
-   }
-
-   /* Half-duplex only */
-   if (din && dout)
-   return -EINVAL;
-   /* No data */
-   if (!din && !dout)
-   return 0;
-
-   if (dout) {
-   data = (char *)dout;
-   write = 1;
-   } else if (din) {
-   data = (char *)din;
-   write = 0;
-   }
+   struct mx28_ssp_regs *ssp_regs = slave->regs;
 
if (flags & SPI_XFER_BEGIN)
mxs_spi_start_xfer(ssp_regs);
 
-   while (len--) {
+   while (length--) {
/* We transfer 1 byte */
writel(1, &ssp_regs->hw_ssp_xfer_size);
 
-   if ((flags & SPI_XFER_END) && !len)
+   if ((flags & SPI_XFER_END) && !length)
mxs_spi_end_xfer(ssp_regs);
 
if (write)
@@ -220,4 +192,40 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
}
 
return 0;
+
+}
+
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
+   const void *dout, void *din, unsigned long flags)
+{
+   struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave);
+   int len = bitlen / 8;
+   char dummy;
+   int write = 0;
+   char *data = NULL;
+
+   if (bitlen == 0) {
+   if (flags & SPI_XFER_END) {
+   din = (void *)&dummy;
+   len = 1;
+   } else
+   return 0;
+   }
+
+   /* Half-duplex only */
+   if (din && dout)
+   return -EINVAL;
+   /* No data */
+   if (!din && !dout)
+   return 0;
+
+   if (dout) {
+   data = (char *)dout;
+   write = 1;
+   } else if (din) {
+   data = (char *)din;
+   write = 0;
+   }
+
+   return mxs_spi_xfer_pio(mxs_slave, data, len, write, flags);
 }
-- 
1.7.10.4

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


[U-Boot] [PATCH 3/3 V2] MX28: SPI: Add DMA transfer support

2012-07-09 Thread Marek Vasut
The DMA transfers happen only if the transfered data are larger
than 512 bytes. Otherwise PIO is used. This is a small speed
optimization.

The DMA transfer doesn't work if unaligned transfer is requested
due to the limitation of the DMA controller. This has to be fixed
by introducing generic bounce buffer. Therefore the DMA feature
is now disabled by default.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Otavio Salvador 
Cc: Stefano Babic 
Cc: Wolfgang Denk 
---
 drivers/spi/mxs_spi.c |  117 -
 1 file changed, 116 insertions(+), 1 deletion(-)

V2: Only do the DMA when the buffer is properly aligned.

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 1733203..4ff8474 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -31,17 +31,32 @@
 #include 
 #include 
 #include 
+#include 
 
 #defineMXS_SPI_MAX_TIMEOUT 100
 #defineMXS_SPI_PORT_OFFSET 0x2000
 #define MXS_SSP_CHIPSELECT_MASK0x0030
 #define MXS_SSP_CHIPSELECT_SHIFT   20
 
+#define MXSSSP_SMALL_TRANSFER  512
+
+/*
+ * CONFIG_MXS_SPI_DMA_ENABLE: Experimental mixed PIO/DMA support for MXS SPI
+ *host. Use with utmost caution!
+ *
+ *Enabling this is not yet recommended since this
+ *still doesn't support transfers to/from unaligned
+ *addresses. Therefore this driver will not work
+ *for example with saving environment. This is
+ *caused by DMA alignment constraints on MXS.
+ */
+
 struct mxs_spi_slave {
struct spi_slaveslave;
uint32_tmax_khz;
uint32_tmode;
struct mx28_ssp_regs*regs;
+   struct mxs_dma_desc *desc;
 };
 
 static inline struct mxs_spi_slave *to_mxs_slave(struct spi_slave *slave)
@@ -69,6 +84,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
uint32_t addr;
struct mx28_ssp_regs *ssp_regs;
int reg;
+   struct mxs_dma_desc *desc;
 
if (!spi_cs_is_valid(bus, cs)) {
printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);
@@ -79,6 +95,13 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
if (!mxs_slave)
return NULL;
 
+   desc = mxs_dma_desc_alloc();
+   if (!desc)
+   goto err_desc;
+
+   if (mxs_dma_init_channel(bus))
+   goto err_init;
+
addr = MXS_SSP0_BASE + (bus * MXS_SPI_PORT_OFFSET);
 
mxs_slave->slave.bus = bus;
@@ -86,6 +109,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
mxs_slave->max_khz = max_hz / 1000;
mxs_slave->mode = mode;
mxs_slave->regs = (struct mx28_ssp_regs *)addr;
+   mxs_slave->desc = desc;
ssp_regs = mxs_slave->regs;
 
reg = readl(&ssp_regs->hw_ssp_ctrl0);
@@ -94,11 +118,18 @@ struct spi_slave *spi_setup_slave(unsigned int bus, 
unsigned int cs,
 
writel(reg, &ssp_regs->hw_ssp_ctrl0);
return &mxs_slave->slave;
+
+err_init:
+   mxs_dma_desc_free(desc);
+err_desc:
+   free(mxs_slave);
+   return NULL;
 }
 
 void spi_free_slave(struct spi_slave *slave)
 {
struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave);
+   mxs_dma_desc_free(mxs_slave->desc);
free(mxs_slave);
 }
 
@@ -195,15 +226,81 @@ static int mxs_spi_xfer_pio(struct mxs_spi_slave *slave,
 
 }
 
+static int mxs_spi_xfer_dma(struct mxs_spi_slave *slave,
+   char *data, int length, int write, unsigned long flags)
+{
+   struct mxs_dma_desc *desc = slave->desc;
+   struct mx28_ssp_regs *ssp_regs = slave->regs;
+   uint32_t ctrl0 = SSP_CTRL0_DATA_XFER;
+   uint32_t cache_data_count;
+   int dmach;
+
+   memset(desc, 0, sizeof(struct mxs_dma_desc));
+   desc->address = (dma_addr_t)desc;
+
+   if (flags & SPI_XFER_BEGIN)
+   ctrl0 |= SSP_CTRL0_LOCK_CS;
+   if (flags & SPI_XFER_END)
+   ctrl0 |= SSP_CTRL0_IGNORE_CRC;
+   if (!write)
+   ctrl0 |= SSP_CTRL0_READ;
+
+   writel(length, &ssp_regs->hw_ssp_xfer_size);
+
+   if (length % ARCH_DMA_MINALIGN)
+   cache_data_count = roundup(length, ARCH_DMA_MINALIGN);
+   else
+   cache_data_count = length;
+
+   if (!write) {
+   slave->desc->cmd.data = MXS_DMA_DESC_COMMAND_DMA_WRITE;
+   slave->desc->cmd.address = (dma_addr_t)data;
+   } else {
+   slave->desc->cmd.data = MXS_DMA_DESC_COMMAND_DMA_READ;
+   slave->desc->cmd.address = (dma_addr_t)data;
+
+   /* Flush data to DRAM so DMA can pick them up */
+   flush_dcache_range((uint32_t)data,
+   (uint32_t)(data + cache_data_count));
+   }
+
+   slave->desc->cmd.data |= MXS_

[U-Boot] [PATCH v3 1/6] arm: rmobile: kzm9g: Modify sdram area

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Reserve first 16MB for RT-CPU (as same as kernel config).

Signed-off-by: Tetsuyuki Kobayashi 
Signed-off-by: Nobuhiro Iwamatsu 
---
Changes for v2:
 - No change. Just rebased.
Changes for v3:
 - No change.

 include/configs/kzm9g.h |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h
index 7567d46..bcf2cd8 100644
--- a/include/configs/kzm9g.h
+++ b/include/configs/kzm9g.h
@@ -97,8 +97,9 @@
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_INIT_RAM_ADDR + \
 CONFIG_SYS_INIT_RAM_SIZE - \
 GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_SDRAM_BASE  KZM_SDRAM_BASE
-#define CONFIG_SYS_SDRAM_SIZE  PHYS_SDRAM_SIZE
+#define CONFIG_SDRAM_OFFSET_FOR_RT (16 * 1024 * 1024)
+#define CONFIG_SYS_SDRAM_BASE  (KZM_SDRAM_BASE + CONFIG_SDRAM_OFFSET_FOR_RT)
+#define CONFIG_SYS_SDRAM_SIZE  (PHYS_SDRAM_SIZE - CONFIG_SDRAM_OFFSET_FOR_RT)
 #define CONFIG_SYS_LOAD_ADDR   (CONFIG_SYS_SDRAM_BASE + 32 * 1024 * 1024)
 
 #define CONFIG_SYS_MONITOR_BASE(KZM_FLASH_BASE)
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 0/6] arm: rmobile: kzm9g: enable booting Linux kernel

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Hi, Iwamatsu-san

This is v3 patch set for kzm9g.
I add a patch for modifying bus controller setting for CS4.

After this patch set, LTSI kernel can boot on KZM-A9-GT board.
It seems stable as before.

Tetsuyuki Kobayashi (6):
  arm: rmobile: kzm9g: Modify sdram area
  arm: rmobile: kzm9g: Adjust low level hardware setting
  arm: rmobile: kzm9g: change prompt to board specific
  arm: rmobile: kzm9g: Add dummy member to struct sh73a0_rwdt
  MAINTAINERS: Add Tetsuyuki Kobayshi for kzm9g
  arm: rmobile: kzm9g: Modify bus controller setting for CS4

 MAINTAINERS|1 +
 arch/arm/include/asm/arch-rmobile/sh73a0.h |6 +-
 board/kmc/kzm9g/kzm9g.c|6 --
 include/configs/kzm9g.h|7 ---
 4 files changed, 14 insertions(+), 6 deletions(-)

-- 
1.7.9.5

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


[U-Boot] [PATCH v3 4/6] arm: rmobile: kzm9g: Add dummy member to struct sh73a0_rwdt

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Add dummy member to struct sh73a0_rwdt in sh73a0.h.
Without this, initializing watch dog timer goes wrong.

Signed-off-by: Tetsuyuki Kobayashi 
---
Changes for v2:
 - New
Changes for v3:
 - No change

 arch/arm/include/asm/arch-rmobile/sh73a0.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/arch-rmobile/sh73a0.h 
b/arch/arm/include/asm/arch-rmobile/sh73a0.h
index ad59be7..74d1c48 100644
--- a/arch/arm/include/asm/arch-rmobile/sh73a0.h
+++ b/arch/arm/include/asm/arch-rmobile/sh73a0.h
@@ -60,7 +60,9 @@
 /* RWDT */
 struct sh73a0_rwdt {
volatile u16 rwtcnt0;   /* 0x00 */
+   volatile u16 dummy0;/* 0x02 */
volatile u16 rwtcsra0;  /* 0x04 */
+   volatile u16 dummy1;/* 0x06 */
volatile u16 rwtcsrb0;  /* 0x08 */
 };
 
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 3/6] arm: rmobile: kzm9g: change prompt to board specific

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Change U-Boot prompt to board specific one.

Signed-off-by: Tetsuyuki Kobayashi 
Signed-off-by: Nobuhiro Iwamatsu 
---
Changes for v2:
 - No change. Just rebased.
Changes for v3:
 - No change.

 include/configs/kzm9g.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h
index bcf2cd8..bd157d9 100644
--- a/include/configs/kzm9g.h
+++ b/include/configs/kzm9g.h
@@ -70,7 +70,7 @@
 
 /* prompt */
 #define CONFIG_SYS_LONGHELP
-#define CONFIG_SYS_PROMPT  "> "
+#define CONFIG_SYS_PROMPT  "KZM-A9-GT# "
 #define CONFIG_SYS_CBSIZE  256
 #define CONFIG_SYS_PBSIZE  256
 #define CONFIG_SYS_MAXARGS 16
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 2/6] arm: rmobile: kzm9g: Adjust low level hardware setting

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Adjust low level hardware setting in s_init.

Signed-off-by: Tetsuyuki Kobayashi 
Signed-off-by: Nobuhiro Iwamatsu 
---
Changes for v2:
 - No change. Just rebased.
Changes for v3:
 - No change.

 arch/arm/include/asm/arch-rmobile/sh73a0.h |4 +++-
 board/kmc/kzm9g/kzm9g.c|2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-rmobile/sh73a0.h 
b/arch/arm/include/asm/arch-rmobile/sh73a0.h
index 605dd44..ad59be7 100644
--- a/arch/arm/include/asm/arch-rmobile/sh73a0.h
+++ b/arch/arm/include/asm/arch-rmobile/sh73a0.h
@@ -229,7 +229,9 @@ struct sh73a0_sbsc_cpg {
volatile u32 smstpcr3;
volatile u32 smstpcr4;
volatile u32 smstpcr5;
-   volatile u32 dummy11[10]; /* 0x148 .. 0x16c */
+   volatile u32 dummy11[2]; /* 0x148 .. 0x14c */
+   volatile u32 cpgxxcs4;
+   volatile u32 dummy12[7]; /* 0x154 .. 0x16c */
volatile u32 dvfscr2;
volatile u32 dvfscr3;
volatile u32 dvfscr4;
diff --git a/board/kmc/kzm9g/kzm9g.c b/board/kmc/kzm9g/kzm9g.c
index 8d7c61a..3716483 100644
--- a/board/kmc/kzm9g/kzm9g.c
+++ b/board/kmc/kzm9g/kzm9g.c
@@ -163,6 +163,7 @@ void s_init(void)
#define LIFEC_SEC_SRC_BIT   (1 << 15)
writel(readl(LIFEC_SEC_SRC) & ~LIFEC_SEC_SRC_BIT, LIFEC_SEC_SRC);
 
+   clrbits_le32(&cpg->smstpcr3, (1 << 15));
clrbits_le32(&cpg_srcr->srcr3, (1 << 15));
clrbits_le32(&cpg->smstpcr2, (1 << 18));
clrbits_le32(&cpg_srcr->srcr2, (1 << 18));
@@ -266,6 +267,7 @@ void s_init(void)
 
writel(0x0b0b, &cpg->frqcrd);
cmp_loop(&cpg->frqcrd, 0x8000, 0x0);
+   writel(0xfffc, &cpg->cpgxxcs4);
 }
 
 int board_early_init_f(void)
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 6/6] arm: rmobile: kzm9g: Modify bus controller setting for CS4

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Problem:
Linux kernel hangs up when it write a file to NFS mounted directory.
Solution:
Modify bus controller setting for CS4, which connected smsc9221 ethernet
controller.

Detail:
Modify CS4BCR bit[29:28] (IWW[1:0]) from 00 to 11.
It inserts 4 idle cycles between Write-Read/Write-Write cycles.
Modify CS4WCR bit[18:16] (WW[2:0]) from 101 to 111
It specifies the number of cycles necessary for write access.

Signed-off-by: Tetsuyuki Kobayashi 
---
Changes for v3:
 - New

 board/kmc/kzm9g/kzm9g.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/kmc/kzm9g/kzm9g.c b/board/kmc/kzm9g/kzm9g.c
index 3716483..8cefbef 100644
--- a/board/kmc/kzm9g/kzm9g.c
+++ b/board/kmc/kzm9g/kzm9g.c
@@ -31,9 +31,9 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #define CS0BCR_D (0x06C00400)
-#define CS4BCR_D (0x06C00400)
+#define CS4BCR_D (0x36C00400)
 #define CS0WCR_D (0x55062C42)
-#define CS4WCR_D (0x19051443)
+#define CS4WCR_D (0x19071443)
 #define CMNCR_BROMMD0   (1 << 21)
 #define CMNCR_BROMMD1   (1 << 22)
 #define CMNCR_BROMMD   (CMNCR_BROMMD0|CMNCR_BROMMD1)
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 5/6] MAINTAINERS: Add Tetsuyuki Kobayshi for kzm9g

2012-07-09 Thread Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi 

Add Tetsuyuki Kobayshi for kzm9g in MAINTAINERS file.

Signed-off-by: Tetsuyuki Kobayashi 
---
Changes for v2:
 - New
Changes for v3:
 - No change

 MAINTAINERS |1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 45446f4..55a6c1b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -947,6 +947,7 @@ Vladimir Zapolskiy 
devkit3250  lpc32xx
 
 Nobuhiro Iwamatsu 
+Tetsuyuki Kobayashi 
 
kzm9g   SH73A0 (RMOBILE SoC)
 
-- 
1.7.9.5

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


Re: [U-Boot] [V3] arm: Fix to mistake clean the memory space

2012-07-09 Thread Andreas BieĂźmann
Dear Zhong Hongbo,

On 07.07.2012 15:19, Zhong Hongbo wrote:
> On 07/07/2012 05:58 PM, Albert ARIBAUD wrote:
>> Hi Zhong Hongbo,
>>
>> On Sat,  7 Jul 2012 17:47:16 +0800, Zhong Hongbo  wrote:
>>> From: Zhong Hongbo 

>> Almost there... The PATCH part is missing, i.e. you should not tag "[V3]"
>> but "[PATCH V3]".
> 
> Ok,

well, you sent v4 but didn't respect this comment. Please read
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
especially this part:

---8<---
Make an appropriate note that this is a re-submission in the subject
line, eg. "[PATCH v2] Add support for feature X". git format-patch
--subject-prefix="PATCH v2" can be used in this case.
--->8---

Another option is to use 'git send-email --annotate ...' and change the
subject line.

>> Just to make sure patchwork gets it right, please repost a V4 of this
>> properly tagged with "[PATCH V4]".

I think patchwork got it right http://patchwork.ozlabs.org/patch/169595/
and http://patchwork.ozlabs.org/patch/169572/. So I would say you do not
need to resend a v5 of the same patch cause of this formal 'fault'.
Albert, do you have the same opinion?

Albert, I think we should count this a fix and pull into this upcoming
release. How do you think about?

Best regards

Andreas BieĂźmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] at91sam9263ek: enable useful commands

2012-07-09 Thread Andreas BieĂźmann
On 28.06.2012 14:32, Andreas BieĂźmann wrote:
> Signed-off-by: Andreas BieĂźmann 
> cc: Stelian Pop 
> ---
>  include/configs/at91sam9263ek.h |2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
> index f2163f1..2d46502 100644
> --- a/include/configs/at91sam9263ek.h
> +++ b/include/configs/at91sam9263ek.h
> @@ -108,10 +108,8 @@
>   * Command line configuration.
>   */
>  #include 
> -#undef CONFIG_CMD_BDI
>  #undef CONFIG_CMD_FPGA
>  #undef CONFIG_CMD_IMI
> -#undef CONFIG_CMD_IMLS

NAK, enabling imls  breaks all the configurations where NOR is not enabled:

---8<---
Configuring for at91sam9263ek_nandflash - Board: at91sam9263ek, Options:
AT91SAM9263,SYS_USE_NANDFLASH
/home/abiessmann/source/git_projects/u-boot-atmel/include/mtd/cfi_flash.h:174:22:
error: unknown type name 'flash_info_t'
/home/abiessmann/source/git_projects/u-boot-atmel/include/mtd/cfi_flash.h:174:43:
error: unknown type name 'flash_sect_t'
cmd_bootm.c:82:1: error: unknown type name 'flash_info_t'
cmd_bootm.c:1164:2: error: unknown type name 'flash_info_t'
cmd_bootm.c:1169:7: error: 'CONFIG_SYS_MAX_FLASH_BANKS' undeclared
(first use in this function)
cmd_bootm.c:1171:11: error: request for member 'flash_id' in something
not a structure or union
cmd_bootm.c:1171:25: error: 'FLASH_UNKNOWN' undeclared (first use in
this function)
cmd_bootm.c:1173:23: error: request for member 'sector_count' in
something not a structure or union
cmd_bootm.c:1175:22: error: request for member 'start' in something not
a structure or union
--->8---


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


Re: [U-Boot] [V4] arm: Fix to mistake clean the memory space

2012-07-09 Thread Andreas BieĂźmann
On 07.07.2012 15:24, Zhong Hongbo wrote:
> From: Zhong Hongbo 
> 
> In currently, when __bss_start is equal to __bss_end__,
> The bss loop will clear all the things in memory space.
> 
> But just only when __bss_end__ greater than __bss_start__,
> we do the clear bss section operation.
> 
> Signed-off-by: Zhong Hongbo 

Acked-by: Andreas BieĂźmann 

> ---
> Change for V1
>   - Fixed bss clear operation, no just skip it.
>   - Adjust the commit information
> Change for V2
>   - Modify all the bss clean operation for arm platform
>   - Adjust the title
> Change for V3
>   - Modify the history information and the tag ot the patch
> ---
>  arch/arm/cpu/arm1136/start.S   |8 +---
>  arch/arm/cpu/arm1176/start.S   |9 +
>  arch/arm/cpu/arm720t/start.S   |8 +---
>  arch/arm/cpu/arm920t/start.S   |8 +---
>  arch/arm/cpu/arm925t/start.S   |8 +---
>  arch/arm/cpu/arm946es/start.S  |8 +---
>  arch/arm/cpu/arm_intcm/start.S |8 +---
>  arch/arm/cpu/armv7/start.S |8 +---
>  arch/arm/cpu/ixp/start.S   |8 +---
>  arch/arm/cpu/lh7a40x/start.S   |8 +---
>  arch/arm/cpu/pxa/start.S   |8 +---
>  arch/arm/cpu/s3c44b0/start.S   |8 +---
>  arch/arm/cpu/sa1100/start.S|8 +---
>  13 files changed, 65 insertions(+), 40 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/7] dfu:usb: Composite USB download gadget with DFU function

2012-07-09 Thread Lukasz Majewski
Hi Marek,


> Those patches add support for composite USB download gadget.
> This gadget (at least for now) is equipped with DFU download function.
> 
> A separate DFU back-end and front-end have been added.
> Back-end is placed at ./drivers/dfu directory. The front-end is
> implemented as USB function.
> 
> The back-end is written in a generic manner with storage device
> specific code separated (eMMC).
> 
> DFU specification can be found at:
> http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_standard
> 
> Example usage:
> 
> u-boot side: dfu mmc 0
> PC: dfu-util -U IMAGE.bin -a uImage (for upload)
> dfu-util -D uImage -a uImage (download)
> 
> To list the alt settings:
> dfu mmc 0 list
> 
> Test HW:
> Exynos4210 Trats board
> 
> 
> Lukasz Majewski (7):
>   dfu:usb: Support for g_dnl composite download gadget.
>   dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget
>   dfu: DFU backend implementation
>   dfu: MMC specific routines for DFU operation
>   dfu:cmd: Support for DFU u-boot command
>   arm:trats: Support for USB UDC driver at TRATS board.
>   arm:trats: Enable g_dnl composite USB gadget with embedded DFU
> function on TRATS

Do you have more comments about those patches? 


-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/7] dfu:usb: Composite USB download gadget with DFU function

2012-07-09 Thread Tom Rini
On Mon, Jul 09, 2012 at 01:28:27PM +0200, Lukasz Majewski wrote:
> Hi Marek,
> 
> 
> > Those patches add support for composite USB download gadget.
> > This gadget (at least for now) is equipped with DFU download function.
> > 
> > A separate DFU back-end and front-end have been added.
> > Back-end is placed at ./drivers/dfu directory. The front-end is
> > implemented as USB function.
> > 
> > The back-end is written in a generic manner with storage device
> > specific code separated (eMMC).
> > 
> > DFU specification can be found at:
> > http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_standard
> > 
> > Example usage:
> > 
> > u-boot side: dfu mmc 0
> > PC: dfu-util -U IMAGE.bin -a uImage (for upload)
> > dfu-util -D uImage -a uImage (download)
> > 
> > To list the alt settings:
> > dfu mmc 0 list
> > 
> > Test HW:
> > Exynos4210 Trats board
> > 
> > 
> > Lukasz Majewski (7):
> >   dfu:usb: Support for g_dnl composite download gadget.
> >   dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget
> >   dfu: DFU backend implementation
> >   dfu: MMC specific routines for DFU operation
> >   dfu:cmd: Support for DFU u-boot command
> >   arm:trats: Support for USB UDC driver at TRATS board.
> >   arm:trats: Enable g_dnl composite USB gadget with embedded DFU
> > function on TRATS
> 
> Do you have more comments about those patches? 

I _think_ he's been busy with exams and preparing for the U-Boot BoF
this week.  I'll make sure this gets brought up then however.

-- 
Tom


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


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Holger Brunck
Hi,

On 07/04/2012 11:20 AM, Prafulla Wadaskar wrote:
>>> Sure it would be great if we had the time and resources to
>> contribute a generic
>>> driver for these switches. Unfortunately it is not the case and we
>> have only
>>> developed a simple driver with limited features that suits our
>> current needs.
>>>
>>> Since we know it's very limited, we have intentionally chosen to put
>> in in our
>>> board/keymile directory so that it's obvious that it is (currently)
>> not intended
>>> to be used nor was it tested on other boards or with other switches.
>>
>> Personally I welcome such a driver submission to mainline as it can be
>> a
>> starting point for someone else later.
>>
>>> The question now is: does u-boot allow some boards (or family of
>> boards) to
>>> integrate some board codes or drivers ? It was until now our
>> understanding that
>>> u-boot allows this. This code definitely fits into this category.
>>
>> This is also my understanding and actually our source code has lots of
>> them and many people are thankful to find such code (if they are able
>> to
>> find it ;)
>>
>>> As for the generic driver, if someone contributes one (the current
>> driver can be
>>> used as a basis), we will be very happy to drop this code and use
>> the generic
>>> driver.
>>
>> Actually I would go even further and say that a generic driver can
>> only
>> be started when there are at least two or more users of the code.
>> One should probably think about not making too many short-sighted
>> assumptions when working on a driver but to think that one could
>> develop
>> a generic driver from one device only would be foolish.
>>
>> So Prafulla, can you please reconsider to add the driver?
> 
> Hi Detlev
> Clear NAK for this patch
> 
> Let's put it in drivers/net/phy/
> FYI: there are several drivers used by just one board,
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ vim drivers/net/phy/Makefile
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ grep -Irn 
> "CONFIG_PHY_ATHEROS" include/configs/*
> include/configs/microblaze-generic.h:346:# define CONFIG_PHY_ATHEROS1
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ vim drivers/net/phy/Makefile
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ grep -Irn 
> "CONFIG_PHY_BROADCOM" include/configs/*
> include/configs/microblaze-generic.h:347:# define CONFIG_PHY_BROADCOM   1
> 
> Anyways peripheral driver should go in drivers/
>

yes there are maybe drivers which proof your concept, but there are many others
in the board related code which do the opposite.

But I think this topic should be discussed not in the context of this patch.
It's a general question. I 100% agree with Detlev's explanation. If a new very
limited HW driver is added to the repo I see good reasons to keep it in the
folder for the board. If a second user comes up and wants to enhance the driver
for his needs he can still move driver then. But if no other user for this
driver is there and maybe in the future the board needs to be removed because
it's broken it's much easier to remove _all_ related code when it's located in
one directory. If the code is spread over several directories it's much harder
to track.

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


Re: [U-Boot] USB detection

2012-07-09 Thread Albert ARIBAUD
Hi Manukumar,

On Mon, 09 Jul 2012 14:17:49 +0530, Manukumar
 wrote:
> hello
> I checked with the hardware spec
> in that
> P1020RDB: having connection like 
> P1012processor -> PHY -> HUB -> ports
> 
> whereas in custom board
> P1012processor -> phy -> port(single usb port)
> 
> In uboot source code initializing sequence of u-boot
> is below:
> 1.usb_init()
> 2.usb_scan_devices()
> 3.usb_new_device(dev)
> 4.usb_hub_probe(dev, 0)
> 5.usb_hub_configure(dev)
> 
> 
> how can we do this in u-boot source code

I am not a USB specialist, but it seems like it is the first time ever
that U-Boot meets a board where the core's USB port is mapped directly
to a device without passing through a hub. Is this design compliant
with the USB standards?

Anyway, you seem to have nailed the (USB) root cause, so the course of
action is obvious even if its compliance with standards is not: you
need to make usb hub probing and configuration optional and enabled by
default, and to disable this option for your custom board.

> manukumar
> signal-networks

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


Re: [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h

2012-07-09 Thread Tom Rini
On Tue, Jul 03, 2012 at 08:02:47PM -0600, Stephen Warren wrote:

> This enables a more typical default set of commands. Remove explicit
> enables for commands already in the default list.
> 
> Signed-off-by: Stephen Warren 
> ---
>  include/configs/rpi_b.h |8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
> index a8883d3..9268efb 100644
> --- a/include/configs/rpi_b.h
> +++ b/include/configs/rpi_b.h
> @@ -80,7 +80,11 @@
>  #define CONFIG_AUTO_COMPLETE
>  
>  /* Commands */
> -#define CONFIG_CMD_MEMORY
> -#define CONFIG_CMD_MISC
> +#include "config_cmd_default.h"

OK, the README says "config_cmd_default.h" but every other user does
.

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


Re: [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT

2012-07-09 Thread Tom Rini
On Tue, Jul 03, 2012 at 08:02:48PM -0600, Stephen Warren wrote:
> This allows bootm/bootz to pass a device tree to the kernel.
> 
> Signed-off-by: Stephen Warren 

FWIW, I would combine this, 6 and 7 into a single commit and say "Enable
booting the Linux Kernel" and in the body mention that today we use
ATAGS and as the code moves into mainline device trees will be used and
required, so enable both for now.  This is roughly what I'm saying in my
to-post series enhancing the am335x_evm support.

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


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Wolfgang Denk
Dear Holger,

In message <4ffac8c9.1020...@keymile.com> you wrote:
> 
> > Anyways peripheral driver should go in drivers/
> 
> yes there are maybe drivers which proof your concept, but there are many 
> others
> in the board related code which do the opposite.

Yes, but bad examples are not a good reason to repeat mistakes either.

> But I think this topic should be discussed not in the context of this patch.
> It's a general question. I 100% agree with Detlev's explanation. If a new very
> limited HW driver is added to the repo I see good reasons to keep it in the
> folder for the board. If a second user comes up and wants to enhance the 
> driver
> for his needs he can still move driver then. But if no other user for this
> driver is there and maybe in the future the board needs to be removed because
> it's broken it's much easier to remove _all_ related code when it's located in
> one directory. If the code is spread over several directories it's much harder
> to track.

Sorry, but I disagree.  How many board directories are there in
U-Boot?  Several hundreds...  How many board directories did you check
to make sure none of them contains any driver that is similar to what
you implement here?

If we place the driver in your board diretory, the chances are huge it
will simply sit there and rot, and the next one who needs something
similar will reinvent the wheel because he did not find your copy.

I agree that even very simple and uncomplete implementations can co in
if the fulfil some purpose, and can form a basis for future
extensions. 

To make sure everybody sees such code, we should really add it to the
standard locations.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The best things in life are for a fee.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Detlev Zundel
Hi Wolfgang,

[...]

> Sorry, but I disagree.  How many board directories are there in
> U-Boot?  Several hundreds...  How many board directories did you check
> to make sure none of them contains any driver that is similar to what
> you implement here?
>
> If we place the driver in your board diretory, the chances are huge it
> will simply sit there and rot, and the next one who needs something
> similar will reinvent the wheel because he did not find your copy.
>
> I agree that even very simple and uncomplete implementations can co in
> if the fulfil some purpose, and can form a basis for future
> extensions. 
>
> To make sure everybody sees such code, we should really add it to the
> standard locations.

According to the current situation, we have the choice of getting good
code into a board directory or no code at all because Prafulla doesn't
accept the code in its current incarnation into a general place.  I
don't need a crystal ball to see that the project will loose code this
way.  I'm sorry that the project rejects working code and I re-ask
Prafulla to reconsider his NAK which has impact on the whole project.

Cheers
  Detlev

-- 
debian is a prototype for a future version of emacs.
 -- Thien-Thi Nguyen in <7eekubiffq@ada2.unipv.it>
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] davinci: reduce pimux_config size by storing register id instead of address

2012-07-09 Thread Tom Rini
On Sun, Apr 08, 2012 at 05:02:03PM -0400, Jérôme Carretero wrote:

> This patch does nothing except saving a few bytes (makes a difference SPL)
> 
> Signed-off-by: Jérôme Carretero 
> CC: Manjunathappa, Prakash 
> ---
>  arch/arm/cpu/arm926ejs/davinci/pinmux.c  |2 +-
>  arch/arm/include/asm/arch-davinci/davinci_misc.h |2 +-
>  arch/arm/include/asm/arch-davinci/hardware.h |2 +-
>  drivers/gpio/da8xx_gpio.c|2 --
>  4 files changed, 3 insertions(+), 5 deletions(-)

I'm OK with the concept, but it no longer applies such that boards still
build.  Please re-submit when a MAKEALL -s davinci builds and I'll get
this into /master if there's still time or /next.  Sorry for the delay,
thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Detlev Zundel
Hi Wolfgang,

[...]

> If we place the driver in your board diretory, the chances are huge it
> will simply sit there and rot, and the next one who needs something
> similar will reinvent the wheel because he did not find your copy.
>
> I agree that even very simple and uncomplete implementations can co in
> if the fulfil some purpose, and can form a basis for future
> extensions. 

I just read through our documentation on the Wiki and found nothing
relavant to such a topic.  If we make this a requirement, we should add
it so people know about it beforehand.

How about amending the U-Boot design principles with 

11. Keep It Generic

- Generic code shall be added as high as possible to the U-Boot
  abstraction hierarchy and only as a last resort into board
  directories.  This entails that peripheral drivers should be put below
  "drivers" even if they start out supporting only one specific
  configuration.  Note that it is not a requirement for such a first
  instance to be generic as genericity generally cannot be extrapolated
  from a single data point.

How does that sound?

Cheers
  Detlev

-- 
The only thing worse than generalizing from one example is generalizing
from no examples at all.
-- principles of X Window System
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] i.MX35PDK: Starting U-Boot from serial NOR-Flash

2012-07-09 Thread Hornung, Michael
>On Thu, Jul 5, 2012 at 6:09 AM, Estevam, wrote:

>Hi Michael,

Hi Fabio,

Thank you very much for your support, I'm getting closer. 

>The best way to generate 'u-boot.imx' is to simply do 'make u-boot.imx' and 
>then you don't need to pass the above line manually.

>In internal mode you should do:

>#define CONFIG_LOADADDR0x8080
>#define CONFIG_SYS_TEXT_BASE0x8780

>You probably will need to skip the RAM init in 
>board/freescale/mx35pdk/lowlevel_init.S

>For a quick test I would remove the call to 'setup_sdram' there, because RAM 
>will be inited by the values from your created imximage.cfg file.


OK, here what I did:

--- a/boards.cfg
+++ b/boards.cfg

-mx35pdk  arm arm1136 -   
freescale  mx35
+mx35pdk arm arm1136 mx35pdk   freescale  
mx35mx35pdk:IMX_CONFIG=board/freescale/mx35pdk/imximage.cfg

--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h

-#define CONFIG_SYS_TEXT_BASE   0xA000
+#define CONFIG_SYS_TEXT_BASE   0x8780

+++ b/board/freescale/mx35pdk/imximage.cfg

+BOOT_FROM  spi

+# DDR2 init
+DATA 4 0xB8001010 0x0304
+DATA 4 0xB8001010 0x030C
+DATA 4 0xB8001004 0x007ffc3f
+DATA 4 0xB8001000 0x9222
+DATA 4 0x8400 0x12345678
+DATA 4 0xB8001000 0xA222
+DATA 4 0x8000 0x87654321
+DATA 4 0x8000 0x87654321
+DATA 4 0xB8001000 0xB222
+DATA 1 0x8233 0xda
+DATA 1 0x82000780 0xda
+DATA 1 0x82000400 0xda
+DATA 4 0xB8001000 0x82226080
+DATA 4 0xB8001004 0x007ffc3f
+DATA 4 0xB800100C 0x007ffc3f
+DATA 4 0xB8001010 0x0304
+DATA 4 0xB8001008 0x2000


--- a/board/freescale/mx35pdk/lowlevel_init.S
+++ b/board/freescale/mx35pdk/lowlevel_init.S

init_sdram_start:
/*init_sdram*/
-   setup_sdram
+  /* setup_sdram */


And here the result (output on the serial line):

---
U-Boot 2012.04.01-00077-g48bcd18-dirty (Jul 09 2012 - 15:22:31)

CPU:   Freescale i.MX35 rev 2.1 at 532 MHz.
Reset cause: POR
I2C:   ready


And that's it, no more output after "I2C:   ready".  Perhaps you have some more 
hints about what to do?


With best regards

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


[U-Boot] [PATCH v2] Add support for Bluegiga APX4 Development Kit

2012-07-09 Thread Veli-Pekka Peltola
This adds support for Bluegiga APX4 Development Kit. It is built around
Freescale i.MX28. Currently supported features are: ethernet, I2C, MMC,
RTC and USB. APX4 has only one ethernet port.

Signed-off-by: Veli-Pekka Peltola 
Signed-off-by: Lauri Hintsala 
Cc: Stefano Babic 
---
Changes after v1 from last December:
 - Updating MAINTAINERS file which I missed last time
 - Started to use SPL
 - Increased size of environment on NAND
 - Better commit message

Our strategy to use fuses differs from other i.MX28 based boards. We store
serial number to CUST3. We don't have ethernet MAC address on fuses so our
customers could use their own address range. If I have some time later this
week or next week, I will do some refactorization on that so we could have
generic OTP reading function.

 MAINTAINERS|4 +
 board/bluegiga/apx4devkit/Makefile |   47 +++
 board/bluegiga/apx4devkit/apx4devkit.c |  150 
 board/bluegiga/apx4devkit/spl_boot.c   |  164 ++
 board/bluegiga/apx4devkit/u-boot.bd|   14 ++
 boards.cfg |1 +
 include/configs/apx4devkit.h   |  238 
 7 files changed, 618 insertions(+)
 create mode 100644 board/bluegiga/apx4devkit/Makefile
 create mode 100644 board/bluegiga/apx4devkit/apx4devkit.c
 create mode 100644 board/bluegiga/apx4devkit/spl_boot.c
 create mode 100644 board/bluegiga/apx4devkit/u-boot.bd
 create mode 100644 include/configs/apx4devkit.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 54eeab7..5c3fc6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -784,6 +784,10 @@ Linus Walleij 
integratorapvarious
integratorcpvarious
 
+Veli-Pekka Peltola 
+
+   apx4devkit  i.MX28
+
 Luka Perkov 
 
ib62x0  ARM926EJS
diff --git a/board/bluegiga/apx4devkit/Makefile 
b/board/bluegiga/apx4devkit/Makefile
new file mode 100644
index 000..68ab8f3
--- /dev/null
+++ b/board/bluegiga/apx4devkit/Makefile
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+ifndef CONFIG_SPL_BUILD
+COBJS  := apx4devkit.o
+else
+COBJS  := spl_boot.o
+endif
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/bluegiga/apx4devkit/apx4devkit.c 
b/board/bluegiga/apx4devkit/apx4devkit.c
new file mode 100644
index 000..c89c6aa
--- /dev/null
+++ b/board/bluegiga/apx4devkit/apx4devkit.c
@@ -0,0 +1,150 @@
+/*
+ * Bluegiga APX4 Development Kit
+ *
+ * Copyright (C) 2012 Bluegiga Technologies Oy
+ *
+ * Authors:
+ * Veli-Pekka Peltola 
+ * Lauri Hintsala 
+ *
+ * Based on m28evk.c:
+ * Copyright (C) 2011 Marek Vasut 
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Functions */
+int board_early_init_f(void)
+{
+   /* IO0 clock at 480MHz */
+   mx28_set_ioclk(MXC_IOCLK0, 48);
+   /* IO1 clock at 480MHz */
+   mx28_set_ioclk(MXC_IOCLK1, 48);
+
+   /* SSP0 clock at 96MHz */
+   mx28_set_sspclk(MXC_SSPCLK0, 96000, 0);
+
+ 

Re: [U-Boot] sha256_crypt for uboot

2012-07-09 Thread Richard Retanubun

On 05/07/12 05:59 AM, Albert ARIBAUD wrote:
Hi Albert,

Thanks for responding, I realize most people are probably away on summer 
holiday.


Can't speak for Wolfgang of course, but my main question would be why
would U-Boot need to identify users when its payload OS can do this
with much more ease and flexibility?

> IOW, what use case are you considering?

The primary concern here is the power of u-boot CLI. Once here, someone can 
manually load
and boot the payload OS in a different mode that can bypass any user 
identification.

Thus, we aim to add the ability uboot to identify users, much like the payload 
OS does
before granting access to its CLI (if the user interrupts the boot process).

So far I got sha256_crypt() and sha512_crypt() working (sha512 is a bit slow due
to non-arch optimized string lib functions, but its working okay).

If there is interest in sha512, I can send it as a separate patch.

One question to the mailing list though, the sha256_context struct that exist 
in u-boot

typedef struct {
uint32_t total[2];
uint32_t state[8];
uint8_t buffer[64];
} sha256_context;

Is a little different from the one in libc (i.e. it adds buflen and has a 128 
char buffer)

struct sha256_ctx {
uint32_t H[8];
uint32_t total[2];
uint32_t buflen;
char buffer[128]; /* NB: always correctly aligned for uint32_t.  */
};

I can't seem to find mainlined boards that uses sha256.h (I am sure there are 
private ones)

Is it okay if I update the sha256.[ch] API to track the implementation from 
libc?

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


Re: [U-Boot] sha256_crypt for uboot

2012-07-09 Thread Albert ARIBAUD
Hi Richard,

On Mon, 9 Jul 2012 09:50:05 -0400, Richard Retanubun
 wrote:
> On 05/07/12 05:59 AM, Albert ARIBAUD wrote:
> Hi Albert,
> 
> Thanks for responding, I realize most people are probably away on
> summer holiday.

Actually some of them are at a U-Boot developer's meeting in Geneva.

> > Can't speak for Wolfgang of course, but my main question would be
> > why would U-Boot need to identify users when its payload OS can do
> > this with much more ease and flexibility?
>  > IOW, what use case are you considering?
> 
> The primary concern here is the power of u-boot CLI. Once here,
> someone can manually load and boot the payload OS in a different mode
> that can bypass any user identification.

Ok, so this risk scenario is about untrusted payloads, not about
untrusted individuals. The difference is that u-boot already has a
concept of 'payload' but does not have or need any concept of 'user' so
far.

> Thus, we aim to add the ability uboot to identify users, much like
> the payload OS does before granting access to its CLI (if the user
> interrupts the boot process).

This risk mitigation answer seems to address another risk than the one
above, i.e. you could address the risk above just as with payload trust
(i.e., some form of trusted boot) without needing to introduce a whole
user identification system.

> So far I got sha256_crypt() and sha512_crypt() working (sha512 is a
> bit slow due to non-arch optimized string lib functions, but its
> working okay).
> 
> If there is interest in sha512, I can send it as a separate patch.
> 
> One question to the mailing list though, the sha256_context struct
> that exist in u-boot
> 
> typedef struct {
>   uint32_t total[2];
>   uint32_t state[8];
>   uint8_t buffer[64];
> } sha256_context;
> 
> Is a little different from the one in libc (i.e. it adds buflen and
> has a 128 char buffer)
> 
> struct sha256_ctx {
>   uint32_t H[8];
>   uint32_t total[2];
>   uint32_t buflen;
>   char buffer[128]; /* NB: always correctly aligned for
> uint32_t.  */ };
> 
> I can't seem to find mainlined boards that uses sha256.h (I am sure
> there are private ones)
> 
> Is it okay if I update the sha256.[ch] API to track the
> implementation from libc?

For the time being, I am still failing to see a viable reason for
introducing user management in mainline u-boot at all: it seems only
your solution (not even your problem) needs it.

> -- Richard Retanubun --

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


Re: [U-Boot] [V3] arm: Fix to mistake clean the memory space

2012-07-09 Thread Albert ARIBAUD
Hi Andreas,

On Mon, 09 Jul 2012 13:21:12 +0200, "Andreas BieĂźmann"
 wrote:
> Dear Zhong Hongbo,
> 
> On 07.07.2012 15:19, Zhong Hongbo wrote:
> > On 07/07/2012 05:58 PM, Albert ARIBAUD wrote:
> >> Hi Zhong Hongbo,
> >>
> >> On Sat,  7 Jul 2012 17:47:16 +0800, Zhong Hongbo
> >>  wrote:
> >>> From: Zhong Hongbo 
> 
> >> Almost there... The PATCH part is missing, i.e. you should not tag
> >> "[V3]" but "[PATCH V3]".
> > 
> > Ok,
> 
> well, you sent v4 but didn't respect this comment. Please read
> http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
> especially this part:
> 
> ---8<---
> Make an appropriate note that this is a re-submission in the subject
> line, eg. "[PATCH v2] Add support for feature X". git format-patch
> --subject-prefix="PATCH v2" can be used in this case.
> --->8---
> 
> Another option is to use 'git send-email --annotate ...' and change
> the subject line.
> 
> >> Just to make sure patchwork gets it right, please repost a V4 of
> >> this properly tagged with "[PATCH V4]".
> 
> I think patchwork got it right
> http://patchwork.ozlabs.org/patch/169595/ and
> http://patchwork.ozlabs.org/patch/169572/. So I would say you do not
> need to resend a v5 of the same patch cause of this formal 'fault'.
> Albert, do you have the same opinion?

(sigh) No, I don't have the same opinion.

But I will accept... for this once.

> Albert, I think we should count this a fix and pull into this upcoming
> release. How do you think about?

This was my intent from the start. :)

> Best regards
> 
> Andreas BieĂźmann

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


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Detlev Zundel
Hi Prafulla,

[...]

> Hi Detlev
> Clear NAK for this patch

Do you mean clear NAK for "the patch" or "for the location of the
files"?

> Let's put it in drivers/net/phy/
> FYI: there are several drivers used by just one board,
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ vim
> drivers/net/phy/Makefile
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ grep -Irn
> "CONFIG_PHY_ATHEROS" include/configs/*
> include/configs/microblaze-generic.h:346:# define CONFIG_PHY_ATHEROS1
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ vim
> drivers/net/phy/Makefile
> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ grep -Irn
> "CONFIG_PHY_BROADCOM" include/configs/*
> include/configs/microblaze-generic.h:347:# define CONFIG_PHY_BROADCOM   1
>
> Anyways peripheral driver should go in drivers/

Ok, so if the files are moved to drivers/net/phy, then you will ACK the
patch?  If this is the case, then Valentin please move the files and be
done with it.

Cheers
  Detlev

-- 
... that every year or so they're going to give you a new release full
of 50 000  additional lines of code all  written  by monkeys.  Because
they generally follow  the  ``million monkeys typing,   and eventually
they'll come up with something useful'' school of system development.
-- Richard M. Stallman
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Valentin Longchamp
Hi Detlev,

On 07/09/2012 04:31 PM, Detlev Zundel wrote:
> Hi Prafulla,
> 
> [...]
> 
>> Hi Detlev
>> Clear NAK for this patch
> 
> Do you mean clear NAK for "the patch" or "for the location of the
> files"?
> 
>> Let's put it in drivers/net/phy/
>> FYI: there are several drivers used by just one board,
>> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ vim
>> drivers/net/phy/Makefile
>> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ grep -Irn
>> "CONFIG_PHY_ATHEROS" include/configs/*
>> include/configs/microblaze-generic.h:346:# define CONFIG_PHY_ATHEROS1
>> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ vim
>> drivers/net/phy/Makefile
>> [prafulla@pe-dt061 u-boot-marvell.git (master)]$ grep -Irn
>> "CONFIG_PHY_BROADCOM" include/configs/*
>> include/configs/microblaze-generic.h:347:# define CONFIG_PHY_BROADCOM   1
>>
>> Anyways peripheral driver should go in drivers/
> 
> Ok, so if the files are moved to drivers/net/phy, then you will ACK the
> patch?  If this is the case, then Valentin please move the files and be
> done with it.
> 

Already working on it ;)

Valentin

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


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Holger Brunck
Hi Detlev,

On 07/09/2012 03:06 PM, Detlev Zundel wrote:
>> If we place the driver in your board diretory, the chances are huge it
>> will simply sit there and rot, and the next one who needs something
>> similar will reinvent the wheel because he did not find your copy.
>>
>> I agree that even very simple and uncomplete implementations can co in
>> if the fulfil some purpose, and can form a basis for future
>> extensions. 
> 
> I just read through our documentation on the Wiki and found nothing
> relavant to such a topic.  If we make this a requirement, we should add
> it so people know about it beforehand.
> 
> How about amending the U-Boot design principles with 
> 
> 11. Keep It Generic
> 
> - Generic code shall be added as high as possible to the U-Boot
>   abstraction hierarchy and only as a last resort into board
>   directories.  This entails that peripheral drivers should be put below
>   "drivers" even if they start out supporting only one specific
>   configuration.  Note that it is not a requirement for such a first
>   instance to be generic as genericity generally cannot be extrapolated
>   from a single data point.
> 
> How does that sound?
> 

shouldn't be there an exception for strictly board specific peripheral drivers
like an custom-made FPGA?

Regards
Holger

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


Re: [U-Boot] sha256_crypt for uboot

2012-07-09 Thread Richard Retanubun

Thanks for responding, I realize most people are probably away on
summer holiday.


Actually some of them are at a U-Boot developer's meeting in Geneva.


Uh-oh... Is it safe to place such a high concentration of hacker brains
so close to CERN? :)


The primary concern here is the power of u-boot CLI. Once here,
someone can manually load and boot the payload OS in a different mode
that can bypass any user identification.


Ok, so this risk scenario is about untrusted payloads, not about
untrusted individuals. The difference is that u-boot already has a
concept of 'payload' but does not have or need any concept of 'user' so
far.


This is the hints I am getting from reading past conversations in the
mailing list as well, which I why I am testing the waters before
finalizing the patch.




Thus, we aim to add the ability uboot to identify users, much like
the payload OS does before granting access to its CLI (if the user
interrupts the boot process).


This risk mitigation answer seems to address another risk than the one
above, i.e. you could address the risk above just as with payload trust
(i.e., some form of trusted boot) without needing to introduce a whole
user identification system.


In principal I agree.

In practice, for situations where one does not control the payload,
how does one ensure it is trusted?

Our current approach is to say "as long as the automatic boot sequence is not
modified, everything in the execution sequence is trusted. When an operator
need to deviate from that auto boot sequence, then the operator needs
to be authenticated."


For the time being, I am still failing to see a viable reason for
introducing user management in mainline u-boot at all: it seems only
your solution (not even your problem) needs it.


Understood. For the time being, I'll aim to make my modifications to the
source as standalone as I can so I don't get hit with merge conflicts.

Thanks for your time!

-- Richard Retanubun


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


[U-Boot] [ARM] one warning left for all ARM boards

2012-07-09 Thread Albert ARIBAUD
Hi all,

With the latest commits on u-boot/master, two obnoxious "attention"
messages were removed from ARM builds, but one still remains:

attention : -fstack-usage not supported for this target [enabled by
default]

This is with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5).

doc/SPL/README.omap3 does indeed say that not all GCC releases have
-fstack-usage, and commit 4a30f1e8 from Tom Rini (Cc:) says it tests
for the option, but apparently testing for the option is not the same as
testing for the option on a given target...

How do we get rid of those warnings? Right now they appear for every
single ARM board built.

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


Re: [U-Boot] sha256_crypt for uboot

2012-07-09 Thread Albert ARIBAUD
Hi Richard,

On Mon, 9 Jul 2012 10:55:18 -0400, Richard Retanubun
 wrote:
> >> Thanks for responding, I realize most people are probably away on
> >> summer holiday.
> >
> > Actually some of them are at a U-Boot developer's meeting in Geneva.
> 
> Uh-oh... Is it safe to place such a high concentration of hacker
> brains so close to CERN? :)

That's OK. The CERN folks must still be high on Higg's Boson, so the
place is safe right now. :)

> >> The primary concern here is the power of u-boot CLI. Once here,
> >> someone can manually load and boot the payload OS in a different
> >> mode that can bypass any user identification.

> >> Thus, we aim to add the ability uboot to identify users, much like
> >> the payload OS does before granting access to its CLI (if the user
> >> interrupts the boot process).
> >
> > This risk mitigation answer seems to address another risk than the
> > one above, i.e. you could address the risk above just as with
> > payload trust (i.e., some form of trusted boot) without needing to
> > introduce a whole user identification system.
> >
> In principal I agree.
> 
> In practice, for situations where one does not control the payload,
> how does one ensure it is trusted?

If you don't control the payload, then how can you expect to control
the users who bring it in, a control which is harder yet to achieve
that payload control? Hint: a piece of cryptographic signature
checking code is immune to greed or malevolence. A human is not. :)

> Our current approach is to say "as long as the automatic boot
> sequence is not modified, everything in the execution sequence is
> trusted. When an operator need to deviate from that auto boot
> sequence, then the operator needs to be authenticated."

Rephrase this as "as long as the boot sequence remains trusted, go
ahead with it. If it is not, then don't go ahead". Then implement a
chain of trust from ROM code to however far in the boot chain you
want. Assuming you have a three-stage (ROM, U-Boot, OS) boot chain,
then the chain of trust is: ROM is trusted;  ROM checks U-Boot's
signature and runs it only if U(Boot is trusted; U-Boot checks the
signature of whatever it is told to run, either from autoboot orfrom
command line, and runs it only if trusted.

If you keep the secret signature keys tightly to your chest, then you
don't need to trust users, or more precisely, misplaced trust in
someone won't have catastrophic effects, as that person can only run
what you have allowed to run. 

> > For the time being, I am still failing to see a viable reason for
> > introducing user management in mainline u-boot at all: it seems only
> > your solution (not even your problem) needs it.
> 
> Understood. For the time being, I'll aim to make my modifications to
> the source as standalone as I can so I don't get hit with merge
> conflicts.
> 
> Thanks for your time!

You're welcome.

> -- Richard Retanubun

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


Re: [U-Boot] [PATCH v2 0/7] dfu:usb: Composite USB download gadget with DFU function

2012-07-09 Thread Marek Vasut
Dear Tom Rini,

> On Mon, Jul 09, 2012 at 01:28:27PM +0200, Lukasz Majewski wrote:
> > Hi Marek,
> > 
> > > Those patches add support for composite USB download gadget.
> > > This gadget (at least for now) is equipped with DFU download function.
> > > 
> > > A separate DFU back-end and front-end have been added.
> > > Back-end is placed at ./drivers/dfu directory. The front-end is
> > > implemented as USB function.
> > > 
> > > The back-end is written in a generic manner with storage device
> > > specific code separated (eMMC).
> > > 
> > > DFU specification can be found at:
> > > http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade
> > > _standard
> > > 
> > > Example usage:
> > > 
> > > u-boot side: dfu mmc 0
> > > PC: dfu-util -U IMAGE.bin -a uImage (for upload)
> > > 
> > > dfu-util -D uImage -a uImage (download)
> > > 
> > > To list the alt settings:
> > > dfu mmc 0 list
> > > 
> > > Test HW:
> > > Exynos4210 Trats board
> > > 
> > > Lukasz Majewski (7):
> > >   dfu:usb: Support for g_dnl composite download gadget.
> > >   dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget
> > >   dfu: DFU backend implementation
> > >   dfu: MMC specific routines for DFU operation
> > >   dfu:cmd: Support for DFU u-boot command
> > >   arm:trats: Support for USB UDC driver at TRATS board.
> > >   arm:trats: Enable g_dnl composite USB gadget with embedded DFU
> > >   
> > > function on TRATS
> > 
> > Do you have more comments about those patches?
> 
> I _think_ he's been busy with exams and preparing for the U-Boot BoF
> this week.  I'll make sure this gets brought up then however.

Exams are long past, but there's a lot of other stuff -- the driver model, the 
denx work, the LSM this week -- I wish I could cut myself in four or so.

But weren't there some open questions, especially about the function vs. 
command 
stuff? The rest were really minor things and I believe you closed them with 
ease. There are just the few big questions, but it doesn't seem people are too 
interested to discuss them.

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


Re: [U-Boot] [PATCH 2/2] [v2] net: abort network initialization if the PHY driver fails

2012-07-09 Thread Stephan Linz
Hi Timur,

Am Freitag, den 06.07.2012, 13:35 -0500 schrieb Timur Tabi: 
> Now that phy_startup() can return an actual error code, check for that error
> code and abort network initialization if the PHY fails.
> 
> Signed-off-by: Timur Tabi 
> ---
>  drivers/net/fec_mxc.c |7 ++-
>  drivers/net/fm/eth.c  |9 -
>  drivers/net/sh_eth.c  |6 +-
>  drivers/net/tsec.c|8 +++-
>  drivers/net/xilinx_axi_emac.c |6 +-
>  drivers/net/xilinx_ll_temac.c |8 +++-
>  6 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index eee41d7..e62ae61 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -510,7 +510,12 @@ static int fec_open(struct eth_device *edev)
>   fec_eth_phy_config(edev);
>   if (fec->phydev) {
>   /* Start up the PHY */
> - phy_startup(fec->phydev);
> + int ret = phy_startup(fec->phydev);
> + if (ret) {
> + printf("Could not initialize PHY %s\n",
> +fec->phydev->dev->name);
> + return ret;
> + }
>   speed = fec->phydev->speed;
>   } else {
>   speed = _100BASET;
> diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
> index f34f4db..2b616ad 100644
> --- a/drivers/net/fm/eth.c
> +++ b/drivers/net/fm/eth.c
> @@ -363,6 +363,9 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
>  {
>   struct fm_eth *fm_eth;
>   struct fsl_enet_mac *mac;
> +#ifdef CONFIG_PHYLIB
> + int ret;
> +#endif
>  
>   fm_eth = (struct fm_eth *)dev->priv;
>   mac = fm_eth->mac;
> @@ -384,7 +387,11 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
>   fmc_tx_port_graceful_stop_disable(fm_eth);
>  
>  #ifdef CONFIG_PHYLIB
> - phy_startup(fm_eth->phydev);
> + ret = phy_startup(fm_eth->phydev);
> + if (ret) {
> + printf("%s: Could not initialize\n", fm_eth->phydev->dev->name);
> + return ret;
> + }
>  #else
>   fm_eth->phydev->speed = SPEED_1000;
>   fm_eth->phydev->link = 1;
> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
> index bb57e4d..268d884 100644
> --- a/drivers/net/sh_eth.c
> +++ b/drivers/net/sh_eth.c
> @@ -415,7 +415,11 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t 
> *bd)
>   goto err_phy_cfg;
>   }
>   phy = port_info->phydev;
> - phy_startup(phy);
> + ret = phy_startup(phy);
> + if (ret) {
> + printf(SHETHER_NAME ": phy startup failure\n");
> + return ret;
> + }
>  
>   val = 0;
>  
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index 3c1c8f0..f5e314b 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -480,6 +480,7 @@ static int tsec_init(struct eth_device *dev, bd_t * bd)
>   int i;
>   struct tsec_private *priv = (struct tsec_private *)dev->priv;
>   tsec_t *regs = priv->regs;
> + int ret;
>  
>   /* Make sure the controller is stopped */
>   tsec_halt(dev);
> @@ -511,7 +512,12 @@ static int tsec_init(struct eth_device *dev, bd_t * bd)
>   startup_tsec(dev);
>  
>   /* Start up the PHY */
> - phy_startup(priv->phydev);
> + ret = phy_startup(priv->phydev);
> + if (ret) {
> + printf("Could not initialize PHY %s\n",
> +priv->phydev->dev->name);
> + return ret;
> + }
>  
>   adjust_link(priv, priv->phydev);
>  
> diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
> index 7854a04..d777144 100644
> --- a/drivers/net/xilinx_axi_emac.c
> +++ b/drivers/net/xilinx_axi_emac.c
> @@ -272,7 +272,11 @@ static int setup_phy(struct eth_device *dev)
>   phydev->advertising = phydev->supported;
>   priv->phydev = phydev;
>   phy_config(phydev);
> - phy_startup(phydev);
> + if (phy_startup(phydev)) {
> + printf("axiemac: could not initialize PHY %s\n",
> +phydev->dev->name);
> + return 0;
> + }
>  
>   switch (phydev->speed) {
>   case 1000:
> diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c
> index 27dafc1..b67153b 100644
> --- a/drivers/net/xilinx_ll_temac.c
> +++ b/drivers/net/xilinx_ll_temac.c
> @@ -232,6 +232,7 @@ static void ll_temac_halt(struct eth_device *dev)
>  static int ll_temac_init(struct eth_device *dev, bd_t *bis)
>  {
>   struct ll_temac *ll_temac = dev->priv;
> + int ret;
>  
>   printf("%s: Xilinx XPS LocalLink Tri-Mode Ether MAC #%d at 0x%08X.\n",
>   dev->name, dev->index, dev->iobase);
> @@ -240,7 +241,12 @@ static int ll_temac_init(struct eth_device *dev, bd_t 
> *bis)
>   return -1;
>  
>   /* Start up the PHY */
> - phy_startup(ll_temac->phydev);
> + ret = phy_startup(ll_temac->phydev);
> + if (ret) {
> + pri

Re: [U-Boot] [PATCH v2 1/7] dfu:usb: Support for g_dnl composite download gadget.

2012-07-09 Thread Marek Vasut
Dear Lukasz Majewski,

> Composite USB download gadget support (g_dnl) for download functions.
> This code works on top of composite gadget.
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> 
> ---
> Changes for v2:
> 
> - G_DNL_{VENDOR_NUM, PRODUCT_NUM and MANUFACTURER} defined at

make this CONFIG_G_

The rest seems ok.

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


Re: [U-Boot] [PATCH v2 2/7] dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget

2012-07-09 Thread Marek Vasut
Dear Lukasz Majewski,

> Support for f_dfu USB function.
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> 
[...]

> +static void handle_getstatus(struct usb_request *req)
> +{
> + struct dfu_status *dstat = (struct dfu_status *)req->buf;
> + struct f_dfu *f_dfu = req->context;
> +
> + switch (f_dfu->dfu_state) {
> + case DFU_STATE_dfuDNLOAD_SYNC:
> + case DFU_STATE_dfuDNBUSY:
> + f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_IDLE;
> + break;
> + case DFU_STATE_dfuMANIFEST_SYNC:
> + break;
> + default:
> + break;
> + }
> +
> + /* send status response */
> + dstat->bStatus = f_dfu->dfu_status;
> + /* FIXME: set dstat->bwPollTimeout */

FIXME? :)

> + dstat->bState = f_dfu->dfu_state;
> + dstat->iString = 0;
> +}

[...]

> +static int
> +dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
> +{
> + struct usb_gadget *gadget = f->config->cdev->gadget;
> + struct usb_request *req = f->config->cdev->req;
> + struct f_dfu *f_dfu = f->config->cdev->req->context;
> + u16 len = le16_to_cpu(ctrl->wLength);
> + u16 w_value = le16_to_cpu(ctrl->wValue);
> + int value = 0;
> + u8 req_type = ctrl->bRequestType & USB_TYPE_MASK;
> +
> + debug("w_value: 0x%x len: 0x%x\n", w_value, len);
> + debug("req_type: 0x%x ctrl->bRequest: 0x%x f_dfu->dfu_state: 0x%x\n",
> +req_type, ctrl->bRequest, f_dfu->dfu_state);
> +
> +
> + if (req_type == USB_TYPE_STANDARD) {
> + if (ctrl->bRequest == USB_REQ_GET_DESCRIPTOR &&
> + (w_value >> 8) == DFU_DT_FUNC) {
> + value = min(len, (u16) sizeof dfu_func);

Does the sizeof really miss braces up here ?

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


Re: [U-Boot] [PATCH v2 3/7] dfu: DFU backend implementation

2012-07-09 Thread Marek Vasut
Dear Lukasz Majewski,

> New, separate driver at ./drivers/dfu has been added. It allows platform
> and storage independent operation of DFU.
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> 

[...]

> +char *dfu_extract_token(char** e, int *n)
> +{
> + char *st = *e;
> +
> + debug("%s: %s\n", __func__, st);
> +
> + strsep(e, " ");
> + *n = *e - st;
> +
> + return st;
> +}

Sigh, what about these? btw don't we have strtok?
[...]


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


Re: [U-Boot] [PATCH v2 4/7] dfu: MMC specific routines for DFU operation

2012-07-09 Thread Marek Vasut
Dear Lukasz Majewski,

> Support for MMC storage devices to work with DFU framework.
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> 

This one opens some questions.

[...]

> +int dfu_fill_entity_mmc(struct dfu_entity *dfu, char* s)
> +{
> + char *st = NULL;
> + int n = 0;
> +
> + dfu->dev_type = MMC;
> + st = dfu_extract_token(&s, &n);
> +
> + if (!strncmp(st, "mmc", n)) {
> + dfu->layout = RAW_ADDR;
> +
> + dfu->data.mmc.lba_start = simple_strtoul(s, &s, 16);
> + dfu->data.mmc.lba_size = simple_strtoul(++s, &s, 16);
> + dfu->data.mmc.lba_blk_size = get_mmc_blk_size(dfu->dev_num);
> +

^ one line too much.

> + } else if (!strncmp(st, "fat", n)) {
> + dfu->layout = FAT;
> +
> + dfu->data.mmc.dev = simple_strtoul(s, &s, 10);
> + dfu->data.mmc.part = simple_strtoul(++s, &s, 10);
> +
> + } else {
> + printf("%s: Wrong memory layout!\n", __func__);
> + }
> +
> + dfu->read_medium = dfu_read_medium_mmc;
> + dfu->write_medium = dfu_write_medium_mmc;
> +
> + return 0;
> +}

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


Re: [U-Boot] [PATCH 2/2] [v2] net: abort network initialization if the PHY driver fails

2012-07-09 Thread Marek Vasut
Dear Timur Tabi,

> Now that phy_startup() can return an actual error code, check for that
> error code and abort network initialization if the PHY fails.
> 
> Signed-off-by: Timur Tabi 
> ---
>  drivers/net/fec_mxc.c |7 ++-
>  drivers/net/fm/eth.c  |9 -
>  drivers/net/sh_eth.c  |6 +-
>  drivers/net/tsec.c|8 +++-
>  drivers/net/xilinx_axi_emac.c |6 +-
>  drivers/net/xilinx_ll_temac.c |8 +++-
>  6 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index eee41d7..e62ae61 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -510,7 +510,12 @@ static int fec_open(struct eth_device *edev)
>   fec_eth_phy_config(edev);
>   if (fec->phydev) {
>   /* Start up the PHY */
> - phy_startup(fec->phydev);
> + int ret = phy_startup(fec->phydev);
> + if (ret) {
> + printf("Could not initialize PHY %s\n",
> +fec->phydev->dev->name);
> + return ret;
> + }
>   speed = fec->phydev->speed;
>   } else {
>   speed = _100BASET;
For the FEC

Reviewed-by: Marek Vasut 

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


[U-Boot] [PULL] u-boot-usb/master

2012-07-09 Thread Marek Vasut
Hello,

This has been in the usb tree for a while, but I'm hesitant to ask you for 
scheduling it into current release. On the other hand, I don't think this will 
cause any breakage.

The following changes since commit 58e22f8a15adec39d24d060180d76a4cbe86a04b:

  fdt: send all dtc output to stderr (2012-07-09 09:05:24 +0200)

are available in the git repository at:

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

for you to fetch changes up to a4dae631bfa848d8a0d1933583ed7e2f6a96cab3:

  CONFIG: EXYNOS5: USB: Enable USB 2.0 on smdk5250 (2012-07-09 18:27:55 +0200)


Rajeshwari Shinde (7):
  USB: EXYNOS: Incorporate EHCI review comments
  EXYNOS5: Fix system register structure
  EXYNOS5: Add structure for PMU registers
  USB: EXYNOS: Set USB 2.0 HOST Link mode
  EXYNOS: Add power Enable/Disable for USB-EHCI
  EXYNOS5: USB: Fix incorrect USB base addresses
  CONFIG: EXYNOS5: USB: Enable USB 2.0 on smdk5250

 arch/arm/cpu/armv7/exynos/power.c   |   22 +++
 arch/arm/cpu/armv7/exynos/system.c  |   22 +++
 arch/arm/include/asm/arch-exynos/cpu.h  |7 +-
 arch/arm/include/asm/arch-exynos/{ehci-s5p.h => ehci.h} |   10 +-
 arch/arm/include/asm/arch-exynos/power.h|  626 

 arch/arm/include/asm/arch-exynos/system.h   |4 +
 drivers/usb/host/Makefile   |2 +-
 drivers/usb/host/{ehci-s5p.c => ehci-exynos.c}  |   26 ++-
 include/configs/smdk5250.h  |6 +
 9 files changed, 708 insertions(+), 17 deletions(-)
 rename arch/arm/include/asm/arch-exynos/{ehci-s5p.h => ehci.h} (90%)
 rename drivers/usb/host/{ehci-s5p.c => ehci-exynos.c} (79%)

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


[U-Boot] pull request for u-boot-tegra/master

2012-07-09 Thread Tom Warren
Albert,

Please pull u-boot-tegra/master into ARM master. Thanks!

The following changes since commit 58e22f8a15adec39d24d060180d76a4cbe86a04b:
  Stephen Warren (1):
fdt: send all dtc output to stderr

are available in the git repository at:

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

Jim Lin (1):
  tegra: usb: Fix device enumeration problem of USB1

Lucas Stach (2):
  tegra: add ULPI on USB2 funcmux entry
  tegra: usb: fix wrong error check

Stephen Warren (10):
  Add env vars describing U-Boot target board
  tegra: enable CONFIG_ENV_VARS_UBOOT_CONFIG
  tegra: add enterrcm command
  tegra: bootcmd enhancements
  tegra: bootcmd: start USB only when needed
  tegra: add GMC/GMD funcmux entry for SFLASH
  tegra: add pin_mux_spi() board initialization function
  tegra: trimslice: set up serial flash pinmux
  tegra: enable bootz command
  tegra: define fdt_load/fdt_high variables

Thierry Reding (7):
  tegra: Rework Tamonten support
  tegra: medcom: Add device tree support
  tegra: plutux: Add device tree support
  tegra: Allow boards to perform early GPIO setup
  tegra: Implement gpio_early_init() on Tamonten
  tegra: Use SD write-protect GPIO on Tamonten
  tegra: Add Tamonten Evaluation Carrier support

Tom Warren (1):
  tegra: fix leftover CONFIG_TEGRA2_MMC & _SPI build switches

 MAINTAINERS|1 +
 README |   14 
 arch/arm/cpu/armv7/tegra2/Makefile |1 +
 arch/arm/cpu/armv7/tegra2/cmd_enterrcm.c   |   65 +++
 arch/arm/cpu/armv7/tegra2/funcmux.c|   23 ++-
 arch/arm/cpu/armv7/tegra2/usb.c|2 +-
 arch/arm/include/asm/arch-tegra2/funcmux.h |6 ++
 arch/arm/include/asm/arch-tegra2/tegra2.h  |1 +
 board/avionic-design/common/tamonten.c |   65 ++-
 board/avionic-design/common/tamonten.h |   32 -
 board/avionic-design/dts/tegra2-medcom.dts |   58 +
 board/avionic-design/dts/tegra2-plutux.dts |   58 +
 board/avionic-design/dts/tegra2-tec.dts|   58 +
 board/avionic-design/medcom/Makefile   |6 +-
 board/avionic-design/medcom/medcom.c   |   45 -
 board/avionic-design/plutux/Makefile   |6 +-
 board/avionic-design/plutux/plutux.c   |   45 -
 board/avionic-design/tec/Makefile  |   50 ++
 board/compal/paz00/paz00.c |4 +-
 board/compulab/trimslice/trimslice.c   |7 ++-
 board/nvidia/common/board.c|   16 -
 board/nvidia/common/board.h|1 +
 boards.cfg |1 +
 common/env_common.c|   11 +++
 common/env_embedded.c  |   11 +++
 drivers/usb/host/ehci-tegra.c  |   18 +-
 include/configs/medcom.h   |   21 ++-
 include/configs/plutux.h   |   21 ++-
 include/configs/tec.h  |   82 
 include/configs/tegra2-common-post.h   |   96 ++-
 include/configs/tegra2-common.h|3 +
 mkconfig   |8 ++
 32 files changed, 622 insertions(+), 214 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/cmd_enterrcm.c
 delete mode 100644 board/avionic-design/common/tamonten.h
 create mode 100644 board/avionic-design/dts/tegra2-medcom.dts
 create mode 100644 board/avionic-design/dts/tegra2-plutux.dts
 create mode 100644 board/avionic-design/dts/tegra2-tec.dts
 delete mode 100644 board/avionic-design/medcom/medcom.c
 delete mode 100644 board/avionic-design/plutux/plutux.c
 create mode 100644 board/avionic-design/tec/Makefile
 create mode 100644 include/configs/tec.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 09/12] microblaze: timer: Add device-tree driver configuration

2012-07-09 Thread Stephan Linz
Hi Michal,

Am Montag, den 09.07.2012, 11:20 +0200 schrieb Michal Simek: 
> Read configuration from DTB.
> 
> Signed-off-by: Michal Simek 
> ---
>  arch/microblaze/cpu/timer.c |   25 +
>  1 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
> index dfaaaf5..91ca42b 100644
> --- a/arch/microblaze/cpu/timer.c
> +++ b/arch/microblaze/cpu/timer.c
> @@ -25,6 +25,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
>  
>  volatile int timestamp = 0;
>  microblaze_timer_t *tmr;
> @@ -62,11 +65,33 @@ int timer_init (void)
>   u32 preload = 0;
>   u32 ret = 0;
>  
> +#ifndef CONFIG_OF_CONTROL
>  #if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
>   preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;
>   irq = CONFIG_SYS_TIMER_0_IRQ;
>   tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
>  #endif
> +#else
> + int temp;
> + int offset = 0;
> +
> + offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset,
> + "xlnx,xps-timer-1.00.a");
> + if (offset > 0) {
> + temp = fdtdec_get_addr(gd->fdt_blob, offset, "reg");
> + if (temp != FDT_ADDR_T_NONE) {
> + tmr = (microblaze_timer_t *)temp;
> + irq = fdtdec_get_int(gd->fdt_blob, offset,
> + "interrupts", -1);
> + if (irq == -1)

irq is u32 (unsigned) -- my be a problem. But yes, I'm missing a
compilation warning here ...


br,
Stephan

> + panic("Connect IRQ to system timer\n");
> + /* Set default clock frequency */
> + temp = fdtdec_get_int(gd->fdt_blob, offset,
> + "clock-frequency", 0);
> + preload = temp / CONFIG_SYS_HZ;
> + }
> + }
> +#endif
>  
>   if (tmr && irq && preload) {
>   tmr->loadreg = preload;



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


Re: [U-Boot] [PATCH 08/12] microblaze: timer: Prepare for device-tree initialization

2012-07-09 Thread Stephan Linz
Hi Michal,

Am Montag, den 09.07.2012, 11:20 +0200 schrieb Michal Simek: 
> microblaze: Fix CONFIG_SYS_HZ usage in board config
> 
> Do not use hardcoded value. Use CONFIG_SYS_HZ instead.
> Separate static configuration to single block.
> 
> Signed-off-by: Michal Simek 
> ---
>  arch/microblaze/cpu/timer.c|   69 ---
>  arch/microblaze/include/asm/microblaze_timer.h |3 +
>  arch/microblaze/lib/board.c|5 --
>  include/configs/microblaze-generic.h   |   12 +
>  4 files changed, 41 insertions(+), 48 deletions(-)
> 
> diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
> index cc6b897..dfaaaf5 100644
> --- a/arch/microblaze/cpu/timer.c
> +++ b/arch/microblaze/cpu/timer.c
> @@ -27,42 +27,30 @@
>  #include 
>  
>  volatile int timestamp = 0;
> +microblaze_timer_t *tmr;
>  
> -#ifdef CONFIG_SYS_TIMER_0
>  ulong get_timer (ulong base)
>  {
> - return (timestamp - base);
> + if (tmr)
> + return timestamp - base;
> + return timestamp++ - base;
>  }
> -#else
> -ulong get_timer (ulong base)
> -{
> - return (timestamp++ - base);
> -}
> -#endif
>  
> -#ifdef CONFIG_SYS_TIMER_0
>  void __udelay(unsigned long usec)
>  {
> - int i;
> + u32 i;
>  
> - i = get_timer(0);
> - while ((get_timer(0) - i) < (usec / 1000))
> - ;
> + if (tmr) {
> + i = get_timer(0);
> + while ((get_timer(0) - i) < (usec / 1000))
> + ;
> + } else {
> + for (i = 0; i < (usec * XILINX_CLOCK_FREQ / 1000); i++)
> + ;
> + }
>  }
> -#else
> -void __udelay(unsigned long usec)
> -{
> - unsigned int i;
>  
> - for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 1000); i++)
> - ;
> -}
> -#endif
> -
> -#ifdef CONFIG_SYS_TIMER_0
> -microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
> -
> -void timer_isr (void *arg)
> +static void timer_isr(void *arg)
>  {
>   timestamp++;
>   tmr->control = tmr->control | TIMER_INTERRUPT;
> @@ -70,15 +58,30 @@ void timer_isr (void *arg)
>  
>  int timer_init (void)
>  {
> - tmr->loadreg = CONFIG_SYS_TIMER_0_PRELOAD;
> - tmr->control = TIMER_INTERRUPT | TIMER_RESET;
> - tmr->control =
> - TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;
> - timestamp = 0;
> - install_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void 
> *)tmr);
> + u32 irq = 0;

should be   int irq = -1;   (see below)

> + u32 preload = 0;
> + u32 ret = 0;
> +
> +#if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
> + preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;
> + irq = CONFIG_SYS_TIMER_0_IRQ;
> + tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
> +#endif
> +
> + if (tmr && irq && preload) {

it should be:

if (tmr && irq >= 0 && preload) {

irq valid --> irq >= 0
irq invalid --> irq == -1


br,
Stephan

> + tmr->loadreg = preload;
> + tmr->control = TIMER_INTERRUPT | TIMER_RESET;
> + tmr->control = TIMER_ENABLE | TIMER_ENABLE_INTR |\
> + TIMER_RELOAD | TIMER_DOWN_COUNT;
> + timestamp = 0;
> + ret = install_interrupt_handler (irq, timer_isr, (void *)tmr);
> + if (ret)
> + tmr = NULL;
> + }
> +
> + /* No problem if timer is not found/initialized */
>   return 0;
>  }
> -#endif
>  
>  /*
>   * This function is derived from PowerPC code (read timebase as long long).
> diff --git a/arch/microblaze/include/asm/microblaze_timer.h 
> b/arch/microblaze/include/asm/microblaze_timer.h
> index 844c8db..28e8b02 100644
> --- a/arch/microblaze/include/asm/microblaze_timer.h
> +++ b/arch/microblaze/include/asm/microblaze_timer.h
> @@ -39,3 +39,6 @@ typedef volatile struct microblaze_timer_t {
>   int loadreg; /* load register TLR */
>   int counter; /* timer/counter register */
>  } microblaze_timer_t;
> +
> +int timer_init(void);
> +
> diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
> index 8cf4266..ddbc862 100644
> --- a/arch/microblaze/lib/board.c
> +++ b/arch/microblaze/lib/board.c
> @@ -40,9 +40,6 @@ DECLARE_GLOBAL_DATA_PTR;
>  #ifdef CONFIG_SYS_GPIO_0
>  extern int gpio_init (void);
>  #endif
> -#ifdef CONFIG_SYS_TIMER_0
> -extern int timer_init (void);
> -#endif
>  #ifdef CONFIG_SYS_FSL_2
>  extern void fsl_init2 (void);
>  #endif
> @@ -72,9 +69,7 @@ init_fnc_t *init_sequence[] = {
>   gpio_init,
>  #endif
>   interrupts_init,
> -#ifdef CONFIG_SYS_TIMER_0
>   timer_init,
> -#endif
>  #ifdef CONFIG_SYS_FSL_2
>   fsl_init2,
>  #endif
> diff --git a/include/configs/microblaze-generic.h 
> b/include/configs/microblaze-generic.h
> index 44934eb..9f90107 100644
> --- a/include/configs/microblaze-generic.h
> +++ b/include/configs/microblaze-generic.h
> @@ -102,19 +102,11 @@
>  #endif
>  

Re: [U-Boot] [PATCH] smsc95xx: align buffers to cache line size

2012-07-09 Thread Ilya Yanok
Dear Marek,

On Mon, Jul 9, 2012 at 4:45 AM, Marek Vasut  wrote:

>
> > But in practice it works without any alignment... ok, you made me read
> the
> > spec ;)
> > page 55: "For the page 0 current offset interpretation, this field is the
> > byte offset into the current page"
>
>
> See the thread
> "[U-Boot] [PATCH] usb_storage: fix ehci driver max transfer size"
>

Interesting... but that's a different issue...


> So, if we compute the size over there correctly (I hope Stefan will send an
> updated patch soon), we'll still need it to be aligned to
> ARCH_DMA_MINALIGN so
> we can flush it. Bah, this is getting quite crazy, the deeper we go, the
> more
> bugs we meet!
>

Well, of course we need proper alignment for cache stuff (well, actually we
can skip this alignment thing for the buffer we will flush as long as all
buffers we are going to invalidate are properly aligned/sized... but that's
too tricky, personally I'd prefer every DMAed buffer to be cache-line
aligned/sized).

And this patch actually adds the alignment for the smsc95xx driver's
buffers. In your initial reply you said it will be broken on systems with
ARCH_DMA_MINALIGN < 32, so I'm asking what makes you think so?


> So, what I'd like to do is to see a patch from Stefan, it was really a good
> finding! Next up, we should finish this patchset for proper EHCI QH and qTD
> alignment. And finally, we need generic bounce buffer to use as a
> protection
> against crazy people who might want to load stuff to unaligned address.
>

Good plan.

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


Re: [U-Boot] [PATCH 2/2] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment

2012-07-09 Thread Ilya Yanok
Hi Marek,

On Sun, Jul 8, 2012 at 7:08 AM, Marek Vasut  wrote:

> -   /* Invalidate the memory area occupied by buffer */
> -   invalidate_dcache_range(((uint32_t)buffer & ~31),
> -   ((uint32_t)buffer & ~31) + roundup(length, 32));
> +   /*
> +* Invalidate the memory area occupied by buffer
> +* Don't try to fix the buffer alignment, if it isn't properly
> +* aligned it's upper layer's fault so let
> invalidate_dcache_range()
> +* vow about it. But we have to fix the length as it's actual
> +* transfer length and can be unaligned. This is potentially
> +* dangerous operation, it's responsibility of the calling
> +* code to make sure enough space is reserved.
> +*/
> +   invalidate_dcache_range((uint32_t)buffer,
> +   ALIGN_END_ADDR(u8, buffer, length));
>

We shouldn't use ALIGN_END_ADDR here. This can lead to strange results on
systems with ARCH_DMA_MINALIGN < 32.

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


[U-Boot] Please pull u-boot-ti/master

2012-07-09 Thread Tom Rini
Hello,

The following changes since commit d702b0811df53a1fc2d8049e35431e4591d093c6:

  ARM: cache: Move the cp15 CR register read before flushing the cache. 
(2012-07-07 14:07:44 +0200)

are available in the git repository at:

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

for you to fetch changes up to a92cc088d32e58b53b6a6d2faec5288f4ed1:

  beagle: add eeprom expansion board info for bct brettl4 (2012-07-09 05:53:00 
-0700)


Peter Meerwald (1):
  beagle: add eeprom expansion board info for bct brettl4

 board/ti/beagle/beagle.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

This is a small change and one that I believe is best served being in
mainline and releases sooner rather than later.  Thanks!

-- 
Tom


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


[U-Boot] Please pull u-boot-ti/next

2012-07-09 Thread Tom Rini
Hello,

The following changes since commit d702b0811df53a1fc2d8049e35431e4591d093c6:

  ARM: cache: Move the cp15 CR register read before flushing the cache. 
(2012-07-07 14:07:44 +0200)

are available in the git repository at:

  git://git.denx.de/u-boot-ti next

for you to fetch changes up to 9af1a780c81639ca4b6f7035530dc8c7151bf201:

  omap: am335x_evm: enable i2c1 channel (2012-07-09 11:12:19 -0700)


Igor Grinberg (1):
  arm: omap3: cm-t35: minor comment and printf change

Ilya Yanok (1):
  omap24xx_i2c: add 2-byte address support

Javier Martinez Canillas (2):
  igep00x0: default to OMAP-specific serial driver
  igep00x0: default mmcrootfstype to EXT4

Lad, Prabhakar (7):
  da850/omap-l138: Add MMC support for DA850/OMAP-L138
  arm, davinci: perform check for initializing global data and serial init
  da850/omap-l138: Define SPI specific configs for SPL only when SPI is used
  da850/omap-l138: Add support to read u-boot image from MMC/SD
  da850/omap-l138: Fix NAND flash timings
  da850/omap-l138: Add support for NAND SPL
  da850/omap-l138: add support for direct NOR boot mode

Peter Meerwald (4):
  beagle: add eeprom expansion board info for bct brettl4
  beagle: make get_expansion_id(), get_board_revision(), 
beagle_display_init() static
  beagle: fix termination of buddy env setting
  beagle: removed unused pr_debug #define

Rajashekhara, Sudhakar (2):
  da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM
  da850/omap-l138: Make MMC and NOR support mutually exclusive

Stefano Babic (4):
  mcx: increased buffer for command line
  OMAP3: mcx: set pinmux for uart4
  OMAP3: mcx: updated default environment
  OMAP3: mcx: read hot-water-button after reset

Steve Sakoman (3):
  omap: am335x_evm: remove unused definitions
  omap: am33xx: enable gpio support
  omap: am335x_evm: enable i2c1 channel

Sughosh Ganu (1):
  hawkboard/omapl-138: Add support for generating ais image for hawkboard

 .gitignore  |3 +
 Makefile|5 +-
 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |   11 ++
 arch/arm/cpu/arm926ejs/davinci/spl.c|   20 ++--
 arch/arm/cpu/armv7/am33xx/board.c   |   10 ++
 arch/arm/cpu/armv7/am33xx/clock.c   |   20 
 arch/arm/cpu/armv7/omap-common/Makefile |2 +-
 arch/arm/include/asm/arch-am33xx/cpu.h  |   20 
 arch/arm/include/asm/arch-am33xx/gpio.h |   29 +
 arch/arm/include/asm/arch-davinci/hardware.h|1 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |3 +
 board/cm_t35/cm_t35.c   |4 +-
 board/davinci/da8xxevm/da850evm.c   |   54 --
 board/davinci/da8xxevm/hawkboard-ais-nand.cfg   |4 +
 board/htkw/mcx/mcx.c|   23 
 board/htkw/mcx/mcx.h|   11 +-
 board/ti/am335x/evm.c   |6 +-
 board/ti/am335x/mux.c   |   13 +++
 board/ti/beagle/beagle.c|   16 +--
 boards.cfg  |1 +
 drivers/i2c/omap24xx_i2c.c  |   58 +-
 drivers/mmc/Makefile|4 +
 drivers/mmc/spl_mmc_load.c  |   62 +++
 include/configs/am335x_evm.h|2 +-
 include/configs/da850evm.h  |   93 ++--
 include/configs/hawkboard.h |1 +
 include/configs/igep00x0.h  |4 +-
 include/configs/mcx.h   |  132 ---
 include/configs/omap3_beagle.h  |2 +-
 include/mmc.h   |2 +
 30 files changed, 502 insertions(+), 114 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-am33xx/gpio.h
 create mode 100644 board/davinci/da8xxevm/hawkboard-ais-nand.cfg
 create mode 100644 drivers/mmc/spl_mmc_load.c

This includes the single patch I asked for in u-boot-ti/master as well
as a number of other small clean-ups, bugfixes or enhancements that have
been around for a bit, but did not meet the merge window and I don't
want to forget them.  If you want me to carry them in my own /next
branch until -rc1 comes out, that's fine and this can just serve as
notice to interested parties that yes, really, patches have been picked
up.

-- 
Tom


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


[U-Boot] [PATCH 2/2] [v3] net: abort network initialization if the PHY driver fails

2012-07-09 Thread Timur Tabi
Now that phy_startup() can return an actual error code, check for that error
code and abort network initialization if the PHY fails.

Signed-off-by: Timur Tabi 
Acked-by: Nobuhiro Iwamamatsu  (sh_eth part)
Acked-by: Stephan Linz  (Xilinx part, xilinx_axi_emac and 
xilinx_ll_temac)
Reviewed-by: Marek Vasut  (FEC part)
---
 drivers/net/fec_mxc.c |8 +++-
 drivers/net/fm/eth.c  |9 -
 drivers/net/sh_eth.c  |6 +-
 drivers/net/tsec.c|8 +++-
 drivers/net/xilinx_axi_emac.c |6 +-
 drivers/net/xilinx_ll_temac.c |8 +++-
 6 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index eee41d7..5700552 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -510,7 +510,13 @@ static int fec_open(struct eth_device *edev)
fec_eth_phy_config(edev);
if (fec->phydev) {
/* Start up the PHY */
-   phy_startup(fec->phydev);
+   int ret = phy_startup(fec->phydev);
+
+   if (ret) {
+   printf("Could not initialize PHY %s\n",
+  fec->phydev->dev->name);
+   return ret;
+   }
speed = fec->phydev->speed;
} else {
speed = _100BASET;
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index f34f4db..2b616ad 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -363,6 +363,9 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
 {
struct fm_eth *fm_eth;
struct fsl_enet_mac *mac;
+#ifdef CONFIG_PHYLIB
+   int ret;
+#endif
 
fm_eth = (struct fm_eth *)dev->priv;
mac = fm_eth->mac;
@@ -384,7 +387,11 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
fmc_tx_port_graceful_stop_disable(fm_eth);
 
 #ifdef CONFIG_PHYLIB
-   phy_startup(fm_eth->phydev);
+   ret = phy_startup(fm_eth->phydev);
+   if (ret) {
+   printf("%s: Could not initialize\n", fm_eth->phydev->dev->name);
+   return ret;
+   }
 #else
fm_eth->phydev->speed = SPEED_1000;
fm_eth->phydev->link = 1;
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index bb57e4d..268d884 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -415,7 +415,11 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd)
goto err_phy_cfg;
}
phy = port_info->phydev;
-   phy_startup(phy);
+   ret = phy_startup(phy);
+   if (ret) {
+   printf(SHETHER_NAME ": phy startup failure\n");
+   return ret;
+   }
 
val = 0;
 
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 3c1c8f0..f5e314b 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -480,6 +480,7 @@ static int tsec_init(struct eth_device *dev, bd_t * bd)
int i;
struct tsec_private *priv = (struct tsec_private *)dev->priv;
tsec_t *regs = priv->regs;
+   int ret;
 
/* Make sure the controller is stopped */
tsec_halt(dev);
@@ -511,7 +512,12 @@ static int tsec_init(struct eth_device *dev, bd_t * bd)
startup_tsec(dev);
 
/* Start up the PHY */
-   phy_startup(priv->phydev);
+   ret = phy_startup(priv->phydev);
+   if (ret) {
+   printf("Could not initialize PHY %s\n",
+  priv->phydev->dev->name);
+   return ret;
+   }
 
adjust_link(priv, priv->phydev);
 
diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index 7854a04..d777144 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -272,7 +272,11 @@ static int setup_phy(struct eth_device *dev)
phydev->advertising = phydev->supported;
priv->phydev = phydev;
phy_config(phydev);
-   phy_startup(phydev);
+   if (phy_startup(phydev)) {
+   printf("axiemac: could not initialize PHY %s\n",
+  phydev->dev->name);
+   return 0;
+   }
 
switch (phydev->speed) {
case 1000:
diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c
index 27dafc1..b67153b 100644
--- a/drivers/net/xilinx_ll_temac.c
+++ b/drivers/net/xilinx_ll_temac.c
@@ -232,6 +232,7 @@ static void ll_temac_halt(struct eth_device *dev)
 static int ll_temac_init(struct eth_device *dev, bd_t *bis)
 {
struct ll_temac *ll_temac = dev->priv;
+   int ret;
 
printf("%s: Xilinx XPS LocalLink Tri-Mode Ether MAC #%d at 0x%08X.\n",
dev->name, dev->index, dev->iobase);
@@ -240,7 +241,12 @@ static int ll_temac_init(struct eth_device *dev, bd_t *bis)
return -1;
 
/* Start up the PHY */
-   phy_startup(ll_temac->phydev);
+   ret = phy_startup(ll_temac->phydev);
+   if (ret) {
+   printf("%s: Could not initialize PHY %s\n",
+   

Re: [U-Boot] [PATCH 08/12] microblaze: timer: Prepare for device-tree initialization

2012-07-09 Thread Stephan Linz
Am Montag, den 09.07.2012, 11:20 +0200 schrieb Michal Simek: 
> microblaze: Fix CONFIG_SYS_HZ usage in board config
> 
> Do not use hardcoded value. Use CONFIG_SYS_HZ instead.
> Separate static configuration to single block.
> 
> Signed-off-by: Michal Simek 
> ---
>  arch/microblaze/cpu/timer.c|   69 ---
>  arch/microblaze/include/asm/microblaze_timer.h |3 +
>  arch/microblaze/lib/board.c|5 --
>  include/configs/microblaze-generic.h   |   12 +
>  4 files changed, 41 insertions(+), 48 deletions(-)
> 
> diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
> index cc6b897..dfaaaf5 100644
> --- a/arch/microblaze/cpu/timer.c
> +++ b/arch/microblaze/cpu/timer.c
> @@ -27,42 +27,30 @@
>  #include 
>  
>  volatile int timestamp = 0;
> +microblaze_timer_t *tmr;
>  
> -#ifdef CONFIG_SYS_TIMER_0
>  ulong get_timer (ulong base)
>  {
> - return (timestamp - base);
> + if (tmr)
> + return timestamp - base;
> + return timestamp++ - base;
>  }
> -#else
> -ulong get_timer (ulong base)
> -{
> - return (timestamp++ - base);
> -}
> -#endif
>  
> -#ifdef CONFIG_SYS_TIMER_0
>  void __udelay(unsigned long usec)
>  {
> - int i;
> + u32 i;
>  
> - i = get_timer(0);
> - while ((get_timer(0) - i) < (usec / 1000))
> - ;
> + if (tmr) {
> + i = get_timer(0);
> + while ((get_timer(0) - i) < (usec / 1000))
> + ;

Hi Michal,

> + } else {
> + for (i = 0; i < (usec * XILINX_CLOCK_FREQ / 1000); i++)
> + ;

this part should be enclosed by   #ifdef XILINX_CLOCK_FREQ


br,
Stephan Linz

> + }
>  }
> -#else
> -void __udelay(unsigned long usec)
> -{
> - unsigned int i;
>  
> - for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 1000); i++)
> - ;
> -}
> -#endif
> -
> -#ifdef CONFIG_SYS_TIMER_0
> -microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
> -
> -void timer_isr (void *arg)
> +static void timer_isr(void *arg)
>  {
>   timestamp++;
>   tmr->control = tmr->control | TIMER_INTERRUPT;
> @@ -70,15 +58,30 @@ void timer_isr (void *arg)
>  
>  int timer_init (void)
>  {
> - tmr->loadreg = CONFIG_SYS_TIMER_0_PRELOAD;
> - tmr->control = TIMER_INTERRUPT | TIMER_RESET;
> - tmr->control =
> - TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;
> - timestamp = 0;
> - install_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void 
> *)tmr);
> + u32 irq = 0;
> + u32 preload = 0;
> + u32 ret = 0;
> +
> +#if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
> + preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;
> + irq = CONFIG_SYS_TIMER_0_IRQ;
> + tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
> +#endif
> +
> + if (tmr && irq && preload) {
> + tmr->loadreg = preload;
> + tmr->control = TIMER_INTERRUPT | TIMER_RESET;
> + tmr->control = TIMER_ENABLE | TIMER_ENABLE_INTR |\
> + TIMER_RELOAD | TIMER_DOWN_COUNT;
> + timestamp = 0;
> + ret = install_interrupt_handler (irq, timer_isr, (void *)tmr);
> + if (ret)
> + tmr = NULL;
> + }
> +
> + /* No problem if timer is not found/initialized */
>   return 0;
>  }
> -#endif
>  
>  /*
>   * This function is derived from PowerPC code (read timebase as long long).
> diff --git a/arch/microblaze/include/asm/microblaze_timer.h 
> b/arch/microblaze/include/asm/microblaze_timer.h
> index 844c8db..28e8b02 100644
> --- a/arch/microblaze/include/asm/microblaze_timer.h
> +++ b/arch/microblaze/include/asm/microblaze_timer.h
> @@ -39,3 +39,6 @@ typedef volatile struct microblaze_timer_t {
>   int loadreg; /* load register TLR */
>   int counter; /* timer/counter register */
>  } microblaze_timer_t;
> +
> +int timer_init(void);
> +
> diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
> index 8cf4266..ddbc862 100644
> --- a/arch/microblaze/lib/board.c
> +++ b/arch/microblaze/lib/board.c
> @@ -40,9 +40,6 @@ DECLARE_GLOBAL_DATA_PTR;
>  #ifdef CONFIG_SYS_GPIO_0
>  extern int gpio_init (void);
>  #endif
> -#ifdef CONFIG_SYS_TIMER_0
> -extern int timer_init (void);
> -#endif
>  #ifdef CONFIG_SYS_FSL_2
>  extern void fsl_init2 (void);
>  #endif
> @@ -72,9 +69,7 @@ init_fnc_t *init_sequence[] = {
>   gpio_init,
>  #endif
>   interrupts_init,
> -#ifdef CONFIG_SYS_TIMER_0
>   timer_init,
> -#endif
>  #ifdef CONFIG_SYS_FSL_2
>   fsl_init2,
>  #endif
> diff --git a/include/configs/microblaze-generic.h 
> b/include/configs/microblaze-generic.h
> index 44934eb..9f90107 100644
> --- a/include/configs/microblaze-generic.h
> +++ b/include/configs/microblaze-generic.h
> @@ -102,19 +102,11 @@
>  #endif
>  
>  /* timer */
> -#ifdef XILINX_TIMER_BASEADDR
> -# if (XILINX_TIMER_IRQ != 

[U-Boot] [PATCH V3 1/3] arm/davinci: fix DDR2/mDDR memory controller initialization for Omap L138

2012-07-09 Thread Mikhail Kshevetskiy
follow section 15.2.13.1 (Initializing Following Device Power Up or Reset) of
OMAP-L138 DSP+ARM Processor Technical Reference Manual

Signed-off-by: Mikhail Kshevetskiy 
Acked-by: Christian Riesch 
Tested-by: Christian Riesch 
---
Change for v3:
 * split DDR and UART bugfixes to separate patch series (series 1/3)
Change for v2:
 * fix checkpatch warnings
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   26 +--
 arch/arm/include/asm/arch-davinci/hardware.h|1 +
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c 
b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index df7d6a2..ff2e2e3 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -190,13 +190,21 @@ int da850_ddr_setup(void)
 
setbits_le32(&davinci_syscfg1_regs->vtpio_ctl, VTP_LOCK);
setbits_le32(&davinci_syscfg1_regs->vtpio_ctl, VTP_POWERDWN);
-
-   setbits_le32(&davinci_syscfg1_regs->vtpio_ctl, VTP_IOPWRDWN);
}
-
+   setbits_le32(&davinci_syscfg1_regs->vtpio_ctl, VTP_IOPWRDWN);
writel(CONFIG_SYS_DA850_DDR2_DDRPHYCR, &dv_ddr2_regs_ctrl->ddrphycr);
-   clrbits_le32(&davinci_syscfg1_regs->ddr_slew,
-   (1 << DDR_SLEW_CMOSEN_BIT));
+
+   if (CONFIG_SYS_DA850_DDR2_SDBCR & (1 << DV_DDR_SDCR_DDR2EN_SHIFT)) {
+   /* DDR2 */
+   clrbits_le32(&davinci_syscfg1_regs->ddr_slew,
+   (1 << DDR_SLEW_DDR_PDENA_BIT) |
+   (1 << DDR_SLEW_CMOSEN_BIT));
+   } else {
+   /* MOBILE DDR */
+   setbits_le32(&davinci_syscfg1_regs->ddr_slew,
+   (1 << DDR_SLEW_DDR_PDENA_BIT) |
+   (1 << DDR_SLEW_CMOSEN_BIT));
+   }
 
/*
 * SDRAM Configuration Register (SDCR):
@@ -216,7 +224,11 @@ int da850_ddr_setup(void)
writel(tmp, &dv_ddr2_regs_ctrl->sdbcr);
 
/* write memory configuration and timing */
-   writel(CONFIG_SYS_DA850_DDR2_SDBCR2, &dv_ddr2_regs_ctrl->sdbcr2);
+   if (!(CONFIG_SYS_DA850_DDR2_SDBCR & (1 << DV_DDR_SDCR_DDR2EN_SHIFT))) {
+   /* MOBILE DDR only*/
+   writel(CONFIG_SYS_DA850_DDR2_SDBCR2,
+   &dv_ddr2_regs_ctrl->sdbcr2);
+   }
writel(CONFIG_SYS_DA850_DDR2_SDTIMR, &dv_ddr2_regs_ctrl->sdtimr);
writel(CONFIG_SYS_DA850_DDR2_SDTIMR2, &dv_ddr2_regs_ctrl->sdtimr2);
 
@@ -240,7 +252,7 @@ int da850_ddr_setup(void)
 
/* disable self refresh */
clrbits_le32(&dv_ddr2_regs_ctrl->sdrcr,
-   DV_DDR_SDRCR_LPMODEN | DV_DDR_SDRCR_LPMODEN);
+   DV_DDR_SDRCR_LPMODEN | DV_DDR_SDRCR_MCLKSTOPEN);
writel(CONFIG_SYS_DA850_DDR2_PBBPR, &dv_ddr2_regs_ctrl->pbbpr);
 
return 0;
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index b145c6e..56e5743 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -505,6 +505,7 @@ struct davinci_syscfg1_regs {
((struct davinci_syscfg1_regs *)DAVINCI_SYSCFG1_BASE)
 
 #define DDR_SLEW_CMOSEN_BIT4
+#define DDR_SLEW_DDR_PDENA_BIT 5
 
 #define VTP_POWERDWN   (1 << 6)
 #define VTP_LOCK   (1 << 7)
-- 
1.7.10.4

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


[U-Boot] [PATCH V3 2/3] arm/davinci/da850: add uart0 pinmux

2012-07-09 Thread Mikhail Kshevetskiy
Signed-off-by: Mikhail Kshevetskiy 
---
Change for v3:
 * split DDR and UART bugfixes to separate patch series (series 1/3)
Change for v2:
 * fix checkpatch warnings
---
 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |5 +
 arch/arm/include/asm/arch-davinci/hardware.h|1 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |1 +
 3 files changed, 7 insertions(+)

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c 
b/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
index fa07fb5..dbae5fa 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
@@ -35,6 +35,11 @@ const struct pinmux_config spi1_pins_scs0[] = {
 };
 
 /* UART pin muxer settings */
+const struct pinmux_config uart0_pins_txrx[] = {
+   { pinmux(3), 2, 4 }, /* UART0_RXD */
+   { pinmux(3), 2, 5 }, /* UART0_TXD */
+};
+
 const struct pinmux_config uart1_pins_txrx[] = {
{ pinmux(4), 2, 6 }, /* UART1_RXD */
{ pinmux(4), 2, 7 }, /* UART1_TXD */
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index 56e5743..76aca24 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -447,6 +447,7 @@ struct davinci_pllc_regs {
 /* Clock IDs */
 enum davinci_clk_ids {
DAVINCI_SPI0_CLKID = 2,
+   DAVINCI_UART0_CLKID = 2,
DAVINCI_UART2_CLKID = 2,
DAVINCI_MMC_CLKID = 2,
DAVINCI_MDIO_CLKID = 4,
diff --git a/arch/arm/include/asm/arch-davinci/pinmux_defs.h 
b/arch/arm/include/asm/arch-davinci/pinmux_defs.h
index 07aceaa..eddb3f7 100644
--- a/arch/arm/include/asm/arch-davinci/pinmux_defs.h
+++ b/arch/arm/include/asm/arch-davinci/pinmux_defs.h
@@ -28,6 +28,7 @@ extern const struct pinmux_config spi1_pins_base[3];
 extern const struct pinmux_config spi1_pins_scs0[1];
 
 /* UART pin muxer settings */
+extern const struct pinmux_config uart0_pins_txrx[2];
 extern const struct pinmux_config uart1_pins_txrx[2];
 extern const struct pinmux_config uart2_pins_txrx[2];
 extern const struct pinmux_config uart2_pins_rtscts[2];
-- 
1.7.10.4

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


[U-Boot] [PATCH V3 3/3] serial/ns16550: ns16550 has a different register layout on SOC_DA8XX

2012-07-09 Thread Mikhail Kshevetskiy
also fix NS16550_init() as we need 16x divider

Signed-off-by: Mikhail Kshevetskiy 
Acked-by: Christian Riesch 
Tested-by: Christian Riesch 
---
Change for v3:
 * split DDR and UART bugfixes to separate patch series (series 1/3)
Change for v2:
 * fix checkpatch warnings
---
 drivers/serial/ns16550.c |2 +-
 include/ns16550.h|9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 0c23955..facadd2 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -52,7 +52,7 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm);
serial_out(UART_LCRVAL, &com_port->lcr);
 #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \
-   defined(CONFIG_AM33XX)
+   defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX)
 
 #if defined(CONFIG_APTIX)
/* /13 mode so Aptix 6MHz can hit 115200 */
diff --git a/include/ns16550.h b/include/ns16550.h
index e9d2eda..51cb5b4 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -46,6 +46,14 @@ struct NS16550 {
UART_REG(lsr);  /* 5 */
UART_REG(msr);  /* 6 */
UART_REG(spr);  /* 7 */
+#ifdef CONFIG_SOC_DA8XX
+   UART_REG(reg8); /* 8 */
+   UART_REG(reg9); /* 9 */
+   UART_REG(revid1);   /* A */
+   UART_REG(revid2);   /* B */
+   UART_REG(pwr_mgmt); /* C */
+   UART_REG(mdr1); /* D */
+#else
UART_REG(mdr1); /* 8 */
UART_REG(reg9); /* 9 */
UART_REG(regA); /* A */
@@ -58,6 +66,7 @@ struct NS16550 {
UART_REG(ssr);  /* 11*/
UART_REG(reg12);/* 12*/
UART_REG(osc_12m_sel);  /* 13*/
+#endif
 };
 
 #define thr rbr
-- 
1.7.10.4

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


[U-Boot] [PATCH V3 1/2] mtd/spi/spi_flash: support CMD_READ_ID=0x90 case

2012-07-09 Thread Mikhail Kshevetskiy
current code does not support spi flashes that have 0x90 read_id command,
so fix this

Signed-off-by: Mikhail Kshevetskiy 
---
Change for v3:
 * split SPI flash fixes to separate patch series (series 2/3)
Change for v2:
 * fix checkpatch warnings
---
 drivers/mtd/spi/spi_flash.c  |   66 +++---
 drivers/mtd/spi/spi_flash_internal.h |1 +
 2 files changed, 47 insertions(+), 20 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index f689cc4..530b7b3 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -306,13 +306,44 @@ static const struct {
 };
 #define IDCODE_LEN (IDCODE_CONT_LEN + IDCODE_PART_LEN)
 
+struct spi_flash *spi_analize_flash_probe(struct spi_slave *spi,
+   u8 *idcode, size_t idcode_len, u8 *id)
+{
+   struct spi_flash *flash = NULL;
+   int i, shift;
+   u8 *idp;
+
+#ifdef DEBUG
+   printf("SF: Got idcodes\n");
+   print_buffer(0, idcode, 1, idcode_len, 0);
+#endif
+
+   /* count the number of continuation bytes */
+   for (shift = 0, idp = idcode;
+shift < idcode_len && *idp == 0x7f;
+++shift, ++idp)
+   continue;
+
+   *id = *idp;
+   /* search the table for matches in shift and id */
+   for (i = 0; i < ARRAY_SIZE(flashes); ++i)
+   if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
+   /* we have a match, call probe */
+   flash = flashes[i].probe(spi, idp);
+   if (flash)
+   break;
+   }
+
+   return flash;
+}
+
 struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int spi_mode)
 {
struct spi_slave *spi;
struct spi_flash *flash = NULL;
-   int ret, i, shift;
-   u8 idcode[IDCODE_LEN], *idp;
+   u8 cmd[4], idcode[IDCODE_LEN], id;
+   int ret;
 
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
if (!spi) {
@@ -331,28 +362,23 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
if (ret)
goto err_read_id;
 
-#ifdef DEBUG
-   printf("SF: Got idcodes\n");
-   print_buffer(0, idcode, 1, sizeof(idcode), 0);
-#endif
+   flash = spi_analize_flash_probe(spi, idcode, sizeof(idcode), &id);
+   if (id == 0xff) {
+   /* try CMD_READ_ID_NEW command */
+   cmd[0] = CMD_READ_ID_NEW;
+   spi_flash_addr(0x00, cmd);
 
-   /* count the number of continuation bytes */
-   for (shift = 0, idp = idcode;
-shift < IDCODE_CONT_LEN && *idp == 0x7f;
-++shift, ++idp)
-   continue;
+   ret = spi_flash_cmd_read(spi, cmd, sizeof(cmd),
+   idcode, sizeof(idcode));
+   if (ret)
+   goto err_read_id;
 
-   /* search the table for matches in shift and id */
-   for (i = 0; i < ARRAY_SIZE(flashes); ++i)
-   if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
-   /* we have a match, call probe */
-   flash = flashes[i].probe(spi, idp);
-   if (flash)
-   break;
-   }
+   flash = spi_analize_flash_probe(spi,
+   idcode, sizeof(idcode), &id);
+   }
 
if (!flash) {
-   printf("SF: Unsupported manufacturer %02x\n", *idp);
+   printf("SF: Unsupported manufacturer %02x\n", id);
goto err_manufacturer_probe;
}
 
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 91e036a..b8bd5d5 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -14,6 +14,7 @@
 
 /* Common commands */
 #define CMD_READ_ID0x9f
+#define CMD_READ_ID_NEW0x90
 
 #define CMD_READ_ARRAY_SLOW0x03
 #define CMD_READ_ARRAY_FAST0x0b
-- 
1.7.10.4

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


[U-Boot] [PATCH V3 2/2] mtd/spi: add sst25l driver

2012-07-09 Thread Mikhail Kshevetskiy
Current SST driver does not support well this types of flash, so
introduce a new one.

This code is a combination of sst.c driver from u-boot and sst25l.c
driver from linux-3.3 release. I try to make a code as close to linux
driver as it was possible.

Signed-off-by: Mikhail Kshevetskiy 
---
Change for v3:
 * split SPI flash fixes to separate patch series (series 2/3)
Change for v2:
 * fix checkpatch warnings
 * improve patch description
---
 drivers/mtd/spi/Makefile |3 +-
 drivers/mtd/spi/spi_flash.c  |3 +
 drivers/mtd/spi/spi_flash_internal.h |1 +
 drivers/mtd/spi/sst25l.c |  372 ++
 4 files changed, 378 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mtd/spi/sst25l.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 90f8392..9285bf7 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -34,7 +34,8 @@ COBJS-$(CONFIG_SPI_FLASH_ATMEL)   += atmel.o
 COBJS-$(CONFIG_SPI_FLASH_EON)  += eon.o
 COBJS-$(CONFIG_SPI_FLASH_MACRONIX) += macronix.o
 COBJS-$(CONFIG_SPI_FLASH_SPANSION) += spansion.o
-COBJS-$(CONFIG_SPI_FLASH_SST)  += sst.o
+COBJS-$(CONFIG_SPI_FLASH_SST)  += sst.o
+COBJS-$(CONFIG_SPI_FLASH_SST25L)   += sst25l.o
 COBJS-$(CONFIG_SPI_FLASH_STMICRO)  += stmicro.o
 COBJS-$(CONFIG_SPI_FLASH_WINBOND)  += winbond.o
 COBJS-$(CONFIG_SPI_FRAM_RAMTRON)   += ramtron.o
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 530b7b3..d2da542 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -285,6 +285,9 @@ static const struct {
 #ifdef CONFIG_SPI_FLASH_SST
{ 0, 0xbf, spi_flash_probe_sst, },
 #endif
+#ifdef CONFIG_SPI_FLASH_SST25L
+   { 0, 0xbf, spi_flash_probe_sst25l, },
+#endif
 #ifdef CONFIG_SPI_FLASH_STMICRO
{ 0, 0x20, spi_flash_probe_stmicro, },
 #endif
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index b8bd5d5..89d9036 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -98,6 +98,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave 
*spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode);
+struct spi_flash *spi_flash_probe_sst25l(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode);
diff --git a/drivers/mtd/spi/sst25l.c b/drivers/mtd/spi/sst25l.c
new file mode 100644
index 000..9d7be0d
--- /dev/null
+++ b/drivers/mtd/spi/sst25l.c
@@ -0,0 +1,372 @@
+/*
+ * Driver for SST25L SPI Flash chips
+ *
+ * (C) Copyright 2000-2002
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ * Copyright 2008, Network Appliance Inc.
+ * Jason McMullan 
+ * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
+ * TsiChung Liew (tsi-chung.l...@freescale.com)
+ * Copyright (c) 2008-2009 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "spi_flash_internal.h"
+
+#define SST25L_CMD_WRSR0x01/* Write status register */
+#define SST25L_CMD_WRDI0x04/* Write disable */
+#define SST25L_CMD_RDSR0x05/* Read status register */
+#define SST25L_CMD_WREN0x06/* Write enable */
+#define SST25L_CMD_READ0x03/* High speed read */
+
+#define SST25L_CMD_EWSR0x50/* Enable write status register 
*/
+#define SST25L_CMD_SECTOR_ERASE0x20/* Erase sector */
+#define SST25L_CMD_READ_ID 0x90/* Read device ID */
+#define SST25L_CMD_AAI_PROGRAM 0xaf/* Auto address increment */
+
+#define SST25L_STATUS_BUSY (1 << 0)/* Chip is busy */
+#define SST25L_STATUS_WREN (1 << 1)/* Write enabled */
+#define SST25L_STATUS_BP0  (1 << 2)/* Block protection 0 */
+#define SST25L_STATUS_BP1  (1 << 3)/* Block protection 1 */
+
+struct flash_info {
+   const char  *name;
+   u16 device_id;
+   u32 page_size;
+   u32 nr_pages;
+   u32 erase_size;
+};
+
+struct sst25l_spi_flash {
+   struct spi_flashflash;
+   const struct flash_info *flash_info;
+};
+
+#define to_sst25l_spi_flash(x) container_of(x, struct sst25l_spi_flash, flash)
+
+static struct flash_info sst25l_flash_info[] = {
+   {"sst25vf010a", 0xbf49, 256, 512,  4096},
+   {"sst25lf020a", 0xbf43, 256, 1024, 4096},
+   {"sst25lf040a", 0xbf44, 256, 2048, 4096},
+};
+
+static inline int spi_write_sync(struct spi_slave *spi,
+  

[U-Boot] [PATCH V3 1/3] MMC: u-boot-spl may be compiled without partition support

2012-07-09 Thread Mikhail Kshevetskiy
Signed-off-by: Mikhail Kshevetskiy 
---
Change for v3:
 * split MMC+SPL+no partition table support bugfix to separate patch
   series (series 3/3)
Change for v2:
 * fix checkpatch warnings
---
 drivers/mmc/mmc.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index aebe578..69df64a 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1253,7 +1253,9 @@ int mmc_startup(struct mmc *mmc)
(mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);
sprintf(mmc->block_dev.revision, "%d.%d", mmc->cid[2] >> 28,
(mmc->cid[2] >> 24) & 0xf);
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT)
init_part(&mmc->block_dev);
+#endif
 
return 0;
 }
-- 
1.7.10.4

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


[U-Boot] [PATCH V3 2/3] arm/davinci: spl - boot device selection

2012-07-09 Thread Mikhail Kshevetskiy
This patch allow us to have a universal spl that detects a boot
device and select a corresponding boot algorithm for main u-boot part
(SOC_DA8XX only)

This patch create copy copy of drivers/mtd/nand/nand_spl_load.c and
drivers/mtd/spi/spi_spl_load.c for the following reasons:
 * avoid jump to main u-boot code just after its loading (required
   for the next patch: spl - add compressed u-boot image support)
 * makes a structure similar to omap3 sources

Signed-off-by: Mikhail Kshevetskiy 
---
Change for v3:
 * split MMC+SPL+no partition table support bugfix to separate patch
   series (series 3/3)
Change for v2:
 * fix checkpatch warnings
 * defines for constants
 * use readl() to read a BOOTCFG_REG
 * improve patch description
---
 arch/arm/cpu/arm926ejs/davinci/Makefile  |5 ++
 arch/arm/cpu/arm926ejs/davinci/spl.c |   91 +++---
 arch/arm/cpu/arm926ejs/davinci/spl_mmc.c |   39 ++
 arch/arm/cpu/arm926ejs/davinci/spl_nand.c|   11 +++
 arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c   |   25 ++
 arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c  |   42 ++
 arch/arm/include/asm/arch-davinci/davinci_boot.h |   50 
 include/configs/cam_enc_4xx.h|   12 +--
 include/configs/da850evm.h   |   19 +++--
 include/configs/hawkboard.h  |   11 +--
 10 files changed, 275 insertions(+), 30 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_mmc.c
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c
 create mode 100644 arch/arm/include/asm/arch-davinci/davinci_boot.h

diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
b/arch/arm/cpu/arm926ejs/davinci/Makefile
index da7efac..12bd37a 100644
--- a/arch/arm/cpu/arm926ejs/davinci/Makefile
+++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
@@ -40,6 +40,11 @@ ifdef CONFIG_SPL_BUILD
 COBJS-y+= spl.o
 COBJS-$(CONFIG_SOC_DM365)  += dm365_lowlevel.o
 COBJS-$(CONFIG_SOC_DA8XX)  += da850_lowlevel.o
+
+COBJS-$(CONFIG_SPL_NAND_SUPPORT)   += spl_nand.o
+COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT)  += spl_spi_flash.o
+COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
+COBJS-$(CONFIG_SPL_MMC_SUPPORT)+= spl_mmc.o
 endif
 
 SOBJS  = reset.o
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
index 74632e5..50b4bbc 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -25,9 +25,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 
@@ -72,25 +74,92 @@ void board_init_f(ulong dummy)
relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
 }
 
+u32 davinci_boot_device(void){
+#ifdef CONFIG_SOC_DA8XX
+   u32 bootmode = readl(BOOTCFG_REG) & BOOTCFG_REG_DEVICE_MASK;
+   switch (bootmode) {
+   case BOOTCFG_DEVICE_NAND8:
+   case BOOTCFG_DEVICE_NAND16:
+   return BOOT_DEVICE_TYPE_NAND;
+   case BOOTCFG_DEVICE_SPI0_FLASH:
+   case BOOTCFG_DEVICE_SPI1_FLASH:
+   return BOOT_DEVICE_TYPE_SPI_FLASH;
+   case BOOTCFG_DEVICE_UART0:
+   case BOOTCFG_DEVICE_UART1:
+   case BOOTCFG_DEVICE_UART2:
+   return BOOT_DEVICE_TYPE_UART;
+   case BOOTCFG_DEVICE_MMC_OR_SD0:
+   return BOOT_DEVICE_TYPE_MMC;
+   default:
+   return BOOT_DEVICE_TYPE_NONE;
+   }
+#else
+#ifdef
+#endif CONFIG_SPL_NAND_SUPPORT
+   return BOOT_DEVICE_TYPE_NAND;
+#endif
+#ifdef BOOT_DEVICE_SPI_FLASH
+   return BOOT_DEVICE_TYPE_SPI_FLASH;
+#endif
+#ifdef CONFIG_SPL_YMODEM_SUPPORT
+   return BOOT_DEVICE_TYPE_UART;
+#endif
+#ifdef CONFIG_SPL_MMC_SUPPORT
+   return BOOT_DEVICE_TYPE_MMC;
+#endif
+}
+
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SPL_NAND_LOAD
-   nand_init();
-   puts("Nand boot...\n");
-   nand_boot();
-#endif
-#ifdef CONFIG_SPL_SPI_LOAD
-   mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
-   CONFIG_SYS_MALLOC_LEN);
+   u32 boot_device;
+   void (*uboot)(void) __noreturn;
+
+   mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
+   CONFIG_SYS_SPL_MALLOC_SIZE);
 
gd = &gdata;
gd->bd = &bdata;
gd->flags |= GD_FLG_RELOC;
+#ifdef CONFIG_SPL_SERIAL_SUPPORT
gd->baudrate = CONFIG_BAUDRATE;
-   serial_init();  /* serial communications setup */
+   serial_init();
gd->have_console = 1;
+#endif
 
-   puts("SPI boot...\n");
-   spi_boot();
+   boot_device = davinci_boot_device();
+   debug("boot device - %d\n", boot_device);
+   switch (boot_device) {
+#ifdef CONFIG_SPL_NAND_SUPPORT
+   case BOOT_DEVICE_TYPE_NAND:
+   puts("Booting from nand flas

[U-Boot] [PATCH V3 3/3] arm/davinci: spl - add compressed u-boot image support

2012-07-09 Thread Mikhail Kshevetskiy
Motivation:
 * we have a board with 128 Kb spi flash, so normal u-boot.ais does not
   fit on it.

This patch add support of compressed 2-nd u-boot stage. To create a compressed
ais image its required:
 * define CONFIG_SPL_GUNZIP_SUPPORT --- enable compressed ais image supports
 * define CONFIG_SPL_GUNZIP_MAX_SIZE --- define a maximum size of compressed
   u-boot part
 * define CONFIG_SPL_GUNZIP_LOAD_ADDR --- memory address to load compressed
   u-boot part (CONFIG_SPL_GUNZIP_LOAD_ADDR region should not overlap with
   CONFIG_SYS_TEXT_BASE region)
 * use: make u-boot-gzip.ais to get a compressed ais image

Signed-off-by: Mikhail Kshevetskiy 
---
Change for v3:
 * split MMC+SPL+no partition table support bugfix to separate patch
   series (series 3/3)
Change for v2:
 * fix checkpatch warnings
 * fix merge conflict with upstream u-boot sources
 * improve patch description
---
 Makefile   |   14 ++
 arch/arm/cpu/arm926ejs/davinci/spl.c   |7 +++
 arch/arm/cpu/arm926ejs/davinci/spl_mmc.c   |7 ++-
 arch/arm/cpu/arm926ejs/davinci/spl_nand.c  |7 ++-
 arch/arm/cpu/arm926ejs/davinci/spl_spi_flash.c |7 ++-
 arch/arm/cpu/arm926ejs/davinci/spl_ymodem.c|4 
 lib/Makefile   |1 +
 spl/Makefile   |1 +
 8 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 85e36ec..cf16824 100644
--- a/Makefile
+++ b/Makefile
@@ -452,6 +452,20 @@ $(obj)u-boot.ais:   $(obj)spl/u-boot-spl.bin 
$(obj)u-boot.bin
$(obj)u-boot.ais
rm $(obj)spl/u-boot-spl{,-pad}.ais
 
+$(obj)u-boot-gzip.ais:   $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+   $(obj)tools/mkimage -s -n /dev/null -T aisimage \
+   -e $(CONFIG_SPL_TEXT_BASE) \
+   -d $(obj)spl/u-boot-spl.bin \
+   $(obj)spl/u-boot-spl.ais
+   $(OBJCOPY) ${OBJCFLAGS} -I binary \
+   --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
+   $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
+   cp $(obj)u-boot.bin $(obj)spl/u-boot.bin
+   gzip $(obj)spl/u-boot.bin
+   cat $(obj)spl/u-boot-spl-pad.ais $(obj)spl/u-boot.bin.gz > \
+   $(obj)u-boot-gzip.ais
+   rm $(obj)spl/u-boot-spl{,-pad}.ais $(obj)spl/u-boot.bin.gz
+
 $(obj)u-boot.sb:   $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \
-o $(obj)u-boot.sb
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
index 50b4bbc..041df5b 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -111,6 +111,7 @@ u32 davinci_boot_device(void){
 
 void board_init_r(gd_t *id, ulong dummy)
 {
+   int size;
u32 boot_device;
void (*uboot)(void) __noreturn;
 
@@ -159,6 +160,12 @@ void board_init_r(gd_t *id, ulong dummy)
break;
}
 
+#ifdef CONFIG_SPL_GUNZIP_SUPPORT
+   size = CONFIG_SPL_GUNZIP_MAX_SIZE;
+   gunzip((void *)CONFIG_SYS_TEXT_BASE, 512 * 1024,
+   (void *)CONFIG_SPL_GUNZIP_LOAD_ADDR, &size);
+#endif
+
puts("Jump to U-Boot image...\n");
uboot = (void *) CONFIG_SYS_TEXT_BASE;
(*uboot)();
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl_mmc.c 
b/arch/arm/cpu/arm926ejs/davinci/spl_mmc.c
index 1a551e9..fa67f1a 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl_mmc.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl_mmc.c
@@ -28,7 +28,12 @@ void spl_mmc_load_image(void)
ret = mmc->block_dev.block_read(0,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS,
-   (void *) CONFIG_SYS_TEXT_BASE);
+#ifndef CONFIG_SPL_GUNZIP_SUPPORT
+   (void *) CONFIG_SYS_TEXT_BASE
+#else
+   (void *) CONFIG_SPL_GUNZIP_LOAD_ADDR
+#endif
+   );
if (ret < 0) {
printf("spl: mmc blk read err - %d\n", ret);
hang();
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl_nand.c 
b/arch/arm/cpu/arm926ejs/davinci/spl_nand.c
index bad1e8f..4bf3e6a 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl_nand.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl_nand.c
@@ -6,6 +6,11 @@ void spl_nand_load_image(void)
nand_init();
nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
CONFIG_SYS_NAND_U_BOOT_SIZE,
-   (void *) CONFIG_SYS_TEXT_BASE);
+#ifndef CONFIG_SPL_GUNZIP_SUPPORT
+   (void *) CONFIG_SYS_TEXT_BASE
+#else
+   (void *) CONFIG_SPL_GUNZIP_LOAD_ADDR
+#endif
+   );
debug(

Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Wolfgang Denk
Dear Detlev,

In message  you wrote:
> 
> > I agree that even very simple and uncomplete implementations can co in

should read: ...can go in...

> > if the fulfil some purpose, and can form a basis for future
> > extensions. 
> >
> > To make sure everybody sees such code, we should really add it to the
> > standard locations.
> 
> According to the current situation, we have the choice of getting good
> code into a board directory or no code at all because Prafulla doesn't
> accept the code in its current incarnation into a general place.  I

I just tried to explain that my wish is that 1) this code can go in,
even if not perfectly universal yet, and 2) that it should go into the
standard location for such drivers.

> don't need a crystal ball to see that the project will loose code this
> way.  I'm sorry that the project rejects working code and I re-ask
> Prafulla to reconsider his NAK which has impact on the whole project.

I don't see why you are taking about rejecting code here.
Didn't I make clear that I vote for adding this code?

I hope Prafulla finds this recommendation acceptable (especially after
I added him to Cc: so he actually gets aware of this discussion).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Unix: Some say the learning curve is steep,  but  you  only  have  to
climb it once.  - Karl Lehenbauer
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Wolfgang Denk
Dear Detlev,

In message  you wrote:
> 
> I just read through our documentation on the Wiki and found nothing
> relavant to such a topic.  If we make this a requirement, we should add
> it so people know about it beforehand.

You know all too well that our wiki suffers from a mismatch of what
people expect to it and what htey contribute to it.

> How about amending the U-Boot design principles with 

Go for it - it's a wiki.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You don't have to stay up nights to succeed; you have to  stay  awake
days.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] sha256_crypt for uboot

2012-07-09 Thread Wolfgang Denk
Dear Richard Retanubun,

In message <4ffae18d.3080...@ruggedcom.com> you wrote:
>
> Thus, we aim to add the ability uboot to identify users, much like the 
> payload OS does
> before granting access to its CLI (if the user interrupts the boot process).

You are opening a can of worms here, and I bet you don't know yet how
big it is.  U-Boot has never been designed with any such level of
security in mind.

If you want securityu, then add it to an environment which has been
designed for it, i. e. use an OS like Linux.  Use U-Boot just to boot
this OS, and don't give anybody an easy chance to break in.

On the other hand, realize how complicated it is just to attach a JTAG
debugger and take over full controll of your board.  Yes, even if you
don't provide a connector to such an interface.  I know quite a number
of systems that have been "opened" this way.

Frankly, I doubt this makes sense from a technical point of view.
[Yes, I know that there are situations where management and.or
marketing asks for such stuff. But is that a good reason to do it?]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Old programmers never die, they just become managers.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 2/3] arm/davinci: spl - boot device selection

2012-07-09 Thread Tom Rini
On 07/09/2012 11:53 AM, Mikhail Kshevetskiy wrote:
> This patch allow us to have a universal spl that detects a boot
> device and select a corresponding boot algorithm for main u-boot part
> (SOC_DA8XX only)
> 
> This patch create copy copy of drivers/mtd/nand/nand_spl_load.c and
> drivers/mtd/spi/spi_spl_load.c for the following reasons:
>  * avoid jump to main u-boot code just after its loading (required
>for the next patch: spl - add compressed u-boot image support)
>  * makes a structure similar to omap3 sources
> 
> Signed-off-by: Mikhail Kshevetskiy 

I guess I wasn't clear enough when I asked the series to be split.  I
want to see this portion turned into:
a) Move omap-common spl bits to arch/arm/lib/
b) davinci converted (and as needed, omap3/4/am33xx converted) to be
able to use the same code.

We shouldn't introduce a new spl_mmc.c for example, we should modify the
davinci structure to be able to re-use the same spl_mmc.c code to
load/verify and let the next step, as needed happen.  I want to see
"omap" be able to re-use SPI (since am33xx can do it too, and I've
kludged the davinci stuff before) and potentially be able to re-use for
example the gunzip support.  This I think is the easy set of steps to
being able to reuse this fairly common SPL logic outside of not just TI
parts but anyone else that wants it.

-- 
Tom


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


Re: [U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

2012-07-09 Thread Wolfgang Denk
Dear Holger,

In message <4ffaee4f.3090...@keymile.com> you wrote:
> 
> shouldn't be there an exception for strictly board specific peripheral drivers
> like an custom-made FPGA?

I see two situations:

1) We are talking about code to load a bitstream into the FPGA, i. e.
   to "program it".  Such code should always be generic enough to put
   it under drivers/fpga/ (if the existing code there does not already
   cover the task).

2) We are talking about driver code for some preipheral implemented
   in the FPGA.  In many cases we find these peripherals to be pretty
   generic (say, UARTs, GPIOs, network interfaces, etc.).  In such
   cases there is no doubt that driver code should go to drivers/ .
   ONly in case you have areally, really special feature implemented
   that you need supported in U-Boot.  OK, then such drivers are
   probably better kept in your board directory.

Note that there will always be cases where hindsight will show that
the initial location was not perfect.  That is perfectly normal ;-)

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
'What shall we do?' said Twoflower.  'Panic?'  said  Rincewind  hope-
fully. He always held that panic was the best means of survival; back
in  the  olden days, his theory went, people faced with hungry sabre-
toothed tigers could be divided very simply in those who panicked and
those who stood there saying 'What a magnificent  brute!'  or  'Here,
pussy.'  - Terry Pratchett, _The Light Fantastic_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] i.MX35PDK: Starting U-Boot from serial NOR-Flash

2012-07-09 Thread Fabio Estevam
Hi Michael,

On Mon, Jul 9, 2012 at 9:57 AM, Hornung, Michael  wrote:

> +++ b/board/freescale/mx35pdk/imximage.cfg
>
> +BOOT_FROM  spi

Please see the Freescale U-boot, you missed the initialization of the CS5:

  //WEIM config-CS5 init
  DCDGEN(1, 4, 0xB8002050, 0xd843)
  DCDGEN(1_1, 4, 0xB8002054, 0x22252521)
  DCDGEN(1_2, 4, 0xB8002058, 0x0a00)

> +# DDR2 init
> +DATA 4 0xB8001010 0x0304
> +DATA 4 0xB8001010 0x030C
> +DATA 4 0xB8001004 0x007ffc3f
> +DATA 4 0xB8001000 0x9222
> +DATA 4 0x8400 0x12345678
> +DATA 4 0xB8001000 0xA222
> +DATA 4 0x8000 0x87654321
> +DATA 4 0x8000 0x87654321
> +DATA 4 0xB8001000 0xB222
> +DATA 1 0x8233 0xda
> +DATA 1 0x82000780 0xda
> +DATA 1 0x82000400 0xda
> +DATA 4 0xB8001000 0x82226080
> +DATA 4 0xB8001004 0x007ffc3f
> +DATA 4 0xB800100C 0x007ffc3f
> +DATA 4 0xB8001010 0x0304
> +DATA 4 0xB8001008 0x2000
>
>
> --- a/board/freescale/mx35pdk/lowlevel_init.S
> +++ b/board/freescale/mx35pdk/lowlevel_init.S
>
> init_sdram_start:
> /*init_sdram*/
> -   setup_sdram
> +  /* setup_sdram */
>
>
> And here the result (output on the serial line):
>
> ---
> U-Boot 2012.04.01-00077-g48bcd18-dirty (Jul 09 2012 - 15:22:31)
>
> CPU:   Freescale i.MX35 rev 2.1 at 532 MHz.
> Reset cause: POR
> I2C:   ready
> 
>
> And that's it, no more output after "I2C:   ready".  Perhaps you have some 
> more hints about what to do?

Most likely it is because it will try to access the network, but you
missed to setup the CS5 as per the Freescale U-boot init sequence.

Regards,

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


Re: [U-Boot] [ARM] one warning left for all ARM boards

2012-07-09 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message <20120709174210.0bc0cef5@aari01-12> you wrote:
> 
> With the latest commits on u-boot/master, two obnoxious "attention"
> messages were removed from ARM builds, but one still remains:
> 
> attention : -fstack-usage not supported for this target [enabled by
> default]

As recommended on the ML I reverted the commit that caused this
trouble, waiting to see a new (more carefully tested) version to be
applied instead.

At the moment ARM is build clean, as far as I can tell.

If nobody adds any new pull requests very soon now, I'll go for -rc1.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
As usual, this being a 1.3.x release, I haven't  even  compiled  this
kernel yet. So if it works, you should be doubly impressed.
  - Linus Torvalds in <199506181536.saa10...@keos.cs.helsinki.fi>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] random errors in kernel or rootfs;u-boot check sum

2012-07-09 Thread Wolfgang Denk
Dear Anthony Garland,

In message  
you wrote:
> 
> I'm working on a recovery tool for an overo COM where I can boot all
> the way into into Linux over USB. This is similar to the beagle-board
> recovery tools. I have a host computer send the overo a modified
> version of x-loader which will ask the host computer for more files to
> store at an address. I have the host computer send it u-boot and

Your version of U-Boot is pretty old, and you are still using X-Loader
instead of SPL - these are too many old components to spend efforts in
analyzing potential problems.  Can you please update instead?

> I thought that u-boot did a check sum on uMulti. If uMulti is being
> corrupted during the USB transfer by noise on the power supply, why
> isn't u-boot check sum catching it??

Maybe you switched it off?

> I've attached the script I use to make uMulti, my Boot_usb.sh script,
> and a few logs of it randomly failing and succeeding.

You have other problems, like instable / incorrectly intialized memory.

> # For whatever reason, the gzip files seem more error prone. With no
> compression I seem to get better results.

Wrong.  Without compression errors don't get caought so easily. I bet
they are still there.

...
>Contents:
>   Image 0: 2585928 Bytes = 2.5 MiB
>   Image 1: 13631488 Bytes = 13 MiB
>Verifying Checksum ... OK

As you can see, it _does_ checksum verification.

> [0.00] Linux version 3.2.0 (anthony@linux-server) (gcc version 4.3.3 
> (GCC) ) #1 Thu Jun 28 16:13:37 CDT 2012

Uh, oh.  GCC 4.3 - can you _please_ try a more recent and less buggy
tool chain?

Recent kernel versions and ancient tools usually don't mix without
problems.


> [8.032104] alignment: ignoring faults is unsafe on this CPU.
> Defaulting to fixup mode.
> Remounting root file system...
> WARNING: -e needs -E or -F
> Segmentation fault

Alignments issues ?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Don't put off for tomorrow what you can  do  today,  because  if  you
enjoy it today you can do it again tomorrow.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] usb_storage: fix ehci driver max transfer size

2012-07-09 Thread Stefan Herbrechtsmeier
The commit 5dd95cf93dfffa1d19a1928990852aac9f55b9d9 'usb_storage:
Fix EHCI "out of buffer pointers" with CD-ROM' introduce a bug in
usb_storage as it wrongly assumes that every transfer can use
4096 bytes per qt_buffer. This is wrong if the start address of
the data is not page aligned to 4096 bytes and leads to 'EHCI
timed out on TD' messages because of 'out of buffer pointers'
in ehci_td_buffer function.

The bug appears during load of a fragmented file and
read from or write to an unaligned memory address.

Cc: Marek Vasut 
Signed-off-by: Stefan Herbrechtsmeier 

---
Changes for v2:
 - Replace fixed worst case calculation with dynamic
   computation based on start address of transfer

 common/usb_storage.c |   37 -
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index faad237..bdc306f 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -150,12 +150,17 @@ struct us_data {
unsigned intirqpipe;/* pipe for release_irq */
unsigned char   irqmaxp;/* max packed for irq Pipe */
unsigned char   irqinterval;/* Intervall for IRQ Pipe */
-   unsigned long   max_xfer_blk;   /* Max blocks per xfer */
ccb *srb;   /* current srb */
trans_reset transport_reset;/* reset routine */
trans_cmnd  transport;  /* transport routine */
 };
 
+/*
+ * The U-Boot EHCI driver cannot handle more than 5 page aligned buffers
+ * of 4096 bytes in a transfer without running itself out of qt_buffers
+ */
+#define USB_MAX_XFER_BLK(start, blksz) (((4096 * 5) - (start % 4096)) / blksz)
+
 static struct us_data usb_stor[USB_MAX_STOR_DEV];
 
 
@@ -1041,7 +1046,7 @@ static void usb_bin_fixup(struct usb_device_descriptor 
descriptor,
 unsigned long usb_stor_read(int device, unsigned long blknr,
unsigned long blkcnt, void *buffer)
 {
-   unsigned long start, blks, buf_addr;
+   unsigned long start, blks, buf_addr, max_xfer_blk;
unsigned short smallblks;
struct usb_device *dev;
struct us_data *ss;
@@ -1083,12 +1088,14 @@ unsigned long usb_stor_read(int device, unsigned long 
blknr,
/* XXX need some comment here */
retry = 2;
srb->pdata = (unsigned char *)buf_addr;
-   if (blks > ss->max_xfer_blk)
-   smallblks = ss->max_xfer_blk;
+   max_xfer_blk = USB_MAX_XFER_BLK(buf_addr,
+   usb_dev_desc[device].blksz);
+   if (blks > max_xfer_blk)
+   smallblks = (unsigned short) max_xfer_blk;
else
smallblks = (unsigned short) blks;
 retry_it:
-   if (smallblks == ss->max_xfer_blk)
+   if (smallblks == max_xfer_blk)
usb_show_progress();
srb->datalen = usb_dev_desc[device].blksz * smallblks;
srb->pdata = (unsigned char *)buf_addr;
@@ -1109,7 +1116,7 @@ retry_it:
start, smallblks, buf_addr);
 
usb_disable_asynch(0); /* asynch transfer allowed */
-   if (blkcnt >= ss->max_xfer_blk)
+   if (blkcnt >= max_xfer_blk)
debug("\n");
return blkcnt;
 }
@@ -1117,7 +1124,7 @@ retry_it:
 unsigned long usb_stor_write(int device, unsigned long blknr,
unsigned long blkcnt, const void *buffer)
 {
-   unsigned long start, blks, buf_addr;
+   unsigned long start, blks, buf_addr, max_xfer_blk;
unsigned short smallblks;
struct usb_device *dev;
struct us_data *ss;
@@ -1162,12 +1169,14 @@ unsigned long usb_stor_write(int device, unsigned long 
blknr,
 */
retry = 2;
srb->pdata = (unsigned char *)buf_addr;
-   if (blks > ss->max_xfer_blk)
-   smallblks = ss->max_xfer_blk;
+   max_xfer_blk = USB_MAX_XFER_BLK(buf_addr,
+   usb_dev_desc[device].blksz);
+   if (blks > max_xfer_blk)
+   smallblks = (unsigned short) max_xfer_blk;
else
smallblks = (unsigned short) blks;
 retry_it:
-   if (smallblks == ss->max_xfer_blk)
+   if (smallblks == max_xfer_blk)
usb_show_progress();
srb->datalen = usb_dev_desc[device].blksz * smallblks;
srb->pdata = (unsigned char *)buf_addr;
@@ -1188,7 +1197,7 @@ retry_it:
start, smallblks, buf_addr);
 
usb_disable_asynch(0); /* asynch transfer allowed */
-   if (blkcnt >= ss->max_xfer_blk)
+   if (blkcnt >= max_xfer_blk)
debug("\n");
return blkcnt;
 
@@ -1415,12 +1424,6 @@ int usb_stor_

Re: [U-Boot] [PATCH V3 2/3] arm/davinci: spl - boot device selection

2012-07-09 Thread Tom Rini
On 07/09/2012 12:57 PM, Mikhail Kshevetskiy wrote:
> On Mon, 9 Jul 2012 12:41:06 -0700
> Tom Rini  wrote:
> 
>> On 07/09/2012 11:53 AM, Mikhail Kshevetskiy wrote:
>>> This patch allow us to have a universal spl that detects a boot
>>> device and select a corresponding boot algorithm for main u-boot part
>>> (SOC_DA8XX only)
>>>
>>> This patch create copy copy of drivers/mtd/nand/nand_spl_load.c and
>>> drivers/mtd/spi/spi_spl_load.c for the following reasons:
>>>  * avoid jump to main u-boot code just after its loading (required
>>>for the next patch: spl - add compressed u-boot image support)
>>>  * makes a structure similar to omap3 sources
>>>
>>> Signed-off-by: Mikhail Kshevetskiy 
>>
>> I guess I wasn't clear enough when I asked the series to be split.  I
>> want to see this portion turned into:
>> a) Move omap-common spl bits to arch/arm/lib/
>> b) davinci converted (and as needed, omap3/4/am33xx converted) to be
>> able to use the same code.
>>
>> We shouldn't introduce a new spl_mmc.c for example, we should modify the
>> davinci structure to be able to re-use the same spl_mmc.c code to
>> load/verify and let the next step, as needed happen.  I want to see
>> "omap" be able to re-use SPI (since am33xx can do it too, and I've
>> kludged the davinci stuff before) and potentially be able to re-use for
>> example the gunzip support.  This I think is the easy set of steps to
>> being able to reuse this fairly common SPL logic outside of not just TI
>> parts but anyone else that wants it.
> 
> Ok, I'll take this task. Unfortunately I have no too much free time for this
> job (summer, parents visit, new job and so on), so it may take a month or so.

OK, thanks.

> What about other patches?

The ddr/uart ones should make their way in soon and I've assigned the
SPI ones to the custodian in patchwork.

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


Re: [U-Boot] Please pull u-boot-ti/master

2012-07-09 Thread Albert ARIBAUD
Hi Tom,

On Mon, 9 Jul 2012 11:43:56 -0700, Tom Rini  wrote:
> Hello,
> 
> The following changes since commit d702b0811df53a1fc2d8049e35431e4591d093c6:
> 
>   ARM: cache: Move the cp15 CR register read before flushing the cache. 
> (2012-07-07 14:07:44 +0200)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-ti master
> 
> for you to fetch changes up to a92cc088d32e58b53b6a6d2faec5288f4ed1:
> 
>   beagle: add eeprom expansion board info for bct brettl4 (2012-07-09 
> 05:53:00 -0700)
> 
> 
> Peter Meerwald (1):
>   beagle: add eeprom expansion board info for bct brettl4
> 
>  board/ti/beagle/beagle.c |8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> This is a small change and one that I believe is best served being in
> mainline and releases sooner rather than later.  Thanks!

Applied to u-boot-arm/master, thanks.

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


  1   2   >