Hi guys, I need your help. I made the mistake on pressing the all data erase and now my phone is stock on the apple logo. I decided on restoring back to factory default with the old itunes 9.1.1 version and it comes with an error " The iPhone could not be restored. This device isn't eligible for the requested built"

I previously jailbroken my phone with Spirit and now I need to restored back. Should I just upgrade to the new iOS4.0 ?

Also I've my files saved in Cydia but I never done that route before.