The firmware of the iPhone is essentially the OS. To find out which version you currently have, on your iPhone go to Settings>General>About>Version. There you will see your firmware version.
Apple has the firmware versions available for download. Here are the links:
iPhone firmware version 1.0
iPhone firmware version 1.0.1
iPhone firmware version 1.0.2
iPhone firmware version 1.1.1
iPhone firmware version 1.1.2
iPhone firmware version 1.1.3
iPhone firmware version 1.1.4
iPhone 2G firmware version 2.0
iPhone 3G firmware version 2.0
iPhone 2G firmware version 2.0.1
iPhone 3G firmware version 2.0.1
iPhone 2G firmware version 2.0.2
iPhone 3G firmware version 2.0.2
iPhone 2G firmware version 2.1
iPhone 3G firmware version 2.1
Iphone Firmware Download
iPhone 5 (GSM iPhone5,1): 6.1.2, 6.1, 6.0.2, 6.0.1, 6.0
iPhone 5 (Global iPhone5,2): 6.1.2, 6.1, 6.0.2, 6.0.1, 6.0
iPhone 4S: 6.1.2, 6.1.1, 6.1, 6.0.1, 6.0
iPhone 4 (GSM iPhone3,1): 6.1.2, 6.1, 6.0.1, 6.0
iPhone 4 (GSM iPhone3,2): 6.1.2, 6.1, 6.0.1, 6.0
iPhone 4 (CDMA iPhone3,3): 6.1.2, 6.1, 6.0.1, 6.0
iPhone 3GS: 6.1.2, 6.1, 6.0.1, 6.0
Firmware is the name given to the set of programs that are an integral part of the operation of a computer’s hardware. They enable to hardware to function properly and allow software to run on the hardware.
It is called firmware because it’s not software (i.e., the programs that users run on the computer), but it’s also not hardware (the physical objects that make up the computer).
On the iPhone, firmware is the set of operations and tools that sit between the hardware that the phone uses and the software that runs on the phone. It enables features, fixes bugs, and attends to the functioning of the phone.
Periodically, Apple releases firmware updates to add new functionality to the iPhone, correct problems with it, and close security holes.