Deleted Added
full compact
ixp425.c (194652) ixp425.c (194653)
1/* $NetBSD: ixp425.c,v 1.10 2005/12/11 12:16:51 christos Exp $ */
2
3/*
4 * Copyright (c) 2003
5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35
36#include <sys/cdefs.h>
1/* $NetBSD: ixp425.c,v 1.10 2005/12/11 12:16:51 christos Exp $ */
2
3/*
4 * Copyright (c) 2003
5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/ixp425.c 194652 2009-06-22 20:36:22Z sam $");
37__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/ixp425.c 194653 2009-06-22 20:38:55Z sam $");
38
39#include "opt_ddb.h"
40
41#define _ARM32_BUS_DMA_PRIVATE
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/bus.h>
45#include <sys/kernel.h>

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

154 & 7]);
155 break;
156 }
157 db_printf("\n");
158 }
159}
160#endif
161
38
39#include "opt_ddb.h"
40
41#define _ARM32_BUS_DMA_PRIVATE
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/bus.h>
45#include <sys/kernel.h>

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

154 & 7]);
155 break;
156 }
157 db_printf("\n");
158 }
159}
160#endif
161
162void
163ixp425_set_gpio(struct ixp425_softc *sc, int pin, int type)
164{
165 uint32_t gpiotr = GPIO_CONF_READ_4(sc, GPIO_TYPE_REG(pin));
166
167 /* clear interrupt type */
168 GPIO_CONF_WRITE_4(sc, GPIO_TYPE_REG(pin),
169 gpiotr &~ GPIO_TYPE(pin, GPIO_TYPE_MASK));
170 /* clear any pending interrupt */
171 GPIO_CONF_WRITE_4(sc, IXP425_GPIO_GPISR, (1<<pin));
172 /* set new interrupt type */
173 GPIO_CONF_WRITE_4(sc, GPIO_TYPE_REG(pin),
174 gpiotr | GPIO_TYPE(pin, type));
175
176 /* configure gpio line as an input */
177 GPIO_CONF_WRITE_4(sc, IXP425_GPIO_GPOER,
178 GPIO_CONF_READ_4(sc, IXP425_GPIO_GPOER) | (1<<pin));
179}
180
162static __inline void
163ixp425_gpio_ack(int irq)
164{
165 if (irq < 32 && ((1 << irq) & IXP425_INT_GPIOMASK))
166 IXPREG(IXP425_GPIO_VBASE + IXP425_GPIO_GPISR) =
167 ixp425_irq2gpio_bit(irq);
168}
169

--- 485 unchanged lines hidden ---
181static __inline void
182ixp425_gpio_ack(int irq)
183{
184 if (irq < 32 && ((1 << irq) & IXP425_INT_GPIOMASK))
185 IXPREG(IXP425_GPIO_VBASE + IXP425_GPIO_GPISR) =
186 ixp425_irq2gpio_bit(irq);
187}
188

--- 485 unchanged lines hidden ---