From ab0df36fc7db9dda0b786b909f653e279dfeb9cf Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Fri, 29 Aug 2008 21:09:49 +0200 Subject: avr32: refactor the portmux/gpio code - Separate the portmux configuration functionality from the GPIO pin control API. - Separate the controller-specific code from the chip-specific code. - Allow "ganged" port configuration (multiple pins at once). - Add more flexibility to the "canned" peripheral select functions: - Allow using more than 23 address bits, more chip selects, as well as NAND- and CF-specific pins. - Make the MACB SPEED pin optional, and choose between MII/RMII using a parameter instead of an #ifdef. - Make it possible to use other MMC slots than slot 0, and support different MMC/SDCard data bus widths. - Use more reasonable pull-up defaults; floating pins may consume a lot of power. - Get rid of some custom portmux code from the mimc200 board code. The old gpio/portmux API couldn't really handle its requirements, but the new one can. - Add documentation. The end result is slightly smaller code for all boards. Which isn't really the point, but at least it isn't any larger. This has been verified on ATSTK1002 and ATNGW100. I'd appreciate if the board maintainers could help me test this on their boards. In particular, the mimc200 port has lost a lot of code, so I'm hoping Mark can help me out. Signed-off-by: Haavard Skinnemoen Cc: Hans-Christian Egtvedt Cc: Mark Jackson Cc: Alex Raimondi Cc: Julien May Changes since v1: * Enable pullup on NWAIT * Add missing include to portmux-pio.h * Rename CONFIG_PIO2 -> CONFIG_PORTMUX_PIO to match docs --- cpu/at32ap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu/at32ap/Makefile') diff --git a/cpu/at32ap/Makefile b/cpu/at32ap/Makefile index 33dc427..100cf3e 100644 --- a/cpu/at32ap/Makefile +++ b/cpu/at32ap/Makefile @@ -34,7 +34,7 @@ COBJS-y += hsdramc.o COBJS-y += exception.o COBJS-y += cache.o COBJS-y += interrupts.o -COBJS-y += pio.o +COBJS-$(CONFIG_PORTMUX_PIO) += portmux-pio.o SRCS := $(START-y:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) -- cgit v1.1 From baf449fc5ff96f071bb0e3789fd3265f6d4fd9a0 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Mon, 1 Sep 2008 14:00:07 +0200 Subject: avr32: Add support for "GPIO" port mux The "GPIO" port mux is used on AVR32 UC3 parts as well as AT32AP7200 and all later AVR32 chips. This patch adds a driver for it, implementing the same API as the existing portmux-pio driver but with more functionality. Signed-off-by: Haavard Skinnemoen --- cpu/at32ap/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'cpu/at32ap/Makefile') diff --git a/cpu/at32ap/Makefile b/cpu/at32ap/Makefile index 100cf3e..e08f273 100644 --- a/cpu/at32ap/Makefile +++ b/cpu/at32ap/Makefile @@ -35,6 +35,7 @@ COBJS-y += exception.o COBJS-y += cache.o COBJS-y += interrupts.o COBJS-$(CONFIG_PORTMUX_PIO) += portmux-pio.o +COBJS-$(CONFIG_PORTMUX_GPIO) += portmux-gpio.o SRCS := $(START-y:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) -- cgit v1.1