Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-18 Thread Hebbar, Gururaja
On Wed, Apr 17, 2013 at 23:12:51, Mark Jackson wrote:
 On 17/04/13 06:27, Hebbar, Gururaja wrote:
  Mark,
 
  On Tue, Apr 16, 2013 at 20:32:34, Mark Jackson wrote:
 
 snip
 
  diff --git a/MAINTAINERS b/MAINTAINERS
  index 1614b91..7778883 100644
  --- a/MAINTAINERS
  +++ b/MAINTAINERS
  @@ -710,6 +710,10 @@ Ilko Iliev il...@ronetix.at
 PM9263  AT91SAM9263
 PM9G45  ARM926EJS (AT91SAM9G45 SoC)
 
  +Mark Jackson m...@newflow.co.uk
 
  A small nit-pick, you sent the commit using email id as 
  mpfj-l...@mimc.co.uk
  But in the maintainer file, it shows as m...@newflow.co.uk.
 
  Is this valid/correct?
 
 Yes ... the newflow address is my official work one.
 
 But I have a separate email address for all my mailing lists which makes 
 sorting out my mailboxes *so* much easier.

AFAIK Email id in Maintainer file will be used for all communications. 

So I believe, you have enabled mail fwd from m...@newflow.co.uk to 
mpfj-l...@mimc.co.uk

 
 I trust this isn't an issue.
 
 Cheers
 Mark J.
 


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


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Hebbar, Gururaja
Mark,

On Tue, Apr 16, 2013 at 20:32:34, Mark Jackson wrote:
 NanoBone Specification:
 ---
 Memory:
   256MB DDR3
   64MB NOR flash
   256MB NAND flash
   128KB FRAM
 
 Ethernet:
   2 x 10/100 connected to SMSC LAN8710 PHY
 
 USB:
   1 x USB2.0 Type A
 
 I2C:
   2Kbit EEPROM (Microchip 24AA02)
   RTC (Maxim DS1338)
   GPIO Expander (Microchip MCP23017)
 
 Expansion connector:
   6 x UART
   1 x MMC/SD
   1 x USB2.0
 
 Signed-off-by: Mark Jackson m...@newflow.co.uk
 ---
  MAINTAINERS |4 +
  board/newflow/nanobone/Makefile |   46 ++
  board/newflow/nanobone/board.c  |  337 
 +++
  board/newflow/nanobone/board.h  |   24 +++
  board/newflow/nanobone/mux.c|  203 +++
  boards.cfg  |1 +
  include/configs/nanobone.h  |  291 +
  7 files changed, 906 insertions(+)
  create mode 100644 board/newflow/nanobone/Makefile
  create mode 100644 board/newflow/nanobone/board.c
  create mode 100644 board/newflow/nanobone/board.h
  create mode 100644 board/newflow/nanobone/mux.c
  create mode 100644 include/configs/nanobone.h
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 1614b91..7778883 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -710,6 +710,10 @@ Ilko Iliev il...@ronetix.at
   PM9263  AT91SAM9263
   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
  
 +Mark Jackson m...@newflow.co.uk

A small nit-pick, you sent the commit using email id as mpfj-l...@mimc.co.uk
But in the maintainer file, it shows as m...@newflow.co.uk.

Is this valid/correct?

Regards
Gururaja

 +
 + NANOBONEARM ARMV7 (AM33xx Soc)
 +
  Michael Jones michael.jo...@matrix-vision.de
  
   omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
 diff --git a/board/newflow/nanobone/Makefile b/board/newflow/nanobone/Makefile
 new file mode 100644
 index 000..67a87a1
 --- /dev/null
 +++ b/board/newflow/nanobone/Makefile
 @@ -0,0 +1,46 @@
 +#
 +# Makefile
 +#
 +# Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 +#
 +# 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 as is WITHOUT ANY WARRANTY of any
 +# kind, whether express or implied; without even the implied warranty
 +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 +# GNU General Public License for more details.
 +#
 +
 +include $(TOPDIR)/config.mk
 +
 +LIB  = $(obj)lib$(BOARD).o
 +
 +ifdef CONFIG_SPL_BUILD
 +COBJS:= mux.o
 +endif
 +
 +COBJS+= board.o
 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 +OBJS := $(addprefix $(obj),$(COBJS))
 +SOBJS:= $(addprefix $(obj),$(SOBJS))
 +
 +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
 + $(call cmd_link_o_target, $(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/newflow/nanobone/board.c b/board/newflow/nanobone/board.c
 new file mode 100644
 index 000..e8f7e00
 --- /dev/null
 +++ b/board/newflow/nanobone/board.c
 @@ -0,0 +1,337 @@
 +/*
 + * board.c
 + *
 + * Board functions for Newflow NanoBone board
 + *
 + * Copyright (C) 2013, Newflow Ltd - http://www.newflow.co.uk/
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +
 +#include common.h
 +#include errno.h
 +#include asm/arch/clock.h
 +#include asm/arch/cpu.h
 +#include asm/arch/ddr_defs.h
 +#include asm/arch/gpio.h
 +#include asm/arch/hardware.h
 +#include asm/arch/sys_proto.h
 +#include asm/arch/mem.h
 +#include asm/arch/mmc_host_def.h
 +#include asm/arch/omap.h
 +#include asm/emif.h
 +#include asm/gpio.h
 +#include asm/io.h
 +#include cpsw.h
 +#include i2c.h
 +#include miiphy.h
 +#include spl.h
 +#include board.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +/* FRAM config */
 +#define FRAM_CS  1
 +#define FRAM_BASE0x1c00
 +#define FRAM_SIZEGPMC_SIZE_16M
 +static u32 gpmc_fram_config[GPMC_MAX_REG] = {
 + 0x1200,
 + 0x00101000,
 + 0x00020201,
 + 0x0f030f03,
 + 0x010d1010,
 

Re: [U-Boot] how to create patches for mailing

2013-01-24 Thread Hebbar, Gururaja
On Thu, Jan 24, 2013 at 13:10:56, Maxim Podbereznyy wrote:
 Hi!
 
 I want to add a new board support to u-boot. So I did the following:
 
 1) git clone git://git.denx.de/u-boot.git u-boot-dev
 2) modified existing files, added new

Use git commit to commit your changes to tree

 3) built the tree for my board, beagle and overo - OK
 4) git format-patch - nothing happens

git-format-patch -M --signoff --stat -p --raw -n -3 --cover-letter

-3 == generate patches for 1st 3 patch 
-n = use n/n style
--cover-letter == Generate Cover letter (0/n patch)


 
 are there any step by step instructions how to create and submit patches to
 u-boot mail-list? 

Use git-send-email to send patches

git-send-email --to ' u-boot@lists.denx.de'  --cc 'maintain...@email.id' --cc 
'related_develo...@email.id'  --cc 'self_for_refere...@email.id' 
--suppress-cc=all required-patches

 Reading this
 http://www.denx.de/wiki/view/U-Boot/Patchesdoes not give sufficient
 comprehension how to do it..
 
 I appreciate any comments..
 


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


Re: [U-Boot] how to create patches for mailing

2013-01-24 Thread Hebbar, Gururaja
On Thu, Jan 24, 2013 at 13:51:30, Maxim Podbereznyy wrote:
 Hi Gururaja!

1st don’t top-most. It breaks the flow.

 
 
 Your instructions are exceptional! However I have a few questions:
 
 1) why should I generate patches for 1st 3 patch, because I have only
 one?

That was just an example.

 
 2) if there are 3 patches (only 1 is mine) + a cover which exactly
 required-patches should I send?


If you have one patch, then only 1 patch should be sent. Cover-letter 
normally is for new feature addition/improvement which involves lots of 
files  platforms.

Normal fix/correction doesn’t require a cover-letter.

 
 
 thanks!
 
 
 
 2013/1/24 Hebbar, Gururaja gururaja.heb...@ti.com
 
 
   On Thu, Jan 24, 2013 at 13:10:56, Maxim Podbereznyy wrote:
Hi!
   
I want to add a new board support to u-boot. So I did the
 following:
   
1) git clone git://git.denx.de/u-boot.git u-boot-dev
2) modified existing files, added new
   
   
   Use git commit to commit your changes to tree
   
 
3) built the tree for my board, beagle and overo - OK
4) git format-patch - nothing happens
   
   
   git-format-patch -M --signoff --stat -p --raw -n -3
 --cover-letter
   
   -3 == generate patches for 1st 3 patch
   -n = use n/n style
   --cover-letter == Generate Cover letter (0/n patch)
   
 
 
   
are there any step by step instructions how to create and
 submit patches to
u-boot mail-list?
   
   
   Use git-send-email to send patches
   
   git-send-email --to ' u-boot@lists.denx.de'  --cc
 'maintain...@email.id' --cc 'related_develo...@email.id'  --cc
 'self_for_refere...@email.id' --suppress-cc=all required-patches
   
Reading this
http://www.denx.de/wiki/view/U-Boot/Patchesdoes not give
 sufficient
   
comprehension how to do it..
   
I appreciate any comments..
   
   
   
   
   Regards,
   Gururaja
   
 
 
 


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


Re: [U-Boot] Detecting board revision that needs to be done after relocation

