writing program to BF512F internal SPI flash


I have a BF512F on a custom board, and I'm trying to use the flash programming to write the program into the internal SPI flash.

I'm looking at the driver for the BF518F Ez board (the project is in the examples folder and is called BF518FEzFlashDriver_SST25WF040). I'm confused as to why the driver makes reference to SST25WF040. From the datasheet for the EZ board, it looks like the external SPI Flash chip is a M25P16, so is the SST25WF040 internal to the BF518F?

Could you give me hints on what I'm going to have to change with the driver to make it work with the BF512F?