Module Name:    src
Committed By:   macallan
Date:           Wed Aug 22 21:15:18 UTC 2012

Modified Files:
        src/sys/arch/shark/ofw: chipsfb_ofbus.c

Log Message:
actually pass a working IO tag to the rest of the driver


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/shark/ofw/chipsfb_ofbus.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/shark/ofw/chipsfb_ofbus.c
diff -u src/sys/arch/shark/ofw/chipsfb_ofbus.c:1.2 src/sys/arch/shark/ofw/chipsfb_ofbus.c:1.3
--- src/sys/arch/shark/ofw/chipsfb_ofbus.c:1.2	Tue Jul 19 15:07:43 2011
+++ src/sys/arch/shark/ofw/chipsfb_ofbus.c	Wed Aug 22 21:15:17 2012
@@ -1,7 +1,7 @@
-/*	$NetBSD: chipsfb_ofbus.c,v 1.2 2011/07/19 15:07:43 dyoung Exp $ */
+/*	$NetBSD: chipsfb_ofbus.c,v 1.3 2012/08/22 21:15:17 macallan Exp $ */
 
 /*
- * Copyright (c) 2006 Michael Lorenz
+ * Copyright (c) 2011 Michael Lorenz
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: chipsfb_ofbus.c,v 1.2 2011/07/19 15:07:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: chipsfb_ofbus.c,v 1.3 2012/08/22 21:15:17 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -90,7 +90,6 @@ chipsfb_ofbus_cnattach(bus_space_tag_t i
 	int chosen_phandle, ct_node;
 	int stdout_ihandle, stdout_phandle;
 	uint32_t regs[16];
-	//char mode_buffer[64];
 
 	stdout_phandle = 0;
 
@@ -109,16 +108,15 @@ chipsfb_ofbus_cnattach(bus_space_tag_t i
 		return ENXIO;
 
 	chipsfb_mem_paddr = be32toh(regs[10]);
-	/* 2MB RAM aperture, bufferable and cacheable */
-	chipsfb_mem_vaddr = ofw_map(chipsfb_mem_paddr, 0x00200000, L2_B | L2_C);
+	/* 2MB RAM aperture, bufferable and not cacheable */
+	chipsfb_mem_vaddr = ofw_map(chipsfb_mem_paddr, 0x00200000, L2_B);
 	/* 128kB MMIO registers */
 	chipsfb_mmio_vaddr = ofw_map(chipsfb_mem_paddr + CT_OFF_BITBLT,
 	    0x00020000, 0);
 
 	memcpy(&chipsfb_memt, memt, sizeof(struct bus_space));
 	chipsfb_memt.bs_cookie = (void *)chipsfb_mem_vaddr;
-	memcpy(&chipsfb_iot, memt, sizeof(struct bus_space));
-	chipsfb_iot.bs_cookie = (void *)chipsfb_mmio_vaddr;
+	memcpy(&chipsfb_iot, iot, sizeof(struct bus_space));
 
 	/*
 	 * check if the firmware output device is indeed the ct65550
@@ -182,6 +180,7 @@ chipsfb_ofbus_attach(device_t parent, de
 	sc->sc_fbsize = 0x00800000;	/* 8MB aperture */
 	sc->sc_fbh = chipsfb_mem_vaddr;
 	sc->sc_mmregh = chipsfb_mmio_vaddr;
+	sc->sc_ioregh = isa_io_data_vaddr();
 	sc->sc_mmap = chipsfb_ofbus_mmap;
 	sc->sc_ioctl = NULL;
 	sc->memsize = 0x00200000;
@@ -213,10 +212,6 @@ chipsfb_ofbus_attach(device_t parent, de
 	prop_dictionary_set_uint32(dict, "depth", depth);
 	prop_dictionary_set_bool(dict, "is_console", isconsole);
 
-	if (bus_space_map(sc->sc_iot, 0, 0x400, 0, &sc->sc_ioregh) != 0) {
-		aprint_error("unable to map IO registers\n");
-		return;
-	}
 	chipsfb_do_attach(sc);
 }
 

Reply via email to