Commit cd399838 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'Ocelot-Felix-driver-cleanup'

Vladimir Oltean says:

====================
Ocelot/Felix driver cleanup

Some of the code in the mscc felix and ocelot drivers was added while in
a bit of a hurry. Let's take a moment and put things in relative order.

First 3 patches are sparse warning fixes.

Patches 4-9 perform some further splitting between mscc_felix,
mscc_ocelot, and the common hardware library they share. Meaning that
some code is being moved from the library into just the mscc_ocelot
module.

Patches 10-12 refactor the naming conventions in the existing VCAP code
(for tc-flower offload), since we're going to be adding some more code
for VCAP IS1 (previous tentatives already submitted here:
https://patchwork.ozlabs.org/project/netdev/cover/20200602051828.5734-1-xiaoliang.yang_1@nxp.com/

),
and that code would be confusing to read and maintain using current
naming conventions.

No functional modification is intended. I checked that the VCAP IS2 code
still works by applying a tc ingress filter with an EtherType key and
'drop' action.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 60cb8d3d c73b0ad3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,7 +4,9 @@ config NET_DSA_MSCC_FELIX
	depends on NET_DSA && PCI
	depends on NET_VENDOR_MICROSEMI
	depends on NET_VENDOR_FREESCALE
	select MSCC_OCELOT_SWITCH
	depends on HAS_IOMEM
	depends on REGMAP_MMIO
	select MSCC_OCELOT_SWITCH_LIB
	select NET_DSA_TAG_OCELOT
	select FSL_ENETC_MDIO
	help
+2 −2
Original line number Diff line number Diff line
@@ -557,7 +557,7 @@ static const struct ocelot_stat_layout vsc9959_stats_layout[] = {
	{ .offset = 0x111,	.name = "drop_green_prio_7", },
};

struct vcap_field vsc9959_vcap_is2_keys[] = {
static struct vcap_field vsc9959_vcap_is2_keys[] = {
	/* Common: 41 bits */
	[VCAP_IS2_TYPE]				= {  0,   4},
	[VCAP_IS2_HK_FIRST]			= {  4,   1},
@@ -637,7 +637,7 @@ struct vcap_field vsc9959_vcap_is2_keys[] = {
	[VCAP_IS2_HK_OAM_IS_Y1731]		= {182,   1},
};

struct vcap_field vsc9959_vcap_is2_actions[] = {
static struct vcap_field vsc9959_vcap_is2_actions[] = {
	[VCAP_IS2_ACT_HIT_ME_ONCE]		= {  0,  1},
	[VCAP_IS2_ACT_CPU_COPY_ENA]		= {  1,  1},
	[VCAP_IS2_ACT_CPU_QU_NUM]		= {  2,  3},
+12 −10
Original line number Diff line number Diff line
@@ -11,22 +11,24 @@ config NET_VENDOR_MICROSEMI

if NET_VENDOR_MICROSEMI

# Users should depend on NET_SWITCHDEV, HAS_IOMEM, PHYLIB and REGMAP_MMIO
config MSCC_OCELOT_SWITCH_LIB
	tristate
	help
	  This is a hardware support library for Ocelot network switches. It is
	  used by switchdev as well as by DSA drivers.

config MSCC_OCELOT_SWITCH
	tristate "Ocelot switch driver"
	depends on NET_SWITCHDEV
	depends on HAS_IOMEM
	select PHYLIB
	select REGMAP_MMIO
	help
	  This driver supports the Ocelot network switch device.

config MSCC_OCELOT_SWITCH_OCELOT
	tristate "Ocelot switch driver on Ocelot"
	depends on MSCC_OCELOT_SWITCH
	depends on GENERIC_PHY
	depends on REGMAP_MMIO
	depends on HAS_IOMEM
	depends on PHYLIB
	depends on OF_NET
	select MSCC_OCELOT_SWITCH_LIB
	help
	  This driver supports the Ocelot network switch device as present on
	  the Ocelot SoCs.
	  the Ocelot SoCs (VSC7514).

endif # NET_VENDOR_MICROSEMI
+12 −4
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR MIT)
obj-$(CONFIG_MSCC_OCELOT_SWITCH) += mscc_ocelot_common.o
mscc_ocelot_common-y := ocelot.o ocelot_io.o
mscc_ocelot_common-y += ocelot_regs.o ocelot_tc.o ocelot_police.o ocelot_ace.o ocelot_flower.o ocelot_ptp.o
obj-$(CONFIG_MSCC_OCELOT_SWITCH_OCELOT) += ocelot_board.o
obj-$(CONFIG_MSCC_OCELOT_SWITCH_LIB) += mscc_ocelot_switch_lib.o
mscc_ocelot_switch_lib-y := \
	ocelot.o \
	ocelot_io.o \
	ocelot_police.o \
	ocelot_vcap.o \
	ocelot_flower.o \
	ocelot_ptp.o
obj-$(CONFIG_MSCC_OCELOT_SWITCH) += mscc_ocelot.o
mscc_ocelot-y := \
	ocelot_vsc7514.o \
	ocelot_net.o
+25 −888

File changed.

Preview size limit exceeded, changes collapsed.

Loading