CVS commit: src/sys/arch/arm/xscale

2021-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug  6 09:01:36 UTC 2021

Modified Files:
src/sys/arch/arm/xscale: i80321_icu.c i80321var.h

Log Message:
Simplify i80321_intr_calculate_masks().

G/C unused members of struct intrq.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/xscale/i80321_icu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/xscale/i80321var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_icu.c
diff -u src/sys/arch/arm/xscale/i80321_icu.c:1.26 src/sys/arch/arm/xscale/i80321_icu.c:1.27
--- src/sys/arch/arm/xscale/i80321_icu.c:1.26	Fri Nov 20 18:49:45 2020
+++ src/sys/arch/arm/xscale/i80321_icu.c	Fri Aug  6 09:01:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_icu.c,v 1.26 2020/11/20 18:49:45 thorpej Exp $	*/
+/*	$NetBSD: i80321_icu.c,v 1.27 2021/08/06 09:01:36 rin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.26 2020/11/20 18:49:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.27 2021/08/06 09:01:36 rin Exp $");
 
 #ifndef EVBARM_SPL_NOINLINE
 #define	EVBARM_SPL_NOINLINE
@@ -166,26 +166,22 @@ i80321_intr_calculate_masks(void)
 	struct intrhand *ih;
 	int irq, ipl;
 
-	/* First, figure out which IPLs each IRQ has. */
+	/* Disable all IRQs. */
+	for (irq = 0; irq < NIRQ; irq++)
+		i80321_disable_irq(irq);
+
+	/* Figure out which IRQs are used by each IPL. */
+	for (ipl = 0; ipl < NIPL; ipl++)
+		i80321_imask[ipl] = 0;
 	for (irq = 0; irq < NIRQ; irq++) {
-		int levels = 0;
 		iq = &intrq[irq];
-		i80321_disable_irq(irq);
-		for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
-		 ih = TAILQ_NEXT(ih, ih_list))
-			levels |= (1U << ih->ih_ipl);
-		iq->iq_levels = levels;
+		TAILQ_FOREACH(ih, &iq->iq_list, ih_list)
+			i80321_imask[ih->ih_ipl] |= (1U << irq);
 	}
 
-	/* Next, figure out which IRQs are used by each IPL. */
-	for (ipl = 0; ipl < NIPL; ipl++) {
-		int irqs = 0;
-		for (irq = 0; irq < NIRQ; irq++) {
-			if (intrq[irq].iq_levels & (1U << ipl))
-irqs |= (1U << irq);
-		}
-		i80321_imask[ipl] = irqs;
-	}
+	/* All IPLs block everything blocked by any lower IPL. */
+	for (ipl = 1; ipl < NIPL; ipl++)
+		i80321_imask[ipl] |= i80321_imask[ipl - 1];
 
 	KASSERT(i80321_imask[IPL_NONE] == 0);
 	KASSERT(i80321_imask[IPL_SOFTCLOCK] == 0);
@@ -193,38 +189,11 @@ i80321_intr_calculate_masks(void)
 	KASSERT(i80321_imask[IPL_SOFTNET] == 0);
 	KASSERT(i80321_imask[IPL_SOFTSERIAL] == 0);
 
-	/*
-	 * Enforce a hierarchy that gives "slow" device (or devices with
-	 * limited input buffer space/"real-time" requirements) a better
-	 * chance at not dropping data.
-	 */
-
-#if 0
-	/*
-	 * This assert might be useful, but only after some interrupts
-	 * are configured.  As it stands now, it will always fire early
-	 * in the initialization phase.  If it's useful enough to re-
-	 * enable, it should be conditionalized on something else like
-	 * having at least something in the levels/irqs above.
-	 */
-	KASSERT(i80321_imask[IPL_VM] != 0);
-#endif
-	i80321_imask[IPL_SCHED] |= i80321_imask[IPL_VM];
-	i80321_imask[IPL_HIGH] |= i80321_imask[IPL_SCHED];
-
-	/*
-	 * Now compute which IRQs must be blocked when servicing any
-	 * given IRQ.
-	 */
+	/* Enable IRQs in use. */
 	for (irq = 0; irq < NIRQ; irq++) {
-		int irqs = (1U << irq);
 		iq = &intrq[irq];
-		if (TAILQ_FIRST(&iq->iq_list) != NULL)
+		if (!TAILQ_EMPTY(&iq->iq_list))
 			i80321_enable_irq(irq);
-		for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
-		 ih = TAILQ_NEXT(ih, ih_list))
-			irqs |= i80321_imask[ih->ih_ipl];
-		iq->iq_mask = irqs;
 	}
 }
 

Index: src/sys/arch/arm/xscale/i80321var.h
diff -u src/sys/arch/arm/xscale/i80321var.h:1.13 src/sys/arch/arm/xscale/i80321var.h:1.14
--- src/sys/arch/arm/xscale/i80321var.h:1.13	Sun Feb 12 16:31:01 2012
+++ src/sys/arch/arm/xscale/i80321var.h	Fri Aug  6 09:01:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321var.h,v 1.13 2012/02/12 16:31:01 matt Exp $	*/
+/*	$NetBSD: i80321var.h,v 1.14 2021/08/06 09:01:36 rin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -59,8 +59,6 @@ struct intrhand {
 struct intrq {
 	TAILQ_HEAD(, intrhand) iq_list;	/* handler list */
 	struct evcnt iq_ev;		/* event counter */
-	int iq_mask;			/* IRQs to mask while handling */
-	int iq_levels;			/* IPL_*'s this IRQ has */
 	int iq_ist;			/* share type */
 };
 



CVS commit: src/sys/arch/arm/xscale

2021-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug  6 08:58:42 UTC 2021

Modified Files:
src/sys/arch/arm/xscale: i80321_intr.h

Log Message:
Do *NOT* lower IPL in i80321_splraise().

Fix various strange crashes for DIAGNOSTIC kernel on evbarm/HDL_G,
including one worked around by if_wm.c rev 1.706:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/if_wm.c#rev1.706


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/xscale/i80321_intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_intr.h
diff -u src/sys/arch/arm/xscale/i80321_intr.h:1.12 src/sys/arch/arm/xscale/i80321_intr.h:1.13
--- src/sys/arch/arm/xscale/i80321_intr.h:1.12	Wed Jan 24 09:04:45 2018
+++ src/sys/arch/arm/xscale/i80321_intr.h	Fri Aug  6 08:58:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_intr.h,v 1.12 2018/01/24 09:04:45 skrll Exp $	*/
+/*	$NetBSD: i80321_intr.h,v 1.13 2021/08/06 08:58:42 rin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
@@ -95,10 +95,15 @@ static inline int __attribute__((__unuse
 i80321_splraise(int ipl)
 {
 	int old = curcpl();
-	set_curcpl(ipl);
 
-	/* Don't let the compiler re-order this code with subsequent code */
-	__insn_barrier();
+	if (ipl > old) {
+		set_curcpl(ipl);
+		/*
+		 * Don't let the compiler re-order this code with
+		 * subsequent code
+		 */
+		__insn_barrier();
+	}
 
 	return (old);
 }



CVS commit: src/sys/arch/arm/xscale

2021-02-06 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Feb  6 12:53:37 UTC 2021

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_ac97.c

Log Message:
Fix "locking against myself".
halt_{input,output} will be called with sc_intr_lock held.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/xscale/pxa2x0_ac97.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_ac97.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.19 src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.20
--- src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.19	Sat Feb  6 07:16:54 2021
+++ src/sys/arch/arm/xscale/pxa2x0_ac97.c	Sat Feb  6 12:53:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_ac97.c,v 1.19 2021/02/06 07:16:54 isaki Exp $	*/
+/*	$NetBSD: pxa2x0_ac97.c,v 1.20 2021/02/06 12:53:36 isaki Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -724,14 +724,12 @@ acu_halt_output(void *arg)
 {
 	struct acu_softc *sc = arg;
 
-	mutex_spin_enter(&sc->sc_intr_lock);
 	if (sc->sc_txdma) {
 		acu_reg_write(sc, AC97_POCR, 0);
 		acu_reg_write(sc, AC97_POSR, AC97_FIFOE);
 		pxa2x0_dmac_abort_xfer(sc->sc_txdma->ad_dx);
 		sc->sc_txdma = NULL;
 	}
-	mutex_spin_exit(&sc->sc_intr_lock);
 	return (0);
 }
 
@@ -740,14 +738,12 @@ acu_halt_input(void *arg)
 {
 	struct acu_softc *sc = arg;
 
-	mutex_spin_enter(&sc->sc_intr_lock);
 	if (sc->sc_rxdma) {
 		acu_reg_write(sc, AC97_PICR, 0);
 		acu_reg_write(sc, AC97_PISR, AC97_FIFOE);
 		pxa2x0_dmac_abort_xfer(sc->sc_rxdma->ad_dx);
 		sc->sc_rxdma = NULL;
 	}
-	mutex_spin_exit(&sc->sc_intr_lock);
 	return (0);
 }
 



CVS commit: src/sys/arch/arm/xscale

2021-02-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Feb  6 07:16:54 UTC 2021

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_ac97.c

Log Message:
Calling halt_{input,output} is done by the MI audio layer if necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/pxa2x0_ac97.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_ac97.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.18 src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.19
--- src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.18	Sun Apr 19 08:18:19 2020
+++ src/sys/arch/arm/xscale/pxa2x0_ac97.c	Sat Feb  6 07:16:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_ac97.c,v 1.18 2020/04/19 08:18:19 isaki Exp $	*/
+/*	$NetBSD: pxa2x0_ac97.c,v 1.19 2021/02/06 07:16:54 isaki Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -545,8 +545,6 @@ acu_close(void *arg)
 	/*
 	 * Make sure the hardware is quiescent
 	 */
-	acu_halt_output(sc);
-	acu_halt_input(sc);
 	delay(100);
 
 	/* Assert Cold Reset */



CVS commit: src/sys/arch/arm/xscale

2020-11-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 21 19:55:49 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: i80200_irq.S

Log Message:
Adjust egister usage so that r4 and r5 are preserved as cur{cpu,lwp}
respectively as required by the change to make ASTs operate per-LWP
rather than per-CPU.  DO_AST_AND_RESTORE_ALIGNMENT_FAULTS expects this.

XXX untested


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/i80200_irq.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80200_irq.S
diff -u src/sys/arch/arm/xscale/i80200_irq.S:1.18 src/sys/arch/arm/xscale/i80200_irq.S:1.19
--- src/sys/arch/arm/xscale/i80200_irq.S:1.18	Thu Jul 12 10:46:42 2018
+++ src/sys/arch/arm/xscale/i80200_irq.S	Sat Nov 21 19:55:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80200_irq.S,v 1.18 2018/07/12 10:46:42 maxv Exp $	*/
+/*	$NetBSD: i80200_irq.S,v 1.19 2020/11/21 19:55:49 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -63,7 +63,7 @@ ASENTRY_NP(irq_entry)
 	sub	lr, lr, #0x0004	/* Adjust the lr */
 
 	PUSHFRAMEINSVC			/* Push an interrupt frame */
-	ENABLE_ALIGNMENT_FAULTS
+	ENABLE_ALIGNMENT_FAULTS		/* puts cur{cpu,lwp} in r4/r5 */
 
 	/*
 	 * Note that we have entered the IRQ handler.  We are
@@ -78,7 +78,7 @@ ASENTRY_NP(irq_entry)
 	/*
 	 * Get the interrupt status into a callee-save register.
 	 */
-	mrc	p13, 0, r5, c4, c0, 0
+	mrc	p13, 0, r6, c4, c0, 0
 
 	/*
 	 * XXX - any need to handle BMU interrupts?
@@ -91,7 +91,7 @@ ASENTRY_NP(irq_entry)
 	 * interrupts disabled, and will return with interrupts
 	 * disabled.
 	 */
-	tst	r5, #(INTSRC_II)
+	tst	r6, #(INTSRC_II)
 	beq	.Lextirq_return		/* no external IRQ pending */
 	ldr	r1, .Lintr_dispatch
 	mov	r0, sp



CVS commit: src/sys/arch/arm/xscale

2020-02-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Feb 18 14:49:32 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: ixp425_if_npe.c

Log Message:
Use ether_mediastatus().


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/xscale/ixp425_if_npe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_if_npe.c
diff -u src/sys/arch/arm/xscale/ixp425_if_npe.c:1.46 src/sys/arch/arm/xscale/ixp425_if_npe.c:1.47
--- src/sys/arch/arm/xscale/ixp425_if_npe.c:1.46	Tue Feb  4 05:16:18 2020
+++ src/sys/arch/arm/xscale/ixp425_if_npe.c	Tue Feb 18 14:49:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_if_npe.c,v 1.46 2020/02/04 05:16:18 thorpej Exp $ */
+/*	$NetBSD: ixp425_if_npe.c,v 1.47 2020/02/18 14:49:32 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2006 Sam Leffler.  All rights reserved.
@@ -28,7 +28,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.46 2020/02/04 05:16:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.47 2020/02/18 14:49:32 thorpej Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -192,7 +192,6 @@ static int	npe_activate(struct npe_softc
 #if 0
 static void	npe_deactivate(struct npe_softc *);
 #endif
-static void	npe_ifmedia_status(struct ifnet *, struct ifmediareq *);
 static void	npe_setmac(struct npe_softc *, const u_char *);
 static void	npe_getmac(struct npe_softc *);
 static void	npe_txdone(int, void *);
@@ -301,7 +300,7 @@ npe_attach(device_t parent, device_t sel
 	sc->sc_ethercom.ec_mii = mii;
 
 	ifmedia_init(&mii->mii_media, IFM_IMASK, ether_mediachange,
-	npe_ifmedia_status);
+	ether_mediastatus);
 
 	mii_attach(sc->sc_dev, mii, 0x, MII_PHY_ANY,
 		MII_OFFSET_ANY, MIIF_DOPAUSE);
@@ -684,20 +683,6 @@ npe_deactivate(struct npe_softc *sc);
 }
 #endif
 
-/*
- * Notify the world which media we're using.
- */
-static void
-npe_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
-	struct npe_softc *sc = ifp->if_softc;
-
-	mii_pollstat(&sc->sc_mii);
-
-	ifmr->ifm_active = sc->sc_mii.mii_media_active;
-	ifmr->ifm_status = sc->sc_mii.mii_media_status;
-}
-
 static void
 npe_addstats(struct npe_softc *sc)
 {



CVS commit: src/sys/arch/arm/xscale

2020-02-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Feb 12 05:44:26 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: ixp425reg.h

Log Message:
Correct the location of SDRAM in the comment describing the IXP425
memory map.  SDRAM is located at 0x and has aliases at 0x1000,
0x2000, and 0x3000.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/xscale/ixp425reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425reg.h
diff -u src/sys/arch/arm/xscale/ixp425reg.h:1.22 src/sys/arch/arm/xscale/ixp425reg.h:1.23
--- src/sys/arch/arm/xscale/ixp425reg.h:1.22	Mon Nov 12 18:00:38 2012
+++ src/sys/arch/arm/xscale/ixp425reg.h	Wed Feb 12 05:44:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425reg.h,v 1.22 2012/11/12 18:00:38 skrll Exp $ */
+/*	$NetBSD: ixp425reg.h,v 1.23 2020/02/12 05:44:26 thorpej Exp $ */
 /*
  * Copyright (c) 2003
  *	Ichiro FUKUHARA .
@@ -54,8 +54,14 @@
  * 4800  ---
  *
  * 4000  ---
- *   SDRAM
+ *   SDRAM (alias)
+ * 3000  ---
+ *   SDRAM (alias)
+ * 2000  ---
+ *   SDRAM (alias)
  * 1000  ---
+ *   SDRAM
+ *   ---
  */   
 
 /*



CVS commit: src/sys/arch/arm/xscale

2020-02-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Feb  4 05:16:18 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: ixp425_if_npe.c

Log Message:
Add a comment that ifmedia_fini() should be used here someday.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/xscale/ixp425_if_npe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_if_npe.c
diff -u src/sys/arch/arm/xscale/ixp425_if_npe.c:1.45 src/sys/arch/arm/xscale/ixp425_if_npe.c:1.46
--- src/sys/arch/arm/xscale/ixp425_if_npe.c:1.45	Wed Jan 29 06:05:31 2020
+++ src/sys/arch/arm/xscale/ixp425_if_npe.c	Tue Feb  4 05:16:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_if_npe.c,v 1.45 2020/01/29 06:05:31 thorpej Exp $ */
+/*	$NetBSD: ixp425_if_npe.c,v 1.46 2020/02/04 05:16:18 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2006 Sam Leffler.  All rights reserved.
@@ -28,7 +28,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.45 2020/01/29 06:05:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.46 2020/02/04 05:16:18 thorpej Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -671,6 +671,7 @@ npe_deactivate(struct npe_softc *sc);
 	npe_dma_destroy(sc, &sc->txdma);
 	npe_dma_destroy(sc, &sc->rxdma);
 	bus_generic_detach(sc->sc_dev);
+	XXX ifmedia_fini somewhere
 	if (sc->sc_mii)
 		device_delete_child(sc->sc_dev, sc->sc_mii);
 #if 0



CVS commit: src/sys/arch/arm/xscale

2020-01-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 30 13:07:18 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: ixp425-fw.README

Log Message:
Update the URL for IPL_ixp400NpeLibrary-2_4.zip.  Note the URL For
IPL_ixp400NpeLibraryWithCrypto-2_4.zip for reference purposes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/ixp425-fw.README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425-fw.README
diff -u src/sys/arch/arm/xscale/ixp425-fw.README:1.4 src/sys/arch/arm/xscale/ixp425-fw.README:1.5
--- src/sys/arch/arm/xscale/ixp425-fw.README:1.4	Fri Feb 10 23:11:30 2017
+++ src/sys/arch/arm/xscale/ixp425-fw.README	Thu Jan 30 13:07:18 2020
@@ -1,4 +1,4 @@
-$NetBSD: ixp425-fw.README,v 1.4 2017/02/10 23:11:30 tnn Exp $
+$NetBSD: ixp425-fw.README,v 1.5 2020/01/30 13:07:18 thorpej Exp $
 
 IXP425 NPE Microcode
 
@@ -24,7 +24,7 @@ You must grab the NPE microcode from her
 SHA1 (IPL_ixp400NpeLibrary-3_0.zip) = dda6b27265e6db3dfec68361644197c0f311a07b
 
 or the older version which is archived here:
- https://downloads.openwrt.org/sources/IPL_ixp400NpeLibrary-2_4.zip
+ https://mirror2.openwrt.org/sources/IPL_ixp400NpeLibrary-2_4.zip
 
 SHA1 (IPL_ixp400NpeLibrary-2_4.zip) = abf1562e750e16e6f9baf9892a59640f863a693e
 
@@ -32,6 +32,11 @@ Select the "Download (without Crypto)" l
 section. Note that there is no benefit in selecting the "with Cypto"
 microcode at this time since NetBSD does not support it.
 
+For refrence, the "with Crypto" version is available here:
+  https://downloads.openwrt.org/sources/IPL_ixp400NpeLibraryWithCrypto-2_4.zip
+
+SHA1(IPL_ixp400NpeLibraryWithCrypto-2_4.zip)= 48beb80564fbbb7fb7861188cad26e896b5a5afc
+
 Note: At the time of writing (February 2017), the NPE Microcode is at
 version 3.0. However, the last known microcode version to work is 2.4.
 



CVS commit: src/sys/arch/arm/xscale

2020-01-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan  2 22:27:15 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_rtc.c

Log Message:
In the wristwatch case, use todr_gettime_ymdhms / todr_settime_ymdhms.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/pxa2x0_rtc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_rtc.c
diff -u src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.6 src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.7
--- src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.6	Sat Oct 27 17:17:42 2012
+++ src/sys/arch/arm/xscale/pxa2x0_rtc.c	Thu Jan  2 22:27:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_rtc.c,v 1.6 2012/10/27 17:17:42 chs Exp $	*/
+/*	$NetBSD: pxa2x0_rtc.c,v 1.7 2020/01/02 22:27:15 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2007 NONAKA Kimihiro 
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_rtc.c,v 1.6 2012/10/27 17:17:42 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_rtc.c,v 1.7 2020/01/02 22:27:15 thorpej Exp $");
 
 #include 
 #include 
@@ -63,9 +63,8 @@ CFATTACH_DECL_NEW(pxartc, sizeof(struct 
 /* todr(9) interface */
 static int pxartc_todr_gettime(todr_chip_handle_t, struct timeval *);
 static int pxartc_todr_settime(todr_chip_handle_t, struct timeval *);
-
-static int pxartc_wristwatch_read(struct pxartc_softc *,struct clock_ymdhms *);
-static int pxartc_wristwatch_write(struct pxartc_softc *,struct clock_ymdhms *);
+static int pxartc_wristwatch_gettime(todr_chip_handle_t, struct clock_ymdhms *);
+static int pxartc_wristwatch_settime(todr_chip_handle_t, struct clock_ymdhms *);
 
 static int
 pxartc_match(device_t parent, cfdata_t cf, void *aux)
@@ -100,17 +99,19 @@ pxartc_attach(device_t parent, device_t 
 		return;
 	}
 
+	memset(&sc->sc_todr, 0, sizeof(sc->sc_todr));
+	sc->sc_todr.cookie = sc;
 	if (pxa->pxa_size == PXA270_RTC_SIZE) {
 		aprint_normal("%s: using wristwatch register\n",
 		device_xname(sc->sc_dev));
 		sc->sc_flags |= FLAG_WRISTWATCH;
+		sc->sc_todr.todr_gettime_ymdhms = pxartc_wristwatch_gettime;
+		sc->sc_todr.todr_settime_ymdhms = pxartc_wristwatch_settime;
+	} else {
+		sc->sc_todr.todr_gettime = pxartc_todr_gettime;
+		sc->sc_todr.todr_settime = pxartc_todr_settime;
 	}
 
-	sc->sc_todr.cookie = sc;
-	sc->sc_todr.todr_gettime = pxartc_todr_gettime;
-	sc->sc_todr.todr_settime = pxartc_todr_settime;
-	sc->sc_todr.todr_setwen = NULL;
-
 	todr_attach(&sc->sc_todr);
 }
 
