diff options
Diffstat (limited to 'target/linux/lantiq/files-3.0/arch/mips/lantiq/xway')
9 files changed, 1072 insertions, 0 deletions
diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/dev-dwc_otg.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/dev-dwc_otg.c new file mode 100644 index 0000000..90b63fc --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/dev-dwc_otg.c @@ -0,0 +1,70 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/types.h> +#include <linux/string.h> +#include <linux/mtd/physmap.h> +#include <linux/kernel.h> +#include <linux/reboot.h> +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <linux/etherdevice.h> +#include <linux/reboot.h> +#include <linux/time.h> +#include <linux/io.h> +#include <linux/gpio.h> +#include <linux/leds.h> + +#include <asm/bootinfo.h> +#include <asm/irq.h> + +#include <lantiq_soc.h> +#include <lantiq_irq.h> +#include <lantiq_platform.h> + +#define LTQ_USB_IOMEM_BASE 0x1e101000 +#define LTQ_USB_IOMEM_SIZE 0x00001000 + +static struct resource resources[] = +{ + [0] = { + .name = "dwc_otg_membase", + .start = LTQ_USB_IOMEM_BASE, + .end = LTQ_USB_IOMEM_BASE + LTQ_USB_IOMEM_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .name = "dwc_otg_irq", + .start = LTQ_USB_INT, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 dwc_dmamask = (u32)0x1fffffff; + +static struct platform_device platform_dev = { + .name = "dwc_otg", + .dev = { + .dma_mask = &dwc_dmamask, + }, + .resource = resources, + .num_resources = ARRAY_SIZE(resources), +}; + +int __init +xway_register_dwc(int pin) +{ + struct irq_data d; + d.irq = resources[1].start; + ltq_enable_irq(&d); + platform_dev.dev.platform_data = (void*) pin; + return platform_device_register(&platform_dev); +} diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/dev-dwc_otg.h b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/dev-dwc_otg.h new file mode 100644 index 0000000..521fad0 --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/dev-dwc_otg.h @@ -0,0 +1,17 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#ifndef _LTQ_DEV_DWC_H__ +#define _LTQ_DEV_DWC_H__ + +#include <lantiq_platform.h> + +extern void __init xway_register_dwc(int pin); + +#endif diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-arv45xx.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-arv45xx.c new file mode 100644 index 0000000..7cd2bd8 --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-arv45xx.c @@ -0,0 +1,495 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <linux/gpio.h> +#include <linux/gpio_buttons.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/physmap.h> +#include <linux/input.h> +#include <linux/etherdevice.h> +#include <linux/ath5k_platform.h> +#include <linux/pci.h> + +#include <lantiq_soc.h> +#include <lantiq_platform.h> + +#include "../machtypes.h" +#include "../dev-leds-gpio.h" +#include "devices.h" +#include "dev-dwc_otg.h" + +static struct mtd_partition arv4510_partitions[] = +{ + { + .name = "uboot", + .offset = 0x0, + .size = 0x20000, + }, + { + .name = "uboot_env", + .offset = 0x20000, + .size = 0x120000, + }, + { + .name = "linux", + .offset = 0x40000, + .size = 0xfa0000, + }, + { + .name = "board_config", + .offset = 0xfe0000, + .size = 0x20000, + }, +}; + +static struct mtd_partition arv45xx_partitions[] = +{ + { + .name = "uboot", + .offset = 0x0, + .size = 0x20000, + }, + { + .name = "uboot_env", + .offset = 0x20000, + .size = 0x10000, + }, + { + .name = "linux", + .offset = 0x30000, + .size = 0x3c0000, + }, + { + .name = "board_config", + .offset = 0x3f0000, + .size = 0x10000, + }, +}; + +static struct mtd_partition arv75xx_partitions[] = +{ + { + .name = "uboot", + .offset = 0x0, + .size = 0x10000, + }, + { + .name = "uboot_env", + .offset = 0x10000, + .size = 0x10000, + }, + { + .name = "linux", + .offset = 0x20000, + .size = 0x7d0000, + }, + { + .name = "board_config", + .offset = 0x7f0000, + .size = 0x10000, + }, +}; + +static struct physmap_flash_data arv4510_flash_data = { + .nr_parts = ARRAY_SIZE(arv4510_partitions), + .parts = arv4510_partitions, +}; + +static struct physmap_flash_data arv45xx_flash_data = { + .nr_parts = ARRAY_SIZE(arv45xx_partitions), + .parts = arv45xx_partitions, +}; + +static struct physmap_flash_data arv75xx_flash_data = { + .nr_parts = ARRAY_SIZE(arv75xx_partitions), + .parts = arv75xx_partitions, +}; + +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_EXT, + .gpio = PCI_GNT1 | PCI_REQ1, + .irq = { + [14] = INT_NUM_IM0_IRL0 + 22, + }, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_RMII, +}; + +static struct gpio_led +arv4510pw_leds_gpio[] __initdata = { + { .name = "soc:green:foo", .gpio = 4, .active_low = 1, }, +}; + +static struct gpio_led +arv4518pw_leds_gpio[] __initdata = { + { .name = "soc:green:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:fail", .gpio = 8, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:voip", .gpio = 100, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:fxs1", .gpio = 101, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:fxs2", .gpio = 102, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" }, +}; + +static struct gpio_button +arv4518pw_gpio_buttons[] __initdata = { + { .desc = "wlan", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, }, + { .desc = "wps", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 29, .active_low = 1, }, + { .desc = "reset", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 30, .active_low = 1, }, +}; + +static struct gpio_led +arv4520pw_leds_gpio[] __initdata = { + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, }, + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, }, + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, }, + { .name = "soc:red:power", .gpio = 6, .active_low = 1, }, + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, }, + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, }, + { .name = "soc:blue:voip", .gpio = 100, .active_low = 1, }, + { .name = "soc:blue:fxs1", .gpio = 101, .active_low = 1, }, + { .name = "soc:blue:fxs2", .gpio = 102, .active_low = 1, }, + { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, }, + { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, }, + { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, }, + { .name = "soc:blue:wlan", .gpio = 106, .active_low = 1, }, +}; + +static struct gpio_led +arv452cpw_leds_gpio[] __initdata = { + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:isdn", .gpio = 5, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:fxs1", .gpio = 100, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:fxs2", .gpio = 101, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:wps", .gpio = 102, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:wlan", .gpio = 106, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:internet", .gpio = 108, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:internet", .gpio = 109, .active_low = 1, .default_trigger = "default-on" }, +}; + +static struct gpio_led +arv4525pw_leds_gpio[] __initdata = { + { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" }, +}; + +static struct gpio_led +arv752dpw22_leds_gpio[] __initdata = { + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:red:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:wlan", .gpio = 106, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:wlan1", .gpio = 107, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:wlan", .gpio = 108, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:blue:wlan1", .gpio = 109, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:eth1", .gpio = 111, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:eth2", .gpio = 112, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:eth3", .gpio = 113, .active_low = 1, .default_trigger = "default-on" }, + { .name = "soc:green:eth4", .gpio = 114, .active_low = 1, .default_trigger = "default-on", }, +}; + +static struct gpio_button +arv752dpw22_gpio_buttons[] __initdata = { + { .desc = "btn0", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 12, .active_low = 1, }, + { .desc = "btn1", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 13, .active_low = 1, }, + { .desc = "btn2", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 28, .active_low = 1, }, +}; + +static struct gpio_led +arv7518pw_leds_gpio[] __initdata = { + { .name = "soc:green:power", .gpio = 2, .active_low = 1, }, + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, }, + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, }, + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, }, + { .name = "soc:red:internet", .gpio = 8, .active_low = 1, }, + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, }, +}; + +static struct gpio_button +arv7518pw_gpio_buttons[] __initdata = { + { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 23, .active_low = 1, }, + { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 25, .active_low = 1, }, +}; + +static void +arv45xx_register_ethernet(void) +{ +#define ARV45XX_BRN_MAC 0x3f0016 + memcpy_fromio(<q_eth_data.mac.sa_data, + (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_MAC), 6); + ltq_register_etop(<q_eth_data); +} + +static void +arv75xx_register_ethernet(void) +{ +#define ARV75XX_BRN_MAC 0x7f0016 + memcpy_fromio(<q_eth_data.mac.sa_data, + (void *)KSEG1ADDR(LTQ_FLASH_START + ARV75XX_BRN_MAC), 6); + ltq_register_etop(<q_eth_data); +} + +static void +bewan_register_ethernet(void) +{ +#define BEWAN_BRN_MAC 0x3f0014 + memcpy_fromio(<q_eth_data.mac.sa_data, + (void *)KSEG1ADDR(LTQ_FLASH_START + BEWAN_BRN_MAC), 6); + ltq_register_etop(<q_eth_data); +} + +static u16 arv45xx_ath5k_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS]; +static struct ath5k_platform_data arv45xx_ath5k_platform_data; + +/*static int arv45xx_pci_plat_dev_init(struct pci_dev *dev) +{ + dev->dev.platform_data = &arv45xx_ath5k_platform_data; + return 0; +} +*/ +void __init +arv45xx_register_ath5k(void) +{ +#define ARV45XX_BRN_ATH 0x3f0478 + int i; + unsigned char eeprom_mac[6]; + static u16 eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS]; + u32 *p = (u32*)arv45xx_ath5k_eeprom_data; + + memcpy_fromio(eeprom_mac, + (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_MAC), 6); + eeprom_mac[5]++; + memcpy_fromio(arv45xx_ath5k_eeprom_data, + (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_ATH), ATH5K_PLAT_EEP_MAX_WORDS); + // swap eeprom bytes + for (i = 0; i < ATH5K_PLAT_EEP_MAX_WORDS>>1; i++){ + //arv4518_ath5k_eeprom_data[i] = ((eeprom_data[i]&0xff)<<8)|((eeprom_data[i]&0xff00)>>8); + p[i] = ((eeprom_data[(i<<1)+1]&0xff)<<24)|((eeprom_data[(i<<1)+1]&0xff00)<<8)|((eeprom_data[i<<1]&0xff)<<8)|((eeprom_data[i<<1]&0xff00)>>8); + if (i == 0xbf>>1){ + // printk ("regdomain: 0x%x --> 0x%x\n", p[i], (p[i] & 0xffff0000)|0x67); + /* regdomain is invalid?? how did original fw convert + * value to 0x82d4 ?? + * for now, force to 0x67 */ + p[i] &= 0xffff0000; + p[i] |= 0x67; + } + } + arv45xx_ath5k_platform_data.eeprom_data = arv45xx_ath5k_eeprom_data; + arv45xx_ath5k_platform_data.macaddr = eeprom_mac; + //lqpci_plat_dev_init = arv45xx_pci_plat_dev_init; +} + +static void __init +arv3527p_init(void) +{ + ltq_register_gpio_stp(); + //ltq_add_device_leds_gpio(arv3527p_leds_gpio, ARRAY_SIZE(arv3527p_leds_gpio)); + ltq_register_nor(&arv45xx_flash_data); + arv45xx_register_ethernet(); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV3527P, + "ARV3527P", + "ARV3527P - Arcor Easybox 401", + arv3527p_init); + +static void __init +arv4510pw_init(void) +{ + ltq_register_gpio_stp(); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4510pw_leds_gpio), arv4510pw_leds_gpio); + ltq_register_nor(&arv4510_flash_data); + ltq_pci_data.irq[12] = (INT_NUM_IM2_IRL0 + 31); + ltq_pci_data.irq[15] = (INT_NUM_IM0_IRL0 + 26); + ltq_pci_data.gpio |= PCI_EXIN2 | PCI_REQ2; + ltq_register_pci(<q_pci_data); + bewan_register_ethernet(); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV4510PW, + "ARV4510PW", + "ARV4510PW - Wippies Homebox", + arv4510pw_init); + +static void __init +arv4518pw_init(void) +{ +#define ARV4518PW_EBU 0 +#define ARV4518PW_USB 14 +#define ARV4518PW_SWITCH_RESET 13 + + ltq_register_gpio_ebu(ARV4518PW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4518pw_leds_gpio), arv4518pw_leds_gpio); + ltq_register_gpio_buttons(arv4518pw_gpio_buttons, ARRAY_SIZE(arv4518pw_gpio_buttons)); + ltq_register_nor(&arv45xx_flash_data); + ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2; + ltq_register_pci(<q_pci_data); + ltq_register_madwifi_eep(); + xway_register_dwc(ARV4518PW_USB); + arv45xx_register_ethernet(); + arv45xx_register_ath5k(); + + gpio_request(ARV4518PW_SWITCH_RESET, "switch"); + gpio_direction_output(ARV4518PW_SWITCH_RESET, 1); + gpio_export(ARV4518PW_SWITCH_RESET, 0); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV4518PW, + "ARV4518PW", + "ARV4518PW - SMC7908A-ISP, Airties WAV-221", + arv4518pw_init); + +static void __init +arv4520pw_init(void) +{ +#define ARV4520PW_EBU 0x400 +#define ARV4520PW_USB 28 +#define ARV4520PW_SWITCH_RESET 110 + + ltq_register_gpio_ebu(ARV4520PW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4520pw_leds_gpio), arv4520pw_leds_gpio); + ltq_register_nor(&arv45xx_flash_data); + ltq_register_pci(<q_pci_data); + ltq_register_tapi(); + arv45xx_register_ethernet(); + xway_register_dwc(ARV4520PW_USB); + + gpio_request(ARV4520PW_SWITCH_RESET, "switch"); + gpio_set_value(ARV4520PW_SWITCH_RESET, 1); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV4520PW, + "ARV4520PW", + "ARV4520PW - Airties WAV-281, Arcor A800", + arv4520pw_init); + +static void __init +arv452Cpw_init(void) +{ +#define ARV452CPW_EBU 0x77f +#define ARV452CPW_USB 28 +#define ARV452CPW_RELAY1 31 +#define ARV452CPW_RELAY2 107 +#define ARV452CPW_SWITCH_RESET 110 + + ltq_register_gpio_ebu(ARV452CPW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv452cpw_leds_gpio), arv452cpw_leds_gpio); + ltq_register_nor(&arv45xx_flash_data); + ltq_register_pci(<q_pci_data); + ltq_register_madwifi_eep(); + xway_register_dwc(ARV452CPW_USB); + arv45xx_register_ethernet(); + arv45xx_register_ath5k(); + + gpio_request(ARV452CPW_SWITCH_RESET, "switch"); + gpio_set_value(ARV452CPW_SWITCH_RESET, 1); + gpio_export(ARV452CPW_SWITCH_RESET, 0); + + gpio_request(ARV452CPW_RELAY1, "relay1"); + gpio_direction_output(ARV452CPW_RELAY1, 1); + gpio_export(ARV452CPW_RELAY1, 0); + + gpio_request(ARV452CPW_RELAY2, "relay2"); + gpio_set_value(ARV452CPW_RELAY2, 1); + gpio_export(ARV452CPW_RELAY2, 0); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV452CPW, + "ARV452CPW", + "ARV452CPW - Arcor A801", + arv452Cpw_init); + +static void __init +arv4525pw_init(void) +{ + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4525pw_leds_gpio), arv4525pw_leds_gpio); + ltq_register_nor(&arv45xx_flash_data); + ltq_pci_data.clock = PCI_CLOCK_INT; + ltq_register_pci(<q_pci_data); + ltq_register_madwifi_eep(); + ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII; + arv45xx_register_ethernet(); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV4525PW, + "ARV4525PW", + "ARV4525PW - Speedport W502V", + arv4525pw_init); + +static void __init +arv7518pw_init(void) +{ +#define ARV7518PW_EBU 0x2 +#define ARV7518PW_USB 14 + + ltq_register_gpio_ebu(ARV7518PW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv7518pw_leds_gpio), arv7518pw_leds_gpio); + ltq_register_gpio_buttons(arv7518pw_gpio_buttons, ARRAY_SIZE(arv7518pw_gpio_buttons)); + ltq_register_nor(&arv75xx_flash_data); + ltq_register_pci(<q_pci_data); + ltq_register_tapi(); + xway_register_dwc(ARV7518PW_USB); + arv75xx_register_ethernet(); + //arv7518_register_ath9k(mac); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV7518PW, + "ARV7518PW", + "ARV7518PW - ASTORIA", + arv7518pw_init); + +static void __init +arv752dpw22_init(void) +{ +#define ARV752DPW22_EBU 0x2 +#define ARV752DPW22_USB 100 +#define ARV752DPW22_RELAY 101 + + ltq_register_gpio_ebu(ARV752DPW22_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv752dpw22_leds_gpio), arv752dpw22_leds_gpio); + ltq_register_gpio_buttons(arv752dpw22_gpio_buttons, ARRAY_SIZE(arv752dpw22_gpio_buttons)); + ltq_register_nor(&arv75xx_flash_data); + ltq_pci_data.irq[15] = (INT_NUM_IM3_IRL0 + 31); + ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2; + ltq_register_pci(<q_pci_data); + xway_register_dwc(ARV752DPW22_USB); + arv75xx_register_ethernet(); + + gpio_request(ARV752DPW22_RELAY, "relay"); + gpio_set_value(ARV752DPW22_RELAY, 1); + gpio_export(ARV752DPW22_RELAY, 0); +} + +MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22, + "ARV752DPW22", + "ARV752DPW22 - Arcor A803", + arv752dpw22_init); diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-easy50601.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-easy50601.c new file mode 100644 index 0000000..a5a0105 --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-easy50601.c @@ -0,0 +1,57 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#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 <linux/input.h> + +#include <lantiq.h> + +#include "../machtypes.h" +#include "devices.h" + +static struct mtd_partition easy50601_partitions[] = { + { + .name = "uboot", + .offset = 0x0, + .size = 0x10000, + }, + { + .name = "uboot_env", + .offset = 0x10000, + .size = 0x10000, + }, + { + .name = "linux", + .offset = 0x20000, + .size = 0x3d0000, + }, +}; + +static struct physmap_flash_data easy50601_flash_data = { + .nr_parts = ARRAY_SIZE(easy50601_partitions), + .parts = easy50601_partitions, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = -1, /* use EPHY */ +}; + +static void __init easy50601_init(void) +{ + ltq_register_nor(&easy50601_flash_data); + ltq_register_etop(<q_eth_data); +} + +MIPS_MACHINE(LTQ_MACH_EASY50601, + "EASY50601", + "EASY50601 Eval Board", + easy50601_init); diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-easy50712.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-easy50712.c new file mode 100644 index 0000000..2fddfca --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-easy50712.c @@ -0,0 +1,70 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#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 <linux/input.h> +#include <linux/phy.h> + +#include <lantiq_soc.h> +#include <irq.h> + +#include "../machtypes.h" +#include "devices.h" + +static struct mtd_partition easy50712_partitions[] = { + { + .name = "uboot", + .offset = 0x0, + .size = 0x10000, + }, + { + .name = "uboot_env", + .offset = 0x10000, + .size = 0x10000, + }, + { + .name = "linux", + .offset = 0x20000, + .size = 0x3d0000, + }, +}; + +static struct physmap_flash_data easy50712_flash_data = { + .nr_parts = ARRAY_SIZE(easy50712_partitions), + .parts = easy50712_partitions, +}; + +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_INT, + .gpio = PCI_GNT1 | PCI_REQ1, + .irq = { + [14] = INT_NUM_IM0_IRL0 + 22, + }, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_MII, +}; + +static void __init easy50712_init(void) +{ + ltq_register_gpio_stp(); + ltq_register_nor(&easy50712_flash_data); + ltq_register_pci(<q_pci_data); + ltq_register_etop(<q_eth_data); + ltq_register_tapi(); +} + +MIPS_MACHINE(LTQ_MACH_EASY50712, + "EASY50712", + "EASY50712 Eval Board", + easy50712_init); diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-fritz.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-fritz.c new file mode 100644 index 0000000..9b54242 --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-fritz.c @@ -0,0 +1,77 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#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 <linux/input.h> +#include <linux/phy.h> + +#include <lantiq_soc.h> +#include <irq.h> + +#include "../machtypes.h" +#include "devices.h" + +/*static struct mtd_partition fritz3370_partitions[] = { + { + .name = "uboot", + .offset = 0x0, + .size = 0x10000, + }, + { + .name = "uboot_env", + .offset = 0x10000, + .size = 0x10000, + }, + { + .name = "linux", + .offset = 0x20000, + .size = 0xe0000, + }, + { + .name = "rootfs", + .offset = 0x100000, + .size = 0x300000, + }, +}; + +static struct physmap_flash_data fritz3370_flash_data = { + .nr_parts = ARRAY_SIZE(fritz3370_partitions), + .parts = fritz3370_partitions, +}; + +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_INT, + .gpio = PCI_GNT1 | PCI_REQ1, + .irq = { + [14] = INT_NUM_IM0_IRL0 + 22, + }, +}; +*/ +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_MII, +}; + +extern void xway_register_nand(void); + +static void __init fritz3370_init(void) +{ +// ltq_register_gpio_stp(); +// ltq_register_nor(&fritz3370_flash_data); +// ltq_register_pci(<q_pci_data); + ltq_register_etop(<q_eth_data); + xway_register_nand(); +} + +MIPS_MACHINE(LANTIQ_MACH_FRITZ3370, + "FRITZ3370", + "FRITZ!BOX 3370", + fritz3370_init); diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-gigasx76x.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-gigasx76x.c new file mode 100644 index 0000000..ab2b08c --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-gigasx76x.c @@ -0,0 +1,109 @@ +/* + * 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. + * + * Copyright (C) 2011 Andrej Vlašić + * Copyright (C) 2011 Luka Perkov + * + */ + +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <linux/gpio.h> +#include <linux/gpio_buttons.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/physmap.h> +#include <linux/input.h> +#include <linux/ath5k_platform.h> +#include <linux/pci.h> +#include <linux/phy.h> + +#include <irq.h> + +#include <lantiq_soc.h> +#include <lantiq_platform.h> + +#include "../machtypes.h" +#include "../dev-leds-gpio.h" +#include "devices.h" +#include "dev-dwc_otg.h" + +static struct mtd_partition gigasx76x_partitions[] = +{ + { + .name = "secondary_env", + .offset = 0xe000, + .size = 0x2000, + }, + { + .name = "secondary_boot", + .offset = 0x10000, + .size = 0x10000, + }, + { + .name = "uboot", + .offset = 0x20000, + .size = 0x30000, + }, + { + .name = "linux", + .offset = 0x50000, + .size = 0x7a0000, + }, + { + .name = "board_config", + .offset = 0x7f0000, + .size = 0x10000, + }, +}; + +static struct gpio_led +gigasx76x_leds_gpio[] __initdata = { + { .name = "soc:green:usb", .gpio = 202, }, + { .name = "soc:green:wlan", .gpio = 203, }, + { .name = "soc:green:phone2", .gpio = 204, }, + { .name = "soc:green:phone1", .gpio = 205, }, + { .name = "soc:green:line", .gpio = 206, }, + { .name = "soc:green:online", .gpio = 207, }, +}; + + +static struct physmap_flash_data gigasx76x_flash_data = { + .nr_parts = ARRAY_SIZE(gigasx76x_partitions), + .parts = gigasx76x_partitions, +}; + +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_INT, + .gpio = PCI_GNT1 | PCI_REQ1, + .irq = { + [14] = INT_NUM_IM0_IRL0 + 22, + }, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_MII, +}; + +static void __init +gigasx76x_init(void) +{ +#define GIGASX76X_USB 29 + + ltq_register_gpio_stp(); + ltq_register_nor(&gigasx76x_flash_data); + ltq_register_pci(<q_pci_data); + ltq_register_etop(<q_eth_data); + xway_register_dwc(GIGASX76X_USB); + ltq_register_tapi(); + ltq_register_madwifi_eep(); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(gigasx76x_leds_gpio), gigasx76x_leds_gpio); +} + +MIPS_MACHINE(LANTIQ_MACH_GIGASX76X, + "GIGASX76X", + "GIGASX76X - Gigaset SX761,SX762,SX763", + gigasx76x_init); diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-netgear.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-netgear.c new file mode 100644 index 0000000..826bfe2 --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-netgear.c @@ -0,0 +1,57 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#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 <linux/input.h> +#include <linux/phy.h> +#include <linux/spi/spi.h> + +#include <lantiq_soc.h> +#include <irq.h> + +#include "../machtypes.h" +#include "devices.h" + +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_INT, + .gpio = PCI_GNT1 | PCI_REQ1, + .irq = { + [14] = INT_NUM_IM0_IRL0 + 22, + }, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_MII, +}; + +struct spi_board_info spi_info = { + .bus_num = 0, + .chip_select = 3, + .max_speed_hz = 25000000, + .modalias = "mx25l12805d", +}; + +struct ltq_spi_platform_data ltq_spi_data = { + .num_chipselect = 4, +}; + +static void __init dgn3500_init(void) +{ + ltq_register_pci(<q_pci_data); + ltq_register_etop(<q_eth_data); + ltq_register_spi(<q_spi_data, &spi_info, 1); +} + +MIPS_MACHINE(LANTIQ_MACH_DGN3500B, + "DGN3500B", + "Netgear DGN3500B", + dgn3500_init); diff --git a/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-wbmr.c b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-wbmr.c new file mode 100644 index 0000000..141a5b7 --- /dev/null +++ b/target/linux/lantiq/files-3.0/arch/mips/lantiq/xway/mach-wbmr.c @@ -0,0 +1,120 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <linux/gpio.h> +#include <linux/gpio_buttons.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/physmap.h> +#include <linux/input.h> + +#include <lantiq_soc.h> +#include <irq.h> + +#include "../machtypes.h" +#include "../dev-leds-gpio.h" +#include "../dev-gpio-buttons.h" +#include "devices.h" +#include "dev-dwc_otg.h" + +static struct mtd_partition wbmr_partitions[] = +{ + { + .name = "uboot", + .offset = 0x0, + .size = 0x40000, + }, + { + .name = "uboot-env", + .offset = 0x40000, + .size = 0x20000, + }, + { + .name = "linux", + .offset = 0x60000, + .size = 0x1f20000, + }, + { + .name = "calibration", + .offset = 0x1fe0000, + .size = 0x20000, + }, +}; + +static struct physmap_flash_data wbmr_flash_data = { + .nr_parts = ARRAY_SIZE(wbmr_partitions), + .parts = wbmr_partitions, +}; + +static struct gpio_led +wbmr_leds_gpio[] __initdata = { + { .name = "soc:blue:movie", .gpio = 20, .active_low = 1, }, + { .name = "soc:red:internet", .gpio = 18, .active_low = 1, }, + { .name = "soc:green:internet", .gpio = 17, .active_low = 1, }, + { .name = "soc:green:adsl", .gpio = 16, .active_low = 1, }, + { .name = "soc:green:wlan", .gpio = 15, .active_low = 1, }, + { .name = "soc:red:security", .gpio = 14, .active_low = 1, }, + { .name = "soc:green:power", .gpio = 1, .active_low = 1, }, + { .name = "soc:red:power", .gpio = 5, .active_low = 1, }, + { .name = "soc:green:usb", .gpio = 28, .active_low = 1, }, +}; + +static struct gpio_keys_button +wbmr_gpio_keys[] __initdata = { + { + .desc = "aoss", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 0, + .active_low = 1, + }, + { + .desc = "reset", + .type = EV_KEY, + .code = BTN_1, + .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, + .gpio = 37, + .active_low = 1, + }, +}; + +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_INT, + .gpio = PCI_GNT1 | PCI_REQ1, + .irq = { + [14] = INT_NUM_IM0_IRL0 + 22, + }, +}; + +static struct ltq_eth_data ltq_eth_data = { + .mii_mode = PHY_INTERFACE_MODE_RGMII, +}; + +static void __init +wbmr_init(void) +{ +#define WMBR_BRN_MAC 0x1fd0024 + + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(wbmr_leds_gpio), wbmr_leds_gpio); + ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(wbmr_gpio_keys), wbmr_gpio_keys); + ltq_register_nor(&wbmr_flash_data); + ltq_register_pci(<q_pci_data); + memcpy_fromio(<q_eth_data.mac.sa_data, + (void *)KSEG1ADDR(LTQ_FLASH_START + WMBR_BRN_MAC), 6); + ltq_register_etop(<q_eth_data); + xway_register_dwc(36); +} + +MIPS_MACHINE(LANTIQ_MACH_WBMR, + "WBMR", + "WBMR", + wbmr_init); |