Skip to content

Commit

Permalink
Merge branch 'armsoc/pxa' of git://github.com/hzhuang1/linux into nex…
Browse files Browse the repository at this point in the history
…t/boards

A series dealing with gpio configuration cleanup from Haojian Zhuang.

* 'armsoc/pxa' of git://github.com/hzhuang1/linux:
  ARM: pxa: move debug uart code
  ARM: pxa: select PXA935 on saar & tavorevb
  ARM: mmp: add more compatible names in gpio driver
  ARM: pxa: move PXA_GPIO_TO_IRQ macro
  ARM: pxa: remove cpu_is_xxx in gpio driver

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Apr 11, 2013
2 parents 6702815 + 0a43cd3 commit 70384d3
Show file tree
Hide file tree
Showing 37 changed files with 302 additions and 141 deletions.
7 changes: 5 additions & 2 deletions Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
* Marvell PXA GPIO controller

Required properties:
- compatible : Should be "mrvl,pxa-gpio" or "mrvl,mmp-gpio"
- compatible : Should be "intel,pxa25x-gpio", "intel,pxa26x-gpio",
"intel,pxa27x-gpio", "intel,pxa3xx-gpio",
"marvell,pxa93x-gpio", "marvell,mmp-gpio" or
"marvell,mmp2-gpio".
- reg : Address and length of the register set for the device
- interrupts : Should be the port interrupt shared by all gpio pins.
There're three gpio interrupts in arch-pxa, and they're gpio0,
Expand All @@ -18,7 +21,7 @@ Required properties:
Example:

gpio: gpio@d4019000 {
compatible = "mrvl,mmp-gpio";
compatible = "marvell,mmp-gpio";
reg = <0xd4019000 0x1000>;
interrupts = <49>;
interrupt-name = "gpio_mux";
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ choice
Say Y here if you want kernel low-level debugging support
on PicoXcell based platforms.

config DEBUG_PXA_UART1
depends on ARCH_PXA
bool "Use PXA UART1 for low-level debug"
help
Say Y here if you want kernel low-level debugging support
on PXA UART1.

config DEBUG_REALVIEW_STD_PORT
bool "RealView Default UART"
depends on ARCH_REALVIEW
Expand Down Expand Up @@ -593,6 +600,8 @@ config DEBUG_LL_INCLUDE
default "debug/mvebu.S" if DEBUG_MVEBU_UART
default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \
DEBUG_MMP_UART3
default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/mmp2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
};

gpio@d4019000 {
compatible = "mrvl,mmp-gpio";
compatible = "marvell,mmp2-gpio";
#address-cells = <1>;
#size-cells = <1>;
reg = <0xd4019000 0x1000>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/pxa168.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
};

gpio@d4019000 {
compatible = "mrvl,mmp-gpio";
compatible = "marvell,mmp-gpio";
#address-cells = <1>;
#size-cells = <1>;
reg = <0xd4019000 0x1000>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/pxa910.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
};

gpio@d4019000 {
compatible = "mrvl,mmp-gpio";
compatible = "marvell,mmp-gpio";
#address-cells = <1>;
#size-cells = <1>;
reg = <0xd4019000 0x1000>;
Expand Down
33 changes: 33 additions & 0 deletions arch/arm/include/debug/pxa.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Early serial output macro for Marvell PXA/MMP SoC
*
* Copyright (C) 1994-1999 Russell King
* Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
*
* Copyright (C) 2013 Haojian Zhuang
*
* 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.
*/

#if defined(CONFIG_DEBUG_PXA_UART1)
#define PXA_UART_REG_PHYS_BASE 0x40100000
#define PXA_UART_REG_VIRT_BASE 0xf2100000
#elif defined(CONFIG_DEBUG_MMP_UART2)
#define PXA_UART_REG_PHYS_BASE 0xd4017000
#define PXA_UART_REG_VIRT_BASE 0xfe017000
#elif defined(CONFIG_DEBUG_MMP_UART3)
#define PXA_UART_REG_PHYS_BASE 0xd4018000
#define PXA_UART_REG_VIRT_BASE 0xfe018000
#else
#error "Select uart for DEBUG_LL"
#endif

.macro addruart, rp, rv, tmp
ldr \rp, =PXA_UART_REG_PHYS_BASE
ldr \rv, =PXA_UART_REG_VIRT_BASE
.endm

#define UART_SHIFT 2
#include <asm/hardware/debug-8250.S>
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/aspenite.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* publishhed by the Free Software Foundation.
*/
#include <linux/gpio.h>
#include <linux/gpio-pxa.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -110,6 +111,10 @@ static unsigned long common_pin_config[] __initdata = {
GPIO121_KP_MKIN4,
};

static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
.irq_base = MMP_GPIO_TO_IRQ(0),
};

static struct smc91x_platdata smc91x_info = {
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
};
Expand Down Expand Up @@ -248,6 +253,8 @@ 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_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
sizeof(struct pxa_gpio_platform_data));
platform_device_register(&pxa168_device_gpio);

/* off-chip devices */
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/avengers_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/gpio-pxa.h>
#include <linux/platform_device.h>

#include <asm/mach-types.h>
Expand All @@ -32,12 +33,18 @@ static unsigned long avengers_lite_pin_config_V16F[] __initdata = {
GPIO89_UART2_RXD,
};

static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
.irq_base = MMP_GPIO_TO_IRQ(0),
};

