We connect the electroweak (EW) baryogenesis and the dark matter physics in a complex singlet scalar S extension of the Standard Model. We impose the additional CP and Z_2 symmetries on the scalar potential. With the complex vacuum expectation value of S at the temperature higher than the EW phase transition, the CP symmetry is spontaneously broken and a strong first-order EW phase transition is easily realized. Together with a dimension-6 effective operator that gives new complex contributions to the top quark mass, we show that it is easy to yield the observed baryon asymmetry in our Universe. On the other hand, the CP and Z_2 symmetries are recovered after the EW phase transition. The lighter real state in S can be the dark matter candidate, and the strong constraints of CP violations can be avoided. With the scan of parameter space, we can find models which can explain the dark matter relic abundance and the baryon asymmetry simultaneously while satisfying all constraints.