Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/cavium/dev Remove unused Timer Unit register d...
details: https://anonhg.NetBSD.org/src/rev/4d2828f707c7
branches: trunk
changeset: 933796:4d2828f707c7
user: simonb <simonb%NetBSD.org@localhost>
date: Sun May 31 06:23:49 2020 +0000
description:
Remove unused Timer Unit register definitions and stubs. Can be
resurrected from the attic in the unlikely event we'll ever have
a driver for this device.
diffstat:
sys/arch/mips/cavium/dev/octeon_tim.c | 178 ----------------------------
sys/arch/mips/cavium/dev/octeon_timreg.h | 192 -------------------------------
2 files changed, 0 insertions(+), 370 deletions(-)
diffs (truncated from 378 to 300 lines):
diff -r 83d31c431ccb -r 4d2828f707c7 sys/arch/mips/cavium/dev/octeon_tim.c
--- a/sys/arch/mips/cavium/dev/octeon_tim.c Sun May 31 06:17:23 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/* $NetBSD: octeon_tim.c,v 1.1 2015/04/29 08:32:01 hikaru Exp $ */
-
-/*
- * Copyright (c) 2007 Internet Initiative Japan, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: octeon_tim.c,v 1.1 2015/04/29 08:32:01 hikaru Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/types.h>
-
-#include <sys/bus.h>
-
-#include <mips/cavium/include/iobusvar.h>
-#include <mips/cavium/dev/octeon_timreg.h>
-
-/* ---- definitions */
-
-struct _ring {
- struct _bucket *r_buckets;
- size_t r_nbuckets;
-
- /* per-ring parameters */
- size_t r_chunksize;
-};
-
-struct _bucket {
- struct _ring *b_ring; /* back pointer */
-
- int b_id;
- struct _bucket *b_first;
- uint32_t b_nentries;
- uint32_t b_remainder;
- struct _bucket *b_current;
- /* ... */
-};
-
-struct _chunk {
- struct _bucket *c_bucket; /* back pointer */
-
- struct _entry c_entries[];
- /* ... */
-};
-
-struct _entry {
- bus_addr_t e_wqe;
-};
-
-struct _context {
- struct _ring *x_ring;
- struct _bucket *x_bucket;
-};
-
-/* ---- global functions */
-
-void
-octeon_tim_init(void)
-{
- /* .... */
-}
-
-/* ---- local functions */
-
-/* ring (an array of buckets) */
-
-int
-_ring_add_wqe(struct _ring *ring, int bid, bus_addr_t wqe, ...)
-{
- int result = 0;
- struct _bucket *bucket;
-
- bucket = &ring->r_buckets[bid];
- result = _bucket_add_wqe(ring, bucket, ...);
- return result;
-}
-
-/* bucket (an entry with a linked list of chunks) */
-
-int
-_bucket_add_wqe(struct _ring *ring, struct _bucket *bucket, bus_addr_t wqe/* pointer */)
-{
- int result = 0;
- struct _entry *entry;
-
- if (bucket->b_remainder == 0) {
- status = _bucket_alloc_chunk(ring, bucket);
- if (status != 0) {
- result = status;
- goto out;
- }
- }
- entry = _bucket_get_current_entry(ring, bucket);
- entry->e_wqe = wqe;
-
-out:
- return result;
-}
-
-int
-_bucket_alloc_chunk(struct _ring *ring, struct _bucket *bucket)
-{
- int result = 0;
- struct _chunk *chunk;
-
- status = _chunk_alloc(ring, &chunk);
- if (status != 0) {
- result = status;
- goto out;
- }
- _bucket_append_chunk(...);
-
-out:
- return result;
-}
-
-void
-_bucket_append_chunk(...)
-{
- if (bucket->b_current == NULL)
- bucket->b_first = chunk;
- else
- bucket->b_current->b_next;
- bucket->b_current = chunk;
- bucket->b_remainder += ring->r_chunksize;
-}
-
-struct _entry *
-_bucket_get_current_entry(...)
-{
- return &bucket->b_current->c_entries
- [ring->r_chunksize - bucket->b_remainder];
-}
-
-/* chunk (an array of pointers to WQE) */
-
-int
-_chunk_alloc(struct _ring *ring, struct _chunk **rchunk)
-{
- int result = 0;
- struct _chunk *chunk;
-
- chunk = fpa_alloc(
- /* array of entires (pointer to WQE) */
- sizeof(struct _entry) * ring->r_chunksize +
- /* pointer to next chunk */
- sizeof(uint64_t));
- if (chunk == NULL) {
- result = ENOMEM;
- goto out;
- }
-
-out:
- return result;
-}
diff -r 83d31c431ccb -r 4d2828f707c7 sys/arch/mips/cavium/dev/octeon_timreg.h
--- a/sys/arch/mips/cavium/dev/octeon_timreg.h Sun May 31 06:17:23 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/* $NetBSD: octeon_timreg.h,v 1.1 2015/04/29 08:32:01 hikaru Exp $ */
-
-/*
- * Copyright (c) 2007 Internet Initiative Japan, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Timer Registers
- */
-
-#ifndef _OCTEON_TIMREG_H_
-#define _OCTEON_TIMREG_H_
-
-/* ---- register addresses */
-
-#define TIM_REG_FLAGS 0x0001180058000000ULL
-#define TIM_REG_READ_IDX 0x0001180058000008ULL
-#define TIM_REG_BIST_RESULT 0x0001180058000000ULL
-#define TIM_REG_ERROR 0x0001180058000088ULL
-#define TIM_REG_INT_MASK 0x0001180058000090ULL
-#define TIM_MEM_RING0 0x0001180058001000ULL
-#define TIM_MEM_RING1 0x0001180058001008ULL
-#define TIM_MEM_DEBUG0 0x0001180058001100ULL
-#define TIM_MEM_DEBUG1 0x0001180058001108ULL
-#define TIM_MEM_DEBUG2 0x0001180058001110ULL
-
-/* ---- register bits */
-
-#define TIM_REG_FLAGS_XXX_63_3 UINT64_C(0xfffffffffffffff8)
-#define TIM_REG_FLAGS_RESET UINT64_C(0x0000000000000004)
-#define TIM_REG_FLAGS_ENA_DWB UINT64_C(0x0000000000000002)
-#define TIM_REG_FLAGS_ENA_TIM UINT64_C(0x0000000000000001)
-
-#define TIM_REG_READ_IDX_XXX_63_16 UINT64_C(0xffffffffffff0000)
-#define TIM_REG_READ_IDX_INC UINT64_C(0x000000000000ff00)
-#define TIM_REG_READ_IDX_IDX UINT64_C(0x00000000000000ff)
-
-#define TIM_REG_BIST_RESULT_XXX_63_4 UINT64_C(0xfffffffffffffff0)
-#define TIM_REG_BIST_RESULT_STA UINT64_C(0x000000000000000c)
-#define TIM_REG_BIST_RESULT_NCB UINT64_C(0x0000000000000002)
-#define TIM_REG_BIST_RESULT_CTL UINT64_C(0x0000000000000001)
-
-#define TIM_REG_ERROR_XXX_63_16 UINT64_C(0xffffffffffff0000)
-#define TIM_REG_ERROR_MASK UINT64_C(0x000000000000ffff)
-
-#define TIM_REG_INT_XXX_63_16 UINT64_C(0xffffffffffff0000)
-#define TIM_REG_INT_MASK UINT64_C(0x000000000000ffff)
-
-#define TIM_MEM_RING0_XXX_63_55 UINT64_C(0xff80000000000000)
-#define TIM_MEM_RING0_BASE UINT64_C(0x007fffffff000000)
-#define TIM_MEM_RING0_BSIZE UINT64_C(0x0000000000fffff0)
-#define TIM_MEM_RING0_RID UINT64_C(0x000000000000000f)
-
-#define TIM_MEM_RING1_XXX_63_43 UINT64_C(0xfffff80000000000)
-#define TIM_MEM_RING1_ENA UINT64_C(0x0000040000000000)
-#define TIM_MEM_RING1_CPOOL UINT64_C(0x0000038000000000)
-#define TIM_MEM_RING1_CSIZE UINT64_C(0x0000007ffc000000)
-#define TIM_MEM_RING1_INTERVAL UINT64_C(0x0000000003fffff0)
-#define TIM_MEM_RING1_RID UINT64_C(0x000000000000000f)
-
-#define TIM_MEM_DEBUG0_XXX_63_48 UINT64_C(0xffff000000000000)
-#define TIM_MEM_DEBUG0_ENA UINT64_C(0x0000800000000000)
-#define TIM_MEM_DEBUG0_XXX_46 UINT64_C(0x0000400000000000)
-#define TIM_MEM_DEBUG0_COUNT UINT64_C(0x00003fffff000000)
-#define TIM_MEM_DEBUG0_XXX_23_22 UINT64_C(0x0000000000c00000)
-#define TIM_MEM_DEBUG0_INTERVAL UINT64_C(0x00000000003fffff)
-
-#define TIM_MEM_DEBUG1_BUCKET UINT64_C(0xfff8000000000000)
-#define TIM_MEM_DEBUG1_BASE UINT64_C(0x0007fffffff00000)
-#define TIM_MEM_DEBUG1_BSIZE UINT64_C(0x00000000000fffff)
-
-#define TIM_MEM_DEBUG2_XXX_63_32 UINT64_C(0xffffffff00000000)
-#define TIM_MEM_DEBUG2_XXX_31_24 UINT64_C(0x00000000ff000000)
-#define TIM_MEM_DEBUG2_CPOOL UINT64_C(0x0000000000e00000)
-#define TIM_MEM_DEBUG2_CSIZE UINT64_C(0x00000000001fff00)
-#define TIM_MEM_DEBUG2_XXX_7 UINT64_C(0x0000000000000080)
-#define TIM_MEM_DEBUG2_BUCKET UINT64_C(0x000000000000007f)
-
-/*
- * Timer Bucket Entry Structure
- */
-
-struct tim_tbe {
- int64_t tim_tbe_first; /* first chunk (pointer) */
- uint32_t tim_tbe_nentries;
- uint32_t tim_tbe_remainder; /* chunk remainder */
- int64_t tim_tbe_current; /* current chunk (pointer) */
- uint64_t tim_tbe_pad;
-} __packed;
-
-/* ---- snprintb */
-
Home |
Main Index |
Thread Index |
Old Index