ARM: mxs: add gpio support for device tree boot
It adds gpio support for device tree boot. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
4052d45e80
commit
ce4c6f9b59
3 changed files with 100 additions and 2 deletions
|
@ -14,6 +14,12 @@
|
||||||
/ {
|
/ {
|
||||||
interrupt-parent = <&icoll>;
|
interrupt-parent = <&icoll>;
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
gpio0 = &gpio0;
|
||||||
|
gpio1 = &gpio1;
|
||||||
|
gpio2 = &gpio2;
|
||||||
|
};
|
||||||
|
|
||||||
cpus {
|
cpus {
|
||||||
cpu@0 {
|
cpu@0 {
|
||||||
compatible = "arm,arm926ejs";
|
compatible = "arm,arm926ejs";
|
||||||
|
@ -74,9 +80,36 @@
|
||||||
pinctrl@80018000 {
|
pinctrl@80018000 {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
compatible = "fsl,imx23-pinctrl";
|
compatible = "fsl,imx23-pinctrl", "simple-bus";
|
||||||
reg = <0x80018000 2000>;
|
reg = <0x80018000 2000>;
|
||||||
|
|
||||||
|
gpio0: gpio@0 {
|
||||||
|
compatible = "fsl,imx23-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <16>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio1: gpio@1 {
|
||||||
|
compatible = "fsl,imx23-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <17>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio2: gpio@2 {
|
||||||
|
compatible = "fsl,imx23-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <18>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
duart_pins_a: duart@0 {
|
duart_pins_a: duart@0 {
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
fsl,pinmux-ids = <0x11a2 0x11b2>;
|
fsl,pinmux-ids = <0x11a2 0x11b2>;
|
||||||
|
|
|
@ -14,6 +14,14 @@
|
||||||
/ {
|
/ {
|
||||||
interrupt-parent = <&icoll>;
|
interrupt-parent = <&icoll>;
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
gpio0 = &gpio0;
|
||||||
|
gpio1 = &gpio1;
|
||||||
|
gpio2 = &gpio2;
|
||||||
|
gpio3 = &gpio3;
|
||||||
|
gpio4 = &gpio4;
|
||||||
|
};
|
||||||
|
|
||||||
cpus {
|
cpus {
|
||||||
cpu@0 {
|
cpu@0 {
|
||||||
compatible = "arm,arm926ejs";
|
compatible = "arm,arm926ejs";
|
||||||
|
@ -97,9 +105,54 @@
|
||||||
pinctrl@80018000 {
|
pinctrl@80018000 {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
compatible = "fsl,imx28-pinctrl";
|
compatible = "fsl,imx28-pinctrl", "simple-bus";
|
||||||
reg = <0x80018000 2000>;
|
reg = <0x80018000 2000>;
|
||||||
|
|
||||||
|
gpio0: gpio@0 {
|
||||||
|
compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <127>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio1: gpio@1 {
|
||||||
|
compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <126>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio2: gpio@2 {
|
||||||
|
compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <125>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio3: gpio@3 {
|
||||||
|
compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <124>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio4: gpio@4 {
|
||||||
|
compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";
|
||||||
|
interrupts = <123>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
};
|
||||||
|
|
||||||
duart_pins_a: duart@0 {
|
duart_pins_a: duart@0 {
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
fsl,pinmux-ids = <0x3102 0x3112>;
|
fsl,pinmux-ids = <0x3102 0x3112>;
|
||||||
|
|
|
@ -30,8 +30,20 @@ static int __init mxs_icoll_add_irq_domain(struct device_node *np,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int __init mxs_gpio_add_irq_domain(struct device_node *np,
|
||||||
|
struct device_node *interrupt_parent)
|
||||||
|
{
|
||||||
|
static int gpio_irq_base = MXS_GPIO_IRQ_START;
|
||||||
|
|
||||||
|
irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, NULL);
|
||||||
|
gpio_irq_base += 32;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct of_device_id mxs_irq_match[] __initconst = {
|
static const struct of_device_id mxs_irq_match[] __initconst = {
|
||||||
{ .compatible = "fsl,mxs-icoll", .data = mxs_icoll_add_irq_domain, },
|
{ .compatible = "fsl,mxs-icoll", .data = mxs_icoll_add_irq_domain, },
|
||||||
|
{ .compatible = "fsl,mxs-gpio", .data = mxs_gpio_add_irq_domain, },
|
||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue