Re: [U-Boot-Users] [PATCH 3/7 v6] ARM: Add arm1176 core with S3C6400 SoC

2008-08-09 Thread Jean-Christophe PLAGNIOL-VILLARD
 +
 +void dcache_disable (void)
 +{
 + ulong reg;
 +
 + reg = read_p15_c1 ();
 + cp_delay ();
 + reg = ~C1_DC;
 + write_p15_c1 (reg);
why not  as the other implementation?
 + write_p15_c1 (reg  ~C1_DC);
 +}
 +
 +int dcache_status (void)
 +{
 + return (read_p15_c1 ()  C1_DC) != 0;
 +}
 +
 +/* flush I/D-cache */
 +static void cache_flush (void)
 +{
 + /* invalidate both caches and flush btb */
 + asm (mcr p15, 0, %0, c7, c7, 0: :r (0));
 + /* mem barrier to sync things */
 + asm (mcr p15, 0, %0, c7, c10, 4: :r (0));
 +}
 +  * The timer is set to wrap after 100s, at 66MHz this obviously
 +  * happens after 10,000,000 ticks. A long variable can thus
 +  * keep values up to 40,000s, i.e., 11 hours. This should be
 +  * enough for most uses:-) Possible optimizations: select a
 +  * binary-friendly frequency, e.g., 1ms / 128. Also calculate
 +  * the prescaler automatically for other PCLK frequencies.
 +  */
 + /* Set timer frequency to 500KHz, at 66MHz we get prescaler=132  255 */
 + timers-TCFG0 = PRESCALER  8;
 + if (timer_load_val == 0) {
 + /*
 +  * for 10 ms clock period @ PCLK with 4 bit divider = 1/2 and
 +  * prescaler = 16. Should be 10390 @33.25MHz and 15625 @ 50 MHz
 +  */
 + timer_load_val = get_PCLK() / PRESCALER * (100 / 4); /* 100s */
 + /*printf(Calculated %lu timer_load_val\n, timer_load_val);*/
please remove if not need
 + timers-TCFG1 = (timers-TCFG1  ~0xf) | 0x2;
 + }
 +
please add some empty line to be more readable
 + /* load value for 10 ms timeout */
 + lastdec = timers-TCNTB4 = timer_load_val;
 + /* auto load, manual update of Timer 4 */
 + timers-TCON = (timers-TCON  ~0x0070) | TCON_4_AUTO |
 + TCON_4_UPDATE;
 + /* auto load, start Timer 4 */
 + timers-TCON = (timers-TCON  ~0x0070) | TCON_4_AUTO | COUNT_4_ON;
 + timestamp = 0;
 +
 + return 0;
 +}
 +
 +/*
 + * timer without interrupts
 + */
 +
 +/*
 + * This function is derived from PowerPC code (read timebase as long long).
 + * On ARM it just returns the timer value.
 + */
 +unsigned long long get_ticks(void)
 +{
 + ulong now = read_timer();
 +
 + if (lastdec = now) {
 + /* normal mode */
 +#define MPLL 1
 +#define EPLL 2
 +
 +/* - 
 */
 +/*
 + * NOTE: This describes the proper use of this file.
 + *
 + * CONFIG_SYS_CLK_FREQ should be defined as the input frequency of the PLL.
 + *
 + * get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of
 + * the specified bus in HZ.
 + */
 +/* - 
 */
 +
 +static ulong get_PLLCLK(int pllreg)
please not uppercase
 +{
 + ulong r, m, p, s;
 +
 + if (pllreg == APLL)
 + r = APLL_CON_REG;
 + else if (pllreg == MPLL)
 + r = MPLL_CON_REG;
 + else if (pllreg == EPLL)
 + r = EPLL_CON0_REG;
 + else
 + hang();
please move to switch implementation
 +
 + m = (r  16)  0x3ff;
 + p = (r  8)  0x3f;
 + s = r  0x7;
 +
 + return m * (CONFIG_SYS_CLK_FREQ / (p * (1  s)));
 +}
 +
 +/* return ARMCORE frequency */
 +ulong get_ARMCLK(void)
please not uppercase
 +{
 + ulong div;
 +
 + div = CLK_DIV0_REG;
 +
 + return get_PLLCLK(APLL) / ((div  0x7) + 1);
 +}
 +
 +/* return FCLK frequency */
 +ulong get_FCLK(void)
please not uppercase
 +{
 + return get_PLLCLK(APLL);
 +}
 +
 +/* return HCLK frequency */
 +ulong get_HCLK(void)
please not uppercase
 +{
 + ulong fclk;
 +
 + uint hclkx2_div = ((CLK_DIV0_REG  9)  0x7) + 1;
 + uint hclk_div = ((CLK_DIV0_REG  8)  0x1) + 1;
 +
 + /*
 +  * Bit 7 exists on s3c6410, and not on s3c6400, it is reserved on
 +  * s3c6400 and is always 0, and it is indeed running in ASYNC mode
 +  */
 + if (OTHERS_REG  0x80)
 + fclk = get_FCLK();  /* SYNC Mode*/
 + else
 + fclk = get_PLLCLK(MPLL);/* ASYNC Mode   */
 +
 + return fclk / (hclk_div * hclkx2_div);
 +}
 +
 +/* return PCLK frequency */
 +ulong get_PCLK(void)
please not uppercase
 +{
 + ulong fclk;
 + uint hclkx2_div = ((CLK_DIV0_REG  9)  0x7) + 1;
 + uint pre_div = ((CLK_DIV0_REG  12)  0xf) + 1;
 +
 + if (OTHERS_REG  0x80)
 + fclk = get_FCLK();  /* SYNC Mode*/
 + else
 + fclk = get_PLLCLK(MPLL);/* ASYNC Mode   */
 +
 + return fclk / (hclkx2_div * pre_div);
 +}
 +
 +/* return UCLK frequency */
 +ulong get_UCLK(void)
please not uppercase
 +{
 + return get_PLLCLK(EPLL);
 +}
 +
 +int print_cpuinfo(void)
 +{
 + printf(\nCPU: [EMAIL PROTECTED], get_ARMCLK() / 100);
 + printf( Fclk = %luMHz, Hclk = %luMHz, Pclk = %luMHz ,
 +get_FCLK() / 100, get_HCLK() / 

Re: [U-Boot-Users] [PATCH 5/7 v6] serial: add S3C64XX serial driver

2008-08-09 Thread Jean-Christophe PLAGNIOL-VILLARD
 + u32 reg;
 + u32 pclk_ratio = get_PCLK() / gd-baudrate;
 + int i;
 +
IMHO it's still obscur
 + /* PCLK / (16 * baudrate) - 1 */
 + reg = pclk_ratio / 16 - 1;
 + /* i = pclk_ratio % 16 */
 + i = pclk_ratio - (reg + 1) * 16;
 +
 + uart-UBRDIV = reg;
 + uart-UDIVSLOT = udivslot[i];
 +
 + for (i = 0; i  100; i++)
 + barrier();
 +}

Best Regards,
J.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/7 v6] ARM: Add support for S3C6400 based SMDK6400 board

2008-08-09 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:42 Wed 06 Aug , Guennadi Liakhovetski wrote:
 SMDK6400 can only boot U-Boot from NAND-flash. This patch adds a nand_spl
 driver for it too. The board can also boot from the NOR flash, but due to
 hardware limitations it can only address 64KiB on it, which is not enough
 for U-Boot. Based on the original sources by Samsung for U-Boot 1.1.6.
 
 Signed-off-by: Guennadi Liakhovetski [EMAIL PROTECTED]
 ---
 
 Changes since v5: adjust the configuration to more precisely desribe NAND 
 ECC layout.
 
  MAKEALL|1 +
  Makefile   |   17 ++
please add your entry in MAINTAINERS
  board/samsung/smdk6400/Makefile|   54 +
  board/samsung/smdk6400/config.mk   |   30 +++
  board/samsung/smdk6400/lowlevel_init.S |  316 
 
  board/samsung/smdk6400/smdk6400.c  |  130 
  board/samsung/smdk6400/u-boot-nand.lds |   62 ++
  include/configs/smdk6400.h |  306 +++
  nand_spl/board/samsung/smdk6400/Makefile   |  106 ++
  nand_spl/board/samsung/smdk6400/config.mk  |   40 
  nand_spl/board/samsung/smdk6400/u-boot.lds |   61 ++
  11 files changed, 1123 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/smdk6400/Makefile
  create mode 100644 board/samsung/smdk6400/config.mk
  create mode 100644 board/samsung/smdk6400/lowlevel_init.S
  create mode 100644 board/samsung/smdk6400/smdk6400.c
  create mode 100644 board/samsung/smdk6400/u-boot-nand.lds
  create mode 100644 include/configs/smdk6400.h
  create mode 100644 nand_spl/board/samsung/smdk6400/Makefile
  create mode 100644 nand_spl/board/samsung/smdk6400/config.mk
  create mode 100644 nand_spl/board/samsung/smdk6400/u-boot.lds

 +# 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:= smdk6400.o
 +SOBJS:= lowlevel_init.o
 +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
 +
 +$(LIB):  $(obj).depend $(OBJS)
 + $(AR) crv $@ $(OBJS)
 +

please keep this Makefile as other new style

ex from atmel board

include $(TOPDIR)/config.mk

LIB = $(obj)lib$(BOARD).a

COBJS-y += at91cap9adk.o
COBJS-y += led.o
COBJS-y += partition.o
COBJS-$(CONFIG_CMD_NAND) += nand.o

SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS:= $(addprefix $(obj),$(COBJS-y))
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/samsung/smdk6400/config.mk 
 b/board/samsung/smdk6400/config.mk
 new file mode 100644
 index 000..298d387
 --- /dev/null
 +++ b/board/samsung/smdk6400/config.mk
 @@ -0,0 +1,30 @@
 +#
 +# (C) Copyright 2002
 +# Gary Jennejohn, DENX Software Engineering, [EMAIL PROTECTED]
 +# David Mueller, ELSOFT AG, [EMAIL PROTECTED]
 +#
 +# (C) Copyright 2008
 +# Guennadi Liakhovetki, DENX Software Engineering, [EMAIL PROTECTED]
 +#
 +# SAMSUNG SMDK6400 board with mDirac3 (ARM1176) cpu
 +#
 +# see http://www.samsung.com/ for more information on SAMSUNG
 +
 +# On SMDK6400 we use the 64 MB SDRAM bank at
 +#
 +# 0x5000 to 0x5800
 +#
 +# Linux-Kernel is expected to be at 0x50008000, entry 0x50008000
 +#
 +# we load ourselves to 0x57e0 without MMU
 +# with MMU, load address is changed to 0xc7e0
 +#
 +# download area is 0x5000c000
 +
 +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 +
 +ifndef CONFIG_NAND_SPL
 +TEXT_BASE = $(RAM_TEXT)
 +else
 +TEXT_BASE = 0
 +endif
 +check_syncack:
 + ldr r1, [r0, #OTHERS_OFFSET]
 + ldr r2, =0xf00
 + and r1, r1, r2
 + cmp r1, #0xf00
 + bne check_syncack
 +#else/* ASYNC Mode */
please use .rept
 + nop
 + nop
 + nop
 + nop
 + nop
 +
and please be carefull with whitespaces
 index 000..77fd2c8
 --- /dev/null
 +++ b/board/samsung/smdk6400/smdk6400.c
 @@ -0,0 +1,130 @@
 +/*
 +static inline void delay(unsigned long loops)
 +{
 + __asm__ volatile (1:\n subs %0, %1, #1\n
 +   bne 1b
 +   : =r (loops) : 0 (loops));
 +}
 +
 +/*
 + * Miscellaneous platform dependent initialisations
 + */
 +
 +{
 + nand_probe(CFG_NAND_BASE);
 + if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN)
 + print_size(nand_dev_desc[0].totlen, 

Re: [U-Boot-Users] [PATCH] FIT: Fix handling of images without ramdisks

2008-08-09 Thread Wolfgang Denk
Dear Peter Tyser,

In message [EMAIL PROTECTED] you wrote:
 boot_get_ramdisk() should not treat the case when a FIT image does not 
 contain a ramdisk as an error.
 
 Signed-off-by: Peter Tyser [EMAIL PROTECTED]
 ---
 The original code would not allow booting of a FIT image which didn't contain 
 a ramdisk.  The bug was observed and fixed on a powerpc 85xx system.

Applied, thanks.

But prelase remeber the maximum line length of some 70+ characters.
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: [EMAIL PROTECTED]
The greatest threat towards future is indifference.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [GIT PULL] Please pull mpc512x tree

2008-08-09 Thread Wolfgang Denk
Dear John Rigby,

In message [EMAIL PROTECTED] you wrote:
 
 The following changes since commit 81091f58f0c58ecd26c5b05de2ae20ca6cdb521c:
Jean-Christophe PLAGNIOL-VILLARD (1):
  drivers/serial: Move conditional compilation to Makefile for 
 CONFIG_* macros
 
 are available in the git repository at:
 
git://git.denx.de/u-boot-mpc512x.git master
 
 John Rigby (1):
mpc5121: squash some fdt fixup errors
 
 Kenneth Johansson (1):
mpc5121: Move iopin features from board specific to common files.
 
   board/ads5121/Makefile|2 +-
   board/ads5121/ads5121.c   |   58 ++-
   board/ads5121/iopin.c |  115 -
   board/ads5121/iopin.h |  222 ---
   cpu/mpc512x/Makefile  |2 +-
   cpu/mpc512x/cpu.c |   77 +++---
   cpu/mpc512x/iopin.c   |   49 +
   include/configs/ads5121.h |5 +-
   include/mpc512x.h |  251 
 +++--
   9 files changed, 388 insertions(+), 393 deletions(-)
   delete mode 100644 board/ads5121/iopin.c
   delete mode 100644 board/ads5121/iopin.h
   create mode 100644 cpu/mpc512x/iopin.c

Done, 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: [EMAIL PROTECTED]
Those who hate and fight must stop themselves -- otherwise it is  not
stopped.
-- Spock, Day of the Dove, stardate unknown

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Allow console input to be disabled

2008-08-09 Thread Wolfgang Denk
Dear Jerry Van Baren,

In message [EMAIL PROTECTED] you wrote:

 For what it is worth, I'm with Haavard - it seems useful.  WRT the 
 dangerous part - it's intended use is for debug, so presumably it will 

It may be intended for debug, but it's available there without warning
for the end user.

 be the developer that locks himself out of the console and will have the 
 tools to break back in.  From that POV, it isn't any more dangerous than 
 all the other ways a user/developer can brick a board (starting with 
 erasing flash ;-).

I think this one is a bit nastier. It's like this rope hanging out of
a black box labeled silencer. The label  doesn't  mention  that  it
goes KABM! first, before there is a big silence (and a cloud of
dust and a pile of debris).


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: [EMAIL PROTECTED]
Certainly there are things in life that money  can't  buy,  but  it's
very funny - Did you ever try buying them without money? - Ogden Nash

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Report back the location we put the device tree if we dont boot

2008-08-09 Thread Wolfgang Denk
Dear Kumar Gala,

In message [EMAIL PROTECTED] you wrote:
 Its useful to know where the device tree is if we have set 'autostart'
 to 'no.  We come back to the prompt after a boot command and we can
 than post process the device tree but we need to know where it was put
 report this back via the env variable 'bootm_fdtaddr'.
 
 Signed-off-by: Kumar Gala [EMAIL PROTECTED]
 ---
  lib_ppc/bootm.c |   11 ++-
  1 files changed, 10 insertions(+), 1 deletions(-)

Since I will revert the 'autostart' patch, this patch becomes
obsolete.

NAK.

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: [EMAIL PROTECTED]
A wise person makes his  own  decisions,  a  weak  one  obeys  public
opinion.   -- Chinese proverb

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users