Re: [U-Boot] [PATCH 4/4] s5p6442: Add support SMDK6442 board

2010-03-29 Thread Minkyu Kang
Dear Joonyoung Shim,

On 29 March 2010 11:56, Joonyoung Shim jy0922.s...@samsung.com wrote:
 This patch adds the new board SMDK6442 that uses s5p6442 SoC.

 Cc: Minkyu Kang mk7.k...@samsung.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  MAKEALL                                |    1 +
  Makefile                               |    3 +
  board/samsung/smdk6442/Makefile        |   55 +++
  board/samsung/smdk6442/config.mk       |    6 +
  board/samsung/smdk6442/lowlevel_init.S |  202 ++
  board/samsung/smdk6442/mem_setup.S     |  175 +++
  board/samsung/smdk6442/onenand.c       |   41 ++
  board/samsung/smdk6442/smdk6442.c      |   54 +++
  include/configs/smdk6442.h             |  242 
 
  9 files changed, 779 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/smdk6442/Makefile
  create mode 100644 board/samsung/smdk6442/config.mk
  create mode 100644 board/samsung/smdk6442/lowlevel_init.S
  create mode 100644 board/samsung/smdk6442/mem_setup.S
  create mode 100644 board/samsung/smdk6442/onenand.c
  create mode 100644 board/samsung/smdk6442/smdk6442.c
  create mode 100644 include/configs/smdk6442.h

Please add smdk6442 at MAINTAINERS entry.

 diff --git a/board/samsung/smdk6442/config.mk 
 b/board/samsung/smdk6442/config.mk
 new file mode 100644
 index 000..9c39c8a
 --- /dev/null
 +++ b/board/samsung/smdk6442/config.mk
 @@ -0,0 +1,6 @@
 +#
 +# Copyright (C) 2010 Samsung Elecgtronics

Is Elecgtronics typo?

 +# Minkyu Kang mk7.k...@samsung.com
 +#
 +
 +TEXT_BASE = 0x3480
 diff --git a/board/samsung/smdk6442/smdk6442.c 
 b/board/samsung/smdk6442/smdk6442.c
 new file mode 100644
 index 000..bb8d469
 --- /dev/null
 +++ b/board/samsung/smdk6442/smdk6442.c
 @@ -0,0 +1,54 @@
 +/*
 + * Copyright (C) 2010 Samsung Electronics
 + * Minkyu Kang mk7.k...@samsung.com
 + * Joonyoung Shim jy0922.s...@samsung.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
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +int board_init(void)
 +{
 +       gd-bd-bi_arch_number = MACH_TYPE_SMDK6442;
 +       gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100;
 +
 +       return 0;
 +}
 +
 +int dram_init(void)
 +{
 +       gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
 +       gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 +
 +       gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
 +       gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 +
 +       return 0;
 +}
 +
 +#ifdef CONFIG_DISPLAY_BOARDINFO
 +int checkboard(void)
 +{
 +       printf(Board:\t6442\n);

Please fix it to SMDK6442.

 +       return 0;
 +}
 +#endif

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] s5p6442: Support serial driver

2010-03-29 Thread Minkyu Kang
Dear Joonyoung Shim,

On 29 March 2010 11:56, Joonyoung Shim jy0922.s...@samsung.com wrote:
 This patch is for serial support of s5p6442 SoC.

 Cc: Minkyu Kang mk7.k...@samsung.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  common/serial.c             |    2 +-
  drivers/serial/Makefile     |    1 +
  drivers/serial/serial_s5p.c |    5 +
  include/serial.h            |    2 +-
  4 files changed, 8 insertions(+), 2 deletions(-)

 diff --git a/common/serial.c b/common/serial.c
 index 94e1921..385c42b 100644
 --- a/common/serial.c
 +++ b/common/serial.c
 @@ -69,7 +69,7 @@ struct serial_device *__default_serial_console (void)
  #else
  #error CONFIG_SERIAL? missing.
  #endif
 -#elif defined(CONFIG_S5PC1XX)
 +#elif defined(CONFIG_S5PC1XX) || defined(CONFIG_S5P64XX)
  #if defined(CONFIG_SERIAL0)
        return s5p_serial0_device;
  #elif defined(CONFIG_SERIAL1)
 diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
 index 71392e6..110b7e1 100644
 --- a/drivers/serial/Makefile
 +++ b/drivers/serial/Makefile
 @@ -34,6 +34,7 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
  COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
  COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
  COBJS-$(CONFIG_S5PC1XX) += serial_s5p.o
 +COBJS-$(CONFIG_S5P64XX) += serial_s5p.o
  COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
  COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
  COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
 diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
 index 68b8d01..1e7426d 100644
 --- a/drivers/serial/serial_s5p.c
 +++ b/drivers/serial/serial_s5p.c
 @@ -31,10 +31,15 @@ static inline struct s5p_uart *s5p_get_base_uart(int 
 dev_index)
  {
        u32 offset = dev_index * sizeof(struct s5p_uart);

 +#ifdef CONFIG_S5PC1XX
        if (cpu_is_s5pc100())
                return (struct s5p_uart *)(S5PC100_UART_BASE + offset);
        else
                return (struct s5p_uart *)(S5PC110_UART_BASE + offset);
 +#elif CONFIG_S5P64XX
 +       if (cpu_is_s5p6442())
 +               return (struct s5p_uart *)(S5P6442_UART_BASE + offset);

need else or return.

 +#endif
  }

  /*
 diff --git a/include/serial.h b/include/serial.h
 index 4caf790..bf15212 100644
 --- a/include/serial.h
 +++ b/include/serial.h
 @@ -43,7 +43,7 @@ extern struct serial_device s3c24xx_serial1_device;
  extern struct serial_device s3c24xx_serial2_device;
  #endif

 -#if defined(CONFIG_S5PC1XX)
 +#if defined(CONFIG_S5PC1XX) || defined(CONFIG_S5P64XX)
  extern struct serial_device s5p_serial0_device;
  extern struct serial_device s5p_serial1_device;
  extern struct serial_device s5p_serial2_device;
 --
 1.6.3.3
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot


Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] s5p6442: Support Samsung s5p6442 SoC

2010-03-29 Thread Minkyu Kang
Dear Joonyoung Shim,

On 29 March 2010 11:56, Joonyoung Shim jy0922.s...@samsung.com wrote:
 This patch adds support s5p6442 SoC. The s5p6442 SoC is ARM1176
 processor.

 Cc: Minkyu Kang mk7.k...@samsung.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  cpu/arm1176/s5p64xx/Makefile         |   52 +
  cpu/arm1176/s5p64xx/clock.c          |  163 +++
  cpu/arm1176/s5p64xx/cpu_info.c       |   58 ++
  cpu/arm1176/s5p64xx/reset.S          |   35 ++
  cpu/arm1176/s5p64xx/timer.c          |  204 
 ++
  include/asm-arm/arch-s5p64xx/clk.h   |   38 +++
  include/asm-arm/arch-s5p64xx/clock.h |   69 
  include/asm-arm/arch-s5p64xx/cpu.h   |   57 ++
  include/asm-arm/arch-s5p64xx/gpio.h  |  111 ++
  include/asm-arm/arch-s5p64xx/power.h |   76 +
  include/asm-arm/arch-s5p64xx/pwm.h   |   58 ++
  include/asm-arm/arch-s5p64xx/uart.h  |   47 
  12 files changed, 968 insertions(+), 0 deletions(-)
  create mode 100644 cpu/arm1176/s5p64xx/Makefile
  create mode 100644 cpu/arm1176/s5p64xx/clock.c
  create mode 100644 cpu/arm1176/s5p64xx/cpu_info.c
  create mode 100644 cpu/arm1176/s5p64xx/reset.S
  create mode 100644 cpu/arm1176/s5p64xx/timer.c
  create mode 100644 include/asm-arm/arch-s5p64xx/clk.h
  create mode 100644 include/asm-arm/arch-s5p64xx/clock.h
  create mode 100644 include/asm-arm/arch-s5p64xx/cpu.h
  create mode 100644 include/asm-arm/arch-s5p64xx/gpio.h
  create mode 100644 include/asm-arm/arch-s5p64xx/power.h
  create mode 100644 include/asm-arm/arch-s5p64xx/pwm.h
  create mode 100644 include/asm-arm/arch-s5p64xx/uart.h

 diff --git a/cpu/arm1176/s5p64xx/clock.c b/cpu/arm1176/s5p64xx/clock.c
 new file mode 100644
 index 000..5fe0482
 --- /dev/null
 +++ b/cpu/arm1176/s5p64xx/clock.c
 @@ -0,0 +1,163 @@
 +/*
 + * Copyright (C) 2010 Samsung Electronics
 + * Minkyu Kang mk7.k...@samsung.com
 + * Joonyoung Shim jy0922.s...@samsung.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 asm/io.h
 +#include asm/arch/clock.h
 +#include asm/arch/clk.h
 +
 +#ifndef CONFIG_SYS_CLK_FREQ_6442
 +#define CONFIG_SYS_CLK_FREQ_6442       1200
 +#endif
 +
 +unsigned long (*get_pclk)(void);
 +unsigned long (*get_arm_clk)(void);
 +unsigned long (*get_pll_clk)(int);
 +
 +/* s5p6442: return pll clock frequency */
 +static unsigned long s5p6442_get_pll_clk(int pllreg)
 +{
 +       struct s5p6442_clock *clk = (struct s5p6442_clock 
 *)S5P64XX_CLOCK_BASE;
 +       unsigned long r, m, p, s, mask, fout;
 +       unsigned int freq;
 +
 +       switch (pllreg) {
 +       case APLL:
 +               r = readl(clk-apll_con);
 +               break;
 +       case MPLL:
 +               r = readl(clk-mpll_con);
 +               break;
 +       case EPLL:
 +               r = readl(clk-epll_con);
 +               break;
 +       case VPLL:
 +               r = readl(clk-vpll_con);
 +               break;
 +       default:
 +               printf(Unsupported PLL (%d)\n, pllreg);
 +               return 0;
 +       }
 +
 +       /*
 +        * APLL_CON: MIDV [25:16]
 +        * MPLL_CON: MIDV [25:16]
 +        * EPLL_CON: MIDV [24:16]
 +        * VPLL_CON: MIDV [24:16]
 +        */
 +       if (pllreg == APLL || pllreg == MPLL)
 +               mask = 0x3ff;
 +       else
 +               mask = 0x1ff;
 +
 +       m = (r  16)  mask;
 +
 +       /* PDIV [13:8] */
 +       p = (r  8)  0x3f;
 +       /* SDIV [2:0] */
 +       s = r  0x7;
 +
 +       freq = CONFIG_SYS_CLK_FREQ_6442;
 +       if (pllreg == APLL) {
 +               if (s  1)
 +                       s = 1;
 +               /* FOUT = MDIV * FIN / (PDIV * 2^(SDIV - 1)) */
 +               fout = m * (freq / (p * (1  (s - 1;
 +       } else {
 +               /* FOUT = MDIV * FIN / (PDIV * 2^SDIV) */
 +               fout = m * (freq / (p * (1  s)));
 +       }
 +
 +       return fout;
 +}
 +
 +/* s5p6442: return ARM clock frequency */
 +static unsigned long s5p6442_get_arm_clk(void)
 +{
 +       struct s5p6442_clock *clk = (struct s5p6442_clock 
 *)S5P64XX_CLOCK_BASE;
 +     

Re: [U-Boot] [PATCH] cmd_bmp.c: added standard subcommand handling

2010-03-29 Thread Detlev Zundel
Hi Frans,

 Signed-off-by: Frans Meulenbroeks fransmeulenbro...@gmail.com

Looks good, so

Acked-by: Detlev Zundel d...@denx.de

Cheers
  Detlev

-- 
Restrict Digital Restrictions Management:
If you can't copy it - don't buy it
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_onenand.c: moved to standard subcommand handling

2010-03-29 Thread Detlev Zundel
Hi Frans,

 Forgot this disclaimer, thought I added it, sry.

 NOTE:
 This code is untested as I have no board with onenand support.
 However, it compiles properly (tested by building opap3_evm, which uses this).
 The changes I did are purely splitting do_onenand in separate
 functions and add the subcommand parsing (which itself was taken from
 i2c, on which I tested it before).
 So I do not expect any serious issues, but I would suggest testing
 this before integrating it.

Why don't you just add the maintainer of omap3_evm board (as I did) on
CC to your mail, so he knows that his testing would be greatly
appreciated?

Thanks for the effort!
  Detlev

-- 
European  efforts to impose  state systems in  conquered  territories are the
source of most conflicts underway right now, after the collapse of the formal
colonial system.  Europe's own  favorite sport of  mutual slaughter had to be
called off  in 1945,  when it was  realized  that the  next time the game was
played would be the last. -- Noam Chomsky
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] cant not enter uboot command line

2010-03-29 Thread Detlev Zundel
Hi zs,

 SMDK2416 # U-Boot 1.1.6 (Sep 24 2009 - 10:24:40) for SMDK2416
 Unknown command 'U-Boot' - try 'help'

U-Boot 1.1.6 is _really old_.  Please try with a recent version of
U-Boot from the git repository.

Also it somewhat looks like you're UART is in loopback mode if it
interprets the U-Boot banner output as input.  But that's just a pure
guess, the number of unreadable output messages in your log is
overwhelming.

Cheers
   Detlev

-- 
Less talking -- more hacking
-- Olin Shivers
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] git merge summary

2010-03-29 Thread Detlev Zundel
Hi Alexander,

 may I ask if there is reason why merge commits don't have a summary?

Yes, you may.  Actually this is a good question.

 I find those summaries (enabled with git config [--global] merge.summary 
 true) very hand to see what was changed with the merge commit.

I didn't even know about that feature, so thanks for poking us.
Checking the documentation, it seems like the name will change soon
however (man git-fmt-merge-msg):

   merge.summary
   Synonym to merge.log; this is deprecated and will be removed
   in the future.

But apart from that, I also like the feature.  Wolfgang, what do you
think?

Cheers
  Detlev

-- 
Mit einem Leben wie dem meinen, Doktor - wer braucht da noch Traeume?
- Alex Portnoy
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_onenand.c: moved to standard subcommand handling

2010-03-29 Thread Detlev Zundel
Hi Frans,

 2010/3/29 Detlev Zundel d...@denx.de:
 Hi Frans,

 Forgot this disclaimer, thought I added it, sry.

 NOTE:
 This code is untested as I have no board with onenand support.
 However, it compiles properly (tested by building opap3_evm, which uses 
 this).
 The changes I did are purely splitting do_onenand in separate
 functions and add the subcommand parsing (which itself was taken from
 i2c, on which I tested it before).
 So I do not expect any serious issues, but I would suggest testing
 this before integrating it.

 Why don't you just add the maintainer of omap3_evm board (as I did) on
 CC to your mail, so he knows that his testing would be greatly
 appreciated?

 Will try to do so next time :-)
 Actually there are more boards which utilize onenand. I just picked
 this one as I have an omap3 board (and actually only discovered when I
 wanted to start testing that it did not have onenand, but just regular
 nand)

Hm ok, then maybe add someone else from the list of boards using it, as
the e-mail of the omap3_evm maintainer Manikandan Pillai
mani.pil...@ti.com bounces.

I added Nishanth Menon from ti on CC, maybe he can tell us the
whereabouts of Manikanden.  Will someone else from ti be maintaining
this board?  If so, then a patch to MAINTAINERS is welcome :)

Cheers
  Detlev

-- 
Those who would trade safety for freedom deserve neither.
   -- Thomas Jefferson
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [STATUS] v2010.03-rc3 is out

2010-03-29 Thread André Schwarz
Wolfgang,

 U-Boot v2010.03-rc3 has been released.
 
 Please help testing, and send any feedback / last minute patches ASAP.

if there's any chance that you'll apply this patch we can include the
latest code in our long term test site and report any possible issues
related with U-Boot @ MPC5200.

http://lists.denx.de/pipermail/u-boot/2010-March/069006.html


There's no need to hurry - we can do this later anytime.


Regards,
André


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [STATUS] next branch reset

2010-03-29 Thread Wolfgang Denk
Hi all,

I am sorry, but I had to reset the next branch as an incorrect
commit had sneeked in. I apologize for any inconveniences this may be
causing.

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 last thing one knows in constructing a work is what to put first.
- Blaise Pascal
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] git merge summary

