Path: blob/master/arch/sh/boards/mach-se/7721/setup.c
15159 views
/*1* linux/arch/sh/boards/se/7721/setup.c2*3* Copyright (C) 2008 Renesas Solutions Corp.4*5* Hitachi UL SolutionEngine 7721 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*/12#include <linux/init.h>13#include <linux/platform_device.h>14#include <mach-se/mach/se7721.h>15#include <mach-se/mach/mrshpc.h>16#include <asm/machvec.h>17#include <asm/io.h>18#include <asm/heartbeat.h>1920static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };2122static struct heartbeat_data heartbeat_data = {23.bit_pos = heartbeat_bit_pos,24.nr_bits = ARRAY_SIZE(heartbeat_bit_pos),25};2627static struct resource heartbeat_resource = {28.start = PA_LED,29.end = PA_LED,30.flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,31};3233static struct platform_device heartbeat_device = {34.name = "heartbeat",35.id = -1,36.dev = {37.platform_data = &heartbeat_data,38},39.num_resources = 1,40.resource = &heartbeat_resource,41};4243static struct resource cf_ide_resources[] = {44[0] = {45.start = PA_MRSHPC_IO + 0x1f0,46.end = PA_MRSHPC_IO + 0x1f0 + 8 ,47.flags = IORESOURCE_IO,48},49[1] = {50.start = PA_MRSHPC_IO + 0x1f0 + 0x206,51.end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,52.flags = IORESOURCE_IO,53},54[2] = {55.start = MRSHPC_IRQ0,56.flags = IORESOURCE_IRQ,57},58};5960static struct platform_device cf_ide_device = {61.name = "pata_platform",62.id = -1,63.num_resources = ARRAY_SIZE(cf_ide_resources),64.resource = cf_ide_resources,65};6667static struct platform_device *se7721_devices[] __initdata = {68&cf_ide_device,69&heartbeat_device70};7172static int __init se7721_devices_setup(void)73{74mrshpc_setup_windows();75return platform_add_devices(se7721_devices, ARRAY_SIZE(se7721_devices));76}77device_initcall(se7721_devices_setup);7879static void __init se7721_setup(char **cmdline_p)80{81/* for USB */82__raw_writew(0x0000, 0xA405010C); /* PGCR */83__raw_writew(0x0000, 0xA405010E); /* PHCR */84__raw_writew(0x00AA, 0xA4050118); /* PPCR */85__raw_writew(0x0000, 0xA4050124); /* PSELA */86}8788/*89* The Machine Vector90*/91struct sh_machine_vector mv_se7721 __initmv = {92.mv_name = "Solution Engine 7721",93.mv_setup = se7721_setup,94.mv_nr_irqs = 109,95.mv_init_irq = init_se7721_IRQ,96};979899