The Olympic final is scheduled for Aug. 1, 2021, one week before Federer — who took doubles gold with Swiss teammate Stan Wawrinka at the 2008 Beijing Games — turns 40.
Federer revealed last month he had “an additional quick arthroscopic procedure” on his right knee some weeks earlier.
The setback in rehabilitation from an initial knee surgery in February has not yet cost Federer any tournament play because the sport has been shut down by the coronavirus pandemic. It is due to resume next month.
Federer was speaking in Zurich on what should have been the start of the second week of Wimbledon, a tournament he has won eight times.
He recalled his fourth-round win in 2001 over defending champion Pete Sampras as perhaps the most significant match that helped define his career.
“I felt like if I can beat Pete Sampras at Wimbledon I can beat anyone anywhere,” Federer said in response to a fan’s question.