2010-03-29 Thread Wolfgang Denk
In message m2mxxreamw@ohwell.denx.de Detlev Zundel wrote:
 
  may I ask if there is reason why merge commits don't have a summary?
 
 Yes, you may.  Actually this is a good question.
 
  I find those summaries (enabled with git config [--global] merge.summary 
  true) very hand to see what was changed with the merge commit.
 
 I didn't even know about that feature, so thanks for poking us.
 Checking the documentation, it seems like the name will change soon
 however (man git-fmt-merge-msg):
 
merge.summary
Synonym to merge.log; this is deprecated and will be removed
in the future.
 
 But apart from that, I also like the feature.  Wolfgang, what do you
 think?

I have no preference.

If there is an agreement (or at least no protests) we can add
'merge.log'.

Shall we?

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
Prof:So the American government went to IBM to come up with a
 data encryption standard and they came up with ...
Student: EBCDIC!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [STATUS] v2010.03-rc3 is out

2010-03-29 Thread Wolfgang Denk
Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,

In message 1269856412.5008.48.ca...@swa-m460 you wrote:

  Please help testing, and send any feedback / last minute patches ASAP.
 
 if there's any chance that you'll apply this patch we can include the
 latest code in our long term test site and report any possible issues
 related with U-Boot @ MPC5200.
 
 http://lists.denx.de/pipermail/u-boot/2010-March/069006.html

This is new code - posted just a couple of days ago. It will certainly
not go into the upcoming release any more.

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
Research is what I'm doing when I don't know what I'm doing.
 -- Wernher von Braun
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [STATUS] v2010.03-rc3 is out

2010-03-29 Thread Andre Schwarz
Wolfgang,

 Please help testing, and send any feedback / last minute patches ASAP.

 if there's any chance that you'll apply this patch we can include the
 latest code in our long term test site and report any possible issues
 related with U-Boot @ MPC5200.

 http://lists.denx.de/pipermail/u-boot/2010-March/069006.html
  
 This is new code - posted just a couple of days ago. It will certainly
 not go into the upcoming release any more.



Hmm - it's just another board making use of existing mpc5xxx code and 
some common matrix-vision code already present.
There are no mods to any code possibly affecting other boards.

But of course it's your decision - will wait for further comments on the 
patch for the next merge window.

Regards,
André

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] bootm, linux: fix booting Multi-File Image with kernel+ramdisk+fdt

2010-03-29 Thread Heiko Schocher
Booting a Multi-File Image including a linux kernel, ramdisk and
fdt, generated with

mkimage -A ppc \
-O linux \
-T multi \
-C gzip \
-a  \
-e  \
-n kernel-2.6+initrd+dtb \
-d vmlinux.bin.gz:ramdisk_image.gz:board.dtb \
multi.bin

actually fails, because ramdisk start and end addresses
didn;t get initialized. This patch fixes this issue.

Tested on the KUP4K board.

Signed-off-by: Heiko Schocher h...@denx.de
---
 common/cmd_bootm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 23ab0c4..995e378 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -291,7 +291,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[])
return 1;
}

-   if ((images.os.type == IH_TYPE_KERNEL) 
+   if (((images.os.type == IH_TYPE_KERNEL) ||
+(images.os.type == IH_TYPE_MULTI)) 
(images.os.os == IH_OS_LINUX)) {
/* find ramdisk */
ret = boot_get_ramdisk (argc, argv, images, IH_INITRD_ARCH,
-- 
1.6.2.5
-- 
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


[U-Boot] i2c pull request (next)

2010-03-29 Thread Heiko Schocher
Hello Wolfgang,

please pull for next branch the following changes for i2c:

The following changes since commit 0020db3f0da61f3e2c8a459a87598e07594dc8ac:
  Wolfgang Denk (1):
Merge remote branch 'origin/master' into next

are available in the git repository at:

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

Frans Meulenbroeks (5):
  cmd_i2c.c: declared local functions as static
  cmd_i2c: moved mispositioned comment for i2c md
  cmd_i2c: moved a define to before the functions
  cmd_i2c: introduced get_alen helper function
  i2c: made unused function i2c_mux_add_device static

 common/cmd_i2c.c |  155 +++---
 include/i2c.h|2 -
 2 files changed, 65 insertions(+), 92 deletions(-)

Frans:

Patch 4 cmd_i2c: introduced get_alen helper function applied
after fixing a whitespace error:

Applying: cmd_i2c: introduced get_alen helper function
/home/hs/i2c/u-boot-i2c/.git/rebase-apply/patch:14: trailing whitespace.
 * returns the address length,or 0 on error
warning: 1 line applied after fixing whitespace errors.

Patch 5: corrected the commit message

Hope this is OK for you?

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] [STATUS] v2010.03-rc3 is out

2010-03-29 Thread Wolfgang Denk
Dear Andre Schwarz,

In message 4bb0987d.7050...@matrix-vision.de you wrote:
 
  This is new code - posted just a couple of days ago. It will certainly
  not go into the upcoming release any more.
 
 Hmm - it's just another board making use of existing mpc5xxx code and 
 some common matrix-vision code already present.
 There are no mods to any code possibly affecting other boards.

It _is_ new code. The rules are clear: when the merge window is closed,
only previously submitted patches and bug fixes go in. And in the last
week(s) before the release there is strict bug-fix-only mode.

 But of course it's your decision - will wait for further comments on the 
 patch for the next merge window.

Sorry.

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
They say, well, meybe it _is_ smelly, maybe it _is_ overcrowded, may-
be it _is_ a bit like Hell would be if they shut the  fires  off  and
stabled  a  herd  of  incontinent cows there for a year, but you must
admit that it is full of sheer, vibrant, dynamic _life_.
 - Terry Pratchett, _Moving Pictures_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default.

2010-03-29 Thread Mikhail Kshevetskiy
commit 4b142febff71eabdb7ddbb125c7b583b24ddc434 (common: delete
CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL) breaks printf on my
arm/pxa270 board. For example, the code

int a = 128;
printf(a= %d\n, a);

will print zero on the console. The problem reproduced on gcc 4.1.1,
4.3.3, 4.4.1 and 4.4.2.

This patch fix printf unless you'll need printing 64-bit values.

Signed-off-by: Mikhail Kshevetskiy mikhail.kshevets...@gmail.com
---
 cpu/pxa/config.mk |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/pxa/config.mk b/cpu/pxa/config.mk
index a05d69c..d87b5e0 100644
--- a/cpu/pxa/config.mk
+++ b/cpu/pxa/config.mk
@@ -24,7 +24,7 @@
 
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
-PLATFORM_CPPFLAGS += -march=armv5te -mtune=xscale
+PLATFORM_CPPFLAGS += -march=armv5t -mtune=xscale
 # =
 #
 # Supply options according to compiler version
-- 
1.7.0
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] bootm, linux: fix booting Multi-File Image with kernel+ramdisk+fdt

2010-03-29 Thread Wolfgang Denk
Dear Heiko Schocher,

In message 4bb08be4@denx.de you wrote:
 Booting a Multi-File Image including a linux kernel, ramdisk and
 fdt, generated with
 
 mkimage -A ppc \
 -O linux \
 -T multi \
 -C gzip \
 -a  \
 -e  \
 -n kernel-2.6+initrd+dtb \
 -d vmlinux.bin.gz:ramdisk_image.gz:board.dtb \
 multi.bin
 
 actually fails, because ramdisk start and end addresses
 didn;t get initialized. This patch fixes this issue.
 
 Tested on the KUP4K board.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 ---
  common/cmd_bootm.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A witty saying proves nothing, but saying  something  pointless  gets
people's attention.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] i2c pull request (next)

2010-03-29 Thread Wolfgang Denk
Dear Heiko Schocher,

In message 4bb090c0.4060...@denx.de you wrote:
 Hello Wolfgang,
 
 please pull for next branch the following changes for i2c:
 
 The following changes since commit 0020db3f0da61f3e2c8a459a87598e07594dc8ac:
   Wolfgang Denk (1):
 Merge remote branch 'origin/master' into next
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-i2c.git next
 
 Frans Meulenbroeks (5):
   cmd_i2c.c: declared local functions as static
   cmd_i2c: moved mispositioned comment for i2c md
   cmd_i2c: moved a define to before the functions
   cmd_i2c: introduced get_alen helper function
   i2c: made unused function i2c_mux_add_device static
 
  common/cmd_i2c.c |  155 
 +++---
  include/i2c.h|2 -
  2 files changed, 65 insertions(+), 92 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There is a multi-legged creature crawling on your shoulder.
-- Spock, A Taste of Armageddon, stardate 3193.9
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] SPEAr : SMI erase and write timeouts increased

