CVS commit: src/sys/arch/powerpc

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:00:17 UTC 2011

Modified Files:
src/sys/arch/powerpc/include: cpu.h
src/sys/arch/powerpc/oea: cpu_subr.c
src/sys/arch/powerpc/powerpc: powerpc_machdep.c

Log Message:
Cleanup hatch names.
Add cpuset_info.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/powerpc/oea/cpu_subr.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/powerpc/powerpc_machdep.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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.86 src/sys/arch/powerpc/include/cpu.h:1.87
--- src/sys/arch/powerpc/include/cpu.h:1.86	Tue Jun 21 06:32:36 2011
+++ src/sys/arch/powerpc/include/cpu.h	Wed Jun 29 06:00:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.86 2011/06/21 06:32:36 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.87 2011/06/29 06:00:17 matt Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -154,17 +154,33 @@
 
 #if defined(MULTIPROCESSOR)  !defined(_MODULE)
 struct cpu_hatch_data {
-	device_t self;
-	struct cpu_info *ci;
-	int running;
-	int pir;
-	int asr;
-	int hid0;
-	int sdr1;
-	int sr[16];
-	int batu[4], batl[4];
-	int tbu, tbl;
+	int hatch_running;
+	device_t hatch_self;
+	struct cpu_info *hatch_ci;
+	uint32_t hatch_tbu;
+	uint32_t hatch_tbl;
+	uint32_t hatch_hid0;
+	uint32_t hatch_pir;
+#if defined(PPC_OEA) || defined(PPC_OEA64_BRIDGE)
+	uintptr_t hatch_asr;
+	uintptr_t hatch_sdr1;
+	uint32_t hatch_sr[16];
+	uintptr_t hatch_batu[8], hatch_batl[8];
+#endif
+#if defined(PPC_BOOKE)
+	vaddr_t hatch_sp;
+#endif
 };
+
+struct cpuset_info {
+	__cpuset_t cpus_running;
+	__cpuset_t cpus_hatched;
+	__cpuset_t cpus_paused;
+	__cpuset_t cpus_resumed;
+	__cpuset_t cpus_halted;
+};
+
+extern volatile struct cpuset_info cpuset_info;
 #endif /* MULTIPROCESSOR  !_MODULE */
 
 #if defined(MULTIPROCESSOR) || defined(_MODULE)

Index: src/sys/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.69 src/sys/arch/powerpc/oea/cpu_subr.c:1.70
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.69	Tue Jun 21 04:21:17 2011
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Wed Jun 29 06:00:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.69 2011/06/21 04:21:17 matt Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.70 2011/06/29 06:00:17 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.69 2011/06/21 04:21:17 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.70 2011/06/29 06:00:17 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_multiprocessor.h
@@ -1213,37 +1213,37 @@
 	ci-ci_curpm = ci-ci_curpcb-pcb_pm;
 
 	cpu_hatch_data = h;
-	h-running = 0;
-	h-self = self;
-	h-ci = ci;
-	h-pir = ci-ci_cpuid;
+	h-hatch_running = 0;
+	h-hatch_self = self;
+	h-hatch_ci = ci;
+	h-hatch_pir = ci-ci_cpuid;
 
 	cpu_hatch_stack = (uint32_t)hp;
 	ci-ci_lasttb = cpu_info[0].ci_lasttb;
 
 	/* copy special registers */
 
-	h-hid0 = mfspr(SPR_HID0);
+	h-hatch_hid0 = mfspr(SPR_HID0);
 	
