/* * Copyright (C) 2006 Ikanos Communications. All rights reserved. * The information and source code contained herein is the property * of Ikanos Communications. */ /* * Platform device support for Ikanos's FUSIV SoCs. * * Copyright 2004, Matt Porter * Modified 2005, Vivek Dharmadhikari * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #include #include #include #include #include #include #include #ifdef CONFIG_FUSIV_VX185 #include #include #endif unsigned char fusiv_usb_enable; static struct resource fusiv_usb_ohci_hcd_resources[] = { [0] = { .start = FUSIV_USB_OHCI_BASE, .end = FUSIV_USB_OHCI_BASE + FUSIV_USB_OHCI_LEN - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = FUSIV_USB_OHCI_HOST_INT, .end = FUSIV_USB_OHCI_HOST_INT, .flags = IORESOURCE_IRQ, }, }; static struct resource fusiv_usb_ehci_hcd_resources[] = { [0] = { .start = FUSIV_USB_EHCI_BASE, .end = FUSIV_USB_EHCI_BASE + FUSIV_USB_EHCI_LEN - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = FUSIV_USB_EHCI_HOST_INT, .end = FUSIV_USB_EHCI_HOST_INT, .flags = IORESOURCE_IRQ, }, }; #if 0 // moved to arch/mips/fusiv/fusiv_mips32/fusiv_mtd.c #if defined(CONFIG_MTD_NAND) && defined(CONFIG_FUSIV_VX185) static struct mtd_partition nand_partition_info[] = { { /* Level-1 bootloader uses the full first block */ .name = "Bootloader-stage-1(nand)", .offset = 0, .size = 128 * 1024, }, { /* Fusiv partition. uboot, uboot environment, Kernel & Filesytem */ .name = "FusivMTD(nand)", .offset = MTDPART_OFS_APPEND, /* 0xC0000 */ .size = MTDPART_SIZ_FULL, }, }; static struct fusiv_nand_platform nand_platform_data = { .partitions = nand_partition_info, .nr_partitions = ARRAY_SIZE(nand_partition_info), }; static struct resource fusiv_nand_resources[] = { [0] = { .start = NFC_BASEADDR+NFC_DATA, .end = NFC_BASEADDR+NFC_SECT7_SYNDROME78, .flags = IORESOURCE_MEM, }, [1] = { .start = NAND_FLASH_INT, .end = NAND_FLASH_INT, .flags = IORESOURCE_IRQ, }, }; #endif #endif static u64 fusiv_dmamask = ~(u32) 0; static struct platform_device fusiv_usb_ohci_hcd_device = { .name = "fusiv-ohci-hcd", .id = 0, .dev = { .dma_mask = &fusiv_dmamask, .coherent_dma_mask = 0xffffffff, }, .num_resources = ARRAY_SIZE(fusiv_usb_ohci_hcd_resources), .resource = fusiv_usb_ohci_hcd_resources, }; static struct platform_device fusiv_usb_ehci_hcd_device = { .name = "fusiv-ehci-hcd", .id = 0, .dev = { .dma_mask = &fusiv_dmamask, .coherent_dma_mask = 0xffffffff, }, .num_resources = ARRAY_SIZE(fusiv_usb_ehci_hcd_resources), .resource = fusiv_usb_ehci_hcd_resources, }; #if 0 // moved to arch/mips/fusiv/fusiv_mips32/fusiv_mtd.c #if defined(CONFIG_MTD_NAND) && defined(CONFIG_FUSIV_VX185) static struct platform_device fusiv_nand_device = { .name = "fusiv-nand", .id = 0, .dev = { .platform_data = &nand_platform_data, }, .num_resources = ARRAY_SIZE(fusiv_nand_resources), .resource = fusiv_nand_resources, }; #endif #endif /* Vx185 SATA device */ static struct resource vx185_ahci_resources[] = { [0] = { .start = 0x19150000, .end = 0x19150000 + 0xffff, .flags = IORESOURCE_MEM, }, [1] = { #if defined (CONFIG_FUSIV_VX185) && defined (CONFIG_CPU_MIPSR2_IRQ_VI) .start = FUSIV_MIPS_INT_SATA, .end = FUSIV_MIPS_INT_SATA, #else .start = 31, .end = 31, #endif .flags = IORESOURCE_IRQ, } }; static int vx185_ahci_data = 8; static struct platform_device vx185_ahci_device = { .name = "ahci", .id = -1, .dev = { .platform_data = &vx185_ahci_data, .coherent_dma_mask = 0xffffffff, }, .num_resources = ARRAY_SIZE(vx185_ahci_resources), .resource = vx185_ahci_resources, }; static struct platform_device *fusiv_platform_devices[] __initdata = { &fusiv_usb_ohci_hcd_device, &fusiv_usb_ehci_hcd_device, &vx185_ahci_device, #if 0 #if defined(CONFIG_MTD_NAND) && defined(CONFIG_FUSIV_VX185) &fusiv_nand_device, #endif #endif }; int fusiv_platform_init(void) { fusiv_usb_enable = 0; return platform_add_devices(fusiv_platform_devices, ARRAY_SIZE(fusiv_platform_devices)); } EXPORT_SYMBOL(fusiv_usb_enable); arch_initcall(fusiv_platform_init);