From b830f3930a95eacd391a1e7ea5730abfe5d3c110 Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Mon, 4 May 2015 16:45:53 +0900 Subject: fmd: rtc: set ClkRatio to 1 for T4 devices Change-Id: I059708174df6e363b3b35102231130c1b9ccbedc Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/35897 Reviewed-by: Yangbo Lu Reviewed-by: Honghua Yin Tested-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c index 7a86897..30191f4 100755 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c @@ -490,7 +490,12 @@ static const struct qe_firmware *FindFmanMicrocode(void) #define SVR_VER_IGNORE_MASK (SVR_SECURITY_MASK | SVR_PERSONALITY_MASK) #define SVR_B4860_REV1_VALUE 0x86800010 #define SVR_B4860_REV2_VALUE 0x86800020 - +#define SVR_T4240_VALUE 0x82400000 +#define SVR_T4120_VALUE 0x82400100 +#define SVR_T4160_VALUE 0x82410000 +#define SVR_T4080_VALUE 0x82410200 +#define SVR_T4_DEVICE_ID 0x82400000 +#define SVR_DEVICE_ID_MASK 0xFFF00000 static t_LnxWrpFmDev * ReadFmDevTreeNode (struct platform_device *of_dev) { @@ -968,6 +973,15 @@ static t_Error InitFmDev(t_LnxWrpFmDev *p_LnxWrpFmDev) p_LnxWrpFmDev->fmDevSettings.param.fmMacClkRatio = !!(get_rcwsr(4) & 0x1); /* RCW[FM_MAC_RAT1] */ + { + /* T4 Devices ClkRatio is always 1 regardless of RCW[FM_MAC_RAT1] */ + uint32_t svr; + svr = mfspr(SPRN_SVR); + + if ((svr & SVR_DEVICE_ID_MASK) == SVR_T4_DEVICE_ID) + p_LnxWrpFmDev->fmDevSettings.param.fmMacClkRatio = 1; + } + if ((p_LnxWrpFmDev->h_Dev = FM_Config(&p_LnxWrpFmDev->fmDevSettings.param)) == NULL) RETURN_ERROR(MAJOR, E_INVALID_HANDLE, ("FM")); -- cgit v0.10.2