arm-trusted-firmware: build 1rank firmware when MACHINE=agl-refhw-h3
[AGL/meta-agl-refhw.git] / meta-agl-refhw-gen3 / recipes-bsp / arm-trusted-firmware / files / 0001-rcar_gen3-plat-Delete-FDT-function-calls.patch
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
5
6 Since U-boot configures the device tree, the FDT function call by
7 BL31 is removed.
8
9 Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
10 Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
11 ---
12  plat/renesas/rcar/bl2_plat_setup.c | 27 +++++++++++++++++++--------
13  1 file changed, 19 insertions(+), 8 deletions(-)
14
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);
20  
21  /* FDT with DRAM configuration */
22  uint64_t fdt_blob[PAGE_SIZE_4KB / sizeof(uint64_t)];
23 +#if 0
24  static void *fdt = (void *)fdt_blob;
25  
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,
28         while (--i >= 0)
29                 *string++ = num_buf[i];
30  }
31 -
32 +#endif
33  #if (RCAR_LOSSY_ENABLE == 1)
34  typedef struct bl2_lossy_info {
35         uint32_t magic;
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)
39  {
40 +#if 0
41         const uint64_t fcnlsize = cpu_to_fdt64(end_addr - start_addr);
42         char nodename[40] = { 0 };
43         int ret, node;
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);
46                 panic();
47         }
48 +#endif
49  }
50  
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;
54  }
55  
56 +#if 0
57  static void bl2_populate_compatible_string(void *dt)
58  {
59         uint32_t board_type;
60 @@ -537,13 +541,17 @@ static void bl2_populate_compatible_string(void *dt)
61                 panic();
62         }
63  }
64 +#endif
65  
66  static void bl2_advertise_dram_entries(uint64_t dram_config[8])
67  {
68 +#if 0
69         char nodename[32] = { 0 };
70 -       uint64_t start, size;
71         uint64_t fdtsize;
72 -       int ret, node, chan;
73 +       int ret, node;
74 +#endif
75 +       uint64_t start, size;
76 +       int chan;
77  
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");
83         }
84 -
85 +#if 0
86         /*
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])
90  err:
91         NOTICE("BL2: Cannot add memory node to FDT (ret=%i)\n", ret);
92         panic();
93 +#endif
94  }
95  
96  static void bl2_advertise_dram_size(uint32_t product)
97 @@ -927,7 +936,7 @@ lcm_state:
98                 }
99                 rcar_qos_init();
100         }
101 -
102 +#if 0
103         /* Set up FDT */
104         ret = fdt_create_empty_tree(fdt, sizeof(fdt_blob));
105         if (ret) {
106 @@ -937,7 +946,7 @@ lcm_state:
107  
108         /* Add platform compatible string */
109         bl2_populate_compatible_string(fdt);
110 -
111 +#endif
112         /* Print DRAM layout */
113         bl2_advertise_dram_size(product);
114  
115 @@ -989,14 +998,14 @@ lcm_state:
116         }
117  #if (RCAR_LOSSY_ENABLE == 1)
118         NOTICE("BL2: Lossy Decomp areas\n");
119 -
120 +#if 0
121         fcnlnode = fdt_add_subnode(fdt, 0, "reserved-memory");
122         if (fcnlnode < 0) {
123                 NOTICE("BL2: Cannot create reserved mem node (ret=%i)\n",
124                         fcnlnode);
125                 panic();
126         }
127 -
128 +#endif
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);
134  #endif
135  
136 +#if 0
137         fdt_pack(fdt);
138         NOTICE("BL2: FDT at %p\n", fdt);
139 +#endif
140  
141         if (boot_dev == MODEMR_BOOT_DEV_EMMC_25X1 ||
142             boot_dev == MODEMR_BOOT_DEV_EMMC_50X8)
143 -- 
144 2.30.2
145