@@ -118,30 +119,18 @@ static int
 pxartc_todr_gettime(todr_chip_handle_t ch, struct timeval *tv)
 {
 	struct pxartc_softc *sc = ch->cookie;
-	struct clock_ymdhms dt;
 
-	if ((sc->sc_flags & FLAG_WRISTWATCH) == 0) {
-		tv->tv_sec = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR);
-		tv->tv_usec = 0;
+	tv->tv_sec = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR);
+	tv->tv_usec = 0;
 #ifdef PXARTC_DEBUG
-		DPRINTF(("%s: RCNR = %08llx\n", device_xname(sc->sc_dev),
-		tv->tv_sec));
-		clock_secs_to_ymdhms(tv->tv_sec, &dt);
-		DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
-		device_xname(sc->sc_dev),
-		dt.dt_year, dt.dt_mon, dt.dt_day,
-		dt.dt_hour, dt.dt_min, dt.dt_sec));
+	DPRINTF(("%s: RCNR = %08llx\n", device_xname(sc->sc_dev),
+	tv->tv_sec));
+	clock_secs_to_ymdhms(tv->tv_sec, &dt);
+	DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
+	device_xname(sc->sc_dev),
+	dt.dt_year, dt.dt_mon, dt.dt_day,
+	dt.dt_hour, dt.dt_min, dt.dt_sec));
 #endif
-		return 0;
-	}
-
-	memset(&dt, 0, sizeof(dt));
-
-	if (pxartc_wristwatch_read(sc, &dt) == 0)
-		return -1;
-
-	tv->tv_sec = clock_ymdhms_to_secs(&dt);
-	tv->tv_usec = 0;
 	return 0;
 }
 
@@ -149,21 +138,19 @@ static int
 pxartc_todr_settime(todr_chip_handle_t ch, struct timeval *tv)
 {
 	struct pxartc_softc *sc = ch->cookie;
-	struct clock_ymdhms dt;
 
-	if ((sc->sc_flags & FLAG_WRISTWATCH) == 0) {
 #ifdef PXARTC_DEBUG
-		DPRINTF(("%s: RCNR = %08llx\n", device_xname(sc->sc_dev),
-		tv->tv_sec));
-		clock_secs_to_ymdhms(tv->tv_sec, &dt);
-		DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
-		device_xname(sc->sc_dev),
-		dt.dt_year, dt.dt_mon, dt.dt_day,
-		dt.dt_hour, dt.dt_min, dt.dt_sec));
+	DPRINTF(("%s: RCNR = %08llx\n", device_xname(sc->sc_dev),
+	tv->tv_sec));
+	clock_secs_to_ymdhms(tv->tv_sec, &dt);
+	DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
+	device_xname(sc->sc_dev),
+	dt.dt_year, dt.dt_mon, dt.dt_day,
+	dt.dt_hour, dt.dt_min, dt.dt_sec));
 #endif
-		bus_space_write_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR, tv->tv_sec);
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR, tv->tv_sec);
 #ifdef PXARTC_DEBUG
-		{
+	{
 		uint32_t cntr;
 		delay(1);
 		cntr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR);
@@ -174,25 +161,20 @@ pxartc_todr_settime(todr_chip_handle_t c
 		device_xname(sc->sc_dev),
 		dt.dt_year, dt.dt_mon, dt.dt_day,
 		dt.dt_hour, dt.dt_min, dt.dt_sec));
-		}
-#endif

CVS commit: src/sys/arch/arm/xscale

2019-04-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 24 10:40:19 UTC 2019

Modified Files:
src/sys/arch/arm/xscale: ixp425_if_npe.c

Log Message:
 This driver uses MII(4) and have hook SIOCGIFMEDIA which just pass to
ifmedia_ioctl(), the hook is not required because ether_ioctl has it
(if_ethersubr.c rev. 1.160). This driver might require some additional fixes
for SIOCSIFMTU and other ioctl()s.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/xscale/ixp425_if_npe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_if_npe.c
diff -u src/sys/arch/arm/xscale/ixp425_if_npe.c:1.37 src/sys/arch/arm/xscale/ixp425_if_npe.c:1.38
--- src/sys/arch/arm/xscale/ixp425_if_npe.c:1.37	Tue Mar  5 08:25:02 2019
+++ src/sys/arch/arm/xscale/ixp425_if_npe.c	Wed Apr 24 10:40:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_if_npe.c,v 1.37 2019/03/05 08:25:02 msaitoh Exp $ */
+/*	$NetBSD: ixp425_if_npe.c,v 1.38 2019/04/24 10:40:18 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2006 Sam Leffler.  All rights reserved.
@@ -28,7 +28,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.37 2019/03/05 08:25:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.38 2019/04/24 10:40:18 msaitoh Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -1421,7 +1421,6 @@ npeioctl(struct ifnet *ifp, u_long cmd, 
 
 	switch (cmd) {
 	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA:
 #if 0 /* not yet */
 		/* Flow control requires full-duplex mode. */
 		if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||



CVS commit: src/sys/arch/arm/xscale

2019-03-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Mar 17 06:36:22 UTC 2019

Modified Files:
src/sys/arch/arm/xscale: iopaau.c iopaaureg.h

Log Message:
Hard-align the fields of the structures with __aligned(32), and pass ioff=0
in the pool cache.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/xscale/iopaau.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/iopaaureg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/iopaau.c
diff -u src/sys/arch/arm/xscale/iopaau.c:1.17 src/sys/arch/arm/xscale/iopaau.c:1.18
--- src/sys/arch/arm/xscale/iopaau.c:1.17	Sun Feb 12 16:31:01 2012
+++ src/sys/arch/arm/xscale/iopaau.c	Sun Mar 17 06:36:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: iopaau.c,v 1.17 2012/02/12 16:31:01 matt Exp $	*/
+/*	$NetBSD: iopaau.c,v 1.18 2019/03/17 06:36:22 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iopaau.c,v 1.17 2012/02/12 16:31:01 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iopaau.c,v 1.18 2019/03/17 06:36:22 maxv Exp $");
 
 #include 
 #include 
@@ -647,13 +647,13 @@ iopaau_attach(struct iopaau_softc *sc)
 
 	/*
 	 * Initialize global resources.  Ok to do here, since there's
-	 * only one AAU.
+	 * only one AAU.  The structures are 32-byte aligned.
 	 */
 	iopaau_desc_4_cache = pool_cache_init(sizeof(struct aau_desc_4),
-	8 * 4, offsetof(struct aau_desc_4, d_nda), 0, "aaud4pl",
+	8 * 4, 0, 0, "aaud4pl",
 	NULL, IPL_VM, iopaau_desc_ctor, NULL, NULL);
 	iopaau_desc_8_cache = pool_cache_init(sizeof(struct aau_desc_8),
-	8 * 4, offsetof(struct aau_desc_8, d_nda), 0, "aaud8pl",
+	8 * 4, 0, 0, "aaud8pl",
 	NULL, IPL_VM, iopaau_desc_ctor, NULL, NULL);
 
 	/* Register us with dmover. */

Index: src/sys/arch/arm/xscale/iopaaureg.h
diff -u src/sys/arch/arm/xscale/iopaaureg.h:1.3 src/sys/arch/arm/xscale/iopaaureg.h:1.4
--- src/sys/arch/arm/xscale/iopaaureg.h:1.3	Sat Aug  3 21:58:56 2002
+++ src/sys/arch/arm/xscale/iopaaureg.h	Sun Mar 17 06:36:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: iopaaureg.h,v 1.3 2002/08/03 21:58:56 thorpej Exp $	*/
+/*	$NetBSD: iopaaureg.h,v 1.4 2019/03/17 06:36:22 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -61,7 +61,7 @@ struct aau_desc_4 {
 	uint32_t d_pa;			/* our physical address */
 
 	/* Hardware portion -- must be 32-byte aligned. */
-	uint32_t	d_nda;		/* next descriptor address */
+	uint32_t	d_nda __aligned(32); /* next descriptor address */
 	uint32_t	d_sar[4];	/* source address */
 	uint32_t	d_dar;		/* destination address */
 	uint32_t	d_bc;		/* byte count */
