We've built an embedded control board using an S7 and we're having an issue with bringing up the Ethernet interface. We're using a KSZ8091RNB like the DKS7G2 but we designed it using the 25 MHz mode while the DK uses 50 MHz mode.
The SSP file ether_phy.c has this Phy_Init function that sets the PHY to 50 MHz mode (and also changes the LED mode but that’s not a show-stopping issue) and I don’t immediately see a way to work around it. The trouble is in this section:
#if !defined(BSP_BOARD_S7G2_SK) && !defined(BSP_BOARD_S5D9_ASK) && !defined(BSP_BOARD_S5D9_DK) && !defined(BSP_BOARD_S5D9_PK) && !defined(BSP_BOARD_S5D5_PROTO)
* When MICREL_KSZ8091RNB of the Micrel, Inc. is used,
* the pin that outputs the state of LINK is used combinedly with ACTIVITY in default.
* The setting of the pin is changed so that only the state of LINK is output.
* Set Clock Mode to 50MHz
reg = phy_read(channel, PHY_REG_PHY_CONTROL_2);
reg &= (uint16_t) (~(PHY_REG_PHY_CONTROL2_RMMI_REF_CLOCK_SELECT_MASK | PHY_REG_PHY_CONTROL2_LED_MODE_MASK));
reg |= (PHY_REG_PHY_CONTROL2_RMMI_REF_CLOCK_SELECT_50MHZ | PHY_REG_PHY_CONTROL2_LED_MODE_LINK0_ACTIVITY1);
phy_write(channel, PHY_REG_PHY_CONTROL_2, reg);
If I break at the phy_write line and change reg from 0x8190 to 0x8100 (the default values that I designed to) my interface comes up. If I comment out the line, since this is SSP code, it just gets regenerated back.
What do I do to work around this? It seems very limiting for the SSP to say “if you’re not using any of these development kits then I’m going to write to this register”. What if I hadn’t chosen to use either KSZ8081RNA or KSZ8091RNB?
Hi If you don't want the file ether_phy.c to be automatically changed you can set it as read-only or exclude the file from building and copy it for example to the src directory (but then could be need to set the include paths again int the file). Regards HENIUS