Merge git://git.denx.de/u-boot-fdt

This commit is contained in:
Tom Rini 2014-12-01 15:24:26 -05:00
commit 88342103cc
4 changed files with 7 additions and 33 deletions

View file

@ -370,22 +370,22 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
int n) int n)
{ {
int i; int i;
int address_len = fdt_address_cells(fdt, 0); int address_cells = fdt_address_cells(fdt, 0);
int size_len = fdt_size_cells(fdt, 0); int size_cells = fdt_size_cells(fdt, 0);
char *p = buf; char *p = buf;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
if (address_len == 2) if (address_cells == 2)
*(fdt64_t *)p = cpu_to_fdt64(address[i]); *(fdt64_t *)p = cpu_to_fdt64(address[i]);
else else
*(fdt32_t *)p = cpu_to_fdt32(address[i]); *(fdt32_t *)p = cpu_to_fdt32(address[i]);
p += address_len; p += 4 * address_cells;
if (size_len == 2) if (size_cells == 2)
*(fdt64_t *)p = cpu_to_fdt64(size[i]); *(fdt64_t *)p = cpu_to_fdt64(size[i]);
else else
*(fdt32_t *)p = cpu_to_fdt32(size[i]); *(fdt32_t *)p = cpu_to_fdt32(size[i]);
p += size_len; p += 4 * size_cells;
} }
return p - (char *)buf; return p - (char *)buf;

View file

@ -39,7 +39,7 @@ static void serial_find_console_or_panic(void)
/* Check for a chosen console */ /* Check for a chosen console */
node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path"); node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
if (node < 0) if (node < 0)
node = fdtdec_get_alias_node(gd->fdt_blob, "console"); node = fdt_path_offset(gd->fdt_blob, "console");
if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &dev)) { if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &dev)) {
gd->cur_serial_dev = dev; gd->cur_serial_dev = dev;
return; return;

View file

@ -392,17 +392,6 @@ int fdtdec_add_aliases_for_id(const void *blob, const char *name,
int fdtdec_get_alias_seq(const void *blob, const char *base, int node, int fdtdec_get_alias_seq(const void *blob, const char *base, int node,
int *seqp); int *seqp);
/**
* Get the offset of the given alias node
*
* This looks up an alias in /aliases then finds the offset of that node.
*
* @param blob Device tree blob (if NULL, then error is returned)
* @param name Alias name, e.g. "console"
* @return Node offset referred to by that alias, or -ve FDT_ERR_...
*/
int fdtdec_get_alias_node(const void *blob, const char *name);
/** /**
* Get the offset of the given chosen node * Get the offset of the given chosen node
* *

View file

@ -373,21 +373,6 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset,
return -ENOENT; return -ENOENT;
} }
int fdtdec_get_alias_node(const void *blob, const char *name)
{
const char *prop;
int alias_node;
int len;
if (!blob)
return -FDT_ERR_NOTFOUND;
alias_node = fdt_path_offset(blob, "/aliases");
prop = fdt_getprop(blob, alias_node, name, &len);
if (!prop)
return -FDT_ERR_NOTFOUND;
return fdt_path_offset(blob, prop);
}
int fdtdec_get_chosen_node(const void *blob, const char *name) int fdtdec_get_chosen_node(const void *blob, const char *name)
{ {
const char *prop; const char *prop;