SATA? In an old world PCI Power Mac?! IMPOSSIBRU! (Updated 11/22/23)

joevt

Tinkerer
Mar 5, 2023
73
32
18
I made forks of pciutils, flashrom, and directhw that you can compile on Mac OS X 10.4 and 10.5 and later.
https://68kmla.org/bb/index.php?thr...ng-easier-way-using-flashrom.7013/post-475781

pciutils works (with directhw) so you can do sudo lspci -vvvnnxxx > PowerMac_lspci.txt in Mac OS X to get PCI device info.

I think flashrom has everything it needs to work (with pciutils and directhw) but I don't have a PCI card to test it with. If it doesn't work, then output from lspci from Mac OS X might be helpful.
 

speakers

Tinkerer
Nov 5, 2021
98
76
18
San Jose, CA
peak-weber.net
I cloned your trees to my G3 Minitower running 10.4.11 with TigerBrew installed and built and installed everything.

DirectHW and pciutils seem to work OK producing this output - see lspci.txt.

But flashrom has trouble - see flashrom.txt. Running under gdb, I see this backtrace - see gdb.txt.

There's a SiL3114 card installed. It's programmable using flashrom under Debian on this machine. The Linux lspci and flashrom output is Debian_lspci.txt and Debian_flassrom.txt.
 

Attachments

  • lspci.txt
    5.2 KB · Views: 121
  • flashrom.txt
    469 bytes · Views: 95
  • gdb.txt
    754 bytes · Views: 114
  • Debian_lspci.txt
    5.2 KB · Views: 91
  • Debian_flashrom.txt
    299 bytes · Views: 87
  • Like
Reactions: AirplaneHome.com

joevt

Tinkerer
Mar 5, 2023
73
32
18
I cloned your trees to my G3 Minitower running 10.4.11 with TigerBrew installed and built and installed everything.

DirectHW and pciutils seem to work OK producing this output - see lspci.txt.

But flashrom has trouble - see flashrom.txt. Running under gdb, I see this backtrace - see gdb.txt.

There's a SiL3114 card installed. It's programmable using flashrom under Debian on this machine. The Linux lspci and flashrom output is Debian_lspci.txt and Debian_flassrom.txt.
Looks like there was a problem in the DirectHW library. pciutils works because it contains its own version of the DirectHW library. I updated the 3 projects so now flashrom should be able to find the PCI card in Mac OS X 10.4.

First verify that flashrom can find the card:
sudo flashrom -VVV -p satasii
Then see if it can read the rom.
sudo flashrom -VVV -p satasii -r satasii.rom
If it can do that, then it should be able to write if the rom chip is writable.
If there's a problem, then I'll need to look more closely at the directhw map functionality.

Use lspci with three xxx's to get all 256 bytes of the PCI config space registers. This will include bytes used for Capabilities.
sudo lspci -vvvnnxxx > PowerMac_lspci.txt

I wonder if lspci for macOS should be updated to extract some info from the IORegistry such as driver name and BAR size like the linux version does...
 
  • Like
Reactions: AirplaneHome.com

joevt

Tinkerer
Mar 5, 2023
73
32
18
I pulled your repos and rebuilt.
See attached flashrom.txt and lspci.txt for the latest ouput. Better, but no cigar.
Ok, thanks. At least it found the PCI card and the BARs. I guess now I need to look more closely at what it wants to do with the BARs. I may need to get a SiI 3112 or 3114 card or make the code think a different PCI card that I have is a Sil card.
 
  • Like
Reactions: AirplaneHome.com

speakers

Tinkerer
Nov 5, 2021
98
76
18
San Jose, CA
peak-weber.net
I did some debugging and the flashrom failure is due to a conflict between the pciutils and DirectHW libraries.

The IOUserClient port is being obtained by the PCI library and the PCI bus is successfully probed. But the subsequently attempted memory mapping via the DirectHW library fails because this library hasn't been initialized and so doesn't know the port: the connect local variable is -1 and so the IOConnect call gets a failure of 0x10000003 which is MACH_SEND_INVALID_DEST.