2010-03-29 Thread Tom
Vipin KUMAR wrote:
 On 3/29/2010 3:21 AM, Tom wrote:
 Vipin KUMAR wrote:
 SMI driver fails because of low timeout values. Increasing the erase
 and write
 timeouts to 3 seconds
 This is a huge timeout change.
 2ms to 3000ms.
 If something goes wrong, it will seem like the board is hung.
 Is this ok?

 
 2ms timeout itself was a mistake. 3 sec is OK. Offcourse, 3 secs are
 required only when something goes wrong

OK

 
snip
 +} while (timeout--);
 This changes the function to wait at least 1ms even if timeout == 0.
 Why was the original logic changed?

 
 Earlier a value of 2 was reading the status register only once. This I
 felt is more appropriate since the status register is read every ms and
 at least once.

OK

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


Re: [U-Boot] i2c pull request (next)

2010-03-29 Thread Frans Meulenbroeks
2010/3/29 Heiko Schocher h...@denx.de:
 Hello Wolfgang,

 please pull for next branch the following changes for i2c:

 The following changes since commit 0020db3f0da61f3e2c8a459a87598e07594dc8ac:
  Wolfgang Denk (1):
        Merge remote branch 'origin/master' into next

 are available in the git repository at:

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

 Frans Meulenbroeks (5):
      cmd_i2c.c: declared local functions as static
      cmd_i2c: moved mispositioned comment for i2c md
      cmd_i2c: moved a define to before the functions
      cmd_i2c: introduced get_alen helper function
      i2c: made unused function i2c_mux_add_device static

  common/cmd_i2c.c |  155 
 +++---
  include/i2c.h    |    2 -
  2 files changed, 65 insertions(+), 92 deletions(-)

 Frans:

 Patch 4 cmd_i2c: introduced get_alen helper function applied
 after fixing a whitespace error:

 Applying: cmd_i2c: introduced get_alen helper function
 /home/hs/i2c/u-boot-i2c/.git/rebase-apply/patch:14: trailing whitespace.
  * returns the address length,or 0 on error
 warning: 1 line applied after fixing whitespace errors.

 Patch 5: corrected the commit message

 Hope this is OK for you?

Yes!

Apologies that a last minute edit added a whitespace error in the comment.
Note to self: recheck even after making a small change.

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


Re: [U-Boot] [PATCH v2] jffs2, suen3: Fix compiler warning

2010-03-29 Thread Tom
Heiko Schocher wrote:
 $ ./MAKEALL suen3
 jffs2_1pass.c: In function 'get_fl_mem':
 jffs2_1pass.c:399: warning: unused variable 'id'
 jffs2_1pass.c: In function 'get_node_mem':
 jffs2_1pass.c:423: warning: unused variable 'id'
 
 Signed-off-by: Heiko Schocher h...@denx.de

This change does silence these warning with no added regressions.
Tested-by: Tom tom@windriver.com

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


[U-Boot] [PATCH 2/2] add support of arm/pxa270 board made by voipac

2010-03-29 Thread Mikhail Kshevetskiy
This patch is based on custom u-boot-1.1.2 version produced by voipac
(http://www.voipac.com) and board/trizepsiv files from current u-boot.

Up to now only PXA270 DIMM module with NOR flash is tested.

Signed-off-by: Mikhail Kshevetskiy mikhail.kshevets...@gmail.com
---
 Makefile  |3 +
 board/vpac270/Makefile|   51 +++
 board/vpac270/config.mk   |3 +
 board/vpac270/lowlevel_init.S |  740 +
 board/vpac270/vpac270.c   |  101 ++
 include/configs/vpac270.h |  329 ++
 6 files changed, 1227 insertions(+), 0 deletions(-)
 create mode 100644 board/vpac270/Makefile
 create mode 100644 board/vpac270/config.mk
 create mode 100644 board/vpac270/lowlevel_init.S
 create mode 100644 board/vpac270/vpac270.c
 create mode 100644 include/configs/vpac270.h

diff --git a/Makefile b/Makefile
index d801e25..188d618 100644
--- a/Makefile
+++ b/Makefile
@@ -3253,6 +3253,9 @@ trizepsiv_config  :   unconfig
fi;
@$(MKCONFIG) -a trizepsiv arm pxa trizepsiv
 
+vpac270_config:unconfig
+   @$(MKCONFIG) $(@:_config=) arm pxa vpac270
+
 wepep250_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm pxa wepep250
 
diff --git a/board/vpac270/Makefile b/board/vpac270/Makefile
new file mode 100644
index 000..500e075
--- /dev/null
+++ b/board/vpac270/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := vpac270.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/vpac270/config.mk b/board/vpac270/config.mk
new file mode 100644
index 000..4486f6b
--- /dev/null
+++ b/board/vpac270/config.mk
@@ -0,0 +1,3 @@
+TEXT_BASE =0xa1f0
+# 0xa170
+#TEXT_BASE = 0
diff --git a/board/vpac270/lowlevel_init.S b/board/vpac270/lowlevel_init.S
new file mode 100644
index 000..1df381c
--- /dev/null
+++ b/board/vpac270/lowlevel_init.S
@@ -0,0 +1,740 @@
+/*
+ * This was originally from the Lubbock u-boot port.
+ *
+ * Most of this taken from Redboot hal_platform_setup.h with cleanup
+ *
+ * NOTE: I haven't clean this up considerably, just enough to get it
+ * running. See hal_platform_setup.h for the source. See
+ * board/cradle/lowlevel_init.S for another PXA250 setup that is
+ * much cleaner.
+ *
+ * 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 config.h
+#include version.h
+#include asm/arch/pxa-regs.h
+
+/* wait for coprocessor write complete */
+   .macro CPWAIT reg
+   mrc p15,0,\reg,c2,c0,0
+   mov \reg,\reg
+   sub pc,pc,#4
+   .endm
+
+
+/*
+ * Memory setup
+ */
+
+.globl lowlevel_init
+lowlevel_init:
+
+   /* Set up GPIO pins first - */
+
+   ldr r0, =GPSR0
+   ldr

Re: [U-Boot] [PATCH] at91: use C structs for AT91 OHCI code

2010-03-29 Thread Tom
Matthias Fuchs wrote:
 This patch is part of migrating the AT91 support towards
 using C struct for all SOC access.
 
 It removes one more CONFIG_AT91_LEGACY warning.
 
 at91_pmc.h needs cleanup after migration of the drivers
 has been done.
 
Yes.
All the #if-def-ing will be removed when the migration is done.


 Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu

Applied to arm/next
Thanks
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [STATUS] v2010.03-rc3 is out

2010-03-29 Thread Andre Schwarz
Wolfgang,

 This is new code - posted just a couple of days ago. It will certainly
 not go into the upcoming release any more.

 Hmm - it's just another board making use of existing mpc5xxx code and
 some common matrix-vision code already present.
 There are no mods to any code possibly affecting other boards.
  
 It _is_ new code. The rules are clear: when the merge window is closed,
 only previously submitted patches and bug fixes go in. And in the last
 week(s) before the release there is strict bug-fix-only mode.


no problem - thanks for pointing this out.

 But of course it's your decision - will wait for further comments on the
 patch for the next merge window.
  
 Sorry.


merge window will re-open some day ... that's for sure :-)


Regards,
André Schwarz


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, 
Hans-Joachim Reich
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] help on u boot loader

2010-03-29 Thread Hari Babu
 Hi, This is hari,working in inforce computing in india.i want small help
from u r side on das u-boot loader.We developed a new NIC card based on the
Caviun octeon 2 CN63xx processor which is communicating through PCIe
protocal to Host.I already downloaded new u-boot-2010.03-rc1 source code.can
u suggest me which board is similar or nearly have configure to my new board
in u-boot/board folder,thenonly its easy for me to changes configuration to
the exist one. u r advises will help me.Thank you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] help on u boot loader

2010-03-29 Thread Wolfgang Denk
Dear Hari Babu,

In message e05b45b91003290607r7aa794c8iea484a36e9e81...@mail.gmail.com you 
wrote:
 
  Hi, This is hari,working in inforce computing in india.i want small help
 from u r side on das u-boot loader.We developed a new NIC card based on the

Please don't try to be keewl - don't use instant-messaging shortcuts.
Spelling you as u etc.makes you look like a semi-literate boob to
save two entire keystrokes

 Caviun octeon 2 CN63xx processor which is communicating through PCIe
 protocal to Host.I already downloaded new u-boot-2010.03-rc1 source code.can
 u suggest me which board is similar or nearly have configure to my new board
 in u-boot/board folder,thenonly its easy for me to changes configuration to
 the exist one. u r advises will help me.Thank you.

So far, Cavium has not pushed any of their U-Boot related work
upstream, i. e. there is no support available for Cavium processors
in mainline U-Boot. You will either have to start from scratch, or
use the Cavium provided code as base for your porting efforts.

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
Applying computer technology is simply finding the  right  wrench  to
pound in the correct screw.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus = 1 initialization

2010-03-29 Thread Stefan Roese
This patch fixes a problem introduced with patch eb5eb2b0
[ppc4xx: Cleanup PPC4xx I2C infrastructure]. We need to assign the I2C
base address to the i2c pointer inside of the controller loop.
Otherwise controller 0 is initialized multiple times instead of
initializing each I2C controller sequentially.

