| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 | 
							- /*
 
-  * Versatile Express V2M Motherboard Support
 
-  */
 
- #include <linux/device.h>
 
- #include <linux/amba/bus.h>
 
- #include <linux/amba/mmci.h>
 
- #include <linux/io.h>
 
- #include <linux/smp.h>
 
- #include <linux/init.h>
 
- #include <linux/of_address.h>
 
- #include <linux/of_fdt.h>
 
- #include <linux/of_irq.h>
 
- #include <linux/of_platform.h>
 
- #include <linux/platform_device.h>
 
- #include <linux/ata_platform.h>
 
- #include <linux/smsc911x.h>
 
- #include <linux/spinlock.h>
 
- #include <linux/usb/isp1760.h>
 
- #include <linux/mtd/physmap.h>
 
- #include <linux/regulator/fixed.h>
 
- #include <linux/regulator/machine.h>
 
- #include <linux/vexpress.h>
 
- #include <asm/arch_timer.h>
 
- #include <asm/mach-types.h>
 
- #include <asm/sizes.h>
 
- #include <asm/smp_twd.h>
 
- #include <asm/mach/arch.h>
 
- #include <asm/mach/map.h>
 
- #include <asm/mach/time.h>
 
- #include <asm/hardware/arm_timer.h>
 
- #include <asm/hardware/cache-l2x0.h>
 
- #include <asm/hardware/gic.h>
 
- #include <asm/hardware/timer-sp.h>
 
- #include <mach/ct-ca9x4.h>
 
- #include <mach/motherboard.h>
 
- #include <plat/sched_clock.h>
 
- #include <plat/platsmp.h>
 
- #include "core.h"
 
- #define V2M_PA_CS0	0x40000000
 
- #define V2M_PA_CS1	0x44000000
 
- #define V2M_PA_CS2	0x48000000
 
- #define V2M_PA_CS3	0x4c000000
 
- #define V2M_PA_CS7	0x10000000
 
- static struct map_desc v2m_io_desc[] __initdata = {
 
- 	{
 
- 		.virtual	= V2M_PERIPH,
 
- 		.pfn		= __phys_to_pfn(V2M_PA_CS7),
 
- 		.length		= SZ_128K,
 
- 		.type		= MT_DEVICE,
 
- 	},
 
- };
 
- static void __init v2m_sp804_init(void __iomem *base, unsigned int irq)
 
- {
 
- 	if (WARN_ON(!base || irq == NO_IRQ))
 
- 		return;
 
- 	writel(0, base + TIMER_1_BASE + TIMER_CTRL);
 
- 	writel(0, base + TIMER_2_BASE + TIMER_CTRL);
 
- 	sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1");
 
- 	sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0");
 
- }
 
- static struct resource v2m_pcie_i2c_resource = {
 
- 	.start	= V2M_SERIAL_BUS_PCI,
 
- 	.end	= V2M_SERIAL_BUS_PCI + SZ_4K - 1,
 
- 	.flags	= IORESOURCE_MEM,
 
- };
 
- static struct platform_device v2m_pcie_i2c_device = {
 
- 	.name		= "versatile-i2c",
 
- 	.id		= 0,
 
- 	.num_resources	= 1,
 
- 	.resource	= &v2m_pcie_i2c_resource,
 
- };
 
- static struct resource v2m_ddc_i2c_resource = {
 
- 	.start	= V2M_SERIAL_BUS_DVI,
 
- 	.end	= V2M_SERIAL_BUS_DVI + SZ_4K - 1,
 
- 	.flags	= IORESOURCE_MEM,
 
- };
 
- static struct platform_device v2m_ddc_i2c_device = {
 
- 	.name		= "versatile-i2c",
 
- 	.id		= 1,
 
- 	.num_resources	= 1,
 
- 	.resource	= &v2m_ddc_i2c_resource,
 
- };
 
- static struct resource v2m_eth_resources[] = {
 
- 	{
 
- 		.start	= V2M_LAN9118,
 
- 		.end	= V2M_LAN9118 + SZ_64K - 1,
 
- 		.flags	= IORESOURCE_MEM,
 
- 	}, {
 
- 		.start	= IRQ_V2M_LAN9118,
 
- 		.end	= IRQ_V2M_LAN9118,
 
- 		.flags	= IORESOURCE_IRQ,
 
- 	},
 
- };
 
