linux/drivers/phy/broadcom/phy-bcm-sr-pcie.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2016-2018 Broadcom
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

/* we have up to 8 PAXB based RC. The 9th one is always PAXC */
#define SR_NR_PCIE_PHYS
#define SR_PAXC_PHY_IDX

#define PCIE_PIPEMUX_CFG_OFFSET
#define PCIE_PIPEMUX_SELECT_STRAP

#define CDRU_STRAP_DATA_LSW_OFFSET
#define PCIE_PIPEMUX_SHIFT
#define PCIE_PIPEMUX_MASK

#define MHB_MEM_PW_PAXC_OFFSET
#define MHB_PWR_ARR_POWERON
#define MHB_PWR_ARR_POWEROK
#define MHB_PWR_POWERON
#define MHB_PWR_POWEROK
#define MHB_PWR_STATUS_MASK

struct sr_pcie_phy_core;

/**
 * struct sr_pcie_phy - Stingray PCIe PHY
 *
 * @core: pointer to the Stingray PCIe PHY core control
 * @index: PHY index
 * @phy: pointer to the kernel PHY device
 */
struct sr_pcie_phy {};

/**
 * struct sr_pcie_phy_core - Stingray PCIe PHY core control
 *
 * @dev: pointer to device
 * @base: base register of PCIe SS
 * @cdru: regmap to the CDRU device
 * @mhb: regmap to the MHB device
 * @pipemux: pipemuex strap
 * @phys: array of PCIe PHYs
 */
struct sr_pcie_phy_core {};

/*
 * PCIe PIPEMUX lookup table
 *
 * Each array index represents a PIPEMUX strap setting
 * The array element represents a bitmap where a set bit means the PCIe
 * core and associated serdes has been enabled as RC and is available for use
 */
static const u8 pipemux_table[] =;

/*
 * Return true if the strap setting is valid
 */
static bool pipemux_strap_is_valid(u32 pipemux)
{}

/*
 * Read the PCIe PIPEMUX from strap
 */
static u32 pipemux_strap_read(struct sr_pcie_phy_core *core)
{}

/*
 * Given a PIPEMUX strap and PCIe core index, this function returns true if the
 * PCIe core needs to be enabled
 */
static bool pcie_core_is_for_rc(struct sr_pcie_phy *phy)
{}

static int sr_pcie_phy_init(struct phy *p)
{}

static int sr_paxc_phy_init(struct phy *p)
{}

static const struct phy_ops sr_pcie_phy_ops =;

static const struct phy_ops sr_paxc_phy_ops =;

static struct phy *sr_pcie_phy_xlate(struct device *dev,
				     const struct of_phandle_args *args)
{}

static int sr_pcie_phy_probe(struct platform_device *pdev)
{}

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

static struct platform_driver sr_pcie_phy_driver =;
module_platform_driver();

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