diff --git a/arch/arm/src/imx6/chip/imx_gpio.h b/arch/arm/src/imx6/chip/imx_gpio.h index f488fc6672..d4fc053e0c 100644 --- a/arch/arm/src/imx6/chip/imx_gpio.h +++ b/arch/arm/src/imx6/chip/imx_gpio.h @@ -141,8 +141,8 @@ /* GPIO interrupt configuration register1/2 */ -#define GPIO_ICR_INDEX(n) ((n) >> 4) -#define GPIO_ICR_OFFSET(n) (GPIO_ICR1_OFFSET + (GPIO_ICR_INDEX(n) << 2)); +#define GPIO_ICR_INDEX(n) (((n) >> 4) & 1) +#define GPIO_ICR_OFFSET(n) (GPIO_ICR1_OFFSET + (GPIO_ICR_INDEX(n) << 2)) #define GPIO_ICR_LOWLEVEL 0 /* Interrupt is low-level sensitive */ #define GPIO_ICR_HIGHLEVEL 1 /* Interrupt is high-level sensitive */ diff --git a/arch/arm/src/imx6/chip/imx_memorymap.h b/arch/arm/src/imx6/chip/imx_memorymap.h index 4b9991a170..08f0d9022e 100644 --- a/arch/arm/src/imx6/chip/imx_memorymap.h +++ b/arch/arm/src/imx6/chip/imx_memorymap.h @@ -181,7 +181,7 @@ #define IMX_CAN1_OFFSET 0x00090000 /* 00090000 00093fff CAN1 16 KB */ #define IMX_CAN2_OFFSET 0x00094000 /* 00094000 00097fff CAN2 16 KB */ #define IMX_GPT_OFFSET 0x00098000 /* 00098000 0009bfff GPT 16 KB */ -#define IMX_GPIO_OFFSET(n) (0x0009c000 - ((n) << 14)) /* n=0..6 */ +#define IMX_GPIO_OFFSET(n) (0x0009c000 + ((n) << 14)) /* n=0..6 */ #define IMX_GPIO1_OFFSET 0x0009c000 /* 0009c000 0009ffff GPIO1 16 KB */ #define IMX_GPIO2_OFFSET 0x000a0000 /* 000a0000 000a3fff GPIO2 16 KB */ #define IMX_GPIO3_OFFSET 0x000a4000 /* 000a4000 000a7fff GPIO3 16 KB */