blob: db03095e3d5bd070a7497e0e14a202d30b2db9ef [file] [log] [blame]
Marcin Bukat28d54c62010-04-26 21:40:16 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Marcin Bukat082c7d32010-10-22 12:28:43 +00008 * $Id$
Marcin Bukat28d54c62010-04-26 21:40:16 +00009 *
10 * Copyright (C) 2010 Marcin Bukat
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 "power.h"
28#include "ata-target.h"
29
30void ata_reset(void)
31{
32 /* GPIO19 */
33 and_l(~(1<<19), &GPIO_OUT);
34 sleep(1); /* > 25us */
35
36 or_l((1<<19), &GPIO_OUT);
37 sleep(1); /* > 25us */
38}
39
40void ata_enable(bool on)
41{
42 (void)on;
43}
44
45/* to be fixed */
46bool ata_is_coldstart(void)
47{
48 return true;
49}
50
51void ata_device_init(void)
52{
53 /* ATA reset line config */
54 or_l((1<<19), &GPIO_OUT);
55 or_l((1<<19), &GPIO_ENABLE);
56 or_l((1<<19), &GPIO_FUNCTION);
57}