Hardware reference

MAC

On this page

The MAC window at 0x09c0_0000 spans 0x2000 bytes but is sparse: the firmware uses more than a hundred of its offsets, grouped here by function. Offsets are written +0x0e34, relative to the window. Receive packet DMA, at +0x0600, has its own page. Words that only the start-up image writes are listed under Receive register image. Every register is also in the register index.

The Access column says how the firmware uses a register: W written, R read, RW both.

Address match

Three address entries, each a low word, a high word and a mode word, decide which frames the MAC accepts and acknowledges. Four further entries at +0x0060 are initialized disabled and not used.

OffsetAddressRegisterAccessDescription
+0x00300x09c0_0030OWN_MAC_LOWWOwn address, octets 0–3, little-endian
+0x00340x09c0_0034OWN_MAC_HIGHWOwn address, octets 4–5
+0x00380x09c0_0038OWN_MAC_MODEW0x101: enabled, own address
+0x003c0x09c0_003cBSSID_LOWWBSSID octets 0–3
+0x00400x09c0_0040BSSID_HIGHWBSSID octets 4–5
+0x00440x09c0_0044BSSID_MODEW0x301 while joined as a station; 0 otherwise. An access point matches its own address only.
+0x00480x09c0_0048SECOND_ADDR_LOWWOwn address, octets 0–3, for the second interface slot
+0x004c0x09c0_004cSECOND_ADDR_HIGHWOwn address, octets 4–5, for the second interface slot
+0x00500x09c0_0050SECOND_ADDR_MODEW0x101: enabled, own address
+0x00600x09c0_0060MATCH_WORDS[0..11]WFour entries of three words, at +0x0060, +0x006c, +0x0078 and +0x0084, initialized disabled: 0xffff_ffff, 0xff, 0xff

Match mode words

Shared by OWN_MAC_MODE, BSSID_MODE and SECOND_ADDR_MODE.

Bits Field Description
9:8 ROLE Match role.
1 OWN: Own address, or the BSSID of an AP or IBSS interface.
3 STATION: The BSSID of the AP a station is joined to. With ROLE = 1 in BSSID_MODE instead, the MAC answers the AP’s aggregates from an unused pipe.
0 ENABLE Set to use the entry; 0 disables it.

Source: MatchMode · 4 bytes

Mode and filter

OffsetAddressRegisterAccessDescription
+0x02000x09c0_0200MODEWBase value plus one group of bits per active record
+0x02040x09c0_0204FILTERWReceive filter: 0x0019_8000 while scanning, 0x0279_fe00 when joined. Bit meanings unknown.
+0x020c0x09c0_020cMODE_20CWWritten 3 at packet-DMA start-up; function unknown
+0x02100x09c0_0210TIMING[0..22]W23 words up to +0x0268. Cleared at start-up, then rewritten by the receive image.
+0x02700x09c0_0270SECOND_PATHW0x0100_0000 or 0x0400_0000, by the second active record’s path
+0x02ec0x09c0_02ecRECEIVE_SETUP_2ECWWritten 4 by the receive image; function unknown
+0x03080x09c0_0308RECEIVE_SETUP_308WWritten 0x70 by the receive image; function unknown
+0x03100x09c0_0310TIMING_310WWritten 0x7800_0000 when scanning and when joined; function unknown
+0x03140x09c0_0314SECOND_PATH_ENABLEW0x0100_0000 when a second active record shares the channel, else 0

The scan filter drops BlockAcks. With the scan value in FILTER, packet DMA never delivers received compressed BlockAck frames, even though the AP sends them and TX status completes. A joined station must switch to the joined value.

MODE

The firmware starts from 0x07e3_b85c, whose other set bits are not described, and adds one group of four bits per active interface record: path 0 when the record’s address is interface 0’s, path 1 otherwise. Scanning uses the base with path 1, 0x07f3_bd5e.

Bits Field Description
20 PATH1_20 In path 1’s mask, 0x0010_0502.
19 PATH0_19 In path 0’s mask, 0x0008_0281.
14 MODE2 Set if any active interface record has mode 2.
10 PATH1_10 In path 1’s mask, 0x0010_0502.
9 PATH0_9 In path 0’s mask, 0x0008_0281.
8 PATH1_8 In path 1’s mask, 0x0010_0502.
7 PATH0_7 In path 0’s mask, 0x0008_0281.
1 PATH1_1 In path 1’s mask, 0x0010_0502.
0 PATH0_0 In path 0’s mask, 0x0008_0281.

