Commit a7a89d96 authored by Eric Miao's avatar Eric Miao

[ARM] pxa: add MFP support for pxa168

Signed-off-by: default avatarEric Miao <eric.miao@marvell.com>
parent e2bb6650
This diff is collapsed.
#ifndef __ASM_MACH_MFP_H
#define __ASM_MACH_MFP_H
#include <plat/mfp.h>
/*
* NOTE: the MFPR register bit definitions on PXA168 processor lines are a
* bit different from those on PXA3xx. Bit [7:10] are now reserved, which
* were SLEEP_OE_N, SLEEP_DATA, SLEEP_SEL and the LSB of DRIVE bits.
*
* To cope with this difference and re-use the pxa3xx mfp code as much as
* possible, we make the following compromise:
*
* 1. SLEEP_OE_N will always be programmed to '1' (by MFP_LPM_FLOAT)
* 2. DRIVE strength definitions redefined to include the reserved bit10
* 3. Override MFP_CFG() and MFP_CFG_DRV()
* 4. Drop the use of MFP_CFG_LPM() and MFP_CFG_X()
*/
#define MFP_DRIVE_VERY_SLOW (0x0 << 13)
#define MFP_DRIVE_SLOW (0x2 << 13)
#define MFP_DRIVE_MEDIUM (0x4 << 13)
#define MFP_DRIVE_FAST (0x8 << 13)
#undef MFP_CFG
#undef MFP_CFG_DRV
#undef MFP_CFG_LPM
#undef MFP_CFG_X
#undef MFP_CFG_DEFAULT
#define MFP_CFG(pin, af) \
(MFP_LPM_FLOAT | MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DRIVE_MEDIUM)
#define MFP_CFG_DRV(pin, af, drv) \
(MFP_LPM_FLOAT | MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DRIVE_##drv)
#endif /* __ASM_MACH_MFP_H */
......@@ -23,10 +23,23 @@
#include <mach/gpio.h>
#include <mach/dma.h>
#include <mach/devices.h>
#include <mach/mfp.h>
#include "common.h"
#include "clock.h"
#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata =
{
MFP_ADDR_X(GPIO0, GPIO36, 0x04c),
MFP_ADDR_X(GPIO37, GPIO55, 0x000),
MFP_ADDR_X(GPIO56, GPIO123, 0x0e0),
MFP_ADDR_X(GPIO124, GPIO127, 0x0f4),
MFP_ADDR_END,
};
#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
static void __init pxa168_init_gpio(void)
......@@ -62,6 +75,8 @@ static struct clk_lookup pxa168_clkregs[] = {
static int __init pxa168_init(void)
{
if (cpu_is_pxa168()) {
mfp_init_base(MFPR_VIRT_BASE);
mfp_init_addr(pxa168_mfp_addr_map);
pxa_init_dma(IRQ_PXA168_DMA_INT0, 32);
clks_register(ARRAY_AND_SIZE(pxa168_clkregs));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment