Repository navigation
mc: decode IP28 128 MB banks as two subbanks - #440
Merged
Merged
Conversation
With the default banks of 128 MB the embedded IP28 PROM fails its
memory diagnostic ("Address 2000000c Expected 00000000 Received
00000001", "No usable memory found"). The model described a 128 MB
bank as one subbank. The PROM sizes a subbank with BNK clear, then sets
BNK and looks for a second one; it found a 128 MB alias and no second
subbank, settled on 256 MB (MEMCFG half 0x2f20), and its data test then
read back words aliased from 128 MB up.
The MC specification's size table gives every other size two subbanks
(fields 1, 7 and 31). Revision D and later count in 16 MB units rather
than 4 MB, so on the IP28 that is 32, 128 and 512 MB, which is how 512
MB was already modelled. Mark 32 and 128 MB the same way.
That alone is not enough. With BNK set and the largest size field
(0x7f20) the MC puts the two subbanks 256 MB apart, each mirrored at its
own size; one address mask cannot place the second 64 MB subbank there.
The decode now reports that spacing, and the bank plan points those
slots at bank views offset into the second half. Only the probe uses
such a value; once POST writes the final 0x6720_6728 the banks are
contiguous again, plain bank entries, and mapped by ppmem as before.
With this the PROM writes 0x6720_6728 for two 128 MB banks and IRIX
6.5.22 reports 256 MB. IP22 and IP24 decodes do not change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the default
banks = [128, 128, 0, 0](and with[128, 0, 0, 0]) the Indigo2 R10000 profile (indigo2_ip28) never gets past the PROM's memory test:iris described a 128 MB IP28 bank as one 128 MB subbank. The PROM sizes a bank in two steps: it maps it with the subbank bit (BNK) clear and finds where it aliases, then sets BNK (MEMCFG half
0x7f20) and looks for a second subbank. iris showed it a 128 MB alias and no second subbank, so the PROM settled on 256 MB (0x2f20). In that decode 0x2800000c aliases 0x2000000c, and the data test failed there.The MC spec's size table makes every other size two subbanks (fields 1, 7 and 31). Revision D and later MCs, which the IP28 needs, count in 16 MB units instead of 4 MB (Linux
ip22-mc.c, OpenBSDip22_machdep.c). On the IP28 that makes 32, 128 and 512 MB two-subbank banks, and 512 MB was already modelled that way. This PR marks 32 and 128 MB the same way.Marking them isn't enough on its own. With BNK set and the largest size field, the MC puts the two subbanks 256 MB apart, each mirrored at its own size. A single address mask can't put the second 64 MB subbank there.
memcfg_bank_infonow also returns that spacing (subbank_span, 0 when the subbanks sit back to back), andplan_bank_slotspoints those slots atbank_views into the bank's second half. Only the PROM's probe writes a value like that. Once POST writes its final0x6720_6728the spacing is 0 again: plain bank entries, mapped by ppmem as before. All of this runs on MEMCFG writes, so the per-access path doesn't change. IP22 and IP24 decodes don't change either.Are 128 MB banks real IP28 hardware? An IP28
hinvon comp.sys.sgi.admin (August 1996) shows 192 MB, which needs a 128 MB bank next to a 64 MB one. A 1997 post there gives the Indigo2 R10000 maximum as 640 MB (128 + 2 x 256).Testing
At 6a487b5, on upstream main 45b7f74:
cargo test --features jitv2 --lib, debug and release: 2958 passed, 0 failed. New:mc::tests::ip28_128_mb_banks_are_two_subbanks(fails on main: it encodes 128 MB as0x2720) andip22_bus::ppmem_tests::ip28_128_mb_bank_answers_the_prom_probe, which drives the PROM's MEMCFG writes through the decode table and checks the addresses it tests. It fails without the subbank views.MEMCFG0 = 0x6720_6728, boots to login,hinvreports 256 MB,halt -ppowers off.[128, 0, 0, 0],[32, 32, 0, 0],[256, 256, 0, 0]and[512, 512, 0, 0]: final MEMCFG0 is0x6720_0000,0x6120_6122,0x2f20_2f30and0x7f20_7f40, with no memory test failure.[128, 128, 0, 0]: boot to login, 256 MB,halt -ppowers off.The boots used a binary built before a comment-only edit to the commit.