svn commit: r346302 - in stable: 11/stand/efi/fdt 11/stand/fdt 11/stand/powerpc/kboot 11/stand/powerpc/ofw 11/stand/uboot/fdt 12/stand/efi/fdt 12/stand/fdt 12/stand/powerpc/kboot 12/stand/powerpc/o...

Kyle Evans kevans at FreeBSD.org
Tue Apr 16 21:01:09 UTC 2019


Author: kevans
Date: Tue Apr 16 21:01:07 2019
New Revision: 346302
URL: https://svnweb.freebsd.org/changeset/base/346302

Log:
  MFC r346132: stand: refactor overlay loading a little bit
  
  It was pointed out that manually loading a .dtb to be used rather than
  relying on platform-specific method for loading .dtb will result in overlays
  not being applied. This was true because overlay loading was hacked into
  fdt_platform_load_dtb, rather than done in a way more independent from how
  the .dtb is loaded.
  
  Instead, push overlay loading (for now) out into an
  fdt_platform_load_overlays. This method easily allows ubldr to pull in any
  fdt_overlays specified in the ub env, and omits overlay-checking on
  platforms where they're not tested and/or not desired (e.g. powerpc). If we
  eventually stop caring about fdt_overlays from ubenv (if we ever cared),
  this method should get chopped out in favor of just calling
  fdt_load_dtb_overlays() directly.

Modified:
  stable/11/stand/efi/fdt/efi_fdt.c
  stable/11/stand/fdt/fdt_loader_cmd.c
  stable/11/stand/fdt/fdt_platform.h
  stable/11/stand/powerpc/kboot/kbootfdt.c
  stable/11/stand/powerpc/ofw/ofwfdt.c
  stable/11/stand/uboot/fdt/uboot_fdt.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/stand/efi/fdt/efi_fdt.c
  stable/12/stand/fdt/fdt_loader_cmd.c
  stable/12/stand/fdt/fdt_platform.h
  stable/12/stand/powerpc/kboot/kbootfdt.c
  stable/12/stand/powerpc/ofw/ofwfdt.c
  stable/12/stand/uboot/fdt/uboot_fdt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/stand/efi/fdt/efi_fdt.c
==============================================================================
--- stable/11/stand/efi/fdt/efi_fdt.c	Tue Apr 16 20:59:57 2019	(r346301)
+++ stable/11/stand/efi/fdt/efi_fdt.c	Tue Apr 16 21:01:07 2019	(r346302)
@@ -52,8 +52,14 @@ fdt_platform_load_dtb(void)
 		return (1);
 	printf("Using DTB provided by EFI at %p.\n", hdr);
 
-	fdt_load_dtb_overlays(NULL);
 	return (0);
+}
+
+void
+fdt_platform_load_overlays(void)
+{
+
+	fdt_load_dtb_overlays(NULL);
 }
 
 void

Modified: stable/11/stand/fdt/fdt_loader_cmd.c
==============================================================================
--- stable/11/stand/fdt/fdt_loader_cmd.c	Tue Apr 16 20:59:57 2019	(r346301)
+++ stable/11/stand/fdt/fdt_loader_cmd.c	Tue Apr 16 21:01:07 2019	(r346302)
@@ -522,6 +522,7 @@ fdt_setup_fdtp()
 		if (fdt_load_dtb(bfp->f_addr) == 0) {
 			printf("Using DTB from loaded file '%s'.\n", 
 			    bfp->f_name);
+			fdt_platform_load_overlays();
 			return (0);
 		}
 	}
@@ -531,12 +532,15 @@ fdt_setup_fdtp()
 		if (fdt_load_dtb_addr(fdt_to_load) == 0) {
 			printf("Using DTB from memory address %p.\n",
 			    fdt_to_load);
+			fdt_platform_load_overlays();
 			return (0);
 		}
 	}
 
-	if (fdt_platform_load_dtb() == 0)
+	if (fdt_platform_load_dtb() == 0) {
+		fdt_platform_load_overlays();
 		return (0);
+	}
 
 	/* If there is a dtb compiled into the kernel, use it. */
 	if ((va = fdt_find_static_dtb()) != 0) {

Modified: stable/11/stand/fdt/fdt_platform.h
==============================================================================
--- stable/11/stand/fdt/fdt_platform.h	Tue Apr 16 20:59:57 2019	(r346301)
+++ stable/11/stand/fdt/fdt_platform.h	Tue Apr 16 21:01:07 2019	(r346302)
@@ -51,6 +51,7 @@ int fdt_setup_fdtp(void);
 
 /* The platform library needs to implement these functions */
 int fdt_platform_load_dtb(void);
+void fdt_platform_load_overlays(void);
 void fdt_platform_fixups(void);
 
 #endif /* FDT_PLATFORM_H */

Modified: stable/11/stand/powerpc/kboot/kbootfdt.c
==============================================================================
--- stable/11/stand/powerpc/kboot/kbootfdt.c	Tue Apr 16 20:59:57 2019	(r346301)
+++ stable/11/stand/powerpc/kboot/kbootfdt.c	Tue Apr 16 21:01:07 2019	(r346302)
@@ -177,6 +177,12 @@ fdt_platform_load_dtb(void)
 }
 
 void
+fdt_platform_load_overlays(void)
+{
+
+}
+
+void
 fdt_platform_fixups(void)
 {
 

Modified: stable/11/stand/powerpc/ofw/ofwfdt.c
==============================================================================
--- stable/11/stand/powerpc/ofw/ofwfdt.c	Tue Apr 16 20:59:57 2019	(r346301)
+++ stable/11/stand/powerpc/ofw/ofwfdt.c	Tue Apr 16 21:01:07 2019	(r346302)
@@ -198,6 +198,12 @@ fdt_platform_load_dtb(void)
 }
 
 void
+fdt_platform_load_overlays(void)
+{
+
+}
+
+void
 fdt_platform_fixups(void)
 {
 

Modified: stable/11/stand/uboot/fdt/uboot_fdt.c
==============================================================================
--- stable/11/stand/uboot/fdt/uboot_fdt.c	Tue Apr 16 20:59:57 2019	(r346301)
+++ stable/11/stand/uboot/fdt/uboot_fdt.c	Tue Apr 16 21:01:07 2019	(r346302)
@@ -103,9 +103,14 @@ fdt_platform_load_dtb(void)
 	}
 
 exit:
-	if (rv == 0)
-		fdt_load_dtb_overlays(ub_env_get("fdt_overlays"));
 	return (rv);
+}
+
+void
+fdt_platform_load_overlays(void)
+{
+
+	fdt_load_dtb_overlays(ub_env_get("fdt_overlays"));
 }
 
 void


More information about the svn-src-all mailing list