--- a/arch/mips/lantiq/machtypes.h
+++ b/arch/mips/lantiq/machtypes.h
@@ -43,6 +43,7 @@ enum lantiq_mach_type {
 	LANTIQ_MACH_ARV752DPW,		/* Arcor easybox a802 */
 	LANTIQ_MACH_ARV752DPW22,	/* Arcor easybox a803 */
 	LANTIQ_MACH_ARV7518PW,		/* ASTORIA */
+	LANTIQ_MACH_ARV7510PW,          /* Elisa kotiboksi */
 
 	/* Netgear */
 	LANTIQ_MACH_DGN3500B,		/* Netgear DGN3500 */
--- a/arch/mips/lantiq/xway/mach-arv.c
+++ b/arch/mips/lantiq/xway/mach-arv.c
@@ -15,6 +15,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/input.h>
+#include <linux/if_ether.h>
 #include <linux/etherdevice.h>
 #include <linux/ath5k_platform.h>
 #include <linux/ath9k_platform.h>
@@ -385,6 +386,51 @@ arv7525pw_gpio_keys[] __initdata = {
 	},
 };
 
+static struct gpio_led
+arv7510pw_gpio_leds[] __initdata = {
+	{ .name = "soc:blue:power", .gpio = 221, },
+	{ .name = "soc:red:power", .gpio = 220, },
+	{ .name = "soc:blue:lan1", .gpio = 219, },
+	{ .name = "soc:blue:lan2", .gpio = 218, },
+	{ .name = "soc:blue:lan3", .gpio = 217, },
+	{ .name = "soc:blue:lan4", .gpio = 216, },
+	{ .name = "soc:blue:wlan", .gpio = 215, },
+	{ .name = "soc:blue:adsl", .gpio = 214, },
+	{ .name = "soc:blue:internet", .gpio = 213, },
+	{ .name = "soc:red:internet", .gpio = 212, },
+	{ .name = "soc:blue:voip", .gpio = 211, },
+	{ .name = "soc:blue:phone1", .gpio = 210, },
+	{ .name = "soc:blue:phone2", .gpio = 209, },
+	{ .name = "soc:blue:usb1", .gpio = 208, },
+	{ .name = "soc:blue:usb2", .gpio = 207, },
+	{ .name = "soc:blue:usb3", .gpio = 206, },
+	{ .name = "soc:blue:unlabeled", .gpio = 205, },
+
+	/* These are clearly connected somewhere, but I don't know where.
+	{ .name = "soc:unknown:out1", .gpio = 200, },
+	{ .name = "soc:unknown:out2", .gpio = 223, },*/
+};
+
+static struct gpio_keys_button
+arv7510pw_gpio_keys[] __initdata = {
+	{
+		.desc		= "wlan",
+		.type		= EV_KEY,
+		.code		= BTN_0,
+		.debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= 14,
+		.active_low	= 1,
+	},
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= BTN_1,
+		.debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= 3,
+		.active_low	= 1,
+	},
+};
+
 static void __init
 arv_load_nor(unsigned int max)
 {
@@ -418,6 +464,43 @@ arv_load_nor(unsigned int max)
 	ltq_register_nor(&arv_flash_data);
 }
 
+/* ARV7510PW has an erasesize of 128k, so I had to make a new version of arv_load_nor. */
+
+static void __init
+arv_load_nor_erasesize(unsigned int max, unsigned int erasesize)
+{
+#define UBOOT_MAGIC     0x27051956
+
+        int i;
+        int sector = -1;
+
+        if (ltq_brn_boot) {
+                if (max == 0x800000)
+                        ltq_register_nor(&arv75xx_brnboot_flash_data);
+                else
+                        ltq_register_nor(&arv45xx_brnboot_flash_data);
+                return;
+        }
+
+        for (i = 1; i < 4 && sector < 0; i++) {
+                unsigned int uboot_magic;
+                memcpy_fromio(&uboot_magic, (void *)KSEG1ADDR(LTQ_FLASH_START) + (i * erasesize), 4);
+                if (uboot_magic == UBOOT_MAGIC)
+                        sector = i;
+        }
+
+        if (sector < 0)
+                return;
+
+        arv_partitions[0].size = arv_partitions[1].offset = (sector - 1) * erasesize;
+	arv_partitions[1].size = erasesize;
+        arv_partitions[2].offset = arv_partitions[0].size + erasesize;
+        arv_partitions[2].size = max - arv_partitions[2].offset - erasesize;
+        arv_partitions[3].offset = max - erasesize;
+	arv_partitions[3].size = erasesize;
+        ltq_register_nor(&arv_flash_data);
+}
+
 static void __init
 arv_register_ethernet(unsigned int mac_addr)
 {
@@ -426,6 +509,19 @@ arv_register_ethernet(unsigned int mac_a
 	ltq_register_etop(&ltq_eth_data);
 }
 
+static u8 ltq_ethaddr[6] = { 0 };
+
+/* The original bootloader is locked and won't load OpenWrt. I have installed
+   u-boot, and pass the correct mac address as a boot argument. This is for parsing it. */
+
+static int __init setup_ethaddr(char *str)
+{
+	if (!mac_pton(str, ltq_ethaddr))
+		memset(ltq_ethaddr, 0, 6);
+	return 0;
+}
+__setup("ethaddr=", setup_ethaddr);
+
 static u16 arv_ath5k_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
 static u16 arv_ath9k_eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
 static u8 arv_athxk_eeprom_mac[6];
@@ -791,3 +887,29 @@ MIPS_MACHINE(LANTIQ_MACH_ARV752DPW,
 			"ARV752DPW",
 			"ARV752DPW - Arcor A802",
 			arv752dpw_init);
+
+static void __init
+arv7510pw_init(void)
+{
+	arv_load_nor_erasesize(0x1000000, 0x20000);
+	ltq_register_gpio_stp();
+	ltq_pci_data.gpio |= PCI_REQ2 | PCI_GNT2 | PCI_EXIN1 | PCI_EXIN2;
+	ltq_pci_data.irq[12] = INT_NUM_IM3_IRL0 + 31;
+	ltq_pci_data.irq[15] = INT_NUM_IM1_IRL0 + 26;
+	ltq_register_pci(&ltq_pci_data);
+	ltq_register_tapi();
+	ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv7510pw_gpio_leds), arv7510pw_gpio_leds);
+	ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv7510pw_gpio_keys), arv7510pw_gpio_keys);
+	ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_RMII;
+	if (!is_valid_ether_addr(ltq_ethaddr)) {
+		printk(KERN_INFO "MAC invalid using random\n");
+		random_ether_addr(ltq_ethaddr);
+	}
+	memcpy(&ltq_eth_data.mac.sa_data, ltq_ethaddr, 6);
+	ltq_register_etop(&ltq_eth_data);
+}
+
+MIPS_MACHINE(LANTIQ_MACH_ARV7510PW,
+			"ARV7510PW",
+			"ARV7510PW - Elisa kotiboksi",
+			arv7510pw_init);
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -40,7 +40,7 @@
 /* #define CMDSET0001_DISABLE_WRITE_SUSPEND */
 
 // debugging, turns off buffer write mode if set to 1
-#define FORCE_WORD_WRITE 0
+#define FORCE_WORD_WRITE 1
 
 /* Intel chips */
 #define I82802AB	0x00ad

