Date: Sat, 10 Oct 2020 07:20:59 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366600 - head/sys/arm/arm Message-ID: <202010100720.09A7KxE1048650@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: manu Date: Sat Oct 10 07:20:59 2020 New Revision: 366600 URL: https://svnweb.freebsd.org/changeset/base/366600 Log: arm: Check dtb version against the one we're expecting to find Reviewed by: imp, emaste, mmel Differential Revision: https://reviews.freebsd.org/D26725 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Oct 10 07:18:51 2020 (r366599) +++ head/sys/arm/arm/machdep.c Sat Oct 10 07:20:59 2020 (r366600) @@ -1111,6 +1111,8 @@ initarm(struct arm_boot_params *abp) char *env; void *kmdp; int err_devmap, mem_regions_sz; + phandle_t root; + char dts_version[255]; #ifdef EFI struct efi_map_header *efihdr; #endif @@ -1272,6 +1274,18 @@ initarm(struct arm_boot_params *abp) err_devmap); platform_late_init(); + + root = OF_finddevice("/"); + if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { + if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) + printf("WARNING: DTB version is %s while kernel expects %s, " + "please update the DTB in the ESP\n", + dts_version, + LINUX_DTS_VERSION); + } else { + printf("WARNING: Cannot find freebsd,dts-version property, " + "cannot check DTB compliance\n"); + } /* * We must now clean the cache again....
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010100720.09A7KxE1048650>