Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Nov 2014 10:50:19 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273927 - in head/sys/boot: fdt uboot/common uboot/lib
Message-ID:  <201411011050.sA1AoJji051771@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sat Nov  1 10:50:18 2014
New Revision: 273927
URL: https://svnweb.freebsd.org/changeset/base/273927

Log:
  Move the definitions of the fdt functions from a uboot header to a new fdt
  header. There is nothing in the fdt spec that ties it to U-Boot.
  
  While here sort and fix the signature of fdt_setup_fdtp.
  
  MFC after:	1 week

Added:
  head/sys/boot/fdt/fdt_platform.h   (contents, props changed)
Modified:
  head/sys/boot/fdt/fdt_loader_cmd.c
  head/sys/boot/uboot/common/metadata.c
  head/sys/boot/uboot/lib/Makefile
  head/sys/boot/uboot/lib/libuboot.h
  head/sys/boot/uboot/lib/module.c

Modified: head/sys/boot/fdt/fdt_loader_cmd.c
==============================================================================
--- head/sys/boot/fdt/fdt_loader_cmd.c	Sat Nov  1 10:40:29 2014	(r273926)
+++ head/sys/boot/fdt/fdt_loader_cmd.c	Sat Nov  1 10:50:18 2014	(r273927)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/elf.h>
 
 #include "bootstrap.h"
+#include "fdt_platform.h"
 #include "glue.h"
 
 #ifdef DEBUG

Added: head/sys/boot/fdt/fdt_platform.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/fdt/fdt_platform.h	Sat Nov  1 10:50:18 2014	(r273927)
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner <andrew@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef FDT_PLATFORM_H
+#define FDT_PLATFORM_H
+
+extern int fdt_copy(vm_offset_t);
+extern int fdt_setup_fdtp(void);
+
+#endif /* FDT_PLATFORM_H */

Modified: head/sys/boot/uboot/common/metadata.c
==============================================================================
--- head/sys/boot/uboot/common/metadata.c	Sat Nov  1 10:40:29 2014	(r273926)
+++ head/sys/boot/uboot/common/metadata.c	Sat Nov  1 10:50:18 2014	(r273927)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #include "glue.h"
 
 #if defined(LOADER_FDT_SUPPORT)
-#include "libuboot.h"
+#include <fdt_platform.h>
 #endif
 
 static int

Modified: head/sys/boot/uboot/lib/Makefile
==============================================================================
--- head/sys/boot/uboot/lib/Makefile	Sat Nov  1 10:40:29 2014	(r273926)
+++ head/sys/boot/uboot/lib/Makefile	Sat Nov  1 10:50:18 2014	(r273927)
@@ -27,7 +27,7 @@ LOADER_FDT_SUPPORT=	no
 .endif
 
 .if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+= -DLOADER_FDT_SUPPORT
+CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt
 .endif
 
 # Pick up FDT includes

Modified: head/sys/boot/uboot/lib/libuboot.h
==============================================================================
--- head/sys/boot/uboot/lib/libuboot.h	Sat Nov  1 10:40:29 2014	(r273926)
+++ head/sys/boot/uboot/lib/libuboot.h	Sat Nov  1 10:50:18 2014	(r273927)
@@ -72,8 +72,3 @@ void reboot(void);
 
 int uboot_diskgetunit(int type, int type_unit);
 
-#if defined(LOADER_FDT_SUPPORT)
-extern int fdt_setup_fdtp();
-extern int fdt_copy(vm_offset_t);
-#endif
-

Modified: head/sys/boot/uboot/lib/module.c
==============================================================================
--- head/sys/boot/uboot/lib/module.c	Sat Nov  1 10:40:29 2014	(r273926)
+++ head/sys/boot/uboot/lib/module.c	Sat Nov  1 10:50:18 2014	(r273927)
@@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$");
 #include <stand.h>
 #include <string.h>
 
+#if defined(LOADER_FDT_SUPPORT)
+#include <fdt_platform.h>
+#endif
+
 #include "bootstrap.h"
 #include "libuboot.h"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411011050.sA1AoJji051771>