From e4dbcc414b4b91ceb6b5e80a4ad49e4270fee096 Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Thu, 8 Dec 2011 21:23:53 +0000 Subject: FS#12418 - Merge prototypes from ata-target.h files into new file ata-driver.h. After this change: - ata.h is for users of ata.c - ata-driver.h is for functions implemented by target-specific code and used by ata.c - ata-target.h is for target-specific defines git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31182 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/ata-driver.h | 69 ++++++++++++++++++++++++++++++++++++++++++++ firmware/export/ata.h | 8 ----- 2 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 firmware/export/ata-driver.h (limited to 'firmware/export') diff --git a/firmware/export/ata-driver.h b/firmware/export/ata-driver.h new file mode 100644 index 0000000000..8711b2145f --- /dev/null +++ b/firmware/export/ata-driver.h @@ -0,0 +1,69 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2011 by Boris Gjenero + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef __ATA_DRIVER_H__ +#define __ATA_DRIVER_H__ + +#include "config.h" /* for HAVE_ATA_DMA */ +#include "ata-target.h" /* for other target-specific defines */ + + /* Returns true if the interface hasn't been initialised yet */ +bool ata_is_coldstart(void); +/* Initializes the interface */ +void ata_device_init(void); +/* ata_enable(true) is used after ata_device_init() to enable the interface + * ata_enable(false) is used to disable the interface so + * an ATA to USB bridge chip can use it instead.*/ +void ata_enable(bool on); +/* ATA hard reset: pulse the RESET pin */ +void ata_reset(void); + +/* Optional optimized target-specific PIO transfer */ +#ifdef ATA_OPTIMIZED_READING +void copy_read_sectors(unsigned char* buf, int wordcount); +#endif +#ifdef ATA_OPTIMIZED_WRITING +void copy_write_sectors(const unsigned char* buf, int wordcount); +#endif + +/* Optional target-specific waiting */ +#ifdef ATA_TARGET_POLLING +int ata_wait_for_bsy(void); +int ata_wait_for_rdy(void); +#endif + +/* Optional setting of controller timings for PIO mode */ +#ifdef ATA_SET_PIO_TIMING +void ata_set_pio_timings(int mode); +#endif + +#ifdef HAVE_ATA_DMA +/* Used to update last disk activity time while waiting for DMA */ +void ata_keep_active(void); +/* Set DMA mode for ATA interface */ +void ata_dma_set_mode(unsigned char mode); +/* Sets up DMA transfer */ +bool ata_dma_setup(void *addr, unsigned long bytes, bool write); +/* Waits for DMA transfer completion */ +bool ata_dma_finish(void); +#endif /* HAVE_ATA_DMA */ + +#endif /* __ATA_DRIVER_H__ */ diff --git a/firmware/export/ata.h b/firmware/export/ata.h index a3537812e5..41a2fd5c9f 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h @@ -65,16 +65,8 @@ long ata_last_disk_activity(void); int ata_spinup_time(void); /* ticks */ #ifdef HAVE_ATA_DMA -/* Needed to allow updating while waiting for DMA to complete */ -void ata_keep_active(void); /* Returns current DMA mode */ int ata_get_dma_mode(void); -/* Set DMA mode for ATA interface */ -void ata_dma_set_mode(unsigned char mode); -/* Sets up DMA transfer */ -bool ata_dma_setup(void *addr, unsigned long bytes, bool write); -/* Waits for DMA transfer completion */ -bool ata_dma_finish(void); #endif /* HAVE_ATA_DMA */ #endif /* __ATA_H__ */ -- cgit v1.2.3