On Mon, 31 Dec 2012 11:06:38 +0000 (UTC)
Robert Watson <rwat...@freebsd.org> wrote:

> Author: rwatson
> Date: Mon Dec 31 11:06:37 2012
> New Revision: 244899
> URL: http://svnweb.freebsd.org/changeset/base/244899
> 
> Log:
>   If FDT is compiled into a FreeBSD/beri kernel, initialise
> OpenFirmware. 
>   Sponsored by:       DARPA, AFRL
> 
> Modified:
>   head/sys/mips/beri/beri_machdep.c
> 
> Modified: head/sys/mips/beri/beri_machdep.c
> ==============================================================================
> --- head/sys/mips/beri/beri_machdep.c Mon Dec 31 07:50:02
> 2012  (r244898) +++ head/sys/mips/beri/beri_machdep.c
> Mon Dec 31 11:06:37 2012      (r244899) @@ -1,7 +1,12 @@
>  /*-
>   * Copyright (c) 2006 Wojciech A. Koszek <wkos...@freebsd.org>
> + * Copyright (c) 2012 Robert N. M. Watson
>   * All rights reserved.
>   *
> + * This software was developed by SRI International and the
> University of
> + * Cambridge Computer Laboratory under DARPA/AFRL contract
> (FA8750-10-C-0237)
> + * ("CTSRD"), as part of the DARPA CRASH research programme.
> + *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
>   * are met:
> @@ -27,6 +32,7 @@
>  __FBSDID("$FreeBSD$");
>  
>  #include "opt_ddb.h"
> +#include "opt_platform.h"
>  
>  #include <sys/param.h>
>  #include <sys/conf.h>
> @@ -49,6 +55,9 @@ __FBSDID("$FreeBSD$");
>  #include <sys/sysproto.h>
>  #include <sys/user.h>
>  
> +#include <dev/fdt/fdt_common.h>
> +#include <dev/ofw/openfirm.h>
> +
>  #include <vm/vm.h>
>  #include <vm/vm_object.h>
>  #include <vm/vm_page.h>
> @@ -76,6 +85,17 @@ mips_init(void)
>  {
>       int i;
>  
> +#ifdef FDT
> +#ifndef FDT_DTB_STATIC
> +#error       "mips_init with FDT requires FDT_DTB_STATIC"
> +#endif
> +
> +     if (OF_install(OFW_FDT, 0) == FALSE)
> +             while (1);
> +     if (OF_init(&fdt_static_dtb) != 0)
> +             while (1);
> +#endif
> +
>       for (i = 0; i < 10; i++) {
>               phys_avail[i] = 0;
>       }
> 
> 

This looks like it is too late in the boot process. If you are using
FDT you will need to use the FDT uart which is initialised in cninit.

You will also need a patch similar to the untested one attached to fix
the build.

Andrew
Index: beri/beri_machdep.c
===================================================================
--- beri/beri_machdep.c	(revision 244940)
+++ beri/beri_machdep.c	(working copy)
@@ -55,8 +55,10 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysproto.h>
 #include <sys/user.h>
 
+#ifdef FDT
 #include <dev/fdt/fdt_common.h>
 #include <dev/ofw/openfirm.h>
+#endif
 
 #include <vm/vm.h>
 #include <vm/vm_object.h>
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to