summaryrefslogtreecommitdiff
path: root/firmware/target/sh/archos/ata-archos.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/sh/archos/ata-archos.c')
-rw-r--r--firmware/target/sh/archos/ata-archos.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c
deleted file mode 100644
index 2046d3b33f..0000000000
--- a/firmware/target/sh/archos/ata-archos.c
+++ /dev/null
@@ -1,71 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "cpu.h"
24#include <stdbool.h>
25#include "kernel.h"
26#include "system.h"
27#include "ata-driver.h"
28#include "hwcompat.h"
29
30#define ATA_CONTROL1 ((volatile unsigned char*)0x06200206)
31#define ATA_CONTROL2 ((volatile unsigned char*)0x06200306)
32
33volatile unsigned char* ata_control;
34
35void ata_reset(void)
36{
37 /* state HRR0 */
38 and_b(~0x02, &PADRH); /* assert _RESET */
39 sleep(1); /* > 25us */
40
41 /* state HRR1 */
42 or_b(0x02, &PADRH); /* negate _RESET */
43 sleep(1); /* > 2ms */
44}
45
46void ata_enable(bool on)
47{
48 if(on)
49 and_b(~0x80, &PADRL); /* enable ATA */
50 else
51 or_b(0x80, &PADRL); /* disable ATA */
52
53 or_b(0x80, &PAIORL);
54}
55
56void ata_device_init(void)
57{
58 or_b(0x02, &PAIORH); /* output for ATA reset */
59 or_b(0x02, &PADRH); /* release ATA reset */
60 PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */
61
62 if (HW_MASK & ATA_ADDRESS_200)
63 ata_control = ATA_CONTROL1;
64 else
65 ata_control = ATA_CONTROL2;
66}
67
68bool ata_is_coldstart(void)
69{
70 return (PACR2 & 0x4000) != 0;
71}