[U-Boot] [PATCH] armv7: s5pc1xx: don't use function pointer for clock functions

2010-12-27 Thread Minkyu Kang
Because of the bss area is cleared after relocation, we've lost pointers.
This patch fixed it.

Signed-off-by: Minkyu Kang mk7.k...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/cpu/armv7/s5p-common/cpu_info.c |2 -
 arch/arm/cpu/armv7/s5pc1xx/clock.c   |   38 ++---
 arch/arm/include/asm/arch-s5pc1xx/clk.h  |   10 +++
 3 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/arch/arm/cpu/armv7/s5p-common/cpu_info.c 
b/arch/arm/cpu/armv7/s5p-common/cpu_info.c
index 2f6c708..c8a543a 100644
--- a/arch/arm/cpu/armv7/s5p-common/cpu_info.c
+++ b/arch/arm/cpu/armv7/s5p-common/cpu_info.c
@@ -32,8 +32,6 @@ int arch_cpu_init(void)
 {
s5p_set_cpu_id();
 
-   s5p_clock_init();
-
return 0;
 }
 #endif
diff --git a/arch/arm/cpu/armv7/s5pc1xx/clock.c 
b/arch/arm/cpu/armv7/s5pc1xx/clock.c
index 98a27e5..e92647c 100644
--- a/arch/arm/cpu/armv7/s5pc1xx/clock.c
+++ b/arch/arm/cpu/armv7/s5pc1xx/clock.c
@@ -38,11 +38,6 @@
 #define CONFIG_SYS_CLK_FREQ_C110   2400
 #endif
 
-unsigned long (*get_uart_clk)(int dev_index);
-unsigned long (*get_pwm_clk)(void);
-unsigned long (*get_arm_clk)(void);
-unsigned long (*get_pll_clk)(int);
-
 /* s5pc110: return pll clock frequency */
 static unsigned long s5pc100_get_pll_clk(int pllreg)
 {
@@ -316,15 +311,28 @@ static unsigned long s5pc1xx_get_pwm_clk(void)
return s5pc100_get_pclk();
 }
 
-void s5p_clock_init(void)
+unsigned long get_pll_clk(int pllreg)
 {
-   if (cpu_is_s5pc110()) {
-   get_pll_clk = s5pc110_get_pll_clk;
-   get_arm_clk = s5pc110_get_arm_clk;
-   } else {
-   get_pll_clk = s5pc100_get_pll_clk;
-   get_arm_clk = s5pc100_get_arm_clk;
-   }
-   get_uart_clk = s5pc1xx_get_uart_clk;
-   get_pwm_clk = s5pc1xx_get_pwm_clk;
+   if (cpu_is_s5pc110())
+   return s5pc110_get_pll_clk(pllreg);
+   else
+   return s5pc100_get_pll_clk(pllreg);
+}
+
+unsigned long get_arm_clk(void)
+{
+   if (cpu_is_s5pc110())
+   return s5pc110_get_arm_clk();
+   else
+   return s5pc100_get_arm_clk();
+}
+
+unsigned long get_pwm_clk(void)
+{
+   return s5pc1xx_get_pwm_clk();
+}
+
+unsigned long get_uart_clk(int dev_index)
+{
+   return s5pc1xx_get_uart_clk(dev_index);
 }
diff --git a/arch/arm/include/asm/arch-s5pc1xx/clk.h 
b/arch/arm/include/asm/arch-s5pc1xx/clk.h
index 3488eb7..4c389c1 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/clk.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/clk.h
@@ -29,11 +29,9 @@
 #define HPLL   3
 #define VPLL   4
 
-void s5p_clock_init(void);
-
-extern unsigned long (*get_pll_clk)(int pllreg);
-extern unsigned long (*get_arm_clk)(void);
-extern unsigned long (*get_pwm_clk)(void);
-extern unsigned long (*get_uart_clk)(int dev_index);
+unsigned long get_pll_clk(int pllreg);
+unsigned long get_arm_clk(void);
+unsigned long get_pwm_clk(void);
+unsigned long get_uart_clk(int dev_index);
 
 #endif
-- 
1.7.1
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] {Spam?} u-boot relocation

2010-12-27 Thread Albert ARIBAUD
Le 26/12/2010 22:09, Marcel a écrit :

 relocation Offset is: 0409e000

 How is 0409e000 near top of my RAM ?
 How does it get this value ?

This is an offset, a difference of addresses, not an absolute address. 
And since it is rather big, it means the original and relocated 
locations are far enough from each other.

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


Re: [U-Boot] [PATCH 5/5] MX5:MX53: add initial support for MX53EVK board

2010-12-27 Thread Stefano Babic
On 12/20/2010 07:52 AM, John Rigby wrote:

 Jason:
 No one is arguing about the use the plugin feature.  The objection is
 to how you are getting the plugin bits into the u-boot image.  You
 should use a tool to prepend the plugins to the u-boot.bin file in a
 similar way to how mkimage is used for i.mx51 and others.

Exactly.

 
 Stefano:
 I know Freescale has a binary to do this but I don't believe the
 source is available.  The binary is included as a package in the
 i.mx28 BSP as well as some sample plugins.

Thanks for hints !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] MX5: Add initial support for MX53 processor

2010-12-27 Thread Stefano Babic
On 12/22/2010 02:23 PM, Jason Liu wrote:
 Add initial support for Freescale MX53 processor,
 
 - Add the iomux support and the pin definition,
 - Add the regs definition, clean up some unused def from mx51,
 - Add the low level init support, make use the freq input of setup_pll macro
 
 ---
 Changes for v2:
 -address some comments of Stefano Babic, remove the is_soc_type
  and use #ifdef,
 -address the comments of stefano, remove CPU_TYPE def, remove something
  like /*0x760*/ comments in mx5x_pins.h.
 -fix the build break for vision2 board

A general remark. You posted two different patchset now to support the
MX53 processor. As the patches are related, please combine all patches
in a single patchset to avoid that only a few of them go to be applied
and to simplify review.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/3] MX5:MX53: add initial support for MX53EVK board

2010-12-27 Thread Stefano Babic
On 12/22/2010 02:23 PM, Jason Liu wrote:
 Add initial support for MX53EVK board support.
 FEC, SD/MMC, UART, I2C, have been support.
 
 Signed-off-by: Jason Liu r64...@freescale.com
 
 ---
 Changes for v2:
 -Address the comments from Stefano, Albert and Wolfgang,
 -remove the ivt.S file and use imximage.cfg instead,
 -remove the ivt link to u-boot
 -Address the comments from Stefano,
 -Correct the copyright issue,
 -Use mxc_get_gpio() and mxc_set_gpio() accessors.
 -Get rid of system_rev,
 -use i2c enumeration value (0,1,..N) instead of BASE address,
 -use fsl_pmic i2c interface,
 -Add comments for why manage the pmic in a different way for TO2
 -Remove the comments from configs/mx53evk.h,
  - /*
  -  * Disabled for now due to build problems under Debian and a 
 significant
  -  * increase in the final file size: 144260 vs. 109536 Bytes.
  -  */
 -Address the comments from Wolfgang,
 -Move CONFIG_SYS_TEXT_BASE  to board config file,
 -Remove the comments from configs/mx53evk.h
  - /* size in bytes reserved for initial data */
  #define BOARD_LATE_INIT
 -Change the comments,  * Hardware drivers to * UART drivers
 ---


  MAINTAINERS   |3 +
  board/freescale/mx53evk/Makefile  |   48 +
  board/freescale/mx53evk/mx53evk.c |  393 
 +
  boards.cfg|1 +
  include/configs/mx53evk.h |  216 
  5 files changed, 661 insertions(+), 0 deletions(-)
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 0590ad9..c87ca56 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -1085,6 +1085,9 @@ Peter Meerwald de...@bct-electronic.com
  
   bct-brettl2 BF536
  
 +Jason Liu r64...@freescale.com
 +
 + MX53evk i.MX53

Why do you add your name at the end of the Blackfin list and not inside
the ARM list ? Please maintain the list sorted.

 +void power_init(void)
 +{
 + unsigned int val;
 +
 + /* Set VDDA to 1.25V */
 + val = pmic_reg_read(REG_SW_2);
 + val = (val  (~0x1F)) | 0x1A;

I have already commented this. Please drop all fix constants and use
already provided #define or add new ones if needed.

 + if (is_soc_rev(CHIP_REV_2_0) == 0) {
 + /* Set VCC to 1.3V for TO2 */
 + val = pmic_reg_read(REG_SW_1);
 + val = (val  (~0x1F)) | 0x1C;

Ditto.



 +int board_init(void)
 +{
 + gd-bd-bi_arch_number = MACH_TYPE_MX53_EVK;
 + /* address of boot parameters */
 + gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100;
 +
 + setup_iomux_uart();

You sent a patch for mx51evk moving this call in board_early_init_f. Do
we need the same for mx53evk ?

 +#ifdef BOARD_LATE_INIT
 +int board_late_init(void)
 +{
 +#ifdef CONFIG_I2C_MXC

Is there a possibility to have a working board if CONFIG_I2C_MXC and
BOARD_LATE_INIT are not set ? If not, it should be better to check if
they are set on the beginning of this file and reporting a compile error
if they are not set, and removing the #ifdef in this function.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] mxc_gpio: add support for MX53 processor

2010-12-27 Thread Stefano Babic
On 12/22/2010 02:23 PM, Jason Liu wrote:
 This patch add mxc_gpio support for Freescale MX53 processor
 
 Signed-off-by: Jason Liu r64...@freescale.com
 ---
  drivers/gpio/mxc_gpio.c |9 +++--
  1 files changed, 7 insertions(+), 2 deletions(-)
 
Hi Jason,


Please move this patch in the same patchset to add support for mx53evk.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL

2010-12-27 Thread Minkyu Kang
There is possibility that pointers set to NULL before relocation.
In this case, system is hang, because of r0 is invalid location in RAM.

Signed-off-by: Minkyu Kang mk7.k...@samsung.com
---
 arch/arm/cpu/armv7/start.S |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 684f2d2..4eeb12a 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -195,6 +195,8 @@ copy_loop:
add r3, r3, r0  /* r3 - rel dyn end in FLASH */
 fixloop:
ldr r0, [r2]/* r0 - location to fix up, IN FLASH! 
*/
+   cmp r0, #0
+   beq fixskip
add r0, r0, r9  /* r0 - location to fix up in RAM */
ldr r1, [r2, #4]
and r7, r1, #0xff
@@ -217,6 +219,7 @@ fixrel:
add r1, r1, r9
 fixnext:
str r1, [r0]
+fixskip:
add r2, r2, #8  /* each rel.dyn entry is 8 bytes */
cmp r2, r3
blo fixloop
-- 
1.7.1
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] fsl_pmic: add I2C interface support

2010-12-27 Thread Stefano Babic
On 12/22/2010 02:23 PM, Jason Liu wrote:
 This patch add I2C interface for fsl_pmic driver support
 
 +#ifdef CONFIG_FSL_PMIC_I2C
 +#include i2c.h
 +static int init_done;
 +
 +u32 pmic_reg(u32 reg, u32 val, u32 write)
 +{
 + unsigned char buf[4] = { 0 };
 + u32 ret_val = 0;
 +
 + if (reg  63 || write  1) {
 + printf(reg num = %d is invalid. Should be less then 63\n,
 + reg);
 + return -1;
 + }

Probably we can factorize better this function and do not duplicate the
pmic_reg function for SPI and I2C.

 +
 + if (init_done == 0) {
 + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 + init_done = 1;
 + }
 +
 + if (write) {
 + buf[0] = (val  16)  0xff;
 + buf[1] = (val  8)  0xff;
 + buf[2] = (val)  0xff;

It seems you are converting the endianess. No chance to use an already
provided accessor ?

 + if (i2c_write(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3))
 + return -1;
 + } else {
 + if (i2c_read(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3)) {
 + return -1;
 + ret_val = buf[0]  16 | buf[1]  8 | buf[2];

Ditto.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this

2010-12-27 Thread Wolfgang Denk
Dear Nobuhiro Iwamatsu,

In message 1293433224-17341-1-git-send-email-iwama...@nigauri.org you wrote:
 This move linker option used by the last of u-boot in LDFLAGS_u-boot variable.
 And the option to use in ld uses LDFLAGS variable.

Can you please explain why this would be needed?

 -LDFLAGS += --gc-sections -m elf32bfin
 +LDFLAGS_u-boot += --gc-sections

The name LDFLAGS_u-boot may actually work here, but iut is
inconsistent with other such variables names, and using '-' in a name
is probably not a good idea either.



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
Star Trek Lives!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] imximage: Add MX53 boot image support

2010-12-27 Thread Stefano Babic
On 12/22/2010 02:23 PM, Jason Liu wrote:
 This patch add the MX53 boot image support
 
 This patch has been tested on Freescale MX53EVK board.
 
 Signed-off-by: Jason Liu r64...@freescale.com
 ---
  board/freescale/mx53evk/config.mk|   25 
  board/freescale/mx53evk/imximage.cfg |  108 
 ++
  tools/imximage.c |  101 +--
  tools/imximage.h |   75 ---

You mixed two patches with different meaning. You add support for
mx53evk board (and patches for config.mk and imximage.cfg must belong to
this patch) and you modify imximage to support the MX53 processor, not
related to the mx53evk board. Please split this patch into two separate
patches.

 diff --git a/tools/imximage.c b/tools/imximage.c
 index 39f89c2..884feff 100644
 --- a/tools/imximage.c
 +++ b/tools/imximage.c
 @@ -82,7 +82,7 @@ static int imximage_check_image_types(uint8_t type)
  static int imximage_verify_header(unsigned char *ptr, int image_size,
   struct mkimage_params *params)
  {
 -
 +#ifdef CONFIG_MX51

NAK. This is wrong: mkimage is a tool running on host and must be
possible to include it in a distro. It must be able (as it now does) to
produce the correct image at runtime. For this reason there are no
#ifdef in the actual code. If a different behavior is required, this
must be added extending the syntax of the imximage.cfg file, for example
adding a processor type (or a version number, or whatever is needed).

 +#if defined(CONFIG_MX51)
  static void imximage_print_header(const void *ptr)
  {
   struct imx_header *imx_hdr = (struct imx_header *) ptr;
   flash_header_t *hdr = imx_hdr-fhdr;
   uint32_t size;
   uint32_t length;
 - dcd_t *dcd = imx_hdr-dcd_table;
  
 + dcd_t *dcd = imx_hdr-dcd_table;

I do not see any changes on these lines. Please add only changes where
they are required.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 8/8] armv7: adapt s5pc1xx to the new cache maintenance framework

2010-12-27 Thread Aneesh V
Dear Minkyu Kang,

On Monday 27 December 2010 12:55 PM, Minkyu Kang wrote:
 snip 
 +
 +#ifndef CONFIG_SYS_NO_DCACHE
 +void v7_setup_outer_cache_ops(void)
 +{
 +#ifndef CONFIG_L2_OFF
 +   v7_outer_cache.enable = ca8_l2_cache_enable;
 +   v7_outer_cache.disable = ca8_l2_cache_disable;
 +#endif
 +}
 +#endif

 I don't agree with add this function at clock.c.
 If need we can make new file as omap3/4 case.

I didn't want to add a new file just for this small function. But no
problem, I will do that in the next revision.

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


Re: [U-Boot] [PATCH] Correct chip detect logic

2010-12-27 Thread Sergei Shtylyov
Hello.

On 26-12-2010 5:41, Yanjun Yang wrote:

 The lan91c96_detect_chip routine is not correct according
 to the manual.

 Signed-off-by: YanJun Yangyangyj...@gmail.com
[...]

 diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
 index bd6966e..2550aa2 100644
 --- a/drivers/net/lan91c96.c
 +++ b/drivers/net/lan91c96.c
 @@ -780,7 +780,7 @@ static int lan91c96_detect_chip(struct eth_device *dev)
 u8 chip_id;
 int r;
 SMC_SELECT_BANK(dev, 3);
 -   chip_id = SMC_inw(dev, 0xA)  LAN91C96_REV_REVID;
 +   chip_id = (SMC_inw(dev, 0xA)  LAN91C96_REV_CHIPID)

Indent with tabs, not spaces.

 LAN91C96_CHIPID_SHIFT;

Your patch is line-wrapped.

 SMC_SELECT_BANK(dev, 0);
 for (r = 0; r  sizeof(supported_chips) / sizeof(struct id_type); r++)
 if (chip_id == supported_chips[r].id)
 diff --git a/drivers/net/lan91c96.h b/drivers/net/lan91c96.h
 index 6fbb0e3..609c92b 100644
 --- a/drivers/net/lan91c96.h
 +++ b/drivers/net/lan91c96.h
 @@ -519,7 +519,8 @@ typedef unsigned long int   dword;
   
   */
   #define LAN91C96_REV_REVID(0xFU  0)
 -#define LAN91C96_REV_CHIPID   (0xFU  4)
 +#define LAN91C96_CHIPID_SHIFT4
 +#define LAN91C96_REV_CHIPID   (0xFU  LAN91C96_CHIPID_SHIFT)

Align the macro values please.

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


Re: [U-Boot] [PATCH 1/1] MX51EVK: UART does not print out the early information

2010-12-27 Thread Stefano Babic
On 12/23/2010 12:13 PM, Jason Liu wrote:
 The early bootup information is not print out due to
 the UART pin iomux not set up correctly before board_init
 
 Add the board_early_init_f function and enable the
 CONFIG_BOARD_EARLY_INIT_F. Move the UART pin setting
 from board_init to board_early_init_f function.
 
 This patch also move the FEC pin iomux setup to the
 board_early_init_f.
 
 Signed-off-by: Jason Liu r64...@freescale.com
 ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] nios2: add gpio_is_valid

2010-12-27 Thread Sergei Shtylyov
Hello.

On 27-12-2010 5:46, Thomas Chou wrote:

 Signed-off-by: Thomas Choutho...@wytron.com.tw
[...]

 diff --git a/arch/nios2/include/asm/gpio.h b/arch/nios2/include/asm/gpio.h
 index 36a7132..4b21c8f 100644
 --- a/arch/nios2/include/asm/gpio.h
 +++ b/arch/nios2/include/asm/gpio.h
 @@ -52,6 +52,11 @@ static inline void gpio_set_value(unsigned gpio, int value)
   {
   writel(value ? 3 : 2, CONFIG_SYS_GPIO_BASE + (gpio  2));
   }
 +
 +static inline int gpio_is_valid(int number)
 +{
 + return ((unsigned)number)  CONFIG_SYS_GPIO_WIDTH;

No need to have parens around '(unsigned)number'.

 diff --git a/board/altera/nios2-generic/gpio.c 
 b/board/altera/nios2-generic/gpio.c
 index 8c639ce..4a30564 100644
 --- a/board/altera/nios2-generic/gpio.c
 +++ b/board/altera/nios2-generic/gpio.c
[...]
 @@ -62,4 +63,9 @@ void gpio_set_value(unsigned gpio, int value)
   pio_data_reg= ~mask;
   writel(pio_data_reg, ALTERA_PIO_DATA);
   }
 +
 +int gpio_is_valid(int number)
 +{
 + return ((unsigned)number)  ALTERA_PIO_WIDTH;

Same here...

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


Re: [U-Boot] [PATCH 15/28] Blackfin: fix bd_t handling

2010-12-27 Thread Sergei Shtylyov
Hello.

On 27-12-2010 7:48, Mike Frysinger wrote:

 The recent global data changes (making the size autogenerated) broke the
 board info handling on Blackfin ports as we were lying and lumping the
 bd_t size in with the gd_t size.  So use the new dedicated bd_t size to
 setup its own address in memory.

 Signed-off-by: Mike Frysingervap...@gentoo.org
[...]

 diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
 index 2b1f78c..47d487f 100644
 --- a/arch/blackfin/lib/board.c
 +++ b/arch/blackfin/lib/board.c
[...]
 @@ -244,14 +243,9 @@ void board_init_f(ulong bootflag)
   gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
   memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);

 - /* Board data initialization */
 - addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
 -
 - /* Align to 4 byte boundary */
 - addr= ~(4 - 1);
 - bd = (bd_t *) addr;
 + bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);

Parens not needed around CONFIG_SYS_BD_INFO_ADDR.

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


Re: [U-Boot] [PATCH] mpq101: initial support for Mercury Computer Systems MPQ101 board

2010-12-27 Thread Wolfgang Denk
Dear Alex Dubov,

In message 25288.34605...@web37607.mail.mud.yahoo.com you wrote:
 Mpq101 is a RapidIO development board in AMC form factor, featuring MPC8548
 processor, 512MB of hardwired DDR2 RAM and 128MB of hardwired NAND flash
 memory. USB controller is available, but not presently enabled.
 
 Additional board information is available at:
 http://www.mc.com/products/boards/ensemble_mpq101_rapidio_powerquicc_iii.aspx
 
 Signed-off-by: Alex Dubov oa...@yahoo.com
 ---
  board/mercury/mpq101/Makefile  |   53 ++
  board/mercury/mpq101/config.mk |7 +
  board/mercury/mpq101/law.c |   54 ++
  board/mercury/mpq101/mpq101.c  |  167 ++
  board/mercury/mpq101/tlb.c |   82 +
  boards.cfg |1 +
  include/configs/mpq101.h   |  381 
 

Entry to MAINTAINERS missing.


 diff --git a/board/mercury/mpq101/config.mk b/board/mercury/mpq101/config.mk
 new file mode 100644
 index 000..1870680
 --- /dev/null
 +++ b/board/mercury/mpq101/config.mk
 @@ -0,0 +1,7 @@
 +#
 +# mpq101 board
 +#
 +
 +# Make room for environment at the beginning of flash sector
 +CONFIG_SYS_TEXT_BASE = 0xfffc0800
 +LDFLAGS += --section-start=.ppcenv=$(CONFIG_ENV_ADDR)

Please mode defines to board config file and get rid of config.mk

 +phys_size_t
 +initdram (int board_type)
 +{
...
 + dram_size = setup_ddr_tlbs(1ull  (CONFIG_SYS_SDRAM_SIZE_LOG - 20));
 +
 + puts(DDR: );
 +
 + return dram_size  20;

You should use get_ram_size().

 +local_bus_init(void)
 +{
 + volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 + volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
 +
 + uint clkdiv;
 + uint lbc_hz;
 + sys_info_t sysinfo;
 +
 + get_sys_info(sysinfo);
 + clkdiv = (lbc-lcrr  LCRR_CLKDIV) * 2;
 + lbc_hz = sysinfo.freqSystemBus / 100 / clkdiv;
 +
 + gur-lbiuiplldcr1 = 0x00078080;
 + if (clkdiv == 16) {
 + gur-lbiuiplldcr0 = 0x7c0f1bf0;
 + } else if (clkdiv == 8) {
 + gur-lbiuiplldcr0 = 0x6c0f1bf0;
 + } else if (clkdiv == 4) {
 + gur-lbiuiplldcr0 = 0x5c0f1bf0;
 + }
 +
 + lbc-lcrr |= 0x0003;
 + asm(sync;isync;msync);
 +
 + lbc-ltesr = 0x;/* Clear LBC error interrupts */
 + lbc-lteir = 0x;/* Enable LBC error interrupts */

NAK.  Please use proper I/O accessors.

...
 +#define CONFIG_SYS_LOAD_ADDR   0x200   /* default load address */
...
 +#define CONFIG_LOADADDR  100 /*default location for tftp and bootm*/

You probably want to make this consistent.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You can only live once, but if you do it right, once is enough.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] nios2: add gpio_is_valid

2010-12-27 Thread Thomas Chou
On 12/27/2010 07:35 PM, Sergei Shtylyov wrote:
 Hello.

 On 27-12-2010 5:46, Thomas Chou wrote:

 Signed-off-by: Thomas Choutho...@wytron.com.tw
 [...]

 diff --git a/arch/nios2/include/asm/gpio.h
 b/arch/nios2/include/asm/gpio.h
 index 36a7132..4b21c8f 100644
 --- a/arch/nios2/include/asm/gpio.h
 +++ b/arch/nios2/include/asm/gpio.h
 @@ -52,6 +52,11 @@ static inline void gpio_set_value(unsigned gpio,
 int value)
 {
 writel(value ? 3 : 2, CONFIG_SYS_GPIO_BASE + (gpio 2));
 }
 +
 +static inline int gpio_is_valid(int number)
 +{
 + return ((unsigned)number)  CONFIG_SYS_GPIO_WIDTH;

 No need to have parens around '(unsigned)number'.

 diff --git a/board/altera/nios2-generic/gpio.c
 b/board/altera/nios2-generic/gpio.c
 index 8c639ce..4a30564 100644
 --- a/board/altera/nios2-generic/gpio.c
 +++ b/board/altera/nios2-generic/gpio.c
 [...]
 @@ -62,4 +63,9 @@ void gpio_set_value(unsigned gpio, int value)
 pio_data_reg= ~mask;
 writel(pio_data_reg, ALTERA_PIO_DATA);
 }
 +
 +int gpio_is_valid(int number)
 +{
 + return ((unsigned)number)  ALTERA_PIO_WIDTH;

 Same here...

 WBR, Sergei


Hi Sergei,

The casting is needed as the arg is type int, and we might use -1 to 
indicate no-such-gpio as they come from linux asm-generic/gpio.h.

Best regards,
Thomas

/*
  * valid GPIO numbers are nonnegative and may be passed to
  * setup routines like gpio_request().  only some valid numbers
  * can successfully be requested and used.
  *
  * Invalid GPIO numbers are useful for indicating no-such-GPIO in
  * platform data and other tables.
  */

static inline int gpio_is_valid(int number)
{
return ((unsigned)number)  ARCH_NR_GPIOS;
}

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


Re: [U-Boot] [PATCH 15/28] Blackfin: fix bd_t handling

2010-12-27 Thread Mike Frysinger
On Monday, December 27, 2010 06:41:47 Sergei Shtylyov wrote:
 On 27-12-2010 7:48, Mike Frysinger wrote:
  +   bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
 
 Parens not needed around CONFIG_SYS_BD_INFO_ADDR.

it isnt a problem to have the parens, and it keeps things sane if someone does 
something like:
#define CONFIG_SYS_BD_INFO_ADDR   SOME_DEFINE + 0x1000
-mike


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


Re: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this

2010-12-27 Thread Mike Frysinger
On Monday, December 27, 2010 05:47:54 Wolfgang Denk wrote:
 Nobuhiro Iwamatsu wrote:
  This move linker option used by the last of u-boot in LDFLAGS_u-boot
  variable. And the option to use in ld uses LDFLAGS variable.
 
 Can you please explain why this would be needed?

he explained in the previous thread why we need to split things.  there are 
flags that are needed for all linker options and there are flags needed just 
for the final u-boot link.

  -LDFLAGS += --gc-sections -m elf32bfin
  +LDFLAGS_u-boot += --gc-sections
 
 The name LDFLAGS_u-boot may actually work here, but iut is
 inconsistent with other such variables names, and using '-' in a name
 is probably not a good idea either.

it isnt inconsistent.  the convention is $(XFLAGS_$(@F)) and we just happen to 
be creating a file here which is named u-boot.  dashes in variable names 
isnt a problem for make.  otherwise you're basically banning creating files in 
the u-boot tree with dashes in their filenames.
-mike


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


[U-Boot] Auto_complete issue with u-boot version v2010.12

2010-12-27 Thread Михаил
Hi,

I found that config_auto_complete feature have no correct functional
since this version (version v2010.09 is ok).
Some part of my board's header file:
...
#define CONFIG_AUTO_COMPLETE
#define CONFIG_SYS_HUSH_PARSER
#define CONFIG_EXTRA_ENV_SETTING \
_kernel=tf uImage; er FE00 +$filesize; cp.b $fileaddr FE00
$filesize\0 \
...
So i type in commandline
= run _k
and press [tab] key for command completion.
And no result i see, but previous u-boot version auto_complete feature
works fine.
Can anyone confirm this malfunction?

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


Re: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this

2010-12-27 Thread Wolfgang Denk
Dear Mike Frysinger,

In message 201012271146.22205.vap...@gentoo.org you wrote:

  Nobuhiro Iwamatsu wrote:
   This move linker option used by the last of u-boot in LDFLAGS_u-boot
   variable. And the option to use in ld uses LDFLAGS variable.
  
  Can you please explain why this would be needed?

 he explained in the previous thread why we need to split things.  there are 
 flags that are needed for all linker options and there are flags needed just 
 for the final u-boot link.

Such an explanation belongs into the commit message.

   -LDFLAGS += --gc-sections -m elf32bfin
   +LDFLAGS_u-boot += --gc-sections
  
  The name LDFLAGS_u-boot may actually work here, but iut is
  inconsistent with other such variables names, and using '-' in a name
  is probably not a good idea either.

 it isnt inconsistent.  the convention is $(XFLAGS_$(@F)) and we just happen 
 to 

Can you please point me to an example where this has been used in
U-Boot before?  Or why do you call this a convention?

I fail to see a reason this is needed or even useful here.

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 sight of death frightens them [Earthers].
-- Kras the Klingon, Friday's Child, stardate 3497.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Auto_complete issue with u-boot version v2010.12

2010-12-27 Thread Wolfgang Denk
Dear =?KOI8-R?B?7cnIwcnM?=,

In message aanlktikac=ck_6pmqehhhp5zgn_jq4jeflpuvzeku...@mail.gmail.com you 
wrote:
 
 I found that config_auto_complete feature have no correct functional
 since this version (version v2010.09 is ok).
...
 Can anyone confirm this malfunction?

It is expected behaviour. See TODO item 2 for commit ea882ba, and
not-yet-added patch http://patchwork.ozlabs.org/patch/75995/

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 in any problem you find yourself doing an immense amount of  work,
the answer can be obtained by simple inspection.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this

2010-12-27 Thread Mike Frysinger
On Monday, December 27, 2010 13:58:08 Wolfgang Denk wrote:
 Mike Frysinger wrote:
   Nobuhiro Iwamatsu wrote:
This move linker option used by the last of u-boot in LDFLAGS_u-boot
variable. And the option to use in ld uses LDFLAGS variable.
   
   Can you please explain why this would be needed?
  
  he explained in the previous thread why we need to split things.  there
  are flags that are needed for all linker options and there are flags
  needed just for the final u-boot link.
 
 Such an explanation belongs into the commit message.

yes, but that isnt what you asked

-LDFLAGS += --gc-sections -m elf32bfin
+LDFLAGS_u-boot += --gc-sections
   
   The name LDFLAGS_u-boot may actually work here, but iut is
   inconsistent with other such variables names, and using '-' in a name
   is probably not a good idea either.
  
  it isnt inconsistent.  the convention is $(XFLAGS_$(@F)) and we just
  happen to
 
 Can you please point me to an example where this has been used in
 U-Boot before?  Or why do you call this a convention?

(1) it's what's used in Linux and every build system based on that (kbuild)
(2) u-boot is slowly moving to the conventions already in use by Linux
(3) u-boot already uses this specific convention for every .c/.s/.S file -- 
simply look at the bottom of config.mk

it makes perfect sense to keep the existing syntax and extend LDFLAGS behavior 
to it rather than coming up with some new specific variable that only applies 
to the final link of u-boot.  otherwise every other final link we have in u-
boot will need its own random style (examples, standalone, spl, ...).
-mike


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


Re: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this

2010-12-27 Thread Wolfgang Denk
Dear Mike Frysinger,

In message 201012271511.54110.vap...@gentoo.org you wrote:

Nobuhiro Iwamatsu wrote:
 This move linker option used by the last of u-boot in LDFLAGS_u-boot
 variable. And the option to use in ld uses LDFLAGS variable.

Can you please explain why this would be needed?
   
   he explained in the previous thread why we need to split things.  there
   are flags that are needed for all linker options and there are flags
   needed just for the final u-boot link.
  
  Such an explanation belongs into the commit message.

 yes, but that isnt what you asked

This is just your quibblerish interpretation.

   it isnt inconsistent.  the convention is $(XFLAGS_$(@F)) and we just
   happen to
  
  Can you please point me to an example where this has been used in
  U-Boot before?  Or why do you call this a convention?

 (1) it's what's used in Linux and every build system based on that (kbuild)

So let's out on record that this is NOT an accepted convention in U-Boot.

 (2) u-boot is slowly moving to the conventions already in use by Linux

Oh, is it?

 (3) u-boot already uses this specific convention for every .c/.s/.S file --  
 simply look at the bottom of config.mk

Well, applying your strict interpretation I see this:

...
258 #
259
260 # If the list of objects to link is empty, just create an empty built-in.o
261 cmd_link_o_target = $(if $(strip $1),\
262   $(LD) -r -o $@ $1 ,\
263   rm -f $@; $(AR) rcs $@ )
264
265 #

And I see no trace of any $(XFLAGS_$(@F)) there.

Actually I see no trace of any $(XFLAGS_$(@F)) anywhere; the closest we have is 
this:

245 ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
246 ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))


 it makes perfect sense to keep the existing syntax and extend LDFLAGS 
 behavior 
 to it rather than coming up with some new specific variable that only applies 
 to the final link of u-boot.  otherwise every other final link we have in u-
 boot will need its own random style (examples, standalone, spl, ...).

Maybe you a are even right. But you might find it easier to get your
arguments considered if you'd use a more constructive way to present
it.


And in any way, my statementt was and is that such explanations must
be included with the commit message.   Period.

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
Bei genauerem Hinsehen ist die  Arbeit  weniger  langweilig  als  das
Vergnügen.  -- Charles Baudelaire
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] OMAP[34]: fix broken timer

2010-12-27 Thread John Rigby
As implemented now the timer used to implement __udelay counts
to 0x and then gets stuck there because the the programmed
reload value is 0x.  This value is not only wrong but
illegal according to the reference manual.

One can reproduce the bug by leaving a board at the u-boot prompt
for sometime then issuing a sleep command.  The sleep will hang
forever.

The timer is a count up timer that reloads as it rolls over
from 0x so the correct load value is 0.

Change TIMER_LOAD_VAL from 0x to 0 and introduce
a new constant called TIMER_OVERFLOW_VAL set to 0x.

Signed-off-by: John Rigby john.ri...@linaro.org
---
 arch/arm/cpu/armv7/omap-common/timer.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/timer.c 
b/arch/arm/cpu/armv7/omap-common/timer.c
index 9beebb1..59bbca8 100644
--- a/arch/arm/cpu/armv7/omap-common/timer.c
+++ b/arch/arm/cpu/armv7/omap-common/timer.c
@@ -43,8 +43,9 @@ static struct gptimer *timer_base = (struct gptimer 
*)CONFIG_SYS_TIMERBASE;
  * Nothing really to do with interrupts, just starts up a counter.
  */
 
-#define TIMER_CLOCK(V_SCLK / (2  CONFIG_SYS_PTV))
-#define TIMER_LOAD_VAL 0x
+#define TIMER_CLOCK(V_SCLK / (2  CONFIG_SYS_PTV))
+#define TIMER_OVERFLOW_VAL 0x
+#define TIMER_LOAD_VAL 0
 
 int timer_init(void)
 {
@@ -86,7 +87,7 @@ void __udelay(unsigned long usec)
while (tmo  0) {
now = readl(timer_base-tcrr);
if (last  now) /* count up timer overflow */
-   tmo -= TIMER_LOAD_VAL - last + now;
+   tmo -= TIMER_OVERFLOW_VAL - last + now + 1;
else
tmo -= now - last;
last = now;
-- 
1.7.3.1.120.g38a18

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


[U-Boot] [RFC PATCH 0/8] Add nand_spl support for TI OMAP Beagle

2010-12-27 Thread John Rigby
This patch series adds the ability to boot a beagle board from
nand without x-loader.  A future addition will add mmc boot 
support. 

John Rigby (8):
  NAND: nand_spl/nand_boot.c: add 16-bit and readid support
  armv7: add nand_spl support
  OMAP3: and nand_spl support
  OMAP3: add dram timing constants from x-loader
  NAND: omap_gpmc.c: add nand_spl support
  omap3_beagle: add nand_spl support
  mkimage: Add OMAP boot image support
  OMAP3: Add ift target to top level Makefile

 Makefile |9 +
 arch/arm/cpu/armv7/omap3/board.c |4 +
 arch/arm/cpu/armv7/omap3/clock.c |3 +
 arch/arm/cpu/armv7/omap3/gpio.c  |5 +
 arch/arm/cpu/armv7/omap3/lowlevel_init.S |2 +-
 arch/arm/cpu/armv7/omap3/mem.c   |2 +
 arch/arm/cpu/armv7/omap3/sys_info.c  |6 +-
 arch/arm/cpu/armv7/start.S   |   45 ++-
 arch/arm/include/asm/arch-omap3/mem.h|   45 ++
 board/ti/beagle/beagle_nand_spl.c|  250 ++
 boards.cfg   |1 +
 common/image.c   |1 +
 drivers/mtd/nand/omap_gpmc.c |   36 +
 include/configs/omap3_beagle.h   |   39 +
 include/image.h  |1 +
 include/nand.h   |3 +
 nand_spl/board/ti/beagle/Makefile|  138 
 nand_spl/board/ti/beagle/u-boot.lds  |   74 +
 nand_spl/nand_boot.c |  134 +---
 tools/Makefile   |2 +
 tools/mkimage.c  |2 +
 tools/omapimage.c|  226 +++
 tools/omapimage.h|   50 ++
 23 files changed, 1049 insertions(+), 29 deletions(-)
 create mode 100644 board/ti/beagle/beagle_nand_spl.c
 create mode 100644 nand_spl/board/ti/beagle/Makefile
 create mode 100644 nand_spl/board/ti/beagle/u-boot.lds
 create mode 100644 tools/omapimage.c
 create mode 100644 tools/omapimage.h

-- 
1.7.3.1.120.g38a18

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


[U-Boot] [RFC PATCH 1/8] NAND: nand_spl/nand_boot.c: add 16-bit and readid support

2010-12-27 Thread John Rigby
Some platforms read the nand type to make configuration
choices.  For example, some versions of OMAP3 Beagle use
the NAND type as a hint of the DRAM type.

Turn readid support on with CONFIG_SYS_NAND_BOOT_READID

Add 16-bit nand support.
Turn it on with CONFIG_SYS_NAND_BUSWIDTH_16

Signed-off-by: John Rigby john.ri...@linaro.org
CC: Scott Wood scootw...@freescale.com
---
 include/nand.h   |3 +
 nand_spl/nand_boot.c |  134 -
 2 files changed, 112 insertions(+), 25 deletions(-)

diff --git a/include/nand.h b/include/nand.h
index a452411..3c6237a 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -130,6 +130,9 @@ int nand_get_lock_status(nand_info_t *meminfo, loff_t 
offset);
 void board_nand_select_device(struct nand_chip *nand, int chip);
 #endif
 
+#ifdef CONFIG_SYS_NAND_BOOT_READID
+int nand_boot_readid(int *manf_id, int *dev_id);
+#endif
 __attribute__((noreturn)) void nand_boot(void);
 
 #endif
diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c
index 76b8566..1ae2cd0 100644
--- a/nand_spl/nand_boot.c
+++ b/nand_spl/nand_boot.c
@@ -27,6 +27,15 @@
 
 static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS;
 
+static uint8_t nand_read_byte(struct nand_chip *chip)
+{
+#ifndef CONFIG_SYS_NAND_BUSWIDTH_16
+   return readb(chip-IO_ADDR_R);
+#else
+   return (uint8_t) cpu_to_le16(readw(chip-IO_ADDR_R));
+#endif
+}
+
 #if (CONFIG_SYS_NAND_PAGE_SIZE = 512)
 /*
  * NAND command for small page NAND devices (512)
@@ -46,6 +55,9 @@ static int nand_command(struct mtd_info *mtd, int block, int 
page, int offs, u8
this-cmd_ctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
/* Set ALE and clear CLE to start address cycle */
/* Column address */
+#ifdef CONFIG_SYS_NAND_BUSWIDTH_16
+   offs = 1;
+#endif
this-cmd_ctrl(mtd, offs, NAND_CTRL_ALE | NAND_CTRL_CHANGE);
this-cmd_ctrl(mtd, page_addr  0xff, NAND_CTRL_ALE); /* A[16:9] */
this-cmd_ctrl(mtd, (page_addr  8)  0xff,
@@ -94,6 +106,9 @@ static int nand_command(struct mtd_info *mtd, int block, int 
page, int offs, u8
this-cmd_ctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
/* Set ALE and clear CLE to start address cycle */
/* Column address */
+#ifdef CONFIG_SYS_NAND_BUSWIDTH_16
+   offs = 1;
+#endif
this-cmd_ctrl(mtd, offs  0xff,
   NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */
this-cmd_ctrl(mtd, (offs  8)  0xff, NAND_CTRL_ALE); /* A[11:9] */
@@ -128,17 +143,27 @@ static int nand_is_bad_block(struct mtd_info *mtd, int 
block)
 {
struct nand_chip *this = mtd-priv;
 
+#ifndef CONFIG_SYS_NAND_BUSWIDTH_16
+   bad = 0;
nand_command(mtd, block, 0, CONFIG_SYS_NAND_BAD_BLOCK_POS, 
NAND_CMD_READOOB);
-
-   /*
-* Read one byte
-*/
if (readb(this-IO_ADDR_R) != 0xff)
return 1;
-
+#else
+   u16 bad;
+   nand_command(mtd, block, 0, CONFIG_SYS_NAND_BAD_BLOCK_POS  0xFE, 
NAND_CMD_READOOB);
+   bad = cpu_to_le16(readw(this-IO_ADDR_R));
+   if (CONFIG_SYS_NAND_BAD_BLOCK_POS  0x1)
+   bad  8;
+   if ((bad  0xff) != 0xff)
+   return 1;
+#endif
return 0;
 }
 
+#ifndef CONFIG_SYS_NAND_BOOT_ECC_SCRATCH
+#define CONFIG_SYS_NAND_BOOT_ECC_SCRATCH 0x1
+#endif
+
 static int nand_read_page(struct mtd_info *mtd, int block, int page, uchar 
*dst)
 {
struct nand_chip *this = mtd-priv;
@@ -222,47 +247,54 @@ static int nand_load(struct mtd_info *mtd, unsigned int 
offs,
 }
 
 /*
+ * Get ready for booting from NAND.  This is for platforms
+ * that need to read nand data or nand chip id's before initializing
+ * SDRAM.
+ */
+void nand_boot_init(struct nand_chip *nand_chip, nand_info_t (*nand_info))
+{
+   /*
+* Init board specific nand support
+*/
+   nand_chip-select_chip = NULL;
+   nand_info-priv = nand_chip;
+   nand_chip-IO_ADDR_R = nand_chip-IO_ADDR_W = (void  __iomem 
*)CONFIG_SYS_NAND_BASE;
+   nand_chip-dev_ready = NULL;/* preset to NULL */
+   board_nand_init(nand_chip);
+
+   if (nand_chip-select_chip)
+   nand_chip-select_chip(nand_info, 0);
+
+}
+
+/*
  * The main entry for NAND booting. It's necessary that SDRAM is already
  * configured and available since this code loads the main U-Boot image
  * from NAND into SDRAM and starts it from there.
  */
-void nand_boot(void)
+void nand_boot_tail(struct nand_chip *nand_chip, nand_info_t *nand_info)
 {
-   struct nand_chip nand_chip;
-   nand_info_t nand_info;
int ret;
__attribute__((noreturn)) void (*uboot)(void);
 
/*
-* Init board specific nand support
-*/
-   nand_chip.select_chip = NULL;
-   nand_info.priv = nand_chip;
-   nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W = (void  __iomem 
*)CONFIG_SYS_NAND_BASE;
-   nand_chip.dev_ready = NULL; /* preset to NULL */
-   board_nand_init(nand_chip);
-
-   if 

[U-Boot] [RFC PATCH 2/8] armv7: add nand_spl support

2010-12-27 Thread John Rigby
Signed-off-by: John Rigby john.ri...@linaro.org
---
 arch/arm/cpu/armv7/start.S |   45 +++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 684f2d2..17b86e1 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -35,6 +35,27 @@
 
 .globl _start
 _start: b  reset
+#ifdef CONFIG_PRELOADER
+/* No exception handlers in preloader */
+   ldr pc, _hang
+   ldr pc, _hang
+   ldr pc, _hang
+   ldr pc, _hang
+   ldr pc, _hang
+   ldr pc, _hang
+   ldr pc, _hang
+
+_hang:
+   .word   do_hang
+/* pad to 64 byte boundary */
+   .word   0x12345678
+   .word   0x12345678
+   .word   0x12345678
+   .word   0x12345678
+   .word   0x12345678
+   .word   0x12345678
+   .word   0x12345678
+#else
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
@@ -54,6 +75,7 @@ _pad: .word 0x12345678 /* now 16*4=64 */
 .global _end_vect
 _end_vect:
 
+#endif
.balignl 16,0xdeadbeef
 /*
  *
@@ -127,7 +149,7 @@ next:
stmia   r1!, {r3 - r10} @ copy to   target address [r1]
cmp r0, r2  @ until source end address [r2]
bne next@ loop until equal */
-#if !defined(CONFIG_SYS_NAND_BOOT)  !defined(CONFIG_SYS_ONENAND_BOOT)
+#if !defined(CONFIG_NAND_U_BOOT)  !defined(CONFIG_ONENAND_U_BOOT)
/* No need to copy/exec the clock code - DPLL adjust already done
 * in NAND/oneNAND Boot.
 */
@@ -240,6 +262,13 @@ clbss_l:strr2, [r0]/* clear 
loop...*/
  * We are done. Do not return, instead branch to second part of board
  * initialization, now running from RAM.
  */
+#ifdef CONFIG_NAND_SPL
+   ldr r0, _nand_boot_ofs
+   mov pc, r0
+
+_nand_boot_ofs:
+   .word nand_boot
+#else
 jump_2_ram:
ldr r0, _board_init_r_ofs
adr r1, _start
@@ -253,6 +282,7 @@ jump_2_ram:
 
 _board_init_r_ofs:
.word board_init_r - _start
+#endif
 
 _rel_dyn_start_ofs:
.word __rel_dyn_start - _start
@@ -269,6 +299,7 @@ _dynsym_start_ofs:
  * setup memory timing
  *
  */
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 cpu_init_crit:
/*
 * Invalidate L1 I/D
@@ -297,6 +328,9 @@ cpu_init_crit:
bl  lowlevel_init   @ go setup pll,mux,memory
mov lr, ip  @ restore link
mov pc, lr  @ back to my caller
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
+
+#ifndef CONFIG_PRELOADER
 /*
  *
  *
@@ -419,10 +453,18 @@ cpu_init_crit:
.macro get_fiq_stack@ setup FIQ stack
ldr sp, FIQ_STACK_START
.endm
+#endif /* CONFIG_PRELOADER */
 
 /*
  * exception handlers
  */
+#ifdef CONFIG_PRELOADER
+   .align  5
+do_hang:
+   ldr sp, _TEXT_BASE  /* switch to abort stack */
+1:
+   bl  1b  /* hang and never return */
+#else  /* !CONFIG_PRELOADER */
.align  5
 undefined_instruction:
get_bad_stack
@@ -485,3 +527,4 @@ fiq:
bl  do_fiq
 
 #endif
+#endif /* CONFIG_PRELOADER */
-- 
1.7.3.1.120.g38a18

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


[U-Boot] [RFC PATCH 4/8] OMAP3: add dram timing constants from x-loader

2010-12-27 Thread John Rigby
Signed-off-by: John Rigby john.ri...@linaro.org
---
 arch/arm/include/asm/arch-omap3/mem.h |   45 +
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap3/mem.h 
b/arch/arm/include/asm/arch-omap3/mem.h
index f165949..970e8b4 100644
--- a/arch/arm/include/asm/arch-omap3/mem.h
+++ b/arch/arm/include/asm/arch-omap3/mem.h
@@ -54,6 +54,29 @@ enum {
 #define SDP_SDRC_DLLAB_CTRL((DLL_ENADLL  3) | \
(DLL_LOCKDLL  2) | (DLL_DLLPHASE_90  1))
 
+#define SDP_3430_SDRC_RFR_CTRL_165MHz   0x0004e201 /* 7.8us/6ns - 50=0x4e2 */
+#define SDP_3430_SDRC_RFR_CTRL_200MHz   0x0005e601 /* 7.8us/5ns - 50=0x5e6 */
+
+/* set the 343x-SDRC incoming address convention */
+#if defined(SDRC_B_R_C)
+#define B_ALL  (0  6)/* bank-row-column */
+#elif defined(SDRC_B1_R_B0_C)
+#define B_ALL  (1  6)/* bank1-row-bank0-column */
+#elif defined(SDRC_R_B_C)
+#define B_ALL  (2  6)/* row-bank-column */
+#endif
+
+
+#define SDP_SDRC_MDCFG_0_DDR   (0x02584019|B_ALL)
+#define SDP_SDRC_MDCFG_0_DDR_MICRON_XM (0x03588019|B_ALL)
+#define SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM(0x04590019|B_ALL)
+
+#define SDP_SDRC_MR_0_DDR  0x0032
+/* Diabling power down mode using CKE pin */
+#define SDP_SDRC_POWER_POP  0x0081
+
+
+
 /* Infineon part of 3430SDP (165MHz optimized) 6.06ns
  *   ACTIMA
  * TDAL = Twr/Tck + Trp/tck = 15/6 + 18/6 = 2.5 + 3 = 5.5 - 6
@@ -167,6 +190,28 @@ enum {
(NUMONYX_XSR_165  0) | (NUMONYX_TXP_165  8) | \
(NUMONYX_TWTR_165  16))
 
+/* Micron part (200MHz optimized) 5 ns
+  */
+#define MICRON_TDAL_200   6
+#define MICRON_TDPL_200   3
+#define MICRON_TRRD_200   2
+#define MICRON_TRCD_200   3
+#define MICRON_TRP_2003
+#define MICRON_TRAS_200   8
+#define MICRON_TRC_200   11
+#define MICRON_TRFC_200  15
+#define MICRON_V_ACTIMA_200 ((MICRON_TRFC_200  27) | (MICRON_TRC_200  22) 
| (MICRON_TRAS_200  18) \
+   | (MICRON_TRP_200  15) | (MICRON_TRCD_200  12) 
|(MICRON_TRRD_200  9) | \
+   (MICRON_TDPL_200  6) | (MICRON_TDAL_200))
+
+#define MICRON_TWTR_200   2
+#define MICRON_TCKE_200   4
+#define MICRON_TXP_2002
+#define MICRON_XSR_200   23
+#define MICRON_V_ACTIMB_200 ((MICRON_TCKE_200  12) | (MICRON_XSR_200  0)) 
| \
+   (MICRON_TXP_200  8) | (MICRON_TWTR_200  16)
+
+
 #ifdef CONFIG_OMAP3_INFINEON_DDR
 #define V_ACTIMA_165 INFINEON_V_ACTIMA_165
 #define V_ACTIMB_165 INFINEON_V_ACTIMB_165
-- 
1.7.3.1.120.g38a18

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


[U-Boot] [RFC PATCH 5/8] NAND: omap_gpmc.c: add nand_spl support

2010-12-27 Thread John Rigby
Signed-off-by: John Rigby john.ri...@linaro.org
CC: Scott Wood scootw...@freescale.com
---
 drivers/mtd/nand/omap_gpmc.c |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 99b9cef..4c76544 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -29,6 +29,28 @@
 #include linux/mtd/nand_ecc.h
 #include nand.h
 
+#ifdef CONFIG_NAND_SPL
+/* in the early stage of NAND flash booting, printf() is not available */
+#define printf(fmt, args...)
+
+static void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
+{
+   int i;
+   struct nand_chip *chip = mtd-priv;
+
+#ifndef CONFIG_SYS_NAND_BUSWIDTH_16
+   for (i = 0; i  len; i++)
+   buf[i] = readb(chip-IO_ADDR_R);
+#else
+   u16 *p = (u16 *) buf;
+
+   len = 1;
+   for (i = 0; i  len; i++)
+   p[i] = readw(chip-IO_ADDR_R);
+#endif
+}
+#endif
+
 static uint8_t cs;
 static struct nand_ecclayout hw_nand_oob = GPMC_NAND_HW_ECC_LAYOUT;
 
@@ -224,6 +246,7 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int32_t 
mode)
}
 }
 
+#ifndef CONFIG_NAND_SPL
 /*
  * omap_nand_switch_ecc - switch the ECC operation b/w h/w ecc and s/w ecc.
  * The default is to come up on s/w ecc
@@ -280,6 +303,7 @@ void omap_nand_switch_ecc(int32_t hardware)
 
nand-options = ~NAND_OWN_BUFFERS;
 }
+#endif
 
 /*
  * Board-specific NAND initialization. The following members of the
@@ -337,8 +361,20 @@ int board_nand_init(struct nand_chip *nand)
nand-options |= NAND_BUSWIDTH_16;
 
nand-chip_delay = 100;
+#ifndef CONFIG_NAND_SPL
/* Default ECC mode */
nand-ecc.mode = NAND_ECC_SOFT;
+#else
+nand-ecc.mode = NAND_ECC_HW;
+nand-ecc.layout = hw_nand_oob;
+nand-ecc.size = 512;
+nand-ecc.bytes = 3;
+nand-ecc.hwctl = omap_enable_hwecc;
+nand-ecc.correct = omap_correct_data;
+nand-ecc.calculate = omap_calculate_ecc;
+   nand-read_buf = nand_read_buf;
+omap_hwecc_init(nand);
+#endif
 
return 0;
 }
-- 
1.7.3.1.120.g38a18

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


[U-Boot] [RFC PATCH 6/8] omap3_beagle: add nand_spl support

2010-12-27 Thread John Rigby
Signed-off-by: John Rigby john.ri...@linaro.org
---
 board/ti/beagle/beagle_nand_spl.c   |  250 +++
 boards.cfg  |1 +
 include/configs/omap3_beagle.h  |   39 ++
 nand_spl/board/ti/beagle/Makefile   |  138 +++
 nand_spl/board/ti/beagle/u-boot.lds |   74 ++
 5 files changed, 502 insertions(+), 0 deletions(-)
 create mode 100644 board/ti/beagle/beagle_nand_spl.c
 create mode 100644 nand_spl/board/ti/beagle/Makefile
 create mode 100644 nand_spl/board/ti/beagle/u-boot.lds

diff --git a/board/ti/beagle/beagle_nand_spl.c 
b/board/ti/beagle/beagle_nand_spl.c
new file mode 100644
index 000..4b4ebde
--- /dev/null
+++ b/board/ti/beagle/beagle_nand_spl.c
@@ -0,0 +1,250 @@
+/*
+ * (C) Copyright 2010
+ * Linaro www.linaro.org
+ * John Rigby john.ri...@linaro.org
+ *
+ * Adapted from x-loader omap3530beagle.c:
+ *   (C) Copyright 2006
+ *   Texas Instruments, www.ti.com
+ *   Jian Zhang jzh...@ti.com
+ *   Richard Woodruff r-woodru...@ti.com
+ *
+ * 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 common.h
+#include nand.h
+#include asm/arch/gpio.h
+#include asm/arch/cpu.h
+#include asm/arch/mem.h
+#include asm/arch/mux.h
+#include asm/arch/sys_proto.h
+#include asm/io.h
+#include asm/mach-types.h
+#include beagle.h
+
+void board_init_f(unsigned long bootflag)
+{
+   nand_boot();
+}
+
+/*
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ * hardware. Many pins need to be moved from protect to primary
+ * mode.
+ */
+void set_muxconf_regs(void)
+{
+   MUX_BEAGLE();
+}
+
+/*
+ * beagle_identify
+ * Description: Detect if we are running on a Beagle revision Ax/Bx,
+ * C1/2/3, C4 or D. This can be done by reading
+ * the level of GPIO173, GPIO172 and GPIO171. This should
+ * result in
+ * GPIO173, GPIO172, GPIO171: 1 1 1 = Ax/Bx
+ * GPIO173, GPIO172, GPIO171: 1 1 0 = C1/2/3
+ * GPIO173, GPIO172, GPIO171: 1 0 1 = C4
+ * GPIO173, GPIO172, GPIO171: 0 0 0 = XM
+ *
+ */
+int beagle_revision(void)
+{
+   int rev;
+
+   omap_request_gpio(171);
+   omap_request_gpio(172);
+   omap_request_gpio(173);
+   omap_set_gpio_direction(171, 1);
+   omap_set_gpio_direction(172, 1);
+   omap_set_gpio_direction(173, 1);
+
+   rev = omap_get_gpio_datain(173)  2 |
+   omap_get_gpio_datain(172)  1 |
+   omap_get_gpio_datain(171);
+   omap_free_gpio(171);
+   omap_free_gpio(172);
+   omap_free_gpio(173);
+
+   return rev;
+}
+
+static const u32 gpmc_m_nand[GPMC_MAX_REG] = {
+   M_NAND_GPMC_CONFIG1,
+   M_NAND_GPMC_CONFIG2,
+   M_NAND_GPMC_CONFIG3,
+   M_NAND_GPMC_CONFIG4,
+   M_NAND_GPMC_CONFIG5,
+   M_NAND_GPMC_CONFIG6, 0
+};
+
+static void gpmc_nand_init(void)
+{
+   gpmc_cfg = (struct gpmc *)GPMC_BASE;
+   const u32 *gpmc_config = NULL;
+   u32 base = 0;
+   u32 size = 0;
+   u32 config = 0;
+
+   /* global settings */
+   writel(0, gpmc_cfg-irqenable); /* isr's sources masked */
+   writel(0, gpmc_cfg-timeout_control);/* timeout disable */
+
+   config = readl(gpmc_cfg-config);
+   config = (~0xf00);
+   writel(config, gpmc_cfg-config);
+
+   /*
+* Disable the GPMC0 config set by ROM code
+* It conflicts with our MPDB (both at 0x0800)
+*/
+   writel(0, gpmc_cfg-cs[0].config7);
+   sdelay(1000);
+
+   gpmc_config = gpmc_m_nand;
+
+   base = PISMO1_NAND_BASE;
+   size = PISMO1_NAND_SIZE;
+   enable_gpmc_cs_config(gpmc_config, gpmc_cfg-cs[0], base, size);
+}
+
+#define MICRON_DDR 0
+#define NUMONYX_MCP1
+int identify_xm_ddr(void)
+{
+   int mfr, id;
+
+   gpmc_nand_init();
+
+   sdelay(2000);
+
+   nand_boot_readid(mfr, id);
+   if (mfr == 0)
+   return MICRON_DDR;
+   if ((mfr == 0x20)  (id == 0xba))
+   return NUMONYX_MCP;
+   return MICRON_DDR;
+}
+
+void mem_init(void)
+{
+   struct sdrc *sdrc_base = (struct sdrc *)OMAP34XX_SDRC_BASE;
+   struct sdrc_actim 

[U-Boot] [RFC PATCH 7/8] mkimage: Add OMAP boot image support

2010-12-27 Thread John Rigby
Signed-off-by: John Rigby john.ri...@linaro.org
---
 common/image.c|1 +
 include/image.h   |1 +
 tools/Makefile|2 +
 tools/mkimage.c   |2 +
 tools/omapimage.c |  226 +
 tools/omapimage.h |   50 
 6 files changed, 282 insertions(+), 0 deletions(-)
 create mode 100644 tools/omapimage.c
 create mode 100644 tools/omapimage.h

diff --git a/common/image.c b/common/image.c
index f63a2ff..4198d76 100644
--- a/common/image.c
+++ b/common/image.c
@@ -141,6 +141,7 @@ static const table_entry_t uimage_type[] = {
{   IH_TYPE_FLATDT, flat_dt,Flat Device Tree,   },
{   IH_TYPE_KWBIMAGE,   kwbimage,   Kirkwood Boot Image,},
{   IH_TYPE_IMXIMAGE,   imximage,   Freescale i.MX Boot Image,},
+   {   IH_TYPE_OMAPIMAGE,  omapimage,  TI OMAP CH/GP Boot Image,},
{   -1, ,   ,   },
 };
 
diff --git a/include/image.h b/include/image.h
index 005e0d2..f74e2b9 100644
--- a/include/image.h
+++ b/include/image.h
@@ -157,6 +157,7 @@
 #define IH_TYPE_FLATDT 8   /* Binary Flat Device Tree Blob */
 #define IH_TYPE_KWBIMAGE   9   /* Kirkwood Boot Image  */
 #define IH_TYPE_IMXIMAGE   10  /* Freescale IMXBoot Image  */
+#define IH_TYPE_OMAPIMAGE  11  /* TI OMAP Config Header Image  */
 
 /*
  * Compression Types
diff --git a/tools/Makefile b/tools/Makefile
index 623f908..a1c4ed7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -84,6 +84,7 @@ OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
 OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o
 NOPED_OBJ_FILES-y += kwbimage.o
 NOPED_OBJ_FILES-y += imximage.o
+NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
@@ -180,6 +181,7 @@ $(obj)mkimage$(SFX):$(obj)crc32.o \
$(obj)fit_image.o \
$(obj)image.o \
$(obj)imximage.o \
+   $(obj)omapimage.o \
$(obj)kwbimage.o \
$(obj)md5.o \
$(obj)mkimage.o \
diff --git a/tools/mkimage.c b/tools/mkimage.c
index f5859d7..e2490c4 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -155,6 +155,8 @@ main (int argc, char **argv)
init_imx_image_type ();
/* Init FIT image generation/list support */
init_fit_image_type ();
+   /* Init TI OMAP Boot image generation/list support */
+   init_omap_image_type ();
/* Init Default image generation/list support */
init_default_image_type ();
 
diff --git a/tools/omapimage.c b/tools/omapimage.c
new file mode 100644
index 000..87be869
--- /dev/null
+++ b/tools/omapimage.c
@@ -0,0 +1,226 @@
+/*
+ * (C) Copyright 2010
+ * Linaro LTD, www.linaro.org
+ * Author: John Rigby john.ri...@linaro.org
+ * Based on TI's signGP.c
+ *
+ * (C) Copyright 2009
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de.
+ *
+ * (C) Copyright 2008
+ * Marvell Semiconductor www.marvell.com
+ * Written-by: Prafulla Wadaskar prafu...@marvell.com
+ *
+ * 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
+ */
+
+/* Required to obtain the getline prototype from stdio.h */
+#define _GNU_SOURCE
+
+#include mkimage.h
+#include image.h
+#include omapimage.h
+
+/* Header size is CH header rounded up to 512 bytes plus GP header */
+#define OMAP_CH_HDR_SIZE 512
+#define OMAP_GP_HDR_SIZE (sizeof(struct gp_header))
+#define OMAP_FILE_HDR_SIZE (OMAP_CH_HDR_SIZE+OMAP_GP_HDR_SIZE)
+
+static uint8_t omapimage_header[OMAP_FILE_HDR_SIZE];
+
+static int omapimage_check_image_types(uint8_t type)
+{
+   if (type == IH_TYPE_OMAPIMAGE)
+   return EXIT_SUCCESS;
+   else
+   return EXIT_FAILURE;
+}
+
+/*
+ * Only the simplest image type is currently supported:
+ * TOC pointing to CHSETTINGS
+ * TOC terminator
+ * CHSETTINGS
+ *
+ * padding to OMAP_CH_HDR_SIZE bytes
+ *
+ * gp header
+ *   size
+ *   load_addr
+ */
+static int valid_gph_size(uint32_t size)
+{
+   return size;
+}
+
+static int valid_gph_load_addr(uint32_t load_addr)
+{
+   return 

[U-Boot] [RFC PATCH 8/8] OMAP3: Add ift target to top level Makefile

2010-12-27 Thread John Rigby
Signed-off-by: John Rigby john.ri...@linaro.org
---
 Makefile |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 9055028..baf11b3 100644
--- a/Makefile
+++ b/Makefile
@@ -289,8 +289,13 @@ LDPPFLAGS += \
 
 ifeq ($(CONFIG_NAND_U_BOOT),y)
 NAND_SPL = nand_spl
+ifeq ($(CONFIG_OMAP3430),y)
+U_BOOT_SPL_IFT=u-boot-spl.ift
+ALL+=$(U_BOOT_SPL_IFT)
+else
 U_BOOT_NAND = $(obj)u-boot-nand.bin
 endif
+endif
 
 ifeq ($(CONFIG_ONENAND_U_BOOT),y)
 ONENAND_IPL = onenand_ipl
@@ -407,6 +412,10 @@ $(NAND_SPL):   $(TIMESTAMP_FILE) $(VERSION_FILE) depend
 $(U_BOOT_NAND):$(NAND_SPL) $(obj)u-boot.bin
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin  
$(obj)u-boot-nand.bin
 
+$(U_BOOT_SPL_IFT): $(NAND_SPL) $(obj)u-boot.bin
+   $(obj)tools/mkimage -T omapimage \
+   -a $(CONFIG_SYS_NAND_SPL_TEXT_BASE) -d 
$(obj)nand_spl/u-boot-spl.bin $@
+
 $(ONENAND_IPL):$(TIMESTAMP_FILE) $(VERSION_FILE) 
$(obj)include/autoconf.mk
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
 
-- 
1.7.3.1.120.g38a18

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


Re: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this

2010-12-27 Thread Mike Frysinger
On Monday, December 27, 2010 18:23:17 Wolfgang Denk wrote:
 And I see no trace of any $(XFLAGS_$(@F)) there.

it's fairly obvious that the X is for you to replace as a matching char
-mike


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


Re: [U-Boot] [PATCH] mpq101: initial support for Mercury Computer Systems MPQ101 board

2010-12-27 Thread Alex Dubov
  +phys_size_t
  +initdram (int board_type)
  +{
 ...
  +    dram_size = setup_ddr_tlbs(1ull
  (CONFIG_SYS_SDRAM_SIZE_LOG - 20));
  +
  +    puts(    DDR: );
  +
  +    return dram_size  20;
 
 You should use get_ram_size().

I still need to call setup_ddr_tlbs because get_ram_size won't do it for
me. So what get_ram_size actually does?


  +    lbc-lcrr |= 0x0003;
  +    asm(sync;isync;msync);
  +
  +    lbc-ltesr = 0x; 
       /* Clear LBC error interrupts */
  +    lbc-lteir = 0x; 
       /* Enable LBC error interrupts */
 
 NAK.  Please use proper I/O accessors.

Do you mean out_be32 and friends?
In which case, why are not these used when writing config values to DDR
registers (for instance) even in some very recently added boards, such as
p2020ds?

 
 ...
  +#define
 CONFIG_SYS_LOAD_ADDR   0x200   
    /* default load address */
 ...
  +#define CONFIG_LOADADDR  100 /*default
 location for tftp and bootm*/
 
 You probably want to make this consistent.
 
 Best regards,
 
 Wolfgang Denk
 
 -- 
 DENX Software Engineering GmbH,     MD:
 Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194
 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
 w...@denx.de
 You can only live once, but if you do it right, once is
 enough.
 


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


Re: [U-Boot] [PATCH] mpq101: initial support for Mercury Computer Systems MPQ101 board

2010-12-27 Thread Alex Dubov
  +CONFIG_SYS_TEXT_BASE = 0xfffc0800
  +LDFLAGS +=
 --section-start=.ppcenv=$(CONFIG_ENV_ADDR)
 
 Please mode defines to board config file and get rid of
 config.mk

And another question: how am I supposed to specify linker flags in the
board config file (I suppose, you mean boards.cfg). There's no examples
throughout the u-boot tree where it is done and Makefile do not seem to
peek those either (they just end up in autoconf.mk).



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


Re: [U-Boot] [RFC PATCH 0/8] Add nand_spl support for TI OMAP Beagle

2010-12-27 Thread Aneesh V
Hello John,

On Tuesday 28 December 2010 06:17 AM, John Rigby wrote:
 This patch series adds the ability to boot a beagle board from
 nand without x-loader.  A future addition will add mmc boot
 support.

I had been working on something similar for OMAP4. Basically, I have an
SPL ready for MMC on OMAP4. It's working on eMMC in raw mode, but needs
some cleanup and also addition of FAT support.

I can clean it up and send it out next week(after my vacation) if you
like.

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


[U-Boot] [PATCH] fsl_esdhc: Fix esdhc disabled problem on some platforms

2010-12-27 Thread Chenhui Zhao
Some platform's esdhc pins don't share with other function.
The eSDHC shouldn't be disabled, even if esdhc isn't defined
in hwconfig env variable.

Use CONFIG_FSL_ESDHC_PIN_MUX to fix this problem.

The problem was introduced by this commit:
commit b33433a63fe08c9e723ea15a7c7c7143bf527c6d
Author: Anton Vorontsov avoront...@ru.mvista.com
Date:   Wed Jun 10 00:25:29 2009 +0400

fsl_esdhc: Add device tree fixups

Signed-off-by: Chenhui Zhao b26...@freescale.com
Signed-off-by: Li Yang le...@freescale.com
---
 drivers/mmc/fsl_esdhc.c   |2 ++
 include/configs/MPC837XEMDS.h |1 +
 include/configs/MPC837XERDB.h |1 +
 include/configs/MPC8569MDS.h  |1 +
 4 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index cd78714..4c8caa9 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -527,10 +527,12 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
const char *compat = fsl,esdhc;
const char *status = okay;
 
+#ifdef CONFIG_FSL_ESDHC_PIN_MUX
if (!hwconfig(esdhc)) {
status = disabled;
goto out;
}
+#endif
 
do_fixup_by_compat_u32(blob, compat, clock-frequency,
   gd-sdhc_clk, 1);
diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index c237991..abccfd6 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -509,6 +509,7 @@ extern int board_pci_host_broken(void);
 
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_ESDHC_PIN_MUX
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index 385c7c3..ea3056b 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -517,6 +517,7 @@
 
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_ESDHC_PIN_MUX
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h
index 9620fd0..f4a3c2f 100644
--- a/include/configs/MPC8569MDS.h
+++ b/include/configs/MPC8569MDS.h
@@ -561,6 +561,7 @@ extern unsigned long get_clock_freq(void);
 
 #ifdef CONFIG_MMC
 #define CONFIG_FSL_ESDHC
+#define CONFIG_FSL_ESDHC_PIN_MUX
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC85xx_ESDHC_ADDR
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
-- 
1.6.4.1


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


Re: [U-Boot] [RFC PATCH 6/8] omap3_beagle: add nand_spl support

2010-12-27 Thread Aneesh V
Hello John,

On Tuesday 28 December 2010 06:17 AM, John Rigby wrote:
 snip 

 +LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 +LDFLAGS  = -Bstatic -T $(nandobj)u-boot.lds -Ttext 
 $(CONFIG_SYS_NAND_SPL_TEXT_BASE) $(PLATFORM_LDFLAGS)
 +AFLAGS   += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
 +CFLAGS   += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL

How big is the spl now? For the OMAP4 spl, using '-ffunction-sections'
and '--gc-sections' reduced the image size by 40% and helped it fit
into the SRAM bugdet. I am sure your nand_spl is already fitting in the
SRAM bugdet. But these flags may help reduce the size further. Do you
want to try it?

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


Re: [U-Boot] [PATCH v2 3/3] MX5:MX53: add initial support for MX53EVK board

2010-12-27 Thread Jason Liu
Hi, Stefano,

2010/12/27 Stefano Babic sba...@denx.de:
 On 12/22/2010 02:23 PM, Jason Liu wrote:
 Add initial support for MX53EVK board support.
 FEC, SD/MMC, UART, I2C, have been support.

 Signed-off-by: Jason Liu r64...@freescale.com

 ---
 Changes for v2:
 -Address the comments from Stefano, Albert and Wolfgang,
         -remove the ivt.S file and use imximage.cfg instead,
         -remove the ivt link to u-boot
 -Address the comments from Stefano,
         -Correct the copyright issue,
         -Use mxc_get_gpio() and mxc_set_gpio() accessors.
         -Get rid of system_rev,
         -use i2c enumeration value (0,1,..N) instead of BASE address,
         -use fsl_pmic i2c interface,
         -Add comments for why manage the pmic in a different way for TO2
         -Remove the comments from configs/mx53evk.h,
          - /*
          -  * Disabled for now due to build problems under Debian and a 
 significant
          -  * increase in the final file size: 144260 vs. 109536 Bytes.
          -  */
 -Address the comments from Wolfgang,
         -Move CONFIG_SYS_TEXT_BASE  to board config file,
         -Remove the comments from configs/mx53evk.h
          - /* size in bytes reserved for initial data */
          #define BOARD_LATE_INIT
         -Change the comments,  * Hardware drivers to * UART drivers
 ---


  MAINTAINERS                       |    3 +
  board/freescale/mx53evk/Makefile  |   48 +
  board/freescale/mx53evk/mx53evk.c |  393 
 +
  boards.cfg                        |    1 +
  include/configs/mx53evk.h         |  216 
  5 files changed, 661 insertions(+), 0 deletions(-)

 diff --git a/MAINTAINERS b/MAINTAINERS
 index 0590ad9..c87ca56 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -1085,6 +1085,9 @@ Peter Meerwald de...@bct-electronic.com

       bct-brettl2     BF536

 +Jason Liu r64...@freescale.com
 +
 +     MX53evk         i.MX53

 Why do you add your name at the end of the Blackfin list and not inside
 the ARM list ? Please maintain the list sorted.

OK, I will put it into the ARM list.


 +void power_init(void)
 +{
 +     unsigned int val;
 +
 +     /* Set VDDA to 1.25V */
 +     val = pmic_reg_read(REG_SW_2);
 +     val = (val  (~0x1F)) | 0x1A;

 I have already commented this. Please drop all fix constants and use
 already provided #define or add new ones if needed.

Do you think that both 0x1F and 0x1A should be used with #define?


 +     if (is_soc_rev(CHIP_REV_2_0) == 0) {
 +             /* Set VCC to 1.3V for TO2 */
 +             val = pmic_reg_read(REG_SW_1);
 +             val = (val  (~0x1F)) | 0x1C;

 Ditto.

Do you think that both 0x1F and 0x1C should be used with #define?




 +int board_init(void)
 +{
 +     gd-bd-bi_arch_number = MACH_TYPE_MX53_EVK;
 +     /* address of boot parameters */
 +     gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100;
 +
 +     setup_iomux_uart();

 You sent a patch for mx51evk moving this call in board_early_init_f. Do
 we need the same for mx53evk ?

Yes, we need the same for mx53evk.


 +#ifdef BOARD_LATE_INIT
 +int board_late_init(void)
 +{
 +#ifdef CONFIG_I2C_MXC

 Is there a possibility to have a working board if CONFIG_I2C_MXC and
 BOARD_LATE_INIT are not set ? If not, it should be better to check if
 they are set on the beginning of this file and reporting a compile error
 if they are not set, and removing the #ifdef in this function.

OK, I will remove it.

Thanks for the review.


 Best regards,
 Stefano Babic

 --
 =
 DENX Software Engineering GmbH,     MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
 =
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] [RFC PATCH 6/8] omap3_beagle: add nand_spl support

2010-12-27 Thread Dirk Behme
On 28.12.2010 07:50, Aneesh V wrote:
 Hello John,

 On Tuesday 28 December 2010 06:17 AM, John Rigby wrote:
   snip

 +LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 +LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds -Ttext 
 $(CONFIG_SYS_NAND_SPL_TEXT_BASE) $(PLATFORM_LDFLAGS)
 +AFLAGS  += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
 +CFLAGS  += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL

 How big is the spl now? For the OMAP4 spl, using '-ffunction-sections'
 and '--gc-sections' reduced the image size by 40% and helped it fit
 into the SRAM bugdet. I am sure your nand_spl is already fitting in the
 SRAM bugdet. But these flags may help reduce the size further. Do you
 want to try it?

Applying this patch series and building with gcc version 4.3.3 
(Sourcery G++ Lite 2009q1-203) I get

  ./MAKEALL omap3_beagle_nand

nand_boot.c: In function 'nand_boot': 

nand_boot.c:356: warning: 'noreturn' function does return 

mkimage.c: In function ‘main’: 

mkimage.c:159: warning: implicit declaration of function 
‘init_omap_image_type’

  ll u-boot-spl.ift
12580 u-boot-spl.ift

Using gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) results in the 
same warnings and

  ll u-boot-spl.ift
12360 u-boot-spl.ift

Thanks

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