linux_dsm_epyc7002/include/linux/uwb/whci.h
Thomas Gleixner 04672fe6d6 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 268
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program if not write to the free
  software foundation inc 51 franklin street fifth floor boston ma
  02110 1301 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 46 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141334.135501091@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:30:29 +02:00

103 lines
3.0 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Wireless Host Controller Interface for Ultra-Wide-Band and Wireless USB
*
* Copyright (C) 2005-2006 Intel Corporation
* Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
*
* References:
* [WHCI] Wireless Host Controller Interface Specification for
* Certified Wireless Universal Serial Bus, revision 0.95.
*/
#ifndef _LINUX_UWB_WHCI_H_
#define _LINUX_UWB_WHCI_H_
#include <linux/pci.h>
/*
* UWB interface capability registers (offsets from UWBBASE)
*
* [WHCI] section 2.2
*/
#define UWBCAPINFO 0x00 /* == UWBCAPDATA(0) */
# define UWBCAPINFO_TO_N_CAPS(c) (((c) >> 0) & 0xFull)
#define UWBCAPDATA(n) (8*(n))
# define UWBCAPDATA_TO_VERSION(c) (((c) >> 32) & 0xFFFFull)
# define UWBCAPDATA_TO_OFFSET(c) (((c) >> 18) & 0x3FFFull)
# define UWBCAPDATA_TO_BAR(c) (((c) >> 16) & 0x3ull)
# define UWBCAPDATA_TO_SIZE(c) ((((c) >> 8) & 0xFFull) * sizeof(u32))
# define UWBCAPDATA_TO_CAP_ID(c) (((c) >> 0) & 0xFFull)
/* Size of the WHCI capability data (including the RC capability) for
a device with n capabilities. */
#define UWBCAPDATA_SIZE(n) (8 + 8*(n))
/*
* URC registers (offsets from URCBASE)
*
* [WHCI] section 2.3
*/
#define URCCMD 0x00
# define URCCMD_RESET (1 << 31) /* UMC Hardware reset */
# define URCCMD_RS (1 << 30) /* Run/Stop */
# define URCCMD_EARV (1 << 29) /* Event Address Register Valid */
# define URCCMD_ACTIVE (1 << 15) /* Command is active */
# define URCCMD_IWR (1 << 14) /* Interrupt When Ready */
# define URCCMD_SIZE_MASK 0x00000fff /* Command size mask */
#define URCSTS 0x04
# define URCSTS_EPS (1 << 17) /* Event Processing Status */
# define URCSTS_HALTED (1 << 16) /* RC halted */
# define URCSTS_HSE (1 << 10) /* Host System Error...fried */
# define URCSTS_ER (1 << 9) /* Event Ready */
# define URCSTS_RCI (1 << 8) /* Ready for Command Interrupt */
# define URCSTS_INT_MASK 0x00000700 /* URC interrupt sources */
# define URCSTS_ISI 0x000000ff /* Interrupt Source Identification */
#define URCINTR 0x08
# define URCINTR_EN_ALL 0x000007ff /* Enable all interrupt sources */
#define URCCMDADDR 0x10
#define URCEVTADDR 0x18
# define URCEVTADDR_OFFSET_MASK 0xfff /* Event pointer offset mask */
/** Write 32 bit @value to little endian register at @addr */
static inline
void le_writel(u32 value, void __iomem *addr)
{
iowrite32(value, addr);
}
/** Read from 32 bit little endian register at @addr */
static inline
u32 le_readl(void __iomem *addr)
{
return ioread32(addr);
}
/** Write 64 bit @value to little endian register at @addr */
static inline
void le_writeq(u64 value, void __iomem *addr)
{
iowrite32(value, addr);
iowrite32(value >> 32, addr + 4);
}
/** Read from 64 bit little endian register at @addr */
static inline
u64 le_readq(void __iomem *addr)
{
u64 value;
value = ioread32(addr);
value |= (u64)ioread32(addr + 4) << 32;
return value;
}
extern int whci_wait_for(struct device *dev, u32 __iomem *reg,
u32 mask, u32 result,
unsigned long max_ms, const char *tag);
#endif /* #ifndef _LINUX_UWB_WHCI_H_ */