Re: [U-Boot] U-Boot: am335x video support

2013-06-26 Thread Matthias Fuchs
Hi Heiko,

perhaps you should take a look at the DA8XX driver. At least
under Linux this driver also handles the AM335x.

Splash screen support (meaning support of the splashimage variable)
might be a problem because it expects a direct mapped physical address
where the splash image is stored - typically some onboard nor flash. But
AM335x designs typically have MMC, NAND or SPI flash attached. So you
probably need some commands to load the spashscreen from a flash device
and then use the 'bmp' command to display it. This should work with all
video drivers.

Matthias

On 26.06.2013 08:29, Heiko Schocher wrote:
> Hello,
> 
> is in current U-Boot a lcd driver for the am335x integrated
> LCD controller? If yes, also with Splash screen support?
> 
> Thanks!
> 
> bye,
> Heiko
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot: am335x video support

2013-06-26 Thread Heiko Schocher
Hello Matthias,

Am 26.06.2013 08:46, schrieb Matthias Fuchs:
> Hi Heiko,
> 
> perhaps you should take a look at the DA8XX driver. At least
> under Linux this driver also handles the AM335x.

Ah! Hmm... I found only one board, which uses this driver ...
But it is a good starting point I think!

Thanks!

> Splash screen support (meaning support of the splashimage variable)
> might be a problem because it expects a direct mapped physical address
> where the splash image is stored - typically some onboard nor flash. But
> AM335x designs typically have MMC, NAND or SPI flash attached. So you
> probably need some commands to load the spashscreen from a flash device
> and then use the 'bmp' command to display it. This should work with all
> video drivers.

Yep.

bye,
Heiko

> Matthias
> 
> On 26.06.2013 08:29, Heiko Schocher wrote:
>> Hello,
>>
>> is in current U-Boot a lcd driver for the am335x integrated
>> LCD controller? If yes, also with Splash screen support?
>>
>> Thanks!
>>
>> bye,
>> Heiko
>>
> 
> 


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


Re: [U-Boot] U-Boot Digest, Vol 61, Issue 36

2013-06-26 Thread krishna dwivedi
Hi All,


I am trying to build U-boot:2013-04.But running into this error:
mips64-nlm-elf-ld: arch/mips/cpu/mips64/start.o: relocation (null) against
`board_init_f' can not be used when making a shared object; recompile with
-fPIC
arch/mips/cpu/mips64/start.o: could not read symbols: Bad value.
Can ayone please provide me pointer what could be issue here.

Regards,
krishna


On Wed, Jun 26, 2013 at 11:52 AM, krishna dwivedi <
krishna.dwived...@gmail.com> wrote:

> Hi All,
>
> Hope everyone is doing great:)
>
> I am trying to build U-boot:2013-04.But running into this error:
> mips64-nlm-elf-ld: arch/mips/cpu/mips64/start.o: relocation (null) against
> `board_init_f' can not be used when making a shared object; recompile with
> -fPIC
> arch/mips/cpu/mips64/start.o: could not read symbols: Bad value.
>
>
> Initially,In file arch/mips/config.mk,I commented the flag:
> #LDFLAGS_FINAL   +=  -pie
> This error resolved.But after relocation of u-boot code,we need this
> flag.So i need to uncomment this flag.and again i am running into this
> error agian.
>
> Anyone faced this issue earlier.Anyone please provide pointers to resolve
> this.
>
> Thanks in advance!!
>
> Regards,
> Krishna
>
>
>
>
>
> On Tue, Jun 25, 2013 at 3:30 PM,  wrote:
>
>> Send U-Boot mailing list submissions to
>> u-boot@lists.denx.de
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://lists.denx.de/mailman/listinfo/u-boot
>> or, via email, send a message with subject or body 'help' to
>> u-boot-requ...@lists.denx.de
>>
>> You can reach the person managing the list at
>> u-boot-ow...@lists.denx.de
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of U-Boot digest..."
>>
>>
>> Today's Topics:
>>
>>1. Re: [PATCH v2 6/7] ARM: extend non-secure switch to also go
>>   into HYP mode (Andre Przywara)
>>2. Re: dfu: using dfu-util -l shows different output
>>   (Lukasz Majewski)
>>3. Re: dfu: using dfu-util -l shows different output (Heiko Schocher)
>>4. Re: [PATCH] OpenRD: relocate environment to 640kB (Sascha Silbe)
>>
>>
>> --
>>
>> Message: 1
>> Date: Tue, 25 Jun 2013 10:27:30 +0200
>> From: Andre Przywara 
>> Subject: Re: [U-Boot] [PATCH v2 6/7] ARM: extend non-secure switch to
>> also go into HYP mode
>> To: Nikolay Nikolaev 
>> Cc: geoff.lev...@linaro.org, u-boot@lists.denx.de, tr...@ti.com,
>> kvm...@lists.cs.columbia.edu
>> Message-ID: <51c95472.9030...@linaro.org>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> On 06/21/2013 04:38 PM, Nikolay Nikolaev wrote:
>> > Hello,
>> >
>> >
>> > On Thu, Jun 13, 2013 at 2:01 PM, Andre Przywara
>> > mailto:andre.przyw...@linaro.org>> wrote:
>> >
>> > For the KVM and XEN hypervisors to be usable, we need to enter the
>> > kernel in HYP mode. Now that we already are in non-secure state,
>> > HYP mode switching is within short reach.
>> >
>> > While doing the non-secure switch, we have to enable the HVC
>> > instruction and setup the HYP mode HVBAR (while still secure).
>> >
>> > The actual switch is done by dropping back from a HYP mode handler
>> > without actually leaving HYP mode, so we introduce a new handler
>> > routine in our new secure exception vector table.
>> >
>> > In the assembly switching routine we save and restore the banked LR
>> > and SP registers around the hypercall to do the actual HYP mode
>> > switch.
>> >
>> > The C routine first checks whether we are in HYP mode already and
>> > also whether the virtualization extensions are available. It also
>> > checks whether the HYP mode switch was finally successful.
>> > The bootm command part only adds and adjusts some error reporting.
>> >
>> > Signed-off-by: Andre Przywara > > >
>> > ---
>> >   arch/arm/cpu/armv7/nonsec_virt.S | 31
>> ---
>> >   arch/arm/include/asm/armv7.h |  7 +--
>> >   arch/arm/lib/bootm.c | 14 ++
>> >   arch/arm/lib/virt-v7.c   | 27 ++-
>> >   4 files changed, 65 insertions(+), 14 deletions(-)
>> >
>> > diff --git a/arch/arm/cpu/armv7/nonsec_virt.S
>> > b/arch/arm/cpu/armv7/nonsec_virt.S
>> > index 919f6e9..950da6f 100644
>> > --- a/arch/arm/cpu/armv7/nonsec_virt.S
>> > +++ b/arch/arm/cpu/armv7/nonsec_virt.S
>> > @@ -1,5 +1,5 @@
>> >   /*
>> > - * code for switching cores into non-secure state
>> > + * code for switching cores into non-secure state and into HYP mode
>> >*
>> >* Copyright (c) 2013  Andre Przywara > > >
>> >*
>> > @@ -26,14 +26,14 @@
>> >   #include 
>> >   #include 
>> >
>> > -/* the vector table for secure state */
>> > +/* the vect

[U-Boot] [PATCH 2/7 v6] spl: env_common.c: add new symbol CONFIG_SPL_ENV_IMPORT to contain function env_import

2013-06-26 Thread ying.zhang
From: Ying Zhang 

The functionality env_import will be used in the SPL. They
had been excluded by ifndef CONFIG_SPL_BUILD. Now, add new
symbol CONFIG_SPL_ENV_IMPORT to contian the functionality
env_import in SPL.

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "boot from SD card/SPI flash with SPL".
2. Split from "spl: Make CONFIG_SPL_BUILD contain more functionality"
3. No change.
4. No change.
5. Add new symbol CONFIG_SPL_ENV_IMPORT

 README  |3 +++
 common/env_common.c |2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/README b/README
index 137e8cb..8a6c26c 100644
--- a/README
+++ b/README
@@ -3046,6 +3046,9 @@ FIT uImage format:
It conflicts with SPL env from storage medium specified by
CONFIG_ENV_IS_xxx but CONFIG_ENV_IS_NOWHERE
 
+   CONFIG_SPL_ENV_IMPORT
+   Support for importing the environment in SPL.
+
CONFIG_SPL_PAD_TO
Image offset to which the SPL should be padded before appending
the SPL payload. By default, this is defined as
diff --git a/common/env_common.c b/common/env_common.c
index 906b41f..1a36660 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -156,7 +156,7 @@ int set_default_vars(int nvars, char * const vars[])
H_NOCLEAR | H_INTERACTIVE, nvars, vars);
 }
 
-#ifndef CONFIG_SPL_BUILD
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_ENV_IMPORT)
 /*
  * Check if CRC is valid and (if yes) import the environment.
  * Note that "buf" may or may not be aligned.
-- 
1.7.0.4


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


[U-Boot] [PATCH 3/7 v6] powerpc/p1022ds: boot from SD Card with SPL

2013-06-26 Thread ying.zhang
From: Ying Zhang 

This patch introduces SPL to enable a loader stub that runs in the L2 SRAM,
after being loaded by the code from the internal on-chip ROM. It loads the
final uboot image into DDR, then jump to it to begin execution.

The SPL's size is sizeable, the maximum size must not exceed the size of L2
SRAM. It initializes the DDR through SPD code, and copys final uboot image
to DDR. So there are two stage uboot images:
* spl_boot, 96KB size. The env variables are copied to L2 SRAM, so
that ddr spd code can get the interleaving mode setting in env. It
loads final uboot image from offset 96KB.
* final uboot image, size is variable depends on the functions
enabled.

This patch is on top of the following patch:
1. common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment
in SPL.
2. Makefile: move the common makefile line to public area
3. powerpc/mpc85xx: support application without resetvec segment in the
linker script.
4. powerpc/mpc85xx: modify the function clear_bss and the end address of
the BSS
5. powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and
enabled some functionality for common SPL
6. spl: env_common.c: add new symbol CONFIG_SPL_ENV_IMPORT to contain
function env_import

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "boot from SD card/SPI flash with SPL".
2. No change.
3. No change.
4. No change.
5. Add new symbol CONFIG_SPL_ENV_IMPORT for contain
   the functionality env_import.

 README |7 +
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds|5 +
 .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c|4 +
 board/freescale/common/Makefile|2 -
 board/freescale/p1022ds/Makefile   |3 +
 board/freescale/p1022ds/spl.c  |  112 +
 board/freescale/p1022ds/tlb.c  |9 ++-
 doc/README.mpc85xx-sd-spi-boot |   81 
 drivers/mmc/Makefile   |3 +
 drivers/mmc/fsl_esdhc_spl.c|  131 
 drivers/mmc/mmc.c  |2 +
 include/configs/P1022DS.h  |   56 -
 include/fsl_esdhc.h|1 +
 spl/Makefile   |3 +
 14 files changed, 409 insertions(+), 10 deletions(-)
 create mode 100644 board/freescale/p1022ds/spl.c
 create mode 100644 doc/README.mpc85xx-sd-spi-boot
 create mode 100644 drivers/mmc/fsl_esdhc_spl.c

diff --git a/README b/README
index 8a6c26c..b941a56 100644
--- a/README
+++ b/README
@@ -2995,6 +2995,13 @@ FIT uImage format:
Support for NAND boot using simple NAND drivers that
expose the cmd_ctrl() interface.
 
+   CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
+   Set for the SPL on PPC mpc8xxx targets, support for
+   arch/powerpc/cpu/mpc8xxx/ddr/libddr.o in SPL binary.
+
+   CONFIG_SPL_COMMON_INIT_DDR
+   Set for common ddr init with serial presence detect in
+   SPL binary.
CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT,
CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE,
CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS,
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds 
b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index 20284ed..8aeb1a0 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -60,6 +60,11 @@ SECTIONS
}
_edata  =  .;
 
+   . = .;
+   __start___ex_table = .;
+   __ex_table : { *(__ex_table) }
+   __stop___ex_table = .;
+
. = ALIGN(8);
__init_begin = .;
__init_end = .;
diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
index e958e13..56128a7 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
@@ -218,12 +218,16 @@ compute_lowest_common_dimm_parameters(const dimm_params_t 
*dimm_params,
if (dimm_params[i].n_ranks) {
if (dimm_params[i].registered_dimm) {
temp1 = 1;
+#ifndef CONFIG_SPL_BUILD
printf("Detected RDIMM %s\n",
dimm_params[i].mpart);
+#endif
} else {
temp2 = 1;
+#ifndef CONFIG_SPL_BUILD
printf("Detected UDIMM %s\n",
dimm_params[i].mpart);
+#endif
}
}
}
diff --git a/board/freescale/common/Makefile b/bo

[U-Boot] [PATCH 1/7 v6] powerpc: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and enabled some functionality for common SPL

2013-06-26 Thread ying.zhang
From: Ying Zhang 

1. The symbol CONFIG_SPL_NAND_MINIMAL is unused, so deleted it.
2. Some functions were unused in the minimal SPL, but it is useful
in the common SPL. So, enabled some functionality for common SPL.

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "boot from SD card/SPI flash with SPL".
2. Split from "Add the symbol for the minimal SPL used to eliminate
unused code"
3. Give up new symbol and delete the line
ifndef CONFIG_SPL_BUILD in common/env_common.c
4. Use !defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL)
to replace to new symbols.
5. No change.

 arch/powerpc/cpu/mpc85xx/tlb.c |3 ++-
 arch/powerpc/cpu/mpc8xxx/law.c |6 --
 include/configs/MPC8313ERDB.h  |1 -
 include/configs/P1022DS.h  |1 -
 include/configs/p1_p2_rdb_pc.h |1 -
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c
index 0dff37f..b903d02 100644
--- a/arch/powerpc/cpu/mpc85xx/tlb.c
+++ b/arch/powerpc/cpu/mpc85xx/tlb.c
@@ -55,7 +55,8 @@ void init_tlbs(void)
return ;
 }
 
-#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL) && \
+   (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
 void read_tlbcam_entry(int idx, u32 *valid, u32 *tsize, unsigned long *epn,
   phys_addr_t *rpn)
 {
diff --git a/arch/powerpc/cpu/mpc8xxx/law.c b/arch/powerpc/cpu/mpc8xxx/law.c
index 6f9d568..6c0a307 100644
--- a/arch/powerpc/cpu/mpc8xxx/law.c
+++ b/arch/powerpc/cpu/mpc8xxx/law.c
@@ -92,7 +92,8 @@ void disable_law(u8 idx)
return;
 }
 
-#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL) && \
+   (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
 static int get_law_entry(u8 i, struct law_entry *e)
 {
u32 lawar;
@@ -122,7 +123,8 @@ int set_next_law(phys_addr_t addr, enum law_size sz, enum 
law_trgt_if id)
return idx;
 }
 
-#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL) && \
+   (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
 int set_last_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 {
u32 idx;
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 1d753e7..0c15195 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -40,7 +40,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
 #define CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 9c27182..bcbda30 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -41,7 +41,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
 
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 2fa5372..b35b966 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -159,7 +159,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
 
-- 
1.7.0.4


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


[U-Boot] [PATCH 5/7 v6] powerpc : p1022ds : enable p1022ds to start from eSPI with SPL

2013-06-26 Thread ying.zhang
From: Ying Zhang 

enable p1022ds to start from eSPI with SPL.

This patch is on top of the patch:
SPL : spi flash : support to start from eSPI with SPL

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "boot from SD card/SPI flash with SPL".
2. No change.
3. No change.
4. No change.
5. Split from "powerpc/p1022ds: boot from spi flash with SPL"
   this patch enable P1022DS to start from eSPI with SPL.

 board/freescale/p1022ds/spl.c |   12 ++--
 include/configs/P1022DS.h |   37 ++---
 2 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index 40f000f..a041e35 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -21,13 +21,12 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include "../common/ngpixis.h"
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -54,6 +53,11 @@ void board_init_f(ulong bootflag)
setbits_be32(&gur->pmuxcr,
in_be32(&gur->pmuxcr) | MPC85xx_PMUXCR_SD_DATA);
 
+#ifdef CONFIG_SPL_SPI_BOOT
+   /* Enable the SPI */
+   clrsetbits_8(&pixis->brdcfg0, PIXIS_ELBC_SPI_MASK, PIXIS_SPI);
+#endif
+
/* Read back the register to synchronize the write. */
in_be32(&gur->pmuxcr);
 
@@ -67,6 +71,8 @@ void board_init_f(ulong bootflag)
bus_clk / 16 / CONFIG_BAUDRATE);
 #ifdef CONFIG_SPL_MMC_BOOT
puts("\nSD boot...\n");
+#elif defined(CONFIG_SPL_SPI_BOOT)
+   puts("\nSPI Flash boot...\n");
 #endif
 
/* copy code to RAM and jump to it - this should not return */
@@ -108,5 +114,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 
 #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot();
+#elif defined(CONFIG_SPL_SPI_BOOT)
+   spi_boot();
 #endif
 }
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 0c6e0ec..9e012c4 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -49,11 +49,34 @@
 #endif
 
 #ifdef CONFIG_SPIFLASH
-#define CONFIG_RAMBOOT_SPIFLASH
-#define CONFIG_SYS_RAMBOOT
-#define CONFIG_SYS_EXTRA_ENV_RELOC
-#define CONFIG_SYS_TEXT_BASE   0x1100
-#define CONFIG_RESET_VECTOR_ADDRESS0x1107fffc
+#define CONFIG_SPL
+#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_ENV_IMPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_MINIMAL
+#define CONFIG_SPL_FLUSH_IMAGE
+#define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_FSL_LAW /* Use common FSL init code */
+#define CONFIG_SYS_TEXT_BASE   0x11001000
+#define CONFIG_SPL_TEXT_BASE   0xf8f81000
+#define CONFIG_SPL_PAD_TO  0x18000
+#define CONFIG_SPL_MAX_SIZE(96 * 1024)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE   (512 << 10)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST(0x1100)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_START  (0x1100)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS   (96 << 10)
+#define CONFIG_SYS_MPC85XX_NO_RESETVEC
+#define CONFIG_SYS_LDSCRIPT"arch/powerpc/cpu/mpc85xx/u-boot.lds"
+#define CONFIG_SPL_SPI_BOOT
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_COMMON_INIT_DDR
+#endif
 #endif
 
 #define CONFIG_NAND_FSL_ELBC
@@ -319,7 +342,7 @@
  * Config the L2 Cache as L2 SRAM
 */
 #if defined(CONFIG_SPL_BUILD)
-#if defined(CONFIG_SDCARD)
+#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
 #define CONFIG_SYS_INIT_L2_ADDR0xf8f8
 #define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
 #define CONFIG_SYS_L2_SIZE (256 << 10)
@@ -564,7 +587,7 @@
 /*
  * Environment
  */
-#ifdef CONFIG_RAMBOOT_SPIFLASH
+#ifdef CONFIG_SPIFLASH
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_SPI_BUS 0
 #define CONFIG_ENV_SPI_CS  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 4/7 v6] SPL : spi flash : support to start from eSPI with SPL

2013-06-26 Thread ying.zhang
From: Ying Zhang 

This patch introduces SPL to enable a loader stub that runs in the L2 SRAM,
after being loaded by the code from the internal on-chip ROM. It loads the
final uboot image into DDR, then jump to it to begin execution.

The SPL's size is sizeable, the maximum size must not exceed the size of L2
SRAM. It initializes the DDR through SPD code, and copys final uboot image
to DDR. So there are two stage uboot images:
* spl_boot, 96KB size. The env variables are copied to L2 SRAM, so
that ddr spd code can get the interleaving mode setting in env. It
loads final uboot image from offset 96KB.
* final uboot image, size is variable depends on the functions
enabled.

This patch is on top of the patch:
powerpc/p1022ds: boot from SD Card with SPL

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "boot from SD card/SPI flash with SPL".
2. No change.
3. No change.
4. No change.
5. Split from "powerpc/p1022ds: boot from spi flash with SPL"
   this patch add the capability starting from eSPI with SPL.

 drivers/mtd/spi/Makefile   |1 +
 drivers/mtd/spi/fsl_espi_spl.c |   78 
 drivers/mtd/spi/spi_flash.c|2 +
 3 files changed, 81 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/fsl_espi_spl.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index ecbb210..39e4e1d 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libspi_flash.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_SPL_SPI_LOAD)   += spi_spl_load.o
+COBJS-$(CONFIG_SPL_SPI_BOOT)   += fsl_espi_spl.o
 endif
 
 COBJS-$(CONFIG_SPI_FLASH)  += spi_flash.o
diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c
new file mode 100644
index 000..8375a75
--- /dev/null
+++ b/drivers/mtd/spi/fsl_espi_spl.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include 
+#include 
+#include 
+
+#define ESPI_BOOT_IMAGE_SIZE   0x48
+#define ESPI_BOOT_IMAGE_ADDR   0x50
+#define CONFIG_CFG_DATA_SECTOR 0
+
+/*
+ * The main entry for SPI booting. It's necessary that SDRAM is already
+ * configured and available since this code loads the main U-Boot image
+ * from SPI into SDRAM and starts it from there.
+ */
+void spi_boot(void)
+{
+   void (*uboot)(void) __noreturn;
+   u32 offset, code_len, i;
+   unsigned char *buf = NULL;
+   struct spi_flash *flash;
+
+   flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
+   CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
+   if (flash == NULL) {
+   puts("\nspi_flash_probe failed");
+   hang();
+   }
+
+   /*
+   * Load U-Boot image from SPI flash into RAM
+   */
+   buf = malloc(flash->page_size);
+   if (buf == NULL) {
+   puts("\nmalloc failed");
+   hang();
+   }
+   memset(buf, 0, flash->page_size);
+
+   spi_flash_read(flash, CONFIG_CFG_DATA_SECTOR, \
+   flash->page_size, (void *)buf);
+   offset = *(u32 *)(buf + ESPI_BOOT_IMAGE_ADDR);
+   /* Skip spl code */
+   offset += CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
+   /* Get the code size from offset 0x48 */
+   code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
+   /* Skip spl code */
+   code_len = code_len - CONFIG_SPL_MAX_SIZE;
+   /* copy code to DDR */
+   spi_flash_read(flash, offset, code_len, \
+   (void *)CONFIG_SYS_SPI_FLASH_U_BOOT_DST);
+   /*
+   * Jump to U-Boot image
+   */
+   flush_cache(CONFIG_SYS_SPI_FLASH_U_BOOT_DST, \
+   code_len);
+   uboot = (void *) CONFIG_SYS_SPI_FLASH_U_BOOT_START;
+   (*uboot)();
+}
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 6a6fe37..e474f5c 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -554,12 +554,14 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
goto err_manufacturer_probe;
}
 #endif
+#ifndef CONFIG_SPL_BUILD
printf("SF: Detected %s with page size ", flash->name);
  

[U-Boot] [PATCH 7/7 v6] powerpc: p1022ds: support TPL on the P1022DS

2013-06-26 Thread ying.zhang
From: Ying Zhang 

Support TPL on the P1022DS.
The TPL's size is sizeable, the maximum size must not exceed the size of L2
SRAM. It initializes the DDR through SPD code, and copys final uboot image
to DDR. So there are three stage uboot images:
* spl_boot, 4KB size, pad to 128K byte.
* tpl_boot, 88K size, pad to 128K size. The env variables are
copied to L2 SRAM, so that ddr SPD code can get the interleaving
mode setting in env. It loads final uboot image from offset 256KB.
* final uboot image, size is variable depends on the functions
enabled.

This patch is on top of the patch:
nand: tpl : introduce the TPL based on the SPL

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "powerpc/p1022ds: nand: introduce the TPL based on the SPL".
2. No change.
3. No change.
4. No change.
5. Change functionality nand_load_image to nand_load, it is called in TPL.

 Makefile|3 +-
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |4 +
 board/freescale/p1022ds/Makefile|3 +
 board/freescale/p1022ds/spl_minimal.c   |   57 ++---
 board/freescale/p1022ds/tlb.c   |4 +-
 board/freescale/p1022ds/tpl.c   |  102 +++
 drivers/mtd/nand/fsl_elbc_spl.c |8 +-
 include/configs/P1022DS.h   |   77 ++-
 8 files changed, 184 insertions(+), 74 deletions(-)
 create mode 100644 board/freescale/p1022ds/tpl.c

diff --git a/Makefile b/Makefile
index 0513e4d..a3c7282 100644
--- a/Makefile
+++ b/Makefile
@@ -895,7 +895,7 @@ clobber:tidy
@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
@rm -f $(obj)spl/u-boot-spl.lds
@rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.bin,u-boot-tpl.map}
-   @rm -f $(obj)tpl/u-boot-tpl.lds
+   @rm -f $(obj)tpl/u-boot-spl.lds
@rm -f $(obj)MLO MLO.byteswap
@rm -f $(obj)SPL
@rm -f $(obj)tools/xway-swap-bytes
@@ -906,6 +906,7 @@ clobber:tidy
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
-print | xargs rm -f
@rm -f $(obj)dts/*.tmp
@rm -f $(obj)spl/u-boot-spl{,-pad}.ais
+   @rm -f $(obj)tpl/u-boot-tpl{,-pad}.ais
 
 mrproper \
 distclean: clobber unconfig
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds 
b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index 8aeb1a0..3167d2d 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -35,7 +35,11 @@ PHDRS
 #endif
 SECTIONS
 {
+#ifdef CONFIG_SPL_BUILD
. = CONFIG_SPL_TEXT_BASE;
+#else
+   . = CONFIG_TPL_TEXT_BASE;
+#endif
.text : {
*(.text*)
}
diff --git a/board/freescale/p1022ds/Makefile b/board/freescale/p1022ds/Makefile
index 9746063..58f224e 100644
--- a/board/freescale/p1022ds/Makefile
+++ b/board/freescale/p1022ds/Makefile
@@ -27,6 +27,9 @@ else
 ifdef CONFIG_SPL_BUILD
 COBJS-y += spl.o
 endif
+ifdef CONFIG_TPL_BUILD
+COBJS-y += tpl.o
+endif
 COBJS-y+= $(BOARD).o
 COBJS-y+= ddr.o
 COBJS-y+= law.o
diff --git a/board/freescale/p1022ds/spl_minimal.c 
b/board/freescale/p1022ds/spl_minimal.c
index 8d12fa6..8ab5ec2 100644
--- a/board/freescale/p1022ds/spl_minimal.c
+++ b/board/freescale/p1022ds/spl_minimal.c
@@ -27,51 +27,6 @@
 #include 
 
 
-/*
- * Fixed sdram init -- doesn't use serial presence detect.
- */
-void sdram_init(void)
-{
-   volatile ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC8xxx_DDR_ADDR;
-
-   __raw_writel(CONFIG_SYS_DDR_CS0_BNDS, &ddr->cs0_bnds);
-   __raw_writel(CONFIG_SYS_DDR_CS0_CONFIG, &ddr->cs0_config);
-#if CONFIG_CHIP_SELECTS_PER_CTRL > 1
-   __raw_writel(CONFIG_SYS_DDR_CS1_BNDS, &ddr->cs1_bnds);
-   __raw_writel(CONFIG_SYS_DDR_CS1_CONFIG, &ddr->cs1_config);
-#endif
-   __raw_writel(CONFIG_SYS_DDR_TIMING_3, &ddr->timing_cfg_3);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_0, &ddr->timing_cfg_0);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_1, &ddr->timing_cfg_1);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_2, &ddr->timing_cfg_2);
-
-   __raw_writel(CONFIG_SYS_DDR_CONTROL_2, &ddr->sdram_cfg_2);
-   __raw_writel(CONFIG_SYS_DDR_MODE_1, &ddr->sdram_mode);
-   __raw_writel(CONFIG_SYS_DDR_MODE_2, &ddr->sdram_mode_2);
-
-   __raw_writel(CONFIG_SYS_DDR_INTERVAL, &ddr->sdram_interval);
-   __raw_writel(CONFIG_SYS_DDR_DATA_INIT, &ddr->sdram_data_init);
-   __raw_writel(CONFIG_SYS_DDR_CLK_CTRL, &ddr->sdram_clk_cntl);
-
-   __raw_writel(CONFIG_SYS_DDR_TIMING_4, &ddr->timing_cfg_4);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_5, &ddr->timing_cfg_5);
-   __raw_writel(CONFIG_SYS_DDR_ZQ_CONTROL, &ddr->ddr_zq_cntl);
-   __raw_writel(CONFIG_SYS_DDR_WRLVL_CONTROL, &ddr->ddr_wrlvl_cntl);
-
-   /* Set, but do not enable the memory */
-   __raw_writel(CONFIG_SYS_DDR_CONTROL & ~SDRAM_CFG_MEM_EN,
-   &ddr->sdram_cfg);
-
-   in_b

[U-Boot] [PATCH 6/7 v6] nand: tpl : introduce the TPL based on the SPL

2013-06-26 Thread ying.zhang
From: Ying Zhang 

Due to the nand SPL on some board(e.g. P1022DS)has a size limit, it can
not be more than 4K. So, the SPL cannot initialize the DDR with the SPD
code. This patch introduces TPL to enable a loader stub that runs in the
L2 SRAM, after being loaded by the code from the SPL. It initializes the
DDR with the SPD or other operations.

The TPL's size is sizeable, the maximum size must not exceed the size of L2
SRAM. It initializes the DDR through SPD code, and copys final uboot image
to DDR. So there are three stage uboot images:
* spl_boot, * tpl_boot, * final uboot image,

This patch is on top of the patch:
SPL : spi flash : support to start from eSPI with SPL

Signed-off-by: Ying Zhang 
---
Compared with the original version, Changed as below:
1. Split from "powerpc/p1022ds: nand: introduce the TPL based on the SPL".
2. No change.
3. No change.
4. No change.
5. Use ifdef to define "nand_load_image" to non-static for non-SPL

 Makefile   |   21 +++-
 README |   57 +++-
 arch/powerpc/config.mk |2 +
 .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c|4 +-
 arch/powerpc/lib/Makefile  |2 +
 common/Makefile|9 +
 common/cmd_nvedit.c|8 +-
 config.mk  |   32 
 doc/README.TPL |   69 +
 drivers/mtd/nand/Makefile  |7 +
 drivers/mtd/nand/fsl_elbc_spl.c|5 +-
 drivers/serial/serial.c|2 +-
 include/bootstage.h|3 +-
 tpl/Makefile   |  161 
 14 files changed, 368 insertions(+), 14 deletions(-)
 create mode 100644 doc/README.TPL
 create mode 100644 tpl/Makefile

diff --git a/Makefile b/Makefile
index fdaddb9..0513e4d 100644
--- a/Makefile
+++ b/Makefile
@@ -118,10 +118,11 @@ endif # ifneq ($(BUILD_DIR),)
 
 OBJTREE:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
 SPLTREE:= $(OBJTREE)/spl
+TPLTREE:= $(OBJTREE)/tpl
 SRCTREE:= $(CURDIR)
 TOPDIR := $(SRCTREE)
 LNDIR  := $(OBJTREE)
-export TOPDIR SRCTREE OBJTREE SPLTREE
+export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
 
 MKCONFIG   := $(SRCTREE)/mkconfig
 export MKCONFIG
@@ -412,6 +413,7 @@ ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
+ALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 ifneq ($(CONFIG_SPL_TARGET),)
 ALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET))
@@ -498,6 +500,18 @@ $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin 
$(obj)u-boot.bin
cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
rm $(obj)spl/u-boot-spl-pad.bin
 
+$(obj)u-boot-with-tpl.bin: $(obj)spl/u-boot-spl.bin $(obj)tpl/u-boot-tpl.bin \
+   $(obj)u-boot.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary \
+   $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl-pad.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_PAD_TO) \
+   -I binary -O binary \
+   $(obj)tpl/u-boot-tpl.bin $(obj)tpl/u-boot-tpl-pad.bin
+   cat $(obj)spl/u-boot-spl-pad.bin $(obj)tpl/u-boot-tpl-pad.bin \
+   $(obj)u-boot.bin > $@
+   rm $(obj)spl/u-boot-spl-pad.bin $(obj)tpl/u-boot-tpl-pad.bin
+
 $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
$(OBJTREE)/u-boot-with-spl.imx
@@ -622,6 +636,9 @@ $(obj)u-boot-nand.bin:  nand_spl $(obj)u-boot.bin
 $(obj)spl/u-boot-spl.bin:  $(SUBDIR_TOOLS) depend
$(MAKE) -C spl all
 
+$(obj)tpl/u-boot-tpl.bin:  $(SUBDIR_TOOLS) depend
+   $(MAKE) -C tpl all
+
 updater:
$(MAKE) -C tools/updater all
 
@@ -877,6 +894,8 @@ clobber:tidy
@rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
@rm -f $(obj)spl/u-boot-spl.lds
+   @rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.bin,u-boot-tpl.map}
+   @rm -f $(obj)tpl/u-boot-tpl.lds
@rm -f $(obj)MLO MLO.byteswap
@rm -f $(obj)SPL
@rm -f $(obj)tools/xway-swap-bytes
diff --git a/README b/README
index b941a56..0c20253 100644
--- a/README
+++ b/README
@@ -2999,9 +2999,10 @@ FIT uImage format:
Set for the SPL on PPC mpc8xx

Re: [U-Boot] [PATCH 2/4] arm:goni:dfu Add support for DFU at GONI target

2013-06-26 Thread Minkyu Kang
On 25/06/13 00:36, Lukasz Majewski wrote:
> From: Arkadiusz Wlodarczyk 
> 
> Proper adjustment for supporting DFU at GONI target has been made.
> The s5p_goni.h file has been updated. Moreover the code for low level
> USB initialization has been added to GONI board code.
> 
> Signed-off-by: Arkadiusz Wlodarczyk 
> Signed-off-by: Kyungmin Park 
> Tested-by: Arkadiusz Wlodarczyk 
> Cc: Minkyu Kang 
> ---
>  board/samsung/goni/goni.c  |7 +++
>  include/configs/s5p_goni.h |   20 +++-
>  2 files changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
> index ff76963..3c53106 100644
> --- a/board/samsung/goni/goni.c
> +++ b/board/samsung/goni/goni.c
> @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
>   .regs_otg = S5PC110_OTG_BASE,
>   .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
>  };
> +
> +void board_usb_init(void)
> +{
> + debug("USB_udc_probe\n");
> + s3c_udc_probe(&s5pc110_otg_data);
> +}
> +
>  #endif
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index ec43652..8a824c7 100644
> --- a/include/configs/s5p_goni.h
> +++ b/include/configs/s5p_goni.h
> @@ -86,6 +86,17 @@
>  #define CONFIG_CMD_ONENAND
>  #define CONFIG_CMD_MTDPARTS
>  #define CONFIG_CMD_MMC
> +#define CONFIG_CMD_DFU
> +
> +/* USB Composite download gadget - g_dnl */
> +#define CONFIG_USBDOWNLOAD_GADGET
> +#define CONFIG_DFU_FUNCTION
> +#define CONFIG_DFU_MMC
> +
> +/* USB Samsung's IDs */
> +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
> +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
> +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
>  
>  #define CONFIG_BOOTDELAY 1
>  #define CONFIG_ZERO_BOOTDELAY_CHECK
> @@ -105,6 +116,10 @@
>   ",60m(qboot)"\
>   ",-(UBI)\0"
>  
> +#define CONFIG_DFU_ALT \
> + "u-boot mmc 80 400;" \
> + "uImage fat 0 2\0" \
> +
>  #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
>  
>  #define CONFIG_BOOTCOMMAND   "run mmcboot"
> @@ -175,7 +190,9 @@
>   "bootblock=9\0" \
>   "ubiblock=8\0" \
>   "ubi=enabled\0" \
> - "opts=always_resume=1"
> + "opts=always_resume=1\0" \
> + "dfu_alt_info=" CONFIG_DFU_ALT
> +

please remove this blank line.

>  
>  /* Miscellaneous configurable options */
>  #define CONFIG_SYS_LONGHELP  /* undef to save memory */
> @@ -242,5 +259,6 @@
>  #define CONFIG_USB_GADGET
>  #define CONFIG_USB_GADGET_S3C_UDC_OTG
>  #define CONFIG_USB_GADGET_DUALSPEED
> +#define CONFIG_USB_GADGET_VBUS_DRAW 2
>  
>  #endif   /* __CONFIG_H */
> 

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


[U-Boot] [PATCH 2/2] powerpc/c29xpcie: add support for C29XPCIE board

2013-06-26 Thread Po Liu
From: Mingkai Hu 

C29XPCIE board is a series of Freescale PCIe add-in cards to perform
as public key crypto accelerator or secure key management module. It
includes C293PCIE board, C293PCIE board and C291PCIE board.

 - 512KB platform SRAM in addition to 512K L2 Cache/SRAM
 - 512MB soldered DDR3 32bit memory
 - CPLD System Logic
 - 64MB x16 NOR flash and 4GB x8 NAND flash
 - 16MB SPI flash

Signed-off-by: Mingkai Hu 
Singed-off-by: Po Liu 
---
 Base on tree git://git.denx.de/u-boot.git, modified integrate C291/C292/C293 
to C29X.
 board/freescale/c29xpcie/Makefile   |  34 +++
 board/freescale/c29xpcie/c29xpcie.c | 150 ++
 board/freescale/c29xpcie/cpld.c | 155 ++
 board/freescale/c29xpcie/cpld.h |  53 
 board/freescale/c29xpcie/ddr.c  |  89 ++
 board/freescale/c29xpcie/law.c  |  22 ++
 board/freescale/c29xpcie/tlb.c  |  89 ++
 boards.cfg  |   2 +
 include/configs/C29XPCIE.h  | 551 
 9 files changed, 1145 insertions(+)
 create mode 100644 board/freescale/c29xpcie/Makefile
 create mode 100644 board/freescale/c29xpcie/c29xpcie.c
 create mode 100644 board/freescale/c29xpcie/cpld.c
 create mode 100644 board/freescale/c29xpcie/cpld.h
 create mode 100644 board/freescale/c29xpcie/ddr.c
 create mode 100644 board/freescale/c29xpcie/law.c
 create mode 100644 board/freescale/c29xpcie/tlb.c
 create mode 100644 include/configs/C29XPCIE.h

diff --git a/board/freescale/c29xpcie/Makefile 
b/board/freescale/c29xpcie/Makefile
new file mode 100644
index 000..15bef9a
--- /dev/null
+++ b/board/freescale/c29xpcie/Makefile
@@ -0,0 +1,34 @@
+#
+# Copyright 2013 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= cpld.o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/c29xpcie/c29xpcie.c 
b/board/freescale/c29xpcie/c29xpcie.c
new file mode 100644
index 000..21f3892
--- /dev/null
+++ b/board/freescale/c29xpcie/c29xpcie.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "cpld.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int checkboard(void)
+{
+   struct cpu_type *cpu = gd->arch.cpu;
+
+   printf("Board: %sPCIe, ", cpu->name);
+   printf("CPLD Ver: 0x%02x\n", CPLD_READ(cpldver));
+
+   return 0;
+}
+
+int board_early_init_f(void)
+{
+   struct fsl_ifc *ifc = (void *)CONFIG_SYS_IFC_ADDR;
+
+   /* Clock configuration to access CPLD using IFC(GPCM) */
+   setbits_be32(&ifc->ifc_gcr, 1 << IFC_GCR_TBCTL_TRN_TIME_SHIFT);
+
+   return 0;
+}
+
+int board_early_init_r(void)
+{
+   const unsigned long flashbase = CONFIG_SYS_FLASH_BASE;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
+
+   /*
+* Remap Boot flash region to caching-inhibited
+* so that flash can be erased properly.
+*/
+
+   /* Flush d-cache and invalidate i-cache of any FLASH data */
+   flush_dcache();
+   invalidate_icache();
+
+   /* invalidate existing TLB entry for flash */
+   disable_tlb(flash_esel);
+
+   set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, flash_esel, BOOKE_PAGESZ_64M, 1);
+
+   return 0;
+}
+
+#ifdef CONFIG_PCI
+void pci_init_board(void)
+{
+   fsl_pcie_init_board(0);
+}
+#endif /* ifdef CONFIG_PCI */
+
+#ifdef CONFIG_TSEC_ENET
+int board_eth_init(bd_t *bis)
+{
+   struct fsl_pq_mdio_info mdio_info;
+   struct tsec_info_struct tsec_info[2];
+   int num = 0;
+
+#ifdef CONFIG_TSEC1
+   SET_STD_TSEC_INFO(tsec_info[num], 1);
+   num++;
+#endif
+#ifdef CONFIG_TSEC2
+   SET_STD_TSEC_INFO(tsec_info[num], 2);

[U-Boot] [PATCH 1/2] powerpc/85xx: Add C29x SoC support

2013-06-26 Thread Po Liu
From: Mingkai Hu 

The Freescale C29x family is a high performance crypto co-processor.
It combines a single e500v2 core with necessary SEC engine. There're
three SoC types(C291, C292, C293) with the following features:

 - 512K L2 Cache/SRAM and 512 KB platform SRAM
 - DDR3/DDR3L 32bit DDR controller
 - One PCI express (x1, x2, x4) Gen 2.0 Controller
 - Trust Architecture 2.0
 - SEC6.0 engine

Signed-off-by: Mingkai Hu 
Signed-off-by: Po Liu 
---
Base on tree git://git.denx.de/u-boot.git, modified integrate C291/C292/C293 to 
C29X.
 arch/powerpc/cpu/mpc85xx/Makefile |  2 +
 arch/powerpc/cpu/mpc85xx/c29x_serdes.c| 65 +++
 arch/powerpc/cpu/mpc8xxx/cpu.c|  3 ++
 arch/powerpc/include/asm/config_mpc85xx.h | 12 ++
 arch/powerpc/include/asm/fsl_law.h|  1 +
 arch/powerpc/include/asm/immap_85xx.h | 23 +++
 arch/powerpc/include/asm/processor.h  |  3 ++
 7 files changed, 109 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc85xx/c29x_serdes.c

diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
b/arch/powerpc/cpu/mpc85xx/Makefile
index 2318064..5135083 100644
--- a/arch/powerpc/cpu/mpc85xx/Makefile
+++ b/arch/powerpc/cpu/mpc85xx/Makefile
@@ -62,6 +62,7 @@ COBJS-$(CONFIG_MPC8568) += ddr-gen2.o
 COBJS-$(CONFIG_MPC8544) += ddr-gen2.o
 
 # supports ddr1/2/3
+COBJS-$(CONFIG_C29X)   += ddr-gen3.o
 COBJS-$(CONFIG_MPC8572) += ddr-gen3.o
 COBJS-$(CONFIG_MPC8536) += ddr-gen3.o
 COBJS-$(CONFIG_MPC8569)+= ddr-gen3.o
@@ -115,6 +116,7 @@ COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS1) += 
fsl_corenet_serdes.o
 COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS2) += fsl_corenet2_serdes.o
 
 # SoC specific SERDES support
+COBJS-$(CONFIG_C29X)   += c29x_serdes.o
 COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o
 COBJS-$(CONFIG_MPC8544) += mpc8544_serdes.o
 COBJS-$(CONFIG_MPC8548) += mpc8548_serdes.o
diff --git a/arch/powerpc/cpu/mpc85xx/c29x_serdes.c 
b/arch/powerpc/cpu/mpc85xx/c29x_serdes.c
new file mode 100644
index 000..4b3214d
--- /dev/null
+++ b/arch/powerpc/cpu/mpc85xx/c29x_serdes.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define SRDS1_MAX_LANES4
+
+static u32 serdes1_prtcl_map;
+
+struct serdes_config {
+   u32 protocol;
+   u8 lanes[SRDS1_MAX_LANES];
+};
+
+static const struct serdes_config serdes1_cfg_tbl[] = {
+   /* SerDes 1 */
+   {1, {PCIE1, PCIE1, PCIE1, PCIE1} },
+   {2, {PCIE1, PCIE1, PCIE1, PCIE1} },
+   {3, {PCIE1, PCIE1, NONE, NONE} },
+   {4, {PCIE1, PCIE1, NONE, NONE} },
+   {5, {PCIE1, NONE, NONE, NONE} },
+   {6, {PCIE1, NONE, NONE, NONE} },
+   {}
+};
+
+int is_serdes_configured(enum srds_prtcl device)
+{
+   return (1 << device) & serdes1_prtcl_map;
+}
+
+void fsl_serdes_init(void)
+{
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+   u32 pordevsr = in_be32(&gur->pordevsr);
+   u32 srds_cfg = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >>
+   MPC85xx_PORDEVSR_IO_SEL_SHIFT;
+   const struct serdes_config *ptr;
+   int lane;
+
+   debug("PORDEVSR[IO_SEL_SRDS] = %x\n", srds_cfg);
+
+   if (srds_cfg > ARRAY_SIZE(serdes1_cfg_tbl)) {
+   printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
+   return;
+   }
+
+   ptr = &serdes1_cfg_tbl[srds_cfg];
+   if (!ptr->protocol)
+   return;
+
+   for (lane = 0; lane < SRDS1_MAX_LANES; lane++) {
+   enum srds_prtcl lane_prtcl = ptr->lanes[lane];
+   serdes1_prtcl_map |= (1 << lane_prtcl);
+   }
+}
diff --git a/arch/powerpc/cpu/mpc8xxx/cpu.c b/arch/powerpc/cpu/mpc8xxx/cpu.c
index bc26855..2eed872 100644
--- a/arch/powerpc/cpu/mpc8xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xxx/cpu.c
@@ -95,6 +95,9 @@ static struct cpu_type cpu_type_list[] = {
CPU_TYPE_ENTRY(BSC9131, 9131, 1),
CPU_TYPE_ENTRY(BSC9132, 9132, 2),
CPU_TYPE_ENTRY(BSC9232, 9232, 2),
+   CPU_TYPE_ENTRY(C291, C291, 1),
+   CPU_TYPE_ENTRY(C292, C292, 1),
+   CPU_TYPE_ENTRY(C293, C293, 1),
 #elif defined(CONFIG_MPC86xx)
CPU_TYPE_ENTRY(8610, 8610, 1),
CPU_TYPE_ENTRY(8641, 8641, 2),
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 1009a31..dd23a4a 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -621,6 +621,18 @@
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe00
 
+#elif defined(CONFIG_C29X)
+#define CONFIG_MAX_CPUS1
+#define CONFIG_FSL_SDHC_V2_3
+#define CONFIG_SYS_FSL_NUM_LAWS   

[U-Boot] [PATCH] dfu:function: Fix number of allocated DFU function pointers

2013-06-26 Thread Lukasz Majewski
This subtle change fix problem with too small amount of allocated
memory to store DFU function pointers.

One needs to allocate extra space for sentinel NULL pointer in this array
of function pointers.

With the previous code, the NULL value overwrites malloc internal data
and afterwards free(f_dfu->function) crashes.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/f_dfu.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 178a004..e3fa0e3 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -589,7 +589,7 @@ static int dfu_prepare_function(struct f_dfu *f_dfu, int n)
struct usb_interface_descriptor *d;
int i = 0;
 
-   f_dfu->function = calloc(sizeof(struct usb_descriptor_header *), n);
+   f_dfu->function = calloc(sizeof(struct usb_descriptor_header *), n + 1);
if (!f_dfu->function)
goto enomem;
 
-- 
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] Add support for Wandboard Quad

2013-06-26 Thread Tapani

Add support for the Quad version of Wandboard; fix compile warning resulting
from having 2G of memory.

Signed-off-by: Tapani Utriainen 
Signed-off-by: Otavio Salvador 
---
 board/wandboard/README  | 5 +
 board/wandboard/wandboard.c | 2 +-
 boards.cfg  | 1 +
 include/configs/wandboard.h | 2 ++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/board/wandboard/README b/board/wandboard/README
index ce83bbe..498db2f 100644
--- a/board/wandboard/README
+++ b/board/wandboard/README
@@ -22,6 +22,11 @@ To build U-Boot for the Wandboard Solo version:
 $ make wandboard_solo_config
 $ make
 
+To build U-Boot for the Wandboard Quad version:
+
+$ make wandboard_quad_config
+$ make
+
 Flashing U-boot into the SD card
 
 
diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index 5666cbf..43c02ac 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-   gd->ram_size = CONFIG_DDR_MB * SZ_1M;
+   gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024;
 
return 0;
 }
diff --git a/boards.cfg b/boards.cfg
index fff4f45..2635942 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -272,6 +272,7 @@ nitrogen6q2g arm armv7   
nitrogen6x  boundar
 nitrogen6s   arm armv7   nitrogen6x  
boundary   mx6
nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
 nitrogen6s1g arm armv7   nitrogen6x  
boundary   mx6
nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024
 wandboard_dlarm armv7   wandboard   -  
mx6 
wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL,DDR_MB=1024
+wandboard_quad  arm armv7   wandboard   -  
mx6 
wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q2g.cfg,MX6Q,DDR_MB=2048
 wandboard_solo  arm armv7   wandboard   -  
mx6 
wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
 omap3_overo  arm armv7   overo   - 
 omap3
 omap3_pandoraarm armv7   pandora - 
 omap3
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 5593f1c..b2995d8 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -103,6 +103,8 @@
 
 #if defined(CONFIG_MX6DL)
 #define CONFIG_DEFAULT_FDT_FILE"imx6dl-wandboard.dtb"
+#elif defined(CONFIG_MX6Q)
+#define CONFIG_DEFAULT_FDT_FILE"imx6q-wandboard.dtb"
 #elif defined(CONFIG_MX6S)
 #define CONFIG_DEFAULT_FDT_FILE"imx6s-wandboard.dtb"
 #endif
-- 
1.8.0.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/4] arm:goni:dfu Add support for DFU at GONI target

2013-06-26 Thread Lukasz Majewski
From: Arkadiusz Wlodarczyk 

Proper adjustment for supporting DFU at GONI target has been made.
The s5p_goni.h file has been updated. Moreover the code for low level
USB initialization has been added to GONI board code.

Signed-off-by: Arkadiusz Wlodarczyk 
Signed-off-by: Kyungmin Park 
Tested-by: Arkadiusz Wlodarczyk 
Cc: Minkyu Kang 

---
Changes for v2:
- Remove blank line
---
 board/samsung/goni/goni.c  |7 +++
 include/configs/s5p_goni.h |   20 +++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index ff76963..3c53106 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
.regs_otg = S5PC110_OTG_BASE,
.usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
 };
+
+void board_usb_init(void)
+{
+   debug("USB_udc_probe\n");
+   s3c_udc_probe(&s5pc110_otg_data);
+}
+
 #endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index ec43652..8a824c7 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -86,6 +86,17 @@
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_DFU
+
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+
+/* USB Samsung's IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
+#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
+#define CONFIG_G_DNL_MANUFACTURER "Samsung"
 
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
@@ -105,6 +116,10 @@
",60m(qboot)"\
",-(UBI)\0"
 
+#define CONFIG_DFU_ALT \
+   "u-boot mmc 80 400;" \
+   "uImage fat 0 2\0" \
+
 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
 
 #define CONFIG_BOOTCOMMAND "run mmcboot"
@@ -175,7 +190,9 @@
"bootblock=9\0" \
"ubiblock=8\0" \
"ubi=enabled\0" \
-   "opts=always_resume=1"
+   "opts=always_resume=1\0" \
+   "dfu_alt_info=" CONFIG_DFU_ALT
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
@@ -242,5 +259,6 @@
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
 
 #endif /* __CONFIG_H */
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH v5 1/3] ARM: Tegra: FDT: Add USB EHCI function for T30/T114

2013-06-26 Thread Marek Vasut
Dear Tom Warren,

> This is a Tegra change, Marek. I believe it's assigned to me in Patchwork.
> 
> I'll apply it to u-boot-tegra/next today or tomorrow.
> 
> Tom

This is also a USB change, but it doesn't touch anything vital, so be my guest. 
Thanks

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/4] usb:composite: use memcpy to avoid unaligned access

2013-06-26 Thread Marek Vasut
Dear Heiko Schocher,

> Hello Prafulla,
> 
> just saw, that the below patch is delegated to you:
> (added also Marek Vasut to cc, as he is the usb maintainer)

Applied

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] drivers:usb: use get|put_unaligned_le16

2013-06-26 Thread Marek Vasut
Dear Piotr Wilczek,

> This patch use get|put_unaligned_le16 to access structure data
> to avoid data abort on some ARM platforms.
> 
> Signed-off-by: Piotr Wilczek 
> Signed-off-by: Kyungmin Park 
> CC: Marek Vasut 

Applied, thanks!

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] dfu:function: Fix number of allocated DFU function pointers

2013-06-26 Thread Heiko Schocher
Hello Lukasz,

Am 26.06.2013 11:46, schrieb Lukasz Majewski:
> This subtle change fix problem with too small amount of allocated
> memory to store DFU function pointers.
> 
> One needs to allocate extra space for sentinel NULL pointer in this array
> of function pointers.
> 
> With the previous code, the NULL value overwrites malloc internal data
> and afterwards free(f_dfu->function) crashes.
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> ---
>  drivers/usb/gadget/f_dfu.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Heiko Schocher 

Thanks!

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


Re: [U-Boot] [PATCH] dfu:function: Fix number of allocated DFU function pointers

2013-06-26 Thread Marek Vasut
Dear Heiko Schocher,

> Hello Lukasz,
> 
> Am 26.06.2013 11:46, schrieb Lukasz Majewski:
> > This subtle change fix problem with too small amount of allocated
> > memory to store DFU function pointers.
> > 
> > One needs to allocate extra space for sentinel NULL pointer in this array
> > of function pointers.
> > 
> > With the previous code, the NULL value overwrites malloc internal data
> > and afterwards free(f_dfu->function) crashes.
> > 
> > Signed-off-by: Lukasz Majewski 
> > Signed-off-by: Kyungmin Park 
> > Cc: Marek Vasut 
> > ---
> > 
> >  drivers/usb/gadget/f_dfu.c |2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Acked-by: Heiko Schocher 

Applied, thanks

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 0/4] ARM: AM33xx: Cleanup clocks and hwinit

2013-06-26 Thread Tom Rini
On Wed, Jun 26, 2013 at 09:54:00AM +0530, Lokesh Vutla wrote:
> Hi Tom,
> On Monday 24 June 2013 06:45 PM, Lokesh Vutla wrote:
> >This series tries to cleanup code for AM33xx,
> >inorder to ensure code reusabilty by moving the
> >duplicated code to common place.
> >This also helps in addition of new Soc with minimal
> >changes.
> >
> >Testing:
> >Boot tested on BeagleBone White/Black, AM35xx EVM, TI814x.
> >Verified MAKEALL for armv7 and am33xx boards.
> You have any other comments on this series ?

Looks good, I'll pick it up for u-boot-ti/next soon.

-- 
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 v4 2/3] Add TI816X support

2013-06-26 Thread TENART Antoine
> [snip]
>> +/* WDT related */
>> +#define WDT_WDSC(WDT_BASE + 0x010)
>> +#define WDT_WDST(WDT_BASE + 0x014)
>> +#define WDT_WISR(WDT_BASE + 0x018)
>> +#define WDT_WIER(WDT_BASE + 0x01C)
>> +#define WDT_WWER(WDT_BASE + 0x020)
>> +#define WDT_WCLR(WDT_BASE + 0x024)
>> +#define WDT_WCRR(WDT_BASE + 0x028)
>> +#define WDT_WLDR(WDT_BASE + 0x02C)
>> +#define WDT_WTGR(WDT_BASE + 0x030)
>> +#define WDT_WWPS(WDT_BASE + 0x034)
>> +#define WDT_WDLY(WDT_BASE + 0x044)
>> +#define WDT_WSPR(WDT_BASE + 0x048)
>> +#define WDT_WIRQEOI (WDT_BASE + 0x050)
>> +#define WDT_WIRQSTATRAW (WDT_BASE + 0x054)
>> +#define WDT_WIRQSTAT(WDT_BASE + 0x058)
>> +#define WDT_WIRQENSET   (WDT_BASE + 0x05C)
>> +#define WDT_WIRQENCLR   (WDT_BASE + 0x060)
>> +#define WDT_UNFREEZE(CTRL_BASE + 0x100)
>
> This should be using a struct like the other platforms do for wdt.

I'll do that and use the wd_timer structure.

>
> [snip]
>> +/* needed by config_dmm() */
>> +void enable_dmm_clocks(void) {}
>
> #ifndef the caller?
>

Yes.

>> +void ddr_pll_config(unsigned int pll)
>> +{
>> +writel(0x5,&(ddr_reg[pll])->cm0config);
>
> Magic value (0x5).

I'll fix it.

>
> [snip]
>> +main_pll_ctrl&= 0xFFFB;
>> +main_pll_ctrl |= 4;
>
> More magic.

This one is already explained in the beginning of the function. I'll put 
a per instruction comment instead.

>
> [snip]
>> +static void peripheral_enable(void)
>
> Lots more magic values in here.
>

I'll remove the magic.

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


Re: [U-Boot] [PATCH v4 3/3] Add TI816X evm board support

2013-06-26 Thread TENART Antoine
>> +#define CONFIG_EXTRA_ENV_SETTINGS \
>> +"verify=yes\0"
>
> Do we really want that?

I don't think so. This will be removed.

>> +/*
>> + * Memtest works on 8 MB in DRAM after skipping 32MB
>> + * from start addr of ram disk
>> + */
>> +#define CONFIG_SYS_MEMTEST_START(PHYS_DRAM_1 + (64*1024*1024))
>> +#define CONFIG_SYS_MEMTEST_END  (CONFIG_SYS_MEMTEST_START \
>> ++ (8*1024*1024))
>
> mtest isn't on by default anymore, see doc/README.memory-test

I'll remove that too.

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


Re: [U-Boot] U-Boot Digest, Vol 61, Issue 36

2013-06-26 Thread krishna dwivedi
Hi All,

Can anyone please provide me poinet on this.

Regards,
Krishna


On Wed, Jun 26, 2013 at 12:54 PM, krishna dwivedi <
krishna.dwived...@gmail.com> wrote:

