AT91SAM9260: How to output PCK0 clock on a GPIO pin
flat view
From: Pedro I. Sanchez <hidden>
Date: 2009-08-31 19:02:01
On Mon, 31 Aug 2009 14:44:19 -0400, Stephen Munnings [off-list ref] wrote:
Pedro I. Sanchez wrote:quoted
quoted
But, I also found that you must have the PMC clock for the GPIOC bank running before GPIO (even the configuration, it seems) will work. I am not sure if I had this issue in Linux, or only in the loaders, but
quoted
quoted
I did have to turn on the PMC clocks to get any GPIO based things working. The standard boot loader only seems to turn on GPIOA, but I am also using GPIOB and GPIOC, and I had to turn on the PMC clocks for those also before I could get very far. Stephen MunningsThanks Stephen, And how do I turn on the PMC clocks for the GPIO?I did some more searching, and it appears that Linux for at91 turns on all the GPIO PMC clocks as part of its initialization. So, the problem appears to not be the PMC clocks. (It does it in /arch/arm/mach-at91/gpio.c in function at91_gpio_init() ) I do presume that you have the appropriate support configured into your kernel when you compiled it.
$ grep -i clocks .config CONFIG_AT91_PROGRAMMABLE_CLOCKS=y $ grep -i gpio .config CONFIG_GENERIC_GPIO=y # CONFIG_MTD_NAND_GPIO is not set CONFIG_I2C_GPIO=m CONFIG_SPI_GPIO=m CONFIG_ARCH_REQUIRE_GPIOLIB=y CONFIG_GPIOLIB=y CONFIG_GPIO_SYSFS=y # Memory mapped GPIO expanders: # I2C GPIO expanders: CONFIG_GPIO_MAX732X=m CONFIG_GPIO_PCA953X=m CONFIG_GPIO_PCF857X=m # PCI GPIO expanders: # SPI GPIO expanders: CONFIG_GPIO_MAX7301=m CONFIG_GPIO_MCP23S08=m # CONFIG_HTC_EGPIO is not set CONFIG_LEDS_GPIO=y I presume I don't need any to modprobe any of these available gpio modules. Certainly the gpio user space interface via /sys/class/gpio works well. Any other suggestions? Thanks, -- Pedro