Tested on Katmai.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Heiko Schocher h...@denx.de
---
Heiko, I just noticed that this PPC4xx I2C driver is still in the
cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
after the next release. Is this ok for you? I can provide a patch
for this soon.

Please let me know if you see any problems with this patch. I would
really like to push it into this release, since it really is a bug
fix.

Thanks.

 cpu/ppc4xx/i2c.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cpu/ppc4xx/i2c.c b/cpu/ppc4xx/i2c.c
index 7976e75..9b86187 100644
--- a/cpu/ppc4xx/i2c.c
+++ b/cpu/ppc4xx/i2c.c
@@ -93,7 +93,7 @@ static void _i2c_bus_reset(void)
 
 void i2c_init(int speed, int slaveaddr)
 {
-   struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+   struct ppc4xx_i2c *i2c;
int val, divisor;
int bus;
 
@@ -109,6 +109,9 @@ void i2c_init(int speed, int slaveaddr)
for (bus = 0; bus  CONFIG_SYS_MAX_I2C_BUS; bus++) {
I2C_SET_BUS(bus);
 
+   /* Set i2c pointer after calling I2C_SET_BUS() */
+   i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+
/* Handle possible failed I2C state */
/* FIXME: put this into i2c_init_board()? */
_i2c_bus_reset();
-- 
1.7.0.3

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


Re: [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus = 1 initialization

2010-03-29 Thread Heiko Schocher
Hello Stefan,

Stefan Roese wrote:
 This patch fixes a problem introduced with patch eb5eb2b0
 [ppc4xx: Cleanup PPC4xx I2C infrastructure]. We need to assign the I2C
 base address to the i2c pointer inside of the controller loop.
 Otherwise controller 0 is initialized multiple times instead of
 initializing each I2C controller sequentially.
 
 Tested on Katmai.
 
 Signed-off-by: Stefan Roese s...@denx.de
 Cc: Heiko Schocher h...@denx.de
 ---
 Heiko, I just noticed that this PPC4xx I2C driver is still in the
 cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
 after the next release. Is this ok for you? I can provide a patch
 for this soon.

Yep, that would be the better place for it.
(Did this already in the multibus_v2 branch in
 git://git.denx.de/u-boot-i2c.git)

 Please let me know if you see any problems with this patch. I would
 really like to push it into this release, since it really is a bug
 fix.

It looks Ok for me.

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] ppc4xx: Fix problem with I2C bus = 1 initialization

2010-03-29 Thread Stefan Roese
Hi Heiko,

On Monday 29 March 2010 15:43:50 Heiko Schocher wrote:
  Heiko, I just noticed that this PPC4xx I2C driver is still in the
  cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
  after the next release. Is this ok for you? I can provide a patch
  for this soon.
 
 Yep, that would be the better place for it.
 (Did this already in the multibus_v2 branch in
  git://git.denx.de/u-boot-i2c.git)

OK, I'll send a moving patch for next soon.
 
  Please let me know if you see any problems with this patch. I would
  really like to push it into this release, since it really is a bug
  fix.
 
 It looks Ok for me.

Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow and 
send a pull request to Wolfgang.

Cheers,
Stefan

--
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] ppc4xx: Fix problem with I2C bus = 1 initialization

2010-03-29 Thread Heiko Schocher
Hello Stefan,

Stefan Roese wrote:
 On Monday 29 March 2010 15:43:50 Heiko Schocher wrote:
 Heiko, I just noticed that this PPC4xx I2C driver is still in the
 cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
 after the next release. Is this ok for you? I can provide a patch
 for this soon.
 Yep, that would be the better place for it.
 (Did this already in the multibus_v2 branch in
  git://git.denx.de/u-boot-i2c.git)
 
 OK, I'll send a moving patch for next soon.

Great.

 Please let me know if you see any problems with this patch. I would
 really like to push it into this release, since it really is a bug
 fix.
 It looks Ok for me.
 
 Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow and 
 send a pull request to Wolfgang.

Ah, I just wanted to send a pull request to Wolfgang, because I added
it to i2c next ... is this Ok for you?

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


[U-Boot] LPC3250 (phy3250) u-boot without S1l

2010-03-29 Thread Bjørnar Syverstad
Hello,
This question is for the LPC3250 (phy3250 board).

Is there any plans for make the u-boot ready so it does not need the S1l.
I do see that there is started some work on it, but the code is stub.

Best Regards
Bjørnar Syverstad

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


Re: [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus = 1 initialization

2010-03-29 Thread Stefan Roese
Hi Heiko,

On Monday 29 March 2010 15:57:22 Heiko Schocher wrote:
  Please let me know if you see any problems with this patch. I would
  really like to push it into this release, since it really is a bug
  fix.
  
  It looks Ok for me.
  
  Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow
  and send a pull request to Wolfgang.
 
 Ah, I just wanted to send a pull request to Wolfgang, because I added
 it to i2c next ... is this Ok for you?

It's supposed to go into master (bug fix). So if you plan to push it via 
your master branch, then it's fine with me.

Thanks.

Cheers,
Stefan

--
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] ppc4xx: Fix problem with I2C bus = 1 initialization

2010-03-29 Thread Heiko Schocher
Hello Stefan,

Stefan Roese wrote:
 On Monday 29 March 2010 15:57:22 Heiko Schocher wrote:
 Please let me know if you see any problems with this patch. I would
 really like to push it into this release, since it really is a bug
 fix.
 It looks Ok for me.
 Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow
 and send a pull request to Wolfgang.
 Ah, I just wanted to send a pull request to Wolfgang, because I added
 it to i2c next ... is this Ok for you?
 
 It's supposed to go into master (bug fix). So if you plan to push it via 
 your master branch, then it's fine with me.

Of course ... Hmm.. I am fine with it, if you want to push this through
ppc4xx/master, so you can add my:

Acked-by: Heiko Schocher h...@denx.de

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


[U-Boot] Saving environment variables in MMC

2010-03-29 Thread Nitin Mahajan
Hi!

I want to save and retrieve environment variables from a file in MMC. Can I get 
some pointers towards this?

Whether env_relocate_spec() and other such functions, has some implementation 
for MMC also? 

regards
-Nitin



  Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Saving environment variables in MMC

2010-03-29 Thread Mike Frysinger
On Monday 29 March 2010 11:21:22 Nitin Mahajan wrote:
 I want to save and retrieve environment variables from a file in MMC. Can I
 get some pointers towards this?
 
 Whether env_relocate_spec() and other such functions, has some
 implementation for MMC also?

search the archives.  some people have posted some patches recently.
-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] [PATCH] mpc86xx: adjust the DDR BATs after calculating true DDR size

2010-03-29 Thread Timur Tabi
After determining how much DDR is actually in the system, adjust DBAT0 and
IBAT0 accordingly.  This ensures that the CPU won't attempt to access
(via speculation) addresses outside of actual memory.

On 86xx systems, DBAT0 and IBAT0 (the BATs for DDR) are initialized to 2GB and
kept that way.  If the system has less than 2GB of memory (typical for an
MPC8610 HPCD), the CPU may attempt to access this memory during speculation.
The zlib code is notorious for generating such memory reads, and indeed on the
MPC8610, uncompressing the Linux kernel causes a machine check (without this
patch).

Signed-off-by: Timur Tabi ti...@freescale.com
---
 board/freescale/mpc8610hpcd/mpc8610hpcd.c |2 +
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |2 +
 cpu/mpc86xx/cpu.c |   44 +
 include/asm-ppc/mmu.h |4 ++-
 include/mpc86xx.h |2 +
 5 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c 
b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
index 15a5b7b..b1623ba 100644
--- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c
+++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
@@ -125,6 +125,8 @@ initdram(int board_type)
dram_size = fixed_sdram();
 #endif
 
+   adjust_ddr_bat(dram_size);
+
puts( DDR: );
return dram_size;
 }
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c 
b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index 7e6aabf..1f8b717 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -72,6 +72,8 @@ initdram(int board_type)
dram_size = fixed_sdram();
 #endif
 
+   adjust_ddr_bat(dram_size);
+
puts(DDR: );
return dram_size;
 }
diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c
index f7e012d..00039d3 100644
--- a/cpu/mpc86xx/cpu.c
+++ b/cpu/mpc86xx/cpu.c
@@ -197,3 +197,47 @@ void mpc86xx_reginfo(void)
printf(\tBR7\t0x%08X\tOR7\t0x%08X \n, in_be32(lbc-br7), 
in_be32(lbc-or7));
 
 }
+
+/*
+ * Update the DDR BATs to reflect the actual size of DDR.
+ *
+ * On 86xx, the CONFIG_SYS_DBAT0U macro is used to specify the initial size of
+ * the BAT for DDR.  After the actual size of DDR is determined (which is
+ * usually smaller than the initial size), this BAT should be adjusted
+ * accordingly.  Otherwise, any inadvertent access to addresses beyond DDR
+ * (such as via speculative execution) can cause a machine check.
+ *
+ * dram_size is the actual size of DDR, in bytes
+ *
+ * Note: we assume that CONFIG_MAX_MEM_MAPPED is = BATU_SIZE(BATU_BL_MAX);
+ * that is, the maximum amount of memory that U-Boot will ever map will always
+ * fit into one BAT.  If this is not true, (e.g. CONFIG_MAX_MEM_MAPPED is 2GB
+ * but HID0_XBSEN is not defined) then we might have a situation where U-Boot
+ * will attempt to relocated itself outside of the region mapped by DBAT0.
+ * This will cause a machine check.
+ *
+ * We also assume that the XBL bits are ignored by the processor (even if set)
+ * if extended BAT addressing is disabled.
+ */
+void adjust_ddr_bat(phys_addr_t dram_size)
+{
+   unsigned long batl, batu, bl;
+
+   bl = KB_TO_BATU(dram_size / 1024)  BATU_BL_MAX;
+
+   if (BATU_SIZE(bl) != dram_size) {
+   puts((limiting mapped memory to );
+   print_size(BATU_SIZE(bl), ));
+   bl = BATU_BL_MAX;
+   }
+
+   read_bat(DBAT0, batu, batl);
+   batu = ~BATU_BL_MAX;
+   batu |= bl;
+   write_bat(DBAT0, batu, batl);
+
+   read_bat(IBAT0, batu, batl);
+   batu = ~BATU_BL_MAX;
+   batu |= bl;
+   write_bat(IBAT0, batu, batl);
+}
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index fd10249..34a292d 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -213,7 +213,9 @@ extern void print_bats(void);
 #define BATL_PADDR(x) ((phys_addr_t)((x  0xfffe)  \
 | ((x  0x0e00ULL)  24)  \
 | ((x  0x04ULL)  30)))
-#define BATU_SIZE(x) (1UL  (fls((x  BATU_BL_MAX)  2) + 17))
+#define BATU_SIZE(x) (1ULL  (fls((x  BATU_BL_MAX)  2) + 17))
+
+#define KB_TO_BATU(x) x)/128) - 1) * 4) /* Convert KBs to BATU value */
 
 /* Used to set up SDR1 register */
 #define HASH_TABLE_SIZE_64K0x0001
diff --git a/include/mpc86xx.h b/include/mpc86xx.h
index c6f30f9..42f8b13 100644
--- a/include/mpc86xx.h
+++ b/include/mpc86xx.h
@@ -83,5 +83,7 @@ static __inline__ unsigned long get_l2cr (void)
return l2cr_val;
 }
 
+void adjust_ddr_bat(phys_addr_t dram_kb);
+
 #endif  /* _ASMLANGUAGE */
 #endif /* __MPC86xx_H__ */
