2 * linux/arch/sh/boards/hp6xx/setup.c
4 * Copyright (C) 2002 Andriy Skulysh
5 * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com>
7 * May be copied or modified under the terms of the GNU General Public
8 * License. See linux/COPYING for more information.
10 * Setup code for an HP680 (internal peripherials only)
12 #include <linux/types.h>
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <asm/hd64461.h>
18 #include <asm/hp6xx.h>
19 #include <asm/cpu/dac.h>
21 #define SCPCR 0xa4000116
22 #define SCPDR 0xa4000136
25 static struct resource cf_ide_resources
[] = {
27 .start
= 0x15000000 + 0x1f0,
28 .end
= 0x15000000 + 0x1f0 + 0x08 - 0x01,
29 .flags
= IORESOURCE_MEM
,
32 .start
= 0x15000000 + 0x1fe,
33 .end
= 0x15000000 + 0x1fe + 0x01,
34 .flags
= IORESOURCE_MEM
,
38 .flags
= IORESOURCE_IRQ
,
42 static struct platform_device cf_ide_device
= {
43 .name
= "pata_platform",
45 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
46 .resource
= cf_ide_resources
,
49 static struct platform_device
*hp6xx_devices
[] __initdata
= {
53 static int __init
hp6xx_devices_setup(void)
55 return platform_add_devices(hp6xx_devices
, ARRAY_SIZE(hp6xx_devices
));
58 static void __init
hp6xx_setup(char **cmdline_p
)
63 v
= inw(HD64461_STBCR
);
64 v
|= HD64461_STBCR_SURTST
| HD64461_STBCR_SIRST
|
65 HD64461_STBCR_STM1ST
| HD64461_STBCR_STM0ST
|
66 HD64461_STBCR_SAFEST
| HD64461_STBCR_SPC0ST
|
67 HD64461_STBCR_SMIAST
| HD64461_STBCR_SAFECKE_OST
|
68 HD64461_STBCR_SAFECKE_IST
;
69 #ifndef CONFIG_HD64461_ENABLER
70 v
|= HD64461_STBCR_SPC1ST
;
72 outw(v
, HD64461_STBCR
);
73 v
= inw(HD64461_GPADR
);
74 v
|= HD64461_GPADR_SPEAKER
| HD64461_GPADR_PCMCIA0
;
75 outw(v
, HD64461_GPADR
);
77 outw(HD64461_PCCGCR_VCC0
| HD64461_PCCSCR_VCC1
, HD64461_PCC0GCR
);
79 #ifndef CONFIG_HD64461_ENABLER
80 outw(HD64461_PCCGCR_VCC0
| HD64461_PCCSCR_VCC1
, HD64461_PCC1GCR
);
83 sh_dac_output(0, DAC_SPEAKER_VOLUME
);
84 sh_dac_disable(DAC_SPEAKER_VOLUME
);
90 v8
|= SCPDR_TS_SCAN_X
| SCPDR_TS_SCAN_Y
;
91 v8
&= ~SCPDR_TS_SCAN_ENABLE
;
99 device_initcall(hp6xx_devices_setup
);
101 static struct sh_machine_vector mv_hp6xx __initmv
= {
103 .mv_setup
= hp6xx_setup
,
104 .mv_nr_irqs
= HD64461_IRQBASE
+ HD64461_IRQ_NUM
,
105 .mv_irq_demux
= hd64461_irq_demux
,