From owner-p4-projects@FreeBSD.ORG Wed Jul 10 22:39:45 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C35E0DF2; Wed, 10 Jul 2013 22:39:44 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 84F6ADF0 for ; Wed, 10 Jul 2013 22:39:44 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) by mx1.freebsd.org (Postfix) with ESMTP id 7524F1F84 for ; Wed, 10 Jul 2013 22:39:44 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AMdisA091085 for ; Wed, 10 Jul 2013 22:39:44 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r6AMdiXa091082 for perforce@freebsd.org; Wed, 10 Jul 2013 22:39:44 GMT (envelope-from brooks@freebsd.org) Date: Wed, 10 Jul 2013 22:39:44 GMT Message-Id: <201307102239.r6AMdiXa091082@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 230987 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 22:39:45 -0000 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); } void