As prince said the northern route is the better option, but I would go from Hohot to Datong and then side roads followed by the G109 to Beijing.
Before you reach the Beijing mountains I would avoid...