~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/staging/et131x/et1310_pm.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
void EnablePhyComa(struct et131x_adapter *etdev)
110
110
{
111
111
        unsigned long flags;
112
 
        u32 GlobalPmCSR;
 
112
        u32 pmcsr;
113
113
 
114
 
        GlobalPmCSR = readl(&etdev->regs->global.pm_csr);
 
114
        pmcsr = readl(&etdev->regs->global.pm_csr);
115
115
 
116
116
        /* Save the GbE PHY speed and duplex modes. Need to restore this
117
117
         * when cable is plugged back in
118
118
         */
119
 
        etdev->PoMgmt.PowerDownSpeed = etdev->AiForceSpeed;
120
 
        etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx;
 
119
        etdev->pdown_speed = etdev->AiForceSpeed;
 
120
        etdev->pdown_duplex = etdev->AiForceDpx;
121
121
 
122
122
        /* Stop sending packets. */
123
 
        spin_lock_irqsave(&etdev->SendHWLock, flags);
 
123
        spin_lock_irqsave(&etdev->send_hw_lock, flags);
124
124
        etdev->Flags |= fMP_ADAPTER_LOWER_POWER;
125
 
        spin_unlock_irqrestore(&etdev->SendHWLock, flags);
 
125
        spin_unlock_irqrestore(&etdev->send_hw_lock, flags);
126
126
 
127
127
        /* Wait for outstanding Receive packets */
128
128
 
129
129
        /* Gate off JAGCore 3 clock domains */
130
 
        GlobalPmCSR &= ~ET_PMCSR_INIT;
131
 
        writel(GlobalPmCSR, &etdev->regs->global.pm_csr);
 
130
        pmcsr &= ~ET_PMCSR_INIT;
 
131
        writel(pmcsr, &etdev->regs->global.pm_csr);
132
132
 
133
133
        /* Program gigE PHY in to Coma mode */
134
 
        GlobalPmCSR |= ET_PM_PHY_SW_COMA;
135
 
        writel(GlobalPmCSR, &etdev->regs->global.pm_csr);
 
134
        pmcsr |= ET_PM_PHY_SW_COMA;
 
135
        writel(pmcsr, &etdev->regs->global.pm_csr);
136
136
}
137
137
 
138
138
/**
141
141
 */
142
142
void DisablePhyComa(struct et131x_adapter *etdev)
143
143
{
144
 
        u32 GlobalPmCSR;
 
144
        u32 pmcsr;
145
145
 
146
 
        GlobalPmCSR = readl(&etdev->regs->global.pm_csr);
 
146
        pmcsr = readl(&etdev->regs->global.pm_csr);
147
147
 
148
148
        /* Disable phy_sw_coma register and re-enable JAGCore clocks */
149
 
        GlobalPmCSR |= ET_PMCSR_INIT;
150
 
        GlobalPmCSR &= ~ET_PM_PHY_SW_COMA;
151
 
        writel(GlobalPmCSR, &etdev->regs->global.pm_csr);
 
149
        pmcsr |= ET_PMCSR_INIT;
 
150
        pmcsr &= ~ET_PM_PHY_SW_COMA;
 
151
        writel(pmcsr, &etdev->regs->global.pm_csr);
152
152
 
153
153
        /* Restore the GbE PHY speed and duplex modes;
154
154
         * Reset JAGCore; re-configure and initialize JAGCore and gigE PHY
155
155
         */
156
 
        etdev->AiForceSpeed = etdev->PoMgmt.PowerDownSpeed;
157
 
        etdev->AiForceDpx = etdev->PoMgmt.PowerDownDuplex;
 
156
        etdev->AiForceSpeed = etdev->pdown_speed;
 
157
        etdev->AiForceDpx = etdev->pdown_duplex;
158
158
 
159
159
        /* Re-initialize the send structures */
160
160
        et131x_init_send(etdev);