Index: arm/sa11x0/sa11x0_com.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/sa11x0/sa11x0_com.c,v retrieving revision 1.28 diff -u -r1.28 sa11x0_com.c --- arm/sa11x0/sa11x0_com.c 4 Mar 2006 17:22:06 -0000 1.28 +++ arm/sa11x0/sa11x0_com.c 5 Mar 2006 11:33:55 -0000 @@ -1522,7 +1522,7 @@ { if (cp == NULL) { /* XXX cp == NULL means that MMU is disabled. */ - sacomconsioh = SACOM3_HW_BASE; + sacomconsioh = SACOM3_BASE; sacomconstag = &sa11x0_bs_tag; cn_tab = &sacomcons; return; Index: arm/sa11x0/sa11x0_io.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/sa11x0/sa11x0_io.c,v retrieving revision 1.15 diff -u -r1.15 sa11x0_io.c --- arm/sa11x0/sa11x0_io.c 4 Mar 2006 17:22:06 -0000 1.15 +++ arm/sa11x0/sa11x0_io.c 5 Mar 2006 11:33:55 -0000 @@ -145,14 +145,13 @@ u_long startpa, endpa, pa; vaddr_t va; pt_entry_t *pte; + const struct pmap_devmap *pd; -#ifdef hpcarm - if ((u_long)bpa > (u_long)KERNEL_BASE) { - /* XXX This is a temporary hack to aid transition. */ - *bshp = bpa; - return(0); + if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { + /* Device was statically mapped. */ + *bshp = pd->pd_va + (bpa - pd->pd_pa); + return 0; } -#endif startpa = trunc_page(bpa); endpa = round_page(bpa + size); @@ -190,9 +189,20 @@ void sa11x0_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size) { - /* - * Temporary implementation - */ + vaddr_t va, endva; + + if (pmap_devmap_find_va(bsh, size) != NULL) { + /* Device was statically mapped; nothing to do. */ + return; + } + + va = trunc_page(bsh); + endva = round_page(bsh + size); + + pmap_kremove(va, endva - va); + pmap_update(pmap_kernel()); + + uvm_km_free(kernel_map, va, endva - va, UVM_KMF_VAONLY); } void Index: arm/sa11x0/sa11x0_reg.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/sa11x0/sa11x0_reg.h,v retrieving revision 1.4 diff -u -r1.4 sa11x0_reg.h --- arm/sa11x0/sa11x0_reg.h 19 Jul 2002 18:26:56 -0000 1.4 +++ arm/sa11x0/sa11x0_reg.h 5 Mar 2006 11:33:55 -0000 @@ -48,7 +48,7 @@ #define SAPPC_BASE 0x90060000 /* Peripheral Pin Controller */ #define SAUDC_BASE 0x80000000 /* USB Device Controller*/ #define SACOM1_BASE 0x80010000 /* GPCLK/UART 1 */ -#define SACOM3_HW_BASE 0x80050000 /* UART 3 */ +#define SACOM3_BASE 0x80050000 /* UART 3 */ #define SAMCP_BASE 0x80060000 /* MCP Controller */ #define SASSP_BASE 0x80070000 /* Synchronous serial port */ @@ -56,7 +56,7 @@ #define SALCD_BASE 0xB0100000 /* LCD */ /* Register base virtual addresses mapped by initarm() */ -#define SACOM3_BASE 0xd000d000 +#define SACOM3_VBASE 0xd000d000 /* Interrupt controller registers */ #define SAIPIC_NPORTS 9 Index: hpcarm/conf/IPAQ =================================================================== RCS file: /cvsroot/src/sys/arch/hpcarm/conf/IPAQ,v retrieving revision 1.45 diff -u -r1.45 IPAQ --- hpcarm/conf/IPAQ 5 Feb 2006 05:01:50 -0000 1.45 +++ hpcarm/conf/IPAQ 5 Mar 2006 11:33:55 -0000 @@ -138,7 +138,7 @@ # Serial options CONSPEED=19200 -sacom* at saip? addr 0xd000d000 size 0x24 intr 17 +sacom* at saip? addr 0x80050000 size 0x24 intr 17 # OS Timer saost* at saip? addr 0x90000000 size 0x20 Index: hpcarm/conf/JORNADA720 =================================================================== RCS file: /cvsroot/src/sys/arch/hpcarm/conf/JORNADA720,v retrieving revision 1.56 diff -u -r1.56 JORNADA720 --- hpcarm/conf/JORNADA720 4 Mar 2006 15:19:47 -0000 1.56 +++ hpcarm/conf/JORNADA720 5 Mar 2006 11:33:55 -0000 @@ -144,7 +144,7 @@ # Serial options CONSPEED=19200 -sacom* at saip? addr 0xd000d000 size 0x24 intr 17 +sacom* at saip? addr 0x80050000 size 0x24 intr 17 # OS Timer saost* at saip? addr 0x90000000 size 0x20 Index: hpcarm/conf/JORNADA820 =================================================================== RCS file: /cvsroot/src/sys/arch/hpcarm/conf/JORNADA820,v retrieving revision 1.4 diff -u -r1.4 JORNADA820 --- hpcarm/conf/JORNADA820 5 Feb 2006 05:01:50 -0000 1.4 +++ hpcarm/conf/JORNADA820 5 Mar 2006 11:33:55 -0000 @@ -140,9 +140,8 @@ saip0 at mainbus? # Serial -# ??? virtual address????? options CONSPEED=19200 -sacom* at saip? addr 0xd000d000 size 0x24 intr 17 +sacom* at saip? addr 0x80050000 size 0x24 intr 17 #OS Timer Index: hpcarm/hpcarm/hpc_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/hpcarm/hpcarm/hpc_machdep.c,v retrieving revision 1.78 diff -u -r1.78 hpc_machdep.c --- hpcarm/hpcarm/hpc_machdep.c 27 Feb 2006 11:34:35 -0000 1.78 +++ hpcarm/hpcarm/hpc_machdep.c 5 Mar 2006 11:33:56 -0000 @@ -283,6 +283,23 @@ #endif /* + * Static device mappings. These peripheral registers are mapped at + * fixed virtual addresses very early in initarm() so that we can use + * them while booting the kernel and stay at the same address + * throughout whole kernel's life time. + */ +static const struct pmap_devmap sa11x0_devmap[] = { + /* Physical/virtual address for UART #3. */ + { + SACOM3_VBASE, + SACOM3_BASE, + 0x24, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE + }, + { 0, 0, 0, 0, 0 } +}; + +/* * Initial entry point on startup. This gets called before main() is * entered. * It should be responsible for setting up everything that must be @@ -587,10 +604,8 @@ pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - /* Map any I/O modules here, as we don't have real bus_space_map() */ - printf("mapping IO..."); - pmap_map_entry(l1pagetable, SACOM3_BASE, SACOM3_HW_BASE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE); + /* Map the statically mapped devices. */ + pmap_devmap_bootstrap(l1pagetable, sa11x0_devmap); pmap_map_chunk(l1pagetable, sa1_cache_clean_addr, 0xe0000000, CPU_SA110_CACHE_CLEAN_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);