sys/dev/cfi/cfi_core.c
/*
 * Read the factory-defined 64-bit segment of the PR.
 */
Read the factory-defined 64-bit segment of the PR.
Read the factory - defined 64 - bit segment of the PR .
int 
cfi_intel_get_factory_pr(struct cfi_softc *sc, uint64_t *id)
{
	if (sc->sc_cmdset != CFI_VEND_INTEL_ECS)
		return EOPNOTSUPP;
	KASSERT(sc->sc_width == 2, ("sc_width %d", sc->sc_width));
	cfi_write(sc, 0, CFI_INTEL_READ_ID);
	*id = ((uint64_t)cfi_get16(sc, CFI_INTEL_PR(0)))<<48 |
	      ((uint64_t)cfi_get16(sc, CFI_INTEL_PR(1)))<<32 |
	      ((uint64_t)cfi_get16(sc, CFI_INTEL_PR(2)))<<16 |
	      ((uint64_t)cfi_get16(sc, CFI_INTEL_PR(3)));
	cfi_write(sc, 0, CFI_BCS_READ_ARRAY);
	return 0;
}
int cfi_intel_get_factory_pr ( struct cfi_softc * sc , uint64_t * id ) { if ( sc -> sc_cmdset != CFI_VEND_INTEL_ECS ) return EOPNOTSUPP ; KASSERT ( sc -> sc_width == 2 , ( " " , sc -> sc_width ) ) ; cfi_write ( sc , 0 , CFI_INTEL_READ_ID ) ; * id = ( ( uint64_t ) cfi_get16 ( sc , CFI_INTEL_PR ( 0 ) ) ) << 48 | ( ( uint64_t ) cfi_get16 ( sc , CFI_INTEL_PR ( 1 ) ) ) << 32 | ( ( uint64_t ) cfi_get16 ( sc , CFI_INTEL_PR ( 2 ) ) ) << 16 | ( ( uint64_t ) cfi_get16 ( sc , CFI_INTEL_PR ( 3 ) ) ) ; cfi_write ( sc , 0 , CFI_BCS_READ_ARRAY ) ; return 0 ; }
Read the factory-defined 64-bit segment of the PR.
Read the factory - defined 64 - bit segment of the PR .