> Hi All,
>
>
>
> I am trying to build U-boot:2013-04.But running into this error:
> mips64-nlm-elf-ld: arch/mips/cpu/mips64/start.o: relocation (null) against
> `board_init_f' can not be used when making a shared object; recompile with
> -fPIC
> arch/mips/cpu/mips64/start.o: could not read symbols: Bad value.
> Can ayone please provide me pointer what could be issue here.
>
> Regards,
> krishna
>
>
> On Wed, Jun 26, 2013 at 11:52 AM, krishna dwivedi <
> krishna.dwived...@gmail.com> wrote:
>
>> Hi All,
>>
>> Hope everyone is doing great:)
>>
>> I am trying to build U-boot:2013-04.But running into this error:
>> mips64-nlm-elf-ld: arch/mips/cpu/mips64/start.o: relocation (null)
>> against `board_init_f' can not be used when making a shared object;
>> recompile with -fPIC
>> arch/mips/cpu/mips64/start.o: could not read symbols: Bad value.
>>
>>
>> Initially,In file arch/mips/config.mk,I commented the flag:
>> #LDFLAGS_FINAL   +=  -pie
>> This error resolved.But after relocation of u-boot code,we need this
>> flag.So i need to uncomment this flag.and again i am running into this
>> error agian.
>>
>> Anyone faced this issue earlier.Anyone please provide pointers to resolve
>> this.
>>
>> Thanks in advance!!
>>
>> Regards,
>> Krishna
>>
>>
>>
>>
>>
>> On Tue, Jun 25, 2013 at 3:30 PM,  wrote:
>>
>>> Send U-Boot mailing list submissions to
>>> u-boot@lists.denx.de
>>>
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>> http://lists.denx.de/mailman/listinfo/u-boot
>>> or, via email, send a message with subject or body 'help' to
>>> u-boot-requ...@lists.denx.de
>>>
>>> You can reach the person managing the list at
>>> u-boot-ow...@lists.denx.de
>>>
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of U-Boot digest..."
>>>
>>>
>>> Today's Topics:
>>>
>>>1. Re: [PATCH v2 6/7] ARM: extend non-secure switch to also go
>>>   into HYP mode (Andre Przywara)
>>>2. Re: dfu: using dfu-util -l shows different output
>>>   (Lukasz Majewski)
>>>3. Re: dfu: using dfu-util -l shows different output (Heiko Schocher)
>>>4. Re: [PATCH] OpenRD: relocate environment to 640kB (Sascha Silbe)
>>>
>>>
>>> --
>>>
>>> Message: 1
>>> Date: Tue, 25 Jun 2013 10:27:30 +0200
>>> From: Andre Przywara 
>>> Subject: Re: [U-Boot] [PATCH v2 6/7] ARM: extend non-secure switch to
>>> also go into HYP mode
>>> To: Nikolay Nikolaev 
>>> Cc: geoff.lev...@linaro.org, u-boot@lists.denx.de, tr...@ti.com,
>>> kvm...@lists.cs.columbia.edu
>>> Message-ID: <51c95472.9030...@linaro.org>
>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>>
>>> On 06/21/2013 04:38 PM, Nikolay Nikolaev wrote:
>>> > Hello,
>>> >
>>> >
>>> > On Thu, Jun 13, 2013 at 2:01 PM, Andre Przywara
>>> > mailto:andre.przyw...@linaro.org>> wrote:
>>> >
>>> > For the KVM and XEN hypervisors to be usable, we need to enter the
>>> > kernel in HYP mode. Now that we already are in non-secure state,
>>> > HYP mode switching is within short reach.
>>> >
>>> > While doing the non-secure switch, we have to enable the HVC
>>> > instruction and setup the HYP mode HVBAR (while still secure).
>>> >
>>> > The actual switch is done by dropping back from a HYP mode handler
>>> > without actually leaving HYP mode, so we introduce a new handler
>>> > routine in our new secure exception vector table.
>>> >
>>> > In the assembly switching routine we save and restore the banked LR
>>> > and SP registers around the hypercall to do the actual HYP mode
>>> > switch.
>>> >
>>> > The C routine first checks whether we are in HYP mode already and
>>> > also whether the virtualization extensions are available. It also
>>> > checks whether the HYP mode switch was finally successful.
>>> > The bootm command part only adds and adjusts some error reporting.
>>> >
>>> > Signed-off-by: Andre Przywara >> > >
>>> > ---
>>> >   arch/arm/cpu/armv7/nonsec_virt.S | 31
>>> ---
>>> >   arch/arm/include/asm/armv7.h |  7 +--
>>> >   arch/arm/lib/bootm.c | 14 ++
>>> >   arch/arm/lib/virt-v7.c   | 27 ++-
>>> >   4 files changed, 65 insertions(+), 14 deletions(-)
>>> >
>>> > diff --git a/arch/arm/cpu/armv7/nonsec_virt.S
>>> > b/arch/arm/cpu/armv7/nonsec_virt.S
>>> > index 919f6e9..950da6f 100644
>>> > --- a/arch/arm/cpu/armv7/nonsec_virt.S
>>> > +++ b/arch/arm/cpu/armv7/nonsec_virt.S
>>> > @@ -1,5 +1,5 @@
>>> >   /*
>>> > - * code for switching cores into non-secure state
>>> > + * code for switching cores 

Re: [U-Boot] [PATCH 0/4] ARM: AM33xx: Cleanup clocks and hwinit

2013-06-26 Thread Lokesh Vutla

On Wednesday 26 June 2013 05:39 PM, Tom Rini wrote:

On Wed, Jun 26, 2013 at 09:54:00AM +0530, Lokesh Vutla wrote:

Hi Tom,
On Monday 24 June 2013 06:45 PM, Lokesh Vutla wrote:

This series tries to cleanup code for AM33xx,
inorder to ensure code reusabilty by moving the
duplicated code to common place.
This also helps in addition of new Soc with minimal
changes.

Testing:
Boot tested on BeagleBone White/Black, AM35xx EVM, TI814x.
Verified MAKEALL for armv7 and am33xx boards.

You have any other comments on this series ?


Looks good, I'll pick it up for u-boot-ti/next soon.


Thanks Tom.!!

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


Re: [U-Boot] [PATCH v4 3/3] Add TI816X evm board support

2013-06-26 Thread Lokesh Vutla

Hi Antoine,
On Wednesday 19 June 2013 03:38 PM, TENART Antoine wrote:

Signed-off-by: Antoine Tenart 
---
  MAINTAINERS  |4 +
  board/ti/ti816x/Makefile |   47 
  board/ti/ti816x/evm.c|  249 ++
  boards.cfg   |1 +
  include/configs/ti816x_evm.h |  188 +++
  5 files changed, 489 insertions(+)
  create mode 100644 board/ti/ti816x/Makefile
  create mode 100644 board/ti/ti816x/evm.c
  create mode 100644 include/configs/ti816x_evm.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 7820375..38ff5c3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -940,6 +940,10 @@ Lucas Stach 

colibri_t20_irisTegra20 (ARM7 & A9 Dual Core)

+Antoine Tenart 
+
+   TI816X  ARM ARMV7 (TI816x Soc)
+
  Nick Thompson 

da830evmARM926EJS (DA830/OMAP-L137)
diff --git a/board/ti/ti816x/Makefile b/board/ti/ti816x/Makefile
new file mode 100644
index 000..dc23d93
--- /dev/null
+++ b/board/ti/ti816x/Makefile
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2013, Adeneo Embedded 
+# Antoine Tenart, 
+#
+# Based on TI-PSP-04.00.02.14 :
+#
+# Copyright (C) 2009, Texas Instruments, Incorporated
+#
+# 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 version 2.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := evm.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/ti/ti816x/evm.c b/board/ti/ti816x/evm.c
new file mode 100644
index 000..12e98d5
--- /dev/null
+++ b/board/ti/ti816x/evm.c
@@ -0,0 +1,249 @@
+/*
+ * evm.c
+ *
+ * Copyright (C) 2013, Adeneo Embedded 
+ * Antoine Tenart, 
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+   gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
+   return 0;
+}
+
+#if defined(CONFIG_SPL_BUILD)
+
+static struct module_pin_mux mmc_pin_mux[] = {
+   { OFFSET(pincntl157), PULLDOWN_EN | PULLUDDIS | MODE(0x0) },
+   { OFFSET(pincntl158), PULLDOWN_EN | PULLUDEN | MODE(0x0) },
+   { OFFSET(pincntl159), PULLUP_EN | PULLUDDIS | MODE(0x0) },
+   { OFFSET(pincntl160), PULLUP_EN | PULLUDDIS | MODE(0x0) },
+   { OFFSET(pincntl161), PULLUP_EN | PULLUDDIS | MODE(0x0) },
+   { OFFSET(pincntl162), PULLUP_EN | PULLUDDIS | MODE(0x0) },
+   { OFFSET(pincntl163), PULLUP_EN | PULLUDDIS | MODE(0x0) },
+   { -1 },
+};
+
+const struct dmm_lisa_map_regs evm_lisa_map_regs = {
+   .dmm_lisa_map_0 = 0x,
+   .dmm_lisa_map_1 = 0x,
+   .dmm_lisa_map_2 = 0x80640300,
+   .dmm_lisa_map_3 = 0xC0640320,
+};
+
+/*
+ * DDR2 related definitions
+ */
+
+static struct ddr_data ddr2_data = {
+   .datardsratio0  = ((0x40<<10) | (0x40<<0)),
+   .datawdsratio0  = ((0x4A<<10) | (0x4A<<0)),
+   .datawiratio0   = ((0x0<<10) | (0x0<<0)),
+   .datagiratio0   = ((0x0<<10) | (0x0<<0)),
+   .datafwsratio0  = ((0x13A<<10) | (0x13A<<0)),
+   .datawrsratio0  = ((0x8A<<10) | (0x8A<<0)),
+   .datauserank0delay  = 0x1,
+   .datadldiff0= 0x0, /* depend on cpu rev, set later */
+};
+
+static struct cmd_control ddr2_ctrl = {
+   .cmd0csratio= 0x80,
+   .cmd0dldiff = 0x04, /* reset value is 0x4 */
+   .cmd0iclkout= 0x00,
+
+   .cmd1csratio= 0x80,
+   .cmd1dldiff = 0x04,
+   .cmd1iclkout= 0x00,
+
+   .cmd2csratio= 0x80,
+   .cmd2dldiff = 0x04,
+   .cmd2iclkout= 0x00,
+
+};
+
+static struct emif_regs ddr2_emif0_regs = {
+   .sdram_config   = 0x43801A3A,
+   .ref_ctrl   = 0x1C30,
+   .sdram_tim1 = 0x0AAB15E2,
+   .sdram_tim2 = 0x423631D2,
+   .sdram_tim3 = 0x00

Re: [U-Boot] Patch for RAMBOOT

2013-06-26 Thread Sadashiva Reddy
Hi,

I found a comment on blackvme board file saying that

The ax88180 driver had to be patched to work around a bug in Marvell
88E B2 silicon.

I am using uboot 2013.01 version.

I am working on the custom board using the Marvell 88E phy
connected to PPC440Gx processor and I am using emac2 (RGMII).

What is the work around need to do or is there any patch to make this
Marvell 88E phy working.

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


[U-Boot] [PATCH v7 3/5] Add Atmel I2C tpm

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

Add support for Atmel TPM devices with two wire interface.

Signed-off-by: Dirk Eibach 
Signed-off-by: Reinhard Pfau 
---
Changes in v7: None
Changes in v6:
- rename CONFIG_ATMEL_TWI_TPM to CONFIG_TPM_ATMEL_TWI
- rename drivers/tpm/atmel_twi_tpm.c to drivers/tpm/tpm_atmel_twi.c
- replace DEBUG_ATMEL_TWI_TPM, simply use DEBUG
- sort drivers/tpm/Makefile
- timeout on waiting for TPM reply

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 README  |   3 ++
 drivers/tpm/Makefile|   1 +
 drivers/tpm/tpm_atmel_twi.c | 121 
 3 files changed, 125 insertions(+)
 create mode 100644 drivers/tpm/tpm_atmel_twi.c

diff --git a/README b/README
index 3f9a613..2fa8c1e 100644
--- a/README
+++ b/README
@@ -1225,6 +1225,9 @@ The following options need to be configured:
CONFIG_TPM_TIS_I2C_BURST_LIMITATION
Define the burst count bytes upper limit
 
+   CONFIG_TPM_ATMEL_TWI
+   Support for Atmel TWI TPM device. Requires I2C support.
+
CONFIG_TPM_TIS_LPC
Support for generic parallel port TPM devices. Only one device
per system is supported at this time.
diff --git a/drivers/tpm/Makefile b/drivers/tpm/Makefile
index 913dd9c..c3010ba 100644
--- a/drivers/tpm/Makefile
+++ b/drivers/tpm/Makefile
@@ -26,6 +26,7 @@ LIB := $(obj)libtpm.o
 $(shell mkdir -p $(obj)slb9635_i2c)
 
 # TODO: Merge tpm_tis_lpc.c with tpm.c
+COBJS-$(CONFIG_TPM_ATMEL_TWI) += tpm_atmel_twi.o
 COBJS-$(CONFIG_TPM_TIS_I2C) += tpm.o
 COBJS-$(CONFIG_TPM_TIS_I2C) += tpm_tis_i2c.o
 COBJS-$(CONFIG_TPM_TIS_LPC) += tpm_tis_lpc.o
diff --git a/drivers/tpm/tpm_atmel_twi.c b/drivers/tpm/tpm_atmel_twi.c
new file mode 100644
index 000..361a772
--- /dev/null
+++ b/drivers/tpm/tpm_atmel_twi.c
@@ -0,0 +1,121 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#define ATMEL_TPM_TIMEOUT_MS 5000 /* sufficient for anything but
+generating/exporting keys */
+
+/*
+ * tis_init()
+ *
+ * Initialize the TPM device. Returns 0 on success or -1 on
+ * failure (in case device probing did not succeed).
+ */
+int tis_init(void)
+{
+   return 0;
+}
+
+/*
+ * tis_open()
+ *
+ * Requests access to locality 0 for the caller. After all commands have been
+ * completed the caller is supposed to call tis_close().
+ *
+ * Returns 0 on success, -1 on failure.
+ */
+int tis_open(void)
+{
+   return 0;
+}
+
+/*
+ * tis_close()
+ *
+ * terminate the currect session with the TPM by releasing the locked
+ * locality. Returns 0 on success of -1 on failure (in case lock
+ * removal did not succeed).
+ */
+int tis_close(void)
+{
+   return 0;
+}
+
+/*
+ * tis_sendrecv()
+ *
+ * Send the requested data to the TPM and then try to get its response
+ *
+ * @sendbuf - buffer of the data to send
+ * @send_size size of the data to send
+ * @recvbuf - memory to save the response to
+ * @recv_len - pointer to the size of the response buffer
+ *
+ * Returns 0 on success (and places the number of response bytes at recv_len)
+ * or -1 on failure.
+ */
+int tis_sendrecv(const uint8_t *sendbuf, size_t send_size, uint8_t *recvbuf,
+   size_t *recv_len)
+{
+   int res;
+   unsigned long start;
+
+#ifdef DEBUG
+   memset(recvbuf, 0xcc, *recv_len);
+   printf("send to TPM (%d bytes, recv_len=%d):\n", send_size, *recv_len);
+   print_buffer(0, (void *)sendbuf, 1, send_size, 0);
+#endif
+
+   res = i2c_write(0x29, 0, 0, (uchar *)sendbuf, send_size);
+   if (res) {
+   printf("i2c_write returned %d\n", res);
+   return -1;
+   }
+
+   start = get_timer(0);
+   while ((res = i2c_read(0x29, 0, 0, recvbuf, 10))) {
+   if (get_timer(start) > ATMEL_TPM_TIMEOUT_MS) {
+   puts("tpm timed out\n");
+   return -1;
+   }
+   udelay(100);
+   }
+   if (!res) {
+   *recv_len = get_unaligned_be32(recvbuf + 2);
+   if (*recv_len > 10)
+   res = i2c_read(0x29, 0, 0, recvbuf, *recv_len);
+   }
+   if (res) {
+

[U-Boot] [PATCH v7 4/5] Build arch/$ARCH/lib/bootm.o depending on CONFIG_CMD_BOOTM

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

MAKEALL is fine for ppc4xx and mpc85xx.
Run checks were done on our controlcenterd hardware.

Signed-off-by: Dirk Eibach 
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4:
- consider CONFIG_CMD_BOOTM for all architectures

Changes in v3: None
Changes in v2: None

 arch/arm/lib/Makefile| 2 +-
 arch/avr32/lib/Makefile  | 2 +-
 arch/m68k/lib/Makefile   | 2 +-
 arch/microblaze/lib/Makefile | 2 +-
 arch/mips/lib/Makefile   | 4 ++--
 arch/nds32/lib/Makefile  | 3 ++-
 arch/nios2/lib/Makefile  | 2 +-
 arch/openrisc/lib/Makefile   | 2 +-
 arch/powerpc/lib/Makefile| 2 +-
 arch/sh/lib/Makefile | 2 +-
 arch/sparc/lib/Makefile  | 3 ++-
 arch/x86/lib/Makefile| 2 +-
 12 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 8ad9f66..6526fc8 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -45,8 +45,8 @@ COBJS-y   += board.o
 endif
 COBJS-y += bss.o
 
-COBJS-y+= bootm.o
 COBJS-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
 SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
diff --git a/arch/avr32/lib/Makefile b/arch/avr32/lib/Makefile
index ee6d067..fce8af3 100644
--- a/arch/avr32/lib/Makefile
+++ b/arch/avr32/lib/Makefile
@@ -30,7 +30,7 @@ LIB   = $(obj)lib$(ARCH).o
 SOBJS-y+= memset.o
 
 COBJS-y+= board.o
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-y+= interrupts.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index a8d6cd5..5722b67 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -28,7 +28,7 @@ LIB   = $(obj)lib$(ARCH).o
 SOBJS-y+=
 
 COBJS-y+= board.o
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-y+= cache.o
 COBJS-y+= interrupts.o
 COBJS-y+= time.o
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index 8d7febd..a40e8d4 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -28,7 +28,7 @@ LIB   = $(obj)lib$(ARCH).o
 SOBJS-y+=
 
 COBJS-y+= board.o
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-y+= muldi3.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 967e98a..b6ded54 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -36,9 +36,9 @@ SOBJS-y   +=
 
 COBJS-y+= board.o
 ifeq ($(CONFIG_QEMU_MIPS),y)
-COBJS-y+= bootm_qemu_mips.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm_qemu_mips.o
 else
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 endif
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/arch/nds32/lib/Makefile b/arch/nds32/lib/Makefile
index 581a2e7..705e1ff 100644
--- a/arch/nds32/lib/Makefile
+++ b/arch/nds32/lib/Makefile
@@ -29,7 +29,8 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(ARCH).o
 
-OBJS   := board.o bootm.o cache.o interrupts.o
+OBJS   := board.o cache.o interrupts.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 
 all:   $(LIB)
 
diff --git a/arch/nios2/lib/Makefile b/arch/nios2/lib/Makefile
index 443f99e..f33f96a 100644
--- a/arch/nios2/lib/Makefile
+++ b/arch/nios2/lib/Makefile
@@ -28,7 +28,7 @@ LIB   = $(obj)lib$(ARCH).o
 SOBJS-y+= cache.o
 
 COBJS-y+= board.o
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-y+= libgcc.o
 COBJS-y+= time.o
 
diff --git a/arch/openrisc/lib/Makefile b/arch/openrisc/lib/Makefile
index db3c657..ab822f4 100644
--- a/arch/openrisc/lib/Makefile
+++ b/arch/openrisc/lib/Makefile
@@ -28,7 +28,7 @@ LIB   = $(obj)lib$(ARCH).o
 SOBJS-y+=
 
 COBJS-y+= board.o
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-y+= timer.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 59c723b..8c4920b 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -63,7 +63,7 @@ ifndef CONFIG_SYS_GENERIC_BOARD
 COBJS-y+= board.o
 endif
 endif
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 COBJS-y+= cache.o
 COBJS-y+= extable.o
 COBJS-y+= interrupts.o
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile
index 256811a..3d4eb53 100644
--- a/arch/sh/lib/Makefile
+++ b/arch/sh/lib/Makefile
@@ -33,7 +33,7 @@ GLSOBJS   += lshrdi3.o
 GLSOBJS+= movmem.o
 
 COBJS-y+= board.o
-COBJS-y+= bootm.o
+COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
 ifeq ($(CONFIG_SH2),y)
 COBJS-y+= time_sh2.o
 else
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 7133ef1..aec29b3 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile

[U-Boot] [PATCH v7 2/5] i2c: fsl_i2c: i2c_read(): dont try to write address w/ alen=0

2013-06-26 Thread dirk . eibach
From: Reinhard Pfau 

if alen is 0: no longer start a write cycle before reading data.

Signed-off-by: Dirk Eibach 
Signed-off-by: Reinhard Pfau 
Acked-by: Heiko Schocher 
---
Changes in v7: None
Changes in v6: None
Changes in v5:
- fix i2c_probe

Changes in v4: None
Changes in v3: None
Changes in v2:
- whitespace fixes

 drivers/i2c/fsl_i2c.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 1c7265d..5d7e010 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -383,13 +383,16 @@ i2c_read(u8 dev, uint addr, int alen, u8 *data, int 
length)
int i = -1; /* signal error */
u8 *a = (u8*)&addr;
 
-   if (i2c_wait4bus() >= 0
+   if (i2c_wait4bus() < 0)
+   return -1;
+
+   if ((!length || alen > 0)
&& i2c_write_addr(dev, I2C_WRITE_BIT, 0) != 0
&& __i2c_write(&a[4 - alen], alen) == alen)
i = 0; /* No error so far */
 
-   if (length
-   && i2c_write_addr(dev, I2C_READ_BIT, 1) != 0)
+   if (length &&
+   i2c_write_addr(dev, I2C_READ_BIT, alen ? 1 : 0) != 0)
i = __i2c_read(data, length);
 
writeb(I2C_CR_MEN, &i2c_dev[i2c_bus_num]->cr);
-- 
1.8.3

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


[U-Boot] [PATCH v7 1/5] tpm: add AUTH1 cmds for LoadKey2 and GetPubKey

2013-06-26 Thread dirk . eibach
From: Reinhard Pfau 

Extend the tpm library with support for single authorized (AUTH1) commands
as specified in the TCG Main Specification 1.2. (The internally used helper
functions are implemented in a way that they could also be used for double
authorized commands if someone needs it.)

Provide enums with the return codes from the TCG Main specification.

For now only a single OIAP session is supported.

OIAP authorized version of the commands TPM_LoadKey2 and TPM_GetPubKey are
provided. Both features are available using the 'tpm' command, too.

Authorized commands are enabled with CONFIG_TPM_AUTH_SESSIONS. (Note that
this also requires CONFIG_SHA1 to be enabled.)

Signed-off-by: Reinhard Pfau 
Signed-off-by: Dirk Eibach 
Acked-by: Che-Liang Chiou 
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- fix email addresses

Changes in v2:
- replace some numeric constants with named constants
- style fixes (as shown by checkpatch.pl) in common/cmd_tpm.c and lib/tpm.c

 README   |  14 +++
 common/cmd_tpm.c | 100 
 include/tpm.h| 174 +++
 lib/tpm.c| 351 ++-
 4 files changed, 638 insertions(+), 1 deletion(-)

diff --git a/README b/README
index cd0336c..3f9a613 100644
--- a/README
+++ b/README
@@ -1234,6 +1234,20 @@ The following options need to be configured:
to. Contemporary x86 systems usually map it at
0xfed4.
 
+   CONFIG_CMD_TPM
+   Add tpm monitor functions.
+   Requires CONFIG_TPM. If CONFIG_TPM_AUTH_SESSIONS is set, also
+   provides monitor access to authorized functions.
+
+   CONFIG_TPM
+   Define this to enable the TPM support library which provides
+   functional interfaces to some TPM commands.
+   Requires support for a TPM device.
+
+   CONFIG_TPM_AUTH_SESSIONS
+   Define this to enable authorized functions in the TPM library.
+   Requires CONFIG_TPM and CONFIG_SHA1.
+
 - USB Support:
At the moment only the UHCI host controller is
supported (PIP405, MIP405, MPC5200); define
diff --git a/common/cmd_tpm.c b/common/cmd_tpm.c
index 46fae18..c34000a 100644
--- a/common/cmd_tpm.c
+++ b/common/cmd_tpm.c
@@ -27,6 +27,13 @@
 #include 
 #include 
 
+/* Useful constants */
+enum {
+   DIGEST_LENGTH   = 20,
+   /* max lengths, valid for RSA keys <= 2048 bits */
+   TPM_PUBKEY_MAX_LENGTH   = 288,
+};
+
 /**
  * Print a byte string in hexdecimal format, 16-bytes per line.
  *
@@ -546,6 +553,72 @@ static int do_tpm_nv_write(cmd_tbl_t *cmdtp, int flag,
return convert_return_code(err);
 }
 
+#ifdef CONFIG_TPM_AUTH_SESSIONS
+
+static int do_tpm_oiap(cmd_tbl_t *cmdtp, int flag,
+   int argc, char * const argv[])
+{
+   uint32_t auth_handle, err;
+
+   err = tpm_oiap(&auth_handle);
+
+   return convert_return_code(err);
+}
+
+static int do_tpm_load_key2_oiap(cmd_tbl_t *cmdtp, int flag,
+   int argc, char * const argv[])
+{
+   uint32_t parent_handle, key_len, key_handle, err;
+   uint8_t usage_auth[DIGEST_LENGTH];
+   void *key;
+
+   if (argc < 5)
+   return CMD_RET_USAGE;
+
+   parent_handle = simple_strtoul(argv[1], NULL, 0);
+   key = (void *)simple_strtoul(argv[2], NULL, 0);
+   key_len = simple_strtoul(argv[3], NULL, 0);
+   if (strlen(argv[4]) != 2 * DIGEST_LENGTH)
+   return CMD_RET_FAILURE;
+   parse_byte_string(argv[4], usage_auth, NULL);
+
+   err = tpm_load_key2_oiap(parent_handle, key, key_len, usage_auth,
+   &key_handle);
+   if (!err)
+   printf("Key handle is 0x%x\n", key_handle);
+
+   return convert_return_code(err);
+}
+
+static int do_tpm_get_pub_key_oiap(cmd_tbl_t *cmdtp, int flag,
+   int argc, char * const argv[])
+{
+   uint32_t key_handle, err;
+   uint8_t usage_auth[DIGEST_LENGTH];
+   uint8_t pub_key_buffer[TPM_PUBKEY_MAX_LENGTH];
+   size_t pub_key_len = sizeof(pub_key_buffer);
+
+   if (argc < 3)
+   return CMD_RET_USAGE;
+
+   key_handle = simple_strtoul(argv[1], NULL, 0);
+   if (strlen(argv[2]) != 2 * DIGEST_LENGTH)
+   return CMD_RET_FAILURE;
+   parse_byte_string(argv[2], usage_auth, NULL);
+
+   err = tpm_get_pub_key_oiap(key_handle, usage_auth,
+   pub_key_buffer, &pub_key_len);
+   if (!err) {
+   printf("dump of received pub key structure:\n");
+   print_byte_string(pub_key_buffer, pub_key_len);
+   }
+   return convert_return_code(err);
+}
+
+TPM_COMMAND_NO_ARG(tpm_end_oiap)
+
+#endif /* CONFIG_TPM_AUTH_SESSIONS */
+
 #define MAKE_TPM_CMD_ENTRY(cmd) \
U_BOOT_CMD_MKENT(cmd, 0, 1, do_tpm_ ## cmd, "", "")
 
@@ 

[U-Boot] [PATCH v7 0/5] Add gdsys ControlCenter Digital board

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 



Changes in v7:
- access FPGA by C struct instead of base+offset
- braces for multiline statement
- clarify that boot commands are already NUL-terminated
- insert some blank lines to serparate declarations and code
- remove CONFIG_HDBOOT which was not used
- remove unused controlcenterd entries from boards.cfg
- undo .checkpatch.conf modification which was comitted by mistake

Changes in v6:
- Add CONFIG_PCI_INDIRECT_BRIDGE to controlcenterd.h
- Add MAINTAINERS entry
- drop "mpc85xx: Add CONFIG_RELEASE_CORE0_ONLY" and use mp_holdoff instead
- rename CONFIG_ATMEL_TWI_TPM to CONFIG_TPM_ATMEL_TWI
- rename drivers/tpm/atmel_twi_tpm.c to drivers/tpm/tpm_atmel_twi.c
- replace DEBUG_ATMEL_TWI_TPM, simply use DEBUG
- sort drivers/tpm/Makefile
- timeout on waiting for TPM reply

Changes in v5:
- avoid probing dp501 i2c bridge addresses
- fix i2c_probe

Changes in v4:
- consider CONFIG_CMD_BOOTM for all architectures

Changes in v3:
- fix email addresses

Changes in v2:
- configuration for SPI builds was missing
- replace some numeric constants with named constants
- style fixes (as shown by checkpatch.pl) in common/cmd_tpm.c and lib/tpm.c
- whitespace fixes

Dirk Eibach (3):
  Add Atmel I2C tpm
  Build arch/$ARCH/lib/bootm.o depending on CONFIG_CMD_BOOTM
  mpc85xx: Add gdsys ControlCenter Digital board

Reinhard Pfau (2):
  tpm: add AUTH1 cmds for LoadKey2 and GetPubKey
  i2c: fsl_i2c: i2c_read(): dont try to write address w/ alen=0

 MAINTAINERS   |3 +-
 README|   17 +
 arch/arm/lib/Makefile |2 +-
 arch/avr32/lib/Makefile   |2 +-
 arch/m68k/lib/Makefile|2 +-
 arch/microblaze/lib/Makefile  |2 +-
 arch/mips/lib/Makefile|4 +-
 arch/nds32/lib/Makefile   |3 +-
 arch/nios2/lib/Makefile   |2 +-
 arch/openrisc/lib/Makefile|2 +-
 arch/powerpc/lib/Makefile |2 +-
 arch/sh/lib/Makefile  |2 +-
 arch/sparc/lib/Makefile   |3 +-
 arch/x86/lib/Makefile |2 +-
 board/gdsys/common/Makefile   |1 +
 board/gdsys/common/dp501.c|  107 +++
 board/gdsys/common/dp501.h|   30 +
 board/gdsys/p1022/Makefile|   37 +
 board/gdsys/p1022/controlcenterd-id.c | 1224 +
 board/gdsys/p1022/controlcenterd-id.h |   29 +
 board/gdsys/p1022/controlcenterd.c|  425 
 board/gdsys/p1022/ddr.c   |   71 ++
 board/gdsys/p1022/diu.c   |   87 +++
 board/gdsys/p1022/law.c   |   20 +
 board/gdsys/p1022/sdhc_boot.c |   63 ++
 board/gdsys/p1022/tlb.c   |   77 +++
 boards.cfg|4 +
 common/cmd_tpm.c  |  100 +++
 drivers/i2c/fsl_i2c.c |9 +-
 drivers/tpm/Makefile  |1 +
 drivers/tpm/tpm_atmel_twi.c   |  121 
 include/configs/controlcenterd.h  |  522 ++
 include/tpm.h |  174 +
 lib/tpm.c |  351 +-
 34 files changed, 3483 insertions(+), 18 deletions(-)
 create mode 100644 board/gdsys/common/dp501.c
 create mode 100644 board/gdsys/common/dp501.h
 create mode 100644 board/gdsys/p1022/Makefile
 create mode 100644 board/gdsys/p1022/controlcenterd-id.c
 create mode 100644 board/gdsys/p1022/controlcenterd-id.h
 create mode 100644 board/gdsys/p1022/controlcenterd.c
 create mode 100644 board/gdsys/p1022/ddr.c
 create mode 100644 board/gdsys/p1022/diu.c
 create mode 100644 board/gdsys/p1022/law.c
 create mode 100644 board/gdsys/p1022/sdhc_boot.c
 create mode 100644 board/gdsys/p1022/tlb.c
 create mode 100644 drivers/tpm/tpm_atmel_twi.c
 create mode 100644 include/configs/controlcenterd.h

-- 
1.8.3

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


Re: [U-Boot] [PATCH v5 1/8] ARM: dove: add support for Marvell Dove SoC

2013-06-26 Thread Wolfgang Denk
Dear Sascha Silbe,

In message <1372195668-25496-2-git-send-email-t-ub...@infra-silbe.de> you wrote:
> This patch adds initial support for the armv7-based Marvell Dove SoC
> (88AP510).
> 
> Signed-off-by: Sascha Silbe 
> ---
> v4->v5: some adjustments for the GPIO and SPI driver changes
> 
>  arch/arm/cpu/armv7/dove/Makefile|  49 +
>  arch/arm/cpu/armv7/dove/cpu.c   | 274 +++
>  arch/arm/cpu/armv7/dove/dram.c  | 117 
>  arch/arm/cpu/armv7/dove/lowlevel_init.S |  83 +
>  arch/arm/cpu/armv7/dove/mpp.c   | 318 
> 
>  arch/arm/cpu/armv7/dove/timer.c | 176 ++
>  arch/arm/cpu/armv7/dove/usb.c   | 101 ++
>  arch/arm/include/asm/arch-dove/config.h | 153 +++
>  arch/arm/include/asm/arch-dove/cpu.h| 204 
>  arch/arm/include/asm/arch-dove/dove.h   |  98 ++
>  arch/arm/include/asm/arch-dove/gpio.h   |  35 
>  arch/arm/include/asm/arch-dove/mpp.h| 283 
>  arch/arm/include/asm/arch-dove/usb.h|  27 +++
>  13 files changed, 1918 insertions(+)

This patch does not apply:

ERROR: patch seems to be corrupt (line wrapped?)
#1269: FILE: arch/arm/include/asm/arch-dove/config.h:100:
diff --git a/arch/arm/include/asm/arch-dove/config.h 
b/arch/arm/include/asm/arch-dove/config.h


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 thing is, as you progress in the Craft,  you'll  learn  there  is
another rule... When you break rules, break 'em good and hard.
- Terry Pratchett, _Wyrd Sisters_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 2/8] usb: ehci-marvell: add support for second USB controller

2013-06-26 Thread Wolfgang Denk
Dear Sascha Silbe,

In message <1372195668-25496-3-git-send-email-t-ub...@infra-silbe.de> you wrote:
> From: Sascha Silbe 
> 
> Marvell 88AP510 (Armada 510, dove) has two separate USB
> controllers. Use the index parameter that already gets passed in to
> calculate the base address of the controller.
...
> -#define rdl(off) readl(MVUSB0_BASE + (off))
> -#define wrl(off, val)writel((val), MVUSB0_BASE + (off))
> +#define rdl(base, off)   readl((base) + (off))
> +#define wrl(base, off, val)  writel((val), (base) + (off))

Instead of extending this, can we eventually clean this up and use C
structs instead?  U-Boot does not allow device accesses through a
based plus offset notation.

>   u32 size, base, attrib;
> +#ifdef MVUSB1_BASE
> + u32 usb_base = (index == 0) ? MVUSB0_BASE : MVUSB1_BASE;
> +#else
> + u32 usb_base = MVUSB0_BASE;
> +#endif

Can we please also avoid this #ifdef's ?  Eventually you can use
something like "base_0 + index * sizeof(struct usb_something)" ?


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
Syntactic sugar causes cancer of the semicolon.
- Epigrams in Programming, ACM SIGPLAN Sept. 1982
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 2/6] powerpc/ppc4xx: Add gdsys mclink interface

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

mclink is a serial interface for communication between gdsys FPGA.

Signed-off-by: Dirk Eibach 
---
Changes in v5: None
Changes in v4: None
Changes in v3:
- adapt to "powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA"
- squashed with "powerpc/ppc4xx: Increase timeout for gdsys mclink bus startup"

Changes in v2:
- update email account

 board/gdsys/common/mclink.c | 153 
 board/gdsys/common/mclink.h |  31 +
 2 files changed, 184 insertions(+)
 create mode 100644 board/gdsys/common/mclink.c
 create mode 100644 board/gdsys/common/mclink.h

diff --git a/board/gdsys/common/mclink.c b/board/gdsys/common/mclink.c
new file mode 100644
index 000..e0382a3
--- /dev/null
+++ b/board/gdsys/common/mclink.c
@@ -0,0 +1,153 @@
+/*
+ * (C) Copyright 2012
+ * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+enum {
+   MCINT_SLAVE_LINK_CHANGED_EV = 1 << 7,
+   MCINT_TX_ERROR_EV = 1 << 9,
+   MCINT_TX_BUFFER_FREE = 1 << 10,
+   MCINT_TX_PACKET_TRANSMITTED_EV = 1 << 11,
+   MCINT_RX_ERROR_EV = 1 << 13,
+   MCINT_RX_CONTENT_AVAILABLE = 1 << 14,
+   MCINT_RX_PACKET_RECEIVED_EV = 1 << 15,
+};
+
+int mclink_probe(void)
+{
+   unsigned int k;
+   int slaves = 0;
+
+   for (k = 0; k < CONFIG_SYS_MCLINK_MAX; ++k) {
+   int timeout = 0;
+   unsigned int ctr = 0;
+   u16 mc_status;
+
+   FPGA_GET_REG(k, mc_status, &mc_status);
+
+   if (!(mc_status & (1 << 15)))
+   break;
+
+   FPGA_SET_REG(k, mc_control, 0x8000);
+
+   FPGA_GET_REG(k, mc_status, &mc_status);
+   while (!(mc_status & (1 << 14))) {
+   udelay(100);
+   if (ctr++ > 500) {
+   timeout = 1;
+   break;
+   }
+   FPGA_GET_REG(k, mc_status, &mc_status);
+   }
+   if (timeout)
+   break;
+
+   printf("waited %d us for mclink %d to come up\n", ctr * 100, k);
+
+   slaves++;
+   }
+
+   return slaves;
+}
+
+int mclink_send(u8 slave, u16 addr, u16 data)
+{
+   unsigned int ctr = 0;
+   u16 int_status;
+   u16 rx_cmd_status;
+   u16 rx_cmd;
+
+   /* reset interrupt status */
+   FPGA_GET_REG(0, mc_int, &int_status);
+   FPGA_SET_REG(0, mc_int, int_status);
+
+   /* send */
+   FPGA_SET_REG(0, mc_tx_address, addr);
+   FPGA_SET_REG(0, mc_tx_data, data);
+   FPGA_SET_REG(0, mc_tx_cmd, (slave & 0x03) << 14);
+   FPGA_SET_REG(0, mc_control, 0x8001);
+
+   /* wait for reply */
+   FPGA_GET_REG(0, mc_int, &int_status);
+   while (!(int_status & MCINT_RX_PACKET_RECEIVED_EV)) {
+   udelay(100);
+   if (ctr++ > 3)
+   return -ETIMEDOUT;
+   FPGA_GET_REG(0, mc_int, &int_status);
+   }
+
+   FPGA_GET_REG(0, mc_rx_cmd_status, &rx_cmd_status);
+   rx_cmd = (rx_cmd_status >> 12) & 0x03;
+   if (rx_cmd != 0)
+   printf("mclink_send: received cmd %d, expected %d\n", rx_cmd,
+  0);
+
+   return 0;
+}
+
+int mclink_receive(u8 slave, u16 addr, u16 *data)
+{
+   u16 rx_cmd_status;
+   u16 rx_cmd;
+   u16 int_status;
+   unsigned int ctr = 0;
+
+   /* send read request */
+   FPGA_SET_REG(0, mc_tx_address, addr);
+   FPGA_SET_REG(0, mc_tx_cmd,
+((slave & 0x03) << 14) | (1 << 12) | (1 << 0));
+   FPGA_SET_REG(0, mc_control, 0x8001);
+
+
+   /* wait for reply */
+   FPGA_GET_REG(0, mc_int, &int_status);
+   while (!(int_status & MCINT_RX_CONTENT_AVAILABLE)) {
+   udelay(100);
+   if (ctr++ > 3)
+   return -ETIMEDOUT;
+   FPGA_GET_REG(0, mc_int, &int_status);
+   }
+
+   /* check reply */
+   FPGA_GET_REG(0, mc_rx_cmd_status, &rx_cmd_status);
+   if ((rx_cmd_status >> 14) != slave) {
+ 

[U-Boot] [PATCH v5 0/6] Update gdsys ppc4xx-based boards

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 


This series depends on i2c multibus support.
It was rebased on the latest multibus branch at
http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/20130620_multibus_v2

Patch "powerpc/ppc4xx: Add bitbang i2c interface for gdsys boards" was dropped 
in
favor of using the new framework.

Changes in v5:
- add board/gdsys/common/fpga.c which was forgotten in v4

Changes in v4:
- Move changes ins osd.c to proper commit
- Move unrelated changes ins osd.c to proper commit
- do not use common FPGA register accessors here
- explain why fpga_gpio_ functions are actually useful
- factor out common code for fpga register access
- use macro instead of #ifdef for reflection test

Changes in v3:
- adapt to "powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA"
- squashed with "Add generic accessor functions for gdsys FPGA"
- squashed with "powerpc/ppc4xx: Increase timeout for gdsys mclink bus startup"
- squashed with powerpc/ppc4xx: Fixup phy erratum on gdsys iocon hardware
- strictly replace base address plus offset with  proper C structs

Changes in v2:
- fpga_state has been moved to arch_global_data
- include cmd_fpgad in iocon
- move cmd_fpgad to common and fix whitespace issues
- update email account
- use multibus soft-i2c in iocon

Dirk Eibach (6):
  powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA
  powerpc/ppc4xx: Add gdsys mclink interface
  powerpc/ppc4xx: Add fpgad command for dumping gdsys fpga registers
  powerpc/ppc4xx: Support gdsys multichannel iocon hardware
  powerpc/ppc4xx: Consider gdsys FPGA OSD size
  powerpc/ppc4xx: Remove CONFIG_SYS_FLASH_PROTECTION from gdsys boards

 board/gdsys/405ep/405ep.c|  22 +-
 board/gdsys/405ep/dlvision-10g.c |  18 +-
 board/gdsys/405ep/io.c   |  16 +-
 board/gdsys/405ep/iocon.c| 486 +++
 board/gdsys/405ep/neo.c  |  13 +-
 board/gdsys/405ex/405ex.c|  22 +-
 board/gdsys/405ex/io64.c |  34 +--
 board/gdsys/common/Makefile  |   4 +-
 board/gdsys/common/fpga.c|  41 
 board/gdsys/common/mclink.c  | 153 
 board/gdsys/common/mclink.h  |  31 +++
 board/gdsys/common/osd.c | 118 ++
 common/Makefile  |   1 +
 common/cmd_fpgad.c   | 100 
 include/configs/dlvision-10g.h   |   9 +-
 include/configs/dlvision.h   |   3 +-
 include/configs/io.h |   8 +-
 include/configs/io64.h   |   6 +
 include/configs/iocon.h  |  60 -
 include/configs/neo.h|   8 +-
 include/gdsys_fpga.h |  58 -
 21 files changed, 1040 insertions(+), 171 deletions(-)
 create mode 100644 board/gdsys/common/fpga.c
 create mode 100644 board/gdsys/common/mclink.c
 create mode 100644 board/gdsys/common/mclink.h
 create mode 100644 common/cmd_fpgad.c

-- 
1.8.3

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


[U-Boot] [PATCH v5 6/6] powerpc/ppc4xx: Remove CONFIG_SYS_FLASH_PROTECTION from gdsys boards

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

CONFIG_SYS_FLASH_PROTECTION was active on most gdsys boards by default,
while hardware flash protection was not implemented.
Hardware support was added recently and we get into trouble because backward
compatibility is broken (u-boot can't unprotect the protected flash after a
downgrade). So we decided to disable hardware flash protection for all our 
boards.

Signed-off-by: Dirk Eibach 
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/dlvision-10g.h | 3 +--
 include/configs/dlvision.h | 3 +--
 include/configs/io.h   | 3 +--
 include/configs/iocon.h| 3 +--
 include/configs/neo.h  | 3 +--
 5 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/include/configs/dlvision-10g.h b/include/configs/dlvision-10g.h
index 8af7848..a147c00 100644
--- a/include/configs/dlvision-10g.h
+++ b/include/configs/dlvision-10g.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEdlvsion-10g
-#define CONFIG_IDENT_STRING" dlvision-10g 0.03"
+#define CONFIG_IDENT_STRING" dlvision-10g 0.04"
 #include "amcc-common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -167,7 +167,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/dlvision.h b/include/configs/dlvision.h
index 24c9fa4..948930e 100644
--- a/include/configs/dlvision.h
+++ b/include/configs/dlvision.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEdlvision
-#define CONFIG_IDENT_STRING" dlvision 0.01"
+#define CONFIG_IDENT_STRING" dlvision 0.02"
 #include "amcc-common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F  /* call board_early_init_f */
@@ -125,7 +125,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/io.h b/include/configs/io.h
index f5b4d79..9272ee6 100644
--- a/include/configs/io.h
+++ b/include/configs/io.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEio
-#define CONFIG_IDENT_STRING" io 0.05"
+#define CONFIG_IDENT_STRING" io 0.06"
 #include "amcc-common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -139,7 +139,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/iocon.h b/include/configs/iocon.h
index 561837c..fd93e9f 100644
--- a/include/configs/iocon.h
+++ b/include/configs/iocon.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEiocon
-#define CONFIG_IDENT_STRING" iocon 0.04"
+#define CONFIG_IDENT_STRING" iocon 0.05"
 #include "amcc-common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -188,7 +188,6 @@ int fpga_gpio_get(unsigned int bus, int pin);
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/neo.h b/include/configs/neo.h
index d1e07ae..d16db4f 100644
--- a/include/configs/neo.h
+++ b/include/configs/neo.h
@@ -35,7 +35,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEneo
-#define CONFIG_IDENT_STRING" neo 0.01"
+#define CONFIG_IDENT_STRING" neo 0.02"
 #include "amcc-common.h"
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -146,7 +146,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write (in 
ms)  */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buffered writes (20x 
faster) */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash 
protection

[U-Boot] [PATCH v5 1/6] powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

A set of accessor functions was added to be able to access not only
memory mapped FPGA in a generic way.

Thanks to Wolfgang Denk for getting this sorted properly.

Signed-off-by: Dirk Eibach 
---
Changes in v5:
- add board/gdsys/common/fpga.c which was forgotten in v4

Changes in v4:
- Move unrelated changes ins osd.c to proper commit
- explain why fpga_gpio_ functions are actually useful
- factor out common code for fpga register access
- use macro instead of #ifdef for reflection test

Changes in v3:
- squashed with "Add generic accessor functions for gdsys FPGA"
- strictly replace base address plus offset with  proper C structs

Changes in v2: None

 board/gdsys/405ep/405ep.c| 22 +++---
 board/gdsys/405ep/dlvision-10g.c | 18 +++
 board/gdsys/405ep/io.c   | 16 ++
 board/gdsys/405ep/iocon.c| 24 ++-
 board/gdsys/405ep/neo.c  | 13 +---
 board/gdsys/405ex/405ex.c| 22 +++---
 board/gdsys/405ex/io64.c | 34 +++--
 board/gdsys/common/Makefile  |  2 ++
 board/gdsys/common/fpga.c| 41 +
 board/gdsys/common/osd.c | 66 ++--
 include/configs/dlvision-10g.h   |  6 
 include/configs/io.h |  5 +++
 include/configs/io64.h   |  6 
 include/configs/iocon.h  |  5 +++
 include/configs/neo.h|  5 +++
 include/gdsys_fpga.h | 43 +-
 16 files changed, 229 insertions(+), 99 deletions(-)
 create mode 100644 board/gdsys/common/fpga.c

diff --git a/board/gdsys/405ep/405ep.c b/board/gdsys/405ep/405ep.c
index 6221171..003911d 100644
--- a/board/gdsys/405ep/405ep.c
+++ b/board/gdsys/405ep/405ep.c
@@ -34,6 +34,12 @@
 #define REFLECTION_TESTPATTERN 0xdede
 #define REFLECTION_TESTPATTERN_INV (~REFLECTION_TESTPATTERN & 0x)
 
+#ifdef CONFIG_SYS_FPGA_NO_RFL_HI
+#define REFLECTION_TESTREG reflection_low
+#else
+#define REFLECTION_TESTREG reflection_high
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 int get_fpga_state(unsigned dev)
@@ -106,23 +112,17 @@ int board_early_init_r(void)
gd405ep_set_fpga_reset(0);
 
for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) {
-   struct ihs_fpga *fpga =
-   (struct ihs_fpga *)CONFIG_SYS_FPGA_BASE(k);
-#ifdef CONFIG_SYS_FPGA_NO_RFL_HI
-   u16 *reflection_target = &fpga->reflection_low;
-#else
-   u16 *reflection_target = &fpga->reflection_high;
-#endif
/*
 * wait for fpga out of reset
 */
ctr = 0;
while (1) {
-   out_le16(&fpga->reflection_low,
-   REFLECTION_TESTPATTERN);
+   u16 val;
+
+   FPGA_SET_REG(k, reflection_low, REFLECTION_TESTPATTERN);
 
-   if (in_le16(reflection_target) ==
-   REFLECTION_TESTPATTERN_INV)
+   FPGA_GET_REG(k, REFLECTION_TESTREG, &val);
+   if (val == REFLECTION_TESTPATTERN_INV)
break;
 
udelay(10);
diff --git a/board/gdsys/405ep/dlvision-10g.c b/board/gdsys/405ep/dlvision-10g.c
index 644493b..16cd5a9 100644
--- a/board/gdsys/405ep/dlvision-10g.c
+++ b/board/gdsys/405ep/dlvision-10g.c
@@ -71,6 +71,8 @@ enum {
RAM_DDR2_64 = 2,
 };
 
+struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
+
 int misc_init_r(void)
 {
/* startup fans */
@@ -95,10 +97,9 @@ static unsigned int get_mc2_present(void)
 
 static void print_fpga_info(unsigned dev)
 {
-   struct ihs_fpga *fpga = (struct ihs_fpga *) CONFIG_SYS_FPGA_BASE(dev);
-   u16 versions = in_le16(&fpga->versions);
-   u16 fpga_version = in_le16(&fpga->fpga_version);
-   u16 fpga_features = in_le16(&fpga->fpga_features);
+   u16 versions;
+   u16 fpga_version;
+   u16 fpga_features;
unsigned unit_type;
unsigned hardware_version;
unsigned feature_rs232;
@@ -112,6 +113,10 @@ static void print_fpga_info(unsigned dev)
 
printf("FPGA%d: ", dev);
 
+   FPGA_GET_REG(dev, versions, &versions);
+   FPGA_GET_REG(dev, fpga_version, &fpga_version);
+   FPGA_GET_REG(dev, fpga_features, &fpga_features);
+
hardware_version = versions & 0x000f;
 
if (fpga_state
@@ -263,8 +268,9 @@ int checkboard(void)
 
 int last_stage_init(void)
 {
-   struct ihs_fpga *fpga = (struct ihs_fpga *) CONFIG_SYS_FPGA_BASE(0);
-   u16 versions = in_le16(&fpga->versions);
+   u16 versions;
+
+   FPGA_GET_REG(0, versions, &versions);
 
print_fpga_info(0);
if (get_mc2_present())
diff --git a/board/gdsys/405ep/io.c b/board/gdsys/405ep/io.c
index 070dcbb..e77ed1e 100644
--- a/board/gdsys/405ep/io.c
+++ b/board/gdsys/405ep/io.c
@@ -53,6 +53,8 @@ enum {
HWVER_122 = 3,
 };
 
+struct ihs_

[U-Boot] [PATCH v5 3/6] powerpc/ppc4xx: Add fpgad command for dumping gdsys fpga registers

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

Signed-off-by: Dirk Eibach 
---
Changes in v5: None
Changes in v4: None
Changes in v3:
- adapt to "powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA"

Changes in v2:
- move cmd_fpgad to common and fix whitespace issues
- update email account

 common/Makefile|   1 +
 common/cmd_fpgad.c | 100 +
 2 files changed, 101 insertions(+)
 create mode 100644 common/cmd_fpgad.c

diff --git a/common/Makefile b/common/Makefile
index 3ba4316..b1a2093 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -110,6 +110,7 @@ COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
 ifdef CONFIG_FPGA
 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
 endif
+COBJS-$(CONFIG_CMD_FPGAD) += cmd_fpgad.o
 COBJS-$(CONFIG_CMD_FS_GENERIC) += cmd_fs.o
 COBJS-$(CONFIG_CMD_FUSE) += cmd_fuse.o
 COBJS-$(CONFIG_CMD_GETTIME) += cmd_gettime.o
diff --git a/common/cmd_fpgad.c b/common/cmd_fpgad.c
new file mode 100644
index 000..07536ff
--- /dev/null
+++ b/common/cmd_fpgad.c
@@ -0,0 +1,100 @@
+/*
+ * (C) Copyright 2013
+ * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
+ *
+ * based on cmd_mem.c
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+
+#include 
+
+static uintdp_last_fpga;
+static uintdp_last_addr;
+static uintdp_last_length = 0x40;
+
+/*
+ * FPGA Memory Display
+ *
+ * Syntax:
+ * fpgad {fpga} {addr} {len}
+ */
+#define DISP_LINE_LEN  16
+int do_fpga_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   unsigned int k;
+   unsigned int fpga;
+   ulong   addr, length;
+   int rc = 0;
+   u16 linebuf[DISP_LINE_LEN/sizeof(u16)];
+
+   /*
+* We use the last specified parameters, unless new ones are
+* entered.
+*/
+   fpga = dp_last_fpga;
+   addr = dp_last_addr;
+   length = dp_last_length;
+
+   if (argc < 3)
+   return CMD_RET_USAGE;
+
+   if ((flag & CMD_FLAG_REPEAT) == 0) {
+   /*
+* FPGA is specified since argc > 2
+*/
+   fpga = simple_strtoul(argv[1], NULL, 16);
+
+   /*
+* Address is specified since argc > 2
+*/
+   addr = simple_strtoul(argv[2], NULL, 16);
+
+   /*
+* If another parameter, it is the length to display.
+* Length is the number of objects, not number of bytes.
+*/
+   if (argc > 3)
+   length = simple_strtoul(argv[3], NULL, 16);
+   }
+
+   /* Print the lines. */
+   for (k = 0; k < DISP_LINE_LEN / sizeof(u16); ++k)
+   fpga_get_reg(fpga, (u16 *)fpga_ptr[fpga] + k, k * sizeof(u16),
+&linebuf[k]);
+   print_buffer(addr, (void *)linebuf, sizeof(u16),
+length, DISP_LINE_LEN / sizeof(u16));
+   addr += sizeof(u16)*length;
+
+   dp_last_fpga = fpga;
+   dp_last_addr = addr;
+   dp_last_length = length;
+   return rc;
+}
+
+U_BOOT_CMD(
+   fpgad,  4,  1,  do_fpga_md,
+   "fpga register display",
+   "fpga address [# of objects]"
+);
-- 
1.8.3

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


[U-Boot] [PATCH v5 4/6] powerpc/ppc4xx: Support gdsys multichannel iocon hardware

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

Signed-off-by: Dirk Eibach 
---
Changes in v5: None
Changes in v4:
- Move changes ins osd.c to proper commit
- do not use common FPGA register accessors here

Changes in v3:
- adapt to "powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA"
- squashed with powerpc/ppc4xx: Fixup phy erratum on gdsys iocon hardware

Changes in v2:
- fpga_state has been moved to arch_global_data
- include cmd_fpgad in iocon
- use multibus soft-i2c in iocon

 board/gdsys/405ep/iocon.c   | 468 
 board/gdsys/common/Makefile |   2 +-
 board/gdsys/common/osd.c|  20 +-
 include/configs/iocon.h |  58 --
 include/gdsys_fpga.h|  15 +-
 5 files changed, 510 insertions(+), 53 deletions(-)

diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c
index 249d901..fe14f36 100644
--- a/board/gdsys/405ep/iocon.c
+++ b/board/gdsys/405ep/iocon.c
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -31,6 +32,15 @@
 #include 
 
 #include "../common/osd.h"
+#include "../common/mclink.h"
+
+#include 
+#include 
+#include 
+
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define LATCH0_BASE (CONFIG_SYS_LATCH_BASE)
 #define LATCH1_BASE (CONFIG_SYS_LATCH_BASE + 0x100)
@@ -47,11 +57,20 @@ enum {
HWVER_100 = 0,
HWVER_104 = 1,
HWVER_110 = 2,
+   HWVER_120 = 3,
+   HWVER_200 = 4,
+   HWVER_210 = 5,
+};
+
+enum {
+   FPGA_HWVER_200 = 0,
+   FPGA_HWVER_210 = 1,
 };
 
 enum {
COMPRESSION_NONE = 0,
-   COMPRESSION_TYPE1_DELTA,
+   COMPRESSION_TYPE1_DELTA = 1,
+   COMPRESSION_TYPE1_TYPE2_DELTA = 3,
 };
 
 enum {
@@ -67,10 +86,71 @@ enum {
 
 enum {
RAM_DDR2_32 = 0,
+   RAM_DDR3_32 = 1,
+};
+
+enum {
+   MCFPGA_DONE = 1 << 0,
+   MCFPGA_INIT_N = 1 << 1,
+   MCFPGA_PROGRAM_N = 1 << 2,
+   MCFPGA_UPDATE_ENABLE_N = 1 << 3,
+   MCFPGA_RESET_N = 1 << 4,
+};
+
+enum {
+   GPIO_MDC = 1 << 14,
+   GPIO_MDIO = 1 << 15,
 };
 
+unsigned int mclink_fpgacount;
 struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 
+static int setup_88e1518(const char *bus, unsigned char addr);
+static int verify_88e1518(const char *bus, unsigned char addr);
+
+int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
+{
+   int res;
+
+   switch (fpga) {
+   case 0:
+   out_le16(reg, data);
+   break;
+   default:
+   res = mclink_send(fpga - 1, regoff, data);
+   if (res < 0) {
+   printf("mclink_send reg %02lx data %04x returned %d\n",
+  regoff, data, res);
+   return res;
+   }
+   break;
+   }
+
+   return 0;
+}
+
+int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
+{
+   int res;
+
+   switch (fpga) {
+   case 0:
+   *data = in_le16(reg);
+   break;
+   default:
+   if (fpga > mclink_fpgacount)
+   return -EINVAL;
+   res = mclink_receive(fpga - 1, regoff, data);
+   if (res < 0) {
+   printf("mclink_receive reg %02lx returned %d\n",
+  regoff, res);
+   return res;
+   }
+   }
+
+   return 0;
+}
+
 /*
  * Check Board Identity:
  */
@@ -92,7 +172,7 @@ int checkboard(void)
return 0;
 }
 
-static void print_fpga_info(void)
+static void print_fpga_info(unsigned int fpga)
 {
u16 versions;
u16 fpga_version;
@@ -106,13 +186,13 @@ static void print_fpga_info(void)
unsigned feature_ramconfig;
unsigned feature_carriers;
unsigned feature_video_channels;
+   int legacy = get_fpga_state(0) & FPGA_STATE_PLATFORM;
 
FPGA_GET_REG(0, versions, &versions);
FPGA_GET_REG(0, fpga_version, &fpga_version);
FPGA_GET_REG(0, fpga_features, &fpga_features);
 
unit_type = (versions & 0xf000) >> 12;
-   hardware_version = versions & 0x000f;
feature_compression = (fpga_features & 0xe000) >> 13;
feature_osd = fpga_features & (1<<11);
feature_audio = (fpga_features & 0x0600) >> 9;
@@ -121,6 +201,9 @@ static void print_fpga_info(void)
feature_carriers = (fpga_features & 0x000c) >> 2;
feature_video_channels = fpga_features & 0x0003;
 
+   if (legacy)
+   printf("legacy ");
+
switch (unit_type) {
case UNITTYPE_MAIN_USER:
printf("Mainchannel");
@@ -135,27 +218,68 @@ static void print_fpga_info(void)
break;
}
 
-   switch (hardware_version) {
-   case HWVER_100:
-   printf(" HW-Ver 1.00\n");
-   break;
-
-   case HWVER_104:
-   printf(" HW-Ver 1.04\n");
-   break;
-
-   case HWVER_110:
-   printf(" HW-Ver 1.10\n");
-   break;
+   if (unit_type == 

Re: [U-Boot] [PATCH v5 3/8] GPIO: add Dove support to Kirkwood GPIO driver

2013-06-26 Thread Wolfgang Denk
Dear Sascha Silbe,

In message <1372195668-25496-4-git-send-email-t-ub...@infra-silbe.de> you wrote:
> The GPIO support of Dove is very similar to that on Kirkwood (and
> possibly orion5x as well). Instead of duplicating the code, we tweak
> the Kirkwood driver so it works for Dove, too.

This throws a number of checkpatch warnings and errors (line over 80
characters, code indent should use tabs where possible, please, no
spaces at the start of a line). Please fix.

> -/*
> - * Based on (mostly copied from) plat-orion based Linux 2.6 kernel driver.
> - * Removed kernel level irq handling. Took some macros from kernel to
> - * allow build.
> - *
> - * Dieter Kiermaier dk-arm-li...@gmx.de
> - */

Please never, never ever remove existing Copyright information or
information about the origin of the code.  This is a strong NAK.

> index cd1bc00..7e35833 100644
> --- a/arch/arm/include/asm/arch-kirkwood/gpio.h
> +++ b/include/kw_gpio.h
> @@ -1,5 +1,7 @@
>  /*
> - * arch/asm-arm/mach-kirkwood/include/mach/gpio.h
> + * Marvell Dove and Kirkwood SoCs common gpio
> + *
> + * Sebastian Hesselbarth 

Which purpose has the mentioning of this name here?  If this is
supposed to be a copyright claim, it should say so.  

> - * Based on (mostly copied from) plat-orion based Linux 2.6 kernel driver.
> - * Removed kernel level irq handling. Took some macros from kernel to
> - * allow build.
> - *
> - * Dieter Kiermaier dk-arm-li...@gmx.de

Again, this gets dropped.  All these changes look pretty much fishy to
me.

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
People seldom know what they want until you give them what  they  ask
for.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 5/8] SPI: add Dove support to Kirkwood SPI driver

2013-06-26 Thread Wolfgang Denk
Dear Sascha Silbe,

In message <1372195668-25496-6-git-send-email-t-ub...@infra-silbe.de> you wrote:
> The SPI support on Dove is very similar to that on Kirkwood (and
> possibly orion5x as well). Instead of duplicating the code, we tweak
> the Kirkwood driver so it works for Dove, too.
> 
> Signed-off-by: Sascha Silbe 

Not checkpatch clean: 2 errors, 2 warnings.  Please fix.


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
If you're out of tree, you don't exist.
 - David Woodhouse in <1304620350.2398.29.ca...@i7.infradead.org>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 6/8] block: mvsata: add dove include

2013-06-26 Thread Wolfgang Denk
Dear Sascha Silbe,

In message <1372195668-25496-7-git-send-email-t-ub...@infra-silbe.de> you wrote:
> Dove SoC also uses mvsata, therefore add a SoC specific include to
> allow to reuse the mvsata ide driver.
> 
> Signed-off-by: Sascha Silbe 
> Acked-by: Prafulla Wadaskar 
> ---
>  v4->v5: no changes
> 
>  drivers/block/mvsata_ide.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/block/mvsata_ide.c b/drivers/block/mvsata_ide.c
> index 42c177f..500f13c 100644
> --- a/drivers/block/mvsata_ide.c
> +++ b/drivers/block/mvsata_ide.c
> @@ -29,6 +29,8 @@
>  #include 
>  #elif defined(CONFIG_KIRKWOOD)
>  #include 
> +#elif defined(CONFIG_DOVE)
> +#include 

Please keep such lists sorted.  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
Real programmers can write assembly code in any language.   :-)
  - Larry Wall in  <8...@jpl-devvax.jpl.nasa.gov>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Add support for Wandboard Quad

2013-06-26 Thread Stefano Babic
Hi Tapani,

On 26/06/2013 11:51, Tapani wrote:
> 
> Add support for the Quad version of Wandboard; fix compile warning resulting
> from having 2G of memory.
> 
> Signed-off-by: Tapani Utriainen 
> Signed-off-by: Otavio Salvador 
> ---
>  board/wandboard/README  | 5 +
>  board/wandboard/wandboard.c | 2 +-
>  boards.cfg  | 1 +
>  include/configs/wandboard.h | 2 ++
>  4 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/board/wandboard/README b/board/wandboard/README
> index ce83bbe..498db2f 100644
> --- a/board/wandboard/README
> +++ b/board/wandboard/README
> @@ -22,6 +22,11 @@ To build U-Boot for the Wandboard Solo version:
>  $ make wandboard_solo_config
>  $ make
>  
> +To build U-Boot for the Wandboard Quad version:
> +
> +$ make wandboard_quad_config
> +$ make
> +
>  Flashing U-boot into the SD card
>  
>  
> diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
> index 5666cbf..43c02ac 100644
> --- a/board/wandboard/wandboard.c
> +++ b/board/wandboard/wandboard.c
> @@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  int dram_init(void)
>  {
> -   gd->ram_size = CONFIG_DDR_MB * SZ_1M;
> +   gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024;
>  
> return 0;
>  }
> diff --git a/boards.cfg b/boards.cfg
> index fff4f45..2635942 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -272,6 +272,7 @@ nitrogen6q2g arm armv7   
> nitrogen6x  boundar
>  nitrogen6s   arm armv7   nitrogen6x  
> boundary   mx6
> nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
>  nitrogen6s1g arm armv7   nitrogen6x  
> boundary   mx6
> nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024
>  wandboard_dlarm armv7   wandboard   -
>   mx6 
> wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL,DDR_MB=1024
> +wandboard_quad  arm armv7   wandboard   -
>   mx6 
> wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q2g.cfg,MX6Q,DDR_MB=2048
>  wandboard_solo  arm armv7   wandboard   -
>   mx6 
> wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
>  omap3_overo  arm armv7   overo   -   
>omap3
>  omap3_pandoraarm armv7   pandora -   
>omap3
> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> index 5593f1c..b2995d8 100644
> --- a/include/configs/wandboard.h
> +++ b/include/configs/wandboard.h
> @@ -103,6 +103,8 @@
>  
>  #if defined(CONFIG_MX6DL)
>  #define CONFIG_DEFAULT_FDT_FILE"imx6dl-wandboard.dtb"
> +#elif defined(CONFIG_MX6Q)
> +#define CONFIG_DEFAULT_FDT_FILE"imx6q-wandboard.dtb"
>  #elif defined(CONFIG_MX6S)
>  #define CONFIG_DEFAULT_FDT_FILE"imx6s-wandboard.dtb"
>  #endif

Patch does not apply cleanly because your mailer or your editor replaced
original  with whitespaces. I change back again, but please take
care of this issue for the next time.

Apart of that:

Acked-by: Stefano Babic 

This patch was pending for a while, I will push it still for the release.

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 v5 8/8] Boards: Add support for SolidRun CuBox

2013-06-26 Thread Wolfgang Denk
Dear Sascha Silbe,

In message <1372195668-25496-9-git-send-email-t-ub...@infra-silbe.de> you wrote:
> With latest support for Marvell Dove SoC, add the SolidRun CuBox as
> the very first board with that SoC.

Not checkpatch clean: 4 x line over 80 characters; please fix.

>  - dropped MAINTAINERS entry on Sebastian Hesselbarth's request

This makes no sense.  You add a new board, and this must have a
matching entry in the MAINTAINERS file.


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
"Where humor is concerned there are no standards -- no  one  can  say
what is good or bad, although you can be sure that everyone will.
- John Kenneth Galbraith
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 5/6] powerpc/ppc4xx: Consider gdsys FPGA OSD size

2013-06-26 Thread dirk . eibach
From: Dirk Eibach 

OSD size was constant 32x16 characters.
Now the size is set as announced by the FPGA.

Signed-off-by: Dirk Eibach 
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 board/gdsys/common/osd.c | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index 5ddd098..ba8c6e1 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -42,10 +42,6 @@
 
 #define PIXCLK_640_480_60 2518
 
-#define BASE_WIDTH 32
-#define BASE_HEIGHT 16
-#define BUFSIZE (BASE_WIDTH * BASE_HEIGHT)
-
 enum {
CH7301_CM = 0x1c,   /* Clock Mode Register */
CH7301_IC = 0x1d,   /* Input Clock Register */
@@ -67,6 +63,11 @@ enum {
CH7301_DSP = 0x56,  /* DVI Sync polarity Register */
 };
 
+unsigned int base_width;
+unsigned int base_height;
+size_t bufsize;
+u16 *buf;
+
 unsigned int max_osd_screen = CONFIG_SYS_OSD_SCREENS - 1;
 
 #ifdef CONFIG_SYS_CH7301
@@ -280,7 +281,7 @@ static int osd_write_videomem(unsigned screen, unsigned 
offset,
unsigned int k;
 
for (k = 0; k < charcount; ++k) {
-   if (offset + k >= BUFSIZE)
+   if (offset + k >= bufsize)
return -1;
FPGA_SET_REG(screen, videomem[offset + k], data[k]);
}
@@ -299,7 +300,6 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
unsigned len;
u8 color;
unsigned int k;
-   u16 buf[BUFSIZE];
char *text;
int res;
 
@@ -313,12 +313,12 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
color = simple_strtoul(argv[3], NULL, 16);
text = argv[4];
charcount = strlen(text);
-   len = (charcount > BUFSIZE) ? BUFSIZE : charcount;
+   len = (charcount > bufsize) ? bufsize : charcount;
 
for (k = 0; k < len; ++k)
buf[k] = (text[k] << 8) | color;
 
-   res = osd_write_videomem(screen, y * BASE_WIDTH + x, buf, len);
+   res = osd_write_videomem(screen, y * base_width + x, buf, len);
if (res < 0)
return res;
}
@@ -330,8 +330,6 @@ int osd_probe(unsigned screen)
 {
u16 version;
u16 features;
-   unsigned width;
-   unsigned height;
u8 value;
 #ifdef CONFIG_SYS_CH7301
int old_bus = i2c_get_bus_num();
@@ -340,11 +338,15 @@ int osd_probe(unsigned screen)
FPGA_GET_REG(0, osd.version, &version);
FPGA_GET_REG(0, osd.features, &features);
 
-   width = ((features & 0x3f00) >> 8) + 1;
-   height = (features & 0x001f) + 1;
+   base_width = ((features & 0x3f00) >> 8) + 1;
+   base_height = (features & 0x001f) + 1;
+   bufsize = base_width * base_height;
+   buf = malloc(sizeof(u16) * bufsize);
+   if (!buf)
+   return -1;
 
printf("OSD%d:  Digital-OSD version %01d.%02d, %d" "x%d characters\n",
-   screen, version/100, version%100, width, height);
+   screen, version/100, version%100, base_width, base_height);
 
 #ifdef CONFIG_SYS_CH7301
i2c_set_bus_num(ch7301_i2c[screen]);
@@ -410,7 +412,7 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
unsigned x;
unsigned y;
unsigned k;
-   u16 buffer[BASE_WIDTH];
+   u16 buffer[base_width];
char *rp;
u16 *wp = buffer;
unsigned count = (argc > 4) ?
@@ -435,13 +437,13 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 
rp += 4;
wp++;
-   if (wp - buffer > BASE_WIDTH)
+   if (wp - buffer > base_width)
break;
}
 
for (k = 0; k < count; ++k) {
unsigned offset =
-   y * BASE_WIDTH + x + k * (wp - buffer);
+   y * base_width + x + k * (wp - buffer);
osd_write_videomem(screen, offset, buffer,
wp - buffer);
}
-- 
1.8.3

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


Re: [U-Boot] U-Boot Digest, Vol 61, Issue 36

2013-06-26 Thread Wolfgang Denk
Dear krishna dwivedi,

please read the following articles.  Please really, really do:
http://catb.org/esr/faqs/smart-questions.html#bespecific
http://www.netmeister.org/news/learn2quote.html

I asked you before NOT to hi-jack existing mail threads, to chose a
descriptive Subject: and NOT to quote tons of unretated stuff, yet you
do it again.   Please STOP doing this!!

In message  
you wrote:
>
> I am trying to build U-boot:2013-04.But running into this error:
> mips64-nlm-elf-ld: arch/mips/cpu/mips64/start.o: relocation (null) against
> `board_init_f' can not be used when making a shared object; recompile with
> -fPIC
> arch/mips/cpu/mips64/start.o: could not read symbols: Bad value.

You fail to mention which board configuration you are trying to build.

> > Today's Topics:
> >
> >1. Re: [PATCH v2 6/7] ARM: extend non-secure switch to also go
> >   into HYP mode (Andre Przywara)
> >2. Re: dfu: using dfu-util -l shows different output
> >   (Lukasz Majewski)
> >3. Re: dfu: using dfu-util -l shows different output (Heiko Schocher)
> >4. Re: [PATCH] OpenRD: relocate environment to 640kB (Sascha Silbe)

This is totally unrelated, do NOT quote such stuff!

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
We are Microsoft. Unix is irrelevant. Openness is futile.  Prepare to
be assimilated.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spi: mxc_spi: Update pre and post divider algorithm

2013-06-26 Thread Stefano Babic
On 11/05/2013 07:25, Dirk Behme wrote:
> The spi clock divisor is of the form x * (2**y),  or  x  << y, where x is
> 1 to 16, and y is 0 to 15. Note the similarity with floating point numbers.
> Convert the desired divisor to the smallest number which is >= desired 
> divisor,
> and can be represented in this form. The previous algorithm chose a divisor
> which could be almost twice as large as needed.
> 
> Signed-off-by: Troy Kisky 
> Signed-off-by: Dirk Behme 
> ---

Applied to u-boot-imx as a fix, thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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] dwc_ahsata: Allow use with dcache enabled

2013-06-26 Thread Stefano Babic
On 16/06/2013 01:09, Eric Nelson wrote:
> Signed-off-by: Eric Nelson 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 V2] ARM: mxs: Consolidate configuration options

2013-06-26 Thread Stefano Babic
Hi Marek,

On 16/06/2013 15:39, Marek Vasut wrote:
> Pull all the duplicate configuration options into configs/mxs.h
> from the board configuration files. This reduces the files greatly
> and makes them somewhat more readable. Besides, we do no longer
> have such a horrible duplication of code.
> 
> Note that the mx23evk grew in size slightly. This is due to the
> CONFIG_SYS_CBSIZE now being set to 1024 as it is on the rest of
> MXS systems.
> 
> This patch also fixes the OCRAM size for i.MX23. The i.MX23 has
> only 32kB of OCRAM, while i.MX28 has 128kB of OCRAM.
> 
> I verified the configuration didn't change for each of the boards,
> but I didn't boot-test it on the boards I do not have. I configured
> U-Boot for each board using the "make ... _config" command
> and then ran "cpp -I include -dM include/config.h" , which dumped
> all the configuration options. I did this both before and after this
> patch and finally compared the results for each MXS board. Actually,
> the results do differ slightly, since the configs/mxs.h file now
> properly includes the correct iomux-mx23.h or iomux-mx28.h , so
> while comparing, I had to ignore these new defines. These have no
> impact on U-Boot configuration though.
> 
> Signed-off-by: Marek Vasut 
> Cc: Fabio Estevam 
> Cc: Lauri Hintsala 
> Cc: Otavio Salvador 
> Cc: Stefano Babic 
> ---

This is a nice cleanup, but as we probably cannot test all boards before
release, I apply it to u-boot-imx, next branch.

Regards,
Stefano


-- 
=
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] dfu:ext4:fix Fix ext4{read|write} command formatting

2013-06-26 Thread Lukasz Majewski
Hi Tom,

> In the following commit:
> "dfu: Support larger than memory transfers."
> SHA1: ea2453d56b8860dbd18a3c517531ffc8dcb5c839
> 
> The ext4{read|write} command formatting has been changed. It removed
> a mandatory [sizebytes] parameter.
> 
> It prevented from ext4 update via dfu. This commit restored the
> previous behaviour.

Tom, please drop this patch, since it only fixes DFU eMMC write.

Unfortunately after dfu.c code changes to support NAND and arbitrary
files transmission, the eMMC ext4 read needs to be fixed.

I will prepare one patch set, which fixes read and write.

-- 
Best regards,

Lukasz Majewski

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


Re: [U-Boot] U-Boot Digest, Vol 61, Issue 36

2013-06-26 Thread Daniel Schwierzeck
2013/6/26 krishna dwivedi :
> Hi All,
>
> Hope everyone is doing great:)
>
> I am trying to build U-boot:2013-04.But running into this error:
> mips64-nlm-elf-ld: arch/mips/cpu/mips64/start.o: relocation (null) against
> `board_init_f' can not be used when making a shared object; recompile with
> -fPIC
> arch/mips/cpu/mips64/start.o: could not read symbols: Bad value.
>
>
> Initially,In file arch/mips/config.mk,I commented the flag:
> #LDFLAGS_FINAL   +=  -pie
> This error resolved.But after relocation of u-boot code,we need this
> flag.So i need to uncomment this flag.and again i am running into this
> error agian.
>
> Anyone faced this issue earlier.Anyone please provide pointers to resolve
> this.
>

try other toolchains!

Searching for mips64-nlm-elf reveals some mailing threads where other
users complaining about linker errors.
Also the gcc and binutils of that toolchain are rather old.

The reference toolchain for U-Boot is ELDK-5.3 [1] which has been
extensively tested with PIE
and automatic relocation.

[1] http://www.denx.de/wiki/ELDK-5

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


Re: [U-Boot] [PATCH v3 2/2] imx: Add support for the SabreSD shipped with i.MX6DL

2013-06-26 Thread Stefano Babic
On 14/06/2013 17:13, Fabio Estevam wrote:
> On Tue, Jun 4, 2013 at 4:00 AM, Pierre Aubert  wrote:
>> The SabreSD platform is available with i.MX6Q or i.MX6DL. This patch adds the
>> support of the i.MX6DL. The config file and the board directory are renamed
>> to remove the reference to the MX6Q.
>>
>>
>> Signed-off-by: Pierre Aubert 
>> CC: Stefano Babic 
> 
> Reviewed-by: Fabio Estevam 
> 

Applied to u-boot-imx (both patches), thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 v2] mx27: add function enable_caches

2013-06-26 Thread Stefano Babic
On 14/06/2013 18:21, Philippe Reynes wrote:
> Signed-off-by: Philippe Reynes 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 RESEND] mx27: add i2c clock

2013-06-26 Thread Stefano Babic
On 14/06/2013 18:21, Philippe Reynes wrote:
> Signed-off-by: Eric Jarrige 
> Signed-off-by: Philippe Reynes 
> ---


Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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] dfu:ext4:fix Fix ext4{read|write} command formatting

2013-06-26 Thread Tom Rini
On Wed, Jun 26, 2013 at 04:41:28PM +0200, Lukasz Majewski wrote:
> Hi Tom,
> 
> > In the following commit:
> > "dfu: Support larger than memory transfers."
> > SHA1: ea2453d56b8860dbd18a3c517531ffc8dcb5c839
> > 
> > The ext4{read|write} command formatting has been changed. It removed
> > a mandatory [sizebytes] parameter.
> > 
> > It prevented from ext4 update via dfu. This commit restored the
> > previous behaviour.
> 
> Tom, please drop this patch, since it only fixes DFU eMMC write.
> 
> Unfortunately after dfu.c code changes to support NAND and arbitrary
> files transmission, the eMMC ext4 read needs to be fixed.
> 
> I will prepare one patch set, which fixes read and write.

Ouch, sorry.  I thought I had tested those cases still.

-- 
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 v2 0/4] imx: nitrogen6x: Config changes

2013-06-26 Thread Stefano Babic
On 06/06/2013 19:39, Robert Winkler wrote:
> These are just some config changes for nitrogen6x.
> 
> 
> RAW_INITRD, BOOTZ, FS_GENERIC are being used by this project
> http://www.eewiki.net/display/linuxonarm/i.MX6x+SABRE+Lite
> 
> DCACHE can finally be enabled because some related bugs have
> been fixed.
> 
> Robert Winkler (4):
>   imx: nitrogen6x: Enabled data cache
>   imx: nitrogen6x: Enable bootz
>   imx: nitrogen6x: Enable raw initrd
>   imx: nitrogen6x: Enable filesystem generic commands
> 
>  include/configs/nitrogen6x.h | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

Patches applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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] dfu:ext4:fix Fix ext4{read|write} command formatting

2013-06-26 Thread Lukasz Majewski
On Wed, 26 Jun 2013 11:05:31 -0400, Tom Rini wrote:

> On Wed, Jun 26, 2013 at 04:41:28PM +0200, Lukasz Majewski wrote:
> > Hi Tom,
> > 
> > > In the following commit:
> > > "dfu: Support larger than memory transfers."
> > > SHA1: ea2453d56b8860dbd18a3c517531ffc8dcb5c839
> > > 
> > > The ext4{read|write} command formatting has been changed. It
> > > removed a mandatory [sizebytes] parameter.
> > > 
> > > It prevented from ext4 update via dfu. This commit restored the
> > > previous behaviour.
> > 
> > Tom, please drop this patch, since it only fixes DFU eMMC write.
> > 
> > Unfortunately after dfu.c code changes to support NAND and arbitrary
> > files transmission, the eMMC ext4 read needs to be fixed.
> > 
> > I will prepare one patch set, which fixes read and write.
> 
> Ouch, sorry.  I thought I had tested those cases still.
> 

With RAW_ADDR from very beginning, we can read chunk by chunk when
proper request from DFU arrives. 

With e.g. DFU_FS_EXT4 we first need to read all data from file system
to a buffer (dfu_buf) and then give it to DFU gadget piece by piece.

I will fix this and share patches.

-- 
Best regards,

Lukasz Majewski

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


Re: [U-Boot] [PATCH 4/6] README: mxs: Introduce README.mxs

2013-06-26 Thread Stefano Babic
On 03/05/2013 20:08, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Create a README.mxs file that contains instructions on how to use U-boot for
> both MX23 and MX28.
> 
> As boot from NAND has only been tested on mx28, make it clear that it only 
> applies to MX28.
> 
> While at it, do some small cleanups for the sake of consistency:
> - Use "MX28" instead of "i.MX28"
> - Use "section" instead of "chapter" when referring to specific parts of the
> reference manual chapters.
> 
> Signed-off-by: Fabio Estevam 
> ---
Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 3/6] README: mx28_common: Fix structure of sentence

2013-06-26 Thread Stefano Babic
On 03/05/2013 20:07, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Re-structure the sentence a bit so that it can clearer.
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 2/6] README: mx28_common: Do not hardcode the SSP port

2013-06-26 Thread Stefano Babic
On 03/05/2013 20:07, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> MX28 can boot from SSP0 or SSP1, so it is better not to hardcode the SSP port
> in the instructions.
> 
> Signed-off-by: Fabio Estevam 
> ---
Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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/6] README: mx28_common: Keep the text within 80 columns

2013-06-26 Thread Stefano Babic
On 03/05/2013 20:07, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> In order to improve readability keep the text within 80 columns.
> 
> Signed-off-by: Fabio Estevam 
> ---


Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 5/6] mx28evk: Move README file inside board directory

2013-06-26 Thread Otavio Salvador
On Wed, Jun 26, 2013 at 12:43 PM, Stefano Babic  wrote:
> On 03/05/2013 20:08, Fabio Estevam wrote:
>> From: Fabio Estevam 
>>
>> Board specific READMEs should be located inside the respective board 
>> directory.
>>
>> Signed-off-by: Fabio Estevam 
>> ---
>>  .../freescale/mx28evk/README   |0
>>  1 file changed, 0 insertions(+), 0 deletions(-)
>>  rename doc/README.mx28evk => board/freescale/mx28evk/README (100%)
>>
>> diff --git a/doc/README.mx28evk b/board/freescale/mx28evk/README
>> similarity index 100%
>> rename from doc/README.mx28evk
>> rename to board/freescale/mx28evk/README
>>
>
> Strange, I cannot find this patch in patchworks..anyway
>
> Applied to u-boot-imx, thanks.

This is because it was  a rename so patchwork does not track it. It is a bug ...

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] m28evk: Move README file inside board directory

2013-06-26 Thread Stefano Babic
On 03/05/2013 20:08, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Board specific READMEs should be located inside the respective board 
> directory.
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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


[U-Boot] [PATCH v2] Fix ext2/ext4 filesystem accesses beyond 2TiB

2013-06-26 Thread Frédéric Leroy
With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
which is required to represent block numbers for storage devices that
exceed 2TiB (the block size usually is 512B), e.g. recent hard drives

We now use lbaint_t for partition offset to reflect the lbaint_t change,
and access partitions beyond or crossing the 2.1TiB limit.
This required changes to signature of ext4fs_devread(), and type of all
variables relatives to block sector.

ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
block is a multiple of device block sector. To avoid overflow problem
when calling ext4fs_devread(), we need to cast the sector parameter.

Signed-off-by: Frédéric Leroy 
---

Changes in v2 :
- Fix warning in disk/part_efi.c by Sascha Silbe
- Fix lines over 80 characters
- Move LBAFu to LBAFU to avoid camel case

 common/cmd_disk.c  |  3 ++-
 disk/part_efi.c|  6 +++---
 disk/part_iso.c|  4 ++--
 fs/ext4/dev.c  |  9 +
 fs/ext4/ext4_common.c  | 48 +++-
 fs/ext4/ext4_journal.c | 19 ---
 fs/ext4/ext4_write.c   | 50 +-
 fs/ext4/ext4fs.c   | 14 +++---
 include/ext4fs.h   |  2 +-
 include/ext_common.h   |  2 +-
 include/ide.h  |  2 ++
 include/part.h |  4 ++--
 12 files changed, 93 insertions(+), 70 deletions(-)

diff --git a/common/cmd_disk.c b/common/cmd_disk.c
index ee4e215..8c4d0bd 100644
--- a/common/cmd_disk.c
+++ b/common/cmd_disk.c
@@ -67,7 +67,8 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int 
argc,
   "Name: %.32s  Type: %.32s\n", intf, dev, part, info.name,
   info.type);
 