Source: MacMode · 4 bytes

Packet DMA and rate RAM

OffsetAddressRegisterAccessDescription
+0x06140x09c0_0614SLOT_TIMING_614W0x01cd, with the slot timings. Inside the receive DMA block’s range but not part of its layout.
+0x06180x09c0_0618SLOT_TIMING_618W0x004d, with the slot timings, likewise
+0x08000x09c0_0800RATE_RAM_BASEWMAC packet offset of the rate RAM. Rewritten after every channel change.
+0x080c0x09c0_080cPACKET_DMA_CFGWCleared at packet-DMA start-up; function unknown
+0x08100x09c0_0810SLOT_TIMING_810WCleared with the slot timings

Response engine

The response engine sends descriptors that the firmware builds in packet RAM: beacons, ACK, CTS and BlockAck. It finds them through a table of 32 pointers.

OffsetAddressRegisterAccessDescription
+0x0a000x09c0_0a00BEACON_CONTROLW0x1030_0000 idle, 0x1030_0001 armed
+0x0a040x09c0_0a04RESPONSE_ENABLERWBit n enables pointer slot n + 2. The mode writes set it whole, 0x0018_0180 while scanning and 0x0018_0783 when joined; installing the BlockAck slots ORs in their bits.
+0x0a080x09c0_0a08RESPONSE_BITMAP_SETRWBit n set when pointer slot n + 2 is programmed. Keep it set while the slot is in use.
+0x0a0c0x09c0_0a0cRESPONSE_BITMAP_CLEARRWBit n set when slot n + 2 is programmed, and cleared again for the BlockAck slots 11 and 12. Function unknown.
+0x0a100x09c0_0a10RESPONSE_STATERW24-bit per-slot bitmap; bit n cleared when slot n + 2 is programmed. Function unknown.
+0x0a140x09c0_0a14SLOT_FIELD_LOWWWritten 0 whole when a BlockAck slot up to 17 is configured, and by the receive image; function unknown
+0x0a180x09c0_0a18SLOT_FIELD_HIGHWWritten 0 whole when a BlockAck slot above 17 is configured; 0x8000 in the receive image; function unknown
+0x0a1c0x09c0_0a1cRESPONSE_MASKW0x827b_ffdf when scanning and when joined; function unknown
+0x0a280x09c0_0a28RADIO_STOPWCleared when the radio stops for a channel change inferred
+0x0c000x09c0_0c00RESPONSE_POINTER_BASEWMAC packet offset of the 32-entry pointer table

Response commands

The descriptors the pointer slots point at are response commands in packet RAM. Like a transmit slot they start with three header words, then a command stream (opcodes). Times are in microseconds; base is the slot-time base and const the slot-time constant.

Command +0x00 +0x04 +0x08
Beacon (3) gap | gap << 16 | 0xe000_e000, gap = (16 × base + const) & 0x1fff 0xbc01_0000: a fixed backoff 0x5800_0000
ACK, CTS (4–7) const << 16 | 0x2000_0000 0 0x5800_0000
BlockAck (11, 12) const << 16 | 0x2000_0000 0 0x5800_0000
Idle and TBTT (0–8, 11, 12 at start-up) n | n << 16 | 0x2000_0000, n = (const + 8 × base) & 0x1fff 0xdc01 in bits 31:16; the low half is not written 0x8000_0000

The beacon’s stream:

0x51 rate word
0x50 PHY control
0x52 rate attribute, length + 4
0x32 frame control
0x32 0                         duration
0x29 header address
0x21 sequence word
0x0700_8400                    insert the timestamp
0x40 address of byte 32, length word
0x0700_4600
0xf000_0000

The ACK and CTS templates, from +0x0c:

0x5900_0000
0x5800_0003
0x5a00_000e
0x3100_00d4 (ACK)  or  0x3100_00c4 (CTS)
0x4700_0000
0x20 interface metadata byte
0x0700_2008 (ACK)  or  0x0700_2004 (CTS)
0x0700_6828
0x0700_4600
0xf000_0000

The BlockAck template, from +0x0c:

0x5900_0000
0x5800_0003
0x5a00_0020
0x3100_0094
0x4700_0000
0x20 interface metadata byte
0x3200_0000
0x6900_0000
0x0700_6820
0x6800_0000
0x6000_0000
0x0700_4600
0xf000_0000

Response slot bitmaps

