~ubuntu-branches/ubuntu/saucy/u-boot/saucy

« back to all changes in this revision

Viewing changes to board/efikamx/efikamx-usb.c

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2012-05-01 18:07:19 UTC
  • mfrom: (16.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20120501180719-rjntk3287im4a0ns
Tags: 2012.04.01-1
* New upstream version.
  - Update mipsel-native-endianness.diff.
  - Update no-error-on-set-but-unused-variables.diff (partially merged).
  - Drop kirkwood_spi-irq_mask.diff (merged).
  - Drop kirkwood-disable-l2c.diff (merged).

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
{
121
121
        int ret;
122
122
        struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
 
123
        struct ulpi_viewport ulpi_vp;
123
124
 
124
125
        mxc_request_iomux(stp_gpio, alt0);
125
126
        mxc_iomux_set_pad(stp_gpio, PAD_CTL_DRV_HIGH |
133
134
        mxc_iomux_set_pad(stp_gpio, USB_PAD_CONFIG);
134
135
        udelay(10000);
135
136
 
136
 
        ret = ulpi_init((u32)&ehci->ulpi_viewpoint);
 
137
        ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
 
138
        ulpi_vp.port_num = 0;
 
139
 
 
140
        ret = ulpi_init(&ulpi_vp);
137
141
        if (ret) {
138
142
                printf("Efika USB ULPI initialization failed\n");
139
143
                return;
140
144
        }
141
145
 
142
146
        /* ULPI set flags */
143
 
        ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl,
 
147
        ulpi_write(&ulpi_vp, &ulpi->otg_ctrl,
144
148
                        ULPI_OTG_DP_PULLDOWN | ULPI_OTG_DM_PULLDOWN |
145
149
                        ULPI_OTG_EXTVBUSIND);
146
 
        ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->function_ctrl,
 
150
        ulpi_write(&ulpi_vp, &ulpi->function_ctrl,
147
151
                        ULPI_FC_FULL_SPEED | ULPI_FC_OPMODE_NORMAL |
148
152
                        ULPI_FC_SUSPENDM);
149
 
        ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->iface_ctrl, 0);
 
153
        ulpi_write(&ulpi_vp, &ulpi->iface_ctrl, 0);
150
154
 
151
155
        /* Set VBus */
152
 
        ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl_set,
 
156
        ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set,
153
157
                        ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
154
158
 
155
159
        /*
158
162
         * NOTE: This violates USB specification, but otherwise, USB on Efika
159
163
         * doesn't work.
160
164
         */
161
 
        ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl_set,
162
 
                        ULPI_OTG_CHRGVBUS);
 
165
        ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
163
166
}
164
167
 
165
168
int board_ehci_hcd_init(int port)
177
180
        uint32_t port = OTG_BASE_ADDR + (0x200 * CONFIG_MXC_USB_PORT);
178
181
        struct usb_ehci *ehci = (struct usb_ehci *)port;
179
182
        struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
180
 
 
181
 
        ulpi_write((u32)&ehci->ulpi_viewpoint, &ulpi->otg_ctrl_set,
182
 
                        ULPI_OTG_CHRGVBUS);
183
 
 
184
 
        wait_ms(50);
 
183
        struct ulpi_viewport ulpi_vp;
 
184
 
 
185
        ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
 
186
        ulpi_vp.port_num = 0;
 
187
 
 
188
        ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
 
189
 
 
190
        mdelay(50);
185
191
 
186
192
        /* terminate the reset */
187
193
        *reg = ehci_readl(status_reg);