Path: blob/master/arch/sh/boards/mach-sdk7780/setup.c
15126 views
/*1* arch/sh/boards/renesas/sdk7780/setup.c2*3* Renesas Solutions SH7780 SDK Support4* Copyright (C) 2008 Nicholas Beck <[email protected]>5*6* This file is subject to the terms and conditions of the GNU General Public7* License. See the file "COPYING" in the main directory of this archive8* for more details.9*/10#include <linux/init.h>11#include <linux/types.h>12#include <linux/platform_device.h>13#include <linux/ata_platform.h>14#include <asm/machvec.h>15#include <mach/sdk7780.h>16#include <asm/heartbeat.h>17#include <asm/io.h>18#include <asm/addrspace.h>1920#define GPIO_PECR 0xFFEA00082122/* Heartbeat */23static struct resource heartbeat_resource = {24.start = PA_LED,25.end = PA_LED,26.flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,27};2829static struct platform_device heartbeat_device = {30.name = "heartbeat",31.id = -1,32.num_resources = 1,33.resource = &heartbeat_resource,34};3536/* SMC91x */37static struct resource smc91x_eth_resources[] = {38[0] = {39.name = "smc91x-regs" ,40.start = PA_LAN + 0x300,41.end = PA_LAN + 0x300 + 0x10 ,42.flags = IORESOURCE_MEM,43},44[1] = {45.start = IRQ_ETHERNET,46.end = IRQ_ETHERNET,47.flags = IORESOURCE_IRQ,48},49};5051static struct platform_device smc91x_eth_device = {52.name = "smc91x",53.id = 0,54.dev = {55.dma_mask = NULL, /* don't use dma */56.coherent_dma_mask = 0xffffffff,57},58.num_resources = ARRAY_SIZE(smc91x_eth_resources),59.resource = smc91x_eth_resources,60};6162static struct platform_device *sdk7780_devices[] __initdata = {63&heartbeat_device,64&smc91x_eth_device,65};6667static int __init sdk7780_devices_setup(void)68{69return platform_add_devices(sdk7780_devices,70ARRAY_SIZE(sdk7780_devices));71}72device_initcall(sdk7780_devices_setup);7374static void __init sdk7780_setup(char **cmdline_p)75{76u16 ver = __raw_readw(FPGA_FPVERR);77u16 dateStamp = __raw_readw(FPGA_FPDATER);7879printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");80printk(KERN_INFO "Board version: %d (revision %d), "81"FPGA version: %d (revision %d), datestamp : %d\n",82(ver >> 12) & 0xf, (ver >> 8) & 0xf,83(ver >> 4) & 0xf, ver & 0xf,84dateStamp);8586/* Setup pin mux'ing for PCIC */87__raw_writew(0x0000, GPIO_PECR);88}8990/*91* The Machine Vector92*/93static struct sh_machine_vector mv_se7780 __initmv = {94.mv_name = "Renesas SDK7780-R3" ,95.mv_setup = sdk7780_setup,96.mv_nr_irqs = 111,97.mv_init_irq = init_sdk7780_IRQ,98};99100101102