From 6e44f102241565a4ada14edb6ff006979b221a80 Mon Sep 17 00:00:00 2001 From: Mario Haustein Date: Wed, 21 Sep 2016 18:44:07 +0200 Subject: reorganized AVR32 Grasshopper kernel patches --- .../4.7.3/0002-grasshopper-enable-mmc.patch | 12 ----- .../4.7.3/0003-grasshopper-enable-i2c-gpio.patch | 55 ---------------------- .../patches/4.7.3/0003-grasshopper-mmc.patch | 12 +++++ .../patches/4.7.3/0004-grasshopper-i2c.patch | 55 ++++++++++++++++++++++ 4 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-enable-mmc.patch delete mode 100644 target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-enable-i2c-gpio.patch create mode 100644 target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-mmc.patch create mode 100644 target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch (limited to 'target') diff --git a/target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-enable-mmc.patch b/target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-enable-mmc.patch deleted file mode 100644 index 88bf498b7..000000000 --- a/target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-enable-mmc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c ---- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-14 10:48:53.403638569 +0200 -+++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-14 11:26:49.572343447 +0200 -@@ -169,7 +169,7 @@ - #endif - - #ifdef CONFIG_MMC_ATMELMCI --// at32_add_device_mci(0, &mci0_data); /* MMC/SD */ -+ at32_add_device_mci(0, &mci0_data); /* MMC/SD */ - #endif - - // printk("registering penirq gpio-pin...\n"); diff --git a/target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-enable-i2c-gpio.patch b/target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-enable-i2c-gpio.patch deleted file mode 100644 index da81cac3a..000000000 --- a/target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-enable-i2c-gpio.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c ---- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-14 10:48:53.403638569 +0200 -+++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-14 11:40:15.735513299 +0200 -@@ -129,6 +129,28 @@ - }; - #endif - -+/* I2C/TWI */ -+#ifdef CONFIG_I2C -+static struct i2c_gpio_platform_data i2c_gpio_data = { -+ .sda_pin = GPIO_PIN_PA(6), -+ .scl_pin = GPIO_PIN_PA(7), -+ .sda_is_open_drain = 1, -+ .scl_is_open_drain = 1, -+ .udelay = 2, /* close to 100 kHz */ -+}; -+ -+static struct platform_device i2c_gpio_device = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &i2c_gpio_data, -+ }, -+}; -+ -+static struct i2c_board_info i2c_info[] = { -+}; -+#endif -+ - /* MCI */ - #ifdef CONFIG_MMC_ATMELMCI - static struct mci_platform_data __initdata mci0_data = { -@@ -168,6 +190,22 @@ - ATMEL_LCDC_PRI_CONTROL | ATMEL_LCDC_PRI_24BIT); - #endif - -+ // I2C / TWI -+#ifdef CONFIG_I2C -+ /* all these i2c/smbus pins should have external pullups for -+ * open-drain sharing among all I2C devices. SDA and SCL do; -+ * PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus), -+ * but it's not available off-board. -+ */ -+ at32_select_periph(GPIO_PIOB_BASE, 1 << 28, 0, AT32_GPIOF_PULLUP); -+ at32_select_gpio(i2c_gpio_data.sda_pin, -+ AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); -+ at32_select_gpio(i2c_gpio_data.scl_pin, -+ AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); -+ platform_device_register(&i2c_gpio_device); -+ i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); -+#endif -+ - #ifdef CONFIG_MMC_ATMELMCI - // at32_add_device_mci(0, &mci0_data); /* MMC/SD */ - #endif diff --git a/target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-mmc.patch b/target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-mmc.patch new file mode 100644 index 000000000..88bf498b7 --- /dev/null +++ b/target/avr32/grasshopper/patches/4.7.3/0003-grasshopper-mmc.patch @@ -0,0 +1,12 @@ +diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c +--- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-14 10:48:53.403638569 +0200 ++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-14 11:26:49.572343447 +0200 +@@ -169,7 +169,7 @@ + #endif + + #ifdef CONFIG_MMC_ATMELMCI +-// at32_add_device_mci(0, &mci0_data); /* MMC/SD */ ++ at32_add_device_mci(0, &mci0_data); /* MMC/SD */ + #endif + + // printk("registering penirq gpio-pin...\n"); diff --git a/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch b/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch new file mode 100644 index 000000000..da81cac3a --- /dev/null +++ b/target/avr32/grasshopper/patches/4.7.3/0004-grasshopper-i2c.patch @@ -0,0 +1,55 @@ +diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c +--- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-14 10:48:53.403638569 +0200 ++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-14 11:40:15.735513299 +0200 +@@ -129,6 +129,28 @@ + }; + #endif + ++/* I2C/TWI */ ++#ifdef CONFIG_I2C ++static struct i2c_gpio_platform_data i2c_gpio_data = { ++ .sda_pin = GPIO_PIN_PA(6), ++ .scl_pin = GPIO_PIN_PA(7), ++ .sda_is_open_drain = 1, ++ .scl_is_open_drain = 1, ++ .udelay = 2, /* close to 100 kHz */ ++}; ++ ++static struct platform_device i2c_gpio_device = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &i2c_gpio_data, ++ }, ++}; ++ ++static struct i2c_board_info i2c_info[] = { ++}; ++#endif ++ + /* MCI */ + #ifdef CONFIG_MMC_ATMELMCI + static struct mci_platform_data __initdata mci0_data = { +@@ -168,6 +190,22 @@ + ATMEL_LCDC_PRI_CONTROL | ATMEL_LCDC_PRI_24BIT); + #endif + ++ // I2C / TWI ++#ifdef CONFIG_I2C ++ /* all these i2c/smbus pins should have external pullups for ++ * open-drain sharing among all I2C devices. SDA and SCL do; ++ * PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus), ++ * but it's not available off-board. ++ */ ++ at32_select_periph(GPIO_PIOB_BASE, 1 << 28, 0, AT32_GPIOF_PULLUP); ++ at32_select_gpio(i2c_gpio_data.sda_pin, ++ AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); ++ at32_select_gpio(i2c_gpio_data.scl_pin, ++ AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); ++ platform_device_register(&i2c_gpio_device); ++ i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); ++#endif ++ + #ifdef CONFIG_MMC_ATMELMCI + // at32_add_device_mci(0, &mci0_data); /* MMC/SD */ + #endif -- cgit v1.2.3