Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e2bb6650
Commit
e2bb6650
authored
Jan 20, 2009
by
Eric Miao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] pxa: add GPIO support for pxa168
Signed-off-by:
Eric Miao
<
eric.miao@marvell.com
>
parent
40305a58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
arch/arm/Kconfig
arch/arm/Kconfig
+2
-0
arch/arm/mach-mmp/include/mach/gpio.h
arch/arm/mach-mmp/include/mach/gpio.h
+36
-0
arch/arm/mach-mmp/pxa168.c
arch/arm/mach-mmp/pxa168.c
+19
-0
No files found.
arch/arm/Kconfig
View file @
e2bb6650
...
...
@@ -490,6 +490,8 @@ config ARCH_PXA
config ARCH_MMP
bool "Marvell PXA168"
depends on MMU
select GENERIC_GPIO
select ARCH_REQUIRE_GPIOLIB
select HAVE_CLK
select COMMON_CLKDEV
select GENERIC_TIME
...
...
arch/arm/mach-mmp/include/mach/gpio.h
0 → 100644
View file @
e2bb6650
#ifndef __ASM_MACH_GPIO_H
#define __ASM_MACH_GPIO_H
#include <mach/addr-map.h>
#include <mach/irqs.h>
#include <asm-generic/gpio.h>
#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x))))
#define NR_BUILTIN_GPIO (128)
#define gpio_to_bank(gpio) ((gpio) >> 5)
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
#define __gpio_is_inverted(gpio) (0)
#define __gpio_is_occupied(gpio) (0)
/* NOTE: these macros are defined here to make optimization of
* gpio_{get,set}_value() to work when 'gpio' is a constant.
* Usage of these macros otherwise is no longer recommended,
* use generic GPIO API whenever possible.
*/
#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f))
#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)
#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)
#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)
#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)
#include <plat/gpio.h>
#endif
/* __ASM_MACH_GPIO_H */
arch/arm/mach-mmp/pxa168.c
View file @
e2bb6650
...
...
@@ -12,6 +12,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <asm/mach/time.h>
...
...
@@ -19,15 +20,33 @@
#include <mach/cputype.h>
#include <mach/regs-apbc.h>
#include <mach/irqs.h>
#include <mach/gpio.h>
#include <mach/dma.h>
#include <mach/devices.h>
#include "common.h"
#include "clock.h"
#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
static
void
__init
pxa168_init_gpio
(
void
)
{
int
i
;
/* enable GPIO clock */
__raw_writel
(
APBC_APBCLK
|
APBC_FNCLK
,
APBC_PXA168_GPIO
);
/* unmask GPIO edge detection for all 4 banks - APMASKx */
for
(
i
=
0
;
i
<
4
;
i
++
)
__raw_writel
(
0xffffffff
,
APMASK
(
i
));
pxa_init_gpio
(
IRQ_PXA168_GPIOX
,
0
,
127
,
NULL
);
}
void
__init
pxa168_init_irq
(
void
)
{
icu_init_irq
();
pxa168_init_gpio
();
}
/* APB peripheral clocks */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment