Skip to contentSkip to conversation

mips: octeon: Add serdes and device helper support incl. DM PCIe driver

PATCH New Stefan Roese 2 participants 57 messages Dec 11, 2020 – Apr 24, 2021 Page 6 of 6

Subsystems (2)
lore
Share & tools
lore
#54 lore raw

PATCH v2 33/50 mips: octeon: Add misc remaining header files

In reply to Daniel Schwierzeck

Hi Daniel,

Quoted 20 lines · Daniel Schwierzeck

Hi Stefan,

Am Freitag, den 23.04.2021, 05:56 +0200 schrieb Stefan Roese:

Quoted 7 lines

From: Aaron Williams <[email protected]>

Import misc remaining header files from 2013 U-Boot. These will be used
by the later added drivers to support PCIe and networking on the MIPS Octeon II / III platforms.

Quoted 9 lines
Cc Aaron Williams <[email protected]>
Cc Chandrakala Chavva <[email protected]>
Cc Daniel Schwierzeck <[email protected]>

---
v2:
- Add missing mach/octeon_qlm.h file (forgot to commit it in v1)

Quoted 2 lines

the patch didn't show up in patchwork. But when manually applying, there is still a build error due to missing mach/octeon_fdt.h

Ah, sorry. I still missed 2 additional headers to commit. v3 will follow very soon.

Thanks,
Stefan

Quoted 13,424 lines
Quoted 13,424 lines
  .../mach-octeon/include/mach/cvmx-address.h   |  209 ++
  .../mach-octeon/include/mach/cvmx-cmd-queue.h |  441 +++
  .../mach-octeon/include/mach/cvmx-csr-enums.h |   87 +
  arch/mips/mach-octeon/include/mach/cvmx-csr.h |   78 +
  .../mach-octeon/include/mach/cvmx-error.h     |  456 +++
  arch/mips/mach-octeon/include/mach/cvmx-fpa.h |  217 ++
  .../mips/mach-octeon/include/mach/cvmx-fpa1.h |  196 ++
  .../mips/mach-octeon/include/mach/cvmx-fpa3.h |  566 ++++
  .../include/mach/cvmx-global-resources.h      |  213 ++
  arch/mips/mach-octeon/include/mach/cvmx-gmx.h |   16 +
  .../mach-octeon/include/mach/cvmx-hwfau.h     |  606 ++++
  .../mach-octeon/include/mach/cvmx-hwpko.h     |  570 ++++
  arch/mips/mach-octeon/include/mach/cvmx-ilk.h |  154 +
  arch/mips/mach-octeon/include/mach/cvmx-ipd.h |  233 ++
  .../mach-octeon/include/mach/cvmx-packet.h    |   40 +
  .../mips/mach-octeon/include/mach/cvmx-pcie.h |  279 ++
  arch/mips/mach-octeon/include/mach/cvmx-pip.h | 1080 ++++++
  .../include/mach/cvmx-pki-resources.h         |  157 +
  arch/mips/mach-octeon/include/mach/cvmx-pki.h |  970 ++++++
  .../mach/cvmx-pko-internal-ports-range.h      |   43 +
  .../include/mach/cvmx-pko3-queue.h            |  175 +
  arch/mips/mach-octeon/include/mach/cvmx-pow.h | 2991
+++++++++++++++++
  arch/mips/mach-octeon/include/mach/cvmx-qlm.h |  304 ++
  .../mach-octeon/include/mach/cvmx-scratch.h   |  113 +
  arch/mips/mach-octeon/include/mach/cvmx-wqe.h | 1462 ++++++++
  .../mach-octeon/include/mach/octeon_qlm.h     |  109 +
  26 files changed, 11765 insertions(+)

create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-address.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-cmd-
queue.h
create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-csr-
enums.h
create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-csr.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-error.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa1.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa3.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-global-
resources.h
create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-gmx.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-hwfau.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-hwpko.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ilk.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ipd.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-packet.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pcie.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pip.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki-
resources.h
create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko-
internal-ports-range.h
create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko3-
queue.h
create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pow.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-qlm.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-scratch.h create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-wqe.h create mode 100644 arch/mips/mach-octeon/include/mach/octeon_qlm.h

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +37 -0
new file mode 100644
index 000000000000..984f574a75bb
@@ -0,0 +1,209 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Typedefs and defines for working with Octeon physical addresses.
+ */
+
+#ifndef __CVMX_ADDRESS_H__
+#define __CVMX_ADDRESS_H__
+
+typedef enum {
+	CVMX_MIPS_SPACE_XKSEG = 3LL,
+	CVMX_MIPS_SPACE_XKPHYS = 2LL,
+	CVMX_MIPS_SPACE_XSSEG = 1LL,
+	CVMX_MIPS_SPACE_XUSEG = 0LL
+} cvmx_mips_space_t;
+
+typedef enum {
+	CVMX_MIPS_XKSEG_SPACE_KSEG0 = 0LL,
+	CVMX_MIPS_XKSEG_SPACE_KSEG1 = 1LL,
+	CVMX_MIPS_XKSEG_SPACE_SSEG = 2LL,
+	CVMX_MIPS_XKSEG_SPACE_KSEG3 = 3LL
+} cvmx_mips_xkseg_space_t;
+
+/* decodes <14:13> of a kseg3 window address */
+typedef enum {
+	CVMX_ADD_WIN_SCR = 0L,
+	CVMX_ADD_WIN_DMA = 1L,
+	CVMX_ADD_WIN_UNUSED = 2L,
+	CVMX_ADD_WIN_UNUSED2 = 3L
+} cvmx_add_win_dec_t;
+
+/* decode within DMA space */
+typedef enum {
+	CVMX_ADD_WIN_DMA_ADD = 0L,
+	CVMX_ADD_WIN_DMA_SENDMEM = 1L,
+	/* store data must be normal DRAM memory space address in this

case */

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +18 -0
+	CVMX_ADD_WIN_DMA_SENDDMA = 2L,
+	/* see CVMX_ADD_WIN_DMA_SEND_DEC for data contents */
+	CVMX_ADD_WIN_DMA_SENDIO = 3L,
+	/* store data must be normal IO space address in this case */
+	CVMX_ADD_WIN_DMA_SENDSINGLE = 4L,
+	/* no write buffer data needed/used */
+} cvmx_add_win_dma_dec_t;
+
+/**
+ *   Physical Address Decode
+ *
+ * Octeon-I HW never interprets this X (<39:36> reserved
+ * for future expansion), software should set to 0.
+ *
+ *  - 0x0 XXX0 0000 0000 to      DRAM         Cached
+ *  - 0x0 XXX0 0FFF FFFF
+ *
+ *  - 0x0 XXX0 1000 0000 to      Boot Bus     Uncached  (Converted

to 0x1 00X0 1000 0000
+ * - 0x0 XXX0 1FFF FFFF +
EJTAG to 0x1 00X0 1FFF FFFF)
+ *
+ * - 0x0 XXX0 2000 0000 to DRAM Cached
+ * - 0x0 XXXF FFFF FFFF
+ *
+ * - 0x1 00X0 0000 0000 to Boot Bus Uncached
+ * - 0x1 00XF FFFF FFFF
+ *

+ *  - 0x1 01X0 0000 0000 to      Other NCB    Uncached
+ *  - 0x1 FFXF FFFF FFFF         devices

+ *
+ * Decode of all Octeon addresses
+ */

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +73 -0
+typedef union {
+	u64 u64;
+	struct {
+		cvmx_mips_space_t R : 2;
+		u64 offset : 62;
+	} sva;
+
+	struct {
+		u64 zeroes : 33;
+		u64 offset : 31;
+	} suseg;
+
+	struct {
+		u64 ones : 33;
+		cvmx_mips_xkseg_space_t sp : 2;
+		u64 offset : 29;
+	} sxkseg;
+
+	struct {
+		cvmx_mips_space_t R : 2;
+		u64 cca : 3;
+		u64 mbz : 10;
+		u64 pa : 49;
+	} sxkphys;
+
+	struct {
+		u64 mbz : 15;
+		u64 is_io : 1;
+		u64 did : 8;
+		u64 unaddr : 4;
+		u64 offset : 36;
+	} sphys;
+
+	struct {
+		u64 zeroes : 24;
+		u64 unaddr : 4;
+		u64 offset : 36;
+	} smem;
+
+	struct {
+		u64 mem_region : 2;
+		u64 mbz : 13;
+		u64 is_io : 1;
+		u64 did : 8;
+		u64 unaddr : 4;
+		u64 offset : 36;
+	} sio;
+
+	struct {
+		u64 ones : 49;
+		cvmx_add_win_dec_t csrdec : 2;
+		u64 addr : 13;
+	} sscr;
+
+	/* there should only be stores to IOBDMA space, no loads */
+	struct {
+		u64 ones : 49;
+		cvmx_add_win_dec_t csrdec : 2;
+		u64 unused2 : 3;
+		cvmx_add_win_dma_dec_t type : 3;
+		u64 addr : 7;
+	} sdma;
+
+	struct {
+		u64 didspace : 24;
+		u64 unused : 40;
+	} sfilldidspace;
+} cvmx_addr_t;
+
+/* These macros for used by 32 bit applications */
+
+#define CVMX_MIPS32_SPACE_KSEG0	     1l
+#define CVMX_ADD_SEG32(segment, add) (((s32)segment << 31) |

(s32)(add))

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +3 -0
+
+/*
+ * Currently all IOs are performed using XKPHYS addressing. Linux

uses the
+ * CvmMemCtl register to enable XKPHYS addressing to IO space from user mode.
+ * Future OSes may need to change the upper bits of IO addresses. The
+ * following define controls the upper two bits for all IO addresses generated
+ * by the simple executive library
+ */

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +3 -0
+#define CVMX_IO_SEG CVMX_MIPS_SPACE_XKPHYS
+
+/* These macros simplify the process of creating common IO addresses

*/

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +5 -0
+#define CVMX_ADD_SEG(segment, add) ((((u64)segment) << 62) | (add))
+
+#define CVMX_ADD_IO_SEG(add) (add)
+
+#define CVMX_ADDR_DIDSPACE(did)	   (((CVMX_IO_SEG) << 22) |

((1ULL) << 8) | (did))

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +28 -0
+#define CVMX_ADDR_DID(did)	   (CVMX_ADDR_DIDSPACE(did) << 40)
+#define CVMX_FULL_DID(did, subdid) (((did) << 3) | (subdid))
+
+/* from include/ncb_rsl_id.v */
+#define CVMX_OCT_DID_MIS  0ULL /* misc stuff */
+#define CVMX_OCT_DID_GMX0 1ULL
+#define CVMX_OCT_DID_GMX1 2ULL
+#define CVMX_OCT_DID_PCI  3ULL
+#define CVMX_OCT_DID_KEY  4ULL
+#define CVMX_OCT_DID_FPA  5ULL
+#define CVMX_OCT_DID_DFA  6ULL
+#define CVMX_OCT_DID_ZIP  7ULL
+#define CVMX_OCT_DID_RNG  8ULL
+#define CVMX_OCT_DID_IPD  9ULL
+#define CVMX_OCT_DID_PKT  10ULL
+#define CVMX_OCT_DID_TIM  11ULL
+#define CVMX_OCT_DID_TAG  12ULL
+/* the rest are not on the IO bus */
+#define CVMX_OCT_DID_L2C  16ULL
+#define CVMX_OCT_DID_LMC  17ULL
+#define CVMX_OCT_DID_SPX0 18ULL
+#define CVMX_OCT_DID_SPX1 19ULL
+#define CVMX_OCT_DID_PIP  20ULL
+#define CVMX_OCT_DID_ASX0 22ULL
+#define CVMX_OCT_DID_ASX1 23ULL
+#define CVMX_OCT_DID_IOB  30ULL
+
+#define CVMX_OCT_DID_PKT_SEND	 CVMX_FULL_DID(CVMX_OCT_DID_PKT

, 2ULL)
+#define CVMX_OCT_DID_TAG_SWTAG CVMX_FULL_DID(CVMX_OCT_DID_TAG
, 0ULL)
+#define CVMX_OCT_DID_TAG_TAG1 CVMX_FULL_DID(CVMX_OCT_DID_TAG
, 1ULL)
+#define CVMX_OCT_DID_TAG_TAG2 CVMX_FULL_DID(CVMX_OCT_DID_TAG
, 2ULL)
+#define CVMX_OCT_DID_TAG_TAG3 CVMX_FULL_DID(CVMX_OCT_DID_TAG
, 3ULL)
+#define CVMX_OCT_DID_TAG_NULL_RD CVMX_FULL_DID(CVMX_OCT_DID_TAG, 4ULL)
+#define CVMX_OCT_DID_TAG_TAG5 CVMX_FULL_DID(CVMX_OCT_DID_TAG
, 5ULL)

arch/mips/mach-octeon/include/mach/cvmx-address.h new file +18 -0
+#define CVMX_OCT_DID_TAG_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 7ULL)
+#define CVMX_OCT_DID_FAU_FAI	 CVMX_FULL_DID(CVMX_OCT_DID_IOB, 0ULL)
+#define CVMX_OCT_DID_TIM_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_TIM, 0ULL)
+#define CVMX_OCT_DID_KEY_RW	 CVMX_FULL_DID(CVMX_OCT_DID_KEY, 0ULL)
+#define CVMX_OCT_DID_PCI_6	 CVMX_FULL_DID(CVMX_OCT_DID_PCI, 6ULL)
+#define CVMX_OCT_DID_MIS_BOO	 CVMX_FULL_DID(CVMX_OCT_DID_MIS, 0ULL)
+#define CVMX_OCT_DID_PCI_RML	 CVMX_FULL_DID(CVMX_OCT_DID_PCI, 0ULL)
+#define CVMX_OCT_DID_IPD_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_IPD, 7ULL)
+#define CVMX_OCT_DID_DFA_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_DFA, 7ULL)
+#define CVMX_OCT_DID_MIS_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_MIS, 7ULL)
+#define CVMX_OCT_DID_ZIP_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_ZIP, 0ULL)
+
+/* Cast to unsigned long long, mainly for use in printfs. */
+#define CAST_ULL(v) ((unsigned long long)(v))
+
+#define UNMAPPED_PTR(x) ((1ULL << 63) | (x))
+
+#endif /* __CVMX_ADDRESS_H__ */
arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +68 -0
new file mode 100644
index 000000000000..ddc294348cb4
@@ -0,0 +1,441 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Support functions for managing command queues used for
+ * various hardware blocks.
+ *
+ * The common command queue infrastructure abstracts out the
+ * software necessary for adding to Octeon's chained queue
+ * structures. These structures are used for commands to the
+ * PKO, ZIP, DFA, RAID, HNA, and DMA engine blocks. Although each
+ * hardware unit takes commands and CSRs of different types,
+ * they all use basic linked command buffers to store the
+ * pending request. In general, users of the CVMX API don't
+ * call cvmx-cmd-queue functions directly. Instead the hardware
+ * unit specific wrapper should be used. The wrappers perform
+ * unit specific validation and CSR writes to submit the
+ * commands.
+ *
+ * Even though most software will never directly interact with
+ * cvmx-cmd-queue, knowledge of its internal workings can help
+ * in diagnosing performance problems and help with debugging.
+ *
+ * Command queue pointers are stored in a global named block
+ * called "cvmx_cmd_queues". Except for the PKO queues, each
+ * hardware queue is stored in its own cache line to reduce SMP
+ * contention on spin locks. The PKO queues are stored such that
+ * every 16th queue is next to each other in memory. This scheme
+ * allows for queues being in separate cache lines when there
+ * are low number of queues per port. With 16 queues per port,
+ * the first queue for each port is in the same cache area. The
+ * second queues for each port are in another area, etc. This
+ * allows software to implement very efficient lockless PKO with
+ * 16 queues per port using a minimum of cache lines per core.
+ * All queues for a given core will be isolated in the same
+ * cache area.
+ *
+ * In addition to the memory pointer layout, cvmx-cmd-queue
+ * provides an optimized fair ll/sc locking mechanism for the
+ * queues. The lock uses a "ticket / now serving" model to
+ * maintain fair order on contended locks. In addition, it uses
+ * predicted locking time to limit cache contention. When a core
+ * know it must wait in line for a lock, it spins on the
+ * internal cycle counter to completely eliminate any causes of
+ * bus traffic.
+ */
+
+#ifndef __CVMX_CMD_QUEUE_H__
+#define __CVMX_CMD_QUEUE_H__
+
+/**
+ * By default we disable the max depth support. Most programs
+ * don't use it and it slows down the command queue processing
+ * significantly.
+ */
+#ifndef CVMX_CMD_QUEUE_ENABLE_MAX_DEPTH
+#define CVMX_CMD_QUEUE_ENABLE_MAX_DEPTH 0
+#endif
+
+/**
+ * Enumeration representing all hardware blocks that use command
+ * queues. Each hardware block has up to 65536 sub identifiers for
+ * multiple command queues. Not all chips support all hardware
+ * units.
+ */
+typedef enum {
+	CVMX_CMD_QUEUE_PKO_BASE = 0x00000,
+#define

CVMX_CMD_QUEUE_PKO(queue)

                       \
arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_PKO_BASE + (0xffff &

(queue))))

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+	CVMX_CMD_QUEUE_ZIP = 0x10000,
+#define

CVMX_CMD_QUEUE_ZIP_QUE(queue)

                       \
arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_ZIP + (0xffff &

(queue))))

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +4 -0
+	CVMX_CMD_QUEUE_DFA = 0x20000,
+	CVMX_CMD_QUEUE_RAID = 0x30000,
+	CVMX_CMD_QUEUE_DMA_BASE = 0x40000,
+#define

CVMX_CMD_QUEUE_DMA(queue)

                       \
arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_DMA_BASE + (0xffff &

(queue))))

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+	CVMX_CMD_QUEUE_BCH = 0x50000,
+#define CVMX_CMD_QUEUE_BCH(queue)

((cvmx_cmd_queue_id_t)(CVMX_CMD_QUEUE_BCH + (0xffff & (queue))))

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +5 -0
+	CVMX_CMD_QUEUE_HNA = 0x60000,
+	CVMX_CMD_QUEUE_END = 0x70000,
+} cvmx_cmd_queue_id_t;
+
+#define CVMX_CMD_QUEUE_ZIP3_QUE(node,

queue) \

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	((cvmx_cmd_queue_id_t)((node) << 24 | CVMX_CMD_QUEUE_ZIP |

(0xffff & (queue))))

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +47 -0
+
+/**
+ * Command write operations can fail if the command queue needs
+ * a new buffer and the associated FPA pool is empty. It can also
+ * fail if the number of queued command words reaches the maximum
+ * set at initialization.
+ */
+typedef enum {
+	CVMX_CMD_QUEUE_SUCCESS = 0,
+	CVMX_CMD_QUEUE_NO_MEMORY = -1,
+	CVMX_CMD_QUEUE_FULL = -2,
+	CVMX_CMD_QUEUE_INVALID_PARAM = -3,
+	CVMX_CMD_QUEUE_ALREADY_SETUP = -4,
+} cvmx_cmd_queue_result_t;
+
+typedef struct {
+	/* First 64-bit word: */
+	u64 fpa_pool : 16;
+	u64 base_paddr : 48;
+	s32 index;
+	u16 max_depth;
+	u16 pool_size_m1;
+} __cvmx_cmd_queue_state_t;
+
+/**
+ * command-queue locking uses a fair ticket spinlock algo,
+ * with 64-bit tickets for endianness-neutrality and
+ * counter overflow protection.
+ * Lock is free when both counters are of equal value.
+ */
+typedef struct {
+	u64 ticket;
+	u64 now_serving;
+} __cvmx_cmd_queue_lock_t;
+
+/**
+ * @INTERNAL
+ * This structure contains the global state of all command queues.
+ * It is stored in a bootmem named block and shared by all
+ * applications running on Octeon. Tickets are stored in a different
+ * cache line that queue information to reduce the contention on the
+ * ll/sc used to get a ticket. If this is not the case, the update
+ * of queue state causes the ll/sc to fail quite often.
+ */
+typedef struct {
+	__cvmx_cmd_queue_lock_t lock[(CVMX_CMD_QUEUE_END >> 16) * 256];
+	__cvmx_cmd_queue_state_t state[(CVMX_CMD_QUEUE_END >> 16) *

256];

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +3 -0
+} __cvmx_cmd_queue_all_state_t;
+
+extern __cvmx_cmd_queue_all_state_t

*__cvmx_cmd_queue_state_ptrs[CVMX_MAX_NODES];

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +8 -0
+
+/**
+ * @INTERNAL
+ * Internal function to handle the corner cases
+ * of adding command words to a queue when the current
+ * block is getting full.
+ */
+cvmx_cmd_queue_result_t

__cvmx_cmd_queue_write_raw(cvmx_cmd_queue_id_t queue_id,

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+						   __cvmx_cmd_queue_sta

te_t *qptr, int cmd_count,

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +15 -0
+						   const u64 *cmds);
+
+/**
+ * Initialize a command queue for use. The initial FPA buffer is
+ * allocated and the hardware unit is configured to point to the
+ * new command queue.
+ *
+ * @param queue_id  Hardware command queue to initialize.
+ * @param max_depth Maximum outstanding commands that can be queued.
+ * @param fpa_pool  FPA pool the command queues should come from.
+ * @param pool_size Size of each buffer in the FPA pool (bytes)
+ *
+ * @return CVMX_CMD_QUEUE_SUCCESS or a failure code
+ */
+cvmx_cmd_queue_result_t

cvmx_cmd_queue_initialize(cvmx_cmd_queue_id_t queue_id, int max_depth,

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+						  int fpa_pool, int

pool_size);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +11 -0
+
+/**
+ * Shutdown a queue a free it's command buffers to the FPA. The
+ * hardware connected to the queue must be stopped before this
+ * function is called.
+ *
+ * @param queue_id Queue to shutdown
+ *
+ * @return CVMX_CMD_QUEUE_SUCCESS or a failure code
+ */
+cvmx_cmd_queue_result_t cvmx_cmd_queue_shutdown(cvmx_cmd_queue_id_t

queue_id);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +15 -0
+
+/**
+ * Return the number of command words pending in the queue. This
+ * function may be relatively slow for some hardware units.
+ *
+ * @param queue_id Hardware command queue to query
+ *
+ * @return Number of outstanding commands
+ */
+int cvmx_cmd_queue_length(cvmx_cmd_queue_id_t queue_id);
+
+/**
+ * Return the command buffer to be written to. The purpose of this
+ * function is to allow CVMX routine access to the low level buffer
+ * for initial hardware setup. User applications should not call

this
+ * function directly.
+ *
+ * @param queue_id Command queue to query
+ *
+ * @return Command buffer or NULL on failure
+ */

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +7 -0
+void *cvmx_cmd_queue_buffer(cvmx_cmd_queue_id_t queue_id);
+
+/**
+ * @INTERNAL
+ * Retrieve or allocate command queue state named block
+ */
+cvmx_cmd_queue_result_t __cvmx_cmd_queue_init_state_ptr(unsigned int

node);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +10 -0
+
+/**
+ * @INTERNAL
+ * Get the index into the state arrays for the supplied queue id.
+ *
+ * @param queue_id Queue ID to get an index for
+ *
+ * @return Index into the state arrays
+ */
+static inline unsigned int

__cvmx_cmd_queue_get_index(cvmx_cmd_queue_id_t queue_id)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+{
+	/* Warning: This code currently only works with devices that

have 256

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	 * queues or less.  Devices with more than 16 queues are laid

out in

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	 * memory to allow cores quick access to every 16th queue. This

reduces

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	 * cache thrashing when you are running 16 queues per port to

support

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +10 -0
+	 * lockless operation
+	 */
+	unsigned int unit = (queue_id >> 16) & 0xff;
+	unsigned int q = (queue_id >> 4) & 0xf;
+	unsigned int core = queue_id & 0xf;
+
+	return (unit << 8) | (core << 4) | q;
+}
+
+static inline int __cvmx_cmd_queue_get_node(cvmx_cmd_queue_id_t

queue_id)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +14 -0
+{
+	unsigned int node = queue_id >> 24;
+	return node;
+}
+
+/**
+ * @INTERNAL
+ * Lock the supplied queue so nobody else is updating it at the same
+ * time as us.
+ *
+ * @param queue_id Queue ID to lock
+ *
+ */
+static inline void __cvmx_cmd_queue_lock(cvmx_cmd_queue_id_t

queue_id)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +11 -0
+{
+}
+
+/**
+ * @INTERNAL
+ * Unlock the queue, flushing all writes.
+ *
+ * @param queue_id Queue ID to lock
+ *
+ */
+static inline void __cvmx_cmd_queue_unlock(cvmx_cmd_queue_id_t

queue_id)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +9 -0
+{
+	CVMX_SYNCWS; /* nudge out the unlock. */
+}
+
+/**
+ * @INTERNAL
+ * Initialize a command-queue lock to "unlocked" state.
+ */
+static inline void __cvmx_cmd_queue_lock_init(cvmx_cmd_queue_id_t

queue_id)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +5 -0
+{
+	unsigned int index = __cvmx_cmd_queue_get_index(queue_id);
+	unsigned int node = __cvmx_cmd_queue_get_node(queue_id);
+
+	__cvmx_cmd_queue_state_ptrs[node]->lock[index] =

(__cvmx_cmd_queue_lock_t){ 0, 0 };

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +12 -0
+	CVMX_SYNCWS;
+}
+
+/**
+ * @INTERNAL
+ * Get the queue state structure for the given queue id
+ *
+ * @param queue_id Queue id to get
+ *
+ * @return Queue structure or NULL on failure
+ */
+static inline __cvmx_cmd_queue_state_t