2012-06-04 Thread Hebbar, Gururaja
On Tue, May 29, 2012 at 08:55:34, Fabio Estevam wrote:
 Hi,
 
 I need to provide a get_board_rev() function that depends on I2C probe
 of a PMIC to decide between the board revision.
 
 I2C is only available after relocation, 

Not necessarily. You can use i2c probe  read even before relocation provided
they are no data from bss section being used. 

Look at below commits for details

http://git.denx.de/?p=u-boot.git;a=commitdiff;h=0b620ec97e05ddb09714d127a7880333fc4008fb

http://arago-project.org/git/projects/?p=u-boot-am33x.git;a=commitdiff;h=4825603ea6b2f70df2986bb489c4179383c76b5a

http://arago-project.org/git/projects/?p=u-boot-am33x.git;a=commitdiff;h=0ffb997b4d2fa3fd6e99310d7eb4d034cc78d63e



so what is the correct way to
 delay get_board_rev, so that it gets called only at a time when I2C
 is ready?
 
 Thanks,
 
 Fabio Estevam
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 


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


Re: [U-Boot] initcall revisited - A new idea to discuss

2012-01-05 Thread Hebbar, Gururaja
Hi,

On Fri, Jan 06, 2012 at 10:29:48, Graeme Russ wrote:
 Hi Simon,
 
 On Fri, Jan 6, 2012 at 3:30 PM, Simon Glass s...@chromium.org wrote:
  Hi Graham,
 
  On Thu, Jan 5, 2012 at 2:18 PM, Graeme Russ graeme.r...@gmail.com wrote:
  Hi Wolfgang,
 
  On Wed, Jan 4, 2012 at 1:44 AM, Wolfgang Denk w...@denx.de wrote:
  Dear Graeme,
 
  In message 4f02da64.60...@gmail.com you wrote:
 
 
 
 [snip]
 
 
  One thing comes to mind: it would be nice if we can find a way that
  the INIT_FUNC definitions behave similar to weak functions - if an
  init_func can be redefined / overwritten / modified by board specific
  code we eventually have a very nice way to get rid of the related
  #ifdef's.
 
  I have a thought on this. How about a SKIP_INIT macro. Here's the idea
  using SDRAM as an example:
 
  At the arch level you may have
 
  INIT_FUNC(sdram_init, f, sdram, console,)
 
  Gosh this email took a few readings :-)
 
  Can we get rid of the 'f' parameter? If we invent a prerequisite
  called 'relocated' or something like that, to act as a barrier, then
  maybe the order can be defined just like any other function which
  depends on being before or after something?
 
 Well I kind of like see that a particular init function is explicitly a
 pre- or post- relocation function. But yes, having barrier pre-requisites
 would achieve the same effect.
 
  so sdram_init sets the sdram requisite and must be done after all
  console requisites have been completed.
 
  Now if a SoC or board has an init that must be done before SDRAM:
 
  INIT_FUNC(pre_sdram_init, f, pre_sdram, , sdram)
 
  So this sets the pre_sdram requisite, requires no other initialisation
  before running and must happen before and sdram init functions are run
 
  Now lets say the Soc or board has a unique sdram init function that
  overrides the arch's sdram init. We could just use weak functions and
  allow the SoC or board to override sdram_init. But what if the SoC or
  board has additional pre-requisite (or post-requisite) init requirements?
 
  So in the SoC or board file:
 
  SKIP_INIT(sdram)
  INIT_FUNC(board_sdram_init, f, board_sdram,pre_sdram,vreg,console, )
 
  Using board_sdram versus sdram_init is cricital:
 
  The init sequence build tool will first create the entire init sequence
  including the functions marked as sdram and board_sdram. But after
  building the arrays, it will strip out all the functions marked as sdram
  init functions. The reason the entire list has to be build first is so the
  functions that rely on sdram can be added without unmet prerequisite
  errors.
 
  Of course, if you use SKIP_INIT(foo), you need to make sure that any
  replacement INIT_FUNC will do everything foo did to make your board work.
 
  Interestingly, this allows the following:
 
  INIT_FUNC(calc_relocation, fr, calc_reloc, sdram, )
  INIT_FUNC(copy_uboot_to_ram, fr, copy_to_ram, calc_relocation, )
  INIT_FUNC(do_elf_reloc_adjusments, fr, elf_reloc, copy_to_ram, )
  INIT_FUNC(clear_bss, fr, clear_bss, calc_reloc, )
 
  #ifdef CONFIG_SYS_SKIP_RELOCATION
  SKIP_INIT(calc_reloc)
  SKIP_INIT(copy_to_ram)
  SKIP_INIT(elf_reloc)
  #endif
 
  So if CONFIG_SYS_SKIP_RELOCATION is defined, relocation is not performed,
  but clear_bss still is
 
 
  I wonder what happens when you skip something - does it substitute for
  any pre/post-requisites that the skipped item had? Or would that be
  illegal?
 
 SKIP_INIT(foo) simply removes all 'foo' init functions from the list
 _after_ the list has been created - If this breaks dependencies that's
 your problem ;). It is up to you as the 'skipper' to make sure that you
 add init functions to allow things to still work

Won't this lead to lots of code duplication across all boards, archs. 
So, tomorrow someone else will send a patch removing duplicate and merging 
it to a common place. 

Why don't start it in 1st place.

 
  I can see plenty of opportunity for confusion, but if the tool is
  friendly enough, then this could solve a lot of the override problems.
  In your particular example it feels like it would be easier to just
  make the INIT_FUNC conditional on an config using #ifdef (horror!), or
  perhaps yet another parameter(!)
 
 The idea behind this all is that we do not know today what we will need
 tomorrow. Our biggest issue right now is that if a board needs to tweak
 the init sequence, it needs to touch arch/foo/board.c and hence introduces
 the potential to break working boards.
 
 With this proposal, if a board wants to entirely re-write the init
 sequence, it can add a whole bunch of SKIP_INIT(blah) and then add it's
 own INIT_FUNC(init_func, myboard_bar...) and nobody else will be the
 wiser as to what is going on. The problem the is if the arch adds a new
 init step, it may not be covered by the skip list by that board - tough,
 lesson learn't for being so esoteric ;)
 

So, every board, even under same arch, needs to define its own *complete-set* 
of INIT_CALL api's. I am dreaming about a lot of MB 

Re: [U-Boot] u-boot jumps to some location

2011-12-22 Thread Hebbar, Gururaja

Siddharth,

On Thu, Dec 22, 2011 at 15:46:21, siddharth baisane wrote:
 Hi,
 so I am now trying to load u-boot-spl.bin using teraterm as per process
 given in following link
 http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#UART;
 *1)I kept uart mode and throug teraterm transfered u-boot-spl.bin.*2)As per
 document After image is successfully downloaded, the ROM code will boot
[snip]
[snip]

 I am trying to load these files on am3517 crane board.

The wiki page only speaks about AM335x Board and the steps are tested on AM335x 
Board. 

Also, just for info
1. Make sure while loading the u-boot-spl.bin, the Teraterm is using X-Modem 
protocol to send the Image

2. For sending u-boot.img, Teraterm should be using y-modem protocol.

Also, can you try with the latest Version of Teraterm. Old version had some 
issues 
with x  y modem protocol.


 
 Boot Over UART
 
 *Note*
 
- The release package does not contain the binary for UART boot. Please
follow the steps mentioned
 herehttp://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#Building_U-Bootfor
 compiling u-boot and use the
*spl/u-boot-spl.bin* file that is produced.
 
 
1. Switch ON EVM with switch settings for UART
 boothttp://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#UART.
When  characters appear on TeraTerm window, from the File Menu select
Transfer -- XMODEM -- Send (1K mode)
2. Select u-boot-spl.bin for the transfer
3. After image is successfully downloaded, the ROM code will boot it.
4. When  characters appear on TeraTerm window, from the File Menu
select Transfer -- YMODEM -- Send (1K mode)
5. Select u-boot.img for the transfer
6. After image is successfully downloaded, U-Boot will boot it.
7. Hit enter and get to u-boot prompt U-Boot# 
 


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


Re: [U-Boot] printf in uboot

2011-12-12 Thread Hebbar, Gururaja
Hi,

On Mon, Dec 12, 2011 at 12:59:43, Sidharth Baisane wrote:
 hi,
 
  How can i use print statement  in uboot ???
  I tried printf in following program but its not executing it and my
 program hangs afterwards.
 
 
 void start_armboot (void)
 {
 init_fnc_t **init_fnc_ptr;
 char *s;
 #if defined(CONFIG_VFD) || defined(CONFIG_LCD)
 unsigned long addr;
 #endif
 *
 printf(starting armboot);*

Serial Console is yet to be initialized at this point. And hence the board 
seems to freeze here.

 /* Pointer is writable since we allocated a register for it */
 gd = (gd_t*)(_armboot_start - CONFIG_SYS_MALLOC_LEN - sizeof(gd_t));
 /* compiler optimization barrier needed for GCC = 3.4 */
 __asm__ __volatile__(: : :memory);
 
 memset ((void*)gd, 0, sizeof (gd_t));
 gd-bd = (bd_t*)((char*)gd - sizeof(bd_t));
 memset (gd-bd, 0, sizeof (bd_t));
 
 gd-flags |= GD_FLG_RELOC;
 
 monitor_flash_len = _bss_start - _armboot_start;
 


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


Re: [U-Boot] Need answers of basic questions regarding u-boot

2011-08-10 Thread Hebbar, Gururaja
By we I meant the gr8 u-boot community. I know at present there isn't a place 
on web for u-boot but surely I would help if someone starts.

Regards
Gururaja

 -Original Message-
 From: Detlev Zundel [mailto:d...@denx.de]
 Sent: Wednesday, August 10, 2011 3:39 PM
 To: Hebbar, Gururaja
 Cc: Jerry Van Baren; Rakesh Modi; u-boot@lists.denx.de
 Subject: Re: [U-Boot] Need answers of basic questions regarding u-boot
 
 Hi Gururaja,
 
  We need to make this sticky or add it into some wiki page.
 
 Who exactly is we? :)
 
 hint Well wikis are, ahem, wikis, i.e. changeable by everyone /hint
 
 Cheers
   Detlev
 
 --
 I have always observed that the pretensions of all people are in
 exact inverse ratio to their merits; this is one of the axioms of
 morals.-- Joseph Lagrange
 --
 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] Need answers of basic questions regarding u-boot

