Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2005 07:17:44 GMT
From:      John-Mark Gurney <jmg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 71365 for review
Message-ID:  <200502200717.j1K7Hiri001480@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=71365

Change 71365 by jmg@jmg_carbon on 2005/02/20 07:17:09

	clean up a bunch of debugging printf's now that we are getting
	all the way to mi_startup, and trying to start init...
	
	we still have a problem with the I/D caches though...
	
	KDB: debugger backends: ddb
	KDB: current backend: ddb
	Copyright (c) 1992-2005 The FreeBSD Project.
	Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
		The Regents of the University of California. All rights reserved.
	FreeBSD 6.0-CURRENT #82: Sat Feb 19 19:11:20 PST 2005
	    jmg@carbon.funkthat.com:/usr/home/jmg/p4/arm/src/sys/arm/compile/TS7200
	Preloaded elf kernel "elf kernel" at 0xc04867cc.
	Old value: 207b, new value : 217b
	ARM920T rev 0 (ARM9TDMI core)
	 DC disabled IC disabled WB enabled LABT16KB/32B 64-way Instruction cache
	16KB/32B 64-way write-back-locking-A Data cache
	
	panic: free: address 0xc0ba6000(0xc0ba6000) has not been allocated.

Affected files ...

.. //depot/projects/arm/src/sys/arm/ep93xx/ts7200_machdep.c#2 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/ep93xx/ts7200_machdep.c#2 (text+ko) ====

@@ -217,13 +217,12 @@
 	int i = 0;
 	uint32_t fake_preload[35];
 	uint32_t memsize = 32*1024*1024; /* XXX */
-	int bla;
 
 	boothowto |= RB_VERBOSE | RB_SINGLE;
 	i = 0;
 	set_cpufuncs();
 	cninit();
-	printf("cninit called\n");
+
 	fake_preload[i++] = MODINFO_NAME;
 	fake_preload[i++] = strlen("elf kernel") + 1;
 	strcpy((char*)&fake_preload[i++], "elf kernel");
@@ -243,13 +242,10 @@
 	preload_metadata = (void *)fake_preload;
 
 	physmem = memsize / PAGE_SIZE;
-	printf("mem: %ld\n", physmem);
 
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);
 
-	printf("pcpu init done\n");
-
 	physical_start = (vm_offset_t) SDRAM_START;
 	physical_end =  (vm_offset_t) &end + SDRAM_START - 0xc0000000;
 #define KERNEL_TEXT_BASE (KERNBASE + 0x00200000)
@@ -281,14 +277,10 @@
 			kernel_pt_table[loop].pv_va = 
 			    kernel_pt_table[loop].pv_pa + 0xc0000000;
 		}
-		printf("kernel[%d], va: 0x%08x, pa: 0x%08x\n", loop,
-		    kernel_pt_table[loop].pv_va, kernel_pt_table[loop].pv_pa);
 		i++;
 	}
 	freemempos -= 2 * PAGE_SIZE;
 
-	printf("page table up\n");
-
 	freemem_pt = freemempos;
 	freemempos = 0x00100000;
 	/*
@@ -306,8 +298,6 @@
 	valloc_pages(minidataclean, 1);
 	valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE);
 
-	printf("stack setup\n");
-
 	/*
 	 * Allocate memory for the l1 and l2 page tables. The scheme to avoid
 	 * wasting memory by allocating the l1pt on the first 16k memory was
@@ -322,41 +312,29 @@
 	 */
 	l1pagetable = kernel_l1pt.pv_pa;
 
-	printf("phys end: %d\n", physical_end);
-	printf("l1page, pt: %08x, va: %08x, pvaddr: %p\n", l1pagetable,
-	    ARM_VECTORS_HIGH & ~(0x00100000 - 1),
-	    &kernel_pt_table[KERNEL_PT_SYS]);
-
 	/* Map the L2 pages tables in the L1 page table */
 	pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1),
 	    &kernel_pt_table[KERNEL_PT_SYS]);
-	printf("linkl2pt\n");
 	for (i = 0; i < KERNEL_PT_KERNEL_NUM; i++) {
 		pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x00100000,
 		    &kernel_pt_table[KERNEL_PT_KERNEL + i]);
 	}
-	printf("afterforkernelnum\n");
 	for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
 		pmap_link_l2pt(l1pagetable, KERNBASE + (i + loop) * 0x00100000,
 		    &kernel_pt_table[KERNEL_PT_VMDATA + loop]);
-	printf("afterforvmdata, freemempos: 0x%08x\n", freemempos);
 	pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START,
 	    freemempos - 0x00000000 + 0x1000,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-	printf("pmapchunk a\n");
 	pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, SDRAM_START + 0x100000,
 	    0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
-	printf("pmapchunk b\n");
+	/* map the kernel into the page table */
 	pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000,
-	   (((uint32_t)(&end) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1),
-	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-	printf("pmapchunk c\n");
+	    (((uint32_t)(&end) - KERNBASE - 0x200000) + L1_S_SIZE) &
+	    ~(L1_S_SIZE - 1), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	freemem_after = ((int)&end + PAGE_SIZE) & ~(PAGE_SIZE - 1);
 	afterkern = round_page(((vm_offset_t)&end + L1_S_SIZE) & ~(L1_S_SIZE 
 	    - 1));
 
-	printf("another place\n");
-
 	/* Map the stack pages */
 #define	alloc_afterkern(va, pa, size)	\
 	va = freemem_after;		\
@@ -405,33 +383,19 @@
 		pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa,
 		    MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 
-	printf("after bunch of pmap's\n");
-
 	/* Map the vector page. */
 	pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	pmap_devmap_bootstrap(l1pagetable, tsarm_devmap);
 
-	printf("foo\n");
-
 	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT);
 
-	printf("bar\n");
-
-	__asm("mov %0, pc": "=r" (bla));
-	printf("pc: %x\n", bla);
-
-	setttb(kernel_l1pt.pv_va);
+	setttb(kernel_l1pt.pv_pa);
 
-	printf("baz\n");
-
 	cpu_tlb_flushID();
 
-	printf("bleh\n");
-
 	cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2));
 
-	printf("XXX: MMU Enabled /o/\n");
 	/*
 	 * Pages were allocated during the secondary bootstrap for the
 	 * stacks for different CPU modes.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502200717.j1K7Hiri001480>