If you want to cities you can do that easily by high speed train. RENFE has a site in English where you can book tickets. Get them well in advance - they can be cheap.
Barcelona-Madrid-Cordoba-Seville would be very doable by train.
And then rent a car or take a bus to go to Granada or Portugal.
Keep in mind Spain is a huge country by European standards. You could easily spend 2 weeks just exploring one region. Enjoy!