Arcana Coelestia # 1214
1214. That 'the sons of Ham' means derivations of matters of doctrine and of forms of worship resulting from the corrupted internal worship meant by Ham is clear from the meaning of 'sons' as matters of doctrine, and from the meaning of 'Ham' as corrupted internal worship, dealt with already.
Genesis 10:10
10
The beginning of his kingdom was Babel, Erech, Accad, and Calneh, in the land of Shinar.