-- 
1.6.5

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


[U-Boot] [PATCH 0/2] at91sam9x: driver to use the internal RTT as RTC

2010-03-29 Thread Alexander Holler
This driver uses the internal RTT as RTC like the linux driver.

To enable it, these defines are needed:

#define CONFIG_CMD_DATE
#define CONFIG_RTC_AT91SAM9
#define CONFIG_RTC_AT91SAM9_RTT AT91_RTT0_BASE /* for AT91SAM9263 */
#define CONFIG_RTC_AT91SAM9_RTT AT91_RTT_BASE /* AT91SAM9260 or AT91SAM9261 */
#define CONFIG_RTC_AT91SAM9_GPBR 0

Tested with an AT91SAM9263.

Regards,

Alexander Holler

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


[U-Boot] [PATCH 2/2] at91sam9x: driver to use the internal RTT as RTC

2010-03-29 Thread Alexander Holler
Based on the linux driver.

Signed-off-by: Alexander Holler hol...@ahsoftware.de
---
 README |1 +
 drivers/rtc/Makefile   |1 +
 drivers/rtc/at91sam9-rtc.c |  162 
 3 files changed, 164 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/at91sam9-rtc.c

diff --git a/README b/README
index 940b507..afe2aa6 100644
--- a/README
+++ b/README
@@ -733,6 +733,7 @@ The following options need to be configured:
CONFIG_RTC_ISL1208  - use Intersil ISL1208 RTC
CONFIG_RTC_MAX6900  - use Maxim, Inc. MAX6900 RTC
CONFIG_SYS_RTC_DS1337_NOOSC - Turn off the OSC output for 
DS1337
+   CONFIG_RTC_AT91SAM9 - use internal RTT of AT91SAM9x
 
Note that if the RTC uses I2C, then the I2C interface
must also be configured. See I2C Support, below.
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 772a49a..4a48231 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -62,6 +62,7 @@ COBJS-$(CONFIG_RTC_RX8025) += rx8025.o
 COBJS-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
 COBJS-$(CONFIG_RTC_S3C44B0) += s3c44b0_rtc.o
 COBJS-$(CONFIG_RTC_X1205) += x1205.o