-   debug("First Block: %ld,  # of blocks: %ld, Block Size: %ld\n",
+   debug("First Block: " LBAFU ",  # of blocks: " LBAFU
+ ", Block Size: %ld\n",
  info.start, info.size, info.blksz);
 
if (dev_desc->block_read(dev, info.start, 1, (ulong *) addr) != 1) {
diff --git a/disk/part_efi.c b/disk/part_efi.c
index fb5e9f0..732bdb5 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -200,8 +200,8 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
uuid_string(gpt_pte[part - 1].unique_partition_guid.b, info->uuid);
 #endif
 
-   debug("%s: start 0x%lX, size 0x%lX, name %s", __func__,
-   info->start, info->size, info->name);
+   debug("%s: start 0x" LBAF ", size 0x" LBAF ", name %s", __func__,
+ info->start, info->size, info->name);
 
/* Remember to free pte */
free(gpt_pte);
@@ -431,7 +431,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
gpt_e[i].partition_name[k] =
(efi_char16_t)(partitions[i].name[k]);
 
-   debug("%s: name: %s offset[%d]: 0x%x size[%d]: 0x%lx\n",
+   debug("%s: name: %s offset[%d]: 0x%x size[%d]: 0x" LBAF "\n",
  __func__, partitions[i].name, i,
  offset, i, partitions[i].size);
}
diff --git a/disk/part_iso.c b/disk/part_iso.c
index cc323b0..a050c44 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -249,8 +249,8 @@ void print_part_iso(block_dev_desc_t * dev_desc)
printf("Part   Start Sect x Size Type\n");
i=0;
do {
-   printf (" %2d %8ld %8ld %6ld %.32s\n",
-   i, info.start, info.size, info.blksz, info.type);
+   printf(" %2d " LBAFU " " LBAFU " %6ld %.32s\n",
+  i, info.start, info.size, info.blksz, info.type);
i++;
} while (get_partition_info_iso_verb(dev_desc,i,&info,0)!=-1);
 }
diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index 81b7633..2cd182c 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -42,7 +42,7 @@
 #include 
 #include "ext4_common.h"
 
-unsigned long part_offset;
+lbaint_t part_offset;
 
 static block_dev_desc_t *ext4fs_block_dev_desc;
 static disk_partition_t *part_info;
@@ -58,7 +58,7 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, 
disk_partition_t *info)
get_fs()->dev_desc->log2blksz;
 }
 
