Harper Lee's novel To Kill a Mockingbird has several examples of foreshadowing that could be connected to the racism directed at Tom Robinson.
In the first chapter, we learn about the history of the Finches in the area, and the "founding" of Finch's Landing. This has happened many years before the story opens in Maycomb, Alabama (a fictitious town), but the history of slavery and the perception that owning another human being was acceptable behavior is seen with Simon Finch.
So Simon, having forgotten his teacher's dictum on the possession of human chattels, bought three slaves...
In Chapter 14, Scout shares the news that she and Jem attended Calpurnia's church with her when Atticus was out of town. Aunt Alexandra is not happy about this. Calpurnia also invited the children to one day visit her in her home. Aunt Alexandra immediately tells Scout she may not do so, and Scout is less than respectful about her aunt's comment, getting in trouble with Atticus.
In the same chapter, Aunt Alexandra is displeased that Calpurnia is raising Scout and Jem, and offers to take over for her, but Atticus will not hear of it. As far as he is concerned, Calpurnia is part of the family and the children love her, but his attitude is not indicative of those of the genteel ring, the "upper crust" of Maycomb society: Aunt Alexandra's attitude is.
At one point the members of the women's missionary circle complain about the behavior of their hired help when Tom is arrested, resenting the concern expressed by those of the black community for one of their own. In this we see the width of the social gap between most (not all) of Maycomb's white community and that of the the black community.
While Tom Robinson is being held in the jail, after being accused of raping Mayella Ewell, a lynch mob shows up to take justice into their own hands. This may not specifically be foreshadowing regarding racism towards Tom, but it could be considered foreshadowing with regard to Tom's fate, and the "forceful" way he is stopped from escaping from the prison yard after his conviction.
And finally, at the start of Tom Robinson's trial, Scout describes the Ewell family, Bob Ewell specifically. The Ewells live near the garbage dump, in "what was once a Negro cabin." Their property was separated by a Negro settlement "some five hundred yards beyond." In describing Bob Ewell as he sat on the witness stand, Scout notes:
All the little man on the witness stand had that made him any better than his nearest neighbors was, that if scrubbed with lye soap in very hot water, his skin was white.
This is another clear indication that socially, someone as distasteful as Bob Ewell was still considered one step above those in the community that were black.