Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281794
b: refs/heads/master
c: 58a2737
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann committed Nov 23, 2011
1 parent 0069370 commit ca0dff3
Show file tree
Hide file tree
Showing 98 changed files with 810 additions and 717 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0116da4fcc1ae8a80d9002441e98768f2a6fa2fe
refs/heads/master: 58a273745fbb2fbd01d26e7a60f0acc8c1d99469
2 changes: 2 additions & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ config ARCH_MMP
select ARCH_REQUIRE_GPIOLIB
select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS
select GPIO_PXA
select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select PLAT_PXA
Expand Down Expand Up @@ -673,6 +674,7 @@ config ARCH_PXA
select CLKSRC_MMIO
select ARCH_REQUIRE_GPIOLIB
select GENERIC_CLOCKEVENTS
select GPIO_PXA
select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select PLAT_PXA
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/arm/mach-mmp/aspenite.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM,
},
[1] = {
.start = gpio_to_irq(27),
.end = gpio_to_irq(27),
.start = MMP_GPIO_TO_IRQ(27),
.end = MMP_GPIO_TO_IRQ(27),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
}
};
Expand Down Expand Up @@ -232,6 +232,7 @@ static void __init common_init(void)
pxa168_add_nand(&aspenite_nand_info);
pxa168_add_fb(&aspenite_lcd_info);
pxa168_add_keypad(&aspenite_keypad_info);
platform_device_register(&pxa168_device_gpio);

/* off-chip devices */
platform_device_register(&smc91x_device);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-mmp/avengers_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static void __init avengers_lite_init(void)

/* on-chip devices */
pxa168_add_uart(2);
platform_device_register(&pxa168_device_gpio);
}

MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-mmp/brownstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ static void __init brownstone_init(void)
/* on-chip devices */
mmp2_add_uart(1);
mmp2_add_uart(3);
platform_device_register(&mmp2_device_gpio);
mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/arm/mach-mmp/flint.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM,
},
[1] = {
.start = gpio_to_irq(155),
.end = gpio_to_irq(155),
.start = MMP_GPIO_TO_IRQ(155),
.end = MMP_GPIO_TO_IRQ(155),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
}
};
Expand All @@ -110,6 +110,7 @@ static void __init flint_init(void)
/* on-chip devices */
mmp2_add_uart(1);
mmp2_add_uart(2);
platform_device_register(&mmp2_device_gpio);

/* off-chip devices */
platform_device_register(&smc91x_device);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-mmp/gplugd.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ static void __init gplugd_init(void)
pxa168_add_uart(3);
pxa168_add_ssp(0);
pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
platform_device_register(&pxa168_device_gpio);

pxa168_add_eth(&gplugd_eth_platform_data);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-mmp/include/mach/gpio-pxa.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
#define __ASM_MACH_GPIO_PXA_H

#include <mach/addr-map.h>
#include <mach/cputype.h>
#include <mach/irqs.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) (GPIO_REGS_VIRT + (x))

#define NR_BUILTIN_GPIO IRQ_GPIO_NUM

#define gpio_to_bank(gpio) ((gpio) >> 5)

/* NOTE: these macros are defined here to make optimization of
Expand Down
7 changes: 1 addition & 6 deletions trunk/arch/arm/mach-mmp/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

#include <asm-generic/gpio.h>

#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
#include <mach/cputype.h>

#define __gpio_is_inverted(gpio) (0)
#define __gpio_is_occupied(gpio) (0)

#include <plat/gpio.h>
#endif /* __ASM_MACH_GPIO_H */
6 changes: 3 additions & 3 deletions trunk/arch/arm/mach-mmp/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
#define IRQ_MMP2_MUX_END (IRQ_MMP2_SSP_BASE + 2)

#define IRQ_GPIO_START 128
#define IRQ_GPIO_NUM 192
#define IRQ_GPIO(x) (IRQ_GPIO_START + (x))
#define MMP_NR_BUILTIN_GPIO 192
#define MMP_GPIO_TO_IRQ(gpio) (IRQ_GPIO_START + (gpio))

#define IRQ_BOARD_START (IRQ_GPIO_START + IRQ_GPIO_NUM)
#define IRQ_BOARD_START (IRQ_GPIO_START + MMP_NR_BUILTIN_GPIO)

#define NR_IRQS (IRQ_BOARD_START)

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-mmp/include/mach/mmp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ extern struct pxa_device_desc mmp2_device_sdh3;
extern struct pxa_device_desc mmp2_device_asram;
extern struct pxa_device_desc mmp2_device_isram;

extern struct platform_device mmp2_device_gpio;

