JP Morgan & Co. has reached a tentative agreement of roughly $4 billion to settle claims the bank misled mortgage-finance companies Fannie Mae and Freddie Mac about the quality of mortgages it sold to them during the housing boom, said people close to the discussions. The amount J.P. Morgan is willing to pay is less than the $6 billion initially sought by the Federal Housing Finance Agency, these people said. The FHFA and J.P. Morgan declined to comment. The New York bank and the U.S. regulator of Fannie and Freddie worked up the general framework of the agreement recently, and now J.P. Morgan hopes to wrap it into a larger pact with the Justice Department that would resolve several probes into the bank’s past sale of mortgage bonds and settle potential civil and criminal charges, these people said. The Justice Department and the bank have discussed a total of $11 billion of cash and consumer relief, an amount that would include the roughly $4 billion for the FHFA.