plat/st/common/stm32mp_dt.c
/*******************************************************************************
 * This function reads a series of parameters in a node property
 * (generic use of fdt library).
 * It reads the values inside the device tree, from property name and node.
 * The number of parameters is also indicated as entry parameter.
 * Returns 0 on success and a negative FDT error code on failure.
 * If success, values are stored at the third parameter address.
 ******************************************************************************/
This function reads a series of parameters in a node property
(generic use of fdt library).
It reads the values inside the device tree, from property name and node.
The number of parameters is also indicated as entry parameter.
Returns 0 on success and a negative FDT error code on failure.
If success, values are stored at the third parameter address.
This function reads a series of parameters in a node property ( generic use of fdt library ) . It reads the values inside the device tree from property name and node . The number of parameters is also indicated as entry parameter . Returns 0 on success and a negative FDT error code on failure . If success values are stored at the third parameter address .
int fdt_read_uint32_array(int node, const char *prop_name, uint32_t *array,
			  uint32_t count)
{
	const fdt32_t *cuint;
	int len;
	uint32_t i;
	cuint = fdt_getprop(fdt, node, prop_name, &len);
	if (cuint == NULL) {
		return -FDT_ERR_NOTFOUND;
	}
	if ((uint32_t)len != (count * sizeof(uint32_t))) {
		return -FDT_ERR_BADLAYOUT;
	}
	for (i = 0; i < ((uint32_t)len / sizeof(uint32_t)); i++) {
		*array = fdt32_to_cpu(*cuint);
		array++;
		cuint++;
	}
	return 0;
}
int fdt_read_uint32_array ( int node , const char * prop_name , uint32_t * array , uint32_t count ) { const fdt32_t * cuint ; int len ; uint32_t i ; cuint = fdt_getprop ( fdt , node , prop_name , & len ) ; if ( cuint == NULL ) { return - FDT_ERR_NOTFOUND ; } if ( ( uint32_t ) len != ( count * sizeof ( uint32_t ) ) ) { return - FDT_ERR_BADLAYOUT ; } for ( i = 0 ; i < ( ( uint32_t ) len / sizeof ( uint32_t ) ) ; i ++ ) { * array = fdt32_to_cpu ( * cuint ) ; array ++ ; cuint ++ ; } return 0 ; }
This function reads a series of parameters in a node property
 (generic use of fdt library).
This function reads a series of parameters in a node property ( generic use of fdt library ) .