From owner-p4-projects@FreeBSD.ORG Fri Feb 15 14:15:08 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0A4F0A5B; Fri, 15 Feb 2013 14:15:08 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 90A3DA59 for ; Fri, 15 Feb 2013 14:15:07 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82788EC5 for ; Fri, 15 Feb 2013 14:15:07 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.6/8.14.6) with ESMTP id r1FEF6ba030262 for ; Fri, 15 Feb 2013 14:15:06 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.6/8.14.6/Submit) id r1FEF6UG030259 for perforce@freebsd.org; Fri, 15 Feb 2013 14:15:06 GMT (envelope-from brooks@freebsd.org) Date: Fri, 15 Feb 2013 14:15:06 GMT Message-Id: <201302151415.r1FEF6UG030259@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 222060 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: Fri, 15 Feb 2013 14:15:08 -0000 http://p4web.freebsd.org/@@222060?ac=10 Change 222060 by brooks@brooks_zenith on 2013/02/15 14:14:54 On Intel devices, put the Factory PPR in kenv: cfi0.factory_ppr="0x9603240200663b49" Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/cfi/cfi_core.c#10 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/cfi/cfi_core.c#10 (text+ko) ==== @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,10 @@ struct timeval tv; u_int blksz, blocks; u_int r, u, usec; +#ifdef CFI_SUPPORT_STRATAFLASH + uint64_t ppr; + char name[KENV_MNAMELEN], value[32]; +#endif sc = device_get_softc(dev); sc->sc_dev = dev; @@ -345,6 +350,20 @@ "%s%u", cfi_driver_name, u); sc->sc_nod->si_drv1 = sc; +#ifdef CFI_SUPPORT_STRATAFLASH + /* + * Store the Intel factory PPR in the environment. In many + * cases it is the most unique ID on a board. + */ + if (cfi_intel_get_factory_pr(sc, &ppr) == 0) { + if (snprintf(name, sizeof(name), "%s.factory_ppr", + device_get_nameunit(dev)) < (sizeof(name) - 1) && + snprintf(value, sizeof(value), "0x%016jx", ppr) < + (sizeof(value) - 1)) + (void) setenv(name, value); + } +#endif + device_add_child(dev, "cfid", -1); bus_generic_attach(dev);