-int ext4fs_devread(int sector, int byte_offset, int byte_len, char *buf)
+int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
 {
unsigned block_len;
int log2blksz = ext4fs_block_dev_desc->log2blksz;
@@ -74,7 +74,8 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, 
char *buf)
if ((sector < 0) ||
((sector + ((byte_offset + byte_len - 1) >> log2blksz))
 >= part_info->size)) {
-   printf("%s read outside partition %d\n", __func__, sector);
+   printf("%s read outside partition " LBAFU "\n", __func__,
+  sector);
return 0;
}
 
@@ -82,7 +83,7 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, 
char *buf)
sector +=

Re: [U-Boot] [PATCH 5/6] mx28evk: Move README file inside board directory

2013-06-26 Thread Stefano Babic
On 03/05/2013 20:08, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Board specific READMEs should be located inside the respective board 
> directory.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  .../freescale/mx28evk/README   |0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  rename doc/README.mx28evk => board/freescale/mx28evk/README (100%)
> 
> diff --git a/doc/README.mx28evk b/board/freescale/mx28evk/README
> similarity index 100%
> rename from doc/README.mx28evk
> rename to board/freescale/mx28evk/README
> 

Strange, I cannot find this patch in patchworks..anyway

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 06/10 v5] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import

2013-06-26 Thread Scott Wood

On 06/25/2013 09:29:37 PM, Zhang Ying-B40530 wrote:



-Original Message-
From: Wolfgang Denk [mailto:w...@denx.de]
Sent: Friday, June 21, 2013 1:38 PM
To: Zhang Ying-B40530
Cc: u-boot@lists.denx.de; Wood Scott-B07421; aflem...@gmail.com; Xie  
Xiaobo-R63061; Zhang Ying-B40530
Subject: Re: [U-Boot] [PATCH 06/10 v5] spl: env_common.c: make  
CONFIG_SPL_BUILD contain function env_import


Dear ying.zh...@freescale.com,

In message  
<1371715468-21120-6-git-send-email-ying.zh...@freescale.com> you  
wrote:

>
> The functionality env_import will be used in the SPL. They
> had been excluded by ifndef CONFIG_SPL_BUILD. Now, put it
> into the SPL.
>
> Signed-off-by: Ying Zhang 
> ---
> Compared with the original version, Changed as below:
> 1. Split from "boot from SD card/SPI flash with SPL".
> 2. Split from "spl: Make CONFIG_SPL_BUILD contain more  
functionality"

> 3. No change.
> 4. No change.
>
>  common/env_common.c |2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)

This affects all boards, all architectures?  How well has this been
tested?
[Zhang Ying]
May I suggest we define a new symbol CONFIG_SPL_ENV_IMPORT to contain
the functionality "env_import"?
So, "#ifndef CONFIG_SPL_BUILD"  will be changed to
"#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_ENV_IMPORT)"


Can we figure out if the ifdef is really needed first?

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


Re: [U-Boot] [PATCH v3] Add support for Wandboard Quad

2013-06-26 Thread Otavio Salvador
On Wed, Jun 26, 2013 at 11:14 AM, Stefano Babic  wrote:
> Patch does not apply cleanly because your mailer or your editor replaced
> original  with whitespaces. I change back again, but please take
> care of this issue for the next time.

Tapani, the easiest way of sending the patches is using git send-email
command. This avoid this problems with the e-mail client.

> Apart of that:
>
> Acked-by: Stefano Babic 
>
> This patch was pending for a while, I will push it still for the release.

Thanks Stefano.

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] vf610twr: Remove SoC name from U-Boot prompt

2013-06-26 Thread Otavio Salvador
We've been dropping SoC name from U-Boot prompt as it increase
complexity for automatic testing and makes line longer for no good
reason.

Signed-off-by: Otavio Salvador 
---
 include/configs/vf610twr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index bda5ddf..f45d73c 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -147,7 +147,7 @@
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
-#define CONFIG_SYS_PROMPT  "Vybrid U-Boot > "
+#define CONFIG_SYS_PROMPT  "=> "
 #undef CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
 #define CONFIG_SYS_PBSIZE  \
-- 
1.8.3.1

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


