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

Commit 3a09b12e authored by Gerhard Sittig's avatar Gerhard Sittig Committed by Marc Kleine-Budde
Browse files

can: mscan: add a comment on reg to idx mapping



add a comment about the magic of deriving an MSCAN component index
from the peripheral's physical address / register offset

Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarGerhard Sittig <gsi@denx.de>
Signed-off-by: default avatarAnatolij Gustschin <agust@denx.de>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 7ec06da8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -148,7 +148,10 @@ static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
		goto exit_put;
	}

	/* Determine the MSCAN device index from the physical address */
	/* Determine the MSCAN device index from the peripheral's
	 * physical address. Register address offsets against the
	 * IMMR base are:  0x1300, 0x1380, 0x2300, 0x2380
	 */
	pval = of_get_property(ofdev->dev.of_node, "reg", &plen);
	BUG_ON(!pval || plen < sizeof(*pval));
	clockidx = (*pval & 0x80) ? 1 : 0;