Date: Fri, 15 Feb 2013 14:15:06 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 222060 for review Message-ID: <201302151415.r1FEF6UG030259@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <sys/bus.h> #include <sys/conf.h> #include <sys/endian.h> +#include <sys/kenv.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/module.h> @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302151415.r1FEF6UG030259>