summaryrefslogtreecommitdiff
path: root/cpu/pxa/cpu.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-15 22:40:42 +0000
committerwdenk <wdenk>2003-06-15 22:40:42 +0000
commit71f9511803de65a3b98d2f592d418da1d1539f13 (patch)
tree4be38a22fc4f588a80aa8cc350ecd5617a211389 /cpu/pxa/cpu.c
parent487778b781257831aa9b9140dd3c7ad4176e8314 (diff)
downloadu-boot-imx-71f9511803de65a3b98d2f592d418da1d1539f13.zip
u-boot-imx-71f9511803de65a3b98d2f592d418da1d1539f13.tar.gz
u-boot-imx-71f9511803de65a3b98d2f592d418da1d1539f13.tar.bz2
* Fix CONFIG_NET_MULTI support in include/net.h
* Patches by Kyle Harris, 13 Mar 2003: - Add FAT partition support - Add command support for FAT - Add command support for MMC ---- - Add Intel PXA support for video - Add Intel PXA support for MMC ---- - Enable MMC and FAT for lubbock board - Other misc changes for lubbock board
Diffstat (limited to 'cpu/pxa/cpu.c')
-rw-r--r--cpu/pxa/cpu.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpu/pxa/cpu.c b/cpu/pxa/cpu.c
index 6a3c24d..cc9b3ff 100644
--- a/cpu/pxa/cpu.c
+++ b/cpu/pxa/cpu.c
@@ -32,6 +32,7 @@
#include <common.h>
#include <command.h>
+#include <asm/arch/pxa-regs.h>
int cpu_init (void)
{
@@ -150,3 +151,21 @@ int dcache_status (void)
{
return 0; /* always off */
}
+
+void set_GPIO_mode(int gpio_mode)
+{
+ int gpio = gpio_mode & GPIO_MD_MASK_NR;
+ int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
+ int gafr;
+
+ if (gpio_mode & GPIO_MD_MASK_DIR)
+ {
+ GPDR(gpio) |= GPIO_bit(gpio);
+ }
+ else
+ {
+ GPDR(gpio) &= ~GPIO_bit(gpio);
+ }
+ gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
+ GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
+}