@@ -73,7 +73,7 @@ struct aau_desc_8 {
 	uint32_t d_pa;			/* our physical address */
 
 	/* Hardware portion -- must be 32-byte aligned. */
-	uint32_t	d_nda;		/* next descriptor address */
+	uint32_t	d_nda __aligned(32); /* next descriptor address */
 	uint32_t	d_sar[4];	/* source address */
 	uint32_t	d_dar;		/* destination address */
 	uint32_t	d_bc;		/* byte count */
@@ -87,7 +87,7 @@ struct aau_desc_16 {
 	uint32_t d_pa;			/* our physical address */
 
 	/* Hardware portion -- must be 32-byte aligned. */
-	uint32_t	d_nda;		/* next descriptor address */
+	uint32_t	d_nda __aligned(32); /* next descriptor address */
 	uint32_t	d_sar[4];	/* source address */
 	uint32_t	d_dar;		/* destination address */
 	uint32_t	d_bc;		/* byte count */
@@ -104,7 +104,7 @@ struct aau_desc_32 {
 	uint32_t d_pa;			/* our physical address */
 
 	/* Hardware portion -- must be 32-byte aligned. */
-	uint32_t	d_nda;		/* next descriptor address */
+	uint32_t	d_nda __aligned(32); /* next descriptor address */
 	uint32_t	d_sar[4];	/* source address */
 	uint32_t	d_dar;		/* destination address */
 	uint32_t	d_bc;		/* byte count */



CVS commit: src/sys/arch/arm/xscale

2018-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov 21 19:03:18 UTC 2018

Modified Files:
src/sys/arch/arm/xscale: i80321_space.c

Log Message:
further de-cargocult the new mmap() methods


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/xscale/i80321_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_space.c
diff -u src/sys/arch/arm/xscale/i80321_space.c:1.17 src/sys/arch/arm/xscale/i80321_space.c:1.18
--- src/sys/arch/arm/xscale/i80321_space.c:1.17	Wed Nov 21 09:49:39 2018
+++ src/sys/arch/arm/xscale/i80321_space.c	Wed Nov 21 19:03:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_space.c,v 1.17 2018/11/21 09:49:39 thorpej Exp $	*/
+/*	$NetBSD: i80321_space.c,v 1.18 2018/11/21 19:03:18 macallan Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.17 2018/11/21 09:49:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.18 2018/11/21 19:03:18 macallan Exp $");
 
 #include 
 #include 
@@ -306,9 +306,6 @@ i80321_io_bs_mmap(void *t, bus_addr_t ad
 	} else
 		return (-1);
 
-	if ((bpa) >= (busbase + VERDE_OUT_XLATE_IO_WIN_SIZE))
-		return (-1);
-
 	return (arm_btop(winpaddr + (bpa - busbase)));
 }
 
@@ -460,9 +457,6 @@ i80321_mem_bs_mmap(void *t, bus_addr_t a
 		physbase = VERDE_OUT_DIRECT_WIN_BASE;
 	} else
 		return (-1);
-	if (bpa >= (VERDE_OUT_DIRECT_WIN_BASE +
-	VERDE_OUT_DIRECT_WIN_SIZE))
-		return (-1);
 #else
 	if (bpa >= sc->sc_owin[0].owin_xlate_lo &&
 	bpa < (sc->sc_owin[0].owin_xlate_lo +
@@ -471,8 +465,6 @@ i80321_mem_bs_mmap(void *t, bus_addr_t a
 		physbase = sc->sc_iwin[1].iwin_xlate;
 	} else
 		return (-1);
-	if (bpa >= (busbase + VERDE_OUT_XLATE_MEM_WIN_SIZE))
-		return (-1);
 #endif
 
 	pa = trunc_page((bpa - busbase) + physbase);



CVS commit: src/sys/arch/arm/xscale

2018-11-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Nov 21 09:49:39 UTC 2018

Modified Files:
src/sys/arch/arm/xscale: i80321_space.c

Log Message:
EINVAL (22) is a valid return value for ARM mmap routines; we need to
return -1 for invalid mmap attempts.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/xscale/i80321_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_space.c
diff -u src/sys/arch/arm/xscale/i80321_space.c:1.16 src/sys/arch/arm/xscale/i80321_space.c:1.17
--- src/sys/arch/arm/xscale/i80321_space.c:1.16	Sun Nov 18 06:28:39 2018
+++ src/sys/arch/arm/xscale/i80321_space.c	Wed Nov 21 09:49:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_space.c,v 1.16 2018/11/18 06:28:39 macallan Exp $	*/
+/*	$NetBSD: i80321_space.c,v 1.17 2018/11/21 09:49:39 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.16 2018/11/18 06:28:39 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.17 2018/11/21 09:49:39 thorpej Exp $");
 
 #include 
 #include 
@@ -304,10 +304,10 @@ i80321_io_bs_mmap(void *t, bus_addr_t ad
 		busbase = sc->sc_ioout_xlate;
 		winpaddr = VERDE_OUT_XLATE_IO_WIN0_BASE;		
 	} else
-		return (EINVAL);
+		return (-1);
 
 	if ((bpa) >= (busbase + VERDE_OUT_XLATE_IO_WIN_SIZE))
-		return (EINVAL);
+		return (-1);
 
 	return (arm_btop(winpaddr + (bpa - busbase)));
 }
@@ -459,10 +459,10 @@ i80321_mem_bs_mmap(void *t, bus_addr_t a
 		busbase = VERDE_OUT_DIRECT_WIN_BASE;
 		physbase = VERDE_OUT_DIRECT_WIN_BASE;
 	} else
-		return (EINVAL);
+		return (-1);
 	if (bpa >= (VERDE_OUT_DIRECT_WIN_BASE +
 	VERDE_OUT_DIRECT_WIN_SIZE))
-		return (EINVAL);
+		return (-1);
 #else
 	if (bpa >= sc->sc_owin[0].owin_xlate_lo &&
 	bpa < (sc->sc_owin[0].owin_xlate_lo +
@@ -470,9 +470,9 @@ i80321_mem_bs_mmap(void *t, bus_addr_t a
 		busbase = sc->sc_owin[0].owin_xlate_lo;
 		physbase = sc->sc_iwin[1].iwin_xlate;
 	} else
-		return (EINVAL);
+		return (-1);
 	if (bpa >= (busbase + VERDE_OUT_XLATE_MEM_WIN_SIZE))
-		return (EINVAL);
+		return (-1);
 #endif
 
 	pa = trunc_page((bpa - busbase) + physbase);



CVS commit: src/sys/arch/arm/xscale

2018-11-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sun Nov 18 06:28:39 UTC 2018

Modified Files:
src/sys/arch/arm/xscale: i80321_space.c

Log Message:
- support *_mmap()
- support BUS_SPACE_MAP_PREFETCHABLE for memory spaces
- fill in *_stream methods if needed
With this Xorg with wsfb works on iyonix. The nv driver still crashes ( and
needs options INSECURE ), something seems to be wrong with accessing IO space.
But, progress.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/xscale/i80321_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_space.c
diff -u src/sys/arch/arm/xscale/i80321_space.c:1.15 src/sys/arch/arm/xscale/i80321_space.c:1.16
--- src/sys/arch/arm/xscale/i80321_space.c:1.15	Fri Mar 16 17:56:32 2018
+++ src/sys/arch/arm/xscale/i80321_space.c	Sun Nov 18 06:28:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_space.c,v 1.15 2018/03/16 17:56:32 ryo Exp $	*/
+/*	$NetBSD: i80321_space.c,v 1.16 2018/11/18 06:28:39 macallan Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.15 2018/03/16 17:56:32 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.16 2018/11/18 06:28:39 macallan Exp $");
 
 #include 
 #include 
@@ -94,36 +94,84 @@ const struct bus_space i80321_bs_tag_tem
 	.bs_r_4 = generic_bs_r_4,
 	.bs_r_8 = bs_notimpl_bs_r_8,
 
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* read (single, stream) */
+	.bs_r_1_s = generic_bs_r_1,
+	.bs_r_2_s = generic_armv4_bs_r_2,
+	.bs_r_4_s = generic_bs_r_4,
+	.bs_r_8_s = bs_notimpl_bs_r_8,
+#endif
+
 	/* read multiple */
 	.bs_rm_1 = generic_bs_rm_1,
 	.bs_rm_2 = generic_armv4_bs_rm_2,
 	.bs_rm_4 = generic_bs_rm_4,
 	.bs_rm_8 = bs_notimpl_bs_rm_8,
 
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* read multiple, stream */
+	.bs_rm_1_s = generic_bs_rm_1,
+	.bs_rm_2_s = generic_armv4_bs_rm_2,
+	.bs_rm_4_s = generic_bs_rm_4,
+	.bs_rm_8_s = bs_notimpl_bs_rm_8,
+#endif
+
 	/* read region */
 	.bs_rr_1 = generic_bs_rr_1,
 	.bs_rr_2 = generic_armv4_bs_rr_2,
 	.bs_rr_4 = generic_bs_rr_4,
 	.bs_rr_8 = bs_notimpl_bs_rr_8,
 
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* read region, stream */
+	.bs_rr_1_s = generic_bs_rr_1,
+	.bs_rr_2_s = generic_armv4_bs_rr_2,
+	.bs_rr_4_s = generic_bs_rr_4,
+	.bs_rr_8_s = bs_notimpl_bs_rr_8,
+#endif
+
 	/* write (single) */
 	.bs_w_1 = generic_bs_w_1,
 	.bs_w_2 = generic_armv4_bs_w_2,
 	.bs_w_4 = generic_bs_w_4,
 	.bs_w_8 = bs_notimpl_bs_w_8,
 
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* write (single, stream) */
+	.bs_w_1_s = generic_bs_w_1,
+	.bs_w_2_s = generic_armv4_bs_w_2,
+	.bs_w_4_s = generic_bs_w_4,
+	.bs_w_8_s = bs_notimpl_bs_w_8,
+#endif
+
 	/* write multiple */
 	.bs_wm_1 = generic_bs_wm_1,
 	.bs_wm_2 = generic_armv4_bs_wm_2,
 	.bs_wm_4 = generic_bs_wm_4,
 	.bs_wm_8 = bs_notimpl_bs_wm_8,
 
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* write multiple, stream */
+	.bs_wm_1_s = generic_bs_wm_1,
+	.bs_wm_2_s = generic_armv4_bs_wm_2,
+	.bs_wm_4_s = generic_bs_wm_4,
+	.bs_wm_8_s = bs_notimpl_bs_wm_8,
+#endif
+
 	/* write region */
 	.bs_wr_1 = generic_bs_wr_1,
 	.bs_wr_2 = generic_armv4_bs_wr_2,
 	.bs_wr_4 = generic_bs_wr_4,
 	.bs_wr_8 = bs_notimpl_bs_wr_8,
 
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* write region, stream */
+	.bs_wr_1_s = generic_bs_wr_1,
+	.bs_wr_2_s = generic_armv4_bs_wr_2,
+	.bs_wr_4_s = generic_bs_wr_4,
+	.bs_wr_8_s = bs_notimpl_bs_wr_8,
+#endif
+
 	/* set multiple */
 	.bs_sm_1 = bs_notimpl_bs_sm_1,
 	.bs_sm_2 = bs_notimpl_bs_sm_2,
@@ -164,6 +212,7 @@ i80321_io_bs_init(bus_space_tag_t bs, vo
 	bs->bs_free = i80321_io_bs_free;
 
 	bs->bs_vaddr = i80321_io_bs_vaddr;
+	bs->bs_mmap = i80321_io_bs_mmap;
 }
 
 void
@@ -177,7 +226,6 @@ i80321_mem_bs_init(bus_space_tag_t bs, v
 	bs->bs_unmap = i80321_mem_bs_unmap;
 	bs->bs_alloc = i80321_mem_bs_alloc;
 	bs->bs_free = i80321_mem_bs_free;
-
 	bs->bs_mmap = i80321_mem_bs_mmap;
 }
 
@@ -245,6 +293,25 @@ i80321_io_bs_map(void *t, bus_addr_t bpa
 	return (0);
 }
 
+paddr_t
+i80321_io_bs_mmap(void *t, bus_addr_t addr, off_t off, int prot, int flags)
+{
+	struct i80321_softc *sc = t;
+	paddr_t bpa = addr + off, winpaddr, busbase;
+
+	if (bpa >= sc->sc_ioout_xlate &&
+	bpa < (sc->sc_ioout_xlate + VERDE_OUT_XLATE_IO_WIN_SIZE)) {
+		busbase = sc->sc_ioout_xlate;
+		winpaddr = VERDE_OUT_XLATE_IO_WIN0_BASE;		
+	} else
+		return (EINVAL);
+
+	if ((bpa) >= (busbase + VERDE_OUT_XLATE_IO_WIN_SIZE))
+		return (EINVAL);
+
+	return (arm_btop(winpaddr + (bpa - busbase)));
+}
+
 void
 i80321_io_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size)
 {
@@ -334,7 +401,9 @@ i80321_mem_bs_map(void *t, bus_addr_t bp
 	for (; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) {
 		pmap_enter(pmap_kernel(), va, pa,
 		VM_PROT_READ | VM_PROT_WRITE,
-		VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED);
+		VM_PROT_READ | VM_PROT_W

CVS commit: src/sys/arch/arm/xscale

2018-03-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar  9 17:14:58 UTC 2018

Modified Files:
src/sys/arch/arm/xscale: files.pxa2x0

Log Message:
fix device attributes


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/xscale/files.pxa2x0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/files.pxa2x0
diff -u src/sys/arch/arm/xscale/files.pxa2x0:1.19 src/sys/arch/arm/xscale/files.pxa2x0:1.20
--- src/sys/arch/arm/xscale/files.pxa2x0:1.19	Fri Jun 16 18:39:34 2017
+++ src/sys/arch/arm/xscale/files.pxa2x0	Fri Mar  9 12:14:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pxa2x0,v 1.19 2017/06/16 22:39:34 pgoyette Exp $
+#	$NetBSD: files.pxa2x0,v 1.20 2018/03/09 17:14:57 christos Exp $
 #
 # Configuration info for Intel PXA2[751]0 CPU support
 #
@@ -78,11 +78,11 @@ device	pxapcic: pcmciabus
 file	arch/arm/xscale/pxa2x0_pcic.c		pxapcic
 
 # Inter-Integrated Circuit controller
-device	pxaiic {}
+device	pxaiic
 file	arch/arm/xscale/pxa2x0_i2c.c		pxaiic
 
 # Inter-IC Sound controller
-device	pxaiis {}
+device	pxaiis
 file	arch/arm/xscale/pxa2x0_i2s.c		pxaiis
 
 # PXA2x0 real time clock



CVS commit: src/sys/arch/arm/xscale

2017-02-10 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Feb 10 23:11:30 UTC 2017

Modified Files:
src/sys/arch/arm/xscale: ixp425-fw.README

Log Message:
remove misleading comment about version 3.0 microcode

The last known microcode to work is 2.4. Version 3.0 changes
the header signature and fails with "block too big for NPE memory".
Provide a backup download URL since intel removed version < 3.0.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/ixp425-fw.README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425-fw.README
diff -u src/sys/arch/arm/xscale/ixp425-fw.README:1.3 src/sys/arch/arm/xscale/ixp425-fw.README:1.4
--- src/sys/arch/arm/xscale/ixp425-fw.README:1.3	Fri Feb 10 20:30:39 2017
+++ src/sys/arch/arm/xscale/ixp425-fw.README	Fri Feb 10 23:11:30 2017
@@ -1,4 +1,4 @@
-$NetBSD: ixp425-fw.README,v 1.3 2017/02/10 20:30:39 tnn Exp $
+$NetBSD: ixp425-fw.README,v 1.4 2017/02/10 23:11:30 tnn Exp $
 
 IXP425 NPE Microcode
 
@@ -21,17 +21,19 @@ You must grab the NPE microcode from her
 
  https://downloadcenter.intel.com/download/13757/IXP400-Software-NPE-Microcode-v3-0-without-crypto
 
+SHA1 (IPL_ixp400NpeLibrary-3_0.zip) = dda6b27265e6db3dfec68361644197c0f311a07b
+
+or the older version which is archived here:
+ https://downloads.openwrt.org/sources/IPL_ixp400NpeLibrary-2_4.zip
+
+SHA1 (IPL_ixp400NpeLibrary-2_4.zip) = abf1562e750e16e6f9baf9892a59640f863a693e
+
 Select the "Download (without Crypto)" link in the "NPE Microcode"
 section. Note that there is no benefit in selecting the "with Cypto"
 microcode at this time since NetBSD does not support it.
 
-Note: At the time of writing (December 2006), the NPE Microcode is at
-version 2.3. Newer versions may not work with NetBSD's native Ethernet
-driver. If this is the case, let us know via send-pr(1).
-
-Update: As of March 2010, NPE Microcode is at version 3.0 and has been
-confirmed to work. See:
- http://mail-index.netbsd.org/port-arm/2010/03/24/msg000912.html
+Note: At the time of writing (February 2017), the NPE Microcode is at
+version 3.0. However, the last known microcode version to work is 2.4.
 
 After clicking the link, you will be directed to a click-through license
 page. Assuming you agree to the terms of the license (and you are
@@ -42,7 +44,7 @@ Extract the microcode under any decent U
 command provided with the OS, or with the version included in the pkgsrc
 collection under archivers/unzip:
 
-	$ unzip IPL_ixp400NpeLibrary-3_0.zip
+	$ unzip IPL_ixp400NpeLibrary-2_4.zip
 
 Next, you must generate a microcode image suitable for inclusion in the
 NetBSD kernel.



CVS commit: src/sys/arch/arm/xscale

2017-02-10 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Feb 10 20:30:39 UTC 2017

Modified Files:
src/sys/arch/arm/xscale: ixp425-fw.README

Log Message:
update firmware download URL


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/xscale/ixp425-fw.README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425-fw.README
diff -u src/sys/arch/arm/xscale/ixp425-fw.README:1.2 src/sys/arch/arm/xscale/ixp425-fw.README:1.3
--- src/sys/arch/arm/xscale/ixp425-fw.README:1.2	Wed Mar 24 13:55:04 2010
+++ src/sys/arch/arm/xscale/ixp425-fw.README	Fri Feb 10 20:30:39 2017
@@ -1,4 +1,4 @@
-$NetBSD: ixp425-fw.README,v 1.2 2010/03/24 13:55:04 scw Exp $
+$NetBSD: ixp425-fw.README,v 1.3 2017/02/10 20:30:39 tnn Exp $
 
 IXP425 NPE Microcode
 
@@ -19,7 +19,7 @@ through license.
 
 You must grab the NPE microcode from here:
 
- http://www.intel.com/design/network/products/npfamily/download_ixp400.htm
+ https://downloadcenter.intel.com/download/13757/IXP400-Software-NPE-Microcode-v3-0-without-crypto
 
 Select the "Download (without Crypto)" link in the "NPE Microcode"
 section. Note that there is no benefit in selecting the "with Cypto"
@@ -42,7 +42,7 @@ Extract the microcode under any decent U
 command provided with the OS, or with the version included in the pkgsrc
 collection under archivers/unzip:
 
-	$ unzip IPL_ixp400NpeLibrary-2_3.zip
+	$ unzip IPL_ixp400NpeLibrary-3_0.zip
 
 Next, you must generate a microcode image suitable for inclusion in the
 NetBSD kernel.



CVS commit: src/sys/arch/arm/xscale

2015-06-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun 28 15:13:29 UTC 2015

Modified Files:
src/sys/arch/arm/xscale: ixp425_if_npe.c

Log Message:
Initialize 'error'.

Can't test, but obvious enough apparently.

Found by Brainy.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/xscale/ixp425_if_npe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_if_npe.c
diff -u src/sys/arch/arm/xscale/ixp425_if_npe.c:1.28 src/sys/arch/arm/xscale/ixp425_if_npe.c:1.29
--- src/sys/arch/arm/xscale/ixp425_if_npe.c:1.28	Mon Apr 13 21:18:41 2015
+++ src/sys/arch/arm/xscale/ixp425_if_npe.c	Sun Jun 28 15:13:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_if_npe.c,v 1.28 2015/04/13 21:18:41 riastradh Exp $ */
+/*	$NetBSD: ixp425_if_npe.c,v 1.29 2015/06/28 15:13:28 maxv Exp $ */
 
 /*-
  * Copyright (c) 2006 Sam Leffler.  All rights reserved.
@@ -28,7 +28,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.28 2015/04/13 21:18:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.29 2015/06/28 15:13:28 maxv Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -602,8 +602,9 @@ npe_activate(struct npe_softc *sc)
 		return error;
 	}
 
-	if (bus_dmamap_load(sc->sc_dt, sc->sc_stats_map, sc->sc_stats,
-	sizeof(struct npestats), NULL, BUS_DMA_NOWAIT) != 0) {
+	error = bus_dmamap_load(sc->sc_dt, sc->sc_stats_map, sc->sc_stats,
+	sizeof(struct npestats), NULL, BUS_DMA_NOWAIT);
+	if (error) {
 		aprint_error_dev(sc->sc_dev,
 		"unable to %s for %s, error %u\n",
 		"load map", "stats block", error);



CVS commit: src/sys/arch/arm/xscale

2015-02-05 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Feb  5 13:27:18 UTC 2015

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_dmac.c

Log Message:
Don't write DMAC_DINT register on PXA270, because read-only register.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/xscale/pxa2x0_dmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_dmac.c
diff -u src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.12 src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.13
--- src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.12	Mon Nov 12 18:00:38 2012
+++ src/sys/arch/arm/xscale/pxa2x0_dmac.c	Thu Feb  5 13:27:18 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_dmac.c,v 1.12 2012/11/12 18:00:38 skrll Exp $	*/
+/*	$NetBSD: pxa2x0_dmac.c,v 1.13 2015/02/05 13:27:18 nonaka Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -321,8 +321,9 @@ pxadmac_attach(device_t parent, device_t
 		dmac_reg_write(sc, DMAC_DRCMR(i), 0);
 		sc->sc_active[i] = NULL;
 	}
-	dmac_reg_write(sc, DMAC_DINT,
-	dmac_reg_read(sc, DMAC_DINT) & DMAC_DINT_MASK);
+	if (!CPU_IS_PXA270)
+		dmac_reg_write(sc, DMAC_DINT,
+		dmac_reg_read(sc, DMAC_DINT) & DMAC_DINT_MASK);
 
 	/*
 	 * Initialise the request queues
@@ -1212,7 +1213,8 @@ dmac_channel_intr(struct pxadmac_softc *
 	/*
 	 * Clear down the interrupt in the DMA Interrupt Register
 	 */
-	dmac_reg_write(sc, DMAC_DINT, (1u << channel));
+	if (!CPU_IS_PXA270)
+		dmac_reg_write(sc, DMAC_DINT, (1u << channel));
 
 	/*
 	 * If this is a looping request, invoke the 'done' callback and



CVS commit: src/sys/arch/arm/xscale

2014-08-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 14 16:55:02 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: ixp425_npe.c

Log Message:
Remove tautologies.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xscale/ixp425_npe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_npe.c
diff -u src/sys/arch/arm/xscale/ixp425_npe.c:1.10 src/sys/arch/arm/xscale/ixp425_npe.c:1.11
--- src/sys/arch/arm/xscale/ixp425_npe.c:1.10	Thu Mar 20 06:48:54 2014
+++ src/sys/arch/arm/xscale/ixp425_npe.c	Thu Aug 14 16:55:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_npe.c,v 1.10 2014/03/20 06:48:54 skrll Exp $	*/
+/*	$NetBSD: ixp425_npe.c,v 1.11 2014/08/14 16:55:02 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Sam Leffler, Errno Consulting
@@ -62,7 +62,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_npe.c,v 1.10 2014/03/20 06:48:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_npe.c,v 1.11 2014/08/14 16:55:02 joerg Exp $");
 
 /*
  * Intel XScale Network Processing Engine (NPE) support.
@@ -594,13 +594,13 @@ npe_load_stateinfo(struct ixpnpe_softc *
 	IX_NPEDL_OFFSET_STATE_ADDR_CTXT_NUM;
 	
 	/* error-check Context Register No. and Context Number values  */
-	if (!(0 <= reg && reg < IX_NPEDL_CTXT_REG_MAX)) {
+	if (reg >= IX_NPEDL_CTXT_REG_MAX) {
 	printf("%s: invalid Context Register %u\n", device_xname(sc->sc_dev),
 		reg);
 	error = EINVAL;
 	break;
 	}
-	if (!(0 <= cNum && cNum < IX_NPEDL_CTXT_NUM_MAX)) {
+	if (cNum >= IX_NPEDL_CTXT_NUM_MAX) {
 	printf("%s: invalid Context Number %u\n", device_xname(sc->sc_dev),
 	cNum);
 	error = EINVAL;



CVS commit: src/sys/arch/arm/xscale

2014-03-30 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Sun Mar 30 21:52:09 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: becc_pci.c

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/xscale/becc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/becc_pci.c
diff -u src/sys/arch/arm/xscale/becc_pci.c:1.16 src/sys/arch/arm/xscale/becc_pci.c:1.17
--- src/sys/arch/arm/xscale/becc_pci.c:1.16	Sun Mar 30 01:19:20 2014
+++ src/sys/arch/arm/xscale/becc_pci.c	Sun Mar 30 21:52:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: becc_pci.c,v 1.16 2014/03/30 01:19:20 christos Exp $	*/
+/*	$NetBSD: becc_pci.c,v 1.17 2014/03/30 21:52:09 htodd Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.16 2014/03/30 01:19:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.17 2014/03/30 21:52:09 htodd Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -377,7 +377,7 @@ const char *
 becc_pci_intr_string(void *v, pci_intr_handle_t ih, char *buf, size_t len)
 {
 
-	strlcpy(buf, becc_irqnames[ih]), len);
+	strlcpy(buf, becc_irqnames[ih], len);
 	return buf;
 }
 



CVS commit: src/sys/arch/arm/xscale

2014-03-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Mar  2 13:23:17 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: i80321_space.c

Log Message:
Skip a tautologic check if we know it is one.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/xscale/i80321_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_space.c
diff -u src/sys/arch/arm/xscale/i80321_space.c:1.13 src/sys/arch/arm/xscale/i80321_space.c:1.14
--- src/sys/arch/arm/xscale/i80321_space.c:1.13	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/i80321_space.c	Sun Mar  2 13:23:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_space.c,v 1.13 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: i80321_space.c,v 1.14 2014/03/02 13:23:16 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.13 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.14 2014/03/02 13:23:16 joerg Exp $");
 
 #include 
 #include 
@@ -291,7 +291,10 @@ i80321_mem_bs_map(void *t, bus_addr_t bp
 	paddr_t pa, endpa, physbase;
 
 #ifdef I80321_USE_DIRECT_WIN
-	if (bpa >= (VERDE_OUT_DIRECT_WIN_BASE) &&
+	if (
+#if VERDE_OUT_DIRECT_WIN_BASE != 0
+	bpa >= (VERDE_OUT_DIRECT_WIN_BASE) &&
+#endif
 	bpa < (VERDE_OUT_DIRECT_WIN_BASE + VERDE_OUT_DIRECT_WIN_SIZE)) {
 		busbase = VERDE_OUT_DIRECT_WIN_BASE;
 		physbase = VERDE_OUT_DIRECT_WIN_BASE;



CVS commit: src/sys/arch/arm/xscale

2014-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 24 10:50:40 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: ixp425_pci_space.c

Log Message:
Fix compilation


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/xscale/ixp425_pci_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_pci_space.c
diff -u src/sys/arch/arm/xscale/ixp425_pci_space.c:1.12 src/sys/arch/arm/xscale/ixp425_pci_space.c:1.13
--- src/sys/arch/arm/xscale/ixp425_pci_space.c:1.12	Sat Feb 22 20:33:00 2014
+++ src/sys/arch/arm/xscale/ixp425_pci_space.c	Mon Feb 24 10:50:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_pci_space.c,v 1.12 2014/02/22 20:33:00 matt Exp $ */
+/*	$NetBSD: ixp425_pci_space.c,v 1.13 2014/02/24 10:50:40 martin Exp $ */
 
 /*
  * Copyright (c) 2003
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixp425_pci_space.c,v 1.12 2014/02/22 20:33:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_pci_space.c,v 1.13 2014/02/24 10:50:40 martin Exp $");
 
 /*
  * bus_space PCI functions for ixp425
@@ -373,7 +373,7 @@ _pci_io_bs_w_4(void *v, bus_space_handle
 /* mem bs */
 int
 ixp425_pci_mem_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
-	  int cacheable, bus_space_handle_t *bshp)
+	  int flags, bus_space_handle_t *bshp)
 {
 	const struct pmap_devmap	*pd;
 
@@ -403,7 +403,7 @@ ixp425_pci_mem_bs_map(void *t, bus_addr_
 	*bshp = va + offset;
 
 	const int pmapflags =
-	(flag & (BUS_SPACE_MAP_CACHEABLE|BUS_SPACE_MAP_PREFETCHABLE))
+	(flags & (BUS_SPACE_MAP_CACHEABLE|BUS_SPACE_MAP_PREFETCHABLE))
 		? 0
 		: PMAP_NOCACHE;
 



CVS commit: src/sys/arch/arm/xscale

2014-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 24 10:47:46 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: ixp425_if_npe.c

Log Message:
Explicitly include  for now (untill Nick kills it
for real), to make it compile.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/xscale/ixp425_if_npe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_if_npe.c
diff -u src/sys/arch/arm/xscale/ixp425_if_npe.c:1.23 src/sys/arch/arm/xscale/ixp425_if_npe.c:1.24
--- src/sys/arch/arm/xscale/ixp425_if_npe.c:1.23	Sun Jul 22 14:32:50 2012
+++ src/sys/arch/arm/xscale/ixp425_if_npe.c	Mon Feb 24 10:47:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_if_npe.c,v 1.23 2012/07/22 14:32:50 matt Exp $ */
+/*	$NetBSD: ixp425_if_npe.c,v 1.24 2014/02/24 10:47:46 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Sam Leffler.  All rights reserved.
@@ -28,7 +28,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.23 2012/07/22 14:32:50 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.24 2014/02/24 10:47:46 martin Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -57,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: ixp425_if_np
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 



CVS commit: src/sys/arch/arm/xscale

2014-02-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Feb 24 00:32:17 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_space.c

Log Message:
Remove unused variable. Fixes compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/xscale/pxa2x0_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_space.c
diff -u src/sys/arch/arm/xscale/pxa2x0_space.c:1.11 src/sys/arch/arm/xscale/pxa2x0_space.c:1.12
--- src/sys/arch/arm/xscale/pxa2x0_space.c:1.11	Sat Feb 22 20:33:00 2014
+++ src/sys/arch/arm/xscale/pxa2x0_space.c	Mon Feb 24 00:32:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_space.c,v 1.11 2014/02/22 20:33:00 matt Exp $ */
+/*	$NetBSD: pxa2x0_space.c,v 1.12 2014/02/24 00:32:17 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_space.c,v 1.11 2014/02/22 20:33:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_space.c,v 1.12 2014/02/24 00:32:17 msaitoh Exp $");
 
 #include 
 #include 
@@ -174,7 +174,6 @@ pxa2x0_bs_map(void *t, bus_addr_t bpa, b
 {
 	u_long startpa, endpa, pa;
 	vaddr_t va;
-	pt_entry_t *pte;
 	const struct pmap_devmap	*pd;
 
 	if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) {



CVS commit: src/sys/arch/arm/xscale

2014-02-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  5 19:03:45 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: becc_intr.h

Log Message:
put back line accidentally deleted before (hi matt)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/becc_intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/becc_intr.h
diff -u src/sys/arch/arm/xscale/becc_intr.h:1.5 src/sys/arch/arm/xscale/becc_intr.h:1.6
--- src/sys/arch/arm/xscale/becc_intr.h:1.5	Tue Feb  4 13:51:16 2014
+++ src/sys/arch/arm/xscale/becc_intr.h	Wed Feb  5 14:03:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: becc_intr.h,v 1.5 2014/02/04 18:51:16 matt Exp $	*/
+/*	$NetBSD: becc_intr.h,v 1.6 2014/02/05 19:03:45 christos Exp $	*/
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -103,6 +103,7 @@ becc_spllower(int ipl)
 	becc_splx(becc_imask[ipl]);
 	return (old);
 }
+#endif /* __PROG32 */
 
 #if !defined(EVBARM_SPL_NOINLINE)
 



CVS commit: src/sys/arch/arm/xscale

2014-01-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 28 12:22:32 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_lcd.c

Log Message:
Remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/xscale/pxa2x0_lcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.33 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.34
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.33	Wed Jan 11 21:15:46 2012
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c	Tue Jan 28 12:22:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.33 2012/01/11 21:15:46 macallan Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.34 2014/01/28 12:22:32 martin Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.33 2012/01/11 21:15:46 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.34 2014/01/28 12:22:32 martin Exp $");
 
 #include "opt_pxa2x0_lcd.h"
 
@@ -475,8 +475,6 @@ int
 pxa2x0_lcd_new_screen(struct pxa2x0_lcd_softc *sc, int depth,
  struct pxa2x0_lcd_screen **scrpp)
 {
-	bus_space_tag_t iot;
-	bus_space_handle_t ioh;
 	bus_dma_tag_t dma_tag;
 	const struct lcd_panel_geometry *geometry;
 	struct pxa2x0_lcd_screen *scr = NULL;
@@ -487,8 +485,6 @@ pxa2x0_lcd_new_screen(struct pxa2x0_lcd_
 	struct lcd_dma_descriptor *desc;
 	paddr_t buf_pa, desc_pa;
 
-	iot = sc->iot;
-	ioh = sc->ioh;
 	dma_tag = sc->dma_tag;
 	geometry = sc->geometry;
 



CVS commit: src/sys/arch/arm/xscale

2014-01-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 28 12:02:48 UTC 2014

Modified Files:
src/sys/arch/arm/xscale: i80312_pci.c

Log Message:
Remove an unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/xscale/i80312_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80312_pci.c
diff -u src/sys/arch/arm/xscale/i80312_pci.c:1.14 src/sys/arch/arm/xscale/i80312_pci.c:1.15
--- src/sys/arch/arm/xscale/i80312_pci.c:1.14	Sun Aug 18 15:58:20 2013
+++ src/sys/arch/arm/xscale/i80312_pci.c	Tue Jan 28 12:02:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80312_pci.c,v 1.14 2013/08/18 15:58:20 matt Exp $	*/
+/*	$NetBSD: i80312_pci.c,v 1.15 2014/01/28 12:02:48 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80312_pci.c,v 1.14 2013/08/18 15:58:20 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80312_pci.c,v 1.15 2014/01/28 12:02:48 martin Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -83,7 +83,7 @@ i80312_pci_init(pci_chipset_tag_t pc, vo
 	struct i80312_softc *sc = cookie;
 	struct extent *ioext, *memext;
 	pcireg_t binfo;
-	int pbus, sbus;
+	int sbus;
 #endif
 
 	pc->pc_conf_v = cookie;
@@ -107,7 +107,7 @@ i80312_pci_init(pci_chipset_tag_t pc, vo
 	 */
 
 	binfo = bus_space_read_4(sc->sc_st, sc->sc_ppb_sh, PPB_REG_BUSINFO);
-	pbus = PPB_BUSINFO_PRIMARY(binfo);
+	/* pbus = PPB_BUSINFO_PRIMARY(binfo); */
 	sbus = PPB_BUSINFO_SECONDARY(binfo);
 
 	ioext  = extent_create("pciio", sc->sc_sioout_base,



CVS commit: src/sys/arch/arm/xscale

2013-12-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec 17 01:28:56 UTC 2013

Modified Files:
src/sys/arch/arm/xscale: i80321_timer.c

Log Message:
Mark tmr0_read and tmr1_read as unused.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/xscale/i80321_timer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80321_timer.c
diff -u src/sys/arch/arm/xscale/i80321_timer.c:1.20 src/sys/arch/arm/xscale/i80321_timer.c:1.21
--- src/sys/arch/arm/xscale/i80321_timer.c:1.20	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/i80321_timer.c	Tue Dec 17 01:28:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_timer.c,v 1.20 2011/07/01 20:32:51 dyoung Exp $ */
+/*	$NetBSD: i80321_timer.c,v 1.21 2013/12/17 01:28:56 joerg Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_timer.c,v 1.20 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_timer.c,v 1.21 2013/12/17 01:28:56 joerg Exp $");
 
 #include "opt_perfctrs.h"
 #include "opt_i80321.h"
@@ -76,7 +76,7 @@ static uint32_t counts_per_hz;
 
 int	clockhandler(void *);
 
-static inline uint32_t
+__unused static inline uint32_t
 tmr0_read(void)
 {
 	uint32_t rv;
@@ -123,7 +123,7 @@ trr0_write(uint32_t val)
 		: "r" (val));
 }
 
-static inline uint32_t
+__unused static inline uint32_t
 tmr1_read(void)
 {
 	uint32_t rv;



CVS commit: src/sys/arch/arm/xscale

2013-12-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec 17 01:28:04 UTC 2013

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_intr.c

Log Message:
Nuke __raise.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/xscale/pxa2x0_intr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_intr.c
diff -u src/sys/arch/arm/xscale/pxa2x0_intr.c:1.20 src/sys/arch/arm/xscale/pxa2x0_intr.c:1.21
--- src/sys/arch/arm/xscale/pxa2x0_intr.c:1.20	Sun Jul 29 00:07:10 2012
+++ src/sys/arch/arm/xscale/pxa2x0_intr.c	Tue Dec 17 01:28:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_intr.c,v 1.20 2012/07/29 00:07:10 matt Exp $	*/
+/*	$NetBSD: pxa2x0_intr.c,v 1.21 2013/12/17 01:28:04 joerg Exp $	*/
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_intr.c,v 1.20 2012/07/29 00:07:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_intr.c,v 1.21 2013/12/17 01:28:04 joerg Exp $");
 
 #include 
 #include 
@@ -146,14 +146,6 @@ pxa2x0_intr_bootstrap(vaddr_t addr)
 	pxaic_base = addr;
 }
 
-static inline void
-__raise(int ipl)
-{
-
-	if (curcpu()->ci_cpl < ipl)
-		pxa2x0_setipl(ipl);
-}
-
 /*
  * called from irq_entry.
  */



CVS commit: src/sys/arch/arm/xscale

2012-09-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  7 17:11:43 UTC 2012

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_dmac.c

Log Message:
Forgot to commit this.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xscale/pxa2x0_dmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_dmac.c
diff -u src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.10 src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.11
--- src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.10	Sun Jan 29 09:08:04 2012
+++ src/sys/arch/arm/xscale/pxa2x0_dmac.c	Fri Sep  7 17:11:43 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_dmac.c,v 1.10 2012/01/29 09:08:04 tsutsui Exp $	*/
+/*	$NetBSD: pxa2x0_dmac.c,v 1.11 2012/09/07 17:11:43 matt Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -462,20 +462,20 @@ dmac_dmover_attach(struct pxadmac_softc 
 		 * small buffers here, since we set up the DMAC source
 		 * descriptor with 'ds_addr_hold' set to true.
 		 */
-		if (bus_dmamem_alloc(sc->sc_dmat,
-arm_pdcache_line_size, arm_pdcache_line_size, 0,
+		if (bus_dmamem_alloc(sc->sc_dmat, arm_pcache.dcache_line_size,
+arm_pcache.dcache_line_size, 0,
 &ds->ds_zero_seg, 1, &dummy, BUS_DMA_NOWAIT) ||
-		bus_dmamem_alloc(sc->sc_dmat,
-arm_pdcache_line_size, arm_pdcache_line_size, 0,
+		bus_dmamem_alloc(sc->sc_dmat, arm_pcache.dcache_line_size,
+arm_pcache.dcache_line_size, 0,
 &ds->ds_fill_seg, 1, &dummy, BUS_DMA_NOWAIT)) {
 			panic("dmac_dmover_attach: bus_dmamem_alloc failed");
 		}
 
 		if (bus_dmamem_map(sc->sc_dmat, &ds->ds_zero_seg, 1,
-arm_pdcache_line_size, &ds->ds_zero_va,
+arm_pcache.dcache_line_size, &ds->ds_zero_va,
 BUS_DMA_NOWAIT) ||
 		bus_dmamem_map(sc->sc_dmat, &ds->ds_fill_seg, 1,
-arm_pdcache_line_size, &ds->ds_fill_va,
+arm_pcache.dcache_line_size, &ds->ds_fill_va,
 BUS_DMA_NOWAIT)) {
 			panic("dmac_dmover_attach: bus_dmamem_map failed");
 		}
@@ -483,7 +483,7 @@ dmac_dmover_attach(struct pxadmac_softc 
 		/*
 		 * Make sure the zero-fill source buffer really is zero filled
 		 */
-		memset(ds->ds_zero_va, 0, arm_pdcache_line_size);
+		memset(ds->ds_zero_va, 0, arm_pcache.dcache_line_size);
 	}
 
 	dmover_backend_register(&sc->sc_dmover.dd_backend);
@@ -590,7 +590,7 @@ dmac_dmover_run(struct dmover_backend *d
 			 * Simply load up the pre-zeroed source buffer
 			 */
 			if (bus_dmamap_load(sc->sc_dmat, ds->ds_src_dmap,
-			ds->ds_zero_va, arm_pdcache_line_size, NULL,
+			ds->ds_zero_va, arm_pcache.dcache_line_size, NULL,
 			BUS_DMA_NOWAIT | BUS_DMA_STREAMING | BUS_DMA_READ))
 goto error;
 
@@ -607,10 +607,10 @@ dmac_dmover_run(struct dmover_backend *d
 			 * burst size (which is hardcoded to 8 for dmover).
 			 */
 			memset(ds->ds_fill_va, dreq->dreq_immediate[0],
-			arm_pdcache_line_size);
+			arm_pcache.dcache_line_size);
 
 			if (bus_dmamap_load(sc->sc_dmat, ds->ds_src_dmap,
-			ds->ds_fill_va, arm_pdcache_line_size, NULL,
+			ds->ds_fill_va, arm_pcache.dcache_line_size, NULL,
 			BUS_DMA_NOWAIT | BUS_DMA_STREAMING | BUS_DMA_READ))
 goto error;
 



CVS commit: src/sys/arch/arm/xscale

2012-09-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  7 02:11:32 UTC 2012

Modified Files:
src/sys/arch/arm/xscale: becc_pci.c

Log Message:
Fix pci_conf_interrupt fallout.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/xscale/becc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/becc_pci.c
diff -u src/sys/arch/arm/xscale/becc_pci.c:1.11 src/sys/arch/arm/xscale/becc_pci.c:1.12
--- src/sys/arch/arm/xscale/becc_pci.c:1.11	Fri Jan 27 18:52:51 2012
+++ src/sys/arch/arm/xscale/becc_pci.c	Fri Sep  7 02:11:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: becc_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $	*/
+/*	$NetBSD: becc_pci.c,v 1.12 2012/09/07 02:11:32 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.12 2012/09/07 02:11:32 matt Exp $");
 
 #include 
 #include 
@@ -70,6 +70,7 @@ void		becc_pci_decompose_tag(void *, pci
 		int *);
 pcireg_t	becc_pci_conf_read(void *, pcitag_t, int);
 void		becc_pci_conf_write(void *, pcitag_t, int, pcireg_t);
+void		becc_pci_conf_interrupt(void *, int, int, int, int, int *);
 
 int		becc_pci_intr_map(const struct pci_attach_args *,
 		pci_intr_handle_t *);
@@ -103,6 +104,7 @@ becc_pci_init(pci_chipset_tag_t pc, void
 	pc->pc_decompose_tag = becc_pci_decompose_tag;
 	pc->pc_conf_read = becc_pci_conf_read;
 	pc->pc_conf_write = becc_pci_conf_write;
+	pc->pc_conf_interrupt = becc_pci_conf_interrupt;
 
 	pc->pc_intr_v = cookie;
 	pc->pc_intr_map = becc_pci_intr_map;
@@ -139,7 +141,7 @@ becc_pci_init(pci_chipset_tag_t pc, void
 }
 
 void
-pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p)
+becc_pci_conf_interrupt(void *v, int a, int b, int c, int d, int *p)
 {
 }
 



CVS commit: src/sys/arch/arm/xscale

2012-01-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 29 09:08:05 UTC 2012

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_dmac.c

Log Message:
Handle PXA25x specific DMAC constraints.  From kiyohara@.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/xscale/pxa2x0_dmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_dmac.c
diff -u src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.9 src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.10
--- src/sys/arch/arm/xscale/pxa2x0_dmac.c:1.9	Wed Nov 23 23:07:29 2011
+++ src/sys/arch/arm/xscale/pxa2x0_dmac.c	Sun Jan 29 09:08:04 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_dmac.c,v 1.9 2011/11/23 23:07:29 jmcneill Exp $	*/
+/*	$NetBSD: pxa2x0_dmac.c,v 1.10 2012/01/29 09:08:04 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -766,24 +766,39 @@ static inline int
 dmac_validate_desc(struct dmac_xfer_desc *xd, size_t *psize,
 bool *misaligned_flag)
 {
+	bus_dma_segment_t *dma_segs = xd->xd_dma_segs;
+	bus_addr_t periph_end;
+	bus_size_t align;
 	size_t size;
-	int i;
+	int i, nsegs = xd->xd_nsegs;
 
 	/*
 	 * Make sure the transfer parameters are acceptable.
 	 */
 
 	if (xd->xd_addr_hold &&
-	(xd->xd_nsegs != 1 || xd->xd_dma_segs[0].ds_len == 0))
+	(nsegs != 1 || dma_segs[0].ds_len == 0))
 		return (EINVAL);
 
-	for (i = 0, size = 0; i < xd->xd_nsegs; i++) {
-		if (xd->xd_dma_segs[i].ds_addr & 0x7) {
+	periph_end = CPU_IS_PXA270 ? PXA270_PERIPH_END : PXA250_PERIPH_END;
+	for (i = 0, size = 0; i < nsegs; i++) {
+		if (dma_segs[i].ds_addr >= PXA2X0_PERIPH_START &&
+		dma_segs[i].ds_addr + dma_segs[i].ds_len < periph_end)
+			/* Internal Peripherals. */
+			align = 0x03;
+		else /* Companion-Chip/External Peripherals/External Memory. */
+			align = 0x07;
+		/*
+		 * :
+		 * Also PXA27x has more constraints by pairs Source/Target.
+		 */
+
+		if (dma_segs[i].ds_addr & align) {
 			if (!CPU_IS_PXA270)
 return (EFAULT);
 			*misaligned_flag = true;
 		}
-		size += xd->xd_dma_segs[i].ds_len;
+		size += dma_segs[i].ds_len;
 	}
 
 	*psize = size;



CVS commit: src/sys/arch/arm/xscale

2012-01-15 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Jan 15 10:59:51 UTC 2012

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_i2s.c

Log Message:
Don't lock sc->sc_intr_lock at halt_output(), halt_input().
sc->sc_intr_lock is already locked by audio_close().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xscale/pxa2x0_i2s.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_i2s.c
diff -u src/sys/arch/arm/xscale/pxa2x0_i2s.c:1.10 src/sys/arch/arm/xscale/pxa2x0_i2s.c:1.11
--- src/sys/arch/arm/xscale/pxa2x0_i2s.c:1.10	Wed Nov 23 23:07:29 2011
+++ src/sys/arch/arm/xscale/pxa2x0_i2s.c	Sun Jan 15 10:59:50 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_i2s.c,v 1.10 2011/11/23 23:07:29 jmcneill Exp $	*/
+/*	$NetBSD: pxa2x0_i2s.c,v 1.11 2012/01/15 10:59:50 nonaka Exp $	*/
 /*	$OpenBSD: pxa2x0_i2s.c,v 1.7 2006/04/04 11:45:40 pascoe Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2s.c,v 1.10 2011/11/23 23:07:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2s.c,v 1.11 2012/01/15 10:59:50 nonaka Exp $");
 
 #include 
 #include 
@@ -322,12 +322,10 @@ pxa2x0_i2s_halt_output(void *hdl)
 {
 	struct pxa2x0_i2s_softc *sc = hdl;
 
-	mutex_spin_enter(sc->sc_intr_lock);
 	if (sc->sc_txdma) {
 		pxa2x0_dmac_abort_xfer(sc->sc_txdma->dx);
 		sc->sc_txdma = NULL;
 	}
-	mutex_spin_exit(sc->sc_intr_lock);
 
 	return 0;
 }
@@ -337,12 +335,10 @@ pxa2x0_i2s_halt_input(void *hdl)
 {
 	struct pxa2x0_i2s_softc *sc = hdl;
 
-	mutex_spin_enter(sc->sc_intr_lock);
 	if (sc->sc_rxdma) {
 		pxa2x0_dmac_abort_xfer(sc->sc_rxdma->dx);
 		sc->sc_rxdma = NULL;
 	}
-	mutex_spin_exit(sc->sc_intr_lock);
 
 	return 0;
 }
@@ -368,7 +364,7 @@ pxa2x0_i2s_start_output(void *hdl, void 
 	}
 	if (p == NULL) {
 		aprint_error("pxa2x0_i2s_start_output: "
-		"request with bad start address: %p, size: %d)\n",
+		"request with bad start address: %p, size: %d\n",
 		block, bsize);
 		return ENXIO;
 	}
@@ -418,7 +414,7 @@ pxa2x0_i2s_start_input(void *hdl, void *
 	}
 	if (p == NULL) {
 		aprint_error("pxa2x0_i2s_start_input: "
-		"request with bad start address: %p, size: %d)\n",
+		"request with bad start address: %p, size: %d\n",
 		block, bsize);
 		return ENXIO;
 	}



CVS commit: src/sys/arch/arm/xscale

2012-01-10 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Jan 10 18:55:38 UTC 2012

Modified Files:
src/sys/arch/arm/xscale: i80312_i2c.c i80321_i2c.c iopi2c.c iopi2cvar.h

Log Message:
split iopi2c(4) device/softc


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/i80312_i2c.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/i80321_i2c.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/iopi2c.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/iopi2cvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80312_i2c.c
diff -u src/sys/arch/arm/xscale/i80312_i2c.c:1.5 src/sys/arch/arm/xscale/i80312_i2c.c:1.6
--- src/sys/arch/arm/xscale/i80312_i2c.c:1.5	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/i80312_i2c.c	Tue Jan 10 18:55:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80312_i2c.c,v 1.5 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: i80312_i2c.c,v 1.6 2012/01/10 18:55:37 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80312_i2c.c,v 1.5 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80312_i2c.c,v 1.6 2012/01/10 18:55:37 jakllsch Exp $");
 
 #include 
 #include 
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: i80312_i2c.c
 #include 
 
 static int
-iic312_match(struct device *parent, struct cfdata *cf, void *aux)
+iic312_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct iopxs_attach_args *ia = aux;
 
@@ -70,21 +70,22 @@ iic312_match(struct device *parent, stru
 }
 
 static void
-iic312_attach(struct device *parent, struct device *self, void *aux)
+iic312_attach(device_t parent, device_t self, void *aux)
 {
-	struct iopiic_softc *sc = (void *) self;
+	struct iopiic_softc *sc = device_private(self);
 	struct iopxs_attach_args *ia = aux;
 	int error;
 
 	aprint_naive(": I2C controller\n");
 	aprint_normal(": I2C controller\n");
 
+	sc->sc_dev = self;
 	sc->sc_st = ia->ia_st;
 	if ((error = bus_space_subregion(sc->sc_st, ia->ia_sh,
 	 ia->ia_offset, ia->ia_size,
 	 &sc->sc_sh)) != 0) {
-		aprint_error("%s: unable to subregion registers, error = %d\n",
-		sc->sc_dev.dv_xname, error);
+		aprint_error_dev(self,
+		"unable to subregion registers, error = %d\n", error);
 		return;
 	}
 
@@ -97,8 +98,8 @@ iic312_attach(struct device *parent, str
 	sc->sc_ih = i80321_intr_establish(ICU_INT_I2C, IPL_BIO,
 	  iopiic_intr, sc);
 	if (sc->sc_ih == NULL) {
-		aprint_error("%s: unable to establish interrupt handler\n",
-		sc->sc_dev.dv_xname);
+		aprint_error_dev(self,
+		"unable to establish interrupt handler\n");
 		return;
 	}
 #endif
@@ -117,5 +118,5 @@ iic312_attach(struct device *parent, str
 	iopiic_attach(sc);
 }
 
-CFATTACH_DECL(iopiic, sizeof(struct iopiic_softc),
+CFATTACH_DECL_NEW(iopiic, sizeof(struct iopiic_softc),
 iic312_match, iic312_attach, NULL, NULL);

Index: src/sys/arch/arm/xscale/i80321_i2c.c
diff -u src/sys/arch/arm/xscale/i80321_i2c.c:1.4 src/sys/arch/arm/xscale/i80321_i2c.c:1.5
--- src/sys/arch/arm/xscale/i80321_i2c.c:1.4	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/i80321_i2c.c	Tue Jan 10 18:55:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_i2c.c,v 1.4 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: i80321_i2c.c,v 1.5 2012/01/10 18:55:37 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_i2c.c,v 1.4 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_i2c.c,v 1.5 2012/01/10 18:55:37 jakllsch Exp $");
 
 #include 
 #include 
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: i80321_i2c.c
 #include 
 
 static int
-iic321_match(struct device *parent, struct cfdata *cf, void *aux)
+iic321_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct iopxs_attach_args *ia = aux;
 
@@ -71,9 +71,9 @@ iic321_match(struct device *parent, stru
 }
 
 static void
-iic321_attach(struct device *parent, struct device *self, void *aux)
+iic321_attach(device_t parent, device_t self, void *aux)
 {
-	struct iopiic_softc *sc = (void *) self;
+	struct iopiic_softc *sc = device_private(self);
 	struct iopxs_attach_args *ia = aux;
 	int error;
 	uint8_t gpio_bits;
@@ -81,12 +81,13 @@ iic321_attach(struct device *parent, str
 	aprint_naive(": I2C controller\n");
 	aprint_normal(": I2C controller\n");
 
+	sc->sc_dev = self;
 	sc->sc_st = ia->ia_st;
 	if ((error = bus_space_subregion(sc->sc_st, ia->ia_sh,
 	 ia->ia_offset, ia->ia_size,
 	 &sc->sc_sh)) != 0) {
-		aprint_error("%s: unable to subregion registers, error = %d\n",
-		sc->sc_dev.dv_xname, error);
+		aprint_error_dev(self,
+		"unable to subregion registers, error = %d\n", error);
 		return;
 	}
 
@@ -104,8 +105,8 @@ iic321_attach(struct device *parent, str
 	sc->sc_ih = i80321_intr_establish((ia->ia_offset == VERDE_I2C_BASE0) ?
 	ICU_INT_I2C0

CVS commit: src/sys/arch/arm/xscale

2011-08-05 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug  6 03:42:11 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_i2c.c pxa2x0_i2c.h

Log Message:
Support slave mode for PXA2x0 I2C.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/xscale/pxa2x0_i2c.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/pxa2x0_i2c.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_i2c.c
diff -u src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.7 src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.8
--- src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.7	Thu Jun 23 11:26:22 2011
+++ src/sys/arch/arm/xscale/pxa2x0_i2c.c	Sat Aug  6 03:42:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_i2c.c,v 1.7 2011/06/23 11:26:22 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_i2c.c,v 1.8 2011/08/06 03:42:11 kiyohara Exp $	*/
 /*	$OpenBSD: pxa2x0_i2c.c,v 1.2 2005/05/26 03:52:07 pascoe Exp $	*/
 
 /*
@@ -18,12 +18,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2c.c,v 1.7 2011/06/23 11:26:22 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2c.c,v 1.8 2011/08/06 03:42:11 kiyohara Exp $");
 
 #include 
-#include 
-#include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -118,7 +119,7 @@
 
 retry:
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE | ISR_IRF);
 	delay(1);
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
@@ -162,8 +163,7 @@
 
 	rv = bus_space_read_4(iot, ioh, I2C_IDBR);
 	*valuep = (u_char)rv;
-	rv = bus_space_read_4(iot, ioh, I2C_ICR);
-	bus_space_write_4(iot, ioh, I2C_ICR, rv & ~(ICR_STOP | ICR_ACKNAK));
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
 
 	return 0;
 
@@ -172,9 +172,9 @@
 		goto retry;
 
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE | ISR_IRF);
-	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
 
 	return EIO;
 }
@@ -190,7 +190,7 @@
 
 retry:
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
 	delay(1);
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
@@ -235,8 +235,7 @@
 
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
 
-	rv = bus_space_read_4(iot, ioh, I2C_ICR);
-	bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
 
 	return 0;
 
@@ -245,9 +244,9 @@
 		goto retry;
 
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
-	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
 
 	return EIO;
 }
@@ -266,7 +265,7 @@
 
 retry:
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
 	delay(1);
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
@@ -290,8 +289,7 @@
 
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
 
-	rv = bus_space_read_4(iot, ioh, I2C_ICR);
-	bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
 
 	return 0;
 
@@ -300,9 +298,9 @@
 		goto retry;
 
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
-	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
 
 	return EIO;
 }
@@ -318,7 +316,7 @@
 
 retry:
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
 	delay(1);
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
@@ -386,6 +384,8 @@
 	rv = bus_space_read_4(iot, ioh, I2C_ICR);
 	bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
 
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
+
 	return 0;
 
 err:
@@ -393,9 +393,9 @@
 		goto retry;
 
 	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
-	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
 	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
-	bus_space_write_4(iot, ioh, I2C_ICR, ICR_

CVS commit: src/sys/arch/arm/xscale

2011-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 15:59:57 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: ixp425_pci_space.c

Log Message:
Remove inline from global routines


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/xscale/ixp425_pci_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425_pci_space.c
diff -u src/sys/arch/arm/xscale/ixp425_pci_space.c:1.9 src/sys/arch/arm/xscale/ixp425_pci_space.c:1.10
--- src/sys/arch/arm/xscale/ixp425_pci_space.c:1.9	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/ixp425_pci_space.c	Mon Jul 11 15:59:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_pci_space.c,v 1.9 2011/07/01 20:32:51 dyoung Exp $ */
+/*	$NetBSD: ixp425_pci_space.c,v 1.10 2011/07/11 15:59:56 matt Exp $ */
 
 /*
  * Copyright (c) 2003
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixp425_pci_space.c,v 1.9 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_pci_space.c,v 1.10 2011/07/11 15:59:56 matt Exp $");
 
 /*
  * bus_space PCI functions for ixp425
@@ -61,13 +61,13 @@
 
 /* special I/O functions */
 #if 1	/* XXX */
-inline u_int8_t  _pci_io_bs_r_1(void *, bus_space_handle_t, bus_size_t);
-inline u_int16_t _pci_io_bs_r_2(void *, bus_space_handle_t, bus_size_t);
-inline u_int32_t _pci_io_bs_r_4(void *, bus_space_handle_t, bus_size_t);
-
-inline void _pci_io_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t);
-inline void _pci_io_bs_w_2(void *, bus_space_handle_t, bus_size_t, u_int16_t);
-inline void _pci_io_bs_w_4(void *, bus_space_handle_t, bus_size_t, u_int32_t);
+u_int8_t  _pci_io_bs_r_1(void *, bus_space_handle_t, bus_size_t);
+u_int16_t _pci_io_bs_r_2(void *, bus_space_handle_t, bus_size_t);
+u_int32_t _pci_io_bs_r_4(void *, bus_space_handle_t, bus_size_t);
+
+void _pci_io_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t);
+void _pci_io_bs_w_2(void *, bus_space_handle_t, bus_size_t, u_int16_t);
+void _pci_io_bs_w_4(void *, bus_space_handle_t, bus_size_t, u_int32_t);
 #endif
 
 struct bus_space ixp425_pci_bs_tag_template = {
@@ -257,7 +257,7 @@
 
 /* special I/O functions */
 #if 1	/* _pci_io_bs_{rw}_{124} */
-inline u_int8_t
+u_int8_t
 _pci_io_bs_r_1(void *v, bus_space_handle_t ioh, bus_size_t off)
 {
 	u_int32_t data, n, be;
@@ -277,7 +277,7 @@
 	return data >> (8 * n);
 }
 
-inline u_int16_t
+u_int16_t
 _pci_io_bs_r_2(void *v, bus_space_handle_t ioh, bus_size_t off)
 {
 	u_int32_t data, n, be;
@@ -297,7 +297,7 @@
 	return data >> (8 * n);
 }
 
-inline u_int32_t
+u_int32_t
 _pci_io_bs_r_4(void *v, bus_space_handle_t ioh, bus_size_t off)
 {
 	u_int32_t data;
@@ -314,7 +314,7 @@
 	return data;
 }
 
-inline void
+void
 _pci_io_bs_w_1(void *v, bus_space_handle_t ioh, bus_size_t off,
 	u_int8_t val)
 {
@@ -334,7 +334,7 @@
 	PCI_CONF_UNLOCK(s);
 }
 
-inline void
+void
 _pci_io_bs_w_2(void *v, bus_space_handle_t ioh, bus_size_t off,
 	u_int16_t val)
 {
@@ -354,7 +354,7 @@
 	PCI_CONF_UNLOCK(s);
 }
 
-inline void
+void
 _pci_io_bs_w_4(void *v, bus_space_handle_t ioh, bus_size_t off,
 	u_int32_t val)
 {



CVS commit: src/sys/arch/arm/xscale

2011-07-01 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Fri Jul  1 20:32:51 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: becc.c becc_pci.c becc_space.c becc_timer.c
i80312.c i80312_gpio.c i80312_i2c.c i80312_mem.c i80312_pci.c
i80312_space.c i80312var.h i80321.c i80321_gpio.c i80321_i2c.c
i80321_icu.c i80321_mcu.c i80321_pci.c i80321_space.c
i80321_timer.c i80321_wdog.c iopi2c.c ixp425.c ixp425_a4x_space.c
ixp425_com.c ixp425_if_npe.c ixp425_intr.c ixp425_ixme.c
ixp425_npe.c ixp425_pci.c ixp425_pci_dma.c ixp425_pci_space.c
ixp425_qmgr.c ixp425_sip.c ixp425_sipvar.h ixp425_space.c
ixp425_timer.c ixp425_wdog.c ixp425var.h pxa2x0.c
pxa2x0_a4x_space.c pxa2x0_ac97.c pxa2x0_apm.h pxa2x0_com.c
pxa2x0_dma.c pxa2x0_dmac.c pxa2x0_gpio.c pxa2x0_i2s.c pxa2x0_i2s.h
pxa2x0_intr.c pxa2x0_lcd.c pxa2x0_lcd.h pxa2x0_ohci.c pxa2x0_pcic.c
pxa2x0_rtc.c pxa2x0_space.c pxa2x0_udc.c

Log Message:
#include  instead of .


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/xscale/becc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/xscale/becc_pci.c \
src/sys/arch/arm/xscale/i80312_pci.c src/sys/arch/arm/xscale/i80312var.h \
src/sys/arch/arm/xscale/i80321_pci.c src/sys/arch/arm/xscale/pxa2x0_lcd.h \
src/sys/arch/arm/xscale/pxa2x0_space.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/becc_space.c \
src/sys/arch/arm/xscale/i80312_i2c.c src/sys/arch/arm/xscale/i80312_mem.c \
src/sys/arch/arm/xscale/ixp425_pci_dma.c \
src/sys/arch/arm/xscale/pxa2x0_a4x_space.c \
src/sys/arch/arm/xscale/pxa2x0_dma.c src/sys/arch/arm/xscale/pxa2x0_rtc.c \
src/sys/arch/arm/xscale/pxa2x0_udc.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/xscale/becc_timer.c \
src/sys/arch/arm/xscale/ixp425.c src/sys/arch/arm/xscale/pxa2x0_gpio.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/xscale/i80312.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/i80312_gpio.c \
src/sys/arch/arm/xscale/i80321_i2c.c src/sys/arch/arm/xscale/i80321_mcu.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xscale/i80312_space.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/xscale/i80321.c \
src/sys/arch/arm/xscale/i80321_icu.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/xscale/i80321_gpio.c \
src/sys/arch/arm/xscale/ixp425_a4x_space.c \
src/sys/arch/arm/xscale/ixp425_ixme.c \
src/sys/arch/arm/xscale/ixp425_wdog.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/xscale/i80321_space.c \
src/sys/arch/arm/xscale/ixp425var.h src/sys/arch/arm/xscale/pxa2x0_com.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/xscale/i80321_timer.c \
src/sys/arch/arm/xscale/ixp425_if_npe.c src/sys/arch/arm/xscale/pxa2x0.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/xscale/i80321_wdog.c \
src/sys/arch/arm/xscale/ixp425_pci_space.c \
src/sys/arch/arm/xscale/pxa2x0_ac97.c \
src/sys/arch/arm/xscale/pxa2x0_i2s.c \
src/sys/arch/arm/xscale/pxa2x0_pcic.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/iopi2c.c \
src/sys/arch/arm/xscale/ixp425_sipvar.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/xscale/ixp425_com.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/xscale/ixp425_intr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/xscale/ixp425_npe.c \
src/sys/arch/arm/xscale/ixp425_space.c \
src/sys/arch/arm/xscale/pxa2x0_dmac.c \
src/sys/arch/arm/xscale/pxa2x0_ohci.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/ixp425_pci.c \
src/sys/arch/arm/xscale/ixp425_qmgr.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/xscale/ixp425_sip.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/xscale/ixp425_timer.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xscale/pxa2x0_apm.h \
src/sys/arch/arm/xscale/pxa2x0_i2s.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/pxa2x0_intr.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/xscale/pxa2x0_lcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/becc.c
diff -u src/sys/arch/arm/xscale/becc.c:1.13 src/sys/arch/arm/xscale/becc.c:1.14
--- src/sys/arch/arm/xscale/becc.c:1.13	Tue May 17 17:34:48 2011
+++ src/sys/arch/arm/xscale/becc.c	Fri Jul  1 20:32:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: becc.c,v 1.13 2011/05/17 17:34:48 dyoung Exp $	*/
+/*	$NetBSD: becc.c,v 1.14 2011/07/01 20:32:51 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -41,14 +41,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: becc.c,v 1.13 2011/05/17 17:34:48 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc.c,v 1.14 2011/07/01 20:32:51 dyoung Exp $");
 
 #include 
 #include 
 #include 
 
 #define	_ARM32_BUS_DMA_PRIVATE
-#include 
+#include 
 
 #include 
 #include 

Index: src/sys/arch/arm/xscale/becc_pci.c
diff -u src/sys/arch/arm/xscale/becc_pci.c:1.9 src/sys/arch/arm/xscale/becc_pci.c:1.10
--- src/sys/arch/arm/xscale/becc_pci.c:1.9	Mon Apr  

CVS commit: src/sys/arch/arm/xscale

2011-06-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Jun 23 11:26:22 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_i2c.c pxa2x0reg.h

Log Message:
Fix bit name ISR_UB.  Not _UE.
And add comments for bit names from datasheet of PXA255.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/pxa2x0_i2c.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/xscale/pxa2x0reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_i2c.c
diff -u src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.6 src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.7
--- src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.6	Wed Jun 22 16:18:55 2011
+++ src/sys/arch/arm/xscale/pxa2x0_i2c.c	Thu Jun 23 11:26:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_i2c.c,v 1.6 2011/06/22 16:18:55 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_i2c.c,v 1.7 2011/06/23 11:26:22 kiyohara Exp $	*/
 /*	$OpenBSD: pxa2x0_i2c.c,v 1.2 2005/05/26 03:52:07 pascoe Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2c.c,v 1.6 2011/06/22 16:18:55 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2c.c,v 1.7 2011/06/23 11:26:22 kiyohara Exp $");
 
 #include 
 #include 
@@ -407,7 +407,7 @@
 #define	CSR_READ_4(sc,r)	bus_space_read_4(sc->sc_iot, sc->sc_ioh, r)
 #define	CSR_WRITE_4(sc,r,v)	bus_space_write_4(sc->sc_iot, sc->sc_ioh, r, v)
 
-#define	ISR_ALL			(ISR_RWM | ISR_ACKNAK | ISR_UE | ISR_IBB \
+#define	ISR_ALL			(ISR_RWM | ISR_ACKNAK | ISR_UB | ISR_IBB \
  | ISR_SSD | ISR_ALD | ISR_ITE | ISR_IRF \
  | ISR_GCAD | ISR_SAD | ISR_BED)
 

Index: src/sys/arch/arm/xscale/pxa2x0reg.h
diff -u src/sys/arch/arm/xscale/pxa2x0reg.h:1.22 src/sys/arch/arm/xscale/pxa2x0reg.h:1.23
--- src/sys/arch/arm/xscale/pxa2x0reg.h:1.22	Sat Jun 18 13:52:24 2011
+++ src/sys/arch/arm/xscale/pxa2x0reg.h	Thu Jun 23 11:26:22 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0reg.h,v 1.22 2011/06/18 13:52:24 nonaka Exp $ */
+/* $NetBSD: pxa2x0reg.h,v 1.23 2011/06/23 11:26:22 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -231,36 +231,38 @@
 
 /* I2C */
 #define I2C_IBMR	0x1680		/* Bus monitor register */
+#define  IBMR_SDAS	(1<<0)		 /* SDA Status */
+#define  IBMR_SCLS	(1<<1)		 /* SCL Status */
 #define I2C_IDBR	0x1688		/* Data buffer */
 #define I2C_ICR  	0x1690		/* Control register */
 #define  ICR_START	(1<<0)
 #define  ICR_STOP	(1<<1)
 #define  ICR_ACKNAK	(1<<2)
-#define  ICR_TB  	(1<<3)
-#define  ICR_MA  	(1<<4)
-#define  ICR_SCLE	(1<<5)		/* PXA270? */
-#define  ICR_IUE	(1<<6)		/* PXA270? */
-#define  ICR_GCD	(1<<7)		/* PXA270? */
-#define  ICR_ITEIE	(1<<8)		/* PXA270? */
-#define  ICR_DRFIE	(1<<9)		/* PXA270? */
-#define  ICR_BEIE	(1<<10)		/* PXA270? */
-#define  ICR_SSDIE	(1<<11)		/* PXA270? */
-#define  ICR_ALDIE	(1<<12)		/* PXA270? */
-#define  ICR_SADIE	(1<<13)		/* PXA270? */
-#define  ICR_UR		(1<<14)		/* PXA270? */
-#define  ICR_FM		(1<<15)		/* PXA270? */
+#define  ICR_TB  	(1<<3)		 /* Transfer Byte */
+#define  ICR_MA  	(1<<4)		 /* Master Abort */
+#define  ICR_SCLE	(1<<5)		 /* SCL Enable */
+#define  ICR_IUE	(1<<6)		 /* I2C Unit Enable */
+#define  ICR_GCD	(1<<7)		 /* General Call Disable */
+#define  ICR_ITEIE	(1<<8)		 /* IDBR Transmit Empty Intr Enable */
+#define  ICR_IRFIE	(1<<9)		 /* IDBR Receive Full Intr Enable */
+#define  ICR_BEIE	(1<<10)		 /* Bus Error Interrupt Enable */
+#define  ICR_SSDIE	(1<<11)		 /* Slave STOP Detected Intr Enable */
+#define  ICR_ALDIE	(1<<12)		 /* Arbitr Loss Detect Intr Enable */
+#define  ICR_SADIE	(1<<13)		 /* Slave Addr Detected Intr Enable */
+#define  ICR_UR		(1<<14)		 /* Unit Reset */
+#define  ICR_FM		(1<<15)		 /* Fast Mode: 0:100kBs/1:400kBs */
 #define I2C_ISR  	0x1698		/* Status register */
-#define  ISR_RWM	(1<<0)
+#define  ISR_RWM	(1<<0)		 /* Read/Write Mode */
 #define  ISR_ACKNAK	(1<<1)
-#define  ISR_UE		(1<<2)
-#define  ISR_IBB	(1<<3)
-#define  ISR_SSD	(1<<4)
-#define  ISR_ALD	(1<<5)
-#define  ISR_ITE	(1<<6)
-#define  ISR_IRF	(1<<7)
-#define  ISR_GCAD	(1<<8)
-#define  ISR_SAD	(1<<9)
-#define  ISR_BED	(1<<10)
+#define  ISR_UB		(1<<2)		 /* Unit Busy */
+#define  ISR_IBB	(1<<3)		 /* I2C Bus Busy */
+#define  ISR_SSD	(1<<4)		 /* Slave STOP Detected */
+#define  ISR_ALD	(1<<5)		 /* Arbitration Loss Detected */
+#define  ISR_ITE	(1<<6)		 /* IDBR Transmit Empty */
+#define  ISR_IRF	(1<<7)		 /* IDBR Receive Full */
+#define  ISR_GCAD	(1<<8)		 /* General Call Address Detected */
+#define  ISR_SAD	(1<<9)		 /* Slave Address Detected */
+#define  ISR_BED	(1<<10)		 /* Bus Error Detected */
 #define I2C_ISAR	0x16a0		/* Slave address */
 
 /* Clock Manager */



CVS commit: src/sys/arch/arm/xscale

2011-06-18 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun 18 13:52:25 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: pxa2x0reg.h

Log Message:
Added some I2C register definition.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/xscale/pxa2x0reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0reg.h
diff -u src/sys/arch/arm/xscale/pxa2x0reg.h:1.21 src/sys/arch/arm/xscale/pxa2x0reg.h:1.22
--- src/sys/arch/arm/xscale/pxa2x0reg.h:1.21	Sat May 15 12:17:34 2010
+++ src/sys/arch/arm/xscale/pxa2x0reg.h	Sat Jun 18 13:52:24 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0reg.h,v 1.21 2010/05/15 12:17:34 kiyohara Exp $ */
+/* $NetBSD: pxa2x0reg.h,v 1.22 2011/06/18 13:52:24 nonaka Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -240,12 +240,27 @@
 #define  ICR_MA  	(1<<4)
 #define  ICR_SCLE	(1<<5)		/* PXA270? */
 #define  ICR_IUE	(1<<6)		/* PXA270? */
+#define  ICR_GCD	(1<<7)		/* PXA270? */
+#define  ICR_ITEIE	(1<<8)		/* PXA270? */
+#define  ICR_DRFIE	(1<<9)		/* PXA270? */
+#define  ICR_BEIE	(1<<10)		/* PXA270? */
+#define  ICR_SSDIE	(1<<11)		/* PXA270? */
+#define  ICR_ALDIE	(1<<12)		/* PXA270? */
+#define  ICR_SADIE	(1<<13)		/* PXA270? */
 #define  ICR_UR		(1<<14)		/* PXA270? */
 #define  ICR_FM		(1<<15)		/* PXA270? */
 #define I2C_ISR  	0x1698		/* Status register */
+#define  ISR_RWM	(1<<0)
 #define  ISR_ACKNAK	(1<<1)
+#define  ISR_UE		(1<<2)
+#define  ISR_IBB	(1<<3)
+#define  ISR_SSD	(1<<4)
+#define  ISR_ALD	(1<<5)
 #define  ISR_ITE	(1<<6)
 #define  ISR_IRF	(1<<7)
+#define  ISR_GCAD	(1<<8)
+#define  ISR_SAD	(1<<9)
+#define  ISR_BED	(1<<10)
 #define I2C_ISAR	0x16a0		/* Slave address */
 
 /* Clock Manager */



CVS commit: src/sys/arch/arm/xscale

2011-06-09 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Jun  9 17:29:42 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: pxa2x0.c pxa2x0_ac97.c pxa2x0_dmac.c
pxa2x0_gpio.c pxa2x0_udc.c

Log Message:
- device_t/softc split.
- use aprint_* function.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/pxa2x0.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/xscale/pxa2x0_ac97.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/pxa2x0_dmac.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/xscale/pxa2x0_gpio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/pxa2x0_udc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0.c
diff -u src/sys/arch/arm/xscale/pxa2x0.c:1.18 src/sys/arch/arm/xscale/pxa2x0.c:1.19
--- src/sys/arch/arm/xscale/pxa2x0.c:1.18	Sun Aug  9 06:12:33 2009
+++ src/sys/arch/arm/xscale/pxa2x0.c	Thu Jun  9 17:29:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0.c,v 1.18 2009/08/09 06:12:33 kiyohara Exp $ */
+/*	$NetBSD: pxa2x0.c,v 1.19 2011/06/09 17:29:42 nonaka Exp $ */
 
 /*
  * Copyright (c) 2002, 2005  Genetec Corporation.  All rights reserved.
@@ -99,7 +99,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.18 2009/08/09 06:12:33 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.19 2011/06/09 17:29:42 nonaka Exp $");
 
 #include "pxaintc.h"
 #include "pxagpio.h"
@@ -126,7 +126,7 @@
 #include 
 
 struct pxaip_softc {
-	struct device sc_dev;
+	device_t sc_dev;
 	bus_space_tag_t sc_bust;
 	bus_dma_tag_t sc_dmat;
 	bus_space_handle_t sc_bush_clk;
@@ -134,10 +134,9 @@
 };
 
 /* prototypes */
-static int	pxaip_match(struct device *, struct cfdata *, void *);
-static void	pxaip_attach(struct device *, struct device *, void *);
-static int 	pxaip_search(struct device *, struct cfdata *,
-			 const int *, void *);
+static int	pxaip_match(device_t, cfdata_t, void *);
+static void	pxaip_attach(device_t, device_t, void *);
+static int 	pxaip_search(device_t, cfdata_t, const int *, void *);
 static void	pxaip_attach_critical(struct pxaip_softc *);
 static int	pxaip_print(void *, const char *);
 
@@ -154,7 +153,7 @@
 #endif
 
 /* attach structures */
-CFATTACH_DECL(pxaip, sizeof(struct pxaip_softc),
+CFATTACH_DECL_NEW(pxaip, sizeof(struct pxaip_softc),
 pxaip_match, pxaip_attach, NULL, NULL);
 
 static struct pxaip_softc *pxaip_sc;
@@ -166,7 +165,7 @@
 	(*((volatile uint32_t *)(pxaclkman_regs + (reg
 
 static int
-pxaip_match(struct device *parent, struct cfdata *match, void *aux)
+pxaip_match(device_t parent, cfdata_t match, void *aux)
 {
 
 #if	!defined(CPU_XSCALE_PXA270)
@@ -190,16 +189,17 @@
 }
 
 static void
-pxaip_attach(struct device *parent, struct device *self, void *aux)
+pxaip_attach(device_t parent, device_t self, void *aux)
 {
-	struct pxaip_softc *sc = (struct pxaip_softc *)self;
+	struct pxaip_softc *sc = device_private(self);
 	int cpuclock;
 
 	pxaip_sc = sc;
+	sc->sc_dev = self;
 	sc->sc_bust = &pxa2x0_bs_tag;
 	sc->sc_dmat = &pxa2x0_bus_dma_tag;
 
-	aprint_normal(": PXA2x0 Onchip Peripheral Bus\n");
+	aprint_normal(": Onchip Peripheral Bus\n");
 
 	if (bus_space_map(sc->sc_bust, PXA2X0_CLKMAN_BASE, PXA2X0_CLKMAN_SIZE,
 	0, &sc->sc_bush_clk))
@@ -234,8 +234,7 @@
 }
 
 static int
-pxaip_search(struct device *parent, struct cfdata *cf,
-	 const int *ldesc, void *aux)
+pxaip_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct pxaip_softc *sc = aux;
 	struct pxaip_attach_args aa;
@@ -265,7 +264,7 @@
 	aa.pxa_addr = PXA2X0_INTCTL_BASE;
 	aa.pxa_size = PXA2X0_INTCTL_SIZE;
 	aa.pxa_intr = PXAIPCF_INTR_DEFAULT;
-	if (config_found(&sc->sc_dev, &aa, pxaip_print) == NULL)
+	if (config_found(sc->sc_dev, &aa, pxaip_print) == NULL)
 		panic("pxaip_attach_critical: failed to attach INTC!");
 
 #if NPXAGPIO > 0
@@ -275,7 +274,7 @@
 	aa.pxa_addr = PXA2X0_GPIO_BASE;
 	aa.pxa_size = PXA2X0_GPIO_SIZE;
 	aa.pxa_intr = PXAIPCF_INTR_DEFAULT;
-	if (config_found(&sc->sc_dev, &aa, pxaip_print) == NULL)
+	if (config_found(sc->sc_dev, &aa, pxaip_print) == NULL)
 		panic("pxaip_attach_critical: failed to attach GPIO!");
 #endif
 
@@ -286,7 +285,7 @@
 	aa.pxa_addr = PXA2X0_DMAC_BASE;
 	aa.pxa_size = PXA2X0_DMAC_SIZE;
 	aa.pxa_intr = PXA2X0_INT_DMA;
-	if (config_found(&sc->sc_dev, &aa, pxaip_print) == NULL)
+	if (config_found(sc->sc_dev, &aa, pxaip_print) == NULL)
 		panic("pxaip_attach_critical: failed to attach DMAC!");
 #endif
 }
@@ -294,7 +293,7 @@
 static int
 pxaip_print(void *aux, const char *name)
 {
-	struct pxaip_attach_args *sa = (struct pxaip_attach_args*)aux;
+	struct pxaip_attach_args *sa = (struct pxaip_attach_args *)aux;
 
 	if (sa->pxa_addr != PXAIPCF_ADDR_DEFAULT) {
 		aprint_normal(" addr 0x%lx", sa->pxa_addr);

Index: src/sys/arch/arm/xscale/pxa2x0_ac97.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.7 src/sys/arch/arm/xscale/pxa2x0_ac97.c:1.8
--- src/sys/arch/arm/xscal

CVS commit: src/sys/arch/arm/xscale

2011-05-14 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 14 15:01:51 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_rtc.c

Log Message:
- Only when pxa_size isn't set, pxa_size is set.
- Split device_t/softc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/pxa2x0_rtc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_rtc.c
diff -u src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.3 src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.4
--- src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.3	Sat Dec 12 14:44:08 2009
+++ src/sys/arch/arm/xscale/pxa2x0_rtc.c	Sat May 14 15:01:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_rtc.c,v 1.3 2009/12/12 14:44:08 tsutsui Exp $	*/
+/*	$NetBSD: pxa2x0_rtc.c,v 1.4 2011/05/14 15:01:50 nonaka Exp $	*/
 
 /*
  * Copyright (c) 2007 NONAKA Kimihiro 
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_rtc.c,v 1.3 2009/12/12 14:44:08 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_rtc.c,v 1.4 2011/05/14 15:01:50 nonaka Exp $");
 
 #include 
 #include 
@@ -44,7 +44,7 @@
 #endif
 
 struct pxartc_softc {
-	struct device		sc_dev;
+	device_t		sc_dev;
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
 
@@ -57,7 +57,7 @@
 static int  pxartc_match(struct device *, struct cfdata *, void *);
 static void pxartc_attach(struct device *, struct device *, void *);
 
-CFATTACH_DECL(pxartc, sizeof(struct pxartc_softc),
+CFATTACH_DECL_NEW(pxartc, sizeof(struct pxartc_softc),
 pxartc_match, pxartc_attach, NULL, NULL);
 
 /* todr(9) interface */
@@ -75,30 +75,34 @@
 	if (strcmp(pxa->pxa_name, cf->cf_name) != 0)
 		return 0;
 
-	pxa->pxa_size = CPU_IS_PXA270 ? PXA270_RTC_SIZE : PXA250_RTC_SIZE;
+	if (pxa->pxa_size == 0) {
+		pxa->pxa_size =
+		CPU_IS_PXA270 ? PXA270_RTC_SIZE : PXA250_RTC_SIZE;
+	}
 	return 1;
 }
 
 static void
 pxartc_attach(struct device *parent, struct device *self, void *aux)
 {
-	struct pxartc_softc *sc = (struct pxartc_softc *)self;
+	struct pxartc_softc *sc = device_private(self);
 	struct pxaip_attach_args *pxa = aux;
 
+	sc->sc_dev = self;
 	sc->sc_iot = pxa->pxa_iot;
 
-	aprint_normal(": PXA2x0 Real-time Clock\n");
+	aprint_normal(": Real-time Clock\n");
 
 	if (bus_space_map(sc->sc_iot, pxa->pxa_addr, pxa->pxa_size, 0,
 	&sc->sc_ioh)) {
 		aprint_error("%s: couldn't map registers\n",
-		sc->sc_dev.dv_xname);
+		device_xname(sc->sc_dev));
 		return;
 	}
 
 	if (pxa->pxa_size == PXA270_RTC_SIZE) {
 		aprint_normal("%s: using wristwatch register\n",
-		sc->sc_dev.dv_xname);
+		device_xname(sc->sc_dev));
 		sc->sc_flags |= FLAG_WRISTWATCH;
 	}
 
@@ -119,11 +123,12 @@
 	if ((sc->sc_flags & FLAG_WRISTWATCH) == 0) {
 		tv->tv_sec = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR);
 		tv->tv_usec = 0;
-		DPRINTF(("%s: RCNR = %08lx\n", sc->sc_dev.dv_xname,tv->tv_sec));
 #ifdef PXARTC_DEBUG
+		DPRINTF(("%s: RCNR = %08llx\n", device_xname(sc->sc_dev),
+		tv->tv_sec));
 		clock_secs_to_ymdhms(tv->tv_sec, &dt);
 		DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
-		sc->sc_dev.dv_xname,
+		device_xname(sc->sc_dev),
 		dt.dt_year, dt.dt_mon, dt.dt_day,
 		dt.dt_hour, dt.dt_min, dt.dt_sec));
 #endif
@@ -148,10 +153,11 @@
 
 	if ((sc->sc_flags & FLAG_WRISTWATCH) == 0) {
 #ifdef PXARTC_DEBUG
-		DPRINTF(("%s: RCNR = %08lx\n", sc->sc_dev.dv_xname,tv->tv_sec));
+		DPRINTF(("%s: RCNR = %08llx\n", device_xname(sc->sc_dev),
+		tv->tv_sec));
 		clock_secs_to_ymdhms(tv->tv_sec, &dt);
 		DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
-		sc->sc_dev.dv_xname,
+		device_xname(sc->sc_dev),
 		dt.dt_year, dt.dt_mon, dt.dt_day,
 		dt.dt_hour, dt.dt_min, dt.dt_sec));
 #endif
@@ -161,10 +167,11 @@
 		uint32_t cntr;
 		delay(1);
 		cntr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RCNR);
-		DPRINTF(("%s: new RCNR = %08x\n", sc->sc_dev.dv_xname, cntr));
+		DPRINTF(("%s: new RCNR = %08x\n", device_xname(sc->sc_dev),
+		cntr));
 		clock_secs_to_ymdhms(cntr, &dt);
 		DPRINTF(("%s: %02d/%02d/%02d %02d:%02d:%02d\n",
-		sc->sc_dev.dv_xname,
+		device_xname(sc->sc_dev),
 		dt.dt_year, dt.dt_mon, dt.dt_day,
 		dt.dt_hour, dt.dt_min, dt.dt_sec));
 		}
@@ -185,14 +192,14 @@
 	uint32_t dayr, yearr;
 	int s;
 
-	DPRINTF(("%s: pxartc_wristwatch_read()\n", sc->sc_dev.dv_xname));
+	DPRINTF(("%s: pxartc_wristwatch_read()\n", device_xname(sc->sc_dev)));
 
 	s = splhigh();
 	dayr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RDCR);
 	yearr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RTC_RYCR);
 	splx(s);
 
-	DPRINTF(("%s: RDCR = %08x, RYCR = %08x\n", sc->sc_dev.dv_xname,
+	DPRINTF(("%s: RDCR = %08x, RYCR = %08x\n", device_xname(sc->sc_dev),
 	dayr, yearr));
 
 	dt->dt_sec = (dayr >> RDCR_SECOND_SHIFT) & RDCR_SECOND_MASK;
@@ -202,7 +209,8 @@
 	dt->dt_mon = (yearr >> RYCR_MONTH_SHIFT) & RYCR_MONTH_MASK;
 	dt->dt_year = (yearr >> RYCR_YEAR_SHIFT) & RYCR_YEAR_MA

CVS commit: src/sys/arch/arm/xscale

2011-05-14 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 14 14:00:03 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: files.pxa2x0 pxa2x0_lcd.c

Log Message:
PXA2X0_LCD_WRITETHROUGH is defflag'd.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/xscale/files.pxa2x0
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/xscale/pxa2x0_lcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/files.pxa2x0
diff -u src/sys/arch/arm/xscale/files.pxa2x0:1.16 src/sys/arch/arm/xscale/files.pxa2x0:1.17
--- src/sys/arch/arm/xscale/files.pxa2x0:1.16	Tue Apr 21 03:00:29 2009
+++ src/sys/arch/arm/xscale/files.pxa2x0	Sat May 14 14:00:03 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pxa2x0,v 1.16 2009/04/21 03:00:29 nonaka Exp $
+#	$NetBSD: files.pxa2x0,v 1.17 2011/05/14 14:00:03 nonaka Exp $
 #
 # Configuration info for Intel PXA2[751]0 CPU support
 #
@@ -42,6 +42,7 @@
 # LCD controller
 device lcd: wsemuldisplaydev, rasops16, rasops8, rasops4, rasops_rotation
 file arch/arm/xscale/pxa2x0_lcd.c		lcd needs-flag
+defflag	opt_pxa2x0_lcd.h		PXA2X0_LCD_WRITETHROUGH
 
 # XXX this is a hack to use dev/pcmcia without fdc.c
 device	fdc

Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.30 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.31
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.30	Sun Aug  8 11:24:52 2010
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c	Sat May 14 14:00:03 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.30 2010/08/08 11:24:52 tsutsui Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.31 2011/05/14 14:00:03 nonaka Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -38,7 +38,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.30 2010/08/08 11:24:52 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.31 2011/05/14 14:00:03 nonaka Exp $");
+
+#include "opt_pxa2x0_lcd.h"
 
 #include 
 #include 



CVS commit: src/sys/arch/arm/xscale

2011-02-05 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Feb  5 15:29:16 UTC 2011

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_mci.c

Log Message:
do pxamci_intr_done() after pxa2x0_dmac_abort_xfer().


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/xscale/pxa2x0_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_mci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_mci.c:1.7 src/sys/arch/arm/xscale/pxa2x0_mci.c:1.8
--- src/sys/arch/arm/xscale/pxa2x0_mci.c:1.7	Thu Oct  7 12:06:09 2010
+++ src/sys/arch/arm/xscale/pxa2x0_mci.c	Sat Feb  5 15:29:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_mci.c,v 1.7 2010/10/07 12:06:09 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_mci.c,v 1.8 2011/02/05 15:29:16 nonaka Exp $	*/
 /*	$OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $	*/
 
 /*
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.7 2010/10/07 12:06:09 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.8 2011/02/05 15:29:16 nonaka Exp $");
 
 #include 
 #include 
@@ -812,9 +812,6 @@
 		DPRINTF(9, ("%s: handling MMC_I_DAT_ERR\n",
 		device_xname(sc->sc_dev)));
 		sc->sc_cmd->c_error = EIO;
-		pxamci_intr_done(sc);
-		pxamci_disable_intr(sc, MMC_I_DAT_ERR);
-		CLR(status, MMC_I_DAT_ERR);
 		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
 		 && DMA_ALIGNED(sc->sc_cmd->c_data)) {
 			if (ISSET(sc->sc_cmd->c_flags, SCF_CMD_READ)) {
@@ -823,6 +820,9 @@
 pxa2x0_dmac_abort_xfer(sc->sc_txdx);
 			}
 		}
+		pxamci_intr_done(sc);
+		pxamci_disable_intr(sc, MMC_I_DAT_ERR);
+		CLR(status, MMC_I_DAT_ERR);
 		/* ignore transmission done condition */
 		if (ISSET(status, MMC_I_DATA_TRAN_DONE)) {
 			pxamci_disable_intr(sc, MMC_I_DATA_TRAN_DONE);



CVS commit: src/sys/arch/arm/xscale

2010-10-01 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Fri Oct  1 09:54:56 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_mci.c

Log Message:
Add capacity SMC_CAPS_MULTI_SEG_DMA.  pxamci uses pxadmac for DMA.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/pxa2x0_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_mci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_mci.c:1.5 src/sys/arch/arm/xscale/pxa2x0_mci.c:1.6
--- src/sys/arch/arm/xscale/pxa2x0_mci.c:1.5	Tue Apr  6 15:55:46 2010
+++ src/sys/arch/arm/xscale/pxa2x0_mci.c	Fri Oct  1 09:54:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_mci.c,v 1.5 2010/04/06 15:55:46 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_mci.c,v 1.6 2010/10/01 09:54:56 kiyohara Exp $	*/
 /*	$OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $	*/
 
 /*
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.5 2010/04/06 15:55:46 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.6 2010/10/01 09:54:56 kiyohara Exp $");
 
 #include 
 #include 
@@ -305,7 +305,7 @@
 	saa.saa_clkmax = sc->sc_clkmax;
 	saa.saa_caps = 0;
 	if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA))
-		SET(saa.saa_caps, SMC_CAPS_DMA);
+		SET(saa.saa_caps, SMC_CAPS_DMA | SMC_CAPS_MULTI_SEG_DMA);
 	if (CPU_IS_PXA270 && ISSET(sc->sc_caps, PMC_CAPS_4BIT))
 		SET(saa.saa_caps, SMC_CAPS_4BIT_MODE);
 



CVS commit: src/sys/arch/arm/xscale

2010-08-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Aug  8 11:24:52 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_lcd.c

Log Message:
Allow pxa2x0_lcd driver mapping screen buffer memory cachable with
write-through map (i.e. map it without BUS_DMA_COHERENT) since
currently all DMA data transfers are memory to device only.

Disabled by default, but enabled by "options PXA2X0_LCD_WRITETHROUGH"
or setting pxa2x0_lcd_writethrough = 1 in a kernel binary.

Tested on WS003SH by me and on WS011SH by jun@, and console output speed
is improved ~three times faster than coherent (uncached) mapping.

XXX: should we have a flag like BUS_DMA_WRITETHROUGH in MI bus_dma(9)?


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/xscale/pxa2x0_lcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.29 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.30
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.29	Sun Aug  8 09:33:35 2010
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c	Sun Aug  8 11:24:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.29 2010/08/08 09:33:35 kiyohara Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.30 2010/08/08 11:24:52 tsutsui Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.29 2010/08/08 09:33:35 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.30 2010/08/08 11:24:52 tsutsui Exp $");
 
 #include 
 #include 
@@ -78,6 +78,12 @@
 	const struct lcd_panel_geometry *geom;
 } pxa2x0_lcd_console;
 
+#ifdef PXA2X0_LCD_WRITETHROUGH
+int pxa2x0_lcd_writethrough = 1;	/* patchable */
+#else
+int pxa2x0_lcd_writethrough = 0;
+#endif
+
 int		lcdintr(void *);
 
 static void	pxa2x0_lcd_initialize(struct pxa2x0_lcd_softc *, 
@@ -333,6 +339,9 @@
 	iot = sc->iot;
 	ioh = sc->ioh;
 
+	bus_dmamap_sync(sc->dma_tag, scr->dma, 0, scr->buf_size,
+	BUS_DMASYNC_PREWRITE);
+
 	save = disable_interrupts(I32_bit);
 
 	switch (scr->depth) {
@@ -536,10 +545,31 @@
 	}
 
 	error = bus_dmamem_map(dma_tag, scr->segs, scr->nsegs, size,
-	(void **)&scr->buf_va, busdma_flag | BUS_DMA_COHERENT);
+	(void **)&scr->buf_va,
+	busdma_flag | (pxa2x0_lcd_writethrough ? 0 : BUS_DMA_COHERENT));
 	if (error)
 		goto bad;
 
+	/* XXX: should we have BUS_DMA_WRITETHROUGH in MI bus_dma(9) API? */
+	if (pxa2x0_lcd_writethrough) {
+		pt_entry_t *ptep;
+		vaddr_t va, eva;
+
+		va = (vaddr_t)scr->buf_va;
+		eva = va + size;
+		while (va < eva) {
+			/* taken from arm/arm32/bus_dma.c:_bus_dmamem_map() */
+			cpu_dcache_wbinv_range(va, PAGE_SIZE);
+			cpu_drain_writebuf();
+			ptep = vtopte(va);
+			*ptep &= ~L2_S_CACHE_MASK;
+			*ptep |= L2_C;
+			PTE_SYNC(ptep);
+			tlb_flush();
+			va += PAGE_SIZE;
+		}
+	}
+
 	memset(scr->buf_va, 0, scr->buf_size);
 
 	/* map memory for DMA */
@@ -899,7 +929,8 @@
 		return -1;
 
 	return bus_dmamem_mmap(sc->dma_tag, scr->segs, scr->nsegs,
-	offset, prot, BUS_DMA_WAITOK|BUS_DMA_COHERENT);
+	offset, prot,
+	BUS_DMA_WAITOK | (pxa2x0_lcd_writethrough ? 0 : BUS_DMA_COHERENT));
 }
 
 



CVS commit: src/sys/arch/arm/xscale

2010-08-08 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  8 09:33:36 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_lcd.c

Log Message:
Must disable LCD Controller in pxa2x0_lcd_attach_sub(), if already enabled.
We wait to become disable LCD in pxa2x0_lcd_initialize().


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/xscale/pxa2x0_lcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.28 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.29
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.28	Sat Mar 13 11:15:52 2010
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c	Sun Aug  8 09:33:35 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.28 2010/03/13 11:15:52 bsh Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.29 2010/08/08 09:33:35 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.28 2010/03/13 11:15:52 bsh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.29 2010/08/08 09:33:35 kiyohara Exp $");
 
 #include 
 #include 
@@ -249,6 +249,9 @@
 		return;
 	}
 
+	/* Must disable LCD Controller here, if already enabled. */
+	bus_space_write_4(iot, ioh, LCDC_LCCR0, 0);
+
 	pxa2x0_lcd_initialize(sc, geom);
 
 #if NWSDISPLAY > 0



CVS commit: src/sys/arch/arm/xscale

2010-05-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat May 15 12:17:35 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0reg.h

Log Message:
Add definitions for Power Manager Registers.
Add some fields for USBHC_UHCRHDB.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/xscale/pxa2x0reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0reg.h
diff -u src/sys/arch/arm/xscale/pxa2x0reg.h:1.20 src/sys/arch/arm/xscale/pxa2x0reg.h:1.21
--- src/sys/arch/arm/xscale/pxa2x0reg.h:1.20	Tue May 11 13:23:09 2010
+++ src/sys/arch/arm/xscale/pxa2x0reg.h	Sat May 15 12:17:34 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0reg.h,v 1.20 2010/05/11 13:23:09 nonaka Exp $ */
+/* $NetBSD: pxa2x0reg.h,v 1.21 2010/05/15 12:17:34 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -986,6 +986,8 @@
 #define  UHCRHDA_PSM	(1<<8)	/* Power switching mode */
 #define  UHCRHDA_NDP_MASK	0xff	/* Number downstream ports */
 #define USBHC_UHCRHDB	0x004c	/* UHC Root Hub Descriptor B */
+#define  UHCRHDB_PPCM(p) ((1<<(p))<<16)	/* Port Power Control Mask [1:3] */
+#define  UHCRHDB_DNR(p)	 ((1<<(p))<<0)	/* Device Not Removable [1:3] */
 #define USBHC_UHCRHS	0x0050	/* UHC Root Hub Stauts */
 #define USBHC_UHCHR	0x0064	/* UHC Reset Register */
 #define  UHCHR_SSEP3	(1<<11)	/* Sleep standby enable for port3 */
@@ -1084,4 +1086,119 @@
 #define  SSSR_BCE	(1<<23)
 #define SSP_SSDR	0x10
 
+/*
+ * Power Manager
+ */
+#define POWMAN_PMCR	0x00	/* Power Manager Control Register */
+#define  POWMAN_BIDAE	(1<<0)	/* Imprecise-Data Abort Enable for nBATT_FAULT*/
+#define  POWMAN_BIDAS	(1<<1)	/* Imprecise-Data Abort Status for nBATT_FAULT*/
+#define  POWMAN_VIDAE	(1<<2)	/* Imprecise-Data Abort Enable for nVDD_FAULT */
+#define  POWMAN_VIDAS	(1<<3)	/* Imprecise-Data Abort Status for nVDD_FAULT */
+#define  POWMAN_IAS	(1<<4)	/* Interrupt/Abort Select */
+#define  POWMAN_INTRS	(1<<5)	/* Interrupt Status */
+#define POWMAN_PSSR	0x04	/* Power Manager Sleep Status Register */
+#define  POWMAN_SSS	(1<<0)	/* Software Sleep Status */
+#define  POWMAN_BFS	(1<<1)	/* Battery Fault Status */
+#define  POWMAN_VFS	(1<<2)	/* VCC Fault Status */
+#define  POWMAN_STS	(1<<3)	/* Standby Mode Status */
+#define  POWMAN_PH	(1<<4)	/* Peripheral Control Hold */
+#define  POWMAN_RDH	(1<<5)	/* Read Disable Hold */
+#define  POWMAN_OTGPH	(1<<6)	/* OTG Peripheral Control Hold */
+#define POWMAN_PSPR	0x08	/* Power Manager Scratch-Pad Register */
+#define  POWMAN_SP(n)	(1<<(n)) /* Scratch Pad Register bit n */
+#define POWMAN_PWER	0x0c	/* Power Manager Wake-Up Enable Register */
+#define  POWMAN_WE(n)	(1<<(n)) /* Wake-up Enable for GPIO[0,1,3,4,9..15] */
+#define  POWMAN_WEMUX2_38  (1<<16) /* Wake-up Enable for GPIO<38> */
+#define  POWMAN_WEMUX2_53  (2<<16) /* Wake-up Enable for GPIO<53> */
+#define  POWMAN_WEMUX2_40  (3<<16) /* Wake-up Enable for GPIO<40> */
+#define  POWMAN_WEMUX2_36  (4<<16) /* Wake-up Enable for GPIO<36> */
+#define  POWMAN_WEMUX3_31  (1<<19) /* Wake-up Enable for GPIO<31> */
+#define  POWMAN_WEMUX3_113 (2<<19) /* Wake-up Enable for GPIO<113> */
+#define  POWMAN_WEUSIM	(1<<23)	/* Wake-up Enable for Rise/Fall Edge from UDET*/
+#define  POWMAN_WE35	(1<<24)	/* Wake-up Enable for GPIO<35> */
+#define  POWMAN_WBB	(1<<25)	/* Wake-up Enable for Rising Edge from MSL */
+#define  POWMAN_WEUSBC	(1<<26)	/* Wake-up Enable for USB Client Port */
+#define  POWMAN_WEUSBH1	(1<<27)	/* Wake-up Enable for USB Host Port 1 */
+#define  POWMAN_WEUSBH2	(1<<28)	/* Wake-up Enable for USB Host Port 2 */
+#define  POWMAN_WEP1	(1<<30)	/* Wake-up Enable for PI */
+#define  POWMAN_WERTC	(1<<31)	/* Wake-up Enable for RTC */
+#define POWMAN_PRER	0x10	/* Power Manager Rising-Edge Detect Enable */
+#define  POWMAN_RE(n)	(1<<(n)) /* Rising-Edge W-u GPIO [0,1,3,4,9..15] */
+#define  POWMAN_RE35	(1<<35)	 /* Rising-Edge W-u GPIO<35> */
+#define POWMAN_PFER	0x14	/* Power Manager Falling-Edge Detect Enable */
+#define  POWMAN_FE(n)	(1<<(n)) /* Falling-Edge W-u GPIO[0,1,3,4,9..15] */
+#define  POWMAN_FE35	(1<<35)	 /* Falling-Edge W-u GPIO<35> */
+#define POWMAN_PEDR	0x18	/* Power Manager Edge Detect Status Register */
+/*  Use bits definitions of POWMAN_PWER */
+#define POWMAN_PCFR	0x1c	/* Power Manager General Configuration */
+#define  POWMAN_OPDE	(1<<0)	/* 13MHz Processor Oscillator Power-Down Ena */
+#define  POWMAN_FP	(1<<1)	/* Float PC Card Pins During Sleep/Deep-Sleep */
+#define  POWMAN_FS	(1<<2)	/* Float Static Chip Selects (nCS<5:1>) Sleep */
+#define  POWMAN_GPR_EN	(1<<4)	/* nRESET_GPIO Pin Enable */
+#define  POWMAN_PI2C_EN	(1<<6)	/* Power Manager I2C Enable */
+#define  POWMAN_DC_EN	(1<<7)	/* Sleep/Deep-Sleep DC-DC Converter Enable */
+#define  POWMAN_FVC	(1<<10)	/* Frequency/Voltage Change */
+#define  POWMAN_L1_EN	(1<<11)	/* Sleep/Deep-Sleep Linear Regulator Enable */
+#define  POWMAN_GP

CVS commit: src/sys/arch/arm/xscale

2010-05-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue May 11 13:23:09 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0reg.h

Log Message:
Add SSP SSSR register definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/xscale/pxa2x0reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0reg.h
diff -u src/sys/arch/arm/xscale/pxa2x0reg.h:1.19 src/sys/arch/arm/xscale/pxa2x0reg.h:1.20
--- src/sys/arch/arm/xscale/pxa2x0reg.h:1.19	Tue May 11 11:28:47 2010
+++ src/sys/arch/arm/xscale/pxa2x0reg.h	Tue May 11 13:23:09 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0reg.h,v 1.19 2010/05/11 11:28:47 nonaka Exp $ */
+/* $NetBSD: pxa2x0reg.h,v 1.20 2010/05/11 13:23:09 nonaka Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -1070,6 +1070,18 @@
 #define SSP_SSSR	0x08
 #define  SSSR_TNF	(1<<2)
 #define  SSSR_RNE	(1<<3)
+#define  SSSR_BUSY	(1<<4)
+#define  SSSR_TFS	(1<<5)
+#define  SSSR_RFS	(1<<6)
+#define  SSSR_ROR	(1<<7)
+#define  SSSR_TFL	(0xf<<8)
+#define  SSSR_RFL	(0xf<<12)
+#define  SSSR_PINT	(1<<18)
+#define  SSSR_TINT	(1<<19)
+#define  SSSR_EOC	(1<<20)
+#define  SSSR_TUR	(1<<21)
+#define  SSSR_CSS	(1<<22)
+#define  SSSR_BCE	(1<<23)
 #define SSP_SSDR	0x10
 
 #endif /* _ARM_XSCALE_PXA2X0REG_H_ */



CVS commit: src/sys/arch/arm/xscale

2010-05-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue May 11 11:28:47 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0reg.h

Log Message:
Added some CKEN_* definition for pxa270.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/pxa2x0reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0reg.h
diff -u src/sys/arch/arm/xscale/pxa2x0reg.h:1.18 src/sys/arch/arm/xscale/pxa2x0reg.h:1.19
--- src/sys/arch/arm/xscale/pxa2x0reg.h:1.18	Mon Mar 16 11:32:27 2009
+++ src/sys/arch/arm/xscale/pxa2x0reg.h	Tue May 11 11:28:47 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0reg.h,v 1.18 2009/03/16 11:32:27 nonaka Exp $ */
+/* $NetBSD: pxa2x0reg.h,v 1.19 2010/05/11 11:28:47 nonaka Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -278,18 +278,30 @@
 #define CKEN_PWM1	(1<<1)
 #define CKEN_AC97	(1<<2)
 #define CKEN_SSP	(1<<3)
+#define CKEN_SSP2	(1<<3)	/* PXA270 */
+#define CKEN_SSP3	(1<<4)	/* PXA270 */
 #define CKEN_HWUART	(1<<4)
 #define CKEN_STUART	(1<<5)
 #define CKEN_FFUART	(1<<6)
 #define CKEN_BTUART	(1<<7)
 #define CKEN_I2S	(1<<8)
 #define CKEN_NSSP	(1<<9)
+#define CKEN_OST	(1<<9)	/* PXA270 */
 #define CKEN_USBHC	(1<<10)
 #define CKEN_USBDC	(1<<11)
 #define CKEN_MMC	(1<<12)
 #define CKEN_FICP	(1<<13)
 #define CKEN_I2C	(1<<14)
+#define CKEN_PI2C	(1<<15)	/* PXA270 */
 #define CKEN_LCD	(1<<16)
+#define CKEN_MSLI	(1<<17)	/* PXA270 */
+#define CKEN_USIM	(1<<18)	/* PXA270 */
+#define CKEN_KPI	(1<<19)	/* PXA270 */
+#define CKEN_INTMEM	(1<<20)	/* PXA270 */
+#define CKEN_MSHC	(1<<21)	/* PXA270 */
+#define CKEN_MEMCTL	(1<<22)	/* PXA270 */
+#define CKEN_SSP1	(1<<23)	/* PXA270 */
+#define CKEN_QCAP	(1<<24)	/* PXA270 */
 
 #define OSCC_OOK	(1<<0)	/* 32.768 kHz oscillator status */
 #define OSCC_OON	(1<<1)	/* 32.768 kHz oscillator */



CVS commit: src/sys/arch/arm/xscale

2010-04-06 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Apr  6 15:55:46 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_mci.c

Log Message:
Enable DMA transfer.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/pxa2x0_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_mci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_mci.c:1.4 src/sys/arch/arm/xscale/pxa2x0_mci.c:1.5
--- src/sys/arch/arm/xscale/pxa2x0_mci.c:1.4	Sat Mar 13 12:28:44 2010
+++ src/sys/arch/arm/xscale/pxa2x0_mci.c	Tue Apr  6 15:55:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_mci.c,v 1.4 2010/03/13 12:28:44 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_mci.c,v 1.5 2010/04/06 15:55:46 nonaka Exp $	*/
 /*	$OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 /*-
- * Copyright (c) 2007-2009 NONAKA Kimihiro 
+ * Copyright (c) 2007-2010 NONAKA Kimihiro 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.4 2010/03/13 12:28:44 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.5 2010/04/06 15:55:46 nonaka Exp $");
 
 #include 
 #include 
@@ -79,18 +79,18 @@
 #include 
 
 #ifdef PXAMCI_DEBUG
-int pxamci_debug = 1;
+int pxamci_debug = 9;
 #define DPRINTF(n,s)	do { if ((n) <= pxamci_debug) printf s; } while (0)
 #else
 #define DPRINTF(n,s)	do {} while (0)
 #endif
 
-#ifndef DEBUG
-#define	STOPCLK_TIMO	2	/* ms */
-#define	EXECCMD_TIMO	2	/* ms */
+#ifndef PXAMCI_DEBUG
+#define	STOPCLK_TIMO	2	/* sec */
+#define	EXECCMD_TIMO	2	/* sec */
 #else
-#define	STOPCLK_TIMO	2	/* ms */
-#define	EXECCMD_TIMO	5	/* ms */
+#define	STOPCLK_TIMO	2	/* sec */
+#define	EXECCMD_TIMO	5	/* sec */
 #endif
 
 static int	pxamci_host_reset(sdmmc_chipset_handle_t);
@@ -155,6 +155,14 @@
 #define CSR_CLR_4(sc, reg, val) \
 	CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) & ~(val))
 
+#if 0	/* XXX */
+#define	DMA_ALIGNED(addr) \
+	(((u_long)(addr) & 0x7) == 0 || !CPU_IS_PXA250)
+#else
+#define	DMA_ALIGNED(addr) \
+	(((u_long)(addr) & 0x1f) == 0)
+#endif
+
 static void
 pxamci_enable_intr(struct pxamci_softc *sc, uint32_t mask)
 {
@@ -238,9 +246,6 @@
 	sc->sc_buswidth = 1;
 
 	/* setting DMA */
-#if 1	/* XXX */
-	SET(sc->sc_caps, PMC_CAPS_NO_DMA);	/* disable DMA */
-#endif
 	if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)) {
 		aprint_normal_dev(sc->sc_dev, "using DMA transfer\n");
 
@@ -301,10 +306,8 @@
 	saa.saa_caps = 0;
 	if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA))
 		SET(saa.saa_caps, SMC_CAPS_DMA);
-#if notyet
 	if (CPU_IS_PXA270 && ISSET(sc->sc_caps, PMC_CAPS_4BIT))
 		SET(saa.saa_caps, SMC_CAPS_4BIT_MODE);
-#endif
 
 	sc->sc_sdmmc = config_found(sc->sc_dev, &saa, NULL);
 	if (sc->sc_sdmmc == NULL) {
@@ -612,9 +615,12 @@
 		cmdat |= CMDAT_DATA_EN;
 
 		/* setting DMA */
-		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)) {
+		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
+		 && DMA_ALIGNED(cmd->c_data)) {
 			struct dmac_xfer_desc *dx_desc;
 
+			DPRINTF(1,("%s: using DMA\n",device_xname(sc->sc_dev)));
+
 			cmdat |= CMDAT_MMC_DMA_EN;
 
 			if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
@@ -641,6 +647,8 @@
 goto err;
 			}
 		} else {
+			DPRINTF(1,("%s: using PIO\n",device_xname(sc->sc_dev)));
+
 			cmd->c_resid = cmd->c_datalen;
 			cmd->c_buf = cmd->c_data;
 
@@ -739,7 +747,7 @@
 	ostatus =
 #endif
 	status = CSR_READ_4(sc, MMC_I_REG) & ~CSR_READ_4(sc, MMC_I_MASK);
-	DPRINTF(9,("%s: intr status = %08x\n", device_xname(sc->sc_dev),
+	DPRINTF(10,("%s: intr status = %08x\n", device_xname(sc->sc_dev),
 	status));
 
 	/*
@@ -762,7 +770,8 @@
 		pxamci_disable_intr(sc, MMC_I_RES_ERR);
 		CLR(status, MMC_I_RES_ERR|MMC_I_END_CMD_RES);
 		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
-		 && (sc->sc_cmd->c_datalen > 0)) {
+		 && (sc->sc_cmd->c_datalen > 0)
+		 && DMA_ALIGNED(sc->sc_cmd->c_data)) {
 			if (ISSET(sc->sc_cmd->c_flags, SCF_CMD_READ)) {
 pxa2x0_dmac_abort_xfer(sc->sc_rxdx);
 			} else {
@@ -796,7 +805,8 @@
 		pxamci_intr_done(sc);
 		pxamci_disable_intr(sc, MMC_I_DAT_ERR);
 		CLR(status, MMC_I_DAT_ERR);
-		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)) {
+		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
+		 && DMA_ALIGNED(sc->sc_cmd->c_data)) {
 			if (ISSET(sc->sc_cmd->c_flags, SCF_CMD_READ)) {
 pxa2x0_dmac_abort_xfer(sc->sc_rxdx);
 			} else {
@@ -820,7 +830,7 @@
 	}
 
 	if (ISSET(status, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ)) {
-		DPRINTF(9,("%s: handling MMC_I_xxFIFO_xx_REQ\n",
+		DPRINTF(10,("%s: handling MMC_I_xxFIFO_xx_REQ\n",
 		device_xname(sc->sc_dev)));
 		pxamci_intr_data(sc);
 		CLR(status, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ);
@@ -920,18 +930,20 @@
 		cmd->c_error = EIO;
 
 	if (cmd->c_error == 0 && cmd->c_datalen > 0) {
-		/* workaround for erratum #91 */
 		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
-		 && CPU_IS_PXA270
-		 && !ISSET(cmd->c_fl

CVS commit: src/sys/arch/arm/xscale

2010-03-26 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Mar 26 15:55:33 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: ixp425-fw.mk

Log Message:
Use objcopy rather than ld to copy Intel NPE firmware blob into ELF.
Avoids internal error in newer binutils ld.
Should fix PR/42864 and PR/43057.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xscale/ixp425-fw.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425-fw.mk
diff -u src/sys/arch/arm/xscale/ixp425-fw.mk:1.1 src/sys/arch/arm/xscale/ixp425-fw.mk:1.2
--- src/sys/arch/arm/xscale/ixp425-fw.mk:1.1	Sun Dec 10 10:01:49 2006
+++ src/sys/arch/arm/xscale/ixp425-fw.mk	Fri Mar 26 15:55:33 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: ixp425-fw.mk,v 1.1 2006/12/10 10:01:49 scw Exp $
+#	$NetBSD: ixp425-fw.mk,v 1.2 2010/03/26 15:55:33 jakllsch Exp $
 
 #
 # For IXP425 NE support, this file must be included by the board-specific
@@ -17,5 +17,5 @@
 ixp425_fw.o:	$S/arch/arm/xscale/IxNpeMicrocode.dat
 	-rm -f ${.OBJDIR}/IxNpeMicrocode.dat
 	-ln -s $S/arch/arm/xscale/IxNpeMicrocode.dat ${.OBJDIR}
-	${LD} -b binary -d -warn-common -r -d -o ${.TARGET} IxNpeMicrocode.dat
+	${OBJCOPY} -I binary -O default -B arm IxNpeMicrocode.dat ${.TARGET}
 .endif



CVS commit: src/sys/arch/arm/xscale

2010-03-24 Thread Steve Woodford
Module Name:src
Committed By:   scw
Date:   Wed Mar 24 13:55:04 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: ixp425-fw.README

Log Message:
Update with new download link provided by Marcin M. Jessa in
http://mail-index.netbsd.org/port-arm/2010/03/24/msg000912.html.

Add a note about version 3.0 microcode.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xscale/ixp425-fw.README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/ixp425-fw.README
diff -u src/sys/arch/arm/xscale/ixp425-fw.README:1.1 src/sys/arch/arm/xscale/ixp425-fw.README:1.2
--- src/sys/arch/arm/xscale/ixp425-fw.README:1.1	Sun Dec 10 10:01:49 2006
+++ src/sys/arch/arm/xscale/ixp425-fw.README	Wed Mar 24 13:55:04 2010
@@ -1,4 +1,4 @@
-$NetBSD: ixp425-fw.README,v 1.1 2006/12/10 10:01:49 scw Exp $
+$NetBSD: ixp425-fw.README,v 1.2 2010/03/24 13:55:04 scw Exp $
 
 IXP425 NPE Microcode
 
@@ -19,7 +19,7 @@
 
 You must grab the NPE microcode from here:
 
- http://www.intel.com/design/network/products/npfamily/ixp400_current.htm
+ http://www.intel.com/design/network/products/npfamily/download_ixp400.htm
 
 Select the "Download (without Crypto)" link in the "NPE Microcode"
 section. Note that there is no benefit in selecting the "with Cypto"
@@ -29,6 +29,10 @@
 version 2.3. Newer versions may not work with NetBSD's native Ethernet
 driver. If this is the case, let us know via send-pr(1).
 
+Update: As of March 2010, NPE Microcode is at version 3.0 and has been
+confirmed to work. See:
+ http://mail-index.netbsd.org/port-arm/2010/03/24/msg000912.html
+
 After clicking the link, you will be directed to a click-through license
 page. Assuming you agree to the terms of the license (and you are
 *strongly* advised to print it out and read it carefully) you will then



CVS commit: src/sys/arch/arm/xscale

2010-03-13 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Mar 13 12:28:44 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_mci.c

Log Message:
fix compile failure when PXAMCI_DEBUG is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/pxa2x0_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_mci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_mci.c:1.3 src/sys/arch/arm/xscale/pxa2x0_mci.c:1.4
--- src/sys/arch/arm/xscale/pxa2x0_mci.c:1.3	Sat Dec  5 13:56:43 2009
+++ src/sys/arch/arm/xscale/pxa2x0_mci.c	Sat Mar 13 12:28:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_mci.c,v 1.3 2009/12/05 13:56:43 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_mci.c,v 1.4 2010/03/13 12:28:44 nonaka Exp $	*/
 /*	$OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $	*/
 
 /*
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.3 2009/12/05 13:56:43 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.4 2010/03/13 12:28:44 nonaka Exp $");
 
 #include 
 #include 
@@ -554,9 +554,9 @@
 	int timo;
 	int s;
 
-	DPRINTF(1,("%s: start cmd %d arg=%#x data=%p dlen=%d flags=%#x\n"
-	"proc=%p \"%s\"\n", device_xname(sc->sc_dev), cmd->c_opcode,
-	cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags));
+	DPRINTF(1,("%s: start cmd %d arg=%#x data=%p dlen=%d flags=%#x\n",
+	device_xname(sc->sc_dev), cmd->c_opcode, cmd->c_arg, cmd->c_data,
+	cmd->c_datalen, cmd->c_flags));
 
 	s = splsdmmc();
 



CVS commit: src/sys/arch/arm/xscale

2010-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 19:12:12 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: i80312_space.c i80321_space.c

Log Message:
Typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/xscale/i80312_space.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/xscale/i80321_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/i80312_space.c
diff -u src/sys/arch/arm/xscale/i80312_space.c:1.9 src/sys/arch/arm/xscale/i80312_space.c:1.10
--- src/sys/arch/arm/xscale/i80312_space.c:1.9	Thu Nov 24 13:08:32 2005
+++ src/sys/arch/arm/xscale/i80312_space.c	Wed Feb 24 19:12:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80312_space.c,v 1.9 2005/11/24 13:08:32 yamt Exp $	*/
+/*	$NetBSD: i80312_space.c,v 1.10 2010/02/24 19:12:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80312_space.c,v 1.9 2005/11/24 13:08:32 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80312_space.c,v 1.10 2010/02/24 19:12:12 skrll Exp $");
 
 #include 
 #include 
@@ -309,7 +309,7 @@
 		return (EINVAL);
 
 	/*
-	 * Found the window -- PCI MEM space is not mapped by allocating
+	 * Found the window -- PCI MEM space is now mapped by allocating
 	 * some kernel VA space and mapping the pages with pmap_enter().
 	 * pmap_enter() will map unmanaged pages as non-cacheable.
 	 */

Index: src/sys/arch/arm/xscale/i80321_space.c
diff -u src/sys/arch/arm/xscale/i80321_space.c:1.11 src/sys/arch/arm/xscale/i80321_space.c:1.12
--- src/sys/arch/arm/xscale/i80321_space.c:1.11	Wed Oct 17 19:53:43 2007
+++ src/sys/arch/arm/xscale/i80321_space.c	Wed Feb 24 19:12:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_space.c,v 1.11 2007/10/17 19:53:43 garbled Exp $	*/
+/*	$NetBSD: i80321_space.c,v 1.12 2010/02/24 19:12:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.11 2007/10/17 19:53:43 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.12 2010/02/24 19:12:12 skrll Exp $");
 
 #include 
 #include 
@@ -314,7 +314,7 @@
 #endif
 
 	/*
-	 * Found the window -- PCI MEM space is not mapped by allocating
+	 * Found the window -- PCI MEM space is now mapped by allocating
 	 * some kernel VA space and mapping the pages with pmap_enter().
 	 * pmap_enter() will map unmanaged pages as non-cacheable.
 	 */



CVS commit: src/sys/arch/arm/xscale

2009-12-06 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Dec  6 12:27:33 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_com.c

Log Message:
Enable UART clock in pxauart_attach().


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/xscale/pxa2x0_com.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_com.c
diff -u src/sys/arch/arm/xscale/pxa2x0_com.c:1.11 src/sys/arch/arm/xscale/pxa2x0_com.c:1.12
--- src/sys/arch/arm/xscale/pxa2x0_com.c:1.11	Tue Aug  4 12:11:33 2009
+++ src/sys/arch/arm/xscale/pxa2x0_com.c	Sun Dec  6 12:27:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_com.c,v 1.11 2009/08/04 12:11:33 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_com.c,v 1.12 2009/12/06 12:27:33 kiyohara Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_com.c,v 1.11 2009/08/04 12:11:33 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_com.c,v 1.12 2009/12/06 12:27:33 kiyohara Exp $");
 
 #include "opt_com.h"
 
@@ -143,6 +143,7 @@
 	bus_space_tag_t iot;
 	bus_space_handle_t ioh;
 	bus_addr_t iobase;
+	int cken = 0;
 
 	sc->sc_dev = self;
 	iot = &pxa2x0_a4x_bs_tag;	/* XXX: This sucks */
@@ -157,6 +158,14 @@
 	}
 	COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
 
+	switch (pxa->pxa_addr) {
+	case PXA2X0_FFUART_BASE: cken = CKEN_FFUART; break;
+	case PXA2X0_STUART_BASE: cken = CKEN_STUART; break;
+	case PXA2X0_BTUART_BASE: cken = CKEN_BTUART; break;
+	case PXA2X0_HWUART_BASE: cken = CKEN_HWUART; break;
+	}
+	pxa2x0_clkman_config(cken, 1);
+
 	com_attach_subr(sc);
 
 	pxa2x0_intr_establish(pxa->pxa_intr, IPL_SERIAL, comintr, sc);



CVS commit: src/sys/arch/arm/xscale

2009-12-05 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Dec  5 13:56:43 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_mci.c

Log Message:
sync with OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/xscale/pxa2x0_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_mci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_mci.c:1.2 src/sys/arch/arm/xscale/pxa2x0_mci.c:1.3
--- src/sys/arch/arm/xscale/pxa2x0_mci.c:1.2	Mon May 11 08:27:03 2009
+++ src/sys/arch/arm/xscale/pxa2x0_mci.c	Sat Dec  5 13:56:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_mci.c,v 1.2 2009/05/11 08:27:03 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_mci.c,v 1.3 2009/12/05 13:56:43 nonaka Exp $	*/
 /*	$OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $	*/
 
 /*
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.2 2009/05/11 08:27:03 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.3 2009/12/05 13:56:43 nonaka Exp $");
 
 #include 
 #include 
@@ -242,6 +242,8 @@
 	SET(sc->sc_caps, PMC_CAPS_NO_DMA);	/* disable DMA */
 #endif
 	if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)) {
+		aprint_normal_dev(sc->sc_dev, "using DMA transfer\n");
+
 		sc->sc_rxdr.ds_addr = PXA2X0_MMC_BASE + MMC_RXFIFO;
 		sc->sc_rxdr.ds_len = 1;
 		sc->sc_rxdx = pxa2x0_dmac_allocate_xfer(M_NOWAIT);
@@ -297,9 +299,9 @@
 	saa.saa_clkmin = sc->sc_clkmin;
 	saa.saa_clkmax = sc->sc_clkmax;
 	saa.saa_caps = 0;
-#if notyet
 	if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA))
 		SET(saa.saa_caps, SMC_CAPS_DMA);
+#if notyet
 	if (CPU_IS_PXA270 && ISSET(sc->sc_caps, PMC_CAPS_4BIT))
 		SET(saa.saa_caps, SMC_CAPS_4BIT_MODE);
 #endif
@@ -503,6 +505,9 @@
 	sc->sc_clkbase = actfreq;
 	sc->sc_clkrt = div;
 
+	CSR_WRITE_4(sc, MMC_CLKRT, sc->sc_clkrt);
+	CSR_WRITE_4(sc, MMC_STRPCL, STRPCL_START);
+
  out:
 	splx(s);
 
@@ -549,10 +554,9 @@
 	int timo;
 	int s;
 
-	DPRINTF(1,("%s: start cmd %d arg=%#x data=%p dlen=%d flags=%#x "
-	"proc=%p \"%s\"\n", device_xname(sc->sc_dev),
-	cmd->c_opcode, cmd->c_arg, cmd->c_data, cmd->c_datalen,
-	cmd->c_flags, curproc, curproc ? curproc->p_comm : ""));
+	DPRINTF(1,("%s: start cmd %d arg=%#x data=%p dlen=%d flags=%#x\n"
+	"proc=%p \"%s\"\n", device_xname(sc->sc_dev), cmd->c_opcode,
+	cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags));
 
 	s = splsdmmc();
 
@@ -785,16 +789,11 @@
 			goto end;
 	}
 
-	if (ISSET(status, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ)) {
-		DPRINTF(9,("%s: handling MMC_I_xxFIFO_xx_REQ\n",
-		device_xname(sc->sc_dev)));
-		CLR(status, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ);
-		pxamci_intr_data(sc);
-	}
-
 	if (ISSET(status, MMC_I_DAT_ERR)) {
 		DPRINTF(9, ("%s: handling MMC_I_DAT_ERR\n",
 		device_xname(sc->sc_dev)));
+		sc->sc_cmd->c_error = EIO;
+		pxamci_intr_done(sc);
 		pxamci_disable_intr(sc, MMC_I_DAT_ERR);
 		CLR(status, MMC_I_DAT_ERR);
 		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)) {
@@ -804,8 +803,6 @@
 pxa2x0_dmac_abort_xfer(sc->sc_txdx);
 			}
 		}
-		sc->sc_cmd->c_error = EIO;
-		pxamci_intr_done(sc);
 		/* ignore transmission done condition */
 		if (ISSET(status, MMC_I_DATA_TRAN_DONE)) {
 			pxamci_disable_intr(sc, MMC_I_DATA_TRAN_DONE);
@@ -822,6 +819,13 @@
 		CLR(status, MMC_I_DATA_TRAN_DONE);
 	}
 
+	if (ISSET(status, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ)) {
+		DPRINTF(9,("%s: handling MMC_I_xxFIFO_xx_REQ\n",
+		device_xname(sc->sc_dev)));
+		pxamci_intr_data(sc);
+		CLR(status, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ);
+	}
+
 	if (ISSET(status, STAT_SDIO_INT)) {
 		DPRINTF(9,("%s: handling STAT_SDIO_INT\n",
 		device_xname(sc->sc_dev)));
@@ -915,7 +919,6 @@
 	} else if (ISSET(status, STAT_ERR))
 		cmd->c_error = EIO;
 
-	pxamci_disable_intr(sc, MMC_I_END_CMD_RES|MMC_I_RES_ERR);
 	if (cmd->c_error == 0 && cmd->c_datalen > 0) {
 		/* workaround for erratum #91 */
 		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
@@ -930,8 +933,9 @@
 pxamci_intr_done(sc);
 return;
 			}
+			pxamci_enable_intr(sc,
+			MMC_I_DATA_TRAN_DONE|MMC_I_DAT_ERR);
 		}
-		pxamci_enable_intr(sc, MMC_I_DATA_TRAN_DONE|MMC_I_DAT_ERR);
 	} else {
 		pxamci_intr_done(sc);
 	}
@@ -968,6 +972,7 @@
 		pxamci_enable_intr(sc, intr);
 	} else {
 		pxamci_disable_intr(sc, intr);
+		pxamci_enable_intr(sc, MMC_I_DATA_TRAN_DONE);
 	}
 }
 
@@ -977,15 +982,12 @@
 static void
 pxamci_intr_done(struct pxamci_softc *sc)
 {
-#ifdef PXAMCI_DEBUG
-	uint32_t status;
 
-	status = CSR_READ_4(sc, MMC_STAT);
 	DPRINTF(1,("%s: pxamci_intr_done: mmc status = %#x\n",
-	device_xname(sc->sc_dev), status));
-#endif
+	device_xname(sc->sc_dev), CSR_READ_4(sc, MMC_STAT)));
 
-	pxamci_disable_intr(sc, MMC_I_DATA_TRAN_DONE|MMC_I_DAT_ERR);
+	pxamci_disable_intr(sc, MMC_I_TXFIFO_WR_REQ|MMC_I_RXFIFO_RD_REQ|
+	MMC_I_DATA_TRAN_DONE|MMC_I_END_CMD_RES|MMC_I_RES_ERR|MMC_I_DAT_ERR);
 	SET(sc->sc_cmd->c_flags, SCF_ITSDONE);
 	sc->sc_

CVS commit: src/sys/arch/arm/xscale

2009-09-05 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Sep  5 17:40:35 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_intr.c

Log Message:
correct the initial value of interrupt masks. 0 is to disable.
This fixes stray interrupt from LCD controller when lcd driver is not 
configured in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/xscale/pxa2x0_intr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_intr.c
diff -u src/sys/arch/arm/xscale/pxa2x0_intr.c:1.15 src/sys/arch/arm/xscale/pxa2x0_intr.c:1.16
--- src/sys/arch/arm/xscale/pxa2x0_intr.c:1.15	Fri Nov  7 16:14:37 2008
+++ src/sys/arch/arm/xscale/pxa2x0_intr.c	Sat Sep  5 17:40:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_intr.c,v 1.15 2008/11/07 16:14:37 rafal Exp $	*/
+/*	$NetBSD: pxa2x0_intr.c,v 1.16 2009/09/05 17:40:35 bsh Exp $	*/
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_intr.c,v 1.15 2008/11/07 16:14:37 rafal Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_intr.c,v 1.16 2009/09/05 17:40:35 bsh Exp $");
 
 #include 
 #include 