The real solution is to reconcile both frameworks, but a quick fix is the attached diff for DirectHW. With it, I can read the contents of my 3114 card (but I haven't tried to write it).
 

Attachments

  • directhw.txt
    855 bytes · Views: 94
  • Like
Reactions: AirplaneHome.com

joevt

Tinkerer
Mar 5, 2023
73
32
18
I did some debugging and the flashrom failure is due to a conflict between the pciutils and DirectHW libraries.

The IOUserClient port is being obtained by the PCI library and the PCI bus is successfully probed. But the subsequently attempted memory mapping via the DirectHW library fails because this library hasn't been initialized and so doesn't know the port: the connect local variable is -1 and so the IOConnect call gets a failure of 0x10000003 which is MACH_SEND_INVALID_DEST.

The real solution is to reconcile both frameworks, but a quick fix is the attached diff for DirectHW. With it, I can read the contents of my 3114 card (but I haven't tried to write it).
I haven't done much testing yet (busy on other projects) but I'm starting to look at it now. Thanks for pointing me at the problem.

The pcilib has 4 different PCI access methods for macOS. pcilib tests each access method in order until it finds one that works. Each access method has its own ioconnect_t because they connect to different IOServices (darwin=AppleACPIPlatformExpert, darwin2=IOPCIBridge, darwin3=DirectHW, intel-conf1=DirectHW). Only the third, darwin3 works for Power Macs. The darwin, darwin2, & darwin3 access methods open their IOService's user client to get their ioconnect_t. The intel-conf1 access method calls iopl in DirectHW lib and that would get the ioconnect_t for DirectHW lib but intel-conf1 doesn't happen on PowerPC Macs (and is not usable on PowerPC Macs). map_physical in DirectHW lib requires the ioconnect_t to work so it fails.

iopl is only for flashrom programmer methods that will access I/O ports (using inb/outb for example). satasii doesn't access I/O BARs (except if intel-conf1 is being used to access PCI config space but in that case iopl would have been called already). flashrom is currently missing code to access I/O ports on PowerPC.

pcilib has its own copy of directhw lib (I did that to make lspci/setpci of pciutils easier to compile and debug on Intel Macs). For flashrom, the exported symbols of directhw in pcilib are overridden by those of DirectHW lib since flashrom links DirectHW lib first so I think directhw in pcilib can be ignored.

Your patch is to MyIOConnectCallStructMethod which is one of the exported symbols in DirectHW lib. The ioconnect_t that darwin3 obtained (and which connects to DirectHW kext's IOService) is passed to MyIOConnectCallStructMethod and your patch saves that as the ioconnect_t for DirectHW lib if DirectHW lib hasn't set it up yet. That's fine except for Intel Macs which may use darwin or darwin2 access method which have ioconnect_t that don't point to DirectHW.

I guess the easiest thing to do is have DirectHW lib obtain its ioconnect_t if it hasn't done that already. Then I don't need to figure out where in flashrom to call darwin_init.
 
  • Like
Reactions: AirplaneHome.com

joevt

Tinkerer
Mar 5, 2023
73
32
18
Yep, you grok the issue. My patch is just a cheap fix to get around the issue for my configuration.

Lazy initialization would seem to be the solution so long as duplicate connections are permitted.
I've updated the three projects so now flashrom should be able to get as far as your patch allowed. Can you verify that it reads the rom correctly (I guess it should have PCIR in the header).
sudo ./flashrom -VVV -p satasii -r satasii.rom > satasii_test1.txt
dd if=satasii.rom bs=256 count=1 | xxd > satasii_first_256_bytes.txt
 
  • Like
Reactions: AirplaneHome.com

XodiumRetro

Tinkerer
Oct 25, 2021
54
100
33
Central Coast, California
xodium.net
Decided to make a substantial update to the guide. Rewrote part of it, added a placeholder for a part of the guide I need to write.

I will say if there's anyone on here willing to organize group buys and/or do the flashing process on the more difficult EEPROMs for those who lack the facilities to do so (specifically the ones that require 12v), please do let us know, I'll add it to the main post.

That's all for now.
 

AirplaneHome.com

New Tinkerer
Nov 21, 2022
27
4
3
I acquired two AliExpress.com PCI SATA cards with Sil3112ACT144 with AM28F010 EEPROM ICs. They provide two internal SATA ports (and, alas, no external ports, nor provisions to add any).

As expected I wasn’t able to reprogram the AM28F010 EEPROMs since as DOSDude1 discovered they require 12 V, which isn’t connected on the card. I replaced them with AM29LV040B EEPROMs, but in multiple PowerMacs and a Mirror Door Drive all running OS 9.2 DOSDude's SeriTek1 S2 Flasher 5.1.3 Patched (with1S2 Patched Compressed.ROM available) still froze my systems upon reprogramming attempts. I see no flaws in my soldering work nor perceive any other obvious errors.

On 2 March DOSDude advised that “Once a 29 or 39 series EEPROM is installed on the SIl3112 card, though, you should have no issues flashing simply using my patched SeriTek/1S2 OS 9 flashing utility.” So either I have an obsolete version of SeriTek1 S2 Flasher or some other problem is afoot. I couldn’t find his SeriTek1 S2 Flasher on DosDude1.com and I can’t check 68MLK.com since I was banned there (my fault, off topic comment).

If the failure’s unexpected I’d be happy to try specific tests or post log data if helpful. Otherwise any comments or suggestions would be appreciated!

If no better options exist I could purchase a bunch of these specific cards on AliExpress.com, upgrade them to AM29LV040B EEPROMs, then mail them to whoever wants them at my cost. However I’m rather desperately time constrained so my hope is that someone with more free time would like to do so. But if not flag me with desired quantities if you’d like me to try squeeze the effort in. Remember that these cards provide only two internal SATA ports with no provisions to revise them for external ports - they’re very basic and inflexible. Cheers!

(In the original paragraph just above I erroneously said "...upgrade them to AM28F010 EEPROMS...", sorry. The paragraph is correct now.)
 
Last edited:

dosdude1

Tinkerer
Jan 10, 2022
18
32
13
I acquired two AliExpress.com PCI SATA cards with Sil3112ACT144 with AM28F010 EEPROM ICs. They provide two internal SATA ports (and, alas, no external ports, nor provisions to add any).

As expected I wasn’t able to reprogram the AM28F010 EEPROMs since as DOSDude1 discovered they require 12 V, which isn’t connected on the card. I replaced them with AM29LV040B EEPROMs, but in multiple PowerMacs and a Mirror Door Drive all running OS 9.2 DOSDude's SeriTek1 S2 Flasher 5.1.3 Patched (with1S2 Patched Compressed.ROM available) still froze my systems upon reprogramming attempts. I see no flaws in my soldering work nor perceive any other obvious errors.

On 2 March DOSDude advised that “Once a 29 or 39 series EEPROM is installed on the SIl3112 card, though, you should have no issues flashing simply using my patched SeriTek/1S2 OS 9 flashing utility.” So either I have an obsolete version of SeriTek1 S2 Flasher or some other problem is afoot. I couldn’t find his SeriTek1 S2 Flasher on DosDude1.com and I can’t check 68MLK.com since I was banned there (my fault, off topic comment).

If the failure’s unexpected I’d be happy to try specific tests or post log data if helpful. Otherwise any comments or suggestions would be appreciated!

If no better options exist I could purchase a bunch of these specific cards on AliExpress.com, upgrade them to AM28F010 EEPROMs, then mail them to whoever wants them at my cost. However I’m rather desperately time constrained so my hope is that someone with more free time would like to do so. But if not flag me with desired quantities if you’d like me to try squeeze the effort in. Remember that these cards provide only two internal SATA ports with no provisions to revise them for external ports - they’re very basic and inflexible. Cheers!
You definitely should be able to flash with AM29LV040, as that's even one of the official SeriTek/1S2 supported ROMs. You should also move the VCC resistor for that chip, as it requires 3.3V instead of 5V (move R25 to position R24). If the flashing continues to fail, it is either a bad solder joint on the card (is known to be the case sometimes with the cheap Chinese ones), or one/some of the legs of the EEPROM are not soldered correctly. The best thing to do is heat it with hot air, that way all the pins solder fully and evenly.
 
  • Like
Reactions: AirplaneHome.com

AirplaneHome.com

New Tinkerer
Nov 21, 2022
27
4
3
Thanks tons DOSDude1 - you’re a prince! Moving R25 to position R24 was the key to progress. It’s merely a shorting bar (a 0 Ω resistor), so I removed it from R25 then shorted the pads of R24 with a solder bridge, which seems easier for manual soldering work.

Then your sweet SeriTek1 S2 Flasher programmed both my Sil3112 based PCI cards smoothly, and they are recognized in storage utility applications and system profilers of all sorts on the three Mac computers I’ve tested thus far.

I’ve not yet successfully mounted a storage device however, but this might simply be a format incompatibility issue, although evidence is mixed. A few new storage devices should arrive quite soon, or I’ll consolidate data to free an existing device, then try formatting one via the SATA connection. As soon as I have further results I’ll post them here.

Likely irrelevant fluff: I replaced all the electrolytic capacitors on these two cards with same value tantalum capacitors to eliminate the inherently life limited electrolytic capacitors, as I commonly do when restoring a legacy system or peripheral. They fit naturally in this case, as they usually do. If the community wants me to order these cards and AM29LV040B EEPROMs in bulk, swap the original EEPROMs with AM29LV040B EEPROMs, and transfer the R25 short to R24, I could also upgrade the capacitors to tantalums if desired. If time for any of this permits...

But I need to complete proof of functionality first. And if problems ensue the tantalum capacitors will be suspect because it's not impossible that the card depends upon the lossy characteristic of electrolytic capacitors for noise damping. Unlikely in my estimation, but not impossible. I'll advise when new results arise... Cheers everyone!

(In the "Likely irrelevant fluff:" paragraph above I erroneously referred to AM28F010 EEPROMS twice, sorry. The paragraph is correct now.)
 
Last edited:
  • Like
Reactions: Kai Robinson

AirplaneHome.com

New Tinkerer
Nov 21, 2022
27
4
3
New storage devices arrived and they formatted easily to HFS+ with journaling disabled, and function well. I might have left journaling on in my previous tests, stupid of me...

All data storage functionality seems completely solid except that I can no longer boot from the AliExpress.com cards, nor a completely different one residing in my Mac 9500/120, which I could boot from in earlier times as noted in my 23 February post. I'll try to discover what's changed and am motivated - an ability to boot through SATA again would be a considerable benefit. Maybe I merely misremember a unique step required to boot through SATA in OS 9...

Otherwise the AliExpress.com cards, with the original EEPROMs replaced with AM29LV040B EEPROMs, R25 removed and the R24 pads shorted, firmware loaded using DOSDude's great SeriTek1 S2 Flasher, and, for long life, all the electrolytic capacitors replaced with equal rated tantalum capacitors, seem to operate flawlessly and relatively swiftly. (But they provide no external ports nor provisions to add any, alas.) Cheers everyone!

(In the original paragraph just above I erroneously said "...replaced with AM28F010 EEPROMS...", sorry. The paragraph is correct now.)
 
Last edited:

V.Yakob

Tinkerer
Sep 6, 2023
63
26
18
Hey!
Great topic, I used this discussion to create my first SATA board and I want to share the result.
I have 2 board designs with a SIL3112 controller, I'll call it conditionally "black" and "red".

"Black" boards are discussed on most resources, and everything is more or less clear with them:

1. flash a hacked firmware utility from dosdude1 and you can use Power Mac with PCI slots except QuickSilver and Digital Audio;
2. flash a compatible ROM chip ( Am29LV040B, MX29LV040 or Pm39LV040) with a programmer, replace the ROM chip on the board and move the resistor R25 -> R24 and also use it in Power Mac with PCI slots except QuickSilver and Digital Audio;
3. For use in Quicksilver and Digital Audio, change the U2 voltage regulator to a compatible FS8860-33. What it looks like can be seen in the photo.

SIL3112-Black-Modified-Detail.png

These modifications work perfectly for me for many months in different Power Macs.

I have never come across descriptions of the modification of the "red" boards, but it works perfectly.
1. flash a hacked firmware utility from dosdude1 and you can use Power Mac with PCI slots except QuickSilver and Digital Audio;
2. flash the ROM programmer chip with a hacked, but not compressed firmware from dosdude1. There is no resistor to change the power supply, so you can just use SST39SF040 instead of SST39SF010A.
3. For use in Quicksilver and Digital Audio, change the U2 voltage regulator to the original MIC29150-3.3, for this board design it is great.

Original
SIL3112-RED-Orig.png

Modification
SIL3112-RED-Modified.png

I like the "red board" most of all in my Quicksilver.
SIL3112-RED-QS.png

SIL3112-RED-QS-Delail.png


I also wrote a blog post about my way of modifying these boards, through an online translator it is available to anyone. I will be glad if my work will help novice enthusiasts like me.
 

Attachments

  • SIL3112-Black-Modified.png
    SIL3112-Black-Modified.png
    3.1 MB · Views: 115

XodiumRetro

Tinkerer
Oct 25, 2021
54
100
33
Central Coast, California
xodium.net
1700046888632.jpeg


Kept you waiting, huh.

It's been a while! And I'm here to tell you I finally, FINALLY got around to using the OS 9 flasher for myself and boy oh boy was it so drop dead simple. If you have the means to go that route, I highly, HIGHLY recommend it. Unless you like soldering EEPROMs or something. As such, that part of the guide has been written in, and I'm considering this guide to be complete maybe outside of voltage regulator shenanigans. But that's outside my pay grade, so if someone else wants to tackle documenting that, feel free.
 
  • Like
Reactions: AirplaneHome.com

XodiumRetro

Tinkerer
Oct 25, 2021
54
100
33
Central Coast, California
xodium.net
Made one more alteration: Since I had to delve into the PC side of SATA things anyway and had to actually roll back one of my flashed cards so I could use it in my Win98 PC...I filled out that part of the guide. Short of just...clarifying things and such, I think this guide is very much complete.
 
  • Like
Reactions: AirplaneHome.com

AirplaneHome.com

New Tinkerer
Nov 21, 2022
27
4
3
Can four port Sil3114CTU cards be made functional in PCI Macs by upgrading their EEPROM and setting their voltage link correctly, then use Collin’s very cool ‘SeriTek1S2 Flasher 5.1.3 Patched’ to install his ‘SIIG-3114 MAC.bin’ firmware?

I haven’t found any conclusive chats about this thus far, though the existence of Collin’s 3114 MAC.bin firmware seems hopeful. So I modified two new cards from AliExpress by upgrading them to AM29LV040B EEPROMs, removing the R3 short, and adding an R4 short.* Then I tried Collin’s cool SeriTek1S2 Flasher, but in my Mac Power Mac 7200 running OS 9.1 it doesn’t detect either of my twin cards, alas. I tested one at a time in the center PCI slot.

However I haven’t confirmed that the R3 / R4 short swap results in 3.3 volt power for the AM29LV040B EEPROM, nor tried other PCI slots, nor with a USB / FireWire PCI card removed. I’ll explore further soon...

In the meantime any comments welcome of course!

Some background and notes:

On the original card with the 5 volt Winbond 39F010P-70B EEPROM, the R3 position is shorted and the R4 position is open. I merely presume that opening the R3 position and shorting the R4 position provides 3.3 volts to the EEPROM - I've not yet confirmed it.

The 3 or 3.3 volt AM29LV040B EEPROM specifications state that its absolute maximum Vcc is 4.0 volts, suggesting that exposure to 5 volts could destroy that EEPROM. I did expose at least two AM29LV040B EEPROMs to 5 volts in much earlier times with no apparent harm, but the actual risk level is unknown to me.

And apologies everyone for my EEPROM nomenclature errors in my earlier posts on this page. I corrected them but the errors stood for a long time and likely caused some confusion. Which I genuinely regret...

* I also replaced all 11 electrolytic capacitors with tantalum capacitors with the same ratings for long term reliability.
 

AirplaneHome.com

New Tinkerer
Nov 21, 2022
27
4
3
Continueing from my last post about four port Sil3114CTU cards: I confirmed 3.3 volt power on EEPROM Vcc pin 32, so removing the R3 short and adding an R4 short is the correct modification for the four port card when using an AM29LV040B or any other 3.3 volt EEPROM.

I also tried both of my four port SATA cards in all three of my Power Mac 7200's PCI slots, both with and without a shorting bar on the sole two pin jumper on the card, whose function is unknown to me. But Collin's SeriTek152 Flasher never detected either of the cards. However it does still detect my two port SATA card in the same PM 7200.

I read somewhere that the EEPROMs require some original firmware for Collin's cool SeriTek152 Flasher to be able to recognize them, but I successfully wrote his EEPROM firmware into the same empty EEPROMs in my two port SATA cards, although I may have done so in my PowerMac 9500 rather than the PM 7200 I'm currently using. I doubt my 7200 is the source of the problem but I might try my 9500 later.

So I plan to write the firmware outside the SATA card, solder in onto a four port card, then repeat tests even though I harbor some skepticism that the EEPROM can't be writen on the card from a completely blank state. However my hope is that someone already understands the source of the failures I'm experiencing and enlightens me before I modify another card. Cheers all and happy holidays!