static void __init avengers_lite_init(void)
{
mfp_config(ARRAY_AND_SIZE(avengers_lite_pin_config_V16F));

/* on-chip devices */
pxa168_add_uart(2);
platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
sizeof(struct pxa_gpio_platform_data));
platform_device_register(&pxa168_device_gpio);
}

Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/brownstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/gpio-pxa.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/max8649.h>
#include <linux/regulator/fixed.h>
Expand Down Expand Up @@ -104,6 +105,10 @@ static unsigned long brownstone_pin_config[] __initdata = {
GPIO89_GPIO,
};

static struct pxa_gpio_platform_data mmp2_gpio_pdata = {
.irq_base = MMP_GPIO_TO_IRQ(0),
};

static struct regulator_consumer_supply max8649_supply[] = {
REGULATOR_SUPPLY("vcc_core", NULL),
};
Expand Down Expand Up @@ -202,6 +207,8 @@ static void __init brownstone_init(void)
/* on-chip devices */
mmp2_add_uart(1);
mmp2_add_uart(3);
platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata,
sizeof(struct pxa_gpio_platform_data));
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 */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/clock-mmp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,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_gpio, "mmp2-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
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/clock-pxa168.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,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_gpio, "mmp-gpio", NULL),
INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"),
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/clock-pxa910.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static struct clk_lookup pxa910_clkregs[] = {
INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
INIT_CLKREG(&clk_gpio, "mmp-gpio", NULL),
INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"),
INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
};
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/flint.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/smc91x.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/gpio-pxa.h>
#include <linux/interrupt.h>

#include <asm/mach-types.h>
Expand Down Expand Up @@ -77,6 +78,10 @@ static unsigned long flint_pin_config[] __initdata = {
GPIO160_ND_RDY1,
};

static struct pxa_gpio_platform_data mmp2_gpio_pdata = {
.irq_base = MMP_GPIO_TO_IRQ(0),
};

static struct smc91x_platdata flint_smc91x_info = {
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
};
Expand Down Expand Up @@ -111,6 +116,8 @@ static void __init flint_init(void)
/* on-chip devices */
mmp2_add_uart(1);
mmp2_add_uart(2);
platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata,
sizeof(struct pxa_gpio_platform_data));
platform_device_register(&mmp2_device_gpio);

/* off-chip devices */
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/gplugd.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio-pxa.h>

#include <asm/mach/arch.h>
#include <asm/mach-types.h>
Expand Down Expand Up @@ -128,6 +129,10 @@ static unsigned long gplugd_pin_config[] __initdata = {
GPIO116_I2S_TXD
};

static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
.irq_base = MMP_GPIO_TO_IRQ(0),
};

static struct i2c_board_info gplugd_i2c_board_info[] = {
{
.type = "isl1208",
Expand Down Expand Up @@ -186,6 +191,8 @@ static void __init gplugd_init(void)
pxa168_add_uart(3);
pxa168_add_ssp(1);
pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
sizeof(struct pxa_gpio_platform_data));
platform_device_register(&pxa168_device_gpio);

pxa168_add_eth(&gplugd_eth_platform_data);
Expand Down
30 changes: 0 additions & 30 deletions arch/arm/mach-mmp/include/mach/debug-macro.S

This file was deleted.

8 changes: 8 additions & 0 deletions arch/arm/mach-mmp/jasper.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/gpio-pxa.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/regulator/machine.h>
Expand Down Expand Up @@ -99,6 +100,10 @@ static unsigned long jasper_pin_config[] __initdata = {
GPIO151_MMC3_CLK,
};

static struct pxa_gpio_platform_data mmp2_gpio_pdata = {
.irq_base = MMP_GPIO_TO_IRQ(0),
};

static struct regulator_consumer_supply max8649_supply[] = {
REGULATOR_SUPPLY("vcc_core", NULL),
};
Expand Down Expand Up @@ -165,6 +170,9 @@ static void __init jasper_init(void)
mmp2_add_uart(1);
mmp2_add_uart(3);
mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info));
platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata,
sizeof(struct pxa_gpio_platform_data));
platform_device_register(&mmp2_device_gpio);
mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */

regulator_has_full_constraints();
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-mmp/mmp-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL),
OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL),
OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL),
OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
{}
};
Expand All @@ -39,7 +39,7 @@ static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL),
OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL),
OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL),
OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
{}
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/mmp2-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4016000, "pxa2xx-uart.3", NULL),
OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL),
OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp2-gpio", NULL),
OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
{}
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/mmp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct resource mmp2_resource_gpio[] = {
};

struct platform_device mmp2_device_gpio = {
.name = "pxa-gpio",
.name = "mmp2-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(mmp2_resource_gpio),
.resource = mmp2_resource_gpio,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/pxa168.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct resource pxa168_resource_gpio[] = {
};

struct platform_device pxa168_device_gpio = {
.name = "pxa-gpio",
.name = "mmp-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(pxa168_resource_gpio),
.resource = pxa168_resource_gpio,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/pxa910.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct resource pxa910_resource_gpio[] = {
};

struct platform_device pxa910_device_gpio = {
.name = "pxa-gpio",
.name = "mmp-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(pxa910_resource_gpio),
.resource = pxa910_resource_gpio,
Expand Down
Loading

0 comments on commit 70384d3

Please sign in to comment.