2011-08-07 Thread Hebbar, Gururaja
Hi,

We need to make this sticky or add it into some wiki page.

Nice explanation for beginners.

Regards
Gururaja

On Mon, Aug 08, 2011 at 01:58:32, Jerry Van Baren wrote:
 On 08/07/2011 02:55 PM, Rakesh Modi wrote:
  Hi,
  I am new to linux and u-boot. Please answer my following questions.
  1) what is u-boot? why it require?
 
 It initializes and configures the hardware (processor, RAM, peripherals), it 
 loads linux (or other OS) from storage (flash, hard drive, ethernet, other) 
 into RAM and then passes control to linux.
 
 While it isn't required, it is very convenient to have it.  The other 
 features of u-boot are that u-boot can be used to load new linux images into 
 your storage device.  The general principle is that u-boot is not often 
 replaced on a board, but the linux image is updated and upgraded regularly.
 
  2) why we can not load linux kernel directly without use of u-boot?
 
 You can, but you need to do the hardware initialization and configuration in 
 the linux start up code.  You will also have to create a method to and 
 mechanism for linux to upgrade itself, preferably in a failure resistant 
 way so that you don't brick your board inadvertently by having a failure 
 when upgrading linux.
 
 U-boot has solved these problems already for you.
 
  3) How does any processor sequence starts when power is on?
 
 That is described in the processor hardware reference manual.  It is 
 different for each processor, but in general the processor starts fetching 
 and executing code from a known location - sometimes from a fixed memory 
 address, sometimes it fetches a pointer from a fixed memory address and 
 starts executing from the address pointed to.
 
 Best regards,
 gvb
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 


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


[U-Boot] MII - Incorrect type specified for offset addr

2011-07-24 Thread Hebbar, Gururaja
Hi,

We have an upcoming SOC with Ethernet controller which has registers with 
offsets crossing 0x110.
In order to access these registers, we use miiphy_read()  miiphy_write() api 
provided by Standard u-boot mii phy util code (common/miiphyutil.c).

However the syntax of miiphy_read()  miiphy_write() is as below 

int miiphy_read (char *devname, unsigned char addr, unsigned char reg,
 unsigned short *value);

int miiphy_write (char *devname, unsigned char addr, unsigned char reg,
  unsigned short value);

Here the reg argument is of type unsigned char which limits the offset to a 
max of 0xff.
In linux, they are using u32 as type.

Right now we have modified the type to short and using it. 

Is this correct? 
If yes, can we send a patch for the same?
If not, what is the alternative?

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


Re: [U-Boot] u-boot environment variable parsing

2011-07-22 Thread Hebbar, Gururaja
Hi wd,

Thanks for the reply. Helped me a lot.

However see below 

On Thu, Jul 21, 2011 at 18:41:30, Wolfgang Denk wrote:
 Dear Hebbar, Gururaja,
 
 In message c82ba3053cfd354aacbd25efbd2a4ec603f0193...@dbde02.ent.ti.com you 
 wrote:
  
  
  The question here is mmc_args re-uses variable bootargs as
  $(bootargs)  nand_args re-uses it as ${bootargs}. Note the difference 
  in curly  flower brackets. run mmc_args fails for me however 
  nand_args runs properly.
 
 Does this not answer your question sufficiently?

The point is mmc_args worked in one place  failed in other. After you reply, I 
found that the place where it worked was common shell environment  it was 
failing in Hush shell.

 
  My question is
  1. Which is correct?
 
 ${...} is correct.
 
  2. What is the difference between the two?
 
 ${...} is correct, and $(...) is not correct.
 
  I have seen few boards using both methods.
 
 $(...) was used in very old versions of U-Boot, but this got changed for the 
 sake of compatibility with standard shell syntax.
 
 Note that the simple cmmand line parser still accepts the obsolete
 $(...) format; the hush shell doesn't.
 
 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 
 morsel of genuine history is a  thing  so  rare  as  to  be  always
 valuable.  - Thomas Jefferson
 

Regards, 
Gururaja

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


[U-Boot] u-boot environment variable parsing

2011-07-21 Thread Hebbar, Gururaja
Hi, 

I need one clarification regarding Environment variable declaration  its usage.

#define CONFIG_EXTRA_ENV_SETTINGS \
brd_mem=62M\0 \
bootargs_defaults=setenv bootargs  \
console=${console}  \
 mem=${brd_mem}\0 \
mmc_args=run bootargs_defaults; \
setenv bootargs $(bootargs)  \
root=${mmc_root}  \
rootfstype=${mmc_root_fs_type} ip=${ip_method}\0 \
nand_args=run bootargs_defaults; \
setenv bootargs ${bootargs}  \
root=${nand_root} noinitrd  \
rootfstype=${nand_root_fs_type} ip=${ip_method}\0 \

The question here is mmc_args re-uses variable bootargs as $(bootargs)  
nand_args re-uses it as ${bootargs}. Note the difference in curly  flower 
brackets. run mmc_args fails for me however nand_args runs properly.

My question is 
1. Which is correct?
2. What is the difference between the two?

I have seen few boards using both methods.

Thanks in advance

Regards
Gururaja

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


[U-Boot] Setup NS16550 specific parameters from platform code

2011-07-12 Thread Hebbar, Gururaja
Hi,

For our upcoming SOC, we have a situation where in we need to configure UART 
console at runtime. Our SOC makes use of NS16550.

I looked through the u-boot tree  found several references for doing the same. 

hebbar@linux- server:~/projects/u-boot-git$ gr NS16550_init *
board/sheldon/simpc8313/simpc8313.c:145:
NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
board/ml2/serial.c:45:  (void) NS16550_init (COM_PORTS[0], clock_divisor);
board/ml2/serial.c:48:  (void) NS16550_init (COM_PORTS[1], clock_divisor);
board/MAI/AmigaOneG3SE/serial.c:157:NS16550_init (Com0, clock_divisor);
board/MAI/AmigaOneG3SE/serial.c:244:NS16550_init (Com0, clock_divisor);
board/freescale/mpc8313erdb/mpc8313erdb.c:138:  
NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
board/freescale/mpc8315erdb/mpc8315erdb.c:239:  
NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
board/bmw/serial.c:45:  NS16550_init (CONFIG_CONS_INDEX - 1, clock_divisor);
board/bmw/ns16550.c:16:volatile struct NS16550 *NS16550_init (int chan, int 
baud_divisor)
board/mvblue/mvblue.c:45:   NS16550_init (console, clock_divisor);
board/Marvell/common/serial.c:101:  (void) NS16550_init (0, clock_divisor);
board/Marvell/common/serial.c:104:  (void) NS16550_init (1, clock_divisor);
board/Marvell/common/ns16550.c:20:volatile struct NS16550 *NS16550_init (int 
chan, int baud_divisor)
board/Marvell/common/ns16550.h:92:volatile struct NS16550 * NS16550_init(int 
chan, int baud_divisor);
board/amirix/ap1000/serial.c:43:(void) NS16550_init (COM_PORTS[0], 
clock_divisor);
board/evb64260/serial.c:103:(void)NS16550_init(COM_PORTS[0], clock_divisor);
board/evb64260/serial.c:106:(void)NS16550_init(COM_PORTS[1], clock_divisor);


I would like to know whether this approach is correct and whether this approach 
is still allowed in current u-boot.

If not, what is the correct approach? I am also looking at CONFIG_SERIAL_MULTI. 

Thanks in advance.

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


[U-Boot] Information regarding load address, execute address and image load address

2011-06-15 Thread Hebbar, Gururaja
Hi,

I need one clarification regarding load address, entry point inside the Kernel 
image  the address to where we load the image.

Assume, the image header is as below.

   Image Name:   Linux-2.6.38-10700-g846a497
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2064396 Bytes = 2 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

And I load the image using loadb to address 0x80008000. 

Will this work?. Because here Image-load_address == Load_address for u-boot. 
Now u-boot considers this as XIP Image and will not move os data which actually 
will be at 0x80008040 to 0x80008000

Please correct me if I am wrong

I have attached the console output for reference.

Thanks  regards
Gururaja


CON_SOLE#iminfo

