summaryrefslogtreecommitdiff
path: root/target/avr32
diff options
context:
space:
mode:
authorMario Haustein <mario.haustein@hrz.tu-chemnitz.de>2016-10-24 15:03:33 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-25 21:01:51 +0200
commit2607c89848a087c3a582e76b83d1bd3424efcc9c (patch)
tree1dfc3baac0e79e8d4695b3751aefc69cb84967a3 /target/avr32
parentabc999b9ebe36de53c53090c077ae06985de808c (diff)
add grasshopper patches for kernel 4.8.3
Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Diffstat (limited to 'target/avr32')
-rw-r--r--target/avr32/grasshopper/patches/4.8.3/0001-grasshopper.patch900
-rw-r--r--target/avr32/grasshopper/patches/4.8.3/0002-grasshopper-led-pwm.patch118
-rw-r--r--target/avr32/grasshopper/patches/4.8.3/0003-grasshopper-mmc.patch54
-rw-r--r--target/avr32/grasshopper/patches/4.8.3/0004-grasshopper-i2c.patch68
-rw-r--r--target/avr32/grasshopper/patches/4.8.3/0005-grasshopper-usart.patch54
-rw-r--r--target/avr32/grasshopper/patches/4.8.3/0100-netfilter-init-fix.patch120
6 files changed, 1314 insertions, 0 deletions
diff --git a/target/avr32/grasshopper/patches/4.8.3/0001-grasshopper.patch b/target/avr32/grasshopper/patches/4.8.3/0001-grasshopper.patch
new file mode 100644
index 000000000..0fa4535c2
--- /dev/null
+++ b/target/avr32/grasshopper/patches/4.8.3/0001-grasshopper.patch
@@ -0,0 +1,900 @@
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/button.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/button.c
+--- linux-4.7.3/arch/avr32/boards/grasshopper/button.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/button.c 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,55 @@
++/*
++ * init code specific for grasshoppers Buttons
++ *
++ * 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.
++ */
++
++#include <linux/gpio.h>
++#include <linux/gpio_keys.h>
++#include <linux/init.h>
++#include <linux/input.h>
++#include <linux/platform_device.h>
++
++#include <mach/at32ap700x.h>
++#include <mach/board.h>
++#include <mach/init.h>
++#include <mach/portmux.h>
++
++static struct gpio_keys_button grasshopper_buttons_btn[] = {
++ {
++ .gpio = GPIO_PIN_PA(31),
++ .code = BTN_0,
++ .desc = "Button 0",
++ .active_low = 1,
++ .type = EV_KEY,
++ },
++};
++
++static struct gpio_keys_platform_data grasshopper_buttons_data = {
++ .buttons = grasshopper_buttons_btn,
++ .nbuttons = 1,
++};
++
++static struct platform_device grasshopper_buttons = {
++ .name = "gpio-keys",
++ .id = -1,
++ .num_resources = 0,
++ .dev = {
++ .platform_data = &grasshopper_buttons_data,
++ },
++};
++
++static int __init grasshopper_init_buttons(void)
++{
++ int i;
++
++ for (i=0; i<grasshopper_buttons_data.nbuttons;i++) {
++ at32_select_gpio(grasshopper_buttons_btn[i].gpio, AT32_GPIOF_DEGLITCH);
++ }
++
++ platform_device_register(&grasshopper_buttons);
++ return 0;
++}
++arch_initcall(grasshopper_init_buttons);
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/flash.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/flash.c
+--- linux-4.7.3/arch/avr32/boards/grasshopper/flash.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/flash.c 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,101 @@
++/*
++ * GRASSHOPPER board-specific flash initialization
++ *
++ * Copyright (C) 2005-2006 Atmel Corporation
++ *
++ * 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.
++ */
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/mtd/physmap.h>
++
++#include <mach/smc.h>
++
++static struct smc_timing flash_timing __initdata = {
++ .ncs_read_setup = 0,
++ .nrd_setup = 40,
++ .ncs_write_setup = 0,
++ .nwe_setup = 10,
++
++ .ncs_read_pulse = 80,
++ .nrd_pulse = 40,
++ .ncs_write_pulse = 65,
++ .nwe_pulse = 55,
++
++ .read_cycle = 120,
++ .write_cycle = 120,
++};
++
++static struct smc_config flash_config __initdata = {
++ .bus_width = 2,
++ .nrd_controlled = 1,
++ .nwe_controlled = 1,
++ .byte_write = 1,
++};
++
++// To prevent trouble when flashing with Linux, take care that the same values for offsets
++// and lengths are set here and in the file
++// 'buildroot_basedir/project_build_avr32/grasshopper/u-boot-1.3.4/include/configs/grasshopper.h' !!!
++static struct mtd_partition flash_parts[] = {
++ {
++ .name = "u-boot",
++ .offset = 0x00000000,
++ .size = 0x00020000, /* 128 KiB */
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "env", /* 64 KB */
++ .offset = 0x00020000,
++ .size = 0x00010000,
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "root",
++ .offset = 0x00030000,
++ .size = 0x007d0000,
++ },
++};
++
++static struct physmap_flash_data flash_data = {
++ .width = 2,
++ .nr_parts = ARRAY_SIZE(flash_parts),
++ .parts = flash_parts,
++};
++
++static struct resource flash_resource = {
++ .start = 0x00000000,
++ .end = 0x007fffff,
++ .flags = IORESOURCE_MEM,
++};
++
++static struct platform_device flash_device = {
++ .name = "physmap-flash",
++ .id = 0,
++ .resource = &flash_resource,
++ .num_resources = 1,
++ .dev = {
++ .platform_data = &flash_data,
++ },
++};
++
++/* This needs to be called after the SMC has been initialized */
++static int __init grasshopper_flash_init(void)
++{
++ int ret;
++
++ smc_set_timing(&flash_config, &flash_timing);
++ ret = smc_set_configuration(0, &flash_config);
++ if (ret < 0) {
++ printk(KERN_ERR "grasshopper: failed to set NOR flash timing\n");
++ return ret;
++ }
++
++ platform_device_register(&flash_device);
++
++ return 0;
++}
++device_initcall(grasshopper_flash_init);
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,5 @@
++# Grasshopper customization
++
++if BOARD_GRASSHOPPER
++
++endif # BOARD_GRASSHOPPER
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/led.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c
+--- linux-4.7.3/arch/avr32/boards/grasshopper/led.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,155 @@
++/*
++ * init code specific for grasshoppers LEDs
++ *
++ * 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.
++ */
++
++#include <linux/gpio.h>
++#include <linux/init.h>
++#include <linux/leds.h>
++#include <linux/platform_device.h>
++
++#include <mach/at32ap700x.h>
++#include <mach/board.h>
++#include <mach/gpio.h>
++#include <mach/init.h>
++#include <mach/portmux.h>
++
++ // LEDs
++static struct gpio_led grasshopper_led[] = {
++#ifndef CONFIG_BOARD_GRASSHOPPER_PWM0
++ {
++ .name = "pwrled:red",
++ .gpio = GPIO_PIN_PA(22),
++ .active_low = 1,
++ },
++#endif
++ {
++ .name = "led1:green",
++ .gpio = GPIO_PIN_PA(23),
++ .default_trigger = "heartbeat",
++ },
++ {
++ .name = "led2:green",
++ .gpio = GPIO_PIN_PA(24),
++ },
++ {
++ .name = "led3:green",
++ .gpio = GPIO_PIN_PA(25),
++ },
++ {
++ .name = "led4:green",
++ .gpio = GPIO_PIN_PA(26),
++ },
++ {
++ .name = "led5:green",
++ .gpio = GPIO_PIN_PA(27),
++ },
++#ifndef CONFIG_BOARD_GRASSHOPPER_PWM0
++ {
++ .name = "led6:green",
++ .gpio = GPIO_PIN_PA(28),
++ },
++#endif
++#ifndef CONFIG_BOARD_GRASSHOPPER_PWM1
++ {
++ .name = "led7:green",
++ .gpio = GPIO_PIN_PA(29),
++ },
++#endif
++ {
++ .name = "led8:green",
++ .gpio = GPIO_PIN_PA(30),
++ },
++};
++
++static struct gpio_led_platform_data grasshopper_led_data = {
++ .num_leds = ARRAY_SIZE(grasshopper_led),
++ .leds = grasshopper_led,
++};
++
++static struct platform_device grasshopper_led_dev = {
++ .name = "leds-gpio",
++ .dev = {
++ .platform_data = &grasshopper_led_data,
++ },
++};
++
++/* PWM */
++#ifdef CONFIG_LEDS_ATMEL_PWM
++static struct gpio_led pwm_led[] = {
++ /* here the "gpio" is actually a PWM channel */
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM0
++ {
++ .name = "pwm0",
++ .gpio = 0,
++ },
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM1
++ {
++ .name = "pwm1",
++ .gpio = 1,
++ },
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM2
++ {
++ .name = "pwm2",
++ .gpio = 2,
++ },
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM3
++ {
++ .name = "pwm3",
++ .gpio = 3,
++ },
++#endif
++};
++
++static struct gpio_led_platform_data pwm_led_data = {
++ .num_leds = ARRAY_SIZE(pwm_led),
++ .leds = pwm_led,
++};
++
++static struct platform_device pwm_led_dev = {
++ .name = "leds-atmel-pwm",
++ .id = -1,
++ .dev = {
++ .platform_data = &pwm_led_data,
++ },
++};
++#endif
++
++static int __init grasshopper_setup_leds(void)
++{
++ printk("Grasshopper: Setting up %d LEDs\n", grasshopper_led_data.num_leds);
++ //for (i=0; i<grasshopper_led_data.num_leds; i++)
++ // at32_select_gpio(grasshopper_led[i].gpio, AT32_GPIOF_OUTPUT);
++
++ platform_device_register(&grasshopper_led_dev);
++
++#ifdef CONFIG_LEDS_ATMEL_PWM
++ at32_add_device_pwm(0
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM0
++ | (1 << 0)
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM1
++ | (1 << 1)
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM2
++ | (1 << 2)
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_PWM3
++ | (1 << 3)
++#endif
++ );
++
++ printk("Grasshopper: Setting up %d PWMs\n", pwm_led_data.num_leds);
++ platform_device_register(&pwm_led_dev);
++#endif
++
++ return 0;
++}
++
++arch_initcall(grasshopper_setup_leds);
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/mac.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/mac.c
+--- linux-4.7.3/arch/avr32/boards/grasshopper/mac.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/mac.c 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,94 @@
++/*
++ * Init Code for the ethernet interface of the Grasshopper board.
++ *
++ * 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.
++ */
++#include <linux/clk.h>
++#include <linux/etherdevice.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++
++#include <asm/setup.h>
++
++#include <mach/board.h>
++
++/* Initialized by bootloader-specific startup code. */
++struct tag *bootloader_tags __initdata;
++
++/* Ethernet */
++struct eth_addr {
++ u8 addr[6];
++};
++
++static struct eth_addr __initdata hw_addr[1];
++static struct macb_platform_data __initdata eth_data[] = {
++ {
++ .phy_mask = ~(1U << 0),
++ },
++};
++
++/*
++ * The next two functions should go away as the boot loader is
++ * supposed to initialize the macb address registers with a valid
++ * ethernet address. But we need to keep it around for a while until
++ * we can be reasonably sure the boot loader does this.
++ *
++ * The phy_id is ignored as the driver will probe for it.
++ */
++static int __init parse_tag_ethernet(struct tag *tag)
++{
++ int i;
++
++ i = tag->u.ethernet.mac_index;
++ if (i < ARRAY_SIZE(hw_addr))
++ memcpy(hw_addr[i].addr, tag->u.ethernet.hw_address,
++ sizeof(hw_addr[i].addr));
++
++ return 0;
++}
++__tagtable(ATAG_ETHERNET, parse_tag_ethernet);
++
++static void __init set_hw_addr(struct platform_device *pdev)
++{
++ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ const u8 *addr;
++ void __iomem *regs;
++ struct clk *pclk;
++
++ if (!res)
++ return;
++ if (pdev->id >= ARRAY_SIZE(hw_addr))
++ return;
++
++ addr = hw_addr[pdev->id].addr;
++ if (!is_valid_ether_addr(addr))
++ return;
++
++ /*
++ * Since this is board-specific code, we'll cheat and use the
++ * physical address directly as we happen to know that it's
++ * the same as the virtual address.
++ */
++ regs = (void __iomem __force *)res->start;
++ pclk = clk_get(&pdev->dev, "pclk");
++ if (!pclk)
++ return;
++
++ clk_enable(pclk);
++ __raw_writel((addr[3] << 24) | (addr[2] << 16)
++ | (addr[1] << 8) | addr[0], regs + 0x98);
++ __raw_writel((addr[5] << 8) | addr[4], regs + 0x9c);
++ clk_disable(pclk);
++ clk_put(pclk);
++}
++
++static int __init grasshopper_init_mac(void)
++{
++ printk("Grasshopper: Setting up Ethernet\n");
++ set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
++
++ return 0;
++}
++arch_initcall(grasshopper_init_mac);
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Makefile linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Makefile
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Makefile 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,5 @@
++obj-y += button.o
++obj-y += flash.o
++obj-y += led.o
++obj-y += mac.o
++obj-y += setup.o
+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 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-13 11:23:21.454833158 +0200
+@@ -0,0 +1,210 @@
++/*
++ * init code specific for grasshopper
++ *
++ * based on icnova_base.c from in-circuit.de
++ *
++ * 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.
++ */
++#include <linux/clk.h>
++#include <linux/gpio.h>
++#include <linux/irq.h>
++#include <linux/i2c.h>
++#include <linux/i2c-gpio.h>
++#include <linux/init.h>
++#include <linux/linkage.h>
++#include <linux/platform_device.h>
++#include <linux/string.h>
++#include <linux/types.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/ads7846.h>
++#include <linux/spi/at73c213.h>
++#include <linux/input.h>
++#include <linux/gpio_keys.h>
++
++#include <linux/fb.h>
++#include <video/atmel_lcdc.h>
++
++#include <linux/atmel-mci.h>
++#include <asm/io.h>
++#include <asm/setup.h>
++
++#include <mach/at32ap700x.h>
++#include <mach/board.h>
++#include <mach/init.h>
++#include <mach/portmux.h>
++
++#define PIN_TS_EXTINT GPIO_PIN_PA(19)
++
++static struct at73c213_board_info at73c213_data = {
++ .ssc_id = 0,
++ .shortname = "AT73C213 Sound",
++};
++
++static int ads7846_pendown_state(void)
++{
++ // active low!
++ return !gpio_get_value(PIN_TS_EXTINT);
++}
++
++static struct ads7846_platform_data ads_info = {
++ .model = 7846,
++ .vref_delay_usecs = 100,
++ .settle_delay_usecs = 800,
++ .penirq_recheck_delay_usecs = 800,
++ .x_plate_ohms = 750, /* FIXME */
++ .y_plate_ohms = 300, /* FIXME */
++ .pressure_max = 4096,
++ .debounce_max = 1,
++ .debounce_rep = 0,
++ .debounce_tol = (~0),
++ .get_pendown_state = ads7846_pendown_state,
++};
++
++static struct spi_board_info spi0_board_info[] __initdata = {
++ {
++ .modalias = "at73c213",
++ .max_speed_hz = 200000,
++ .chip_select = 1,
++ .mode = SPI_MODE_1,
++ .platform_data = &at73c213_data,
++ },
++ {
++ .modalias = "ads7846",
++ .max_speed_hz = 31250*26,
++ .chip_select = 0,
++ .platform_data = &ads_info,
++ .irq = -1,
++ },
++};
++
++/* Oscillator frequencies. These are board-specific */
++unsigned long at32_board_osc_rates[3] = {
++ [0] = 32768, /* 32.768 kHz on RTC osc */
++ [1] = 20000000, /* 20 MHz on osc0 */
++ [2] = 12000000, /* 12 MHz on osc1 */
++};
++
++/* LCD */
++#ifdef CONFIG_GRASSHOPPER_LCD
++static struct fb_videomode __initdata grasshopper_tft_modes[] = {
++ {
++ .name = "480x272 @ 60Hz",
++ .refresh = 60,
++ .xres = 480, .yres = 272,
++ .pixclock = KHZ2PICOS(9000),
++
++ .left_margin = 2, .right_margin = 2,
++ .upper_margin = 12, .lower_margin = 2,
++ .hsync_len = 41, .vsync_len = 10,
++
++ .sync = 0,
++ .vmode = FB_VMODE_NONINTERLACED,
++ },
++};
++
++static struct fb_monspecs __initdata grasshopper_default_monspecs = {
++ .manufacturer = "SHA",
++ .monitor = "LQ043T3DX02",
++ .modedb = grasshopper_tft_modes,
++ .modedb_len = ARRAY_SIZE(grasshopper_tft_modes),
++ .hfmin = 15000,
++ .hfmax = 30000,
++ .vfmin = 60,
++ .vfmax = 700,
++ .dclkmax = 90000000,
++};
++
++struct atmel_lcdfb_info __initdata grasshopper_lcdc_data = {
++ .default_bpp = 24, // Color depth
++ .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
++ .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
++ | ATMEL_LCDC_PIXELSIZE_24
++ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
++ | ATMEL_LCDC_MEMOR_BIG),
++ .default_monspecs = &grasshopper_default_monspecs,
++ .guard_time = 2,
++ .lcdcon_is_backlight = 1,
++};
++#endif
++
++/* MCI */
++#ifdef CONFIG_MMC_ATMELMCI
++static struct mci_platform_data __initdata mci0_data = {
++ .slot[0] = {
++ .bus_width = 4,
++ .detect_pin = GPIO_PIN_NONE,
++ .wp_pin = GPIO_PIN_NONE,
++ // .detect_pin = GPIO_PIN_PC(14), /* gpio30/sdcd */
++ // .wp_pin = GPIO_PIN_PC(15), /* gpio31/sdwp */
++ }
++};
++#endif
++
++void __init setup_board(void)
++{
++ at32_map_usart(1, 0, 0); // USART 1: /dev/ttyS0, CP2102
++ at32_setup_serial_console(0);
++
++ // grasshopper_add_spi();
++}
++
++static int __init grasshopper_init(void)
++{
++ int i;
++
++ /*
++ * grasshopper uses 32-bit SDRAM interface. Reserve the
++ * SDRAM-specific pins so that nobody messes with them.
++ */
++ at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
++ at32_add_device_usba(0, NULL);
++ at32_add_device_usart(0);
++
++#ifdef CONFIG_GRASSHOPPER_LCD
++ at32_add_device_lcdc(0, &grasshopper_lcdc_data,
++ fbmem_start, fbmem_size,
++ ATMEL_LCDC_PRI_CONTROL | ATMEL_LCDC_PRI_24BIT);
++#endif
++
++#ifdef CONFIG_MMC_ATMELMCI
++// at32_add_device_mci(0, &mci0_data); /* MMC/SD */
++#endif
++
++// printk("registering penirq gpio-pin...\n");
++// at32_select_gpio(PIN_TS_EXTINT, AT32_GPIOF_DEGLITCH);
++// spi0_board_info[1].irq = gpio_to_irq(PIN_TS_EXTINT);
++// printk("done\n");
++
++ //at32_select_periph(PIN_TS_EXTINT, GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
++// printk("registering SSC1 for external DAC...\n");
++// at32_add_device_ssc(0, ATMEL_SSC_TX);
++// printk("registering SPI for touchscreen and sound...\n");
++/*
++ struct clk *gclk;
++ struct clk *pll;
++
++ gclk = clk_get(NULL, "gclk0");
++ if (IS_ERR(gclk)) {
++ printk("failed to get clk gclk0\n");
++ } else {
++ pll = clk_get(NULL, "pll0");
++ if (IS_ERR(pll)) {
++ printk("failed to get clk pll0\n");
++ } else {
++ if (clk_set_parent(gclk, pll)) {
++ printk("failed to set pll0 as parent for DAC clock\n");
++ } else {
++ at32_select_periph(GPIO_PIOA_BASE, (1 << 30), GPIO_PERIPH_A, 0);
++ at73c213_data.dac_clk = gclk;
++ }
++ }
++ }
++*/
++// at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
++// printk("done\n");
++
++ return 0;
++}
++arch_initcall(grasshopper_init);
+diff -Naur linux-4.7.3/arch/avr32/configs/grasshopper_defconfig linux-4.7.3.grasshopper/arch/avr32/configs/grasshopper_defconfig
+--- linux-4.7.3/arch/avr32/configs/grasshopper_defconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.7.3.grasshopper/arch/avr32/configs/grasshopper_defconfig 2016-09-13 11:23:29.341833182 +0200
+@@ -0,0 +1,182 @@
++CONFIG_EXPERIMENTAL=y
++# CONFIG_LOCALVERSION_AUTO is not set
++CONFIG_SYSVIPC=y
++CONFIG_POSIX_MQUEUE=y
++CONFIG_BSD_PROCESS_ACCT=y
++CONFIG_BSD_PROCESS_ACCT_V3=y
++CONFIG_DEFAULT_HOSTNAME="grasshopper"
++CONFIG_LOG_BUF_SHIFT=14
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++CONFIG_BLK_DEV_INITRD=y
++# CONFIG_RD_GZIP is not set
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++# CONFIG_SYSCTL_SYSCALL is not set
++# CONFIG_BASE_FULL is not set
++CONFIG_EMBEDDED=y
++CONFIG_PROFILING=y
++CONFIG_OPROFILE=m
++CONFIG_KPROBES=y
++CONFIG_MODULES=y
++CONFIG_MODULE_UNLOAD=y
++CONFIG_MODULE_FORCE_UNLOAD=y
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_IOSCHED_DEADLINE is not set
++CONFIG_BOARD_GRASSHOPPER=y
++CONFIG_AP700X_32_BIT_SMC=y
++# CONFIG_OWNERSHIP_TRACE is not set
++# CONFIG_SUSPEND is not set
++CONFIG_CPU_FREQ=y
++# CONFIG_CPU_FREQ_STAT is not set
++CONFIG_CPU_FREQ_GOV_USERSPACE=y
++CONFIG_CPU_FREQ_GOV_ONDEMAND=y
++CONFIG_CPU_FREQ_AT32AP=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_NET=y
++CONFIG_PACKET=y
++CONFIG_UNIX=y
++CONFIG_XFRM_USER=y
++CONFIG_NET_KEY=y
++CONFIG_INET=y
++CONFIG_IP_MULTICAST=y
++CONFIG_IP_ADVANCED_ROUTER=y
++CONFIG_IP_PNP=y
++CONFIG_IP_PNP_DHCP=y
++CONFIG_IP_MROUTE=y
++CONFIG_IP_PIMSM_V1=y
++CONFIG_SYN_COOKIES=y
++CONFIG_INET_AH=y
++CONFIG_INET_ESP=y
++CONFIG_INET_IPCOMP=y
++# CONFIG_INET_LRO is not set
++CONFIG_IPV6=y
++CONFIG_INET6_AH=y
++CONFIG_INET6_ESP=y
++CONFIG_INET6_IPCOMP=y
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++# CONFIG_PREVENT_FIRMWARE_BUILD is not set
++# CONFIG_FW_LOADER is not set
++CONFIG_MTD=y
++CONFIG_MTD_CMDLINE_PARTS=y
++CONFIG_MTD_CHAR=y
++CONFIG_MTD_BLKDEVS=y
++CONFIG_MTD_BLOCK=y
++CONFIG_MTD_CFI=y
++CONFIG_MTD_JEDECPROBE=y
++CONFIG_MTD_GEN_PROBE=y
++CONFIG_MTD_CFI_AMDSTD=y
++CONFIG_MTD_RAM=y
++CONFIG_MTD_PHYSMAP=y
++CONFIG_MTD_UBI=y
++CONFIG_MTD_UBI_WL_THRESHOLD=4096
++CONFIG_MTD_UBI_BEB_RESERVE=1
++CONFIG_MTD_DATAFLASH=m
++CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
++CONFIG_BLK_DEV=y
++CONFIG_BLK_DEV_LOOP=y
++CONFIG_BLK_DEV_NBD=y
++CONFIG_BLK_DEV_RAM=y
++CONFIG_MISC_DEVICES=y
++CONFIG_ATMEL_PWM=y
++CONFIG_ATMEL_TCLIB=y
++CONFIG_ATMEL_SSC=y
++CONFIG_NETDEVICES=y
++CONFIG_TUN=m
++CONFIG_MARVELL_PHY=y
++CONFIG_DAVICOM_PHY=y
++CONFIG_NET_ETHERNET=y
++CONFIG_MACB=y
++# CONFIG_NETDEV_1000 is not set
++# CONFIG_NETDEV_10000 is not set
++CONFIG_INPUT_EVDEV=y
++# CONFIG_KEYBOARD_ATKBD is not set
++CONFIG_KEYBOARD_GPIO=y
++CONFIG_MOUSE_GPIO=y
++CONFIG_INPUT_TOUCHSCREEN=y
++CONFIG_TOUCHSCREEN_ADS7846=y
++# CONFIG_SERIO_I8042 is not set
++# CONFIG_SERIO_SERPORT is not set
++CONFIG_SERIO_AT32PSIF=y
++# CONFIG_LEGACY_PTYS is not set
++CONFIG_SERIAL_ATMEL=y
++CONFIG_SERIAL_ATMEL_CONSOLE=y
++# CONFIG_HW_RANDOM is not set
++CONFIG_I2C=m
++CONFIG_I2C_CHARDEV=m
++CONFIG_I2C_GPIO=m
++CONFIG_SPI=y
++CONFIG_SPI_ATMEL=y
++CONFIG_SPI_SPIDEV=m
++CONFIG_GPIO_SYSFS=y
++# CONFIG_HWMON is not set
++CONFIG_WATCHDOG=y
++CONFIG_AT32AP700X_WDT=y
++CONFIG_FB=y
++CONFIG_FB_ATMEL=y
++CONFIG_BACKLIGHT_LCD_SUPPORT=y
++CONFIG_LCD_CLASS_DEVICE=y
++CONFIG_LCD_PLATFORM=y
++CONFIG_BACKLIGHT_CLASS_DEVICE=y
++CONFIG_BACKLIGHT_ATMEL_LCDC=y
++# CONFIG_BACKLIGHT_GENERIC is not set
++CONFIG_LOGO=y
++CONFIG_SOUND=y
++CONFIG_SND=y
++CONFIG_SND_AT73C213=y
++# CONFIG_USB_SUPPORT is not set
++CONFIG_MMC=y
++CONFIG_MMC_SDHCI=y
++CONFIG_MMC_ATMELMCI=y
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++CONFIG_LEDS_GPIO=y
++CONFIG_LEDS_TRIGGERS=y
++CONFIG_LEDS_TRIGGER_TIMER=y
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++CONFIG_LEDS_TRIGGER_GPIO=y
++CONFIG_RTC_CLASS=y
++CONFIG_RTC_DRV_AT32AP700X=y
++CONFIG_DMADEVICES=y
++CONFIG_EXT2_FS=y
++CONFIG_EXT3_FS=y
++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
++# CONFIG_EXT3_FS_XATTR is not set
++# CONFIG_DNOTIFY is not set
++CONFIG_FUSE_FS=m
++CONFIG_MSDOS_FS=m
++CONFIG_VFAT_FS=m
++CONFIG_FAT_DEFAULT_CODEPAGE=850
++CONFIG_TMPFS=y
++CONFIG_CONFIGFS_FS=m
++CONFIG_JFFS2_FS=y
++CONFIG_JFFS2_FS_WRITEBUFFER=y
++CONFIG_JFFS2_FS_WBUF_VERIFY=y
++CONFIG_JFFS2_COMPRESSION_OPTIONS=y
++CONFIG_JFFS2_ZLIB=y
++CONFIG_JFFS2_LZO=y
++CONFIG_JFFS2_RTIME=y
++CONFIG_JFFS2_RUBIN=y
++CONFIG_JFFS2_CMODE_PRIORITY=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++CONFIG_ROOT_NFS=y
++CONFIG_NFSD=m
++CONFIG_NFSD_V3=y
++CONFIG_CIFS=m
++CONFIG_NLS=y
++CONFIG_NLS_CODEPAGE_437=y
++CONFIG_NLS_CODEPAGE_1250=y
++CONFIG_NLS_ASCII=y
++CONFIG_NLS_ISO8859_1=y
++CONFIG_NLS_ISO8859_15=y
++CONFIG_NLS_UTF8=y
++CONFIG_MAGIC_SYSRQ=y
++CONFIG_DEBUG_FS=y
++CONFIG_DEBUG_KERNEL=y
++CONFIG_DETECT_HUNG_TASK=y
++CONFIG_FRAME_POINTER=y
++CONFIG_CRYPTO_PCBC=m
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRC_CCITT=m
++CONFIG_CRC_ITU_T=m
++CONFIG_CRC7=m
+diff -Naur linux-4.7.3/arch/avr32/include/asm/kprobes.h linux-4.7.3.grasshopper/arch/avr32/include/asm/kprobes.h
+--- linux-4.7.3/arch/avr32/include/asm/kprobes.h 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/include/asm/kprobes.h 2016-09-13 11:23:21.455833158 +0200
+@@ -40,6 +40,19 @@
+ char jprobes_stack[MAX_STACK_SIZE];
+ };
+
++struct prev_kprobe {
++ struct kprobe *kp;
++ unsigned int status;
++};
++
++/* per-cpu kprobe control block */
++struct kprobe_ctlblk {
++ unsigned int kprobe_status;
++ struct prev_kprobe prev_kprobe;
++ struct pt_regs jprobe_saved_regs;
++ char jprobes_stack[MAX_STACK_SIZE];
++};
++
+ extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
+ extern int kprobe_exceptions_notify(struct notifier_block *self,
+ unsigned long val, void *data);
+diff -Naur linux-4.7.3/arch/avr32/Kconfig linux-4.7.3.grasshopper/arch/avr32/Kconfig
+--- linux-4.7.3/arch/avr32/Kconfig 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/Kconfig 2016-09-13 11:23:21.455833158 +0200
+@@ -156,6 +156,15 @@
+ config BOARD_MIMC200
+ bool "MIMC200 CPU board"
+ select CPU_AT32AP7000
++
++config BOARD_GRASSHOPPER
++ bool "Grasshopper Board"
++ select CPU_AT32AP7000
++ help
++ Grasshopper is the Nickname of the AVR32-based ICNova
++ AP7000 base board that is distributed by IN-Circuit.
++
++ For more information see: http://www.ic-board.de/
+ endchoice
+
+ source "arch/avr32/boards/atstk1000/Kconfig"
+@@ -163,6 +172,7 @@
+ source "arch/avr32/boards/hammerhead/Kconfig"
+ source "arch/avr32/boards/favr-32/Kconfig"
+ source "arch/avr32/boards/merisc/Kconfig"
++source "arch/avr32/boards/grasshopper/Kconfig"
+
+ choice
+ prompt "Boot loader type"
+diff -Naur linux-4.7.3/arch/avr32/Makefile linux-4.7.3.grasshopper/arch/avr32/Makefile
+--- linux-4.7.3/arch/avr32/Makefile 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/Makefile 2016-09-13 11:23:21.455833158 +0200
+@@ -37,6 +37,7 @@
+ core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/
+ core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/
+ core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/
++core-$(CONFIG_BOARD_GRASSHOPPER) += arch/avr32/boards/grasshopper/
+ core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
+ core-y += arch/avr32/kernel/
+ core-y += arch/avr32/mm/
diff --git a/target/avr32/grasshopper/patches/4.8.3/0002-grasshopper-led-pwm.patch b/target/avr32/grasshopper/patches/4.8.3/0002-grasshopper-led-pwm.patch
new file mode 100644
index 000000000..977c91523
--- /dev/null
+++ b/target/avr32/grasshopper/patches/4.8.3/0002-grasshopper-led-pwm.patch
@@ -0,0 +1,118 @@
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-21 17:42:47.405315973 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-21 18:02:11.184236423 +0200
+@@ -2,4 +2,37 @@
+
+ if BOARD_GRASSHOPPER
+
++config BOARD_GRASSHOPPER_LEDS
++ bool "Enable LED1 through 8"
++ depends on NEW_LEDS
++ depends on LEDS_GPIO
++ default y
++ help
++ Enabling this option will provide access to the LED trough
++ Linux LED API.
++
++config BOARD_GRASSHOPPER_PWM0
++ bool "Enable PWM0"
++ depends on PWM_ATMEL
++ depends on BOARD_GRASSHOPPER_LEDS
++ default n
++ help
++ Enabling PWM channel 0 will exclude LED6 from LED API.
++
++config BOARD_GRASSHOPPER_PWM1
++ bool "Enable PWM1"
++ depends on PWM_ATMEL
++ depends on BOARD_GRASSHOPPER_LEDS
++ default n
++ help
++ Enabling PWM channel 1 will exclude LED7 from LED API.
++
++config BOARD_GRASSHOPPER_PWM3
++ bool "Enable PWM3"
++ depends on PWM_ATMEL
++ depends on BOARD_GRASSHOPPER_LEDS
++ default n
++ help
++ Enabling PWM channel 3 will exclude the power LED from LED API.
++
+ endif # BOARD_GRASSHOPPER
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/led.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c
+--- linux-4.7.3/arch/avr32/boards/grasshopper/led.c 2016-09-21 17:42:47.405315973 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c 2016-09-21 17:43:33.144940844 +0200
+@@ -19,7 +19,7 @@
+
+ // LEDs
+ static struct gpio_led grasshopper_led[] = {
+-#ifndef CONFIG_BOARD_GRASSHOPPER_PWM0
++#ifndef CONFIG_BOARD_GRASSHOPPER_PWM3
+ {
+ .name = "pwrled:red",
+ .gpio = GPIO_PIN_PA(22),
+@@ -78,7 +78,7 @@
+ };
+
+ /* PWM */
+-#ifdef CONFIG_LEDS_ATMEL_PWM
++#ifdef CONFIG_PWM_ATMEL
+ static struct gpio_led pwm_led[] = {
+ /* here the "gpio" is actually a PWM channel */
+ #ifdef CONFIG_BOARD_GRASSHOPPER_PWM0
+@@ -93,12 +93,6 @@
+ .gpio = 1,
+ },
+ #endif
+-#ifdef CONFIG_BOARD_GRASSHOPPER_PWM2
+- {
+- .name = "pwm2",
+- .gpio = 2,
+- },
+-#endif
+ #ifdef CONFIG_BOARD_GRASSHOPPER_PWM3
+ {
+ .name = "pwm3",
+@@ -123,13 +117,15 @@
+
+ static int __init grasshopper_setup_leds(void)
+ {
++ unsigned int i;
++
+ printk("Grasshopper: Setting up %d LEDs\n", grasshopper_led_data.num_leds);
+- //for (i=0; i<grasshopper_led_data.num_leds; i++)
+- // at32_select_gpio(grasshopper_led[i].gpio, AT32_GPIOF_OUTPUT);
++ for (i=0; i<grasshopper_led_data.num_leds; i++)
++ at32_select_gpio(grasshopper_led[i].gpio, AT32_GPIOF_OUTPUT);
+
+ platform_device_register(&grasshopper_led_dev);
+
+-#ifdef CONFIG_LEDS_ATMEL_PWM
++#ifdef CONFIG_PWM_ATMEL
+ at32_add_device_pwm(0
+ #ifdef CONFIG_BOARD_GRASSHOPPER_PWM0
+ | (1 << 0)
+@@ -137,9 +133,6 @@
+ #ifdef CONFIG_BOARD_GRASSHOPPER_PWM1
+ | (1 << 1)
+ #endif
+-#ifdef CONFIG_BOARD_GRASSHOPPER_PWM2
+- | (1 << 2)
+-#endif
+ #ifdef CONFIG_BOARD_GRASSHOPPER_PWM3
+ | (1 << 3)
+ #endif
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Makefile linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Makefile
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Makefile 2016-09-21 17:42:47.405315973 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Makefile 2016-09-21 17:43:04.042543262 +0200
+@@ -1,5 +1,5 @@
+-obj-y += button.o
+-obj-y += flash.o
+-obj-y += led.o
+-obj-y += mac.o
+-obj-y += setup.o
++obj-y += button.o
++obj-y += flash.o
++obj-$(CONFIG_BOARD_GRASSHOPPER_LEDS) += led.o
++obj-y += mac.o
++obj-y += setup.o
diff --git a/target/avr32/grasshopper/patches/4.8.3/0003-grasshopper-mmc.patch b/target/avr32/grasshopper/patches/4.8.3/0003-grasshopper-mmc.patch
new file mode 100644
index 000000000..f87d4731b
--- /dev/null
+++ b/target/avr32/grasshopper/patches/4.8.3/0003-grasshopper-mmc.patch
@@ -0,0 +1,54 @@
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:22:36.665693605 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:22:45.803816861 +0200
+@@ -34,4 +34,14 @@
+ help
+ Enabling PWM channel 3 will exclude the power LED from LED API.
+
++config BOARD_GRASSHOPPER_MMC
++ bool "Enable MMC slot"
++ depends on MMC_ATMELMCI
++ default n
++
++config BOARD_GRASSHOPPER_MMCLED
++ bool "Show MMC acces on LED8"
++ depends on BOARD_GRASSHOPPER_MMC
++ default n
++
+ endif # BOARD_GRASSHOPPER
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/led.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c
+--- linux-4.7.3/arch/avr32/boards/grasshopper/led.c 2016-09-20 11:17:36.448644161 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c 2016-09-20 11:25:30.690040822 +0200
+@@ -62,6 +62,9 @@
+ {
+ .name = "led8:green",
+ .gpio = GPIO_PIN_PA(30),
++#ifdef CONFIG_BOARD_GRASSHOPPER_MMCLED
++ .default_trigger = "mmc0",
++#endif
+ },
+ };
+
+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-20 10:32:24.571984951 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-20 11:23:52.197712372 +0200
+@@ -130,7 +130,7 @@
+ #endif
+
+ /* MCI */
+-#ifdef CONFIG_MMC_ATMELMCI
++#ifdef CONFIG_BOARD_GRASSHOPPER_MMC
+ static struct mci_platform_data __initdata mci0_data = {
+ .slot[0] = {
+ .bus_width = 4,
+@@ -168,8 +168,8 @@
+ ATMEL_LCDC_PRI_CONTROL | ATMEL_LCDC_PRI_24BIT);
+ #endif
+
+-#ifdef CONFIG_MMC_ATMELMCI
+-// at32_add_device_mci(0, &mci0_data); /* MMC/SD */
++#ifdef CONFIG_BOARD_GRASSHOPPER_MMC
++ at32_add_device_mci(0, &mci0_data); /* MMC/SD */
+ #endif
+
+ // printk("registering penirq gpio-pin...\n");
diff --git a/target/avr32/grasshopper/patches/4.8.3/0004-grasshopper-i2c.patch b/target/avr32/grasshopper/patches/4.8.3/0004-grasshopper-i2c.patch
new file mode 100644
index 000000000..b0796ed5a
--- /dev/null
+++ b/target/avr32/grasshopper/patches/4.8.3/0004-grasshopper-i2c.patch
@@ -0,0 +1,68 @@
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:29:35.780351249 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:39:58.981762577 +0200
+@@ -44,4 +44,9 @@
+ depends on BOARD_GRASSHOPPER_MMC
+ default n
+
++config BOARD_GRASSHOPPER_I2C
++ bool "Enable I2C interface"
++ depends on I2C && I2C_GPIO
++ default y
++
+ endif # BOARD_GRASSHOPPER
+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-20 11:29:35.781351262 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-20 11:32:21.270587433 +0200
+@@ -129,6 +129,28 @@
+ };
+ #endif
+
++/* I2C/TWI */
++#ifdef CONFIG_BOARD_GRASSHOPPER_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_BOARD_GRASSHOPPER_MMC
+ 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_BOARD_GRASSHOPPER_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_BOARD_GRASSHOPPER_MMC
+ at32_add_device_mci(0, &mci0_data); /* MMC/SD */
+ #endif
diff --git a/target/avr32/grasshopper/patches/4.8.3/0005-grasshopper-usart.patch b/target/avr32/grasshopper/patches/4.8.3/0005-grasshopper-usart.patch
new file mode 100644
index 000000000..448647c29
--- /dev/null
+++ b/target/avr32/grasshopper/patches/4.8.3/0005-grasshopper-usart.patch
@@ -0,0 +1,54 @@
+diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig
+--- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:43:03.645251779 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:58:20.129642638 +0200
+@@ -49,4 +49,21 @@
+ depends on I2C && I2C_GPIO
+ default y
+
++config BOARD_GRASSHOPPER_USART0
++ bool "Enable USART0"
++ depends on SERIAL_ATMEL_PDC
++ default n
++ help
++ USART0 is mapped to /dev/ttyS1 (or /dev/ttyAT1 resp.) and available via
++ connector J6 and J13.
++
++config BOARD_GRASSHOPPER_USART1
++ bool "Enable USART1 (CP2102 USB-Interface)"
++ depends on SERIAL_ATMEL_PDC
++ default y
++ help
++ USART1 is mapped to /dev/ttyS0 (or /dev/ttyAT0 resp.) and available via
++ the CP2002 USB-USART-bridge. If you disable this option, you won't be
++ able to access the serial console, so it is recommended to say 'y' here.
++
+ endif # BOARD_GRASSHOPPER
+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-20 11:43:03.646251793 +0200
++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-20 12:03:04.864496603 +0200
+@@ -166,7 +166,12 @@
+
+ void __init setup_board(void)
+ {
++#ifdef CONFIG_BOARD_GRASSHOPPER_USART1
+ at32_map_usart(1, 0, 0); // USART 1: /dev/ttyS0, CP2102
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_USART0
++ at32_map_usart(0, 1, 0); // USART 0: /dev/ttyS1
++#endif
+ at32_setup_serial_console(0);
+
+ // grasshopper_add_spi();
+@@ -182,7 +187,12 @@
+ */
+ at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
+ at32_add_device_usba(0, NULL);
++#ifdef CONFIG_BOARD_GRASSHOPPER_USART1
+ at32_add_device_usart(0);
++#endif
++#ifdef CONFIG_BOARD_GRASSHOPPER_USART0
++ at32_add_device_usart(1);
++#endif
+
+ #ifdef CONFIG_GRASSHOPPER_LCD
+ at32_add_device_lcdc(0, &grasshopper_lcdc_data,
diff --git a/target/avr32/grasshopper/patches/4.8.3/0100-netfilter-init-fix.patch b/target/avr32/grasshopper/patches/4.8.3/0100-netfilter-init-fix.patch
new file mode 100644
index 000000000..9d80e8b53
--- /dev/null
+++ b/target/avr32/grasshopper/patches/4.8.3/0100-netfilter-init-fix.patch
@@ -0,0 +1,120 @@
+diff -Naur linux-4.7.3/net/ipv4/netfilter/iptable_filter.c linux-4.7.3.new/net/ipv4/netfilter/iptable_filter.c
+--- linux-4.7.3/net/ipv4/netfilter/iptable_filter.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv4/netfilter/iptable_filter.c 2016-09-20 17:34:57.000156904 +0200
+@@ -25,7 +25,7 @@
+ (1 << NF_INET_LOCAL_OUT))
+ static int __net_init iptable_filter_table_init(struct net *net);
+
+-static const struct xt_table packet_filter = {
++static const struct xt_table __net_initconst packet_filter = {
+ .name = "filter",
+ .valid_hooks = FILTER_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv4/netfilter/iptable_mangle.c linux-4.7.3.new/net/ipv4/netfilter/iptable_mangle.c
+--- linux-4.7.3/net/ipv4/netfilter/iptable_mangle.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv4/netfilter/iptable_mangle.c 2016-09-20 17:35:04.360257550 +0200
+@@ -30,7 +30,7 @@
+
+ static int __net_init iptable_mangle_table_init(struct net *net);
+
+-static const struct xt_table packet_mangler = {
++static const struct xt_table __net_initconst packet_mangler = {
+ .name = "mangle",
+ .valid_hooks = MANGLE_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv4/netfilter/iptable_nat.c linux-4.7.3.new/net/ipv4/netfilter/iptable_nat.c
+--- linux-4.7.3/net/ipv4/netfilter/iptable_nat.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv4/netfilter/iptable_nat.c 2016-09-20 17:35:11.847359932 +0200
+@@ -20,7 +20,7 @@
+
+ static int __net_init iptable_nat_table_init(struct net *net);
+
+-static const struct xt_table nf_nat_ipv4_table = {
++static const struct xt_table __net_initconst nf_nat_ipv4_table = {
+ .name = "nat",
+ .valid_hooks = (1 << NF_INET_PRE_ROUTING) |
+ (1 << NF_INET_POST_ROUTING) |
+diff -Naur linux-4.7.3/net/ipv4/netfilter/iptable_raw.c linux-4.7.3.new/net/ipv4/netfilter/iptable_raw.c
+--- linux-4.7.3/net/ipv4/netfilter/iptable_raw.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv4/netfilter/iptable_raw.c 2016-09-20 17:35:18.424449870 +0200
+@@ -12,7 +12,7 @@
+
+ static int __net_init iptable_raw_table_init(struct net *net);
+
+-static const struct xt_table packet_raw = {
++static const struct xt_table __net_initconst packet_raw = {
+ .name = "raw",
+ .valid_hooks = RAW_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv4/netfilter/iptable_security.c linux-4.7.3.new/net/ipv4/netfilter/iptable_security.c
+--- linux-4.7.3/net/ipv4/netfilter/iptable_security.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv4/netfilter/iptable_security.c 2016-09-20 17:35:28.232583992 +0200
+@@ -30,7 +30,7 @@
+
+ static int __net_init iptable_security_table_init(struct net *net);
+
+-static const struct xt_table security_table = {
++static const struct xt_table __net_initconst security_table = {
+ .name = "security",
+ .valid_hooks = SECURITY_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv6/netfilter/ip6table_filter.c linux-4.7.3.new/net/ipv6/netfilter/ip6table_filter.c
+--- linux-4.7.3/net/ipv6/netfilter/ip6table_filter.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv6/netfilter/ip6table_filter.c 2016-09-20 17:34:01.580392165 +0200
+@@ -24,7 +24,7 @@
+
+ static int __net_init ip6table_filter_table_init(struct net *net);
+
+-static const struct xt_table packet_filter = {
++static const struct xt_table __net_initconst packet_filter = {
+ .name = "filter",
+ .valid_hooks = FILTER_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv6/netfilter/ip6table_mangle.c linux-4.7.3.new/net/ipv6/netfilter/ip6table_mangle.c
+--- linux-4.7.3/net/ipv6/netfilter/ip6table_mangle.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv6/netfilter/ip6table_mangle.c 2016-09-20 17:34:08.893493248 +0200
+@@ -25,7 +25,7 @@
+
+ static int __net_init ip6table_mangle_table_init(struct net *net);
+
+-static const struct xt_table packet_mangler = {
++static const struct xt_table __net_initconst packet_mangler = {
+ .name = "mangle",
+ .valid_hooks = MANGLE_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv6/netfilter/ip6table_nat.c linux-4.7.3.new/net/ipv6/netfilter/ip6table_nat.c
+--- linux-4.7.3/net/ipv6/netfilter/ip6table_nat.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv6/netfilter/ip6table_nat.c 2016-09-20 17:34:15.294581725 +0200
+@@ -22,7 +22,7 @@
+
+ static int __net_init ip6table_nat_table_init(struct net *net);
+
+-static const struct xt_table nf_nat_ipv6_table = {
++static const struct xt_table __net_initconst nf_nat_ipv6_table = {
+ .name = "nat",
+ .valid_hooks = (1 << NF_INET_PRE_ROUTING) |
+ (1 << NF_INET_POST_ROUTING) |
+diff -Naur linux-4.7.3/net/ipv6/netfilter/ip6table_raw.c linux-4.7.3.new/net/ipv6/netfilter/ip6table_raw.c
+--- linux-4.7.3/net/ipv6/netfilter/ip6table_raw.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv6/netfilter/ip6table_raw.c 2016-09-20 17:34:22.939687395 +0200
+@@ -11,7 +11,7 @@
+
+ static int __net_init ip6table_raw_table_init(struct net *net);
+
+-static const struct xt_table packet_raw = {
++static const struct xt_table __net_initconst packet_raw = {
+ .name = "raw",
+ .valid_hooks = RAW_VALID_HOOKS,
+ .me = THIS_MODULE,
+diff -Naur linux-4.7.3/net/ipv6/netfilter/ip6table_security.c linux-4.7.3.new/net/ipv6/netfilter/ip6table_security.c
+--- linux-4.7.3/net/ipv6/netfilter/ip6table_security.c 2016-09-07 08:35:12.000000000 +0200
++++ linux-4.7.3.new/net/ipv6/netfilter/ip6table_security.c 2016-09-20 17:34:30.348789803 +0200
+@@ -29,7 +29,7 @@
+
+ static int __net_init ip6table_security_table_init(struct net *net);
+
+-static const struct xt_table security_table = {
++static const struct xt_table __net_initconst security_table = {
+ .name = "security",
+ .valid_hooks = SECURITY_VALID_HOOKS,
+ .me = THIS_MODULE,