@@ -262,25 +262,11 @@
 init_interrupt_masks(void)
 {
 
-	memset(pxa2x0_imask, 0, sizeof(pxa2x0_imask));
-
-	/*
-	 * IPL_NONE has soft interrupts enabled only, at least until
-	 * hardware handlers are installed.
-	 */
-	pxa2x0_imask[IPL_NONE] = ~0;
 	/*
-	 * Initialize the soft interrupt masks to block themselves.
+	 * disable all interrups until handlers are installed.
 	 */
-	pxa2x0_imask[IPL_SOFTCLOCK] = ~0;
-	pxa2x0_imask[IPL_SOFTBIO] = ~0;
-	pxa2x0_imask[IPL_SOFTNET] = ~0;
-	pxa2x0_imask[IPL_SOFTSERIAL] = ~0;
+	memset(pxa2x0_imask, 0, sizeof(pxa2x0_imask));
 
-	pxa2x0_imask[IPL_SOFTCLOCK] &= pxa2x0_imask[IPL_NONE];
-	pxa2x0_imask[IPL_SOFTBIO] &= pxa2x0_imask[IPL_SOFTCLOCK];
-	pxa2x0_imask[IPL_SOFTNET] &= pxa2x0_imask[IPL_SOFTBIO];
-	pxa2x0_imask[IPL_SOFTSERIAL] &= pxa2x0_imask[IPL_SOFTNET];
 }
 
 #undef splx



