Re: [PATCH net-next v1 09/10] net: dsa: microchip: add regmap_range for KSZ8563 chip

Oleksij Rempel
2022-08-01T05:11:58Z

On Fri, Jul 29, 2022 at 03:03:45PM +0200, Oleksij Rempel wrote:
> Add register validation for KSZ8563.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> drivers/net/dsa/microchip/ksz_common.c | 131 +++++++++++++++++++++++++
> 1 file changed, 131 insertions(+)
>
> diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
> index d3a9836c706f..97b5fb75b489 100644
> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -412,6 +412,135 @@ static const u8 lan937x_shifts[] = {
> [ALU_STAT_INDEX] = 8,
> };
>
> +static const struct regmap_range ksz8563_valid_regs[] = {
> + regmap_reg_range(0x0000, 0x0003),
> + regmap_reg_range(0x0006, 0x0006),
> + regmap_reg_range(0x000f, 0x001f),
> + regmap_reg_range(0x0100, 0x0100),
> + regmap_reg_range(0x0104, 0x0107),
> + regmap_reg_range(0x010d, 0x010d),
> + regmap_reg_range(0x0110, 0x0113),
> + regmap_reg_range(0x0120, 0x012b),
> + regmap_reg_range(0x0201, 0x0201),
> + regmap_reg_range(0x0210, 0x0213),
> + regmap_reg_range(0x0300, 0x0300),
> + regmap_reg_range(0x0302, 0x031b),
> + regmap_reg_range(0x0320, 0x032b),
> + regmap_reg_range(0x0330, 0x0336),
> + regmap_reg_range(0x0338, 0x033e),
> + regmap_reg_range(0x0340, 0x035f),
> + regmap_reg_range(0x0370, 0x0370),
> + regmap_reg_range(0x0378, 0x0378),
> + regmap_reg_range(0x037c, 0x037d),
> + regmap_reg_range(0x0390, 0x0393),
> + regmap_reg_range(0x0400, 0x040e),
> + regmap_reg_range(0x0410, 0x042f),
> + regmap_reg_range(0x0500, 0x0519),
> + regmap_reg_range(0x0520, 0x054b),
> + regmap_reg_range(0x0550, 0x05b3),
> +
> + /* port 1 */
> + regmap_reg_range(0x1000, 0x1001),
> + regmap_reg_range(0x1004, 0x100b),
> + regmap_reg_range(0x1013, 0x1013),
> + regmap_reg_range(0x1017, 0x1017),
> + regmap_reg_range(0x101b, 0x101b),
> + regmap_reg_range(0x101f, 0x1021),
> + regmap_reg_range(0x1030, 0x1030),
> + regmap_reg_range(0x1100, 0x1111),
> + regmap_reg_range(0x111a, 0x111d),
> + regmap_reg_range(0x1122, 0x1127),
> + regmap_reg_range(0x112a, 0x112b),
> + regmap_reg_range(0x1136, 0x1139),
> + regmap_reg_range(0x113e, 0x113f),
> + regmap_reg_range(0x1300, 0x1301),
> + regmap_reg_range(0x1303, 0x1303),

Some of this register are not supported on port 1 and 2. I'll send new
version of this patches.

Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |