Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
Paul Mundt | e5723e0 | 2006-09-27 17:38:11 +0900 | [diff] [blame^] | 11 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/init.h> |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame] | 13 | #include <asm/hd64461.h> |
Paul Mundt | e5723e0 | 2006-09-27 17:38:11 +0900 | [diff] [blame^] | 14 | #include <asm/io.h> |
| 15 | #include <asm/irq.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <asm/hp6xx/hp6xx.h> |
| 17 | #include <asm/cpu/dac.h> |
| 18 | |
Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 19 | #define SCPCR 0xa4000116 |
| 20 | #define SCPDR 0xa4000136 |
| 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | const char *get_system_type(void) |
| 23 | { |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame] | 24 | return "HP6xx"; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | int __init platform_setup(void) |
| 28 | { |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame] | 29 | u8 v8; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | u16 v; |
Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | v = inw(HD64461_STBCR); |
| 33 | v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST | |
| 34 | HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST | |
| 35 | HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST | |
| 36 | HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST | |
| 37 | HD64461_STBCR_SAFECKE_IST; |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame] | 38 | #ifndef CONFIG_HD64461_ENABLER |
| 39 | v |= HD64461_STBCR_SPC1ST; |
| 40 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | outw(v, HD64461_STBCR); |
| 42 | v = inw(HD64461_GPADR); |
| 43 | v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0; |
| 44 | outw(v, HD64461_GPADR); |
| 45 | |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame] | 46 | outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR); |
| 47 | |
| 48 | #ifndef CONFIG_HD64461_ENABLER |
| 49 | outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR); |
| 50 | #endif |
| 51 | |
| 52 | sh_dac_output(0, DAC_SPEAKER_VOLUME); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | sh_dac_disable(DAC_SPEAKER_VOLUME); |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame] | 54 | v8 = ctrl_inb(DACR); |
| 55 | v8 &= ~DACR_DAE; |
| 56 | ctrl_outb(v8,DACR); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 58 | v8 = ctrl_inb(SCPDR); |
| 59 | v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y; |
| 60 | v8 &= ~SCPDR_TS_SCAN_ENABLE; |
| 61 | ctrl_outb(v8, SCPDR); |
| 62 | |
| 63 | v = ctrl_inw(SCPCR); |
| 64 | v &= ~SCPCR_TS_MASK; |
| 65 | v |= SCPCR_TS_ENABLE; |
| 66 | ctrl_outw(v, SCPCR); |
| 67 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | return 0; |
| 69 | } |