Global tectonics and oxygenation events drove the Earth-scale phosphorus cycle