Deleted Added
full compact
avila_ata.c (194044) avila_ata.c (194653)
1/*-
2 * Copyright (c) 2006 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/avila_ata.c 194044 2009-06-12 00:07:09Z imp $");
31__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/avila_ata.c 194653 2009-06-22 20:38:55Z sam $");
32
33/*
34 * Compact Flash Support for the Avila Gateworks XScale boards.
35 * The CF slot is operated in "True IDE" mode. Registers are on
36 * the Expansion Bus connected to CS1 and CS2. Interrupts are
37 * tied to GPIO pin 12. No DMA, just PIO.
38 *
39 * The ADI Pronghorn Metro is very similar. It use CS3 and CS4 and

--- 173 unchanged lines hidden (view full) ---

213 sc->sc_expbus_tag.bs_wm_2 = ata_bs_wm_2,
214 sc->sc_expbus_tag.bs_wm_2_s = ata_bs_wm_2_s,
215
216 rman_set_bustag(&sc->sc_ata, &sc->sc_expbus_tag);
217 rman_set_bushandle(&sc->sc_ata, sc->sc_ioh);
218 rman_set_bustag(&sc->sc_alt_ata, &sc->sc_expbus_tag);
219 rman_set_bushandle(&sc->sc_alt_ata, sc->sc_alt_ioh);
220
32
33/*
34 * Compact Flash Support for the Avila Gateworks XScale boards.
35 * The CF slot is operated in "True IDE" mode. Registers are on
36 * the Expansion Bus connected to CS1 and CS2. Interrupts are
37 * tied to GPIO pin 12. No DMA, just PIO.
38 *
39 * The ADI Pronghorn Metro is very similar. It use CS3 and CS4 and

--- 173 unchanged lines hidden (view full) ---

213 sc->sc_expbus_tag.bs_wm_2 = ata_bs_wm_2,
214 sc->sc_expbus_tag.bs_wm_2_s = ata_bs_wm_2_s,
215
216 rman_set_bustag(&sc->sc_ata, &sc->sc_expbus_tag);
217 rman_set_bushandle(&sc->sc_ata, sc->sc_ioh);
218 rman_set_bustag(&sc->sc_alt_ata, &sc->sc_expbus_tag);
219 rman_set_bushandle(&sc->sc_alt_ata, sc->sc_alt_ioh);
220
221 GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPOER,
222 GPIO_CONF_READ_4(sa, IXP425_GPIO_GPOER) | (1<<config->gpin));
223 /* set interrupt type */
224 GPIO_CONF_WRITE_4(sa, GPIO_TYPE_REG(config->gpin),
225 (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(config->gpin)) &~
226 GPIO_TYPE(config->gpin, GPIO_TYPE_MASK)) |
227 GPIO_TYPE(config->gpin, GPIO_TYPE_EDG_RISING));
221 ixp425_set_gpio(sa, config->gpin, GPIO_TYPE_EDG_RISING);
228
222
229 /* clear ISR */
230 GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPISR, (1<<config->gpin));
231
232 /* configure CS1/3 window, leaving timing unchanged */
233 EXP_BUS_WRITE_4(sc, sc->sc_16bit_off,
234 EXP_BUS_READ_4(sc, sc->sc_16bit_off) |
235 EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN);
236 /* configure CS2/4 window, leaving timing unchanged */
237 EXP_BUS_WRITE_4(sc, config->offalt,
238 EXP_BUS_READ_4(sc, config->offalt) |
239 EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN);

--- 319 unchanged lines hidden ---
223 /* configure CS1/3 window, leaving timing unchanged */
224 EXP_BUS_WRITE_4(sc, sc->sc_16bit_off,
225 EXP_BUS_READ_4(sc, sc->sc_16bit_off) |
226 EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN);
227 /* configure CS2/4 window, leaving timing unchanged */
228 EXP_BUS_WRITE_4(sc, config->offalt,
229 EXP_BUS_READ_4(sc, config->offalt) |
230 EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN);

--- 319 unchanged lines hidden ---