I'm currently reading Paul Stamets Mycelium Running, a book about how mushrooms can be used to clean our environment, repel insects, and cure diseases. I tripped over this interesting bit of lore in Chapter 9:
Frank Herbert, the well-known author of the Dune books, told me his technique for using [mushroom] spores. When I met him in the early 1980s, Frank enjoyed collecting mushrooms on his property near Port Townsend, Washington.
Frank went on to tell me that much of the premise of Dune–the magic spice (spores) that allowed the bending of space (tripping), the giant worms (maggots digesting mushrooms), the eyes of the Fremen (the cerulean blue of the Psilocybe mushroom), the mysticism of the female spiritual warriors, the Bene Gesserits (influenced by tales of Maria Sabina and the sacred mushroom cults of Mexico)—came from his perception of the fungal life cycle, and his imagination was stimulated through the experience with the use of the magic mushroom.
For what it's worth, most of Mycelium Running has little to do with psychedelic mushrooms—not that there would be anything wrong with that—but instead focuses more on the technical details about the growth cycle and practical uses of a wide array of fungi.