// SPDX-License-Identifier: GPL-2.0/* Realtek SMI subdriver for the Realtek RTL8366RB ethernet switch * * This is a sparsely documented chip, the only viable documentation seems * to be a patched up code drop from the vendor that appear in various * GPL source trees. * * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org> * Copyright (C) 2010 Antti Seppälä <a.seppala@gmail.com> * Copyright (C) 2010 Roman Yeryomin <roman@advem.lv> * Copyright (C) 2011 Colin Leitner <colin.leitner@googlemail.com> */#include<linux/bitops.h>#include<linux/etherdevice.h>#include<linux/interrupt.h>#include<linux/irqdomain.h>#include<linux/irqchip/chained_irq.h>#include<linux/of_irq.h>#include<linux/regmap.h>#include"realtek-smi-core.h"#define RTL8366RB_PORT_NUM_CPU 5#define RTL8366RB_NUM_PORTS 6#define RTL8366RB_PHY_NO_MAX 4#define RTL8366RB_PHY_ADDR_MAX 31/* Switch Global Configuration register */#define RTL8366RB_SGCR 0x0000#define RTL8366RB_SGCR_EN_BC_STORM_CTRL BIT(0)#define RTL8366RB_SG