I've rewritten it in c, so pretty happy I know all that the code does (lots of pushing bits and some waiting for responses), but not much more about why it does it. Did you see the link to the memory map page on the wiki posted in the comments? It was updated 2 weeks ago with a bit of relevant information. Apparently the last parameter, which I had no idea what it does, selects the size of the flash read cache. In theory you can half the amount of cache to give more iram, but when I tried that out it wasn't successful.
I've rewritten it in c, so pretty happy I know all that the code does (lots of pushing bits and some waiting for responses), but not much more about why it does it. Did you see the link to the memory map page on the wiki posted in the comments? It was updated 2 weeks ago with a bit of relevant information. Apparently the last parameter, which I had no idea what it does, selects the size of the flash read cache. In theory you can half the amount of cache to give more iram, but when I tried that out it wasn't successful.