diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
| commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
| tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/char/xilinx_hwicap | |
| parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) | |
Patched in Tegra support.
Diffstat (limited to 'drivers/char/xilinx_hwicap')
| -rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.c | 45 | ||||
| -rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.h | 2 |
2 files changed, 9 insertions, 38 deletions
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 5224da5202d..e90e1c74fd4 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c | |||
| @@ -89,6 +89,7 @@ | |||
| 89 | 89 | ||
| 90 | #include <asm/io.h> | 90 | #include <asm/io.h> |
| 91 | #include <asm/uaccess.h> | 91 | #include <asm/uaccess.h> |
| 92 | #include <asm/system.h> | ||
| 92 | 93 | ||
| 93 | #ifdef CONFIG_OF | 94 | #ifdef CONFIG_OF |
| 94 | /* For open firmware. */ | 95 | /* For open firmware. */ |
| @@ -167,7 +168,6 @@ static const struct config_registers v4_config_registers = { | |||
| 167 | .BOOTSTS = UNIMPLEMENTED, | 168 | .BOOTSTS = UNIMPLEMENTED, |
| 168 | .CTL_1 = UNIMPLEMENTED, | 169 | .CTL_1 = UNIMPLEMENTED, |
| 169 | }; | 170 | }; |
| 170 | |||
| 171 | static const struct config_registers v5_config_registers = { | 171 | static const struct config_registers v5_config_registers = { |
| 172 | .CRC = 0, | 172 | .CRC = 0, |
| 173 | .FAR = 1, | 173 | .FAR = 1, |
| @@ -193,31 +193,6 @@ static const struct config_registers v5_config_registers = { | |||
| 193 | .CTL_1 = 19, | 193 | .CTL_1 = 19, |
| 194 | }; | 194 | }; |
| 195 | 195 | ||
| 196 | static const struct config_registers v6_config_registers = { | ||
| 197 | .CRC = 0, | ||
| 198 | .FAR = 1, | ||
| 199 | .FDRI = 2, | ||
| 200 | .FDRO = 3, | ||
| 201 | .CMD = 4, | ||
| 202 | .CTL = 5, | ||
| 203 | .MASK = 6, | ||
| 204 | .STAT = 7, | ||
| 205 | .LOUT = 8, | ||
| 206 | .COR = 9, | ||
| 207 | .MFWR = 10, | ||
| 208 | .FLR = UNIMPLEMENTED, | ||
| 209 | .KEY = UNIMPLEMENTED, | ||
| 210 | .CBC = 11, | ||
| 211 | .IDCODE = 12, | ||
| 212 | .AXSS = 13, | ||
| 213 | .C0R_1 = 14, | ||
| 214 | .CSOB = 15, | ||
| 215 | .WBSTAR = 16, | ||
| 216 | .TIMER = 17, | ||
| 217 | .BOOTSTS = 22, | ||
| 218 | .CTL_1 = 24, | ||
| 219 | }; | ||
| 220 | |||
| 221 | /** | 196 | /** |
| 222 | * hwicap_command_desync - Send a DESYNC command to the ICAP port. | 197 | * hwicap_command_desync - Send a DESYNC command to the ICAP port. |
| 223 | * @drvdata: a pointer to the drvdata. | 198 | * @drvdata: a pointer to the drvdata. |
| @@ -595,7 +570,7 @@ static const struct file_operations hwicap_fops = { | |||
| 595 | .llseek = noop_llseek, | 570 | .llseek = noop_llseek, |
| 596 | }; | 571 | }; |
| 597 | 572 | ||
| 598 | static int hwicap_setup(struct device *dev, int id, | 573 | static int __devinit hwicap_setup(struct device *dev, int id, |
| 599 | const struct resource *regs_res, | 574 | const struct resource *regs_res, |
| 600 | const struct hwicap_driver_config *config, | 575 | const struct hwicap_driver_config *config, |
| 601 | const struct config_registers *config_regs) | 576 | const struct config_registers *config_regs) |
| @@ -717,7 +692,7 @@ static struct hwicap_driver_config fifo_icap_config = { | |||
| 717 | .reset = fifo_icap_reset, | 692 | .reset = fifo_icap_reset, |
| 718 | }; | 693 | }; |
| 719 | 694 | ||
| 720 | static int hwicap_remove(struct device *dev) | 695 | static int __devexit hwicap_remove(struct device *dev) |
| 721 | { | 696 | { |
| 722 | struct hwicap_drvdata *drvdata; | 697 | struct hwicap_drvdata *drvdata; |
| 723 | 698 | ||
| @@ -740,7 +715,7 @@ static int hwicap_remove(struct device *dev) | |||
| 740 | } | 715 | } |
| 741 | 716 | ||
| 742 | #ifdef CONFIG_OF | 717 | #ifdef CONFIG_OF |
| 743 | static int hwicap_of_probe(struct platform_device *op, | 718 | static int __devinit hwicap_of_probe(struct platform_device *op, |
| 744 | const struct hwicap_driver_config *config) | 719 | const struct hwicap_driver_config *config) |
| 745 | { | 720 | { |
| 746 | struct resource res; | 721 | struct resource res; |
| @@ -770,8 +745,6 @@ static int hwicap_of_probe(struct platform_device *op, | |||
| 770 | regs = &v4_config_registers; | 745 | regs = &v4_config_registers; |
| 771 | } else if (!strcmp(family, "virtex5")) { | 746 | } else if (!strcmp(family, "virtex5")) { |
| 772 | regs = &v5_config_registers; | 747 | regs = &v5_config_registers; |
| 773 | } else if (!strcmp(family, "virtex6")) { | ||
| 774 | regs = &v6_config_registers; | ||
| 775 | } | 748 | } |
| 776 | } | 749 | } |
| 777 | return hwicap_setup(&op->dev, id ? *id : -1, &res, config, | 750 | return hwicap_setup(&op->dev, id ? *id : -1, &res, config, |
| @@ -785,8 +758,8 @@ static inline int hwicap_of_probe(struct platform_device *op, | |||
| 785 | } | 758 | } |
| 786 | #endif /* CONFIG_OF */ | 759 | #endif /* CONFIG_OF */ |
| 787 | 760 | ||
| 788 | static const struct of_device_id hwicap_of_match[]; | 761 | static const struct of_device_id __devinitconst hwicap_of_match[]; |
| 789 | static int hwicap_drv_probe(struct platform_device *pdev) | 762 | static int __devinit hwicap_drv_probe(struct platform_device *pdev) |
| 790 | { | 763 | { |
| 791 | const struct of_device_id *match; | 764 | const struct of_device_id *match; |
| 792 | struct resource *res; | 765 | struct resource *res; |
| @@ -813,8 +786,6 @@ static int hwicap_drv_probe(struct platform_device *pdev) | |||
| 813 | regs = &v4_config_registers; | 786 | regs = &v4_config_registers; |
| 814 | } else if (!strcmp(family, "virtex5")) { | 787 | } else if (!strcmp(family, "virtex5")) { |
| 815 | regs = &v5_config_registers; | 788 | regs = &v5_config_registers; |
| 816 | } else if (!strcmp(family, "virtex6")) { | ||
| 817 | regs = &v6_config_registers; | ||
| 818 | } | 789 | } |
| 819 | } | 790 | } |
| 820 | 791 | ||
| @@ -822,14 +793,14 @@ static int hwicap_drv_probe(struct platform_device *pdev) | |||
| 822 | &buffer_icap_config, regs); | 793 | &buffer_icap_config, regs); |
| 823 | } | 794 | } |
| 824 | 795 | ||
| 825 | static int hwicap_drv_remove(struct platform_device *pdev) | 796 | static int __devexit hwicap_drv_remove(struct platform_device *pdev) |
| 826 | { | 797 | { |
| 827 | return hwicap_remove(&pdev->dev); | 798 | return hwicap_remove(&pdev->dev); |
| 828 | } | 799 | } |
| 829 | 800 | ||
| 830 | #ifdef CONFIG_OF | 801 | #ifdef CONFIG_OF |
| 831 | /* Match table for device tree binding */ | 802 | /* Match table for device tree binding */ |
| 832 | static const struct of_device_id hwicap_of_match[] = { | 803 | static const struct of_device_id __devinitconst hwicap_of_match[] = { |
| 833 | { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config}, | 804 | { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config}, |
| 834 | { .compatible = "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config}, | 805 | { .compatible = "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config}, |
| 835 | {}, | 806 | {}, |
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.h b/drivers/char/xilinx_hwicap/xilinx_hwicap.h index d31ee23c9f1..8cca11981c5 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.h +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.h | |||
| @@ -86,7 +86,7 @@ struct hwicap_driver_config { | |||
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | /* Number of times to poll the done regsiter */ | 88 | /* Number of times to poll the done regsiter */ |
| 89 | #define XHI_MAX_RETRIES 5000 | 89 | #define XHI_MAX_RETRIES 10 |
| 90 | 90 | ||
| 91 | /************ Constant Definitions *************/ | 91 | /************ Constant Definitions *************/ |
| 92 | 92 | ||
