
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121 (619) 450-9333
15-63
PCI CONTROLLER
S5933
use of the bits 31-29 in the BCSR register as the
“command” to be sent to the memory. The bits 23-16
in the BCSR register are also used in conjunction
with these command bits to indicate high address,
low address, or data read/written to the non-volatile
memory. The non-volatile memory commands are
contained in the table shown below.
These “commands” are written to the BCSR register
to indicate the option to be performed on the
memory. Both a read and a write must first load the
low and high address bytes. For example, to access
the location 0x1234 in the non-volatile memory, the
value 0x34 will be written to bits 23-16 and the value
100 (binary) written to bits 31-29. This will be fol-
lowed by the value 0x12 written to bits 23-16 and the
value 101 (binary) in bits 31-29. The actual Begin
Read or Begin Write command may then be sent.
The Begin Write command must also place the value
to be written in bits 23-16. Bit 31 on reads indicates
whether the command is complete. This bit must be
polled until clear, which indicates that the command
is complete. Upon completion, the data value has
been written, or is available for reading from bits 23-
16. Code Segment 8 demonstrates a method to ac-
cess the non-volatile memory.
The non-volatile memory may also be accessed from
the Add-On side of the S5933. The memory must,
however, only be accessed from one side at a time.
The host software and the Add-On software must
then negotiate to determine who has access to the
memory. This could be accomplished via a com-
mand/status using the mailbox registers.
Bit 31
Bit 30
Bit 29
Command
1
0
Load low address byte
1
0
1
Load high address byte
1
0
Begin Write
1
Begin Read
#define NVRAM_BUSY
0x80
/* Bit 31 indicates if device busy */
#define NVCMD_LOAD_LOW
(0x4 << 5) /* nvRAM Load Low command */
#define NVCMD_LOAD_HIGH (0x5 << 5) /* nvRAM Load High command */
#define NVCMD_BEGIN_READ (0x7 << 5) /* nvRAM Begin Read command */
#define NVCMD_BEGIN_WRITE (0x6 << 5) /* nvRAM Begin Write command */
#define AMCC_OP_REG_MCSR_NVDATA (AMCC_OP_REG_MCSR + 2) /* Data in byte 2 */
#define AMCC_OP_REG_MCSR_NVCMD (AMCC_OP_REG_MCSR + 3) /* Command in byte 3 */
byte nv_data;
/* Data read from non-volatile memory */
/* Wait for nvRAM not busy */
while ((inp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR + 3) & NVRAM_BUSY) == 1) {
/* Busy wait */
}
/* Load Low address */
outp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR_NVCMD, NVCMD_LOAD_LOW);
outp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR_NVDATA, 0x34);
/* Load High address */
outp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR_NVCMD, NVCMD_LOAD_HIGH);
outp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR_NVDATA, 0x12);
/* Send Begin Read command */
outp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR_NVCMD, NVCMD_BEGIN_READ);
/* Wait for nvRAM not busy */
while ((inp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR + 3) & NVRAM_BUSY) == 1) {
/* Busy wait */
}
/* Get data from nvRAM Data register */
nv_data = inp(amcc_op_reg_base_address + AMCC_OP_REG_MCSR_NVDATA);
Code Segment 8