CVS commit: [netbsd-7] src/sys/arch/arm/omap

2017-05-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri May 12 05:17:40 UTC 2017

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: omap_edma.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1387):
sys/arch/arm/omap/omap_edma.c: revision 1.4 via patch
PR/51380: Mutex error: mutex_vector_enter: locking against myself
Change the interrupt handler IPL level to IPL_VM (aka IPL_BIO aka
IPL_SDMMC) so that the sdhc_host_lock prevents edma_intr from running


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/arm/omap/omap_edma.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/omap/omap_edma.c
diff -u src/sys/arch/arm/omap/omap_edma.c:1.1.2.2 src/sys/arch/arm/omap/omap_edma.c:1.1.2.3
--- src/sys/arch/arm/omap/omap_edma.c:1.1.2.2	Sun Apr 19 04:37:17 2015
+++ src/sys/arch/arm/omap/omap_edma.c	Fri May 12 05:17:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: omap_edma.c,v 1.1.2.2 2015/04/19 04:37:17 msaitoh Exp $ */
+/* $NetBSD: omap_edma.c,v 1.1.2.3 2017/05/12 05:17:40 snj Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.1.2.2 2015/04/19 04:37:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.1.2.3 2017/05/12 05:17:40 snj Exp $");
 
 #include "opt_omap.h"
 
@@ -141,7 +141,7 @@ edma_attach(device_t parent, device_t se
 
 	sc->sc_dev = self;
 	sc->sc_iot = obio->obio_iot;
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_SCHED);
+   mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_VM);
 	if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size,
 	0, >sc_ioh) != 0) {
 		aprint_error(": couldn't map address spcae\n");
@@ -164,13 +164,13 @@ edma_attach(device_t parent, device_t se
 	edma_init(sc);
 
 	sc->sc_ih = intr_establish(obio->obio_intrbase + 0,
-	IPL_SCHED, IST_LEVEL, edma_intr, sc);
+   IPL_VM, IST_LEVEL | IST_MPSAFE, edma_intr, sc);
 	KASSERT(sc->sc_ih != NULL);
 
 	sc->sc_mperr_ih = intr_establish(obio->obio_intrbase + 1,
-	IPL_SCHED, IST_LEVEL, edma_mperr_intr, sc);
+   IPL_VM, IST_LEVEL, edma_mperr_intr, sc);
 	sc->sc_errint_ih = intr_establish(obio->obio_intrbase + 2,
-	IPL_SCHED, IST_LEVEL, edma_errint_intr, sc);
+   IPL_VM, IST_LEVEL, edma_errint_intr, sc);
 }
 
 /*



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2017-05-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri May 12 05:17:40 UTC 2017

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: omap_edma.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1387):
sys/arch/arm/omap/omap_edma.c: revision 1.4 via patch
PR/51380: Mutex error: mutex_vector_enter: locking against myself
Change the interrupt handler IPL level to IPL_VM (aka IPL_BIO aka
IPL_SDMMC) so that the sdhc_host_lock prevents edma_intr from running


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/arm/omap/omap_edma.c

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



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-11-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Nov 17 19:21:14 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: omap3_sdhc.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1017):
sys/arch/arm/omap/omap3_sdhc.c: revision 1.18
AM335x EDMA3 has an alignment restriction for both SAM and DAM in constant
addressing mode. In these cases, the physical address must be aligned to
256-bits. To handle this, pre-allocate a MAXPHYS sized bounce buffer and
use it for unaligned transfers.
Fixes edma errint! problem mentioned in port-arm/50288.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/arch/arm/omap/omap3_sdhc.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/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.14.4.2 src/sys/arch/arm/omap/omap3_sdhc.c:1.14.4.3
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.14.4.2	Sun Nov  8 01:22:54 2015
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Tue Nov 17 19:21:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.14.4.2 2015/11/08 01:22:54 riz Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.14.4.3 2015/11/17 19:21:14 riz Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.14.4.2 2015/11/08 01:22:54 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.14.4.3 2015/11/17 19:21:14 riz Exp $");
 
 #include "opt_omap.h"
 #include "edma.h"
@@ -109,13 +109,17 @@ struct obiosdhc_softc {
 	kcondvar_t		sc_edma_cv;
 	bus_addr_t		sc_edma_fifo;
 	bool			sc_edma_pending;
+	bus_dmamap_t		sc_edma_dmamap;
+	bus_dma_segment_t	sc_edma_segs[1];
+	void			*sc_edma_bbuf;
 #endif
 };
 
 #if NEDMA > 0
-static void obiosdhc_edma_init(struct obiosdhc_softc *, unsigned int);
+static int obiosdhc_edma_init(struct obiosdhc_softc *, unsigned int);
 static int obiosdhc_edma_xfer_data(struct sdhc_softc *, struct sdmmc_command *);
 static void obiosdhc_edma_done(void *);
+static int obiosdhc_edma_transfer(struct sdhc_softc *, struct sdmmc_command *);
 #endif
 
 #ifdef TI_AM335X
@@ -252,11 +256,13 @@ obiosdhc_attach(device_t parent, device_
 
 #if NEDMA > 0
 	if (oa->obio_edmabase != -1) {
+		if (obiosdhc_edma_init(sc, oa->obio_edmabase) != 0)
+			goto no_dma;
+
 		mutex_init(>sc_edma_lock, MUTEX_DEFAULT, IPL_SCHED);
 		cv_init(>sc_edma_cv, "sdhcedma");
 		sc->sc_edma_fifo = oa->obio_addr +
 		OMAP3_SDMMC_SDHC_OFFSET + SDHC_DATA;
-		obiosdhc_edma_init(sc, oa->obio_edmabase);
 		sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
 		sc->sc.sc_flags |= SDHC_FLAG_EXTERNAL_DMA;
 		sc->sc.sc_flags |= SDHC_FLAG_EXTDMA_DMAEN;
@@ -264,6 +270,7 @@ obiosdhc_attach(device_t parent, device_
 		sc->sc.sc_vendor_transfer_data_dma = obiosdhc_edma_xfer_data;
 		transfer_mode = "EDMA";
 	}
+no_dma:
 #endif
 
 	aprint_naive("\n");
@@ -494,10 +501,10 @@ obiosdhc_bus_clock(struct sdhc_softc *sc
 }
 
 #if NEDMA > 0
-static void
+static int
 obiosdhc_edma_init(struct obiosdhc_softc *sc, unsigned int edmabase)
 {
-	int i;
+	int i, error, rseg;
 
 	/* Request tx and rx DMA channels */
 	sc->sc_edma_tx = edma_channel_alloc(EDMA_TYPE_DMA, edmabase + 0,
@@ -521,18 +528,98 @@ obiosdhc_edma_init(struct obiosdhc_softc
 		KASSERT(sc->sc_edma_param_rx[i] != 0x);
 	}
 
-	return;
+	/* Setup bounce buffer */
+	error = bus_dmamem_alloc(sc->sc.sc_dmat, MAXPHYS, 32, MAXPHYS,
+	sc->sc_edma_segs, 1, , BUS_DMA_WAITOK);
+	if (error) {
+		aprint_error_dev(sc->sc.sc_dev,
+		"couldn't allocate dmamem: %d\n", error);
+		return error;
+	}
+	KASSERT(rseg == 1);
+	error = bus_dmamem_map(sc->sc.sc_dmat, sc->sc_edma_segs, rseg, MAXPHYS,
+	>sc_edma_bbuf, BUS_DMA_WAITOK);
+	if (error) {
+		aprint_error_dev(sc->sc.sc_dev, "couldn't map dmamem: %d\n",
+		error);
+		return error;
+	}
+	error = bus_dmamap_create(sc->sc.sc_dmat, MAXPHYS, 1, MAXPHYS, 0,
+	BUS_DMA_WAITOK, >sc_edma_dmamap);
+	if (error) {
+		aprint_error_dev(sc->sc.sc_dev, "couldn't create dmamap: %d\n",
+		error);
+		return error;
+	}
+
+	return error;
 }
 
 static int
 obiosdhc_edma_xfer_data(struct sdhc_softc *sdhc_sc, struct sdmmc_command *cmd)
 {
 	struct obiosdhc_softc *sc = device_private(sdhc_sc->sc_dev);
+	const bus_dmamap_t map = cmd->c_dmamap;
+	int seg, error;
+	bool bounce;
+
+	for (bounce = false, seg = 0; seg < cmd->c_dmamap->dm_nsegs; seg++) {
+		if ((cmd->c_dmamap->dm_segs[seg].ds_addr & 0x1f) != 0) {
+			bounce = true;
+			break;
+		}
+	}
+
+	if (bounce) {
+		error = bus_dmamap_load(sc->sc.sc_dmat, sc->sc_edma_dmamap,
+		sc->sc_edma_bbuf, MAXPHYS, NULL, BUS_DMA_WAITOK);
+		if (error) {
+			device_printf(sc->sc.sc_dev,
+			"[bounce] bus_dmamap_load failed: %d\n", error);
+			return error;
+		}
+		if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
+			bus_dmamap_sync(sc->sc.sc_dmat, sc->sc_edma_dmamap, 0,
+			MAXPHYS, BUS_DMASYNC_PREREAD);
+		} else {

CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-11-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Nov 17 19:21:14 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: omap3_sdhc.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1017):
sys/arch/arm/omap/omap3_sdhc.c: revision 1.18
AM335x EDMA3 has an alignment restriction for both SAM and DAM in constant
addressing mode. In these cases, the physical address must be aligned to
256-bits. To handle this, pre-allocate a MAXPHYS sized bounce buffer and
use it for unaligned transfers.
Fixes edma errint! problem mentioned in port-arm/50288.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/arch/arm/omap/omap3_sdhc.c

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



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-06-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun 12 16:32:05 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: am335x_trng.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #839):
sys/arch/arm/omap/am335x_trng.c: patch
Fix build on the branch.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/arm/omap/am335x_trng.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/omap/am335x_trng.c
diff -u src/sys/arch/arm/omap/am335x_trng.c:1.1.2.2 src/sys/arch/arm/omap/am335x_trng.c:1.1.2.3
--- src/sys/arch/arm/omap/am335x_trng.c:1.1.2.2	Wed Jun 10 16:38:05 2015
+++ src/sys/arch/arm/omap/am335x_trng.c	Fri Jun 12 16:32:05 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: am335x_trng.c,v 1.1.2.2 2015/06/10 16:38:05 snj Exp $ */
+/* $NetBSD: am335x_trng.c,v 1.1.2.3 2015/06/12 16:32:05 snj Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill jmcne...@invisible.ca
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: am335x_trng.c,v 1.1.2.2 2015/06/10 16:38:05 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: am335x_trng.c,v 1.1.2.3 2015/06/12 16:32:05 snj Exp $);
 
 #include opt_omap.h
 
@@ -37,8 +37,7 @@ __KERNEL_RCSID(0, $NetBSD: am335x_trng.
 #include sys/intr.h
 #include sys/mutex.h
 #include sys/bus.h
-#include sys/rndpool.h
-#include sys/rndsource.h
+#include sys/rnd.h
 
 #include arm/omap/am335x_prcm.h
 #include arm/omap/omap2_prcm.h



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-06-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun 12 16:32:05 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: am335x_trng.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #839):
sys/arch/arm/omap/am335x_trng.c: patch
Fix build on the branch.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/arm/omap/am335x_trng.c

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



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 17 08:44:54 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: if_cpsw.c if_cpswreg.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #696):
sys/arch/arm/omap/if_cpsw.c: revision 1.12
sys/arch/arm/omap/if_cpswreg.h: revision 1.5
Disable flow control with CPSW_SS FLOW_CONTROL register (cherry-picked
from FreeBSD driver). Resolves device timeout / watchdog issues for me.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/arm/omap/if_cpsw.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/arm/omap/if_cpswreg.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/omap/if_cpsw.c
diff -u src/sys/arch/arm/omap/if_cpsw.c:1.6 src/sys/arch/arm/omap/if_cpsw.c:1.6.2.1
--- src/sys/arch/arm/omap/if_cpsw.c:1.6	Wed Apr  9 20:52:14 2014
+++ src/sys/arch/arm/omap/if_cpsw.c	Fri Apr 17 08:44:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.6 2014/04/09 20:52:14 hans Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.6.2.1 2015/04/17 08:44:54 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: if_cpsw.c,v 1.6 2014/04/09 20:52:14 hans Exp $);
+__KERNEL_RCSID(1, $NetBSD: if_cpsw.c,v 1.6.2.1 2015/04/17 08:44:54 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -891,6 +891,9 @@ cpsw_init(struct ifnet *ifp)
 	}
 	sc-sc_rxhead = 0;
 
+	/* turn off flow control */
+	cpsw_write_4(sc, CPSW_SS_FLOW_CONTROL, 0);
+
 	/* align layer 3 header to 32-bit */
 	cpsw_write_4(sc, CPSW_CPDMA_RX_BUFFER_OFFSET, ETHER_ALIGN);
 

Index: src/sys/arch/arm/omap/if_cpswreg.h
diff -u src/sys/arch/arm/omap/if_cpswreg.h:1.2 src/sys/arch/arm/omap/if_cpswreg.h:1.2.4.1
--- src/sys/arch/arm/omap/if_cpswreg.h:1.2	Wed Feb 26 03:58:33 2014
+++ src/sys/arch/arm/omap/if_cpswreg.h	Fri Apr 17 08:44:54 2015
@@ -34,6 +34,7 @@
 #define CPSW_SS_SOFT_RESET		(CPSW_SS_OFFSET + 0x08)
 #define CPSW_SS_STAT_PORT_EN		(CPSW_SS_OFFSET + 0x0C)
 #define CPSW_SS_PTYPE			(CPSW_SS_OFFSET + 0x10)
+#define CPSW_SS_FLOW_CONTROL		(CPSW_SS_OFFSET + 0x24)
 #define CPSW_SS_RGMII_CTL		(CPSW_SS_OFFSET + 0x88)
 
 #define CPSW_PORT_OFFSET		0x0100



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 17 08:44:54 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: if_cpsw.c if_cpswreg.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #696):
sys/arch/arm/omap/if_cpsw.c: revision 1.12
sys/arch/arm/omap/if_cpswreg.h: revision 1.5
Disable flow control with CPSW_SS FLOW_CONTROL register (cherry-picked
from FreeBSD driver). Resolves device timeout / watchdog issues for me.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/arm/omap/if_cpsw.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/arm/omap/if_cpswreg.h

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



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-04-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr 16 06:12:56 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: am335x_prcm.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #695):
sys/arch/arm/omap/am335x_prcm.c: revision 1.8
change freq change message to aprint_debug to prevent dmesg spam when running 
estd


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/arch/arm/omap/am335x_prcm.c

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



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2015-04-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr 16 06:12:56 UTC 2015

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: am335x_prcm.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #695):
sys/arch/arm/omap/am335x_prcm.c: revision 1.8
change freq change message to aprint_debug to prevent dmesg spam when running 
estd


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/arch/arm/omap/am335x_prcm.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/omap/am335x_prcm.c
diff -u src/sys/arch/arm/omap/am335x_prcm.c:1.7 src/sys/arch/arm/omap/am335x_prcm.c:1.7.2.1
--- src/sys/arch/arm/omap/am335x_prcm.c:1.7	Sun Jul 20 23:08:43 2014
+++ src/sys/arch/arm/omap/am335x_prcm.c	Thu Apr 16 06:12:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: am335x_prcm.c,v 1.7 2014/07/20 23:08:43 bouyer Exp $	*/
+/*	$NetBSD: am335x_prcm.c,v 1.7.2.1 2015/04/16 06:12:56 snj Exp $	*/
 
 /*
  * TI OMAP Power, Reset, and Clock Management on the AM335x
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: am335x_prcm.c,v 1.7 2014/07/20 23:08:43 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: am335x_prcm.c,v 1.7.2.1 2015/04/16 06:12:56 snj Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -220,7 +220,7 @@ mpu_current_frequency_sysctl_helper(SYSC
 mpu_frequency.mvolt = old_mvolt;
 			}
 		}
-		aprint_normal_dev(curcpu()-ci_dev,
+		aprint_debug_dev(curcpu()-ci_dev,
 		frequency changed from %d MHz to %d MHz\n,
 		old_freq, freq);
 		pmf_event_inject(NULL, PMFE_SPEED_CHANGED);



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2014-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 21 08:50:55 UTC 2014

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: omapfb.c

Log Message:
Pull up following revision(s) (requested by macallan in ticket #41):
sys/arch/arm/omap/omapfb.c: revision 1.27
Do not assume that PAGE_SIZE is 4kB always.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/arm/omap/omapfb.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/omap/omapfb.c
diff -u src/sys/arch/arm/omap/omapfb.c:1.26 src/sys/arch/arm/omap/omapfb.c:1.26.2.1
--- src/sys/arch/arm/omap/omapfb.c:1.26	Thu Aug  7 19:05:18 2014
+++ src/sys/arch/arm/omap/omapfb.c	Thu Aug 21 08:50:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: omapfb.c,v 1.26 2014/08/07 19:05:18 macallan Exp $	*/
+/*	$NetBSD: omapfb.c,v 1.26.2.1 2014/08/21 08:50:55 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omapfb.c,v 1.26 2014/08/07 19:05:18 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: omapfb.c,v 1.26.2.1 2014/08/21 08:50:55 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -256,7 +256,7 @@ omapfb_attach(device_t parent, device_t 
 	}
 
 	/* setup video DMA */
-	sc-sc_vramsize = (12  20) + 0x1000; /* 12MB + CLUT */
+	sc-sc_vramsize = (12  20) + PAGE_SIZE; /* 12MB + CLUT */
 
 	if (bus_dmamem_alloc(sc-sc_dmat, sc-sc_vramsize, 0, 0,
 	sc-sc_dmamem, 1, segs, BUS_DMA_NOWAIT) != 0) {
@@ -271,7 +271,7 @@ omapfb_attach(device_t parent, device_t 
 		aprint_error_dev(sc-sc_dev, failed to map video RAM\n);
 		return;
 	}
-	sc-sc_fbaddr = (uint8_t *)sc-sc_vramaddr + 0x1000;
+	sc-sc_fbaddr = (uint8_t *)sc-sc_vramaddr + PAGE_SIZE;
 	sc-sc_clut = sc-sc_vramaddr;
 
 	if (bus_dmamap_create(sc-sc_dmat, sc-sc_vramsize, 1, sc-sc_vramsize,
@@ -321,7 +321,7 @@ omapfb_attach(device_t parent, device_t 
 	/* we use overlay 1 for the console and X */
 	bus_space_write_4(sc-sc_iot, sc-sc_regh, OMAPFB_DISPC_GLOBAL_ALPHA,
 	0x00ff00ff);
-	sc-sc_fbhwaddr = sc-sc_dmamem-ds_addr + 0x1000;
+	sc-sc_fbhwaddr = sc-sc_dmamem-ds_addr + PAGE_SIZE;
 	bus_space_write_4(sc-sc_iot, sc-sc_regh, OMAPFB_DISPC_VID1_BASE_0,
 	sc-sc_fbhwaddr);
 	bus_space_write_4(sc-sc_iot, sc-sc_regh,
@@ -626,7 +626,7 @@ omapfb_mmap(void *v, void *vs, off_t off
 	/* 'regular' framebuffer mmap()ing */
 	if (offset  sc-sc_vramsize) {
 		pa = bus_dmamem_mmap(sc-sc_dmat, sc-sc_dmamem, 1,
-		offset + 0x1000, prot, BUS_DMA_PREFETCHABLE);
+		offset + PAGE_SIZE, prot, BUS_DMA_PREFETCHABLE);
 		return pa;
 	}
 	return pa;



CVS commit: [netbsd-7] src/sys/arch/arm/omap

2014-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 21 08:50:55 UTC 2014

Modified Files:
src/sys/arch/arm/omap [netbsd-7]: omapfb.c

Log Message:
Pull up following revision(s) (requested by macallan in ticket #41):
sys/arch/arm/omap/omapfb.c: revision 1.27
Do not assume that PAGE_SIZE is 4kB always.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/arm/omap/omapfb.c

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