+COBJS-$(CONFIG_RTC_AT91SAM9) += at91sam9-rtc.o
 
 COBJS  := $(sort $(COBJS-y))
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/rtc/at91sam9-rtc.c b/drivers/rtc/at91sam9-rtc.c
new file mode 100644
index 000..5eb7b91
--- /dev/null
+++ b/drivers/rtc/at91sam9-rtc.c
@@ -0,0 +1,162 @@
+/*
+ * RTT as Real Time Clock driver for AT91SAM9 SoC family
+ *
+ * (C) Copyright 2010
+ * Alexander Holler hol...@ahsoftware.de
+ *
+ * Based on rtc-at91sam9.c from Michel Benoit
+ * Based on rtc-at91rm9200.c by Rick Bronson
+ *
+ * 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
+ */
+
+/*
+ * This driver uses two configurable hardware resources that live in the
+ * AT91SAM9 backup power domain (intended to be powered at all times)
+ * to implement the Real Time Clock interfaces
+ *
+ *  - A Real-time Timer (RTT) counts up in seconds from a base time.
+ *We can't assign the counter value (CRTV) ... but we can reset it.
+ *
+ *  - One of the General Purpose Backup Registers (GPBRs) holds the
+ *base time, normally an offset from the beginning of the POSIX
+ *epoch (1970-Jan-1 00:00:00 UTC).  Some systems also include the
+ *local timezone's offset.
+ *
+ * The RTC's value is the RTT counter plus that offset.  The RTC's alarm
+ * is likewise a base (ALMV) plus that offset.
+ *
+ * Not all RTTs will be used as RTCs; some systems have multiple RTTs to
+ * choose from, or a real RTC module.  All systems have multiple GPBR
+ * registers available, likewise usable for more than RTC support.
+ *
+ * In addition to CONFIG_CMD_DATE these additional defines must be set:
+ *
+ * #define CONFIG_RTC_AT91SAM9
+ * #define CONFIG_RTC_AT91SAM9_RTT AT91_RTT0_BASE
+ * #define CONFIG_RTC_AT91SAM9_GPBR 0
+ *
+ */
+#include common.h
+#include command.h
+#include asm/arch/io.h
+#include asm/arch/hardware.h
+#include rtc.h
+
+#if defined(CONFIG_CMD_DATE)
+
+#undef RTC_DEBUG
+
+#ifdef RTC_DEBUG
+#  define DPRINTF(x,args...)   printf(at91sam9-rtc:  x , ##args)
+#else
+#  define DPRINTF(x,args...)
+#endif
+
+/* Defines copied from linux/arch/arm/mach-at91/include/mach/at91_rtt.h */
+#define AT91_RTT_MR0x00/* Real-time Mode Register */
+#define AT91_RTT_AR0x04/* Real-time Alarm Register */
+#define AT91_RTT_VR0x08/* Real-time Value Register */
+#define AT91_RTT_RTPRES(0x  0)   /* Real-time Timer 
Prescaler Value */
+#define AT91_RTT_ALMIEN(1  16)   /* Alarm Interrupt 
Enable */
+#define AT91_RTT_RTTINCIEN (1  17)   /* Real Time Timer Increment 
Interrupt Enable */
+#define AT91_RTT_RTTRST(1  18)   /* Real Time Timer 
Restart */
+
+/*
+ * We store ALARM_DISABLED in ALMV to record that no alarm is set.
+ * It's also the reset value for that field.
+ */
+#define ALARM_DISABLED ((u32)~0)
+
+#define rtt_readl(field) \
+   readl(CONFIG_RTC_AT91SAM9_RTT + AT91_RTT_ ## field)
+#define rtt_writel(field, val) \
+   writel((val), 

[U-Boot] [PATCH 1/2] at91: add defines for RTT and GPBR

2010-03-29 Thread Alexander Holler
Signed-off-by: Alexander Holler hol...@ahsoftware.de
---
 include/asm-arm/arch-at91/at91sam9260.h |2 ++
 include/asm-arm/arch-at91/at91sam9261.h |2 ++
 include/asm-arm/arch-at91/at91sam9263.h |3 +++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-at91/at91sam9260.h 
b/include/asm-arm/arch-at91/at91sam9260.h
index a60a081..ec04318 100644
--- a/include/asm-arm/arch-at91/at91sam9260.h
+++ b/include/asm-arm/arch-at91/at91sam9260.h
@@ -56,8 +56,10 @@
 #define AT91_PIO_BASE  0xf400
 #define AT91_PMC_BASE  0xfc00
 #define AT91_RSTC_BASE 0xfd00
+#define AT91_RTT_BASE  0xfd20
 #define AT91_PIT_BASE  0xfd30
 #define AT91_WDT_BASE  0xfd40
+#define AT91_GPR_BASE  0xfd50
 
 #ifdef CONFIG_AT91_LEGACY
 
diff --git a/include/asm-arm/arch-at91/at91sam9261.h 
b/include/asm-arm/arch-at91/at91sam9261.h
index 2952292..7ca0283 100644
--- a/include/asm-arm/arch-at91/at91sam9261.h
+++ b/include/asm-arm/arch-at91/at91sam9261.h
@@ -49,8 +49,10 @@
 #define AT91_PIO_BASE  0xf400
 #define AT91_PMC_BASE  0xfc00
 #define AT91_RSTC_BASE 0xfd00
+#define AT91_RTT_BASE  0xfd20
 #define AT91_PIT_BASE  0xfd30
 #define AT91_WDT_BASE  0xfd40
+#define AT91_GPBR_BASE 0xfd50
 
 #ifdef CONFIG_AT91_LEGACY
 
diff --git a/include/asm-arm/arch-at91/at91sam9263.h 
b/include/asm-arm/arch-at91/at91sam9263.h
index c177bd0..4ada1ce 100644
--- a/include/asm-arm/arch-at91/at91sam9263.h
+++ b/include/asm-arm/arch-at91/at91sam9263.h
@@ -61,8 +61,11 @@
 #define AT91_PIO_BASE  0xf200
 #define AT91_PMC_BASE  0xfc00
 #define AT91_RSTC_BASE 0xfd00
+#define AT91_RTT0_BASE 0xfd20
 #define AT91_PIT_BASE  0xfd30
 #define AT91_WDT_BASE  0xfd40
+#define AT91_RTT1_BASE 0xfd50
+#define AT91_GPBR_BASE 0xfd60
 
 #ifdef CONFIG_AT91_LEGACY
 
-- 
1.6.2.5

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


Re: [U-Boot] [PATCH 2/4] s5p6442: Support onenand driver

2010-03-29 Thread Scott Wood
Joonyoung Shim wrote:
 This patch is for onenand support of s5p6442 SoC.
 
 Cc: Minkyu Kang mk7.k...@samsung.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com
 ---

Acked-by: Scott Wood scottw...@freescale.com

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


[U-Boot] [PATCH 1/3] ARM1176: Coexist with other ARM1176 platforms

2010-03-29 Thread Cyril Chemparathy
The current ARM1176 CPU specific code is too specific to the SMDK6400
architecture.  The following changes were necessary prerequisites for the
addition of other SoCs based on ARM1176.

Existing board's (SMDK6400) configuration has been modified to keep behavior
unchanged despite these changes.

1. Peripheral port remap configurability
The earlier code had hardcoded remap values specific to s3c64xx in start.S.
This change makes the peripheral port remap addresses and sizes configurable.

2. Skip low level initialization
Ability to skip low level initialization if necessary.  Many other platforms
have a similar capability, and this is quite useful during debug/bring-up.

3. U-Boot code relocation support
Most architectures allow u-boot code to run initially at a different
address (possibly in NOR) and then get relocated to its final resting place
in RAM.  Added support for this capability in ARM1176 architecture.

4. Disable TCM if necessary
If a ROM based bootloader happened to have initialized TCM, we disable it here
to keep things sane.

5. Remove unnecessary SoC specific includes
ARM1176 code does not really need this SoC specific include.  The presence
of this include prevents builds on other ARM1176 archs.

6. ARM926 style MMU disable when !CONFIG_ENABLE_MMU
The original MMU disable code masks out too many bits from the load address
when it tries to figure out the physical address of the jump target label.
Consequently, it ends up branching to the wrong address after disabling the
MMU.

Signed-off-by: Cyril Chemparathy cy...@ti.com
---
 cpu/arm1176/cpu.c  |1 -
 cpu/arm1176/start.S|   60 ++--
 include/configs/smdk6400.h |6 
 3 files changed, 58 insertions(+), 9 deletions(-)

diff --git a/cpu/arm1176/cpu.c b/cpu/arm1176/cpu.c
index 2c0014f..c0fd114 100644
--- a/cpu/arm1176/cpu.c
+++ b/cpu/arm1176/cpu.c
@@ -33,7 +33,6 @@
 
 #include common.h
 #include command.h
-#include asm/arch/s3c6400.h
 #include asm/system.h
 
 static void cache_flush (void);
diff --git a/cpu/arm1176/start.S b/cpu/arm1176/start.S
index 68a356d..beec574 100644
--- a/cpu/arm1176/start.S
+++ b/cpu/arm1176/start.S
@@ -1,5 +1,5 @@
 /*
- *  armboot - Startup Code for S3C6400/ARM1176 CPU-core
+ *  armboot - Startup Code for ARM1176 CPU-core
  *
  * Copyright (c) 2007  Samsung Electronics
  *
@@ -35,7 +35,6 @@
 #ifdef CONFIG_ENABLE_MMU
 #include asm/proc/domain.h
 #endif
-#include asm/arch/s3c6400.h
 
 #if !defined(CONFIG_ENABLE_MMU)  !defined(CONFIG_SYS_PHY_UBOOT_BASE)
 #define CONFIG_SYS_PHY_UBOOT_BASE  CONFIG_SYS_UBOOT_BASE
@@ -145,6 +144,7 @@ reset:
  *
  *
  */
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
/*
 * we do sys-critical inits only at reboot,
 * not when booting from ram!
@@ -170,6 +170,8 @@ cpu_init_crit:
bic r0, r0, #0x0087 @ clear bits 7, 2:0 (B--- -CAM)
orr r0, r0, #0x0002 @ set bit 2 (A) Align
orr r0, r0, #0x1000 @ set bit 12 (I) I-Cache
+
+#ifdef CONFIG_ENABLE_MMU
/* Prepare to disable the MMU */
adr r1, mmu_disable_phys
/* We presume we're within the first 1024 bytes */
@@ -187,20 +189,60 @@ mmu_disable:
nop
nop
mov pc, r2
+mmu_disable_phys:
+#else
+   mcr p15, 0, r0, c1, c0, 0
 #endif
 
-mmu_disable_phys:
+#ifdef CONFIG_DISABLE_TCM
+   /*
+* Disable the TCMs
+*/
+   mrc p15, 0, r0, c0, c0, 2   /* Return TCM details */
+   cmp r0, #0
+   beq skip_tcmdisable
+   mov r1, #0
+   mov r2, #1
+   tst r0, r2
+   mcrne   p15, 0, r1, c9, c1, 1   /* Disable Instruction TCM if present*/
+   tst r0, r2, LSL #16
+   mcrne   p15, 0, r1, c9, c1, 0   /* Disable Data TCM if present*/
+skip_tcmdisable:
+#endif
+#endif
+
+#ifdef CONFIG_PERIPORT_REMAP
/* Peri port setup */
-   ldr r0, =0x7000
-   orr r0, r0, #0x13
+   ldr r0, =CONFIG_PERIPORT_BASE
+   orr r0, r0, #CONFIG_PERIPORT_SIZE
mcr p15,0,r0,c15,c2,4   @ 256M (0x7000 - 0x7fff)
+#endif
 
/*
 * Go setup Memory and board specific bits prior to relocation.
 */
bl  lowlevel_init   /* go setup pll,mux,memory */
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
+
+#ifndef CONFIG_SKIP_RELOCATE_UBOOT
+relocate:  /* relocate U-Boot to RAM   */
+   adr r0, _start  /* r0 - current position of code   */
+   ldr r1, _TEXT_BASE  /* test if we run from flash or RAM */
+   cmp r0, r1  /* don't reloc during debug */
+   beq stack_setup
+
+   ldr r2, _armboot_start
+   ldr r3, _bss_start
+   sub r2, r3, r2  /* r2 - size of armboot*/
+   add r2, r0, r2  /* r2 - source 

[U-Boot] [PATCH 0/3] TI: tnetv107x patch series

2010-03-29 Thread Cyril Chemparathy
TNETV107X is a Texas Instruments SoC based on an ARM1176 core, and with a
bunch on on-chip integrated peripherals.  This patch series generalizes current
ARM1176 code to allow for the addition of new ARM1176 SOCs.  The remaining
patches in this series add arch and board support.

The contents of this series are identical to the larger patch posted earlier.
The only difference here is that these changes have been split up as per
feedback from Sandeep.


Cyril Chemparathy (3):
  ARM1176: Coexist with other ARM1176 platforms
  ARM1176: TI: TNETV107X soc initial support
  TI: TNETV107X EVM initial support

 MAKEALL|1 +
 Makefile   |3 +
 board/ti/tnetv107xevm/Makefile |   49 +++
 board/ti/tnetv107xevm/config.mk|   20 +
 board/ti/tnetv107xevm/sdb_board.c  |   66 
 board/ti/tnetv107xevm/u-boot.lds   |   48 +++
 cpu/arm1176/cpu.c  |1 -
 cpu/arm1176/start.S|   60 +++-
 cpu/arm1176/tnetv107x/Makefile |   44 +++
 cpu/arm1176/tnetv107x/aemif.c  |  173 +
 cpu/arm1176/tnetv107x/clock.c  |  562 
 cpu/arm1176/tnetv107x/init.c   |   41 ++
 cpu/arm1176/tnetv107x/lowlevel_init.S  |   25 ++
 cpu/arm1176/tnetv107x/mux.c|  463 +++
 cpu/arm1176/tnetv107x/timer.c  |  125 ++
 cpu/arm1176/tnetv107x/wdt.c|  172 +
 include/asm-arm/arch-tnetv107x/clock.h |   43 +++
 include/asm-arm/arch-tnetv107x/emif_defs.h |1 +
 include/asm-arm/arch-tnetv107x/hardware.h  |  184 +
 include/asm-arm/arch-tnetv107x/mux.h   |  307 +++
 include/asm-arm/arch-tnetv107x/nand_defs.h |   38 ++
 include/configs/smdk6400.h |6 +
 include/configs/tnetv107x_evm.h|  225 +++
 23 files changed, 2648 insertions(+), 9 deletions(-)
 create mode 100644 board/ti/tnetv107xevm/Makefile
 create mode 100644 board/ti/tnetv107xevm/config.mk
 create mode 100644 board/ti/tnetv107xevm/sdb_board.c
 create mode 100644 board/ti/tnetv107xevm/u-boot.lds
 create mode 100644 cpu/arm1176/tnetv107x/Makefile
 create mode 100644 cpu/arm1176/tnetv107x/aemif.c
 create mode 100644 cpu/arm1176/tnetv107x/clock.c
 create mode 100644 cpu/arm1176/tnetv107x/init.c
 create mode 100644 cpu/arm1176/tnetv107x/lowlevel_init.S
 create mode 100644 cpu/arm1176/tnetv107x/mux.c
 create mode 100644 cpu/arm1176/tnetv107x/timer.c
 create mode 100644 cpu/arm1176/tnetv107x/wdt.c
 create mode 100644 include/asm-arm/arch-tnetv107x/clock.h
 create mode 100644 include/asm-arm/arch-tnetv107x/emif_defs.h
 create mode 100644 include/asm-arm/arch-tnetv107x/hardware.h
 create mode 100644 include/asm-arm/arch-tnetv107x/mux.h
 create mode 100644 include/asm-arm/arch-tnetv107x/nand_defs.h
 create mode 100644 include/configs/tnetv107x_evm.h

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


[U-Boot] [PATCH 3/3] TI: TNETV107X EVM initial support

2010-03-29 Thread Cyril Chemparathy
TNETV107X is a Texas Instruments SoC based on an ARM1176 core, and with a
bunch on on-chip integrated peripherals.  This patch adds support for the
TNETV107X EVM board.

Signed-off-by: Cyril Chemparathy cy...@ti.com
---
 MAKEALL   |1 +
 Makefile  |3 +
 board/ti/tnetv107xevm/Makefile|   49 
 board/ti/tnetv107xevm/config.mk   |   20 
 board/ti/tnetv107xevm/sdb_board.c |   66 +++
 board/ti/tnetv107xevm/u-boot.lds  |   48 
 include/configs/tnetv107x_evm.h   |  225 +
 7 files changed, 412 insertions(+), 0 deletions(-)
 create mode 100644 board/ti/tnetv107xevm/Makefile
 create mode 100644 board/ti/tnetv107xevm/config.mk
 create mode 100644 board/ti/tnetv107xevm/sdb_board.c
 create mode 100644 board/ti/tnetv107xevm/u-boot.lds
 create mode 100644 include/configs/tnetv107x_evm.h

diff --git a/MAKEALL b/MAKEALL
index a88c31e..63d8d16 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -623,6 +623,7 @@ LIST_ARM11=\
mx31pdk_nand\
qong\
smdk6400\
+   tnetv107x_evm   \
 
 
 #
diff --git a/Makefile b/Makefile
index c0e73de..e723e7c 100644
--- a/Makefile
+++ b/Makefile
@@ -2936,6 +2936,9 @@ davinci_dm365evm_config : unconfig
 davinci_dm6467evm_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci
 
+tnetv107x_evm_config: unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm1176 tnetv107xevm ti tnetv107x
+
 imx27lite_config:  unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
 
diff --git a/board/ti/tnetv107xevm/Makefile b/board/ti/tnetv107xevm/Makefile
new file mode 100644
index 000..2446c2a
--- /dev/null
+++ b/board/ti/tnetv107xevm/Makefile
@@ -0,0 +1,49 @@
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  += sdb_board.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+.PHONY: all
+
+all: $(LIB)
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak *~ .depend
+
+#
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/ti/tnetv107xevm/config.mk b/board/ti/tnetv107xevm/config.mk
new file mode 100644
index 000..d24d49a
--- /dev/null
+++ b/board/ti/tnetv107xevm/config.mk
@@ -0,0 +1,20 @@
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+TEXT_BASE = 0x83FC
diff --git a/board/ti/tnetv107xevm/sdb_board.c 
b/board/ti/tnetv107xevm/sdb_board.c
new file mode 100644
index 000..fa7b49c
--- /dev/null
+++ b/board/ti/tnetv107xevm/sdb_board.c
@@ -0,0 +1,66 @@
+/*
+ * TNETV107X-EVM: Board initialization
+ *
+ * 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.

Re: [U-Boot] [PATCH 2/2] at91sam9x: driver to use the internal RTT as RTC

2010-03-29 Thread Alexander Holler
Uups,

looks like I have corrupted the set date functionality with one of my 
last minute changes (as I've just discovered). I will send a fixed patch 
2/2 tomorrow.

Regards,

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


Re: [U-Boot] [PATCH] mpc86xx: adjust the DDR BATs after calculating true DDR size

2010-03-29 Thread Becky Bruce

On Mar 29, 2010, at 12:51 PM, Timur Tabi wrote:

 After determining how much DDR is actually in the system, adjust  
 DBAT0 and
 IBAT0 accordingly.  This ensures that the CPU won't attempt to access
 (via speculation) addresses outside of actual memory.

 On 86xx systems, DBAT0 and IBAT0 (the BATs for DDR) are initialized  
 to 2GB and
 kept that way.  If the system has less than 2GB of memory (typical  
 for an
 MPC8610 HPCD), the CPU may attempt to access this memory during  
 speculation.
 The zlib code is notorious for generating such memory reads, and  
 indeed on the
 MPC8610, uncompressing the Linux kernel causes a machine check  
 (without this
 patch).

 Signed-off-by: Timur Tabi ti...@freescale.com
 ---
 board/freescale/mpc8610hpcd/mpc8610hpcd.c |2 +
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |2 +
 cpu/mpc86xx/cpu.c |   44  
 +
 include/asm-ppc/mmu.h |4 ++-
 include/mpc86xx.h |2 +
 5 files changed, 53 insertions(+), 1 deletions(-)

 diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/ 
 freescale/mpc8610hpcd/mpc8610hpcd.c
 index 15a5b7b..b1623ba 100644
 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c
 +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
 @@ -125,6 +125,8 @@ initdram(int board_type)
   dram_size = fixed_sdram();
 #endif

 + adjust_ddr_bat(dram_size);
 +
   puts( DDR: );
   return dram_size;
 }
 diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/ 
 freescale/mpc8641hpcn/mpc8641hpcn.c
 index 7e6aabf..1f8b717 100644
 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
 +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
 @@ -72,6 +72,8 @@ initdram(int board_type)
   dram_size = fixed_sdram();
 #endif

 + adjust_ddr_bat(dram_size);
 +

By doing this here, you still have a (small) window where the problem  
could occur.  It's highly unlikely, but we might still have problems  
going forward.  I think we might need to:

1) remove the write of BAT0 from setup_bats (add a comment).  This  
way, there is no BAT setup for the DDR until right after we configure  
the controller
2) change the name adjust_ddr_bat to setup_ddr_bat or something  
similar.  I haven't dug around too much to see if this causes  
problems, but I am able to boot my 8641 this way.
3) Change setup_ddr_bat so that it just does a write (remove the BL  
from the #defined values for the default BAT0 and or them in here  
instead, and add a comment to the config file that says BL is  
determined dynamically


   puts(DDR: );
   return dram_size;
 }
 diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c
 index f7e012d..00039d3 100644
 --- a/cpu/mpc86xx/cpu.c
 +++ b/cpu/mpc86xx/cpu.c
 @@ -197,3 +197,47 @@ void mpc86xx_reginfo(void)
   printf(\tBR7\t0x%08X\tOR7\t0x%08X \n, in_be32(lbc-br7),  
 in_be32(lbc-or7));

 }
 +
 +/*
 + * Update the DDR BATs to reflect the actual size of DDR.
 + *
 + * On 86xx, the CONFIG_SYS_DBAT0U macro is used to specify the  
 initial size of
 + * the BAT for DDR.  After the actual size of DDR is determined  
 (which is
 + * usually smaller than the initial size), this BAT should be  
 adjusted
 + * accordingly.  Otherwise, any inadvertent access to addresses  
 beyond DDR
 + * (such as via speculative execution) can cause a machine check.
 + *
 + * dram_size is the actual size of DDR, in bytes
 + *
 + * Note: we assume that CONFIG_MAX_MEM_MAPPED is =  
 BATU_SIZE(BATU_BL_MAX);
 + * that is, the maximum amount of memory that U-Boot will ever map  
 will always
 + * fit into one BAT.  If this is not true, (e.g.  
 CONFIG_MAX_MEM_MAPPED is 2GB
 + * but HID0_XBSEN is not defined) then we might have a situation  
 where U-Boot
 + * will attempt to relocated itself outside of the region mapped by  
 DBAT0.
 + * This will cause a machine check.

I think you need to adjust how much usable ram u-boot thinks it has if  
you can't map it all.  If you have one BAT, and you have an amount of  
memory that is ! a power of 2, then you're going to leave a chunk  
unmapped, which can cause problems later.

 + *
 + * We also assume that the XBL bits are ignored by the processor  
 (even if set)
 + * if extended BAT addressing is disabled.
 + */
 +void adjust_ddr_bat(phys_addr_t dram_size)
 +{
 + unsigned long batl, batu, bl;
 +
 + bl = KB_TO_BATU(dram_size / 1024)  BATU_BL_MAX;
 +
 + if (BATU_SIZE(bl) != dram_size) {
 + puts((limiting mapped memory to );
 + print_size(BATU_SIZE(bl), ));
 + bl = BATU_BL_MAX;
 + }
 +
 + read_bat(DBAT0, batu, batl);
 + batu = ~BATU_BL_MAX;
 + batu |= bl;
 + write_bat(DBAT0, batu, batl);
 +
 + read_bat(IBAT0, batu, batl);
 + batu = ~BATU_BL_MAX;
 + batu |= bl;
 + write_bat(IBAT0, batu, batl);
 +}

 diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
 index fd10249..34a292d 100644
 --- a/include/asm-ppc/mmu.h
 +++ b/include/asm-ppc/mmu.h
 

Re: [U-Boot] [PATCH] mpc86xx: adjust the DDR BATs after calculating true DDR size

2010-03-29 Thread Timur Tabi
On Mon, Mar 29, 2010 at 5:09 PM, Becky Bruce bec...@kernel.crashing.org wrote:

 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
 +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
 @@ -72,6 +72,8 @@ initdram(int board_type)
       dram_size = fixed_sdram();
 #endif

 +     adjust_ddr_bat(dram_size);
 +

 By doing this here, you still have a (small) window where the problem
 could occur.

U-Boot hasn't relocated yet, so it's not using any of the DDR.  I
don't see how there could be a problem.

 It's highly unlikely, but we might still have problems
 going forward.  I think we might need to:

 1) remove the write of BAT0 from setup_bats (add a comment).  This
 way, there is no BAT setup for the DDR until right after we configure
 the controller

Ok, I get it now.  It will catch anyone trying to write to DDR before
it's really set up.  I can do that.

 2) change the name adjust_ddr_bat to setup_ddr_bat or something
 similar.  I haven't dug around too much to see if this causes
 problems, but I am able to boot my 8641 this way.