## Checking Image at 80008000 ...
   Legacy image found
   Image Name:   Linux-2.6.38-10700-g846a497
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2064396 Bytes = 2 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

CON_SOLE #bootm 0x80008000
*  kernel: cmdline image address = 0x80008000
Boot reached stage 1
## Booting kernel from Legacy Image at 80008000 ...
Boot reached stage 2
Boot reached stage 3
   Image Name:   Linux-2.6.38-10700-g846a497
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2064396 Bytes = 2 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
Boot reached stage 4
Boot reached stage 5
Boot reached stage 6
   kernel data at 0x80008040, len = 0x001f800c (2064396)
Boot reached stage 14
## No init Ramdisk
   ramdisk start = 0x, ramdisk end = 0x
   XIP Kernel Image ... OK
OK
   kernel loaded at 0x80008000, end = 0x802c
Boot reached stage 7
images.os.start = 0x80008000, images.os.end = 0x8020004c
images.os.load = 0x80008000, load_end = 0x802c
Boot reached stage 8
Boot reached stage 15
## Transferring control to Linux (at address 80008000) ...

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


Re: [U-Boot] How does u-boot know where to put its start code?

2011-04-19 Thread Hebbar, Gururaja
Hi,

On Wed, Apr 20, 2011 at 02:43:23, Rogan Dawes wrote:
 Hi folks,
 
 I'm trying to understand a bit more about how u-boot creates the image, such 
 that the CPU reset vector is pointing to the right piece of code when it is 
 reset.
 
 i.e. my DNS323 (Orion5x) has a reset vector of 0x. But for the life 
 of me, I can't find anywhere that actually references that value to place the 
 start code at that point.
 

