From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 13:20:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EA7E7E2F; Sat, 12 Jan 2013 13:20:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3AF98A6; Sat, 12 Jan 2013 13:20:22 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CDKM8c035630; Sat, 12 Jan 2013 13:20:22 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CDKMtj035628; Sat, 12 Jan 2013 13:20:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121320.r0CDKMtj035628@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 13:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245330 - in head/sys/mips: beri include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 13:20:23 -0000 Author: rwatson Date: Sat Jan 12 13:20:21 2013 New Revision: 245330 URL: http://svnweb.freebsd.org/changeset/base/245330 Log: Merge Perforce change @219948 to head: Add code so that the BERI boot process can ask the kernel linker for DTB blobs that may have been left for it by the boot loader, as done on PowerPC and ARM. This will require both a more mature boot loader, and more mature boot loader argument passing mechanism, than currently supported on BERI. Sponsored by: DARPA, AFRL Modified: head/sys/mips/beri/beri_machdep.c head/sys/mips/include/metadata.h Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Sat Jan 12 12:34:59 2013 (r245329) +++ head/sys/mips/beri/beri_machdep.c Sat Jan 12 13:20:21 2013 (r245330) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -135,6 +137,10 @@ platform_start(__register_t a0, __regist char **argv = (char **)a1; char **envp = (char **)a2; unsigned int memsize = a3; +#ifdef FDT + vm_offset_t dtbp; + void *kmdp; +#endif int i; /* clear the BSS and SBSS segments */ @@ -146,8 +152,24 @@ platform_start(__register_t a0, __regist mips_pcpu0_init(); #ifdef FDT -#ifndef FDT_DTB_STATIC -#error "mips_init with FDT requires FDT_DTB_STATIC" + /* + * Find the dtb passed in by the boot loader (currently fictional). + */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; + +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; +#else +#error "Non-static FDT not yet supported on BERI" #endif if (OF_install(OFW_FDT, 0) == FALSE) Modified: head/sys/mips/include/metadata.h ============================================================================== --- head/sys/mips/include/metadata.h Sat Jan 12 12:34:59 2013 (r245329) +++ head/sys/mips/include/metadata.h Sat Jan 12 13:20:21 2013 (r245330) @@ -30,5 +30,6 @@ #define _MACHINE_METADATA_H_ #define MODINFOMD_SMAP 0x1001 +#define MODINFOMD_DTBP 0x1002 #endif /* !_MACHINE_METADATA_H_ */