-	__asm volatile (mfsdr1 %0 : =r(h-sdr1));
+	__asm volatile (mfsdr1 %0 : =r(h-hatch_sdr1));
 	for (i = 0; i  16; i++) {
-		__asm (mfsrin %0,%1 : =r(h-sr[i]) :
+		__asm (mfsrin %0,%1 : =r(h-hatch_sr[i]) :
 		   r(i  ADDR_SR_SHFT));
 	}
 	if (oeacpufeat  OEACPU_64)
-		h-asr = mfspr(SPR_ASR);
+		h-hatch_asr = mfspr(SPR_ASR);
 	else
-		h-asr = 0;
+		h-hatch_asr = 0;
 
 	/* copy the bat regs */
-	__asm volatile (mfibatu %0,0 : =r(h-batu[0]));
-	__asm volatile (mfibatl %0,0 : =r(h-batl[0]));
-	__asm volatile (mfibatu %0,1 : =r(h-batu[1]));
-	__asm volatile (mfibatl %0,1 : =r(h-batl[1]));
-	__asm volatile (mfibatu %0,2 : =r(h-batu[2]));
-	__asm volatile (mfibatl %0,2 : =r(h-batl[2]));
-	__asm volatile (mfibatu %0,3 : =r(h-batu[3]));
-	__asm volatile (mfibatl %0,3 : =r(h-batl[3]));
+	__asm volatile (mfibatu %0,0 : =r(h-hatch_batu[0]));
+	__asm volatile (mfibatl %0,0 : =r(h-hatch_batl[0]));
+	__asm volatile (mfibatu %0,1 : =r(h-hatch_batu[1]));
+	__asm volatile (mfibatl %0,1 : =r(h-hatch_batl[1]));
+	__asm volatile (mfibatu %0,2 : =r(h-hatch_batu[2]));
+	__asm volatile (mfibatl %0,2 : =r(h-hatch_batl[2]));
+	__asm volatile (mfibatu %0,3 : =r(h-hatch_batu[3]));
+	__asm volatile (mfibatl %0,3 : =r(h-hatch_batl[3]));
 	__asm volatile (sync; isync);
 
 	if (md_setup_trampoline(h, ci) == -1)
@@ -1255,7 +1255,7 @@
 
 	delay(20);
 
-	if (h-running  1) {
+	if (h-hatch_running  1) {
 		aprint_error(%d:CPU %d didn't start %d\n, cpu_spinstart_ack,
 		ci-ci_cpuid, cpu_spinstart_ack);
 		Debugger();
@@ -1276,7 +1276,7 @@
 cpu_hatch(void)
 {
 	volatile struct cpu_hatch_data *h = cpu_hatch_data;
-	struct cpu_info * const ci = h-ci;
+	struct cpu_info * const ci = h-hatch_ci;
 	struct pcb *pcb;
 	u_int msr;
 	int i;
@@ -1291,44 +1291,44 @@
 	 */
 
 	msr = mfspr(SPR_PIR);
-	if 

CVS commit: src/sys/arch/powerpc/include/booke

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:00:57 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/booke: cpuvar.h

Log Message:
Declare cpu_hatch_data


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/powerpc/include/booke/cpuvar.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/powerpc/include/booke/cpuvar.h
diff -u src/sys/arch/powerpc/include/booke/cpuvar.h:1.10 src/sys/arch/powerpc/include/booke/cpuvar.h:1.11
--- src/sys/arch/powerpc/include/booke/cpuvar.h:1.10	Thu Jun 23 01:27:20 2011
+++ src/sys/arch/powerpc/include/booke/cpuvar.h	Wed Jun 29 06:00:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.10 2011/06/23 01:27:20 matt Exp $	*/
+/*	$NetBSD: cpuvar.h,v 1.11 2011/06/29 06:00:56 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -160,6 +160,9 @@
 struct powerpc_bus_dma_tag booke_bus_dma_tag;
 
 extern struct cpu_info cpu_info[];
+#ifdef MULTIPROCESSOR
+extern volatile struct cpu_hatch_data cpu_hatch_data;
+#endif
 
 void	cpu_evcnt_attach(struct cpu_info *);
 uint32_t cpu_read_4(bus_size_t);



CVS commit: src/sys/arch/powerpc/include/booke

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:01:33 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/booke: e500var.h

Log Message:
Add some e500 MP prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/booke/e500var.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/powerpc/include/booke/e500var.h
diff -u src/sys/arch/powerpc/include/booke/e500var.h:1.3 src/sys/arch/powerpc/include/booke/e500var.h:1.4
--- src/sys/arch/powerpc/include/booke/e500var.h:1.3	Sun Jun  5 16:52:25 2011
+++ src/sys/arch/powerpc/include/booke/e500var.h	Wed Jun 29 06:01:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500var.h,v 1.3 2011/06/05 16:52:25 matt Exp $	*/
+/*	$NetBSD: e500var.h,v 1.4 2011/06/29 06:01:33 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -85,9 +85,11 @@
  * Used by MP hatch code to fetch the TLB1 entries so they be setup on the
  * just hatched CPU.
  */
-void   *e500_tlb1_fetch(size_t);
+void *	e500_tlb1_fetch(size_t);
 void	e500_tlb1_sync(void);
 void	e500_ipi_halt(void);
+void	e500_spinup_trampoline(void);
+void	e500_cpu_hatch(struct cpu_info *);
 
 void	pq3gpio_attach(device_t, device_t, void *);
 
@@ -96,11 +98,14 @@
  */
 
 struct uboot_spinup_entry {
-	uint64_t entry_addr;
-	uint64_t entry_r3;
+	uint32_t entry_addr_upper;
+	uint32_t entry_addr_lower;
+	uint32_t entry_r3_upper;
+	uint32_t entry_r3_lower;
 	uint32_t entry__rsvd;
 	uint32_t entry_pir;
-	uint64_t entry_r6;
+	uint32_t entry_r6_upper;
+	uint32_t entry_r6_lower;
 };
 
 #endif /* _KERNEL */



CVS commit: src/sys/arch/powerpc/conf

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:02:43 UTC 2011

Modified Files:
src/sys/arch/powerpc/conf: files.powerpc

Log Message:
Add VERBOSE_INITPPC flag


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/powerpc/conf/files.powerpc

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/powerpc/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.81 src/sys/arch/powerpc/conf/files.powerpc:1.82
--- src/sys/arch/powerpc/conf/files.powerpc:1.81	Sat Jun 18 20:35:05 2011
+++ src/sys/arch/powerpc/conf/files.powerpc	Wed Jun 29 06:02:43 2011
@@ -1,8 +1,8 @@
-#	$NetBSD: files.powerpc,v 1.81 2011/06/18 20:35:05 matt Exp $
+#	$NetBSD: files.powerpc,v 1.82 2011/06/29 06:02:43 matt Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC PPC_HAVE_SPE
 defflag	opt_openpic.h	OPENPIC OPENPIC_SERIAL_MODE OPENPIC_DISTRIBUTE
-defparam opt_ppcparam.h	L2CR_CONFIG L3CR_CONFIG INTSTK CLOCKBASE
+defparam opt_ppcparam.h	L2CR_CONFIG L3CR_CONFIG INTSTK CLOCKBASE VERBOSE_INITPPC
 defflag	opt_ppcarch.h	PPC_OEA PPC_OEA601 PPC_OEA64 PPC_OEA64_BRIDGE PPC_MPC8XX PPC_IBM4XX PPC_IBM403 PPC_BOOKE
 defflag opt_pmap.h	PMAPDEBUG PMAPCHECK PMAPCOUNTERS
 defparam opt_pmap.h	PTEGCOUNT PMAP_MEMLIMIT



CVS commit: src/sys/arch/powerpc/booke

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:06:04 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke: e500_mpsubr.S genassym.cf

Log Message:
More MP support.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/booke/e500_mpsubr.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/genassym.cf

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/powerpc/booke/e500_mpsubr.S
diff -u src/sys/arch/powerpc/booke/e500_mpsubr.S:1.1 src/sys/arch/powerpc/booke/e500_mpsubr.S:1.2
--- src/sys/arch/powerpc/booke/e500_mpsubr.S:1.1	Sun Jun  5 16:52:24 2011
+++ src/sys/arch/powerpc/booke/e500_mpsubr.S	Wed Jun 29 06:06:04 2011
@@ -8,7 +8,35 @@
  * r8 = 0
  * r9 = 0
  */
-_ENTRY(e500_spinup_trampoline)
+	.p2align 5
+ENTRY_NOPROFILE(e500_spinup_trampoline)
+
+	stw	%r7, 4(%r0)		/* r7 to 4 */
+
+	lis	%r31, 0xdeadbeef@h
+	ori	%r31, %r31, 0xdeadbeef@l
+	mr	%r30, %r31
+	mr	%r29, %r31
+	mr	%r28, %r31
+	mr	%r27, %r31
+	mr	%r26, %r31
+	mr	%r25, %r31
+	mr	%r24, %r31
+	mr	%r23, %r31
+	mr	%r22, %r31
+	mr	%r21, %r31
+	mr	%r20, %r31
+	mr	%r19, %r31
+	mr	%r18, %r31
+	mr	%r17, %r31
+	mr	%r16, %r31
+	mr	%r15, %r31
+	mr	%r14, %r31
+	mr	%r13, %r31
+	mr	%r12, %r31
+	mr	%r11, %r31
+	mr	%r10, %r31
+	mr	%r2, %r31
 
 	/*
 	 * First thing we need to do is to set SPRG0 with our cpu_info
@@ -19,25 +47,78 @@
 	 *
 	 * All the caller-saved register are ours to use.  So we will.
 	 */
-	lis	%r20, _C_LABEL(cpu_hatch_data)@ha
-	addi	%r20, %r20, _C_LABEL(cpu_hatch_data)@l
+	lis	%r20, _C_LABEL(cpu_hatch_data)@h
+	ori	%r20, %r20, _C_LABEL(cpu_hatch_data)@l
+
+	li	%r0, 0
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
+	eieio
 
+	lwz	%r1, HATCH_SP(%r20)		/* get hatch SP */
 	lwz	%r21, HATCH_CI(%r20)		/* get cpu_info */
 	mtsprg0	%r21/* save cpu_info */
-	lwz	%r1, HATCH_SP(%r20)		/* get hatch SP */
-	
+	lwz	%r13, CI_CURLWP(%r21)		/* load r13 with curlwp */
+	mtsprg2	%r13/* save it in sprg2 */
+
+	/*
+	 * Now to synchronize timebase values.  First to make sure HID0 is
+	 * set correctly, except with the timebase disabled.
+	 */
+	lwz	%r22, HATCH_HID0(%r20)		/* get HID0 */
+	li	%r28, HID0_TBEN			/* HID0_TBEN */
+	andc	%r0,%r22,%r28			/* clear TBEN from HID0 */
+	mtspr	SPR_HID0, %r0			/* set HID0 (timebase off) */
+	isync
+	lwz	%r24, HATCH_TBL(%r20)		/* get lower timebase value */
+	lwz	%r23, HATCH_TBU(%r20)		/* get upper timebase value */
+
+	/*
+	 * Figure out how much we are adjusting the timebase
+	 */
+	mftbl	%r4/* get lower timebase */
+	subfc	%r0, %r4, %r24			/* subtract from new value */
+	stw	%r0, HATCH_TBL(%r20)		/* save it */
+	mftbu	%r3/* get upper timebase */
+	subfe	%r0, %r3, %r23			/* subtract from new value */
+	stw	%r0, HATCH_TBU(%r20)		/* save it */
+
+	/*
+	 * Since we've disabled timebase, we can set the timebase registers
+	 * without fear of them changing.  Have to do this after we read the
+	 * previous values.
+	 */
+	mttbu	%r23/* set upper timebase */
+	mttbl	%r24/* set lower timebase */
+
+	/*
+	 * Now we loop until the boot cpu tells us to enable timebase
+	 */
+1:	lwz	%r0, HATCH_RUNNING(%r20)	/* is it time? */
+	cmplwi	%r0, 0
+	beq+	1b
+
+	mtspr	SPR_HID0, %r22			/* start timebase running */
+	isync
+
+	li	%r0, 2
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
+
 	/*
 	 * We have to setup the IVOR SPRs since the ones u-boot setup
 	 * don't work for us.
 	 */
 	bl	_C_LABEL(exception_init)	/* setup IVORs */
 
+	li	%r0, 3
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
+
 	/*
 	 * U-boot has mapped the bottom 64MB in TLB1[0].  We are going to need
-	 * change this entry and it's not safe to do so while running out of it.
-	 * So we copy TLB1[0] to TLB1[1] but set it for AS1.  We then switch
-	 * to AS1 and reload TLB1[0] with its correct value, and we switch
-	 * back to AS0.  Then we can load the rest of the TLB1 entries.
+	 * to change this entry and it's not safe to do so while running out
+	 * of it.  So we copy TLB1[0] to TLB1[1] but set it for AS1.  We then
+	 * switch to AS1 and reload TLB1[0] with its correct value, and then we
+	 * switch back to AS0.  After that, we can load the rest of the TLB1
+	 * entries.
 	 */
 
 	/*
@@ -47,6 +128,9 @@
 	mtspr	SPR_MAS0, %r16
 	tlbre
 
+	li	%r0, 4
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
+
 	/*
 	 * Copy TLB1[0] to TLB[1] and set it to use AS1
 	 */
@@ -58,6 +142,9 @@
 	mtspr	SPR_MAS1, %r4
 	tlbwe	/* write the TLB entry */
 
+	li	%r0, 5
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
+
 	/*
 	 * Let's find out what TLB1[0] entry we are supposed to use.
 	 */
@@ -69,6 +156,9 @@
 	mtspr	SPR_MAS2, %r30
 	mtspr	SPR_MAS3, %r31
 
+	li	%r0, 6
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
+
 	/*
 	 * Now to switch to running in AS1
 	 */
@@ -81,19 +171,49 @@
 	addi	%r4,%r11,.Las1start-1b
 	addi	%r5,%r11,.Las1end-1b
 	mtsrr0	%r4
+	li	%r0, 7
+	stw	%r0, HATCH_RUNNING(%r20)	/* progress */
 	rfi			/* switch to AS1, 

CVS commit: src/sys/arch/powerpc/booke/dev

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:12:10 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3sdhc.c

Log Message:
Use a private bus_space for freescale eSDHC controller (only allows
32 bit access).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/booke/dev/pq3sdhc.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/powerpc/booke/dev/pq3sdhc.c
diff -u src/sys/arch/powerpc/booke/dev/pq3sdhc.c:1.2 src/sys/arch/powerpc/booke/dev/pq3sdhc.c:1.3
--- src/sys/arch/powerpc/booke/dev/pq3sdhc.c:1.2	Tue Jan 18 01:02:53 2011
+++ src/sys/arch/powerpc/booke/dev/pq3sdhc.c	Wed Jun 29 06:12:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3sdhc.c,v 1.2 2011/01/18 01:02:53 matt Exp $	*/
+/*	$NetBSD: pq3sdhc.c,v 1.3 2011/06/29 06:12:10 matt Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pq3sdhc.c,v 1.2 2011/01/18 01:02:53 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pq3sdhc.c,v 1.3 2011/06/29 06:12:10 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -47,10 +47,13 @@
 #include dev/sdmmc/sdhcreg.h
 #include dev/sdmmc/sdhcvar.h
 
+#define	EDSHC_HOST_CTL_RES	0x05
+
 static int pq3sdhc_match(device_t, cfdata_t, void *);
 static void pq3sdhc_attach(device_t, device_t, void *);
 
 struct pq3sdhc_softc {
+	struct powerpc_bus_space sc_mybst;
 	struct sdhc_softc	sc;
 	bus_space_tag_t		sc_bst;
 	bus_space_handle_t	sc_bsh;
@@ -61,6 +64,114 @@
 CFATTACH_DECL_NEW(pq3sdhc, sizeof(struct pq3sdhc_softc),
 pq3sdhc_match, pq3sdhc_attach, NULL, NULL);
 
+static uint8_t
+pq3sdhc_read_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o)
+{
+	const struct pq3sdhc_softc * const sc = (const void *) t;
+	
+	KASSERT((o  -4) != SDHC_DATA);
+
+	const uint32_t v = bus_space_read_4(sc-sc_bst, h, o  -4);
+
+	return v  ((o  3) * 8);
+}
+
+static uint16_t
+pq3sdhc_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o)
+{
+	const struct pq3sdhc_softc * const sc = (const void *) t;
+
+	KASSERT((o  1) == 0);
+	KASSERT((o  -4) != SDHC_DATA);
+
+	uint32_t v = bus_space_read_4(sc-sc_bst, h, o  -4);
+
+	if (__predict_false(o == SDHC_HOST_VER))
+		return v;
+	if (__predict_false(o == SDHC_NINTR_STATUS)) {
+		v |= SDHC_ERROR_INTERRUPT * ((v  0x) != 0);
+		if (v != 0)
+			printf(get(INTR_STATUS)=%#x\n, v);
+	}
+	if (__predict_false(o == SDHC_EINTR_STATUS)) {
+		if (v != 0)
+			printf(get(INTR_STATUS)=%#x\n, v);
+	}
+
+	return v  ((o  2) * 8);
+}
+
+static uint32_t
+pq3sdhc_read_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o)
+{
+	const struct pq3sdhc_softc * const sc = (const void *) t;
+
+	KASSERT((o  3) == 0);
+
+	uint32_t v = bus_space_read_4(sc-sc_bst, h, o  -4);
+
+	if (__predict_false(o == SDHC_DATA))
+		v = htole32(v);
+
+	return v;
+}
+
+static void
+pq3sdhc_write_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, uint8_t nv)
+{
+	const struct pq3sdhc_softc * const sc = (const void *) t;
+	KASSERT((o  -4) != SDHC_DATA);
+	uint32_t v = bus_space_read_4(sc-sc_bst, h, o  -4);
+	const u_int shift = (o  3) * 8;
+
+	if (o == SDHC_HOST_CTL) {
+		nv = ~EDSHC_HOST_CTL_RES;
+	}
+
+	v = ~(0xff  shift);
+	v |= (nv  shift);
+
+	bus_space_write_4(sc-sc_bst, h, o  -4, v);
+}
+
+static void
+pq3sdhc_write_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, uint16_t nv)
+{
+	const struct pq3sdhc_softc * const sc = (const void *) t;
+	KASSERT((o  1) == 0);
+	KASSERT((o  -4) != SDHC_DATA);
+	const u_int shift = (o  2) * 8;
+	uint32_t v;
+
+	/*
+	 * Since NINTR_STATUS and EINTR_STATUS are W1C, don't bother getting
+	 * the previous value since we'd clear them.
+	 */
+	if (__predict_true((o  -4) != SDHC_NINTR_STATUS)) {
+		v = bus_space_read_4(sc-sc_bst, h, o  -4);
+		v = ~(0x  shift);
+		v |= nv  shift;
+	} else {
+		v = nv  shift;
+		printf(put(INTR_STATUS,%#x)\n, v);
+	}
+
+	bus_space_write_4(sc-sc_bst, h, o  -4, v);
+}
+
+static void
+pq3sdhc_write_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, uint32_t v)
+{
+	const struct pq3sdhc_softc * const sc = (const void *) t;
+
+	KASSERT((o  3) == 0);
+
+	if (__predict_false(o == SDHC_DATA))
+		v = le32toh(v);
+
+	bus_space_write_4(sc-sc_bst, h, o  -4, v);
+}
+
 static int
 pq3sdhc_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -84,8 +195,18 @@
 	sc-sc.sc_dmat = cna-cna_dmat;
 	sc-sc.sc_dev = self;
 	//sc-sc.sc_flags |= SDHC_FLAG_USE_DMA;
+	sc-sc.sc_flags |= SDHC_FLAG_HAVE_DVS;
 	sc-sc.sc_host = sc-sc_hosts;
+	sc-sc.sc_clkbase = board_info_get_number(bus-frequency) / 2000;
 	sc-sc_bst = cna-cna_memt;
+	sc-sc_mybst = *cna-cna_memt;
+
+	sc-sc_mybst.pbs_scalar.pbss_read_1 = pq3sdhc_read_1;
+	sc-sc_mybst.pbs_scalar.pbss_read_2 = pq3sdhc_read_2;
+	sc-sc_mybst.pbs_scalar.pbss_read_4 = pq3sdhc_read_4;
+	sc-sc_mybst.pbs_scalar.pbss_write_1 = pq3sdhc_write_1;
+	

CVS commit: src/sys/arch

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:13:09 UTC 2011

Modified Files:
src/sys/arch/macppc/macppc: cpu.c
src/sys/arch/ofppc/ofppc: cpu.c
src/sys/arch/prep/prep: cpu.c

Log Message:
Adapt to cpu_hatch_data changes


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/macppc/macppc/cpu.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/ofppc/ofppc/cpu.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/prep/prep/cpu.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/macppc/macppc/cpu.c
diff -u src/sys/arch/macppc/macppc/cpu.c:1.56 src/sys/arch/macppc/macppc/cpu.c:1.57
--- src/sys/arch/macppc/macppc/cpu.c:1.56	Sun Jun  5 17:03:16 2011
+++ src/sys/arch/macppc/macppc/cpu.c	Wed Jun 29 06:13:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.56 2011/06/05 17:03:16 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.57 2011/06/29 06:13:08 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 Tsubai Masanari.
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.56 2011/06/05 17:03:16 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.57 2011/06/29 06:13:08 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_multiprocessor.h
@@ -218,7 +218,7 @@
 		*(u_int *)EXC_RST =		/* ba cpu_spinup_trampoline */
 		0x4802 | (u_int)cpu_spinup_trampoline;
 		__syncicache((void *)EXC_RST, 0x100);
-		h-running = -1;
+		h-hatch_running = -1;
 
 		/* see if there's an OF property for the reset register */
 		sprintf(cpupath, /cpus/@%x, ci-ci_cpuid);
@@ -260,14 +260,14 @@
 		tb = mftb();
 		tb += 10;  /* 3ms @ 33MHz */
 
-		h-tbu = tb  32;
-		h-tbl = tb  0x;
+		h-hatch_tbu = tb  32;
+		h-hatch_tbl = tb  0x;
 
 		while (tb  mftb())
 			;
 
 		__asm volatile (sync; isync);
-		h-running = 0;
+		h-hatch_running = 0;
 
 		delay(50);
 	} else
@@ -291,7 +291,7 @@
 		 * running.
 		 */
 		for (i = 0; i  10; i++)
-			if (h-running)
+			if (h-hatch_running)
 break;
 
 		/* Start timebase. */
@@ -308,9 +308,9 @@
 #ifdef OPENPIC
 	if (openpic_base) {
 		/* Sync timebase. */
-		u_int tbu = h-tbu;
-		u_int tbl = h-tbl;
-		while (h-running == -1)
+		u_int tbu = h-hatch_tbu;
+		u_int tbl = h-hatch_tbl;
+		while (h-hatch_running == -1)
 			;
 		__asm volatile (sync; isync);
 		__asm volatile (mttbl %0 :: r(0));

Index: src/sys/arch/ofppc/ofppc/cpu.c
diff -u src/sys/arch/ofppc/ofppc/cpu.c:1.15 src/sys/arch/ofppc/ofppc/cpu.c:1.16
--- src/sys/arch/ofppc/ofppc/cpu.c:1.15	Sun Jun  5 17:03:16 2011
+++ src/sys/arch/ofppc/ofppc/cpu.c	Wed Jun 29 06:13:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.15 2011/06/05 17:03:16 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.16 2011/06/29 06:13:09 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.15 2011/06/05 17:03:16 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.16 2011/06/29 06:13:09 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_multiprocessor.h
@@ -241,7 +241,7 @@
 	u_int msr;
 
 	msr = mfmsr();
-	h-running = -1;
+	h-hatch_running = -1;
 	cpu_spinstart_cpunum = ci-ci_cpuid;
 	__asm volatile(dcbf 0,%0::r(cpu_spinstart_cpunum):memory);
 
@@ -262,10 +262,10 @@
 		/* Sync timebase. */
 		tb = mftb();
 
-		h-tbu = tb  32;
-		h-tbl = tb  0x;
+		h-hatch_tbu = tb  32;
+		h-hatch_tbl = tb  0x;
 
-		h-running = 0;
+		h-hatch_running = 0;
 	}
 	/* otherwise, the machine has no rtas, or if it does, things
 	 * are pre-syncd, per PAPR v2.2.  I don't have anything without
@@ -284,7 +284,7 @@
 	 * running.
 	 */
 	for (i = 0; i  10; i++)
-		if (h-running)
+		if (h-hatch_running)
 			break;
 
 	/* Start timebase. */
@@ -293,17 +293,17 @@
 }
 
 /*
- * We wait for h-running to become 0, and then we know that the time is
- * frozen and h-tb is correct.
+ * We wait for h-hatch_running to become 0, and then we know that the time is
+ * frozen and h-hatch_tb is correct.
  */
 
 void
 md_sync_timebase(volatile struct cpu_hatch_data *h)
 {
 	/* Sync timebase. */
-	u_int tbu = h-tbu;
-	u_int tbl = h-tbl;
-	while (h-running == -1)
+	u_int tbu = h-hatch_tbu;
+	u_int tbl = h-hatch_tbl;
+	while (h-hatch_running == -1)
 		;
 	__asm volatile (sync; isync);
 	__asm volatile (mttbl %0 :: r(0));

Index: src/sys/arch/prep/prep/cpu.c
diff -u src/sys/arch/prep/prep/cpu.c:1.16 src/sys/arch/prep/prep/cpu.c:1.17
--- src/sys/arch/prep/prep/cpu.c:1.16	Sun Jun  5 17:03:17 2011
+++ src/sys/arch/prep/prep/cpu.c	Wed Jun 29 06:13:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.16 2011/06/05 17:03:17 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.17 2011/06/29 06:13:09 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.16 2011/06/05 17:03:17 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.17 2011/06/29 06:13:09 matt Exp $);
 

CVS commit: src/sys/dev/sdmmc

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:21:16 UTC 2011

Modified Files:
src/sys/dev/sdmmc: sdhc.c sdhcreg.h sdhcvar.h

Log Message:
Add some inital changes for the Freescale eSDHC.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/sdmmc/sdhcreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/sdmmc/sdhcvar.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/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.8 src/sys/dev/sdmmc/sdhc.c:1.9
--- src/sys/dev/sdmmc/sdhc.c:1.8	Thu Oct  7 12:06:10 2010
+++ src/sys/dev/sdmmc/sdhc.c	Wed Jun 29 06:21:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.8 2010/10/07 12:06:10 kiyohara Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.9 2011/06/29 06:21:16 matt Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sdhc.c,v 1.8 2010/10/07 12:06:10 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: sdhc.c,v 1.9 2011/06/29 06:21:16 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -176,8 +176,12 @@
 		aprint_normal(1.0/%u\n, SDHC_VENDOR_VERSION(sdhcver));
 		break;
 
+	case 0x01:
+		aprint_normal(2.0/%u\n, SDHC_VENDOR_VERSION(sdhcver));
+		break;
+
 	default:
-		aprint_normal(1.0/%u\n, SDHC_VENDOR_VERSION(sdhcver));
+		aprint_normal(2.0/%u\n, SDHC_VENDOR_VERSION(sdhcver));
 		break;
 	}
 #endif
@@ -227,10 +231,14 @@
 	if (SDHC_BASE_FREQ_KHZ(caps) != 0)
 		hp-clkbase = SDHC_BASE_FREQ_KHZ(caps);
 	if (hp-clkbase == 0) {
-		/* The attachment driver must tell us. */
-		aprint_error_dev(sc-sc_dev, unknown base clock frequency\n);
-		goto err;
-	} else if (hp-clkbase  1 || hp-clkbase  63000) {
+		if (sc-sc_clkbase == 0) {
+			/* The attachment driver must tell us. */
+			aprint_error_dev(sc-sc_dev,unknown base clock frequency\n);
+			goto err;
+		}
+		hp-clkbase = sc-sc_clkbase;
+	}
+	if (hp-clkbase  1 || hp-clkbase  1 * 256) {
 		/* SDHC 1.0 supports only 10-63 MHz. */
 		aprint_error_dev(sc-sc_dev,
 		base clock frequency out of range: %u MHz\n,
@@ -273,6 +281,10 @@
 		hp-maxblklen = 2048;
 		break;
 
+	case SDHC_MAX_BLK_LEN_4096:
+		hp-maxblklen = 4096;
+		break;
+
 	default:
 		aprint_error_dev(sc-sc_dev, max block length unknown\n);
 		goto err;
@@ -292,6 +304,8 @@
 	saa.saa_dmat = hp-dmat;
 	saa.saa_clkmin = hp-clkbase / 256;
 	saa.saa_clkmax = hp-clkbase;
+	if (ISSET(sc-sc_flags, SDHC_FLAG_HAVE_DVS))
+		saa.saa_clkmin /= 16;
 	saa.saa_caps = SMC_CAPS_4BIT_MODE|SMC_CAPS_AUTO_STOP;
 #if notyet
 	if (ISSET(hp-flags, SHF_USE_DMA))
@@ -561,9 +575,23 @@
 {
 	int div;
 
-	for (div = 1; div = 256; div *= 2)
-		if ((hp-clkbase / div) = freq)
-			return (div / 2);
+	if (hp-sc-sc_flags  SDHC_FLAG_HAVE_DVS) {
+		int dvs = (hp-clkbase + freq - 1) / freq;
+		div = 1;
+		for (div = 1; div = 256; div = 1, dvs = 1) {
+			if (dvs = 16) {
+div = SDHC_SDCLK_DIV_SHIFT;
+div |= (dvs - 1)  SDHC_SDCLK_DVS_SHIFT;
+return div;
+			}
+		}
+	} else {
+		for (div = 1; div = 256; div *= 2) {
+			if ((hp-clkbase / div) = freq)
+return (div / 2)  SDHC_SDCLK_DIV_SHIFT;
+		}
+	}
+
 	/* No divisor found. */
 	return -1;
 }
@@ -611,7 +639,7 @@
 		error = EINVAL;
 		goto out;
 	}
-	HWRITE2(hp, SDHC_CLOCK_CTL, div  SDHC_SDCLK_DIV_SHIFT);
+	HWRITE2(hp, SDHC_CLOCK_CTL, div);
 
 	/*
 	 * Start internal clock.  Wait 10ms for stabilization.
@@ -1199,8 +1227,13 @@
 		/*
 		 * Wake up the sdmmc event thread to scan for cards.
 		 */
-		if (ISSET(status, SDHC_CARD_REMOVAL|SDHC_CARD_INSERTION))
+		if (ISSET(status, SDHC_CARD_REMOVAL|SDHC_CARD_INSERTION)) {
 			sdmmc_needs_discover(hp-sdmmc);
+#if 0
+			HCLR2(hp, SDHC_NINTR_STATUS_EN,
+			status  (SDHC_CARD_REMOVAL|SDHC_CARD_INSERTION));
+#endif
+		}
 
 		/*
 		 * Wake up the blocking process to service command

Index: src/sys/dev/sdmmc/sdhcreg.h
diff -u src/sys/dev/sdmmc/sdhcreg.h:1.2 src/sys/dev/sdmmc/sdhcreg.h:1.3
--- src/sys/dev/sdmmc/sdhcreg.h:1.2	Thu Mar 17 16:56:58 2011
+++ src/sys/dev/sdmmc/sdhcreg.h	Wed Jun 29 06:21:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcreg.h,v 1.2 2011/03/17 16:56:58 matt Exp $	*/
+/*	$NetBSD: sdhcreg.h,v 1.3 2011/06/29 06:21:16 matt Exp $	*/
 /*	$OpenBSD: sdhcreg.h,v 1.4 2006/07/30 17:20:40 fgsch Exp $	*/
 
 /*
@@ -112,6 +112,7 @@
 #define  SDHC_COMMAND_COMPLETE		(10)
 #define  SDHC_NINTR_STATUS_MASK		0x81ff
 #define SDHC_EINTR_STATUS		0x32
+#define  SDHC_DMA_ERROR			(112)
 #define  SDHC_AUTO_CMD12_ERROR		(18)
 #define  SDHC_CURRENT_LIMIT_ERROR	(17)
 #define  SDHC_DATA_END_BIT_ERROR	(16)
@@ -147,6 +148,11 @@
 #define  SDHC_TIMEOUT_FREQ_SHIFT	0
 #define  SDHC_TIMEOUT_FREQ_MASK		0x1f
 #define SDHC_MAX_CAPABILITIES		0x48
+#define	SDHC_HOST_VER			0xFC
+#define  SDHC_VVN_MASK			0x0f
+#define  SDHC_VVN_SHIFT			0x04
+#define  SDHC_SVN_MASK			0x0f
+#define  SDHC_SVN_SHIFT			0x00
 #define SDHC_SLOT_INTR_STATUS		0xfc
 #define 

CVS commit: src/sys/kern

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:22:21 UTC 2011

Modified Files:
src/sys/kern: kern_cpu.c

Log Message:
Add the new ci to cpu_infos *before* calling routines which may want to
cpu_lookup.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_cpu.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/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.46 src/sys/kern/kern_cpu.c:1.47
--- src/sys/kern/kern_cpu.c:1.46	Fri May 13 22:16:43 2011
+++ src/sys/kern/kern_cpu.c	Wed Jun 29 06:22:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.46 2011/05/13 22:16:43 rmind Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.47 2011/06/29 06:22:21 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_cpu.c,v 1.46 2011/05/13 22:16:43 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_cpu.c,v 1.47 2011/06/29 06:22:21 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -128,6 +128,12 @@
 	snprintf(ci-ci_data.cpu_name, sizeof(ci-ci_data.cpu_name), cpu%d,
 	cpu_index(ci));
 
+	if (__predict_false(cpu_infos == NULL)) {
+		cpu_infos =
+		kmem_zalloc(sizeof(cpu_infos[0]) * maxcpus, KM_SLEEP);
+	}
+	cpu_infos[cpu_index(ci)] = ci;
+
 	sched_cpuattach(ci);
 
 	error = create_idle_lwp(ci);
@@ -152,12 +158,6 @@
 	ncpu++;
 	ncpuonline++;
 
-	if (cpu_infos == NULL) {
-		cpu_infos =
-		kmem_zalloc(sizeof(cpu_infos[0]) * maxcpus, KM_SLEEP);
-	}
-	cpu_infos[cpu_index(ci)] = ci;
-
 	return 0;
 }
 



CVS commit: src/sys/arch/evbppc/conf

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 06:23:36 UTC 2011

Added Files:
src/sys/arch/evbppc/conf: INSTALL_P2020DS.MP INSTALL_P2020RDB.MP
P2020DS.MP P2020RDB.MP

Log Message:
Add some config files for the P2020.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbppc/conf/INSTALL_P2020DS.MP \
src/sys/arch/evbppc/conf/INSTALL_P2020RDB.MP \
src/sys/arch/evbppc/conf/P2020DS.MP src/sys/arch/evbppc/conf/P2020RDB.MP

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

Added files:

Index: src/sys/arch/evbppc/conf/INSTALL_P2020DS.MP
diff -u /dev/null src/sys/arch/evbppc/conf/INSTALL_P2020DS.MP:1.1
--- /dev/null	Wed Jun 29 06:23:36 2011
+++ src/sys/arch/evbppc/conf/INSTALL_P2020DS.MP	Wed Jun 29 06:23:36 2011
@@ -0,0 +1,10 @@
+# 	$NetBSD: INSTALL_P2020DS.MP,v 1.1 2011/06/29 06:23:36 matt Exp $
+
+include arch/evbppc/conf/P2020DS.MP
+
+#ident 		INSTALL_P2020DS-$Revision: 1.1 $
+
+include arch/evbppc/conf/INSTALL.inc
+
+no config nfsnetbsd
+no config netbsd-esata
Index: src/sys/arch/evbppc/conf/INSTALL_P2020RDB.MP
diff -u /dev/null src/sys/arch/evbppc/conf/INSTALL_P2020RDB.MP:1.1
--- /dev/null	Wed Jun 29 06:23:36 2011
+++ src/sys/arch/evbppc/conf/INSTALL_P2020RDB.MP	Wed Jun 29 06:23:36 2011
@@ -0,0 +1,9 @@
+# 	$NetBSD: INSTALL_P2020RDB.MP,v 1.1 2011/06/29 06:23:36 matt Exp $
+
+include arch/evbppc/conf/P2020RDB.MP
+
+#ident 		INSTALL_P2020DS-$Revision: 1.1 $
+
+include arch/evbppc/conf/INSTALL.inc
+
+no config nfsnetbsd
Index: src/sys/arch/evbppc/conf/P2020DS.MP
diff -u /dev/null src/sys/arch/evbppc/conf/P2020DS.MP:1.1
--- /dev/null	Wed Jun 29 06:23:36 2011
+++ src/sys/arch/evbppc/conf/P2020DS.MP	Wed Jun 29 06:23:36 2011
@@ -0,0 +1,9 @@
+# $NetBSD: P2020DS.MP,v 1.1 2011/06/29 06:23:36 matt Exp $
+#
+#	P2020DS kernel, plus multiprocessor support.
+
+include	arch/evbppc/conf/P2020DS
+
+options 	MULTIPROCESSOR
+# this option may cause trouble under very high interrupt load
+#options 	OPENPIC_DISTRIBUTE	# let all CPUs serve interrupts
Index: src/sys/arch/evbppc/conf/P2020RDB.MP
diff -u /dev/null src/sys/arch/evbppc/conf/P2020RDB.MP:1.1
--- /dev/null	Wed Jun 29 06:23:36 2011
+++ src/sys/arch/evbppc/conf/P2020RDB.MP	Wed Jun 29 06:23:36 2011
@@ -0,0 +1,9 @@
+# $NetBSD: P2020RDB.MP,v 1.1 2011/06/29 06:23:36 matt Exp $
+#
+#	P2020RDB kernel, plus multiprocessor support.
+
+include	arch/evbppc/conf/P2020RDB
+
+options 	MULTIPROCESSOR
+# this option may cause trouble under very high interrupt load
+#options 	OPENPIC_DISTRIBUTE	# let all CPUs serve interrupts



CVS commit: src/external/gpl3/gcc/dist/gcc

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 06:24:48 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc: targhooks.c

Log Message:
pull across from gcc 4.1 tree:

revision 1.2
date: 2007/09/15 16:24:06;  author: christos;  state: Exp;  lines: +10 -0
Add a hack to handle that the __stack_chk_fail_local call is not generated
properly for pic code; more explained in the code.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/targhooks.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/targhooks.c
diff -u src/external/gpl3/gcc/dist/gcc/targhooks.c:1.1.1.1 src/external/gpl3/gcc/dist/gcc/targhooks.c:1.2
--- src/external/gpl3/gcc/dist/gcc/targhooks.c:1.1.1.1	Tue Jun 21 01:20:15 2011
+++ src/external/gpl3/gcc/dist/gcc/targhooks.c	Wed Jun 29 06:24:48 2011
@@ -569,7 +569,17 @@
   DECL_ARTIFICIAL (t) = 1;
   DECL_IGNORED_P (t) = 1;
   DECL_VISIBILITY_SPECIFIED (t) = 1;
+#if 1
+  /*
+   * This is a hack:
+   * It appears that our gas does not generate @PLT for hidden
+   * symbols. It could be that we need a newer version, or that
+   * this local function is handled differently on linux.
+   */
+  DECL_VISIBILITY (t) = VISIBILITY_DEFAULT;
+#else
   DECL_VISIBILITY (t) = VISIBILITY_HIDDEN;
+#endif
 
   stack_chk_fail_decl = t;
 }



CVS commit: src/usr.sbin/dhcp/common

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 06:32:32 UTC 2011

Modified Files:
src/usr.sbin/dhcp/common: Makefile

Log Message:
-Wno-enum-compare is only valid for GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/dhcp/common/Makefile

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

Modified files:

Index: src/usr.sbin/dhcp/common/Makefile
diff -u src/usr.sbin/dhcp/common/Makefile:1.24 src/usr.sbin/dhcp/common/Makefile:1.25
--- src/usr.sbin/dhcp/common/Makefile:1.24	Wed Jun 29 02:40:11 2011
+++ src/usr.sbin/dhcp/common/Makefile	Wed Jun 29 06:32:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2011/06/29 02:40:11 mrg Exp $
+# $NetBSD: Makefile,v 1.25 2011/06/29 06:32:32 mrg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -13,4 +13,6 @@
 
 .include bsd.lib.mk
 
+.if defined(HAVE_GCC)  HAVE_GCC = 45
 CPPFLAGS.dns.c+=	-Wno-enum-compare
+.endif



CVS commit: src/usr.sbin/dhcp

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 06:34:31 UTC 2011

Modified Files:
src/usr.sbin/dhcp/common: Makefile
src/usr.sbin/dhcp/server: Makefile

Log Message:
fix previous / -Wno-enum-compare is only valid for GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/dhcp/common/Makefile
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/dhcp/server/Makefile

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

Modified files:

Index: src/usr.sbin/dhcp/common/Makefile
diff -u src/usr.sbin/dhcp/common/Makefile:1.25 src/usr.sbin/dhcp/common/Makefile:1.26
--- src/usr.sbin/dhcp/common/Makefile:1.25	Wed Jun 29 06:32:32 2011
+++ src/usr.sbin/dhcp/common/Makefile	Wed Jun 29 06:34:31 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2011/06/29 06:32:32 mrg Exp $
+# $NetBSD: Makefile,v 1.26 2011/06/29 06:34:31 mrg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -13,6 +13,6 @@
 
 .include bsd.lib.mk
 
-.if defined(HAVE_GCC)  HAVE_GCC = 45
+.if defined(HAVE_GCC)  ${HAVE_GCC} = 45
 CPPFLAGS.dns.c+=	-Wno-enum-compare
 .endif

Index: src/usr.sbin/dhcp/server/Makefile
diff -u src/usr.sbin/dhcp/server/Makefile:1.15 src/usr.sbin/dhcp/server/Makefile:1.16
--- src/usr.sbin/dhcp/server/Makefile:1.15	Wed Jun 29 02:40:11 2011
+++ src/usr.sbin/dhcp/server/Makefile	Wed Jun 29 06:34:31 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2011/06/29 02:40:11 mrg Exp $
+# $NetBSD: Makefile,v 1.16 2011/06/29 06:34:31 mrg Exp $
 
 .include bsd.own.mk
 
@@ -21,4 +21,6 @@
 
 .include bsd.prog.mk
 
+.if defined(HAVE_GCC)  ${HAVE_GCC} = 45
 CPPFLAGS.ddns.c+=	-Wno-enum-compare
+.endif



CVS commit: src/sys/kern

2011-06-29 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed Jun 29 08:01:14 UTC 2011

Modified Files:
src/sys/kern: vfs_xattr.c

Log Message:
Fix bug introduced in previous commuit: Do not vrele() a vnode we did not
obtained.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/kern/vfs_xattr.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/kern/vfs_xattr.c
diff -u src/sys/kern/vfs_xattr.c:1.25 src/sys/kern/vfs_xattr.c:1.26
--- src/sys/kern/vfs_xattr.c:1.25	Tue Jun 28 07:50:03 2011
+++ src/sys/kern/vfs_xattr.c	Wed Jun 29 08:01:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_xattr.c,v 1.25 2011/06/28 07:50:03 manu Exp $	*/
+/*	$NetBSD: vfs_xattr.c,v 1.26 2011/06/29 08:01:14 manu Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_xattr.c,v 1.25 2011/06/28 07:50:03 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_xattr.c,v 1.26 2011/06/29 08:01:14 manu Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -794,7 +794,7 @@
 	error = namei_simple_user(SCARG(uap, path),
 NSM_FOLLOW_NOEMULROOT, vp);
 	if (error)
-		goto out_rele;
+		goto out;
 
 	namespace = xattr_native(attrname);
 
@@ -802,7 +802,6 @@
 	attrname, SCARG(uap, value), SCARG(uap, size), l, 
 	attrlen, SCARG(uap, flags));
 
-out_rele:
 	vrele(vp);
 out:
 	*retval = (error == 0) ? 0 : -1;
@@ -833,7 +832,7 @@
 	error = namei_simple_user(SCARG(uap, path),
 NSM_NOFOLLOW_NOEMULROOT, vp);
 	if (error)
-		goto out_rele;
+		goto out;
 
 	namespace = xattr_native(attrname);
 
@@ -841,7 +840,6 @@
 	attrname, SCARG(uap, value), SCARG(uap, size), l,
 	attrlen, SCARG(uap, flags));
 
-out_rele:
 	vrele(vp);
 out:
 	*retval = (error == 0) ? 0 : -1;



CVS commit: src/external/gpl3/gcc/dist/gcc

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 08:08:54 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
powerpc*-netbsd* wants svr4.h these days.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/config.gcc

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.3 src/external/gpl3/gcc/dist/gcc/config.gcc:1.4
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.3	Tue Jun 21 07:28:44 2011
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Wed Jun 29 08:08:54 2011
@@ -1975,7 +1975,7 @@
 	extra_options=${extra_options} rs6000/sysv4.opt
 	;;
 powerpc*-*-netbsd*)
-	tm_file=${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h
+	tm_file=${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h svr4.h freebsd-spec.h rs6000/sysv4.h
 	case ${target} in
 	  powerpc64*)
 	tm_file=rs6000/biarch64.h ${tm_file} rs6000/default64.h rs6000/netbsd64.h



CVS commit: src/external/lgpl3/gmp/lib/libgmp

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 08:09:43 UTC 2011

Modified Files:
src/external/lgpl3/gmp/lib/libgmp: Makefile

Log Message:
enable lint.
fix the 32 / 64 bit problem.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/lgpl3/gmp/lib/libgmp/Makefile

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

Modified files:

Index: src/external/lgpl3/gmp/lib/libgmp/Makefile
diff -u src/external/lgpl3/gmp/lib/libgmp/Makefile:1.3 src/external/lgpl3/gmp/lib/libgmp/Makefile:1.4
--- src/external/lgpl3/gmp/lib/libgmp/Makefile:1.3	Fri Jun 24 03:50:23 2011
+++ src/external/lgpl3/gmp/lib/libgmp/Makefile	Wed Jun 29 08:09:43 2011
@@ -1,12 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2011/06/24 03:50:23 mrg Exp $
+#	$NetBSD: Makefile,v 1.4 2011/06/29 08:09:43 mrg Exp $
 
 .include bsd.init.mk
 
 DIST=${.CURDIR}/../../dist
 
-# XXX
-MKLINT=no
-
 LIB=	gmp
 
 MPF_SRCS = \
@@ -167,29 +164,29 @@
 
 fac_ui.h: gen-fac_ui.c
 	${HOST_CC} -o ${.OBJDIR}/gen-fac_ui ${.ALLSRC}
-	${.OBJDIR}/gen-fac_ui 64 0  ${.OBJDIR}/fac_ui.h
+	${.OBJDIR}/gen-fac_ui ${GMP_LIMB_BITS} 0  ${.OBJDIR}/fac_ui.h
 
 gen-fib: gen-fib.c
 	${HOST_CC} -o ${.OBJDIR}/gen-fib ${.ALLSRC}
 
 fib_table.h: gen-fib
-	${.OBJDIR}/gen-fib header 64 0  ${.OBJDIR}/fib_table.h
+	${.OBJDIR}/gen-fib header ${GMP_LIMB_BITS} 0  ${.OBJDIR}/fib_table.h
 
 fib_table.c: gen-fib
-	${.OBJDIR}/gen-fib table 64 0  ${.OBJDIR}/fib_table.c
+	${.OBJDIR}/gen-fib table ${GMP_LIMB_BITS} 0  ${.OBJDIR}/fib_table.c
 
 gen-bases: gen-bases.c
 	${HOST_CC} -o ${.OBJDIR}/gen-bases ${.ALLSRC} -lm
 
 mp_bases.h: gen-bases
-	${.OBJDIR}/gen-bases header 64 0  ${.OBJDIR}/mp_bases.h
+	${.OBJDIR}/gen-bases header ${GMP_LIMB_BITS} 0  ${.OBJDIR}/mp_bases.h
 
 mp_bases.c: gen-bases
-	${.OBJDIR}/gen-bases table 64 0  ${.OBJDIR}/mp_bases.c
+	${.OBJDIR}/gen-bases table ${GMP_LIMB_BITS} 0  ${.OBJDIR}/mp_bases.c
 
 perfsqr.h: gen-psqr.c
 	${HOST_CC} -o ${.OBJDIR}/gen-psqr ${.ALLSRC}
-	${.OBJDIR}/gen-psqr 64 0  ${.OBJDIR}/perfsqr.h
+	${.OBJDIR}/gen-psqr ${GMP_LIMB_BITS} 0  ${.OBJDIR}/perfsqr.h
 
 CLEANFILES+=	${DPSRCS} gen-fac_ui gen-fib gen-bases gen-psqr
 



CVS commit: src/share/mk

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 08:10:05 UTC 2011

Modified Files:
src/share/mk: bsd.sys.mk

Log Message:
XXX: for now, disable fatal linker warnings for GCC 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.204 src/share/mk/bsd.sys.mk:1.205
--- src/share/mk/bsd.sys.mk:1.204	Mon Jun 20 06:52:37 2011
+++ src/share/mk/bsd.sys.mk	Wed Jun 29 08:10:05 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.204 2011/06/20 06:52:37 mrg Exp $
+#	$NetBSD: bsd.sys.mk,v 1.205 2011/06/29 08:10:05 mrg Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -39,7 +39,10 @@
 # XXX on linking static libs
 .if (!defined(MKPIC) || ${MKPIC} != no)  \
 (!defined(LDSTATIC) || ${LDSTATIC} != -static)
+# XXX there are some strange problems not yet resolved
+. if !defined(HAVE_GCC) || ${HAVE_GCC} != 45
 LDFLAGS+=	-Wl,--fatal-warnings
+. endif
 .endif
 .endif
 .if ${WARNS}  1



CVS commit: src/external/gpl3/gcc/usr.bin/include

2011-06-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 08:37:10 UTC 2011

Modified Files:
src/external/gpl3/gcc/usr.bin/include: Makefile

Log Message:
GCC 4.5 x86 installs a bunch more platform header files


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/usr.bin/include/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/include/Makefile
diff -u src/external/gpl3/gcc/usr.bin/include/Makefile:1.1 src/external/gpl3/gcc/usr.bin/include/Makefile:1.2
--- src/external/gpl3/gcc/usr.bin/include/Makefile:1.1	Tue Jun 21 06:03:15 2011
+++ src/external/gpl3/gcc/usr.bin/include/Makefile	Wed Jun 29 08:37:10 2011
@@ -1,12 +1,33 @@
-#	$NetBSD: Makefile,v 1.1 2011/06/21 06:03:15 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2011/06/29 08:37:10 mrg Exp $
 
 .include ../Makefile.inc
 
 .if ${MACHINE_CPU} == powerpc
 INCS=	altivec.h
 .elif ${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == x86_64
-INCS=	emmintrin.h mmintrin.h pmmintrin.h xmmintrin.h mm_malloc.h
+INCS= \
+	mmintrin.h \
+	mm3dnow.h \
+	xmmintrin.h \
+	emmintrin.h \
+	pmmintrin.h \
+	tmmintrin.h \
+	ammintrin.h \
+	smmintrin.h \
+	nmmintrin.h \
+	bmmintrin.h \
+	fma4intrin.h \
+	wmmintrin.h \
+	immintrin.h \
+	x86intrin.h \
+	avxintrin.h \
+	xopintrin.h \
+	ia32intrin.h \
+	popcntintrin.h \
+	lwpintrin.h \
+	abmintrin.h
 
+# XXX this comment is no longer true:
 # We don't have posix_memalign, so use the gmm_malloc.h version.
 mm_malloc.h: ${DIST}/gcc/config/i386/gmm_malloc.h
 	cp $ ${.TARGET}



CVS commit: src/sys/dev

2011-06-29 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jun 29 09:12:42 UTC 2011

Modified Files:
src/sys/dev: vnd.c vndvar.h

Log Message:
Make vnd(4) work on sparse files:
- Make the strategy decision a device flag and set VNF_USE_VN_RDWR for
  files known to be sparse.
- Change handle_with_rdwr() to use POSIX_FADV_NOREUSE advise to disable
  read ahead and keep the size of mapped pages below 1 MByte.

No objections on tech-kern@.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/dev/vnd.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/vndvar.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/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.217 src/sys/dev/vnd.c:1.218
--- src/sys/dev/vnd.c:1.217	Sun Jun 12 03:35:51 2011
+++ src/sys/dev/vnd.c	Wed Jun 29 09:12:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.217 2011/06/12 03:35:51 rmind Exp $	*/
+/*	$NetBSD: vnd.c,v 1.218 2011/06/29 09:12:42 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.217 2011/06/12 03:35:51 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.218 2011/06/29 09:12:42 hannken Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_vnd.h
@@ -549,7 +549,6 @@
 vndthread(void *arg)
 {
 	struct vnd_softc *vnd = arg;
-	bool usestrategy;
 	int s;
 
 	/* Determine whether we can *use* VOP_BMAP and VOP_STRATEGY to
@@ -557,12 +556,14 @@
 	 * operations to avoid messing with the local buffer cache.
 	 * Otherwise fall back to regular VOP_READ/VOP_WRITE operations
 	 * which are guaranteed to work with any file system. */
-	usestrategy = vnode_has_strategy(vnd);
+	if ((vnd-sc_flags  VNF_USE_VN_RDWR) == 0 
+	! vnode_has_strategy(vnd))
+		vnd-sc_flags |= VNF_USE_VN_RDWR;
 
 #ifdef DEBUG
 	if (vnddebug  VDB_INIT)
 		printf(vndthread: vp %p, %s\n, vnd-sc_vp,
-		usestrategy ?
+		(vnd-sc_flags  VNF_USE_VN_RDWR) == 0 ?
 		using bmap/strategy operations :
 		using read/write operations);
 #endif
@@ -644,7 +645,7 @@
 		BIO_COPYPRIO(bp, obp);
 
 		/* Handle the request using the appropriate operations. */
-		if (usestrategy)
+		if ((vnd-sc_flags  VNF_USE_VN_RDWR) == 0)
 			handle_with_strategy(vnd, obp, bp);
 		else
 			handle_with_rdwr(vnd, obp, bp);
@@ -696,11 +697,12 @@
 {
 	bool doread;
 	off_t offset;
-	size_t resid;
+	size_t len, resid;
 	struct vnode *vp;
 
 	doread = bp-b_flags  B_READ;
 	offset = obp-b_rawblkno * vnd-sc_dkdev.dk_label-d_secsize;
+	len = bp-b_bcount;
 	vp = vnd-sc_vp;
 
 #if defined(DEBUG)
@@ -716,10 +718,18 @@
 	/* Issue the read or write operation. */
 	bp-b_error =
 	vn_rdwr(doread ? UIO_READ : UIO_WRITE,
-	vp, bp-b_data, bp-b_bcount, offset,
-	UIO_SYSSPACE, 0, vnd-sc_cred, resid, NULL);
+	vp, bp-b_data, len, offset, UIO_SYSSPACE,
+	IO_ADV_ENCODE(POSIX_FADV_NOREUSE), vnd-sc_cred, resid, NULL);
 	bp-b_resid = resid;
 
+	/* Keep mapped pages below threshold. */
+	mutex_enter(vp-v_interlock);
+	if (vp-v_uobj.uo_npages  1024*1024 / PAGE_SIZE)
+		(void) VOP_PUTPAGES(vp, 0, 0,
+		PGO_ALLPAGES | PGO_CLEANIT | PGO_FREE | PGO_SYNCIO);
+	else
+		mutex_exit(vp-v_interlock);
+
 	/* We need to increase the number of outputs on the vnode if
 	 * there was any write to it. */
 	if (!doread) {
@@ -1076,8 +1086,8 @@
 		if (!error  nd.ni_vp-v_type != VREG)
 			error = EOPNOTSUPP;
 		if (!error  vattr.va_bytes  vattr.va_size)
-			/* File is definitely sparse, reject here */
-			error = EINVAL;
+			/* File is definitely sparse, use vn_rdwr() */
+			vnd-sc_flags |= VNF_USE_VN_RDWR;
 		if (error) {
 			VOP_UNLOCK(nd.ni_vp);
 			goto close_and_exit;

Index: src/sys/dev/vndvar.h
diff -u src/sys/dev/vndvar.h:1.30 src/sys/dev/vndvar.h:1.31
--- src/sys/dev/vndvar.h:1.30	Tue Feb  8 20:20:26 2011
+++ src/sys/dev/vndvar.h	Wed Jun 29 09:12:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vndvar.h,v 1.30 2011/02/08 20:20:26 rmind Exp $	*/
+/*	$NetBSD: vndvar.h,v 1.31 2011/06/29 09:12:42 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -142,6 +142,7 @@
 #define	VNF_VUNCONF	0x200	/* device is unconfiguring */
 #define VNF_COMP	0x400	/* file is compressed */
 #define VNF_CLEARING	0x800	/* unit is being torn down */
+#define VNF_USE_VN_RDWR	0x1000	/* have to use vn_rdwr() */
 
 /* structure of header in a compressed file */
 struct vnd_comp_header



CVS commit: src/distrib/sets/lists/xserver

2011-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jun 29 14:35:13 UTC 2011

Modified Files:
src/distrib/sets/lists/xserver: md.newsmips

Log Message:
Update a list for newsmips. The previous one has a bit obsolete entries.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/lists/xserver/md.newsmips

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

Modified files:

Index: src/distrib/sets/lists/xserver/md.newsmips
diff -u src/distrib/sets/lists/xserver/md.newsmips:1.6 src/distrib/sets/lists/xserver/md.newsmips:1.7
--- src/distrib/sets/lists/xserver/md.newsmips:1.6	Sat May 21 11:52:30 2011
+++ src/distrib/sets/lists/xserver/md.newsmips	Wed Jun 29 14:35:13 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.newsmips,v 1.6 2011/05/21 11:52:30 tsutsui Exp $
+# $NetBSD: md.newsmips,v 1.7 2011/06/29 14:35:13 tsutsui Exp $
 ./usr/X11R6/bin/X	-unknown-	x11
 ./usr/X11R6/bin/Xnewsmips-unknown-	x11
 ./usr/X11R6/man/cat1/Xnewsmips.0			-unknown-	.cat,x11
@@ -8,8 +8,9 @@
 ./usr/X11R7/bin/Xorg	-unknown-	xorg
 ./usr/X11R7/bin/cvt	-unknown-	xorg
 ./usr/X11R7/bin/gtf	-unknown-	xorg
-./usr/X11R7/lib/X11/doc/README.DRI			-unknown-	xorg
-./usr/X11R7/lib/X11/doc/README.rapidaccess		-unknown-	xorg
+./usr/X11R7/lib/X11/doc/README.DRI			-unknown-	obsolete
+./usr/X11R7/lib/X11/doc/README.modes			-unknown-	xorg
+./usr/X11R7/lib/X11/doc/README.rapidaccess		-unknown-	obsolete
 ./usr/X11R7/lib/modules/drivers/kbd_drv.so		-unknown-	xorg
 ./usr/X11R7/lib/modules/drivers/kbd_drv.so.1		-unknown-	xorg
 ./usr/X11R7/lib/modules/drivers/mouse_drv.so		-unknown-	xorg
@@ -118,3 +119,4 @@
 ./usr/X11R7/man/man4/ws.4-unknown-	.man,xorg
 ./usr/X11R7/man/man4/wsfb.4-unknown-	.man,xorg
 ./usr/X11R7/man/man5/xorg.conf.5			-unknown-	.man,xorg
+./usr/X11R7/share/aclocal/xorg-server.m4		-unknown-	xorg



CVS commit: src/external/mit/xorg/server/drivers

2011-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jun 29 14:38:02 UTC 2011

Modified Files:
src/external/mit/xorg/server/drivers: Makefile

Log Message:
Sort.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/external/mit/xorg/server/drivers/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile
diff -u src/external/mit/xorg/server/drivers/Makefile:1.55 src/external/mit/xorg/server/drivers/Makefile:1.56
--- src/external/mit/xorg/server/drivers/Makefile:1.55	Tue May 17 22:29:06 2011
+++ src/external/mit/xorg/server/drivers/Makefile	Wed Jun 29 14:38:02 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.55 2011/05/17 22:29:06 macallan Exp $
+#	$NetBSD: Makefile,v 1.56 2011/06/29 14:38:02 tsutsui Exp $
 
 # xf86-input drivers
 
@@ -178,6 +178,12 @@
 #	xf86-video-imstt
 .endif	# ${MACHINE} == macppc
 
+.if ${MACHINE} == netwinder
+SUBDIR+= \
+	xf86-video-wsfb
+#	xf86-video-igs
+.endif	# ${MACHINE} == netwinder
+
 .if ${MACHINE} == ofppc
 SUBDIR+= \
 	xf86-video-ati \
@@ -191,12 +197,6 @@
 	xf86-video-wsfb
 .endif	# ${MACHINE} == ofppc
 
-.if ${MACHINE} == netwinder
-SUBDIR+= \
-	xf86-video-wsfb
-#	xf86-video-igs
-.endif	# ${MACHINE} == netwinder
-
 .if ${MACHINE} == prep
 SUBDIR+= \
 	xf86-video-cirrus \



CVS commit: src/external/mit/xorg/server

2011-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jun 29 14:49:14 UTC 2011

Modified Files:
src/external/mit/xorg/server/drivers: Makefile
src/external/mit/xorg/server/xorg-server: Makefile.common
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos: Makefile

Log Message:
Add definitions for newsmips Xorg server.  Build test only.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/external/mit/xorg/server/drivers/Makefile
cvs rdiff -u -r1.20 -r1.21 \
src/external/mit/xorg/server/xorg-server/Makefile.common
cvs rdiff -u -r1.28 -r1.29 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile
diff -u src/external/mit/xorg/server/drivers/Makefile:1.56 src/external/mit/xorg/server/drivers/Makefile:1.57
--- src/external/mit/xorg/server/drivers/Makefile:1.56	Wed Jun 29 14:38:02 2011
+++ src/external/mit/xorg/server/drivers/Makefile	Wed Jun 29 14:49:12 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.56 2011/06/29 14:38:02 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.57 2011/06/29 14:49:12 tsutsui Exp $
 
 # xf86-input drivers
 
@@ -197,6 +197,11 @@
 	xf86-video-wsfb
 .endif	# ${MACHINE} == ofppc
 
+.if ${MACHINE} == newsmips
+SUBDIR+= \
+	xf86-video-wsfb
+.endif	# ${MACHINE} == newsmips
+
 .if ${MACHINE} == prep
 SUBDIR+= \
 	xf86-video-cirrus \

Index: src/external/mit/xorg/server/xorg-server/Makefile.common
diff -u src/external/mit/xorg/server/xorg-server/Makefile.common:1.20 src/external/mit/xorg/server/xorg-server/Makefile.common:1.21
--- src/external/mit/xorg/server/xorg-server/Makefile.common:1.20	Wed Feb  9 13:37:48 2011
+++ src/external/mit/xorg/server/xorg-server/Makefile.common	Wed Jun 29 14:49:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.20 2011/02/09 13:37:48 tsutsui Exp $
+#	$NetBSD: Makefile.common,v 1.21 2011/06/29 14:49:13 tsutsui Exp $
 
 # These define parts of the Xserver tree that are to be
 # conditionally compiled for different platforms.  See
@@ -20,6 +20,7 @@
 ${MACHINE} == i386	|| \
 ${MACHINE} == macppc	|| \
 ${MACHINE} == netwinder	|| \
+${MACHINE} == newsmips	|| \
 ${MACHINE} == prep	|| \
 ${MACHINE} == ofppc	|| \
 ${MACHINE} == sgimips	|| \
@@ -60,9 +61,9 @@
 XSERVER_XMACPPC=	yes
 .endif
 
-.if ${MACHINE} == newsmips
-XSERVER_XNEWSMIPS?=	yes
-.endif
+#.if ${MACHINE} == newsmips
+#XSERVER_XNEWSMIPS?=	yes
+#.endif
 
 .if ${MACHINE} == pmax
 XSERVER_XDECNETBSD=	yes

Index: src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile
diff -u src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile:1.28 src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile:1.29
--- src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile:1.28	Mon Feb 21 04:42:17 2011
+++ src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile	Wed Jun 29 14:49:14 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2011/02/21 04:42:17 mrg Exp $
+#	$NetBSD: Makefile,v 1.29 2011/06/29 14:49:14 tsutsui Exp $
 
 .include ../../../Makefile.serverlib
 .include ../../../Makefile.servermod
@@ -59,6 +59,7 @@
 
 .if ${MACHINE} == ews4800mips || \
 ${MACHINE} == hpcmips || \
+${MACHINE} == newsmips || \
 ${MACHINE} == sgimips
 SRCS.bsd+=	ppc_video.c pm_noop.c agp_noop.c
 .for _FN in ${SRCS.bsd}



CVS commit: src/external/mit/xorg/server/drivers

2011-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jun 29 14:52:18 UTC 2011

Modified Files:
src/external/mit/xorg/server/drivers: Makefile

Log Message:
More sort. (i.e. fix merge botch)


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/external/mit/xorg/server/drivers/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile
diff -u src/external/mit/xorg/server/drivers/Makefile:1.57 src/external/mit/xorg/server/drivers/Makefile:1.58
--- src/external/mit/xorg/server/drivers/Makefile:1.57	Wed Jun 29 14:49:12 2011
+++ src/external/mit/xorg/server/drivers/Makefile	Wed Jun 29 14:52:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.57 2011/06/29 14:49:12 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.58 2011/06/29 14:52:18 tsutsui Exp $
 
 # xf86-input drivers
 
@@ -184,6 +184,11 @@
 #	xf86-video-igs
 .endif	# ${MACHINE} == netwinder
 
+.if ${MACHINE} == newsmips
+SUBDIR+= \
+	xf86-video-wsfb
+.endif	# ${MACHINE} == newsmips
+
 .if ${MACHINE} == ofppc
 SUBDIR+= \
 	xf86-video-ati \
@@ -197,11 +202,6 @@
 	xf86-video-wsfb
 .endif	# ${MACHINE} == ofppc
 
-.if ${MACHINE} == newsmips
-SUBDIR+= \
-	xf86-video-wsfb
-.endif	# ${MACHINE} == newsmips
-
 .if ${MACHINE} == prep
 SUBDIR+= \
 	xf86-video-cirrus \



CVS commit: src/sys/uvm

2011-06-29 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jun 29 19:51:12 UTC 2011

Modified Files:
src/sys/uvm: uvm_bio.c

Log Message:
Remove dead uvm_vnp_zerorange() after bump to 5.99.54.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/uvm/uvm_bio.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/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.77 src/sys/uvm/uvm_bio.c:1.78
--- src/sys/uvm/uvm_bio.c:1.77	Sun Jun 19 02:42:53 2011
+++ src/sys/uvm/uvm_bio.c	Wed Jun 29 19:51:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_bio.c,v 1.77 2011/06/19 02:42:53 rmind Exp $	*/
+/*	$NetBSD: uvm_bio.c,v 1.78 2011/06/29 19:51:12 hannken Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_bio.c,v 1.77 2011/06/19 02:42:53 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_bio.c,v 1.78 2011/06/29 19:51:12 hannken Exp $);
 
 #include opt_uvmhist.h
 #include opt_ubc.h
@@ -774,18 +774,6 @@
 }
 
 /*
- * uvm_vnp_zerorange: set a range of bytes in a file to zero.
- * WILL BE REMOVED AFTER THE NEXT KERNEL VERSION BUMP (5.99.54)!
- */
-void uvm_vnp_zerorange(struct vnode *, off_t, size_t);
-void
-uvm_vnp_zerorange(struct vnode *vp, off_t off, size_t len)
-{
-
-	ubc_zerorange(vp-v_uobj, off, len, UBC_UNMAP_FLAG(vp));
-}
-
-/*
  * ubc_purge: disassociate ubc_map structures from an empty uvm_object.
  */
 



CVS commit: src/sys/arch/powerpc/booke

2011-06-29 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Jun 29 21:53:11 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke: booke_cache.c booke_machdep.c booke_pmap.c
booke_stubs.c e500_intr.c

Log Message:
Add missing $NetBSD$ and/or __KERNEL_RCSID.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/booke_cache.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/booke_pmap.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/booke_stubs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/booke/e500_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/powerpc/booke/booke_cache.c
diff -u src/sys/arch/powerpc/booke/booke_cache.c:1.3 src/sys/arch/powerpc/booke/booke_cache.c:1.4
--- src/sys/arch/powerpc/booke/booke_cache.c:1.3	Wed Jun 15 22:46:39 2011
+++ src/sys/arch/powerpc/booke/booke_cache.c	Wed Jun 29 21:53:10 2011
@@ -1,3 +1,4 @@
+/*	$NetBSD: booke_cache.c,v 1.4 2011/06/29 21:53:10 dholland Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +38,7 @@
  */
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: booke_cache.c,v 1.3 2011/06/15 22:46:39 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: booke_cache.c,v 1.4 2011/06/29 21:53:10 dholland Exp $);
 
 #include sys/param.h
 #include sys/cpu.h

Index: src/sys/arch/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.12 src/sys/arch/powerpc/booke/booke_machdep.c:1.13
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.12	Wed Jun 29 06:03:52 2011
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Wed Jun 29 21:53:10 2011
@@ -1,3 +1,4 @@
+/*	$NetBSD: booke_machdep.c,v 1.13 2011/06/29 21:53:10 dholland Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,6 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: booke_machdep.c,v 1.13 2011/06/29 21:53:10 dholland Exp $);
 
 #include opt_modular.h
 

Index: src/sys/arch/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.8 src/sys/arch/powerpc/booke/booke_pmap.c:1.9
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.8	Wed Jun 29 06:05:38 2011
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Wed Jun 29 21:53:10 2011
@@ -1,3 +1,4 @@
+/*	$NetBSD: booke_pmap.c,v 1.9 2011/06/29 21:53:10 dholland Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +38,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: booke_pmap.c,v 1.8 2011/06/29 06:05:38 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: booke_pmap.c,v 1.9 2011/06/29 21:53:10 dholland Exp $);
 
 #include sys/param.h
 #include sys/kcore.h

Index: src/sys/arch/powerpc/booke/booke_stubs.c
diff -u src/sys/arch/powerpc/booke/booke_stubs.c:1.7 src/sys/arch/powerpc/booke/booke_stubs.c:1.8
--- src/sys/arch/powerpc/booke/booke_stubs.c:1.7	Thu Jun 23 01:27:20 2011
+++ src/sys/arch/powerpc/booke/booke_stubs.c	Wed Jun 29 21:53:11 2011
@@ -1,3 +1,4 @@
+/*	$NetBSD: booke_stubs.c,v 1.8 2011/06/29 21:53:11 dholland Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +36,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: booke_stubs.c,v 1.7 2011/06/23 01:27:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: booke_stubs.c,v 1.8 2011/06/29 21:53:11 dholland Exp $);
 
 #include sys/param.h
 #include sys/cpu.h

Index: src/sys/arch/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.14 src/sys/arch/powerpc/booke/e500_intr.c:1.15
--- src/sys/arch/powerpc/booke/e500_intr.c:1.14	Wed Jun 29 05:55:47 2011
+++ src/sys/arch/powerpc/booke/e500_intr.c	Wed Jun 29 21:53:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.14 2011/06/29 05:55:47 matt Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.15 2011/06/29 21:53:11 dholland Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,6 +38,9 @@
 
 #define __INTR_PRIVATE
 
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: e500_intr.c,v 1.15 2011/06/29 21:53:11 dholland Exp $);
+
 #include sys/param.h
 #include sys/proc.h
 #include sys/intr.h



CVS commit: src/sys/arch/powerpc/booke

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 29 23:15:55 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Don't use TLB1 entries for device access if they are writethrough or not
cache-inhibited.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/booke/e500_tlb.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/powerpc/booke/e500_tlb.c
diff -u src/sys/arch/powerpc/booke/e500_tlb.c:1.5 src/sys/arch/powerpc/booke/e500_tlb.c:1.6
--- src/sys/arch/powerpc/booke/e500_tlb.c:1.5	Thu Jun 23 05:42:27 2011
+++ src/sys/arch/powerpc/booke/e500_tlb.c	Wed Jun 29 23:15:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_tlb.c,v 1.5 2011/06/23 05:42:27 matt Exp $	*/
+/*	$NetBSD: e500_tlb.c,v 1.6 2011/06/29 23:15:55 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: e500_tlb.c,v 1.5 2011/06/23 05:42:27 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: e500_tlb.c,v 1.6 2011/06/29 23:15:55 matt Exp $);
 
 #include sys/param.h
 
@@ -689,9 +689,13 @@
 
 	/*
 	 * See if we have a TLB entry for the pa.  If completely falls within
-	 * mark the reference and return the pa.
+	 * mark the reference and return the pa.  But only if the tlb entry
+	 * is not cacheable.
 	 */
-	if (xtlb  pa + len = xtlb-e_tlb.tlb_va + xtlb-e_tlb.tlb_size) {
+	if (xtlb
+	 pa + len = xtlb-e_tlb.tlb_va + xtlb-e_tlb.tlb_size
+	 ((xtlb-e_tlb.tlb_pte  PTE_W) == 0
+		|| (xtlb-e_tlb.tlb_pte  PTE_I) == PTE_I)) {
 		xtlb-e_refcnt++;
 		return (void *) pa;
 	}



CVS commit: src/sys/fs/tmpfs

2011-06-29 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jun 30 00:09:27 UTC 2011

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c

Log Message:
- Use  PAGE_SHIFT rather than calling round_page again.
- No need to call uao_dropswap_range() here since uao_dropswap()
  is already called for each pages by uvm_vnp_setsize().


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/fs/tmpfs/tmpfs_subr.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/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.74 src/sys/fs/tmpfs/tmpfs_subr.c:1.75
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.74	Thu Jun 16 09:21:02 2011
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Thu Jun 30 00:09:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.74 2011/06/16 09:21:02 hannken Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $	*/
 
 /*
  * Copyright (c) 2005-2011 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.74 2011/06/16 09:21:02 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $);
 
 #include sys/param.h
 #include sys/dirent.h
@@ -821,7 +821,8 @@
 			return ENOSPC;
 		}
 	} else if (newsize  oldsize) {
-		int zerolen = MIN(round_page(newsize), node-tn_size) - newsize;
+		int zerolen = MIN(newpages  PAGE_SHIFT, node-tn_size)
+		- newsize;
 
 		ubc_zerorange(uobj, newsize, zerolen, UBC_UNMAP_FLAG(vp));
 	}
@@ -830,16 +831,7 @@
 	node-tn_size = newsize;
 	uvm_vnp_setsize(vp, newsize);
 
-	/*
-	 * Free backing store.
-	 */
 	if (newpages  oldpages) {
-		KASSERT(uobj-vmobjlock == vp-v_interlock);
-
-		mutex_enter(uobj-vmobjlock);
-		uao_dropswap_range(uobj, newpages, oldpages);
-		mutex_exit(uobj-vmobjlock);
-
 		/* Decrease the used-memory counter. */
 		tmpfs_mem_decr(tmp, (oldpages - newpages)  PAGE_SHIFT);
 	}



CVS commit: src/sys/fs/tmpfs

2011-06-29 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jun 30 00:37:08 UTC 2011

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c

Log Message:
Backout previous.  May be I need more coffee.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/fs/tmpfs/tmpfs_subr.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/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.75 src/sys/fs/tmpfs/tmpfs_subr.c:1.76
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.75	Thu Jun 30 00:09:26 2011
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Thu Jun 30 00:37:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.76 2011/06/30 00:37:07 enami Exp $	*/
 
 /*
  * Copyright (c) 2005-2011 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.76 2011/06/30 00:37:07 enami Exp $);
 
 #include sys/param.h
 #include sys/dirent.h
@@ -821,8 +821,7 @@
 			return ENOSPC;
 		}
 	} else if (newsize  oldsize) {
-		int zerolen = MIN(newpages  PAGE_SHIFT, node-tn_size)
-		- newsize;
+		int zerolen = MIN(round_page(newsize), node-tn_size) - newsize;
 
 		ubc_zerorange(uobj, newsize, zerolen, UBC_UNMAP_FLAG(vp));
 	}
@@ -831,7 +830,16 @@
 	node-tn_size = newsize;
 	uvm_vnp_setsize(vp, newsize);
 
+	/*
+	 * Free backing store.
+	 */
 	if (newpages  oldpages) {
+		KASSERT(uobj-vmobjlock == vp-v_interlock);
+
+		mutex_enter(uobj-vmobjlock);
+		uao_dropswap_range(uobj, newpages, oldpages);
+		mutex_exit(uobj-vmobjlock);
+
 		/* Decrease the used-memory counter. */
 		tmpfs_mem_decr(tmp, (oldpages - newpages)  PAGE_SHIFT);
 	}



CVS commit: src/sys/uvm

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 30 00:49:14 UTC 2011

Modified Files:
src/sys/uvm: uvm_pmap.h

Log Message:
Move PMAP_* cache defines to before inclusion of machine/pmap.h


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/uvm/uvm_pmap.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/uvm/uvm_pmap.h
diff -u src/sys/uvm/uvm_pmap.h:1.36 src/sys/uvm/uvm_pmap.h:1.37
--- src/sys/uvm/uvm_pmap.h:1.36	Fri Feb 11 23:05:55 2011
+++ src/sys/uvm/uvm_pmap.h	Thu Jun 30 00:49:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pmap.h,v 1.36 2011/02/11 23:05:55 jmcneill Exp $	*/
+/*	$NetBSD: uvm_pmap.h,v 1.37 2011/06/30 00:49:14 matt Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -90,8 +90,29 @@
 extern struct pmap	*const kernel_pmap_ptr;
 #define pmap_kernel()	kernel_pmap_ptr
 
-#include machine/pmap.h
+#endif
+
+/*
+ * Cache Type Encodings
+ */
+#define PMAP_CACHE_MASK		0x0f00
+
+/* All accesses are uncacheable. No speculative accesses. */
+#define PMAP_NOCACHE		0x0100	/* [BOTH] */
+
+/* All accesses are uncacheable. No speculative accesses.
+ * Writes are combined. */
+#define PMAP_WRITE_COMBINE	0x0200	/* [BOTH] */
 
+/* On reads, cachelines become shared or exclusive if allocated on cache miss.
+ * On writes, cachelines become modified on a cache miss.  */
+#define PMAP_WRITE_BACK		0x0300	/* [BOTH] */
+
+/* = PMAP_NOCACHE but overrideable (e.g. on x86 by MTRRs) */
+#define PMAP_NOCACHE_OVR	0x0400	/* [BOTH] */
+
+#ifdef _KERNEL
+#include machine/pmap.h
 #endif
 
 /*
@@ -114,26 +135,6 @@
 #define	PMAP_MD_MASK	0xff00	/* [BOTH] Machine-dependent bits */
 #define PMAP_PROT_MASK	0x000f	/* [BOTH] VM_PROT_* bit mask */
 
-/*
- * Cache Type Encodings
- */
-#define PMAP_CACHE_MASK		0x0f00
-
-/* All accesses are uncacheable. No speculative accesses. */
-#define PMAP_NOCACHE		0x0100	/* [BOTH] */
-
-/* All accesses are uncacheable. No speculative accesses.
- * Writes are combined. */
-#define PMAP_WRITE_COMBINE	0x0200	/* [BOTH] */
-
-/* On reads, cachelines become shared or exclusive if allocated on cache miss.
- * On writes, cachelines become modified on a cache miss.  */
-#define PMAP_WRITE_BACK		0x0300	/* [BOTH] */
-
-/* = PMAP_NOCACHE but overrideable (e.g. on x86 by MTRRs) */
-#define PMAP_NOCACHE_OVR	0x0400	/* [BOTH] */
-
-
 #ifndef PMAP_EXCLUDE_DECLS	/* Used in Sparc port to virtualize pmap mod */
 #ifdef _KERNEL
 __BEGIN_DECLS



CVS commit: src/sys/arch

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 30 00:53:01 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox: machdep.c
src/sys/arch/bebox/include: autoconf.h
src/sys/arch/bebox/pci: pci_machdep.c
src/sys/arch/evbppc/evbppc: evbppc_machdep.c
src/sys/arch/evbppc/mpc85xx: machdep.c
src/sys/arch/evbppc/pmppc/pci: pci_machdep.c
src/sys/arch/ibmnws/ibmnws: machdep.c
src/sys/arch/ibmnws/include: autoconf.h
src/sys/arch/ibmnws/pci: pci_machdep.c
src/sys/arch/macppc/dev: adb.c esp.c gpio.c if_bm.c if_mc.c mediabay.c
mesh.c nvram.c zs.c
src/sys/arch/macppc/include: autoconf.h
src/sys/arch/macppc/macppc: cpu.c
src/sys/arch/macppc/pci: bandit.c grackle.c u3.c uninorth.c
src/sys/arch/mvmeppc/include: autoconf.h
src/sys/arch/mvmeppc/mvmeppc: machdep.c
src/sys/arch/mvmeppc/pci: pci_machdep.c
src/sys/arch/ofppc/ofppc: mainbus.c
src/sys/arch/powerpc/booke: booke_machdep.c booke_stubs.c e500_tlb.c
src/sys/arch/powerpc/ibm4xx: pmap.c
src/sys/arch/powerpc/include: cpu.h
src/sys/arch/powerpc/include/booke: cpuvar.h pmap.h pte.h
src/sys/arch/powerpc/include/ibm4xx: pmap.h
src/sys/arch/powerpc/include/oea: pmap.h
src/sys/arch/powerpc/oea: oea_machdep.c pmap.c pmap_kernel.c
src/sys/arch/powerpc/pci: pchb.c
src/sys/arch/powerpc/powerpc: bus_dma.c bus_space.c
src/sys/arch/prep/include: autoconf.h
src/sys/arch/prep/pci: pci_machdep.c
src/sys/arch/prep/prep: machdep.c
src/sys/arch/rs6000/include: autoconf.h

Log Message:
Modify mapiodev to take a third argument indicating whether the space
should be prefetchable (true) or not (false).


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/bebox/bebox/machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/bebox/include/autoconf.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/bebox/pci/pci_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbppc/evbppc/evbppc_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbppc/mpc85xx/machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/pmppc/pci/pci_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/ibmnws/ibmnws/machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ibmnws/include/autoconf.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ibmnws/pci/pci_machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/macppc/dev/adb.c \
src/sys/arch/macppc/dev/esp.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/macppc/dev/gpio.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/macppc/dev/if_bm.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/macppc/dev/if_mc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/macppc/dev/mediabay.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/macppc/dev/mesh.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/macppc/dev/nvram.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/macppc/dev/zs.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/macppc/include/autoconf.h
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/macppc/macppc/cpu.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/macppc/pci/bandit.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/macppc/pci/grackle.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/macppc/pci/u3.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/macppc/pci/uninorth.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mvmeppc/include/autoconf.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/mvmeppc/mvmeppc/machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mvmeppc/pci/pci_machdep.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/ofppc/ofppc/mainbus.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/booke_stubs.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/e500_tlb.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/booke/cpuvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/booke/pmap.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/booke/pte.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/include/ibm4xx/pmap.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/include/oea/pmap.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/oea/oea_machdep.c
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/oea/pmap_kernel.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/pci/pchb.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/powerpc/bus_space.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/prep/include/autoconf.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/prep/pci/pci_machdep.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/prep/prep/machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/rs6000/include/autoconf.h

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

Modified files:

Index: 

CVS commit: src/sys/arch/powerpc/booke/dev

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 30 04:43:47 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3gpio.c

Log Message:
Fix RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/dev/pq3gpio.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/powerpc/booke/dev/pq3gpio.c
diff -u src/sys/arch/powerpc/booke/dev/pq3gpio.c:1.3 src/sys/arch/powerpc/booke/dev/pq3gpio.c:1.4
--- src/sys/arch/powerpc/booke/dev/pq3gpio.c:1.3	Wed Mar 16 05:31:03 2011
+++ src/sys/arch/powerpc/booke/dev/pq3gpio.c	Thu Jun 30 04:43:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3gpio.c,v 1.3 2011/03/16 05:31:03 matt Exp $	*/
+/*	$NetBSD: pq3gpio.c,v 1.4 2011/06/30 04:43:47 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD);
+__KERNEL_RCSID(0, $NetBSD: pq3gpio.c,v 1.4 2011/06/30 04:43:47 matt Exp $);
 
 #include sys/param.h
 #include sys/cpu.h



CVS commit: src/sys/arch/powerpc/booke/dev

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 30 04:44:26 UTC 2011

Added Files:
src/sys/arch/powerpc/booke/dev: pq3nandfcm.c

Log Message:
Unfinished (by far) NAND driver.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/powerpc/booke/dev/pq3nandfcm.c

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

Added files:

Index: src/sys/arch/powerpc/booke/dev/pq3nandfcm.c
diff -u /dev/null src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.1
--- /dev/null	Thu Jun 30 04:44:26 2011
+++ src/sys/arch/powerpc/booke/dev/pq3nandfcm.c	Thu Jun 30 04:44:26 2011
@@ -0,0 +1,265 @@
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include opt_flash.h
+#define LBC_PRIVATE
+
+#include sys/cdefs.h
+
+__KERNEL_RCSID(0, $NetBSD: pq3nandfcm.c,v 1.1 2011/06/30 04:44:26 matt Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/device.h
+#include sys/cpu.h
+
+#include machine/bus.h
+
+#include powerpc/booke/cpuvar.h
+#include powerpc/booke/e500reg.h
+#include powerpc/booke/obiovar.h
+
+#include dev/nand/nand.h
+#include dev/nand/onfi.h
+
+static int  pq3nandfcm_match(device_t, cfdata_t, void *);
+static void pq3nandfcm_attach(device_t, device_t, void *);
+static int  pq3nandfcm_detach(device_t, int);
+
+static void pq3nandfcm_select(device_t, bool);
+static void pq3nandfcm_command(device_t, uint8_t);
+static void pq3nandfcm_address(device_t, uint8_t);
+static void pq3nandfcm_busy(device_t);
+static void pq3nandfcm_read_byte(device_t, uint8_t *);
+static void pq3nandfcm_write_byte(device_t, uint8_t);
+static void pq3nandfcm_read_buf(device_t, void *, size_t);
+static void pq3nandfcm_write_buf(device_t, const void *, size_t);
+
+struct pq3nandfcm_softc {
+	device_t sc_dev;
+	bus_space_tag_t sc_window_bst;
+	bus_space_handle_t sc_window_bsh;
+	bus_size_t sc_window_size;
+
+	struct nand_interface sc_nandif;
+	device_t sc_nanddev;
+
+	struct pq3obio_softc *sc_obio;
+	struct pq3lbc_softc *sc_lbc;
+
+	u_int	sc_cs;
+
+};
+
+CFATTACH_DECL_NEW(pq3nandfcm, sizeof(struct pq3nandfcm_softc),
+ pq3nandfcm_match, pq3nandfcm_attach, pq3nandfcm_detach, NULL);
+
+int
+pq3nandfcm_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct generic_attach_args * const ga = aux;
+	struct pq3obio_softc * const psc = device_private(parent);
+	struct pq3lbc_softc * const lbc = psc-sc_lbcs[ga-ga_cs];
+
+	if ((lbc-lbc_br  BR_V) == 0)
+		return 0;
+
+	if (__SHIFTOUT(lbc-lbc_br,BR_MSEL) != BR_MSEL_FCM)
+		return 0;
+
+	return 1;
+}
+
+void
+pq3nandfcm_attach(device_t parent, device_t self, void *aux)
+{
+	struct generic_attach_args * const ga = aux;
+	struct pq3nandfcm_softc * const sc = device_private(self);
+	struct pq3obio_softc * const psc = device_private(parent);
+	struct pq3lbc_softc * const lbc = psc-sc_lbcs[ga-ga_cs];
+
+	sc-sc_dev = self;
+	sc-sc_obio = psc;
+	sc-sc_lbc = lbc;
+}
+
+int
+pq3nandfcm_detach(device_t self, int flags)
+{
+	struct pq3nandfcm_softc * const sc = device_private(self);
+	int rv = 0;
+
+	pmf_device_deregister(self);
+
+	if (sc-sc_nanddev != NULL)
+		rv = config_detach(sc-sc_nanddev, flags);
+
+	bus_space_unmap(sc-sc_window_bst, sc-sc_window_bsh,
+	sc-sc_window_size);
+	return rv;
+}
+void
+pq3nandfcm_command(device_t self, uint8_t command)
+{
+	struct pq3nandfcm_softc * const sc = device_private(self);
+
+	lbc_lock(sc-sc_obio);
+	lbc_write_4(sc-sc_obio, FCR, __SHIFTIN(command, FCR_CMD0));
+	lbc_write_4(sc-sc_obio, FIR, 

CVS commit: src/sys/arch/powerpc/include/booke

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 30 04:45:04 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/booke: e500reg.h

Log Message:
Add LSOR register


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/include/booke/e500reg.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/powerpc/include/booke/e500reg.h
diff -u src/sys/arch/powerpc/include/booke/e500reg.h:1.8 src/sys/arch/powerpc/include/booke/e500reg.h:1.9
--- src/sys/arch/powerpc/include/booke/e500reg.h:1.8	Thu Jun  9 19:10:37 2011
+++ src/sys/arch/powerpc/include/booke/e500reg.h	Thu Jun 30 04:45:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500reg.h,v 1.8 2011/06/09 19:10:37 matt Exp $	*/
+/*	$NetBSD: e500reg.h,v 1.9 2011/06/30 04:45:04 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -560,6 +560,7 @@
 #define	MDR_AS2		__PPCBITS(8,15)
 #define	MDR_AS1		__PPCBITS(16,23)
 #define	MDR_AS0		__PPCBITS(24,31)
+#define	LSOR		0x090 /* Special Operation Initiation register */
 #define LSDMR		0x094 /* SDRAM mode register */
 #define LURT		0x0A0 /* UPM refresh timer */
 #define LSRT		0x0A4 /* SDRAM refresh timer */



CVS commit: src/sys/arch/powerpc/include/booke

2011-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 30 04:45:38 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/booke: obiovar.h

Log Message:
Add prototypes for lbc_* routines.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/include/booke/obiovar.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/powerpc/include/booke/obiovar.h
diff -u src/sys/arch/powerpc/include/booke/obiovar.h:1.1 src/sys/arch/powerpc/include/booke/obiovar.h:1.2
--- src/sys/arch/powerpc/include/booke/obiovar.h:1.1	Sat May 28 05:27:20 2011
+++ src/sys/arch/powerpc/include/booke/obiovar.h	Thu Jun 30 04:45:38 2011
@@ -48,5 +48,11 @@
 	struct powerpc_bus_space sc_obio_bst;
 };
 
+#ifdef _KERNEL
+void lbc_lock(struct pq3obio_softc *);
+void lbc_unlock(struct pq3obio_softc *);
+uint32_t lbc_read_4(struct pq3obio_softc *, bus_size_t);
+void lbc_write_4(struct pq3obio_softc *, bus_size_t, uint32_t size);
+#endif
 
 #endif /* _POWERPC_BOOKE_OBIOVAR_H_ */