thrd 551 drivers/dma/pl330.c static inline bool _queue_full(struct pl330_thread *thrd) thrd 553 drivers/dma/pl330.c return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL; thrd 556 drivers/dma/pl330.c static inline bool is_manager(struct pl330_thread *thrd) thrd 558 drivers/dma/pl330.c return thrd->dmac->manager == thrd; thrd 562 drivers/dma/pl330.c static inline bool _manager_ns(struct pl330_thread *thrd) thrd 564 drivers/dma/pl330.c return (thrd->dmac->pcfg.mode & DMAC_MODE_NS) ? true : false; thrd 863 drivers/dma/pl330.c static bool _until_dmac_idle(struct pl330_thread *thrd) thrd 865 drivers/dma/pl330.c void __iomem *regs = thrd->dmac->base; thrd 882 drivers/dma/pl330.c static inline void _execute_DBGINSN(struct pl330_thread *thrd, thrd 885 drivers/dma/pl330.c void __iomem *regs = thrd->dmac->base; thrd 891 drivers/dma/pl330.c val |= (thrd->id << 8); /* Channel Number */ thrd 899 drivers/dma/pl330.c if (_until_dmac_idle(thrd)) { thrd 900 drivers/dma/pl330.c dev_err(thrd->dmac->ddma.dev, "DMAC halted!\n"); thrd 908 drivers/dma/pl330.c static inline u32 _state(struct pl330_thread *thrd) thrd 910 drivers/dma/pl330.c void __iomem *regs = thrd->dmac->base; thrd 913 drivers/dma/pl330.c if (is_manager(thrd)) thrd 916 drivers/dma/pl330.c val = readl(regs + CS(thrd->id)) & 0xf; thrd 932 drivers/dma/pl330.c if (is_manager(thrd)) thrd 937 drivers/dma/pl330.c if (is_manager(thrd)) thrd 942 drivers/dma/pl330.c if (is_manager(thrd)) thrd 947 drivers/dma/pl330.c if (is_manager(thrd)) thrd 952 drivers/dma/pl330.c if (is_manager(thrd)) thrd 957 drivers/dma/pl330.c if (is_manager(thrd)) thrd 966 drivers/dma/pl330.c static void _stop(struct pl330_thread *thrd) thrd 968 drivers/dma/pl330.c void __iomem *regs = thrd->dmac->base; thrd 972 drivers/dma/pl330.c if (_state(thrd) == PL330_STATE_FAULT_COMPLETING) thrd 973 drivers/dma/pl330.c UNTIL(thrd, PL330_STATE_FAULTING | PL330_STATE_KILLING); thrd 976 drivers/dma/pl330.c if (_state(thrd) == PL330_STATE_COMPLETING thrd 977 drivers/dma/pl330.c || _state(thrd) == PL330_STATE_KILLING thrd 978 drivers/dma/pl330.c || _state(thrd) == PL330_STATE_STOPPED) thrd 983 drivers/dma/pl330.c _execute_DBGINSN(thrd, insn, is_manager(thrd)); thrd 986 drivers/dma/pl330.c if (inten & (1 << thrd->ev)) thrd 987 drivers/dma/pl330.c writel(1 << thrd->ev, regs + INTCLR); thrd 989 drivers/dma/pl330.c writel(inten & ~(1 << thrd->ev), regs + INTEN); thrd 993 drivers/dma/pl330.c static bool _trigger(struct pl330_thread *thrd) thrd 995 drivers/dma/pl330.c void __iomem *regs = thrd->dmac->base; thrd 1004 drivers/dma/pl330.c if (_state(thrd) != PL330_STATE_STOPPED) thrd 1007 drivers/dma/pl330.c idx = 1 - thrd->lstenq; thrd 1008 drivers/dma/pl330.c if (thrd->req[idx].desc != NULL) { thrd 1009 drivers/dma/pl330.c req = &thrd->req[idx]; thrd 1011 drivers/dma/pl330.c idx = thrd->lstenq; thrd 1012 drivers/dma/pl330.c if (thrd->req[idx].desc != NULL) thrd 1013 drivers/dma/pl330.c req = &thrd->req[idx]; thrd 1023 drivers/dma/pl330.c if (idx == thrd->req_running) thrd 1031 drivers/dma/pl330.c if (_manager_ns(thrd) && !ns) thrd 1032 drivers/dma/pl330.c dev_info(thrd->dmac->ddma.dev, "%s:%d Recipe for ABORT!\n", thrd 1035 drivers/dma/pl330.c go.chan = thrd->id; thrd 1041 drivers/dma/pl330.c writel(readl(regs + INTEN) | (1 << thrd->ev), regs + INTEN); thrd 1044 drivers/dma/pl330.c _execute_DBGINSN(thrd, insn, true); thrd 1046 drivers/dma/pl330.c thrd->req_running = idx; thrd 1051 drivers/dma/pl330.c static bool _start(struct pl330_thread *thrd) thrd 1053 drivers/dma/pl330.c switch (_state(thrd)) { thrd 1055 drivers/dma/pl330.c UNTIL(thrd, PL330_STATE_FAULTING | PL330_STATE_KILLING); thrd 1057 drivers/dma/pl330.c if (_state(thrd) == PL330_STATE_KILLING) thrd 1058 drivers/dma/pl330.c UNTIL(thrd, PL330_STATE_STOPPED) thrd 1062 drivers/dma/pl330.c _stop(thrd); thrd 1067 drivers/dma/pl330.c UNTIL(thrd, PL330_STATE_STOPPED) thrd 1071 drivers/dma/pl330.c return _trigger(thrd); thrd 1401 drivers/dma/pl330.c struct pl330_thread *thrd, unsigned index, thrd 1404 drivers/dma/pl330.c struct _pl330_req *req = &thrd->req[index]; thrd 1416 drivers/dma/pl330.c off += _emit_SEV(dry_run, &buf[off], thrd->ev); thrd 1460 drivers/dma/pl330.c static int pl330_submit_req(struct pl330_thread *thrd, thrd 1463 drivers/dma/pl330.c struct pl330_dmac *pl330 = thrd->dmac; thrd 1485 drivers/dma/pl330.c || pl330->dmac_tbd.reset_chan & (1 << thrd->id)) { thrd 1486 drivers/dma/pl330.c dev_info(thrd->dmac->ddma.dev, "%s:%d\n", thrd 1494 drivers/dma/pl330.c dev_info(thrd->dmac->ddma.dev, thrd 1502 drivers/dma/pl330.c if (_queue_full(thrd)) { thrd 1508 drivers/dma/pl330.c if (!_manager_ns(thrd)) thrd 1515 drivers/dma/pl330.c idx = thrd->req[0].desc == NULL ? 0 : 1; thrd 1521 drivers/dma/pl330.c ret = _setup_req(pl330, 1, thrd, idx, &xs); thrd 1533 drivers/dma/pl330.c thrd->lstenq = idx; thrd 1534 drivers/dma/pl330.c thrd->req[idx].desc = desc; thrd 1535 drivers/dma/pl330.c _setup_req(pl330, 0, thrd, idx, &xs); thrd 1596 drivers/dma/pl330.c struct pl330_thread *thrd = &pl330->channels[i]; thrd 1600 drivers/dma/pl330.c _stop(thrd); thrd 1602 drivers/dma/pl330.c if (readl(regs + FSC) & (1 << thrd->id)) thrd 1608 drivers/dma/pl330.c dma_pl330_rqcb(thrd->req[1 - thrd->lstenq].desc, err); thrd 1609 drivers/dma/pl330.c dma_pl330_rqcb(thrd->req[thrd->lstenq].desc, err); thrd 1612 drivers/dma/pl330.c thrd->req[0].desc = NULL; thrd 1613 drivers/dma/pl330.c thrd->req[1].desc = NULL; thrd 1614 drivers/dma/pl330.c thrd->req_running = -1; thrd 1674 drivers/dma/pl330.c struct pl330_thread *thrd; thrd 1686 drivers/dma/pl330.c thrd = &pl330->channels[id]; thrd 1688 drivers/dma/pl330.c active = thrd->req_running; thrd 1693 drivers/dma/pl330.c descdone = thrd->req[active].desc; thrd 1694 drivers/dma/pl330.c thrd->req[active].desc = NULL; thrd 1696 drivers/dma/pl330.c thrd->req_running = -1; thrd 1699 drivers/dma/pl330.c _start(thrd); thrd 1730 drivers/dma/pl330.c static inline int _alloc_event(struct pl330_thread *thrd) thrd 1732 drivers/dma/pl330.c struct pl330_dmac *pl330 = thrd->dmac; thrd 1737 drivers/dma/pl330.c pl330->events[ev] = thrd->id; thrd 1754 drivers/dma/pl330.c struct pl330_thread *thrd = NULL; thrd 1763 drivers/dma/pl330.c thrd = &pl330->channels[i]; thrd 1764 drivers/dma/pl330.c if ((thrd->free) && (!_manager_ns(thrd) || thrd 1766 drivers/dma/pl330.c thrd->ev = _alloc_event(thrd); thrd 1767 drivers/dma/pl330.c if (thrd->ev >= 0) { thrd 1768 drivers/dma/pl330.c thrd->free = false; thrd 1769 drivers/dma/pl330.c thrd->lstenq = 1; thrd 1770 drivers/dma/pl330.c thrd->req[0].desc = NULL; thrd 1771 drivers/dma/pl330.c thrd->req[1].desc = NULL; thrd 1772 drivers/dma/pl330.c thrd->req_running = -1; thrd 1776 drivers/dma/pl330.c thrd = NULL; thrd 1779 drivers/dma/pl330.c return thrd; thrd 1783 drivers/dma/pl330.c static inline void _free_event(struct pl330_thread *thrd, int ev) thrd 1785 drivers/dma/pl330.c struct pl330_dmac *pl330 = thrd->dmac; thrd 1789 drivers/dma/pl330.c && pl330->events[ev] == thrd->id) thrd 1793 drivers/dma/pl330.c static void pl330_release_channel(struct pl330_thread *thrd) thrd 1795 drivers/dma/pl330.c if (!thrd || thrd->free) thrd 1798 drivers/dma/pl330.c _stop(thrd); thrd 1800 drivers/dma/pl330.c dma_pl330_rqcb(thrd->req[1 - thrd->lstenq].desc, PL330_ERR_ABORT); thrd 1801 drivers/dma/pl330.c dma_pl330_rqcb(thrd->req[thrd->lstenq].desc, PL330_ERR_ABORT); thrd 1803 drivers/dma/pl330.c _free_event(thrd, thrd->ev); thrd 1804 drivers/dma/pl330.c thrd->free = true; thrd 1852 drivers/dma/pl330.c static inline void _reset_thread(struct pl330_thread *thrd) thrd 1854 drivers/dma/pl330.c struct pl330_dmac *pl330 = thrd->dmac; thrd 1856 drivers/dma/pl330.c thrd->req[0].mc_cpu = pl330->mcode_cpu thrd 1857 drivers/dma/pl330.c + (thrd->id * pl330->mcbufsz); thrd 1858 drivers/dma/pl330.c thrd->req[0].mc_bus = pl330->mcode_bus thrd 1859 drivers/dma/pl330.c + (thrd->id * pl330->mcbufsz); thrd 1860 drivers/dma/pl330.c thrd->req[0].desc = NULL; thrd 1862 drivers/dma/pl330.c thrd->req[1].mc_cpu = thrd->req[0].mc_cpu thrd 1864 drivers/dma/pl330.c thrd->req[1].mc_bus = thrd->req[0].mc_bus thrd 1866 drivers/dma/pl330.c thrd->req[1].desc = NULL; thrd 1868 drivers/dma/pl330.c thrd->req_running = -1; thrd 1874 drivers/dma/pl330.c struct pl330_thread *thrd; thrd 1878 drivers/dma/pl330.c pl330->channels = kcalloc(1 + chans, sizeof(*thrd), thrd 1885 drivers/dma/pl330.c thrd = &pl330->channels[i]; thrd 1886 drivers/dma/pl330.c thrd->id = i; thrd 1887 drivers/dma/pl330.c thrd->dmac = pl330; thrd 1888 drivers/dma/pl330.c _reset_thread(thrd); thrd 1889 drivers/dma/pl330.c thrd->free = true; thrd 1893 drivers/dma/pl330.c thrd = &pl330->channels[chans]; thrd 1894 drivers/dma/pl330.c thrd->id = chans; thrd 1895 drivers/dma/pl330.c thrd->dmac = pl330; thrd 1896 drivers/dma/pl330.c thrd->free = false; thrd 1897 drivers/dma/pl330.c pl330->manager = thrd; thrd 1983 drivers/dma/pl330.c struct pl330_thread *thrd; thrd 1988 drivers/dma/pl330.c thrd = &pl330->channels[i]; thrd 1989 drivers/dma/pl330.c pl330_release_channel(thrd); thrd 2367 drivers/dma/pl330.c struct pl330_thread *thrd = pch->thread; thrd 2369 drivers/dma/pl330.c void __iomem *regs = thrd->dmac->base; thrd 2375 drivers/dma/pl330.c val = readl(regs + SA(thrd->id)); thrd 2378 drivers/dma/pl330.c val = readl(regs + DA(thrd->id)); thrd 2918 drivers/dma/pl330.c struct pl330_thread *thrd = &pl330->channels[ch]; thrd 2924 drivers/dma/pl330.c if (!pch->thread || thrd->id != pch->thread->id) thrd 2930 drivers/dma/pl330.c seq_printf(s, "%d\t\t", thrd->id);