The damage is most likely caused by the yellow-bellied sapsucker. They make two kinds of holes, round and square. They drill into the bark making a small hole so they can lap up the sap that is inside. They also will eat any small insects or larvae that happen to be there.
Some things that you can try to deter them would be to wrap the trunk in hardware cloth or burlap. Hang shiny items that move around with the wind to scare them. Try hanging wind chimes to create noise. Obviously, if you see them, wave your arms to scare them off. If you are persistent, hopefully it will go away.