As I said we came by car, on the route up to the castle with the roads being one way and very very narrow and winding, parking was definitely out. There is a small, and I mean small car park at the top just below the castle walls. Probably only enough for approx 6 cars if people park correctly.
There is no entrance fee to the castle.
We drove to Jimena but you can also get a train from San Roque, which is just past La Linea on the otherside of the border from Gibraltar. Its about 35 kilometers from San Roque to Jimena. Apparently the train line was built in the late 19th century.