1*da2014a2SPaul Mundt /* 2*da2014a2SPaul Mundt * 3*da2014a2SPaul Mundt * linux/arch/sh/boards/se/7206/setup.c 4*da2014a2SPaul Mundt * 5*da2014a2SPaul Mundt * Copyright (C) 2006 Yoshinori Sato 6*da2014a2SPaul Mundt * Copyright (C) 2007 - 2008 Paul Mundt 7*da2014a2SPaul Mundt * 8*da2014a2SPaul Mundt * Hitachi 7206 SolutionEngine Support. 9*da2014a2SPaul Mundt */ 10*da2014a2SPaul Mundt #include <linux/init.h> 11*da2014a2SPaul Mundt #include <linux/platform_device.h> 12*da2014a2SPaul Mundt #include <linux/smc91x.h> 13*da2014a2SPaul Mundt #include <asm/se7206.h> 14*da2014a2SPaul Mundt #include <asm/io.h> 15*da2014a2SPaul Mundt #include <asm/machvec.h> 16*da2014a2SPaul Mundt #include <asm/heartbeat.h> 17*da2014a2SPaul Mundt 18*da2014a2SPaul Mundt static struct resource smc91x_resources[] = { 19*da2014a2SPaul Mundt [0] = { 20*da2014a2SPaul Mundt .name = "smc91x-regs", 21*da2014a2SPaul Mundt .start = PA_SMSC + 0x300, 22*da2014a2SPaul Mundt .end = PA_SMSC + 0x300 + 0x020 - 1, 23*da2014a2SPaul Mundt .flags = IORESOURCE_MEM, 24*da2014a2SPaul Mundt }, 25*da2014a2SPaul Mundt [1] = { 26*da2014a2SPaul Mundt .start = 64, 27*da2014a2SPaul Mundt .end = 64, 28*da2014a2SPaul Mundt .flags = IORESOURCE_IRQ, 29*da2014a2SPaul Mundt }, 30*da2014a2SPaul Mundt }; 31*da2014a2SPaul Mundt 32*da2014a2SPaul Mundt static struct smc91x_platdata smc91x_info = { 33*da2014a2SPaul Mundt .flags = SMC91X_USE_16BIT, 34*da2014a2SPaul Mundt }; 35*da2014a2SPaul Mundt 36*da2014a2SPaul Mundt static struct platform_device smc91x_device = { 37*da2014a2SPaul Mundt .name = "smc91x", 38*da2014a2SPaul Mundt .id = -1, 39*da2014a2SPaul Mundt .dev = { 40*da2014a2SPaul Mundt .dma_mask = NULL, 41*da2014a2SPaul Mundt .coherent_dma_mask = 0xffffffff, 42*da2014a2SPaul Mundt .platform_data = &smc91x_info, 43*da2014a2SPaul Mundt }, 44*da2014a2SPaul Mundt .num_resources = ARRAY_SIZE(smc91x_resources), 45*da2014a2SPaul Mundt .resource = smc91x_resources, 46*da2014a2SPaul Mundt }; 47*da2014a2SPaul Mundt 48*da2014a2SPaul Mundt static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; 49*da2014a2SPaul Mundt 50*da2014a2SPaul Mundt static struct heartbeat_data heartbeat_data = { 51*da2014a2SPaul Mundt .bit_pos = heartbeat_bit_pos, 52*da2014a2SPaul Mundt .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), 53*da2014a2SPaul Mundt .regsize = 32, 54*da2014a2SPaul Mundt }; 55*da2014a2SPaul Mundt 56*da2014a2SPaul Mundt static struct resource heartbeat_resources[] = { 57*da2014a2SPaul Mundt [0] = { 58*da2014a2SPaul Mundt .start = PA_LED, 59*da2014a2SPaul Mundt .end = PA_LED, 60*da2014a2SPaul Mundt .flags = IORESOURCE_MEM, 61*da2014a2SPaul Mundt }, 62*da2014a2SPaul Mundt }; 63*da2014a2SPaul Mundt 64*da2014a2SPaul Mundt static struct platform_device heartbeat_device = { 65*da2014a2SPaul Mundt .name = "heartbeat", 66*da2014a2SPaul Mundt .id = -1, 67*da2014a2SPaul Mundt .dev = { 68*da2014a2SPaul Mundt .platform_data = &heartbeat_data, 69*da2014a2SPaul Mundt }, 70*da2014a2SPaul Mundt .num_resources = ARRAY_SIZE(heartbeat_resources), 71*da2014a2SPaul Mundt .resource = heartbeat_resources, 72*da2014a2SPaul Mundt }; 73*da2014a2SPaul Mundt 74*da2014a2SPaul Mundt static struct platform_device *se7206_devices[] __initdata = { 75*da2014a2SPaul Mundt &smc91x_device, 76*da2014a2SPaul Mundt &heartbeat_device, 77*da2014a2SPaul Mundt }; 78*da2014a2SPaul Mundt 79*da2014a2SPaul Mundt static int __init se7206_devices_setup(void) 80*da2014a2SPaul Mundt { 81*da2014a2SPaul Mundt return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices)); 82*da2014a2SPaul Mundt } 83*da2014a2SPaul Mundt __initcall(se7206_devices_setup); 84*da2014a2SPaul Mundt 85*da2014a2SPaul Mundt /* 86*da2014a2SPaul Mundt * The Machine Vector 87*da2014a2SPaul Mundt */ 88*da2014a2SPaul Mundt 89*da2014a2SPaul Mundt static struct sh_machine_vector mv_se __initmv = { 90*da2014a2SPaul Mundt .mv_name = "SolutionEngine", 91*da2014a2SPaul Mundt .mv_nr_irqs = 256, 92*da2014a2SPaul Mundt .mv_inb = se7206_inb, 93*da2014a2SPaul Mundt .mv_inw = se7206_inw, 94*da2014a2SPaul Mundt .mv_outb = se7206_outb, 95*da2014a2SPaul Mundt .mv_outw = se7206_outw, 96*da2014a2SPaul Mundt 97*da2014a2SPaul Mundt .mv_inb_p = se7206_inb_p, 98*da2014a2SPaul Mundt .mv_inw_p = se7206_inw, 99*da2014a2SPaul Mundt .mv_outb_p = se7206_outb_p, 100*da2014a2SPaul Mundt .mv_outw_p = se7206_outw, 101*da2014a2SPaul Mundt 102*da2014a2SPaul Mundt .mv_insb = se7206_insb, 103*da2014a2SPaul Mundt .mv_insw = se7206_insw, 104*da2014a2SPaul Mundt .mv_outsb = se7206_outsb, 105*da2014a2SPaul Mundt .mv_outsw = se7206_outsw, 106*da2014a2SPaul Mundt 107*da2014a2SPaul Mundt .mv_init_irq = init_se7206_IRQ, 108*da2014a2SPaul Mundt }; 109