Subject: Still can't alloc physical memory in cpu_setup().
To: None <>
From: Alexander Funcke <>
List: tech-kern
Date: 05/04/2002 02:51:35

I'm now running NetBSD-current and want to add support for National's
Geode SCx200 family. One of the features on the chip is an scratchpad
RAM area.

It is this one I want to alloc space for.

The physical address is at gx_base and the area is GX_BASE_SIZE bytes.
This code is executed from cpu_setup() in arch/i386/i386/machdep.c
for the particular CPU.

Running this code tell me kernel_map equals NULL, so I guess uvm_init()
hasn't taken place? even though I believed it had...

anyways, I don't have a kernel_map, but I still want to alloc this area,
should I just wait until later in the startup or is there away to do this
before uvm_init?

if(gx_base) {
		pgpa = i386_trunc_page(gx_base);
		endpa = i386_round_page(gx_base + GX_BASE_SIZE);
		if(kernel_map == NULL) {
			printf("aborting GX mapping\n");

		if((va = uvm_km_valloc(kernel_map, endpa - pgpa)) == 0) {
			printf("cpu0: Couldn't allocate a virtual adress for gx_base\n");

		for(; pgpa > endpa; pgpa += NBPG, va += NBPG)
			pmap_kenter_pa(va, pgpa, VM_PROT_READ | VM_PROT_WRITE);
	} else 
		printf("cpu0: This doesn't seem like an GX1 Geode.\n");

/Alexander Funcke