Yes… and no. Eternity is a tricky concept. When we say God is eternal, we do not mean that He has existed for infinite moments of time in the past and will continue to exist for infinite moments in the future. We mean that God experiences no moments or duration. He is what He is, unchanging. What we experiences as progressive time does not come and go for God. All of creation is one act of God. His knowledge is directed to all points at once.
So to speak of God having foreknowledge can be misleading, as there is no before or after in His eternity. He has knowledge of how we experience things, on the order of time, but he doesn’t pass through time Himself. So God doesn’t know “in advance” or “before” in the way a human would know things “in advance” or “before”.