162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci	Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
462306a36Sopenharmony_ci	<http://rt2x00.serialmonkey.com>
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/*
962306a36Sopenharmony_ci	Module: rt2500pci
1062306a36Sopenharmony_ci	Abstract: Data structures and registers for the rt2500pci module.
1162306a36Sopenharmony_ci	Supported chipsets: RT2560.
1262306a36Sopenharmony_ci */
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#ifndef RT2500PCI_H
1562306a36Sopenharmony_ci#define RT2500PCI_H
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci/*
1862306a36Sopenharmony_ci * RF chip defines.
1962306a36Sopenharmony_ci */
2062306a36Sopenharmony_ci#define RF2522				0x0000
2162306a36Sopenharmony_ci#define RF2523				0x0001
2262306a36Sopenharmony_ci#define RF2524				0x0002
2362306a36Sopenharmony_ci#define RF2525				0x0003
2462306a36Sopenharmony_ci#define RF2525E				0x0004
2562306a36Sopenharmony_ci#define RF5222				0x0010
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/*
2862306a36Sopenharmony_ci * RT2560 version
2962306a36Sopenharmony_ci */
3062306a36Sopenharmony_ci#define RT2560_VERSION_B		2
3162306a36Sopenharmony_ci#define RT2560_VERSION_C		3
3262306a36Sopenharmony_ci#define RT2560_VERSION_D		4
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci/*
3562306a36Sopenharmony_ci * Signal information.
3662306a36Sopenharmony_ci * Default offset is required for RSSI <-> dBm conversion.
3762306a36Sopenharmony_ci */
3862306a36Sopenharmony_ci#define DEFAULT_RSSI_OFFSET		121
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci/*
4162306a36Sopenharmony_ci * Register layout information.
4262306a36Sopenharmony_ci */
4362306a36Sopenharmony_ci#define CSR_REG_BASE			0x0000
4462306a36Sopenharmony_ci#define CSR_REG_SIZE			0x0174
4562306a36Sopenharmony_ci#define EEPROM_BASE			0x0000
4662306a36Sopenharmony_ci#define EEPROM_SIZE			0x0200
4762306a36Sopenharmony_ci#define BBP_BASE			0x0000
4862306a36Sopenharmony_ci#define BBP_SIZE			0x0040
4962306a36Sopenharmony_ci#define RF_BASE				0x0004
5062306a36Sopenharmony_ci#define RF_SIZE				0x0010
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci/*
5362306a36Sopenharmony_ci * Number of TX queues.
5462306a36Sopenharmony_ci */
5562306a36Sopenharmony_ci#define NUM_TX_QUEUES			2
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci/*
5862306a36Sopenharmony_ci * Control/Status Registers(CSR).
5962306a36Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
6062306a36Sopenharmony_ci */
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci/*
6362306a36Sopenharmony_ci * CSR0: ASIC revision number.
6462306a36Sopenharmony_ci */
6562306a36Sopenharmony_ci#define CSR0				0x0000
6662306a36Sopenharmony_ci#define CSR0_REVISION			FIELD32(0x0000ffff)
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci/*
6962306a36Sopenharmony_ci * CSR1: System control register.
7062306a36Sopenharmony_ci * SOFT_RESET: Software reset, 1: reset, 0: normal.
7162306a36Sopenharmony_ci * BBP_RESET: Hardware reset, 1: reset, 0, release.
7262306a36Sopenharmony_ci * HOST_READY: Host ready after initialization.
7362306a36Sopenharmony_ci */
7462306a36Sopenharmony_ci#define CSR1				0x0004
7562306a36Sopenharmony_ci#define CSR1_SOFT_RESET			FIELD32(0x00000001)
7662306a36Sopenharmony_ci#define CSR1_BBP_RESET			FIELD32(0x00000002)
7762306a36Sopenharmony_ci#define CSR1_HOST_READY			FIELD32(0x00000004)
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci/*
8062306a36Sopenharmony_ci * CSR2: System admin status register (invalid).
8162306a36Sopenharmony_ci */
8262306a36Sopenharmony_ci#define CSR2				0x0008
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci/*
8562306a36Sopenharmony_ci * CSR3: STA MAC address register 0.
8662306a36Sopenharmony_ci */
8762306a36Sopenharmony_ci#define CSR3				0x000c
8862306a36Sopenharmony_ci#define CSR3_BYTE0			FIELD32(0x000000ff)
8962306a36Sopenharmony_ci#define CSR3_BYTE1			FIELD32(0x0000ff00)
9062306a36Sopenharmony_ci#define CSR3_BYTE2			FIELD32(0x00ff0000)
9162306a36Sopenharmony_ci#define CSR3_BYTE3			FIELD32(0xff000000)
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci/*
9462306a36Sopenharmony_ci * CSR4: STA MAC address register 1.
9562306a36Sopenharmony_ci */
9662306a36Sopenharmony_ci#define CSR4				0x0010
9762306a36Sopenharmony_ci#define CSR4_BYTE4			FIELD32(0x000000ff)
9862306a36Sopenharmony_ci#define CSR4_BYTE5			FIELD32(0x0000ff00)
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci/*
10162306a36Sopenharmony_ci * CSR5: BSSID register 0.
10262306a36Sopenharmony_ci */
10362306a36Sopenharmony_ci#define CSR5				0x0014
10462306a36Sopenharmony_ci#define CSR5_BYTE0			FIELD32(0x000000ff)
10562306a36Sopenharmony_ci#define CSR5_BYTE1			FIELD32(0x0000ff00)
10662306a36Sopenharmony_ci#define CSR5_BYTE2			FIELD32(0x00ff0000)
10762306a36Sopenharmony_ci#define CSR5_BYTE3			FIELD32(0xff000000)
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci/*
11062306a36Sopenharmony_ci * CSR6: BSSID register 1.
11162306a36Sopenharmony_ci */
11262306a36Sopenharmony_ci#define CSR6				0x0018
11362306a36Sopenharmony_ci#define CSR6_BYTE4			FIELD32(0x000000ff)
11462306a36Sopenharmony_ci#define CSR6_BYTE5			FIELD32(0x0000ff00)
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci/*
11762306a36Sopenharmony_ci * CSR7: Interrupt source register.
11862306a36Sopenharmony_ci * Write 1 to clear.
11962306a36Sopenharmony_ci * TBCN_EXPIRE: Beacon timer expired interrupt.
12062306a36Sopenharmony_ci * TWAKE_EXPIRE: Wakeup timer expired interrupt.
12162306a36Sopenharmony_ci * TATIMW_EXPIRE: Timer of atim window expired interrupt.
12262306a36Sopenharmony_ci * TXDONE_TXRING: Tx ring transmit done interrupt.
12362306a36Sopenharmony_ci * TXDONE_ATIMRING: Atim ring transmit done interrupt.
12462306a36Sopenharmony_ci * TXDONE_PRIORING: Priority ring transmit done interrupt.
12562306a36Sopenharmony_ci * RXDONE: Receive done interrupt.
12662306a36Sopenharmony_ci * DECRYPTION_DONE: Decryption done interrupt.
12762306a36Sopenharmony_ci * ENCRYPTION_DONE: Encryption done interrupt.
12862306a36Sopenharmony_ci * UART1_TX_TRESHOLD: UART1 TX reaches threshold.
12962306a36Sopenharmony_ci * UART1_RX_TRESHOLD: UART1 RX reaches threshold.
13062306a36Sopenharmony_ci * UART1_IDLE_TRESHOLD: UART1 IDLE over threshold.
13162306a36Sopenharmony_ci * UART1_TX_BUFF_ERROR: UART1 TX buffer error.
13262306a36Sopenharmony_ci * UART1_RX_BUFF_ERROR: UART1 RX buffer error.
13362306a36Sopenharmony_ci * UART2_TX_TRESHOLD: UART2 TX reaches threshold.
13462306a36Sopenharmony_ci * UART2_RX_TRESHOLD: UART2 RX reaches threshold.
13562306a36Sopenharmony_ci * UART2_IDLE_TRESHOLD: UART2 IDLE over threshold.
13662306a36Sopenharmony_ci * UART2_TX_BUFF_ERROR: UART2 TX buffer error.
13762306a36Sopenharmony_ci * UART2_RX_BUFF_ERROR: UART2 RX buffer error.
13862306a36Sopenharmony_ci * TIMER_CSR3_EXPIRE: TIMECSR3 timer expired (802.1H quiet period).
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci */
14162306a36Sopenharmony_ci#define CSR7				0x001c
14262306a36Sopenharmony_ci#define CSR7_TBCN_EXPIRE		FIELD32(0x00000001)
14362306a36Sopenharmony_ci#define CSR7_TWAKE_EXPIRE		FIELD32(0x00000002)
14462306a36Sopenharmony_ci#define CSR7_TATIMW_EXPIRE		FIELD32(0x00000004)
14562306a36Sopenharmony_ci#define CSR7_TXDONE_TXRING		FIELD32(0x00000008)
14662306a36Sopenharmony_ci#define CSR7_TXDONE_ATIMRING		FIELD32(0x00000010)
14762306a36Sopenharmony_ci#define CSR7_TXDONE_PRIORING		FIELD32(0x00000020)
14862306a36Sopenharmony_ci#define CSR7_RXDONE			FIELD32(0x00000040)
14962306a36Sopenharmony_ci#define CSR7_DECRYPTION_DONE		FIELD32(0x00000080)
15062306a36Sopenharmony_ci#define CSR7_ENCRYPTION_DONE		FIELD32(0x00000100)
15162306a36Sopenharmony_ci#define CSR7_UART1_TX_TRESHOLD		FIELD32(0x00000200)
15262306a36Sopenharmony_ci#define CSR7_UART1_RX_TRESHOLD		FIELD32(0x00000400)
15362306a36Sopenharmony_ci#define CSR7_UART1_IDLE_TRESHOLD	FIELD32(0x00000800)
15462306a36Sopenharmony_ci#define CSR7_UART1_TX_BUFF_ERROR	FIELD32(0x00001000)
15562306a36Sopenharmony_ci#define CSR7_UART1_RX_BUFF_ERROR	FIELD32(0x00002000)
15662306a36Sopenharmony_ci#define CSR7_UART2_TX_TRESHOLD		FIELD32(0x00004000)
15762306a36Sopenharmony_ci#define CSR7_UART2_RX_TRESHOLD		FIELD32(0x00008000)
15862306a36Sopenharmony_ci#define CSR7_UART2_IDLE_TRESHOLD	FIELD32(0x00010000)
15962306a36Sopenharmony_ci#define CSR7_UART2_TX_BUFF_ERROR	FIELD32(0x00020000)
16062306a36Sopenharmony_ci#define CSR7_UART2_RX_BUFF_ERROR	FIELD32(0x00040000)
16162306a36Sopenharmony_ci#define CSR7_TIMER_CSR3_EXPIRE		FIELD32(0x00080000)
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_ci/*
16462306a36Sopenharmony_ci * CSR8: Interrupt mask register.
16562306a36Sopenharmony_ci * Write 1 to mask interrupt.
16662306a36Sopenharmony_ci * TBCN_EXPIRE: Beacon timer expired interrupt.
16762306a36Sopenharmony_ci * TWAKE_EXPIRE: Wakeup timer expired interrupt.
16862306a36Sopenharmony_ci * TATIMW_EXPIRE: Timer of atim window expired interrupt.
16962306a36Sopenharmony_ci * TXDONE_TXRING: Tx ring transmit done interrupt.
17062306a36Sopenharmony_ci * TXDONE_ATIMRING: Atim ring transmit done interrupt.
17162306a36Sopenharmony_ci * TXDONE_PRIORING: Priority ring transmit done interrupt.
17262306a36Sopenharmony_ci * RXDONE: Receive done interrupt.
17362306a36Sopenharmony_ci * DECRYPTION_DONE: Decryption done interrupt.
17462306a36Sopenharmony_ci * ENCRYPTION_DONE: Encryption done interrupt.
17562306a36Sopenharmony_ci * UART1_TX_TRESHOLD: UART1 TX reaches threshold.
17662306a36Sopenharmony_ci * UART1_RX_TRESHOLD: UART1 RX reaches threshold.
17762306a36Sopenharmony_ci * UART1_IDLE_TRESHOLD: UART1 IDLE over threshold.
17862306a36Sopenharmony_ci * UART1_TX_BUFF_ERROR: UART1 TX buffer error.
17962306a36Sopenharmony_ci * UART1_RX_BUFF_ERROR: UART1 RX buffer error.
18062306a36Sopenharmony_ci * UART2_TX_TRESHOLD: UART2 TX reaches threshold.
18162306a36Sopenharmony_ci * UART2_RX_TRESHOLD: UART2 RX reaches threshold.
18262306a36Sopenharmony_ci * UART2_IDLE_TRESHOLD: UART2 IDLE over threshold.
18362306a36Sopenharmony_ci * UART2_TX_BUFF_ERROR: UART2 TX buffer error.
18462306a36Sopenharmony_ci * UART2_RX_BUFF_ERROR: UART2 RX buffer error.
18562306a36Sopenharmony_ci * TIMER_CSR3_EXPIRE: TIMECSR3 timer expired (802.1H quiet period).
18662306a36Sopenharmony_ci */
18762306a36Sopenharmony_ci#define CSR8				0x0020
18862306a36Sopenharmony_ci#define CSR8_TBCN_EXPIRE		FIELD32(0x00000001)
18962306a36Sopenharmony_ci#define CSR8_TWAKE_EXPIRE		FIELD32(0x00000002)
19062306a36Sopenharmony_ci#define CSR8_TATIMW_EXPIRE		FIELD32(0x00000004)
19162306a36Sopenharmony_ci#define CSR8_TXDONE_TXRING		FIELD32(0x00000008)
19262306a36Sopenharmony_ci#define CSR8_TXDONE_ATIMRING		FIELD32(0x00000010)
19362306a36Sopenharmony_ci#define CSR8_TXDONE_PRIORING		FIELD32(0x00000020)
19462306a36Sopenharmony_ci#define CSR8_RXDONE			FIELD32(0x00000040)
19562306a36Sopenharmony_ci#define CSR8_DECRYPTION_DONE		FIELD32(0x00000080)
19662306a36Sopenharmony_ci#define CSR8_ENCRYPTION_DONE		FIELD32(0x00000100)
19762306a36Sopenharmony_ci#define CSR8_UART1_TX_TRESHOLD		FIELD32(0x00000200)
19862306a36Sopenharmony_ci#define CSR8_UART1_RX_TRESHOLD		FIELD32(0x00000400)
19962306a36Sopenharmony_ci#define CSR8_UART1_IDLE_TRESHOLD	FIELD32(0x00000800)
20062306a36Sopenharmony_ci#define CSR8_UART1_TX_BUFF_ERROR	FIELD32(0x00001000)
20162306a36Sopenharmony_ci#define CSR8_UART1_RX_BUFF_ERROR	FIELD32(0x00002000)
20262306a36Sopenharmony_ci#define CSR8_UART2_TX_TRESHOLD		FIELD32(0x00004000)
20362306a36Sopenharmony_ci#define CSR8_UART2_RX_TRESHOLD		FIELD32(0x00008000)
20462306a36Sopenharmony_ci#define CSR8_UART2_IDLE_TRESHOLD	FIELD32(0x00010000)
20562306a36Sopenharmony_ci#define CSR8_UART2_TX_BUFF_ERROR	FIELD32(0x00020000)
20662306a36Sopenharmony_ci#define CSR8_UART2_RX_BUFF_ERROR	FIELD32(0x00040000)
20762306a36Sopenharmony_ci#define CSR8_TIMER_CSR3_EXPIRE		FIELD32(0x00080000)
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci/*
21062306a36Sopenharmony_ci * CSR9: Maximum frame length register.
21162306a36Sopenharmony_ci * MAX_FRAME_UNIT: Maximum frame length in 128b unit, default: 12.
21262306a36Sopenharmony_ci */
21362306a36Sopenharmony_ci#define CSR9				0x0024
21462306a36Sopenharmony_ci#define CSR9_MAX_FRAME_UNIT		FIELD32(0x00000f80)
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci/*
21762306a36Sopenharmony_ci * SECCSR0: WEP control register.
21862306a36Sopenharmony_ci * KICK_DECRYPT: Kick decryption engine, self-clear.
21962306a36Sopenharmony_ci * ONE_SHOT: 0: ring mode, 1: One shot only mode.
22062306a36Sopenharmony_ci * DESC_ADDRESS: Descriptor physical address of frame.
22162306a36Sopenharmony_ci */
22262306a36Sopenharmony_ci#define SECCSR0				0x0028
22362306a36Sopenharmony_ci#define SECCSR0_KICK_DECRYPT		FIELD32(0x00000001)
22462306a36Sopenharmony_ci#define SECCSR0_ONE_SHOT		FIELD32(0x00000002)
22562306a36Sopenharmony_ci#define SECCSR0_DESC_ADDRESS		FIELD32(0xfffffffc)
22662306a36Sopenharmony_ci
22762306a36Sopenharmony_ci/*
22862306a36Sopenharmony_ci * CSR11: Back-off control register.
22962306a36Sopenharmony_ci * CWMIN: CWmin. Default cwmin is 31 (2^5 - 1).
23062306a36Sopenharmony_ci * CWMAX: CWmax. Default cwmax is 1023 (2^10 - 1).
23162306a36Sopenharmony_ci * SLOT_TIME: Slot time, default is 20us for 802.11b
23262306a36Sopenharmony_ci * CW_SELECT: CWmin/CWmax selection, 1: Register, 0: TXD.
23362306a36Sopenharmony_ci * LONG_RETRY: Long retry count.
23462306a36Sopenharmony_ci * SHORT_RETRY: Short retry count.
23562306a36Sopenharmony_ci */
23662306a36Sopenharmony_ci#define CSR11				0x002c
23762306a36Sopenharmony_ci#define CSR11_CWMIN			FIELD32(0x0000000f)
23862306a36Sopenharmony_ci#define CSR11_CWMAX			FIELD32(0x000000f0)
23962306a36Sopenharmony_ci#define CSR11_SLOT_TIME			FIELD32(0x00001f00)
24062306a36Sopenharmony_ci#define CSR11_CW_SELECT			FIELD32(0x00002000)
24162306a36Sopenharmony_ci#define CSR11_LONG_RETRY		FIELD32(0x00ff0000)
24262306a36Sopenharmony_ci#define CSR11_SHORT_RETRY		FIELD32(0xff000000)
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci/*
24562306a36Sopenharmony_ci * CSR12: Synchronization configuration register 0.
24662306a36Sopenharmony_ci * All units in 1/16 TU.
24762306a36Sopenharmony_ci * BEACON_INTERVAL: Beacon interval, default is 100 TU.
24862306a36Sopenharmony_ci * CFP_MAX_DURATION: Cfp maximum duration, default is 100 TU.
24962306a36Sopenharmony_ci */
25062306a36Sopenharmony_ci#define CSR12				0x0030
25162306a36Sopenharmony_ci#define CSR12_BEACON_INTERVAL		FIELD32(0x0000ffff)
25262306a36Sopenharmony_ci#define CSR12_CFP_MAX_DURATION		FIELD32(0xffff0000)
25362306a36Sopenharmony_ci
25462306a36Sopenharmony_ci/*
25562306a36Sopenharmony_ci * CSR13: Synchronization configuration register 1.
25662306a36Sopenharmony_ci * All units in 1/16 TU.
25762306a36Sopenharmony_ci * ATIMW_DURATION: Atim window duration.
25862306a36Sopenharmony_ci * CFP_PERIOD: Cfp period, default is 0 TU.
25962306a36Sopenharmony_ci */
26062306a36Sopenharmony_ci#define CSR13				0x0034
26162306a36Sopenharmony_ci#define CSR13_ATIMW_DURATION		FIELD32(0x0000ffff)
26262306a36Sopenharmony_ci#define CSR13_CFP_PERIOD		FIELD32(0x00ff0000)
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci/*
26562306a36Sopenharmony_ci * CSR14: Synchronization control register.
26662306a36Sopenharmony_ci * TSF_COUNT: Enable tsf auto counting.
26762306a36Sopenharmony_ci * TSF_SYNC: Tsf sync, 0: disable, 1: infra, 2: ad-hoc/master mode.
26862306a36Sopenharmony_ci * TBCN: Enable tbcn with reload value.
26962306a36Sopenharmony_ci * TCFP: Enable tcfp & cfp / cp switching.
27062306a36Sopenharmony_ci * TATIMW: Enable tatimw & atim window switching.
27162306a36Sopenharmony_ci * BEACON_GEN: Enable beacon generator.
27262306a36Sopenharmony_ci * CFP_COUNT_PRELOAD: Cfp count preload value.
27362306a36Sopenharmony_ci * TBCM_PRELOAD: Tbcn preload value in units of 64us.
27462306a36Sopenharmony_ci */
27562306a36Sopenharmony_ci#define CSR14				0x0038
27662306a36Sopenharmony_ci#define CSR14_TSF_COUNT			FIELD32(0x00000001)
27762306a36Sopenharmony_ci#define CSR14_TSF_SYNC			FIELD32(0x00000006)
27862306a36Sopenharmony_ci#define CSR14_TBCN			FIELD32(0x00000008)
27962306a36Sopenharmony_ci#define CSR14_TCFP			FIELD32(0x00000010)
28062306a36Sopenharmony_ci#define CSR14_TATIMW			FIELD32(0x00000020)
28162306a36Sopenharmony_ci#define CSR14_BEACON_GEN		FIELD32(0x00000040)
28262306a36Sopenharmony_ci#define CSR14_CFP_COUNT_PRELOAD		FIELD32(0x0000ff00)
28362306a36Sopenharmony_ci#define CSR14_TBCM_PRELOAD		FIELD32(0xffff0000)
28462306a36Sopenharmony_ci
28562306a36Sopenharmony_ci/*
28662306a36Sopenharmony_ci * CSR15: Synchronization status register.
28762306a36Sopenharmony_ci * CFP: ASIC is in contention-free period.
28862306a36Sopenharmony_ci * ATIMW: ASIC is in ATIM window.
28962306a36Sopenharmony_ci * BEACON_SENT: Beacon is send.
29062306a36Sopenharmony_ci */
29162306a36Sopenharmony_ci#define CSR15				0x003c
29262306a36Sopenharmony_ci#define CSR15_CFP			FIELD32(0x00000001)
29362306a36Sopenharmony_ci#define CSR15_ATIMW			FIELD32(0x00000002)
29462306a36Sopenharmony_ci#define CSR15_BEACON_SENT		FIELD32(0x00000004)
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ci/*
29762306a36Sopenharmony_ci * CSR16: TSF timer register 0.
29862306a36Sopenharmony_ci */
29962306a36Sopenharmony_ci#define CSR16				0x0040
30062306a36Sopenharmony_ci#define CSR16_LOW_TSFTIMER		FIELD32(0xffffffff)
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ci/*
30362306a36Sopenharmony_ci * CSR17: TSF timer register 1.
30462306a36Sopenharmony_ci */
30562306a36Sopenharmony_ci#define CSR17				0x0044
30662306a36Sopenharmony_ci#define CSR17_HIGH_TSFTIMER		FIELD32(0xffffffff)
30762306a36Sopenharmony_ci
30862306a36Sopenharmony_ci/*
30962306a36Sopenharmony_ci * CSR18: IFS timer register 0.
31062306a36Sopenharmony_ci * SIFS: Sifs, default is 10 us.
31162306a36Sopenharmony_ci * PIFS: Pifs, default is 30 us.
31262306a36Sopenharmony_ci */
31362306a36Sopenharmony_ci#define CSR18				0x0048
31462306a36Sopenharmony_ci#define CSR18_SIFS			FIELD32(0x000001ff)
31562306a36Sopenharmony_ci#define CSR18_PIFS			FIELD32(0x001f0000)
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_ci/*
31862306a36Sopenharmony_ci * CSR19: IFS timer register 1.
31962306a36Sopenharmony_ci * DIFS: Difs, default is 50 us.
32062306a36Sopenharmony_ci * EIFS: Eifs, default is 364 us.
32162306a36Sopenharmony_ci */
32262306a36Sopenharmony_ci#define CSR19				0x004c
32362306a36Sopenharmony_ci#define CSR19_DIFS			FIELD32(0x0000ffff)
32462306a36Sopenharmony_ci#define CSR19_EIFS			FIELD32(0xffff0000)
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ci/*
32762306a36Sopenharmony_ci * CSR20: Wakeup timer register.
32862306a36Sopenharmony_ci * DELAY_AFTER_TBCN: Delay after tbcn expired in units of 1/16 TU.
32962306a36Sopenharmony_ci * TBCN_BEFORE_WAKEUP: Number of beacon before wakeup.
33062306a36Sopenharmony_ci * AUTOWAKE: Enable auto wakeup / sleep mechanism.
33162306a36Sopenharmony_ci */
33262306a36Sopenharmony_ci#define CSR20				0x0050
33362306a36Sopenharmony_ci#define CSR20_DELAY_AFTER_TBCN		FIELD32(0x0000ffff)
33462306a36Sopenharmony_ci#define CSR20_TBCN_BEFORE_WAKEUP	FIELD32(0x00ff0000)
33562306a36Sopenharmony_ci#define CSR20_AUTOWAKE			FIELD32(0x01000000)
33662306a36Sopenharmony_ci
33762306a36Sopenharmony_ci/*
33862306a36Sopenharmony_ci * CSR21: EEPROM control register.
33962306a36Sopenharmony_ci * RELOAD: Write 1 to reload eeprom content.
34062306a36Sopenharmony_ci * TYPE_93C46: 1: 93c46, 0:93c66.
34162306a36Sopenharmony_ci */
34262306a36Sopenharmony_ci#define CSR21				0x0054
34362306a36Sopenharmony_ci#define CSR21_RELOAD			FIELD32(0x00000001)
34462306a36Sopenharmony_ci#define CSR21_EEPROM_DATA_CLOCK		FIELD32(0x00000002)
34562306a36Sopenharmony_ci#define CSR21_EEPROM_CHIP_SELECT	FIELD32(0x00000004)
34662306a36Sopenharmony_ci#define CSR21_EEPROM_DATA_IN		FIELD32(0x00000008)
34762306a36Sopenharmony_ci#define CSR21_EEPROM_DATA_OUT		FIELD32(0x00000010)
34862306a36Sopenharmony_ci#define CSR21_TYPE_93C46		FIELD32(0x00000020)
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci/*
35162306a36Sopenharmony_ci * CSR22: CFP control register.
35262306a36Sopenharmony_ci * CFP_DURATION_REMAIN: Cfp duration remain, in units of TU.
35362306a36Sopenharmony_ci * RELOAD_CFP_DURATION: Write 1 to reload cfp duration remain.
35462306a36Sopenharmony_ci */
35562306a36Sopenharmony_ci#define CSR22				0x0058
35662306a36Sopenharmony_ci#define CSR22_CFP_DURATION_REMAIN	FIELD32(0x0000ffff)
35762306a36Sopenharmony_ci#define CSR22_RELOAD_CFP_DURATION	FIELD32(0x00010000)
35862306a36Sopenharmony_ci
35962306a36Sopenharmony_ci/*
36062306a36Sopenharmony_ci * Transmit related CSRs.
36162306a36Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
36262306a36Sopenharmony_ci */
36362306a36Sopenharmony_ci
36462306a36Sopenharmony_ci/*
36562306a36Sopenharmony_ci * TXCSR0: TX Control Register.
36662306a36Sopenharmony_ci * KICK_TX: Kick tx ring.
36762306a36Sopenharmony_ci * KICK_ATIM: Kick atim ring.
36862306a36Sopenharmony_ci * KICK_PRIO: Kick priority ring.
36962306a36Sopenharmony_ci * ABORT: Abort all transmit related ring operation.
37062306a36Sopenharmony_ci */
37162306a36Sopenharmony_ci#define TXCSR0				0x0060
37262306a36Sopenharmony_ci#define TXCSR0_KICK_TX			FIELD32(0x00000001)
37362306a36Sopenharmony_ci#define TXCSR0_KICK_ATIM		FIELD32(0x00000002)
37462306a36Sopenharmony_ci#define TXCSR0_KICK_PRIO		FIELD32(0x00000004)
37562306a36Sopenharmony_ci#define TXCSR0_ABORT			FIELD32(0x00000008)
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ci/*
37862306a36Sopenharmony_ci * TXCSR1: TX Configuration Register.
37962306a36Sopenharmony_ci * ACK_TIMEOUT: Ack timeout, default = sifs + 2*slottime + acktime @ 1mbps.
38062306a36Sopenharmony_ci * ACK_CONSUME_TIME: Ack consume time, default = sifs + acktime @ 1mbps.
38162306a36Sopenharmony_ci * TSF_OFFSET: Insert tsf offset.
38262306a36Sopenharmony_ci * AUTORESPONDER: Enable auto responder which include ack & cts.
38362306a36Sopenharmony_ci */
38462306a36Sopenharmony_ci#define TXCSR1				0x0064
38562306a36Sopenharmony_ci#define TXCSR1_ACK_TIMEOUT		FIELD32(0x000001ff)
38662306a36Sopenharmony_ci#define TXCSR1_ACK_CONSUME_TIME		FIELD32(0x0003fe00)
38762306a36Sopenharmony_ci#define TXCSR1_TSF_OFFSET		FIELD32(0x00fc0000)
38862306a36Sopenharmony_ci#define TXCSR1_AUTORESPONDER		FIELD32(0x01000000)
38962306a36Sopenharmony_ci
39062306a36Sopenharmony_ci/*
39162306a36Sopenharmony_ci * TXCSR2: Tx descriptor configuration register.
39262306a36Sopenharmony_ci * TXD_SIZE: Tx descriptor size, default is 48.
39362306a36Sopenharmony_ci * NUM_TXD: Number of tx entries in ring.
39462306a36Sopenharmony_ci * NUM_ATIM: Number of atim entries in ring.
39562306a36Sopenharmony_ci * NUM_PRIO: Number of priority entries in ring.
39662306a36Sopenharmony_ci */
39762306a36Sopenharmony_ci#define TXCSR2				0x0068
39862306a36Sopenharmony_ci#define TXCSR2_TXD_SIZE			FIELD32(0x000000ff)
39962306a36Sopenharmony_ci#define TXCSR2_NUM_TXD			FIELD32(0x0000ff00)
40062306a36Sopenharmony_ci#define TXCSR2_NUM_ATIM			FIELD32(0x00ff0000)
40162306a36Sopenharmony_ci#define TXCSR2_NUM_PRIO			FIELD32(0xff000000)
40262306a36Sopenharmony_ci
40362306a36Sopenharmony_ci/*
40462306a36Sopenharmony_ci * TXCSR3: TX Ring Base address register.
40562306a36Sopenharmony_ci */
40662306a36Sopenharmony_ci#define TXCSR3				0x006c
40762306a36Sopenharmony_ci#define TXCSR3_TX_RING_REGISTER		FIELD32(0xffffffff)
40862306a36Sopenharmony_ci
40962306a36Sopenharmony_ci/*
41062306a36Sopenharmony_ci * TXCSR4: TX Atim Ring Base address register.
41162306a36Sopenharmony_ci */
41262306a36Sopenharmony_ci#define TXCSR4				0x0070
41362306a36Sopenharmony_ci#define TXCSR4_ATIM_RING_REGISTER	FIELD32(0xffffffff)
41462306a36Sopenharmony_ci
41562306a36Sopenharmony_ci/*
41662306a36Sopenharmony_ci * TXCSR5: TX Prio Ring Base address register.
41762306a36Sopenharmony_ci */
41862306a36Sopenharmony_ci#define TXCSR5				0x0074
41962306a36Sopenharmony_ci#define TXCSR5_PRIO_RING_REGISTER	FIELD32(0xffffffff)
42062306a36Sopenharmony_ci
42162306a36Sopenharmony_ci/*
42262306a36Sopenharmony_ci * TXCSR6: Beacon Base address register.
42362306a36Sopenharmony_ci */
42462306a36Sopenharmony_ci#define TXCSR6				0x0078
42562306a36Sopenharmony_ci#define TXCSR6_BEACON_RING_REGISTER	FIELD32(0xffffffff)
42662306a36Sopenharmony_ci
42762306a36Sopenharmony_ci/*
42862306a36Sopenharmony_ci * TXCSR7: Auto responder control register.
42962306a36Sopenharmony_ci * AR_POWERMANAGEMENT: Auto responder power management bit.
43062306a36Sopenharmony_ci */
43162306a36Sopenharmony_ci#define TXCSR7				0x007c
43262306a36Sopenharmony_ci#define TXCSR7_AR_POWERMANAGEMENT	FIELD32(0x00000001)
43362306a36Sopenharmony_ci
43462306a36Sopenharmony_ci/*
43562306a36Sopenharmony_ci * TXCSR8: CCK Tx BBP register.
43662306a36Sopenharmony_ci */
43762306a36Sopenharmony_ci#define TXCSR8				0x0098
43862306a36Sopenharmony_ci#define TXCSR8_BBP_ID0			FIELD32(0x0000007f)
43962306a36Sopenharmony_ci#define TXCSR8_BBP_ID0_VALID		FIELD32(0x00000080)
44062306a36Sopenharmony_ci#define TXCSR8_BBP_ID1			FIELD32(0x00007f00)
44162306a36Sopenharmony_ci#define TXCSR8_BBP_ID1_VALID		FIELD32(0x00008000)
44262306a36Sopenharmony_ci#define TXCSR8_BBP_ID2			FIELD32(0x007f0000)
44362306a36Sopenharmony_ci#define TXCSR8_BBP_ID2_VALID		FIELD32(0x00800000)
44462306a36Sopenharmony_ci#define TXCSR8_BBP_ID3			FIELD32(0x7f000000)
44562306a36Sopenharmony_ci#define TXCSR8_BBP_ID3_VALID		FIELD32(0x80000000)
44662306a36Sopenharmony_ci
44762306a36Sopenharmony_ci/*
44862306a36Sopenharmony_ci * TXCSR9: OFDM TX BBP registers
44962306a36Sopenharmony_ci * OFDM_SIGNAL: BBP rate field address for OFDM.
45062306a36Sopenharmony_ci * OFDM_SERVICE: BBP service field address for OFDM.
45162306a36Sopenharmony_ci * OFDM_LENGTH_LOW: BBP length low byte address for OFDM.
45262306a36Sopenharmony_ci * OFDM_LENGTH_HIGH: BBP length high byte address for OFDM.
45362306a36Sopenharmony_ci */
45462306a36Sopenharmony_ci#define TXCSR9				0x0094
45562306a36Sopenharmony_ci#define TXCSR9_OFDM_RATE		FIELD32(0x000000ff)
45662306a36Sopenharmony_ci#define TXCSR9_OFDM_SERVICE		FIELD32(0x0000ff00)
45762306a36Sopenharmony_ci#define TXCSR9_OFDM_LENGTH_LOW		FIELD32(0x00ff0000)
45862306a36Sopenharmony_ci#define TXCSR9_OFDM_LENGTH_HIGH		FIELD32(0xff000000)
45962306a36Sopenharmony_ci
46062306a36Sopenharmony_ci/*
46162306a36Sopenharmony_ci * Receive related CSRs.
46262306a36Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
46362306a36Sopenharmony_ci */
46462306a36Sopenharmony_ci
46562306a36Sopenharmony_ci/*
46662306a36Sopenharmony_ci * RXCSR0: RX Control Register.
46762306a36Sopenharmony_ci * DISABLE_RX: Disable rx engine.
46862306a36Sopenharmony_ci * DROP_CRC: Drop crc error.
46962306a36Sopenharmony_ci * DROP_PHYSICAL: Drop physical error.
47062306a36Sopenharmony_ci * DROP_CONTROL: Drop control frame.
47162306a36Sopenharmony_ci * DROP_NOT_TO_ME: Drop not to me unicast frame.
47262306a36Sopenharmony_ci * DROP_TODS: Drop frame tods bit is true.
47362306a36Sopenharmony_ci * DROP_VERSION_ERROR: Drop version error frame.
47462306a36Sopenharmony_ci * PASS_CRC: Pass all packets with crc attached.
47562306a36Sopenharmony_ci * PASS_CRC: Pass all packets with crc attached.
47662306a36Sopenharmony_ci * PASS_PLCP: Pass all packets with 4 bytes PLCP attached.
47762306a36Sopenharmony_ci * DROP_MCAST: Drop multicast frames.
47862306a36Sopenharmony_ci * DROP_BCAST: Drop broadcast frames.
47962306a36Sopenharmony_ci * ENABLE_QOS: Accept QOS data frame and parse QOS field.
48062306a36Sopenharmony_ci */
48162306a36Sopenharmony_ci#define RXCSR0				0x0080
48262306a36Sopenharmony_ci#define RXCSR0_DISABLE_RX		FIELD32(0x00000001)
48362306a36Sopenharmony_ci#define RXCSR0_DROP_CRC			FIELD32(0x00000002)
48462306a36Sopenharmony_ci#define RXCSR0_DROP_PHYSICAL		FIELD32(0x00000004)
48562306a36Sopenharmony_ci#define RXCSR0_DROP_CONTROL		FIELD32(0x00000008)
48662306a36Sopenharmony_ci#define RXCSR0_DROP_NOT_TO_ME		FIELD32(0x00000010)
48762306a36Sopenharmony_ci#define RXCSR0_DROP_TODS		FIELD32(0x00000020)
48862306a36Sopenharmony_ci#define RXCSR0_DROP_VERSION_ERROR	FIELD32(0x00000040)
48962306a36Sopenharmony_ci#define RXCSR0_PASS_CRC			FIELD32(0x00000080)
49062306a36Sopenharmony_ci#define RXCSR0_PASS_PLCP		FIELD32(0x00000100)
49162306a36Sopenharmony_ci#define RXCSR0_DROP_MCAST		FIELD32(0x00000200)
49262306a36Sopenharmony_ci#define RXCSR0_DROP_BCAST		FIELD32(0x00000400)
49362306a36Sopenharmony_ci#define RXCSR0_ENABLE_QOS		FIELD32(0x00000800)
49462306a36Sopenharmony_ci
49562306a36Sopenharmony_ci/*
49662306a36Sopenharmony_ci * RXCSR1: RX descriptor configuration register.
49762306a36Sopenharmony_ci * RXD_SIZE: Rx descriptor size, default is 32b.
49862306a36Sopenharmony_ci * NUM_RXD: Number of rx entries in ring.
49962306a36Sopenharmony_ci */
50062306a36Sopenharmony_ci#define RXCSR1				0x0084
50162306a36Sopenharmony_ci#define RXCSR1_RXD_SIZE			FIELD32(0x000000ff)
50262306a36Sopenharmony_ci#define RXCSR1_NUM_RXD			FIELD32(0x0000ff00)
50362306a36Sopenharmony_ci
50462306a36Sopenharmony_ci/*
50562306a36Sopenharmony_ci * RXCSR2: RX Ring base address register.
50662306a36Sopenharmony_ci */
50762306a36Sopenharmony_ci#define RXCSR2				0x0088
50862306a36Sopenharmony_ci#define RXCSR2_RX_RING_REGISTER		FIELD32(0xffffffff)
50962306a36Sopenharmony_ci
51062306a36Sopenharmony_ci/*
51162306a36Sopenharmony_ci * RXCSR3: BBP ID register for Rx operation.
51262306a36Sopenharmony_ci * BBP_ID#: BBP register # id.
51362306a36Sopenharmony_ci * BBP_ID#_VALID: BBP register # id is valid or not.
51462306a36Sopenharmony_ci */
51562306a36Sopenharmony_ci#define RXCSR3				0x0090
51662306a36Sopenharmony_ci#define RXCSR3_BBP_ID0			FIELD32(0x0000007f)
51762306a36Sopenharmony_ci#define RXCSR3_BBP_ID0_VALID		FIELD32(0x00000080)
51862306a36Sopenharmony_ci#define RXCSR3_BBP_ID1			FIELD32(0x00007f00)
51962306a36Sopenharmony_ci#define RXCSR3_BBP_ID1_VALID		FIELD32(0x00008000)
52062306a36Sopenharmony_ci#define RXCSR3_BBP_ID2			FIELD32(0x007f0000)
52162306a36Sopenharmony_ci#define RXCSR3_BBP_ID2_VALID		FIELD32(0x00800000)
52262306a36Sopenharmony_ci#define RXCSR3_BBP_ID3			FIELD32(0x7f000000)
52362306a36Sopenharmony_ci#define RXCSR3_BBP_ID3_VALID		FIELD32(0x80000000)
52462306a36Sopenharmony_ci
52562306a36Sopenharmony_ci/*
52662306a36Sopenharmony_ci * ARCSR1: Auto Responder PLCP config register 1.
52762306a36Sopenharmony_ci * AR_BBP_DATA#: Auto responder BBP register # data.
52862306a36Sopenharmony_ci * AR_BBP_ID#: Auto responder BBP register # Id.
52962306a36Sopenharmony_ci */
53062306a36Sopenharmony_ci#define ARCSR1				0x009c
53162306a36Sopenharmony_ci#define ARCSR1_AR_BBP_DATA2		FIELD32(0x000000ff)
53262306a36Sopenharmony_ci#define ARCSR1_AR_BBP_ID2		FIELD32(0x0000ff00)
53362306a36Sopenharmony_ci#define ARCSR1_AR_BBP_DATA3		FIELD32(0x00ff0000)
53462306a36Sopenharmony_ci#define ARCSR1_AR_BBP_ID3		FIELD32(0xff000000)
53562306a36Sopenharmony_ci
53662306a36Sopenharmony_ci/*
53762306a36Sopenharmony_ci * Miscellaneous Registers.
53862306a36Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
53962306a36Sopenharmony_ci
54062306a36Sopenharmony_ci */
54162306a36Sopenharmony_ci
54262306a36Sopenharmony_ci/*
54362306a36Sopenharmony_ci * PCICSR: PCI control register.
54462306a36Sopenharmony_ci * BIG_ENDIAN: 1: big endian, 0: little endian.
54562306a36Sopenharmony_ci * RX_TRESHOLD: Rx threshold in dw to start pci access
54662306a36Sopenharmony_ci * 0: 16dw (default), 1: 8dw, 2: 4dw, 3: 32dw.
54762306a36Sopenharmony_ci * TX_TRESHOLD: Tx threshold in dw to start pci access
54862306a36Sopenharmony_ci * 0: 0dw (default), 1: 1dw, 2: 4dw, 3: forward.
54962306a36Sopenharmony_ci * BURST_LENTH: Pci burst length 0: 4dw (default, 1: 8dw, 2: 16dw, 3:32dw.
55062306a36Sopenharmony_ci * ENABLE_CLK: Enable clk_run, pci clock can't going down to non-operational.
55162306a36Sopenharmony_ci * READ_MULTIPLE: Enable memory read multiple.
55262306a36Sopenharmony_ci * WRITE_INVALID: Enable memory write & invalid.
55362306a36Sopenharmony_ci */
55462306a36Sopenharmony_ci#define PCICSR				0x008c
55562306a36Sopenharmony_ci#define PCICSR_BIG_ENDIAN		FIELD32(0x00000001)
55662306a36Sopenharmony_ci#define PCICSR_RX_TRESHOLD		FIELD32(0x00000006)
55762306a36Sopenharmony_ci#define PCICSR_TX_TRESHOLD		FIELD32(0x00000018)
55862306a36Sopenharmony_ci#define PCICSR_BURST_LENTH		FIELD32(0x00000060)
55962306a36Sopenharmony_ci#define PCICSR_ENABLE_CLK		FIELD32(0x00000080)
56062306a36Sopenharmony_ci#define PCICSR_READ_MULTIPLE		FIELD32(0x00000100)
56162306a36Sopenharmony_ci#define PCICSR_WRITE_INVALID		FIELD32(0x00000200)
56262306a36Sopenharmony_ci
56362306a36Sopenharmony_ci/*
56462306a36Sopenharmony_ci * CNT0: FCS error count.
56562306a36Sopenharmony_ci * FCS_ERROR: FCS error count, cleared when read.
56662306a36Sopenharmony_ci */
56762306a36Sopenharmony_ci#define CNT0				0x00a0
56862306a36Sopenharmony_ci#define CNT0_FCS_ERROR			FIELD32(0x0000ffff)
56962306a36Sopenharmony_ci
57062306a36Sopenharmony_ci/*
57162306a36Sopenharmony_ci * Statistic Register.
57262306a36Sopenharmony_ci * CNT1: PLCP error count.
57362306a36Sopenharmony_ci * CNT2: Long error count.
57462306a36Sopenharmony_ci */
57562306a36Sopenharmony_ci#define TIMECSR2			0x00a8
57662306a36Sopenharmony_ci#define CNT1				0x00ac
57762306a36Sopenharmony_ci#define CNT2				0x00b0
57862306a36Sopenharmony_ci#define TIMECSR3			0x00b4
57962306a36Sopenharmony_ci
58062306a36Sopenharmony_ci/*
58162306a36Sopenharmony_ci * CNT3: CCA false alarm count.
58262306a36Sopenharmony_ci */
58362306a36Sopenharmony_ci#define CNT3				0x00b8
58462306a36Sopenharmony_ci#define CNT3_FALSE_CCA			FIELD32(0x0000ffff)
58562306a36Sopenharmony_ci
58662306a36Sopenharmony_ci/*
58762306a36Sopenharmony_ci * Statistic Register.
58862306a36Sopenharmony_ci * CNT4: Rx FIFO overflow count.
58962306a36Sopenharmony_ci * CNT5: Tx FIFO underrun count.
59062306a36Sopenharmony_ci */
59162306a36Sopenharmony_ci#define CNT4				0x00bc
59262306a36Sopenharmony_ci#define CNT5				0x00c0
59362306a36Sopenharmony_ci
59462306a36Sopenharmony_ci/*
59562306a36Sopenharmony_ci * Baseband Control Register.
59662306a36Sopenharmony_ci */
59762306a36Sopenharmony_ci
59862306a36Sopenharmony_ci/*
59962306a36Sopenharmony_ci * PWRCSR0: Power mode configuration register.
60062306a36Sopenharmony_ci */
60162306a36Sopenharmony_ci#define PWRCSR0				0x00c4
60262306a36Sopenharmony_ci
60362306a36Sopenharmony_ci/*
60462306a36Sopenharmony_ci * Power state transition time registers.
60562306a36Sopenharmony_ci */
60662306a36Sopenharmony_ci#define PSCSR0				0x00c8
60762306a36Sopenharmony_ci#define PSCSR1				0x00cc
60862306a36Sopenharmony_ci#define PSCSR2				0x00d0
60962306a36Sopenharmony_ci#define PSCSR3				0x00d4
61062306a36Sopenharmony_ci
61162306a36Sopenharmony_ci/*
61262306a36Sopenharmony_ci * PWRCSR1: Manual power control / status register.
61362306a36Sopenharmony_ci * Allowed state: 0 deep_sleep, 1: sleep, 2: standby, 3: awake.
61462306a36Sopenharmony_ci * SET_STATE: Set state. Write 1 to trigger, self cleared.
61562306a36Sopenharmony_ci * BBP_DESIRE_STATE: BBP desired state.
61662306a36Sopenharmony_ci * RF_DESIRE_STATE: RF desired state.
61762306a36Sopenharmony_ci * BBP_CURR_STATE: BBP current state.
61862306a36Sopenharmony_ci * RF_CURR_STATE: RF current state.
61962306a36Sopenharmony_ci * PUT_TO_SLEEP: Put to sleep. Write 1 to trigger, self cleared.
62062306a36Sopenharmony_ci */
62162306a36Sopenharmony_ci#define PWRCSR1				0x00d8
62262306a36Sopenharmony_ci#define PWRCSR1_SET_STATE		FIELD32(0x00000001)
62362306a36Sopenharmony_ci#define PWRCSR1_BBP_DESIRE_STATE	FIELD32(0x00000006)
62462306a36Sopenharmony_ci#define PWRCSR1_RF_DESIRE_STATE		FIELD32(0x00000018)
62562306a36Sopenharmony_ci#define PWRCSR1_BBP_CURR_STATE		FIELD32(0x00000060)
62662306a36Sopenharmony_ci#define PWRCSR1_RF_CURR_STATE		FIELD32(0x00000180)
62762306a36Sopenharmony_ci#define PWRCSR1_PUT_TO_SLEEP		FIELD32(0x00000200)
62862306a36Sopenharmony_ci
62962306a36Sopenharmony_ci/*
63062306a36Sopenharmony_ci * TIMECSR: Timer control register.
63162306a36Sopenharmony_ci * US_COUNT: 1 us timer count in units of clock cycles.
63262306a36Sopenharmony_ci * US_64_COUNT: 64 us timer count in units of 1 us timer.
63362306a36Sopenharmony_ci * BEACON_EXPECT: Beacon expect window.
63462306a36Sopenharmony_ci */
63562306a36Sopenharmony_ci#define TIMECSR				0x00dc
63662306a36Sopenharmony_ci#define TIMECSR_US_COUNT		FIELD32(0x000000ff)
63762306a36Sopenharmony_ci#define TIMECSR_US_64_COUNT		FIELD32(0x0000ff00)
63862306a36Sopenharmony_ci#define TIMECSR_BEACON_EXPECT		FIELD32(0x00070000)
63962306a36Sopenharmony_ci
64062306a36Sopenharmony_ci/*
64162306a36Sopenharmony_ci * MACCSR0: MAC configuration register 0.
64262306a36Sopenharmony_ci */
64362306a36Sopenharmony_ci#define MACCSR0				0x00e0
64462306a36Sopenharmony_ci
64562306a36Sopenharmony_ci/*
64662306a36Sopenharmony_ci * MACCSR1: MAC configuration register 1.
64762306a36Sopenharmony_ci * KICK_RX: Kick one-shot rx in one-shot rx mode.
64862306a36Sopenharmony_ci * ONESHOT_RXMODE: Enable one-shot rx mode for debugging.
64962306a36Sopenharmony_ci * BBPRX_RESET_MODE: Ralink bbp rx reset mode.
65062306a36Sopenharmony_ci * AUTO_TXBBP: Auto tx logic access bbp control register.
65162306a36Sopenharmony_ci * AUTO_RXBBP: Auto rx logic access bbp control register.
65262306a36Sopenharmony_ci * LOOPBACK: Loopback mode. 0: normal, 1: internal, 2: external, 3:rsvd.
65362306a36Sopenharmony_ci * INTERSIL_IF: Intersil if calibration pin.
65462306a36Sopenharmony_ci */
65562306a36Sopenharmony_ci#define MACCSR1				0x00e4
65662306a36Sopenharmony_ci#define MACCSR1_KICK_RX			FIELD32(0x00000001)
65762306a36Sopenharmony_ci#define MACCSR1_ONESHOT_RXMODE		FIELD32(0x00000002)
65862306a36Sopenharmony_ci#define MACCSR1_BBPRX_RESET_MODE	FIELD32(0x00000004)
65962306a36Sopenharmony_ci#define MACCSR1_AUTO_TXBBP		FIELD32(0x00000008)
66062306a36Sopenharmony_ci#define MACCSR1_AUTO_RXBBP		FIELD32(0x00000010)
66162306a36Sopenharmony_ci#define MACCSR1_LOOPBACK		FIELD32(0x00000060)
66262306a36Sopenharmony_ci#define MACCSR1_INTERSIL_IF		FIELD32(0x00000080)
66362306a36Sopenharmony_ci
66462306a36Sopenharmony_ci/*
66562306a36Sopenharmony_ci * RALINKCSR: Ralink Rx auto-reset BBCR.
66662306a36Sopenharmony_ci * AR_BBP_DATA#: Auto reset BBP register # data.
66762306a36Sopenharmony_ci * AR_BBP_ID#: Auto reset BBP register # id.
66862306a36Sopenharmony_ci */
66962306a36Sopenharmony_ci#define RALINKCSR			0x00e8
67062306a36Sopenharmony_ci#define RALINKCSR_AR_BBP_DATA0		FIELD32(0x000000ff)
67162306a36Sopenharmony_ci#define RALINKCSR_AR_BBP_ID0		FIELD32(0x00007f00)
67262306a36Sopenharmony_ci#define RALINKCSR_AR_BBP_VALID0		FIELD32(0x00008000)
67362306a36Sopenharmony_ci#define RALINKCSR_AR_BBP_DATA1		FIELD32(0x00ff0000)
67462306a36Sopenharmony_ci#define RALINKCSR_AR_BBP_ID1		FIELD32(0x7f000000)
67562306a36Sopenharmony_ci#define RALINKCSR_AR_BBP_VALID1		FIELD32(0x80000000)
67662306a36Sopenharmony_ci
67762306a36Sopenharmony_ci/*
67862306a36Sopenharmony_ci * BCNCSR: Beacon interval control register.
67962306a36Sopenharmony_ci * CHANGE: Write one to change beacon interval.
68062306a36Sopenharmony_ci * DELTATIME: The delta time value.
68162306a36Sopenharmony_ci * NUM_BEACON: Number of beacon according to mode.
68262306a36Sopenharmony_ci * MODE: Please refer to asic specs.
68362306a36Sopenharmony_ci * PLUS: Plus or minus delta time value.
68462306a36Sopenharmony_ci */
68562306a36Sopenharmony_ci#define BCNCSR				0x00ec
68662306a36Sopenharmony_ci#define BCNCSR_CHANGE			FIELD32(0x00000001)
68762306a36Sopenharmony_ci#define BCNCSR_DELTATIME		FIELD32(0x0000001e)
68862306a36Sopenharmony_ci#define BCNCSR_NUM_BEACON		FIELD32(0x00001fe0)
68962306a36Sopenharmony_ci#define BCNCSR_MODE			FIELD32(0x00006000)
69062306a36Sopenharmony_ci#define BCNCSR_PLUS			FIELD32(0x00008000)
69162306a36Sopenharmony_ci
69262306a36Sopenharmony_ci/*
69362306a36Sopenharmony_ci * BBP / RF / IF Control Register.
69462306a36Sopenharmony_ci */
69562306a36Sopenharmony_ci
69662306a36Sopenharmony_ci/*
69762306a36Sopenharmony_ci * BBPCSR: BBP serial control register.
69862306a36Sopenharmony_ci * VALUE: Register value to program into BBP.
69962306a36Sopenharmony_ci * REGNUM: Selected BBP register.
70062306a36Sopenharmony_ci * BUSY: 1: asic is busy execute BBP programming.
70162306a36Sopenharmony_ci * WRITE_CONTROL: 1: write BBP, 0: read BBP.
70262306a36Sopenharmony_ci */
70362306a36Sopenharmony_ci#define BBPCSR				0x00f0
70462306a36Sopenharmony_ci#define BBPCSR_VALUE			FIELD32(0x000000ff)
70562306a36Sopenharmony_ci#define BBPCSR_REGNUM			FIELD32(0x00007f00)
70662306a36Sopenharmony_ci#define BBPCSR_BUSY			FIELD32(0x00008000)
70762306a36Sopenharmony_ci#define BBPCSR_WRITE_CONTROL		FIELD32(0x00010000)
70862306a36Sopenharmony_ci
70962306a36Sopenharmony_ci/*
71062306a36Sopenharmony_ci * RFCSR: RF serial control register.
71162306a36Sopenharmony_ci * VALUE: Register value + id to program into rf/if.
71262306a36Sopenharmony_ci * NUMBER_OF_BITS: Number of bits used in value (i:20, rfmd:22).
71362306a36Sopenharmony_ci * IF_SELECT: Chip to program: 0: rf, 1: if.
71462306a36Sopenharmony_ci * PLL_LD: Rf pll_ld status.
71562306a36Sopenharmony_ci * BUSY: 1: asic is busy execute rf programming.
71662306a36Sopenharmony_ci */
71762306a36Sopenharmony_ci#define RFCSR				0x00f4
71862306a36Sopenharmony_ci#define RFCSR_VALUE			FIELD32(0x00ffffff)
71962306a36Sopenharmony_ci#define RFCSR_NUMBER_OF_BITS		FIELD32(0x1f000000)
72062306a36Sopenharmony_ci#define RFCSR_IF_SELECT			FIELD32(0x20000000)
72162306a36Sopenharmony_ci#define RFCSR_PLL_LD			FIELD32(0x40000000)
72262306a36Sopenharmony_ci#define RFCSR_BUSY			FIELD32(0x80000000)
72362306a36Sopenharmony_ci
72462306a36Sopenharmony_ci/*
72562306a36Sopenharmony_ci * LEDCSR: LED control register.
72662306a36Sopenharmony_ci * ON_PERIOD: On period, default 70ms.
72762306a36Sopenharmony_ci * OFF_PERIOD: Off period, default 30ms.
72862306a36Sopenharmony_ci * LINK: 0: linkoff, 1: linkup.
72962306a36Sopenharmony_ci * ACTIVITY: 0: idle, 1: active.
73062306a36Sopenharmony_ci * LINK_POLARITY: 0: active low, 1: active high.
73162306a36Sopenharmony_ci * ACTIVITY_POLARITY: 0: active low, 1: active high.
73262306a36Sopenharmony_ci * LED_DEFAULT: LED state for "enable" 0: ON, 1: OFF.
73362306a36Sopenharmony_ci */
73462306a36Sopenharmony_ci#define LEDCSR				0x00f8
73562306a36Sopenharmony_ci#define LEDCSR_ON_PERIOD		FIELD32(0x000000ff)
73662306a36Sopenharmony_ci#define LEDCSR_OFF_PERIOD		FIELD32(0x0000ff00)
73762306a36Sopenharmony_ci#define LEDCSR_LINK			FIELD32(0x00010000)
73862306a36Sopenharmony_ci#define LEDCSR_ACTIVITY			FIELD32(0x00020000)
73962306a36Sopenharmony_ci#define LEDCSR_LINK_POLARITY		FIELD32(0x00040000)
74062306a36Sopenharmony_ci#define LEDCSR_ACTIVITY_POLARITY	FIELD32(0x00080000)
74162306a36Sopenharmony_ci#define LEDCSR_LED_DEFAULT		FIELD32(0x00100000)
74262306a36Sopenharmony_ci
74362306a36Sopenharmony_ci/*
74462306a36Sopenharmony_ci * SECCSR3: AES control register.
74562306a36Sopenharmony_ci */
74662306a36Sopenharmony_ci#define SECCSR3				0x00fc
74762306a36Sopenharmony_ci
74862306a36Sopenharmony_ci/*
74962306a36Sopenharmony_ci * ASIC pointer information.
75062306a36Sopenharmony_ci * RXPTR: Current RX ring address.
75162306a36Sopenharmony_ci * TXPTR: Current Tx ring address.
75262306a36Sopenharmony_ci * PRIPTR: Current Priority ring address.
75362306a36Sopenharmony_ci * ATIMPTR: Current ATIM ring address.
75462306a36Sopenharmony_ci */
75562306a36Sopenharmony_ci#define RXPTR				0x0100
75662306a36Sopenharmony_ci#define TXPTR				0x0104
75762306a36Sopenharmony_ci#define PRIPTR				0x0108
75862306a36Sopenharmony_ci#define ATIMPTR				0x010c
75962306a36Sopenharmony_ci
76062306a36Sopenharmony_ci/*
76162306a36Sopenharmony_ci * TXACKCSR0: TX ACK timeout.
76262306a36Sopenharmony_ci */
76362306a36Sopenharmony_ci#define TXACKCSR0			0x0110
76462306a36Sopenharmony_ci
76562306a36Sopenharmony_ci/*
76662306a36Sopenharmony_ci * ACK timeout count registers.
76762306a36Sopenharmony_ci * ACKCNT0: TX ACK timeout count.
76862306a36Sopenharmony_ci * ACKCNT1: RX ACK timeout count.
76962306a36Sopenharmony_ci */
77062306a36Sopenharmony_ci#define ACKCNT0				0x0114
77162306a36Sopenharmony_ci#define ACKCNT1				0x0118
77262306a36Sopenharmony_ci
77362306a36Sopenharmony_ci/*
77462306a36Sopenharmony_ci * GPIO and others.
77562306a36Sopenharmony_ci */
77662306a36Sopenharmony_ci
77762306a36Sopenharmony_ci/*
77862306a36Sopenharmony_ci * GPIOCSR: GPIO control register.
77962306a36Sopenharmony_ci *	GPIOCSR_VALx: GPIO value
78062306a36Sopenharmony_ci *	GPIOCSR_DIRx: GPIO direction: 0 = output; 1 = input
78162306a36Sopenharmony_ci */
78262306a36Sopenharmony_ci#define GPIOCSR				0x0120
78362306a36Sopenharmony_ci#define GPIOCSR_VAL0			FIELD32(0x00000001)
78462306a36Sopenharmony_ci#define GPIOCSR_VAL1			FIELD32(0x00000002)
78562306a36Sopenharmony_ci#define GPIOCSR_VAL2			FIELD32(0x00000004)
78662306a36Sopenharmony_ci#define GPIOCSR_VAL3			FIELD32(0x00000008)
78762306a36Sopenharmony_ci#define GPIOCSR_VAL4			FIELD32(0x00000010)
78862306a36Sopenharmony_ci#define GPIOCSR_VAL5			FIELD32(0x00000020)
78962306a36Sopenharmony_ci#define GPIOCSR_VAL6			FIELD32(0x00000040)
79062306a36Sopenharmony_ci#define GPIOCSR_VAL7			FIELD32(0x00000080)
79162306a36Sopenharmony_ci#define GPIOCSR_DIR0			FIELD32(0x00000100)
79262306a36Sopenharmony_ci#define GPIOCSR_DIR1			FIELD32(0x00000200)
79362306a36Sopenharmony_ci#define GPIOCSR_DIR2			FIELD32(0x00000400)
79462306a36Sopenharmony_ci#define GPIOCSR_DIR3			FIELD32(0x00000800)
79562306a36Sopenharmony_ci#define GPIOCSR_DIR4			FIELD32(0x00001000)
79662306a36Sopenharmony_ci#define GPIOCSR_DIR5			FIELD32(0x00002000)
79762306a36Sopenharmony_ci#define GPIOCSR_DIR6			FIELD32(0x00004000)
79862306a36Sopenharmony_ci#define GPIOCSR_DIR7			FIELD32(0x00008000)
79962306a36Sopenharmony_ci
80062306a36Sopenharmony_ci/*
80162306a36Sopenharmony_ci * FIFO pointer registers.
80262306a36Sopenharmony_ci * FIFOCSR0: TX FIFO pointer.
80362306a36Sopenharmony_ci * FIFOCSR1: RX FIFO pointer.
80462306a36Sopenharmony_ci */
80562306a36Sopenharmony_ci#define FIFOCSR0			0x0128
80662306a36Sopenharmony_ci#define FIFOCSR1			0x012c
80762306a36Sopenharmony_ci
80862306a36Sopenharmony_ci/*
80962306a36Sopenharmony_ci * BCNCSR1: Tx BEACON offset time control register.
81062306a36Sopenharmony_ci * PRELOAD: Beacon timer offset in units of usec.
81162306a36Sopenharmony_ci * BEACON_CWMIN: 2^CwMin.
81262306a36Sopenharmony_ci */
81362306a36Sopenharmony_ci#define BCNCSR1				0x0130
81462306a36Sopenharmony_ci#define BCNCSR1_PRELOAD			FIELD32(0x0000ffff)
81562306a36Sopenharmony_ci#define BCNCSR1_BEACON_CWMIN		FIELD32(0x000f0000)
81662306a36Sopenharmony_ci
81762306a36Sopenharmony_ci/*
81862306a36Sopenharmony_ci * MACCSR2: TX_PE to RX_PE turn-around time control register
81962306a36Sopenharmony_ci * DELAY: RX_PE low width, in units of pci clock cycle.
82062306a36Sopenharmony_ci */
82162306a36Sopenharmony_ci#define MACCSR2				0x0134
82262306a36Sopenharmony_ci#define MACCSR2_DELAY			FIELD32(0x000000ff)
82362306a36Sopenharmony_ci
82462306a36Sopenharmony_ci/*
82562306a36Sopenharmony_ci * TESTCSR: TEST mode selection register.
82662306a36Sopenharmony_ci */
82762306a36Sopenharmony_ci#define TESTCSR				0x0138
82862306a36Sopenharmony_ci
82962306a36Sopenharmony_ci/*
83062306a36Sopenharmony_ci * ARCSR2: 1 Mbps ACK/CTS PLCP.
83162306a36Sopenharmony_ci */
83262306a36Sopenharmony_ci#define ARCSR2				0x013c
83362306a36Sopenharmony_ci#define ARCSR2_SIGNAL			FIELD32(0x000000ff)
83462306a36Sopenharmony_ci#define ARCSR2_SERVICE			FIELD32(0x0000ff00)
83562306a36Sopenharmony_ci#define ARCSR2_LENGTH			FIELD32(0xffff0000)
83662306a36Sopenharmony_ci
83762306a36Sopenharmony_ci/*
83862306a36Sopenharmony_ci * ARCSR3: 2 Mbps ACK/CTS PLCP.
83962306a36Sopenharmony_ci */
84062306a36Sopenharmony_ci#define ARCSR3				0x0140
84162306a36Sopenharmony_ci#define ARCSR3_SIGNAL			FIELD32(0x000000ff)
84262306a36Sopenharmony_ci#define ARCSR3_SERVICE			FIELD32(0x0000ff00)
84362306a36Sopenharmony_ci#define ARCSR3_LENGTH			FIELD32(0xffff0000)
84462306a36Sopenharmony_ci
84562306a36Sopenharmony_ci/*
84662306a36Sopenharmony_ci * ARCSR4: 5.5 Mbps ACK/CTS PLCP.
84762306a36Sopenharmony_ci */
84862306a36Sopenharmony_ci#define ARCSR4				0x0144
84962306a36Sopenharmony_ci#define ARCSR4_SIGNAL			FIELD32(0x000000ff)
85062306a36Sopenharmony_ci#define ARCSR4_SERVICE			FIELD32(0x0000ff00)
85162306a36Sopenharmony_ci#define ARCSR4_LENGTH			FIELD32(0xffff0000)
85262306a36Sopenharmony_ci
85362306a36Sopenharmony_ci/*
85462306a36Sopenharmony_ci * ARCSR5: 11 Mbps ACK/CTS PLCP.
85562306a36Sopenharmony_ci */
85662306a36Sopenharmony_ci#define ARCSR5				0x0148
85762306a36Sopenharmony_ci#define ARCSR5_SIGNAL			FIELD32(0x000000ff)
85862306a36Sopenharmony_ci#define ARCSR5_SERVICE			FIELD32(0x0000ff00)
85962306a36Sopenharmony_ci#define ARCSR5_LENGTH			FIELD32(0xffff0000)
86062306a36Sopenharmony_ci
86162306a36Sopenharmony_ci/*
86262306a36Sopenharmony_ci * ARTCSR0: CCK ACK/CTS payload consumed time for 1/2/5.5/11 mbps.
86362306a36Sopenharmony_ci */
86462306a36Sopenharmony_ci#define ARTCSR0				0x014c
86562306a36Sopenharmony_ci#define ARTCSR0_ACK_CTS_11MBS		FIELD32(0x000000ff)
86662306a36Sopenharmony_ci#define ARTCSR0_ACK_CTS_5_5MBS		FIELD32(0x0000ff00)
86762306a36Sopenharmony_ci#define ARTCSR0_ACK_CTS_2MBS		FIELD32(0x00ff0000)
86862306a36Sopenharmony_ci#define ARTCSR0_ACK_CTS_1MBS		FIELD32(0xff000000)
86962306a36Sopenharmony_ci
87062306a36Sopenharmony_ci
87162306a36Sopenharmony_ci/*
87262306a36Sopenharmony_ci * ARTCSR1: OFDM ACK/CTS payload consumed time for 6/9/12/18 mbps.
87362306a36Sopenharmony_ci */
87462306a36Sopenharmony_ci#define ARTCSR1				0x0150
87562306a36Sopenharmony_ci#define ARTCSR1_ACK_CTS_6MBS		FIELD32(0x000000ff)
87662306a36Sopenharmony_ci#define ARTCSR1_ACK_CTS_9MBS		FIELD32(0x0000ff00)
87762306a36Sopenharmony_ci#define ARTCSR1_ACK_CTS_12MBS		FIELD32(0x00ff0000)
87862306a36Sopenharmony_ci#define ARTCSR1_ACK_CTS_18MBS		FIELD32(0xff000000)
87962306a36Sopenharmony_ci
88062306a36Sopenharmony_ci/*
88162306a36Sopenharmony_ci * ARTCSR2: OFDM ACK/CTS payload consumed time for 24/36/48/54 mbps.
88262306a36Sopenharmony_ci */
88362306a36Sopenharmony_ci#define ARTCSR2				0x0154
88462306a36Sopenharmony_ci#define ARTCSR2_ACK_CTS_24MBS		FIELD32(0x000000ff)
88562306a36Sopenharmony_ci#define ARTCSR2_ACK_CTS_36MBS		FIELD32(0x0000ff00)
88662306a36Sopenharmony_ci#define ARTCSR2_ACK_CTS_48MBS		FIELD32(0x00ff0000)
88762306a36Sopenharmony_ci#define ARTCSR2_ACK_CTS_54MBS		FIELD32(0xff000000)
88862306a36Sopenharmony_ci
88962306a36Sopenharmony_ci/*
89062306a36Sopenharmony_ci * SECCSR1: WEP control register.
89162306a36Sopenharmony_ci * KICK_ENCRYPT: Kick encryption engine, self-clear.
89262306a36Sopenharmony_ci * ONE_SHOT: 0: ring mode, 1: One shot only mode.
89362306a36Sopenharmony_ci * DESC_ADDRESS: Descriptor physical address of frame.
89462306a36Sopenharmony_ci */
89562306a36Sopenharmony_ci#define SECCSR1				0x0158
89662306a36Sopenharmony_ci#define SECCSR1_KICK_ENCRYPT		FIELD32(0x00000001)
89762306a36Sopenharmony_ci#define SECCSR1_ONE_SHOT		FIELD32(0x00000002)
89862306a36Sopenharmony_ci#define SECCSR1_DESC_ADDRESS		FIELD32(0xfffffffc)
89962306a36Sopenharmony_ci
90062306a36Sopenharmony_ci/*
90162306a36Sopenharmony_ci * BBPCSR1: BBP TX configuration.
90262306a36Sopenharmony_ci */
90362306a36Sopenharmony_ci#define BBPCSR1				0x015c
90462306a36Sopenharmony_ci#define BBPCSR1_CCK			FIELD32(0x00000003)
90562306a36Sopenharmony_ci#define BBPCSR1_CCK_FLIP		FIELD32(0x00000004)
90662306a36Sopenharmony_ci#define BBPCSR1_OFDM			FIELD32(0x00030000)
90762306a36Sopenharmony_ci#define BBPCSR1_OFDM_FLIP		FIELD32(0x00040000)
90862306a36Sopenharmony_ci
90962306a36Sopenharmony_ci/*
91062306a36Sopenharmony_ci * Dual band configuration registers.
91162306a36Sopenharmony_ci * DBANDCSR0: Dual band configuration register 0.
91262306a36Sopenharmony_ci * DBANDCSR1: Dual band configuration register 1.
91362306a36Sopenharmony_ci */
91462306a36Sopenharmony_ci#define DBANDCSR0			0x0160
91562306a36Sopenharmony_ci#define DBANDCSR1			0x0164
91662306a36Sopenharmony_ci
91762306a36Sopenharmony_ci/*
91862306a36Sopenharmony_ci * BBPPCSR: BBP Pin control register.
91962306a36Sopenharmony_ci */
92062306a36Sopenharmony_ci#define BBPPCSR				0x0168
92162306a36Sopenharmony_ci
92262306a36Sopenharmony_ci/*
92362306a36Sopenharmony_ci * MAC special debug mode selection registers.
92462306a36Sopenharmony_ci * DBGSEL0: MAC special debug mode selection register 0.
92562306a36Sopenharmony_ci * DBGSEL1: MAC special debug mode selection register 1.
92662306a36Sopenharmony_ci */
92762306a36Sopenharmony_ci#define DBGSEL0				0x016c
92862306a36Sopenharmony_ci#define DBGSEL1				0x0170
92962306a36Sopenharmony_ci
93062306a36Sopenharmony_ci/*
93162306a36Sopenharmony_ci * BISTCSR: BBP BIST register.
93262306a36Sopenharmony_ci */
93362306a36Sopenharmony_ci#define BISTCSR				0x0174
93462306a36Sopenharmony_ci
93562306a36Sopenharmony_ci/*
93662306a36Sopenharmony_ci * Multicast filter registers.
93762306a36Sopenharmony_ci * MCAST0: Multicast filter register 0.
93862306a36Sopenharmony_ci * MCAST1: Multicast filter register 1.
93962306a36Sopenharmony_ci */
94062306a36Sopenharmony_ci#define MCAST0				0x0178
94162306a36Sopenharmony_ci#define MCAST1				0x017c
94262306a36Sopenharmony_ci
94362306a36Sopenharmony_ci/*
94462306a36Sopenharmony_ci * UART registers.
94562306a36Sopenharmony_ci * UARTCSR0: UART1 TX register.
94662306a36Sopenharmony_ci * UARTCSR1: UART1 RX register.
94762306a36Sopenharmony_ci * UARTCSR3: UART1 frame control register.
94862306a36Sopenharmony_ci * UARTCSR4: UART1 buffer control register.
94962306a36Sopenharmony_ci * UART2CSR0: UART2 TX register.
95062306a36Sopenharmony_ci * UART2CSR1: UART2 RX register.
95162306a36Sopenharmony_ci * UART2CSR3: UART2 frame control register.
95262306a36Sopenharmony_ci * UART2CSR4: UART2 buffer control register.
95362306a36Sopenharmony_ci */
95462306a36Sopenharmony_ci#define UARTCSR0			0x0180
95562306a36Sopenharmony_ci#define UARTCSR1			0x0184
95662306a36Sopenharmony_ci#define UARTCSR3			0x0188
95762306a36Sopenharmony_ci#define UARTCSR4			0x018c
95862306a36Sopenharmony_ci#define UART2CSR0			0x0190
95962306a36Sopenharmony_ci#define UART2CSR1			0x0194
96062306a36Sopenharmony_ci#define UART2CSR3			0x0198
96162306a36Sopenharmony_ci#define UART2CSR4			0x019c
96262306a36Sopenharmony_ci
96362306a36Sopenharmony_ci/*
96462306a36Sopenharmony_ci * BBP registers.
96562306a36Sopenharmony_ci * The wordsize of the BBP is 8 bits.
96662306a36Sopenharmony_ci */
96762306a36Sopenharmony_ci
96862306a36Sopenharmony_ci/*
96962306a36Sopenharmony_ci * R2: TX antenna control
97062306a36Sopenharmony_ci */
97162306a36Sopenharmony_ci#define BBP_R2_TX_ANTENNA		FIELD8(0x03)
97262306a36Sopenharmony_ci#define BBP_R2_TX_IQ_FLIP		FIELD8(0x04)
97362306a36Sopenharmony_ci
97462306a36Sopenharmony_ci/*
97562306a36Sopenharmony_ci * R14: RX antenna control
97662306a36Sopenharmony_ci */
97762306a36Sopenharmony_ci#define BBP_R14_RX_ANTENNA		FIELD8(0x03)
97862306a36Sopenharmony_ci#define BBP_R14_RX_IQ_FLIP		FIELD8(0x04)
97962306a36Sopenharmony_ci
98062306a36Sopenharmony_ci/*
98162306a36Sopenharmony_ci * BBP_R70
98262306a36Sopenharmony_ci */
98362306a36Sopenharmony_ci#define BBP_R70_JAPAN_FILTER		FIELD8(0x08)
98462306a36Sopenharmony_ci
98562306a36Sopenharmony_ci/*
98662306a36Sopenharmony_ci * RF registers
98762306a36Sopenharmony_ci */
98862306a36Sopenharmony_ci
98962306a36Sopenharmony_ci/*
99062306a36Sopenharmony_ci * RF 1
99162306a36Sopenharmony_ci */
99262306a36Sopenharmony_ci#define RF1_TUNER			FIELD32(0x00020000)
99362306a36Sopenharmony_ci
99462306a36Sopenharmony_ci/*
99562306a36Sopenharmony_ci * RF 3
99662306a36Sopenharmony_ci */
99762306a36Sopenharmony_ci#define RF3_TUNER			FIELD32(0x00000100)
99862306a36Sopenharmony_ci#define RF3_TXPOWER			FIELD32(0x00003e00)
99962306a36Sopenharmony_ci
100062306a36Sopenharmony_ci/*
100162306a36Sopenharmony_ci * EEPROM content.
100262306a36Sopenharmony_ci * The wordsize of the EEPROM is 16 bits.
100362306a36Sopenharmony_ci */
100462306a36Sopenharmony_ci
100562306a36Sopenharmony_ci/*
100662306a36Sopenharmony_ci * HW MAC address.
100762306a36Sopenharmony_ci */
100862306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_0		0x0002
100962306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE0		FIELD16(0x00ff)
101062306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE1		FIELD16(0xff00)
101162306a36Sopenharmony_ci#define EEPROM_MAC_ADDR1		0x0003
101262306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE2		FIELD16(0x00ff)
101362306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE3		FIELD16(0xff00)
101462306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_2		0x0004
101562306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE4		FIELD16(0x00ff)
101662306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE5		FIELD16(0xff00)
101762306a36Sopenharmony_ci
101862306a36Sopenharmony_ci/*
101962306a36Sopenharmony_ci * EEPROM antenna.
102062306a36Sopenharmony_ci * ANTENNA_NUM: Number of antenna's.
102162306a36Sopenharmony_ci * TX_DEFAULT: Default antenna 0: diversity, 1: A, 2: B.
102262306a36Sopenharmony_ci * RX_DEFAULT: Default antenna 0: diversity, 1: A, 2: B.
102362306a36Sopenharmony_ci * LED_MODE: 0: default, 1: TX/RX activity,2: Single (ignore link), 3: rsvd.
102462306a36Sopenharmony_ci * DYN_TXAGC: Dynamic TX AGC control.
102562306a36Sopenharmony_ci * HARDWARE_RADIO: 1: Hardware controlled radio. Read GPIO0.
102662306a36Sopenharmony_ci * RF_TYPE: Rf_type of this adapter.
102762306a36Sopenharmony_ci */
102862306a36Sopenharmony_ci#define EEPROM_ANTENNA			0x10
102962306a36Sopenharmony_ci#define EEPROM_ANTENNA_NUM		FIELD16(0x0003)
103062306a36Sopenharmony_ci#define EEPROM_ANTENNA_TX_DEFAULT	FIELD16(0x000c)
103162306a36Sopenharmony_ci#define EEPROM_ANTENNA_RX_DEFAULT	FIELD16(0x0030)
103262306a36Sopenharmony_ci#define EEPROM_ANTENNA_LED_MODE		FIELD16(0x01c0)
103362306a36Sopenharmony_ci#define EEPROM_ANTENNA_DYN_TXAGC	FIELD16(0x0200)
103462306a36Sopenharmony_ci#define EEPROM_ANTENNA_HARDWARE_RADIO	FIELD16(0x0400)
103562306a36Sopenharmony_ci#define EEPROM_ANTENNA_RF_TYPE		FIELD16(0xf800)
103662306a36Sopenharmony_ci
103762306a36Sopenharmony_ci/*
103862306a36Sopenharmony_ci * EEPROM NIC config.
103962306a36Sopenharmony_ci * CARDBUS_ACCEL: 0: enable, 1: disable.
104062306a36Sopenharmony_ci * DYN_BBP_TUNE: 0: enable, 1: disable.
104162306a36Sopenharmony_ci * CCK_TX_POWER: CCK TX power compensation.
104262306a36Sopenharmony_ci */
104362306a36Sopenharmony_ci#define EEPROM_NIC			0x11
104462306a36Sopenharmony_ci#define EEPROM_NIC_CARDBUS_ACCEL	FIELD16(0x0001)
104562306a36Sopenharmony_ci#define EEPROM_NIC_DYN_BBP_TUNE		FIELD16(0x0002)
104662306a36Sopenharmony_ci#define EEPROM_NIC_CCK_TX_POWER		FIELD16(0x000c)
104762306a36Sopenharmony_ci
104862306a36Sopenharmony_ci/*
104962306a36Sopenharmony_ci * EEPROM geography.
105062306a36Sopenharmony_ci * GEO: Default geography setting for device.
105162306a36Sopenharmony_ci */
105262306a36Sopenharmony_ci#define EEPROM_GEOGRAPHY		0x12
105362306a36Sopenharmony_ci#define EEPROM_GEOGRAPHY_GEO		FIELD16(0x0f00)
105462306a36Sopenharmony_ci
105562306a36Sopenharmony_ci/*
105662306a36Sopenharmony_ci * EEPROM BBP.
105762306a36Sopenharmony_ci */
105862306a36Sopenharmony_ci#define EEPROM_BBP_START		0x13
105962306a36Sopenharmony_ci#define EEPROM_BBP_SIZE			16
106062306a36Sopenharmony_ci#define EEPROM_BBP_VALUE		FIELD16(0x00ff)
106162306a36Sopenharmony_ci#define EEPROM_BBP_REG_ID		FIELD16(0xff00)
106262306a36Sopenharmony_ci
106362306a36Sopenharmony_ci/*
106462306a36Sopenharmony_ci * EEPROM TXPOWER
106562306a36Sopenharmony_ci */
106662306a36Sopenharmony_ci#define EEPROM_TXPOWER_START		0x23
106762306a36Sopenharmony_ci#define EEPROM_TXPOWER_SIZE		7
106862306a36Sopenharmony_ci#define EEPROM_TXPOWER_1		FIELD16(0x00ff)
106962306a36Sopenharmony_ci#define EEPROM_TXPOWER_2		FIELD16(0xff00)
107062306a36Sopenharmony_ci
107162306a36Sopenharmony_ci/*
107262306a36Sopenharmony_ci * RSSI <-> dBm offset calibration
107362306a36Sopenharmony_ci */
107462306a36Sopenharmony_ci#define EEPROM_CALIBRATE_OFFSET		0x3e
107562306a36Sopenharmony_ci#define EEPROM_CALIBRATE_OFFSET_RSSI	FIELD16(0x00ff)
107662306a36Sopenharmony_ci
107762306a36Sopenharmony_ci/*
107862306a36Sopenharmony_ci * DMA descriptor defines.
107962306a36Sopenharmony_ci */
108062306a36Sopenharmony_ci#define TXD_DESC_SIZE			(11 * sizeof(__le32))
108162306a36Sopenharmony_ci#define RXD_DESC_SIZE			(11 * sizeof(__le32))
108262306a36Sopenharmony_ci
108362306a36Sopenharmony_ci/*
108462306a36Sopenharmony_ci * TX descriptor format for TX, PRIO, ATIM and Beacon Ring.
108562306a36Sopenharmony_ci */
108662306a36Sopenharmony_ci
108762306a36Sopenharmony_ci/*
108862306a36Sopenharmony_ci * Word0
108962306a36Sopenharmony_ci */
109062306a36Sopenharmony_ci#define TXD_W0_OWNER_NIC		FIELD32(0x00000001)
109162306a36Sopenharmony_ci#define TXD_W0_VALID			FIELD32(0x00000002)
109262306a36Sopenharmony_ci#define TXD_W0_RESULT			FIELD32(0x0000001c)
109362306a36Sopenharmony_ci#define TXD_W0_RETRY_COUNT		FIELD32(0x000000e0)
109462306a36Sopenharmony_ci#define TXD_W0_MORE_FRAG		FIELD32(0x00000100)
109562306a36Sopenharmony_ci#define TXD_W0_ACK			FIELD32(0x00000200)
109662306a36Sopenharmony_ci#define TXD_W0_TIMESTAMP		FIELD32(0x00000400)
109762306a36Sopenharmony_ci#define TXD_W0_OFDM			FIELD32(0x00000800)
109862306a36Sopenharmony_ci#define TXD_W0_CIPHER_OWNER		FIELD32(0x00001000)
109962306a36Sopenharmony_ci#define TXD_W0_IFS			FIELD32(0x00006000)
110062306a36Sopenharmony_ci#define TXD_W0_RETRY_MODE		FIELD32(0x00008000)
110162306a36Sopenharmony_ci#define TXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
110262306a36Sopenharmony_ci#define TXD_W0_CIPHER_ALG		FIELD32(0xe0000000)
110362306a36Sopenharmony_ci
110462306a36Sopenharmony_ci/*
110562306a36Sopenharmony_ci * Word1
110662306a36Sopenharmony_ci */
110762306a36Sopenharmony_ci#define TXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
110862306a36Sopenharmony_ci
110962306a36Sopenharmony_ci/*
111062306a36Sopenharmony_ci * Word2
111162306a36Sopenharmony_ci */
111262306a36Sopenharmony_ci#define TXD_W2_IV_OFFSET		FIELD32(0x0000003f)
111362306a36Sopenharmony_ci#define TXD_W2_AIFS			FIELD32(0x000000c0)
111462306a36Sopenharmony_ci#define TXD_W2_CWMIN			FIELD32(0x00000f00)
111562306a36Sopenharmony_ci#define TXD_W2_CWMAX			FIELD32(0x0000f000)
111662306a36Sopenharmony_ci
111762306a36Sopenharmony_ci/*
111862306a36Sopenharmony_ci * Word3: PLCP information
111962306a36Sopenharmony_ci */
112062306a36Sopenharmony_ci#define TXD_W3_PLCP_SIGNAL		FIELD32(0x000000ff)
112162306a36Sopenharmony_ci#define TXD_W3_PLCP_SERVICE		FIELD32(0x0000ff00)
112262306a36Sopenharmony_ci#define TXD_W3_PLCP_LENGTH_LOW		FIELD32(0x00ff0000)
112362306a36Sopenharmony_ci#define TXD_W3_PLCP_LENGTH_HIGH		FIELD32(0xff000000)
112462306a36Sopenharmony_ci
112562306a36Sopenharmony_ci/*
112662306a36Sopenharmony_ci * Word4
112762306a36Sopenharmony_ci */
112862306a36Sopenharmony_ci#define TXD_W4_IV			FIELD32(0xffffffff)
112962306a36Sopenharmony_ci
113062306a36Sopenharmony_ci/*
113162306a36Sopenharmony_ci * Word5
113262306a36Sopenharmony_ci */
113362306a36Sopenharmony_ci#define TXD_W5_EIV			FIELD32(0xffffffff)
113462306a36Sopenharmony_ci
113562306a36Sopenharmony_ci/*
113662306a36Sopenharmony_ci * Word6-9: Key
113762306a36Sopenharmony_ci */
113862306a36Sopenharmony_ci#define TXD_W6_KEY			FIELD32(0xffffffff)
113962306a36Sopenharmony_ci#define TXD_W7_KEY			FIELD32(0xffffffff)
114062306a36Sopenharmony_ci#define TXD_W8_KEY			FIELD32(0xffffffff)
114162306a36Sopenharmony_ci#define TXD_W9_KEY			FIELD32(0xffffffff)
114262306a36Sopenharmony_ci
114362306a36Sopenharmony_ci/*
114462306a36Sopenharmony_ci * Word10
114562306a36Sopenharmony_ci */
114662306a36Sopenharmony_ci#define TXD_W10_RTS			FIELD32(0x00000001)
114762306a36Sopenharmony_ci#define TXD_W10_TX_RATE			FIELD32(0x000000fe)
114862306a36Sopenharmony_ci
114962306a36Sopenharmony_ci/*
115062306a36Sopenharmony_ci * RX descriptor format for RX Ring.
115162306a36Sopenharmony_ci */
115262306a36Sopenharmony_ci
115362306a36Sopenharmony_ci/*
115462306a36Sopenharmony_ci * Word0
115562306a36Sopenharmony_ci */
115662306a36Sopenharmony_ci#define RXD_W0_OWNER_NIC		FIELD32(0x00000001)
115762306a36Sopenharmony_ci#define RXD_W0_UNICAST_TO_ME		FIELD32(0x00000002)
115862306a36Sopenharmony_ci#define RXD_W0_MULTICAST		FIELD32(0x00000004)
115962306a36Sopenharmony_ci#define RXD_W0_BROADCAST		FIELD32(0x00000008)
116062306a36Sopenharmony_ci#define RXD_W0_MY_BSS			FIELD32(0x00000010)
116162306a36Sopenharmony_ci#define RXD_W0_CRC_ERROR		FIELD32(0x00000020)
116262306a36Sopenharmony_ci#define RXD_W0_OFDM			FIELD32(0x00000040)
116362306a36Sopenharmony_ci#define RXD_W0_PHYSICAL_ERROR		FIELD32(0x00000080)
116462306a36Sopenharmony_ci#define RXD_W0_CIPHER_OWNER		FIELD32(0x00000100)
116562306a36Sopenharmony_ci#define RXD_W0_ICV_ERROR		FIELD32(0x00000200)
116662306a36Sopenharmony_ci#define RXD_W0_IV_OFFSET		FIELD32(0x0000fc00)
116762306a36Sopenharmony_ci#define RXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
116862306a36Sopenharmony_ci#define RXD_W0_CIPHER_ALG		FIELD32(0xe0000000)
116962306a36Sopenharmony_ci
117062306a36Sopenharmony_ci/*
117162306a36Sopenharmony_ci * Word1
117262306a36Sopenharmony_ci */
117362306a36Sopenharmony_ci#define RXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
117462306a36Sopenharmony_ci
117562306a36Sopenharmony_ci/*
117662306a36Sopenharmony_ci * Word2
117762306a36Sopenharmony_ci */
117862306a36Sopenharmony_ci#define RXD_W2_SIGNAL			FIELD32(0x000000ff)
117962306a36Sopenharmony_ci#define RXD_W2_RSSI			FIELD32(0x0000ff00)
118062306a36Sopenharmony_ci#define RXD_W2_TA			FIELD32(0xffff0000)
118162306a36Sopenharmony_ci
118262306a36Sopenharmony_ci/*
118362306a36Sopenharmony_ci * Word3
118462306a36Sopenharmony_ci */
118562306a36Sopenharmony_ci#define RXD_W3_TA			FIELD32(0xffffffff)
118662306a36Sopenharmony_ci
118762306a36Sopenharmony_ci/*
118862306a36Sopenharmony_ci * Word4
118962306a36Sopenharmony_ci */
119062306a36Sopenharmony_ci#define RXD_W4_IV			FIELD32(0xffffffff)
119162306a36Sopenharmony_ci
119262306a36Sopenharmony_ci/*
119362306a36Sopenharmony_ci * Word5
119462306a36Sopenharmony_ci */
119562306a36Sopenharmony_ci#define RXD_W5_EIV			FIELD32(0xffffffff)
119662306a36Sopenharmony_ci
119762306a36Sopenharmony_ci/*
119862306a36Sopenharmony_ci * Word6-9: Key
119962306a36Sopenharmony_ci */
120062306a36Sopenharmony_ci#define RXD_W6_KEY			FIELD32(0xffffffff)
120162306a36Sopenharmony_ci#define RXD_W7_KEY			FIELD32(0xffffffff)
120262306a36Sopenharmony_ci#define RXD_W8_KEY			FIELD32(0xffffffff)
120362306a36Sopenharmony_ci#define RXD_W9_KEY			FIELD32(0xffffffff)
120462306a36Sopenharmony_ci
120562306a36Sopenharmony_ci/*
120662306a36Sopenharmony_ci * Word10
120762306a36Sopenharmony_ci */
120862306a36Sopenharmony_ci#define RXD_W10_DROP			FIELD32(0x00000001)
120962306a36Sopenharmony_ci
121062306a36Sopenharmony_ci/*
121162306a36Sopenharmony_ci * Macros for converting txpower from EEPROM to mac80211 value
121262306a36Sopenharmony_ci * and from mac80211 value to register value.
121362306a36Sopenharmony_ci */
121462306a36Sopenharmony_ci#define MIN_TXPOWER	0
121562306a36Sopenharmony_ci#define MAX_TXPOWER	31
121662306a36Sopenharmony_ci#define DEFAULT_TXPOWER	24
121762306a36Sopenharmony_ci
121862306a36Sopenharmony_ci#define TXPOWER_FROM_DEV(__txpower) \
121962306a36Sopenharmony_ci	(((u8)(__txpower)) > MAX_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
122062306a36Sopenharmony_ci
122162306a36Sopenharmony_ci#define TXPOWER_TO_DEV(__txpower) \
122262306a36Sopenharmony_ci	clamp_t(u8, __txpower, MIN_TXPOWER, MAX_TXPOWER)
122362306a36Sopenharmony_ci
122462306a36Sopenharmony_ci#endif /* RT2500PCI_H */
1225