diff --git a/mote/v2/openwrt/patches/300-set_AR2315_RESET_GPIO_to_6.patch b/mote/v2/openwrt/patches/300-set_AR2315_RESET_GPIO_to_6.patch new file mode 100644 index 0000000..84c1c3b --- /dev/null +++ b/mote/v2/openwrt/patches/300-set_AR2315_RESET_GPIO_to_6.patch @@ -0,0 +1,11 @@ +--- a/arch/mips/include/asm/mach-ar231x/ar2315_regs.h ++++ b/arch/mips/include/asm/mach-ar231x/ar2315_regs.h +@@ -301,7 +301,7 @@ + #define AR2315_GPIO_INT_LVL_HIGH 2 /* High Level Triggered */ + #define AR2315_GPIO_INT_LVL_EDGE 3 /* Edge Triggered */ + +-#define AR2315_RESET_GPIO 5 ++#define AR2315_RESET_GPIO 6 + #define AR2315_NUM_GPIO 22 + + /* diff --git a/mote/v2/openwrt/patches/310-hotplug_button_jiffies_calc.patch b/mote/v2/openwrt/patches/310-hotplug_button_jiffies_calc.patch new file mode 100644 index 0000000..5112f19 --- /dev/null +++ b/mote/v2/openwrt/patches/310-hotplug_button_jiffies_calc.patch @@ -0,0 +1,27 @@ +--- a/arch/mips/ar231x/reset.c ++++ b/arch/mips/ar231x/reset.c +@@ -19,6 +19,7 @@ + struct work_struct wq; + int set; + unsigned long jiffies; ++ unsigned long jiffies_prev; + }; + + static struct timer_list rst_button_timer; +@@ -68,7 +69,7 @@ + add_msg(skb, "SUBSYSTEM=button"); + add_msg(skb, "BUTTON=reset"); + add_msg(skb, (event->set ? "ACTION=pressed" : "ACTION=released")); +- sprintf(buf, "SEEN=%ld", (event->jiffies - seen)/HZ); ++ sprintf(buf, "SEEN=%lu", (event->jiffies - event->jiffies_prev)/HZ); + add_msg(skb, buf); + snprintf(buf, 128, "SEQNUM=%llu", uevent_next_seqnum()); + add_msg(skb, buf); +@@ -127,6 +128,7 @@ + no_release_workaround = 0; + + event->jiffies = jiffies; ++ event->jiffies_prev = seen; + + INIT_WORK(&event->wq, hotplug_button); + schedule_work(&event->wq); diff --git a/mote/v2/openwrt/patches/400-spi_gpio_support.patch b/mote/v2/openwrt/patches/400-spi_gpio_support.patch new file mode 100644 index 0000000..8ac1bf9 --- /dev/null +++ b/mote/v2/openwrt/patches/400-spi_gpio_support.patch @@ -0,0 +1,82 @@ +--- a/arch/mips/ar231x/ar2315.c 2010-08-07 10:15:11.696355750 +0200 ++++ b/arch/mips/ar231x/ar2315.c 2010-08-07 10:33:47.588393782 +0200 +@@ -36,6 +36,11 @@ + #include "devices.h" + #include "ar2315.h" + ++/* BVDM 04/06/2010 */ ++#include ++#include ++#include ++ + static u32 gpiointmask = 0, gpiointval = 0; + + static inline void ar2315_gpio_irq(void) +@@ -398,6 +403,37 @@ + .name = "ar2315_wdt", + }; + ++/* BVDM 04/06/2010 */ ++#define SPI_GPIO_SCK 3 ++#define SPI_GPIO_MOSI 1 ++#define SPI_GPIO_MISO 2 ++ ++static struct spi_gpio_platform_data ar2315_spi_gpio_platform_data = { ++ .sck = SPI_GPIO_SCK, ++ .mosi = SPI_GPIO_MOSI, ++ .miso = SPI_GPIO_MISO, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device ar2315_spi_gpio = { ++ .name = "spi_gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &ar2315_spi_gpio_platform_data, ++ }, ++}; ++ ++static struct spi_board_info ar2315_spi_gpio_board_info[] __initdata = { ++{ ++ .modalias = "spidev", ++ .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT, ++ .mode = SPI_MODE_0, ++ .max_speed_hz = 16000000, /* 16kHz */ ++ .bus_num = 0, ++}, ++}; ++ ++ + #define SPI_FLASH_CTL 0x00 + #define SPI_FLASH_OPCODE 0x04 + #define SPI_FLASH_DATA 0x08 +@@ -520,6 +556,7 @@ + } + ar2315_led_data.num_leds = led; + platform_device_register(&ar2315_gpio_leds); ++ platform_device_register(&ar2315_spi_gpio); + } + #else + static inline void ar2315_init_gpio(void) +@@ -530,6 +567,8 @@ + int __init + ar2315_init_devices(void) + { ++ int ret; ++ + if (!is_2315()) + return 0; + +@@ -544,6 +583,12 @@ + &ar2315_eth_data); + ar231x_add_wmac(0, AR2315_WLAN0, AR2315_IRQ_WLAN0_INTRS); + ++ /* BVDM 04/06/2010 */ ++ platform_device_register(&ar2315_spi_gpio); ++ ret = spi_register_board_info(ar2315_spi_gpio_board_info, ARRAY_SIZE(ar2315_spi_gpio_board_info)); ++ /* debugging */ ++ printk(KERN_DEBUG "spi_register_board_info return value: %x\n", ret); ++ + return 0; + } + diff --git a/mote/v2/openwrt/patches/410-spi_gpio_enable_cs_line.patch b/mote/v2/openwrt/patches/410-spi_gpio_enable_cs_line.patch new file mode 100644 index 0000000..5d961bf --- /dev/null +++ b/mote/v2/openwrt/patches/410-spi_gpio_enable_cs_line.patch @@ -0,0 +1,19 @@ +--- a/arch/mips/ar231x/ar2315.c 2010-08-08 15:52:43.005477443 +0200 ++++ b/arch/mips/ar231x/ar2315.c 2010-08-08 15:56:06.009475860 +0200 +@@ -407,6 +407,7 @@ + #define SPI_GPIO_SCK 3 + #define SPI_GPIO_MOSI 2 + #define SPI_GPIO_MISO 1 ++#define SPI_GPIO_CS 4 + + static struct spi_gpio_platform_data ar2315_spi_gpio_platform_data = { + .sck = SPI_GPIO_SCK, +@@ -426,7 +427,7 @@ + static struct spi_board_info ar2315_spi_gpio_board_info[] __initdata = { + { + .modalias = "spidev", +- .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT, ++ .controller_data = (void *) SPI_GPIO_CS, + .mode = SPI_MODE_0, + .max_speed_hz = 10000000, /* 10kHz */ + .bus_num = 0, diff --git a/mote/v2/openwrt/patches/900-disable_console.patch b/mote/v2/openwrt/patches/900-disable_console.patch new file mode 100644 index 0000000..9f6426e --- /dev/null +++ b/mote/v2/openwrt/patches/900-disable_console.patch @@ -0,0 +1,13 @@ +Index: target/linux/generic-2.6/config-2.6.30 +=================================================================== +--- target/linux/generic-2.6/config-2.6.30 (revision 23099) ++++ target/linux/generic-2.6/config-2.6.30 (working copy) +@@ -1964,7 +1964,7 @@ + # CONFIG_SENSORS_W83793 is not set + # CONFIG_SENSORS_W83L785TS is not set + # CONFIG_SENSORS_W83L786NG is not set +-CONFIG_SERIAL_8250_CONSOLE=y ++# CONFIG_SERIAL_8250_CONSOLE is not set + # CONFIG_SERIAL_8250_CS is not set + CONFIG_SERIAL_8250_NR_UARTS=2 + # CONFIG_SERIAL_8250_PCI is not set diff --git a/mote/v2/openwrt/patches/910-set_ttyS0_baud_to_115200.patch b/mote/v2/openwrt/patches/910-set_ttyS0_baud_to_115200.patch new file mode 100644 index 0000000..59e98e1 --- /dev/null +++ b/mote/v2/openwrt/patches/910-set_ttyS0_baud_to_115200.patch @@ -0,0 +1,13 @@ +Index: target/linux/atheros/config-2.6.30 +=================================================================== +--- target/linux/atheros/config-2.6.30 (revision 23099) ++++ target/linux/atheros/config-2.6.30 (working copy) +@@ -21,7 +21,7 @@ + # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set + CONFIG_CEVT_R4K=y + CONFIG_CEVT_R4K_LIB=y +-CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2" ++CONFIG_CMDLINE="console=ttyS0,4800 rootfstype=squashfs,jffs2" + # CONFIG_COMPAT_NET_DEV_OPS is not set + CONFIG_CPU_BIG_ENDIAN=y + # CONFIG_CPU_CAVIUM_OCTEON is not set