One of the best soils for greenhouses is Terra Preta. It is black and is created from anorganic matter (sand, clay, regolith, or traditionally, pottery sherds), organic waste (feces, bones, rotten leaves, etc.) and charcoal.
Terra preta is full of microbial life, can hold large amounts of water and supports plant growth with lots of nutrients. As far as usage for Mars is concerned, the lack of coal on Mars would make its preparation difficult. However, the settlement might produce activated charcoal for filtration, and eventually recycle this charcoal into the soil, for example.
Alternatively, some biomass from food production might be turned into charcoal before being returned to the soil. This would displace the hydrogen in the biomass towards water, and therefore consume energy, so the best method for biomass recovery would need to be studied. Bioreactors, for example, might keep the hydrogen in the food chain by producing hydrocarbons.