Marcin Bukat | 28d54c6 | 2010-04-26 21:40:16 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Marcin Bukat | 082c7d3 | 2010-10-22 12:28:43 +0000 | [diff] [blame^] | 8 | * $Id$ |
Marcin Bukat | 28d54c6 | 2010-04-26 21:40:16 +0000 | [diff] [blame] | 9 | * |
| 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 | |
| 30 | void 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 | |
| 40 | void ata_enable(bool on) |
| 41 | { |
| 42 | (void)on; |
| 43 | } |
| 44 | |
| 45 | /* to be fixed */ |
| 46 | bool ata_is_coldstart(void) |
| 47 | { |
| 48 | return true; |
| 49 | } |
| 50 | |
| 51 | void 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 | } |