Lines Matching +full:tegra +full:- +full:pmc
1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2010 - 2011
15 #include <asm/arch/tegra.h>
16 #include <asm/arch-tegra/ap.h>
17 #include <asm/arch-tegra/apb_misc.h>
18 #include <asm/arch-tegra/clk_rst.h>
19 #include <asm/arch-tegra/pmc.h>
20 #include <asm/arch-tegra/fuse.h>
21 #include <asm/arch-tegra/warmboot.h>
127 struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; in warmboot_save_sdram_params() local
130 struct emc_ctlr *emc = emc_get_controller(gd->fdt_blob); in warmboot_save_sdram_params()
139 ram_code = (readl(&apb_misc->strapping_opt_a) >> in warmboot_save_sdram_params()
145 xm2cfga.word = readl(&gp->xm2cfga); in warmboot_save_sdram_params()
146 xm2cfgd.word = readl(&gp->xm2cfgd); in warmboot_save_sdram_params()
157 return -1; in warmboot_save_sdram_params()
168 writel(scratch2.word, &pmc->pmc_scratch2); in warmboot_save_sdram_params()
171 fbio_spare.word = readl(&emc->fbio_spare); in warmboot_save_sdram_params()
175 scratch4.pllm_stable_time = -1; in warmboot_save_sdram_params()
176 scratch4.pllx_stable_time = -1; in warmboot_save_sdram_params()
177 writel(scratch4.word, &pmc->pmc_scratch4); in warmboot_save_sdram_params()
184 writel(scratch24.word, &pmc->pmc_scratch24); in warmboot_save_sdram_params()
195 major_id = (readl(&gp->hidrev) & HIDREV_MAJORPREV_MASK) >> in get_major_version()
202 return readl(&fuse->production_mode); in is_production_mode_fuse_set()
207 return readl(&fuse->security_mode); in is_odm_production_mode_fuse_set()
212 return readl(&fuse->fa); in is_failure_analysis_mode()
247 chip_id = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK) >> in fuse_get_operation_mode()
288 length -= offsetof(struct wb_header, random_aes_block); in sign_wb_code()
308 length = roundup(((u32)wb_end - (u32)wb_start), 16); in warmboot_prepare_code()
315 seg_address + seg_length >= NV_PA_SDRAM_BASE + gd->ram_size) { in warmboot_prepare_code()
316 err = -EFAULT; in warmboot_prepare_code()
320 /* Things must be 16-byte aligned. */ in warmboot_prepare_code()
322 err = -EINVAL; in warmboot_prepare_code()
328 err = -EINVAL; in warmboot_prepare_code()
337 u32 *aes_block = (u32 *)&(dst_header->random_aes_block); in warmboot_prepare_code()
339 sizeof(dst_header->random_aes_block)); in warmboot_prepare_code()
347 dst_header->length_insecure = length + sizeof(struct wb_header); in warmboot_prepare_code()
348 dst_header->length_secure = length + sizeof(struct wb_header); in warmboot_prepare_code()
349 dst_header->destination = NV_WB_RUN_ADDRESS; in warmboot_prepare_code()
350 dst_header->entry_point = NV_WB_RUN_ADDRESS; in warmboot_prepare_code()
351 dst_header->code_length = length; in warmboot_prepare_code()
355 dst_header->length_insecure = 0; in warmboot_prepare_code()
356 err = -EACCES; in warmboot_prepare_code()
363 err = sign_wb_code(seg_address, dst_header->length_insecure, in warmboot_prepare_code()