- static struct smsc911x_platform_config v2m_eth_config = {
 
- 	.flags		= SMSC911X_USE_32BIT,
 
- 	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
 
- 	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
 
- 	.phy_interface	= PHY_INTERFACE_MODE_MII,
 
- };
 
- static struct platform_device v2m_eth_device = {
 
- 	.name		= "smsc911x",
 
- 	.id		= -1,
 
- 	.resource	= v2m_eth_resources,
 
- 	.num_resources	= ARRAY_SIZE(v2m_eth_resources),
 
- 	.dev.platform_data = &v2m_eth_config,
 
- };
 
- static struct regulator_consumer_supply v2m_eth_supplies[] = {
 
- 	REGULATOR_SUPPLY("vddvario", "smsc911x"),
 
- 	REGULATOR_SUPPLY("vdd33a", "smsc911x"),
 
- };
 
- static struct resource v2m_usb_resources[] = {
 
- 	{
 
- 		.start	= V2M_ISP1761,
 
- 		.end	= V2M_ISP1761 + SZ_128K - 1,
 
- 		.flags	= IORESOURCE_MEM,
 
- 	}, {
 
- 		.start	= IRQ_V2M_ISP1761,
 
- 		.end	= IRQ_V2M_ISP1761,
 
- 		.flags	= IORESOURCE_IRQ,
 
- 	},
 
- };
 
- static struct isp1760_platform_data v2m_usb_config = {
 
- 	.is_isp1761		= true,
 
- 	.bus_width_16		= false,
 
- 	.port1_otg		= true,
 
- 	.analog_oc		= false,
 
- 	.dack_polarity_high	= false,
 
- 	.dreq_polarity_high	= false,
 
- };
 
- static struct platform_device v2m_usb_device = {
 
- 	.name		= "isp1760",
 
- 	.id		= -1,
 
- 	.resource	= v2m_usb_resources,
 
- 	.num_resources	= ARRAY_SIZE(v2m_usb_resources),
 
- 	.dev.platform_data = &v2m_usb_config,
 
- };
 
- static struct physmap_flash_data v2m_flash_data = {
 
- 	.width		= 4,
 
- };
 
- static struct resource v2m_flash_resources[] = {
 
- 	{
 
- 		.start	= V2M_NOR0,
 
- 		.end	= V2M_NOR0 + SZ_64M - 1,
 
- 		.flags	= IORESOURCE_MEM,
 
- 	}, {
 
- 		.start	= V2M_NOR1,
 
- 		.end	= V2M_NOR1 + SZ_64M - 1,
 
- 		.flags	= IORESOURCE_MEM,
 
- 	},
 
- };
 
- static struct platform_device v2m_flash_device = {
 
- 	.name		= "physmap-flash",
 
- 	.id		= -1,
 
- 	.resource	= v2m_flash_resources,
 
- 	.num_resources	= ARRAY_SIZE(v2m_flash_resources),
 
- 	.dev.platform_data = &v2m_flash_data,
 
- };
 
- static struct pata_platform_info v2m_pata_data = {
 
- 	.ioport_shift	= 2,
 
- };
 
- static struct resource v2m_pata_resources[] = {
 
- 	{
 
- 		.start	= V2M_CF,
 
- 		.end	= V2M_CF + 0xff,
 
- 		.flags	= IORESOURCE_MEM,
 
- 	}, {
 
- 		.start	= V2M_CF + 0x100,
 
- 		.end	= V2M_CF + SZ_4K - 1,
 
- 		.flags	= IORESOURCE_MEM,
 
- 	},
 
- };
 
- static struct platform_device v2m_cf_device = {
 
- 	.name		= "pata_platform",
 
- 	.id		= -1,
 
- 	.resource	= v2m_pata_resources,
 
- 	.num_resources	= ARRAY_SIZE(v2m_pata_resources),
 
- 	.dev.platform_data = &v2m_pata_data,
 
- };
 
- static struct mmci_platform_data v2m_mmci_data = {
 
 
  |