
Dear Stefano Babic,
In message 4B542B4E.4000108@denx.de you wrote:
+#ifndef CONFIG_MX51
struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE;
/* enable FEC clock */ writel(readl(&pll->pccr1) | PCCR1_HCLK_FEC, &pll->pccr1); writel(readl(&pll->pccr0) | PCCR0_FEC_EN, &pll->pccr0);
+#endif
Can we implement this clock enable in a way that goes without #ifdef ?
I think this should be dropped from the driver. The driver should be responsible to set up the FEC controller and nothing else. Enabling the clock should be done in another place (probably in the cpu related part ?), but not here. However, this is related to the i.MX27, I am not sure where we have to move this code.
I'm not sure. Here is where we enable the FEC because we want to use it in a network command, right? Then this is the place to enable the needed clocks, too. These should not be globally enabled and running even if no network access is ever made - this would only increase the power dissipation, which is bad on battery operated devices.
Best regards,
Wolfgang Denk