Reply 20 of 87, by Chkcpu
- Rank
- Member
Patching for new CPU models
Okay, now we need to decide what needs to be changed to support the Am5x86 CPU.
Because the BIOS_uP_ID is used in multiple places during POST to make decisions depending on the CPU model, the most effective way to add Am5x86 support to a 1994 BIOS is to let the BIOS think it is a DX4. This can be done with a small change to the Reset_ID table and works for the Enhanced Am486DX4 as well.
To know which Reset_IDs to use for the Am5x86 patch, we need AMD document 19720.
This AMD 486 BIOS Development Guide tells us the Reset_ID for each Am486 model, but also shows that specific models can have more than one Reset_ID depending on multiplier and L1 cache WT/WB settings at reset.
The Am5x86 can even have 4 different Reset_IDs:
0484h: x3 mode and Write-Through cache
0494h: x3 mode and Write-Back cache
04E4h: x4 mode and Write-Through cache
04F4h: x4 mode and Write-Back cache
As these 1994 BIOSes have no logic to program the chipset for L1 cache WB automatically, we don’t have to distinguish between Write-Through and Write-Back cache Reset_IDs and can group them together for CPU detection.
If the chipset supports L1 cache WB, there will be a BIOS Setup option to select WT/WB manually.
But we do want to distinguish between x3/x4 multiplier mode. So for the Am5x86 we need to have 2 table items, one with Reset_IDs 0480h-049Fh (x3) and a second with Reset_IDs 04E0h-04FFh (x4 multiplier).
The new 0480h-049Fh item will then also be used to identify the Enhanced Am486DX4 and Intel’s DX4, which means the old 0480h-048Fh item for the DX4 can be overwriten. But because we will change the DX4 item from 0480h-048Fh to 0480h-049Fh, we have to place the 0490h-0490h item for the Cyrix 486DX in front of the new DX4 item, otherwise the detection of the Cx486DX is broken.
So this is the patch I’ve come up with for the 11/24/94 BIOS.
This patch uses the 2nd table item, originally for the DX4, now for the Am5x86 in x4 mode. The CMOS_3F_data byte for this item has both bits 7 and 6 set to indicate x4 mode. This will be explained later on.
The 4th table item, originally for a Pentium, can be overwritten without consequence on this socket 3 BIOS, and is used for the new AMD/Intel DX4 item.
Doing the patch this way, the 3rd table item for the Cx486DX is already in sequence and can remain unchanged.
This is how this patch looks when I put the bytes in sequence for a hexeditor. The changed bytes are in red.
If your 1994 Award BIOS is slightly older, you may find that the Reset_ID 1480h-148Fh for the DX4 ODP is missing and that the DX4 byte sequence AB, 90, 80, 04, 8F, 04 is at the beginning of the table. However, the above Am5x86 patch will still work in this case, only the DX4 ODP is and remains unsupported.
But look-out for a changed CMOS_3Fh bit definition for Green CPU from bit 4 to bit 5 in older BIOSes. The patch has to be adjusted accordingly in this case, and this is how the same Am5x86 patch looks when you find the DX4 byte sequence to be AB, A0, 80, 04, 8F, 04 in your BIOS.
- more in the next posting -