* calibrate_delay function
@ 2006-10-10 22:43 Ashlesha Shintre
2006-10-10 22:38 ` mlachwani
0 siblings, 1 reply; 7+ messages in thread
From: Ashlesha Shintre @ 2006-10-10 22:43 UTC (permalink / raw)
To: linux-mips
Hi,
I m working on the Encore M3 board that has the AU1500 MIPS processor on
it. I aim to port the 2.6 linux kernel to the board which is already
supported in the 2.4 kernel.
The start_kernel function in linux/init/main.c file, calls a function
calibrate_delay found in the arch/frv/kernel/setup.c file. Why does the
kernel call this function which is a part of the Fujitsu FR-V
architecture?
When I build the image, this is the point where the kernel is stuck and
the last contents of the log buffer show the following printk message
from the calibrate_delay function:
> Calibrating delay loop...
Thanks,
Ashlesha.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: calibrate_delay function 2006-10-10 22:43 calibrate_delay function Ashlesha Shintre @ 2006-10-10 22:38 ` mlachwani 2006-10-10 23:34 ` Ashlesha Shintre 0 siblings, 1 reply; 7+ messages in thread From: mlachwani @ 2006-10-10 22:38 UTC (permalink / raw) To: ashlesha; +Cc: linux-mips Ashlesha Shintre wrote: > Hi, > I m working on the Encore M3 board that has the AU1500 MIPS processor on > it. I aim to port the 2.6 linux kernel to the board which is already > supported in the 2.4 kernel. > > The start_kernel function in linux/init/main.c file, calls a function > calibrate_delay found in the arch/frv/kernel/setup.c file. Why does the > kernel call this function which is a part of the Fujitsu FR-V > architecture? > > When I build the image, this is the point where the kernel is stuck and > the last contents of the log buffer show the following printk message > from the calibrate_delay function: > > > >> Calibrating delay loop... >> > > Thanks, > Ashlesha. > > > > > start_kernel() calls calibrate_delay() which can be found in init/calibrate.c thanks, Manish Lachwani ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: calibrate_delay function 2006-10-10 22:38 ` mlachwani @ 2006-10-10 23:34 ` Ashlesha Shintre 2006-10-10 23:30 ` mlachwani 2006-10-10 23:35 ` Ricardo Mendoza 0 siblings, 2 replies; 7+ messages in thread From: Ashlesha Shintre @ 2006-10-10 23:34 UTC (permalink / raw) To: mlachwani; +Cc: linux-mips > > start_kernel() calls calibrate_delay() which can be found in > > init/calibrate.c Thanks, I did find it and put in a few printk s to debug the problem. i have pasted part of the calibrate_delay function where the kernel gets stuck.. It is getting stuck at the second while loop where it goes into an infinite loop! the value of ash_count keeps incrementing and thats all i see in the log buffer! i can see why the kernel is stuck -- its because ticks=jiffies is the command just before infinitely looping based on the condition that ticks==jiffies! Am I not looking in the right place? Regards, Ashlesha. > printk(KERN_DEBUG "Calibrating delay loop... "); > while ((loops_per_jiffy <<= 1) != 0) { > printk("within the while loop\n"); > /* wait for "start of" clock tick */ > ticks = jiffies; > while (ticks == jiffies) > printk("%d\n",++ash_count); > /* nothing ; infinite loop, control never comes out of here*/ > /* Go .. */ On Tue, 2006-10-10 at 15:38 -0700, mlachwani wrote: > Ashlesha Shintre wrote: > > Hi, > > I m working on the Encore M3 board that has the AU1500 MIPS processor on > > it. I aim to port the 2.6 linux kernel to the board which is already > > supported in the 2.4 kernel. > > > > The start_kernel function in linux/init/main.c file, calls a function > > calibrate_delay found in the arch/frv/kernel/setup.c file. Why does the > > kernel call this function which is a part of the Fujitsu FR-V > > architecture? > > > > When I build the image, this is the point where the kernel is stuck and > > the last contents of the log buffer show the following printk message > > from the calibrate_delay function: > > > > > > > >> Calibrating delay loop... > >> > > > > Thanks, > > Ashlesha. > > > > > > > > > > > > start_kernel() calls calibrate_delay() which can be found in > > init/calibrate.c > > > thanks, > Manish Lachwani ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: calibrate_delay function 2006-10-10 23:34 ` Ashlesha Shintre @ 2006-10-10 23:30 ` mlachwani 2006-10-11 1:07 ` Ashlesha Shintre 2006-10-11 17:52 ` Ashlesha Shintre 2006-10-10 23:35 ` Ricardo Mendoza 1 sibling, 2 replies; 7+ messages in thread From: mlachwani @ 2006-10-10 23:30 UTC (permalink / raw) To: ashlesha; +Cc: linux-mips Can you check to see if you are getting timer interrupts thanks, Manish Lachwani Ashlesha Shintre wrote: >>> start_kernel() calls calibrate_delay() which can be found in >>> init/calibrate.c >>> > > Thanks, I did find it and put in a few printk s to debug the problem. > > i have pasted part of the calibrate_delay function where the kernel gets stuck.. > It is getting stuck at the second while loop where it goes into an infinite loop! > the value of ash_count keeps incrementing and thats all i see in the log buffer! > > i can see why the kernel is stuck -- its because ticks=jiffies is the command just before infinitely looping based on the condition that ticks==jiffies! > Am I not looking in the right place? > > Regards, > Ashlesha. > >> printk(KERN_DEBUG "Calibrating delay loop... "); >> while ((loops_per_jiffy <<= 1) != 0) { >> printk("within the while loop\n"); >> /* wait for "start of" clock tick */ >> ticks = jiffies; >> while (ticks == jiffies) >> printk("%d\n",++ash_count); >> /* nothing ; infinite loop, control never comes out of here*/ >> /* Go .. */ >> > > On Tue, 2006-10-10 at 15:38 -0700, mlachwani wrote: > >> Ashlesha Shintre wrote: >> >>> Hi, >>> I m working on the Encore M3 board that has the AU1500 MIPS processor on >>> it. I aim to port the 2.6 linux kernel to the board which is already >>> supported in the 2.4 kernel. >>> >>> The start_kernel function in linux/init/main.c file, calls a function >>> calibrate_delay found in the arch/frv/kernel/setup.c file. Why does the >>> kernel call this function which is a part of the Fujitsu FR-V >>> architecture? >>> >>> When I build the image, this is the point where the kernel is stuck and >>> the last contents of the log buffer show the following printk message >>> from the calibrate_delay function: >>> >>> >>> >>> >>>> Calibrating delay loop... >>>> >>>> >>> Thanks, >>> Ashlesha. >>> >>> >>> >>> >>> >>> > > >>> start_kernel() calls calibrate_delay() which can be found in >>> init/calibrate.c >>> >>> >> thanks, >> Manish Lachwani >> > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: calibrate_delay function 2006-10-10 23:30 ` mlachwani @ 2006-10-11 1:07 ` Ashlesha Shintre 2006-10-11 17:52 ` Ashlesha Shintre 1 sibling, 0 replies; 7+ messages in thread From: Ashlesha Shintre @ 2006-10-11 1:07 UTC (permalink / raw) To: mlachwani, mendoza.ricardo; +Cc: linux-mips thanks, i m checking the Documentation/mips/time.c file..the time_init function gets executed as it is supposed to... the curious part is that a few days ago, this was not where the kernel was stuck.. it was going to the rest_init function in the start_kernel and discovering devices on the PCI bus...it used to hang at that point! but i will check and let you know.. thanks, On Tue, 2006-10-10 at 16:30 -0700, mlachwani wrote: > Can you check to see if you are getting timer interrupts > > thanks, > Manish Lachwani > > Ashlesha Shintre wrote: > >>> start_kernel() calls calibrate_delay() which can be found in > >>> init/calibrate.c > >>> > > > > Thanks, I did find it and put in a few printk s to debug the problem. > > > > i have pasted part of the calibrate_delay function where the kernel gets stuck.. > > It is getting stuck at the second while loop where it goes into an infinite loop! > > the value of ash_count keeps incrementing and thats all i see in the log buffer! > > > > i can see why the kernel is stuck -- its because ticks=jiffies is the command just before infinitely looping based on the condition that ticks==jiffies! > > Am I not looking in the right place? > > > > Regards, > > Ashlesha. > > > >> printk(KERN_DEBUG "Calibrating delay loop... "); > >> while ((loops_per_jiffy <<= 1) != 0) { > >> printk("within the while loop\n"); > >> /* wait for "start of" clock tick */ > >> ticks = jiffies; > >> while (ticks == jiffies) > >> printk("%d\n",++ash_count); > >> /* nothing ; infinite loop, control never comes out of here*/ > >> /* Go .. */ > >> > > > > On Tue, 2006-10-10 at 15:38 -0700, mlachwani wrote: > > > >> Ashlesha Shintre wrote: > >> > >>> Hi, > >>> I m working on the Encore M3 board that has the AU1500 MIPS processor on > >>> it. I aim to port the 2.6 linux kernel to the board which is already > >>> supported in the 2.4 kernel. > >>> > >>> The start_kernel function in linux/init/main.c file, calls a function > >>> calibrate_delay found in the arch/frv/kernel/setup.c file. Why does the > >>> kernel call this function which is a part of the Fujitsu FR-V > >>> architecture? > >>> > >>> When I build the image, this is the point where the kernel is stuck and > >>> the last contents of the log buffer show the following printk message > >>> from the calibrate_delay function: > >>> > >>> > >>> > >>> > >>>> Calibrating delay loop... > >>>> > >>>> > >>> Thanks, > >>> Ashlesha. > >>> > >>> > >>> > >>> > >>> > >>> > > > > > >>> start_kernel() calls calibrate_delay() which can be found in > >>> init/calibrate.c > >>> > >>> > >> thanks, > >> Manish Lachwani > >> > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: calibrate_delay function 2006-10-10 23:30 ` mlachwani 2006-10-11 1:07 ` Ashlesha Shintre @ 2006-10-11 17:52 ` Ashlesha Shintre 1 sibling, 0 replies; 7+ messages in thread From: Ashlesha Shintre @ 2006-10-11 17:52 UTC (permalink / raw) To: mlachwani; +Cc: linux-mips hi, I checked what functions are being executed in the start up process and found that the au1xxx_timer_setup is called and executed.. Also the processor has 2 counters, the TOY (time of year) and RTC, so the calibrate_div32_gettimeoffset gets executed... how can I check if I get the timer interrupt? Thanks, Ashlesha. On Tue, 2006-10-10 at 16:30 -0700, mlachwani wrote: > Can you check to see if you are getting timer interrupts > > thanks, > Manish Lachwani > > Ashlesha Shintre wrote: > >>> start_kernel() calls calibrate_delay() which can be found in > >>> init/calibrate.c > >>> > > > > Thanks, I did find it and put in a few printk s to debug the problem. > > > > i have pasted part of the calibrate_delay function where the kernel gets stuck.. > > It is getting stuck at the second while loop where it goes into an infinite loop! > > the value of ash_count keeps incrementing and thats all i see in the log buffer! > > > > i can see why the kernel is stuck -- its because ticks=jiffies is the command just before infinitely looping based on the condition that ticks==jiffies! > > Am I not looking in the right place? > > > > Regards, > > Ashlesha. > > > >> printk(KERN_DEBUG "Calibrating delay loop... "); > >> while ((loops_per_jiffy <<= 1) != 0) { > >> printk("within the while loop\n"); > >> /* wait for "start of" clock tick */ > >> ticks = jiffies; > >> while (ticks == jiffies) > >> printk("%d\n",++ash_count); > >> /* nothing ; infinite loop, control never comes out of here*/ > >> /* Go .. */ > >> > > > > On Tue, 2006-10-10 at 15:38 -0700, mlachwani wrote: > > > >> Ashlesha Shintre wrote: > >> > >>> Hi, > >>> I m working on the Encore M3 board that has the AU1500 MIPS processor on > >>> it. I aim to port the 2.6 linux kernel to the board which is already > >>> supported in the 2.4 kernel. > >>> > >>> The start_kernel function in linux/init/main.c file, calls a function > >>> calibrate_delay found in the arch/frv/kernel/setup.c file. Why does the > >>> kernel call this function which is a part of the Fujitsu FR-V > >>> architecture? > >>> > >>> When I build the image, this is the point where the kernel is stuck and > >>> the last contents of the log buffer show the following printk message > >>> from the calibrate_delay function: > >>> > >>> > >>> > >>> > >>>> Calibrating delay loop... > >>>> > >>>> > >>> Thanks, > >>> Ashlesha. > >>> > >>> > >>> > >>> > >>> > >>> > > > > > >>> start_kernel() calls calibrate_delay() which can be found in > >>> init/calibrate.c > >>> > >>> > >> thanks, > >> Manish Lachwani > >> > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: calibrate_delay function 2006-10-10 23:34 ` Ashlesha Shintre 2006-10-10 23:30 ` mlachwani @ 2006-10-10 23:35 ` Ricardo Mendoza 1 sibling, 0 replies; 7+ messages in thread From: Ricardo Mendoza @ 2006-10-10 23:35 UTC (permalink / raw) To: ashlesha; +Cc: linux-mips On 10/10/06, Ashlesha Shintre <ashlesha@kenati.com> wrote: > i can see why the kernel is stuck -- its because ticks=jiffies is the command just before infinitely looping based on the condition that ticks==jiffies! > Am I not looking in the right place? The delay loop calibration relies on a working system timer, if you haven't setup and started a timer for your board, the jiffies will never be incremented ergo indefinitely looping in this place. This information can probably be found under Porting, on the l-m.o wiki. Check there if you have any other problems in the process of writing your board specific code. Ricardo ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-10-11 17:42 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-10-10 22:43 calibrate_delay function Ashlesha Shintre 2006-10-10 22:38 ` mlachwani 2006-10-10 23:34 ` Ashlesha Shintre 2006-10-10 23:30 ` mlachwani 2006-10-11 1:07 ` Ashlesha Shintre 2006-10-11 17:52 ` Ashlesha Shintre 2006-10-10 23:35 ` Ricardo Mendoza
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.