That's eight full days in Spain, not counting your arrival and departure days, for four or five cities. To visit all of them you'll be changing cities four times. Even if you visit Toledo as a day trip from Madrid, and Cordoba along the way between Madrid, Sevilla, and/or Granada, you'll still be dealing with a lot of packing, switching cities and hotels, unpacking, etc.
A doable plan (too fast for me) would be:
Day 1 -- Arrive Madrid, see outdoor sights to stay awake, sleep in Madrid
Day 2 -- More Madrid sights, sleep in Madrid
Day 3 -- Day trip to Toledo, return and sleep in Madrid
Day 4 -- Train to Cordoba, sights there, sleep in Cordoba
Day 5 -- Train to Granada, sights there, sleep in Granada
Day 6 -- Granada sights, sleep in Granada
Day 7 -- Train (via Cordoba) to Seville, sleep in Seville
Day 8 -- Seville sights, sleep in Seville
Day 9 -- Train (via Cordoba) back to Madrid, more sights, sleep in Madrid (near airport if a morning flight)
Day 10 -- Fly home
You could rework the non-Madrid days to stop in Cordoba whenever you're going between Madrid, Granada, and Seville. You could make Cordoba a daytime stop between those cities to reduce the number of hotel changes. You could skip Toledo and/or Cordoba to give yourself more time in the other cities. If I had just nine nights, I'd probably split them between Madrid and Seville, with a daytime stop in Cordoba between trains. I hope this is helpful.