plat/st/common/stm32mp_dt.c
/*******************************************************************************
 * This function gets the stdout path node.
 * It reads the value indicated inside the device tree.
 * Returns node on success and a negative FDT error code on failure.
 ******************************************************************************/
This function gets the stdout path node.
It reads the value indicated inside the device tree.
Returns node on success and a negative FDT error code on failure.
This function gets the stdout path node . It reads the value indicated inside the device tree . Returns node on success and a negative FDT error code on failure .
static int dt_get_stdout_node_offset(void)
{
	int node;
	const char *cchar;
	node = fdt_path_offset(fdt, "/secure-chosen");
	if (node < 0) {
		node = fdt_path_offset(fdt, "/chosen");
		if (node < 0) {
			return -FDT_ERR_NOTFOUND;
		}
	}
	cchar = fdt_getprop(fdt, node, "stdout-path", NULL);
	if (cchar == NULL) {
		return -FDT_ERR_NOTFOUND;
	}
	node = -FDT_ERR_NOTFOUND;
	if (strchr(cchar, (int)':') != NULL) {
		const char *name;
		char *str = (char *)cchar;
		int len = 0;
		while (strncmp(":", str, 1)) {
			len++;
			str++;
		}
		name = fdt_get_alias_namelen(fdt, cchar, len);
		if (name != NULL) {
			node = fdt_path_offset(fdt, name);
		}
	} else {
		node = fdt_path_offset(fdt, cchar);
	}
	return node;
}
static int dt_get_stdout_node_offset ( void ) { int node ; const char * cchar ; node = fdt_path_offset ( fdt , " " ) ; if ( node < 0 ) { node = fdt_path_offset ( fdt , " " ) ; if ( node < 0 ) { return - FDT_ERR_NOTFOUND ; } } cchar = fdt_getprop ( fdt , node , " " , NULL ) ; if ( cchar == NULL ) { return - FDT_ERR_NOTFOUND ; } node = - FDT_ERR_NOTFOUND ; if ( strchr ( cchar , ( int ) ' ' ) != NULL ) { const char * name ; char * str = ( char * ) cchar ; int len = 0 ; while ( strncmp ( " " , str , 1 ) ) { len ++ ; str ++ ; } name = fdt_get_alias_namelen ( fdt , cchar , len ) ; if ( name != NULL ) { node = fdt_path_offset ( fdt , name ) ; } } else { node = fdt_path_offset ( fdt , cchar ) ; } return node ; }
This function gets the stdout path node.
This function gets the stdout path node .