Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2067e0a1 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by David S. Miller
Browse files

net: mvpp2: set dma mask and coherent dma mask on PPv2.2



On PPv2.2, the streaming mappings can be anywhere in the first 40 bits
of the physical address space. However, for the coherent mappings, we
still need them to be in the first 32 bits of the address space,
because all BM pools share a single register to store the high 32 bits
of the BM pool address, which means all BM pools must be allocated in
the same 4GB memory area.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fceb55d4
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -6941,6 +6941,20 @@ static int mvpp2_probe(struct platform_device *pdev)
	/* Get system's tclk rate */
	priv->tclk = clk_get_rate(priv->pp_clk);

	if (priv->hw_version == MVPP22) {
		err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
		if (err)
			goto err_mg_clk;
		/* Sadly, the BM pools all share the same register to
		 * store the high 32 bits of their address. So they
		 * must all have the same high 32 bits, which forces
		 * us to restrict coherent memory to DMA_BIT_MASK(32).
		 */
		err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
		if (err)
			goto err_mg_clk;
	}

	/* Initialize network controller */
	err = mvpp2_init(pdev, priv);
	if (err < 0) {