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


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


[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


[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


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


[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


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


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