Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2007 Dave Chapman |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | #include "ata.h" |
| 22 | #include "ata-target.h" |
| 23 | #include "ata_idle_notify.h" |
| 24 | #include "system.h" |
| 25 | #include <string.h> |
| 26 | #include "thread.h" |
| 27 | #include "led.h" |
| 28 | #include "disk.h" |
| 29 | #include "panic.h" |
| 30 | #include "usb.h" |
| 31 | |
| 32 | /* for compatibility */ |
| 33 | int ata_spinup_time = 0; |
| 34 | |
| 35 | long last_disk_activity = -1; |
| 36 | |
Dave Chapman | f204298 | 2008-05-02 19:12:09 +0000 | [diff] [blame] | 37 | /* Used to store (fake?) identify info */ |
| 38 | static unsigned short identify_info[256]; |
| 39 | |
Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 40 | /** static, private data **/ |
| 41 | static bool initialized = false; |
| 42 | |
| 43 | static long next_yield = 0; |
| 44 | #define MIN_YIELD_PERIOD 2000 |
| 45 | |
| 46 | /* API Functions */ |
| 47 | |
| 48 | void ata_led(bool onoff) |
| 49 | { |
| 50 | led(onoff); |
| 51 | } |
| 52 | |
| 53 | int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int incount, |
| 54 | void* inbuf) |
| 55 | { |
| 56 | |
| 57 | } |
| 58 | |
| 59 | int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, |
| 60 | const void* outbuf) |
| 61 | { |
| 62 | } |
| 63 | |
| 64 | void ata_spindown(int seconds) |
| 65 | { |
| 66 | (void)seconds; |
| 67 | } |
| 68 | |
| 69 | bool ata_disk_is_active(void) |
| 70 | { |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | void ata_sleep(void) |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | void ata_spin(void) |
| 79 | { |
| 80 | } |
| 81 | |
| 82 | /* Hardware reset protocol as specified in chapter 9.1, ATA spec draft v5 */ |
| 83 | int ata_hard_reset(void) |
| 84 | { |
| 85 | return 0; |
| 86 | } |
| 87 | |
| 88 | int ata_soft_reset(void) |
| 89 | { |
| 90 | return 0; |
| 91 | } |
| 92 | |
| 93 | void ata_enable(bool on) |
| 94 | { |
| 95 | } |
| 96 | |
| 97 | int ata_init(void) |
| 98 | { |
Dave Chapman | f204298 | 2008-05-02 19:12:09 +0000 | [diff] [blame] | 99 | return 0; |
| 100 | } |
| 101 | |
| 102 | /* TEMP: This will return junk, it's here for compilation only */ |
| 103 | unsigned short* ata_get_identify(void) |
| 104 | { |
| 105 | return identify_info; |
Dave Chapman | 28f6ae4 | 2007-10-28 11:08:10 +0000 | [diff] [blame] | 106 | } |