AT91SAM9260: How to output PCK0 clock on a GPIO pin

Sergey Matyukevich geomatsi at gmail.com
Mon Aug 31 16:35:46 EDT 2009



> So are the following statements correct?
> 
> 1. The pck0 clock I've been playing with has nothing to do with the
> clock I want on PC6 (TIOB2).

Yes. PCK's (programmable clocks) are assigned to different pins:  
PB30, PC1 for PCK0 and to  PB31, PC2 for PCK1. 
For PCK see ch. 26 of at91sam9260 datasheet.

> 2. I have to use instead the "tc2_clk" as defined in
> arch/arm/mach-at-91/at91sam9260.c.

Yes

> 3. I have to access the TC_CMR register directly to set things up. I
> mean, there are no macros already defined to access these structures.

You have to 'ioremap' required registers and write to those
registers directly using memory-writing macroses iowriteXX.

But at first decide what you need, TIOB or PCK. If you don't need all
the power of Ryan Mallon's pwm driver (see below in the thread) and
all you need is clocking output on GPIO pin, then you might be happy
with PCK. Note that PMC_PCK registers allows several dividers, if
original clock is too high.

Sergey 



More information about the linux-arm-kernel mailing list