*__cvmx_cmd_queue_get_state(cvmx_cmd_queue_id_t queue_id)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +23 -0
+{
+	unsigned int index;
+	unsigned int node;
+	__cvmx_cmd_queue_state_t *qptr;
+
+	node = __cvmx_cmd_queue_get_node(queue_id);
+	index = __cvmx_cmd_queue_get_index(queue_id);
+
+	if (cvmx_unlikely(!__cvmx_cmd_queue_state_ptrs[node]))
+		__cvmx_cmd_queue_init_state_ptr(node);
+
+	qptr = &__cvmx_cmd_queue_state_ptrs[node]->state[index];
+	return qptr;
+}
+
+/**
+ * Write an arbitrary number of command words to a command queue.
+ * This is a generic function; the fixed number of command word
+ * functions yield higher performance.
+ *
+ * @param queue_id  Hardware command queue to write to
+ * @param use_locking
+ *                  Use internal locking to ensure exclusive access

for queue
+ * updates. If you don't use this locking you must
ensure
+ * exclusivity some other way. Locking is strongly
recommended.
+ * @param cmd_count Number of command words to write
+ * @param cmds Array of commands to write
+ *
+ * @return CVMX_CMD_QUEUE_SUCCESS or a failure code
+ */

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+static inline cvmx_cmd_queue_result_t
+cvmx_cmd_queue_write(cvmx_cmd_queue_id_t queue_id, bool use_locking,

int cmd_count, const u64 *cmds)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +5 -0
+{
+	cvmx_cmd_queue_result_t ret = CVMX_CMD_QUEUE_SUCCESS;
+	u64 *cmd_ptr;
+
+	__cvmx_cmd_queue_state_t *qptr =

__cvmx_cmd_queue_get_state(queue_id);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +6 -0
+
+	/* Make sure nobody else is updating the same queue */
+	if (cvmx_likely(use_locking))
+		__cvmx_cmd_queue_lock(queue_id);
+
+	/* Most of the time there is lots of free words in current

block */

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+	if (cvmx_unlikely((qptr->index + cmd_count) >= qptr-
Quoted 1 line

pool_size_m1)) {

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+		/* The rare case when nearing end of block */
+		ret = __cvmx_cmd_queue_write_raw(queue_id, qptr,

cmd_count, cmds);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+	} else {
+		cmd_ptr = (u64 *)cvmx_phys_to_ptr((u64)qptr-
Quoted 1 line

base_paddr);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+		/* Loop easy for compiler to unroll for the likely case

*/

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +21 -0
+		while (cmd_count > 0) {
+			cmd_ptr[qptr->index++] = *cmds++;
+			cmd_count--;
+		}
+	}
+
+	/* All updates are complete. Release the lock and return */
+	if (cvmx_likely(use_locking))
+		__cvmx_cmd_queue_unlock(queue_id);
+	else
+		CVMX_SYNCWS;
+
+	return ret;
+}
+
+/**
+ * Simple function to write two command words to a command queue.
+ *
+ * @param queue_id Hardware command queue to write to
+ * @param use_locking
+ *                 Use internal locking to ensure exclusive access

for queue
+ * updates. If you don't use this locking you must
ensure
+ * exclusivity some other way. Locking is strongly
recommended.
+ * @param cmd1 Command
+ * @param cmd2 Command
+ *
+ * @return CVMX_CMD_QUEUE_SUCCESS or a failure code
+ */
+static inline cvmx_cmd_queue_result_t cvmx_cmd_queue_write2(cvmx_cmd_queue_id_t queue_id,

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +1 -0
+							    bool

use_locking, u64 cmd1, u64 cmd2)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +5 -0
+{
+	cvmx_cmd_queue_result_t ret = CVMX_CMD_QUEUE_SUCCESS;
+	u64 *cmd_ptr;
+
+	__cvmx_cmd_queue_state_t *qptr =

__cvmx_cmd_queue_get_state(queue_id);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +12 -0
+
+	/* Make sure nobody else is updating the same queue */
+	if (cvmx_likely(use_locking))
+		__cvmx_cmd_queue_lock(queue_id);
+
+	if (cvmx_unlikely((qptr->index + 2) >= qptr->pool_size_m1)) {
+		/* The rare case when nearing end of block */
+		u64 cmds[2];
+
+		cmds[0] = cmd1;
+		cmds[1] = cmd2;
+		ret = __cvmx_cmd_queue_write_raw(queue_id, qptr, 2,

cmds);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +3 -0
+	} else {
+		/* Likely case to work fast */
+		cmd_ptr = (u64 *)cvmx_phys_to_ptr((u64)qptr-
Quoted 1 line

base_paddr);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +21 -0
+		cmd_ptr += qptr->index;
+		qptr->index += 2;
+		cmd_ptr[0] = cmd1;
+		cmd_ptr[1] = cmd2;
+	}
+
+	/* All updates are complete. Release the lock and return */
+	if (cvmx_likely(use_locking))
+		__cvmx_cmd_queue_unlock(queue_id);
+	else
+		CVMX_SYNCWS;
+
+	return ret;
+}
+
+/**
+ * Simple function to write three command words to a command queue.
+ *
+ * @param queue_id Hardware command queue to write to
+ * @param use_locking
+ *                 Use internal locking to ensure exclusive access

for queue
+ * updates. If you don't use this locking you must
ensure
+ * exclusivity some other way. Locking is strongly
recommended.

+ * @param cmd1     Command
+ * @param cmd2     Command
+ * @param cmd3     Command

+ *
+ * @return CVMX_CMD_QUEUE_SUCCESS or a failure code
+ */

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+static inline cvmx_cmd_queue_result_t
+cvmx_cmd_queue_write3(cvmx_cmd_queue_id_t queue_id, bool

use_locking, u64 cmd1, u64 cmd2, u64 cmd3)

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +3 -0
+{
+	cvmx_cmd_queue_result_t ret = CVMX_CMD_QUEUE_SUCCESS;
+	__cvmx_cmd_queue_state_t *qptr =

__cvmx_cmd_queue_get_state(queue_id);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +8 -0
+	u64 *cmd_ptr;
+
+	/* Make sure nobody else is updating the same queue */
+	if (cvmx_likely(use_locking))
+		__cvmx_cmd_queue_lock(queue_id);
+
+	if (cvmx_unlikely((qptr->index + 3) >= qptr->pool_size_m1)) {
+		/* Most of the time there is lots of free words in

current block */

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +6 -0
+		u64 cmds[3];
+
+		cmds[0] = cmd1;
+		cmds[1] = cmd2;
+		cmds[2] = cmd3;
+		ret = __cvmx_cmd_queue_write_raw(queue_id, qptr, 3,

cmds);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +2 -0
+	} else {
+		cmd_ptr = (u64 *)cvmx_phys_to_ptr((u64)qptr-
Quoted 1 line

base_paddr);

arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +17 -0
+		cmd_ptr += qptr->index;
+		qptr->index += 3;
+		cmd_ptr[0] = cmd1;
+		cmd_ptr[1] = cmd2;
+		cmd_ptr[2] = cmd3;
+	}
+
+	/* All updates are complete. Release the lock and return */
+	if (cvmx_likely(use_locking))
+		__cvmx_cmd_queue_unlock(queue_id);
+	else
+		CVMX_SYNCWS;
+
+	return ret;
+}
+
+#endif /* __CVMX_CMD_QUEUE_H__ */
arch/mips/mach-octeon/include/mach/cvmx-csr-enums.h new file +31 -0
new file mode 100644
index 000000000000..a8625b4228ac
@@ -0,0 +1,87 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Definitions for enumerations used with Octeon CSRs.
+ */
+
+#ifndef __CVMX_CSR_ENUMS_H__
+#define __CVMX_CSR_ENUMS_H__
+
+typedef enum {
+	CVMX_IPD_OPC_MODE_STT = 0LL,
+	CVMX_IPD_OPC_MODE_STF = 1LL,
+	CVMX_IPD_OPC_MODE_STF1_STT = 2LL,
+	CVMX_IPD_OPC_MODE_STF2_STT = 3LL
+} cvmx_ipd_mode_t;
+
+/**
+ * Enumeration representing the amount of packet processing
+ * and validation performed by the input hardware.
+ */
+typedef enum {
+	CVMX_PIP_PORT_CFG_MODE_NONE = 0ull,
+	CVMX_PIP_PORT_CFG_MODE_SKIPL2 = 1ull,
+	CVMX_PIP_PORT_CFG_MODE_SKIPIP = 2ull
+} cvmx_pip_port_parse_mode_t;
+
+/**
+ * This enumeration controls how a QoS watcher matches a packet.
+ *
+ * @deprecated  This enumeration was used with

cvmx_pip_config_watcher which has
+ * been deprecated.
+ */

arch/mips/mach-octeon/include/mach/cvmx-csr-enums.h new file +30 -0
+typedef enum {
+	CVMX_PIP_QOS_WATCH_DISABLE = 0ull,
+	CVMX_PIP_QOS_WATCH_PROTNH = 1ull,
+	CVMX_PIP_QOS_WATCH_TCP = 2ull,
+	CVMX_PIP_QOS_WATCH_UDP = 3ull
+} cvmx_pip_qos_watch_types;
+
+/**
+ * This enumeration is used in PIP tag config to control how
+ * POW tags are generated by the hardware.
+ */
+typedef enum {
+	CVMX_PIP_TAG_MODE_TUPLE = 0ull,
+	CVMX_PIP_TAG_MODE_MASK = 1ull,
+	CVMX_PIP_TAG_MODE_IP_OR_MASK = 2ull,
+	CVMX_PIP_TAG_MODE_TUPLE_XOR_MASK = 3ull
+} cvmx_pip_tag_mode_t;
+
+/**
+ * Tag type definitions
+ */
+typedef enum {
+	CVMX_POW_TAG_TYPE_ORDERED = 0L,
+	CVMX_POW_TAG_TYPE_ATOMIC = 1L,
+	CVMX_POW_TAG_TYPE_NULL = 2L,
+	CVMX_POW_TAG_TYPE_NULL_NULL = 3L
+} cvmx_pow_tag_type_t;
+
+/**
+ * LCR bits 0 and 1 control the number of bits per character. See

the following table for encodings:
+ *
+ * - 00 = 5 bits (bits 0-4 sent)
+ * - 01 = 6 bits (bits 0-5 sent)
+ * - 10 = 7 bits (bits 0-6 sent)
+ * - 11 = 8 bits (all bits sent)
+ */

arch/mips/mach-octeon/include/mach/cvmx-csr-enums.h new file +18 -0
+typedef enum {
+	CVMX_UART_BITS5 = 0,
+	CVMX_UART_BITS6 = 1,
+	CVMX_UART_BITS7 = 2,
+	CVMX_UART_BITS8 = 3
+} cvmx_uart_bits_t;
+
+typedef enum {
+	CVMX_UART_IID_NONE = 1,
+	CVMX_UART_IID_RX_ERROR = 6,
+	CVMX_UART_IID_RX_DATA = 4,
+	CVMX_UART_IID_RX_TIMEOUT = 12,
+	CVMX_UART_IID_TX_EMPTY = 2,
+	CVMX_UART_IID_MODEM = 0,
+	CVMX_UART_IID_BUSY = 7
+} cvmx_uart_iid_t;
+
+#endif /* __CVMX_CSR_ENUMS_H__ */
arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +5 -0
new file mode 100644
index 000000000000..730d54bb9278
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Configuration and status register (CSR) address and type

definitions for
+ * Octoen.
+ */

arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +18 -0
+
+#ifndef __CVMX_CSR_H__
+#define __CVMX_CSR_H__
+
+#include "cvmx-csr-enums.h"
+#include "cvmx-pip-defs.h"
+
+typedef cvmx_pip_prt_cfgx_t cvmx_pip_port_cfg_t;
+
+/* The CSRs for bootbus region zero used to be independent of the
+    other 1-7. As of SDK 1.7.0 these were combined. These macros
+    are for backwards compactability */
+#define CVMX_MIO_BOOT_REG_CFG0 CVMX_MIO_BOOT_REG_CFGX(0)
+#define CVMX_MIO_BOOT_REG_TIM0 CVMX_MIO_BOOT_REG_TIMX(0)
+
+/* The CN3XXX and CN58XX chips used to not have a LMC number
+    passed to the address macros. These are here to supply backwards
+    compatibility with old code. Code should really use the new

addresses

arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +36 -0
+    with bus arguments for support on other chips */
+#define CVMX_LMC_BIST_CTL	  CVMX_LMCX_BIST_CTL(0)
+#define CVMX_LMC_BIST_RESULT	  CVMX_LMCX_BIST_RESULT(0)
+#define CVMX_LMC_COMP_CTL	  CVMX_LMCX_COMP_CTL(0)
+#define CVMX_LMC_CTL		  CVMX_LMCX_CTL(0)
+#define CVMX_LMC_CTL1		  CVMX_LMCX_CTL1(0)
+#define CVMX_LMC_DCLK_CNT_HI	  CVMX_LMCX_DCLK_CNT_HI(0)
+#define CVMX_LMC_DCLK_CNT_LO	  CVMX_LMCX_DCLK_CNT_LO(0)
+#define CVMX_LMC_DCLK_CTL	  CVMX_LMCX_DCLK_CTL(0)
+#define CVMX_LMC_DDR2_CTL	  CVMX_LMCX_DDR2_CTL(0)
+#define CVMX_LMC_DELAY_CFG	  CVMX_LMCX_DELAY_CFG(0)
+#define CVMX_LMC_DLL_CTL	  CVMX_LMCX_DLL_CTL(0)
+#define CVMX_LMC_DUAL_MEMCFG	  CVMX_LMCX_DUAL_MEMCFG(0)
+#define CVMX_LMC_ECC_SYND	  CVMX_LMCX_ECC_SYND(0)
+#define CVMX_LMC_FADR		  CVMX_LMCX_FADR(0)
+#define CVMX_LMC_IFB_CNT_HI	  CVMX_LMCX_IFB_CNT_HI(0)
+#define CVMX_LMC_IFB_CNT_LO	  CVMX_LMCX_IFB_CNT_LO(0)
+#define CVMX_LMC_MEM_CFG0	  CVMX_LMCX_MEM_CFG0(0)
+#define CVMX_LMC_MEM_CFG1	  CVMX_LMCX_MEM_CFG1(0)
+#define CVMX_LMC_OPS_CNT_HI	  CVMX_LMCX_OPS_CNT_HI(0)
+#define CVMX_LMC_OPS_CNT_LO	  CVMX_LMCX_OPS_CNT_LO(0)
+#define CVMX_LMC_PLL_BWCTL	  CVMX_LMCX_PLL_BWCTL(0)
+#define CVMX_LMC_PLL_CTL	  CVMX_LMCX_PLL_CTL(0)
+#define CVMX_LMC_PLL_STATUS	  CVMX_LMCX_PLL_STATUS(0)
+#define CVMX_LMC_READ_LEVEL_CTL	  CVMX_LMCX_READ_LEVEL_CTL(0)
+#define CVMX_LMC_READ_LEVEL_DBG	  CVMX_LMCX_READ_LEVEL_DBG(0)
+#define CVMX_LMC_READ_LEVEL_RANKX CVMX_LMCX_READ_LEVEL_RANKX(0)
+#define CVMX_LMC_RODT_COMP_CTL	  CVMX_LMCX_RODT_COMP_CTL(0)
+#define CVMX_LMC_RODT_CTL	  CVMX_LMCX_RODT_CTL(0)
+#define CVMX_LMC_WODT_CTL	  CVMX_LMCX_WODT_CTL0(0)
+#define CVMX_LMC_WODT_CTL0	  CVMX_LMCX_WODT_CTL0(0)
+#define CVMX_LMC_WODT_CTL1	  CVMX_LMCX_WODT_CTL1(0)
+
+/* The CN3XXX and CN58XX chips used to not have a TWSI bus number
+    passed to the address macros. These are here to supply backwards
+    compatibility with old code. Code should really use the new

addresses

arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +7 -0
+    with bus arguments for support on other chips */
+#define CVMX_MIO_TWS_INT	 CVMX_MIO_TWSX_INT(0)
+#define CVMX_MIO_TWS_SW_TWSI	 CVMX_MIO_TWSX_SW_TWSI(0)
+#define CVMX_MIO_TWS_SW_TWSI_EXT CVMX_MIO_TWSX_SW_TWSI_EXT(0)
+#define CVMX_MIO_TWS_TWSI_SW	 CVMX_MIO_TWSX_TWSI_SW(0)
+
+/* The CN3XXX and CN58XX chips used to not have a SMI/MDIO bus

number

arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +2 -0
+    passed to the address macros. These are here to supply backwards
+    compatibility with old code. Code should really use the new

addresses

arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +8 -0
+    with bus arguments for support on other chips */
+#define CVMX_SMI_CLK	CVMX_SMIX_CLK(0)
+#define CVMX_SMI_CMD	CVMX_SMIX_CMD(0)
+#define CVMX_SMI_EN	CVMX_SMIX_EN(0)
+#define CVMX_SMI_RD_DAT CVMX_SMIX_RD_DAT(0)
+#define CVMX_SMI_WR_DAT CVMX_SMIX_WR_DAT(0)
+
+#endif /* __CVMX_CSR_H__ */
arch/mips/mach-octeon/include/mach/cvmx-error.h new file +62 -0
new file mode 100644
index 000000000000..9a13ed422484
@@ -0,0 +1,456 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the Octeon extended error status.
+ */
+
+#ifndef __CVMX_ERROR_H__
+#define __CVMX_ERROR_H__
+
+/**
+ * There are generally many error status bits associated with a
+ * single logical group. The enumeration below is used to
+ * communicate high level groups to the error infastructure so
+ * error status bits can be enable or disabled in large groups.
+ */
+typedef enum {
+	CVMX_ERROR_GROUP_INTERNAL,
+	CVMX_ERROR_GROUP_L2C,
+	CVMX_ERROR_GROUP_ETHERNET,
+	CVMX_ERROR_GROUP_MGMT_PORT,
+	CVMX_ERROR_GROUP_PCI,
+	CVMX_ERROR_GROUP_SRIO,
+	CVMX_ERROR_GROUP_USB,
+	CVMX_ERROR_GROUP_LMC,
+	CVMX_ERROR_GROUP_ILK,
+	CVMX_ERROR_GROUP_DFM,
+	CVMX_ERROR_GROUP_ILA,
+} cvmx_error_group_t;
+
+/**
+ * Flags representing special handling for some error registers.
+ * These flags are passed to cvmx_error_initialize() to control
+ * the handling of bits where the same flags were passed to the
+ * added cvmx_error_info_t.
+ */
+typedef enum {
+	CVMX_ERROR_TYPE_NONE = 0,
+	CVMX_ERROR_TYPE_SBE = 1 << 0,
+	CVMX_ERROR_TYPE_DBE = 1 << 1,
+} cvmx_error_type_t;
+
+/**
+ * When registering for interest in an error status register, the
+ * type of the register needs to be known by cvmx-error. Most
+ * registers are either IO64 or IO32, but some blocks contain
+ * registers that can't be directly accessed. A good example of
+ * would be PCIe extended error state stored in config space.
+ */
+typedef enum {
+	__CVMX_ERROR_REGISTER_NONE,
+	CVMX_ERROR_REGISTER_IO64,
+	CVMX_ERROR_REGISTER_IO32,
+	CVMX_ERROR_REGISTER_PCICONFIG,
+	CVMX_ERROR_REGISTER_SRIOMAINT,
+} cvmx_error_register_t;
+
+struct cvmx_error_info;
+/**
+ * Error handling functions must have the following prototype.
+ */
+typedef int (*cvmx_error_func_t)(const struct cvmx_error_info

*info);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +26 -0
+
+/**
+ * This structure is passed to all error handling functions.
+ */
+typedef struct cvmx_error_info {
+	cvmx_error_register_t reg_type;
+	u64 status_addr;
+	u64 status_mask;
+	u64 enable_addr;
+	u64 enable_mask;
+	cvmx_error_type_t flags;
+	cvmx_error_group_t group;
+	int group_index;
+	cvmx_error_func_t func;
+	u64 user_info;
+	struct {
+		cvmx_error_register_t reg_type;
+		u64 status_addr;
+		u64 status_mask;
+	} parent;
+} cvmx_error_info_t;
+
+/**
+ * Initialize the error status system. This should be called once
+ * before any other functions are called. This function adds default
+ * handlers for most all error events but does not enable them.

Later
+ * calls to cvmx_error_enable() are needed.
+ *
+ * @param flags Optional flags.
+ *
+ * @return Zero on success, negative on failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +16 -0
+int cvmx_error_initialize(void);
+
+/**
+ * Poll the error status registers and call the appropriate error
+ * handlers. This should be called in the RSL interrupt handler
+ * for your application or operating system.
+ *
+ * @return Number of error handlers called. Zero means this call
+ *         found no errors and was spurious.
+ */
+int cvmx_error_poll(void);
+
+/**
+ * Register to be called when an error status bit is set. Most users
+ * will not need to call this function as cvmx_error_initialize()
+ * registers default handlers for most error conditions. This

function
+ * is normally used to add more handlers without changing the existing
+ * handlers.
+ *
+ * @param new_info Information about the handler for a error register. The
+ * structure passed is copied and can be destroyed
after the
+ * call. All members of the structure must be
populated, even the
+ * parent information.
+ *
+ * @return Zero on success, negative on failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +5 -0
+int cvmx_error_add(const cvmx_error_info_t *new_info);
+
+/**
+ * Remove all handlers for a status register and mask. Normally
+ * this function should not be called. Instead a new handler should

be
+ * installed to replace the existing handler. In the even that all
+ * reporting of a error bit should be removed, then use this
+ * function.
+ *
+ * @param reg_type Type of the status register to remove
+ * @param status_addr
+ * Status register to remove.
+ * @param status_mask
+ * All handlers for this status register with this
mask will be
+ * removed.
+ * @param old_info If not NULL, this is filled with information about the handler
+ * that was removed.
+ *
+ * @return Zero on success, negative on failure (not found).
+ */
+int cvmx_error_remove(cvmx_error_register_t reg_type, u64 status_addr, u64 status_mask,

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +12 -0
+		      cvmx_error_info_t *old_info);
+
+/**
+ * Change the function and user_info for an existing error status
+ * register. This function should be used to replace the default
+ * handler with an application specific version as needed.
+ *
+ * @param reg_type Type of the status register to change
+ * @param status_addr
+ *                 Status register to change.
+ * @param status_mask
+ *                 All handlers for this status register with this

mask will be
+ * changed.
+ * @param new_func New function to use to handle the error status
+ * @param new_user_info
+ * New user info parameter for the function
+ * @param old_func If not NULL, the old function is returned. Useful for restoring
+ * the old handler.
+ * @param old_user_info
+ * If not NULL, the old user info parameter.
+ *
+ * @return Zero on success, negative on failure
+ */
+int cvmx_error_change_handler(cvmx_error_register_t reg_type, u64 status_addr, u64 status_mask,

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +1 -0
+			      cvmx_error_func_t new_func, u64

new_user_info,

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +1 -0
+			      cvmx_error_func_t *old_func, u64

*old_user_info);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +8 -0
+
+/**
+ * Enable all error registers for a logical group. This should be
+ * called whenever a logical group is brought online.
+ *
+ * @param group  Logical group to enable
+ * @param group_index
+ *               Index for the group as defined in the

cvmx_error_group_t
+ * comments.
+ *
+ * @return Zero on success, negative on failure.
+ */
+/*
+ * Rather than conditionalize the calls throughout the executive to not enable
+ * interrupts in Uboot, simply make the enable function do nothing
+ */
+static inline int cvmx_error_enable_group(cvmx_error_group_t group, int group_index)

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +13 -0
+{
+	return 0;
+}
+
+/**
+ * Disable all error registers for a logical group. This should be
+ * called whenever a logical group is brought offline. Many blocks
+ * will report spurious errors when offline unless this function
+ * is called.
+ *
+ * @param group  Logical group to disable
+ * @param group_index
+ *               Index for the group as defined in the

cvmx_error_group_t
+ * comments.
+ *
+ * @return Zero on success, negative on failure.
+ */
+/*
+ * Rather than conditionalize the calls throughout the executive to not disable
+ * interrupts in Uboot, simply make the enable function do nothing
+ */
+static inline int cvmx_error_disable_group(cvmx_error_group_t group, int group_index)

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +12 -0
+{
+	return 0;
+}
+
+/**
+ * Enable all handlers for a specific status register mask.
+ *
+ * @param reg_type Type of the status register
+ * @param status_addr
+ *                 Status register address
+ * @param status_mask
+ *                 All handlers for this status register with this

mask will be
+ * enabled.
+ *
+ * @return Zero on success, negative on failure.
+ */
+int cvmx_error_enable(cvmx_error_register_t reg_type, u64 status_addr, u64 status_mask);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +9 -0
+
+/**
+ * Disable all handlers for a specific status register and mask.
+ *
+ * @param reg_type Type of the status register
+ * @param status_addr
+ *                 Status register address
+ * @param status_mask
+ *                 All handlers for this status register with this

mask will be
+ * disabled.
+ *
+ * @return Zero on success, negative on failure.
+ */
+int cvmx_error_disable(cvmx_error_register_t reg_type, u64 status_addr, u64 status_mask);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +4 -0
+
+/**
+ * @INTERNAL
+ * Function for processing non leaf error status registers. This

function
+ * calls all handlers for this passed register and all children linked
+ * to it.
+ *
+ * @param info Error register to check
+ *
+ * @return Number of error status bits found or zero if no bits were set.
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +5 -0
+int __cvmx_error_decode(const cvmx_error_info_t *info);
+
+/**
+ * @INTERNAL
+ * This error bit handler simply prints a message and clears the

status bit
+ *
+ * @param info Error register to check
+ *
+ * @return
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +24 -0
+int __cvmx_error_display(const cvmx_error_info_t *info);
+
+/**
+ * Find the handler for a specific status register and mask
+ *
+ * @param status_addr
+ *                Status register address
+ *
+ * @return  Return the handler on success or null on failure.
+ */
+cvmx_error_info_t *cvmx_error_get_index(u64 status_addr);
+
+void __cvmx_install_gmx_error_handler_for_xaui(void);
+
+/**
+ * 78xx related
+ */
+/**
+ * Compare two INTSN values.
+ *
+ * @param key INTSN value to search for
+ * @param data current entry from the searched array
+ *
+ * @return Negative, 0 or positive when respectively key is less

than,
+ * equal or greater than data.
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +15 -0
+int cvmx_error_intsn_cmp(const void *key, const void *data);
+
+/**
+ * @INTERNAL
+ *
+ * @param intsn   Interrupt source number to display
+ *
+ * @param node Node number
+ *
+ * @return Zero on success, -1 on error
+ */
+int cvmx_error_intsn_display_v3(int node, u32 intsn);
+
+/**
+ * Initialize the error status system for cn78xx. This should be

called once
+ * before any other functions are called. This function enables the interrupts
+ * described in the array.
+ *
+ * @param node Node number
+ *
+ * @return Zero on success, negative on failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +33 -0
+int cvmx_error_initialize_cn78xx(int node);
+
+/**
+ * Enable interrupt for a specific INTSN.
+ *
+ * @param node Node number
+ * @param intsn Interrupt source number
+ *
+ * @return Zero on success, negative on failure.
+ */
+int cvmx_error_intsn_enable_v3(int node, u32 intsn);
+
+/**
+ * Disable interrupt for a specific INTSN.
+ *
+ * @param node Node number
+ * @param intsn Interrupt source number
+ *
+ * @return Zero on success, negative on failure.
+ */
+int cvmx_error_intsn_disable_v3(int node, u32 intsn);
+
+/**
+ * Clear interrupt for a specific INTSN.
+ *
+ * @param intsn Interrupt source number
+ *
+ * @return Zero on success, negative on failure.
+ */
+int cvmx_error_intsn_clear_v3(int node, u32 intsn);
+
+/**
+ * Enable interrupts for a specific CSR(all the bits/intsn in the

csr).
+ *
+ * @param node Node number
+ * @param csr_address CSR address
+ *
+ * @return Zero on success, negative on failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +4 -0
+int cvmx_error_csr_enable_v3(int node, u64 csr_address);
+
+/**
+ * Disable interrupts for a specific CSR (all the bits/intsn in the

csr).
+ *
+ * @param node Node number
+ * @param csr_address CSR address
+ *
+ * @return Zero
+ */

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +12 -0
+int cvmx_error_csr_disable_v3(int node, u64 csr_address);
+
+/**
+ * Enable all error registers for a logical group. This should be
+ * called whenever a logical group is brought online.
+ *
+ * @param group  Logical group to enable
+ * @param xipd_port  The IPD port value
+ *
+ * @return Zero.
+ */
+int cvmx_error_enable_group_v3(cvmx_error_group_t group, int

xipd_port);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +10 -0
+
+/**
+ * Disable all error registers for a logical group.
+ *
+ * @param group  Logical group to enable
+ * @param xipd_port  The IPD port value
+ *
+ * @return Zero.
+ */
+int cvmx_error_disable_group_v3(cvmx_error_group_t group, int

xipd_port);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +3 -0
+
+/**
+ * Enable all error registers for a specific category in a logical

group.
+ * This should be called whenever a logical group is brought online.
+ *
+ * @param group Logical group to enable
+ * @param type Category in a logical group to enable
+ * @param xipd_port The IPD port value
+ *
+ * @return Zero.
+ */
+int cvmx_error_enable_group_type_v3(cvmx_error_group_t group, cvmx_error_type_t type,

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +4 -0
+				    int xipd_port);
+
+/**
+ * Disable all error registers for a specific category in a logical

group.
+ * This should be called whenever a logical group is brought online.
+ *
+ * @param group Logical group to disable
+ * @param type Category in a logical group to disable
+ * @param xipd_port The IPD port value
+ *
+ * @return Zero.
+ */
+int cvmx_error_disable_group_type_v3(cvmx_error_group_t group, cvmx_error_type_t type,

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +11 -0
+				     int xipd_port);
+
+/**
+ * Clear all error registers for a logical group.
+ *
+ * @param group  Logical group to disable
+ * @param xipd_port  The IPD port value
+ *
+ * @return Zero.
+ */
+int cvmx_error_clear_group_v3(cvmx_error_group_t group, int

xipd_port);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +41 -0
+
+/**
+ * Enable all error registers for a particular category.
+ *
+ * @param node  CCPI node
+ * @param type  category to enable
+ *
+ *@return Zero.
+ */
+int cvmx_error_enable_type_v3(int node, cvmx_error_type_t type);
+
+/**
+ * Disable all error registers for a particular category.
+ *
+ * @param node  CCPI node
+ * @param type  category to disable
+ *
+ *@return Zero.
+ */
+int cvmx_error_disable_type_v3(int node, cvmx_error_type_t type);
+
+void cvmx_octeon_hang(void) __attribute__((__noreturn__));
+
+/**
+ * @INTERNAL
+ *
+ * Process L2C single and multi-bit ECC errors
+ *
+ */
+int __cvmx_cn7xxx_l2c_l2d_ecc_error_display(int node, int intsn);
+
+/**
+ * Handle L2 cache TAG ECC errors and noway errors
+ *
+ * @param	CCPI node
+ * @param	intsn	intsn from error array.
+ * @param	remote	true for remote node (cn78xx only)
+ *
+ * @return	1 if handled, 0 if not handled
+ */
+int __cvmx_cn7xxx_l2c_tag_error_display(int node, int intsn, bool

remote);

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +2 -0
+
+#endif
arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +21 -0
new file mode 100644
index 000000000000..297fb3f4a28c
@@ -0,0 +1,217 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the hardware Free Pool Allocator.
+ */
+
+#ifndef __CVMX_FPA_H__
+#define __CVMX_FPA_H__
+
+#include "cvmx-scratch.h"
+#include "cvmx-fpa-defs.h"
+#include "cvmx-fpa1.h"
+#include "cvmx-fpa3.h"
+
+#define CVMX_FPA_MIN_BLOCK_SIZE 128
+#define CVMX_FPA_ALIGNMENT	128
+#define CVMX_FPA_POOL_NAME_LEN	16
+
+/* On CN78XX in backward-compatible mode, pool is mapped to AURA */
+#define

CVMX_FPA_NUM_POOLS

                       \
arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +1 -0
+	(octeon_has_feature(OCTEON_FEATURE_FPA3) ?

cvmx_fpa3_num_auras() : CVMX_FPA1_NUM_POOLS)

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +64 -0
+
+/**
+ * Structure to store FPA pool configuration parameters.
+ */
+struct cvmx_fpa_pool_config {
+	s64 pool_num;
+	u64 buffer_size;
+	u64 buffer_count;
+};
+
+typedef struct cvmx_fpa_pool_config cvmx_fpa_pool_config_t;
+
+/**
+ * Return the name of the pool
+ *
+ * @param pool_num   Pool to get the name of
+ * @return The name
+ */
+const char *cvmx_fpa_get_name(int pool_num);
+
+/**
+ * Initialize FPA per node
+ */
+int cvmx_fpa_global_init_node(int node);
+
+/**
+ * Enable the FPA
+ */
+static inline void cvmx_fpa_enable(void)
+{
+	if (!octeon_has_feature(OCTEON_FEATURE_FPA3))
+		cvmx_fpa1_enable();
+	else
+		cvmx_fpa_global_init_node(cvmx_get_node_num());
+}
+
+/**
+ * Disable the FPA
+ */
+static inline void cvmx_fpa_disable(void)
+{
+	if (!octeon_has_feature(OCTEON_FEATURE_FPA3))
+		cvmx_fpa1_disable();
+	/* FPA3 does not have a disable function */
+}
+
+/**
+ * @INTERNAL
+ * @deprecated OBSOLETE
+ *
+ * Kept for transition assistance only
+ */
+static inline void cvmx_fpa_global_initialize(void)
+{
+	cvmx_fpa_global_init_node(cvmx_get_node_num());
+}
+
+/**
+ * @INTERNAL
+ *
+ * Convert FPA1 style POOL into FPA3 AURA in
+ * backward compatibility mode.
+ */
+static inline cvmx_fpa3_gaura_t

cvmx_fpa1_pool_to_fpa3_aura(cvmx_fpa1_pool_t pool)

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +20 -0
+{
+	if ((octeon_has_feature(OCTEON_FEATURE_FPA3))) {
+		unsigned int node = cvmx_get_node_num();
+		cvmx_fpa3_gaura_t aura = __cvmx_fpa3_gaura(node, pool);
+		return aura;
+	}
+	return CVMX_FPA3_INVALID_GAURA;
+}
+
+/**
+ * Get a new block from the FPA
+ *
+ * @param pool   Pool to get the block from
+ * @return Pointer to the block or NULL on failure
+ */
+static inline void *cvmx_fpa_alloc(u64 pool)
+{
+	/* FPA3 is handled differently */
+	if ((octeon_has_feature(OCTEON_FEATURE_FPA3))) {
+		return

cvmx_fpa3_alloc(cvmx_fpa1_pool_to_fpa3_aura(pool));

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +11 -0
+	} else
+		return cvmx_fpa1_alloc(pool);
+}
+
+/**
+ * Asynchronously get a new block from the FPA
+ *
+ * The result of cvmx_fpa_async_alloc() may be retrieved using
+ * cvmx_fpa_async_alloc_finish().
+ *
+ * @param scr_addr Local scratch address to put response in.  This

is a byte
+ * address but must be 8 byte aligned.
+ * @param pool Pool to get the block from
+ */

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +4 -0
+static inline void cvmx_fpa_async_alloc(u64 scr_addr, u64 pool)
+{
+	if ((octeon_has_feature(OCTEON_FEATURE_FPA3))) {
+		return cvmx_fpa3_async_alloc(scr_addr,

cvmx_fpa1_pool_to_fpa3_aura(pool));

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +8 -0
+	} else
+		return cvmx_fpa1_async_alloc(scr_addr, pool);
+}
+
+/**
+ * Retrieve the result of cvmx_fpa_async_alloc
+ *
+ * @param scr_addr The Local scratch address.  Must be the same

value
+ * passed to cvmx_fpa_async_alloc().
+ *
+ * @param pool Pool the block came from. Must be the same value
+ * passed to cvmx_fpa_async_alloc.
+ *
+ * @return Pointer to the block or NULL on failure
+ */
+static inline void *cvmx_fpa_async_alloc_finish(u64 scr_addr, u64 pool)

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +3 -0
+{
+	if ((octeon_has_feature(OCTEON_FEATURE_FPA3)))
+		return cvmx_fpa3_async_alloc_finish(scr_addr,

cvmx_fpa1_pool_to_fpa3_aura(pool));

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +7 -0
+	else
+		return cvmx_fpa1_async_alloc_finish(scr_addr, pool);
+}
+
+/**
+ * Free a block allocated with a FPA pool.
+ * Does NOT provide memory ordering in cases where the memory block

was
+ * modified by the core.
+ *
+ * @param ptr Block to free
+ * @param pool Pool to put it in
+ * @param num_cache_lines
+ * Cache lines to invalidate
+ */
+static inline void cvmx_fpa_free_nosync(void *ptr, u64 pool, u64 num_cache_lines)

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +4 -0
+{
+	/* FPA3 is handled differently */
+	if ((octeon_has_feature(OCTEON_FEATURE_FPA3)))
+		cvmx_fpa3_free_nosync(ptr,

cvmx_fpa1_pool_to_fpa3_aura(pool), num_cache_lines);

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +14 -0
+	else
+		cvmx_fpa1_free_nosync(ptr, pool, num_cache_lines);
+}
+
+/**
+ * Free a block allocated with a FPA pool.  Provides required memory
+ * ordering in cases where memory block was modified by core.
+ *
+ * @param ptr    Block to free
+ * @param pool   Pool to put it in
+ * @param num_cache_lines
+ *               Cache lines to invalidate
+ */
+static inline void cvmx_fpa_free(void *ptr, u64 pool, u64

num_cache_lines)

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +3 -0
+{
+	if ((octeon_has_feature(OCTEON_FEATURE_FPA3)))
+		cvmx_fpa3_free(ptr, cvmx_fpa1_pool_to_fpa3_aura(pool),

num_cache_lines);

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +13 -0
+	else
+		cvmx_fpa1_free(ptr, pool, num_cache_lines);
+}
+
+/**
+ * Setup a FPA pool to control a new block of memory.
+ * This can only be called once per pool. Make sure proper
+ * locking enforces this.
+ *
+ * @param pool       Pool to initialize
+ * @param name       Constant character string to name this pool.
+ *                   String is not copied.
+ * @param buffer     Pointer to the block of memory to use. This

must be
+ * accessible by all processors and external
hardware.
+ * @param block_size Size for each block controlled by the FPA
+ * @param num_blocks Number of blocks
+ *
+ * @return the pool number on Success,
+ * -1 on failure
+ */
+int cvmx_fpa_setup_pool(int pool, const char *name, void *buffer, u64 block_size, u64 num_blocks);

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +17 -0
+
+int cvmx_fpa_shutdown_pool(int pool);
+
+/**
+ * Gets the block size of buffer in specified pool
+ * @param pool	 Pool to get the block size from
+ * @return       Size of buffer in specified pool
+ */
+unsigned int cvmx_fpa_get_block_size(int pool);
+
+int cvmx_fpa_is_pool_available(int pool_num);
+u64 cvmx_fpa_get_pool_owner(int pool_num);
+int cvmx_fpa_get_max_pools(void);
+int cvmx_fpa_get_current_count(int pool_num);
+int cvmx_fpa_validate_pool(int pool);
+
+#endif /*  __CVM_FPA_H__ */
arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +53 -0
new file mode 100644
index 000000000000..6985083a5d66
@@ -0,0 +1,196 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the hardware Free Pool Allocator on Octeon chips.
+ * These are the legacy models, i.e. prior to CN78XX/CN76XX.
+ */
+
+#ifndef __CVMX_FPA1_HW_H__
+#define __CVMX_FPA1_HW_H__
+
+#include "cvmx-scratch.h"
+#include "cvmx-fpa-defs.h"
+#include "cvmx-fpa3.h"
+
+/* Legacy pool range is 0..7 and 8 on CN68XX */
+typedef int cvmx_fpa1_pool_t;
+
+#define CVMX_FPA1_NUM_POOLS    8
+#define CVMX_FPA1_INVALID_POOL ((cvmx_fpa1_pool_t)-1)
+#define CVMX_FPA1_NAME_SIZE    16
+
+/**
+ * Structure describing the data format used for stores to the FPA.
+ */
+typedef union {
+	u64 u64;
+	struct {
+		u64 scraddr : 8;
+		u64 len : 8;
+		u64 did : 8;
+		u64 addr : 40;
+	} s;
+} cvmx_fpa1_iobdma_data_t;
+
+/*
+ * Allocate or reserve the specified fpa pool.
+ *
+ * @param pool	  FPA pool to allocate/reserve. If -1 it
+ *                finds an empty pool to allocate.
+ * @return        Alloctaed pool number or CVMX_FPA1_POOL_INVALID
+ *                if fails to allocate the pool
+ */
+cvmx_fpa1_pool_t cvmx_fpa1_reserve_pool(cvmx_fpa1_pool_t pool);
+
+/**
+ * Free the specified fpa pool.
+ * @param pool	   Pool to free
+ * @return         0 for success -1 failure
+ */
+int cvmx_fpa1_release_pool(cvmx_fpa1_pool_t pool);
+
+static inline void cvmx_fpa1_free(void *ptr, cvmx_fpa1_pool_t pool,

u64 num_cache_lines)

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +5 -0
+{
+	cvmx_addr_t newptr;
+
+	newptr.u64 = cvmx_ptr_to_phys(ptr);
+	newptr.sfilldidspace.didspace =

CVMX_ADDR_DIDSPACE(CVMX_FULL_DID(CVMX_OCT_DID_FPA, pool));

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +1 -0
+	/* Make sure that any previous writes to memory go out before

we free

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +1 -0
+	 * this buffer.  This also serves as a barrier to prevent GCC

from

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +8 -0
+	 * reordering operations to after the free.
+	 */
+	CVMX_SYNCWS;
+	/* value written is number of cache lines not written back */
+	cvmx_write_io(newptr.u64, num_cache_lines);
+}
+
+static inline void cvmx_fpa1_free_nosync(void *ptr, cvmx_fpa1_pool_t

pool,

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +6 -0
+					 unsigned int num_cache_lines)
+{
+	cvmx_addr_t newptr;
+
+	newptr.u64 = cvmx_ptr_to_phys(ptr);
+	newptr.sfilldidspace.didspace =

CVMX_ADDR_DIDSPACE(CVMX_FULL_DID(CVMX_OCT_DID_FPA, pool));

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +18 -0
+	/* Prevent GCC from reordering around free */
+	asm volatile("" : : : "memory");
+	/* value written is number of cache lines not written back */
+	cvmx_write_io(newptr.u64, num_cache_lines);
+}
+
+/**
+ * Enable the FPA for use. Must be performed after any CSR
+ * configuration but before any other FPA functions.
+ */
+static inline void cvmx_fpa1_enable(void)
+{
+	cvmx_fpa_ctl_status_t status;
+
+	status.u64 = csr_rd(CVMX_FPA_CTL_STATUS);
+	if (status.s.enb) {
+		/*
+		 * CN68XXP1 should not reset the FPA (doing so may

break

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +1 -0
+		 * the SSO, so we may end up enabling it more than

once.

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +12 -0
+		 * Just return and don't spew messages.
+		 */
+		return;
+	}
+
+	status.u64 = 0;
+	status.s.enb = 1;
+	csr_wr(CVMX_FPA_CTL_STATUS, status.u64);
+}
+
+/**
+ * Reset FPA to disable. Make sure buffers from all FPA pools are

freed
+ * before disabling FPA.
+ */

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +18 -0
+static inline void cvmx_fpa1_disable(void)
+{
+	cvmx_fpa_ctl_status_t status;
+
+	if (OCTEON_IS_MODEL(OCTEON_CN68XX_PASS1))
+		return;
+
+	status.u64 = csr_rd(CVMX_FPA_CTL_STATUS);
+	status.s.reset = 1;
+	csr_wr(CVMX_FPA_CTL_STATUS, status.u64);
+}
+
+static inline void *cvmx_fpa1_alloc(cvmx_fpa1_pool_t pool)
+{
+	u64 address;
+
+	for (;;) {
+		address =

csr_rd(CVMX_ADDR_DID(CVMX_FULL_DID(CVMX_OCT_DID_FPA, pool)));

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +19 -0
+		if (cvmx_likely(address)) {
+			return cvmx_phys_to_ptr(address);
+		} else {
+			if (csr_rd(CVMX_FPA_QUEX_AVAILABLE(pool)) > 0)
+				udelay(50);
+			else
+				return NULL;
+		}
+	}
+}
+
+/**
+ * Asynchronously get a new block from the FPA
+ * @INTERNAL
+ *
+ * The result of cvmx_fpa_async_alloc() may be retrieved using
+ * cvmx_fpa_async_alloc_finish().
+ *
+ * @param scr_addr Local scratch address to put response in.  This

is a byte
+ * address but must be 8 byte aligned.
+ * @param pool Pool to get the block from
+ */
+static inline void cvmx_fpa1_async_alloc(u64 scr_addr, cvmx_fpa1_pool_t pool)

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +4 -0
+{
+	cvmx_fpa1_iobdma_data_t data;
+
+	/* Hardware only uses 64 bit aligned locations, so convert from

byte

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +18 -0
+	 * address to 64-bit index
+	 */
+	data.u64 = 0ull;
+	data.s.scraddr = scr_addr >> 3;
+	data.s.len = 1;
+	data.s.did = CVMX_FULL_DID(CVMX_OCT_DID_FPA, pool);
+	data.s.addr = 0;
+
+	cvmx_scratch_write64(scr_addr, 0ull);
+	CVMX_SYNCW;
+	cvmx_send_single(data.u64);
+}
+
+/**
+ * Retrieve the result of cvmx_fpa_async_alloc
+ * @INTERNAL
+ *
+ * @param scr_addr The Local scratch address.  Must be the same

value
+ * passed to cvmx_fpa_async_alloc().
+ *
+ * @param pool Pool the block came from. Must be the same value
+ * passed to cvmx_fpa_async_alloc.
+ *
+ * @return Pointer to the block or NULL on failure
+ */
+static inline void *cvmx_fpa1_async_alloc_finish(u64 scr_addr, cvmx_fpa1_pool_t pool)

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +18 -0
+{
+	u64 address;
+
+	CVMX_SYNCIOBDMA;
+
+	address = cvmx_scratch_read64(scr_addr);
+	if (cvmx_likely(address))
+		return cvmx_phys_to_ptr(address);
+	else
+		return cvmx_fpa1_alloc(pool);
+}
+
+static inline u64 cvmx_fpa1_get_available(cvmx_fpa1_pool_t pool)
+{
+	return csr_rd(CVMX_FPA_QUEX_AVAILABLE(pool));
+}
+
+#endif /* __CVMX_FPA1_HW_H__ */
arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +32 -0
new file mode 100644
index 000000000000..229982b83163
@@ -0,0 +1,566 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the CN78XX Free Pool Allocator, a.k.a. FPA3
+ */
+
+#include "cvmx-address.h"
+#include "cvmx-fpa-defs.h"
+#include "cvmx-scratch.h"
+
+#ifndef __CVMX_FPA3_H__
+#define __CVMX_FPA3_H__
+
+typedef struct {
+	unsigned res0 : 6;
+	unsigned node : 2;
+	unsigned res1 : 2;
+	unsigned lpool : 6;
+	unsigned valid_magic : 16;
+} cvmx_fpa3_pool_t;
+
+typedef struct {
+	unsigned res0 : 6;
+	unsigned node : 2;
+	unsigned res1 : 6;
+	unsigned laura : 10;
+	unsigned valid_magic : 16;
+} cvmx_fpa3_gaura_t;
+
+#define CVMX_FPA3_VALID_MAGIC	0xf9a3
+#define CVMX_FPA3_INVALID_GAURA ((cvmx_fpa3_gaura_t){ 0, 0, 0, 0, 0

})
+#define CVMX_FPA3_INVALID_POOL ((cvmx_fpa3_pool_t){ 0, 0, 0,
0, 0 })

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +16 -0
+
+static inline bool __cvmx_fpa3_aura_valid(cvmx_fpa3_gaura_t aura)
+{
+	if (aura.valid_magic != CVMX_FPA3_VALID_MAGIC)
+		return false;
+	return true;
+}
+
+static inline bool __cvmx_fpa3_pool_valid(cvmx_fpa3_pool_t pool)
+{
+	if (pool.valid_magic != CVMX_FPA3_VALID_MAGIC)
+		return false;
+	return true;
+}
+
+static inline cvmx_fpa3_gaura_t __cvmx_fpa3_gaura(int node, int

laura)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +109 -0
+{
+	cvmx_fpa3_gaura_t aura;
+
+	if (node < 0)
+		node = cvmx_get_node_num();
+	if (laura < 0)
+		return CVMX_FPA3_INVALID_GAURA;
+
+	aura.node = node;
+	aura.laura = laura;
+	aura.valid_magic = CVMX_FPA3_VALID_MAGIC;
+	return aura;
+}
+
+static inline cvmx_fpa3_pool_t __cvmx_fpa3_pool(int node, int lpool)
+{
+	cvmx_fpa3_pool_t pool;
+
+	if (node < 0)
+		node = cvmx_get_node_num();
+	if (lpool < 0)
+		return CVMX_FPA3_INVALID_POOL;
+
+	pool.node = node;
+	pool.lpool = lpool;
+	pool.valid_magic = CVMX_FPA3_VALID_MAGIC;
+	return pool;
+}
+
+#undef CVMX_FPA3_VALID_MAGIC
+
+/**
+ * Structure describing the data format used for stores to the FPA.
+ */
+typedef union {
+	u64 u64;
+	struct {
+		u64 scraddr : 8;
+		u64 len : 8;
+		u64 did : 8;
+		u64 addr : 40;
+	} s;
+	struct {
+		u64 scraddr : 8;
+		u64 len : 8;
+		u64 did : 8;
+		u64 node : 4;
+		u64 red : 1;
+		u64 reserved2 : 9;
+		u64 aura : 10;
+		u64 reserved3 : 16;
+	} cn78xx;
+} cvmx_fpa3_iobdma_data_t;
+
+/**
+ * Struct describing load allocate operation addresses for FPA pool.
+ */
+union cvmx_fpa3_load_data {
+	u64 u64;
+	struct {
+		u64 seg : 2;
+		u64 reserved1 : 13;
+		u64 io : 1;
+		u64 did : 8;
+		u64 node : 4;
+		u64 red : 1;
+		u64 reserved2 : 9;
+		u64 aura : 10;
+		u64 reserved3 : 16;
+	};
+};
+
+typedef union cvmx_fpa3_load_data cvmx_fpa3_load_data_t;
+
+/**
+ * Struct describing store free operation addresses from FPA pool.
+ */
+union cvmx_fpa3_store_addr {
+	u64 u64;
+	struct {
+		u64 seg : 2;
+		u64 reserved1 : 13;
+		u64 io : 1;
+		u64 did : 8;
+		u64 node : 4;
+		u64 reserved2 : 10;
+		u64 aura : 10;
+		u64 fabs : 1;
+		u64 reserved3 : 3;
+		u64 dwb_count : 9;
+		u64 reserved4 : 3;
+	};
+};
+
+typedef union cvmx_fpa3_store_addr cvmx_fpa3_store_addr_t;
+
+enum cvmx_fpa3_pool_alignment_e {
+	FPA_NATURAL_ALIGNMENT,
+	FPA_OFFSET_ALIGNMENT,
+	FPA_OPAQUE_ALIGNMENT
+};
+
+#define CVMX_FPA3_AURAX_LIMIT_MAX ((1ull << 40) - 1)
+
+/**
+ * @INTERNAL
+ * Accessor functions to return number of POOLS in an FPA3
+ * depending on SoC model.
+ * The number is per-node for models supporting multi-node

configurations.
+ */

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +17 -0
+static inline int cvmx_fpa3_num_pools(void)
+{
+	if (OCTEON_IS_MODEL(OCTEON_CN78XX))
+		return 64;
+	if (OCTEON_IS_MODEL(OCTEON_CNF75XX))
+		return 32;
+	if (OCTEON_IS_MODEL(OCTEON_CN73XX))
+		return 32;
+	printf("ERROR: %s: Unknowm model\n", __func__);
+	return -1;
+}
+
+/**
+ * @INTERNAL
+ * Accessor functions to return number of AURAS in an FPA3
+ * depending on SoC model.
+ * The number is per-node for models supporting multi-node

configurations.
+ */

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +14 -0
+static inline int cvmx_fpa3_num_auras(void)
+{
+	if (OCTEON_IS_MODEL(OCTEON_CN78XX))
+		return 1024;
+	if (OCTEON_IS_MODEL(OCTEON_CNF75XX))
+		return 512;
+	if (OCTEON_IS_MODEL(OCTEON_CN73XX))
+		return 512;
+	printf("ERROR: %s: Unknowm model\n", __func__);
+	return -1;
+}
+
+/**
+ * Get the FPA3 POOL underneath FPA3 AURA, containing all its

buffers
+ *
+ */
+static inline cvmx_fpa3_pool_t
cvmx_fpa3_aura_to_pool(cvmx_fpa3_gaura_t aura)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +5 -0
+{
+	cvmx_fpa3_pool_t pool;
+	cvmx_fpa_aurax_pool_t aurax_pool;
+
+	aurax_pool.u64 = cvmx_read_csr_node(aura.node,

CVMX_FPA_AURAX_POOL(aura.laura));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +39 -0
+
+	pool = __cvmx_fpa3_pool(aura.node, aurax_pool.s.pool);
+	return pool;
+}
+
+/**
+ * Get a new block from the FPA pool
+ *
+ * @param aura  - aura number
+ * @return pointer to the block or NULL on failure
+ */
+static inline void *cvmx_fpa3_alloc(cvmx_fpa3_gaura_t aura)
+{
+	u64 address;
+	cvmx_fpa3_load_data_t load_addr;
+
+	load_addr.u64 = 0;
+	load_addr.seg = CVMX_MIPS_SPACE_XKPHYS;
+	load_addr.io = 1;
+	load_addr.did = 0x29; /* Device ID. Indicates FPA. */
+	load_addr.node = aura.node;
+	load_addr.red = 0; /* Perform RED on allocation.
+				  * FIXME to use config option
+				  */
+	load_addr.aura = aura.laura;
+
+	address = cvmx_read64_uint64(load_addr.u64);
+	if (!address)
+		return NULL;
+	return cvmx_phys_to_ptr(address);
+}
+
+/**
+ * Asynchronously get a new block from the FPA
+ *
+ * The result of cvmx_fpa_async_alloc() may be retrieved using
+ * cvmx_fpa_async_alloc_finish().
+ *
+ * @param scr_addr Local scratch address to put response in.  This

is a byte
+ * address but must be 8 byte aligned.
+ * @param aura Global aura to get the block from
+ */
+static inline void cvmx_fpa3_async_alloc(u64 scr_addr, cvmx_fpa3_gaura_t aura)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +4 -0
+{
+	cvmx_fpa3_iobdma_data_t data;
+
+	/* Hardware only uses 64 bit aligned locations, so convert from

byte

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +18 -0
+	 * address to 64-bit index
+	 */
+	data.u64 = 0ull;
+	data.cn78xx.scraddr = scr_addr >> 3;
+	data.cn78xx.len = 1;
+	data.cn78xx.did = 0x29;
+	data.cn78xx.node = aura.node;
+	data.cn78xx.aura = aura.laura;
+	cvmx_scratch_write64(scr_addr, 0ull);
+
+	CVMX_SYNCW;
+	cvmx_send_single(data.u64);
+}
+
+/**
+ * Retrieve the result of cvmx_fpa3_async_alloc
+ *
+ * @param scr_addr The Local scratch address.  Must be the same

value
+ * passed to cvmx_fpa_async_alloc().
+ *
+ * @param aura Global aura the block came from. Must be the same value
+ * passed to cvmx_fpa_async_alloc.
+ *
+ * @return Pointer to the block or NULL on failure
+ */
+static inline void *cvmx_fpa3_async_alloc_finish(u64 scr_addr, cvmx_fpa3_gaura_t aura)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +21 -0
+{
+	u64 address;
+
+	CVMX_SYNCIOBDMA;
+
+	address = cvmx_scratch_read64(scr_addr);
+	if (cvmx_likely(address))
+		return cvmx_phys_to_ptr(address);
+	else
+		/* Try regular alloc if async failed */
+		return cvmx_fpa3_alloc(aura);
+}
+
+/**
+ * Free a pointer back to the pool.
+ *
+ * @param aura   global aura number
+ * @param ptr    physical address of block to free.
+ * @param num_cache_lines Cache lines to invalidate
+ */
+static inline void cvmx_fpa3_free(void *ptr, cvmx_fpa3_gaura_t aura,

unsigned int num_cache_lines)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +7 -0
+{
+	cvmx_fpa3_store_addr_t newptr;
+	cvmx_addr_t newdata;
+
+	newdata.u64 = cvmx_ptr_to_phys(ptr);
+
+	/* Make sure that any previous writes to memory go out before

we free

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+	   this buffer. This also serves as a barrier to prevent GCC

from

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +10 -0
+	   reordering operations to after the free. */
+	CVMX_SYNCWS;
+
+	newptr.u64 = 0;
+	newptr.seg = CVMX_MIPS_SPACE_XKPHYS;
+	newptr.io = 1;
+	newptr.did = 0x29; /* Device id, indicates FPA */
+	newptr.node = aura.node;
+	newptr.aura = aura.laura;
+	newptr.fabs = 0; /* Free absolute. FIXME to use config option

*/

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +7 -0
+	newptr.dwb_count = num_cache_lines;
+
+	cvmx_write_io(newptr.u64, newdata.u64);
+}
+
+/**
+ * Free a pointer back to the pool without flushing the write

buffer.
+ *
+ * @param aura global aura number
+ * @param ptr physical address of block to free.
+ * @param num_cache_lines Cache lines to invalidate
+ */
+static inline void cvmx_fpa3_free_nosync(void *ptr, cvmx_fpa3_gaura_t aura,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +17 -0
+					 unsigned int num_cache_lines)
+{
+	cvmx_fpa3_store_addr_t newptr;
+	cvmx_addr_t newdata;
+
+	newdata.u64 = cvmx_ptr_to_phys(ptr);
+
+	/* Prevent GCC from reordering writes to (*ptr) */
+	asm volatile("" : : : "memory");
+
+	newptr.u64 = 0;
+	newptr.seg = CVMX_MIPS_SPACE_XKPHYS;
+	newptr.io = 1;
+	newptr.did = 0x29; /* Device id, indicates FPA */
+	newptr.node = aura.node;
+	newptr.aura = aura.laura;
+	newptr.fabs = 0; /* Free absolute. FIXME to use config option

*/

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +13 -0
+	newptr.dwb_count = num_cache_lines;
+
+	cvmx_write_io(newptr.u64, newdata.u64);
+}
+
+static inline int cvmx_fpa3_pool_is_enabled(cvmx_fpa3_pool_t pool)
+{
+	cvmx_fpa_poolx_cfg_t pool_cfg;
+
+	if (!__cvmx_fpa3_pool_valid(pool))
+		return -1;
+
+	pool_cfg.u64 = cvmx_read_csr_node(pool.node,

CVMX_FPA_POOLX_CFG(pool.lpool));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +4 -0
+	return pool_cfg.cn78xx.ena;
+}
+
+static inline int cvmx_fpa3_config_red_params(unsigned int node, int

qos_avg_en, int red_lvl_dly,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +23 -0
+					      int avg_dly)
+{
+	cvmx_fpa_gen_cfg_t fpa_cfg;
+	cvmx_fpa_red_delay_t red_delay;
+
+	fpa_cfg.u64 = cvmx_read_csr_node(node, CVMX_FPA_GEN_CFG);
+	fpa_cfg.s.avg_en = qos_avg_en;
+	fpa_cfg.s.lvl_dly = red_lvl_dly;
+	cvmx_write_csr_node(node, CVMX_FPA_GEN_CFG, fpa_cfg.u64);
+
+	red_delay.u64 = cvmx_read_csr_node(node, CVMX_FPA_RED_DELAY);
+	red_delay.s.avg_dly = avg_dly;
+	cvmx_write_csr_node(node, CVMX_FPA_RED_DELAY, red_delay.u64);
+	return 0;
+}
+
+/**
+ * Gets the buffer size of the specified pool,
+ *
+ * @param aura Global aura number
+ * @return Returns size of the buffers in the specified pool.
+ */
+static inline int cvmx_fpa3_get_aura_buf_size(cvmx_fpa3_gaura_t

aura)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +8 -0
+{
+	cvmx_fpa3_pool_t pool;
+	cvmx_fpa_poolx_cfg_t pool_cfg;
+	int block_size;
+
+	pool = cvmx_fpa3_aura_to_pool(aura);
+
+	pool_cfg.u64 = cvmx_read_csr_node(pool.node,

CVMX_FPA_POOLX_CFG(pool.lpool));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +11 -0
+	block_size = pool_cfg.cn78xx.buf_size << 7;
+	return block_size;
+}
+
+/**
+ * Return the number of available buffers in an AURA
+ *
+ * @param aura to receive count for
+ * @return available buffer count
+ */
+static inline long long cvmx_fpa3_get_available(cvmx_fpa3_gaura_t

aura)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +11 -0
+{
+	cvmx_fpa3_pool_t pool;
+	cvmx_fpa_poolx_available_t avail_reg;
+	cvmx_fpa_aurax_cnt_t cnt_reg;
+	cvmx_fpa_aurax_cnt_limit_t limit_reg;
+	long long ret;
+
+	pool = cvmx_fpa3_aura_to_pool(aura);
+
+	/* Get POOL available buffer count */
+	avail_reg.u64 = cvmx_read_csr_node(pool.node,

CVMX_FPA_POOLX_AVAILABLE(pool.lpool));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +3 -0
+
+	/* Get AURA current available count */
+	cnt_reg.u64 = cvmx_read_csr_node(aura.node,

CVMX_FPA_AURAX_CNT(aura.laura));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+	limit_reg.u64 = cvmx_read_csr_node(aura.node,

CVMX_FPA_AURAX_CNT_LIMIT(aura.laura));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +8 -0
+
+	if (limit_reg.cn78xx.limit < cnt_reg.cn78xx.cnt)
+		return 0;
+
+	/* Calculate AURA-based buffer allowance */
+	ret = limit_reg.cn78xx.limit - cnt_reg.cn78xx.cnt;
+
+	/* Use POOL real buffer availability when less then allowance

*/

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +11 -0
+	if (ret > (long long)avail_reg.cn78xx.count)
+		ret = avail_reg.cn78xx.count;
+
+	return ret;
+}
+
+/**
+ * Configure the QoS parameters of an FPA3 AURA
+ *
+ * @param aura is the FPA3 AURA handle
+ * @param ena_bp enables backpressure when outstanding count exceeds

'bp_thresh'
+ * @param ena_red enables random early discard when outstanding count exceeds 'pass_thresh'
+ * @param pass_thresh is the maximum count to invoke flow control
+ * @param drop_thresh is the count threshold to begin dropping packets
+ * @param bp_thresh is the back-pressure threshold
+ *
+ */
+static inline void cvmx_fpa3_setup_aura_qos(cvmx_fpa3_gaura_t aura, bool ena_red, u64 pass_thresh,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+					    u64 drop_thresh, bool

ena_bp, u64 bp_thresh)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +11 -0
+{
+	unsigned int shift = 0;
+	u64 shift_thresh;
+	cvmx_fpa_aurax_cnt_limit_t limit_reg;
+	cvmx_fpa_aurax_cnt_levels_t aura_level;
+
+	if (!__cvmx_fpa3_aura_valid(aura))
+		return;
+
+	/* Get AURAX count limit for validation */
+	limit_reg.u64 = cvmx_read_csr_node(aura.node,

CVMX_FPA_AURAX_CNT_LIMIT(aura.laura));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +5 -0
+
+	if (pass_thresh < 256)
+		pass_thresh = 255;
+
+	if (drop_thresh <= pass_thresh || drop_thresh >

limit_reg.cn78xx.limit)

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +6 -0
+		drop_thresh = limit_reg.cn78xx.limit;
+
+	if (bp_thresh < 256 || bp_thresh > limit_reg.cn78xx.limit)
+		bp_thresh = limit_reg.cn78xx.limit >> 1;
+
+	shift_thresh = (bp_thresh > drop_thresh) ? bp_thresh :

drop_thresh;

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +2 -0
+
+	/* Calculate shift so that the largest threshold fits in 8 bits

*/

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +6 -0
+	for (shift = 0; shift < (1 << 6); shift++) {
+		if (0 == ((shift_thresh >> shift) & ~0xffull))
+			break;
+	};
+
+	aura_level.u64 = cvmx_read_csr_node(aura.node,

CVMX_FPA_AURAX_CNT_LEVELS(aura.laura));

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +7 -0
+	aura_level.s.pass = pass_thresh >> shift;
+	aura_level.s.drop = drop_thresh >> shift;
+	aura_level.s.bp = bp_thresh >> shift;
+	aura_level.s.shift = shift;
+	aura_level.s.red_ena = ena_red;
+	aura_level.s.bp_ena = ena_bp;
+	cvmx_write_csr_node(aura.node,

CVMX_FPA_AURAX_CNT_LEVELS(aura.laura), aura_level.u64);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +3 -0
+}
+
+cvmx_fpa3_gaura_t cvmx_fpa3_reserve_aura(int node, int

desired_aura_num);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +2 -0
+int cvmx_fpa3_release_aura(cvmx_fpa3_gaura_t aura);
+cvmx_fpa3_pool_t cvmx_fpa3_reserve_pool(int node, int

desired_pool_num);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +5 -0
+int cvmx_fpa3_release_pool(cvmx_fpa3_pool_t pool);
+int cvmx_fpa3_is_aura_available(int node, int aura_num);
+int cvmx_fpa3_is_pool_available(int node, int pool_num);
+
+cvmx_fpa3_pool_t cvmx_fpa3_setup_fill_pool(int node, int

desired_pool, const char *name,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+					   unsigned int block_size,

unsigned int num_blocks,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +8 -0
+					   void *buffer);
+
+/**
+ * Function to attach an aura to an existing pool
+ *
+ * @param node - configure fpa on this node
+ * @param pool - configured pool to attach aura to
+ * @param desired_aura - pointer to aura to use, set to -1 to

allocate
+ * @param name - name to register
+ * @param block_size - size of buffers to use
+ * @param num_blocks - number of blocks to allocate
+ *
+ * @return configured gaura on success, CVMX_FPA3_INVALID_GAURA on failure
+ */
+cvmx_fpa3_gaura_t cvmx_fpa3_set_aura_for_pool(cvmx_fpa3_pool_t pool, int desired_aura,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+					      const char *name,

unsigned int block_size,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +12 -0
+					      unsigned int num_blocks);
+
+/**
+ * Function to setup and initialize a pool.
+ *
+ * @param node - configure fpa on this node
+ * @param desired_aura - aura to use, -1 for dynamic allocation
+ * @param name - name to register
+ * @param block_size - size of buffers in pool
+ * @param num_blocks - max number of buffers allowed
+ */
+cvmx_fpa3_gaura_t cvmx_fpa3_setup_aura_and_pool(int node, int

desired_aura, const char *name,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+						void *buffer, unsigned

int block_size,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+						unsigned int

num_blocks);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +11 -0
+
+int cvmx_fpa3_shutdown_aura_and_pool(cvmx_fpa3_gaura_t aura);
+int cvmx_fpa3_shutdown_aura(cvmx_fpa3_gaura_t aura);
+int cvmx_fpa3_shutdown_pool(cvmx_fpa3_pool_t pool);
+const char *cvmx_fpa3_get_pool_name(cvmx_fpa3_pool_t pool);
+int cvmx_fpa3_get_pool_buf_size(cvmx_fpa3_pool_t pool);
+const char *cvmx_fpa3_get_aura_name(cvmx_fpa3_gaura_t aura);
+
+/* FIXME: Need a different macro for stage2 of u-boot */
+
+static inline void cvmx_fpa3_stage2_init(int aura, int pool, u64

stack_paddr, int stacklen,

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +6 -0
+					 int buffer_sz, int buf_cnt)
+{
+	cvmx_fpa_poolx_cfg_t pool_cfg;
+
+	/* Configure pool stack */
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_STACK_BASE(pool),

stack_paddr);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_STACK_ADDR(pool),