Ok.

 3) Change setup_ddr_bat so that it just does a write (remove the BL
 from the #defined values for the default BAT0 and or them in here
 instead, and add a comment to the config file that says BL is
 determined dynamically

Ok.

 I think you need to adjust how much usable ram u-boot thinks it has if
 you can't map it all.

I tried that.  The problem is that U-Boot uses this number to tell
Linux how much DDR there is.  The code doesn't really support U-Boot
and Linux seeing different amounts of DDR.

 If you have one BAT, and you have an amount of
 memory that is ! a power of 2, then you're going to leave a chunk
 unmapped, which can cause problems later.

AFAIK, we always have only one BAT for DDR.  I wasn't planning on
expanding the scope of this patch to add support for multiple BATs.

I don't know how to handle !2^X sizes of DDR.

 +#define KB_TO_BATU(x) x)/128) - 1) * 4) /* Convert KBs to BATU
 value */

 It seems somewhat arbitrary that you decided to use take KB here as an
 arg when the BATU_SIZE macro returns bytes.   I'd prefer to see
 symmetry here.

I used KB to keep the sizes of numbers small.  The smallest value is
128KB, so it's not *that* arbitrary.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc86xx: adjust the DDR BATs after calculating true DDR size

2010-03-29 Thread Becky Bruce

On Mar 29, 2010, at 6:07 PM, Timur Tabi wrote:

 On Mon, Mar 29, 2010 at 5:09 PM, Becky Bruce bec...@kernel.crashing.org 
  wrote:

snip



 I think you need to adjust how much usable ram u-boot thinks it has  
 if
 you can't map it all.

 I tried that.  The problem is that U-Boot uses this number to tell
 Linux how much DDR there is.  The code doesn't really support U-Boot
 and Linux seeing different amounts of DDR.

 If you have one BAT, and you have an amount of
 memory that is ! a power of 2, then you're going to leave a chunk
 unmapped, which can cause problems later.

 AFAIK, we always have only one BAT for DDR.  I wasn't planning on
 expanding the scope of this patch to add support for multiple BATs.

I'm not suggesting that - you really can't use multiple BATs as there  
are only 8 of them and they're a hot resource.


 I don't know how to handle !2^X sizes of DDR.

You can't map !2^x sizes of DDR with one BAT, so in this case you're  
always going to end up with a mapping that's smaller than the actual  
size of DDR, which is a *new* scenario for 86xx.  IIRC, before, we  
always set the BAT up for 2G, so we either 1) had *less* RAM than we  
had BAT mappings for or 2) pretended that we had 2G of memory and  
ignored the rest.  Have you looked at 83xx or 85xx to see if they do  
anything interesting here?  It's possible this problem has just been  
ignored other places, and we haven't had an issue yet.  It should't be  
too complicated to get get_effective_memsize to report something  
reasonable.


 +#define KB_TO_BATU(x) x)/128) - 1) * 4) /* Convert KBs to BATU
 value */

 It seems somewhat arbitrary that you decided to use take KB here as  
 an
 arg when the BATU_SIZE macro returns bytes.   I'd prefer to see
 symmetry here.

 I used KB to keep the sizes of numbers small.  The smallest value is
 128KB, so it's not *that* arbitrary.

The other stuff used bytes.  It's confusing.  Just use bytes.

-B

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


[U-Boot] [PATCH] mpc86xx: set the DDR BATs after calculating true DDR size

2010-03-29 Thread Kumar Gala
From: Timur Tabi ti...@freescale.com

After determining how much DDR is actually in the system, set DBAT0 and
IBAT0 accordingly.  This ensures that the CPU won't attempt to access
(via speculation) addresses outside of actual memory.

On 86xx systems, DBAT0 and IBAT0 (the BATs for DDR) are initialized to 2GB and
kept that way.  If the system has less than 2GB of memory (typical for an
MPC8610 HPCD), the CPU may attempt to access this memory during speculation.
The zlib code is notorious for generating such memory reads, and indeed on the
MPC8610, uncompressing the Linux kernel causes a machine check (without this
patch).

Signed-off-by: Timur Tabi ti...@freescale.com
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* This is my attempt at reworking the patch Timur posted based on comments from
  Becky.  I've tried to mimic the behavior or setup_ddr_tlb that we have on 85xx

 board/freescale/mpc8610hpcd/mpc8610hpcd.c |2 +
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |2 +
 cpu/mpc86xx/cpu.c |   32 +
 cpu/mpc86xx/cpu_init.c|4 +++
 include/asm-ppc/mmu.h |4 ++-
 include/configs/MPC8610HPCD.h |6 +---
 include/configs/MPC8641HPCN.h |4 +--
 include/mpc86xx.h |2 +
 8 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c 
b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
index 784a2ed..ab5f800 100644
--- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c
+++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c
@@ -127,6 +127,8 @@ initdram(int board_type)
dram_size = fixed_sdram();
 #endif
 
+   setup_ddr_bat(dram_size);
+
puts( DDR: );
return dram_size;
 }
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c 
b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index c521527..443c9fd 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -74,6 +74,8 @@ initdram(int board_type)
dram_size = fixed_sdram();
 #endif
 
+   setup_ddr_bat(dram_size);
+
puts(DDR: );
return dram_size;
 }
diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c
index f7e012d..c03a2b6 100644
--- a/cpu/mpc86xx/cpu.c
+++ b/cpu/mpc86xx/cpu.c
@@ -197,3 +197,35 @@ void mpc86xx_reginfo(void)
printf(\tBR7\t0x%08X\tOR7\t0x%08X \n, in_be32(lbc-br7), 
in_be32(lbc-or7));
 
 }
