Date: Mon, 2 Apr 2018 22:02:49 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331890 - in stable/11/sys/arm: arm xscale/i8134x Message-ID: <201804022202.w32M2nfB028113@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Mon Apr 2 22:02:49 2018 New Revision: 331890 URL: https://svnweb.freebsd.org/changeset/base/331890 Log: MFC r305094, r305096-r305097 r305094 by cognet: Garbage collect bits forgotten in r295267. r305096 by cognet: Some old arm ports don't load the kernel at the beginning of the memory, because the bootloader, ie redboot, won't let them do so, and so used the memory before the kernel for early memory allocation, such as pagetables, stacks, etc... Make a bit of an effort to try to get that memory mapped. r305097 by cognet: Nuke obio_bs_tag, it was used before it was initialized, and arm_base_bs_tag is the same, anyway. Modified: stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/11/sys/arm/arm/locore-v4.S stable/11/sys/arm/xscale/i8134x/crb_machdep.c stable/11/sys/arm/xscale/i8134x/obio.c stable/11/sys/arm/xscale/i8134x/obiovar.h stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Apr 2 22:02:49 2018 (r331890) @@ -364,8 +364,6 @@ ENTRY(xscalec3_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR msr cpsr_fsxc, r3 -#else - str r2, [r3] #endif RET END(xscalec3_setttb) Modified: stable/11/sys/arm/arm/locore-v4.S ============================================================================== --- stable/11/sys/arm/arm/locore-v4.S Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/arm/locore-v4.S Mon Apr 2 22:02:49 2018 (r331890) @@ -194,6 +194,16 @@ Lunmapped: ldr r2, =(KERNVIRTADDR) mov r3, #64 bl build_pagetables +#if defined(PHYSADDR) && (KERNVIRTADDR != KERNBASE) +/* + * If the kernel wasn't loaded at the beginning of the ram, map the memory + * before the kernel too, as some ports use that for pagetables, stack, etc... + */ + ldr r1, =PHYSADDR + ldr r2, =KERNBASE + ldr r3, =((KERNVIRTADDR - KERNBASE) / L1_S_SIZE) + bl build_pagetables +#endif /* Create a device mapping for early_printf if specified. */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) Modified: stable/11/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/11/sys/arm/xscale/i8134x/crb_machdep.c Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/crb_machdep.c Mon Apr 2 22:02:49 2018 (r331890) @@ -286,7 +286,7 @@ initarm(struct arm_boot_params *abp) cpu_setup(); i80321_calibrate_delay(); - i81342_sdram_bounds(obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); + i81342_sdram_bounds(arm_base_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; cninit(); /* Set stack for exception handlers */ Modified: stable/11/sys/arm/xscale/i8134x/obio.c ============================================================================== --- stable/11/sys/arm/xscale/i8134x/obio.c Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/obio.c Mon Apr 2 22:02:49 2018 (r331890) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include <arm/xscale/i8134x/i81342reg.h> #include <arm/xscale/i8134x/obiovar.h> -bus_space_tag_t obio_bs_tag; - static int obio_probe(device_t dev) { @@ -69,8 +67,7 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - obio_bs_tag = arm_base_bs_tag; - sc->oba_st = obio_bs_tag; + sc->oba_st = arm_base_bs_tag; sc->oba_rman.rm_type = RMAN_ARRAY; sc->oba_rman.rm_descr = "OBIO I/O"; if (rman_init(&sc->oba_rman) != 0 || Modified: stable/11/sys/arm/xscale/i8134x/obiovar.h ============================================================================== --- stable/11/sys/arm/xscale/i8134x/obiovar.h Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/obiovar.h Mon Apr 2 22:02:49 2018 (r331890) @@ -50,6 +50,5 @@ struct obio_softc { struct rman oba_irq_rman; }; -extern bus_space_tag_t obio_bs_tag; #endif /* _IQ80321_OBIOVAR_H_ */ Modified: stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c ============================================================================== --- stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c Mon Apr 2 22:02:49 2018 (r331890) @@ -54,14 +54,14 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = obio_bs_tag; + di->bas.bst = arm_base_bs_tag; di->bas.regshft = 2; di->bas.rclk = 33334000; di->baudrate = 115200; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = obio_bs_tag; + uart_bus_space_io = arm_base_bs_tag; uart_bus_space_mem = NULL; di->bas.bsh = IOP34X_UART0_VADDR; return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804022202.w32M2nfB028113>