Placing the final boot image is left to user who flashes/burns it board. But it 
should be same as _TEXT_BASE (this is being removed now. Orion5x is arm based). 
Also look at u-boot-src\arch\arm\cpu\arm926ejs\start.S  
u-boot-src\arch\arm\cpu\arm926ejs\u-boot.lds for more info on how linker is 
instructed to place the starting code at predefined address.

 I'm basically trying to make sure that my CONFIG_SYS_TEXT_BASE is correct 
 (the address in the flash to which I write the whole u-boot.bin file, right?.
 
This is passed to linker as the entry point.

 Thanks
 
 Rogan


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


Re: [U-Boot] SPI - cs validity

2011-04-06 Thread Hebbar, Gururaja
Hi,

On Wed, Apr 06, 2011 at 11:22:13, Ran Shalit wrote:
 Hello,
 
 I am trying to understand the logic behind the implementation of SPI 
 interface, and came across a validity routine (for different baords it is 
 about the same):
 
 for Atmel and Davinci for example:
 
 int spi_cs_is_valid(unsigned int bus, unsigned int cs) {  return bus == 0  
 cs == 0; }
 
 Althout atmel and davinci can have more then one spi port, it seems that they 
 will fail in configuration if bus is different then 0.
 I wander if any one can solve this issue for me.
 

It seems that currently both atmel  davinci boards supports only 1 spi 
instance at a time. 

In order to support different spi instances,
In case of atmel declare SPIx_BASE as required  set CONFIG_DEFAULT_SPI_BUS to 
required bus
In case of davinci set CONFIG_SYS_SPI_BASE to base address of required spi 
instance

Also, spi_cs_is_valid() function needs to be updated to support different spi 
instances. spi_cs_is_valid() function is board dependednt.

Hope this helps. 

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


Re: [U-Boot] SPI - cs validity

2011-04-06 Thread Hebbar, Gururaja
Hi,

On Wed, Apr 06, 2011 at 15:02:22, Ran Shalit wrote:
  
 
   It seems that currently both atmel  davinci boards supports only 1 spi 
 instance at a time.
   
   In order to support different spi instances,
   In case of atmel declare SPIx_BASE as required  set 
 CONFIG_DEFAULT_SPI_BUS to required bus
   In case of davinci set CONFIG_SYS_SPI_BASE to base address of required 
 spi instance
   
   Also, spi_cs_is_valid() function needs to be updated to support 
 different spi instances. spi_cs_is_valid() function is board dependednt.
   
   Hope this helps.
   
   Regards,
   Gururaja
   
 
 
  
 Hi Gururaja,
  
 It seems that the implementation limit the validity only for bus==0.
 This means that trying other bus(=spi port ?)  will fail even if its not at 
 the same time. In addition to that the CPU's data sheet make no limit.
  
 Best Regards,
 Ran
 

Don't top post.


Currenly davinci spi driver only allows (bus == 0) to pass which means spi0. So 
if you want to support other or many spi port at once, then

1. you need to change spi_cs_is_valid() to check for various bus values 
2. validate the bus argument to spi_setup_slave(). may be using a switch as in 
case of atmel. 
 
from 

ds-regs = (struct davinci_spi_regs *)CONFIG_SYS_SPI_BASE;

to 

struct davinci_spi_regs *regs;

switch (bus) {
case 0:
regs = (struct davinci_spi_regs *)CONFIG_SYS_SPI0_BASE;
break;
case 1:
regs = (struct davinci_spi_regs *)CONFIG_SYS_SPI1_BASE;
break;
 ...
 ...
default:
return NULL;
}

ds-regs = regs;

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


Re: [U-Boot] last reboot information for u-boot

2011-03-24 Thread Hebbar, Gururaja
Hi,

On Fri, Mar 25, 2011 at 08:21:46, sywang wrote:
 
 
 I have a question about how to save last warm-reboot information. 
 
 
 I am trying to find a method to save last warm-reboot reason. If I want to
 save the information by DRAM memory, how to do this? 
 

AFAIK, there isn't any direct support to this in u-boot. 
However, this can be achieved in 2 ways.
1. Many Hardware / SOC / Processor has inbuilt registers to detect 
   reason for last reset (HW, WatchDog, SW, or Cold reset). If your platform 
has any of these, use them

2. while resetting save required info to flash by custom code and read it back 
upon reset. 

Hope this helps.

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


Re: [U-Boot] Uboot- Nor flash

2011-03-15 Thread Hebbar, Gururaja
Hi,

On Tue, Mar 15, 2011 at 11:07:46, Sanjeeva Kumara wrote:
 Hi pls help me...
 How the boot image is read into memory from where exactly execution 
 starts...
 

1. what is your board configuration (memory, Processor, ram, etc..)
2. Is your board inside u-boot repository ?. what is the board config name 

Regards
Gururaja




 
 -Original Message-
 From: Hebbar, Gururaja [mailto:gururaja.heb...@ti.com]
 Sent: Friday, March 11, 2011 6:14 PM
 To: Sanjeeva Kumara; u-boot@lists.denx.de
 Subject: RE: Uboot- Nor flash
 
 Hi,
 
 On Fri, Mar 11, 2011 at 14:02:20, Sanjeeva Kumara wrote:
  Hi
  My self Sanjeev.  I'm working on marvell's processor ( PXA ). I'm using NOR 
  flash to port Uboot. I want to do partition in NOR flash so that in one 
  partition I can keep my master copy and provide Uboot upgrade option. 
  Please suggest me how can I achieve this.
 
 
 The quickest would be to use CONFIG_SYS_FLASH_AUTOPROTECT_LIST. Search for 
 this config and this will help you setup autoprotect options for various 
 partitions.
 
 
 Regards,
 Gururaja
 
 
 Larsen  Toubro Limited
 
 www.larsentoubro.com
 
 This Email may contain confidential or privileged information for the 
 intended recipient (s) If you are not the intended recipient, please do not 
 use or disseminate the information, notify the sender and delete it from your 
 system.
 


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


Re: [U-Boot] Uboot- Nor flash

2011-03-15 Thread Hebbar, Gururaja
On Tue, Mar 15, 2011 at 12:14:40, Sanjeeva Kumara wrote:
 
 Board - PXA168 from Marvell
 Nor Flash - 64MB
 Nand Flash - 2Gb
 Clock - 1Ghz
 RAM 128MB

Don't top-post.
Maintain cc list

There are lot of pxa ports in u-boot. Kindly follow the nearest one. 

pxa u-boot starts execution from u-boot-src/arch/arm/cpu/pxa/start.S -- 
_start function

regards
Gururaja

 -Original Message-
 From: Hebbar, Gururaja [mailto:gururaja.heb...@ti.com]
 Sent: Tuesday, March 15, 2011 11:55 AM
 To: Sanjeeva Kumara
 Cc: u-boot@lists.denx.de
 Subject: RE: Uboot- Nor flash
 
 Hi,
 
 On Tue, Mar 15, 2011 at 11:07:46, Sanjeeva Kumara wrote:
  Hi pls help me...
  How the boot image is read into memory from where exactly execution 
  starts...
 
 
 1. what is your board configuration (memory, Processor, ram, etc..) 2. Is 
 your board inside u-boot repository ?. what is the board config name
 
 Regards
 Gururaja
 
 
 
 
 
  -Original Message-
  From: Hebbar, Gururaja [mailto:gururaja.heb...@ti.com]
  Sent: Friday, March 11, 2011 6:14 PM
  To: Sanjeeva Kumara; u-boot@lists.denx.de
  Subject: RE: Uboot- Nor flash
 
  Hi,
 
  On Fri, Mar 11, 2011 at 14:02:20, Sanjeeva Kumara wrote:
   Hi
   My self Sanjeev.  I'm working on marvell's processor ( PXA ). I'm using 
   NOR flash to port Uboot. I want to do partition in NOR flash so that in 
   one partition I can keep my master copy and provide Uboot upgrade option. 
   Please suggest me how can I achieve this.
  
 
  The quickest would be to use CONFIG_SYS_FLASH_AUTOPROTECT_LIST. Search for 
  this config and this will help you setup autoprotect options for various 
  partitions.
 
 
  Regards,
  Gururaja
 
 
  Larsen  Toubro Limited
 
  www.larsentoubro.com
 
  This Email may contain confidential or privileged information for the 
  intended recipient (s) If you are not the intended recipient, please do not 
  use or disseminate the information, notify the sender and delete it from 
  your system.
 
 
 
 Regards,
 Gururaja
 
 
 Larsen  Toubro Limited
 
 www.larsentoubro.com
 
 This Email may contain confidential or privileged information for the 
 intended recipient (s) If you are not the intended recipient, please do not 
 use or disseminate the information, notify the sender and delete it from your 
 system.
 


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


Re: [U-Boot] [PATCH 1/3][v3] mmc: checking status after commands with R1b response

2011-03-11 Thread Hebbar, Gururaja
Hi,

On Fri, Mar 11, 2011 at 14:08:14, Raffaele Recalcati wrote:
 From: Raffaele Recalcati raffaele.recalc...@bticino.it
 
[...]
[...]
 @@ -48,6 +48,36 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, 
 struct mmc_data *data)
   return mmc-send_cmd(mmc, cmd, data);
  }
  
 +int mmc_send_status(struct mmc *mmc, int timeout)
 +{
 + struct mmc_cmd cmd;

[...]
[...]

 + do {
 + err = mmc_send_cmd(mmc, cmd, NULL);
 + break;

Why this break


 + if (err)
 + return err;
 + else if (cmd.response[0]  MMC_STATUS_RDY_FOR_DATA)
 + break;

[...]
[...]

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


Re: [U-Boot] Uboot- Nor flash

2011-03-11 Thread Hebbar, Gururaja
Hi,

On Fri, Mar 11, 2011 at 14:02:20, Sanjeeva Kumara wrote:
 Hi
 My self Sanjeev.  I'm working on marvell's processor ( PXA ). I'm using NOR 
 flash to port Uboot. I want to do partition in NOR flash so that in one 
 partition I can keep my master copy and provide Uboot upgrade option. Please 
 suggest me how can I achieve this.
 

The quickest would be to use CONFIG_SYS_FLASH_AUTOPROTECT_LIST. Search for this 
config and this will help you setup autoprotect options for various partitions.


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


Re: [U-Boot] how can i change u-boot load address?

2008-10-07 Thread Hebbar

Hi Wolfgang Denk,


wd wrote:
 
 I'm trying to understand how it's done on ARM --
 
 On ARM it's being done wrong  -  no  real  relocation  is  preformed;
 instead,  U-Boot is liked to a fixed address in RAM. The startup code
 (mostly assembler) can run from ROM (too).
 
 

If you can tell me what exactly is wrong with ARM startup, i will try to
find a solution. Can u point the platform and its startup functions where it
is been done correctly. Then i will try to fixup th error in ARM.

Thanks in advance

Regards
Gururaja

-- 
View this message in context: 
http://www.nabble.com/how-can-i-change-u-boot-load-address--tp19836732p19853320.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] how can i change u-boot load address?

2008-10-07 Thread Gururaja Hebbar K R
Hi, 

 -Original Message-
 From: Wolfgang Denk [mailto:[EMAIL PROTECTED] 
 Subject: Re: [U-Boot] how can i change u-boot load address?
 
  U wouldnt see mapping the vector on (most) ARM Platforms 
 because they 
  use u-boot as secondary bootloader
 
 I  don't have reliable statistical data to judge if the 
 most is correct, or if it actually is only a few 
 configurations that do this.
I meant to say the arm supplied board (integrator[ap/cp], versatile[ap/cp], 
realview).

 
  I said most because ARM Integrator Board doesnt use Arm 
 Bootmonitor 
   hence its code has remapping functionality.
 
 From what I'm seeing, most systems use U-oot as primary 
 (and  only) boot loader.

S its my mistake. sorry for that.

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


Re: [U-Boot] ARM Versatile port - possibly inefficient code?

2008-09-30 Thread Hebbar

Hi,



Regardless of CFG_MAX_FLASH_BANKS value, the only first bank is
configured. Was it done deliberately or it's logical flaw? I think
is code could cloned on a multiple of other platforms.

ARM Versatile has only one flash bank.
What if a user has configured an incorrect number for flash banks. 
The driver should take care of this properly. Since CFG_MAX_FLASH_BANKS 
is in a different place  the flash.c is a different file, care is taken to
see 
that an incorrect bank is not considered for initialization

also,

panic (configured too many flash banks!\n); 
this error message clearly explains the mistake the user did.

Regards
Gururaja

-- 
View this message in context: 
http://www.nabble.com/-U-Boot--ARM-Versatile-port---possibly-inefficient-code--tp19736928p19739341.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] PrimeCell Peripherals

2008-09-23 Thread Hebbar

Hi,


how well does U-Boot support ARM's PrimeCell peripherals?
What do u mean by support. 

I use U-booot as The Primary Bootloader on arm926ej-s based Board.

By Default U-boot supports few Primecell peripherals drivers like PL0x1
UART. 

I developed few others my self, like pl18x mmc, rtc, gpio.

I recently sent a patch for RTC pl031. 

U too can contribute if u can send patch's for other peripherals.

Regards
Gururaja
-- 
View this message in context: 
http://www.nabble.com/-U-Boot--PrimeCell-Peripherals-tp19627089p19628769.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] PrimeCell Peripherals

2008-09-23 Thread Gururaja Hebbar K R
Hi, 

 From: Roman Mashak [mailto:[EMAIL PROTECTED] 
 Subject: Re: [U-Boot] PrimeCell Peripherals

 Right, that's what I've found in the U-Boot sources. How come 
 that widely used interrupt controllers like PL19x are not 
 supported by default?

Thats because Most of the ARM based boards doesnt use Interrupts. Atleast as 
far as i have seen.
IIRC U-boot is a single process bootloader  hence Interrupts are not so much 
supported.
Is there any interrupt related drivers in U-boot for other platforms?

  I recently sent a patch for RTC pl031.
 Yes, I saw that patch. Are you planning to send patch for 
 GPIO as well?

I havent done any Framework kind of a driver for GPIO. For me, it just works 
like a standalone  hence i cannot submit the same.
Later when i get time. I will prepare a GPIO Framework and submit for RFC in ML


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


Re: [U-Boot] PrimeCell Peripherals

2008-09-23 Thread Gururaja Hebbar K R
Hi, 

 In U-Boot source tree there are number of drivers with 
 interrupt service routines running (for example,
 $(U_BOOT)/drivers/net/bcm570x.c) as well as various 
 interrupts related macros (some of them not used thought), if 
 this is what you mean.
 Perhaps these definitions are for future ?

At $(U_BOOT)/drivers/net/bcm570x.c files header, it says 

 * Broadcom BCM570x Ethernet Driver for U-Boot.
 * Support 5701, 5702, 5703, and 5704. Single instance driver. 

-- Single Instance Driver. Does this mean it doesn't handle Interrupt. 
Sorry I cannot say more as I don't have any knowledge abt this

Also,

CONFIG_BCM570x is used in $(U_BOOT)/include/configs/BMW.h which is a MPC based 
Board. 

May be MPC uses interrupts for its operation inside U-Boot. 

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


Re: [U-Boot] PrimeCell Peripherals

2008-09-23 Thread Gururaja Hebbar K R
HI, 

 From: Roman Mashak [mailto:[EMAIL PROTECTED] 
 Subject: Re: [U-Boot] PrimeCell Peripherals

 To add a bit to my previous message.
 
 As far as I understood from U-Boot's README, a standalone 
 mode can and may want to use interrupts -- so it'd reasonable 
 to have interrupts controllers support, isn't it? Correct me 
 if I'm wrong, just trying to understand the architecture of 
 U-Boot more deeply.

U-boots readme is general  for all platforms.

Yes, U-boot ARM supports interrupt mode, but generally not used.
Also standalone can use interrupt mode if the u-boot it is running on is 
configured to support irq
i.e., CONFIG_USE_IRQ is defined.

Then the user has to also define a do_irq command to support the same

Kindly look at below file for do_irq function definitions  its usage.

uboot\cpu\arm720t\interrupts.c
uboot\cpu\arm920t\interrupts.c

i havent seen this function definitions for arm926ej-s except 

#ifndef CONFIG_USE_IRQ
void do_irq (struct pt_regs *pt_regs)
{
... 


Regards
Gururaja


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


Re: [U-Boot] U-Boot on ARM9

2008-09-22 Thread Hebbar

Hi,


I have a few questions on arm926 initialization code, located in
${U_BOOT}/cpu/arm926ejs/start.S:
1) what is the point of deliberately setting up SVC mode, as it's
already in this mode right upon the reset?
What if the target board has a custom bootmonitor  you use U-Boot as
secondary bootloader. This is a precautionary measure.

2) I can't quite understand what 'CONFIG_USE_IRQ' is used for. It is
defined on just a few targets.
Generally bootloader doesnt use IRQ for running. But if u need to use
IRQ/FIQ u need to setup stacks for the Same. And also When Interrupt occurs
you need to set sp to pint to proper stacks, save registers  then jump to
irq handler. U_Boot provides a common envelope for all interrupt related
functions. 


3) The stack set up -- commonly startup code initializes stacks for
all modes, but it's not clear how it's done in 'start.S'. Seems like
somehow stacks are run-time configured, but I didn't perceive  how.
U-boot Initially sets up Stack for SVC Mode. 

Upon Interrupt Triggers, Stacks are setup for the IRQ/FIQ Modes. 

This is done in the ${U_BOOT}/cpu/arm926ejs/start.S

for SVC Mode --- @ line 173
for IRQ Mode ---  @ line 327
for FIQ Mode ---  @ line 331

Hope this would clear your doubts.

Regards
Gururaja
-- 
View this message in context: 
http://www.nabble.com/-U-Boot--U-Boot-on-ARM9-tp19602930p19604726.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] [PATCH] ARM: Use do_div() instead of division for long long

2008-09-08 Thread Gururaja Hebbar K R
 Hmm,

Interestingly i had sent a patch for the same for both
integrator[ap/cp].
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/46044. 

i had sent it to Jean-Christophe PLAGNIOL-VILLARD  Peter Pearse  also
to U-Boot user list. 

Don't know y it didn't reach there.

Regards
Gururaja

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


[U-Boot] [PATCH] ARM OMAP : Correct Invalid Timer Register Field Declaration in omap1510.h omap730.h

2008-09-02 Thread Gururaja Hebbar K R
Hi,

Any update on this patch. I even checked Linux Source for this define  way 
back in Linux 2.6.11, same kind of patch was applied.

More info @ 
http://www.linuxhq.com/kernel/v2.6/11/include/asm-arm/arch-omap/hardware.h

TIA

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


Re: [U-Boot] U-Boot version for a new port

2008-09-02 Thread Gururaja Hebbar K R
Hi,

 From: Roman Mashak [EMAIL PROTECTED]
 Subject: [U-Boot] U-Boot version for a new port
 I'm planning to make a port on a ARM926EJ-S based board. What is the
 recommended way: take release or GIT version as a base ?

Depends on what processor you are using, atmel at91sam9 series or omap
or ti davinci 

If s, then check if your board/processor configs match with any of
these. 

Try to port their configuration  files to your board.

Look at arm versatile board, ti davinci boards for reference.

Hope this helps

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


[U-Boot] [PATCH] ARM - Remove references to CONFIG_INIT_CRITICAL from ARM based boards

2008-09-02 Thread Gururaja Hebbar K R
Hi,

- CONFIG_INIT_CRITICAL is deprecated
- remove all references to CONFIG_INIT_CRITICAL for ARM based boards
- replace by CONFIG_SKIP_LOWLEVEL_INIT


Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
---
 cpu/arm946es/start.S|6 +++---
 cpu/arm_intcm/start.S   |2 +-
 include/configs/SMN42.h |2 +-
 include/configs/armadillo.h |2 +-
 include/configs/gcplus.h|2 +-
 include/configs/integratorap.h  |2 +-
 include/configs/lpc2292sodimm.h |2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cpu/arm946es/start.S b/cpu/arm946es/start.S
index 9e97f53..582cf18 100755
--- a/cpu/arm946es/start.S
+++ b/cpu/arm946es/start.S
@@ -133,15 +133,15 @@ reset:
 * we do sys-critical inits only at reboot,
 * not when booting from ram!
 */
-#ifdef CONFIG_INIT_CRITICAL
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
bl  cpu_init_crit
 #endif
 
 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
+   cmp r0, r1  /* don't reloc during debug */
+   beq stack_setup
 
ldr r2, _armboot_start
ldr r3, _bss_start
diff --git a/cpu/arm_intcm/start.S b/cpu/arm_intcm/start.S
index d5778a0..2ee2c86 100755
--- a/cpu/arm_intcm/start.S
+++ b/cpu/arm_intcm/start.S
@@ -131,7 +131,7 @@ reset:
 * we do sys-critical inits only at reboot,
 * not when booting from ram!
 */
-#ifdef CONFIG_INIT_CRITICAL
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
bl  cpu_init_crit
 #endif
 
diff --git a/include/configs/SMN42.h b/include/configs/SMN42.h
index a5d3d69..53d7c7b 100755
--- a/include/configs/SMN42.h
+++ b/include/configs/SMN42.h
@@ -30,7 +30,7 @@
  * If we are developing, we might want to start u-boot from ram
  * so we MUST NOT initialize critical regs like mem-timing ...
  */
-#undef CONFIG_INIT_CRITICAL/* undef for developing */
+#define CONFIG_SKIP_LOWLEVEL_INIT  1
 
 #undef CONFIG_SKIP_LOWLEVEL_INIT
 #undef CONFIG_SKIP_RELOCATE_UBOOT
diff --git a/include/configs/armadillo.h b/include/configs/armadillo.h
index 98a83db..ab06ecf 100755
--- a/include/configs/armadillo.h
+++ b/include/configs/armadillo.h
@@ -34,7 +34,7 @@
  * If we are developing, we might want to start armboot from ram
  * so we MUST NOT initialize critical regs like mem-timing ...
  */
-/*#define  CONFIG_INIT_CRITICAL*/  /* undef for developing */
+#define CONFIG_SKIP_LOWLEVEL_INIT  1
 
 /*
  * High Level Configuration Options
diff --git a/include/configs/gcplus.h b/include/configs/gcplus.h
index 3b1b4ab..b7bd274 100755
--- a/include/configs/gcplus.h
+++ b/include/configs/gcplus.h
@@ -36,7 +36,7 @@
  * e.g. bootp/tftp download of the kernel is a far more convenient
  * when testing new kernels on this target. However the ADS GCPlus Linux
  * boot ROM leaves the MMU enabled when it passes control to U-Boot. So
- * we use lowlevel_init (CONFIG_INIT_CRITICAL) to remedy that problem.
+ * we use lowlevel_init (CONFIG_SKIP_LOWLEVEL_INIT) to remedy that problem.
  */
 #undef  CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SKIP_RELOCATE_UBOOT 1
diff --git a/include/configs/integratorap.h b/include/configs/integratorap.h
index 1452bf2..c877a01 100755
--- a/include/configs/integratorap.h
+++ b/include/configs/integratorap.h
@@ -44,7 +44,7 @@
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_MISC_INIT_R 1   /* call misc_init_r during start up */
 
-#undef CONFIG_INIT_CRITICAL
+#define CONFIG_SKIP_LOWLEVEL_INIT  1
 #define CONFIG_CM_INIT 1
 #define CONFIG_CM_REMAP1
 #undef CONFIG_CM_SPD_DETECT
diff --git a/include/configs/lpc2292sodimm.h b/include/configs/lpc2292sodimm.h
index e3fef5e..3ce3c97 100755
--- a/include/configs/lpc2292sodimm.h
+++ b/include/configs/lpc2292sodimm.h
@@ -30,7 +30,7 @@
  * If we are developing, we might want to start u-boot from ram
  * so we MUST NOT initialize critical regs like mem-timing ...
  */
-#undef CONFIG_INIT_CRITICAL/* undef for developing */
+#define CONFIG_SKIP_LOWLEVEL_INIT  1
 
 #undef CONFIG_SKIP_LOWLEVEL_INIT
 #undef CONFIG_SKIP_RELOCATE_UBOOT
-- 
1.5.6.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] integratorcp board - multiple definition of `__udivsi3' undefined reference to `raise' Error

2008-08-28 Thread Gururaja Hebbar K R
Hi,

I am using CodeSourcery Arm Toolchain to compile U-boot-1.3.3 for integrator cp 
board. 

1. I set the proper environment variables (BUILD_DIR, PATH, CROSS_COMPILE) 

export PATH=/home/user/project/arm-2007q1/bin:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabi-
export BUILD_DIR=/home/user/project/u_boot/Ubuild_all

2. Then i give 
make clean
make distclean
make cp926ejs_config
make

At the end of the compile i get 

..snip..
..snip..
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivsi3.o):
 In function `__aeabi_uidiv':
(.text+0x0): multiple definition of `__udivsi3'
lib_arm/libarm.a(_udivsi3.o):/home/user/project/u_boot/u-boot-1.3.3/lib_arm/_udivsi3.S:17:
 first defined here
arm-none-linux-gnueabi-ld: ERROR: Source object 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivdi3.o)
 has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivdi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivsi3.o)
 has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivsi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_dvmd_lnx.o)
 has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_dvmd_lnx.o)