+
+/*
+ * Set the DDR BATs to reflect the actual size of DDR.
+ *
+ * dram_size is the actual size of DDR, in bytes
+ *
+ * Note: we assume that CONFIG_MAX_MEM_MAPPED is 2G or smaller as we only
+ * are using a single BAT to cover DDR.  
+ *
+ * If this is not true, (e.g. CONFIG_MAX_MEM_MAPPED is 2GB but HID0_XBSEN
+ * is not defined) then we might have a situation where U-Boot will attempt
+ * to relocated itself outside of the region mapped by DBAT0.
+ * This will cause a machine check.
+ *
+ * We also assume that the XBL bits are ignored by the processor (even if set)
+ * if extended BAT addressing is disabled.
+ */
+void setup_ddr_bat(phys_addr_t dram_size)
+{
+   unsigned long batu, bl;
+
+   bl = TO_BATU_BL(min(dram_size, CONFIG_MAX_MEM_MAPPED));
+
+   if (BATU_SIZE(bl) != dram_size) {
+   u64 sz = (u64)dram_size - BATU_SIZE(bl);
+   print_size(sz,  left unmapped\n);
+   }
+
+   batu = BATU_BL_2G | BATU_VS | BATU_VP;
+   write_bat(DBAT0, batu, CONFIG_SYS_DBAT0L);
+   write_bat(IBAT0, batu, CONFIG_SYS_IBAT0L);
+}
diff --git a/cpu/mpc86xx/cpu_init.c b/cpu/mpc86xx/cpu_init.c
index 5a78a9c..b4f047d 100644
--- a/cpu/mpc86xx/cpu_init.c
+++ b/cpu/mpc86xx/cpu_init.c
@@ -138,8 +138,12 @@ int cpu_init_r(void)
 /* Set up BAT registers */
 void setup_bats(void)
 {
+#if defined(CONFIG_SYS_DBAT0U)  defined(CONFIG_SYS_DBAT0L)
write_bat(DBAT0, CONFIG_SYS_DBAT0U, CONFIG_SYS_DBAT0L);
+#endif
+#if defined(CONFIG_SYS_IBAT0U)  defined(CONFIG_SYS_IBAT0L)
write_bat(IBAT0, CONFIG_SYS_IBAT0U, CONFIG_SYS_IBAT0L);
+#endif
write_bat(DBAT1, CONFIG_SYS_DBAT1U, CONFIG_SYS_DBAT1L);
write_bat(IBAT1, CONFIG_SYS_IBAT1U, CONFIG_SYS_IBAT1L);
write_bat(DBAT2, CONFIG_SYS_DBAT2U, CONFIG_SYS_DBAT2L);
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index fd10249..210b171 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -213,7 +213,9 @@ extern void print_bats(void);
 #define BATL_PADDR(x) ((phys_addr_t)((x  0xfffe)  \
 | ((x  0x0e00ULL)  24)  \
 | ((x  0x04ULL)  30)))
-#define BATU_SIZE(x) (1UL  (fls((x  BATU_BL_MAX)  2) + 17))
+#define BATU_SIZE(x) (1ULL  (fls((x  BATU_BL_MAX)  2) + 17))
+
+#define TO_BATU_BL(x) x)/(128*1024)) - 1) * 4) /* bytes into BATU_BL */
 
 /* Used to set up SDR1 register */
 #define HASH_TABLE_SIZE_64K0x0001
diff --git a/include/configs/MPC8610HPCD.h 

Re: [U-Boot] [PATCH] mpc86xx: set the DDR BATs after calculating true DDR size

2010-03-29 Thread Timur Tabi
On Mon, Mar 29, 2010 at 10:02 PM, Kumar Gala ga...@kernel.crashing.org wrote:

 + * We also assume that the XBL bits are ignored by the processor (even if 
 set)
 + * if extended BAT addressing is disabled.

Since we don't read/modify/write that BATs, this comment is probably
not true any more.

 -#define BATU_SIZE(x) (1UL  (fls((x  BATU_BL_MAX)  2) + 17))
 +#define BATU_SIZE(x) (1ULL  (fls((x  BATU_BL_MAX)  2) + 17))
 +
 +#define TO_BATU_BL(x) x)/(128*1024)) - 1) * 4) /* bytes into BATU_BL */

I don't think this works if (x) is not a power of two.  E.g.,
TO_BATU_BL(1.5GB) = 0xbffc.  It should truncate the number to 1GB and
give us 7ffc.  This is one of the issues that Becky raised.  I don't
know if there's some simple way to truncate a number to its lowest
power of two.

 --- a/include/configs/MPC8610HPCD.h
 +++ b/include/configs/MPC8610HPCD.h
 @@ -341,10 +341,8 @@
  * BAT0                2G      Cacheable, non-guarded
  * 0x_ 2G      DDR
  */
 -#define CONFIG_SYS_DBAT0L      (BATL_PP_RW | BATL_MEMCOHERENCE)
 -#define CONFIG_SYS_DBAT0U      (BATU_BL_2G | BATU_VS | BATU_VP)
 -#define CONFIG_SYS_IBAT0L      (BATL_PP_RW | BATL_MEMCOHERENCE )
 -#define CONFIG_SYS_IBAT0U      CONFIG_SYS_DBAT0U
 +#define CONFIG_SYS_DBAT0L      (BATL_PP_RW)
 +#define CONFIG_SYS_IBAT0L      (BATL_PP_RW)

  /*
  * BAT1                1G      Cache-inhibited, guarded
 diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
 index 12a8f60..94e4d24 100644
 --- a/include/configs/MPC8641HPCN.h
 +++ b/include/configs/MPC8641HPCN.h
 @@ -482,9 +482,7 @@ extern unsigned long get_board_sys_clk(unsigned long 
 dummy);
  * BAT0                DDR
  */
  #define CONFIG_SYS_DBAT0L      (BATL_PP_RW | BATL_MEMCOHERENCE)
 -#define CONFIG_SYS_DBAT0U      (BATU_BL_2G | BATU_VS | BATU_VP)
 -#define CONFIG_SYS_IBAT0L      (BATL_PP_RW | BATL_MEMCOHERENCE )
 -#define CONFIG_SYS_IBAT0U      CONFIG_SYS_DBAT0U
 +#define CONFIG_SYS_IBAT0L      (BATL_PP_RW | BATL_MEMCOHERENCE)

Why do we need BATL_MEMCOHERENCE on 8641 but not on 8610?

-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mpc86xx: set the DDR BATs after calculating true DDR size

2010-03-29 Thread Kumar Gala

On Mar 29, 2010, at 10:40 PM, Timur Tabi wrote:

 On Mon, Mar 29, 2010 at 10:02 PM, Kumar Gala ga...@kernel.crashing.org 
 wrote:
 
 + * We also assume that the XBL bits are ignored by the processor (even if 
 set)
 + * if extended BAT addressing is disabled.
 
 Since we don't read/modify/write that BATs, this comment is probably
 not true any more.
 
 -#define BATU_SIZE(x) (1UL  (fls((x  BATU_BL_MAX)  2) + 17))
 +#define BATU_SIZE(x) (1ULL  (fls((x  BATU_BL_MAX)  2) + 17))
 +
 +#define TO_BATU_BL(x) x)/(128*1024)) - 1) * 4) /* bytes into BATU_BL */
 
 I don't think this works if (x) is not a power of two.  E.g.,
 TO_BATU_BL(1.5GB) = 0xbffc.  It should truncate the number to 1GB and
 give us 7ffc.  This is one of the issues that Becky raised.  I don't
 know if there's some simple way to truncate a number to its lowest
 power of two.

Good point, we can do something like to cover to power two first:

(1  __ilog2_u64(x))

 --- a/include/configs/MPC8610HPCD.h
 +++ b/include/configs/MPC8610HPCD.h
 @@ -341,10 +341,8 @@
  * BAT02G  Cacheable, non-guarded
  * 0x_ 2G  DDR
  */
 -#define CONFIG_SYS_DBAT0L  (BATL_PP_RW | BATL_MEMCOHERENCE)
 -#define CONFIG_SYS_DBAT0U  (BATU_BL_2G | BATU_VS | BATU_VP)
 -#define CONFIG_SYS_IBAT0L  (BATL_PP_RW | BATL_MEMCOHERENCE )
 -#define CONFIG_SYS_IBAT0U  CONFIG_SYS_DBAT0U
 +#define CONFIG_SYS_DBAT0L  (BATL_PP_RW)
 +#define CONFIG_SYS_IBAT0L  (BATL_PP_RW)
 
  /*
  * BAT11G  Cache-inhibited, guarded
 diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
 index 12a8f60..94e4d24 100644
 --- a/include/configs/MPC8641HPCN.h
 +++ b/include/configs/MPC8641HPCN.h
 @@ -482,9 +482,7 @@ extern unsigned long get_board_sys_clk(unsigned long 
 dummy);
  * BAT0DDR
  */
  #define CONFIG_SYS_DBAT0L  (BATL_PP_RW | BATL_MEMCOHERENCE)
 -#define CONFIG_SYS_DBAT0U  (BATU_BL_2G | BATU_VS | BATU_VP)
 -#define CONFIG_SYS_IBAT0L  (BATL_PP_RW | BATL_MEMCOHERENCE )
 -#define CONFIG_SYS_IBAT0U  CONFIG_SYS_DBAT0U
 +#define CONFIG_SYS_IBAT0L  (BATL_PP_RW | BATL_MEMCOHERENCE)
 
 Why do we need BATL_MEMCOHERENCE on 8641 but not on 8610?

dual core on 8641, single core on 8610.

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


[U-Boot] net, fec_mxc: init mac address before using network commands

2010-03-29 Thread Heiko Schocher
initialize mac address with the value from ethaddr, before
doing some network commands. This is not in line with u-boot
design principle not to initalize not used devices, and
maybe should go away, if there is a solution for passing
the mac address to arm linux kernels.

Tested on the magnesium board.

Signed-off-by: Heiko Schocher h...@denx.de
---
posting this patch as a result of this discussion:

http://lists.denx.de/pipermail/u-boot/2010-March/069025.html

 drivers/net/fec_mxc.c |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 5af9cdb..9029490 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -749,11 +749,18 @@ static int fec_probe(bd_t *bd)

eth_register(edev);

-   if (fec_get_hwaddr(edev, ethaddr) == 0) {
-   printf(got MAC address from EEPROM: %pM\n, ethaddr);
-   memcpy(edev-enetaddr, ethaddr, 6);
-   fec_set_hwaddr(edev);
+   if (!eth_getenv_enetaddr(ethaddr, ethaddr)) { 
+   /* ethaddr is not set in the environment */
+   if (fec_get_hwaddr(edev, ethaddr) == 0) {
+   printf(got MAC address from EEPROM: %pM\n, ethaddr);
+   eth_setenv_enetaddr(ethaddr, ethaddr);
+   } else {
+   printf (no MAC found\n);
+   return -1;
+   }
}
+   memcpy(edev-enetaddr, ethaddr, 6);
+   fec_set_hwaddr(edev);

return 0;
 }
-- 
1.6.2.5

-- 
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


[U-Boot] net, kirkwood_egiga: init mac address before using network commands

2010-03-29 Thread Heiko Schocher
initialize mac address with the value from ethaddr, before
doing some network commands. This is not in line with u-boot
design principle not to initalize not used devices, and
maybe should go away, if there is a solution for passing
the mac address to arm linux kernels.

Tested on the suen3 board.

Signed-off-by: Heiko Schocher h...@denx.de
---
posting this patch as a result of this discussion:

http://lists.denx.de/pipermail/u-boot/2010-March/069025.html

 drivers/net/kirkwood_egiga.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index 2ad7fea..e8b3777 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -678,7 +678,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
return -1;
}

-   while (!eth_getenv_enetaddr(s, dev-enetaddr)) {
+   if (!eth_getenv_enetaddr(s, dev-enetaddr)) {
/* Generate Random Private MAC addr if not set */
dev-enetaddr[0] = 0x02;
dev-enetaddr[1] = 0x50;
@@ -688,6 +688,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
dev-enetaddr[5] = get_random_hex();
eth_setenv_enetaddr(s, dev-enetaddr);
}
+   port_uc_addr_set(dkwgbe-regs, dev-enetaddr);

dev-init = (void *)kwgbe_init;
dev-halt = (void *)kwgbe_halt;
-- 
1.6.2.5

-- 
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