blob: 71f315663cc964fb3c51f4b40963ea015b522b8c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/sh/boards/hp6xx/hp680/setup.c
3 *
4 * Copyright (C) 2002 Andriy Skulysh
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * Setup code for an HP680 (internal peripherials only)
10 */
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <asm/io.h>
Paul Mundt00258352006-01-16 22:14:08 -080014#include <asm/hd64461.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <asm/hp6xx/hp6xx.h>
16#include <asm/cpu/dac.h>
17
18const char *get_system_type(void)
19{
Paul Mundt00258352006-01-16 22:14:08 -080020 return "HP6xx";
Linus Torvalds1da177e2005-04-16 15:20:36 -070021}
22
23int __init platform_setup(void)
24{
Paul Mundt00258352006-01-16 22:14:08 -080025 u8 v8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 u16 v;
27 v = inw(HD64461_STBCR);
28 v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST |
29 HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST |
30 HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST |
31 HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST |
32 HD64461_STBCR_SAFECKE_IST;
Paul Mundt00258352006-01-16 22:14:08 -080033#ifndef CONFIG_HD64461_ENABLER
34 v |= HD64461_STBCR_SPC1ST;
35#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 outw(v, HD64461_STBCR);
37 v = inw(HD64461_GPADR);
38 v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
39 outw(v, HD64461_GPADR);
40
Paul Mundt00258352006-01-16 22:14:08 -080041 outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
42
43#ifndef CONFIG_HD64461_ENABLER
44 outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
45#endif
46
47 sh_dac_output(0, DAC_SPEAKER_VOLUME);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 sh_dac_disable(DAC_SPEAKER_VOLUME);
Paul Mundt00258352006-01-16 22:14:08 -080049 v8 = ctrl_inb(DACR);
50 v8 &= ~DACR_DAE;
51 ctrl_outb(v8,DACR);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53 return 0;
54}