Middle Chinese (MC) has four tones. Standard Cantonese preserves the MC tonal structure very well considering the over thousand-year span between them. The following chart illustrates their tonal relationships.

From the diagram, the tonal evolvement from MC to Cantonese is mainly a splitting process along voiced/unvoiced lines. The only major exception is that many MC Voiced Shang syllables (全浊上) become Cantonese Yang Qu (阳去). This is a known phenomenon (浊上变去) that occur to varying degrees in many Chinese dialects. In Cantonese, about two-thirds of the MC Voiced Shang syllables became Yang Qu with the remaining stayed Yang Shang. I've read somewhere that the split is along literal-colloquial lines. I've not checked the validity of the claim. However, I do notice that many Cantonese syllables of  MC Voiced Shang origin  that have dual Literal/Colloquial pronunciation usually have their Literal Form (文读) in Yang Qu and their Colloquial Form (白读) in Yang Shang. For example, the MC Voiced Shang character 断 pronounced colloquially in Cantonese as [ty:n23], a Yang Shang tone, but literally as [dyn22], a Yang Qu tone.

There seems to be confusion with respect to the number of tones in Cantonese. The above classification of nine tones has a long history and predates the adoption of modern phonological conventions. This classification emphasizes the continuity of Chinese phonological development and reveals clearly the relationships among the phonological systems of various Chinese dialects.  Unfortunately, the parameter used for the classification, 声 (as in 四声,  the Four Tones), and it's English translation tone  do not have the same meaning.  In the traditional Chinese classification,  Ru (入) syllables, i.e. syllables end with unreleased stops [p, t, k] with their associated tonal profiles, are considered having distinct 声('tones') while in modern phonology, tone is an independent syllable-wide parameter  not condition to the makeup of the syllable. For example, in modern phonology, Yang Qu and Yang Ru, different 声('tones') in Cantonese, would be considered  having the same tone because both of them have the same tonal profile 22.  Thus the traditional Chinese classification give the Cantonese nine 声('tones'), while the conventional phonological classification would make it six as  there are only six unique tonal profiles (55, 25, 33, 21, 23,  and 22) in Cantonese: Ru syllables do not have distinct tonal profiles. Somehow we get lost in the translation.