stack_paddr);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +1 -0
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_STACK_END(pool),

stack_paddr + stacklen);

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +27 -0
+
+	/* Configure pool with buffer size */
+	pool_cfg.u64 = 0;
+	pool_cfg.cn78xx.nat_align = 1;
+	pool_cfg.cn78xx.buf_size = buffer_sz >> 7;
+	pool_cfg.cn78xx.l_type = 0x2;
+	pool_cfg.cn78xx.ena = 0;
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_CFG(pool), pool_cfg.u64);
+	/* Reset pool before starting */
+	pool_cfg.cn78xx.ena = 1;
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_CFG(pool), pool_cfg.u64);
+
+	cvmx_write_csr_node(0, CVMX_FPA_AURAX_CFG(aura), 0);
+	cvmx_write_csr_node(0, CVMX_FPA_AURAX_CNT_ADD(aura), buf_cnt);
+	cvmx_write_csr_node(0, CVMX_FPA_AURAX_POOL(aura), (u64)pool);
+}
+
+static inline void cvmx_fpa3_stage2_disable(int aura, int pool)
+{
+	cvmx_write_csr_node(0, CVMX_FPA_AURAX_POOL(aura), 0);
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_CFG(pool), 0);
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_STACK_BASE(pool), 0);
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_STACK_ADDR(pool), 0);
+	cvmx_write_csr_node(0, CVMX_FPA_POOLX_STACK_END(pool), 0);
+}
+
+#endif /* __CVMX_FPA3_H__ */
(quoted diff) +0 -0

resources.h b/arch/mips/mach-octeon/include/mach/cvmx-global- resources.h
new file mode 100644
index 000000000000..28c32ddbe17a

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +12 -0
@@ -0,0 +1,213 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+#ifndef _CVMX_GLOBAL_RESOURCES_T_
+#define _CVMX_GLOBAL_RESOURCES_T_
+
+#define CVMX_GLOBAL_RESOURCES_DATA_NAME "cvmx-global-resources"
+
+/*In macros below abbreviation GR stands for global resources. */
+#define

CVMX_GR_TAG_INVALID

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('i', 'n', 'v', 'a', 'l', 'i', 'd', '.', '.',

'.', '.', '.', '.', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +3 -0
+			'.')
+/*Tag for pko que table range. */
+#define

CVMX_GR_TAG_PKO_QUEUES

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'p', 'k', 'o', '_', 'q',

'u', 'e', 'u', 's', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +3 -0
+			'.')
+/*Tag for a pko internal ports range */
+#define

CVMX_GR_TAG_PKO_IPORTS

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'p', 'k', 'o', '_', 'i',

'p', 'o', 'r', 't', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.')
+#define

CVMX_GR_TAG_FPA

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'f', 'p', 'a', '.', '.',

'.', '.', '.', '.', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.')
+#define

CVMX_GR_TAG_FAU

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'f', 'a', 'u', '.', '.',

'.', '.', '.', '.', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.')
+#define

CVMX_GR_TAG_SSO_GRP(n)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 's', 's', 'o', '_', '0',

(n) + '0', '.', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.');
+#define

CVMX_GR_TAG_TIM(n)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 't', 'i', 'm', '_', (n) +

'0', '.', '.', '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define

CVMX_GR_TAG_CLUSTERS(x)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'c', 'l', 'u', 's', 't',

'e', 'r', '_', (x + '0'), \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define

CVMX_GR_TAG_CLUSTER_GRP(x)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'c', 'l', 'g', 'r', 'p',

'_', (x + '0'), '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define

CVMX_GR_TAG_STYLE(x)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 's', 't', 'y', 'l', 'e',

'_', (x + '0'), '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define

CVMX_GR_TAG_QPG_ENTRY(x)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'q', 'p', 'g', 'e', 't',

'_', (x + '0'), '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define

CVMX_GR_TAG_BPID(x)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'b', 'p', 'i', 'd', 's',

'_', (x + '0'), '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define

CVMX_GR_TAG_MTAG_IDX(x)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'm', 't', 'a', 'g', 'x',

'_', (x + '0'), '.', '.', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			'.', '.', '.')
+#define CVMX_GR_TAG_PCAM(x, y,

z) \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +5 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'p', 'c', 'a', 'm', '_', (x
+ '0'), (y + '0'),         \
+			(z + '0'), '.', '.', '.', '.')
+
+#define

CVMX_GR_TAG_CIU3_IDT(_n)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'c', 'i', 'u', '3', '_',

((_n) + '0'), '_', 'i', 'd', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +3 -0
+			't', '.', '.')
+
+/* Allocation of the 512 SW INTSTs (in the  12 bit SW INTSN space)

*/
+#define
CVMX_GR_TAG_CIU3_SWINTSN(_n)

                       \
arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	cvmx_get_gr_tag('c', 'v', 'm', '_', 'c', 'i', 'u', '3', '_',

((_n) + '0'), '_', 's', 'w', \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +3 -0
+			'i', 's', 'n')
+
+#define TAG_INIT_PART(A, B, C, D, E, F, G,

H) \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	((((u64)(A) & 0xff) << 56) | (((u64)(B) & 0xff) << 48) |

(((u64)(C) & 0xff) << 40) | \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+	 (((u64)(D) & 0xff) << 32) | (((u64)(E) & 0xff) << 24) |

(((u64)(F) & 0xff) << 16) | \

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +8 -0
+	 (((u64)(G) & 0xff) << 8) | (((u64)(H) & 0xff)))
+
+struct global_resource_tag {
+	u64 lo;
+	u64 hi;
+};
+
+enum cvmx_resource_err { CVMX_RESOURCE_ALLOC_FAILED = -1,

CVMX_RESOURCE_ALREADY_RESERVED = -2 };

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +6 -0
+
+/*
+ * @INTERNAL
+ * Creates a tag from the specified characters.
+ */
+static inline struct global_resource_tag cvmx_get_gr_tag(char a,

char b, char c, char d, char e,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+							 char f, char

g, char h, char i, char j,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +1 -0
+							 char k, char

l, char m, char n, char o,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +10 -0
+							 char p)
+{
+	struct global_resource_tag tag;
+
+	tag.lo = TAG_INIT_PART(a, b, c, d, e, f, g, h);
+	tag.hi = TAG_INIT_PART(i, j, k, l, m, n, o, p);
+	return tag;
+}
+
+static inline int cvmx_gr_same_tag(struct global_resource_tag gr1,

struct global_resource_tag gr2)

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +7 -0
+{
+	return (gr1.hi == gr2.hi) && (gr1.lo == gr2.lo);
+}
+
+/*
+ * @INTERNAL
+ * Creates a global resource range that can hold the specified

number of
+ * elements
+ * @param tag is the tag of the range. The taga is created using the method
+ * cvmx_get_gr_tag()
+ * @param nelements is the number of elements to be held in the resource range.
+ */
+int cvmx_create_global_resource_range(struct global_resource_tag tag, int nelements);

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +4 -0
+
+/*
+ * @INTERNAL
+ * Allocate nelements in the global resource range with the

specified tag. It
+ * is assumed that prior
+ * to calling this the global resource range has already been created using
+ * cvmx_create_global_resource_range().
+ * @param tag is the tag of the global resource range.
+ * @param nelements is the number of elements to be allocated.
+ * @param owner is a 64 bit number that identifes the owner of this range.
+ * @aligment specifes the required alignment of the returned base number.
+ * @return returns the base of the allocated range. -1 return value indicates
+ * failure.
+ */
+int cvmx_allocate_global_resource_range(struct global_resource_tag tag, u64 owner, int nelements,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +5 -0
+					int alignment);
+
+/*
+ * @INTERNAL
+ * Allocate nelements in the global resource range with the

specified tag.
+ * The elements allocated need not be contiguous. It is assumed that prior to
+ * calling this the global resource range has already
+ * been created using cvmx_create_global_resource_range().
+ * @param tag is the tag of the global resource range.
+ * @param nelements is the number of elements to be allocated.
+ * @param owner is a 64 bit number that identifes the owner of the allocated
+ * elements.
+ * @param allocated_elements returns indexs of the allocated entries.
+ * @return returns 0 on success and -1 on failure.
+ */
+int cvmx_resource_alloc_many(struct global_resource_tag tag, u64 owner, int nelements,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +2 -0
+			     int allocated_elements[]);
+int cvmx_resource_alloc_reverse(struct global_resource_tag, u64

owner);
+/*
+ * @INTERNAL
+ * Reserve nelements starting from base in the global resource range with the
+ * specified tag.
+ * It is assumed that prior to calling this the global resource range has
+ * already been created using cvmx_create_global_resource_range().
+ * @param tag is the tag of the global resource range.
+ * @param nelements is the number of elements to be allocated.
+ * @param owner is a 64 bit number that identifes the owner of this range.
+ * @base specifies the base start of nelements.
+ * @return returns the base of the allocated range. -1 return value indicates
+ * failure.
+ */
+int cvmx_reserve_global_resource_range(struct global_resource_tag tag, u64 owner, int base,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +4 -0
+				       int nelements);
+/*
+ * @INTERNAL
+ * Free nelements starting at base in the global resource range with

the
+ * specified tag.
+ * @param tag is the tag of the global resource range.
+ * @param base is the base number
+ * @param nelements is the number of elements that are to be freed.
+ * @return returns 0 if successful and -1 on failure.
+ */
+int cvmx_free_global_resource_range_with_base(struct global_resource_tag tag, int base,

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +12 -0
+					      int nelements);
+
+/*
+ * @INTERNAL
+ * Free nelements with the bases specified in bases[] with the
+ * specified tag.
+ * @param tag is the tag of the global resource range.
+ * @param bases is an array containing the bases to be freed.
+ * @param nelements is the number of elements that are to be freed.
+ * @return returns 0 if successful and -1 on failure.
+ */
+int cvmx_free_global_resource_range_multiple(struct

global_resource_tag tag, int bases[],

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +4 -0
+					     int nelements);
+/*
+ * @INTERNAL
+ * Free elements from the specified owner in the global resource

range with the
+ * specified tag.
+ * @param tag is the tag of the global resource range.
+ * @param owner is the owner of resources that are to be freed.
+ * @return returns 0 if successful and -1 on failure.
+ */
+int cvmx_free_global_resource_range_with_owner(struct global_resource_tag tag, int owner);

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +5 -0
+
+/*
+ * @INTERNAL
+ * Frees all the global resources that have been created.
+ * For use only from the bootloader, when it shutdown and boots up

the
+ * application or kernel.
+ */

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +3 -0
+int free_global_resources(void);
+
+u64 cvmx_get_global_resource_owner(struct global_resource_tag tag,

int base);
+/*
+ * @INTERNAL
+ * Shows the global resource range with the specified tag. Use mainly for debug.
+ */
+void cvmx_show_global_resource_range(struct global_resource_tag tag);

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +11 -0
+
+/*
+ * @INTERNAL
+ * Shows all the global resources. Used mainly for debug.
+ */
+void cvmx_global_resources_show(void);
+
+u64 cvmx_allocate_app_id(void);
+u64 cvmx_get_app_id(void);
+
+#endif
arch/mips/mach-octeon/include/mach/cvmx-gmx.h new file +13 -0
new file mode 100644
index 000000000000..2df7da102a0f
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the GMX hardware.
+ */
+
+#ifndef __CVMX_GMX_H__
+#define __CVMX_GMX_H__
+
+/* CSR typedefs have been moved to cvmx-gmx-defs.h */
+
+int cvmx_gmx_set_backpressure_override(u32 interface, u32

port_mask);
+int cvmx_agl_set_backpressure_override(u32 interface, u32 port_mask);

