1707, "dust, powdery substance," from Latin farina "ground wheat, flour, meal," from far (genitive farris) "husked wheat, emmer; grain, flour," from Proto-Italic *fars "flour," from PIE *bhars-, with cognates in Old Irish bairgen "bread, loaf," Welsh bara "bread," Serbo-Croatian brašno "flour, food," Latvian bariba "food," Gothic barizeins "from barley," Old Norse barr "grain," Old English bere "barley;" according to de Vaan perhaps a loan-word from a non-IE language.
word-forming element, from Latin -farius, -fariam "in (so many) parts," as in bifariam "in two parts or places, in two ways;" multifariam "in many places," an element of disputed origin. Watkins suggests it is from PIE *dwi-dhe- "making two," from roots *dwi- "two" + *dhe- "to put, set." It also has been derived from Latin fari "to say" (as in nefarious), but de Vaan writes that "the alleged semantic development to 'in n ways' is obscure," and he points to the suggestion of a PIE *-dho-, with cognates in Sanskrit dvidha (adv.) "twofold;" tridha "threefold."
c. 1300, "fixed payment (usually in exchange for taxes collected, etc.), fixed rent," from Old French ferme "a rent, lease" (13c.), from Medieval Latin firma "fixed payment," from Latin firmare "to fix, settle, confirm, strengthen," from firmus "strong; stable," figuratively "constant, trusty" (from suffixed form of PIE root *dher- "to hold firmly, support").
Sense of "tract of leased land" is first recorded early 14c.; that of "cultivated land" (leased or not) is 1520s. A word of confused history, but there is agreement that "the purely agricultural sense is comparatively modern" [Century Dictionary]. There is a set of Old English words that appear to be related in sound and sense; if these, too, are from Latin it would be a very early borrowing. Some books strenuously defend a theory that the Anglo-Saxon words are original (perhaps related to feorh "life").
Phrase buy the farm "die in battle," is from at least World War II, perhaps a cynical reference to the draftee's dream of getting out of the war and going home, in many cases to a peaceful farmstead. The simple term buy it as slang for "suffer a mishap," especially "to die" is attested by 1825, and seems to have been picked up in airmen's jargon. Meanwhile fetch the farm is prisoner slang from at least 1879 for "get sent to the infirmary," with reference to the better diet and lighter duties there.