This patch adds initial support for arv4510 boards (bewan ibox, wippies homebox, elisa)
Index: target/linux/ifxmips/files/arch/mips/ifxmips/danube/Kconfig =================================================================== --- target/linux/ifxmips/files/arch/mips/ifxmips/danube/Kconfig (revisión: 24135) +++ target/linux/ifxmips/files/arch/mips/ifxmips/danube/Kconfig (copia de trabajo) @@ -4,6 +4,10 @@ bool default n +config IFXMIPS_BEWAN_BOOT + bool + default n + menu "Infineon SoC machine selection" config DANUBE_MACH_EASY50712 @@ -14,6 +18,11 @@ bool "Easy4010" default y +config DANUBE_MACH_ARV4510 + bool "ARV4510" + default y + select IFXMIPS_BEWAN_BOOT + config DANUBE_MACH_ARV4519 bool "ARV4519" default y Index: target/linux/ifxmips/files/arch/mips/ifxmips/danube/Makefile =================================================================== --- target/linux/ifxmips/files/arch/mips/ifxmips/danube/Makefile (revisión: 24135) +++ target/linux/ifxmips/files/arch/mips/ifxmips/danube/Makefile (copia de trabajo) @@ -1,5 +1,7 @@ obj-y := dma-core.o irq.o ebu.o setup.o devices.o cgu.o obj-$(CONFIG_IFXMIPS_ARCAYDIAN_BRNBOOT) += arcaydian.o +obj-$(CONFIG_IFXMIPS_BEWAN_BOOT) += bewan.o +obj-$(CONFIG_DANUBE_MACH_ARV4510) += mach-arv4510.o obj-$(CONFIG_DANUBE_MACH_ARV45XX) += mach-arv45xx.o obj-$(CONFIG_DANUBE_MACH_EASY50712) += mach-easy50712.o obj-$(CONFIG_DANUBE_MACH_EASY4010) += mach-easy4010.o Index: target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/machine.h =================================================================== --- target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/machine.h (revisión: 24135) +++ target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/machine.h (copia de trabajo) @@ -6,6 +6,7 @@ /* Danube/Twinpass based machines */ IFXMIPS_MACH_EASY50712, /* Danube evalkit */ IFXMIPS_MACH_EASY4010, /* Twinpass evalkit */ + IFXMIPS_MACH_ARV4510, /* Arcadyan ARV4510, Wippies Homebox */ IFXMIPS_MACH_ARV4518, /* Airties WAV-221 */ IFXMIPS_MACH_ARV4520, /* Airties WAV-281, Arcor EasyboxA800 */ IFXMIPS_MACH_ARV4525, /* Speedport W502V */ Index: target/linux/ifxmips/files/arch/mips/ifxmips/danube/mach-arv4510.c =================================================================== --- target/linux/ifxmips/files/arch/mips/ifxmips/danube/mach-arv4510.c (revisión: 0) +++ target/linux/ifxmips/files/arch/mips/ifxmips/danube/mach-arv4510.c (revisión: 0) @@ -0,0 +1,85 @@ +#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 <machine.h> +#include <ifxmips.h> +#include <ifxmips_prom.h> + +#include "devices.h" +#include "bewan.h" + +#define ARV4510_BEWAN 0x20 +#define ARV4510_BEWAN_MAC 0x14 + +static unsigned char arv4510_ethaddr[6]; + +#ifdef CONFIG_MTD_PARTITIONS +static struct mtd_partition arv4510_partitions[] = +{ + { + .name = "uboot", + .offset = 0x60000, + .size = 0x20000, + }, + { + .name = "kernel", + .offset = 0x80000, + .size = 0x0, + }, + { + .name = "rootfs", + .offset = 0x0, + .size = 0x0, + }, + { + .name = "board_config", + .offset = 0x3f0000, + .size = 0x10000, + }, + { + .name = "openwrt", + .offset = 0x60000, + .size = 0x0, + }, +}; +#endif + +static struct physmap_flash_data arv4510_flash_data = { +#ifdef CONFIG_MTD_PARTITIONS + .nr_parts = ARRAY_SIZE(arv4510_partitions), + .parts = arv4510_partitions, +#endif +}; + +static void __init +arv4510_init(void) +{ + unsigned char *mac = arv4510_ethaddr; + + if(!ifxmips_detect_bewan(ARV4510_BEWAN)) + ifxmips_find_bewan_mac(ARV4510_BEWAN_MAC, mac); + else + random_ether_addr(mac); + + ifxmips_register_gpio(); + + //ifxmips_register_mtd(&arv4510_flash_data); + danube_register_pci(PCI_CLOCK_EXT, 0x3); + ifxmips_register_wdt(); + danube_register_ethernet(mac, REV_MII_MODE); + danube_register_tapi(); +} + +MIPS_MACHINE(IFXMIPS_MACH_ARV4510, + "ARV4510", + "Arcadyan ARV4510 - Bewan iBox - Wippies Homebox", + arv4510_init); + Index: target/linux/ifxmips/files/arch/mips/ifxmips/danube/bewan.h =================================================================== --- target/linux/ifxmips/files/arch/mips/ifxmips/danube/bewan.h (revisión: 0) +++ target/linux/ifxmips/files/arch/mips/ifxmips/danube/bewan.h (revisión: 0) @@ -0,0 +1,7 @@ +#ifndef _BEWAN_H__ +#define _BEWAN_H__ + +int __init ifxmips_detect_bewan(unsigned int offset); +int __init ifxmips_find_bewan_mac(unsigned int offset, unsigned char *ifxmips_ethaddr); + +#endif Index: target/linux/ifxmips/files/arch/mips/ifxmips/danube/bewan.c =================================================================== --- target/linux/ifxmips/files/arch/mips/ifxmips/danube/bewan.c (revisión: 0) +++ target/linux/ifxmips/files/arch/mips/ifxmips/danube/bewan.c (revisión: 0) @@ -0,0 +1,42 @@ +#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 <ifxmips.h> +#include <ifxmips_prom.h> + +#include "bewan.h" + +static int ifxmips_bewan = 0; + +int __init +ifxmips_detect_bewan(unsigned int offset) +{ + unsigned char temp[4]; + memcpy_fromio(temp, (void *)KSEG1ADDR(IFXMIPS_FLASH_START + offset), 4); + if (!memcmp(temp, "FHLP", 4)) + ifxmips_bewan = 1; + return !ifxmips_bewan; +} + +int __init +ifxmips_find_bewan_mac(unsigned int offset, unsigned char *ifxmips_ethaddr) +{ + if(!ifxmips_bewan) + return 1; + memcpy_fromio(ifxmips_ethaddr, + (void *)KSEG1ADDR(IFXMIPS_FLASH_START + offset), 6); + return is_valid_ether_addr(ifxmips_ethaddr); +} +
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel