Lewis Hamilton's Spanish Grand Prix lasted just six laps before he was forced to retire with Ferrari brake issues.