The San Francisco 49ers have locked up their franchise quarterback to a long-term deal.