提交 f11c5403 编写于 作者: H Hannes Reinecke 提交者: Damien Le Moal

ata: sata_sx4: add module parameter 'dimm_test'

Add module parameter 'dimm_test' to enable DIMM testing during startup.
Signed-off-by: NHannes Reinecke <hare@suse.de>
Signed-off-by: NDamien Le Moal <damien.lemoal@opensource.wdc.com>
上级 bc21c105
...@@ -78,6 +78,9 @@ ...@@ -78,6 +78,9 @@
#define DRV_NAME "sata_sx4" #define DRV_NAME "sata_sx4"
#define DRV_VERSION "0.12" #define DRV_VERSION "0.12"
static int dimm_test;
module_param(dimm_test, int, 0644);
MODULE_PARM_DESC(dimm_test, "Enable DIMM test during startup (1 = enabled)");
enum { enum {
PDC_MMIO_BAR = 3, PDC_MMIO_BAR = 3,
...@@ -211,10 +214,8 @@ static unsigned int pdc20621_i2c_read(struct ata_host *host, ...@@ -211,10 +214,8 @@ static unsigned int pdc20621_i2c_read(struct ata_host *host,
u32 device, u32 subaddr, u32 *pdata); u32 device, u32 subaddr, u32 *pdata);
static int pdc20621_prog_dimm0(struct ata_host *host); static int pdc20621_prog_dimm0(struct ata_host *host);
static unsigned int pdc20621_prog_dimm_global(struct ata_host *host); static unsigned int pdc20621_prog_dimm_global(struct ata_host *host);
#ifdef ATA_VERBOSE_DEBUG
static void pdc20621_get_from_dimm(struct ata_host *host, static void pdc20621_get_from_dimm(struct ata_host *host,
void *psource, u32 offset, u32 size); void *psource, u32 offset, u32 size);
#endif
static void pdc20621_put_to_dimm(struct ata_host *host, static void pdc20621_put_to_dimm(struct ata_host *host,
void *psource, u32 offset, u32 size); void *psource, u32 offset, u32 size);
static void pdc20621_irq_clear(struct ata_port *ap); static void pdc20621_irq_clear(struct ata_port *ap);
...@@ -575,7 +576,6 @@ static void pdc20621_pop_hdma(struct ata_queued_cmd *qc) ...@@ -575,7 +576,6 @@ static void pdc20621_pop_hdma(struct ata_queued_cmd *qc)
pp->hdma_cons++; pp->hdma_cons++;
} }
#ifdef ATA_VERBOSE_DEBUG
static void pdc20621_dump_hdma(struct ata_queued_cmd *qc) static void pdc20621_dump_hdma(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
...@@ -585,14 +585,10 @@ static void pdc20621_dump_hdma(struct ata_queued_cmd *qc) ...@@ -585,14 +585,10 @@ static void pdc20621_dump_hdma(struct ata_queued_cmd *qc)
dimm_mmio += (port_no * PDC_DIMM_WINDOW_STEP); dimm_mmio += (port_no * PDC_DIMM_WINDOW_STEP);
dimm_mmio += PDC_DIMM_HOST_PKT; dimm_mmio += PDC_DIMM_HOST_PKT;
printk(KERN_ERR "HDMA[0] == 0x%08X\n", readl(dimm_mmio)); ata_port_dbg(ap, "HDMA 0x%08X 0x%08X 0x%08X 0x%08X\n",
printk(KERN_ERR "HDMA[1] == 0x%08X\n", readl(dimm_mmio + 4)); readl(dimm_mmio), readl(dimm_mmio + 4),
printk(KERN_ERR "HDMA[2] == 0x%08X\n", readl(dimm_mmio + 8)); readl(dimm_mmio + 8), readl(dimm_mmio + 12));
printk(KERN_ERR "HDMA[3] == 0x%08X\n", readl(dimm_mmio + 12));
} }
#else
static inline void pdc20621_dump_hdma(struct ata_queued_cmd *qc) { }
#endif /* ATA_VERBOSE_DEBUG */
static void pdc20621_packet_start(struct ata_queued_cmd *qc) static void pdc20621_packet_start(struct ata_queued_cmd *qc)
{ {
...@@ -938,7 +934,6 @@ static void pdc_sata_setup_port(struct ata_ioports *port, void __iomem *base) ...@@ -938,7 +934,6 @@ static void pdc_sata_setup_port(struct ata_ioports *port, void __iomem *base)
} }
#ifdef ATA_VERBOSE_DEBUG
static void pdc20621_get_from_dimm(struct ata_host *host, void *psource, static void pdc20621_get_from_dimm(struct ata_host *host, void *psource,
u32 offset, u32 size) u32 offset, u32 size)
{ {
...@@ -988,7 +983,6 @@ static void pdc20621_get_from_dimm(struct ata_host *host, void *psource, ...@@ -988,7 +983,6 @@ static void pdc20621_get_from_dimm(struct ata_host *host, void *psource,
memcpy_fromio(psource, dimm_mmio, size / 4); memcpy_fromio(psource, dimm_mmio, size / 4);
} }
} }
#endif
static void pdc20621_put_to_dimm(struct ata_host *host, void *psource, static void pdc20621_put_to_dimm(struct ata_host *host, void *psource,
...@@ -1301,8 +1295,7 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host) ...@@ -1301,8 +1295,7 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
return 1; return 1;
} }
#ifdef ATA_VERBOSE_DEBUG if (dimm_test) {
{
u8 test_parttern1[40] = u8 test_parttern1[40] =
{0x55,0xAA,'P','r','o','m','i','s','e',' ', {0x55,0xAA,'P','r','o','m','i','s','e',' ',
'N','o','t',' ','Y','e','t',' ', 'N','o','t',' ','Y','e','t',' ',
...@@ -1316,19 +1309,20 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host) ...@@ -1316,19 +1309,20 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
pdc20621_put_to_dimm(host, test_parttern1, 0x10040, 40); pdc20621_put_to_dimm(host, test_parttern1, 0x10040, 40);
pdc20621_get_from_dimm(host, test_parttern2, 0x40, 40); pdc20621_get_from_dimm(host, test_parttern2, 0x40, 40);
printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], dev_info(host->dev, "DIMM test pattern 1: %x, %x, %s\n", test_parttern2[0],
test_parttern2[1], &(test_parttern2[2])); test_parttern2[1], &(test_parttern2[2]));
pdc20621_get_from_dimm(host, test_parttern2, 0x10040, pdc20621_get_from_dimm(host, test_parttern2, 0x10040,
40); 40);
printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], dev_info(host->dev, "DIMM test pattern 2: %x, %x, %s\n",
test_parttern2[1], &(test_parttern2[2])); test_parttern2[0],
test_parttern2[1], &(test_parttern2[2]));
pdc20621_put_to_dimm(host, test_parttern1, 0x40, 40); pdc20621_put_to_dimm(host, test_parttern1, 0x40, 40);
pdc20621_get_from_dimm(host, test_parttern2, 0x40, 40); pdc20621_get_from_dimm(host, test_parttern2, 0x40, 40);
printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], dev_info(host->dev, "DIMM test pattern 3: %x, %x, %s\n",
test_parttern2[1], &(test_parttern2[2])); test_parttern2[0],
test_parttern2[1], &(test_parttern2[2]));
} }
#endif
/* ECC initiliazation. */ /* ECC initiliazation. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册