It sounds like you're planning a minimum 4 week trip. How long are you planning to stay in each place and will you have a car for part of that time?
As acraven has pointed out, longer stays may well need to be booked in advance. Unless you're okay with changing hotels while in one city. And it depends on how picky you are and what your budget allows.
Barcelona may be difficult if you end up there during an expo week. Granada really needs to be planned in advance because Alhambra tickets sell out even in February/March. As of today, tickets on the official website are sold out through Nov. 5 and very few tickets are still availble through the middle of the month.
The white hill towns probably not a problem in February if you have a car. Some places may close in February because of low demand or to make repairs/renovations.
Lastly, I'd encourage you to spend a few nights in Cordoba.
You will get big discounts on train tickets if you buy them well in advance. Tickets are usually offered 62 days ahead, though it varies somewhat. I compared the fares for Madrid-Barcelona. Most tickets for a week from today were over €100, though there were still a handful at around €85. For 2 months from now, many were at €67 and I even saw one at €50. However, if you are entitled to the tarjeta dorada (60+), that won't be a factor.