One bit per response pointer slot in RESPONSE_ENABLE, RESPONSE_BITMAP_SET and RESPONSE_BITMAP_CLEAR. The firmware masks its RESPONSE_STATE writes to bits 23:0. Bits 30:25 are never written; no slot above 22 is installed, so bits 24:21 stay clear too.

Bits Field Description
31 SLOT_27_28 Slots 27 and 28, both, in the two bitmaps. Never installed.
24:0 SLOT Bit n stands for pointer slot n + 2, slots 2 to 26.

Source: ResponseSlots · 4 bytes

BEACON_CONTROL

The firmware writes 0x1030_0000 plus this bit; the other set bits are not described.

Bits Field Description
0 ARM Send the beacon descriptor in pointer slot 0 at the next TBTT.

Source: BeaconControl · 4 bytes

Pointer slots

Every slot starts pointing at response command 8, the idle descriptor; slots not listed keep it. The firmware installs:

Slot Response command Descriptor
0 3 Beacon, while armed
2, 3 11, 12 BlockAck, interface 0 and 1
9, 10 6, 7 CTS, interface 0 and 1
11, 12 11, 12 BlockAck, interface 0 and 1
16 8 Idle descriptor, installed when beaconing starts so that its bitmap bits are set
21, 22 4, 5 ACK, interface 0 and 1

Pointers hold MAC packet offsets. Four things set the slots up:

If a slot’s RESPONSE_BITMAP_SET bit is clear, the MAC sends its descriptor from another pipe, which the peer does not expect.

Event FIFO

The MAC reports transmit progress, received frames and pipe service requests as 32-bit words in an event FIFO. Its event line is the CPU’s FIQ; the main loop drains the FIFO. The firmware drains the FIFO only while EVENT_READINESS bit 31 is clear: it pops one event, then keeps popping until the bit sets.

OffsetAddressRegisterAccessDescription
+0x0a200x09c0_0a20MAC_EVENT_FIFOREach read pops one event word
+0x0a240x09c0_0a24EVENT_READINESSRBit 31 set when the event FIFO is empty

Event word

Bits 31, 30, 26:23 and 7 are flags; the rest are small fields.

Bits Field Description
31 EMPTY The FIFO was empty; the rest of the word is not an event.
30 FATAL Fatal MAC condition. The firmware records a postmortem and stops.
26 BEACON Beacon event.
25 PIPE_VALID PIPE is valid; latched for type 0x37.
24 COMPLETION Carries a terminal TX status in STATUS.
23 SERVICE Pipe service requested; consult the pipe scheduler word.
19:18 PIPE Pipe the event refers to.
17:16 PHASE Decoded as the event’s phase; the meaning is not established.
13:8 TYPE Event class, for example 0x37 for a pipe event.
7 SIDEBAND Set for each received frame. The firmware reads PHY_SIDEBAND once per such event.
5:0 STATUS TX status for completion events (bit 24); other classes use these bits differently.

Source: MacEventWord · 4 bytes

EVENT_READINESS

Bits Field Description
31 EMPTY Set when the event FIFO holds no more events. The firmware drains the FIFO only while this bit is clear.

Source: EventReadiness · 4 bytes

TSF and beacon timing

OffsetAddressRegisterAccessDescription
+0x0e000x09c0_0e00TIMING_BLOCKW0x4f00_004f at start-up; function unknown
+0x0e040x09c0_0e04TIMING_BLOCK_4W0x0909_0000 at start-up, after which +0x0e08–+0x0e2c, BEACON_TIMER included, are cleared; function unknown
+0x0e080x09c0_0e08BEACON_TIMERWNext beacon time; 0 disarms
+0x0e340x09c0_0e34TSF_CONTROLRWWritten 0, then 3, at start-up. The IRQ 26 handler writes back its value masked with 0x1f00_0003.
+0x0e380x09c0_0e38TSF_LOWRWLow 32 bits of the 64-bit microsecond TSF; cleared at start-up
+0x0e3c0x09c0_0e3cTSF_HIGHRWHigh 32 bits. Read high, low, high again, and retry if the high word changed.
+0x0e940x09c0_0e94BEACON_AIRTIMEWAirtime of a 24-octet frame at the beacon rate, with a small per-configuration adjustment

BEACON_TIMER

Bits Field Description
30 ARM Set when arming.
23:0 TBTT Low 24 bits of the target beacon transmission time, in TSF microseconds.

