linux/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_target.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/* Copyright (C) 2015-2018 Netronome Systems, Inc. */

/*
 * nfp_target.c
 * CPP Access Width Decoder
 * Authors: Jakub Kicinski <[email protected]>
 *          Jason McMullan <[email protected]>
 *          Francois H. Theron <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/printk.h>

#include "nfp_cpp.h"

#include "nfp6000/nfp6000.h"

#define P32
#define P64

/* This structure ONLY includes items that can be done with a read or write of
 * 32-bit or 64-bit words. All others are not listed.
 */

#define AT

static int target_rw(u32 cpp_id, int pp, int start, int len)
{}

static int nfp6000_nbi_dma(u32 cpp_id)
{}

static int nfp6000_nbi_stats(u32 cpp_id)
{}

static int nfp6000_nbi_tm(u32 cpp_id)
{}

static int nfp6000_nbi_ppc(u32 cpp_id)
{}

static int nfp6000_nbi(u32 cpp_id, u64 address)
{}

/* This structure ONLY includes items that can be done with a read or write of
 * 32-bit or 64-bit words. All others are not listed.
 */
static int nfp6000_mu_common(u32 cpp_id)
{}

static int nfp6000_mu_ctm(u32 cpp_id)
{}

static int nfp6000_mu_emu(u32 cpp_id)
{}

static int nfp6000_mu_imu(u32 cpp_id)
{}

static int nfp6000_mu(u32 cpp_id, u64 address)
{}

static int nfp6000_ila(u32 cpp_id)
{}

static int nfp6000_pci(u32 cpp_id)
{}

static int nfp6000_crypto(u32 cpp_id)
{}

static int nfp6000_cap_xpb(u32 cpp_id)
{}

static int nfp6000_cls(u32 cpp_id)
{}

int nfp_target_pushpull(u32 cpp_id, u64 address)
{}

#undef AT
#undef P32
#undef P64

/* All magic NFP-6xxx IMB 'mode' numbers here are from:
 * Databook (1 August 2013)
 * - System Overview and Connectivity
 * -- Internal Connectivity
 * --- Distributed Switch Fabric - Command Push/Pull (DSF-CPP) Bus
 * ---- CPP addressing
 * ----- Table 3.6. CPP Address Translation Mode Commands
 */

#define _NIC_NFP6000_MU_LOCALITY_DIRECT

static int nfp_decode_basic(u64 addr, int *dest_island, int cpp_tgt,
			    int mode, bool addr40, int isld1, int isld0)
{}

static int nfp_encode_basic_qdr(u64 addr, int dest_island, int cpp_tgt,
				int mode, bool addr40, int isld1, int isld0)
{}

/* Try each option, take first one that fits.
 * Not sure if we would want to do some smarter
 * searching and prefer 0 or non-0 island IDs.
 */
static int nfp_encode_basic_search(u64 *addr, int dest_island, int *isld,
				   int iid_lsb, int idx_lsb, int v_max)
{}

/* For VQDR, we may not modify the Channel bits, which might overlap
 *  with the Index bit. When it does, we need to ensure that isld0 == isld1.
 */
static int nfp_encode_basic(u64 *addr, int dest_island, int cpp_tgt,
			    int mode, bool addr40, int isld1, int isld0)
{}

static int nfp_encode_mu(u64 *addr, int dest_island, int mode,
			 bool addr40, int isld1, int isld0)
{}

static int nfp_cppat_addr_encode(u64 *addr, int dest_island, int cpp_tgt,
				 int mode, bool addr40, int isld1, int isld0)
{}

int nfp_target_cpp(u32 cpp_island_id, u64 cpp_island_address,
		   u32 *cpp_target_id, u64 *cpp_target_address,
		   const u32 *imb_table)
{}