Add partition scheme for mpc85xx devices

Some mpc85xx devices with u-boot need MBR partitioning with a FAT boot
partition.  Since the infrastructure is already in place to have a dedicated
boot partition, this adds the necessary bits to use that infrastructure with
mpc85xx boards.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15664
This commit is contained in:
Justin Hibbits 2018-06-07 00:24:10 +00:00
parent 30dc95029e
commit 60f18ad0b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334745

View File

@ -44,7 +44,8 @@ default_scheme(void) {
if (strcmp(platform, "powermac") == 0)
return ("APM");
if (strcmp(platform, "chrp") == 0 || strcmp(platform, "ps3") == 0)
if (strcmp(platform, "chrp") == 0 || strcmp(platform, "ps3") == 0 ||
strcmp(platform, "mpc85xx") == 0)
return ("MBR");
/* Pick GPT as a generic default */
@ -65,6 +66,8 @@ is_scheme_bootable(const char *part_type) {
(strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 ||
strcmp(part_type, "GPT") == 0))
return (1);
if (strcmp(platform, "mpc85xx") == 0 && strcmp(part_type, "MBR") == 0)
return (1);
return (0);
}
@ -91,7 +94,8 @@ bootpart_size(const char *part_type)
return (0);
if (strcmp(platform, "chrp") == 0)
return (800*1024);
if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0)
if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0 ||
strcmp(platform, "mpc85xx") == 0)
return (512*1024*1024);
return (0);
}
@ -107,7 +111,8 @@ bootpart_type(const char *scheme, const char **mountpoint)
return ("prep-boot");
if (strcmp(platform, "powermac") == 0)
return ("apple-boot");
if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0) {
if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0 ||
strcmp(platform, "mpc85xx") == 0) {
*mountpoint = "/boot";
if (strcmp(scheme, "GPT") == 0)
return ("ms-basic-data");