Source: BeaconTimer · 4 bytes

Slot timing and EDCA

The firmware writes these together, with SLOT_TIMING_614, SLOT_TIMING_618 and SLOT_TIMING_810 listed under packet DMA. SLOT_BASE, SLOT_X16 and SLOT_X24 derive from the interface’s slot-time base, 9 µs for a joined station; the others are constants.

OffsetAddressRegisterAccessDescription
+0x04280x09c0_0428SLOT_TIMING_428WWritten 0x049d with the slot timings; function unknown
+0x042c0x09c0_042cSLOT_TIMING_42CWWritten 0x049d with the slot timings; function unknown
+0x04340x09c0_0434SLOT_TIMING_434WWritten 0x003d with the slot timings; function unknown
+0x04380x09c0_0438SLOT_TIMING_438WWritten 0x003d with the slot timings; function unknown
+0x043c0x09c0_043cSLOT_TIMING_43CWWritten 0x0298 with the slot timings; function unknown
+0x04400x09c0_0440SLOT_TIMING_440WWritten 0x0298 with the slot timings; function unknown
+0x04440x09c0_0444SLOT_TIMING_444WWritten 0x0258 with the slot timings; function unknown
+0x04480x09c0_0448SLOT_TIMING_448WWritten 0x0258 with the slot timings; function unknown
+0x044c0x09c0_044cSLOT_TIMING_44CWWritten 0x0134 with the slot timings; function unknown
+0x0e300x09c0_0e30SLOT_BASEWbase × 8 − 1
+0x0e580x09c0_0e58SLOT_X16Wbase × 16 + 2
+0x0e5c0x09c0_0e5cSLOT_X24Wbase × 24 + 2
+0x0e640x09c0_0e64EDCA_AIFSWPacked AIFS values of the active record, written when they change as a frame is staged

TX pipe scheduler

OffsetAddressRegisterAccessDescription
+0x0e600x09c0_0e60PIPE_CFG_60WWritten 2 at start-up; function unknown
+0x0e700x09c0_0e70PIPE_QUANTUM[0..3]WOne word per pipe, at +0x0e70–+0x0e7c: (quantum + 0x1f) >> 5, written as each frame is staged
+0x0e800x09c0_0e80PIPE_CFG_80WWritten 0x100 at start-up; function unknown
+0x0e840x09c0_0e84PIPE_SCHEDULERRWRead once per event; acknowledged by writing the ones’ complement of the serviced bit
+0x0e880x09c0_0e88PIPE_CFG_88WWritten 0xff at start-up; function unknown
+0x0e8c0x09c0_0e8cCOMMAND_FETCHRW0xbf at start-up, after 0 in the second pass; the name assumes it enables command fetch. In operation the pipe watchdog clears bits 5:2 for about 2 µs and restores the saved value when a pipe nears expiry. Those bits may gate reception rather than fetch. hypothesis
+0x0e980x09c0_0e98PIPE_TRIGGERWTells the MAC which pipes the firmware has published to or serviced

PIPE_SCHEDULER

The lowest non-zero nibble decides which service runs.

Bits Field Description
15:12 SERVICE_HIGH One bit per pipe. Services the pipe latched by the last pipe event.
11:8 RETRY One bit per pipe; with TX status 4 or 0x19 the pipe’s frames are retried.
7:4 SERVICE_MID One bit per pipe. Only the lowest asserted pipe is serviced.
3:0 SERVICE_LOW One bit per pipe. All asserted pipes are serviced together: the firmware programs backoff for pipes 0–2 and triggers each of them.

Source: PipeScheduler · 4 bytes

PIPE_TRIGGER

Bits Field Description
28:25 PIPES One bit per serviced pipe.

Source: PipeTrigger · 4 bytes

Control and debug

OffsetAddressRegisterAccessDescription
+0x10000x09c0_1000PACKET_CONTROLLERW1 enables the packet controller: the last hardware step before the startup indication
+0x13000x09c0_1300MATCH_CONTROLW0, then 0x0100_0000, just before the match entries are initialized
+0x14000x09c0_1400DEBUG_CONTEXTWWritten 0, after the four words below, at start-up and before a station transmits after a retune; function unknown
+0x14040x09c0_1404DEBUG_CONTEXT_4W0 at start-up and before a station transmits after a retune
+0x14080x09c0_1408DEBUG_CONTEXT_8W0 at start-up and before a station transmits after a retune
+0x140c0x09c0_140cDEBUG_CONTEXT_CW0x7ff at start-up; 0 before a station transmits after a retune
+0x14100x09c0_1410DEBUG_CONTEXT_10W0 at start-up and before a station transmits after a retune
—0x09c1_0000MAC_10000WOutside the MAC window, at +0x1_0000. Cleared at packet-DMA start-up; function unknown.

