linux/drivers/net/dsa/b53/b53_srab.c

/*
 * B53 register access through Switch Register Access Bridge Registers
 *
 * Copyright (C) 2013 Hauke Mehrtens <[email protected]>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/platform_data/b53.h>
#include <linux/of.h>

#include "b53_priv.h"
#include "b53_serdes.h"

/* command and status register of the SRAB */
#define B53_SRAB_CMDSTAT
#define B53_SRAB_CMDSTAT_RST
#define B53_SRAB_CMDSTAT_WRITE
#define B53_SRAB_CMDSTAT_GORDYN
#define B53_SRAB_CMDSTAT_PAGE
#define B53_SRAB_CMDSTAT_REG

/* high order word of write data to switch registe */
#define B53_SRAB_WD_H

/* low order word of write data to switch registe */
#define B53_SRAB_WD_L

/* high order word of read data from switch register */
#define B53_SRAB_RD_H

/* low order word of read data from switch register */
#define B53_SRAB_RD_L

/* command and status register of the SRAB */
#define B53_SRAB_CTRLS
#define B53_SRAB_CTRLS_HOST_INTR
#define B53_SRAB_CTRLS_RCAREQ
#define B53_SRAB_CTRLS_RCAGNT
#define B53_SRAB_CTRLS_SW_INIT_DONE

/* the register captures interrupt pulses from the switch */
#define B53_SRAB_INTR
#define B53_SRAB_INTR_P(x)
#define B53_SRAB_SWITCH_PHY
#define B53_SRAB_1588_SYNC
#define B53_SRAB_IMP1_SLEEP_TIMER
#define B53_SRAB_P7_SLEEP_TIMER
#define B53_SRAB_IMP0_SLEEP_TIMER

/* Port mux configuration registers */
#define B53_MUX_CONFIG_P5
#define MUX_CONFIG_SGMII
#define MUX_CONFIG_MII_LITE
#define MUX_CONFIG_RGMII
#define MUX_CONFIG_GMII
#define MUX_CONFIG_GPHY
#define MUX_CONFIG_INTERNAL
#define MUX_CONFIG_MASK
#define B53_MUX_CONFIG_P4

struct b53_srab_port_priv {};

struct b53_srab_priv {};

static int b53_srab_request_grant(struct b53_device *dev)
{}

static void b53_srab_release_grant(struct b53_device *dev)
{}

static int b53_srab_op(struct b53_device *dev, u8 page, u8 reg, u32 op)
{}

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

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

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

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

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

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

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

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

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

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

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

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

#if IS_ENABLED(CONFIG_B53_SERDES)
static u8 b53_srab_serdes_map_lane(struct b53_device *dev, int port)
{}
#endif

static int b53_srab_irq_enable(struct b53_device *dev, int port)
{}

static void b53_srab_irq_disable(struct b53_device *dev, int port)
{}

static void b53_srab_phylink_get_caps(struct b53_device *dev, int port,
				      struct phylink_config *config)
{}

static const struct b53_io_ops b53_srab_ops =;

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

static void b53_srab_intr_set(struct b53_srab_priv *priv, bool set)
{}

static void b53_srab_prepare_irq(struct platform_device *pdev)
{}

static void b53_srab_mux_init(struct platform_device *pdev)
{}

static int b53_srab_probe(struct platform_device *pdev)
{}

static void b53_srab_remove(struct platform_device *pdev)
{}

static void b53_srab_shutdown(struct platform_device *pdev)
{}

static struct platform_driver b53_srab_driver =;

module_platform_driver();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();