1 From a8e6139af9a307cc30d2e804819da963e419f017 Mon Sep 17 00:00:00 2001
2 From: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
3 Date: Tue, 15 Dec 2020 18:23:32 +0900
4 Subject: [PATCH] rcar_gen3: plat: Delete FDT function calls
6 Since U-boot configures the device tree, the FDT function call by
9 Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
10 Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
12 plat/renesas/rcar/bl2_plat_setup.c | 27 +++++++++++++++++++--------
13 1 file changed, 19 insertions(+), 8 deletions(-)
15 diff --git a/plat/renesas/rcar/bl2_plat_setup.c b/plat/renesas/rcar/bl2_plat_setup.c
16 index 24a13c7f7..59a72b5bb 100644
17 --- a/plat/renesas/rcar/bl2_plat_setup.c
18 +++ b/plat/renesas/rcar/bl2_plat_setup.c
19 @@ -110,6 +110,7 @@ static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE);
21 /* FDT with DRAM configuration */
22 uint64_t fdt_blob[PAGE_SIZE_4KB / sizeof(uint64_t)];
24 static void *fdt = (void *)fdt_blob;
26 static void unsigned_num_print(unsigned long long int unum, unsigned int radix,
27 @@ -133,7 +134,7 @@ static void unsigned_num_print(unsigned long long int unum, unsigned int radix,
29 *string++ = num_buf[i];
33 #if (RCAR_LOSSY_ENABLE == 1)
34 typedef struct bl2_lossy_info {
36 @@ -145,6 +146,7 @@ static void bl2_lossy_gen_fdt(uint32_t no, uint64_t start_addr,
37 uint64_t end_addr, uint32_t format,
38 uint32_t enable, int fcnlnode)
41 const uint64_t fcnlsize = cpu_to_fdt64(end_addr - start_addr);
42 char nodename[40] = { 0 };
44 @@ -199,6 +201,7 @@ static void bl2_lossy_gen_fdt(uint32_t no, uint64_t start_addr,
45 NOTICE("BL2: Cannot add FCNL formats prop (ret=%i)\n", ret);
51 static void bl2_lossy_setting(uint32_t no, uint64_t start_addr,
52 @@ -449,6 +452,7 @@ struct meminfo *bl2_plat_sec_mem_layout(void)
53 return &bl2_tzram_layout;
57 static void bl2_populate_compatible_string(void *dt)
60 @@ -537,13 +541,17 @@ static void bl2_populate_compatible_string(void *dt)
66 static void bl2_advertise_dram_entries(uint64_t dram_config[8])
69 char nodename[32] = { 0 };
70 - uint64_t start, size;
72 - int ret, node, chan;
75 + uint64_t start, size;
78 for (chan = 0; chan < 4; chan++) {
79 start = dram_config[2 * chan];
80 @@ -556,7 +564,7 @@ static void bl2_advertise_dram_entries(uint64_t dram_config[8])
81 (size >> 30) ? : size >> 20,
82 (size >> 30) ? "G" : "M");
87 * We add the DT nodes in reverse order here. The fdt_add_subnode()
88 * adds the DT node before the first existing DT node, so we have
89 @@ -604,6 +612,7 @@ static void bl2_advertise_dram_entries(uint64_t dram_config[8])
91 NOTICE("BL2: Cannot add memory node to FDT (ret=%i)\n", ret);
96 static void bl2_advertise_dram_size(uint32_t product)
97 @@ -927,7 +936,7 @@ lcm_state:
104 ret = fdt_create_empty_tree(fdt, sizeof(fdt_blob));
106 @@ -937,7 +946,7 @@ lcm_state:
108 /* Add platform compatible string */
109 bl2_populate_compatible_string(fdt);
112 /* Print DRAM layout */
113 bl2_advertise_dram_size(product);
115 @@ -989,14 +998,14 @@ lcm_state:
117 #if (RCAR_LOSSY_ENABLE == 1)
118 NOTICE("BL2: Lossy Decomp areas\n");
121 fcnlnode = fdt_add_subnode(fdt, 0, "reserved-memory");
123 NOTICE("BL2: Cannot create reserved mem node (ret=%i)\n",
129 bl2_lossy_setting(0, LOSSY_ST_ADDR0, LOSSY_END_ADDR0,
130 LOSSY_FMT0, LOSSY_ENA_DIS0, fcnlnode);
131 bl2_lossy_setting(1, LOSSY_ST_ADDR1, LOSSY_END_ADDR1,
132 @@ -1005,8 +1014,10 @@ lcm_state:
133 LOSSY_FMT2, LOSSY_ENA_DIS2, fcnlnode);
138 NOTICE("BL2: FDT at %p\n", fdt);
141 if (boot_dev == MODEMR_BOOT_DEV_EMMC_25X1 ||
142 boot_dev == MODEMR_BOOT_DEV_EMMC_50X8)