Linux Audio

Check our new training course

Loading...
v3.15
  1/*
  2 * SH-2007 board support.
  3 *
  4 * Copyright (C) 2003, 2004  SUGIOKA Toshinobu
  5 * Copyright (C) 2010  Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
  6 */
  7#include <linux/init.h>
  8#include <linux/irq.h>
  9#include <linux/regulator/fixed.h>
 10#include <linux/regulator/machine.h>
 11#include <linux/smsc911x.h>
 12#include <linux/platform_device.h>
 13#include <linux/ata_platform.h>
 14#include <linux/io.h>
 15#include <asm/machvec.h>
 16#include <mach/sh2007.h>
 17
 18/* Dummy supplies, where voltage doesn't matter */
 19static struct regulator_consumer_supply dummy_supplies[] = {
 20	REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
 21	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 22	REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
 23	REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
 24};
 25
 26struct smsc911x_platform_config smc911x_info = {
 27	.flags		= SMSC911X_USE_32BIT,
 28	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 29	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
 30};
 31
 32static struct resource smsc9118_0_resources[] = {
 33	[0] = {
 34		.start	= SMC0_BASE,
 35		.end	= SMC0_BASE + 0xff,
 36		.flags	= IORESOURCE_MEM,
 37	},
 38	[1] = {
 39		.start	= evt2irq(0x240),
 40		.end	= evt2irq(0x240),
 41		.flags	= IORESOURCE_IRQ,
 42	}
 43};
 44
 45static struct resource smsc9118_1_resources[] = {
 46	[0] = {
 47		.start	= SMC1_BASE,
 48		.end	= SMC1_BASE + 0xff,
 49		.flags	= IORESOURCE_MEM,
 50	},
 51	[1] = {
 52		.start	= evt2irq(0x280),
 53		.end	= evt2irq(0x280),
 54		.flags	= IORESOURCE_IRQ,
 55	}
 56};
 57
 58static struct platform_device smsc9118_0_device = {
 59	.name		= "smsc911x",
 60	.id		= 0,
 61	.num_resources	= ARRAY_SIZE(smsc9118_0_resources),
 62	.resource	= smsc9118_0_resources,
 63	.dev = {
 64		.platform_data = &smc911x_info,
 65	},
 66};
 67
 68static struct platform_device smsc9118_1_device = {
 69	.name		= "smsc911x",
 70	.id		= 1,
 71	.num_resources	= ARRAY_SIZE(smsc9118_1_resources),
 72	.resource	= smsc9118_1_resources,
 73	.dev = {
 74		.platform_data = &smc911x_info,
 75	},
 76};
 77
 78static struct resource cf_resources[] = {
 79	[0] = {
 80		.start	= CF_BASE + CF_OFFSET,
 81		.end	= CF_BASE + CF_OFFSET + 0x0f,
 82		.flags	= IORESOURCE_MEM,
 83	},
 84	[1] = {
 85		.start	= CF_BASE + CF_OFFSET + 0x206,
 86		.end	= CF_BASE + CF_OFFSET + 0x20f,
 87		.flags	= IORESOURCE_MEM,
 88	},
 89	[2] = {
 90		.start	= evt2irq(0x2c0),
 91		.end	= evt2irq(0x2c0),
 92		.flags	= IORESOURCE_IRQ,
 93	},
 94};
 95
 96static struct platform_device cf_device  = {
 97	.name		= "pata_platform",
 98	.id		= 0,
 99	.num_resources	= ARRAY_SIZE(cf_resources),
100	.resource	= cf_resources,
101};
102
103static struct platform_device *sh2007_devices[] __initdata = {
104	&smsc9118_0_device,
105	&smsc9118_1_device,
106	&cf_device,
107};
108
109static int __init sh2007_io_init(void)
110{
111	regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
112
113	platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
114	return 0;
115}
116subsys_initcall(sh2007_io_init);
117
118static void __init sh2007_init_irq(void)
119{
120	plat_irq_setup_pins(IRQ_MODE_IRQ);
121}
122
123/*
124 * Initialize the board
125 */
126static void __init sh2007_setup(char **cmdline_p)
127{
128	printk(KERN_INFO "SH-2007 Setup...");
129
130	/* setup wait control registers for area 5 */
131	__raw_writel(CS5BCR_D, CS5BCR);
132	__raw_writel(CS5WCR_D, CS5WCR);
133	__raw_writel(CS5PCR_D, CS5PCR);
134
135	printk(KERN_INFO " done.\n");
136}
137
138/*
139 * The Machine Vector
140 */
141struct sh_machine_vector mv_sh2007 __initmv = {
142	.mv_setup		= sh2007_setup,
143	.mv_name		= "sh2007",
144	.mv_init_irq		= sh2007_init_irq,
145};
v3.1
  1/*
  2 * SH-2007 board support.
  3 *
  4 * Copyright (C) 2003, 2004  SUGIOKA Toshinobu
  5 * Copyright (C) 2010  Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
  6 */
  7#include <linux/init.h>
  8#include <linux/irq.h>
 
 
  9#include <linux/smsc911x.h>
 10#include <linux/platform_device.h>
 11#include <linux/ata_platform.h>
 12#include <linux/io.h>
 13#include <asm/machvec.h>
 14#include <mach/sh2007.h>
 15
 
 
 
 
 
 
 
 
 16struct smsc911x_platform_config smc911x_info = {
 17	.flags		= SMSC911X_USE_32BIT,
 18	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 19	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
 20};
 21
 22static struct resource smsc9118_0_resources[] = {
 23	[0] = {
 24		.start	= SMC0_BASE,
 25		.end	= SMC0_BASE + 0xff,
 26		.flags	= IORESOURCE_MEM,
 27	},
 28	[1] = {
 29		.start	= evt2irq(0x240),
 30		.end	= evt2irq(0x240),
 31		.flags	= IORESOURCE_IRQ,
 32	}
 33};
 34
 35static struct resource smsc9118_1_resources[] = {
 36	[0] = {
 37		.start	= SMC1_BASE,
 38		.end	= SMC1_BASE + 0xff,
 39		.flags	= IORESOURCE_MEM,
 40	},
 41	[1] = {
 42		.start	= evt2irq(0x280),
 43		.end	= evt2irq(0x280),
 44		.flags	= IORESOURCE_IRQ,
 45	}
 46};
 47
 48static struct platform_device smsc9118_0_device = {
 49	.name		= "smsc911x",
 50	.id		= 0,
 51	.num_resources	= ARRAY_SIZE(smsc9118_0_resources),
 52	.resource	= smsc9118_0_resources,
 53	.dev = {
 54		.platform_data = &smc911x_info,
 55	},
 56};
 57
 58static struct platform_device smsc9118_1_device = {
 59	.name		= "smsc911x",
 60	.id		= 1,
 61	.num_resources	= ARRAY_SIZE(smsc9118_1_resources),
 62	.resource	= smsc9118_1_resources,
 63	.dev = {
 64		.platform_data = &smc911x_info,
 65	},
 66};
 67
 68static struct resource cf_resources[] = {
 69	[0] = {
 70		.start	= CF_BASE + CF_OFFSET,
 71		.end	= CF_BASE + CF_OFFSET + 0x0f,
 72		.flags	= IORESOURCE_MEM,
 73	},
 74	[1] = {
 75		.start	= CF_BASE + CF_OFFSET + 0x206,
 76		.end	= CF_BASE + CF_OFFSET + 0x20f,
 77		.flags	= IORESOURCE_MEM,
 78	},
 79	[2] = {
 80		.start	= evt2irq(0x2c0),
 81		.end	= evt2irq(0x2c0),
 82		.flags	= IORESOURCE_IRQ,
 83	},
 84};
 85
 86static struct platform_device cf_device  = {
 87	.name		= "pata_platform",
 88	.id		= 0,
 89	.num_resources	= ARRAY_SIZE(cf_resources),
 90	.resource	= cf_resources,
 91};
 92
 93static struct platform_device *sh2007_devices[] __initdata = {
 94	&smsc9118_0_device,
 95	&smsc9118_1_device,
 96	&cf_device,
 97};
 98
 99static int __init sh2007_io_init(void)
100{
 
 
101	platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
102	return 0;
103}
104subsys_initcall(sh2007_io_init);
105
106static void __init sh2007_init_irq(void)
107{
108	plat_irq_setup_pins(IRQ_MODE_IRQ);
109}
110
111/*
112 * Initialize the board
113 */
114static void __init sh2007_setup(char **cmdline_p)
115{
116	printk(KERN_INFO "SH-2007 Setup...");
117
118	/* setup wait control registers for area 5 */
119	__raw_writel(CS5BCR_D, CS5BCR);
120	__raw_writel(CS5WCR_D, CS5WCR);
121	__raw_writel(CS5PCR_D, CS5PCR);
122
123	printk(KERN_INFO " done.\n");
124}
125
126/*
127 * The Machine Vector
128 */
129struct sh_machine_vector mv_sh2007 __initmv = {
130	.mv_setup		= sh2007_setup,
131	.mv_name		= "sh2007",
132	.mv_init_irq		= sh2007_init_irq,
133};