net: sun8i_emac: Name magic bits and simplify read-modify-write calls
authorAndre Przywara <andre.przywara@arm.com>
Mon, 6 Jul 2020 00:40:36 +0000 (01:40 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Wed, 21 Oct 2020 18:13:28 +0000 (23:43 +0530)
commit4fe8641260d005f24b0ecca8b21d7c51e639c647
treecc8b8864ad7a63969aaedaf27cf67ad0d81c4990
parenta5b2a991b388b7f42b0e264dfe2dfefc265f43ca
net: sun8i_emac: Name magic bits and simplify read-modify-write calls

The EMAC driver contains a lot of magic bits, although the manuals
and the Linux driver have all names for them.

Define those names and use them when programming the registers.
Also this replaces a lot of readl/mask/writel operations with the much
easier-to-read setbits_le32() macro.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Amit Singh Tomar <amittomer25@gmail.com> # Pine64+
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/net/sun8i_emac.c