linux/drivers/net/dsa/bcm_sf2.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Broadcom Starfighter 2 DSA switch driver
 *
 * Copyright (C) 2014, Broadcom Corporation
 */

#include <linux/list.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/phy_fixed.h>
#include <linux/phylink.h>
#include <linux/mii.h>
#include <linux/clk.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_address.h>
#include <linux/of_net.h>
#include <linux/of_mdio.h>
#include <net/dsa.h>
#include <linux/ethtool.h>
#include <linux/if_bridge.h>
#include <linux/brcmphy.h>
#include <linux/etherdevice.h>
#include <linux/platform_data/b53.h>

#include "bcm_sf2.h"
#include "bcm_sf2_regs.h"
#include "b53/b53_priv.h"
#include "b53/b53_regs.h"

static u16 bcm_sf2_reg_rgmii_cntrl(struct bcm_sf2_priv *priv, int port)
{}

static u16 bcm_sf2_reg_led_base(struct bcm_sf2_priv *priv, int port)
{}

static u32 bcm_sf2_port_override_offset(struct bcm_sf2_priv *priv, int port)
{}

/* Return the number of active ports, not counting the IMP (CPU) port */
static unsigned int bcm_sf2_num_active_ports(struct dsa_switch *ds)
{}

static void bcm_sf2_recalc_clock(struct dsa_switch *ds)
{}

static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
{}

static void bcm_sf2_gphy_enable_set(struct dsa_switch *ds, bool enable)
{}

static inline void bcm_sf2_port_intr_enable(struct bcm_sf2_priv *priv,
					    int port)
{}

static inline void bcm_sf2_port_intr_disable(struct bcm_sf2_priv *priv,
					     int port)
{}

static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,
			      struct phy_device *phy)
{}

static void bcm_sf2_port_disable(struct dsa_switch *ds, int port)
{}


static int bcm_sf2_sw_indir_rw(struct bcm_sf2_priv *priv, int op, int addr,
			       int regnum, u16 val)
{}

static int bcm_sf2_sw_mdio_read(struct mii_bus *bus, int addr, int regnum)
{}

static int bcm_sf2_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
				 u16 val)
{}

static irqreturn_t bcm_sf2_switch_0_isr(int irq, void *dev_id)
{}

static irqreturn_t bcm_sf2_switch_1_isr(int irq, void *dev_id)
{}

static int bcm_sf2_sw_rst(struct bcm_sf2_priv *priv)
{}

static void bcm_sf2_crossbar_setup(struct bcm_sf2_priv *priv)
{}

static void bcm_sf2_intr_disable(struct bcm_sf2_priv *priv)
{}

static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
				   struct device_node *dn)
{}

static int bcm_sf2_mdio_register(struct dsa_switch *ds)
{}

static void bcm_sf2_mdio_unregister(struct bcm_sf2_priv *priv)
{}

static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)
{}

static void bcm_sf2_sw_get_caps(struct dsa_switch *ds, int port,
				struct phylink_config *config)
{}

static void bcm_sf2_sw_mac_config(struct phylink_config *config,
				  unsigned int mode,
				  const struct phylink_link_state *state)
{}

static void bcm_sf2_sw_mac_link_set(struct dsa_switch *ds, int port,
				    phy_interface_t interface, bool link)
{}

static void bcm_sf2_sw_mac_link_down(struct phylink_config *config,
				     unsigned int mode,
				     phy_interface_t interface)
{}

static void bcm_sf2_sw_mac_link_up(struct phylink_config *config,
				   struct phy_device *phydev,
				   unsigned int mode,
				   phy_interface_t interface,
				   int speed, int duplex,
				   bool tx_pause, bool rx_pause)
{}

static void bcm_sf2_sw_fixed_state(struct dsa_switch *ds, int port,
				   struct phylink_link_state *status)
{}

static void bcm_sf2_enable_acb(struct dsa_switch *ds)
{}

static int bcm_sf2_sw_suspend(struct dsa_switch *ds)
{}

static int bcm_sf2_sw_resume(struct dsa_switch *ds)
{}

static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port,
			       struct ethtool_wolinfo *wol)
{}

static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port,
			      struct ethtool_wolinfo *wol)
{}

static int bcm_sf2_sw_setup(struct dsa_switch *ds)
{}

static void bcm_sf2_sw_teardown(struct dsa_switch *ds)
{}

/* The SWITCH_CORE register space is managed by b53 but operates on a page +
 * register basis so we need to translate that into an address that the
 * bus-glue understands.
 */
#define SF2_PAGE_REG_MKADDR(page, reg)

static int bcm_sf2_core_read8(struct b53_device *dev, u8 page, u8 reg,
			      u8 *val)
{}

static int bcm_sf2_core_read16(struct b53_device *dev, u8 page, u8 reg,
			       u16 *val)
{}

static int bcm_sf2_core_read32(struct b53_device *dev, u8 page, u8 reg,
			       u32 *val)
{}

static int bcm_sf2_core_read64(struct b53_device *dev, u8 page, u8 reg,
			       u64 *val)
{}

static int bcm_sf2_core_write8(struct b53_device *dev, u8 page, u8 reg,
			       u8 value)
{}

static int bcm_sf2_core_write16(struct b53_device *dev, u8 page, u8 reg,
				u16 value)
{}

static int bcm_sf2_core_write32(struct b53_device *dev, u8 page, u8 reg,
				u32 value)
{}

static int bcm_sf2_core_write64(struct b53_device *dev, u8 page, u8 reg,
				u64 value)
{}

static const struct b53_io_ops bcm_sf2_io_ops =;

static void bcm_sf2_sw_get_strings(struct dsa_switch *ds, int port,
				   u32 stringset, uint8_t *data)
{}

static void bcm_sf2_sw_get_ethtool_stats(struct dsa_switch *ds, int port,
					 uint64_t *data)
{}

static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds, int port,
				     int sset)
{}

static const struct phylink_mac_ops bcm_sf2_phylink_mac_ops =;

static const struct dsa_switch_ops bcm_sf2_ops =;

struct bcm_sf2_of_data {};

static const u16 bcm_sf2_4908_reg_offsets[] =;

static const struct bcm_sf2_of_data bcm_sf2_4908_data =;

/* Register offsets for the SWITCH_REG_* block */
static const u16 bcm_sf2_7445_reg_offsets[] =;

static const struct bcm_sf2_of_data bcm_sf2_7445_data =;

static const u16 bcm_sf2_7278_reg_offsets[] =;

static const struct bcm_sf2_of_data bcm_sf2_7278_data =;

static const struct of_device_id bcm_sf2_of_match[] =;
MODULE_DEVICE_TABLE(of, bcm_sf2_of_match);

static int bcm_sf2_sw_probe(struct platform_device *pdev)
{}

static void bcm_sf2_sw_remove(struct platform_device *pdev)
{}

static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int bcm_sf2_suspend(struct device *dev)
{}

static int bcm_sf2_resume(struct device *dev)
{}
#endif /* CONFIG_PM_SLEEP */

static SIMPLE_DEV_PM_OPS(bcm_sf2_pm_ops,
			 bcm_sf2_suspend, bcm_sf2_resume);


static struct platform_driver bcm_sf2_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();