Exactly what Penyafort wrote.
Feijoo is a Castilianized form of an older Middle Galician
Feixoo, which was anyway written
Feijoo in Medieval Galician, when we had a /ʃ/ versus /
ʒ/ contrast. Today is most frequent in central-southern Galicia (
FEIJO* - Cartografía dos apelidos de Galicia).
It derives directly from Vulgar Latin
Phaseolu 'Little bean' > *
Feijolo ( -sy- > -ys- > -yj-; -ay- > -ey- ) >
Feijoo (with characteristic Galicia-Portuguese lose of intervocalic /l/, compare Pt.
feijão) >
Feixoo (/
ʒ/ > /ʃ/). The double oo at the end is archaic spelling, relativelly frequent in surnames; it also codified an open o:
Galician pronunciation is [fejˈʃɔ]. It was finally Castilianized
Feijoo (<x> > <j> [x]; and [o]).
The word is used by Afonso X of Castile, apparently referring to the bald head of a guy: "
semelha Pedro Gil no feijoo" ~ "looks as Pedro Gil in the bald".
As a nickname or surname I find it in 1433, but I'm sure it was used earlier: "
Juan Fariña, pedreiro, se obligou de dar a Fernan Garçia de Astorga, ou a quen seu poder ouver, de un moyo de sal de dosentos et des et seys mrs. blanca en tres dineiros de un moyo de sal que ovo, o qual levou Juan Feijoo, mareante, por el et en seu nome, pagar a pascoa de resureiçon primeira, so pena do doblo·" (
Minutario Notarial de Pontevedra, 1433)
And...
the guy won a majority in the last Galician elections with the unheard lemma "Galicia, Galicia, Galicia".