Tesla has reportedly struck a deal to set up a plant in Shanghai to make cars for the Chinese market.