If the driver can't detect a PHY it's because it's unable to communicate with the PHY over the MDIO interface. This is basically an I2C interface involving the "mdc" and "mdio" pins. I'm not familiar with this gmii_mii_mux module that appears to interact with these signals somehow.
Typically you make a simple assignment at the top level like this:
module ddr2_test_top(
...
mdc,
mdio,
...
);
wire mdio_out;
wire mdio_oe;
assign mdio = mdio_oen ? 1'bz : mdio_out;
nios_ddr2 b2v_inst(
...
.mdio_in_to_the_tse_mac(mdio),
.mdio_out_from_the_tse_mac(mdio_out),
.mdio_oen_from_the_tse_mac(mdio_oen),
...
);