Lines Matching refs:pl08x
401 static void pl08x_write_lli(struct pl08x_driver_data *pl08x, in pl08x_write_lli() argument
404 if (pl08x->vd->pl080s) in pl08x_write_lli()
405 dev_vdbg(&pl08x->adev->dev, in pl08x_write_lli()
412 dev_vdbg(&pl08x->adev->dev, in pl08x_write_lli()
473 switch (pl08x->pd->memcpy_burst_size) { in pl08x_write_lli()
510 if (pl08x->pd->memcpy_prot_buff) in pl08x_write_lli()
512 if (pl08x->pd->memcpy_prot_cache) in pl08x_write_lli()
524 if (pl08x->vd->pl080s) in pl08x_write_lli()
539 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_start_next_txd() local
553 pl08x_write_lli(pl08x, phychan, &txd->llis_va[0], txd->ccfg); in pl08x_start_next_txd()
557 while (readl(pl08x->base + PL080_EN_CHAN) & BIT(phychan->id)) in pl08x_start_next_txd()
644 static void pl08x_terminate_phy_chan(struct pl08x_driver_data *pl08x, in pl08x_terminate_phy_chan() argument
666 pl08x->base + PL080_ERR_CLEAR); in pl08x_terminate_phy_chan()
667 writel(BIT(ch->id), pl08x->base + PL080_TC_CLEAR); in pl08x_terminate_phy_chan()
677 writel(BIT(ch->id), pl08x->base + PL080_ERR_CLEAR); in pl08x_terminate_phy_chan()
678 writel(BIT(ch->id), pl08x->base + PL080_TC_CLEAR); in pl08x_terminate_phy_chan()
765 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_getbytes_chan() local
795 llis_max_words = pl08x->lli_words * MAX_NUM_TSFR_LLIS; in pl08x_getbytes_chan()
807 for (; llis_va < llis_va_limit; llis_va += pl08x->lli_words) { in pl08x_getbytes_chan()
828 pl08x_get_phy_channel(struct pl08x_driver_data *pl08x, in pl08x_get_phy_channel() argument
835 for (i = 0; i < pl08x->vd->channels; i++) { in pl08x_get_phy_channel()
836 ch = &pl08x->phy_chans[i]; in pl08x_get_phy_channel()
849 if (i == pl08x->vd->channels) { in pl08x_get_phy_channel()
858 static inline void pl08x_put_phy_channel(struct pl08x_driver_data *pl08x, in pl08x_put_phy_channel() argument
871 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_phy_alloc_and_start() local
874 ch = pl08x_get_phy_channel(pl08x, plchan); in pl08x_phy_alloc_and_start()
876 dev_dbg(&pl08x->adev->dev, "no physical channel available for xfer on %s\n", plchan->name); in pl08x_phy_alloc_and_start()
881 dev_dbg(&pl08x->adev->dev, "allocated physical channel %d for xfer on %s\n", in pl08x_phy_alloc_and_start()
892 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_phy_reassign_start() local
894 dev_dbg(&pl08x->adev->dev, "reassigned physical channel %d for xfer on %s\n", in pl08x_phy_reassign_start()
914 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_phy_free() local
921 list_for_each_entry(p, &pl08x->memcpy.channels, vc.chan.device_node) in pl08x_phy_free()
927 if (!next && pl08x->has_slave) { in pl08x_phy_free()
928 list_for_each_entry(p, &pl08x->slave.channels, vc.chan.device_node) in pl08x_phy_free()
936 pl08x_terminate_phy_chan(pl08x, plchan->phychan); in pl08x_phy_free()
957 pl08x_put_phy_channel(pl08x, plchan->phychan); in pl08x_phy_free()
969 pl08x_get_bytes_for_lli(struct pl08x_driver_data *pl08x, in pl08x_get_bytes_for_lli() argument
975 if (pl08x->vd->ftdmac020) { in pl08x_get_bytes_for_lli()
1005 static inline u32 pl08x_lli_control_bits(struct pl08x_driver_data *pl08x, in pl08x_lli_control_bits() argument
1017 if (pl08x->vd->ftdmac020) { in pl08x_lli_control_bits()
1125 static void pl08x_choose_master_bus(struct pl08x_driver_data *pl08x, in pl08x_choose_master_bus() argument
1138 if (pl08x->vd->ftdmac020) { in pl08x_choose_master_bus()
1170 static void pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x, in pl08x_fill_lli_for_desc() argument
1174 u32 offset = num_llis * pl08x->lli_words; in pl08x_fill_lli_for_desc()
1181 offset += pl08x->lli_words; in pl08x_fill_lli_for_desc()
1188 if (pl08x->vd->pl080s) in pl08x_fill_lli_for_desc()
1191 if (pl08x->vd->ftdmac020) { in pl08x_fill_lli_for_desc()
1207 static inline void prep_byte_width_lli(struct pl08x_driver_data *pl08x, in prep_byte_width_lli() argument
1211 *cctl = pl08x_lli_control_bits(pl08x, *cctl, 1, 1, len); in prep_byte_width_lli()
1212 pl08x_fill_lli_for_desc(pl08x, bd, num_llis, len, *cctl, len); in prep_byte_width_lli()
1217 static void pl08x_dump_lli(struct pl08x_driver_data *pl08x, in pl08x_dump_lli() argument
1222 if (pl08x->vd->pl080s) { in pl08x_dump_lli()
1223 dev_vdbg(&pl08x->adev->dev, in pl08x_dump_lli()
1227 dev_vdbg(&pl08x->adev->dev, in pl08x_dump_lli()
1233 llis_va += pl08x->lli_words; in pl08x_dump_lli()
1236 dev_vdbg(&pl08x->adev->dev, in pl08x_dump_lli()
1240 dev_vdbg(&pl08x->adev->dev, in pl08x_dump_lli()
1245 llis_va += pl08x->lli_words; in pl08x_dump_lli()
1250 static inline void pl08x_dump_lli(struct pl08x_driver_data *pl08x, in pl08x_dump_lli() argument
1259 static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, in pl08x_fill_llis_for_desc() argument
1270 txd->llis_va = dma_pool_alloc(pl08x->pool, GFP_NOWAIT, &txd->llis_bus); in pl08x_fill_llis_for_desc()
1272 dev_err(&pl08x->adev->dev, "%s no memory for llis\n", __func__); in pl08x_fill_llis_for_desc()
1277 bd.lli_bus = (pl08x->lli_buses & PL08X_AHB2) ? PL080_LLI_LM_AHB2 : 0; in pl08x_fill_llis_for_desc()
1281 bd.srcbus.maxwidth = pl08x_get_bytes_for_lli(pl08x, cctl, true); in pl08x_fill_llis_for_desc()
1284 bd.dstbus.maxwidth = pl08x_get_bytes_for_lli(pl08x, cctl, false); in pl08x_fill_llis_for_desc()
1296 pl08x_choose_master_bus(pl08x, &bd, &mbus, &sbus, cctl); in pl08x_fill_llis_for_desc()
1298 dev_vdbg(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1307 dev_vdbg(&pl08x->adev->dev, "mbus=%s sbus=%s\n", in pl08x_fill_llis_for_desc()
1336 if (pl08x->vd->ftdmac020) in pl08x_fill_llis_for_desc()
1343 dev_err(&pl08x->adev->dev, "%s sg len can't be zero", in pl08x_fill_llis_for_desc()
1350 dev_err(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1357 cctl = pl08x_lli_control_bits(pl08x, cctl, in pl08x_fill_llis_for_desc()
1360 pl08x_fill_lli_for_desc(pl08x, &bd, num_llis++, in pl08x_fill_llis_for_desc()
1380 dev_vdbg(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1383 prep_byte_width_lli(pl08x, &bd, &cctl, early_bytes, in pl08x_fill_llis_for_desc()
1393 dev_dbg(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1405 pl08x->vd->max_transfer_size; in pl08x_fill_llis_for_desc()
1406 dev_vdbg(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1433 dev_vdbg(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1438 cctl = pl08x_lli_control_bits(pl08x, cctl, in pl08x_fill_llis_for_desc()
1441 pl08x_fill_lli_for_desc(pl08x, &bd, num_llis++, in pl08x_fill_llis_for_desc()
1450 dev_vdbg(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1453 prep_byte_width_lli(pl08x, &bd, &cctl, in pl08x_fill_llis_for_desc()
1459 dev_err(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1466 dev_err(&pl08x->adev->dev, in pl08x_fill_llis_for_desc()
1474 last_lli = llis_va + (num_llis - 1) * pl08x->lli_words; in pl08x_fill_llis_for_desc()
1483 if (pl08x->vd->ftdmac020) in pl08x_fill_llis_for_desc()
1489 pl08x_dump_lli(pl08x, llis_va, num_llis); in pl08x_fill_llis_for_desc()
1494 static void pl08x_free_txd(struct pl08x_driver_data *pl08x, in pl08x_free_txd() argument
1500 dma_pool_free(pl08x->pool, txd->llis_va, txd->llis_bus); in pl08x_free_txd()
1522 static void pl08x_free_txd_list(struct pl08x_driver_data *pl08x, in pl08x_free_txd_list() argument
1763 static u32 pl08x_memcpy_cctl(struct pl08x_driver_data *pl08x) in pl08x_memcpy_cctl() argument
1768 switch (pl08x->pd->memcpy_burst_size) { in pl08x_memcpy_cctl()
1770 dev_err(&pl08x->adev->dev, in pl08x_memcpy_cctl()
1807 switch (pl08x->pd->memcpy_bus_width) { in pl08x_memcpy_cctl()
1809 dev_err(&pl08x->adev->dev, in pl08x_memcpy_cctl()
1827 if (pl08x->pd->memcpy_prot_buff) in pl08x_memcpy_cctl()
1829 if (pl08x->pd->memcpy_prot_cache) in pl08x_memcpy_cctl()
1838 if (pl08x->vd->dualmaster) in pl08x_memcpy_cctl()
1840 pl08x->mem_buses, in pl08x_memcpy_cctl()
1841 pl08x->mem_buses); in pl08x_memcpy_cctl()
1846 static u32 pl08x_ftdmac020_memcpy_cctl(struct pl08x_driver_data *pl08x) in pl08x_ftdmac020_memcpy_cctl() argument
1851 switch (pl08x->pd->memcpy_bus_width) { in pl08x_ftdmac020_memcpy_cctl()
1853 dev_err(&pl08x->adev->dev, in pl08x_ftdmac020_memcpy_cctl()
1880 if (pl08x->vd->dualmaster) in pl08x_ftdmac020_memcpy_cctl()
1882 pl08x->mem_buses, in pl08x_ftdmac020_memcpy_cctl()
1883 pl08x->mem_buses); in pl08x_ftdmac020_memcpy_cctl()
1896 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_prep_dma_memcpy() local
1903 dev_err(&pl08x->adev->dev, in pl08x_prep_dma_memcpy()
1910 pl08x_free_txd(pl08x, txd); in pl08x_prep_dma_memcpy()
1918 if (pl08x->vd->ftdmac020) { in pl08x_prep_dma_memcpy()
1921 txd->cctl = pl08x_ftdmac020_memcpy_cctl(pl08x); in pl08x_prep_dma_memcpy()
1926 txd->cctl = pl08x_memcpy_cctl(pl08x); in pl08x_prep_dma_memcpy()
1931 pl08x_free_txd(pl08x, txd); in pl08x_prep_dma_memcpy()
1944 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_init_txd() local
1953 dev_err(&pl08x->adev->dev, "%s no txd\n", __func__); in pl08x_init_txd()
1967 src_buses = pl08x->mem_buses; in pl08x_init_txd()
1975 dst_buses = pl08x->mem_buses; in pl08x_init_txd()
1977 pl08x_free_txd(pl08x, txd); in pl08x_init_txd()
1978 dev_err(&pl08x->adev->dev, in pl08x_init_txd()
1985 pl08x_free_txd(pl08x, txd); in pl08x_init_txd()
1986 dev_err(&pl08x->adev->dev, in pl08x_init_txd()
2006 pl08x_free_txd(pl08x, txd); in pl08x_init_txd()
2007 dev_dbg(&pl08x->adev->dev, in pl08x_init_txd()
2013 dev_dbg(&pl08x->adev->dev, "allocated DMA request signal %d for xfer on %s\n", in pl08x_init_txd()
2057 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_prep_slave_sg() local
2063 dev_dbg(&pl08x->adev->dev, "%s prepare transaction of %d bytes from %s\n", in pl08x_prep_slave_sg()
2076 pl08x_free_txd(pl08x, txd); in pl08x_prep_slave_sg()
2077 dev_err(&pl08x->adev->dev, "%s no mem for pl080 sg\n", in pl08x_prep_slave_sg()
2086 pl08x_free_txd(pl08x, txd); in pl08x_prep_slave_sg()
2099 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_prep_dma_cyclic() local
2104 dev_dbg(&pl08x->adev->dev, in pl08x_prep_dma_cyclic()
2121 pl08x_free_txd(pl08x, txd); in pl08x_prep_dma_cyclic()
2129 pl08x_free_txd(pl08x, txd); in pl08x_prep_dma_cyclic()
2140 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_config() local
2150 if (config->device_fc && pl08x->vd->pl080s) { in pl08x_config()
2151 dev_err(&pl08x->adev->dev, in pl08x_config()
2165 struct pl08x_driver_data *pl08x = plchan->host; in pl08x_terminate_all() local
2189 pl08x_free_txd_list(pl08x, plchan); in pl08x_terminate_all()
2281 static void pl08x_ensure_on(struct pl08x_driver_data *pl08x) in pl08x_ensure_on() argument
2284 if (pl08x->vd->nomadik) in pl08x_ensure_on()
2287 if (pl08x->vd->ftdmac020) { in pl08x_ensure_on()
2288 writel(PL080_CONFIG_ENABLE, pl08x->base + FTDMAC020_CSR); in pl08x_ensure_on()
2291 writel(PL080_CONFIG_ENABLE, pl08x->base + PL080_CONFIG); in pl08x_ensure_on()
2296 struct pl08x_driver_data *pl08x = dev; in pl08x_irq() local
2300 err = readl(pl08x->base + PL080_ERR_STATUS); in pl08x_irq()
2302 dev_err(&pl08x->adev->dev, "%s error interrupt, register value 0x%08x\n", in pl08x_irq()
2304 writel(err, pl08x->base + PL080_ERR_CLEAR); in pl08x_irq()
2306 tc = readl(pl08x->base + PL080_TC_STATUS); in pl08x_irq()
2308 writel(tc, pl08x->base + PL080_TC_CLEAR); in pl08x_irq()
2313 for (i = 0; i < pl08x->vd->channels; i++) { in pl08x_irq()
2316 struct pl08x_phy_chan *phychan = &pl08x->phy_chans[i]; in pl08x_irq()
2321 dev_err(&pl08x->adev->dev, in pl08x_irq()
2371 static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, in pl08x_dma_init_virtual_channels() argument
2389 chan->host = pl08x; in pl08x_dma_init_virtual_channels()
2394 chan->cd = &pl08x->pd->slave_channels[i]; in pl08x_dma_init_virtual_channels()
2409 chan->cd->periph_buses = pl08x->pd->mem_buses; in pl08x_dma_init_virtual_channels()
2417 dev_dbg(&pl08x->adev->dev, in pl08x_dma_init_virtual_channels()
2424 dev_info(&pl08x->adev->dev, "initialized %d virtual %s channels\n", in pl08x_dma_init_virtual_channels()
2461 struct pl08x_driver_data *pl08x = s->private; in pl08x_debugfs_show() local
2470 for (i = 0; i < pl08x->vd->channels; i++) { in pl08x_debugfs_show()
2473 ch = &pl08x->phy_chans[i]; in pl08x_debugfs_show()
2489 list_for_each_entry(chan, &pl08x->memcpy.channels, vc.chan.device_node) { in pl08x_debugfs_show()
2494 if (pl08x->has_slave) { in pl08x_debugfs_show()
2498 list_for_each_entry(chan, &pl08x->slave.channels, in pl08x_debugfs_show()
2520 static void init_pl08x_debugfs(struct pl08x_driver_data *pl08x) in init_pl08x_debugfs() argument
2523 (void) debugfs_create_file(dev_name(&pl08x->adev->dev), in init_pl08x_debugfs()
2524 S_IFREG | S_IRUGO, NULL, pl08x, in init_pl08x_debugfs()
2529 static inline void init_pl08x_debugfs(struct pl08x_driver_data *pl08x) in init_pl08x_debugfs() argument
2535 static struct dma_chan *pl08x_find_chan_id(struct pl08x_driver_data *pl08x, in pl08x_find_chan_id() argument
2541 if (!pl08x->has_slave) in pl08x_find_chan_id()
2544 list_for_each_entry(chan, &pl08x->slave.channels, vc.chan.device_node) { in pl08x_find_chan_id()
2555 struct pl08x_driver_data *pl08x = ofdma->of_dma_data; in pl08x_of_xlate() local
2559 if (!pl08x) in pl08x_of_xlate()
2563 dev_err(&pl08x->adev->dev, in pl08x_of_xlate()
2568 dma_chan = pl08x_find_chan_id(pl08x, dma_spec->args[0]); in pl08x_of_xlate()
2570 dev_err(&pl08x->adev->dev, in pl08x_of_xlate()
2576 dev_dbg(&pl08x->adev->dev, in pl08x_of_xlate()
2586 struct pl08x_driver_data *pl08x, in pl08x_of_probe() argument
2681 if (pl08x->vd->signals) { in pl08x_of_probe()
2683 pl08x->vd->signals, in pl08x_of_probe()
2690 for (i = 0; i < pl08x->vd->signals; i++) { in pl08x_of_probe()
2697 pd->num_slave_channels = pl08x->vd->signals; in pl08x_of_probe()
2700 pl08x->pd = pd; in pl08x_of_probe()
2703 pl08x); in pl08x_of_probe()
2707 struct pl08x_driver_data *pl08x, in pl08x_of_probe() argument
2716 struct pl08x_driver_data *pl08x; in pl08x_probe() local
2733 pl08x = kzalloc(sizeof(*pl08x), GFP_KERNEL); in pl08x_probe()
2734 if (!pl08x) { in pl08x_probe()
2740 pl08x->adev = adev; in pl08x_probe()
2741 pl08x->vd = vd; in pl08x_probe()
2743 pl08x->base = ioremap(adev->res.start, resource_size(&adev->res)); in pl08x_probe()
2744 if (!pl08x->base) { in pl08x_probe()
2752 val = readl(pl08x->base + FTDMAC020_REVISION); in pl08x_probe()
2753 dev_info(&pl08x->adev->dev, "FTDMAC020 %d.%d rel %d\n", in pl08x_probe()
2755 val = readl(pl08x->base + FTDMAC020_FEATURE); in pl08x_probe()
2756 dev_info(&pl08x->adev->dev, "FTDMAC020 %d channels, " in pl08x_probe()
2765 dev_warn(&pl08x->adev->dev, in pl08x_probe()
2772 dma_cap_set(DMA_MEMCPY, pl08x->memcpy.cap_mask); in pl08x_probe()
2773 pl08x->memcpy.dev = &adev->dev; in pl08x_probe()
2774 pl08x->memcpy.device_free_chan_resources = pl08x_free_chan_resources; in pl08x_probe()
2775 pl08x->memcpy.device_prep_dma_memcpy = pl08x_prep_dma_memcpy; in pl08x_probe()
2776 pl08x->memcpy.device_prep_dma_interrupt = pl08x_prep_dma_interrupt; in pl08x_probe()
2777 pl08x->memcpy.device_tx_status = pl08x_dma_tx_status; in pl08x_probe()
2778 pl08x->memcpy.device_issue_pending = pl08x_issue_pending; in pl08x_probe()
2779 pl08x->memcpy.device_config = pl08x_config; in pl08x_probe()
2780 pl08x->memcpy.device_pause = pl08x_pause; in pl08x_probe()
2781 pl08x->memcpy.device_resume = pl08x_resume; in pl08x_probe()
2782 pl08x->memcpy.device_terminate_all = pl08x_terminate_all; in pl08x_probe()
2783 pl08x->memcpy.device_synchronize = pl08x_synchronize; in pl08x_probe()
2784 pl08x->memcpy.src_addr_widths = PL80X_DMA_BUSWIDTHS; in pl08x_probe()
2785 pl08x->memcpy.dst_addr_widths = PL80X_DMA_BUSWIDTHS; in pl08x_probe()
2786 pl08x->memcpy.directions = BIT(DMA_MEM_TO_MEM); in pl08x_probe()
2787 pl08x->memcpy.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; in pl08x_probe()
2789 pl08x->memcpy.copy_align = DMAENGINE_ALIGN_4_BYTES; in pl08x_probe()
2797 pl08x->has_slave = true; in pl08x_probe()
2798 dma_cap_set(DMA_SLAVE, pl08x->slave.cap_mask); in pl08x_probe()
2799 dma_cap_set(DMA_CYCLIC, pl08x->slave.cap_mask); in pl08x_probe()
2800 pl08x->slave.dev = &adev->dev; in pl08x_probe()
2801 pl08x->slave.device_free_chan_resources = in pl08x_probe()
2803 pl08x->slave.device_prep_dma_interrupt = in pl08x_probe()
2805 pl08x->slave.device_tx_status = pl08x_dma_tx_status; in pl08x_probe()
2806 pl08x->slave.device_issue_pending = pl08x_issue_pending; in pl08x_probe()
2807 pl08x->slave.device_prep_slave_sg = pl08x_prep_slave_sg; in pl08x_probe()
2808 pl08x->slave.device_prep_dma_cyclic = pl08x_prep_dma_cyclic; in pl08x_probe()
2809 pl08x->slave.device_config = pl08x_config; in pl08x_probe()
2810 pl08x->slave.device_pause = pl08x_pause; in pl08x_probe()
2811 pl08x->slave.device_resume = pl08x_resume; in pl08x_probe()
2812 pl08x->slave.device_terminate_all = pl08x_terminate_all; in pl08x_probe()
2813 pl08x->slave.device_synchronize = pl08x_synchronize; in pl08x_probe()
2814 pl08x->slave.src_addr_widths = PL80X_DMA_BUSWIDTHS; in pl08x_probe()
2815 pl08x->slave.dst_addr_widths = PL80X_DMA_BUSWIDTHS; in pl08x_probe()
2816 pl08x->slave.directions = in pl08x_probe()
2818 pl08x->slave.residue_granularity = in pl08x_probe()
2823 pl08x->pd = dev_get_platdata(&adev->dev); in pl08x_probe()
2824 if (!pl08x->pd) { in pl08x_probe()
2826 ret = pl08x_of_probe(adev, pl08x, np); in pl08x_probe()
2835 pl08x->slave.filter.map = pl08x->pd->slave_map; in pl08x_probe()
2836 pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len; in pl08x_probe()
2837 pl08x->slave.filter.fn = pl08x_filter_fn; in pl08x_probe()
2841 pl08x->lli_buses = PL08X_AHB1; in pl08x_probe()
2842 pl08x->mem_buses = PL08X_AHB1; in pl08x_probe()
2843 if (pl08x->vd->dualmaster) { in pl08x_probe()
2844 pl08x->lli_buses = pl08x->pd->lli_buses; in pl08x_probe()
2845 pl08x->mem_buses = pl08x->pd->mem_buses; in pl08x_probe()
2849 pl08x->lli_words = PL080S_LLI_WORDS; in pl08x_probe()
2851 pl08x->lli_words = PL080_LLI_WORDS; in pl08x_probe()
2852 tsfr_size = MAX_NUM_TSFR_LLIS * pl08x->lli_words * sizeof(u32); in pl08x_probe()
2855 pl08x->pool = dma_pool_create(DRIVER_NAME, &pl08x->adev->dev, in pl08x_probe()
2857 if (!pl08x->pool) { in pl08x_probe()
2863 pl08x_ensure_on(pl08x); in pl08x_probe()
2868 writel(0x0000FFFF, pl08x->base + PL080_ERR_CLEAR); in pl08x_probe()
2870 writel(0x000000FF, pl08x->base + PL080_ERR_CLEAR); in pl08x_probe()
2871 writel(0x000000FF, pl08x->base + PL080_TC_CLEAR); in pl08x_probe()
2874 ret = request_irq(adev->irq[0], pl08x_irq, 0, DRIVER_NAME, pl08x); in pl08x_probe()
2882 pl08x->phy_chans = kzalloc((vd->channels * sizeof(*pl08x->phy_chans)), in pl08x_probe()
2884 if (!pl08x->phy_chans) { in pl08x_probe()
2890 struct pl08x_phy_chan *ch = &pl08x->phy_chans[i]; in pl08x_probe()
2893 ch->base = pl08x->base + PL080_Cx_BASE(i); in pl08x_probe()
2935 ret = pl08x_dma_init_virtual_channels(pl08x, &pl08x->memcpy, in pl08x_probe()
2936 pl08x->vd->channels, false); in pl08x_probe()
2938 dev_warn(&pl08x->adev->dev, in pl08x_probe()
2945 if (pl08x->has_slave) { in pl08x_probe()
2946 ret = pl08x_dma_init_virtual_channels(pl08x, &pl08x->slave, in pl08x_probe()
2947 pl08x->pd->num_slave_channels, true); in pl08x_probe()
2949 dev_warn(&pl08x->adev->dev, in pl08x_probe()
2956 ret = dma_async_device_register(&pl08x->memcpy); in pl08x_probe()
2958 dev_warn(&pl08x->adev->dev, in pl08x_probe()
2964 if (pl08x->has_slave) { in pl08x_probe()
2965 ret = dma_async_device_register(&pl08x->slave); in pl08x_probe()
2967 dev_warn(&pl08x->adev->dev, in pl08x_probe()
2974 amba_set_drvdata(adev, pl08x); in pl08x_probe()
2975 init_pl08x_debugfs(pl08x); in pl08x_probe()
2976 dev_info(&pl08x->adev->dev, "DMA: PL%03x%s rev%u at 0x%08llx irq %d\n", in pl08x_probe()
2977 amba_part(adev), pl08x->vd->pl080s ? "s" : "", amba_rev(adev), in pl08x_probe()
2983 dma_async_device_unregister(&pl08x->memcpy); in pl08x_probe()
2985 if (pl08x->has_slave) in pl08x_probe()
2986 pl08x_free_virtual_channels(&pl08x->slave); in pl08x_probe()
2988 pl08x_free_virtual_channels(&pl08x->memcpy); in pl08x_probe()
2990 kfree(pl08x->phy_chans); in pl08x_probe()
2992 free_irq(adev->irq[0], pl08x); in pl08x_probe()
2994 dma_pool_destroy(pl08x->pool); in pl08x_probe()
2997 iounmap(pl08x->base); in pl08x_probe()
2999 kfree(pl08x); in pl08x_probe()