arch/mips/mach-octeon/include/mach/cvmx-gmx.h new file +2 -0
+
+#endif
arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +108 -0
new file mode 100644
index 000000000000..59772190aa3b
@@ -0,0 +1,606 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the hardware Fetch and Add Unit.
+ */
+
+/**
+ * @file
+ *
+ * Interface to the hardware Fetch and Add Unit.
+ *
+ */
+
+#ifndef __CVMX_HWFAU_H__
+#define __CVMX_HWFAU_H__
+
+typedef int cvmx_fau_reg64_t;
+typedef int cvmx_fau_reg32_t;
+typedef int cvmx_fau_reg16_t;
+typedef int cvmx_fau_reg8_t;
+
+#define CVMX_FAU_REG_ANY -1
+
+/*
+ * Octeon Fetch and Add Unit (FAU)
+ */
+
+#define CVMX_FAU_LOAD_IO_ADDRESS cvmx_build_io_address(0x1e, 0)
+#define CVMX_FAU_BITS_SCRADDR	 63, 56
+#define CVMX_FAU_BITS_LEN	 55, 48
+#define CVMX_FAU_BITS_INEVAL	 35, 14
+#define CVMX_FAU_BITS_TAGWAIT	 13, 13
+#define CVMX_FAU_BITS_NOADD	 13, 13
+#define CVMX_FAU_BITS_SIZE	 12, 11
+#define CVMX_FAU_BITS_REGISTER	 10, 0
+
+#define CVMX_FAU_MAX_REGISTERS_8 (2048)
+
+typedef enum {
+	CVMX_FAU_OP_SIZE_8 = 0,
+	CVMX_FAU_OP_SIZE_16 = 1,
+	CVMX_FAU_OP_SIZE_32 = 2,
+	CVMX_FAU_OP_SIZE_64 = 3
+} cvmx_fau_op_size_t;
+
+/**
+ * Tagwait return definition. If a timeout occurs, the error
+ * bit will be set. Otherwise the value of the register before
+ * the update will be returned.
+ */
+typedef struct {
+	u64 error : 1;
+	s64 value : 63;
+} cvmx_fau_tagwait64_t;
+
+/**
+ * Tagwait return definition. If a timeout occurs, the error
+ * bit will be set. Otherwise the value of the register before
+ * the update will be returned.
+ */
+typedef struct {
+	u64 error : 1;
+	s32 value : 31;
+} cvmx_fau_tagwait32_t;
+
+/**
+ * Tagwait return definition. If a timeout occurs, the error
+ * bit will be set. Otherwise the value of the register before
+ * the update will be returned.
+ */
+typedef struct {
+	u64 error : 1;
+	s16 value : 15;
+} cvmx_fau_tagwait16_t;
+
+/**
+ * Tagwait return definition. If a timeout occurs, the error
+ * bit will be set. Otherwise the value of the register before
+ * the update will be returned.
+ */
+typedef struct {
+	u64 error : 1;
+	int8_t value : 7;
+} cvmx_fau_tagwait8_t;
+
+/**
+ * Asynchronous tagwait return definition. If a timeout occurs,
+ * the error bit will be set. Otherwise the value of the
+ * register before the update will be returned.
+ */
+typedef union {
+	u64 u64;
+	struct {
+		u64 invalid : 1;
+		u64 data : 63; /* unpredictable if invalid is set */
+	} s;
+} cvmx_fau_async_tagwait_result_t;
+
+#define SWIZZLE_8  0
+#define SWIZZLE_16 0
+#define SWIZZLE_32 0
+
+/**
+ * @INTERNAL
+ * Builds a store I/O address for writing to the FAU
+ *
+ * @param noadd  0 = Store value is atomically added to the current

value
+ * 1 = Store value is atomically written over the
current value

+ * @param reg    FAU atomic register to access. 0 <= reg < 2048.
+ *               - Step by 2 for 16 bit access.
+ *               - Step by 4 for 32 bit access.
+ *               - Step by 8 for 64 bit access.

+ * @return Address to store for atomic update
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +12 -0
+static inline u64 __cvmx_hwfau_store_address(u64 noadd, u64 reg)
+{
+	return (CVMX_ADD_IO_SEG(CVMX_FAU_LOAD_IO_ADDRESS) |
+		cvmx_build_bits(CVMX_FAU_BITS_NOADD, noadd) |
+		cvmx_build_bits(CVMX_FAU_BITS_REGISTER, reg));
+}
+
+/**
+ * @INTERNAL
+ * Builds a I/O address for accessing the FAU
+ *
+ * @param tagwait Should the atomic add wait for the current tag

switch

+ *                operation to complete.
+ *                - 0 = Don't wait
+ *                - 1 = Wait for tag switch to complete
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ *                - Step by 4 for 32 bit access.
+ *                - Step by 8 for 64 bit access.
+ * @param value   Signed value to add.
+ *                Note: When performing 32 and 64 bit access, only

the low
+ * 22 bits are available.
+ * @return Address to read from for atomic update
+ */
+static inline u64 __cvmx_hwfau_atomic_address(u64 tagwait, u64 reg, s64 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +17 -0
+{
+	return (CVMX_ADD_IO_SEG(CVMX_FAU_LOAD_IO_ADDRESS) |
+		cvmx_build_bits(CVMX_FAU_BITS_INEVAL, value) |
+		cvmx_build_bits(CVMX_FAU_BITS_TAGWAIT, tagwait) |
+		cvmx_build_bits(CVMX_FAU_BITS_REGISTER, reg));
+}
+
+/**
+ * Perform an atomic 64 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 8 for 64 bit access.
+ * @param value   Signed value to add.
+ *                Note: Only the low 22 bits are available.
+ * @return Value of the register before the update
+ */
+static inline s64 cvmx_hwfau_fetch_and_add64(cvmx_fau_reg64_t reg,

s64 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	return cvmx_read64_int64(__cvmx_hwfau_atomic_address(0, reg,

value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +12 -0
+}
+
+/**
+ * Perform an atomic 32 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 4 for 32 bit access.
+ * @param value   Signed value to add.
+ *                Note: Only the low 22 bits are available.
+ * @return Value of the register before the update
+ */
+static inline s32 cvmx_hwfau_fetch_and_add32(cvmx_fau_reg32_t reg,

s32 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +3 -0
+{
+	reg ^= SWIZZLE_32;
+	return cvmx_read64_int32(__cvmx_hwfau_atomic_address(0, reg,

value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +11 -0
+}
+
+/**
+ * Perform an atomic 16 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ * @param value   Signed value to add.
+ * @return Value of the register before the update
+ */
+static inline s16 cvmx_hwfau_fetch_and_add16(cvmx_fau_reg16_t reg,

s16 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +3 -0
+{
+	reg ^= SWIZZLE_16;
+	return cvmx_read64_int16(__cvmx_hwfau_atomic_address(0, reg,

value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +10 -0
+}
+
+/**
+ * Perform an atomic 8 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ * @param value   Signed value to add.
+ * @return Value of the register before the update
+ */
+static inline int8_t cvmx_hwfau_fetch_and_add8(cvmx_fau_reg8_t reg,

int8_t value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +3 -0
+{
+	reg ^= SWIZZLE_8;
+	return cvmx_read64_int8(__cvmx_hwfau_atomic_address(0, reg,

value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +15 -0
+}
+
+/**
+ * Perform an atomic 64 bit add after the current tag switch
+ * completes
+ *
+ * @param reg    FAU atomic register to access. 0 <= reg < 2048.
+ *               - Step by 8 for 64 bit access.
+ * @param value  Signed value to add.
+ *               Note: Only the low 22 bits are available.
+ * @return If a timeout occurs, the error bit will be set. Otherwise
+ *         the value of the register before the update will be
+ *         returned
+ */
+static inline cvmx_fau_tagwait64_t

cvmx_hwfau_tagwait_fetch_and_add64(cvmx_fau_reg64_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +1 -0
+								      s

64 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +6 -0
+{
+	union {
+		u64 i64;
+		cvmx_fau_tagwait64_t t;
+	} result;
+	result.i64 = cvmx_read64_int64(__cvmx_hwfau_atomic_address(1,

reg, value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +16 -0
+	return result.t;
+}
+
+/**
+ * Perform an atomic 32 bit add after the current tag switch
+ * completes
+ *
+ * @param reg    FAU atomic register to access. 0 <= reg < 2048.
+ *               - Step by 4 for 32 bit access.
+ * @param value  Signed value to add.
+ *               Note: Only the low 22 bits are available.
+ * @return If a timeout occurs, the error bit will be set. Otherwise
+ *         the value of the register before the update will be
+ *         returned
+ */
+static inline cvmx_fau_tagwait32_t

cvmx_hwfau_tagwait_fetch_and_add32(cvmx_fau_reg32_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +1 -0
+								      s

32 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +7 -0
+{
+	union {
+		u64 i32;
+		cvmx_fau_tagwait32_t t;
+	} result;
+	reg ^= SWIZZLE_32;
+	result.i32 = cvmx_read64_int32(__cvmx_hwfau_atomic_address(1,

reg, value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +15 -0
+	return result.t;
+}
+
+/**
+ * Perform an atomic 16 bit add after the current tag switch
+ * completes
+ *
+ * @param reg    FAU atomic register to access. 0 <= reg < 2048.
+ *               - Step by 2 for 16 bit access.
+ * @param value  Signed value to add.
+ * @return If a timeout occurs, the error bit will be set. Otherwise
+ *         the value of the register before the update will be
+ *         returned
+ */
+static inline cvmx_fau_tagwait16_t

cvmx_hwfau_tagwait_fetch_and_add16(cvmx_fau_reg16_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +1 -0
+								      s

16 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +7 -0
+{
+	union {
+		u64 i16;
+		cvmx_fau_tagwait16_t t;
+	} result;
+	reg ^= SWIZZLE_16;
+	result.i16 = cvmx_read64_int16(__cvmx_hwfau_atomic_address(1,

reg, value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +14 -0
+	return result.t;
+}
+
+/**
+ * Perform an atomic 8 bit add after the current tag switch
+ * completes
+ *
+ * @param reg    FAU atomic register to access. 0 <= reg < 2048.
+ * @param value  Signed value to add.
+ * @return If a timeout occurs, the error bit will be set. Otherwise
+ *         the value of the register before the update will be
+ *         returned
+ */
+static inline cvmx_fau_tagwait8_t

cvmx_hwfau_tagwait_fetch_and_add8(cvmx_fau_reg8_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +1 -0
+								    int

8_t value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +7 -0
+{
+	union {
+		u64 i8;
+		cvmx_fau_tagwait8_t t;
+	} result;
+	reg ^= SWIZZLE_8;
+	result.i8 = cvmx_read64_int8(__cvmx_hwfau_atomic_address(1,

reg, value));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +8 -0
+	return result.t;
+}
+
+/**
+ * @INTERNAL
+ * Builds I/O data for async operations
+ *
+ * @param scraddr Scratch pad byte address to write to.  Must be 8

byte aligned
+ * @param value Signed value to add.
+ * Note: When performing 32 and 64 bit access, only
the low
+ * 22 bits are available.
+ * @param tagwait Should the atomic add wait for the current tag switch

+ *                operation to complete.
+ *                - 0 = Don't wait
+ *                - 1 = Wait for tag switch to complete
+ * @param size    The size of the operation:
+ *                - CVMX_FAU_OP_SIZE_8  (0) = 8 bits
+ *                - CVMX_FAU_OP_SIZE_16 (1) = 16 bits
+ *                - CVMX_FAU_OP_SIZE_32 (2) = 32 bits
+ *                - CVMX_FAU_OP_SIZE_64 (3) = 64 bits
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ *                - Step by 4 for 32 bit access.
+ *                - Step by 8 for 64 bit access.

+ * @return Data to write using cvmx_send_single
+ */
+static inline u64 __cvmx_fau_iobdma_data(u64 scraddr, s64 value, u64 tagwait,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +1 -0
+					 cvmx_fau_op_size_t size, u64

reg)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	return (CVMX_FAU_LOAD_IO_ADDRESS |

cvmx_build_bits(CVMX_FAU_BITS_SCRADDR, scraddr >> 3) |

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +20 -0
+		cvmx_build_bits(CVMX_FAU_BITS_LEN, 1) |
+		cvmx_build_bits(CVMX_FAU_BITS_INEVAL, value) |
+		cvmx_build_bits(CVMX_FAU_BITS_TAGWAIT, tagwait) |
+		cvmx_build_bits(CVMX_FAU_BITS_SIZE, size) |
+		cvmx_build_bits(CVMX_FAU_BITS_REGISTER, reg));
+}
+
+/**
+ * Perform an async atomic 64 bit add. The old value is
+ * placed in the scratch memory at byte address scraddr.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 8 for 64 bit access.
+ * @param value   Signed value to add.
+ *                Note: Only the low 22 bits are available.
+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_fetch_and_add64(u64 scraddr,

cvmx_fau_reg64_t reg, s64 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 0,

CVMX_FAU_OP_SIZE_64, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +15 -0
+}
+
+/**
+ * Perform an async atomic 32 bit add. The old value is
+ * placed in the scratch memory at byte address scraddr.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 4 for 32 bit access.
+ * @param value   Signed value to add.
+ *                Note: Only the low 22 bits are available.
+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_fetch_and_add32(u64 scraddr,

cvmx_fau_reg32_t reg, s32 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 0,

CVMX_FAU_OP_SIZE_32, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +14 -0
+}
+
+/**
+ * Perform an async atomic 16 bit add. The old value is
+ * placed in the scratch memory at byte address scraddr.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ * @param value   Signed value to add.
+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_fetch_and_add16(u64 scraddr,

cvmx_fau_reg16_t reg, s16 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 0,

CVMX_FAU_OP_SIZE_16, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +13 -0
+}
+
+/**
+ * Perform an async atomic 8 bit add. The old value is
+ * placed in the scratch memory at byte address scraddr.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ * @param value   Signed value to add.
+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_fetch_and_add8(u64 scraddr,

cvmx_fau_reg8_t reg, int8_t value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 0,

CVMX_FAU_OP_SIZE_8, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +9 -0
+}
+
+/**
+ * Perform an async atomic 64 bit add after the current tag
+ * switch completes.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ *                If a timeout occurs, the error bit (63) will be

set. Otherwise
+ * the value of the register before the update will
be

+ *                returned
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 8 for 64 bit access.
+ * @param value   Signed value to add.
+ *                Note: Only the low 22 bits are available.

+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_tagwait_fetch_and_add64(u64 scraddr, cvmx_fau_reg64_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +3 -0
+							    s64 value)
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 1,

CVMX_FAU_OP_SIZE_64, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +9 -0
+}
+
+/**
+ * Perform an async atomic 32 bit add after the current tag
+ * switch completes.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ *                If a timeout occurs, the error bit (63) will be

set. Otherwise
+ * the value of the register before the update will
be

+ *                returned
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 4 for 32 bit access.
+ * @param value   Signed value to add.
+ *                Note: Only the low 22 bits are available.

+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_tagwait_fetch_and_add32(u64 scraddr, cvmx_fau_reg32_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +3 -0
+							    s32 value)
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 1,

CVMX_FAU_OP_SIZE_32, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +9 -0
+}
+
+/**
+ * Perform an async atomic 16 bit add after the current tag
+ * switch completes.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ *                If a timeout occurs, the error bit (63) will be

set. Otherwise
+ * the value of the register before the update will
be

+ *                returned
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ * @param value   Signed value to add.

+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_tagwait_fetch_and_add16(u64 scraddr, cvmx_fau_reg16_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +3 -0
+							    s16 value)
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 1,

CVMX_FAU_OP_SIZE_16, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +9 -0
+}
+
+/**
+ * Perform an async atomic 8 bit add after the current tag
+ * switch completes.
+ *
+ * @param scraddr Scratch memory byte address to put response in.
+ *                Must be 8 byte aligned.
+ *                If a timeout occurs, the error bit (63) will be

set. Otherwise
+ * the value of the register before the update will
be

+ *                returned
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ * @param value   Signed value to add.

+ * @return Placed in the scratch pad register
+ */
+static inline void cvmx_hwfau_async_tagwait_fetch_and_add8(u64 scraddr, cvmx_fau_reg8_t reg,

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +1 -0
+							   int8_t

value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +2 -0
+{
+	cvmx_send_single(__cvmx_fau_iobdma_data(scraddr, value, 1,

CVMX_FAU_OP_SIZE_8, reg));

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +10 -0
+}
+
+/**
+ * Perform an atomic 64 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 8 for 64 bit access.
+ * @param value   Signed value to add.
+ */
+static inline void cvmx_hwfau_atomic_add64(cvmx_fau_reg64_t reg, s64

value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +12 -0
+{
+	cvmx_write64_int64(__cvmx_hwfau_store_address(0, reg), value);
+}
+
+/**
+ * Perform an atomic 32 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 4 for 32 bit access.
+ * @param value   Signed value to add.
+ */
+static inline void cvmx_hwfau_atomic_add32(cvmx_fau_reg32_t reg, s32

value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +13 -0
+{
+	reg ^= SWIZZLE_32;
+	cvmx_write64_int32(__cvmx_hwfau_store_address(0, reg), value);
+}
+
+/**
+ * Perform an atomic 16 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ * @param value   Signed value to add.
+ */
+static inline void cvmx_hwfau_atomic_add16(cvmx_fau_reg16_t reg, s16

value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +12 -0
+{
+	reg ^= SWIZZLE_16;
+	cvmx_write64_int16(__cvmx_hwfau_store_address(0, reg), value);
+}
+
+/**
+ * Perform an atomic 8 bit add
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ * @param value   Signed value to add.
+ */
+static inline void cvmx_hwfau_atomic_add8(cvmx_fau_reg8_t reg,

int8_t value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +13 -0
+{
+	reg ^= SWIZZLE_8;
+	cvmx_write64_int8(__cvmx_hwfau_store_address(0, reg), value);
+}
+
+/**
+ * Perform an atomic 64 bit write
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 8 for 64 bit access.
+ * @param value   Signed value to write.
+ */
+static inline void cvmx_hwfau_atomic_write64(cvmx_fau_reg64_t reg,

s64 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +12 -0
+{
+	cvmx_write64_int64(__cvmx_hwfau_store_address(1, reg), value);
+}
+
+/**
+ * Perform an atomic 32 bit write
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 4 for 32 bit access.
+ * @param value   Signed value to write.
+ */
+static inline void cvmx_hwfau_atomic_write32(cvmx_fau_reg32_t reg,

s32 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +13 -0
+{
+	reg ^= SWIZZLE_32;
+	cvmx_write64_int32(__cvmx_hwfau_store_address(1, reg), value);
+}
+
+/**
+ * Perform an atomic 16 bit write
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ *                - Step by 2 for 16 bit access.
+ * @param value   Signed value to write.
+ */
+static inline void cvmx_hwfau_atomic_write16(cvmx_fau_reg16_t reg,

s16 value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +12 -0
+{
+	reg ^= SWIZZLE_16;
+	cvmx_write64_int16(__cvmx_hwfau_store_address(1, reg), value);
+}
+
+/**
+ * Perform an atomic 8 bit write
+ *
+ * @param reg     FAU atomic register to access. 0 <= reg < 2048.
+ * @param value   Signed value to write.
+ */
+static inline void cvmx_hwfau_atomic_write8(cvmx_fau_reg8_t reg,

int8_t value)

arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +36 -0
+{
+	reg ^= SWIZZLE_8;
+	cvmx_write64_int8(__cvmx_hwfau_store_address(1, reg), value);
+}
+
+/** Allocates 64bit FAU register.
+ *  @return value is the base address of allocated FAU register
+ */
+int cvmx_fau64_alloc(int reserve);
+
+/** Allocates 32bit FAU register.
+ *  @return value is the base address of allocated FAU register
+ */
+int cvmx_fau32_alloc(int reserve);
+
+/** Allocates 16bit FAU register.
+ *  @return value is the base address of allocated FAU register
+ */
+int cvmx_fau16_alloc(int reserve);
+
+/** Allocates 8bit FAU register.
+ *  @return value is the base address of allocated FAU register
+ */
+int cvmx_fau8_alloc(int reserve);
+
+/** Frees the specified FAU register.
+ *  @param address Base address of register to release.
+ *  @return 0 on success; -1 on failure
+ */
+int cvmx_fau_free(int address);
+
+/** Display the fau registers array
+ */
+void cvmx_fau_show(void);
+
+#endif /* __CVMX_HWFAU_H__ */
arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +43 -0
new file mode 100644
index 000000000000..459c19bbc0f1
@@ -0,0 +1,570 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the hardware Packet Output unit.
+ *
+ * Starting with SDK 1.7.0, the PKO output functions now support
+ * two types of locking. CVMX_PKO_LOCK_ATOMIC_TAG continues to
+ * function similarly to previous SDKs by using POW atomic tags
+ * to preserve ordering and exclusivity. As a new option, you
+ * can now pass CVMX_PKO_LOCK_CMD_QUEUE which uses a ll/sc
+ * memory based locking instead. This locking has the advantage
+ * of not affecting the tag state but doesn't preserve packet
+ * ordering. CVMX_PKO_LOCK_CMD_QUEUE is appropriate in most
+ * generic code while CVMX_PKO_LOCK_CMD_QUEUE should be used
+ * with hand tuned fast path code.
+ *
+ * Some of other SDK differences visible to the command command
+ * queuing:
+ * - PKO indexes are no longer stored in the FAU. A large
+ *   percentage of the FAU register block used to be tied up
+ *   maintaining PKO queue pointers. These are now stored in a
+ *   global named block.
+ * - The PKO <b>use_locking</b> parameter can now have a global
+ *   effect. Since all application use the same named block,
+ *   queue locking correctly applies across all operating
+ *   systems when using CVMX_PKO_LOCK_CMD_QUEUE.
+ * - PKO 3 word commands are now supported. Use
+ *   cvmx_pko_send_packet_finish3().
+ */
+
+#ifndef __CVMX_HWPKO_H__
+#define __CVMX_HWPKO_H__
+
+#include "cvmx-hwfau.h"
+#include "cvmx-fpa.h"
+#include "cvmx-pow.h"
+#include "cvmx-cmd-queue.h"
+#include "cvmx-helper.h"
+#include "cvmx-helper-util.h"
+#include "cvmx-helper-cfg.h"
+
+/* Adjust the command buffer size by 1 word so that in the case of

using only
+** two word PKO commands no command words stradle buffers. The useful values

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0
+** for this are 0 and 1. */
+#define CVMX_PKO_COMMAND_BUFFER_SIZE_ADJUST (1)
+
+#define CVMX_PKO_MAX_OUTPUT_QUEUES_STATIC 256
+#define

CVMX_PKO_MAX_OUTPUT_QUEUES

                       \
arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+	((OCTEON_IS_OCTEON2() || OCTEON_IS_MODEL(OCTEON_CN70XX)) ? 256

: 128)
+#define
CVMX_PKO_NUM_OUTPUT_PORTS

                       \
arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+	((OCTEON_IS_MODEL(OCTEON_CN63XX)) ? 44 :

(OCTEON_IS_MODEL(OCTEON_CN66XX) ? 48 : 40))

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +17 -0
+#define CVMX_PKO_MEM_QUEUE_PTRS_ILLEGAL_PID 63
+#define CVMX_PKO_QUEUE_STATIC_PRIORITY	    9
+#define CVMX_PKO_ILLEGAL_QUEUE		    0xFFFF
+#define CVMX_PKO_MAX_QUEUE_DEPTH	    0
+
+typedef enum {
+	CVMX_PKO_SUCCESS,
+	CVMX_PKO_INVALID_PORT,
+	CVMX_PKO_INVALID_QUEUE,
+	CVMX_PKO_INVALID_PRIORITY,
+	CVMX_PKO_NO_MEMORY,
+	CVMX_PKO_PORT_ALREADY_SETUP,
+	CVMX_PKO_CMD_QUEUE_INIT_ERROR
+} cvmx_pko_return_value_t;
+
+/**
+ * This enumeration represents the differnet locking modes supported

by PKO.
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +86 -0
+typedef enum {
+	CVMX_PKO_LOCK_NONE = 0,
+	CVMX_PKO_LOCK_ATOMIC_TAG = 1,
+	CVMX_PKO_LOCK_CMD_QUEUE = 2,
+} cvmx_pko_lock_t;
+
+typedef struct cvmx_pko_port_status {
+	u32 packets;
+	u64 octets;
+	u64 doorbell;
+} cvmx_pko_port_status_t;
+
+/**
+ * This structure defines the address to use on a packet enqueue
+ */
+typedef union {
+	u64 u64;
+	struct {
+		cvmx_mips_space_t mem_space : 2;
+		u64 reserved : 13;
+		u64 is_io : 1;
+		u64 did : 8;
+		u64 reserved2 : 4;
+		u64 reserved3 : 15;
+		u64 port : 9;
+		u64 queue : 9;
+		u64 reserved4 : 3;
+	} s;
+} cvmx_pko_doorbell_address_t;
+
+/**
+ * Structure of the first packet output command word.
+ */
+typedef union {
+	u64 u64;
+	struct {
+		cvmx_fau_op_size_t size1 : 2;
+		cvmx_fau_op_size_t size0 : 2;
+		u64 subone1 : 1;
+		u64 reg1 : 11;
+		u64 subone0 : 1;
+		u64 reg0 : 11;
+		u64 le : 1;
+		u64 n2 : 1;
+		u64 wqp : 1;
+		u64 rsp : 1;
+		u64 gather : 1;
+		u64 ipoffp1 : 7;
+		u64 ignore_i : 1;
+		u64 dontfree : 1;
+		u64 segs : 6;
+		u64 total_bytes : 16;
+	} s;
+} cvmx_pko_command_word0_t;
+
+/**
+ * Call before any other calls to initialize the packet
+ * output system.
+ */
+
+void cvmx_pko_hw_init(u8 pool, unsigned int bufsize);
+
+/**
+ * Enables the packet output hardware. It must already be
+ * configured.
+ */
+void cvmx_pko_enable(void);
+
+/**
+ * Disables the packet output. Does not affect any configuration.
+ */
+void cvmx_pko_disable(void);
+
+/**
+ * Shutdown and free resources required by packet output.
+ */
+
+void cvmx_pko_shutdown(void);
+
+/**
+ * Configure a output port and the associated queues for use.
+ *
+ * @param port       Port to configure.
+ * @param base_queue First queue number to associate with this port.
+ * @param num_queues Number of queues t oassociate with this port
+ * @param priority   Array of priority levels for each queue. Values

are
+ * allowed to be 1-8. A value of 8 get 8 times the
traffic
+ * of a value of 1. There must be num_queues
elements in the
+ * array.
+ */
+cvmx_pko_return_value_t cvmx_pko_config_port(int port, int base_queue, int num_queues,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +14 -0
+					     const u8 priority[]);
+
+/**
+ * Ring the packet output doorbell. This tells the packet
+ * output hardware that "len" command words have been added
+ * to its pending list.  This command includes the required
+ * CVMX_SYNCWS before the doorbell ring.
+ *
+ * WARNING: This function may have to look up the proper PKO port in
+ * the IPD port to PKO port map, and is thus slower than calling
+ * cvmx_pko_doorbell_pkoid() directly if the PKO port identifier is
+ * known.
+ *
+ * @param ipd_port   The IPD port corresponding the to pko port the

packet is for
+ * @param queue Queue the packet is for
+ * @param len Length of the command in 64 bit words
+ */
+static inline void cvmx_pko_doorbell(u64 ipd_port, u64 queue, u64 len)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +15 -0
+{
+	cvmx_pko_doorbell_address_t ptr;
+	u64 pko_port;
+
+	pko_port = ipd_port;
+	if (octeon_has_feature(OCTEON_FEATURE_PKND))
+		pko_port = cvmx_helper_cfg_ipd2pko_port_base(ipd_port);
+
+	ptr.u64 = 0;
+	ptr.s.mem_space = CVMX_IO_SEG;
+	ptr.s.did = CVMX_OCT_DID_PKT_SEND;
+	ptr.s.is_io = 1;
+	ptr.s.port = pko_port;
+	ptr.s.queue = queue;
+	/* Need to make sure output queue data is in DRAM before

doorbell write */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +10 -0
+	CVMX_SYNCWS;
+	cvmx_write_io(ptr.u64, len);
+}
+
+/**
+ * Prepare to send a packet.  This may initiate a tag switch to
+ * get exclusive access to the output queue structure, and
+ * performs other prep work for the packet send operation.
+ *
+ * cvmx_pko_send_packet_finish() MUST be called after this function

is called,
+ * and must be called with the same port/queue/use_locking arguments.
+ *
+ * The use_locking parameter allows the caller to use three
+ * possible locking modes.
+ * - CVMX_PKO_LOCK_NONE
+ * - PKO doesn't do any locking. It is the responsibility
+ * of the application to make sure that no other core
+ * is accessing the same queue at the same time.
+ * - CVMX_PKO_LOCK_ATOMIC_TAG
+ * - PKO performs an atomic tagswitch to insure exclusive
+ * access to the output queue. This will maintain
+ * packet ordering on output.
+ * - CVMX_PKO_LOCK_CMD_QUEUE
+ * - PKO uses the common command queue locks to insure

+ *          exclusive access to the output queue. This is a
+ *          memory based ll/sc. This is the most portable
+ *          locking mechanism.

+ *
+ * NOTE: If atomic locking is used, the POW entry CANNOT be
+ * descheduled, as it does not contain a valid WQE pointer.
+ *
+ * @param port Port to send it on, this can be either IPD port or
PKO
+ * port.
+ * @param queue Queue to use
+ * @param use_locking
+ * CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or
CVMX_PKO_LOCK_CMD_QUEUE
+ */
+static inline void cvmx_pko_send_packet_prepare(u64 port __attribute__((unused)), u64 queue,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+						cvmx_pko_lock_t

use_locking)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +4 -0
+{
+	if (use_locking == CVMX_PKO_LOCK_ATOMIC_TAG) {
+		/*
+		 * Must do a full switch here to handle all cases.  We

use a

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+		 * fake WQE pointer, as the POW does not access this

memory.

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+		 * The WQE pointer and group are only used if this work

is

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0
+		 * descheduled, which is not supported by the
+		 *

cvmx_pko_send_packet_prepare/cvmx_pko_send_packet_finish

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+		 * combination. Note that this is a special case in

which these

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+		 * fake values can be used - this is not a general

technique.

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0
+		 */
+		u32 tag = CVMX_TAG_SW_BITS_INTERNAL <<

CVMX_TAG_SW_SHIFT |

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+			  CVMX_TAG_SUBGROUP_PKO <<

CVMX_TAG_SUBGROUP_SHIFT |

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0
+			  (CVMX_TAG_SUBGROUP_MASK & queue);
+		cvmx_pow_tag_sw_full((cvmx_wqe_t

*)cvmx_phys_to_ptr(0x80), tag,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0
+				     CVMX_POW_TAG_TYPE_ATOMIC, 0);
+	}
+}
+
+#define cvmx_pko_send_packet_prepare_pkoid

cvmx_pko_send_packet_prepare

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +3 -0
+
+/**
+ * Complete packet output. cvmx_pko_send_packet_prepare() must be

called exactly once before this,
+ * and the same parameters must be passed to both cvmx_pko_send_packet_prepare() and
+ * cvmx_pko_send_packet_finish().
+ *
+ * WARNING: This function may have to look up the proper PKO port in
+ * the IPD port to PKO port map, and is thus slower than calling
+ * cvmx_pko_send_packet_finish_pkoid() directly if the PKO port
+ * identifier is known.
+ *
+ * @param ipd_port The IPD port corresponding the to pko port the
packet is for
+ * @param queue Queue to use
+ * @param pko_command
+ * PKO HW command word
+ * @param packet Packet to send
+ * @param use_locking
+ * CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or
CVMX_PKO_LOCK_CMD_QUEUE
+ *
+ * @return returns CVMX_PKO_SUCCESS on success, or error code on failure of output
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0
+static inline cvmx_pko_return_value_t
+cvmx_hwpko_send_packet_finish(u64 ipd_port, u64 queue,

cvmx_pko_command_word0_t pko_command,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+			      cvmx_buf_ptr_t packet, cvmx_pko_lock_t

use_locking)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0
+{
+	cvmx_cmd_queue_result_t result;
+
+	if (use_locking == CVMX_PKO_LOCK_ATOMIC_TAG)
+		cvmx_pow_tag_sw_wait();
+
+	result = cvmx_cmd_queue_write2(CVMX_CMD_QUEUE_PKO(queue),
+				       (use_locking ==

CVMX_PKO_LOCK_CMD_QUEUE), pko_command.u64,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0
+				       packet.u64);
+	if (cvmx_likely(result == CVMX_CMD_QUEUE_SUCCESS)) {
+		cvmx_pko_doorbell(ipd_port, queue, 2);
+		return CVMX_PKO_SUCCESS;
+	} else if ((result == CVMX_CMD_QUEUE_NO_MEMORY) || (result ==

CVMX_CMD_QUEUE_FULL)) {

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0
+		return CVMX_PKO_NO_MEMORY;
+	} else {
+		return CVMX_PKO_INVALID_QUEUE;
+	}
+}
+
+/**
+ * Complete packet output. cvmx_pko_send_packet_prepare() must be

called exactly once before this,
+ * and the same parameters must be passed to both cvmx_pko_send_packet_prepare() and
+ * cvmx_pko_send_packet_finish().
+ *
+ * WARNING: This function may have to look up the proper PKO port in
+ * the IPD port to PKO port map, and is thus slower than calling
+ * cvmx_pko_send_packet_finish3_pkoid() directly if the PKO port
+ * identifier is known.
+ *
+ * @param ipd_port The IPD port corresponding the to pko port the
packet is for
+ * @param queue Queue to use
+ * @param pko_command
+ * PKO HW command word
+ * @param packet Packet to send
+ * @param addr Plysical address of a work queue entry or physical
address to zero on complete.
+ * @param use_locking
+ * CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or
CVMX_PKO_LOCK_CMD_QUEUE
+ *
+ * @return returns CVMX_PKO_SUCCESS on success, or error code on failure of output
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0
+static inline cvmx_pko_return_value_t
+cvmx_hwpko_send_packet_finish3(u64 ipd_port, u64 queue,

cvmx_pko_command_word0_t pko_command,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0
+			       cvmx_buf_ptr_t packet, u64 addr,

cvmx_pko_lock_t use_locking)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0
+{
+	cvmx_cmd_queue_result_t result;
+
+	if (use_locking == CVMX_PKO_LOCK_ATOMIC_TAG)
+		cvmx_pow_tag_sw_wait();
+
+	result = cvmx_cmd_queue_write3(CVMX_CMD_QUEUE_PKO(queue),
+				       (use_locking ==

CVMX_PKO_LOCK_CMD_QUEUE), pko_command.u64,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0
+				       packet.u64, addr);
+	if (cvmx_likely(result == CVMX_CMD_QUEUE_SUCCESS)) {
+		cvmx_pko_doorbell(ipd_port, queue, 3);
+		return CVMX_PKO_SUCCESS;
+	} else if ((result == CVMX_CMD_QUEUE_NO_MEMORY) || (result ==

CVMX_CMD_QUEUE_FULL)) {

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +49 -0
+		return CVMX_PKO_NO_MEMORY;
+	} else {
+		return CVMX_PKO_INVALID_QUEUE;
+	}
+}
+
+/**
+ * Get the first pko_port for the (interface, index)
+ *
+ * @param interface
+ * @param index
+ */
+int cvmx_pko_get_base_pko_port(int interface, int index);
+
+/**
+ * Get the number of pko_ports for the (interface, index)
+ *
+ * @param interface
+ * @param index
+ */
+int cvmx_pko_get_num_pko_ports(int interface, int index);
+
+/**
+ * For a given port number, return the base pko output queue
+ * for the port.
+ *
+ * @param port   IPD port number
+ * @return Base output queue
+ */
+int cvmx_pko_get_base_queue(int port);
+
+/**
+ * For a given port number, return the number of pko output queues.
+ *
+ * @param port   IPD port number
+ * @return Number of output queues
+ */
+int cvmx_pko_get_num_queues(int port);
+
+/**
+ * Sets the internal FPA pool data structure for PKO comamnd queue.
+ * @param pool	fpa pool number yo use
+ * @param buffer_size	buffer size of pool
+ * @param buffer_count	number of buufers to allocate to pool
+ *
+ * @note the caller is responsable for setting up the pool with
+ * an appropriate buffer size and sufficient buffer count.
+ */
+void cvmx_pko_set_cmd_que_pool_config(s64 pool, u64 buffer_size, u64

buffer_count);

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +6 -0
+
+/**
+ * Get the status counters for a port.
+ *
+ * @param ipd_port Port number (ipd_port) to get statistics for.
+ * @param clear    Set to 1 to clear the counters after they are

read
+ * @param status Where to put the results.
+ *
+ * Note:
+ * - Only the doorbell for the base queue of the ipd_port is
+ * collected.
+ * - Retrieving the stats involves writing the index through

+ *       CVMX_PKO_REG_READ_IDX and reading the stat CSRs, in that
+ *       order. It is not MP-safe and caller should guarantee
+ *       atomicity.

+ */
+void cvmx_pko_get_port_status(u64 ipd_port, u64 clear, cvmx_pko_port_status_t *status);

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0
+
+/**
+ * Rate limit a PKO port to a max packets/sec. This function is only
+ * supported on CN57XX, CN56XX, CN55XX, and CN54XX.
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

before rate
+ * limiting cuts in.
+ *
+ * @return Zero on success, negative on failure
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +59 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

u64 len)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

doorbell write */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

called exactly once before this,
+ * and the same parameters must be passed to both cvmx_pko_send_packet_prepare() and
+ * cvmx_pko_send_packet_finish_pkoid().
+ *
+ * @param pko_port Port to send it on
+ * @param queue Queue to use
+ * @param pko_command
+ * PKO HW command word
+ * @param packet Packet to send
+ * @param use_locking
+ * CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or
CVMX_PKO_LOCK_CMD_QUEUE
+ *
+ * @return returns CVMX_PKO_SUCCESS on success, or error code on failure of output
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pko_command_word0_t pko_command,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pko_lock_t use_locking)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKO_LOCK_CMD_QUEUE), pko_command.u64,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_CMD_QUEUE_FULL)) {

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

called exactly once before this,
+ * and the same parameters must be passed to both cvmx_pko_send_packet_prepare() and
+ * cvmx_pko_send_packet_finish_pkoid().
+ *
+ * @param pko_port The PKO port the packet is for
+ * @param queue Queue to use
+ * @param pko_command
+ * PKO HW command word
+ * @param packet Packet to send
+ * @param addr Plysical address of a work queue entry or physical
address to zero on complete.
+ * @param use_locking
+ * CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or
CVMX_PKO_LOCK_CMD_QUEUE
+ *
+ * @return returns CVMX_PKO_SUCCESS on success, or error code on failure of output
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pko_command_word0_t pko_command,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pko_lock_t use_locking)

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKO_LOCK_CMD_QUEUE), pko_command.u64,

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_CMD_QUEUE_FULL)) {

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

error
+ */

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +5 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +14 -0
new file mode 100644
index 000000000000..727298352c28

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

ipd_port_map_68xx[]
+ * and ipd_port_map_78xx[] arrays.
+ */

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +37 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ilk_lane_mask[CVMX_MAX_NODES][CVMX_NUM_ILK_INTF];

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +40 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ilk_cal_ent_ctrl_t;

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ilk_lpbk_ena_t;

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ilk_lpbk_mode_t;

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mode packets
+ */

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +30 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

num_lanes);
+int cvmx_ilk_start_interface_la(int interface, unsigned char num_lanes);
+int cvmx_ilk_set_pipe(int interface, int pipe_base, unsigned int pipe_len);
+int cvmx_ilk_tx_set_channel(int interface, cvmx_ilk_pipe_chan_t *pch, unsigned int num_chs);
+int cvmx_ilk_rx_set_pknd(int interface, cvmx_ilk_chan_pknd_t *chpknd, unsigned int num_pknd);

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned char *num_chan); +cvmx_ilk_la_nsp_compact_hdr_t cvmx_ilk_enable_la_header(int ipd_port, int mode);
+void cvmx_ilk_show_stats(int interface, cvmx_ilk_stats_ctrl_t *pstats);
+int cvmx_ilk_cal_setup_rx(int interface, int cal_depth, cvmx_ilk_cal_entry_t *pent, int hi_wm,

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ilk_cal_entry_t *pent,

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ilk_lpbk_mode_t mode);

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +3 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +16 -0
new file mode 100644
index 000000000000..cdff36fffb56

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_ipd_second_next_ptr_back_t;

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +85 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

then used
+ * for seting IPD hardware block
+ */

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

buffer_count);

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

buffer_count);

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*buffer_size, u64 *buffer_count)

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

buffer_size, u64 buffer_count)

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

buffer_count);

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*buffer_size, u64 *buffer_count)

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

buffer_size, u64 buffer_count)

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

buffer
+ * @param not_first_mbuff_skip
+ * Number of 8 byte words to skip in each
following buffer
+ * @param first_back Must be same as first_mbuff_skip / 128
+ * @param second_back
+ * Must be same as not_first_mbuff_skip / 128
+ * @param wqe_fpa_pool
+ * FPA pool to get work entries from
+ * @param cache_mode
+ * @param back_pres_enable_flag
+ * Enable or disable port back pressure at a
global level.
+ * This should always be 1 as more accurate
control can be
+ * found in IPD_PORTX_BP_PAGE_CNT[BP_ENB].
+ */
+void cvmx_ipd_config(u64 mbuff_size, u64 first_mbuff_skip, u64 not_first_mbuff_skip, u64 first_back,

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cache_mode,

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +22 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

less than
+ * this many packet buffers free in FPA 0.
+ * @param drop_thresh
+ * All incoming packets will be dropped when there are
less
+ * than this many free packet buffers in FPA 0.
+ * @return Zero on success. Negative on failure
+ */
+int cvmx_ipd_setup_red_queue(int queue, int pass_thresh, int drop_thresh);

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

less than
+ * this many packet buffers free in FPA 0.
+ * @param drop_thresh
+ * All incoming packets will be dropped when there are
less
+ * than this many free packet buffers in FPA 0.
+ * @return Zero on success. Negative on failure
+ */

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +3 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-packet.h new file +40 -0
new file mode 100644
index 000000000000..f3cfe9c64f43

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +10 -0
new file mode 100644
index 000000000000..a819196c021c

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PCIE_PORTS

                       \
arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

OCTEON_IS_MODEL(OCTEON_CN73XX)) ? \

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

: \

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

BAR2,
+ * place BAR1 so it is the same for both.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +67 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

is
+ * read/written as an offset from this address.
+ *
+ * @param pcie_port PCIe port the IO is for
+ *
+ * @return 64bit Octeon IO base address for read/write
+ */

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enumerate the bus.
+ *
+ * @param pcie_port PCIe port to initialize
+ *
+ * @return Zero on success
+ */

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +23 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

int reg);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

int reg);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

int reg);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

fn, int reg, u8 val);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

fn, int reg, u16 val);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

fn, int reg, u32 val);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cfg_offset);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cfg_offset, u32 val);

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +54 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +27 -0
new file mode 100644
index 000000000000..013f533fb7bb

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(UDP) header */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

match IP length) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

is zero) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +22 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

hdr) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

IP hdr) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

bad FCS
+ * or carrier extend error which is CVMX_PIP_EXTEND_ERR
+ */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet (buffering/bandwidth not adequate) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

large and truncated */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

len > max frame len) (with FCS error) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

len > max frame len) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