CVS commit: src/sys/arch/arm/xscale

2009-08-10 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Aug 10 23:08:12 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_ohci.c

Log Message:
Remove unused variable powman_ioh.
  It is used in GUMSTIX ohci patch.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/pxa2x0_ohci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_ohci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.6 src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.7
--- src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.6	Sun Aug  9 06:12:34 2009
+++ src/sys/arch/arm/xscale/pxa2x0_ohci.c	Mon Aug 10 23:08:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_ohci.c,v 1.6 2009/08/09 06:12:34 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_ohci.c,v 1.7 2009/08/10 23:08:12 kiyohara Exp $	*/
 /*	$OpenBSD: pxa2x0_ohci.c,v 1.19 2005/04/08 02:32:54 dlg Exp $ */
 
 /*
@@ -70,7 +70,6 @@
 {
 	struct pxaohci_softc *sc = device_private(self);
 	struct pxaip_attach_args *pxa = aux;
-	bus_space_handle_t powman_ioh;
 	usbd_status r;
 
 #ifdef USB_DEBUG



CVS commit: src/sys/arch/arm/xscale

2009-08-08 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Aug  9 06:24:04 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_udc.c

Log Message:
Remove GPIO configuration for board dependently.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/xscale/pxa2x0_udc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_udc.c
diff -u src/sys/arch/arm/xscale/pxa2x0_udc.c:1.2 src/sys/arch/arm/xscale/pxa2x0_udc.c:1.3
--- src/sys/arch/arm/xscale/pxa2x0_udc.c:1.2	Sun Aug  9 06:12:34 2009
+++ src/sys/arch/arm/xscale/pxa2x0_udc.c	Sun Aug  9 06:24:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_udc.c,v 1.2 2009/08/09 06:12:34 kiyohara Exp $	*/
+/*	$NetBSD: pxa2x0_udc.c,v 1.3 2009/08/09 06:24:03 kiyohara Exp $	*/
 /*	$OpenBSD: pxa27x_udc.c,v 1.5 2005/03/30 14:24:39 dlg Exp $ */
 
 /*
@@ -83,18 +83,10 @@
 	bus_space_barrier(sc->sc_iot, sc->sc_ioh, 0, sc->sc_size,
 	BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE);
 
-	pxa2x0_gpio_set_function(35, GPIO_ALT_FN_2_IN); /* USB_P2_1 */
-	pxa2x0_gpio_set_function(37, GPIO_ALT_FN_1_OUT); /* USB_P2_8 */
-	pxa2x0_gpio_set_function(41, GPIO_ALT_FN_2_IN); /* USB_P2_7 */
-	pxa2x0_gpio_set_function(89, GPIO_ALT_FN_2_OUT); /* USBHPEN<1> */
-	pxa2x0_gpio_set_function(120, GPIO_ALT_FN_2_OUT); /* USBHPEN<2> */
-
 	pxa2x0_clkman_config(CKEN_USBDC, 1);
 
 	pxaudc_enable(sc);
 