arm-none-linux-gnueabi-ld: ERROR: Source object 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_clz.o)
 has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file 
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_clz.o)
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_dvmd_lnx.o):
 In function `__aeabi_ldiv0':
(.text+0x8): undefined reference to `raise'
make: *** [/home/user/project/u_boot/Ubuild_all/u-boot] Error 1

When i searched for the place of error, i found that in 
uboot-1.3.3/board/integratorcp/integratorcp.c 

@line 235, in function 
ulong get_timer_masked (void)
{
..snip..
..snip..

lastdec   = now;
timestamp = (ulong)(total_count/div_timer);

return timestamp;
}

I think we need to change it to use do_div function as below.

ulong get_timer_masked (void)
{
unsigned long long n;

..snip..
..snip..
lastdec = now;

n = total_count;
do_div(n, div_timer);
timestamp = (ulong)n;

return timestamp;
}

Also include div64.h

If this correct, then i can send a patch for integrator[ap/cp] board. Since 
both has same c code for this function.

Correct me if i am wrong

Thanks in advance

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


[U-Boot] [PATCH] ARM - Integrator[AP/CP] - Remove unused file memsetup.S

2008-08-28 Thread Gururaja Hebbar K R
Hi,

- memsetup.s is changed/merged to lowlevel_init.S
  memsetup.S has a global label memsetup that just returns back to caller
- memsetup global label is changed/merged to lowlevel_init
  This label is not called from anywhere.


Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
---
 board/integratorap/Makefile   |2 +-
 board/integratorap/memsetup.S |   29 -
 board/integratorcp/Makefile   |2 +-
 board/integratorcp/memsetup.S |   29 -
 4 files changed, 2 insertions(+), 60 deletions(-)
 delete mode 100755 board/integratorap/memsetup.S
 delete mode 100755 board/integratorcp/memsetup.S

diff --git a/board/integratorap/Makefile b/board/integratorap/Makefile
index f78de3a..79f501a 100755
--- a/board/integratorap/Makefile
+++ b/board/integratorap/Makefile
@@ -30,7 +30,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS  := integratorap.o flash.o
-SOBJS  := lowlevel_init.o memsetup.o
+SOBJS  := lowlevel_init.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/integratorap/memsetup.S b/board/integratorap/memsetup.S
deleted file mode 100755
index da43cb6..000
--- a/board/integratorap/memsetup.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Memory setup for integratorAP
- *
- * 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
- */
-/*
- * Memory setup
- *  - the reset defaults are assumed sufficient
- */
-
-.globl memsetup
-memsetup:
-   mov pc,lr
diff --git a/board/integratorcp/Makefile b/board/integratorcp/Makefile
index 9201acc..92a1a07 100755
--- a/board/integratorcp/Makefile
+++ b/board/integratorcp/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS  := integratorcp.o flash.o
-SOBJS  := lowlevel_init.o memsetup.o
+SOBJS  := lowlevel_init.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/integratorcp/memsetup.S b/board/integratorcp/memsetup.S
deleted file mode 100755
index da43cb6..000
--- a/board/integratorcp/memsetup.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Memory setup for integratorAP
- *
- * 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
- */
-/*
- * Memory setup
- *  - the reset defaults are assumed sufficient
- */
-
-.globl memsetup
-memsetup:
-   mov pc,lr
-- 
1.5.6.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM - Integrator[AP/CP] - - Correct Improper ulong division

2008-08-28 Thread Gururaja Hebbar K R
Hi,

- Correct Improper ulong division. This patch take care of
   multiple definition of `__udivsi3'  undefined reference to `raise' Error
   when compiling [ap/cp]926ejs_config with CodeSourcery arm toolchain


Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
---
 board/integratorap/integratorap.c |7 +--
 board/integratorcp/integratorcp.c |7 +--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/board/integratorap/integratorap.c 
b/board/integratorap/integratorap.c
index e659907..421cdbb 100755
--- a/board/integratorap/integratorap.c
+++ b/board/integratorap/integratorap.c
@@ -611,6 +611,7 @@ void reset_timer_masked (void)
 ulong get_timer_masked (void)
 {
ulong now = READ_TIMER; /* current count */
+   unsigned long long n;
 
if (now  lastdec) {
/* Must have wrapped */
@@ -618,8 +619,10 @@ ulong get_timer_masked (void)
} else {
total_count += lastdec - now;
}
-   lastdec   = now;
-   timestamp = total_count/div_timer;
+   lastdec = now;
+   n = total_count;
+   do_div(n, div_timer);
+   timestamp = (ulong)n;
 
return timestamp;
 }
diff --git a/board/integratorcp/integratorcp.c 
b/board/integratorcp/integratorcp.c
index d6d6e13..8d85238 100755
--- a/board/integratorcp/integratorcp.c
+++ b/board/integratorcp/integratorcp.c
@@ -236,6 +236,7 @@ ulong get_timer_masked (void)
 {
/* get current count */
unsigned long long now = (unsigned long long)READ_TIMER;
+   unsigned long long n;
 
if(now  lastdec) {
/* Must have wrapped */
@@ -243,8 +244,10 @@ ulong get_timer_masked (void)
} else {
total_count += lastdec - now;
}
-   lastdec   = now;
-   timestamp = (ulong)(total_count/div_timer);
+   lastdec = now;
+   n = total_count;
+   do_div(n, div_timer);
+   timestamp = (ulong)n;
 
return timestamp;
 }
-- 
1.5.6.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] Correct ARM Versatile Timer Initialization

2008-08-25 Thread Gururaja Hebbar K R
Hi,

Acked-by :  Gururaja Hebbar [EMAIL PROTECTED]

Regards
Gururaja

 -Original Message-
 From: Jean-Christophe PLAGNIOL-VILLARD [mailto:[EMAIL PROTECTED] 
 Subject: [PATCH 1/1] Correct ARM Versatile Timer Initialization
 
 From: Gururaja Hebbar K R [EMAIL PROTECTED]
 
  - According to ARM Dual-Timer Module (SP804) TRM (ARM DDI0271),
-- Timer Value Register @ TIMER Base + 4 is Read-only.
-- Prescale Value (Bits 3-2 of TIMER Control register)
   can only be one of 00,01,10. 11 is undefined.
-- CFG_HZ for Versatile board is set to
   #define CFG_HZ  (100 / 256)
   So Prescale bits is set to indicate
   - 8 Stages of Prescale, Clock divided by 256
  - The Timer Control Register has one Undefined/Shouldn't Use Bit
So we should do read/modify/write Operation
 
 Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
 ---
 
 I've fix comment style nad a var name
 please ack.
 
 Best Regards,
 J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM OMAP : Correct Invalid Timer Register Field Declaration in omap1510.h omap730.h

2008-08-24 Thread Gururaja Hebbar K R
Hi,

Resend - Subject Corrected. Sorry for the mistake

I searched the Entire u-boot-1.3.4\ directory for PTV_BIT declaration  
couldn't find any.
Rather MPUTIM_PTV_BIT is defined which is the correct declaration. 

Below Patch Corrects the declaration of MPUTIM_PTV_MASK bit in both omap1510.h 
 omap730.h.

Kindly update me if i am wrong.

TIA

Regards
Gururaja

- Correct Invalid #define of MPUTIM_PTV_MASK for
   omap1510  omap730 register definition

 MPUTIM_PTV_MASK is defined as
 #define MPUTIM_PTV_MASK(0x7PTV_BIT)

 while it should have been
 #define MPUTIM_PTV_MASK(0x7MPUTIM_PTV_BIT)

- Below Patch corrects the same

Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
---
 include/configs/omap1510.h |2 +-
 include/configs/omap730.h  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/omap1510.h b/include/configs/omap1510.h
index 6787b19..931560c 100755
--- a/include/configs/omap1510.h
+++ b/include/configs/omap1510.h
@@ -482,7 +482,7 @@
 /*  CNTL_TIMER register bits */
 #define MPUTIM_FREE(16)
 #define MPUTIM_CLOCK_ENABLE(15)
-#define MPUTIM_PTV_MASK(0x7PTV_BIT)
+#define MPUTIM_PTV_MASK(0x7MPUTIM_PTV_BIT)
 #define MPUTIM_PTV_BIT 2
 #define MPUTIM_AR  (11)
 #define MPUTIM_ST  (10)
diff --git a/include/configs/omap730.h b/include/configs/omap730.h
index 03abcb3..04d5144 100755
--- a/include/configs/omap730.h
+++ b/include/configs/omap730.h
@@ -150,7 +150,7 @@
 /* MPU_CNTL_TIMER register bits */
 #define MPUTIM_FREE   (16)
 #define MPUTIM_CLOCK_ENABLE   (15)
-#define MPUTIM_PTV_MASK   (0x7PTV_BIT)
+#define MPUTIM_PTV_MASK   (0x7MPUTIM_PTV_BIT)
 #define MPUTIM_PTV_BIT2
 #define MPUTIM_AR (11)
 #define MPUTIM_ST (10)
-- 
1.5.6.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Resubmit: Correct ARM Versatile Timer Initialization

2008-08-21 Thread Gururaja Hebbar K R
 - According to ARM Dual-Timer Module (SP804) TRM (ARM DDI0271),
   -- Timer Value Register @ TIMER Base + 4 is Read-only.
   -- Prescale Value (Bits 3-2 of TIMER Control register)
can only be one of 00,01,10. 11 is undefined.
   -- CFG_HZ for Versatile board is set to
#define CFG_HZ  (100 / 256)
  So Prescale bits is set to indicate
- 8 Stages of Prescale, Clock divided by 256
 - The Timer Control Register has one Undefined/Shouldn't Use Bit
   So we should do read/modify/write Operation


Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
---
 cpu/arm926ejs/versatile/timer.c |   37 +
 1 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/cpu/arm926ejs/versatile/timer.c b/cpu/arm926ejs/versatile/timer.c
index 32872d2..17ba387 100755
--- a/cpu/arm926ejs/versatile/timer.c
+++ b/cpu/arm926ejs/versatile/timer.c
@@ -46,12 +46,41 @@
 static ulong timestamp;
 static ulong lastdec;
 
-/* nothing really to do with interrupts, just starts up a counter. */
+#define TIMER_ENABLE   (1  7)
+#define TIMER_MODE_MSK (1  6)
+#define TIMER_MODE_FR  (0  6)
+#define TIMER_MODE_PD  (1  6)
+
+#define TIMER_INT_EN   (1  5)
+#define TIMER_PRS_MSK  (3  2)
+#define TIMER_PRS_8S   (1  3)
+#define TIMER_SIZE_MSK (1  2)
+#define TIMER_ONE_SHT  (1  0)
+
 int timer_init (void)
 {
-   *(volatile ulong *)(CFG_TIMERBASE + 0) = CFG_TIMER_RELOAD;  /* 
TimerLoad */
-   *(volatile ulong *)(CFG_TIMERBASE + 4) = CFG_TIMER_RELOAD;  /* 
TimerValue */
-   *(volatile ulong *)(CFG_TIMERBASE + 8) = 0x8C;
+   ulong   TmrCntrlVal;
+
+   /*1st disable the Timer*/
+   TmrCntrlVal = *(volatile ulong *)(CFG_TIMERBASE + 8);
+   TmrCntrlVal = ~TIMER_ENABLE;
+   *(volatile ulong *)(CFG_TIMERBASE + 8) = TmrCntrlVal;
+
+   /* The Timer Control Register has one Undefined/Shouldn't Use Bit
+* So we should do read/modify/write Operation
+   */
+
+   /* Timer Mode : Free Running
+* Interrupt : Disabled
+* Prescale : 8 Stage,  Clk/256
+* Tmr Siz : 16 Bit Counter
+* Tmr in Wrapping Mode
+   */
+   TmrCntrlVal = *(volatile ulong *)(CFG_TIMERBASE + 8);
+   TmrCntrlVal = ~(TIMER_MODE_MSK | TIMER_INT_EN | TIMER_PRS_MSK | 
TIMER_SIZE_MSK | TIMER_ONE_SHT );
+   TmrCntrlVal |= (TIMER_ENABLE | TIMER_PRS_8S);
+
+   *(volatile ulong *)(CFG_TIMERBASE + 8) = TmrCntrlVal;
 
/* init the timestamp and lastdec value */
reset_timer_masked();
-- 
1.5.6.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] need clarification regarding mmc csd structure declaration

2008-08-18 Thread Gururaja Hebbar K R
Hi,

  So my doubt is, Shouldn't erase_grp_size come before sector size. 
 
 No. But sometimes, erase_grp_size just isn't there at all, 
 and you have a 1-bit flag right before sector_size instead.
 
 Currently, these values aren't actually used by u-boot, but I 
 guess ideally, we should either read them correctly or not 
 read them at all.

Thanks for the clarification. 

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


Re: [U-Boot] Resubmit : [PATCH] Correct ARM Versatile TimerInitialization

2008-08-18 Thread Gururaja Hebbar K R
Hi,

Today I download u-boot-1.3.4 and checked drivers\rtc directory with 
u-boot-1.3.3\drivers\rtc .

 There is change in the files that this patch touches. So I think the same 
patch can be applied to u-boot-1.3.4 also.

 

Kindly update me if any changes is needed

 

Regards

Gururaja

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


Re: [U-Boot] need clarification regarding mmc csd structure declaration

2008-08-17 Thread Gururaja Hebbar K R
 Hi,

 Hi,
 
 I need few clarification regarding mmc csd structure 
 declaration. I was taking Atmel mci as reference.
 
 In ProductManualSDCardv2.2.pdf @ page 34  
 ProdManualSDCardv1.9[1].pdf @ page 39, says 
 
 ...
 ...
 ...
 C_SIZE_MULT   3 bit width
 ERASE_BLK_EN  1 bit width
 SECTOR_SIZE   7 bit width
 WP_GRP_SIZE   7 bit width
 WP_GRP_ENABLE 1 bit width
 ...
 ...
 .. 
 
 But in mmc.h file inside 
 u-boot-1.3.4\include\asm-avr32\arch-at32ap700x.
 
 Here, inside structure mmc_csd @ line 
 
 ...
 ...
 ...
 c_size_mult:3
 sector_size:5
 erase_grp_size:5
 wp_grp_size:5
 wp_grp_enable:1
 ...
 ...
 ...
 
 
 So my doubt is, Shouldn't erase_grp_size come before sector size. 
 
 please correct me if i am wrong.

Could some one clarify my doubt.

TIA

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


Re: [U-Boot] Resubmit : [PATCH] Correct ARM Versatile TimerInitialization

2008-08-15 Thread Gururaja Hebbar K R
Hi 

   Hi,
   
according to datasheet for the register TimerXControl
we are supposed to not modify the bits [31:8] and [4]
so we are suppose to read the register and modify only 
 the others registers/register/bits/
   
   Does this mean i need to resend the earlier patch. Writing 00 to 
   these bits ( 31:8  4) is undefined.
  
  Generally, in ARM terminology, one should avoid writing 
 values where writing a value or bit is undefined.
 
 Not only in ARM.
 
  Undefined implies, not that there is no result, but that 
 the outcome is not defined by the specification.
  Hence it is good practice to read/change/write registers with 
  undefined bits, or bits where writing is undefined.
 
 That exaclty what I mean
 
  This is especially important with bits defined as such in ARM TRMs 
  since different ARM customers may implement the ARM IP in different 
  ways i.e writing a value to such bits may have different results in 
  different implementations and or versions of the hardware.
 
 Thanks Peter for the clarification,


I checked the source code  found that the original code itself modifies
the Timer Control Register directly.

Also, after going through the Timer Module i found that,

For free-running Mode of the timer, Writing to Timer_Load register has
no effect.

The TRM Says,

If the timer is operating in Free-Running Mode, it continues to
decrement from its maximum value

So i think the writing to timer_load register is also unnecessary in
this case. 

Kindly correct me if i am wrong.

Also Kindly let me know, if i need to change anything in the patch.
Else i resend the patch once again

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


[U-Boot] [PATCH] - Correct Invalid Timer Register Field Declaration

2008-08-15 Thread Gururaja Hebbar K R
Hi,

I searched the Entire u-boot-1.3.4\ directory for PTV_BIT declaration  
couldn't find any.
Rather MPUTIM_PTV_BIT is defined which is the correct declaration. 

Below Patch Corrects the declaration of MPUTIM_PTV_MASK bit in both omap1510.h 
 omap730.h.

Kindly update me if i am wrong.

TIA

Regards
Gururaja

- Correct Invalid #define of MPUTIM_PTV_MASK for
   omap1510  omap730 register definition

 MPUTIM_PTV_MASK is defined as
 #define MPUTIM_PTV_MASK(0x7PTV_BIT)

 while it should have been
 #define MPUTIM_PTV_MASK(0x7MPUTIM_PTV_BIT)

- Below Patch corrects the same

Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED]
---
 include/configs/omap1510.h |2 +-
 include/configs/omap730.h  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/omap1510.h b/include/configs/omap1510.h
index 6787b19..931560c 100755
--- a/include/configs/omap1510.h
+++ b/include/configs/omap1510.h
@@ -482,7 +482,7 @@
 /*  CNTL_TIMER register bits */
 #define MPUTIM_FREE(16)
 #define MPUTIM_CLOCK_ENABLE(15)
-#define MPUTIM_PTV_MASK(0x7PTV_BIT)
+#define MPUTIM_PTV_MASK(0x7MPUTIM_PTV_BIT)
 #define MPUTIM_PTV_BIT 2
 #define MPUTIM_AR  (11)
 #define MPUTIM_ST  (10)
diff --git a/include/configs/omap730.h b/include/configs/omap730.h
index 03abcb3..04d5144 100755
--- a/include/configs/omap730.h
+++ b/include/configs/omap730.h
@@ -150,7 +150,7 @@
 /* MPU_CNTL_TIMER register bits */
 #define MPUTIM_FREE   (16)
 #define MPUTIM_CLOCK_ENABLE   (15)
-#define MPUTIM_PTV_MASK   (0x7PTV_BIT)
+#define MPUTIM_PTV_MASK   (0x7MPUTIM_PTV_BIT)
 #define MPUTIM_PTV_BIT2
 #define MPUTIM_AR (11)
 #define MPUTIM_ST (10)
-- 
1.5.6.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Resubmit : [PATCH] Correct ARM Versatile Timer Initialization

2008-08-11 Thread Gururaja Hebbar K R
 
Hi,

 according to datasheet for the register TimerXControl
 
 we are supposed to not modify the bits [31:8] and [4]
 
 so we are suppose to read the register and modify only the 
 others register.

Does this mean i need to resend the earlier patch. Writing 00 to these
bits ( 31:8  4) is undefined. 

So i think this will not make any problems. 

anyone could you please update me about the status of this patch. if not
accessible, i will change  resend

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