/*-1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2015-2016 Landon Fuller <[email protected]>4* Copyright (c) 2010 Broadcom Corporation5* All rights reserved.6*7* Portions of this file were derived from the sbchipc.h header contributed by8* Broadcom to to the Linux staging repository, as well as later revisions of9* sbchipc.h distributed with the Asus RT-N16 firmware source code release.10*11* Permission to use, copy, modify, and/or distribute this software for any12* purpose with or without fee is hereby granted, provided that the above13* copyright notice and this permission notice appear in all copies.14*15* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES16* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF17* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY18* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES19* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION20* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN21* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.22*/2324#ifndef _BHND_BHNDREG_H_25#define _BHND_BHNDREG_H_2627/**28* The default address at which the ChipCommon core is mapped on all siba(4)29* devices, and most (all?) bcma(4) devices.30*/31#define BHND_DEFAULT_CHIPC_ADDR 0x180000003233/**34* The standard size of a primary BHND_PORT_DEVICE or BHND_PORT_AGENT35* register block.36*/37#define BHND_DEFAULT_CORE_SIZE 0x10003839/**40* The standard size of the siba(4) and bcma(4) enumeration space.41*/42#define BHND_DEFAULT_ENUM_SIZE 0x001000004344/*45* Common per-core clock control/status register available on PMU-equipped46* devices.47*48* Clock Mode Name Description49* High Throughput (HT) Full bandwidth, low latency. Generally supplied50* from PLL.51* Active Low Power (ALP) Register access, low speed DMA.52* Idle Low Power (ILP) No interconnect activity, or if long latency53* is permitted.54*/55#define BHND_CLK_CTL_ST 0x1e0 /**< clock control and status */56#define BHND_CCS_FORCEALP 0x00000001 /**< force ALP request */57#define BHND_CCS_FORCEHT 0x00000002 /**< force HT request */58#define BHND_CCS_FORCEILP 0x00000004 /**< force ILP request */59#define BHND_CCS_FORCE_MASK 0x0000000F6061#define BHND_CCS_ALPAREQ 0x00000008 /**< ALP Avail Request */62#define BHND_CCS_HTAREQ 0x00000010 /**< HT Avail Request */63#define BHND_CCS_AREQ_MASK 0x000000186465#define BHND_CCS_FORCEHWREQOFF 0x00000020 /**< Force HW Clock Request Off */6667#define BHND_CCS_ERSRC_REQ_MASK 0x00000700 /**< external resource requests */68#define BHND_CCS_ERSRC_REQ_SHIFT 869#define BHND_CCS_ERSRC_MAX 2 /**< maximum ERSRC value (corresponding to bits 0-2) */7071#define BHND_CCS_ALPAVAIL 0x00010000 /**< ALP is available */72#define BHND_CCS_HTAVAIL 0x00020000 /**< HT is available */73#define BHND_CCS_AVAIL_MASK 0x000300007475#define BHND_CCS_BP_ON_APL 0x00040000 /**< RO: Backplane is running on ALP clock */76#define BHND_CCS_BP_ON_HT 0x00080000 /**< RO: Backplane is running on HT clock */77#define BHND_CCS_ERSRC_STS_MASK 0x07000000 /**< external resource status */78#define BHND_CCS_ERSRC_STS_SHIFT 247980#define BHND_CCS0_HTAVAIL 0x00010000 /**< HT avail in chipc and pcmcia on 4328a0 */81#define BHND_CCS0_ALPAVAIL 0x00020000 /**< ALP avail in chipc and pcmcia on 4328a0 */8283#define BHND_CCS_GET_FLAG(_value, _flag) \84(((_value) & _flag) != 0)85#define BHND_CCS_GET_BITS(_value, _field) \86(((_value) & _field ## _MASK) >> _field ## _SHIFT)87#define BHND_CCS_SET_BITS(_value, _field) \88(((_value) << _field ## _SHIFT) & _field ## _MASK)8990#endif /* _BHND_BHNDREG_H_ */919293