[U-Boot] [PATCH 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Otavio Salvador
Signed-off-by: Otavio Salvador 
---
 include/configs/vf610twr.h | 58 ++
 1 file changed, 58 insertions(+)

diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 77fe893..bda5ddf 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -85,6 +85,64 @@
 
 #define CONFIG_SYS_TEXT_BASE   0x3f008000
 
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "script=boot.scr\0" \
+   "uimage=uImage\0" \
+   "console=ttymxc0\0" \
+   "initrd_high=0x\0" \
+   "ip_dyn=yes\0" \
+   "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+   "mmcpart=1\0" \
+   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
+   "update_sd_firmware_filename=u-boot.imx\0" \
+   "update_sd_firmware=" \
+   "if test ${ip_dyn} = yes; then " \
+   "setenv get_cmd dhcp; " \
+   "else " \
+   "setenv get_cmd tftp; " \
+   "fi; " \
+   "if mmc dev ${mmcdev}; then "   \
+   "if ${get_cmd} ${update_sd_firmware_filename}; then " \
+   "setexpr fw_sz ${filesize} / 0x200; " \
+   "setexpr fw_sz ${fw_sz} + 1; "  \
+   "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+   "fi; "  \
+   "fi\0" \
+   "mmcargs=setenv bootargs console=${console},${baudrate} " \
+   "root=${mmcroot}\0" \
+   "loadbootscript=" \
+   "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+   "bootscript=echo Running bootscript from mmc ...; " \
+   "source\0" \
+   "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+   "mmcboot=echo Booting from mmc ...; " \
+   "run mmcargs; " \
+   "bootm\0" \
+   "netargs=setenv bootargs console=${console},${baudrate} " \
+   "root=/dev/nfs " \
+   "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+   "netboot=echo Booting from net ...; " \
+   "run netargs; " \
+   "if test ${ip_dyn} = yes; then " \
+   "setenv get_cmd dhcp; " \
+   "else " \
+   "setenv get_cmd tftp; " \
+   "fi; " \
+   "${get_cmd} ${uimage}; " \
+   "bootm\0"
+
+#define CONFIG_BOOTCOMMAND \
+  "mmc dev ${mmcdev}; if mmc rescan; then " \
+  "if run loadbootscript; then " \
+  "run bootscript; " \
+  "else " \
+  "if run loaduimage; then " \
+  "run mmcboot; " \
+  "else run netboot; " \
+  "fi; " \
+  "fi; " \
+  "else run netboot; fi"
+
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
-- 
1.8.3.1

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


[U-Boot] [PATCH] MAINTAINERS: Add an entry to the mx6q wandboard variant

2013-06-26 Thread Fabio Estevam
Signed-off-by: Fabio Estevam 
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e753e03..001b42d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -664,7 +664,7 @@ Fabio Estevam 
mx53smd i.MX53
mx6sabresd  i.MX6Q/DL
mx6qsabreauto   i.MX6Q
-   wandboard   i.MX6DL/S
+   wandboard   i.MX6DL/S/Q
mx6slevki.MX6SL
 
 Daniel Gorsulowski 
-- 
1.8.1.2


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


Re: [U-Boot] [PATCH 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Fabio Estevam
On Wed, Jun 26, 2013 at 1:40 PM, Otavio Salvador
 wrote:
> Signed-off-by: Otavio Salvador 
> ---
>  include/configs/vf610twr.h | 58 
> ++
>  1 file changed, 58 insertions(+)
>
> diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
> index 77fe893..bda5ddf 100644
> --- a/include/configs/vf610twr.h
> +++ b/include/configs/vf610twr.h
> @@ -85,6 +85,64 @@
>
>  #define CONFIG_SYS_TEXT_BASE   0x3f008000
>
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> +   "script=boot.scr\0" \
> +   "uimage=uImage\0" \
> +   "console=ttymxc0\0" \

Vybrid does not use ttymxc0.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MAINTAINERS: Add an entry to the mx6q wandboard variant

2013-06-26 Thread Otavio Salvador
On Wed, Jun 26, 2013 at 1:53 PM, Fabio Estevam
 wrote:
> Signed-off-by: Fabio Estevam 

Acked-by: Otavio Salvador 

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Otavio Salvador
On Wed, Jun 26, 2013 at 1:59 PM, Fabio Estevam  wrote:
> On Wed, Jun 26, 2013 at 1:40 PM, Otavio Salvador
>  wrote:
>> Signed-off-by: Otavio Salvador 
>> ---
>>  include/configs/vf610twr.h | 58 
>> ++
>>  1 file changed, 58 insertions(+)
>>
>> diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
>> index 77fe893..bda5ddf 100644
>> --- a/include/configs/vf610twr.h
>> +++ b/include/configs/vf610twr.h
>> @@ -85,6 +85,64 @@
>>
>>  #define CONFIG_SYS_TEXT_BASE   0x3f008000
>>
>> +#define CONFIG_EXTRA_ENV_SETTINGS \
>> +   "script=boot.scr\0" \
>> +   "uimage=uImage\0" \
>> +   "console=ttymxc0\0" \
>
> Vybrid does not use ttymxc0.

Andy can you confirm which one we should use here?

It should be /dev/ttymxc1 right?

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Otavio Salvador
Signed-off-by: Otavio Salvador 
---
Changes in v2:
- fix console for ttymxc1 (Fabio)

 include/configs/vf610twr.h | 58 ++
 1 file changed, 58 insertions(+)

diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 77fe893..a944984 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -85,6 +85,64 @@
 
 #define CONFIG_SYS_TEXT_BASE   0x3f008000
 
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "script=boot.scr\0" \
+   "uimage=uImage\0" \
+   "console=ttymxc1\0" \
+   "initrd_high=0x\0" \
+   "ip_dyn=yes\0" \
+   "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+   "mmcpart=1\0" \
+   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
+   "update_sd_firmware_filename=u-boot.imx\0" \
+   "update_sd_firmware=" \
+   "if test ${ip_dyn} = yes; then " \
+   "setenv get_cmd dhcp; " \
+   "else " \
+   "setenv get_cmd tftp; " \
+   "fi; " \
+   "if mmc dev ${mmcdev}; then "   \
+   "if ${get_cmd} ${update_sd_firmware_filename}; then " \
+   "setexpr fw_sz ${filesize} / 0x200; " \
+   "setexpr fw_sz ${fw_sz} + 1; "  \
+   "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+   "fi; "  \
+   "fi\0" \
+   "mmcargs=setenv bootargs console=${console},${baudrate} " \
+   "root=${mmcroot}\0" \
+   "loadbootscript=" \
+   "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+   "bootscript=echo Running bootscript from mmc ...; " \
+   "source\0" \
+   "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+   "mmcboot=echo Booting from mmc ...; " \
+   "run mmcargs; " \
+   "bootm\0" \
+   "netargs=setenv bootargs console=${console},${baudrate} " \
+   "root=/dev/nfs " \
+   "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+   "netboot=echo Booting from net ...; " \
+   "run netargs; " \
+   "if test ${ip_dyn} = yes; then " \
+   "setenv get_cmd dhcp; " \
+   "else " \
+   "setenv get_cmd tftp; " \
+   "fi; " \
+   "${get_cmd} ${uimage}; " \
+   "bootm\0"
+
+#define CONFIG_BOOTCOMMAND \
+  "mmc dev ${mmcdev}; if mmc rescan; then " \
+  "if run loadbootscript; then " \
+  "run bootscript; " \
+  "else " \
+  "if run loaduimage; then " \
+  "run mmcboot; " \
+  "else run netboot; " \
+  "fi; " \
+  "fi; " \
+  "else run netboot; fi"
+
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
-- 
1.8.3.1

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


[U-Boot] [PATCH v2 2/2] vf610twr: Remove SoC name from U-Boot prompt

2013-06-26 Thread Otavio Salvador
We've been dropping SoC name from U-Boot prompt as it increase
complexity for automatic testing and makes line longer for no good
reason.

Signed-off-by: Otavio Salvador 
---
Changes in v2: None

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

diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index a944984..bb1ccd6 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -147,7 +147,7 @@
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
-#define CONFIG_SYS_PROMPT  "Vybrid U-Boot > "
+#define CONFIG_SYS_PROMPT  "=> "
 #undef CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
 #define CONFIG_SYS_PBSIZE  \
-- 
1.8.3.1

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


Re: [U-Boot] [PATCH 2/2] vf610twr: Remove SoC name from U-Boot prompt

2013-06-26 Thread Andy Voltz
I'm going to boot test these patches on the tower. I'll follow-up after I
verify with a new environment & build.


On Wed, Jun 26, 2013 at 12:40:51PM -0400, Otavio Salvador wrote:
> We've been dropping SoC name from U-Boot prompt as it increase
> complexity for automatic testing and makes line longer for no good
> reason.
> 
> Signed-off-by: Otavio Salvador 
> ---
>  include/configs/vf610twr.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
> index bda5ddf..f45d73c 100644
> --- a/include/configs/vf610twr.h
> +++ b/include/configs/vf610twr.h
> @@ -147,7 +147,7 @@
>  #define CONFIG_SYS_LONGHELP  /* undef to save memory */
>  #define CONFIG_SYS_HUSH_PARSER   /* use "hush" command parser */
>  #define CONFIG_SYS_PROMPT_HUSH_PS2   "> "
> -#define CONFIG_SYS_PROMPT"Vybrid U-Boot > "
> +#define CONFIG_SYS_PROMPT"=> "
>  #undef CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE256 /* Console I/O Buffer Size */
>  #define CONFIG_SYS_PBSIZE\
> -- 
> 1.8.3.1
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] [PATCH v2 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Fabio Estevam
On Wed, Jun 26, 2013 at 2:12 PM, Otavio Salvador
 wrote:

> +   "console=ttymxc1\0" \

Vybrid does not use the same serial driver as i.MX.

In the kernel the serial driver is this one:
https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/tree/drivers/tty/serial/fsl_lpuart.c?h=tty-next

,and the driver name is "ttyLP".

Vybrid starts numbering the UART ports from 0, so the device number in
Linux matches the hardware port number.

This means that the correct is "console=ttyLP1" for this board to boot
a mainline kernel.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Otavio Salvador
On Wed, Jun 26, 2013 at 2:16 PM, Fabio Estevam  wrote:
> On Wed, Jun 26, 2013 at 2:12 PM, Otavio Salvador
>  wrote:
>
>> +   "console=ttymxc1\0" \
>
> Vybrid does not use the same serial driver as i.MX.
>
> In the kernel the serial driver is this one:
> https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/tree/drivers/tty/serial/fsl_lpuart.c?h=tty-next
>
> ,and the driver name is "ttyLP".
>
> Vybrid starts numbering the UART ports from 0, so the device number in
> Linux matches the hardware port number.
>
> This means that the correct is "console=ttyLP1" for this board to boot
> a mainline kernel.

This is being done using Timesys kernel as reference; so I did used
his kernel as reference.

This is the kernel which has been send for inclusion in Yocto BSP so I
think I will stay with it for now.

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Fabio Estevam
On Wed, Jun 26, 2013 at 2:19 PM, Otavio Salvador
 wrote:

> This is being done using Timesys kernel as reference; so I did used
> his kernel as reference.

So it is better to fix the tty driver name in the Timesys kernel to
ttyLP then, instead of adding a console option that is incorrect.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Otavio Salvador
On Wed, Jun 26, 2013 at 2:27 PM, Fabio Estevam  wrote:
> On Wed, Jun 26, 2013 at 2:19 PM, Otavio Salvador
>  wrote:
>
>> This is being done using Timesys kernel as reference; so I did used
>> his kernel as reference.
>
> So it is better to fix the tty driver name in the Timesys kernel to
> ttyLP then, instead of adding a console option that is incorrect.

Yes; I think I agree. Mostly like we did for mxs in Freescale kernel.
Andy, can you check it?

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 06/10 v5] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import

2013-06-26 Thread Tom Rini
On Wed, Jun 26, 2013 at 11:12:01AM -0500, Scott Wood wrote:
> On 06/25/2013 09:29:37 PM, Zhang Ying-B40530 wrote:
> >
> >
> >-Original Message-
> >From: Wolfgang Denk [mailto:w...@denx.de]
> >Sent: Friday, June 21, 2013 1:38 PM
> >To: Zhang Ying-B40530
> >Cc: u-boot@lists.denx.de; Wood Scott-B07421; aflem...@gmail.com;
> >Xie Xiaobo-R63061; Zhang Ying-B40530
> >Subject: Re: [U-Boot] [PATCH 06/10 v5] spl: env_common.c: make
> >CONFIG_SPL_BUILD contain function env_import
> >
> >Dear ying.zh...@freescale.com,
> >
> >In message
> ><1371715468-21120-6-git-send-email-ying.zh...@freescale.com> you
> >wrote:
> >>
> >> The functionality env_import will be used in the SPL. They
> >> had been excluded by ifndef CONFIG_SPL_BUILD. Now, put it
> >> into the SPL.
> >>
> >> Signed-off-by: Ying Zhang 
> >> ---
> >> Compared with the original version, Changed as below:
> >> 1. Split from "boot from SD card/SPI flash with SPL".
> >> 2. Split from "spl: Make CONFIG_SPL_BUILD contain more
> >functionality"
> >> 3. No change.
> >> 4. No change.
> >>
> >>  common/env_common.c |2 --
> >>  1 files changed, 0 insertions(+), 2 deletions(-)
> >
> >This affects all boards, all architectures?  How well has this been
> >tested?
> >[Zhang Ying]
> >May I suggest we define a new symbol CONFIG_SPL_ENV_IMPORT to contain
> >the functionality "env_import"?
> >So, "#ifndef CONFIG_SPL_BUILD"  will be changed to
> >"#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_ENV_IMPORT)"
> 
> Can we figure out if the ifdef is really needed first?

Building for am335x_evm and am335x_evm_usbspl should tell you if it is,
or is not.  Whacking network support into SPL required more than
--gc-sections alone could give us and we needed to drop a few
couldn't-ever-reach calls and functionality out.

-- 
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 v3 2/2] vf610twr: Remove SoC name from U-Boot prompt

2013-06-26 Thread Otavio Salvador
We've been dropping SoC name from U-Boot prompt as it increase
complexity for automatic testing and makes line longer for no good
reason.

Signed-off-by: Otavio Salvador 
---
Changes in v3: None
Changes in v2: None

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

diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 94c69a6..6848b3f 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -177,7 +177,7 @@
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
-#define CONFIG_SYS_PROMPT  "Vybrid U-Boot > "
+#define CONFIG_SYS_PROMPT  "=> "
 #undef CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
 #define CONFIG_SYS_PBSIZE  \
-- 
1.8.3.1

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


[U-Boot] [PATCH v3 1/2] vf610twr: Add default environment in line with other Freescale boards

2013-06-26 Thread Otavio Salvador
This adds a default environment which should be able to support both
3.0.15 from Timesys and upcoming 3.11.

Signed-off-by: Otavio Salvador 
---
Changes in v3:
- add dt boot support
- use ttyLP1 as console
- change loadaddr and sys text as iMX6SL
- NOTE: It needs to be boot tested as I don't have the board

Changes in v2:
- fix console for ttymxc1 (Fabio)

 include/configs/vf610twr.h | 93 --
 1 file changed, 90 insertions(+), 3 deletions(-)

diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 77fe893..94c69a6 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -83,7 +83,95 @@
 
 #define CONFIG_BOOTDELAY   3
 
-#define CONFIG_SYS_TEXT_BASE   0x3f008000
+#define CONFIG_LOADADDR0x8200
+#define CONFIG_SYS_TEXT_BASE   0x8780
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "script=boot.scr\0" \
+   "uimage=uImage\0" \
+   "console=ttyLP1\0" \
+   "fdt_high=0x\0" \
+   "initrd_high=0x\0" \
+   "fdt_file=vf610-twr.dtb\0" \
+   "fdt_addr=0x8100\0" \
+   "boot_fdt=try\0" \
+   "ip_dyn=yes\0" \
+   "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+   "mmcpart=1\0" \
+   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
+   "update_sd_firmware_filename=u-boot.imx\0" \
+   "update_sd_firmware=" \
+   "if test ${ip_dyn} = yes; then " \
+   "setenv get_cmd dhcp; " \
+   "else " \
+   "setenv get_cmd tftp; " \
+   "fi; " \
+   "if mmc dev ${mmcdev}; then "   \
+   "if ${get_cmd} ${update_sd_firmware_filename}; then " \
+   "setexpr fw_sz ${filesize} / 0x200; " \
+   "setexpr fw_sz ${fw_sz} + 1; "  \
+   "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+   "fi; "  \
+   "fi\0" \
+   "mmcargs=setenv bootargs console=${console},${baudrate} " \
+   "root=${mmcroot}\0" \
+   "loadbootscript=" \
+   "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+   "bootscript=echo Running bootscript from mmc ...; " \
+   "source\0" \
+   "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+   "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+   "mmcboot=echo Booting from mmc ...; " \
+   "run mmcargs; " \
+   "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+   "if run loadfdt; then " \
+   "bootm ${loadaddr} - ${fdt_addr}; " \
+   "else " \
+   "if test ${boot_fdt} = try; then " \
+   "bootm; " \
+   "else " \
+   "echo WARN: Cannot load the DT; " \
+   "fi; " \
+   "fi; " \
+   "else " \
+   "bootm; " \
+   "fi;\0" \
+   "netargs=setenv bootargs console=${console},${baudrate} " \
+   "root=/dev/nfs " \
+   "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+   "netboot=echo Booting from net ...; " \
+   "run netargs; " \
+   "if test ${ip_dyn} = yes; then " \
+   "setenv get_cmd dhcp; " \
+   "else " \
+   "setenv get_cmd tftp; " \
+   "fi; " \
+   "${get_cmd} ${uimage}; " \
+   "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+   "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+   "bootm ${loadaddr} - ${fdt_addr}; " \
+   "else " \
+   "if test ${boot_fdt} = try; then " \
+   "bootm; " \
+   "else " \
+   "echo WARN: Cannot load the DT; " \
+   "fi; " \
+   "fi; " \
+   "else " \
+   "bootm; " \
+   "fi;\0"
+
+#define CONFIG_BOOTCOMMAND \
+  "mmc dev ${mmcdev}; if mmc rescan; then " \
+  "if run loadbootscript; then " \
+  "run bootscript; " \
+  "else " \
+  "if run loaduimage; then " \
+  "run mmcboot; " \
+  "else run netboot; " \
+  "fi; " \
+  "fi; " \
+  "else run netboot; fi"
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
@@ -101,8 +189,7 @@
 #define CONFIG_SYS_MEMTEST_START   0x

[U-Boot] [PATCH v3 1/2] Optimized nand_read_buf for kirkwood

2013-06-26 Thread Phil Sutter
The basic idea is taken from the linux-kernel, but further optimized.

First align the buffer to 8 bytes, then use ldrd/strd to read and store
in 8 byte quantities, then do the final bytes.

Tested using: 'date ; nand read.raw 0xE0 0x0 0x1 ; date'.
Without this patch, NAND read of 132MB took 49s (~2.69MB/s). With this
patch in place, reading the same amount of data was done in 27s
(~4.89MB/s). So read performance is increased by ~80%!

Signed-off-by: Nico Erfurth 
Tested-by: Phil Sutter 
Cc: Prafulla Wadaskar 
---
 drivers/mtd/nand/kirkwood_nand.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/drivers/mtd/nand/kirkwood_nand.c b/drivers/mtd/nand/kirkwood_nand.c
index 0a99a10..85ea5d2 100644
--- a/drivers/mtd/nand/kirkwood_nand.c
+++ b/drivers/mtd/nand/kirkwood_nand.c
@@ -38,6 +38,37 @@ struct kwnandf_registers {
 static struct kwnandf_registers *nf_reg =
(struct kwnandf_registers *)KW_NANDF_BASE;
 
+
+/*
+ * The basic idea is stolen from the linux kernel, but the inner loop is
+ * optimized a bit more.
+ */
+static void kw_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
+{
+   struct nand_chip *chip = mtd->priv;
+
+   while (len && (unsigned long)buf & 7) {
+   *buf++ = readb(chip->IO_ADDR_R);
+   len--;
+   };
+
+   /* This loop reads and writes 64bit per round. */
+   asm volatile (
+   "1:\n"
+   "  subs   %0, #8\n"
+   "  ldrpld r2, [%2]\n"
+   "  strpld r2, [%1], #8\n"
+   "  bhi1b\n"
+   "  addne  %0, #8\n"
+   : "+&r" (len), "+&r" (buf)
+   : "r" (chip->IO_ADDR_R)
+   : "r2", "r3", "memory", "cc"
+   );
+
+   while (len--)
+   *buf++ = readb(chip->IO_ADDR_R);
+}
+
 /*
  * hardware specific access to control-lines/bits
  */
@@ -80,6 +111,7 @@ int board_nand_init(struct nand_chip *nand)
nand->ecc.mode = NAND_ECC_SOFT;
 #endif
nand->cmd_ctrl = kw_nand_hwcontrol;
+   nand->read_buf = kw_nand_read_buf;
nand->chip_delay = 40;
nand->select_chip = kw_nand_select_chip;
return 0;
-- 
1.8.1.5

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


[U-Boot] Version 3 of Kirkwood and env_nand improvements

2013-06-26 Thread Phil Sutter
Respin of the remaining two of my patch series for review.  First patch
is identical but removed the versioning from the title as suggested.
Second patch cleaned up so checkpatch.pl does not complain anymore.
Kudos to Scott for pointing out the warnings and his further comments. 

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


[U-Boot] [PATCH v3 2/2] env_nand.c: support falling back to redundant env when writing

2013-06-26 Thread Phil Sutter
Without this patch, when the currently chosen environment to be written
has bad blocks, saveenv fails completely. Instead, when there is
redundant environment fall back to the other copy. Environment reading
needs no adjustment, as the fallback logic for incomplete writes applies
to this case as well.

Signed-off-by: Phil Sutter 
---
 common/env_nand.c | 105 --
 1 file changed, 46 insertions(+), 59 deletions(-)

diff --git a/common/env_nand.c b/common/env_nand.c
index b745822..06af5ce 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -168,72 +168,56 @@ int writeenv(size_t offset, u_char *buf)
return 0;
 }
 
-#ifdef CONFIG_ENV_OFFSET_REDUND
-static unsigned char env_flags;
+struct env_location {
+   const char *name;
+   nand_erase_options_t *erase_opts;
+   loff_t offset;
+};
 
-int saveenv(void)
+static int erase_and_write_env(struct env_location *location, u_char *env_new)
 {
-   env_t   env_new;
-   ssize_t len;
-   char*res;
-   int ret = 0;
-   nand_erase_options_t nand_erase_options;
-
-   memset(&nand_erase_options, 0, sizeof(nand_erase_options));
-   nand_erase_options.length = CONFIG_ENV_RANGE;
-
-   if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
-   return 1;
+   int ret = 0;
 
-   res = (char *)&env_new.data;
-   len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
-   if (len < 0) {
-   error("Cannot export environment: errno = %d\n", errno);
+   printf("Erasing %s...\n", location->name);
+   location->erase_opts->offset = location->offset;
+   if (nand_erase_opts(&nand_info[0], location->erase_opts))
return 1;
-   }
-   env_new.crc = crc32(0, env_new.data, ENV_SIZE);
-   env_new.flags   = ++env_flags; /* increase the serial */
 
-   if (gd->env_valid == 1) {
-   puts("Erasing redundant NAND...\n");
-   nand_erase_options.offset = CONFIG_ENV_OFFSET_REDUND;
-   if (nand_erase_opts(&nand_info[0], &nand_erase_options))
-   return 1;
-
-   puts("Writing to redundant NAND... ");
-   ret = writeenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)&env_new);
-   } else {
-   puts("Erasing NAND...\n");
-   nand_erase_options.offset = CONFIG_ENV_OFFSET;
-   if (nand_erase_opts(&nand_info[0], &nand_erase_options))
-   return 1;
-
-   puts("Writing to NAND... ");
-   ret = writeenv(CONFIG_ENV_OFFSET, (u_char *)&env_new);
-   }
-   if (ret) {
-   puts("FAILED!\n");
-   return 1;
-   }
-
-   puts("done\n");
-
-   gd->env_valid = gd->env_valid == 2 ? 1 : 2;
+   printf("Writing to %s... ", location->name);
+   ret = writeenv(location->offset, env_new);
+   puts(ret ? "FAILED!\n" : "OK\n");
 
return ret;
 }
-#else /* ! CONFIG_ENV_OFFSET_REDUND */
+
+static unsigned char env_flags;
+
 int saveenv(void)
 {
int ret = 0;
ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
ssize_t len;
char*res;
+   int env_idx;
nand_erase_options_t nand_erase_options;
+   static const struct env_location location[] = {
+   {
+   .name = "NAND",
+   .erase_opts = &nand_erase_options,
+   .offset = CONFIG_ENV_OFFSET,
+   },
+#ifdef CONFIG_ENV_OFFSET_REDUND
+   {
+   .name = "redundant NAND",
+   .erase_opts = &nand_erase_options,
+   .offset = CONFIG_ENV_OFFSET_REDUND,
+   },
+#endif
+   };
+
 
memset(&nand_erase_options, 0, sizeof(nand_erase_options));
nand_erase_options.length = CONFIG_ENV_RANGE;
-   nand_erase_options.offset = CONFIG_ENV_OFFSET;
 
if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
return 1;
@@ -244,22 +228,25 @@ int saveenv(void)
error("Cannot export environment: errno = %d\n", errno);
return 1;
}
-   env_new->crc = crc32(0, env_new->data, ENV_SIZE);
-
-   puts("Erasing Nand...\n");
-   if (nand_erase_opts(&nand_info[0], &nand_erase_options))
-   return 1;
+   env_new->crc   = crc32(0, env_new->data, ENV_SIZE);
+#ifdef CONFIG_ENV_OFFSET_REDUND
+   env_new->flags = ++env_flags; /* increase the serial */
+   env_idx = (gd->env_valid == 1);
+#endif
 