static inline int mmp2_add_uart(int id)
{
struct pxa_device_desc *d = NULL;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-mmp/include/mach/pxa168.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct pxa168_usb_pdata {
/* pdata can be NULL */
int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);

extern struct platform_device pxa168_device_gpio;

static inline int pxa168_add_uart(int id)
{
struct pxa_device_desc *d = NULL;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-mmp/include/mach/pxa910.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ extern struct pxa_device_desc pxa910_device_pwm3;
extern struct pxa_device_desc pxa910_device_pwm4;
extern struct pxa_device_desc pxa910_device_nand;

extern struct platform_device pxa910_device_gpio;

static inline int pxa910_add_uart(int id)
{
struct pxa_device_desc *d = NULL;
Expand Down
39 changes: 21 additions & 18 deletions trunk/arch/arm/mach-mmp/mmp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/platform_device.h>

#include <asm/hardware/cache-tauros2.h>

Expand All @@ -24,7 +25,6 @@
#include <mach/irqs.h>
#include <mach/dma.h>
#include <mach/mfp.h>
#include <mach/gpio-pxa.h>
#include <mach/devices.h>
#include <mach/mmp2.h>

Expand All @@ -33,8 +33,6 @@

#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)

#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c)

static struct mfp_addr_map mmp2_addr_map[] __initdata = {

MFP_ADDR_X(GPIO0, GPIO58, 0x54),
Expand Down Expand Up @@ -95,24 +93,9 @@ void mmp2_clear_pmic_int(void)
__raw_writel(data, mfpr_pmic);
}

static void __init mmp2_init_gpio(void)
{
int i;

/* enable GPIO clock */
__raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_MMP2_GPIO);

/* unmask GPIO edge detection for all 6 banks -- APMASKx */
for (i = 0; i < 6; i++)
__raw_writel(0xffffffff, APMASK(i));

pxa_init_gpio(IRQ_MMP2_GPIO, 0, 167, NULL);
}

void __init mmp2_init_irq(void)
{
mmp2_init_icu();
mmp2_init_gpio();
}

static void sdhc_clk_enable(struct clk *clk)
Expand Down Expand Up @@ -149,6 +132,7 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
static APBC_CLK(gpio, MMP2_GPIO, 0, 26000000);

static APMU_CLK(nand, NAND, 0xbf, 100000000);
static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops);
Expand All @@ -168,6 +152,7 @@ static struct clk_lookup mmp2_clkregs[] = {
INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL),
INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"),
INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"),
INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"),
Expand Down Expand Up @@ -230,3 +215,21 @@ MMP2_DEVICE(asram, "asram", -1, NONE, 0xe0000000, 0x4000);
/* 0xd1000000 ~ 0xd101ffff is reserved for secure processor */
MMP2_DEVICE(isram, "isram", -1, NONE, 0xd1020000, 0x18000);

struct resource mmp2_resource_gpio[] = {
{
.start = 0xd4019000,
.end = 0xd4019fff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_MMP2_GPIO,
.end = IRQ_MMP2_GPIO,
.flags = IORESOURCE_IRQ,
},
};

struct platform_device mmp2_device_gpio = {
.name = "pxa-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(mmp2_resource_gpio),
.resource = mmp2_resource_gpio,
};
40 changes: 22 additions & 18 deletions trunk/arch/arm/mach-mmp/pxa168.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#include <linux/list.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/platform_device.h>

#include <asm/mach/time.h>
#include <mach/addr-map.h>
#include <mach/cputype.h>
#include <mach/regs-apbc.h>
#include <mach/regs-apmu.h>
#include <mach/irqs.h>
#include <mach/gpio-pxa.h>
#include <mach/dma.h>
#include <mach/devices.h>
#include <mach/mfp.h>
Expand All @@ -43,26 +43,9 @@ static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata =
MFP_ADDR_END,
};

#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 */
Expand All @@ -80,6 +63,7 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0);
static APBC_CLK(ssp3, PXA168_SSP3, 4, 0);
static APBC_CLK(ssp4, PXA168_SSP4, 4, 0);
static APBC_CLK(ssp5, PXA168_SSP5, 4, 0);
static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000);
static APBC_CLK(keypad, PXA168_KPC, 0, 32000);

static APMU_CLK(nand, NAND, 0x19b, 156000000);
Expand All @@ -105,6 +89,7 @@ static struct clk_lookup pxa168_clkregs[] = {
INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"),
Expand Down Expand Up @@ -174,6 +159,25 @@ PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);

struct resource pxa168_resource_gpio[] = {
{
.start = 0xd4019000,
.end = 0xd4019fff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_PXA168_GPIOX,
.end = IRQ_PXA168_GPIOX,
.flags = IORESOURCE_IRQ,
},
};

struct platform_device pxa168_device_gpio = {
.name = "pxa-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(pxa168_resource_gpio),
.resource = pxa168_resource_gpio,
};

struct resource pxa168_usb_host_resources[] = {
/* USB Host conroller register base */
[0] = {
Expand Down
Loading

0 comments on commit ca0dff3

Please sign in to comment.