-	pxa2x0_gpio_set_bit(37); /* USB_P2_8 */
-
 	sc->sc_powerhook = powerhook_establish(sc->sc_dev.dv_xname,
 	pxaudc_power, sc);
 	if (sc->sc_powerhook == NULL) {



CVS commit: src/sys/arch/arm/xscale

2009-05-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon May 11 08:27:04 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_mci.c

Log Message:
Don't touch dma data when PMC_CAPS_NO_DMA is set.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xscale/pxa2x0_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_mci.c
diff -u src/sys/arch/arm/xscale/pxa2x0_mci.c:1.1 src/sys/arch/arm/xscale/pxa2x0_mci.c:1.2
--- src/sys/arch/arm/xscale/pxa2x0_mci.c:1.1	Tue Apr 21 03:00:29 2009
+++ src/sys/arch/arm/xscale/pxa2x0_mci.c	Mon May 11 08:27:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_mci.c,v 1.1 2009/04/21 03:00:29 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_mci.c,v 1.2 2009/05/11 08:27:03 nonaka Exp $	*/
 /*	$OpenBSD: pxa2x0_mmc.c,v 1.5 2009/02/23 18:09:55 miod Exp $	*/
 
 /*
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.1 2009/04/21 03:00:29 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_mci.c,v 1.2 2009/05/11 08:27:03 nonaka Exp $");
 
 #include 
 #include 
@@ -797,11 +797,12 @@
 		device_xname(sc->sc_dev)));
 		pxamci_disable_intr(sc, MMC_I_DAT_ERR);
 		CLR(status, MMC_I_DAT_ERR);
-		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)
-		 && (ISSET(sc->sc_cmd->c_flags, SCF_CMD_READ))) {
-			pxa2x0_dmac_abort_xfer(sc->sc_rxdx);
-		} else {
-			pxa2x0_dmac_abort_xfer(sc->sc_txdx);
+		if (!ISSET(sc->sc_caps, PMC_CAPS_NO_DMA)) {
+			if (ISSET(sc->sc_cmd->c_flags, SCF_CMD_READ)) {
+pxa2x0_dmac_abort_xfer(sc->sc_rxdx);
+			} else {
+pxa2x0_dmac_abort_xfer(sc->sc_txdx);
+			}
 		}
 		sc->sc_cmd->c_error = EIO;
 		pxamci_intr_done(sc);



CVS commit: src/sys/arch/arm/xscale

2009-04-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 20 12:55:02 UTC 2009

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_i2c.c pxa2x0_i2c.h

Log Message:
One more i2c quick_{read,write} update.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/pxa2x0_i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xscale/pxa2x0_i2c.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_i2c.c
diff -u src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.3 src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.4
--- src/sys/arch/arm/xscale/pxa2x0_i2c.c:1.3	Wed Oct 17 19:53:44 2007
+++ src/sys/arch/arm/xscale/pxa2x0_i2c.c	Mon Apr 20 12:55:02 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_i2c.c,v 1.3 2007/10/17 19:53:44 garbled Exp $	*/
+/*	$NetBSD: pxa2x0_i2c.c,v 1.4 2009/04/20 12:55:02 pgoyette Exp $	*/
 /*	$OpenBSD: pxa2x0_i2c.c,v 1.2 2005/05/26 03:52:07 pascoe Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2c.c,v 1.3 2007/10/17 19:53:44 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2c.c,v 1.4 2009/04/20 12:55:02 pgoyette Exp $");
 
 #include 
 #include 
@@ -235,6 +235,61 @@
 	return EIO;
 }
 
+/*
+ * XXX The quick_{read,write} opertions are untested!
+ */
+int
+pxa2x0_i2c_quick(struct pxa2x0_i2c_softc *sc, u_char slave, u_char rw)
+{
+	bus_space_tag_t iot = sc->sc_iot;
+	bus_space_handle_t ioh = sc->sc_ioh;
+	int timeout;
+	int tries = I2C_RETRY_COUNT;
+	uint32_t rv;
+
+retry:
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
+	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
+	delay(1);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
+
+	/* Write slave device address. */
+	bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1) | (rw & 1));
+	rv = bus_space_read_4(iot, ioh, I2C_ICR);
+	bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START);
+	rv = bus_space_read_4(iot, ioh, I2C_ICR);
+	bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_STOP);
+	rv = bus_space_read_4(iot, ioh, I2C_ICR);
+
+	timeout = 1;
+	while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
+		if (timeout-- == 0)
+			goto err;
+		delay(1);
+	}
+	if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
+		goto err;
+
+	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
+
+	rv = bus_space_read_4(iot, ioh, I2C_ICR);
+	bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
+
+	return 0;
+
+err:
+	if (tries-- >= 0)
+		goto retry;
+
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
+	bus_space_write_4(iot, ioh, I2C_ISAR, 0x00);
+	bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
+	bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
+
+	return EIO;
+}
+
 int
 pxa2x0_i2c_write_2(struct pxa2x0_i2c_softc *sc, u_char slave, u_short value)
 {

Index: src/sys/arch/arm/xscale/pxa2x0_i2c.h
diff -u src/sys/arch/arm/xscale/pxa2x0_i2c.h:1.1 src/sys/arch/arm/xscale/pxa2x0_i2c.h:1.2
--- src/sys/arch/arm/xscale/pxa2x0_i2c.h:1.1	Sun Dec 17 16:03:33 2006
+++ src/sys/arch/arm/xscale/pxa2x0_i2c.h	Mon Apr 20 12:55:02 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_i2c.h,v 1.1 2006/12/17 16:03:33 peter Exp $	*/
+/*	$NetBSD: pxa2x0_i2c.h,v 1.2 2009/04/20 12:55:02 pgoyette Exp $	*/
 /*	$OpenBSD: pxa2x0_i2c.h,v 1.2 2005/05/26 03:52:07 pascoe Exp $	*/
 
 /*
@@ -37,5 +37,6 @@
 int	pxa2x0_i2c_read(struct pxa2x0_i2c_softc *sc, u_char, u_char *);
 int	pxa2x0_i2c_write(struct pxa2x0_i2c_softc *, u_char, u_char);
 int	pxa2x0_i2c_write_2(struct pxa2x0_i2c_softc *, u_char, u_short);
+int	pxa2x0_i2c_quick(struct pxa2x0_i2c_softc *sc, u_char slave, u_char rw);
 
 #endif