未验证 提交 25717315 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!430 [openEuler-1.0-LTS] ata: sata_zhaoxin: Update Zhaoxin Serial ATA product name

Merge Pull Request from: @leoliu-oc 
 
Change internal project name to external product name.

### Issue
https://gitee.com/openeuler/kernel/issues/I6J0SW

### Test
N/A

### Knowe Issue
N/A

### Default config change
N/A 
 
Link:https://gitee.com/openeuler/kernel/pulls/430 

Reviewed-by: Wei Li <liwei391@huawei.com> 
......@@ -18,7 +18,7 @@
#define DRV_VERSION "2.6.1"
enum board_ids_enum {
cnd001,
zx100s,
};
enum {
......@@ -37,25 +37,25 @@ enum {
SATA_EXT_PHY = (1 << 6), /* 0==use PATA, 1==ext phy */
};
static int szx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static int cnd001_scr_read(struct ata_link *link, unsigned int scr, u32 *val);
static int cnd001_scr_write(struct ata_link *link, unsigned int scr, u32 val);
static int szx_hardreset(struct ata_link *link, unsigned int *class,
static int zx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static int zx_scr_read(struct ata_link *link, unsigned int scr, u32 *val);
static int zx_scr_write(struct ata_link *link, unsigned int scr, u32 val);
static int zx_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline);
static void szx_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
static void zx_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
static const struct pci_device_id szx_pci_tbl[] = {
{ PCI_VDEVICE(ZHAOXIN, 0x9002), cnd001 },
{ PCI_VDEVICE(ZHAOXIN, 0x9003), cnd001 },
static const struct pci_device_id zx_pci_tbl[] = {
{ PCI_VDEVICE(ZHAOXIN, 0x9002), zx100s },
{ PCI_VDEVICE(ZHAOXIN, 0x9003), zx100s },
{ } /* terminate list */
};
static struct pci_driver szx_pci_driver = {
static struct pci_driver zx_pci_driver = {
.name = DRV_NAME,
.id_table = szx_pci_tbl,
.probe = szx_init_one,
.id_table = zx_pci_tbl,
.probe = zx_init_one,
#ifdef CONFIG_PM_SLEEP
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
......@@ -63,32 +63,32 @@ static struct pci_driver szx_pci_driver = {
.remove = ata_pci_remove_one,
};
static struct scsi_host_template szx_sht = {
static struct scsi_host_template zx_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};
static struct ata_port_operations szx_base_ops = {
static struct ata_port_operations zx_base_ops = {
.inherits = &ata_bmdma_port_ops,
.sff_tf_load = szx_tf_load,
.sff_tf_load = zx_tf_load,
};
static struct ata_port_operations cnd001_ops = {
.inherits = &szx_base_ops,
.hardreset = szx_hardreset,
.scr_read = cnd001_scr_read,
.scr_write = cnd001_scr_write,
static struct ata_port_operations zx_ops = {
.inherits = &zx_base_ops,
.hardreset = zx_hardreset,
.scr_read = zx_scr_read,
.scr_write = zx_scr_write,
};
static struct ata_port_info cnd001_port_info = {
static struct ata_port_info zx100s_port_info = {
.flags = ATA_FLAG_SATA | ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA6,
.port_ops = &cnd001_ops,
.port_ops = &zx_ops,
};
static int szx_hardreset(struct ata_link *link, unsigned int *class,
static int zx_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
int rc;
......@@ -120,7 +120,7 @@ static int szx_hardreset(struct ata_link *link, unsigned int *class,
return rc;
}
static int cnd001_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
static int zx_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
{
static const u8 ipm_tbl[] = { 1, 2, 6, 0 };
struct pci_dev *pdev = to_pci_dev(link->ap->host->dev);
......@@ -168,7 +168,7 @@ static int cnd001_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
return 0;
}
static int cnd001_scr_write(struct ata_link *link, unsigned int scr, u32 val)
static int zx_scr_write(struct ata_link *link, unsigned int scr, u32 val)
{
struct pci_dev *pdev = to_pci_dev(link->ap->host->dev);
int slot = 2 * link->ap->port_no + link->pmp;
......@@ -204,7 +204,7 @@ static int cnd001_scr_write(struct ata_link *link, unsigned int scr, u32 val)
/**
* szx_tf_load - send taskfile registers to host controller
* zx_tf_load - send taskfile registers to host controller
* @ap: Port to which output is sent
* @tf: ATA taskfile register set
*
......@@ -214,7 +214,7 @@ static int cnd001_scr_write(struct ata_link *link, unsigned int scr, u32 val)
* reset the device register after changing the IEN bit on ctl
* register.
*/
static void szx_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
static void zx_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
{
struct ata_taskfile ttf;
......@@ -226,25 +226,25 @@ static void szx_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
ata_sff_tf_load(ap, tf);
}
static const unsigned int szx_bar_sizes[] = {
static const unsigned int zx_bar_sizes[] = {
8, 4, 8, 4, 16, 256
};
static const unsigned int cnd001_bar_sizes0[] = {
static const unsigned int zx100s_bar_sizes0[] = {
8, 4, 8, 4, 16, 0
};
static const unsigned int cnd001_bar_sizes1[] = {
static const unsigned int zx100s_bar_sizes1[] = {
8, 4, 0, 0, 16, 0
};
static int cnd001_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
static int zx_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
{
const struct ata_port_info *ppi0[] = {
&cnd001_port_info, NULL
&zx100s_port_info, NULL
};
const struct ata_port_info *ppi1[] = {
&cnd001_port_info, &ata_dummy_port_info
&zx100s_port_info, &ata_dummy_port_info
};
struct ata_host *host;
int i, rc;
......@@ -261,15 +261,15 @@ static int cnd001_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
*r_host = host;
/* cnd001 9002 hosts four sata ports as M/S of the two channels */
/* cnd001 9003 hosts two sata ports as M/S of the one channel */
/* 9002 hosts four sata ports as M/S of the two channels */
/* 9003 hosts two sata ports as M/S of the one channel */
for (i = 0; i < host->n_ports; i++)
ata_slave_link_init(host->ports[i]);
return 0;
}
static void szx_configure(struct pci_dev *pdev, int board_id)
static void zx_configure(struct pci_dev *pdev, int board_id)
{
u8 tmp8;
......@@ -306,7 +306,7 @@ static void szx_configure(struct pci_dev *pdev, int board_id)
}
}
static int szx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
static int zx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
unsigned int i;
int rc;
......@@ -335,14 +335,14 @@ static int szx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
return rc;
if (board_id == cnd001 && pdev->device == 0x9002)
bar_sizes = &cnd001_bar_sizes0[0];
else if (board_id == cnd001 && pdev->device == 0x9003)
bar_sizes = &cnd001_bar_sizes1[0];
if (board_id == zx100s && pdev->device == 0x9002)
bar_sizes = &zx100s_bar_sizes0[0];
else if (board_id == zx100s && pdev->device == 0x9003)
bar_sizes = &zx100s_bar_sizes1[0];
else
bar_sizes = &szx_bar_sizes[0];
bar_sizes = &zx_bar_sizes[0];
for (i = 0; i < ARRAY_SIZE(szx_bar_sizes); i++) {
for (i = 0; i < ARRAY_SIZE(zx_bar_sizes); i++) {
if ((pci_resource_start(pdev, i) == 0) ||
(pci_resource_len(pdev, i) < bar_sizes[i])) {
if (bar_sizes[i] == 0)
......@@ -359,8 +359,8 @@ static int szx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
switch (board_id) {
case cnd001:
rc = cnd001_prepare_host(pdev, &host);
case zx100s:
rc = zx_prepare_host(pdev, &host);
break;
default:
rc = -EINVAL;
......@@ -368,17 +368,17 @@ static int szx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
return rc;
szx_configure(pdev, board_id);
zx_configure(pdev, board_id);
pci_set_master(pdev);
return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
IRQF_SHARED, &szx_sht);
IRQF_SHARED, &zx_sht);
}
module_pci_driver(szx_pci_driver);
module_pci_driver(zx_pci_driver);
MODULE_AUTHOR("Yanchen:YanchenSun@zhaoxin.com");
MODULE_DESCRIPTION("SCSI low-level driver for ZX SATA controllers");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, szx_pci_tbl);
MODULE_DEVICE_TABLE(pci, zx_pci_tbl);
MODULE_VERSION(DRV_VERSION);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册