Receive register image

At start-up the firmware writes this fixed image, in this order, to configure reception; the functions of these words are unknown. It includes the 23 TIMING words from +0x0210. Two of them, 0x0400_0004 at +0x0230 and 0x0400_0000 at +0x0260, look like DTCM addresses but are probably timing values inferred: other values slow association.

Show the 75 writes
# Address Value
0 0x09c0_0000 0x8000_ffd4
1 0x09c0_0004 0x8000_ffc4
2 0x09c0_0008 0x8000_ffb4
3 0x09c0_000c 0x8000_efe4
4 0x09c0_0010 0x8000_ff84
5 0x09c0_0014 0x8000_ff94
6 0x09c0_0018 0x0000_ff80
7 0x09c0_001c 0x0000_8f88
8 0x09c0_0020 0x0000_2020
9 0x09c0_0024 0x0000_4040
10 0x09c0_0028 0x0000_4000
11 0x09c0_002c 0x0004_0101
12 0x09c0_00a0 0x0010_0101
13 0x09c0_00a4 0x8018_6000
14 0x09c0_00a8 0x0002_ff00
15 0x09c0_00ac 0x0003_ff00
16 0x09c0_00b0 0x0000_ff74
17 0x09c0_00b4 0x0084_0604
18 0x09c0_00b8 0x0001_8080
19 0x09c0_00bc 0x801a_0202
20 0x09c0_00c0 0x801d_0100
21 0x09c0_00c4 0x000c_0202
22 0x09c0_00c8 0x000f_0100
23 0x09c0_00cc 0x0018_0202
24 0x09c0_00d0 0x8600_e3e2
25 0x09c0_00d4 0x860a_3f1d
26 0x09c0_00f4 0x001b_0100
27 0x09c0_00f8 0x0000_0f00
28 0x09c0_00fc 0x0084_2624
29 0x09c0_0100 0x8000_0000
30 0x09c0_0104 0x0002_0000
31 0x09c0_0108 0x0016_0000
32 0x09c0_010c 0xc018_0000
33 0x09c0_0110 0xc010_0000
34 0x09c0_0114 0xc012_0000
35 0x09c0_0120 0x0004_0000
36 0x09c0_0128 0x800a_0000
37 0x09c0_0130 0x0010_0000
38 0x09c0_0210 0x1900_0000
39 0x09c0_0214 0x1c00_0000
40 0x09c0_0218 0x1000_0000
41 0x09c0_021c 0x4000_0000
42 0x09c0_0220 0x8000_0000
43 0x09c0_0228 0x2000_0002
44 0x09c0_022c 0x0100_0004
45 0x09c0_0230 0x0400_0004
46 0x09c0_0234 0x0180_0010
47 0x09c0_0238 0x0480_0010
48 0x09c0_023c 0x2000_1010
49 0x09c0_0240 0x2000_0020
50 0x09c0_0244 0x2000_1020
51 0x09c0_0248 0x0200_0040
52 0x09c0_024c 0x0000_0800
53 0x09c0_0250 0x2000_2080
54 0x09c0_0254 0x2000_0001
55 0x09c0_025c 0x0100_0000
56 0x09c0_0260 0x0400_0000
57 0x09c0_0264 0x0000_c380
58 0x09c0_0268 0x0000_0008
59 0x09c0_026c 0x0000_0000
60 0x09c0_0274 0x2080_0010
61 0x09c0_0278 0x2082_0080
62 0x09c0_027c 0x0000_2000
63 0x09c0_0298 0x0000_0000
64 0x09c0_02c0 0x0000_0000
65 0x09c0_02e4 0x0000_0000
66 0x09c0_02e8 0x0000_0080
67 0x09c0_02f0 0x0002_0004
68 0x09c0_02f4 0x001e_0080
69 0x09c0_02f8 0x0006_0000
70 0x09c0_02fc 0x0067_0000
71 0x09c0_0a14 0x0000_0000
72 0x09c0_0a18 0x0000_8000
73 0x09c0_0308 0x0000_0070
74 0x09c0_02ec 0x0000_0004