Path: blob/master/arch/sh/boards/mach-se/7780/setup.c
15162 views
/*1* linux/arch/sh/boards/se/7780/setup.c2*3* Copyright (C) 2006,2007 Nobuhiro Iwamatsu4*5* Hitachi UL SolutionEngine 7780 Support.6*7* This file is subject to the terms and conditions of the GNU General Public8* License. See the file "COPYING" in the main directory of this archive9* for more details.10*/11#include <linux/init.h>12#include <linux/platform_device.h>13#include <asm/machvec.h>14#include <mach-se/mach/se7780.h>15#include <asm/io.h>16#include <asm/heartbeat.h>1718/* Heartbeat */19static struct resource heartbeat_resource = {20.start = PA_LED,21.end = PA_LED,22.flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,23};2425static struct platform_device heartbeat_device = {26.name = "heartbeat",27.id = -1,28.num_resources = 1,29.resource = &heartbeat_resource,30};3132/* SMC91x */33static struct resource smc91x_eth_resources[] = {34[0] = {35.name = "smc91x-regs" ,36.start = PA_LAN + 0x300,37.end = PA_LAN + 0x300 + 0x10 ,38.flags = IORESOURCE_MEM,39},40[1] = {41.start = SMC_IRQ,42.end = SMC_IRQ,43.flags = IORESOURCE_IRQ,44},45};4647static struct platform_device smc91x_eth_device = {48.name = "smc91x",49.id = 0,50.dev = {51.dma_mask = NULL, /* don't use dma */52.coherent_dma_mask = 0xffffffff,53},54.num_resources = ARRAY_SIZE(smc91x_eth_resources),55.resource = smc91x_eth_resources,56};5758static struct platform_device *se7780_devices[] __initdata = {59&heartbeat_device,60&smc91x_eth_device,61};6263static int __init se7780_devices_setup(void)64{65return platform_add_devices(se7780_devices,66ARRAY_SIZE(se7780_devices));67}68device_initcall(se7780_devices_setup);6970#define GPIO_PHCR 0xFFEA000E71#define GPIO_PMSELR 0xFFEA008072#define GPIO_PECR 0xFFEA00087374static void __init se7780_setup(char **cmdline_p)75{76/* "SH-Linux" on LED Display */77__raw_writew( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );78__raw_writew( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );79__raw_writew( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );80__raw_writew( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );81__raw_writew( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );82__raw_writew( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );83__raw_writew( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );84__raw_writew( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );8586printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");8788/*89* PCI REQ/GNT setting90* REQ0/GNT0 -> USB91* REQ1/GNT1 -> PC Card92* REQ2/GNT2 -> Serial ATA93* REQ3/GNT3 -> PCI slot94*/95__raw_writew(0x0213, FPGA_REQSEL);9697/* GPIO setting */98__raw_writew(0x0000, GPIO_PECR);99__raw_writew(__raw_readw(GPIO_PHCR)&0xfff3, GPIO_PHCR);100__raw_writew(0x0c00, GPIO_PMSELR);101102/* iVDR Power ON */103__raw_writew(0x0001, FPGA_IVDRPW);104}105106/*107* The Machine Vector108*/109static struct sh_machine_vector mv_se7780 __initmv = {110.mv_name = "Solution Engine 7780" ,111.mv_setup = se7780_setup ,112.mv_nr_irqs = 111 ,113.mv_init_irq = init_se7780_IRQ,114};115116117