aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/host/mic_x100.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 01:15:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 01:15:15 -0500
commit8e483ed1342a4ea45b70f0f33ac54eff7a33d918 (patch)
tree66c9f9ad196581966bdb06802e11e9856b1c0779 /drivers/misc/mic/host/mic_x100.c
parente880e87488d5bbf630dd716e6de8a53585614568 (diff)
parente2d8680741edec84f843f783a7f4a44418b818d7 (diff)
Merge tag 'char-misc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver update for 4.4-rc1. Lots of different driver and subsystem updates, hwtracing being the largest with the addition of some new platforms that are now supported. Full details in the shortlog. All of these have been in linux-next for a long time with no reported issues" * tag 'char-misc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (181 commits) fpga: socfpga: Fix check of return value of devm_request_irq lkdtm: fix ACCESS_USERSPACE test mcb: Destroy IDA on module unload mcb: Do not return zero on error path in mcb_pci_probe() mei: bus: set the device name before running fixup mei: bus: use correct lock ordering mei: Fix debugfs filename in error output char: ipmi: ipmi_ssif: Replace timeval with timespec64 fpga: zynq-fpga: Fix issue with drvdata being overwritten. fpga manager: remove unnecessary null pointer checks fpga manager: ensure lifetime with of_fpga_mgr_get fpga: zynq-fpga: Change fw format to handle bin instead of bit. fpga: zynq-fpga: Fix unbalanced clock handling misc: sram: partition base address belongs to __iomem space coresight: etm3x: adding documentation for sysFS's cpu interface vme: 8-bit status/id takes 256 values, not 255 fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000 ARM: zynq: dt: Updated devicetree for Zynq 7000 platform. ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager. ver_linux: proc/modules, limit text processing to 'sed' ...
Diffstat (limited to 'drivers/misc/mic/host/mic_x100.c')
-rw-r--r--drivers/misc/mic/host/mic_x100.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/drivers/misc/mic/host/mic_x100.c b/drivers/misc/mic/host/mic_x100.c
index 3341e90dede4..8118ac48c764 100644
--- a/drivers/misc/mic/host/mic_x100.c
+++ b/drivers/misc/mic/host/mic_x100.c
@@ -43,7 +43,7 @@
43static void 43static void
44mic_x100_write_spad(struct mic_device *mdev, unsigned int idx, u32 val) 44mic_x100_write_spad(struct mic_device *mdev, unsigned int idx, u32 val)
45{ 45{
46 dev_dbg(mdev->sdev->parent, "Writing 0x%x to scratch pad index %d\n", 46 dev_dbg(&mdev->pdev->dev, "Writing 0x%x to scratch pad index %d\n",
47 val, idx); 47 val, idx);
48 mic_mmio_write(&mdev->mmio, val, 48 mic_mmio_write(&mdev->mmio, val,
49 MIC_X100_SBOX_BASE_ADDRESS + 49 MIC_X100_SBOX_BASE_ADDRESS +
@@ -66,7 +66,7 @@ mic_x100_read_spad(struct mic_device *mdev, unsigned int idx)
66 MIC_X100_SBOX_BASE_ADDRESS + 66 MIC_X100_SBOX_BASE_ADDRESS +
67 MIC_X100_SBOX_SPAD0 + idx * 4); 67 MIC_X100_SBOX_SPAD0 + idx * 4);
68 68
69 dev_dbg(mdev->sdev->parent, 69 dev_dbg(&mdev->pdev->dev,
70 "Reading 0x%x from scratch pad index %d\n", val, idx); 70 "Reading 0x%x from scratch pad index %d\n", val, idx);
71 return val; 71 return val;
72} 72}
@@ -126,7 +126,7 @@ static void mic_x100_disable_interrupts(struct mic_device *mdev)
126 * @mdev: pointer to mic_device instance 126 * @mdev: pointer to mic_device instance
127 */ 127 */
128static void mic_x100_send_sbox_intr(struct mic_device *mdev, 128static void mic_x100_send_sbox_intr(struct mic_device *mdev,
129 int doorbell) 129 int doorbell)
130{ 130{
131 struct mic_mw *mw = &mdev->mmio; 131 struct mic_mw *mw = &mdev->mmio;
132 u64 apic_icr_offset = MIC_X100_SBOX_APICICR0 + doorbell * 8; 132 u64 apic_icr_offset = MIC_X100_SBOX_APICICR0 + doorbell * 8;
@@ -147,7 +147,7 @@ static void mic_x100_send_sbox_intr(struct mic_device *mdev,
147 * @mdev: pointer to mic_device instance 147 * @mdev: pointer to mic_device instance
148 */ 148 */
149static void mic_x100_send_rdmasr_intr(struct mic_device *mdev, 149static void mic_x100_send_rdmasr_intr(struct mic_device *mdev,
150 int doorbell) 150 int doorbell)
151{ 151{
152 int rdmasr_offset = MIC_X100_SBOX_RDMASR0 + (doorbell << 2); 152 int rdmasr_offset = MIC_X100_SBOX_RDMASR0 + (doorbell << 2);
153 /* Ensure that the interrupt is ordered w.r.t. previous stores. */ 153 /* Ensure that the interrupt is ordered w.r.t. previous stores. */
@@ -359,15 +359,14 @@ mic_x100_load_command_line(struct mic_device *mdev, const struct firmware *fw)
359 359
360 boot_mem = mdev->aper.len >> 20; 360 boot_mem = mdev->aper.len >> 20;
361 buf = kzalloc(CMDLINE_SIZE, GFP_KERNEL); 361 buf = kzalloc(CMDLINE_SIZE, GFP_KERNEL);
362 if (!buf) { 362 if (!buf)
363 dev_err(mdev->sdev->parent,
364 "%s %d allocation failed\n", __func__, __LINE__);
365 return -ENOMEM; 363 return -ENOMEM;
366 } 364
367 len += snprintf(buf, CMDLINE_SIZE - len, 365 len += snprintf(buf, CMDLINE_SIZE - len,
368 " mem=%dM", boot_mem); 366 " mem=%dM", boot_mem);
369 if (mdev->cmdline) 367 if (mdev->cosm_dev->cmdline)
370 snprintf(buf + len, CMDLINE_SIZE - len, " %s", mdev->cmdline); 368 snprintf(buf + len, CMDLINE_SIZE - len, " %s",
369 mdev->cosm_dev->cmdline);
371 memcpy_toio(cmd_line_va, buf, strlen(buf) + 1); 370 memcpy_toio(cmd_line_va, buf, strlen(buf) + 1);
372 kfree(buf); 371 kfree(buf);
373 return 0; 372 return 0;
@@ -386,12 +385,11 @@ mic_x100_load_ramdisk(struct mic_device *mdev)
386 int rc; 385 int rc;
387 struct boot_params __iomem *bp = mdev->aper.va + mdev->bootaddr; 386 struct boot_params __iomem *bp = mdev->aper.va + mdev->bootaddr;
388 387
389 rc = request_firmware(&fw, 388 rc = request_firmware(&fw, mdev->cosm_dev->ramdisk, &mdev->pdev->dev);
390 mdev->ramdisk, mdev->sdev->parent);
391 if (rc < 0) { 389 if (rc < 0) {
392 dev_err(mdev->sdev->parent, 390 dev_err(&mdev->pdev->dev,
393 "ramdisk request_firmware failed: %d %s\n", 391 "ramdisk request_firmware failed: %d %s\n",
394 rc, mdev->ramdisk); 392 rc, mdev->cosm_dev->ramdisk);
395 goto error; 393 goto error;
396 } 394 }
397 /* 395 /*
@@ -423,10 +421,10 @@ mic_x100_get_boot_addr(struct mic_device *mdev)
423 421
424 scratch2 = mdev->ops->read_spad(mdev, MIC_X100_DOWNLOAD_INFO); 422 scratch2 = mdev->ops->read_spad(mdev, MIC_X100_DOWNLOAD_INFO);
425 boot_addr = MIC_X100_SPAD2_DOWNLOAD_ADDR(scratch2); 423 boot_addr = MIC_X100_SPAD2_DOWNLOAD_ADDR(scratch2);
426 dev_dbg(mdev->sdev->parent, "%s %d boot_addr 0x%x\n", 424 dev_dbg(&mdev->pdev->dev, "%s %d boot_addr 0x%x\n",
427 __func__, __LINE__, boot_addr); 425 __func__, __LINE__, boot_addr);
428 if (boot_addr > (1 << 31)) { 426 if (boot_addr > (1 << 31)) {
429 dev_err(mdev->sdev->parent, 427 dev_err(&mdev->pdev->dev,
430 "incorrect bootaddr 0x%x\n", 428 "incorrect bootaddr 0x%x\n",
431 boot_addr); 429 boot_addr);
432 rc = -EINVAL; 430 rc = -EINVAL;
@@ -454,37 +452,37 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf)
454 if (rc) 452 if (rc)
455 goto error; 453 goto error;
456 /* load OS */ 454 /* load OS */
457 rc = request_firmware(&fw, mdev->firmware, mdev->sdev->parent); 455 rc = request_firmware(&fw, mdev->cosm_dev->firmware, &mdev->pdev->dev);
458 if (rc < 0) { 456 if (rc < 0) {
459 dev_err(mdev->sdev->parent, 457 dev_err(&mdev->pdev->dev,
460 "ramdisk request_firmware failed: %d %s\n", 458 "ramdisk request_firmware failed: %d %s\n",
461 rc, mdev->firmware); 459 rc, mdev->cosm_dev->firmware);
462 goto error; 460 goto error;
463 } 461 }
464 if (mdev->bootaddr > mdev->aper.len - fw->size) { 462 if (mdev->bootaddr > mdev->aper.len - fw->size) {
465 rc = -EINVAL; 463 rc = -EINVAL;
466 dev_err(mdev->sdev->parent, "%s %d rc %d bootaddr 0x%x\n", 464 dev_err(&mdev->pdev->dev, "%s %d rc %d bootaddr 0x%x\n",
467 __func__, __LINE__, rc, mdev->bootaddr); 465 __func__, __LINE__, rc, mdev->bootaddr);
468 release_firmware(fw); 466 release_firmware(fw);
469 goto error; 467 goto error;
470 } 468 }
471 memcpy_toio(mdev->aper.va + mdev->bootaddr, fw->data, fw->size); 469 memcpy_toio(mdev->aper.va + mdev->bootaddr, fw->data, fw->size);
472 mdev->ops->write_spad(mdev, MIC_X100_FW_SIZE, fw->size); 470 mdev->ops->write_spad(mdev, MIC_X100_FW_SIZE, fw->size);
473 if (!strcmp(mdev->bootmode, "elf")) 471 if (!strcmp(mdev->cosm_dev->bootmode, "flash"))
474 goto done; 472 goto done;
475 /* load command line */ 473 /* load command line */
476 rc = mic_x100_load_command_line(mdev, fw); 474 rc = mic_x100_load_command_line(mdev, fw);
477 if (rc) { 475 if (rc) {
478 dev_err(mdev->sdev->parent, "%s %d rc %d\n", 476 dev_err(&mdev->pdev->dev, "%s %d rc %d\n",
479 __func__, __LINE__, rc); 477 __func__, __LINE__, rc);
480 goto error; 478 goto error;
481 } 479 }
482 release_firmware(fw); 480 release_firmware(fw);
483 /* load ramdisk */ 481 /* load ramdisk */
484 if (mdev->ramdisk) 482 if (mdev->cosm_dev->ramdisk)
485 rc = mic_x100_load_ramdisk(mdev); 483 rc = mic_x100_load_ramdisk(mdev);
486error: 484error:
487 dev_dbg(mdev->sdev->parent, "%s %d rc %d\n", __func__, __LINE__, rc); 485 dev_dbg(&mdev->pdev->dev, "%s %d rc %d\n", __func__, __LINE__, rc);
488done: 486done:
489 return rc; 487 return rc;
490} 488}