diff options
author | Martyn Welch <martyn.welch@ge.com> | 2010-02-18 11:22:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 19:43:01 -0500 |
commit | bb9ea89ec8a3d80a835d53afc388ad5f67fd3cb3 (patch) | |
tree | d6275b9301126053dbc90d6b9bbc96eb9d920bc2 /drivers/staging/vme/bridges | |
parent | 25331ba2f8e36abe77211765fa879106cdbc43e6 (diff) |
Staging: vme: Remove legacy unsupported code
Remove the code from the drivers that we are not going to implement before
submitting for review.
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme/bridges')
-rw-r--r-- | drivers/staging/vme/bridges/vme_ca91cx42.c | 150 | ||||
-rw-r--r-- | drivers/staging/vme/bridges/vme_tsi148.c | 351 |
2 files changed, 4 insertions, 497 deletions
diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c index ecd91798667..2795ff2411e 100644 --- a/drivers/staging/vme/bridges/vme_ca91cx42.c +++ b/drivers/staging/vme/bridges/vme_ca91cx42.c | |||
@@ -93,21 +93,6 @@ static u32 ca91cx42_IACK_irqhandler(struct ca91cx42_driver *bridge) | |||
93 | return CA91CX42_LINT_SW_IACK; | 93 | return CA91CX42_LINT_SW_IACK; |
94 | } | 94 | } |
95 | 95 | ||
96 | #if 0 | ||
97 | int ca91cx42_bus_error_chk(int clrflag) | ||
98 | { | ||
99 | int tmp; | ||
100 | tmp = ioread32(bridge->base + PCI_COMMAND); | ||
101 | if (tmp & 0x08000000) { /* S_TA is Set */ | ||
102 | if (clrflag) | ||
103 | iowrite32(tmp | 0x08000000, | ||
104 | bridge->base + PCI_COMMAND); | ||
105 | return 1; | ||
106 | } | ||
107 | return 0; | ||
108 | } | ||
109 | #endif | ||
110 | |||
111 | static u32 ca91cx42_VERR_irqhandler(struct ca91cx42_driver *bridge) | 96 | static u32 ca91cx42_VERR_irqhandler(struct ca91cx42_driver *bridge) |
112 | { | 97 | { |
113 | int val; | 98 | int val; |
@@ -379,10 +364,6 @@ int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled, | |||
379 | vme_bound = vme_base + size; | 364 | vme_bound = vme_base + size; |
380 | pci_offset = pci_base - vme_base; | 365 | pci_offset = pci_base - vme_base; |
381 | 366 | ||
382 | /* XXX Need to check that vme_base, vme_bound and pci_offset aren't | ||
383 | * too big for registers | ||
384 | */ | ||
385 | |||
386 | if ((i == 0) || (i == 4)) | 367 | if ((i == 0) || (i == 4)) |
387 | granularity = 0x1000; | 368 | granularity = 0x1000; |
388 | else | 369 | else |
@@ -411,18 +392,6 @@ int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled, | |||
411 | iowrite32(vme_bound, bridge->base + CA91CX42_VSI_BD[i]); | 392 | iowrite32(vme_bound, bridge->base + CA91CX42_VSI_BD[i]); |
412 | iowrite32(pci_offset, bridge->base + CA91CX42_VSI_TO[i]); | 393 | iowrite32(pci_offset, bridge->base + CA91CX42_VSI_TO[i]); |
413 | 394 | ||
414 | /* XXX Prefetch stuff currently unsupported */ | ||
415 | #if 0 | ||
416 | if (vmeIn->wrPostEnable) | ||
417 | temp_ctl |= CA91CX42_VSI_CTL_PWEN; | ||
418 | if (vmeIn->prefetchEnable) | ||
419 | temp_ctl |= CA91CX42_VSI_CTL_PREN; | ||
420 | if (vmeIn->rmwLock) | ||
421 | temp_ctl |= CA91CX42_VSI_CTL_LLRMW; | ||
422 | if (vmeIn->data64BitCapable) | ||
423 | temp_ctl |= CA91CX42_VSI_CTL_LD64EN; | ||
424 | #endif | ||
425 | |||
426 | /* Setup address space */ | 395 | /* Setup address space */ |
427 | temp_ctl &= ~CA91CX42_VSI_CTL_VAS_M; | 396 | temp_ctl &= ~CA91CX42_VSI_CTL_VAS_M; |
428 | temp_ctl |= addr; | 397 | temp_ctl |= addr; |
@@ -637,9 +606,6 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled, | |||
637 | 606 | ||
638 | spin_lock(&(image->lock)); | 607 | spin_lock(&(image->lock)); |
639 | 608 | ||
640 | /* XXX We should do this much later, so that we can exit without | ||
641 | * needing to redo the mapping... | ||
642 | */ | ||
643 | /* | 609 | /* |
644 | * Let's allocate the resource here rather than further up the stack as | 610 | * Let's allocate the resource here rather than further up the stack as |
645 | * it avoids pushing loads of bus dependant stuff up the stack | 611 | * it avoids pushing loads of bus dependant stuff up the stack |
@@ -667,12 +633,6 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled, | |||
667 | temp_ctl &= ~CA91CX42_LSI_CTL_EN; | 633 | temp_ctl &= ~CA91CX42_LSI_CTL_EN; |
668 | iowrite32(temp_ctl, bridge->base + CA91CX42_LSI_CTL[i]); | 634 | iowrite32(temp_ctl, bridge->base + CA91CX42_LSI_CTL[i]); |
669 | 635 | ||
670 | /* XXX Prefetch stuff currently unsupported */ | ||
671 | #if 0 | ||
672 | if (vmeOut->wrPostEnable) | ||
673 | temp_ctl |= 0x40000000; | ||
674 | #endif | ||
675 | |||
676 | /* Setup cycle types */ | 636 | /* Setup cycle types */ |
677 | temp_ctl &= ~CA91CX42_LSI_CTL_VCT_M; | 637 | temp_ctl &= ~CA91CX42_LSI_CTL_VCT_M; |
678 | if (cycle & VME_BLT) | 638 | if (cycle & VME_BLT) |
@@ -849,12 +809,6 @@ int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled, | |||
849 | break; | 809 | break; |
850 | } | 810 | } |
851 | 811 | ||
852 | /* XXX Prefetch stuff currently unsupported */ | ||
853 | #if 0 | ||
854 | if (ctl & 0x40000000) | ||
855 | vmeOut->wrPostEnable = 1; | ||
856 | #endif | ||
857 | |||
858 | return 0; | 812 | return 0; |
859 | } | 813 | } |
860 | 814 | ||
@@ -1812,9 +1766,9 @@ void ca91cx42_remove(struct pci_dev *pdev) | |||
1812 | iowrite32(0x00F00000, bridge->base + VSI7_CTL); | 1766 | iowrite32(0x00F00000, bridge->base + VSI7_CTL); |
1813 | 1767 | ||
1814 | vme_unregister_bridge(ca91cx42_bridge); | 1768 | vme_unregister_bridge(ca91cx42_bridge); |
1815 | #if 0 | 1769 | |
1816 | ca91cx42_crcsr_exit(pdev); | 1770 | ca91cx42_crcsr_exit(ca91cx42_bridge, pdev); |
1817 | #endif | 1771 | |
1818 | /* resources are stored in link list */ | 1772 | /* resources are stored in link list */ |
1819 | list_for_each(pos, &(ca91cx42_bridge->lm_resources)) { | 1773 | list_for_each(pos, &(ca91cx42_bridge->lm_resources)) { |
1820 | lm = list_entry(pos, struct vme_lm_resource, list); | 1774 | lm = list_entry(pos, struct vme_lm_resource, list); |
@@ -1868,101 +1822,3 @@ MODULE_LICENSE("GPL"); | |||
1868 | 1822 | ||
1869 | module_init(ca91cx42_init); | 1823 | module_init(ca91cx42_init); |
1870 | module_exit(ca91cx42_exit); | 1824 | module_exit(ca91cx42_exit); |
1871 | |||
1872 | /*---------------------------------------------------------------------------- | ||
1873 | * STAGING | ||
1874 | *--------------------------------------------------------------------------*/ | ||
1875 | |||
1876 | #if 0 | ||
1877 | |||
1878 | int ca91cx42_set_arbiter(vmeArbiterCfg_t *vmeArb) | ||
1879 | { | ||
1880 | int temp_ctl = 0; | ||
1881 | int vbto = 0; | ||
1882 | |||
1883 | temp_ctl = ioread32(bridge->base + MISC_CTL); | ||
1884 | temp_ctl &= 0x00FFFFFF; | ||
1885 | |||
1886 | if (vmeArb->globalTimeoutTimer == 0xFFFFFFFF) { | ||
1887 | vbto = 7; | ||
1888 | } else if (vmeArb->globalTimeoutTimer > 1024) { | ||
1889 | return -EINVAL; | ||
1890 | } else if (vmeArb->globalTimeoutTimer == 0) { | ||
1891 | vbto = 0; | ||
1892 | } else { | ||
1893 | vbto = 1; | ||
1894 | while ((16 * (1 << (vbto - 1))) < vmeArb->globalTimeoutTimer) | ||
1895 | vbto += 1; | ||
1896 | } | ||
1897 | temp_ctl |= (vbto << 28); | ||
1898 | |||
1899 | if (vmeArb->arbiterMode == VME_PRIORITY_MODE) | ||
1900 | temp_ctl |= 1 << 26; | ||
1901 | |||
1902 | if (vmeArb->arbiterTimeoutFlag) | ||
1903 | temp_ctl |= 2 << 24; | ||
1904 | |||
1905 | iowrite32(temp_ctl, bridge->base + MISC_CTL); | ||
1906 | return 0; | ||
1907 | } | ||
1908 | |||
1909 | int ca91cx42_get_arbiter(vmeArbiterCfg_t *vmeArb) | ||
1910 | { | ||
1911 | int temp_ctl = 0; | ||
1912 | int vbto = 0; | ||
1913 | |||
1914 | temp_ctl = ioread32(bridge->base + MISC_CTL); | ||
1915 | |||
1916 | vbto = (temp_ctl >> 28) & 0xF; | ||
1917 | if (vbto != 0) | ||
1918 | vmeArb->globalTimeoutTimer = (16 * (1 << (vbto - 1))); | ||
1919 | |||
1920 | if (temp_ctl & (1 << 26)) | ||
1921 | vmeArb->arbiterMode = VME_PRIORITY_MODE; | ||
1922 | else | ||
1923 | vmeArb->arbiterMode = VME_R_ROBIN_MODE; | ||
1924 | |||
1925 | if (temp_ctl & (3 << 24)) | ||
1926 | vmeArb->arbiterTimeoutFlag = 1; | ||
1927 | |||
1928 | return 0; | ||
1929 | } | ||
1930 | |||
1931 | int ca91cx42_set_requestor(vmeRequesterCfg_t *vmeReq) | ||
1932 | { | ||
1933 | int temp_ctl = 0; | ||
1934 | |||
1935 | temp_ctl = ioread32(bridge->base + MAST_CTL); | ||
1936 | temp_ctl &= 0xFF0FFFFF; | ||
1937 | |||
1938 | if (vmeReq->releaseMode == 1) | ||
1939 | temp_ctl |= (1 << 20); | ||
1940 | |||
1941 | if (vmeReq->fairMode == 1) | ||
1942 | temp_ctl |= (1 << 21); | ||
1943 | |||
1944 | temp_ctl |= (vmeReq->requestLevel << 22); | ||
1945 | |||
1946 | iowrite32(temp_ctl, bridge->base + MAST_CTL); | ||
1947 | return 0; | ||
1948 | } | ||
1949 | |||
1950 | int ca91cx42_get_requestor(vmeRequesterCfg_t *vmeReq) | ||
1951 | { | ||
1952 | int temp_ctl = 0; | ||
1953 | |||
1954 | temp_ctl = ioread32(bridge->base + MAST_CTL); | ||
1955 | |||
1956 | if (temp_ctl & (1 << 20)) | ||
1957 | vmeReq->releaseMode = 1; | ||
1958 | |||
1959 | if (temp_ctl & (1 << 21)) | ||
1960 | vmeReq->fairMode = 1; | ||
1961 | |||
1962 | vmeReq->requestLevel = (temp_ctl & 0xC00000) >> 22; | ||
1963 | |||
1964 | return 0; | ||
1965 | } | ||
1966 | |||
1967 | |||
1968 | #endif | ||
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c index a6f853a3dc2..faf652edb70 100644 --- a/drivers/staging/vme/bridges/vme_tsi148.c +++ b/drivers/staging/vme/bridges/vme_tsi148.c | |||
@@ -571,16 +571,6 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled, | |||
571 | 571 | ||
572 | bridge = image->parent->driver_priv; | 572 | bridge = image->parent->driver_priv; |
573 | 573 | ||
574 | #if 0 | ||
575 | printk("Set slave image %d to:\n", image->number); | ||
576 | printk("\tEnabled: %s\n", (enabled == 1)? "yes" : "no"); | ||
577 | printk("\tVME Base:0x%llx\n", vme_base); | ||
578 | printk("\tWindow Size:0x%llx\n", size); | ||
579 | printk("\tPCI Base:0x%lx\n", (unsigned long)pci_base); | ||
580 | printk("\tAddress Space:0x%x\n", aspace); | ||
581 | printk("\tTransfer Cycle Properties:0x%x\n", cycle); | ||
582 | #endif | ||
583 | |||
584 | i = image->number; | 574 | i = image->number; |
585 | 575 | ||
586 | switch (aspace) { | 576 | switch (aspace) { |
@@ -636,11 +626,6 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled, | |||
636 | return -EINVAL; | 626 | return -EINVAL; |
637 | } | 627 | } |
638 | 628 | ||
639 | #if 0 | ||
640 | printk("\tVME Bound:0x%llx\n", vme_bound); | ||
641 | printk("\tPCI Offset:0x%llx\n", pci_offset); | ||
642 | #endif | ||
643 | |||
644 | /* Disable while we are mucking around */ | 629 | /* Disable while we are mucking around */ |
645 | temp_ctl = ioread32be(bridge->base + TSI148_LCSR_IT[i] + | 630 | temp_ctl = ioread32be(bridge->base + TSI148_LCSR_IT[i] + |
646 | TSI148_LCSR_OFFSET_ITAT); | 631 | TSI148_LCSR_OFFSET_ITAT); |
@@ -662,23 +647,6 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled, | |||
662 | iowrite32be(pci_offset_low, bridge->base + TSI148_LCSR_IT[i] + | 647 | iowrite32be(pci_offset_low, bridge->base + TSI148_LCSR_IT[i] + |
663 | TSI148_LCSR_OFFSET_ITOFL); | 648 | TSI148_LCSR_OFFSET_ITOFL); |
664 | 649 | ||
665 | /* XXX Prefetch stuff currently unsupported */ | ||
666 | #if 0 | ||
667 | |||
668 | for (x = 0; x < 4; x++) { | ||
669 | if ((64 << x) >= vmeIn->prefetchSize) { | ||
670 | break; | ||
671 | } | ||
672 | } | ||
673 | if (x == 4) | ||
674 | x--; | ||
675 | temp_ctl |= (x << 16); | ||
676 | |||
677 | if (vmeIn->prefetchThreshold) | ||
678 | if (vmeIn->prefetchThreshold) | ||
679 | temp_ctl |= 0x40000; | ||
680 | #endif | ||
681 | |||
682 | /* Setup 2eSST speeds */ | 650 | /* Setup 2eSST speeds */ |
683 | temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M; | 651 | temp_ctl &= ~TSI148_LCSR_ITAT_2eSSTM_M; |
684 | switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) { | 652 | switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) { |
@@ -735,8 +703,6 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled, | |||
735 | 703 | ||
736 | /* | 704 | /* |
737 | * Get slave window configuration. | 705 | * Get slave window configuration. |
738 | * | ||
739 | * XXX Prefetch currently unsupported. | ||
740 | */ | 706 | */ |
741 | int tsi148_slave_get(struct vme_slave_resource *image, int *enabled, | 707 | int tsi148_slave_get(struct vme_slave_resource *image, int *enabled, |
742 | unsigned long long *vme_base, unsigned long long *size, | 708 | unsigned long long *vme_base, unsigned long long *size, |
@@ -1030,20 +996,6 @@ int tsi148_master_set( struct vme_master_resource *image, int enabled, | |||
1030 | iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] + | 996 | iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] + |
1031 | TSI148_LCSR_OFFSET_OTAT); | 997 | TSI148_LCSR_OFFSET_OTAT); |
1032 | 998 | ||
1033 | /* XXX Prefetch stuff currently unsupported */ | ||
1034 | #if 0 | ||
1035 | if (vmeOut->prefetchEnable) { | ||
1036 | temp_ctl |= 0x40000; | ||
1037 | for (x = 0; x < 4; x++) { | ||
1038 | if ((2 << x) >= vmeOut->prefetchSize) | ||
1039 | break; | ||
1040 | } | ||
1041 | if (x == 4) | ||
1042 | x = 3; | ||
1043 | temp_ctl |= (x << 16); | ||
1044 | } | ||
1045 | #endif | ||
1046 | |||
1047 | /* Setup 2eSST speeds */ | 999 | /* Setup 2eSST speeds */ |
1048 | temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M; | 1000 | temp_ctl &= ~TSI148_LCSR_OTAT_2eSSTM_M; |
1049 | switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) { | 1001 | switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) { |
@@ -1156,12 +1108,6 @@ int tsi148_master_set( struct vme_master_resource *image, int enabled, | |||
1156 | iowrite32be(vme_offset_low, bridge->base + TSI148_LCSR_OT[i] + | 1108 | iowrite32be(vme_offset_low, bridge->base + TSI148_LCSR_OT[i] + |
1157 | TSI148_LCSR_OFFSET_OTOFL); | 1109 | TSI148_LCSR_OFFSET_OTOFL); |
1158 | 1110 | ||
1159 | /* XXX We need to deal with OTBS */ | ||
1160 | #if 0 | ||
1161 | iowrite32be(vmeOut->bcastSelect2esst, bridge->base + | ||
1162 | TSI148_LCSR_OT[i] + TSI148_LCSR_OFFSET_OTBS); | ||
1163 | #endif | ||
1164 | |||
1165 | /* Write ctl reg without enable */ | 1111 | /* Write ctl reg without enable */ |
1166 | iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] + | 1112 | iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] + |
1167 | TSI148_LCSR_OFFSET_OTAT); | 1113 | TSI148_LCSR_OFFSET_OTAT); |
@@ -1669,8 +1615,6 @@ static int tsi148_dma_set_vme_dest_attributes(u32 *attr, vme_address_t aspace, | |||
1669 | 1615 | ||
1670 | /* | 1616 | /* |
1671 | * Add a link list descriptor to the list | 1617 | * Add a link list descriptor to the list |
1672 | * | ||
1673 | * XXX Need to handle 2eSST Broadcast select bits | ||
1674 | */ | 1618 | */ |
1675 | int tsi148_dma_list_add (struct vme_dma_list *list, struct vme_dma_attr *src, | 1619 | int tsi148_dma_list_add (struct vme_dma_list *list, struct vme_dma_attr *src, |
1676 | struct vme_dma_attr *dest, size_t count) | 1620 | struct vme_dma_attr *dest, size_t count) |
@@ -1683,7 +1627,7 @@ int tsi148_dma_list_add (struct vme_dma_list *list, struct vme_dma_attr *src, | |||
1683 | dma_addr_t desc_ptr; | 1627 | dma_addr_t desc_ptr; |
1684 | int retval = 0; | 1628 | int retval = 0; |
1685 | 1629 | ||
1686 | /* XXX descriptor must be aligned on 64-bit boundaries */ | 1630 | /* Descriptor must be aligned on 64-bit boundaries */ |
1687 | entry = (struct tsi148_dma_entry *)kmalloc( | 1631 | entry = (struct tsi148_dma_entry *)kmalloc( |
1688 | sizeof(struct tsi148_dma_entry), GFP_KERNEL); | 1632 | sizeof(struct tsi148_dma_entry), GFP_KERNEL); |
1689 | if (entry == NULL) { | 1633 | if (entry == NULL) { |
@@ -1850,9 +1794,6 @@ int tsi148_dma_list_exec(struct vme_dma_list *list) | |||
1850 | dma_addr_t bus_addr; | 1794 | dma_addr_t bus_addr; |
1851 | u32 bus_addr_high, bus_addr_low; | 1795 | u32 bus_addr_high, bus_addr_low; |
1852 | u32 val, dctlreg = 0; | 1796 | u32 val, dctlreg = 0; |
1853 | #if 0 | ||
1854 | int x; | ||
1855 | #endif | ||
1856 | struct tsi148_driver *bridge; | 1797 | struct tsi148_driver *bridge; |
1857 | 1798 | ||
1858 | ctrlr = list->parent; | 1799 | ctrlr = list->parent; |
@@ -1875,48 +1816,6 @@ int tsi148_dma_list_exec(struct vme_dma_list *list) | |||
1875 | } else { | 1816 | } else { |
1876 | list_add(&(list->list), &(ctrlr->running)); | 1817 | list_add(&(list->list), &(ctrlr->running)); |
1877 | } | 1818 | } |
1878 | #if 0 | ||
1879 | /* XXX Still todo */ | ||
1880 | for (x = 0; x < 8; x++) { /* vme block size */ | ||
1881 | if ((32 << x) >= vmeDma->maxVmeBlockSize) { | ||
1882 | break; | ||
1883 | } | ||
1884 | } | ||
1885 | if (x == 8) | ||
1886 | x = 7; | ||
1887 | dctlreg |= (x << 12); | ||
1888 | |||
1889 | for (x = 0; x < 8; x++) { /* pci block size */ | ||
1890 | if ((32 << x) >= vmeDma->maxPciBlockSize) { | ||
1891 | break; | ||
1892 | } | ||
1893 | } | ||
1894 | if (x == 8) | ||
1895 | x = 7; | ||
1896 | dctlreg |= (x << 4); | ||
1897 | |||
1898 | if (vmeDma->vmeBackOffTimer) { | ||
1899 | for (x = 1; x < 8; x++) { /* vme timer */ | ||
1900 | if ((1 << (x - 1)) >= vmeDma->vmeBackOffTimer) { | ||
1901 | break; | ||
1902 | } | ||
1903 | } | ||
1904 | if (x == 8) | ||
1905 | x = 7; | ||
1906 | dctlreg |= (x << 8); | ||
1907 | } | ||
1908 | |||
1909 | if (vmeDma->pciBackOffTimer) { | ||
1910 | for (x = 1; x < 8; x++) { /* pci timer */ | ||
1911 | if ((1 << (x - 1)) >= vmeDma->pciBackOffTimer) { | ||
1912 | break; | ||
1913 | } | ||
1914 | } | ||
1915 | if (x == 8) | ||
1916 | x = 7; | ||
1917 | dctlreg |= (x << 0); | ||
1918 | } | ||
1919 | #endif | ||
1920 | 1819 | ||
1921 | /* Get first bus address and write into registers */ | 1820 | /* Get first bus address and write into registers */ |
1922 | entry = list_first_entry(&(list->entries), struct tsi148_dma_entry, | 1821 | entry = list_first_entry(&(list->entries), struct tsi148_dma_entry, |
@@ -2738,251 +2637,3 @@ MODULE_LICENSE("GPL"); | |||
2738 | 2637 | ||
2739 | module_init(tsi148_init); | 2638 | module_init(tsi148_init); |
2740 | module_exit(tsi148_exit); | 2639 | module_exit(tsi148_exit); |
2741 | |||
2742 | /*---------------------------------------------------------------------------- | ||
2743 | * STAGING | ||
2744 | *--------------------------------------------------------------------------*/ | ||
2745 | |||
2746 | #if 0 | ||
2747 | /* | ||
2748 | * Direct Mode DMA transfer | ||
2749 | * | ||
2750 | * XXX Not looking at direct mode for now, we can always use link list mode | ||
2751 | * with a single entry. | ||
2752 | */ | ||
2753 | int tsi148_dma_run(struct vme_dma_resource *resource, struct vme_dma_attr src, | ||
2754 | struct vme_dma_attr dest, size_t count) | ||
2755 | { | ||
2756 | u32 dctlreg = 0; | ||
2757 | unsigned int tmp; | ||
2758 | int val; | ||
2759 | int channel, x; | ||
2760 | struct vmeDmaPacket *cur_dma; | ||
2761 | struct tsi148_dma_descriptor *dmaLL; | ||
2762 | |||
2763 | /* direct mode */ | ||
2764 | dctlreg = 0x800000; | ||
2765 | |||
2766 | for (x = 0; x < 8; x++) { /* vme block size */ | ||
2767 | if ((32 << x) >= vmeDma->maxVmeBlockSize) { | ||
2768 | break; | ||
2769 | } | ||
2770 | } | ||
2771 | if (x == 8) | ||
2772 | x = 7; | ||
2773 | dctlreg |= (x << 12); | ||
2774 | |||
2775 | for (x = 0; x < 8; x++) { /* pci block size */ | ||
2776 | if ((32 << x) >= vmeDma->maxPciBlockSize) { | ||
2777 | break; | ||
2778 | } | ||
2779 | } | ||
2780 | if (x == 8) | ||
2781 | x = 7; | ||
2782 | dctlreg |= (x << 4); | ||
2783 | |||
2784 | if (vmeDma->vmeBackOffTimer) { | ||
2785 | for (x = 1; x < 8; x++) { /* vme timer */ | ||
2786 | if ((1 << (x - 1)) >= vmeDma->vmeBackOffTimer) { | ||
2787 | break; | ||
2788 | } | ||
2789 | } | ||
2790 | if (x == 8) | ||
2791 | x = 7; | ||
2792 | dctlreg |= (x << 8); | ||
2793 | } | ||
2794 | |||
2795 | if (vmeDma->pciBackOffTimer) { | ||
2796 | for (x = 1; x < 8; x++) { /* pci timer */ | ||
2797 | if ((1 << (x - 1)) >= vmeDma->pciBackOffTimer) { | ||
2798 | break; | ||
2799 | } | ||
2800 | } | ||
2801 | if (x == 8) | ||
2802 | x = 7; | ||
2803 | dctlreg |= (x << 0); | ||
2804 | } | ||
2805 | |||
2806 | /* Program registers for DMA transfer */ | ||
2807 | iowrite32be(dmaLL->dsau, tsi148_bridge->driver_priv->base + | ||
2808 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DSAU); | ||
2809 | iowrite32be(dmaLL->dsal, tsi148_bridge->driver_priv->base + | ||
2810 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DSAL); | ||
2811 | iowrite32be(dmaLL->ddau, tsi148_bridge->driver_priv->base + | ||
2812 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DDAU); | ||
2813 | iowrite32be(dmaLL->ddal, tsi148_bridge->driver_priv->base + | ||
2814 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DDAL); | ||
2815 | iowrite32be(dmaLL->dsat, tsi148_bridge->driver_priv->base + | ||
2816 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DSAT); | ||
2817 | iowrite32be(dmaLL->ddat, tsi148_bridge->driver_priv->base + | ||
2818 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DDAT); | ||
2819 | iowrite32be(dmaLL->dcnt, tsi148_bridge->driver_priv->base + | ||
2820 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DCNT); | ||
2821 | iowrite32be(dmaLL->ddbs, tsi148_bridge->driver_priv->base + | ||
2822 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DDBS); | ||
2823 | |||
2824 | /* Start the operation */ | ||
2825 | iowrite32be(dctlreg | 0x2000000, tsi148_bridge->driver_priv->base + | ||
2826 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DCTL); | ||
2827 | |||
2828 | tmp = ioread32be(tsi148_bridge->driver_priv->base + | ||
2829 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DSTA); | ||
2830 | wait_event_interruptible(dma_queue[channel], (tmp & 0x1000000) == 0); | ||
2831 | |||
2832 | /* | ||
2833 | * Read status register, we should probably do this in some error | ||
2834 | * handler rather than here so that we can be sure we haven't kicked off | ||
2835 | * another DMA transfer. | ||
2836 | */ | ||
2837 | val = ioread32be(tsi148_bridge->driver_priv->base + | ||
2838 | TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DSTA); | ||
2839 | |||
2840 | vmeDma->vmeDmaStatus = 0; | ||
2841 | if (val & 0x10000000) { | ||
2842 | printk(KERN_ERR | ||
2843 | "DMA Error in DMA_tempe_irqhandler DSTA=%08X\n", | ||
2844 | val); | ||
2845 | vmeDma->vmeDmaStatus = val; | ||
2846 | |||
2847 | } | ||
2848 | return (0); | ||
2849 | } | ||
2850 | #endif | ||
2851 | |||
2852 | #if 0 | ||
2853 | |||
2854 | /* Global VME controller information */ | ||
2855 | struct pci_dev *vme_pci_dev; | ||
2856 | |||
2857 | /* | ||
2858 | * Set the VME bus arbiter with the requested attributes | ||
2859 | */ | ||
2860 | int tempe_set_arbiter(vmeArbiterCfg_t * vmeArb) | ||
2861 | { | ||
2862 | int temp_ctl = 0; | ||
2863 | int gto = 0; | ||
2864 | |||
2865 | temp_ctl = ioread32be(tsi148_bridge->driver_priv->base + | ||
2866 | TSI148_LCSR_VCTRL); | ||
2867 | temp_ctl &= 0xFFEFFF00; | ||
2868 | |||
2869 | if (vmeArb->globalTimeoutTimer == 0xFFFFFFFF) { | ||
2870 | gto = 8; | ||
2871 | } else if (vmeArb->globalTimeoutTimer > 2048) { | ||
2872 | return (-EINVAL); | ||
2873 | } else if (vmeArb->globalTimeoutTimer == 0) { | ||
2874 | gto = 0; | ||
2875 | } else { | ||
2876 | gto = 1; | ||
2877 | while ((16 * (1 << (gto - 1))) < vmeArb->globalTimeoutTimer) { | ||
2878 | gto += 1; | ||
2879 | } | ||
2880 | } | ||
2881 | temp_ctl |= gto; | ||
2882 | |||
2883 | if (vmeArb->arbiterMode != VME_PRIORITY_MODE) { | ||
2884 | temp_ctl |= 1 << 6; | ||
2885 | } | ||
2886 | |||
2887 | if (vmeArb->arbiterTimeoutFlag) { | ||
2888 | temp_ctl |= 1 << 7; | ||
2889 | } | ||
2890 | |||
2891 | if (vmeArb->noEarlyReleaseFlag) { | ||
2892 | temp_ctl |= 1 << 20; | ||
2893 | } | ||
2894 | iowrite32be(temp_ctl, tsi148_bridge->driver_priv->base + | ||
2895 | TSI148_LCSR_VCTRL); | ||
2896 | |||
2897 | return (0); | ||
2898 | } | ||
2899 | |||
2900 | /* | ||
2901 | * Return the attributes of the VME bus arbiter. | ||
2902 | */ | ||
2903 | int tempe_get_arbiter(vmeArbiterCfg_t * vmeArb) | ||
2904 | { | ||
2905 | int temp_ctl = 0; | ||
2906 | int gto = 0; | ||
2907 | |||
2908 | |||
2909 | temp_ctl = ioread32be(tsi148_bridge->driver_priv->base + | ||
2910 | TSI148_LCSR_VCTRL); | ||
2911 | |||
2912 | gto = temp_ctl & 0xF; | ||
2913 | if (gto != 0) { | ||
2914 | vmeArb->globalTimeoutTimer = (16 * (1 << (gto - 1))); | ||
2915 | } | ||
2916 | |||
2917 | if (temp_ctl & (1 << 6)) { | ||
2918 | vmeArb->arbiterMode = VME_R_ROBIN_MODE; | ||
2919 | } else { | ||
2920 | vmeArb->arbiterMode = VME_PRIORITY_MODE; | ||
2921 | } | ||
2922 | |||
2923 | if (temp_ctl & (1 << 7)) { | ||
2924 | vmeArb->arbiterTimeoutFlag = 1; | ||
2925 | } | ||
2926 | |||
2927 | if (temp_ctl & (1 << 20)) { | ||
2928 | vmeArb->noEarlyReleaseFlag = 1; | ||
2929 | } | ||
2930 | |||
2931 | return (0); | ||
2932 | } | ||
2933 | |||
2934 | /* | ||
2935 | * Set the VME bus requestor with the requested attributes | ||
2936 | */ | ||
2937 | int tempe_set_requestor(vmeRequesterCfg_t * vmeReq) | ||
2938 | { | ||
2939 | int temp_ctl = 0; | ||
2940 | |||
2941 | temp_ctl = ioread32be(tsi148_bridge->driver_priv->base + | ||
2942 | TSI148_LCSR_VMCTRL); | ||
2943 | temp_ctl &= 0xFFFF0000; | ||
2944 | |||
2945 | if (vmeReq->releaseMode == 1) { | ||
2946 | temp_ctl |= (1 << 3); | ||
2947 | } | ||
2948 | |||
2949 | if (vmeReq->fairMode == 1) { | ||
2950 | temp_ctl |= (1 << 2); | ||
2951 | } | ||
2952 | |||
2953 | temp_ctl |= (vmeReq->timeonTimeoutTimer & 7) << 8; | ||
2954 | temp_ctl |= (vmeReq->timeoffTimeoutTimer & 7) << 12; | ||
2955 | temp_ctl |= vmeReq->requestLevel; | ||
2956 | |||
2957 | iowrite32be(temp_ctl, tsi148_bridge->driver_priv->base + | ||
2958 | TSI148_LCSR_VMCTRL); | ||
2959 | return (0); | ||
2960 | } | ||
2961 | |||
2962 | /* | ||
2963 | * Return the attributes of the VME bus requestor | ||
2964 | */ | ||
2965 | int tempe_get_requestor(vmeRequesterCfg_t * vmeReq) | ||
2966 | { | ||
2967 | int temp_ctl = 0; | ||
2968 | |||
2969 | temp_ctl = ioread32be(tsi148_bridge->driver_priv->base + | ||
2970 | TSI148_LCSR_VMCTRL); | ||
2971 | |||
2972 | if (temp_ctl & 0x18) { | ||
2973 | vmeReq->releaseMode = 1; | ||
2974 | } | ||
2975 | |||
2976 | if (temp_ctl & (1 << 2)) { | ||
2977 | vmeReq->fairMode = 1; | ||
2978 | } | ||
2979 | |||
2980 | vmeReq->requestLevel = temp_ctl & 3; | ||
2981 | vmeReq->timeonTimeoutTimer = (temp_ctl >> 8) & 7; | ||
2982 | vmeReq->timeoffTimeoutTimer = (temp_ctl >> 12) & 7; | ||
2983 | |||
2984 | return (0); | ||
2985 | } | ||
2986 | |||
2987 | |||
2988 | #endif | ||