The electromagnetic calorimeter (ECAL) of the Compact Muon Solenoid Experiment (CMS) has been operating at the Large Hadron Collider (LHC) with proton-proton collisions at 13 TeV center-of-mass energy, with a bunch spacing of 25 ns and instantaneous luminosity exceeding 10^34 cm-2s-1. The CMS ECAL design ensures that its superb performance extends over a very wide range of energies, up to electron and photon energies of ~1 TeV, as required for physics searches beyond the standard model. The Run II running conditions give a first impression of the challenging environment we expect at the high luminosity LHC (HL-LHC). We review the design and R&D studies for the CMS ECAL crystal calorimeter upgrade. Particular challenges at the HL-LHC are the harsh radiation environment, the increasing data rates, and the extreme level of pile-up events, up to 200 simultaneous proton-proton collisions. We present test beam results on hadron irradiated PbWO crystals up to the fluences expected at the HL-LHC and the status of the new readout and trigger electronics R&D. The pile-up mitigation may be substantially improved by means of precision time tagging of calorimeter clusters, by associating them to primary vertices via 4D triangulation. We present test beam results on the precision timing potential of the CMS PbWO crystal calorimeter and discuss how the readout electronics may be adapted to exploit this performance in CMS.