projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stm32mp1: display board information
[oweals/u-boot.git]
/
common
/
fdt_support.c
diff --git
a/common/fdt_support.c
b/common/fdt_support.c
index 812eca8173ba91c2f14cc698600ba1d069a07cf1..42583e3ed8c895d5b2b081bccc846be48d17bde4 100644
(file)
--- a/
common/fdt_support.c
+++ b/
common/fdt_support.c
@@
-7,7
+7,7
@@
*/
#include <common.h>
*/
#include <common.h>
-#include <
inttypes
.h>
+#include <
mapmem
.h>
#include <stdio_dev.h>
#include <linux/ctype.h>
#include <linux/types.h>
#include <stdio_dev.h>
#include <linux/ctype.h>
#include <linux/types.h>
@@
-409,7
+409,7
@@
static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
return p - (char *)buf;
}
return p - (char *)buf;
}
-#if
def CONFIG_NR_DRAM_BANKS
+#if
CONFIG_NR_DRAM_BANKS > 4
#define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS
#else
#define MEMORY_BANKS_MAX 4
#define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS
#else
#define MEMORY_BANKS_MAX 4
@@
-634,7
+634,7
@@
int fdt_shrink_to_minimum(void *blob, uint extrasize)
fdt_set_totalsize(blob, actualsize);
/* Add the new reservation */
fdt_set_totalsize(blob, actualsize);
/* Add the new reservation */
- ret = fdt_add_mem_rsv(blob,
(uintptr_t)blob
, actualsize);
+ ret = fdt_add_mem_rsv(blob,
map_to_sysmem(blob)
, actualsize);
if (ret < 0)
return ret;
if (ret < 0)
return ret;
@@
-729,7
+729,7
@@
struct reg_cell {
unsigned int r1;
};
unsigned int r1;
};
-int fdt_del_subnodes(const void *blob, int parent_offset)
+
static
int fdt_del_subnodes(const void *blob, int parent_offset)
{
int off, ndepth;
int ret;
{
int off, ndepth;
int ret;
@@
-754,7
+754,7
@@
int fdt_del_subnodes(const void *blob, int parent_offset)
return 0;
}
return 0;
}
-int fdt_del_partitions(void *blob, int parent_offset)
+
static
int fdt_del_partitions(void *blob, int parent_offset)
{
const void *prop;
int ndepth = 0;
{
const void *prop;
int ndepth = 0;
@@
-893,9
+893,9
@@
err_prop:
*
* fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
*/
*
* fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
*/
-void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size)
+void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info,
+ int node_info_size)
{
{
- struct node_info *ni = node_info;
struct mtd_device *dev;
int i, idx;
int noff;
struct mtd_device *dev;
int i, idx;
int noff;
@@
-905,12
+905,13
@@
void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size)
for (i = 0; i < node_info_size; i++) {
idx = 0;
for (i = 0; i < node_info_size; i++) {
idx = 0;
- noff = fdt_node_offset_by_compatible(blob, -1, ni[i].compat);
+ noff = fdt_node_offset_by_compatible(blob, -1,
+ node_info[i].compat);
while (noff != -FDT_ERR_NOTFOUND) {
debug("%s: %s, mtd dev type %d\n",
fdt_get_name(blob, noff, 0),
while (noff != -FDT_ERR_NOTFOUND) {
debug("%s: %s, mtd dev type %d\n",
fdt_get_name(blob, noff, 0),
- n
i[i].compat, ni
[i].type);
- dev = device_find(n
i
[i].type, idx++);
+ n
ode_info[i].compat, node_info
[i].type);
+ dev = device_find(n
ode_info
[i].type, idx++);
if (dev) {
if (fdt_node_set_part_info(blob, noff, dev))
return; /* return on error */
if (dev) {
if (fdt_node_set_part_info(blob, noff, dev))
return; /* return on error */
@@
-918,7
+919,7
@@
void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size)
/* Jump to next flash node */
noff = fdt_node_offset_by_compatible(blob, noff,
/* Jump to next flash node */
noff = fdt_node_offset_by_compatible(blob, noff,
- n
i
[i].compat);
+ n
ode_info
[i].compat);
}
}
}
}
}
}
@@
-1024,8
+1025,7
@@
static u64 of_bus_default_map(fdt32_t *addr, const fdt32_t *range,
s = fdt_read_number(range + na + pna, ns);
da = fdt_read_number(addr, na);
s = fdt_read_number(range + na + pna, ns);
da = fdt_read_number(addr, na);
- debug("OF: default map, cp=%" PRIu64 ", s=%" PRIu64
- ", da=%" PRIu64 "\n", cp, s, da);
+ debug("OF: default map, cp=%llx, s=%llx, da=%llx\n", cp, s, da);
if (da < cp || da >= (cp + s))
return OF_BAD_ADDR;
if (da < cp || da >= (cp + s))
return OF_BAD_ADDR;
@@
-1080,8
+1080,7
@@
static u64 of_bus_isa_map(fdt32_t *addr, const fdt32_t *range,
s = fdt_read_number(range + na + pna, ns);
da = fdt_read_number(addr + 1, na - 1);
s = fdt_read_number(range + na + pna, ns);
da = fdt_read_number(addr + 1, na - 1);
- debug("OF: ISA map, cp=%" PRIu64 ", s=%" PRIu64
- ", da=%" PRIu64 "\n", cp, s, da);
+ debug("OF: ISA map, cp=%llx, s=%llx, da=%llx\n", cp, s, da);
if (da < cp || da >= (cp + s))
return OF_BAD_ADDR;
if (da < cp || da >= (cp + s))
return OF_BAD_ADDR;
@@
-1187,7
+1186,7
@@
static int of_translate_one(const void *blob, int parent, struct of_bus *bus,
finish:
of_dump_addr("OF: parent translation for:", addr, pna);
finish:
of_dump_addr("OF: parent translation for:", addr, pna);
- debug("OF: with offset: %
" PRIu64 "
\n", offset);
+ debug("OF: with offset: %
llu
\n", offset);
/* Translate it into parent bus space */
return pbus->translate(addr, offset, pna);
/* Translate it into parent bus space */
return pbus->translate(addr, offset, pna);
@@
-1517,9
+1516,9
@@
int fdt_verify_alias_address(void *fdt, int anode, const char *alias, u64 addr)
dt_addr = fdt_translate_address(fdt, node, reg);
if (addr != dt_addr) {
dt_addr = fdt_translate_address(fdt, node, reg);
if (addr != dt_addr) {
- printf("Warning: U-Boot configured device %s at address %"
- PRIx64 ",\n but the device tree has it address %"
-
PRIx64 ".\n",
alias, addr, dt_addr);
+ printf("Warning: U-Boot configured device %s at address %
llu,\n
"
+ "but the device tree has it address %llx.\n",
+ alias, addr, dt_addr);
return 0;
}
return 0;
}
@@
-1667,7
+1666,7
@@
int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
if (ret < 0)
return ret;
if (ret < 0)
return ret;
- snprintf(name, sizeof(name), "framebuffer@%
" PRIx64
, base_address);
+ snprintf(name, sizeof(name), "framebuffer@%
llx"
, base_address);
ret = fdt_set_name(fdt, node, name);
if (ret < 0)
return ret;
ret = fdt_set_name(fdt, node, name);
if (ret < 0)
return ret;