The poem recited by Hathaway to Scarlett Mortmaigne is no. XL from "A Shropshire Lad" by A.E. Housman. It is also used in the season 7 episode "Down Among The Fearful" for the scattering of the cremation ashes.
There are references to Morse in that the murdered professor is from Lonsdale College, and had a passion for crosswords.
The name of the castle-dwelling Mortmaigne family, who later reappear in an episode of "Endeavour", is derived from that of the castle-dwelling (but much less wealthy) Mortmain family in Dodie Smith's novel, "I Capture The Castle".
The title of this episode derives from T.S. Eliot's poem. "Journey Of The Magi".