o Enable GPIO device driver for i.MX6.
It was originally written for i.MX5 and compatible with newer chip. o Extend device tree information o style(9) fixes Discussed with: ian
This commit is contained in:
parent
a127e581c5
commit
e18aa9229a
@ -82,6 +82,9 @@ device miibus # Required for ethernet
|
||||
device bpf # Berkeley packet filter (required for DHCP)
|
||||
#device iomux # IO Multiplexor
|
||||
|
||||
# General-purpose input/output
|
||||
device gpio
|
||||
|
||||
# Serial (COM) ports
|
||||
device uart # Multi-uart driver
|
||||
|
||||
|
@ -26,6 +26,7 @@ arm/freescale/imx/imx6_mp.c optional smp
|
||||
arm/freescale/imx/imx6_pl310.c standard
|
||||
arm/freescale/imx/imx_machdep.c standard
|
||||
arm/freescale/imx/imx_gpt.c standard
|
||||
arm/freescale/imx/imx51_gpio.c optional gpio
|
||||
|
||||
#
|
||||
# Optional devices.
|
||||
@ -50,8 +51,6 @@ arm/freescale/imx/imx6_usbphy.c optional ehci
|
||||
# Not ready yet...
|
||||
#
|
||||
#arm/freescale/imx/imx51_iomux.c optional iomux
|
||||
#arm/freescale/imx/imx51_gpio.c optional gpio
|
||||
#dev/ata/chipsets/ata-fsl.c optional imxata
|
||||
#arm/freescale/imx/i2c.c optional fsliic
|
||||
#arm/freescale/imx/imx51_ipuv3.c optional sc
|
||||
|
||||
|
@ -102,6 +102,13 @@ struct imx51_gpio_softc {
|
||||
struct gpio_pin gpio_pins[NGPIO];
|
||||
};
|
||||
|
||||
static struct ofw_compat_data compat_data[] = {
|
||||
{"fsl,imx6q-gpio", 1},
|
||||
{"fsl,imx53-gpio", 1},
|
||||
{"fsl,imx51-gpio", 1},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
static struct resource_spec imx_gpio_spec[] = {
|
||||
{ SYS_RES_MEMORY, 0, RF_ACTIVE },
|
||||
{ SYS_RES_IRQ, 0, RF_ACTIVE },
|
||||
@ -373,9 +380,8 @@ imx51_gpio_probe(device_t dev)
|
||||
if (!ofw_bus_status_okay(dev))
|
||||
return (ENXIO);
|
||||
|
||||
if (ofw_bus_is_compatible(dev, "fsl,imx51-gpio") ||
|
||||
ofw_bus_is_compatible(dev, "fsl,imx53-gpio")) {
|
||||
device_set_desc(dev, "i.MX515 GPIO Controller");
|
||||
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) {
|
||||
device_set_desc(dev, "Freescale i.MX GPIO Controller");
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,20 @@
|
||||
interrupts = <119 120>;
|
||||
};
|
||||
|
||||
/* System Reset Controller */
|
||||
src: src@4006E000 {
|
||||
compatible = "fsl,imx6-src";
|
||||
reg = <0x020D8000 0x100>;
|
||||
};
|
||||
|
||||
sdma: sdma@020ec000 {
|
||||
compatible = "fsl,imx6q-sdma";
|
||||
reg = <0x020ec000 0x4000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <34>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
anatop: anatop@020c8000 {
|
||||
compatible = "fsl,imx6q-anatop";
|
||||
reg = <0x020c8000 0x1000>;
|
||||
@ -115,81 +129,89 @@
|
||||
interrupt-parent = <&gic>; interrupts = <87>;
|
||||
};
|
||||
|
||||
// iomux@73fa8000 {
|
||||
// compatible = "fsl,imx51-iomux";
|
||||
// reg = <0x73fa8000 0x4000>;
|
||||
// interrupt-parent = <&gic>; interrupts = <7>;
|
||||
// status = "disabled";
|
||||
// };
|
||||
iomux@020e0000 {
|
||||
compatible = "fsl,imx6q-iomux";
|
||||
reg = <0x020e0000 0x4000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <32>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio1: gpio@0209c000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x0209c000 0x4000>;
|
||||
interrupts = <0 66 0x04 0 67 0x04>;
|
||||
interrupts = < 98 99 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio2: gpio@020a0000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x020a0000 0x4000>;
|
||||
interrupts = <0 68 0x04 0 69 0x04>;
|
||||
interrupts = < 100 101 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio3: gpio@020a4000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x020a4000 0x4000>;
|
||||
interrupts = <0 70 0x04 0 71 0x04>;
|
||||
interrupts = < 102 103 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio4: gpio@020a8000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x020a8000 0x4000>;
|
||||
interrupts = <0 72 0x04 0 73 0x04>;
|
||||
interrupts = < 104 105 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio5: gpio@020ac000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x020ac000 0x4000>;
|
||||
interrupts = <0 74 0x04 0 75 0x04>;
|
||||
interrupts = < 106 107 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio6: gpio@020b0000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x020b0000 0x4000>;
|
||||
interrupts = <0 76 0x04 0 77 0x04>;
|
||||
interrupts = < 108 109 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio7: gpio@020b4000 {
|
||||
compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
|
||||
reg = <0x020b4000 0x4000>;
|
||||
interrupts = <0 78 0x04 0 79 0x04>;
|
||||
interrupts = < 110 111 >;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
uart1: serial@02020000 {
|
||||
@ -251,6 +273,61 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ecspi1: ecspi@02008000 {
|
||||
compatible = "fsl,imx6q-ecspi";
|
||||
reg = <0x02008000 0x4000>;
|
||||
interrupts = < 63 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ecspi2: ecspi@0200C000 {
|
||||
compatible = "fsl,imx6q-ecspi";
|
||||
reg = <0x0200C000 0x4000>;
|
||||
interrupts = < 64 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ecspi3: ecspi@02010000 {
|
||||
compatible = "fsl,imx6q-ecspi";
|
||||
reg = <0x02010000 0x4000>;
|
||||
interrupts = < 65 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ecspi4: ecspi@02014000 {
|
||||
compatible = "fsl,imx6q-ecspi";
|
||||
reg = <0x02014000 0x4000>;
|
||||
interrupts = < 66 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ecspi5: ecspi@02018000 {
|
||||
compatible = "fsl,imx6q-ecspi";
|
||||
reg = <0x02018000 0x4000>;
|
||||
interrupts = < 67 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ssi1: ssi@02028000 {
|
||||
compatible = "fsl,imx6q-ssi";
|
||||
reg = <0x02028000 0x4000>;
|
||||
interrupts = < 78 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ssi2: ssi@0202C000 {
|
||||
compatible = "fsl,imx6q-ssi";
|
||||
reg = <0x0202C000 0x4000>;
|
||||
interrupts = < 79 >;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ssi3: ssi@02030000 {
|
||||
compatible = "fsl,imx6q-ssi";
|
||||
reg = <0x02030000 0x4000>;
|
||||
interrupts = < 80 >;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
aips@02100000 { /* AIPS2 */
|
||||
@ -352,6 +429,12 @@
|
||||
compatible = "fsl,imx6q-ocotp";
|
||||
reg = <0x021bc000 0x4000>;
|
||||
};
|
||||
|
||||
audmux: audmux@021d8000 {
|
||||
compatible = "fsl,imx6q-audmux";
|
||||
reg = <0x021d8000 0x4000>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -44,11 +44,14 @@
|
||||
|
||||
SOC: soc@00000000 {
|
||||
aips@02000000 { /* AIPS1 */
|
||||
// iomux@73fa8000 { status = "disabled"; };
|
||||
// gpio@0209C000 { status = "disabled"; };
|
||||
// gpio@020A0000 { status = "disabled"; };
|
||||
// gpio@020A4000 { status = "disabled"; };
|
||||
// gpio@020A8000 { status = "disabled"; };
|
||||
iomux@020e0000 { status = "disabled"; };
|
||||
gpio@0209c000 { status = "okay"; };
|
||||
gpio@020a0000 { status = "okay"; };
|
||||
gpio@020a4000 { status = "okay"; };
|
||||
gpio@020a8000 { status = "okay"; };
|
||||
gpio@020aC000 { status = "okay"; };
|
||||
gpio@020b0000 { status = "okay"; };
|
||||
gpio@020b4000 { status = "okay"; };
|
||||
console:serial@02020000 { status = "okay"; };
|
||||
serial@021e8000 { status = "disabled"; };
|
||||
serial@021ec000 { status = "disabled"; };
|
||||
|
@ -44,11 +44,14 @@
|
||||
|
||||
SOC: soc@00000000 {
|
||||
aips@02000000 { /* AIPS1 */
|
||||
// iomux@73fa8000 { status = "disabled"; };
|
||||
// gpio@0209C000 { status = "disabled"; };
|
||||
// gpio@020A0000 { status = "disabled"; };
|
||||
// gpio@020A4000 { status = "disabled"; };
|
||||
// gpio@020A8000 { status = "disabled"; };
|
||||
iomux@020e0000 { status = "disabled"; };
|
||||
gpio@0209c000 { status = "okay"; };
|
||||
gpio@020a0000 { status = "okay"; };
|
||||
gpio@020a4000 { status = "okay"; };
|
||||
gpio@020a8000 { status = "okay"; };
|
||||
gpio@020aC000 { status = "okay"; };
|
||||
gpio@020b0000 { status = "okay"; };
|
||||
gpio@020b4000 { status = "okay"; };
|
||||
console:serial@02020000 { status = "okay"; };
|
||||
serial@021e8000 { status = "disabled"; };
|
||||
serial@021ec000 { status = "disabled"; };
|
||||
|
@ -44,11 +44,14 @@
|
||||
|
||||
SOC: soc@00000000 {
|
||||
aips@02000000 { /* AIPS1 */
|
||||
// iomux@73fa8000 { status = "disabled"; };
|
||||
// gpio@0209C000 { status = "disabled"; };
|
||||
// gpio@020A0000 { status = "disabled"; };
|
||||
// gpio@020A4000 { status = "disabled"; };
|
||||
// gpio@020A8000 { status = "disabled"; };
|
||||
iomux@020e0000 { status = "disabled"; };
|
||||
gpio@0209c000 { status = "okay"; };
|
||||
gpio@020a0000 { status = "okay"; };
|
||||
gpio@020a4000 { status = "okay"; };
|
||||
gpio@020a8000 { status = "okay"; };
|
||||
gpio@020aC000 { status = "okay"; };
|
||||
gpio@020b0000 { status = "okay"; };
|
||||
gpio@020b4000 { status = "okay"; };
|
||||
console:serial@02020000 { status = "okay"; };
|
||||
serial@021e8000 { status = "disabled"; };
|
||||
serial@021ec000 { status = "disabled"; };
|
||||
|
Loading…
Reference in New Issue
Block a user