Date: Wed, 10 Jul 2013 22:39:44 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 230987 for review Message-ID: <201307102239.r6AMdiXa091082@skunkworks.freebsd.org>
index | next in thread | raw e-mail
http://p4web.freebsd.org/@@230987?ac=10 Change 230987 by brooks@brooks_zenith on 2013/07/10 22:39:40 Allow kernels with FDT entries for CPUs or threads are aren't present to boot by checking for a properly initalized spin_entry struct. This will simplify configuration managment while we work toward a state where the FDT is built with each bitfile. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_mp.c#4 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_mp.c#4 (text+ko) ==== @@ -57,6 +57,8 @@ { phandle_t cpus, cpu; pcell_t reg; + char prop[16]; + struct spin_entry *se; if ((cpus = OF_finddevice("/cpus")) <= 0) { printf("%s: no \"/cpus\" device found in FDT\n", __func__); @@ -76,8 +78,36 @@ if (reg > MAXCPU) { printf("%s: cpu ID too large (%d > %d)\n", __func__, reg, MAXCPU); + continue; } cpu_of_nodes[reg] = cpu; + + if (reg != 0) { + if (OF_getprop(cpu, "enable-method", &prop, + sizeof(prop)) <= 0 && OF_getprop(OF_parent(cpu), + "enable-method", &prop, sizeof(prop)) <= 0) { + printf("%s: CPU %d has no enable-method " + "property\n", __func__, reg); + continue; + } + if (strcmp("spin-table", prop) != 0) { + printf("%s: CPU %d enable-method is '%s' not " + "'spin-table'\n", __func__, reg, prop); + continue; + } + + if (OF_getprop(cpu, "cpu-release-addr", &se, + sizeof(se)) <= 0) { + printf("%s: CPU %d has missing or invalid " + "cpu-release-addr\n", __func__, reg); + continue; + } + if (se->entry_addr != 1) { + printf("%s: CPU %d has uninitalized spin " + "entry\n", __func__, reg); + continue; + } + } CPU_SET(reg, mask); } while ((cpu = OF_peer(cpu)) > 0); @@ -91,7 +121,7 @@ * XXX: panic instead? */ CPU_ZERO(mask); - CPU_SET(1, mask); + CPU_SET(0, mask); } voidhelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307102239.r6AMdiXa091082>