byte multiple - 100M and 10M only) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

len < min frame len) (with FCS error) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

error */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

len < min frame len) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

carrier extend error */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

with an idle cycle */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

did not match len in L2 length/type) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

all data bits marked err) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enough to pass the skipper - no inspection could occur */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

not repeated - 100M and 10M only) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enough to pass the skipper - no inspection could occur */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

long enough to cover L2 hdr) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

or less when FCS stripping is enabled) */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

receiver

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

as bad FCS

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PIP_EXTEND_ERR

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +78 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

match, u16 mask, int grp,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

index);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enabled program the entry*/

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_TERM_L3_FLAGS;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

16);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_TERM_L4_PORT;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_TERM_L4_PORT;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

/*CVMX_PIP_QOS_WATCH_ETHERTYPE*/) {

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_TERM_ETHTYPE0;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

already exist, cant set watcher\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

16);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

type);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

compat 78xx\n", grp);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag_type, int field)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

&style_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_CLUSTER_ALL, &style_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_FIND_AVAL_ENTRY, bank,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

R_ALL);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enable qos watcher\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_CLUSTER_ALL, pcam_input,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +27 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_FIND_AVAL_ENTRY, bank,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

watcher\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_CLUSTER_ALL, pcam_input, pcam_action);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

index, int style)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

before enable\n", index);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and qps base */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

&style_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

&qpg_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

watcher\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

reserve

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

watcher\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_CLUSTER_ALL, &style_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_FIND_AVAL_ENTRY, bank,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

watcher\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_CLUSTER_ALL, pcam_input, pcam_action);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pip_prt_cfgx_t port_cfg,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_ipd_port_to_xport(ipd_port);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.pad_len)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

this option\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.len_chk_sel;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.lenerr_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.maxerr_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.minerr_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.crc_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.grp_wat_47 ||

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(u8)(port_cfg.s.grp_wat_47 << 4));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(u8)(port_cfg.s.qos_wat_47 << 4));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(qos_mask & (1 << i)))

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

xp.node, i, style);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

supported in 78xx pass1\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag generation\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.rawdrp;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.inst_hdr;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_QPG_QOS_HIGIG;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_QPG_QOS_VLAN;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_QPG_QOS_DIFFSERV;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

installed to achieve qos_vod\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pki_prt_cfg.style_cfg.parm_cfg.qpg_base,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_pki_set_qpg_entry(xp.node, &qpg_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

available, will not modify qos\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

= qpg_offset;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pki_dflt_sso_grp[xp.node].group) {

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pki_prt_cfg.style_cfg.parm_cfg.qpg_base,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_pki_set_qpg_entry(xp.node, &qpg_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

available, will not modify group\n");

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

= qpg_offset;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.dsa_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_cfg.s.higig_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.ip4_src_flag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.ip4_dst_flag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

r =

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.ip4_pctl_flag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.ip4_sprt_flag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.ip4_dprt_flag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.inc_prt_flag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.inc_vlan;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.inc_vs;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.tcp4_tag_type)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.ip4_tag_type)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_sso_tag_type)port_tag_cfg.s.non_tag_type;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port_tag_cfg.s.non_tag_type)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_sso_tag_type)tcp_tag;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_MATCH_IP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tcp_tag, CVMX_PKI_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__cvmx_pip_set_tag_type(xp.node, style, ip_tag,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

KI_PCAM_MATCH_IP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, nstyle, tcp_tag,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__cvmx_pip_set_tag_type(xp.node, nstyle, ip_tag,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, n4style,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

g_cfg.s.tcp4_tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__cvmx_pip_set_tag_type(xp.node, nstyle, ip_tag,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, n6style,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

g_cfg.s.tcp6_tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__cvmx_pip_set_tag_type(xp.node, style,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag_cfg.s.ip4_tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

PKI_PCAM_MATCH_IPV4);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__cvmx_pip_set_tag_type(xp.node, style,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag_cfg.s.ip6_tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

PKI_PCAM_MATCH_IPV6);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, n4style, tcp_tag,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, n6style, tcp_tag,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, n4style,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

g_cfg.s.tcp4_tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

, n6style,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

g_cfg.s.tcp6_tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

I_PCAM_MATCH_TCP);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

!port_tag_cfg.s.portadd_en;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PARSE_LA_TO_LG;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PARSE_LC_TO_LG;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PARSE_NOTHING;

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

parameters are supported in 78xx */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_get_interface_num(ipd_port);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_get_interface_index_num(ipd_port);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

qos)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pip_qos_vlanx.u64);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

qos)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pip_qos_diffx.u64);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

read
+ * @param status Where to put the results.
+ */
+static inline void cvmx_pip_get_port_stats(u64 port_num, u64 clear, cvmx_pip_port_status_t *status)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +44 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT0_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT1_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT2_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT3_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT4_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT5_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT6_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT7_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT8_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT9_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT10_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_XSTAT11_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT0_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT1_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT2_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT3_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT4_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT5_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT6_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT7_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT8_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT9_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

OCTEON_IS_MODEL(OCTEON_CN70XX)) {

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT10_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT11_PRTX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT_INB_PKTS_PKNDX(pknd));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT_INB_OCTS_PKNDX(pknd));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT_INB_ERRS_PKNDX(pknd));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT_INB_PKTSX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT_INB_OCTSX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_STAT_INB_ERRSX(port_num));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +37 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

read
+ * @param status Where to put the results.
+ */
+static inline void cvmx_pip_get_port_status(u64 port_num, u64 clear, cvmx_pip_port_status_t *status)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_port_stats *)status);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +16 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

invert_result, u64 reflect,

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +21 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

index++)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

GCC macro
+ * offsetof() to determine the offsets into packet
headers.
+ * For example, offsetof(ethhdr, protocol) returns
the offset
+ * of the ethernet protocol field. The bitmask
selects which bytes
+ * to include the the tag, with bit offset X
selecting byte at offset X
+ * from the beginning of the packet data.
+ * @param len Number of bytes to include. Usually this is the
sizeof()
+ * the field.
+ */
+static inline void cvmx_pip_tag_mask_set(u64 mask_index, u64 offset, u64 len)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

max_size)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

values. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_ports_on_interface(interface);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_helper_get_ipd_port(interface, port);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

max_size);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_PRT_CFGX(pknd));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd(CVMX_PIP_FRM_LEN_CHKX(sel));

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

frm_len.u64);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

{

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and valids
+ * to be used when using the corresponding extractor.
+ *

+ * @param bit     Bit Select Extractor to use
+ * @param pos     Which position to update
+ * @param val     The value to update the position with

+ */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Extractor (%d) passed\n",

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +40 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pos(%d)\n", pos);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

final address
+ * to lookup table.
+ * @param skip Number of bytes to skip from start of
packet 0-64
+ */
+static inline void cvmx_pip_bsel_config(int bit, int offset, int skip)

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +24 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Quoted 1 line

packet_ptr.s.addr);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +52 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pass2.0 onwards. */

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

((upper_tag << 16) & 0xffff0000);

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +3 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +12 -0
new file mode 100644
index 000000000000..79b99b0bd7c2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

styles per node.
+ * @param node node to allocate style from.
+ * @param style style to allocate, if -1 it will be allocated

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

positive

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

style.
+ * @return style number on success, -1 on failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

if -1 ,

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

allocated
+ */
+int cvmx_pki_cluster_alloc(int node, int num_clusters, u64 *cluster_mask);

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pcan entry from
+ * @param cluster_mask mask of clusters from which pcam entry is needed.
+ * @return pcam entry of -1 on failure
+ */
+int cvmx_pki_pcam_entry_alloc(int node, int index, int bank, u64 cluster_mask);

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

available

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

base_offset is positive

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

specified base_offset.
+ @param count number of consecutive qpg entries to
allocate. They will be consecutive

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +23 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

available
+ * qpg base_offset will be allocated. If
base_offset is positive
+ * number and in range, it will try to allocate
specified base_offset.
+ * @param count number of consecutive qpg entries to
allocate. They will be consecutive
+ * from base offset.
+ * @return qpg table base offset number on success, -1 on
failure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

freed.
+ * @return 0 on success OR -1 on failure
+ */
+int cvmx_pki_pcam_entry_free(int node, int index, int bank, u64 cluster_mask);

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

per node.
+ * @param node node to allocate bpid from.
+ * @param bpid bpid to allocate, if -1 it will be allocated
+ * first available boid from bpid resource. If index is
positive
+ * number and in range, it will try to allocate specified
bpid.
+ * @return bpid number on success,
+ * -1 on alloc failure.
+ * -2 on resource already reserved.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

node
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

MTAG-IDX per node.
+ * @param node node to allocate index from.
+ * @param idx index to allocate, if -1 it will be allocated
+ * @return MTAG index number on success,
+ * -1 on alloc failure.
+ * -2 on resource already reserved.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

node.
+ * @param node node to free bpid from.
+ * @param bpid bpid to free
+ * @return 0 on success, -1 on failure or
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +5 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +30 -0
new file mode 100644
index 000000000000..c1feb55a1f01

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grouped by 4*/

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_TOTAL_PCAM_ENTRY

                       \
arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(CVMX_PKI_NUM_PCAM_ENTRY))

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_NUM_PCAM_ENTRY)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

OCTEON_IS_MODEL(OCTEON_CNF75XX))

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

OCTEON_IS_MODEL(OCTEON_CNF75XX) ||

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +23 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

PKI_L2_LENCHK_EQUAL_ONLY };

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DRAM,*/

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DRAM */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +22 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_USE_SECOND_VLAN };

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(pkind), or
+ * final style. (Does not apply to the PKI_STAT_INB* registers.)
+ * 0 = X represents the packet?s pkind
+ * 1 = X represents the low 6-bits of packet?s final style
+ */
+enum cvmx_pki_stats_mode { CVMX_PKI_STAT_MODE_PKIND, CVMX_PKI_STAT_MODE_STYLE };

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +92 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cluster group */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

ports
+ * which are using this style
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +46 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

configuration,
+ * it is kind of of profile which can be assigned to any port.
+ * If multiple ports are assigned same style be aware that modiying that style
+ * will modify the respective parameters for all the ports which are
+ * using this style */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +18 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

array.*/

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +95 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_TERM_E_L2_CUSTOM_M,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +24 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_PCAM_TERM_E_IL3_FLAGS_M,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +77 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

bytes */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enable */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 = enable */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enable */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0x0..0x7 */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

= 0: */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

= enable */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

INST_HDR[UTT] = 1 */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

INST_HDR[UQPG] = 1 */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

INST_HDR[UTAG] = 1 */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

be
+ * configured to use that group depending on number of clusters pkind
+ * would use. A given cluster can only be enabled in a single cluster group.
+ * Number of clusters assign to that group determines how many engine can work
+ * in parallel to process the packet. Eack cluster can process x MPPS.
+ *
+ * @param node Node
+ * @param cluster_group Group to attach clusters to.
+ * @param cluster_mask The mask of clusters which needs to be assigned to the group.
+ */
+static inline int cvmx_pki_attach_cluster_to_group(int node, u64 cluster_group, u64 cluster_mask)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(int)cluster_group);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_ICGX_CFG(cluster_group));

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pki_cl_grp.u64);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_global_parse gbl_pen)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +18 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_tag_sec tag_secret)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_TAG_SECRET);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag_secret_reg.u64);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_layer_type layer,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

backend)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_BELTYPE_MAX) {

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPEX_MAP(layer));

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

ltype_map.u64);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cl_grp)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_ICGX_CFG(cl_grp));

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

pki_cl_grp.u64);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CN78XX inputs.
+ *
+ * @param node Node number.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port/pkind stats.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_port_stats *status);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port/pkind stats.
+ * @param status Where to put the results.
+ */
+static inline void cvmx_pki_get_port_stats(int node, u64 port, struct cvmx_pki_port_stats *status)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

PKI.
+ *
+ * @param node Node number.
+ * @param style_num Style number to get statistics for.
+ * Make sure PKI_STATS_CTL:mode is set to 1 for collecting per
style/flow stats.
+ * @param status Where to put the results.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*status)

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +60 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_global_config *gbl_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_global_config *gbl_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

defines how
+ * the incoming packet is processed.
+ *
+ * @param node Node number.
+ * @param pkind PKI supports a large number of incoming interfaces and packets
+ * arriving on different interfaces or channels may want to be
processed
+ * differently. PKI uses the pkind to determine how the incoming
packet
+ * is processed.
+ * @param pkind_cfg Pointer to struct conatining pkind
configuration read
+ * from hardware.
+ */
+int cvmx_pki_read_pkind_config(int node, int pkind, struct cvmx_pki_pkind_config *pkind_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

defines how
+ * the incoming packet is processed.
+ *
+ * @param node Node number.
+ * @param pkind PKI supports a large number of incoming interfaces and packets
+ * arriving on different interfaces or channels may want to be
processed
+ * differently. PKI uses the pkind to determine how the incoming
packet
+ * is processed.
+ * @param pkind_cfg Pointer to struct conatining pkind
configuration need
+ * to be written in hardware.
+ */
+int cvmx_pki_write_pkind_config(int node, int pkind, struct cvmx_pki_pkind_config *pkind_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

in hardware.
+ *
+ * @param node Node number.
+ * @param style Style to configure tag for.
+ * @param cluster_mask Mask of clusters to configure the style for.
+ * @param tag_cfg Pointer to tag configuration struct.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cluster_mask,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cluster_mask,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*style_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

in hardware.
+ *
+ * @param node Node number.
+ * @param style Style to configure.
+ * @param cluster_mask Mask of clusters to configure the style for.
+ * @param style_cfg Pointer to style config struct.
+ */
+void cvmx_pki_write_style_config(int node, u64 style, u64 cluster_mask,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*style_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_qpg_config *qpg_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_qpg_config *qpg_cfg);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

hardware
+ *
+ * @param node Node number.
+ * @param index Offset in pcam table.
+ * @param cluster_mask Mask of clusters in which to write pcam entry.
+ * @param input Input keys to pcam match passed as struct.
+ * @param action PCAM match action passed as struct
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pki_pcam_action action);
+/**
+ * Configures the channel which will receive backpressure from the specified bpid.
+ * Each channel listens for backpressure on a specific bpid.
+ * Each bpid can backpressure multiple channels.
+ * @param node Node number.
+ * @param bpid BPID from which channel will receive backpressure.
+ * @param channel Channel number to receive backpressue.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the* PKI aura.
+ *
+ * @param node Node number
+ * @param aura To enable/disable QoS on.
+ * @param ena_red Enable/Disable RED drop between pass and drop level
+ * 1-enable 0-disable
+ * @param ena_drop Enable/disable tail drop when max drop level exceeds
+ * 1-enable 0-disable
+ * @param ena_bp Enable/Disable asserting backpressure on bpid when
+ * max DROP level exceeds.
+ * 1-enable 0-disable
+ */
+int cvmx_pki_enable_aura_qos(int node, int aura, bool ena_red, bool ena_drop, bool ena_bp);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

can reside
+ * either in same buffer as wqe OR it can go in separate buffer. If used the later mode,
+ * make sure software allocate enough buffers to now have wqe separate from packet data.
+ *
+ * @param node Node number.
+ * @param style Style to configure.
+ * @param pkt_outside_wqe
+ * 0 = The packet link pointer will be at word [FIRST_SKIP]
immediately
+ * followed by packet data, in the same buffer as the work queue
entry.
+ * 1 = The packet link pointer will be at word [FIRST_SKIP] in a
new

+ *    buffer separate from the work queue entry. Words following the
+ *    WQE in the same cache line will be zeroed, other lines in the
+ *    buffer will not be modified and will retain stale data (from

the
+ * buffer?s previous use). This setting may decrease the peak PKI
+ * performance by up to half on small packets.
+ */
+void cvmx_pki_set_wqe_mode(int node, u64 style, bool pkt_outside_wqe);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

little-endian.
+ * It Changes write operations of packet data to L2C to
+ * be in little-endian. Does not change the WQE header format, which is
+ * properly endian neutral.
+ *
+ * @param node Node number.
+ * @param style Style to configure.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

checks.
+ *
+ * @param node Node number.
+ * @param pknd PKIND to disable error for.
+ * @param l2len_err L2 length error check enable.
+ * @param maxframe_err Max frame error check enable.
+ * @param minframe_err Min frame error check enable.
+ * 1 -- Enabel err checks
+ * 0 -- Disable error checks
+ */
+void cvmx_pki_endis_l2_errs(int node, int pknd, bool l2len_err, bool maxframe_err,

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

WQE[LEN] by 4 bytes
+ * 1 -- strip L2 FCS.
+ * 0 -- Do not strip L2 FCS.
+ */
+void cvmx_pki_endis_fcs_check(int node, int pknd, bool fcs_chk, bool fcs_strip);

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

hardware.
+ *
+ * @param node Node number.
+ * @param num_entry Number of entries to print.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

from hardware.
+ *
+ * @param node Node number.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +21 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

FPA buffers
+ * out of the PKI. After this function completes, all FPA buffers that were
+ * prefetched by PKI will be in the appropriate FPA pool.
+ * This functions does not reset the PKI.
+ * WARNING: It is very important that PKI be reset soon after a call to this function.
+ *
+ * @param node Node number.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +3 -0

Lines of this file are not shown. View the raw message.

(quoted diff) +0 -0

The rest of this diff is not shown. View the raw message.

ports-range.h b/arch/mips/mach-octeon/include/mach/cvmx-pko-internal- ports-range.h
new file mode 100644
index 000000000000..1fb49b3fb6de

arch/mips/mach-octeon/include/mach/cvmx-pko-internal-ports- new file +0 -0

range.h

arch/mips/mach-octeon/include/mach/cvmx-pko-internal-ports- new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

interface/port
+ *
+ * @param interface the interface for which the internal ports are requested
+ * @param port the index of the port within in the interface
for which the internal ports
+ * are requested.
+ * @param count the number of internal ports requested
+ *
+ * @return 0 on success
+ * -1 on failure
+ */
+int cvmx_pko_internal_ports_alloc(int interface, int port, u64 count);

arch/mips/mach-octeon/include/mach/cvmx-pko-internal-ports- new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

interface/port
+ *
+ * @param interface the interface for which the internal ports are requested
+ * @param port the index of the port within in the interface
for which the internal ports
+ * are requested.
+ *
+ * @return 0 on success
+ * -1 on failure
+ */

arch/mips/mach-octeon/include/mach/cvmx-pko-internal-ports- new file +12 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +22 -0
new file mode 100644
index 000000000000..5f8398904953

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

node
+ */

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +22 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

parent.
+ * The children can have fair round-robin or priority-based scheduling
+ * when multiple children are assigned a single parent.
+ *
+ * @param node is the OCI node location for the queues to be configured
+ * @param parent_level is the level of the parent queue, 2 to 5.
+ * @param parent_queue is the number of the parent Scheduler Queue
+ * @param child_base is the number of the first child SQ or DQ to assign to
+ * @param parent
+ * @param child_count is the number of consecutive children to assign
+ * @param stat_prio_count is the priority setting for the children L2 SQs
+ *
+ * If <stat_prio_count> is -1, the Ln children will have equal Round-Robin
+ * relationship with eachother. If <stat_prio_count> is 0, all Ln children
+ * will be arranged in Weighted-Round-Robin, with the first having the most
+ * precedence. If <stat_prio_count> is between 1 and 8, it indicates how
+ * many children will have static priority settings (with the first having
+ * the most precedence), with the remaining Ln children having WRR scheduling.
+ *
+ * @returns 0 on success, -1 on failure.
+ *
+ * Note: this function supports the configuration of node-local unit.
+ */
+int cvmx_pko3_sq_config_children(unsigned int node, unsigned int parent_level,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

int child_base,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

stat_prio_count);

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

ordered
+ * by priority) for a given IPD-port, which is either a physical port,
+ * or a channel on a channelized interface (i.e. ILK).
+ *
+ * @param xiface is the physical interface number
+ * @param index is either a physical port on an interface
+ * @param or a channel of an ILK interface
+ * @param dq_base is the first Descriptor Queue number in a consecutive range
+ * @param dq_count is the number of consecutive Descriptor Queues leading
+ * @param the same channel or port.
+ *
+ * Only a consecurive range of Descriptor Queues can be associated with any
+ * given channel/port, and usually they are ordered from most to least
+ * in terms of scheduling priority.
+ *
+ * Note: thus function only populates the node-local translation table.
+ *
+ * @returns 0 on success, -1 on failure.
+ */
+int __cvmx_pko3_ipd_dq_register(int xiface, int index, unsigned int dq_base, unsigned int dq_count);

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

applied.
+ * @param pq_num specifies the Port Queue (i.e. L1) queue number.
+ * @param l2_l3_q_num specifies L2/L3 queue number.
+ * @param channel specifies the channel number to map to the queue.
+ *
+ * The channel assignment applies to L2 or L3 Shaper Queues depending
+ * on the setting of channel credit level.
+ *
+ * @return returns none.
+ */
+void cvmx_pko3_map_channel(unsigned int node, unsigned int pq_num, unsigned int l2_l3_q_num,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned int pq_num);

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned long rate_kbips,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned long rate_kbips,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned long rate_kbips,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

red_action_t red_act,

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +16 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

e)
\

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SHOFT_MANT_BITS)

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

e) \

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

{
                    \
arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

u; \

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

k;
\

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1; \

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0;
         \
arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SHOFT_MANT_BITS;
   \
arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

{ \

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1;
\

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1); \

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SHOFT_MAX()

                       \
arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SHOFT_EXP_BITS) - 1)

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +3 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +73 -0
new file mode 100644
index 000000000000..0680ca258f12

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

POW.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +212 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

if it is NULL_NULL

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

entry is not available -

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

work before a POW

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(except CSR reads)
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

get_wqp==0)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +39 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

get_wqp==1)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +50 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and get_rev==0)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +39 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and get_rev==1)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +31 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and get_rev==0)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +39 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and get_rev==1)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +162 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0/get_des_get_tail == 0)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +31 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0/get_des_get_tail == 1)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +18 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

IPL_FREE0/IPL_FREE1/IPL_FREE2)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1/get_des_get_tail == 0)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1/get_des_get_tail == 1)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +36 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

hardware assumes that an aligned
+ * 64-bit store was used for all these stores.
+ * Note the assumption that the work queue entry is aligned on an 8-byte
+ * boundary (since the low-order 3 address bits must be zero).
+ * Note that not all fields are used by all operations.
+ *
+ * NOTE: The following is the behavior of the pending switch bit at the PP
+ * for POW stores (i.e. when did<7:3> == 0xc)

+ *     - did<2:0> == 0      => pending switch bit is set
+ *     - did<2:0> == 1      => no affect on the pending switch bit
+ *     - did<2:0> == 3      => pending switch bit is cleared
+ *     - did<2:0> == 7      => no affect on the pending switch bit
+ *     - did<2:0> == others => must not be used
+ *     - No other loads/stores have an affect on the pending switch

bit
+ * - The switch bus from POW can clear the pending switch bit
+ *
+ * NOTE: did<2:0> == 2 is used by the HW for a special single-cycle ADDWQ command
+ * that only contains the pointer). SW must never use did<2:0> == 2.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +117 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_SL_PPX_TAG(core));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +58 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_SL_PPX_WQP(core));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*)cvmx_phys_to_ptr(sso_wqp.s.wqp);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*)cvmx_phys_to_ptr(load_resp.s_sstatus3_cn68xx.wqp);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*)cvmx_phys_to_ptr(load_resp.s_sstatus4.wqp);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*function)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

progress\n", function);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +23 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

TIMEOUT_MS)) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

taking a long time, possible deadlock\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

complete,
+ * so the caller must ensure that there is not a pending tag switch.
+ *
+ * @param wait When set, call stalls until work becomes available,
or
+ * times out. If not set, returns immediately.
+ *
+ * @return Returns the WQE pointer from POW. Returns NULL if no work was
+ * available.
+ */
+static inline cvmx_wqe_t *cvmx_pow_work_request_sync_nocheck(cvmx_pow_wait_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +26 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*)cvmx_phys_to_ptr(result.s_work.addr);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

before
+ * requesting the new work.
+ *
+ * @param wait When set, call stalls until work becomes available,
or
+ * times out. If not set, returns immediately.
+ *
+ * @return Returns the WQE pointer from POW. Returns NULL if no work was
+ * available.
+ */
+static inline cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

POW state.
+ * This function waits for any previous tag switch to complete before
+ * requesting the null_rd.
+ *
+ * @return Returns the POW state of type cvmx_pow_tag_type_t.
+ */
+static inline cvmx_pow_tag_type_t cvmx_pow_work_request_null_rd(void)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +25 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

