Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Problem with atmel_tcb.1 in kernel 3.0.4
PostPosted: Wed Oct 05, 2011 9:04 pm 
Offline

Joined: Sat Sep 24, 2011 11:33 pm
Posts: 13
Hi,

I've ported my driver, which uses the atmel_tcb.1 block as PWM source (in AT91SAM9260).
The code worked perfectly in kernel.2.6.29.3, but now during the initialization I get the following error:

atmel_tcb: probe of atmel_tcb.1 failed with error -22

I have added printk invocations in the tc_probe routine, and I've found, that the problem occures, when tc_probe attempts to get clock for atmel_tcb.1 (In this line: http://lxr.linux.no/linux+v3.0.4/driver ... lib.c#L125 )

The atmel_tcb.0 is correctly used as clocksource:
tcb_clksrc: tc0 at 12.916 MHz

OK . I have found a solution:

I have found, that the tc_probe always looks for "t0_clk", "t1_clk" and "t2_clk", and
function at91_add_device_tc performs the following operations:

( http://lxr.linux.no/linux+*/arch/arm/ma ... ces.c#L599 )
static void __init at91_add_device_tc(void)
{
/* this chip has a separate clock and irq for each TC channel */
at91_clock_associate("tc0_clk", &at91sam9260_tcb0_device.dev, "t0_clk");
at91_clock_associate("tc1_clk", &at91sam9260_tcb0_device.dev, "t1_clk");
at91_clock_associate("tc2_clk", &at91sam9260_tcb0_device.dev, "t2_clk");
platform_device_register(&at91sam9260_tcb0_device);
at91_clock_associate("tc3_clk", &at91sam9260_tcb1_device.dev, "t0_clk");
at91_clock_associate("tc4_clk", &at91sam9260_tcb1_device.dev, "t1_clk");
at91_clock_associate("tc5_clk", &at91sam9260_tcb1_device.dev, "t2_clk");
platform_device_register(&at91sam9260_tcb1_device);
}
While the code mapping the clock names in 3.0.4 has the following form:
(see: http://lxr.linux.no/linux+*/arch/arm/ma ... 260.c#L234 )
static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk),
CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
};

So it is necessary to change strings describing clocks for atmel_tcb.1 (replacing t3_clk with t0_clk, t4_clk with t1_clk, and t5_clk with t3_clk).
I have filled the bug report for LKML.
--
Regards,
Wojtek


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: