an obvious derivation from the Spanish patata

MacBain's comments that they are from English, but, of course, the English is from Spanish (ultimately from Taino). The Scots contains a bit of folk etymology, the bun meaning root.