with
+ * function cvmx_pow_work_response_async.
+ * This function does NOT wait for previous tag switches to complete,
+ * so the caller must ensure that there is not a pending tag switch.
+ *
+ * @param scr_addr Scratch memory address that response will be returned to,
+ * which is either a valid WQE, or a response with the invalid
bit set.
+ * Byte address, must be 8 byte aligned.
+ * @param wait 1 to cause response to wait for work to become available
+ * (or timeout)
+ * 0 to cause response to return immediately
+ */
+static inline void cvmx_pow_work_request_async_nocheck(int scr_addr, cvmx_pow_wait_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +26 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

with
+ * function cvmx_pow_work_response_async.
+ * This function waits for any previous tag switch to complete before
+ * requesting the new work.
+ *
+ * @param scr_addr Scratch memory address that response will be returned to,
+ * which is either a valid WQE, or a response with the invalid
bit set.
+ * Byte address, must be 8 byte aligned.
+ * @param wait 1 to cause response to wait for work to become available
+ * (or timeout)
+ * 0 to cause response to return immediately
+ */
+static inline void cvmx_pow_work_request_async(int scr_addr, cvmx_pow_wait_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

work was
+ * available.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*)cvmx_phys_to_ptr(result.s_work.addr);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

type. Completion for
+ * the tag switch must be checked for separately.
+ * This function does NOT update the
+ * work queue entry in dram to match tag value and type, so the application must
+ * keep track of these if they are important to the application.
+ * This tag switch command must not be used for switches to NULL, as the tag
+ * switch pending bit will be set by the switch request, but never cleared by
+ * the hardware.
+ *
+ * NOTE: This should not be used when switching from a NULL tag. Use
+ * cvmx_pow_tag_sw_full() instead.
+ *
+ * This function does no checks, so the caller must ensure that any previous tag
+ * switch has completed.
+ *
+ * @param tag new tag value
+ * @param tag_type new tag type (ordered or atomic)
+ */
+static inline void cvmx_pow_tag_sw_nocheck(u32 tag, cvmx_pow_tag_type_t tag_type)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(current_tag.tag == tag),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

same tag\n", __func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_tag_sw_null() instead\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

not read

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

for

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +36 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

type. Completion for
+ * the tag switch must be checked for separately.
+ * This function does NOT update the
+ * work queue entry in dram to match tag value and type, so the application must
+ * keep track of these if they are important to the application.
+ * This tag switch command must not be used for switches to NULL, as the tag
+ * switch pending bit will be set by the switch request, but never cleared by
+ * the hardware.
+ *
+ * NOTE: This should not be used when switching from a NULL tag. Use
+ * cvmx_pow_tag_sw_full() instead.
+ *
+ * This function waits for any previous tag switch to complete, and also
+ * displays an error on tag switches to NULL.
+ *
+ * @param tag new tag value
+ * @param tag_type new tag type (ordered or atomic)
+ */
+static inline void cvmx_pow_tag_sw(u32 tag, cvmx_pow_tag_type_t tag_type)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

not read

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

for

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

keep

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

switch

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

type. Completion for
+ * the tag switch must be checked for separately.
+ * This function does NOT update the
+ * work queue entry in dram to match tag value and type, so the application must
+ * keep track of these if they are important to the application.
+ * This tag switch command must not be used for switches to NULL, as the tag
+ * switch pending bit will be set by the switch request, but never cleared by
+ * the hardware.
+ *
+ * This function must be used for tag switches from NULL.
+ *
+ * This function does no checks, so the caller must ensure that any previous tag
+ * switch has completed.
+ *
+ * @param wqp pointer to work queue entry to submit. This
entry is
+ * updated to match the other parameters
+ * @param tag tag value to be assigned to work queue entry
+ * @param tag_type type of tag
+ * @param group group value for the work queue entry.
+ */
+static inline void cvmx_pow_tag_sw_full_nocheck(cvmx_wqe_t *wqp, u32 tag,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag_type, u64 group)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(current_tag.tag == tag),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

same tag\n", __func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_tag_sw_null() instead\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_get_current_wqp())

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the address in the POW(%p)\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_get_current_wqp());

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

not

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

manual

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

to

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

node */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +40 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

match tag value
+ * and type, so the application must keep track of these if they are important
+ * to the application. This tag switch command must not be used for switches
+ * to NULL, as the tag switch pending bit will be set by the switch request,
+ * but never cleared by the hardware.
+ *
+ * This function must be used for tag switches from NULL.
+ *
+ * This function waits for any pending tag switches to complete
+ * before requesting the tag switch.
+ *
+ * @param wqp Pointer to work queue entry to submit.
+ * This entry is updated to match the other parameters
+ * @param tag Tag value to be assigned to work queue entry
+ * @param tag_type Type of tag
+ * @param group Group value for the work queue entry.
+ */
+static inline void cvmx_pow_tag_sw_full(cvmx_wqe_t *wqp, u32 tag, cvmx_pow_tag_type_t tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

switch cannot

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

complete,
+ * so the caller must ensure that any previous tag switches have completed.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag\n", __func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +38 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

switch cannot

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

arguments given.
+ * Note that the tag provided is for the work queue entry submitted, and
+ * is unrelated to the tag that the core currently holds.
+ *
+ * @param wqp pointer to work queue entry to submit.
+ * This entry is updated to match the other
parameters
+ * @param tag tag value to be assigned to work queue entry
+ * @param tag_type type of tag
+ * @param qos Input queue to add to.
+ * @param grp group value for the work queue entry.
+ */
+static inline void cvmx_pow_work_submit(cvmx_wqe_t *wqp, u32 tag, cvmx_pow_tag_type_t tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +76 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

time */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

work from
+ * the corresponding group.
+ * The CN68XX supports 64 groups, earlier models only
support
+ * 16 groups.
+ *
+ * The CN78XX in backwards compatibility mode allows up to 32 groups,
+ * so the 'mask' argument has one bit for every of the legacy
+ * groups, and a '1' in the mask causes a total of 8 groups
+ * which share the legacy group numbher and 8 qos levels,
+ * to be enabled for the calling processor core.
+ * A '0' in the mask will disable the current core
+ * from receiving work from the associated group.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

core# %llu, ignored.\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

exceeded: %#llx\n", __func__,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

{

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

bit;

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_sso_num_maskset(); mask_set++) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_PPX_SX_GRPMSKX(core, mask_set, rix),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +24 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

work from
+ * the corresponding group.
+ * The CN68XX supports 64 groups, earlier models only
support
+ * 16 groups.
+ *
+ * The CN78XX in backwards compatibility mode allows up to 32 groups,
+ * so the 'mask' argument has one bit for every of the legacy
+ * groups, and a '1' in the mask causes a total of 8 groups
+ * which share the legacy group numbher and 8 qos levels,
+ * to be enabled for the calling processor core.
+ * A '0' in the mask will disable the current core
+ * from receiving work from the associated group.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

rix--) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

same) */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_PPX_SX_GRPMSKX(core, 0, rix));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp_mask.u64[56,48,40,32,24,16,8,0] */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

8))) >> (7 * i);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

continue */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

compatible mode
+ * Returns 1 if 78xx(73xx,75xx) is programmed in legacy compatible mode
+ * Returns 1 if octeon model is not 78xx(73xx,75xx)
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

compatible mode

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

rix--) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

same) */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_PPX_SX_GRPMSKX(core, 0, rix));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_PPX_SX_GRPMSKX(core, 1, rix));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

compatible

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mask_set=0 */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0xFF;

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mode */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

queue has
+ * an associated priority value.
+ *
+ * @param core_num core to apply priorities to
+ * @param priority Vector of 8 priorities, one per POW Input Queue
(0-7).
+ * Highest priority is 0 and lowest is 7. A
priority value
+ * of 0xF instructs POW to skip the Input Queue
when
+ * scheduling to this specific core.
+ * NOTE: priorities should not have gaps in
values, meaning
+ * {0,1,1,1,1,1,1,1} is a valid
configuration while
+ * {0,2,2,2,2,2,2,2} is not.
+ */
+static inline void cvmx_pow_set_priority(u64 core_num, const u8 priority[])

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

contiguous (0x%llx)\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

overwritten */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

csr_rd_node(..), */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_GRPX_PRI(group));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp_pri.u64);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +35 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

queue has
+ * an associated priority value.
+ *
+ * @param[in] core_num core to get priorities for
+ * @param[out] priority Pointer to u8[] where to return priorities
+ * Vector of 8 priorities, one per POW Input Queue
(0-7).
+ * Highest priority is 0 and lowest is 7. A
priority value
+ * of 0xF instructs POW to skip the Input Queue
when
+ * scheduling to this specific core.
+ * NOTE: priorities should not have gaps in
values, meaning
+ * {0,1,1,1,1,1,1,1} is a valid
configuration while
+ * {0,2,2,2,2,2,2,2} is not.
+ */
+static inline void cvmx_pow_get_priority(u64 core_num, u8 priority[])

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(periodicaly) */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

group++) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_GRPX_PRI(group));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +31 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

be contiguous (0x%llx)\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

xgrp, int *priority,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*affinity)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

completes
+ * immediately, so completion must not be waited for. This function does NOT
+ * update the wqe in DRAM to match arguments.
+ *
+ * This function does NOT wait for any prior tag switches to complete, so the
+ * calling code must do this.
+ *
+ * Note the following CAVEAT of the Octeon HW behavior when
+ * re-scheduling DE-SCHEDULEd items whose (next) state is
+ * ORDERED:
+ * - If there are no switches pending at the time that the

+ *     HW executes the de-schedule, the HW will only re-schedule
+ *     the head of the FIFO associated with the given tag. This
+ *     means that in many respects, the HW treats this ORDERED
+ *     tag as an ATOMIC tag. Note that in the SWTAG_DESCH
+ *     case (to an ORDERED tag), the HW will do the switch
+ *     before the deschedule whenever it is possible to do
+ *     the switch immediately, so it may often look like
+ *     this case.
+ *   - If there is a pending switch to ORDERED at the time
+ *     the HW executes the de-schedule, the HW will perform
+ *     the switch at the time it re-schedules, and will be
+ *     able to reschedule any/all of the entries with the
+ *     same tag.

+ * Due to this behavior, the RECOMMENDATION to software is
+ * that they have a (next) state of ATOMIC when they
+ * DE-SCHEDULE. If an ORDERED tag is what was really desired,
+ * SW can choose to immediately switch to an ORDERED tag
+ * after the work (that has an ATOMIC tag) is re-scheduled.
+ * Note that since there are never any tag switches pending
+ * when the HW re-schedules, this switch can be IMMEDIATE upon
+ * the reception of the pointer during the re-schedule.
+ *
+ * @param tag New tag value
+ * @param tag_type New tag type
+ * @param group New group value
+ * @param no_sched Control whether this work queue entry will be rescheduled.
+ * - 1 : don't schedule this work
+ * - 0 : allow this work to be scheduled.
+ */
+static inline void cvmx_pow_tag_sw_desched_nocheck(u32 tag, cvmx_pow_tag_type_t tag_type, u64 group,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

allowed from NULL state\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_ATOMIC) &&

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

after tag is ATOMIC\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_OP_SWTAG_DESCH;

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_OP_SWTAG_DESCH;

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +29 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

completes
+ * immediately, so completion must not be waited for. This function does NOT
+ * update the wqe in DRAM to match arguments.
+ *
+ * This function waits for any prior tag switches to complete, so the
+ * calling code may call this function with a pending tag switch.
+ *
+ * Note the following CAVEAT of the Octeon HW behavior when
+ * re-scheduling DE-SCHEDULEd items whose (next) state is
+ * ORDERED:
+ * - If there are no switches pending at the time that the

+ *     HW executes the de-schedule, the HW will only re-schedule
+ *     the head of the FIFO associated with the given tag. This
+ *     means that in many respects, the HW treats this ORDERED
+ *     tag as an ATOMIC tag. Note that in the SWTAG_DESCH
+ *     case (to an ORDERED tag), the HW will do the switch
+ *     before the deschedule whenever it is possible to do
+ *     the switch immediately, so it may often look like
+ *     this case.
+ *   - If there is a pending switch to ORDERED at the time
+ *     the HW executes the de-schedule, the HW will perform
+ *     the switch at the time it re-schedules, and will be
+ *     able to reschedule any/all of the entries with the
+ *     same tag.

+ * Due to this behavior, the RECOMMENDATION to software is
+ * that they have a (next) state of ATOMIC when they
+ * DE-SCHEDULE. If an ORDERED tag is what was really desired,
+ * SW can choose to immediately switch to an ORDERED tag
+ * after the work (that has an ATOMIC tag) is re-scheduled.
+ * Note that since there are never any tag switches pending
+ * when the HW re-schedules, this switch can be IMMEDIATE upon
+ * the reception of the pointer during the re-schedule.
+ *
+ * @param tag New tag value
+ * @param tag_type New tag type
+ * @param group New group value
+ * @param no_sched Control whether this work queue entry will be rescheduled.
+ * - 1 : don't schedule this work
+ * - 0 : allow this work to be scheduled.
+ */
+static inline void cvmx_pow_tag_sw_desched(u32 tag, cvmx_pow_tag_type_t tag_type, u64 group,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

complete */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

switch cannot be started

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

no_sched);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

queue entry.
+ * If this is set the entry will not be rescheduled.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

expected from NULL state\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

complete */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +28 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

***********/
+/* OCTEON3-specific
functions. */
+/******************************************************************* ***********/
+/**
+ * This function sets the the affinity of group to the cores in 78xx.
+ * It sets up all the cores in core_mask to accept work from the specified group.
+ *
+ * @param xgrp Group to accept work from, 0 - 255.
+ * @param core_mask Mask of all the cores which will accept work
from this group
+ * @param mask_set Every core has set of 2 masks which can be set
to accept work
+ * from 256 groups. At the time of get_work, cores can choose
which mask_set
+ * to get work from. 'mask_set' values range from 0 to 3, where
each of the
+ * two bits represents a mask set. Cores will be added to the
mask set with
+ * corresponding bit set, and removed from the mask set with
corresponding
+ * bit clear.
+ * Note: cores can only accept work from SSO groups on the same node,
+ * so the node number for the group is derived from the core number.
+ */
+static inline void cvmx_sso_set_group_core_affinity(cvmx_xgrp_t xgrp,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_coremask *core_mask,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp_index);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp_index);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

for each group.
+ *
+ * @param node Node number
+ * @param xgrp Group 0 - 255 to apply mask parameters to
+ * @param priority Priority of the group relative to other groups
+ * 0x0 - highest priority
+ * 0x7 - lowest priority
+ * @param weight Cross-group arbitration weight to apply to this
group.
+ * valid values are 1-63
+ * h/w default is 0x3f
+ * @param affinity Processor affinity arbitration weight to apply
to this group.

+ *     If zero, affinity is disabled.
+ *     valid values are 0-15
+ *     h/w default which is 0xf.
+ * @param modify_mask   mask of the parameters which needs to be
modified.
+ *     enum cvmx_sso_group_modify_mask
+ *     to modify only priority -- set bit0
+ *     to modify only weight   -- set bit1
+ *     to modify only affinity -- set bit2

+ */
+static inline void cvmx_sso_set_group_priority(int node, cvmx_xgrp_t xgrp, int priority, int weight,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_sso_group_modify_mask modify_mask)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +22 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

with
+ * function cvmx_pow_work_response_async.
+ * This function does NOT wait for previous tag switches to complete,
+ * so the caller must ensure that there is not a pending tag switch.
+ *
+ * @param scr_addr Scratch memory address that response will be returned to,
+ * which is either a valid WQE, or a response with the invalid
bit set.
+ * Byte address, must be 8 byte aligned.
+ * @param xgrp Group to receive work for (0-255).
+ * @param wait
+ * 1 to cause response to wait for work to become available (or
timeout)
+ * 0 to cause response to return immediately
+ */
+static inline void cvmx_sso_work_request_grp_async_nocheck(int scr_addr, cvmx_xgrp_t xgrp,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

t_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

WQE), "Not CN78XX");

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +16 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

verifying
+ * pending tag switch. It requests work from a specific SSO group.
+ *
+ * @param lgrp The local group number (within the SSO of the node of the caller)
+ * from which to get the work.
+ * @param wait When set, call stalls until work becomes available, or times out.
+ * If not set, returns immediately.
+ *
+ * @return Returns the WQE pointer from SSO.
+ * Returns NULL if no work was available.
+ */
+static inline void *cvmx_sso_work_request_grp_sync_nocheck(unsigned int lgrp, cvmx_pow_wait_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

WQE), "Not CN78XX");

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +21 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

before
+ * requesting the new work.
+ *
+ * @param lgrp The node-local group number from which to get the work.
+ * @param wait When set, call stalls until work becomes available, or times out.
+ * If not set, returns immediately.
+ *
+ * @return The WQE pointer or NULL, if work is not available.
+ */
+static inline void *cvmx_sso_work_request_grp_sync(unsigned int lgrp, cvmx_pow_wait_t wait)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

bits
+ * indicate which groups each core will accept work from.
+ *
+ * @param core_num Processor core to apply mask to.
+ * @param mask_set 7XXX has 2 sets of masks per core.
+ * Bit 0 represents the first mask set, bit 1 -- the second.
+ * @param xgrp_mask Group mask array.

+ *     Total number of groups is divided into a number of
+ *     64-bits mask sets. Each bit in the mask, if set, enables
+ *     the core to accept work from the corresponding group.

+ *
+ * NOTE: Each core can be configured to accept work in accordance to both
+ * mask sets, with the first having higher precedence over the second,
+ * or to accept work in accordance to just one of the two mask sets.
+ * The 'core_num' argument represents a processor core on any node
+ * in a coherent multi-chip system.
+ *
+ * If the 'mask_set' argument is 3, both mask sets are configured
+ * with the same value (which is not typically the intention),
+ * so keep in mind the function needs to be called twice
+ * to set a different value into each of the mask sets,
+ * once with 'mask_set=1' and second time with 'mask_set=2'.
+ */
+static inline void cvmx_pow_set_xgrp_mask(u64 core_num, u8 mask_set, const u64 xgrp_mask[])

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

"Invalid mask set");

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

bits
+ * indicate which groups each core will accept work from.
+ *
+ * @param core_num Processor core to apply mask to.
+ * @param mask_set 7XXX has 2 sets of masks per core.
+ * Bit 0 represents the first mask set, bit 1 -- the second.
+ * @param xgrp_mask Provide pointer to u64 mask[8] output array.

+ *     Total number of groups is divided into a number of
+ *     64-bits mask sets. Each bit in the mask represents
+ *     the core accepts work from the corresponding group.

+ *
+ * NOTE: Each core can be configured to accept work in accordance to both
+ * mask sets, with the first having higher precedence over the second,
+ * or to accept work in accordance to just one of the two mask sets.
+ * The 'core_num' argument represents a processor core on any node
+ * in a coherent multi-chip system.
+ */
+static inline void cvmx_pow_get_xgrp_mask(u64 core_num, u8 mask_set, u64 *xgrp_mask)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mask set");

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

grp),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_tag_type_t tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(cvmx_unlikely(!octeon_has_feature(OCTEON_FEATURE_CN78XX_WQE))) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(current_tag.tag == tag),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

same tag\n", __func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_tag_sw_null() instead\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +25 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag, cvmx_pow_tag_type_t tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(cvmx_unlikely(!octeon_has_feature(OCTEON_FEATURE_CN78XX_WQE))) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

switch cannot be

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(current_tag.tag == tag),

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

same tag\n", __func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_tag_sw_null() instead\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_get_current_wqp())

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the address in the POW(%p)\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_pow_get_current_wqp());

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +38 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

does
+ * not support OCI nodes, the 'node' argument is ignored, and the 'xgrp'
+ * parameter is converted into 'qos' (the lower 3 bits) and 'grp' (the higher
+ * 5 bits), following the backward-compatibility scheme of translating
+ * between new and old style group numbers.
+ */
+static inline void cvmx_pow_work_submit_node(cvmx_wqe_t *wqp, u32 tag, cvmx_pow_tag_type_t tag_type,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(cvmx_unlikely(!octeon_has_feature(OCTEON_FEATURE_CN78XX_WQE))) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +23 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

necessary

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tag_type, u8 xgrp, u64 no_sched,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(cvmx_unlikely(!octeon_has_feature(OCTEON_FEATURE_CN78XX_WQE))) {

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

complete */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

switch cannot

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_NULL,

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

allowed from NULL state\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_POW_TAG_TYPE_ATOMIC) &&

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

after tag is ATOMIC\n",

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +32 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

xgrp)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

***********/
+/* Define usage of bits within the 32 bit tag
values. */
+/******************************************************************* ***********/
+/*
+ * Number of bits of the tag used by software. The SW bits
+ * are always a contiguous block of the high starting at bit 31.
+ * The hardware bits are always the low bits. By default, the top 8 bits
+ * of the tag are reserved for software, and the low 24 are set by the IPD unit.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

executive
+ * uses
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

with
+ * the subgroup. Note that this section describes the format of tags generated
+ * by software - refer to the hardware documentation for a description of the
+ * tags values generated by the packet input hardware.
+ * Subgroups are defined here
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

provided.
+ *
+ * @param sw_bits The upper bits (number depends on configuration) are set
+ * to this value. The remainder of bits are set by the hw_bits
parameter.
+ * @param hw_bits The lower bits (number depends on configuration) are set
+ * to this value. The remainder of bits are set by the sw_bits
parameter.
+ *
+ * @return 32 bit value of the combined hw and sw bits.
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_TAG_SW_SHIFT) |

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_build_mask(CVMX_TAG_SW_BITS));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

with
+ * the CVMX_TAG_SW_BITS define
+ */

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_SSO_GRPX_AQ_CNT(grp));

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +55 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

node to the
+ * calling application. These groups will be for exclusive use of the
+ * application until they are freed.
+ * @param node The numa node for the allocation.
+ * @param base_group Pointer to the initial group, -1 to allocate anywhere.
+ * @param count The number of consecutive groups to allocate.
+ * @return 0 on success and -1 on failure.
+ */
+int cvmx_sso_reserve_group_range(int node, int *base_group, int count);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

count);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +25 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

systems)
+ */
+void cvmx_pow_mask_priority_dump_node(unsigned int node, struct cvmx_coremask *avail_coremask);

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

node systems)
+ */
+static inline void cvmx_pow_mask_priority_dump(struct cvmx_coremask *avail_coremask)

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +18 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +10 -0
new file mode 100644
index 000000000000..19915eb82c51

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

interface
+ * 0 is connected to qlm 0, this macro must be set to 0. When interface 0 is
+ * connected to qlm 2, this macro must be set to 1.
+ */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

interface
+ * 1 is connected to qlm 1, this macro must be set to 0. When interface 1 is
+ * connected to qlm 3, this macro must be set to 1.
+ */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +55 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

chips.
+ *
+ * @return qlm_jtag_field_t structure
+ */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +35 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

value);

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tweaks the
+ * JTAG setting for a QLMs to run better at 5 and 6.25Ghz.
+ */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

tweak.
+ * This function tweaks the JTAG setting for a QLMs for PCIe to run better.
+ */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +59 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM5(SGMII) & DLM6(XFI) */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM6 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM6 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

for DLM5 & DLM6 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM5 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM6 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM6 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DLM6 */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

or QSGMII */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

or QSGMII */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

must be DISABLED */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

PEM1(DLM1.1,DLM2.0), PEM2(DLM2.1) */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

PEM1(DLM1.1,DLM2.0), PEM2(DLM2.1) */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

interface);

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +24 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

equalization
+ */

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +28 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

gser);

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

gser);

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

format, const cvmx_qlm_eye_t *eye);

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +4 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-scratch.h new file +5 -0
new file mode 100644
index 000000000000..d567a8453b7a

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

memory.
+ * Scratch memory is byte addressable - all addresses are byte addresses.
+ */

arch/mips/mach-octeon/include/mach/cvmx-scratch.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

compile

arch/mips/mach-octeon/include/mach/cvmx-scratch.h new file +76 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(u16)value;

arch/mips/mach-octeon/include/mach/cvmx-scratch.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

(u32)value;

arch/mips/mach-octeon/include/mach/cvmx-scratch.h new file +14 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +5 -0
new file mode 100644
index 000000000000..c9e3c8312a65

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

structure.
+ * Since this is a commonly used structure that depends on structures
+ * from several hardware blocks, those definitions have been placed
+ * in this file to create a single point of definition of the wqe
+ * format.
+ * Data structures are still named according to the block that they
+ * relate to.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

	\
arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

\

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

\

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

\

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

\

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +24 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

field.*/

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +35 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

field.*/

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +284 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

translation*/

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +78 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

2 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

when a

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet,

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the work

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

IP, the

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

starts.

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

starts

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

purposes

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the hardware

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +11 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

2 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

4 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +5 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet,

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the work

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

IP, the

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

starts.

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

starts

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

this is

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

separate buffer.
+ *
+ * Must be 8-byte aligned.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +3 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

2 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

when a

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +7 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

4 */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

when a

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +7 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

set. */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +15 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

port
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

indicate

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

"ipd"

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*/

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +129 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

packet.
+ *
+ * @param work pointer to work queue entry
+ *
+ * @return 0 if packet had no error, non-zero to indicate error
code.
+ *
+ * Please refer to HRM for the specific model for full enumaration of error codes.
+ * With Octeon1/Octeon2 models, the returned code indicates L1/L2 errors.
+ * On CN73XX/CN78XX, the return code is the value of PKI_OPCODE_E,
+ * if it is non-zero, otherwise the returned code will be derived from
+ * PKI_ERRLEV_E such that an error indicated in LayerA will return 0x20,
+ * LayerB - 0x30, LayerC - 0x40 and so forth.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

wqe->word2.err_code != 0)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +91 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

channel)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

__func__);

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +37 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP4)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP4)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP4)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP4)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP6)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP6)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +49 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

bcast)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mcast)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +36 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

and
+ * ipv6 extension, it will be flag them.
+ * @param work pointer to work queue entry
+ * @return 1 -- If IP error was found in packet
+ * 0 -- If no IP error was found in packet.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +70 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

translated.
+ * If the packet data is only found inside the work queue entry,
+ * a standard buffer pointer structure is created for it.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

!work->word2.s.software))

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +40 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

data_sz);

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

segment is
+ * written in the opposite endianness of the configured mode. Fix these here.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Quoted 1 line

pki_errata20776) {

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

cvmx_phys_to_ptr(buffer_next.addr - 8);

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*work)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned int bufs)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsupported.
+ *
+ * FIXME: Assuming word4 is present.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP4)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

unsigned int ip_off)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_IP4)

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

header.
+ * Use 'cvmx_wqe_set_l3_ipv6()' if the protocol is IPv6.
+ * When 'set' is false, the call will result in an indication
+ * that the Layer-3 protocol is neither IPv4 nor IPv6.
+ *
+ * FIXME: Add IPV4_OPT handling based on L3 header length.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

headers.
+ */

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +141 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

