2008-03-27 10:50:41 +00:00
|
|
|
#ifndef __ATA_PIIX_H__
|
|
|
|
#define __ATA_PIIX_H__
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
|
|
|
|
struct sata_ioports {
|
|
|
|
unsigned long cmd_addr;
|
|
|
|
unsigned long data_addr;
|
|
|
|
unsigned long error_addr;
|
|
|
|
unsigned long feature_addr;
|
|
|
|
unsigned long nsect_addr;
|
|
|
|
unsigned long lbal_addr;
|
|
|
|
unsigned long lbam_addr;
|
|
|
|
unsigned long lbah_addr;
|
|
|
|
unsigned long device_addr;
|
|
|
|
unsigned long status_addr;
|
|
|
|
unsigned long command_addr;
|
|
|
|
unsigned long altstatus_addr;
|
|
|
|
unsigned long ctl_addr;
|
|
|
|
unsigned long bmdma_addr;
|
|
|
|
unsigned long scr_addr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sata_port {
|
2007-05-15 21:38:05 +00:00
|
|
|
unsigned char port_no; /* primary=0, secondary=1 */
|
|
|
|
struct sata_ioports ioaddr; /* ATA cmd/ctl/dma reg blks */
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
unsigned char ctl_reg;
|
|
|
|
unsigned char last_ctl;
|
2007-06-30 16:50:48 +00:00
|
|
|
unsigned char port_state; /* 1-port is available and */
|
|
|
|
/* 0-port is not available */
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
unsigned char dev_mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
/***********SATA LIBRARY SPECIFIC DEFINITIONS AND DECLARATIONS**************/
|
2012-09-29 14:35:12 +00:00
|
|
|
#ifdef SATA_DECL /* SATA library specific declarations */
|
|
|
|
inline void ata_dump_id(u16 *id)
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
{
|
2012-09-29 14:35:12 +00:00
|
|
|
debug("49 = 0x%04x "
|
2008-03-27 10:50:41 +00:00
|
|
|
"53 = 0x%04x "
|
|
|
|
"63 = 0x%04x "
|
|
|
|
"64 = 0x%04x "
|
2012-09-29 14:35:12 +00:00
|
|
|
"75 = 0x%04x\n", id[49], id[53], id[63], id[64], id[75]);
|
|
|
|
debug("80 = 0x%04x "
|
2008-03-27 10:50:41 +00:00
|
|
|
"81 = 0x%04x "
|
|
|
|
"82 = 0x%04x "
|
|
|
|
"83 = 0x%04x "
|
2012-09-29 14:35:12 +00:00
|
|
|
"84 = 0x%04x\n", id[80], id[81], id[82], id[83], id[84]);
|
|
|
|
debug("88 = 0x%04x " "93 = 0x%04x\n", id[88], id[93]);
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SATA_DECL /*SATA library specific declarations */
|
2012-09-29 14:35:12 +00:00
|
|
|
int sata_bus_softreset(int num);
|
|
|
|
void sata_identify(int num, int dev);
|
|
|
|
void sata_port(struct sata_ioports *ioport);
|
|
|
|
void set_Feature_cmd(int num, int dev);
|
|
|
|
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);
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/************DRIVER SPECIFIC DEFINITIONS AND DECLARATIONS**************/
|
|
|
|
|
2012-09-29 14:35:12 +00:00
|
|
|
#ifdef DRV_DECL /* Driver specific declaration */
|
|
|
|
int init_sata(int dev);
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
#endif
|
|
|
|
|
2012-09-29 14:35:12 +00:00
|
|
|
#ifdef DRV_DECL /* Defines Driver Specific variables */
|
2008-10-16 13:01:15 +00:00
|
|
|
struct sata_port port[CONFIG_SYS_SATA_MAXBUS];
|
Add driver for S-ATA-controller on Intel processors with South
Bridge, ICH-5, ICH-6 and ICH-7.
Implementation:
1. Code is divided in to two files. All functions, which are
controller specific are kept in "drivers/ata_piix.c" file and
functions, which are not controller specific, are kept in
"common/cmd_sata.c" file.
2. Reading and Writing from the S-ATA drive is done using PIO method.
3. Driver can be configured for 48-bit addressing by defining macro
CONFIG_LBA48, if this macro is not defined driver uses the 28-bit
addressing.
4. S-ATA read function is hooked to the File system, commands like
ext2ls and ext2load file can be used. This has been tested.
5. U-Boot command "SATA_init" is added, which initializes the S-ATA
controller and identifies the S-ATA drives connected to it.
6. U-Boot command "sata" is added, which is used to read/write, print
partition table and get info about the drives present. This I have
implemented in same way as "ide" command is implemented in U-Boot.
7. This driver is for S-ATA in native mode.
8. This driver does not support the Native command queuing and
Hot-plugging.
Signed-off-by: Mushtaq Khan <mushtaq_k@procsys.com>
2007-04-20 08:53:02 +00:00
|
|
|
#endif
|
2008-03-27 10:50:41 +00:00
|
|
|
|
|
|
|
#endif /* __ATA_PIIX_H__ */
|