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/target/arm/archos/av300/ata-av300.c | 2 +- firmware/target/arm/archos/av300/ata-target.h | 8 ++++---- firmware/target/arm/ata-pp5002.c | 3 +-- firmware/target/arm/ata-pp5020.c | 3 +-- firmware/target/arm/ata-target.h | 17 +++++++---------- firmware/target/arm/imx31/ata-imx31.c | 3 +-- firmware/target/arm/imx31/ata-target.h | 8 +++----- firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c | 3 +-- firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h | 4 ---- .../arm/tms320dm320/creative-zvm/ata-creativezvm.c | 2 +- .../target/arm/tms320dm320/creative-zvm/ata-target.h | 6 ------ .../arm/tms320dm320/creative-zvm/dma-creativezvm.c | 2 +- firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c | 3 +-- firmware/target/arm/tms320dm320/mrobe-500/ata-target.h | 5 ----- firmware/target/coldfire/ata-target.h | 6 ------ firmware/target/coldfire/iaudio/ata-iaudio.c | 2 +- firmware/target/coldfire/iaudio/m3/ata-m3.c | 2 +- firmware/target/coldfire/iriver/ata-iriver.c | 2 +- firmware/target/coldfire/mpio/ata-mpio.c | 2 +- firmware/target/coldfire/mpio/ata-target.h | 6 ------ firmware/target/sh/archos/ata-archos.c | 2 +- firmware/target/sh/archos/ata-target.h | 6 ------ 22 files changed, 27 insertions(+), 70 deletions(-) (limited to 'firmware/target') diff --git a/firmware/target/arm/archos/av300/ata-av300.c b/firmware/target/arm/archos/av300/ata-av300.c index 08bee15fe6..e8623e5f16 100644 --- a/firmware/target/arm/archos/av300/ata-av300.c +++ b/firmware/target/arm/archos/av300/ata-av300.c @@ -30,7 +30,7 @@ #include #include "system.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset() { diff --git a/firmware/target/arm/archos/av300/ata-target.h b/firmware/target/arm/archos/av300/ata-target.h index bc3a19a6b4..5732f17045 100644 --- a/firmware/target/arm/archos/av300/ata-target.h +++ b/firmware/target/arm/archos/av300/ata-target.h @@ -19,6 +19,9 @@ * ****************************************************************************/ +#ifndef ATA_TARGET_H +#define ATA_TARGET_H + /* Plain C read & write loops */ #define ATA_IOBASE 0x02400000 @@ -33,7 +36,4 @@ #define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE + 0x340))) #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x380))) -void ata_reset(void); -void ata_enable(bool on); -bool ata_is_coldstart(void); -void ata_device_init(void); +#endif /* ATA_TARGET_H */ diff --git a/firmware/target/arm/ata-pp5002.c b/firmware/target/arm/ata-pp5002.c index 2c4bb3b3bc..5ab0e9ddc7 100644 --- a/firmware/target/arm/ata-pp5002.c +++ b/firmware/target/arm/ata-pp5002.c @@ -23,8 +23,7 @@ #include #include "system.h" -#include "ata.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset() { diff --git a/firmware/target/arm/ata-pp5020.c b/firmware/target/arm/ata-pp5020.c index 0eb64351f2..50e6e27c98 100644 --- a/firmware/target/arm/ata-pp5020.c +++ b/firmware/target/arm/ata-pp5020.c @@ -23,8 +23,7 @@ #include #include "system.h" -#include "ata.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset() { diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h index 779ebed070..616c451579 100644 --- a/firmware/target/arm/ata-target.h +++ b/firmware/target/arm/ata-target.h @@ -19,6 +19,11 @@ * ****************************************************************************/ +#ifndef ATA_TARGET_H +#define ATA_TARGET_H + +#include "config.h" + #ifdef CPU_PP #ifdef HAVE_BOOTLOADER_USB_MODE @@ -49,17 +54,11 @@ /* asm optimized reading and writing */ #define ATA_OPTIMIZED_READING #define ATA_OPTIMIZED_WRITING -void copy_read_sectors(unsigned char* buf, int wordcount); -void copy_write_sectors(const unsigned char* buf, int wordcount); #endif /* CONFIG_CPU */ #endif -void ata_reset(void); -bool ata_is_coldstart(void); -void ata_device_init(void); - #ifdef HAVE_ATA_DMA /* IDE DMA controller registers */ @@ -88,8 +87,6 @@ void ata_device_init(void); #define ATA_MAX_UDMA 1 #endif -void ata_dma_set_mode(unsigned char mode); -bool ata_dma_setup(void *addr, unsigned long bytes, bool write); -bool ata_dma_finish(void); - #endif /* HAVE_ATA_DMA */ + +#endif /* ATA_TARGET_H */ diff --git a/firmware/target/arm/imx31/ata-imx31.c b/firmware/target/arm/imx31/ata-imx31.c index 8a40c924ff..80539b9c9d 100644 --- a/firmware/target/arm/imx31/ata-imx31.c +++ b/firmware/target/arm/imx31/ata-imx31.c @@ -25,9 +25,8 @@ #include "system.h" #include "power.h" #include "panic.h" -#include "ata.h" +#include "ata-driver.h" #include "ata-defines.h" -#include "ata-target.h" #include "ccm-imx31.h" #ifdef HAVE_ATA_DMA #include "sdma-imx31.h" diff --git a/firmware/target/arm/imx31/ata-target.h b/firmware/target/arm/imx31/ata-target.h index 24141c6aa7..6893e83198 100644 --- a/firmware/target/arm/imx31/ata-target.h +++ b/firmware/target/arm/imx31/ata-target.h @@ -21,6 +21,8 @@ #ifndef ATA_TARGET_H #define ATA_TARGET_H +#include "config.h" + #ifdef BOOTLOADER #define ATA_DRIVER_CLOSE #endif @@ -46,12 +48,8 @@ #define ATA_COMMAND ATA_DRIVE_COMMAND #define ATA_CONTROL ATA_DRIVE_CONTROL -void ata_reset(void); -void ata_device_init(void); -bool ata_is_coldstart(void); -#define ATA_SET_DEVICE_FEATURES -void ata_set_pio_timings(int mode); +#define ATA_SET_PIO_TIMING #define ATA_TARGET_POLLING diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c index 8cd0260fe4..89b00bbd1d 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c @@ -26,8 +26,7 @@ #include "power.h" #include "panic.h" #include "pcf50606.h" -#include "ata.h" -#include "ata-target.h" +#include "ata-driver.h" #include "backlight-target.h" /* ARESET on C7C68300 and RESET on ATA interface (Active Low) */ diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h index 95cbaa11cf..7ca7d77c4f 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h +++ b/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h @@ -30,7 +30,6 @@ #define PREFER_C_WRITING #if !defined(BOOTLOADER) #define ATA_OPTIMIZED_READING -void copy_read_sectors(unsigned char* buf, int wordcount); #endif #define ATA_IOBASE 0x18000000 @@ -44,8 +43,5 @@ void copy_read_sectors(unsigned char* buf, int wordcount); #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x0E))) #define ATA_CONTROL (*((volatile unsigned char*)(0x20000000 + 0x1C))) -void ata_reset(void); -void ata_device_init(void); -bool ata_is_coldstart(void); #endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c index ad10502f2d..4ff39e2a9e 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c @@ -26,7 +26,7 @@ #include "system.h" #include "power.h" #include "panic.h" -#include "ata-target.h" +#include "ata-driver.h" #include "dm320.h" #include "ata.h" #include "string.h" diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h index 1a1648983d..5b66d192a5 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h @@ -32,8 +32,6 @@ #define copy_read_sectors dma_ata_read #define copy_write_sectors dma_ata_write */ -void copy_read_sectors(const unsigned char* buf, int wordcount); -void copy_write_sectors(const unsigned char* buf, int wordcount); /* Nasty hack, but Creative is nasty... */ #define ata_read_sectors _ata_read_sectors @@ -53,10 +51,6 @@ extern int _ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE+0xE))) #define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE+0x800C))) -void ata_reset(void); -void ata_device_init(void); -bool ata_is_coldstart(void); -void ide_power_enable(bool on); #ifdef BOOTLOADER int load_minifs_file(char* filename, unsigned char* location); #endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c index 6a74ff5e57..418a28ff09 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c @@ -26,7 +26,7 @@ #include "dma-target.h" #include "dm320.h" #include "ata.h" -#include "ata-target.h" +#include "ata-driver.h" #include "ata-defines.h" #include diff --git a/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c index 59f8464d76..1abe0843b3 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c @@ -27,8 +27,7 @@ #include "power.h" #include "panic.h" #include "pcf50606.h" -#include "ata.h" -#include "ata-target.h" +#include "ata-driver.h" #include "backlight-target.h" /* ARESET on C7C68300 and RESET on ATA interface (Active Low) */ diff --git a/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h b/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h index ca75876259..564ff3031f 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h +++ b/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h @@ -31,8 +31,6 @@ #define ATA_OPTIMIZED_READING #define ATA_OPTIMIZED_WRITING -void copy_read_sectors(const unsigned char* buf, int wordcount); -void copy_write_sectors(const unsigned char* buf, int wordcount); #endif #define ATA_IOBASE 0x50000000 @@ -49,8 +47,5 @@ void copy_write_sectors(const unsigned char* buf, int wordcount); #define ATA_COMMAND (*((volatile unsigned char*)(REGISTER_OFFSET + (0x07 << IDE_SHIFT)))) #define ATA_CONTROL (*((volatile unsigned char*)(CONTROL_OFFSET + (0x06 << IDE_SHIFT)))) -void ata_reset(void); -void ata_device_init(void); -bool ata_is_coldstart(void); #endif diff --git a/firmware/target/coldfire/ata-target.h b/firmware/target/coldfire/ata-target.h index 1a223e1eae..405dbcafe5 100644 --- a/firmware/target/coldfire/ata-target.h +++ b/firmware/target/coldfire/ata-target.h @@ -42,11 +42,5 @@ #define ATA_IN8(reg) ((reg) >> 8) #define ATA_IN16(reg) (swap16(reg)) -void ata_reset(void); -void ata_enable(bool on); -void ata_device_init(void); -bool ata_is_coldstart(void); -void copy_read_sectors(unsigned char* buf, int wordcount); -void copy_write_sectors(const unsigned char* buf, int wordcount); #endif diff --git a/firmware/target/coldfire/iaudio/ata-iaudio.c b/firmware/target/coldfire/iaudio/ata-iaudio.c index 4a70456ed2..91b6c87093 100644 --- a/firmware/target/coldfire/iaudio/ata-iaudio.c +++ b/firmware/target/coldfire/iaudio/ata-iaudio.c @@ -25,7 +25,7 @@ #include "system.h" #include "power.h" #include "pcf50606.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset(void) { diff --git a/firmware/target/coldfire/iaudio/m3/ata-m3.c b/firmware/target/coldfire/iaudio/m3/ata-m3.c index d82ca5a857..b3630798cf 100644 --- a/firmware/target/coldfire/iaudio/m3/ata-m3.c +++ b/firmware/target/coldfire/iaudio/m3/ata-m3.c @@ -25,7 +25,7 @@ #include "kernel.h" #include "system.h" #include "power.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset(void) { diff --git a/firmware/target/coldfire/iriver/ata-iriver.c b/firmware/target/coldfire/iriver/ata-iriver.c index d16943172c..1b8f475c4c 100644 --- a/firmware/target/coldfire/iriver/ata-iriver.c +++ b/firmware/target/coldfire/iriver/ata-iriver.c @@ -25,7 +25,7 @@ #include "system.h" #include "power.h" #include "pcf50606.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset(void) { diff --git a/firmware/target/coldfire/mpio/ata-mpio.c b/firmware/target/coldfire/mpio/ata-mpio.c index cf4276b5a0..af082640bf 100644 --- a/firmware/target/coldfire/mpio/ata-mpio.c +++ b/firmware/target/coldfire/mpio/ata-mpio.c @@ -25,7 +25,7 @@ #include "kernel.h" #include "system.h" #include "power.h" -#include "ata-target.h" +#include "ata-driver.h" void ata_reset(void) { diff --git a/firmware/target/coldfire/mpio/ata-target.h b/firmware/target/coldfire/mpio/ata-target.h index b2c8f15417..095a7fc1bd 100644 --- a/firmware/target/coldfire/mpio/ata-target.h +++ b/firmware/target/coldfire/mpio/ata-target.h @@ -36,11 +36,5 @@ #define ATA_SELECT (*((volatile unsigned short*)(ATA_IOBASE + 0x2c))) #define ATA_COMMAND (*((volatile unsigned short*)(ATA_IOBASE + 0x2e))) -void ata_reset(void); -void ata_enable(bool on); -void ata_device_init(void); -bool ata_is_coldstart(void); -void copy_read_sectors(unsigned char* buf, int wordcount); -void copy_write_sectors(const unsigned char* buf, int wordcount); #endif diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c index 6b58481b8b..2046d3b33f 100644 --- a/firmware/target/sh/archos/ata-archos.c +++ b/firmware/target/sh/archos/ata-archos.c @@ -24,7 +24,7 @@ #include #include "kernel.h" #include "system.h" -#include "ata-target.h" +#include "ata-driver.h" #include "hwcompat.h" #define ATA_CONTROL1 ((volatile unsigned char*)0x06200206) diff --git a/firmware/target/sh/archos/ata-target.h b/firmware/target/sh/archos/ata-target.h index fb343f4df4..dc55cdd5d5 100644 --- a/firmware/target/sh/archos/ata-target.h +++ b/firmware/target/sh/archos/ata-target.h @@ -41,11 +41,5 @@ extern volatile unsigned char* ata_control; -void ata_reset(void); -void ata_enable(bool on); -void ata_device_init(void); -bool ata_is_coldstart(void); -void copy_read_sectors(unsigned char* buf, int wordcount); -void copy_write_sectors(const unsigned char* buf, int wordcount); #endif -- cgit v1.2.3