CVMX_PKI_LTYPE_E_ARP);

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +9 -0

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +20 -0
new file mode 100644
index 000000000000..219625b25688

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0 for EP
+ * mode.
+ * @param pcie_mode Only used when qlm/dlm are in pcie mode.
+ * @param ref_clk_sel Reference clock to use for 70XX where:
+ * 0: 100MHz
+ * 1: 125MHz
+ * 2: 156.25MHz
+ * 3: 161.1328125MHz (CN73XX and CN78XX only)
+ * @param ref_clk_input This selects which reference clock
input to use. For
+ * cn70xx:
+ * 0: DLMC_REF_CLK0
+ * 1: DLMC_REF_CLK1
+ * 2: DLM0_REF_CLK
+ * cn61xx: (not used)
+ * cn78xx/cn76xx/cn73xx:
+ * 0: Internal clock (QLM[0-7]_REF_CLK)
+ * 1: QLMC_REF_CLK0
+ * 2: QLMC_REF_CLK1
+ *
+ * @return Return 0 on success or -1.
+ *
+ * @note When the 161MHz clock is used it can only be used for
+ * XLAUI mode with a 6316 speed or XFI mode with a 103125
speed.
+ * This rate is also only supported for CN73XX and CN78XX.
+ */
+int octeon_configure_qlm(int qlm, int speed, int mode, int rc, int pcie_mode, int ref_clk_sel,

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mode, int rc, int pcie_mode,

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the voltage,
+ * the default value is 7.
+ * @param tx_pre pre-cursor pre-emphasis
+ * @param tx_post post-cursor pre-emphasis.
+ * @param tx_gain Transmit gain. Range 0-7
+ * @param tx_vboost Transmit voltage boost. Range 0-1
+ */
+void octeon_qlm_tune_per_lane_v3(int node, int qlm, int baud_mhz, int lane, int tx_swing,

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

int tx_vboost);

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

the voltage,
+ * the default value is 7.
+ * @param tx_premptap bits [0:3] pre-cursor pre-emphasis, bits[4:8] post-cursor
+ * pre-emphasis.
+ * @param tx_gain Transmit gain. Range 0-7
+ * @param tx_vboost Transmit voltage boost. Range 0-1
+ */
+void octeon_qlm_tune_v3(int node, int qlm, int baud_mhz, int tx_swing, int tx_premptap, int tx_gain,

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

baud_mhz, int mode);

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

channels.
+ *
+ * @param node Node to configure
+ * @param qlm QLM to configure
+ * @param pre_ctle pre-ctle settings for low loss channels

Quoted 8 lines

arch/mips/mach-octeon/include/mach/octeon_qlm.h

Quoted 8 lines

+ */

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

Part of the diff is not shown here. View the raw message.

#55 lore raw

PATCH v3 33/50 mips: octeon: Add misc remaining header files

In reply to Stefan Roese

From: Aaron Williams <[email protected]>

Import misc remaining header files from 2013 U-Boot. These will be used by the later added drivers to support PCIe and networking on the MIPS Octeon II / III platforms.

Cc Aaron Williams <[email protected]>
Cc Chandrakala Chavva <[email protected]>
Cc Daniel Schwierzeck <[email protected]>

---
v3:
- Add missing mach/octeon_eth.h and mach/octeon_pci.h files (forgot to commit it in v1 and v2)

v2:
- Add missing mach/octeon_qlm.h file (forgot to commit it in v1)

 .../mach-octeon/include/mach/cvmx-address.h   |  209 ++
 .../mach-octeon/include/mach/cvmx-cmd-queue.h |  441 +++
 .../mach-octeon/include/mach/cvmx-csr-enums.h |   87 +
 arch/mips/mach-octeon/include/mach/cvmx-csr.h |   78 +
 .../mach-octeon/include/mach/cvmx-error.h     |  456 +++
 arch/mips/mach-octeon/include/mach/cvmx-fpa.h |  217 ++
 .../mips/mach-octeon/include/mach/cvmx-fpa1.h |  196 ++
 .../mips/mach-octeon/include/mach/cvmx-fpa3.h |  566 ++++
 .../include/mach/cvmx-global-resources.h      |  213 ++
 arch/mips/mach-octeon/include/mach/cvmx-gmx.h |   16 +
 .../mach-octeon/include/mach/cvmx-hwfau.h     |  606 ++++
 .../mach-octeon/include/mach/cvmx-hwpko.h     |  570 ++++
 arch/mips/mach-octeon/include/mach/cvmx-ilk.h |  154 +
 arch/mips/mach-octeon/include/mach/cvmx-ipd.h |  233 ++
 .../mach-octeon/include/mach/cvmx-packet.h    |   40 +
 .../mips/mach-octeon/include/mach/cvmx-pcie.h |  279 ++
 arch/mips/mach-octeon/include/mach/cvmx-pip.h | 1080 ++++++
 .../include/mach/cvmx-pki-resources.h         |  157 +
 arch/mips/mach-octeon/include/mach/cvmx-pki.h |  970 ++++++
 .../mach/cvmx-pko-internal-ports-range.h      |   43 +
 .../include/mach/cvmx-pko3-queue.h            |  175 +
 arch/mips/mach-octeon/include/mach/cvmx-pow.h | 2991 +++++++++++++++++
 arch/mips/mach-octeon/include/mach/cvmx-qlm.h |  304 ++
 .../mach-octeon/include/mach/cvmx-scratch.h   |  113 +
 arch/mips/mach-octeon/include/mach/cvmx-wqe.h | 1462 ++++++++
 .../mach-octeon/include/mach/octeon_eth.h     |  141 +
 .../mach-octeon/include/mach/octeon_fdt.h     |  268 ++
 .../mach-octeon/include/mach/octeon_pci.h     |   68 +
 .../mach-octeon/include/mach/octeon_qlm.h     |  109 +
 29 files changed, 12242 insertions(+)
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-address.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-csr-enums.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-csr.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-error.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa1.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa3.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-global-resources.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-gmx.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-hwfau.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-hwpko.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ilk.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ipd.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-packet.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pcie.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pip.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko-internal-ports-range.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pow.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-qlm.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-scratch.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-wqe.h
 create mode 100644 arch/mips/mach-octeon/include/mach/octeon_eth.h
 create mode 100644 arch/mips/mach-octeon/include/mach/octeon_fdt.h
 create mode 100644 arch/mips/mach-octeon/include/mach/octeon_pci.h
 create mode 100644 arch/mips/mach-octeon/include/mach/octeon_qlm.h
arch/mips/mach-octeon/include/mach/cvmx-address.h new file +209 -0
new file mode 100644
index 000000000000..984f574a75bb
@@ -0,0 +1,209 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Typedefs and defines for working with Octeon physical addresses.
+ */
+
+#ifndef __CVMX_ADDRESS_H__
+#define __CVMX_ADDRESS_H__
+
+typedef enum {
+	CVMX_MIPS_SPACE_XKSEG = 3LL,
+	CVMX_MIPS_SPACE_XKPHYS = 2LL,
+	CVMX_MIPS_SPACE_XSSEG = 1LL,
+	CVMX_MIPS_SPACE_XUSEG = 0LL
+} cvmx_mips_space_t;
+
+typedef enum {
+	CVMX_MIPS_XKSEG_SPACE_KSEG0 = 0LL,
+	CVMX_MIPS_XKSEG_SPACE_KSEG1 = 1LL,
+	CVMX_MIPS_XKSEG_SPACE_SSEG = 2LL,
+	CVMX_MIPS_XKSEG_SPACE_KSEG3 = 3LL
+} cvmx_mips_xkseg_space_t;
+
+/* decodes <14:13> of a kseg3 window address */
+typedef enum {
+	CVMX_ADD_WIN_SCR = 0L,
+	CVMX_ADD_WIN_DMA = 1L,
+	CVMX_ADD_WIN_UNUSED = 2L,
+	CVMX_ADD_WIN_UNUSED2 = 3L
+} cvmx_add_win_dec_t;
+
+/* decode within DMA space */
+typedef enum {
+	CVMX_ADD_WIN_DMA_ADD = 0L,
+	CVMX_ADD_WIN_DMA_SENDMEM = 1L,
+	/* store data must be normal DRAM memory space address in this case */
+	CVMX_ADD_WIN_DMA_SENDDMA = 2L,
+	/* see CVMX_ADD_WIN_DMA_SEND_DEC for data contents */
+	CVMX_ADD_WIN_DMA_SENDIO = 3L,
+	/* store data must be normal IO space address in this case */
+	CVMX_ADD_WIN_DMA_SENDSINGLE = 4L,
+	/* no write buffer data needed/used */
+} cvmx_add_win_dma_dec_t;
+
+/**
+ *   Physical Address Decode
+ *
+ * Octeon-I HW never interprets this X (<39:36> reserved
+ * for future expansion), software should set to 0.
+ *
+ *  - 0x0 XXX0 0000 0000 to      DRAM         Cached
+ *  - 0x0 XXX0 0FFF FFFF
+ *
+ *  - 0x0 XXX0 1000 0000 to      Boot Bus     Uncached  (Converted to 0x1 00X0 1000 0000
+ *  - 0x0 XXX0 1FFF FFFF         + EJTAG                           to 0x1 00X0 1FFF FFFF)
+ *
+ *  - 0x0 XXX0 2000 0000 to      DRAM         Cached
+ *  - 0x0 XXXF FFFF FFFF
+ *
+ *  - 0x1 00X0 0000 0000 to      Boot Bus     Uncached
+ *  - 0x1 00XF FFFF FFFF
+ *
+ *  - 0x1 01X0 0000 0000 to      Other NCB    Uncached
+ *  - 0x1 FFXF FFFF FFFF         devices
+ *
+ * Decode of all Octeon addresses
+ */
+typedef union {
+	u64 u64;
+	struct {
+		cvmx_mips_space_t R : 2;
+		u64 offset : 62;
+	} sva;
+
+	struct {
+		u64 zeroes : 33;
+		u64 offset : 31;
+	} suseg;
+
+	struct {
+		u64 ones : 33;
+		cvmx_mips_xkseg_space_t sp : 2;
+		u64 offset : 29;
+	} sxkseg;
+
+	struct {
+		cvmx_mips_space_t R : 2;
+		u64 cca : 3;
+		u64 mbz : 10;
+		u64 pa : 49;
+	} sxkphys;
+
+	struct {
+		u64 mbz : 15;
+		u64 is_io : 1;
+		u64 did : 8;
+		u64 unaddr : 4;
+		u64 offset : 36;
+	} sphys;
+
+	struct {
+		u64 zeroes : 24;
+		u64 unaddr : 4;
+		u64 offset : 36;
+	} smem;
+
+	struct {
+		u64 mem_region : 2;
+		u64 mbz : 13;
+		u64 is_io : 1;
+		u64 did : 8;
+		u64 unaddr : 4;
+		u64 offset : 36;
+	} sio;
+
+	struct {
+		u64 ones : 49;
+		cvmx_add_win_dec_t csrdec : 2;
+		u64 addr : 13;
+	} sscr;
+
+	/* there should only be stores to IOBDMA space, no loads */
+	struct {
+		u64 ones : 49;
+		cvmx_add_win_dec_t csrdec : 2;
+		u64 unused2 : 3;
+		cvmx_add_win_dma_dec_t type : 3;
+		u64 addr : 7;
+	} sdma;
+
+	struct {
+		u64 didspace : 24;
+		u64 unused : 40;
+	} sfilldidspace;
+} cvmx_addr_t;
+
+/* These macros for used by 32 bit applications */
+
+#define CVMX_MIPS32_SPACE_KSEG0	     1l
+#define CVMX_ADD_SEG32(segment, add) (((s32)segment << 31) | (s32)(add))
+
+/*
+ * Currently all IOs are performed using XKPHYS addressing. Linux uses the
+ * CvmMemCtl register to enable XKPHYS addressing to IO space from user mode.
+ * Future OSes may need to change the upper bits of IO addresses. The
+ * following define controls the upper two bits for all IO addresses generated
+ * by the simple executive library
+ */
+#define CVMX_IO_SEG CVMX_MIPS_SPACE_XKPHYS
+
+/* These macros simplify the process of creating common IO addresses */
+#define CVMX_ADD_SEG(segment, add) ((((u64)segment) << 62) | (add))
+
+#define CVMX_ADD_IO_SEG(add) (add)
+
+#define CVMX_ADDR_DIDSPACE(did)	   (((CVMX_IO_SEG) << 22) | ((1ULL) << 8) | (did))
+#define CVMX_ADDR_DID(did)	   (CVMX_ADDR_DIDSPACE(did) << 40)
+#define CVMX_FULL_DID(did, subdid) (((did) << 3) | (subdid))
+
+/* from include/ncb_rsl_id.v */
+#define CVMX_OCT_DID_MIS  0ULL /* misc stuff */
+#define CVMX_OCT_DID_GMX0 1ULL
+#define CVMX_OCT_DID_GMX1 2ULL
+#define CVMX_OCT_DID_PCI  3ULL
+#define CVMX_OCT_DID_KEY  4ULL
+#define CVMX_OCT_DID_FPA  5ULL
+#define CVMX_OCT_DID_DFA  6ULL
+#define CVMX_OCT_DID_ZIP  7ULL
+#define CVMX_OCT_DID_RNG  8ULL
+#define CVMX_OCT_DID_IPD  9ULL
+#define CVMX_OCT_DID_PKT  10ULL
+#define CVMX_OCT_DID_TIM  11ULL
+#define CVMX_OCT_DID_TAG  12ULL
+/* the rest are not on the IO bus */
+#define CVMX_OCT_DID_L2C  16ULL
+#define CVMX_OCT_DID_LMC  17ULL
+#define CVMX_OCT_DID_SPX0 18ULL
+#define CVMX_OCT_DID_SPX1 19ULL
+#define CVMX_OCT_DID_PIP  20ULL
+#define CVMX_OCT_DID_ASX0 22ULL
+#define CVMX_OCT_DID_ASX1 23ULL
+#define CVMX_OCT_DID_IOB  30ULL
+
+#define CVMX_OCT_DID_PKT_SEND	 CVMX_FULL_DID(CVMX_OCT_DID_PKT, 2ULL)
+#define CVMX_OCT_DID_TAG_SWTAG	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 0ULL)
+#define CVMX_OCT_DID_TAG_TAG1	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 1ULL)
+#define CVMX_OCT_DID_TAG_TAG2	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 2ULL)
+#define CVMX_OCT_DID_TAG_TAG3	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 3ULL)
+#define CVMX_OCT_DID_TAG_NULL_RD CVMX_FULL_DID(CVMX_OCT_DID_TAG, 4ULL)
+#define CVMX_OCT_DID_TAG_TAG5	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 5ULL)
+#define CVMX_OCT_DID_TAG_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 7ULL)
+#define CVMX_OCT_DID_FAU_FAI	 CVMX_FULL_DID(CVMX_OCT_DID_IOB, 0ULL)
+#define CVMX_OCT_DID_TIM_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_TIM, 0ULL)
+#define CVMX_OCT_DID_KEY_RW	 CVMX_FULL_DID(CVMX_OCT_DID_KEY, 0ULL)
+#define CVMX_OCT_DID_PCI_6	 CVMX_FULL_DID(CVMX_OCT_DID_PCI, 6ULL)
+#define CVMX_OCT_DID_MIS_BOO	 CVMX_FULL_DID(CVMX_OCT_DID_MIS, 0ULL)
+#define CVMX_OCT_DID_PCI_RML	 CVMX_FULL_DID(CVMX_OCT_DID_PCI, 0ULL)
+#define CVMX_OCT_DID_IPD_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_IPD, 7ULL)
+#define CVMX_OCT_DID_DFA_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_DFA, 7ULL)
+#define CVMX_OCT_DID_MIS_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_MIS, 7ULL)
+#define CVMX_OCT_DID_ZIP_CSR	 CVMX_FULL_DID(CVMX_OCT_DID_ZIP, 0ULL)
+
+/* Cast to unsigned long long, mainly for use in printfs. */
+#define CAST_ULL(v) ((unsigned long long)(v))
+
+#define UNMAPPED_PTR(x) ((1ULL << 63) | (x))
+
+#endif /* __CVMX_ADDRESS_H__ */
arch/mips/mach-octeon/include/mach/cvmx-cmd-queue.h new file +441 -0

441 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-csr-enums.h new file +87 -0

87 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-csr.h new file +78 -0

78 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-error.h new file +456 -0

456 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-fpa.h new file +217 -0

217 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-fpa1.h new file +196 -0

196 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-fpa3.h new file +566 -0

566 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-global-resources.h new file +213 -0

213 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-gmx.h new file +16 -0
new file mode 100644
index 000000000000..2df7da102a0f
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ *
+ * Interface to the GMX hardware.
+ */
+
+#ifndef __CVMX_GMX_H__
+#define __CVMX_GMX_H__
+
+/* CSR typedefs have been moved to cvmx-gmx-defs.h */
+
+int cvmx_gmx_set_backpressure_override(u32 interface, u32 port_mask);
+int cvmx_agl_set_backpressure_override(u32 interface, u32 port_mask);
+
+#endif
arch/mips/mach-octeon/include/mach/cvmx-hwfau.h new file +606 -0

521 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-hwpko.h new file +570 -0

570 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-ilk.h new file +154 -0

154 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-ipd.h new file +233 -0

233 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-packet.h new file +40 -0
new file mode 100644
index 000000000000..f3cfe9c64f43

Lines of this file are not shown. View the raw message.

arch/mips/mach-octeon/include/mach/cvmx-pcie.h new file +279 -0

279 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-pip.h new file +1080 -0

1,080 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-pki-resources.h new file +157 -0

157 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-pki.h new file +970 -0

970 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-pko-internal-ports-range.h new file +43 -0

43 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-pko3-queue.h new file +175 -0

175 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-pow.h new file +2991 -0

2,991 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-qlm.h new file +304 -0

304 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-scratch.h new file +113 -0

113 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/cvmx-wqe.h new file +1462 -0

1,462 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/octeon_eth.h new file +141 -0

141 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/octeon_fdt.h new file +268 -0

268 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/octeon_pci.h new file +68 -0

68 lines not on this page · raw message

arch/mips/mach-octeon/include/mach/octeon_qlm.h new file +109 -0

109 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.31.1

Part of the diff is not shown here. View the raw message.

#56 lore raw

cover mips: octeon: Add serdes and device helper support incl. DM PCIe driver

In reply to Stefan Roese

Am Freitag, den 11.12.2020, 17:05 +0100 schrieb Stefan Roese:

Quoted 35 lines

This patchset adds the serdes and (mostly networking) device helper macros and functions, needed to support the still missing Octeon II / III devices in mainline U-Boot.

Please excuse the massive amount of files in this patch series. Also the
sometimes huge files (mostly headers with register definitions) that I
needed to include.

The infrastructure code with all the headers is ported without any intended functional changes from the 2013 Cavium / Marvell U-Boot version. It has undergone many hours of extensive code cleanup and reformatting. Some of it done by using tools (checkpatch, Lindent, clang
format etc) and also some of it done manually, as I couldn't find some
tools that could do the needed work in a reliable and functional way. The result is that checkpatch now only throws a "few" warnings that are
left. Some of those can't be removed without an even more extensive cleanup / rewrite of the code, like the addition of typedefs.

The added headers and helper functions will be used by the upcoming support for the Octeon II / III networking drivers, including PHY & switch support. It was not easily possible to split these infrastructure
files into a separate patchset, as it is heavily interconnected in the
common QLM/DLM serdes interface initialization. The result is, that the
upcoming ethernet driver support will be much smaller (this is at least
my current assumption).

Quoted 8 lines

The added PCIe RC support with the included DM PCIe driver is the first
driver making use of this Octeon serdes infrastructure. This has been tested with an Intel E1000 PCIe network card in the Octeon 7304 EBB.

Thanks,
Stefan

series applied to u-boot-mips, thanks.

Quoted 318 lines

Aaron Williams (42):
mips: octeon: Add misc cvmx-helper header files
mips: octeon: Add cvmx-agl-defs.h header file
mips: octeon: Add cvmx-asxx-defs.h header file
mips: octeon: Add cvmx-bgxx-defs.h header file
mips: octeon: Add cvmx-ciu-defs.h header file
mips: octeon: Add cvmx-dbg-defs.h header file
mips: octeon: Add cvmx-dpi-defs.h header file
mips: octeon: Add cvmx-dtx-defs.h header file
mips: octeon: Add cvmx-fpa-defs.h header file
mips: octeon: Add cvmx-gmxx-defs.h header file
mips: octeon: Add cvmx-gserx-defs.h header file
mips: octeon: Add cvmx-ipd-defs.h header file
mips: octeon: Add cvmx-l2c-defs.h header file
mips: octeon: Add cvmx-mio-defs.h header file
mips: octeon: Add cvmx-npi-defs.h header file
mips: octeon: Add cvmx-pcieepx-defs.h header file
mips: octeon: Add cvmx-pciercx-defs.h header file
mips: octeon: Add cvmx-pcsx-defs.h header file
mips: octeon: Add cvmx-pemx-defs.h header file
mips: octeon: Add cvmx-pepx-defs.h header file
mips: octeon: Add cvmx-pip-defs.h header file
mips: octeon: Add cvmx-pki-defs.h header file
mips: octeon: Add cvmx-pko-defs.h header file
mips: octeon: Add cvmx-pow-defs.h header file
mips: octeon: Add cvmx-rst-defs.h header file
mips: octeon: Add cvmx-sata-defs.h header file
mips: octeon: Add cvmx-sli-defs.h header file
mips: octeon: Add cvmx-smix-defs.h header file
mips: octeon: Add cvmx-sriomaintx-defs.h header file
mips: octeon: Add cvmx-sriox-defs.h header file
mips: octeon: Add cvmx-sso-defs.h header file
mips: octeon: Add misc remaining header files
mips: octeon: Add cvmx-helper-cfg.c
mips: octeon: Add cvmx-helper-fdt.c
mips: octeon: Add cvmx-helper-jtag.c
mips: octeon: Add cvmx-helper-util.c
mips: octeon: Add cvmx-helper.c
mips: octeon: Add cvmx-pcie.c
mips: octeon: Add cvmx-qlm.c
mips: octeon: Add octeon_fdt.c
mips: octeon: Add octeon_qlm.c
mips: octeon: octeon_ebb7304: Add board specific QLM init code

Stefan Roese (8):
mips: global_data.h: Add Octeon specific data to arch_global_data
struct
mips: octeon: Misc changes required because of the newly added
headers
mips: octeon: Move cvmx-lmcx-defs.h from mach/cvmx to mach
mips: octeon: Makefile: Enable building of the newly added C files
mips: octeon: Kconfig: Enable CONFIG_SYS_PCI_64BIT
mips: octeon: mrvl,cn73xx.dtsi: Add PCIe controller DT node
mips: octeon: Add Octeon PCIe host controller driver
mips: octeon: octeon_ebb7304_defconfig: Enable Octeon PCIe and
E1000

 arch/mips/dts/mrvl,cn73xx.dtsi                |   16 +
 arch/mips/include/asm/global_data.h           |    9 +
 arch/mips/mach-octeon/Kconfig                 |    4 +
 arch/mips/mach-octeon/Makefile                |   11 +
 arch/mips/mach-octeon/bootoctlinux.c          |    1 +
 arch/mips/mach-octeon/cvmx-bootmem.c          |    6 -
 arch/mips/mach-octeon/cvmx-coremask.c         |    1 +
 arch/mips/mach-octeon/cvmx-helper-cfg.c       | 1914 ++++
 arch/mips/mach-octeon/cvmx-helper-fdt.c       |  970 ++
 arch/mips/mach-octeon/cvmx-helper-jtag.c      |  172 +
 arch/mips/mach-octeon/cvmx-helper-util.c      | 1225 +++
 arch/mips/mach-octeon/cvmx-helper.c           | 2611 +++++
 arch/mips/mach-octeon/cvmx-pcie.c             | 2487 +++++
 arch/mips/mach-octeon/cvmx-qlm.c              | 2350 +++++
 .../mach-octeon/include/mach/cvmx-address.h   |  209 +
 .../mach-octeon/include/mach/cvmx-agl-defs.h  | 3135 ++++++
 .../mach-octeon/include/mach/cvmx-asxx-defs.h |  709 ++
 .../mach-octeon/include/mach/cvmx-bgxx-defs.h | 4106 +++++++
 .../mach-octeon/include/mach/cvmx-ciu-defs.h  | 7351 +++++++++++++
 .../mach-octeon/include/mach/cvmx-cmd-queue.h |  441 +
 .../mach-octeon/include/mach/cvmx-csr-enums.h |   87 +
 arch/mips/mach-octeon/include/mach/cvmx-csr.h |   78 +
 .../mach-octeon/include/mach/cvmx-dbg-defs.h  |   33 +
 .../mach-octeon/include/mach/cvmx-dpi-defs.h  | 1460 +++
 .../mach-octeon/include/mach/cvmx-dtx-defs.h  | 6962 ++++++++++++
 .../mach-octeon/include/mach/cvmx-error.h     |  456 +
 .../mach-octeon/include/mach/cvmx-fpa-defs.h  | 1866 ++++
 arch/mips/mach-octeon/include/mach/cvmx-fpa.h |  217 +
 .../mips/mach-octeon/include/mach/cvmx-fpa1.h |  196 +
 .../mips/mach-octeon/include/mach/cvmx-fpa3.h |  566 +
 .../include/mach/cvmx-global-resources.h      |  213 +
 arch/mips/mach-octeon/include/mach/cvmx-gmx.h |   16 +
 .../mach-octeon/include/mach/cvmx-gmxx-defs.h | 6378 +++++++++++
 .../include/mach/cvmx-gserx-defs.h            | 2191 ++++
 .../include/mach/cvmx-helper-agl.h            |   68 +
 .../include/mach/cvmx-helper-bgx.h            |  335 +
 .../include/mach/cvmx-helper-board.h          |  558 +
 .../include/mach/cvmx-helper-cfg.h            |  884 ++
 .../include/mach/cvmx-helper-errata.h         |   50 +
 .../include/mach/cvmx-helper-fdt.h            |  568 +
 .../include/mach/cvmx-helper-fpa.h            |   43 +
 .../include/mach/cvmx-helper-gpio.h           |  427 +
 .../include/mach/cvmx-helper-ilk.h            |   93 +
 .../include/mach/cvmx-helper-ipd.h            |   16 +
 .../include/mach/cvmx-helper-jtag.h           |   84 +
 .../include/mach/cvmx-helper-loop.h           |   37 +
 .../include/mach/cvmx-helper-npi.h            |   42 +
 .../include/mach/cvmx-helper-pki.h            |  319 +
 .../include/mach/cvmx-helper-pko.h            |   51 +
 .../include/mach/cvmx-helper-pko3.h           |   76 +
 .../include/mach/cvmx-helper-rgmii.h          |   99 +
 .../include/mach/cvmx-helper-sfp.h            |  437 +
 .../include/mach/cvmx-helper-sgmii.h          |   81 +
 .../include/mach/cvmx-helper-spi.h            |   73 +
 .../include/mach/cvmx-helper-srio.h           |   72 +
 .../include/mach/cvmx-helper-util.h           |  412 +
 .../include/mach/cvmx-helper-xaui.h           |  108 +
 .../mach-octeon/include/mach/cvmx-helper.h    |  565 +
 .../mach-octeon/include/mach/cvmx-hwfau.h     |  606 ++
 .../mach-octeon/include/mach/cvmx-hwpko.h     |  570 +
 arch/mips/mach-octeon/include/mach/cvmx-ilk.h |  154 +
 .../mach-octeon/include/mach/cvmx-ipd-defs.h  | 1925 ++++
 arch/mips/mach-octeon/include/mach/cvmx-ipd.h |  233 +
 .../mach-octeon/include/mach/cvmx-l2c-defs.h  |  172 +
 .../include/mach/{cvmx => }/cvmx-lmcx-defs.h  |    0
 .../mach-octeon/include/mach/cvmx-mio-defs.h  |  353 +
 .../mach-octeon/include/mach/cvmx-npi-defs.h  | 1953 ++++
 .../mach-octeon/include/mach/cvmx-packet.h    |   40 +
 .../mips/mach-octeon/include/mach/cvmx-pcie.h |  279 +
 .../include/mach/cvmx-pcieepx-defs.h          | 6848 ++++++++++++
 .../include/mach/cvmx-pciercx-defs.h          | 5586 ++++++++++
 .../mach-octeon/include/mach/cvmx-pcsx-defs.h | 1005 ++
 .../mach-octeon/include/mach/cvmx-pemx-defs.h | 2028 ++++
 .../mach-octeon/include/mach/cvmx-pexp-defs.h | 1382 +++
 .../mach-octeon/include/mach/cvmx-pip-defs.h  | 3040 ++++++
 arch/mips/mach-octeon/include/mach/cvmx-pip.h | 1080 ++
 .../mach-octeon/include/mach/cvmx-pki-defs.h  | 2353 +++++
 .../include/mach/cvmx-pki-resources.h         |  157 +
 arch/mips/mach-octeon/include/mach/cvmx-pki.h |  970 ++
 .../mach-octeon/include/mach/cvmx-pko-defs.h  | 9388
+++++++++++++++++
 .../mach/cvmx-pko-internal-ports-range.h      |   43 +
 .../include/mach/cvmx-pko3-queue.h            |  175 +
 .../mach-octeon/include/mach/cvmx-pow-defs.h  | 1135 ++
 arch/mips/mach-octeon/include/mach/cvmx-pow.h | 2991 ++++++
 arch/mips/mach-octeon/include/mach/cvmx-qlm.h |  304 +
 .../mips/mach-octeon/include/mach/cvmx-regs.h |  330 +-
 .../mach-octeon/include/mach/cvmx-rst-defs.h  |   77 +
 .../mach-octeon/include/mach/cvmx-sata-defs.h |  311 +
 .../mach-octeon/include/mach/cvmx-scratch.h   |  113 +
 .../mach-octeon/include/mach/cvmx-sli-defs.h  | 6548 ++++++++++++
 .../mach-octeon/include/mach/cvmx-smix-defs.h |  360 +
 .../include/mach/cvmx-sriomaintx-defs.h       |   61 +
 .../include/mach/cvmx-sriox-defs.h            |   44 +
 .../mach-octeon/include/mach/cvmx-sso-defs.h  | 2904 +++++
 arch/mips/mach-octeon/include/mach/cvmx-wqe.h | 1462 +++
 .../mach-octeon/include/mach/octeon-feature.h |    2 +
 .../mach-octeon/include/mach/octeon-model.h   |    2 +
 .../mach-octeon/include/mach/octeon_ddr.h     |  189 +-
 arch/mips/mach-octeon/octeon_fdt.c            | 1040 ++
 arch/mips/mach-octeon/octeon_qlm.c            | 5853 ++++++++++
 board/Marvell/octeon_ebb7304/board.c          |  732 +-
 configs/octeon_ebb7304_defconfig              |    5 +-
 drivers/pci/Kconfig                           |    6 +
 drivers/pci/Makefile                          |    1 +
 drivers/pci/pcie_octeon.c                     |  159 +
 drivers/ram/octeon/octeon3_lmc.c              |   28 +-
 drivers/ram/octeon/octeon_ddr.c               |   22 +-
 107 files changed, 118724 insertions(+), 240 deletions(-)
 create mode 100644 arch/mips/mach-octeon/cvmx-helper-cfg.c
 create mode 100644 arch/mips/mach-octeon/cvmx-helper-fdt.c
 create mode 100644 arch/mips/mach-octeon/cvmx-helper-jtag.c
 create mode 100644 arch/mips/mach-octeon/cvmx-helper-util.c
 create mode 100644 arch/mips/mach-octeon/cvmx-helper.c
 create mode 100644 arch/mips/mach-octeon/cvmx-pcie.c
 create mode 100644 arch/mips/mach-octeon/cvmx-qlm.c
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-address.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-agl-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-asxx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-bgxx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ciu-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-cmd-
queue.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-csr-
enums.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-csr.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-dbg-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-dpi-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-dtx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-error.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa1.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-fpa3.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-global-
resources.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-gmx.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-gmxx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-gserx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
agl.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
bgx.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
board.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
cfg.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
errata.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
fdt.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
fpa.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
gpio.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
ilk.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
ipd.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
jtag.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
loop.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
npi.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
pki.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
pko.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
pko3.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
rgmii.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
sfp.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
sgmii.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
spi.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
srio.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
util.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper-
xaui.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-helper.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-hwfau.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-hwpko.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ilk.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ipd-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-ipd.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-l2c-
defs.h
 rename arch/mips/mach-octeon/include/mach/{cvmx => }/cvmx-lmcx-
defs.h (100%)
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-mio-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-npi-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-packet.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pcie.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pcieepx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pciercx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pcsx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pemx-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pexp-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pip-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pip.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki-
resources.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pki.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko-
internal-ports-range.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pko3-
queue.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pow-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-pow.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-qlm.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-rst-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-sata-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-scratch.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-sli-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-smix-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-
sriomaintx-defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-sriox-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-sso-
defs.h
 create mode 100644 arch/mips/mach-octeon/include/mach/cvmx-wqe.h
 create mode 100644 arch/mips/mach-octeon/octeon_fdt.c
 create mode 100644 arch/mips/mach-octeon/octeon_qlm.c
 create mode 100644 drivers/pci/pcie_octeon.c
Signature · 1 line
- Daniel