-   puts("Writing to Nand... ");
-   if (writeenv(CONFIG_ENV_OFFSET, (u_char *)env_new)) {
-   puts("FAILED!\n");
-   return 1;
+   ret = erase_and_write_env(&location[env_idx], (u_char *)env_new);
+#ifdef CONFIG_ENV_OFFSET_REDUND
+   if (ret) {
+   env_idx = (env_idx + 1) & 1;
+   ret = erase_and_write_env(&location[env_idx],
+   (u_c

Re: [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL

2013-06-26 Thread Scott Wood

On 06/25/2013 11:09:04 PM, Prabhakar Kushwaha wrote:

On 06/25/2013 08:38 PM, Scott Wood wrote:

On 06/25/2013 12:03:56 AM, Prabhakar Kushwaha wrote:
CONFIG_SPL_BUILD creates debug TLB entry, so disable it before  
init_tlbs.


CONFIG_SPL_INIT_MINIMAL never creates any debug TLB entry, so no  
need

of disable_tlb().

Signed-off-by: Prabhakar Kushwaha 
---
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c  
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c

index 837c034..0cb2717 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -180,7 +180,8 @@ void cpu_init_early_f(void)

 invalidate_tlb(1);

-#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
!defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NAND_SPL)

+#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
+!defined(CONFIG_SPL_INIT_MINIMAL) &&  
!defined(CONFIG_NAND_SPL)

 disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
 #endif


This fails to clear the debug TLB in non-SPL_BUILD portion of a  
build that has CONFIG_SPL_INIT_MINIMAL setoh..

oh.. lots of cases :(

then it should be like this. slightly complex.
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
!(defined(CONFIG_NAND_SPL) || \

(defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL)))

or
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && (CONFIG_SYS_RAMBOOT) ||  
\

(defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_INIT_MINIMAL)))


The former:

http://lists.denx.de/pipermail/u-boot/2013-June/157201.html

Ignore the line wrapping.

The latter will only clear the debug TLB when CONFIG_SYS_RAMBOOT is set  
or in a non-minimal SPL (i.e. not in an ordinary NOR boot), which I  
don't think is what you meant.  Check your parentheses. :-)


If you meant to exclude CONFIG_SYS_RAMBOOT, why?

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


[U-Boot] [PATCH] video: mxsfb: Break the line in videomode message

2013-06-26 Thread Fabio Estevam
Currently we have the following on boot:

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
Video: MXSFB: 'videomode' variable not set!In:serial

Break the line of the warning message in order to have a better reading format.

Signed-off-by: Fabio Estevam 
---
 drivers/video/mxsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index b189419..411d356 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -137,7 +137,7 @@ void *video_hw_init(void)
/* Suck display configuration from "videomode" variable */
penv = getenv("videomode");
if (!penv) {
-   printf("MXSFB: 'videomode' variable not set!");
+   printf("MXSFB: 'videomode' variable not set!\n");
return NULL;
}
 
-- 
1.8.1.2


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


Re: [U-Boot] [PATCH 2/2] powerpc/c29xpcie: add support for C29XPCIE board

2013-06-26 Thread Scott Wood

On 06/26/2013 02:23:30 AM, Po Liu wrote:

+   set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, flash_esel, BOOKE_PAGESZ_64M, 1);


Don't set MAS3_SX on I/O mappings.


+   /* *I*G - Board CPLD */
+	SET_TLB_ENTRY(1, CONFIG_SYS_CPLD_BASE,  
CONFIG_SYS_CPLD_BASE_PHYS,

+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 5, BOOKE_PAGESZ_4K, 1),
+
+	SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE,  
CONFIG_SYS_NAND_BASE_PHYS,

+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 6, BOOKE_PAGESZ_1M, 1),


Don't set MAS3_SX on I/O mappings.


+   /* *I*G - platform SRAM */
+   SET_TLB_ENTRY(1, CONFIG_SYS_PLATFORM_SRAM_BASE,
+   CONFIG_SYS_PLATFORM_SRAM_BASE_PHYS,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 7, BOOKE_PAGESZ_256K, 1),
+   SET_TLB_ENTRY(1, CONFIG_SYS_PLATFORM_SRAM_BASE + 0x4,
+   CONFIG_SYS_PLATFORM_SRAM_BASE_PHYS + 0x4,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 8, BOOKE_PAGESZ_256K, 1),


Why is this I+G?


+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#ifdef CONFIG_36BIT
+#define CONFIG_PHYS_64BIT
+#endif


Why are you adding non-36bit support that will not even get build
testing?


+/*
+ * Internal Definitions
+ *
+ * Boot Flags
+ */
+#define BOOTFLAG_COLD	0x01		/* Normal Power-On:  
Boot from FLASH */

+#define BOOTFLAG_WARM  0x02/* Software reboot */


These are not used anywhere.  Please go through this file and only  
retain

things which actually continue to make sense.


+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 64 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ	(64 << 20) /* Initial Memory map for  
Linux */
+#define CONFIG_SYS_BOOTM_LEN	(64 << 20) /* Increase max gunzip size  
*/

+
+#ifdef CONFIG_CMD_KGDB
+#define CONFIG_KGDB_BAUDRATE	230400	/* speed to run kgdb serial  
port */
+#define CONFIG_KGDB_SER_INDEX	2	/* which serial port to  
use */

+#endif


Likewise, this KGDB stuff is bad copy-and-paste.


+
+/*
+ * Environment Configuration
+ */
+
+#ifdef CONFIG_TSEC_ENET
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+#endif
+
+#define CONFIG_ROOTPATH"/opt/nfsroot"
+#define CONFIG_BOOTFILE"uImage"
+#define CONFIG_UBOOTPATH	u-boot.bin/* U-Boot image on TFTP  
server */

+
+/* default location for tftp and bootm */
+#define CONFIG_LOADADDR100
+
+#define CONFIG_BOOTDELAY   10  /* -1 disables auto-boot */
+
+#define CONFIG_BAUDRATE115200
+
+#define	CONFIG_EXTRA_ENV_SETTINGS 
\

+   "hwconfig=" __stringify(CONFIG_DEF_HWCONFIG)  "\0"  \
+   "netdev=eth0\0"   \
+   "uboot=" __stringify(CONFIG_UBOOTPATH) "\0" \
+   "loadaddr=100\0"  \
+   "consoledev=ttyS0\0"  \
+   "ramdiskaddr=200\0"   \
+   "ramdiskfile=rootfs.ext2.gz.uboot\0"  \
+   "fdtaddr=c0\0"\
+   "fdtfile=c293pcie.dtb\0"  \


Why c293?  Doesn't this support c291 and c292 as well?

Better to not have any default, or an obviously non-working placeholder
like fdtfile=name/of/device-tree.dtb

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


[U-Boot] [PATCH] mtd/nand: docg4: fix compiler warnings

2013-06-26 Thread Mike Dunn
Newer gcc versions warn about unused variables.  This patch corrects a few of
those warnings that popped up in a build for the palmtreo680 board.

Signed-off-by: Mike Dunn 
---

 drivers/mtd/nand/docg4_spl.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/docg4_spl.c b/drivers/mtd/nand/docg4_spl.c
index 95e856c..734cbeb 100644
--- a/drivers/mtd/nand/docg4_spl.c
+++ b/drivers/mtd/nand/docg4_spl.c
@@ -113,7 +113,6 @@ static int docg4_load_block_reliable(uint32_t flash_offset, 
void *dest_addr)
int g4_index = 0;
uint16_t flash_status;
uint16_t *buf;
-   uint16_t discard, magic_high, magic_low;
 
/* flash_offset must be aligned to the start of a block */
if (flash_offset & 0x3)
@@ -154,9 +153,9 @@ static int docg4_load_block_reliable(uint32_t flash_offset, 
void *dest_addr)
 * The IPL on the palmtreo680 requires that this contain a 32 bit magic
 * number, or the load aborts.  We'll ignore it.
 */
-   discard = readw(docptr + 0x103c); /* hw quirk; 1st read discarded */
-   magic_low = readw(docptr + 0x103c);
-   magic_high = readw(docptr + DOCG4_MYSTERY_REG);
+   readw(docptr + 0x103c); /* hw quirk; 1st read discarded */
+   readw(docptr + 0x103c); /* lower 16 bits of magic number */
+   readw(docptr + DOCG4_MYSTERY_REG); /* upper 16 bits of magic number */
writew(0, docptr + DOC_DATAEND);
write_nop(docptr);
write_nop(docptr);
@@ -183,15 +182,15 @@ static int docg4_load_block_reliable(uint32_t 
flash_offset, void *dest_addr)
write_nop(docptr);
 
/* read the 512 bytes of page data, 2 bytes at a time */
-   discard = readw(docptr + 0x103c);
+   readw(docptr + 0x103c); /* hw quirk */
for (i = 0; i < 256; i++)
*buf++ = readw(docptr + 0x103c);
 
/* read oob, but discard it */
for (i = 0; i < 7; i++)
-   discard = readw(docptr + 0x103c);
-   discard = readw(docptr + DOCG4_OOB_6_7);
-   discard = readw(docptr + DOCG4_OOB_6_7);
+   readw(docptr + 0x103c);
+   readw(docptr + DOCG4_OOB_6_7);
+   readw(docptr + DOCG4_OOB_6_7);
 
writew(0, docptr + DOC_DATAEND);
write_nop(docptr);
-- 
1.8.1.5

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


[U-Boot] [PATCH] usb: pxa27x_udc: fix compiler warnings

2013-06-26 Thread Mike Dunn
Newer gcc versions warn about unused variables.  This patch corrects a few of
those warnings that popped up in a build for the palmtreo680 board.

Signed-off-by: Mike Dunn 
---
 drivers/usb/gadget/pxa27x_udc.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 71cc0f2..598923d 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -151,7 +151,7 @@ static int udc_read_urb(struct usb_endpoint_instance 
*endpoint)
struct urb *urb = endpoint->rcv_urb;
int ep_num = endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK;
u32 *data32 = (u32 *) urb->buffer;
-   unsigned int i, n, is_short ;
+   unsigned int i, n;
 
usbdbg("read urb on ep %d", ep_num);
 #if defined(USBDDBG) && defined(USBDPARANOIA)
@@ -165,9 +165,8 @@ static int udc_read_urb(struct usb_endpoint_instance 
*endpoint)
n = readl(UDCBCN(ep_num)) & 0x3ff;
else /* zlp */
n = 0;
-   is_short = n != endpoint->rcv_packetSize;
 
-   usbdbg("n %d%s", n, is_short ? "-s" : "");
+   usbdbg("n %d%s", n, n != endpoint->rcv_packetSize ? "-s" : "");
for (i = 0; i < n; i += 4)
data32[urb->actual_length / 4 + i / 4] = readl(UDCDN(ep_num));
 
@@ -402,16 +401,13 @@ static void udc_handle_ep(struct usb_endpoint_instance 
*endpoint)
 
 static void udc_state_changed(void)
 {
-   int config, interface, alternate;
 
writel(readl(UDCCR) | UDCCR_SMAC, UDCCR);
 
-   config = (readl(UDCCR) & UDCCR_ACN) >> UDCCR_ACN_S;
-   interface = (readl(UDCCR) & UDCCR_AIN) >> UDCCR_AIN_S;
-   alternate = (readl(UDCCR) & UDCCR_AAISN) >> UDCCR_AAISN_S;
-
usbdbg("New UDC settings are: conf %d - inter %d - alter %d",
-   config, interface, alternate);
+  (readl(UDCCR) & UDCCR_ACN) >> UDCCR_ACN_S,
+  (readl(UDCCR) & UDCCR_AIN) >> UDCCR_AIN_S,
+  (readl(UDCCR) & UDCCR_AAISN) >> UDCCR_AAISN_S);
 
usbd_device_event_irq(udc_device, DEVICE_CONFIGURED, 0);
writel(UDCISR1_IRCC, UDCISR1);
-- 
1.8.1.5

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


[U-Boot] U-Boot build issue

2013-06-26 Thread Marek Vasut
Hi,

remember when the Jenkins was failing on random targets and the log always 
contained this message, where it stated it can't compile some object file due 
to 
missing dependency, whose path was "trimmed" ?

See this log from my machine:

marex@bfu:~/U-Boot/u-boot-imx$ bash ../compile/compile-xfi3.sh >/dev/null 
make[2]: *** No rule to make target `/home/mar', needed by `/home/marex/U-
Boot/u-boot-imx/spl/arch/arm/cpu/arm926ejs/mxs/spl_power_init.o'.  Stop.
make[2]: *** Waiting for unfinished jobs
make[1]: *** [/home/marex/U-Boot/u-boot-
imx/spl/arch/arm/cpu/arm926ejs/mxs/libmxs.o] Error 2
make[1]: *** Waiting for unfinished jobs
make: *** [spl/u-boot-spl.bin] Error 2
make: *** Waiting for unfinished jobs

marex@bfu:~/U-Boot/u-boot-imx$ bash ../compile/compile-xfi3.sh >/dev/null

marex@bfu:~/U-Boot/u-boot-imx$ cat ../compile/compile-xfi3.sh
export 
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/mnt/work/elftosb-10.12.01/bld/linux/
make CROSS_COMPILE=arm-linux-gnueabi- clean mrproper
make CROSS_COMPILE=arm-linux-gnueabi- xfi3_config
make CROSS_COMPILE=arm-linux-gnueabi- -j9 u-boot.sb
marex@bfu:~/U-Boot/u-boot-imx$ pwd
/home/marex/U-Boot/u-boot-imx

So, I am compiling in /home/marex/U-Boot/u-boot-imx (in-tree build) using the 
above commands. First run failed, any subsequent run did not. And the first run 
failed because it was missing this "/home/mar" dependency. It's exactly the 
same 
as when Jenkins failed at these random targets.

I cannot reliably reproduce this bug, but it seems to be quite a slimy one. The 
grease is dripping down it's body.

Any ideas?

Thanks!

btw. tool versions:

marex@bfu:~/U-Boot/u-boot-imx$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Debian 4.8.0-7) 4.8.0
[...]
marex@bfu:~/U-Boot/u-boot-imx$ arm-linux-gnueabi-ld --version
GNU ld (GNU Binutils for Debian) 2.23.52.20130612
[...]
marex@bfu:~/U-Boot/u-boot-imx$ make --version
GNU Make 3.81

This program built for x86_64-pc-linux-gnu
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] video: mxsfb: Break the line in videomode message

2013-06-26 Thread Marek Vasut
Dear Fabio Estevam,

> Currently we have the following on boot:
> 
> CPU:   Freescale i.MX28 rev1.2 at 454 MHz
> BOOT:  SSP SD/MMC #0, 3V3
> DRAM:  128 MiB
> MMC:   MXS MMC: 0
> Video: MXSFB: 'videomode' variable not set!In:serial
> 
> Break the line of the warning message in order to have a better reading
> format.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  drivers/video/mxsfb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
> index b189419..411d356 100644
> --- a/drivers/video/mxsfb.c
> +++ b/drivers/video/mxsfb.c
> @@ -137,7 +137,7 @@ void *video_hw_init(void)
>   /* Suck display configuration from "videomode" variable */
>   penv = getenv("videomode");
>   if (!penv) {
> - printf("MXSFB: 'videomode' variable not set!");
> + printf("MXSFB: 'videomode' variable not set!\n");

puts() ... and you might want to fix it in all drivers ;-)

>   return NULL;
>   }

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] ARM: mxs: Consolidate configuration options

2013-06-26 Thread Marek Vasut
Hi Stefano,

> Hi Marek,
> 
> On 16/06/2013 15:39, Marek Vasut wrote:
> > Pull all the duplicate configuration options into configs/mxs.h
> > from the board configuration files. This reduces the files greatly
> > and makes them somewhat more readable. Besides, we do no longer
> > have such a horrible duplication of code.
> > 
> > Note that the mx23evk grew in size slightly. This is due to the
> > CONFIG_SYS_CBSIZE now being set to 1024 as it is on the rest of
> > MXS systems.
> > 
> > This patch also fixes the OCRAM size for i.MX23. The i.MX23 has
> > only 32kB of OCRAM, while i.MX28 has 128kB of OCRAM.
> > 
> > I verified the configuration didn't change for each of the boards,
> > but I didn't boot-test it on the boards I do not have. I configured
> > U-Boot for each board using the "make ... _config" command
> > and then ran "cpp -I include -dM include/config.h" , which dumped
> > all the configuration options. I did this both before and after this
> > patch and finally compared the results for each MXS board. Actually,
> > the results do differ slightly, since the configs/mxs.h file now
> > properly includes the correct iomux-mx23.h or iomux-mx28.h , so
> > while comparing, I had to ignore these new defines. These have no
> > impact on U-Boot configuration though.
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Fabio Estevam 
> > Cc: Lauri Hintsala 
> > Cc: Otavio Salvador 
> > Cc: Stefano Babic 
> > ---
> 
> This is a nice cleanup, but as we probably cannot test all boards before
> release, I apply it to u-boot-imx, next branch.

Come on guys, test this! I know you want to have it in current release ;-)

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 3/5] Allow U-Boot scripts to be placed in a .env file

2013-06-26 Thread Stephen Warren
On 06/24/2013 02:46 PM, Simon Glass wrote:
> At present U-Boot environment variables, and thus scripts, are defined
> by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text
> to this file and dealing with quoting and newlines is harder than it
> should be. It would be better if we could just type the script into a
> text file and have it included by U-Boot.
> 
> Add a feature that brings in a .env file associated with the board
> config, if present. To use it, create a file in a board//env
> directory called .env (or common.env if you want the same
> environment for all boards).

I'm not entirely sure how useful common.env is.

Consider that many different Tegra boards, from different vendors, all
share the same environment. For example boards/compulab/trimslice shares
the core environment with boards/nvidia/*. IIUC, common.env wouldn't
work in this case, since the vendor is different. To solve that, we
could easily symlink board/compulab/env/trimslice.env ->
board/nvidia/env/something.env. But in that case, why not always rely on
creating symlinks, instead of having the common.env fallback work too?
Also consider that compulab makes a ton of boards only some of which use
Tegra, so even a common.env in board/compulab/env wouldn't be that useful.

> diff --git a/Makefile b/Makefile

> +$(obj)include/generated/environment.inc: 
> $(obj)include/generated/environment.in
> + @$(XECHO) Generating $@ ; \
> + set -e ; \
> + : Process the environment file ; \
> + echo -n "CONFIG_EXTRA_ENV_TEXT=" >$@ ; \
> + echo -n "#define CONFIG_EXTRA_ENV_TEXT " >$(ENV_HEADER) ; \
> + awk -f tools/scripts/env2string.awk $< | \
> + tee -a $(ENV_HEADER) >>$@ ; \

That generates two different files. Doesn't this confuse make a bit,
since if make needs to create $(ENV_HEADER) (which isn't $@ for that
rule) it won't know how to? I've certainly seen problems due to similar
make setups in the past. Perhaps even though it's a bit extra build-time
work, the two files should be generated separately? Or, is there some
reason here that there won't be a problem?

> diff --git a/README b/README

> +For example, for snapper9260 you would create a text file called
> +board/bluewater/env/snapper9260.env containing the environment text.
> +
> +>>>
> +bootcmd=
> + if [ -z ${tftpserverip} ]; then
> + echo "Use 'setenv tftpserverip a.b.c.d' to set IP address."
> + fi
> +
> + usb start; setenv autoload n; bootp;
> + tftpboot ${tftpserverip}:
> + bootm
> +failed=
> + echo boot failed - please check your image
> +<<<

Presumably the parser looks for something like /^[A-Z]=/i to know when
to "switch" to a new environment variable. Is some form of escaping
useful if you want to include that form of text in your environment
variable's value? If the parser is somehow smarter than that, it might
be worth explaining the syntax structure a little more above.

> diff --git a/tools/scripts/env2string.awk b/tools/scripts/env2string.awk

> +# We begin and end with "

I'm not sure what the " means at the end of that line.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/6] mx28evk: Move README file inside board directory

2013-06-26 Thread Marek Vasut
Dear Otavio Salvador,

> On Wed, Jun 26, 2013 at 12:43 PM, Stefano Babic  wrote:
> > On 03/05/2013 20:08, Fabio Estevam wrote:
> >> From: Fabio Estevam 
> >> 
> >> Board specific READMEs should be located inside the respective board
> >> directory.
> >> 
> >> Signed-off-by: Fabio Estevam 
> >> ---
> >> 
> >>  .../freescale/mx28evk/README   |0
> >>  1 file changed, 0 insertions(+), 0 deletions(-)
> >>  rename doc/README.mx28evk => board/freescale/mx28evk/README (100%)
> >> 
> >> diff --git a/doc/README.mx28evk b/board/freescale/mx28evk/README
> >> similarity index 100%
> >> rename from doc/README.mx28evk
> >> rename to board/freescale/mx28evk/README
> > 
> > Strange, I cannot find this patch in patchworks..anyway
> > 
> > Applied to u-boot-imx, thanks.
> 
> This is because it was  a rename so patchwork does not track it. It is a
> bug ...

Fix it and send patch ;-)

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/5] env: Allow environment files to use the C preprocessor

2013-06-26 Thread Stephen Warren
On 06/24/2013 02:46 PM, Simon Glass wrote:
> In many cases environment variables need access to the U-Boot CONFIG
> variables to select different options. Enable this so that the environment
> scripts can be as useful as the ones currently in the board config files.

The addition of += seems like a separate change to enabling
pre-processing, but I guess they're both simple enough and this is a new
features, perhaps it's not a big deal.

> diff --git a/Makefile b/Makefile

>  $(obj)include/generated/environment.in: 
> $(obj)include/generated/autoconf.mk.base \
>   $(wildcard $(ENV_FILE))
>   if [ -f "$(ENV_FILE)" ]; then \
> - cat $(ENV_FILE) >$@ ; \
> + $(CPP) -P $(CFLAGS) -x assembler-with-cpp -D__ASSEMBLY__ \
> + -include $(obj)include/config.h $(ENV_FILE) -o $@; \

I guess -undef doesn't make sense here, since config.h could well rely
on standard pre-defined macros.

Does it make sense to -D __UBOOT_CONFIG__ rather than, or in addition
to, -D __ASSEMBLY__ here, so headers can tell what they're being
included for? The series I sent for dtc+cpp did -D __DTS__ for similar
reasons.

> diff --git a/tools/scripts/env2string.awk b/tools/scripts/env2string.awk

> + # Deal with +=
> + if (match(var, "(.*)[+]$", var_arr)) {
> + var = var_arr[1]
> + env = vars[var] env
> + }

Does this work if you write just:

foo+=bar

rather than:

foo=
foo+=bar

It might be worth allowing the former syntax, so you don't need to
explicitly assign empty values before a sequence of ifdef'd +=
operations. If the above blows up, at least a descriptive error message
might be useful.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/5] RFC: tegra: Convert to using environment files

2013-06-26 Thread Stephen Warren
On 06/24/2013 02:46 PM, Simon Glass wrote:
> This seems more intuitive that the current #define way of doing things.
> The resulting code is shorter, avoids the quoting and line continuation
> pain, and also improves the clumsy way that stdio variables are created:
> 
>  #ifdef CONFIG_VIDEO_TEGRA
>  #define STDOUT_LCD ",lcd"
>  #else
>  #define STDOUT_LCD ""
>  #endif
> 
> ...
>  #define TEGRA_DEVICE_SETTINGS \
>   "stdout=serial" STDOUT_LCD "\0" \
>   ...
> 
> The MEM_LAYOUT_ENV_SETTINGS variable is left in the header files, since
> it depends on the SOC type and we probably don't want to add .emv files
> for each board at this stage.

Presumably e.g. seaboard.env could #include "tegra20.env" in order to
allow *.env to define MEM_LAYOUT_ENV_SETTINGS?

BTW, what's the #include -I path for these files? Perhaps it's worth
setting it up as board/$vendor/$board/env board/$vendor/env
arch/$arch/env to match the dtc+cpp patches I posted?

> diff --git a/board/nvidia/env/common.env b/board/nvidia/env/common.env

> +bootcmd_mmc0=setenv devnum 0; run mmc_boot
> +bootcmd_mmc1=setenv devnum 1; run mmc_booxt
> +boot_targets+= mmc1 mmc0

The first two lines there have no space after = and the last has space
after +=. Does that get stripped? Should it?

> diff --git a/include/configs/tegra-common-post.h 
> b/include/configs/tegra-common-post.h

> -#ifdef CONFIG_BOOTCOMMAND
> -
> -#define BOOTCMDS_COMMON ""
> -
> -#else
...

Overall this change seems reasonable, but as I alluded to earlier,
removing this from tegra-common-post.h will break Tegra boards for
vendors other than NVIDIA. I guess that's part of why this patch is RFC.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >