From: psanchez@fosstel.com (Pedro I. Sanchez) Date: Mon, 31 Aug 2009 17:06:09 -0400 Subject: AT91SAM9260: How to output PCK0 clock on a GPIO pin In-Reply-To: <20090901003546.14313e09@realm> References: <4A9C0136.3080102@gabaedevelopment.com> <20090831233312.2d2a6676@realm> <20090901003546.14313e09@realm> Message-ID: <9088b8e176c52c4c5832d549f766934d@colcan.ca> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 1 Sep 2009 00:35:46 +0400, Sergey Matyukevich wrote: >> 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 Well, the board I'm working on, as well several others already on my shelf :-(, is already wired to use PC6 so I have to go the TC way. So this is the way to go for me. -- Pedro