From: Pavel Herrmann Date: Thu, 27 Sep 2012 23:18:04 +0000 (+0000) Subject: sata.h: Make all sata/ata drivers include X-Git-Tag: v2013.01-rc1~252 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e46a4350b484cf7bc4ab861967bf303fc439c9e0;p=oweals%2Fu-boot.git sata.h: Make all sata/ata drivers include - block_dev_desc_t says that block_(read|write) take lbaint_t for blkcnt not ulong. - We also move the extern of sata_dev_desc into - Remove now duplicate declarations from driver-specific headers. Signed-off-by: Tom Rini Signed-off-by: Pavel Herrmann --- diff --git a/drivers/block/ata_piix.c b/drivers/block/ata_piix.c index dd411f12d6..1e33a66c45 100644 --- a/drivers/block/ata_piix.c +++ b/drivers/block/ata_piix.c @@ -34,9 +34,7 @@ #include #include #include - -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; -extern int sata_curr_device; +#include #define DEBUG_SATA 0 /* For debug prints set DEBUG_SATA to 1 */ diff --git a/drivers/block/ata_piix.h b/drivers/block/ata_piix.h index 85a8843a2d..6c68ea2f01 100644 --- a/drivers/block/ata_piix.h +++ b/drivers/block/ata_piix.h @@ -56,8 +56,6 @@ int sata_devchk(struct sata_ioports *ioaddr, int dev); void dev_select(struct sata_ioports *ioaddr, int dev); u8 sata_busy_wait(struct sata_ioports *ioaddr, int bits, unsigned int max); u8 sata_chk_status(struct sata_ioports *ioaddr); -ulong sata_read(int device, ulong blknr,lbaint_t blkcnt, void *buffer); -ulong sata_write(int device,ulong blknr, lbaint_t blkcnt, const void *buffer); #endif /************DRIVER SPECIFIC DEFINITIONS AND DECLARATIONS**************/ diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c index 70752d2869..c9b71f7e1f 100644 --- a/drivers/block/dwc_ahsata.c +++ b/drivers/block/dwc_ahsata.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/drivers/block/dwc_ahsata.h b/drivers/block/dwc_ahsata.h index 84860ea492..4dac5dcae2 100644 --- a/drivers/block/dwc_ahsata.h +++ b/drivers/block/dwc_ahsata.h @@ -330,6 +330,4 @@ #define READ_CMD 0 #define WRITE_CMD 1 -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; - #endif /* __FSL_SATA_H__ */ diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c index ed4647f837..fda3389e8b 100644 --- a/drivers/block/fsl_sata.c +++ b/drivers/block/fsl_sata.c @@ -26,10 +26,9 @@ #include #include #include +#include #include "fsl_sata.h" -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; - #ifndef CONFIG_SYS_SATA1_FLAGS #define CONFIG_SYS_SATA1_FLAGS FLAGS_DMA #endif diff --git a/drivers/block/pata_bfin.c b/drivers/block/pata_bfin.c index 2b4437efd3..b847dd91e7 100644 --- a/drivers/block/pata_bfin.c +++ b/drivers/block/pata_bfin.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "pata_bfin.h" diff --git a/drivers/block/pata_bfin.h b/drivers/block/pata_bfin.h index 2b3425bc95..2093cf06b4 100644 --- a/drivers/block/pata_bfin.h +++ b/drivers/block/pata_bfin.h @@ -41,8 +41,6 @@ struct ata_port { unsigned char dev_mask; }; -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; - #define DRV_NAME "pata-bfin" #define DRV_VERSION "0.9" #define __iomem diff --git a/drivers/block/sata_dwc.c b/drivers/block/sata_dwc.c index cc4446ad7b..28d87f538b 100644 --- a/drivers/block/sata_dwc.c +++ b/drivers/block/sata_dwc.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "sata_dwc.h" @@ -268,8 +269,6 @@ static int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, unsigned int flags, u16 *id); static int check_sata_dev_state(void); -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; - static const struct ata_port_info sata_dwc_port_info[] = { { .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | diff --git a/drivers/block/sata_sil.c b/drivers/block/sata_sil.c index 27cfa3da93..245b872f99 100644 --- a/drivers/block/sata_sil.c +++ b/drivers/block/sata_sil.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "sata_sil.h" diff --git a/drivers/block/sata_sil.h b/drivers/block/sata_sil.h index 2dfd4a5e54..9f3a37f508 100644 --- a/drivers/block/sata_sil.h +++ b/drivers/block/sata_sil.h @@ -24,8 +24,6 @@ #define READ_CMD 0 #define WRITE_CMD 1 -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; - /* * SATA device driver struct for each dev */ diff --git a/drivers/block/sata_sil3114.c b/drivers/block/sata_sil3114.c index 34fe038608..3a5e0328f5 100644 --- a/drivers/block/sata_sil3114.c +++ b/drivers/block/sata_sil3114.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "sata_sil3114.h" @@ -48,7 +49,6 @@ static u8 sata_chk_status (struct sata_ioports *ioaddr, u8 usealtstatus); static void msleep (int count); static u32 iobase[6] = { 0, 0, 0, 0, 0, 0}; /* PCI BAR registers for device */ -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; static struct sata_port port[CONFIG_SYS_SATA_MAX_DEVICE]; diff --git a/include/sata.h b/include/sata.h index 37573cfee2..c95dc56e94 100644 --- a/include/sata.h +++ b/include/sata.h @@ -1,12 +1,15 @@ #ifndef __SATA_H__ #define __SATA_H__ +#include int init_sata(int dev); int scan_sata(int dev); -ulong sata_read(int dev, ulong blknr, ulong blkcnt, void *buffer); -ulong sata_write(int dev, ulong blknr, ulong blkcnt, const void *buffer); +ulong sata_read(int dev, ulong blknr, lbaint_t blkcnt, void *buffer); +ulong sata_write(int dev, ulong blknr, lbaint_t blkcnt, const void *buffer); int sata_initialize(void); int __sata_initialize(void); +extern block_dev_desc_t sata_dev_desc[]; + #endif