xref: /openbmc/u-boot/drivers/net/fsl-mc/mc.c (revision 7b3bd9a7)
1*7b3bd9a7SJ. German Rivera /*
2*7b3bd9a7SJ. German Rivera  * Copyright (C) 2014 Freescale Semiconductor
3*7b3bd9a7SJ. German Rivera  *
4*7b3bd9a7SJ. German Rivera  * SPDX-License-Identifier:	GPL-2.0+
5*7b3bd9a7SJ. German Rivera  */
6*7b3bd9a7SJ. German Rivera 
7*7b3bd9a7SJ. German Rivera #include <errno.h>
8*7b3bd9a7SJ. German Rivera #include <asm/io.h>
9*7b3bd9a7SJ. German Rivera #include <fsl-mc/fsl_mc.h>
10*7b3bd9a7SJ. German Rivera #include <fsl-mc/fsl_mc_sys.h>
11*7b3bd9a7SJ. German Rivera #include <fsl-mc/fsl_dpmng.h>
12*7b3bd9a7SJ. German Rivera 
13*7b3bd9a7SJ. German Rivera DECLARE_GLOBAL_DATA_PTR;
14*7b3bd9a7SJ. German Rivera static int mc_boot_status;
15*7b3bd9a7SJ. German Rivera 
16*7b3bd9a7SJ. German Rivera /**
17*7b3bd9a7SJ. German Rivera  * Copying MC firmware or DPL image to DDR
18*7b3bd9a7SJ. German Rivera  */
19*7b3bd9a7SJ. German Rivera static int mc_copy_image(const char *title,
20*7b3bd9a7SJ. German Rivera 			 u64 image_addr, u32 image_size, u64 mc_ram_addr)
21*7b3bd9a7SJ. German Rivera {
22*7b3bd9a7SJ. German Rivera 	debug("%s copied to address %p\n", title, (void *)mc_ram_addr);
23*7b3bd9a7SJ. German Rivera 	memcpy((void *)mc_ram_addr, (void *)image_addr, image_size);
24*7b3bd9a7SJ. German Rivera 	return 0;
25*7b3bd9a7SJ. German Rivera }
26*7b3bd9a7SJ. German Rivera 
27*7b3bd9a7SJ. German Rivera /**
28*7b3bd9a7SJ. German Rivera  * MC firmware FIT image parser checks if the image is in FIT
29*7b3bd9a7SJ. German Rivera  * format, verifies integrity of the image and calculates
30*7b3bd9a7SJ. German Rivera  * raw image address and size values.
31*7b3bd9a7SJ. German Rivera  * Returns 0 on success and a negative errno on error.
32*7b3bd9a7SJ. German Rivera  * task fail.
33*7b3bd9a7SJ. German Rivera  **/
34*7b3bd9a7SJ. German Rivera int parse_mc_firmware_fit_image(const void **raw_image_addr,
35*7b3bd9a7SJ. German Rivera 				size_t *raw_image_size)
36*7b3bd9a7SJ. German Rivera {
37*7b3bd9a7SJ. German Rivera 	int format;
38*7b3bd9a7SJ. German Rivera 	void *fit_hdr;
39*7b3bd9a7SJ. German Rivera 	int node_offset;
40*7b3bd9a7SJ. German Rivera 	const void *data;
41*7b3bd9a7SJ. German Rivera 	size_t size;
42*7b3bd9a7SJ. German Rivera 	const char *uname = "firmware";
43*7b3bd9a7SJ. German Rivera 
44*7b3bd9a7SJ. German Rivera 	/* Check if the image is in NOR flash */
45*7b3bd9a7SJ. German Rivera #ifdef CONFIG_SYS_LS_MC_FW_IN_NOR
46*7b3bd9a7SJ. German Rivera 	fit_hdr = (void *)CONFIG_SYS_LS_MC_FW_ADDR;
47*7b3bd9a7SJ. German Rivera #else
48*7b3bd9a7SJ. German Rivera #error "No CONFIG_SYS_LS_MC_FW_IN_xxx defined"
49*7b3bd9a7SJ. German Rivera #endif
50*7b3bd9a7SJ. German Rivera 
51*7b3bd9a7SJ. German Rivera 	/* Check if Image is in FIT format */
52*7b3bd9a7SJ. German Rivera 	format = genimg_get_format(fit_hdr);
53*7b3bd9a7SJ. German Rivera 
54*7b3bd9a7SJ. German Rivera 	if (format != IMAGE_FORMAT_FIT) {
55*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Bad firmware image (not a FIT image)\n");
56*7b3bd9a7SJ. German Rivera 		return -EINVAL;
57*7b3bd9a7SJ. German Rivera 	}
58*7b3bd9a7SJ. German Rivera 
59*7b3bd9a7SJ. German Rivera 	if (!fit_check_format(fit_hdr)) {
60*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Bad firmware image (bad FIT header)\n");
61*7b3bd9a7SJ. German Rivera 		return -EINVAL;
62*7b3bd9a7SJ. German Rivera 	}
63*7b3bd9a7SJ. German Rivera 
64*7b3bd9a7SJ. German Rivera 	node_offset = fit_image_get_node(fit_hdr, uname);
65*7b3bd9a7SJ. German Rivera 
66*7b3bd9a7SJ. German Rivera 	if (node_offset < 0) {
67*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Bad firmware image (missing subimage)\n");
68*7b3bd9a7SJ. German Rivera 		return -ENOENT;
69*7b3bd9a7SJ. German Rivera 	}
70*7b3bd9a7SJ. German Rivera 
71*7b3bd9a7SJ. German Rivera 	/* Verify MC firmware image */
72*7b3bd9a7SJ. German Rivera 	if (!(fit_image_verify(fit_hdr, node_offset))) {
73*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Bad firmware image (bad CRC)\n");
74*7b3bd9a7SJ. German Rivera 		return -EINVAL;
75*7b3bd9a7SJ. German Rivera 	}
76*7b3bd9a7SJ. German Rivera 
77*7b3bd9a7SJ. German Rivera 	/* Get address and size of raw image */
78*7b3bd9a7SJ. German Rivera 	fit_image_get_data(fit_hdr, node_offset, &data, &size);
79*7b3bd9a7SJ. German Rivera 
80*7b3bd9a7SJ. German Rivera 	*raw_image_addr = data;
81*7b3bd9a7SJ. German Rivera 	*raw_image_size = size;
82*7b3bd9a7SJ. German Rivera 
83*7b3bd9a7SJ. German Rivera 	return 0;
84*7b3bd9a7SJ. German Rivera }
85*7b3bd9a7SJ. German Rivera 
86*7b3bd9a7SJ. German Rivera int mc_init(bd_t *bis)
87*7b3bd9a7SJ. German Rivera {
88*7b3bd9a7SJ. German Rivera 	int error = 0;
89*7b3bd9a7SJ. German Rivera 	int timeout = 200000;
90*7b3bd9a7SJ. German Rivera 	struct mc_ccsr_registers __iomem *mc_ccsr_regs = MC_CCSR_BASE_ADDR;
91*7b3bd9a7SJ. German Rivera 	u64 mc_ram_addr;
92*7b3bd9a7SJ. German Rivera 	u64 mc_dpl_offset;
93*7b3bd9a7SJ. German Rivera 	u32 reg_gsr;
94*7b3bd9a7SJ. German Rivera 	u32 mc_fw_boot_status;
95*7b3bd9a7SJ. German Rivera 	void *dpl_fdt_hdr;
96*7b3bd9a7SJ. German Rivera 	int dpl_size;
97*7b3bd9a7SJ. German Rivera 	const void *raw_image_addr;
98*7b3bd9a7SJ. German Rivera 	size_t raw_image_size = 0;
99*7b3bd9a7SJ. German Rivera 	struct fsl_mc_io mc_io;
100*7b3bd9a7SJ. German Rivera 	int portal_id;
101*7b3bd9a7SJ. German Rivera 	struct mc_version mc_ver_info;
102*7b3bd9a7SJ. German Rivera 
103*7b3bd9a7SJ. German Rivera 	/*
104*7b3bd9a7SJ. German Rivera 	 * The MC private DRAM block was already carved at the end of DRAM
105*7b3bd9a7SJ. German Rivera 	 * by board_init_f() using CONFIG_SYS_MEM_TOP_HIDE:
106*7b3bd9a7SJ. German Rivera 	 */
107*7b3bd9a7SJ. German Rivera 	if (gd->bd->bi_dram[1].start) {
108*7b3bd9a7SJ. German Rivera 		mc_ram_addr =
109*7b3bd9a7SJ. German Rivera 			gd->bd->bi_dram[1].start + gd->bd->bi_dram[1].size;
110*7b3bd9a7SJ. German Rivera 	} else {
111*7b3bd9a7SJ. German Rivera 		mc_ram_addr =
112*7b3bd9a7SJ. German Rivera 			gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size;
113*7b3bd9a7SJ. German Rivera 	}
114*7b3bd9a7SJ. German Rivera 
115*7b3bd9a7SJ. German Rivera 	/*
116*7b3bd9a7SJ. German Rivera 	 * Management Complex cores should be held at reset out of POR.
117*7b3bd9a7SJ. German Rivera 	 * U-boot should be the first software to touch MC. To be safe,
118*7b3bd9a7SJ. German Rivera 	 * we reset all cores again by setting GCR1 to 0. It doesn't do
119*7b3bd9a7SJ. German Rivera 	 * anything if they are held at reset. After we setup the firmware
120*7b3bd9a7SJ. German Rivera 	 * we kick off MC by deasserting the reset bit for core 0, and
121*7b3bd9a7SJ. German Rivera 	 * deasserting the reset bits for Command Portal Managers.
122*7b3bd9a7SJ. German Rivera 	 * The stop bits are not touched here. They are used to stop the
123*7b3bd9a7SJ. German Rivera 	 * cores when they are active. Setting stop bits doesn't stop the
124*7b3bd9a7SJ. German Rivera 	 * cores from fetching instructions when they are released from
125*7b3bd9a7SJ. German Rivera 	 * reset.
126*7b3bd9a7SJ. German Rivera 	 */
127*7b3bd9a7SJ. German Rivera 	out_le32(&mc_ccsr_regs->reg_gcr1, 0);
128*7b3bd9a7SJ. German Rivera 	dmb();
129*7b3bd9a7SJ. German Rivera 
130*7b3bd9a7SJ. German Rivera 	error = parse_mc_firmware_fit_image(&raw_image_addr, &raw_image_size);
131*7b3bd9a7SJ. German Rivera 	if (error != 0)
132*7b3bd9a7SJ. German Rivera 		goto out;
133*7b3bd9a7SJ. German Rivera 	/*
134*7b3bd9a7SJ. German Rivera 	 * Load the MC FW at the beginning of the MC private DRAM block:
135*7b3bd9a7SJ. German Rivera 	 */
136*7b3bd9a7SJ. German Rivera 	mc_copy_image("MC Firmware",
137*7b3bd9a7SJ. German Rivera 		      (u64)raw_image_addr, raw_image_size, mc_ram_addr);
138*7b3bd9a7SJ. German Rivera 
139*7b3bd9a7SJ. German Rivera 	/*
140*7b3bd9a7SJ. German Rivera 	 * Get address and size of the DPL blob stored in flash:
141*7b3bd9a7SJ. German Rivera 	 */
142*7b3bd9a7SJ. German Rivera #ifdef CONFIG_SYS_LS_MC_DPL_IN_NOR
143*7b3bd9a7SJ. German Rivera 	dpl_fdt_hdr = (void *)CONFIG_SYS_LS_MC_DPL_ADDR;
144*7b3bd9a7SJ. German Rivera #else
145*7b3bd9a7SJ. German Rivera #error "No CONFIG_SYS_LS_MC_DPL_IN_xxx defined"
146*7b3bd9a7SJ. German Rivera #endif
147*7b3bd9a7SJ. German Rivera 
148*7b3bd9a7SJ. German Rivera 	error = fdt_check_header(dpl_fdt_hdr);
149*7b3bd9a7SJ. German Rivera 	if (error != 0) {
150*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Bad DPL image (bad header)\n");
151*7b3bd9a7SJ. German Rivera 		goto out;
152*7b3bd9a7SJ. German Rivera 	}
153*7b3bd9a7SJ. German Rivera 
154*7b3bd9a7SJ. German Rivera 	dpl_size = fdt_totalsize(dpl_fdt_hdr);
155*7b3bd9a7SJ. German Rivera 	if (dpl_size > CONFIG_SYS_LS_MC_DPL_MAX_LENGTH) {
156*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Bad DPL image (too large: %d)\n",
157*7b3bd9a7SJ. German Rivera 		       dpl_size);
158*7b3bd9a7SJ. German Rivera 		error = -EINVAL;
159*7b3bd9a7SJ. German Rivera 		goto out;
160*7b3bd9a7SJ. German Rivera 	}
161*7b3bd9a7SJ. German Rivera 
162*7b3bd9a7SJ. German Rivera 	/*
163*7b3bd9a7SJ. German Rivera 	 * Calculate offset in the MC private DRAM block at which the MC DPL
164*7b3bd9a7SJ. German Rivera 	 * blob is to be placed:
165*7b3bd9a7SJ. German Rivera 	 */
166*7b3bd9a7SJ. German Rivera #ifdef CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET
167*7b3bd9a7SJ. German Rivera 	BUILD_BUG_ON((CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET & 0x3) != 0 ||
168*7b3bd9a7SJ. German Rivera 		     CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET > 0xffffffff);
169*7b3bd9a7SJ. German Rivera 
170*7b3bd9a7SJ. German Rivera 	mc_dpl_offset = CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET;
171*7b3bd9a7SJ. German Rivera #else
172*7b3bd9a7SJ. German Rivera 	mc_dpl_offset = mc_get_dram_block_size() -
173*7b3bd9a7SJ. German Rivera 			roundup(CONFIG_SYS_LS_MC_DPL_MAX_LENGTH, 4096);
174*7b3bd9a7SJ. German Rivera 
175*7b3bd9a7SJ. German Rivera 	if ((mc_dpl_offset & 0x3) != 0 || mc_dpl_offset > 0xffffffff) {
176*7b3bd9a7SJ. German Rivera 		printf("%s: Invalid MC DPL offset: %llu\n",
177*7b3bd9a7SJ. German Rivera 		       __func__, mc_dpl_offset);
178*7b3bd9a7SJ. German Rivera 		error = -EINVAL;
179*7b3bd9a7SJ. German Rivera 		goto out;
180*7b3bd9a7SJ. German Rivera 	}
181*7b3bd9a7SJ. German Rivera #endif
182*7b3bd9a7SJ. German Rivera 
183*7b3bd9a7SJ. German Rivera 	/*
184*7b3bd9a7SJ. German Rivera 	 * Load the MC DPL blob at the far end of the MC private DRAM block:
185*7b3bd9a7SJ. German Rivera 	 *
186*7b3bd9a7SJ. German Rivera 	 * TODO: Should we place the DPL at a different location to match
187*7b3bd9a7SJ. German Rivera 	 * assumptions of MC firmware about its memory layout?
188*7b3bd9a7SJ. German Rivera 	 */
189*7b3bd9a7SJ. German Rivera 	mc_copy_image("MC DPL blob",
190*7b3bd9a7SJ. German Rivera 		      (u64)dpl_fdt_hdr, dpl_size, mc_ram_addr + mc_dpl_offset);
191*7b3bd9a7SJ. German Rivera 
192*7b3bd9a7SJ. German Rivera 	debug("mc_ccsr_regs %p\n", mc_ccsr_regs);
193*7b3bd9a7SJ. German Rivera 
194*7b3bd9a7SJ. German Rivera 	/*
195*7b3bd9a7SJ. German Rivera 	 * Tell MC where the MC Firmware image was loaded in DDR:
196*7b3bd9a7SJ. German Rivera 	 */
197*7b3bd9a7SJ. German Rivera 	out_le32(&mc_ccsr_regs->reg_mcfbalr, (u32)mc_ram_addr);
198*7b3bd9a7SJ. German Rivera 	out_le32(&mc_ccsr_regs->reg_mcfbahr, (u32)((u64)mc_ram_addr >> 32));
199*7b3bd9a7SJ. German Rivera 	out_le32(&mc_ccsr_regs->reg_mcfapr, MCFAPR_BYPASS_ICID_MASK);
200*7b3bd9a7SJ. German Rivera 
201*7b3bd9a7SJ. German Rivera 	/*
202*7b3bd9a7SJ. German Rivera 	 * Tell MC where the DPL blob was loaded in DDR, by indicating
203*7b3bd9a7SJ. German Rivera 	 * its offset relative to the beginning of the DDR block
204*7b3bd9a7SJ. German Rivera 	 * allocated to the MC firmware. The MC firmware is responsible
205*7b3bd9a7SJ. German Rivera 	 * for checking that there is no overlap between the DPL blob
206*7b3bd9a7SJ. German Rivera 	 * and the runtime heap and stack of the MC firmware itself.
207*7b3bd9a7SJ. German Rivera 	 *
208*7b3bd9a7SJ. German Rivera 	 * NOTE: bits [31:2] of this offset need to be stored in bits [29:0] of
209*7b3bd9a7SJ. German Rivera 	 * the GSR MC CCSR register. So, this offset is assumed to be 4-byte
210*7b3bd9a7SJ. German Rivera 	 * aligned.
211*7b3bd9a7SJ. German Rivera 	 * Care must be taken not to write 1s into bits 31 and 30 of the GSR in
212*7b3bd9a7SJ. German Rivera 	 * this case as the SoC COP or PIC will be signaled.
213*7b3bd9a7SJ. German Rivera 	 */
214*7b3bd9a7SJ. German Rivera 	out_le32(&mc_ccsr_regs->reg_gsr, (u32)(mc_dpl_offset >> 2));
215*7b3bd9a7SJ. German Rivera 
216*7b3bd9a7SJ. German Rivera 	printf("\nfsl-mc: Booting Management Complex ...\n");
217*7b3bd9a7SJ. German Rivera 
218*7b3bd9a7SJ. German Rivera 	/*
219*7b3bd9a7SJ. German Rivera 	 * Deassert reset and release MC core 0 to run
220*7b3bd9a7SJ. German Rivera 	 */
221*7b3bd9a7SJ. German Rivera 	out_le32(&mc_ccsr_regs->reg_gcr1, GCR1_P1_DE_RST | GCR1_M_ALL_DE_RST);
222*7b3bd9a7SJ. German Rivera 	dmb();
223*7b3bd9a7SJ. German Rivera 	debug("Polling mc_ccsr_regs->reg_gsr ...\n");
224*7b3bd9a7SJ. German Rivera 
225*7b3bd9a7SJ. German Rivera 	for (;;) {
226*7b3bd9a7SJ. German Rivera 		reg_gsr = in_le32(&mc_ccsr_regs->reg_gsr);
227*7b3bd9a7SJ. German Rivera 		mc_fw_boot_status = (reg_gsr & GSR_FS_MASK);
228*7b3bd9a7SJ. German Rivera 		if (mc_fw_boot_status & 0x1)
229*7b3bd9a7SJ. German Rivera 			break;
230*7b3bd9a7SJ. German Rivera 
231*7b3bd9a7SJ. German Rivera 		udelay(1000);	/* throttle polling */
232*7b3bd9a7SJ. German Rivera 		if (timeout-- <= 0)
233*7b3bd9a7SJ. German Rivera 			break;
234*7b3bd9a7SJ. German Rivera 	}
235*7b3bd9a7SJ. German Rivera 
236*7b3bd9a7SJ. German Rivera 	if (timeout <= 0) {
237*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: timeout booting management complex firmware\n");
238*7b3bd9a7SJ. German Rivera 
239*7b3bd9a7SJ. German Rivera 		/* TODO: Get an error status from an MC CCSR register */
240*7b3bd9a7SJ. German Rivera 		error = -ETIMEDOUT;
241*7b3bd9a7SJ. German Rivera 		goto out;
242*7b3bd9a7SJ. German Rivera 	}
243*7b3bd9a7SJ. German Rivera 
244*7b3bd9a7SJ. German Rivera 	if (mc_fw_boot_status != 0x1) {
245*7b3bd9a7SJ. German Rivera 		/*
246*7b3bd9a7SJ. German Rivera 		 * TODO: Identify critical errors from the GSR register's FS
247*7b3bd9a7SJ. German Rivera 		 * field and for those errors, set error to -ENODEV or other
248*7b3bd9a7SJ. German Rivera 		 * appropriate errno, so that the status property is set to
249*7b3bd9a7SJ. German Rivera 		 * failure in the fsl,dprc device tree node.
250*7b3bd9a7SJ. German Rivera 		 */
251*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: WARNING: Firmware booted with error (GSR: %#x)\n",
252*7b3bd9a7SJ. German Rivera 		       reg_gsr);
253*7b3bd9a7SJ. German Rivera 	}
254*7b3bd9a7SJ. German Rivera 
255*7b3bd9a7SJ. German Rivera 	/*
256*7b3bd9a7SJ. German Rivera 	 * TODO: need to obtain the portal_id for the root container from the
257*7b3bd9a7SJ. German Rivera 	 * DPL
258*7b3bd9a7SJ. German Rivera 	 */
259*7b3bd9a7SJ. German Rivera 	portal_id = 0;
260*7b3bd9a7SJ. German Rivera 
261*7b3bd9a7SJ. German Rivera 	/*
262*7b3bd9a7SJ. German Rivera 	 * Check that the MC firmware is responding portal commands:
263*7b3bd9a7SJ. German Rivera 	 */
264*7b3bd9a7SJ. German Rivera 	mc_io.mmio_regs = SOC_MC_PORTAL_ADDR(portal_id);
265*7b3bd9a7SJ. German Rivera 	debug("Checking access to MC portal of root DPRC container (portal_id %d, portal physical addr %p)\n",
266*7b3bd9a7SJ. German Rivera 	      portal_id, mc_io.mmio_regs);
267*7b3bd9a7SJ. German Rivera 
268*7b3bd9a7SJ. German Rivera 	error = mc_get_version(&mc_io, &mc_ver_info);
269*7b3bd9a7SJ. German Rivera 	if (error != 0) {
270*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Firmware version check failed (error: %d)\n",
271*7b3bd9a7SJ. German Rivera 		       error);
272*7b3bd9a7SJ. German Rivera 		goto out;
273*7b3bd9a7SJ. German Rivera 	}
274*7b3bd9a7SJ. German Rivera 
275*7b3bd9a7SJ. German Rivera 	if (MC_VER_MAJOR != mc_ver_info.major)
276*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: ERROR: Firmware major version mismatch (found: %d, expected: %d)\n",
277*7b3bd9a7SJ. German Rivera 		       mc_ver_info.major, MC_VER_MAJOR);
278*7b3bd9a7SJ. German Rivera 
279*7b3bd9a7SJ. German Rivera 	if (MC_VER_MINOR != mc_ver_info.minor)
280*7b3bd9a7SJ. German Rivera 		printf("fsl-mc: WARNING: Firmware minor version mismatch (found: %d, expected: %d)\n",
281*7b3bd9a7SJ. German Rivera 		       mc_ver_info.minor, MC_VER_MINOR);
282*7b3bd9a7SJ. German Rivera 
283*7b3bd9a7SJ. German Rivera 	printf("fsl-mc: Management Complex booted (version: %d.%d.%d, boot status: %#x)\n",
284*7b3bd9a7SJ. German Rivera 	       mc_ver_info.major, mc_ver_info.minor, mc_ver_info.revision,
285*7b3bd9a7SJ. German Rivera 	       mc_fw_boot_status);
286*7b3bd9a7SJ. German Rivera out:
287*7b3bd9a7SJ. German Rivera 	if (error != 0)
288*7b3bd9a7SJ. German Rivera 		mc_boot_status = -error;
289*7b3bd9a7SJ. German Rivera 	else
290*7b3bd9a7SJ. German Rivera 		mc_boot_status = 0;
291*7b3bd9a7SJ. German Rivera 
292*7b3bd9a7SJ. German Rivera 	return error;
293*7b3bd9a7SJ. German Rivera }
294*7b3bd9a7SJ. German Rivera 
295*7b3bd9a7SJ. German Rivera int get_mc_boot_status(void)
296*7b3bd9a7SJ. German Rivera {
297*7b3bd9a7SJ. German Rivera 	return mc_boot_status;
298*7b3bd9a7SJ. German Rivera }
299*7b3bd9a7SJ. German Rivera 
300*7b3bd9a7SJ. German Rivera /**
301*7b3bd9a7SJ. German Rivera  * Return the actual size of the MC private DRAM block.
302*7b3bd9a7SJ. German Rivera  *
303*7b3bd9a7SJ. German Rivera  * NOTE: For now this function always returns the minimum required size,
304*7b3bd9a7SJ. German Rivera  * However, in the future, the actual size may be obtained from an environment
305*7b3bd9a7SJ. German Rivera  * variable.
306*7b3bd9a7SJ. German Rivera  */
307*7b3bd9a7SJ. German Rivera unsigned long mc_get_dram_block_size(void)
308*7b3bd9a7SJ. German Rivera {
309*7b3bd9a7SJ. German Rivera 	return CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE;
310*7b3bd9a7SJ. German Rivera }
311