Pinning energy and vortex-phase diagram of MgB2 bulk materials