Skip to content

Commit

Permalink
[ARM] 3037/1: AAED-2000 - Add defines for GPIO registers on external …
Browse files Browse the repository at this point in the history
…port.

Patch from Bellido Nicolas

The AAED-2000 board has GPIO pins on an external port.
This patch adds the defines, and do the necessary mapping.

Signed-off-by: Nicolas Bellido <ml@acolin.be>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Bellido Nicolas authored and Russell King committed Oct 28, 2005
1 parent 13b1d67 commit 4028ef4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/arm/mach-aaec2000/aaed2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,23 @@
#include <asm/mach/map.h>
#include <asm/mach/irq.h>

#include <asm/arch/aaed2000.h>

#include "core.h"

static void __init aaed2000_init_irq(void)
{
aaec2000_init_irq();
}

static struct map_desc aaed2000_io_desc[] __initdata = {
{ EXT_GPIO_VBASE, EXT_GPIO_PBASE, EXT_GPIO_LENGTH, MT_DEVICE }, /* Ext GPIO */
};

static void __init aaed2000_map_io(void)
{
aaec2000_map_io();
iotable_init(aaed2000_io_desc, ARRAY_SIZE(aaed2000_io_desc));
}

MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
Expand Down
40 changes: 40 additions & 0 deletions include/asm-arm/arch-aaec2000/aaed2000.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* linux/include/asm-arm/arch-aaec2000/aaed2000.h
*
* AAED-2000 specific bits definition
*
* Copyright (c) 2005 Nicolas Bellido Y Ortega
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#ifndef __ASM_ARCH_AAED2000_H
#define __ASM_ARCH_AAED2000_H

/* External GPIOs. */

#define EXT_GPIO_PBASE AAEC_CS3
#define EXT_GPIO_VBASE 0xf8100000
#define EXT_GPIO_LENGTH 0x00001000

#define __ext_gpio_p2v(x) ((x) - EXT_GPIO_PBASE + EXT_GPIO_VBASE)
#define __ext_gpio_v2p(x) ((x) + EXT_GPIO_PBASE - EXT_GPIO_VBASE)

#define __EXT_GPIO_REG(x) (*((volatile u32 *)__ext_gpio_p2v(x)))
#define __EXT_GPIO_PREG(x) (__ext_gpio_v2p((u32)&(x)))

#define AAED_EXT_GPIO __EXT_GPIO_REG(EXT_GPIO_PBASE)

#define AAED_EGPIO_KBD_SCAN 0x00003fff /* Keyboard scan data */
#define AAED_EGPIO_PWR_INT 0x00008fff /* Smart battery charger interrupt */
#define AAED_EGPIO_SWITCHED 0x000f0000 /* DIP Switches */
#define AAED_EGPIO_USB_VBUS 0x00400000 /* USB Vbus sense */
#define AAED_EGPIO_LCD_PWR_EN 0x02000000 /* LCD and backlight PWR enable */
#define AAED_EGPIO_nLED0 0x20000000 /* LED 0 */
#define AAED_EGPIO_nLED1 0x20000000 /* LED 1 */
#define AAED_EGPIO_nLED2 0x20000000 /* LED 2 */


#endif /* __ARM_ARCH_AAED2000_H */

0 comments on commit 4028ef4

Please sign in to comment.