George RR Martin writes in his blog about how the Rock inspired him and the differences and similarities it bears with Casterly Rock. He tells of Gibraltar being a "unique place, with thousands of years of histroy".
He describes astonishment about the rock, especially what you can find inside it, "it's not just a big hunk of stone, y'see...[there] are 34 miles of tunnels, more than 150 halls, chambers, and caves, Napoleonic gunports and cannons looking out over land and sea, stalgmites and stalactites, World War II bunkers, a concert hall/ampitheatre, a hospital (WWII era), and ancient mines."
This all came about after a visit to Gibraltar some years ago where he "found the place just as fascinating in personal as [he] had in print".
You can read more about his thoughts and inisghts about Gibraltar and Casterly Rock on his blog: https://georgerrmartin.com/notablog/2022/12/23/a-couple-of-rocks/
The author also spoke to the Gibraltar Broadcasting Coporation for an exclusive interview about the inspiration. You can watch it here: https://www.gbc.gi/news/author-games-thrones-series-george-rr-martin-speaks-gbc-exclusive-interview