Merge branch '2021-03-03-assorted-improvements' into next
- Clean up reset_cpu() - Assorted arm cp15 cleanups - Assorted cleanups throughout the tree from Simon - TPM1 / TPM2 cleanups
This commit is contained in:
1
Makefile
1
Makefile
@@ -1330,6 +1330,7 @@ u-boot.ldr: u-boot
|
||||
# binman
|
||||
# ---------------------------------------------------------------------------
|
||||
# Use 'make BINMAN_DEBUG=1' to enable debugging
|
||||
# Use 'make BINMAN_VERBOSE=3' to set vebosity level
|
||||
default_dt := $(if $(DEVICE_TREE),$(DEVICE_TREE),$(CONFIG_DEFAULT_DEVICE_TREE))
|
||||
quiet_cmd_binman = BINMAN $@
|
||||
cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
|
||||
__weak void reset_cpu(ulong addr)
|
||||
__weak void reset_cpu(void)
|
||||
{
|
||||
/* Stop debug session here */
|
||||
__builtin_arc_brk();
|
||||
@@ -17,7 +17,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
printf("Resetting the board...\n");
|
||||
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <asm/io.h>
|
||||
|
||||
/* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
|
||||
extern void reset_cpu(ulong addr)
|
||||
extern void reset_cpu(void)
|
||||
{
|
||||
struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
|
||||
uint32_t value;
|
||||
|
||||
@@ -81,7 +81,7 @@ ulong get_tbclk(void)
|
||||
/*
|
||||
* Reset the cpu by setting up the watchdog timer and let him time out
|
||||
*/
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* Disable watchdog and set Time-Out field to 0 */
|
||||
WCR = 0x00000000;
|
||||
|
||||
@@ -142,7 +142,7 @@ int timer_init(void)
|
||||
* 2. Write key value to TMP_WSAR reg.
|
||||
* 3. Perform write operation.
|
||||
*/
|
||||
void reset_cpu(unsigned long ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct armd1mpmu_registers *mpmu =
|
||||
(struct armd1mpmu_registers *) ARMD1_MPMU_BASE;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/*
|
||||
* Reset the cpu by setting up the watchdog timer and let it time out
|
||||
*/
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
|
||||
/* Disable watchdog and set Time-Out field to 0 */
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/*
|
||||
* Reset the cpu by setting up the watchdog timer and let it time out
|
||||
*/
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
|
||||
/* Disable watchdog and set Time-Out field to 0 */
|
||||
|
||||
@@ -32,9 +32,9 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
/* Lowlevel init isn't used on i.MX28, so just have a dummy here */
|
||||
__weak void lowlevel_init(void) {}
|
||||
|
||||
void reset_cpu(ulong ignored) __attribute__((noreturn));
|
||||
void reset_cpu(void) __attribute__((noreturn));
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct mxs_rtc_regs *rtc_regs =
|
||||
(struct mxs_rtc_regs *)MXS_RTC_BASE;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <asm/arch/spr_syscntl.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct syscntl_regs *syscntl_regs_p =
|
||||
(struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE;
|
||||
|
||||
@@ -56,7 +56,7 @@ static void cache_flush (void)
|
||||
|
||||
#ifndef CONFIG_ARCH_INTEGRATOR
|
||||
|
||||
__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
|
||||
__attribute__((noreturn)) void reset_cpu(void)
|
||||
{
|
||||
writew(0x0, 0xfffece10);
|
||||
writew(0x8, 0xfffece10);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define CLKS_SHIFT 20 /* Clock period shift */
|
||||
#define LD_SHIFT 0 /* Reload value shift */
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/*
|
||||
* Set WD enable, RST enable,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define CRMU_MAIL_BOX1 0x03024028
|
||||
#define CRMU_SOFT_RESET_CMD 0xFFFFFFFF
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* Send soft reset command via Mailbox. */
|
||||
writel(CRMU_SOFT_RESET_CMD, CRMU_MAIL_BOX1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#define CRU_RESET_OFFSET 0x1803F184
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* Reset the cpu by setting software reset request bit */
|
||||
writel(0x1, CRU_RESET_OFFSET);
|
||||
|
||||
@@ -176,9 +176,6 @@ void mmu_page_table_flush(unsigned long start, unsigned long stop)
|
||||
{
|
||||
}
|
||||
|
||||
void arm_init_domains(void)
|
||||
{
|
||||
}
|
||||
#endif /* #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) */
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
|
||||
|
||||
@@ -375,7 +375,7 @@ void smp_kick_all_cpus(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ int print_cpuinfo(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
void *clkpwr_reg = (void *)PHY_BASEADDR_CLKPWR;
|
||||
const u32 sw_rst_enb_bitpos = 3;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/stv0991_wdru.h>
|
||||
#include <linux/delay.h>
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
puts("System is going to reboot ...\n");
|
||||
/*
|
||||
|
||||
@@ -47,7 +47,7 @@ int cleanup_before_linux(void)
|
||||
/*
|
||||
* Perform the low-level reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/*
|
||||
* Perform reset but keep priority group unchanged.
|
||||
|
||||
@@ -1231,7 +1231,7 @@ int timer_init(void)
|
||||
|
||||
__efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
|
||||
|
||||
void __efi_runtime reset_cpu(ulong addr)
|
||||
void __efi_runtime reset_cpu(void)
|
||||
{
|
||||
#if defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A)
|
||||
/* clear the RST_REQ_MSK and SW_RST_REQ */
|
||||
@@ -1260,7 +1260,7 @@ void __efi_runtime EFIAPI efi_reset_system(
|
||||
case EFI_RESET_COLD:
|
||||
case EFI_RESET_WARM:
|
||||
case EFI_RESET_PLATFORM_SPECIFIC:
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
break;
|
||||
case EFI_RESET_SHUTDOWN:
|
||||
/* Nothing we can do */
|
||||
|
||||
@@ -319,7 +319,7 @@ static char *get_reset_cause(void)
|
||||
|
||||
#define SRC_SCR_SW_RST (1<<12)
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
printf("Feature not supported.\n");
|
||||
};
|
||||
|
||||
@@ -267,9 +267,9 @@ void i2c_clk_enable(void)
|
||||
writel(readl(CKEN) | CKEN14_I2C, CKEN);
|
||||
}
|
||||
|
||||
void __attribute__((weak)) reset_cpu(ulong ignored) __attribute__((noreturn));
|
||||
void __attribute__((weak)) reset_cpu(void) __attribute__((noreturn));
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ static void cache_flush (void)
|
||||
#define RSRR 0x00
|
||||
#define RCSR 0x04
|
||||
|
||||
__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
|
||||
__attribute__((noreturn)) void reset_cpu(void)
|
||||
{
|
||||
/* repeat endlessly */
|
||||
while (1) {
|
||||
|
||||
@@ -35,7 +35,6 @@ void l2_cache_disable(void);
|
||||
void set_section_dcache(int section, enum dcache_option option);
|
||||
|
||||
void arm_init_before_mmu(void);
|
||||
void arm_init_domains(void);
|
||||
void cpu_cache_initialization(void);
|
||||
void dram_bank_mmu_setup(int bank);
|
||||
|
||||
|
||||
@@ -397,20 +397,6 @@ static inline void set_cr(unsigned int val)
|
||||
isb();
|
||||
}
|
||||
|
||||
static inline unsigned int get_dacr(void)
|
||||
{
|
||||
unsigned int val;
|
||||
asm("mrc p15, 0, %0, c3, c0, 0 @ get DACR" : "=r" (val) : : "cc");
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void set_dacr(unsigned int val)
|
||||
{
|
||||
asm volatile("mcr p15, 0, %0, c3, c0, 0 @ set DACR"
|
||||
: : "r" (val) : "cc");
|
||||
isb();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARMV7_LPAE
|
||||
/* Long-Descriptor Translation Table Level 1/2 Bits */
|
||||
#define TTB_SECT_XN_MASK (1ULL << 54)
|
||||
@@ -475,7 +461,7 @@ enum dcache_option {
|
||||
#define TTB_SECT_XN_MASK (1 << 4)
|
||||
#define TTB_SECT_C_MASK (1 << 3)
|
||||
#define TTB_SECT_B_MASK (1 << 2)
|
||||
#define TTB_SECT (2 << 0)
|
||||
#define TTB_SECT (2 << 0)
|
||||
|
||||
/*
|
||||
* Short-descriptor format memory region attributes, without TEX remap
|
||||
@@ -489,7 +475,7 @@ enum dcache_option {
|
||||
*/
|
||||
enum dcache_option {
|
||||
DCACHE_OFF = TTB_SECT_DOMAIN(0) | TTB_SECT_XN_MASK | TTB_SECT,
|
||||
DCACHE_WRITETHROUGH = DCACHE_OFF | TTB_SECT_C_MASK,
|
||||
DCACHE_WRITETHROUGH = TTB_SECT_DOMAIN(0) | TTB_SECT | TTB_SECT_C_MASK,
|
||||
DCACHE_WRITEBACK = DCACHE_WRITETHROUGH | TTB_SECT_B_MASK,
|
||||
DCACHE_WRITEALLOC = DCACHE_WRITEBACK | TTB_SECT_TEX(1),
|
||||
};
|
||||
|
||||
@@ -22,10 +22,6 @@ __weak void arm_init_before_mmu(void)
|
||||
{
|
||||
}
|
||||
|
||||
__weak void arm_init_domains(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void set_section_phys(int section, phys_addr_t phys,
|
||||
enum dcache_option option)
|
||||
{
|
||||
@@ -203,11 +199,12 @@ static inline void mmu_setup(void)
|
||||
asm volatile("mcr p15, 0, %0, c2, c0, 0"
|
||||
: : "r" (gd->arch.tlb_addr) : "memory");
|
||||
#endif
|
||||
/* Set the access control to all-supervisor */
|
||||
/*
|
||||
* initial value of Domain Access Control Register (DACR)
|
||||
* Set the access control to client (1U) for each of the 16 domains
|
||||
*/
|
||||
asm volatile("mcr p15, 0, %0, c3, c0, 0"
|
||||
: : "r" (~0));
|
||||
|
||||
arm_init_domains();
|
||||
: : "r" (0x55555555));
|
||||
|
||||
/* and enable the mmu */
|
||||
reg = get_cr(); /* get control reg. */
|
||||
|
||||
@@ -53,7 +53,7 @@ int disable_interrupts(void)
|
||||
void bad_mode (void)
|
||||
{
|
||||
panic ("Resetting CPU ...\n");
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
|
||||
static void show_efi_loaded_images(struct pt_regs *regs)
|
||||
|
||||
@@ -59,7 +59,7 @@ void dump_regs(struct autosave_regs *regs)
|
||||
void bad_mode(void)
|
||||
{
|
||||
panic("Resetting CPU ...\n");
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
|
||||
void do_hard_fault(struct autosave_regs *autosave_regs)
|
||||
|
||||
@@ -39,7 +39,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
disable_interrupts();
|
||||
|
||||
reset_misc();
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
|
||||
/*NOTREACHED*/
|
||||
return 0;
|
||||
|
||||
@@ -24,7 +24,7 @@ void __attribute__((weak)) board_reset(void)
|
||||
/* true empty function for defining weak symbol */
|
||||
}
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
at91_st_t *st = (at91_st_t *) ATMEL_BASE_ST;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <asm/arch/at91_rstc.h>
|
||||
|
||||
/* Reset the cpu by telling the reset controller to do so */
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <asm/arch/at91_rstc.h>
|
||||
|
||||
/* Reset the cpu by telling the reset controller to do so */
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ __reset_cpu(struct bcm2835_wdog_regs *wdog_regs, ulong ticks)
|
||||
writel(BCM2835_WDOG_PASSWORD | rstc, &wdog_regs->rstc);
|
||||
}
|
||||
|
||||
void reset_cpu(ulong ticks)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct bcm2835_wdog_regs *regs =
|
||||
(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <asm/arch/timer_defs.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
|
||||
void reset_cpu(unsigned long a)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct davinci_timer *const wdttimer =
|
||||
(struct davinci_timer *)DAVINCI_WDOG_BASE;
|
||||
|
||||
@@ -20,7 +20,7 @@ extern void _main(void);
|
||||
void *secondary_boot_addr = (void *)_main;
|
||||
#endif /* CONFIG_TARGET_ESPRESSO7420 */
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
#ifdef CONFIG_CPU_V7A
|
||||
writel(0x1, samsung_get_base_swreset());
|
||||
|
||||
@@ -910,7 +910,7 @@ usb_modify_speed:
|
||||
#endif
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SYSRESET)
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void s_init(void)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ULP_WATCHDOG
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
setbits_le32(SIM0_RBASE, SIM_SOPT1_A7_SW_RESET);
|
||||
while (1)
|
||||
|
||||
@@ -320,7 +320,7 @@ int fdt_disable_node(void *blob, char *node_path)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYSRESET
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -345,7 +345,7 @@ void ddr3_check_ecc_int(u32 base)
|
||||
|
||||
if (!ecc_test) {
|
||||
puts("Reseting the device ...\n");
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ void ddr3_err_reset_workaround(void)
|
||||
tmp &= ~KS2_RSTYPE_PLL_SOFT;
|
||||
__raw_writel(tmp, KS2_RSTCTRL_RSCFG);
|
||||
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -192,7 +192,7 @@ int arch_cpu_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
volatile u32 *rstctrl = (volatile u32 *)(KS2_RSTCTRL);
|
||||
u32 tmp;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <asm/arch/soc.h>
|
||||
#include <mvebu_mmc.h>
|
||||
|
||||
void reset_cpu(unsigned long ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct kwcpu_registers *cpureg =
|
||||
(struct kwcpu_registers *)KW_CPU_REG_BASE;
|
||||
|
||||
@@ -17,28 +17,17 @@
|
||||
static struct clk_pm_regs *clk = (struct clk_pm_regs *)CLK_PM_BASE;
|
||||
static struct wdt_regs *wdt = (struct wdt_regs *)WDT_BASE;
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* Enable watchdog clock */
|
||||
setbits_le32(&clk->timclk_ctrl, CLK_TIMCLK_WATCHDOG);
|
||||
|
||||
/* To be compatible with the original U-Boot code:
|
||||
* addr: - 0: perform hard reset.
|
||||
* - !=0: perform a soft reset; i.e. "RESOUT_N" not asserted). */
|
||||
if (addr == 0) {
|
||||
/* Reset pulse length is 13005 peripheral clock frames */
|
||||
writel(13000, &wdt->pulse);
|
||||
/* Reset pulse length is 13005 peripheral clock frames */
|
||||
writel(13000, &wdt->pulse);
|
||||
|
||||
/* Force WDOG_RESET2 and RESOUT_N signal active */
|
||||
writel(WDTIM_MCTRL_RESFRC2 | WDTIM_MCTRL_RESFRC1
|
||||
| WDTIM_MCTRL_M_RES2, &wdt->mctrl);
|
||||
} else {
|
||||
/* Force match output active */
|
||||
writel(0x01, &wdt->emr);
|
||||
|
||||
/* Internal reset on match output (no pulse on "RESOUT_N") */
|
||||
writel(WDTIM_MCTRL_M_RES1, &wdt->mctrl);
|
||||
}
|
||||
/* Force WDOG_RESET2 and RESOUT_N signal active */
|
||||
writel(WDTIM_MCTRL_RESFRC2 | WDTIM_MCTRL_RESFRC1 | WDTIM_MCTRL_M_RES2,
|
||||
&wdt->mctrl);
|
||||
|
||||
while (1)
|
||||
/* NOP */;
|
||||
|
||||
@@ -27,7 +27,7 @@ int dram_init(void)
|
||||
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ int dram_init_banksize(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct udevice *watchdog_dev = NULL;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ int mtk_soc_early_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ int dram_init_banksize(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ int fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct pt_regs regs;
|
||||
|
||||
@@ -182,7 +182,7 @@ void reset_cpu(ulong addr)
|
||||
;
|
||||
}
|
||||
#else
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ int a3700_fdt_fix_pcie_regions(void *blob)
|
||||
return fdt_setprop_inplace(blob, node, "ranges", new_ranges, len);
|
||||
}
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/*
|
||||
* Write magic number of 0x1d1e to North Bridge Warm Reset register
|
||||
|
||||
@@ -104,7 +104,7 @@ void enable_caches(void)
|
||||
dcache_enable();
|
||||
}
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void lowlevel_init(void)
|
||||
*/
|
||||
}
|
||||
|
||||
void reset_cpu(unsigned long ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct mvebu_system_registers *reg =
|
||||
(struct mvebu_system_registers *)MVEBU_SYSTEM_REG_BASE;
|
||||
|
||||
@@ -10,4 +10,3 @@ obj-y += nx_gpio.o
|
||||
obj-y += tieoff.o
|
||||
obj-$(CONFIG_ARCH_S5P4418) += reg-call.o
|
||||
obj-$(CONFIG_ARCH_S5P4418) += nx_sec_reg.o
|
||||
obj-$(CONFIG_CMD_BOOTL) += cmd_boot_linux.o
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2016 nexell
|
||||
* jhkim <jhkim@nexell.co.kr>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <bootm.h>
|
||||
#include <command.h>
|
||||
#include <environment.h>
|
||||
#include <errno.h>
|
||||
#include <image.h>
|
||||
#include <fdt_support.h>
|
||||
#include <asm/global_data.h>
|
||||
|
||||
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_CLI_FRAMEWORK)
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static bootm_headers_t linux_images;
|
||||
|
||||
static void boot_go_set_os(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[],
|
||||
bootm_headers_t *images)
|
||||
{
|
||||
char * const img_addr = argv[0];
|
||||
|
||||
images->os.type = IH_TYPE_KERNEL;
|
||||
images->os.comp = IH_COMP_NONE;
|
||||
images->os.os = IH_OS_LINUX;
|
||||
images->os.load = simple_strtoul(img_addr, NULL, 16);
|
||||
images->ep = images->os.load;
|
||||
#if defined(CONFIG_ARM)
|
||||
images->os.arch = IH_ARCH_ARM;
|
||||
#elif defined(CONFIG_ARM64)
|
||||
images->os.arch = IH_ARCH_ARM64;
|
||||
#else
|
||||
#error "Not support architecture ..."
|
||||
#endif
|
||||
if (!IS_ENABLED(CONFIG_OF_LIBFDT) && !IS_ENABLED(CONFIG_SPL_BUILD)) {
|
||||
/* set DTB address for linux kernel */
|
||||
if (argc > 2) {
|
||||
unsigned long ft_addr;
|
||||
|
||||
ft_addr = simple_strtol(argv[2], NULL, 16);
|
||||
images->ft_addr = (char *)ft_addr;
|
||||
|
||||
/*
|
||||
* if not defined IMAGE_ENABLE_OF_LIBFDT,
|
||||
* must be set to fdt address
|
||||
*/
|
||||
if (!IMAGE_ENABLE_OF_LIBFDT)
|
||||
gd->bd->bi_boot_params = ft_addr;
|
||||
|
||||
debug("## set ft:%08lx and boot params:%08lx [control of:%s]"
|
||||
"...\n", ft_addr, gd->bd->bi_boot_params,
|
||||
IMAGE_ENABLE_OF_LIBFDT ? "on" : "off");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_LMB)
|
||||
static void boot_start_lmb(bootm_headers_t *images)
|
||||
{
|
||||
ulong mem_start;
|
||||
phys_size_t mem_size;
|
||||
|
||||
lmb_init(&images->lmb);
|
||||
|
||||
mem_start = getenv_bootm_low();
|
||||
mem_size = getenv_bootm_size();
|
||||
|
||||
lmb_add(&images->lmb, (phys_addr_t)mem_start, mem_size);
|
||||
|
||||
arch_lmb_reserve(&images->lmb);
|
||||
board_lmb_reserve(&images->lmb);
|
||||
}
|
||||
#else
|
||||
#define lmb_reserve(lmb, base, size)
|
||||
static inline void boot_start_lmb(bootm_headers_t *images) { }
|
||||
#endif
|
||||
|
||||
int do_boot_linux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
boot_os_fn *boot_fn;
|
||||
bootm_headers_t *images = &linux_images;
|
||||
int flags;
|
||||
int ret;
|
||||
|
||||
boot_start_lmb(images);
|
||||
|
||||
flags = BOOTM_STATE_START;
|
||||
|
||||
argc--; argv++;
|
||||
boot_go_set_os(cmdtp, flag, argc, argv, images);
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF_LIBFDT)) {
|
||||
/* find flattened device tree */
|
||||
ret = boot_get_fdt(flag, argc, argv, IH_ARCH_DEFAULT, images,
|
||||
&images->ft_addr, &images->ft_len);
|
||||
if (ret) {
|
||||
puts("Could not find a valid device tree\n");
|
||||
return 1;
|
||||
}
|
||||
set_working_fdt_addr((ulong)images->ft_addr);
|
||||
}
|
||||
|
||||
if (!IS_ENABLED(CONFIG_OF_LIBFDT))
|
||||
flags |= BOOTM_STATE_OS_GO;
|
||||
|
||||
boot_fn = do_bootm_linux;
|
||||
ret = boot_fn(flags, argc, argv, images);
|
||||
|
||||
if (ret == BOOTM_ERR_UNIMPLEMENTED)
|
||||
show_boot_progress(BOOTSTAGE_ID_DECOMP_UNIMPL);
|
||||
else if (ret == BOOTM_ERR_RESET)
|
||||
do_reset(cmdtp, flag, argc, argv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(bootl, CONFIG_SYS_MAXARGS, 1, do_boot_linux,
|
||||
"boot linux image from memory",
|
||||
"[addr [arg ...]]\n - boot linux image stored in memory\n"
|
||||
"\tuse a '-' for the DTB address\n"
|
||||
);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CMD_BOOTD) && !defined(CONFIG_CMD_BOOTM)
|
||||
int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
return run_command(env_get("bootcmd"), flag);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(boot, 1, 1, do_bootd,
|
||||
"boot default, i.e., run 'bootcmd'",
|
||||
""
|
||||
);
|
||||
|
||||
/* keep old command name "bootd" for backward compatibility */
|
||||
U_BOOT_CMD(bootd, 1, 1, do_bootd,
|
||||
"boot default, i.e., run 'bootcmd'",
|
||||
""
|
||||
);
|
||||
#endif
|
||||
@@ -72,6 +72,6 @@ u64 get_page_table_size(void)
|
||||
return 0x80000;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,6 +68,6 @@ u64 get_page_table_size(void)
|
||||
return 0x80000;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -41,9 +41,6 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
#define ARMV7_DCACHE_POLICY DCACHE_WRITEBACK & ~TTB_SECT_XN_MASK
|
||||
#endif
|
||||
|
||||
#define ARMV7_DOMAIN_CLIENT 1
|
||||
#define ARMV7_DOMAIN_MASK (0x3 << 0)
|
||||
|
||||
void enable_caches(void)
|
||||
{
|
||||
|
||||
@@ -67,17 +64,3 @@ void dram_bank_mmu_setup(int bank)
|
||||
for (i = start; i < end; i++)
|
||||
set_section_dcache(i, ARMV7_DCACHE_POLICY);
|
||||
}
|
||||
|
||||
void arm_init_domains(void)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
reg = get_dacr();
|
||||
/*
|
||||
* Set DOMAIN to client access so that all permissions
|
||||
* set in pagetables are validated by the mmu.
|
||||
*/
|
||||
reg &= ~ARMV7_DOMAIN_MASK;
|
||||
reg |= ARMV7_DOMAIN_CLIENT;
|
||||
set_dacr(reg);
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ void omap_die_id(unsigned int *die_id)
|
||||
die_id[3] = readl((*ctrl)->control_std_fuse_die_id_3);
|
||||
}
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
u32 omap_rev = omap_revision();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
void __weak reset_cpu(unsigned long ignored)
|
||||
void __weak reset_cpu(void)
|
||||
{
|
||||
writel(PRM_RSTCTRL_RESET, PRM_RSTCTRL);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define BUFLEN 16
|
||||
|
||||
void reset_cpu(unsigned long ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
struct orion5x_cpu_registers *cpureg =
|
||||
(struct orion5x_cpu_registers *)ORION5X_CPU_REG_BASE;
|
||||
|
||||
@@ -74,7 +74,7 @@ int board_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
phys_addr_t socfpga_get_rstmgr_addr(void);
|
||||
|
||||
void reset_cpu(ulong addr);
|
||||
void reset_cpu(void);
|
||||
|
||||
void socfpga_per_reset(u32 reset, int set);
|
||||
void socfpga_per_reset_all(void);
|
||||
|
||||
@@ -211,6 +211,35 @@ u32 get_bootmode(void)
|
||||
TAMP_BOOT_MODE_SHIFT;
|
||||
}
|
||||
|
||||
/*
|
||||
* weak function overidde: set the DDR/SYSRAM executable before to enable the
|
||||
* MMU and configure DACR, for early early_enable_caches (SPL or pre-reloc)
|
||||
*/
|
||||
void dram_bank_mmu_setup(int bank)
|
||||
{
|
||||
struct bd_info *bd = gd->bd;
|
||||
int i;
|
||||
phys_addr_t start;
|
||||
phys_size_t size;
|
||||
|
||||
if (IS_ENABLED(CONFIG_SPL_BUILD)) {
|
||||
start = ALIGN_DOWN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE);
|
||||
size = ALIGN(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE);
|
||||
} else if (gd->flags & GD_FLG_RELOC) {
|
||||
/* bd->bi_dram is available only after relocation */
|
||||
start = bd->bi_dram[bank].start;
|
||||
size = bd->bi_dram[bank].size;
|
||||
} else {
|
||||
/* mark cacheable and executable the beggining of the DDR */
|
||||
start = STM32_DDR_BASE;
|
||||
size = CONFIG_DDR_CACHEABLE_SIZE;
|
||||
}
|
||||
|
||||
for (i = start >> MMU_SECTION_SHIFT;
|
||||
i < (start >> MMU_SECTION_SHIFT) + (size >> MMU_SECTION_SHIFT);
|
||||
i++)
|
||||
set_section_dcache(i, DCACHE_DEFAULT_OPTION);
|
||||
}
|
||||
/*
|
||||
* initialize the MMU and activate cache in SPL or in U-Boot pre-reloc stage
|
||||
* MMU/TLB is updated in enable_caches() for U-Boot after relocation
|
||||
@@ -226,17 +255,8 @@ static void early_enable_caches(void)
|
||||
gd->arch.tlb_size = PGTABLE_SIZE;
|
||||
gd->arch.tlb_addr = (unsigned long)&early_tlb;
|
||||
|
||||
/* enable MMU (default configuration) */
|
||||
dcache_enable();
|
||||
|
||||
if (IS_ENABLED(CONFIG_SPL_BUILD))
|
||||
mmu_set_region_dcache_behaviour(
|
||||
ALIGN_DOWN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE),
|
||||
ALIGN(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE),
|
||||
DCACHE_DEFAULT_OPTION);
|
||||
else
|
||||
mmu_set_region_dcache_behaviour(STM32_DDR_BASE,
|
||||
CONFIG_DDR_CACHEABLE_SIZE,
|
||||
DCACHE_DEFAULT_OPTION);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <log.h>
|
||||
#include <ram.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
@@ -41,6 +42,7 @@ int dram_init(void)
|
||||
|
||||
ulong board_get_usable_ram_top(ulong total_size)
|
||||
{
|
||||
phys_size_t size;
|
||||
phys_addr_t reg;
|
||||
struct lmb lmb;
|
||||
|
||||
@@ -48,10 +50,13 @@ ulong board_get_usable_ram_top(ulong total_size)
|
||||
lmb_init(&lmb);
|
||||
lmb_add(&lmb, gd->ram_base, gd->ram_size);
|
||||
boot_fdt_add_mem_rsv_regions(&lmb, (void *)gd->fdt_blob);
|
||||
reg = lmb_alloc(&lmb, CONFIG_SYS_MALLOC_LEN + total_size, SZ_4K);
|
||||
size = ALIGN(CONFIG_SYS_MALLOC_LEN + total_size, MMU_SECTION_SIZE),
|
||||
reg = lmb_alloc(&lmb, size, MMU_SECTION_SIZE);
|
||||
|
||||
if (reg)
|
||||
return ALIGN(reg + CONFIG_SYS_MALLOC_LEN + total_size, SZ_4K);
|
||||
if (!reg)
|
||||
reg = gd->ram_top - size;
|
||||
|
||||
return gd->ram_top;
|
||||
mmu_set_region_dcache_behaviour(reg, size, DCACHE_DEFAULT_OPTION);
|
||||
|
||||
return reg + size;
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ void board_init_f(ulong dummy)
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
#if defined(CONFIG_SUNXI_GEN_SUN4I) || defined(CONFIG_MACH_SUN8I_R40)
|
||||
static const struct sunxi_wdog *wdog =
|
||||
|
||||
@@ -40,7 +40,7 @@ static int do_enterrcm(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
|
||||
tegra_pmc_writel(2, PMC_SCRATCH0);
|
||||
disable_interrupts();
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ void tegra_pmc_writel(u32 value, unsigned long offset)
|
||||
writel(value, NV_PA_PMC_BASE + offset);
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
u32 value;
|
||||
|
||||
|
||||
@@ -158,5 +158,5 @@ s32 __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point,
|
||||
|
||||
void __secure psci_system_reset(void)
|
||||
{
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define __SECURE
|
||||
#endif
|
||||
|
||||
void __SECURE reset_cpu(unsigned long ignored)
|
||||
void __SECURE reset_cpu(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ unsigned int zynq_get_silicon_version(void)
|
||||
>> ZYNQ_SILICON_VER_SHIFT;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
zynq_slcr_cpu_reset();
|
||||
while (1)
|
||||
|
||||
@@ -30,7 +30,7 @@ int arch_cpu_init(void)
|
||||
/*
|
||||
* Perform the low-level reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
while (1)
|
||||
;
|
||||
|
||||
@@ -46,7 +46,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
/*
|
||||
* reset to the base addr of andesboot.
|
||||
* currently no ROM loader at addr 0.
|
||||
* do not use reset_cpu(0);
|
||||
* do not use reset_cpu();
|
||||
*/
|
||||
#ifdef CONFIG_FTWDT010_WATCHDOG
|
||||
/*
|
||||
|
||||
@@ -500,25 +500,3 @@ software_interrupt:
|
||||
bal do_interruption
|
||||
|
||||
.align 5
|
||||
|
||||
/*
|
||||
* void reset_cpu(ulong addr);
|
||||
* $r0: input address to jump to
|
||||
*/
|
||||
.globl reset_cpu
|
||||
reset_cpu:
|
||||
/* No need to disable MMU because we never enable it */
|
||||
|
||||
bal invalidate_icac
|
||||
bal invalidate_dcac
|
||||
mfsr $p0, $MMU_CFG
|
||||
andi $p0, $p0, 0x3 ! MMPS
|
||||
li $p1, 0x2 ! TLB MMU
|
||||
bne $p0, $p1, 1f
|
||||
tlbop flushall ! Flush TLB
|
||||
1:
|
||||
mfsr $p0, MR_CAC_CTL ! Get the $CACHE_CTL reg
|
||||
li $p1, DIS_DCAC
|
||||
and $p0, $p0, $p1 ! Clear the DC_EN bit
|
||||
mtsr $p0, MR_CAC_CTL ! Write back the $CACHE_CTL reg
|
||||
br $r0 ! Jump to the input address
|
||||
|
||||
@@ -66,7 +66,7 @@ int disable_interrupts(void)
|
||||
void bad_mode(void)
|
||||
{
|
||||
panic("Resetting CPU ...\n");
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
|
||||
void show_regs(struct pt_regs *regs)
|
||||
|
||||
@@ -153,7 +153,7 @@ int os_read_file(const char *fname, void **bufp, int *sizep)
|
||||
printf("Cannot seek to start of file '%s'\n", fname);
|
||||
goto err;
|
||||
}
|
||||
*bufp = malloc(size);
|
||||
*bufp = os_malloc(size);
|
||||
if (!*bufp) {
|
||||
printf("Not enough memory to read file '%s'\n", fname);
|
||||
ret = -ENOMEM;
|
||||
@@ -267,11 +267,18 @@ void os_tty_raw(int fd, bool allow_sigs)
|
||||
signal(SIGINT, os_sigint_handler);
|
||||
}
|
||||
|
||||
/*
|
||||
* Provide our own malloc so we don't use space in the sandbox ram_buf for
|
||||
* allocations that are internal to sandbox, or need to be done before U-Boot's
|
||||
* malloc() is ready.
|
||||
*/
|
||||
void *os_malloc(size_t length)
|
||||
{
|
||||
int page_size = getpagesize();
|
||||
struct os_mem_hdr *hdr;
|
||||
|
||||
if (!length)
|
||||
return NULL;
|
||||
/*
|
||||
* Use an address that is hopefully available to us so that pointers
|
||||
* to this memory are fairly obvious. If we end up with a different
|
||||
@@ -298,6 +305,47 @@ void os_free(void *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
/* These macros are from kernel.h but not accessible in this file */
|
||||
#define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a) - 1)
|
||||
#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
||||
|
||||
/*
|
||||
* Provide our own malloc so we don't use space in the sandbox ram_buf for
|
||||
* allocations that are internal to sandbox, or need to be done before U-Boot's
|
||||
* malloc() is ready.
|
||||
*/
|
||||
void *os_realloc(void *ptr, size_t length)
|
||||
{
|
||||
int page_size = getpagesize();
|
||||
struct os_mem_hdr *hdr;
|
||||
void *new_ptr;
|
||||
|
||||
/* Reallocating a NULL pointer is just an alloc */
|
||||
if (!ptr)
|
||||
return os_malloc(length);
|
||||
|
||||
/* Changing a length to 0 is just a free */
|
||||
if (length) {
|
||||
os_free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the new size is the same number of pages as the old, nothing to
|
||||
* do. There isn't much point in shrinking things
|
||||
*/
|
||||
hdr = ptr - page_size;
|
||||
if (ALIGN(length, page_size) <= ALIGN(hdr->length, page_size))
|
||||
return ptr;
|
||||
|
||||
/* We have to grow it, so allocate something new */
|
||||
new_ptr = os_malloc(length);
|
||||
memcpy(new_ptr, ptr, hdr->length);
|
||||
os_free(ptr);
|
||||
|
||||
return new_ptr;
|
||||
}
|
||||
|
||||
void os_usleep(unsigned long usec)
|
||||
{
|
||||
usleep(usec);
|
||||
@@ -343,8 +391,8 @@ int os_parse_args(struct sandbox_state *state, int argc, char *argv[])
|
||||
state->argv = argv;
|
||||
|
||||
/* dynamically construct the arguments to the system getopt_long */
|
||||
short_opts = malloc(sizeof(*short_opts) * num_options * 2 + 1);
|
||||
long_opts = malloc(sizeof(*long_opts) * (num_options + 1));
|
||||
short_opts = os_malloc(sizeof(*short_opts) * num_options * 2 + 1);
|
||||
long_opts = os_malloc(sizeof(*long_opts) * (num_options + 1));
|
||||
if (!short_opts || !long_opts)
|
||||
return 1;
|
||||
|
||||
@@ -423,7 +471,7 @@ void os_dirent_free(struct os_dirent_node *node)
|
||||
|
||||
while (node) {
|
||||
next = node->next;
|
||||
free(node);
|
||||
os_free(node);
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
@@ -448,7 +496,7 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
|
||||
/* Create a buffer upfront, with typically sufficient size */
|
||||
dirlen = strlen(dirname) + 2;
|
||||
len = dirlen + 256;
|
||||
fname = malloc(len);
|
||||
fname = os_malloc(len);
|
||||
if (!fname) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
@@ -461,7 +509,7 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
|
||||
ret = errno;
|
||||
break;
|
||||
}
|
||||
next = malloc(sizeof(*node) + strlen(entry->d_name) + 1);
|
||||
next = os_malloc(sizeof(*node) + strlen(entry->d_name) + 1);
|
||||
if (!next) {
|
||||
os_dirent_free(head);
|
||||
ret = -ENOMEM;
|
||||
@@ -470,10 +518,10 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
|
||||
if (dirlen + strlen(entry->d_name) > len) {
|
||||
len = dirlen + strlen(entry->d_name);
|
||||
old_fname = fname;
|
||||
fname = realloc(fname, len);
|
||||
fname = os_realloc(fname, len);
|
||||
if (!fname) {
|
||||
free(old_fname);
|
||||
free(next);
|
||||
os_free(old_fname);
|
||||
os_free(next);
|
||||
os_dirent_free(head);
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
@@ -507,7 +555,7 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
|
||||
|
||||
done:
|
||||
closedir(dir);
|
||||
free(fname);
|
||||
os_free(fname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -624,7 +672,7 @@ static int add_args(char ***argvp, char *add_args[], int count)
|
||||
for (argc = 0; (*argvp)[argc]; argc++)
|
||||
;
|
||||
|
||||
argv = malloc((argc + count + 1) * sizeof(char *));
|
||||
argv = os_malloc((argc + count + 1) * sizeof(char *));
|
||||
if (!argv) {
|
||||
printf("Out of memory for %d argv\n", count);
|
||||
return -ENOMEM;
|
||||
@@ -707,7 +755,7 @@ static int os_jump_to_file(const char *fname)
|
||||
os_exit(2);
|
||||
|
||||
err = execv(fname, argv);
|
||||
free(argv);
|
||||
os_free(argv);
|
||||
if (err) {
|
||||
perror("Unable to run image");
|
||||
printf("Image filename '%s'\n", fname);
|
||||
|
||||
@@ -69,14 +69,14 @@ static void sandbox_sdl_poll_events(void)
|
||||
* We don't want to include common.h in this file since it uses
|
||||
* system headers. So add a declation here.
|
||||
*/
|
||||
extern void reset_cpu(unsigned long addr);
|
||||
extern void reset_cpu(void);
|
||||
SDL_Event event;
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_QUIT:
|
||||
puts("LCD window closed - quitting\n");
|
||||
reset_cpu(1);
|
||||
reset_cpu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,14 @@ static int spl_board_load_image(struct spl_image_info *spl_image,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Set up spl_image to boot from jump_to_image_no_args() */
|
||||
spl_image->arg = strdup(fname);
|
||||
/*
|
||||
* Set up spl_image to boot from jump_to_image_no_args(). Allocate this
|
||||
* outsdide the RAM buffer (i.e. don't use strdup()).
|
||||
*/
|
||||
spl_image->arg = os_malloc(strlen(fname) + 1);
|
||||
if (!spl_image->arg)
|
||||
return log_msg_ret("Setup exec filename", -ENOMEM);
|
||||
return log_msg_ret("exec", -ENOMEM);
|
||||
strcpy(spl_image->arg, fname);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ int sandbox_early_getopt_check(void)
|
||||
|
||||
/* Sort the options */
|
||||
size = sizeof(*sorted_opt) * num_options;
|
||||
sorted_opt = malloc(size);
|
||||
sorted_opt = os_malloc(size);
|
||||
if (!sorted_opt) {
|
||||
printf("No memory to sort options\n");
|
||||
os_exit(1);
|
||||
@@ -188,7 +188,7 @@ static int sandbox_cmdline_cb_default_fdt(struct sandbox_state *state,
|
||||
int len;
|
||||
|
||||
len = strlen(state->argv[0]) + strlen(fmt) + 1;
|
||||
fname = malloc(len);
|
||||
fname = os_malloc(len);
|
||||
if (!fname)
|
||||
return -ENOMEM;
|
||||
snprintf(fname, len, fmt, state->argv[0]);
|
||||
@@ -208,7 +208,7 @@ static int sandbox_cmdline_cb_test_fdt(struct sandbox_state *state,
|
||||
int len;
|
||||
|
||||
len = strlen(state->argv[0]) + strlen(fmt) + 1;
|
||||
fname = malloc(len);
|
||||
fname = os_malloc(len);
|
||||
if (!fname)
|
||||
return -ENOMEM;
|
||||
strcpy(fname, state->argv[0]);
|
||||
@@ -436,16 +436,18 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
struct sandbox_state *state;
|
||||
gd_t data;
|
||||
int size;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Copy argv[] so that we can pass the arguments in the original
|
||||
* sequence when resetting the sandbox.
|
||||
*/
|
||||
os_argv = calloc(argc + 1, sizeof(char *));
|
||||
size = sizeof(char *) * (argc + 1);
|
||||
os_argv = os_malloc(size);
|
||||
if (!os_argv)
|
||||
os_exit(1);
|
||||
memcpy(os_argv, argv, sizeof(char *) * (argc + 1));
|
||||
memcpy(os_argv, argv, size);
|
||||
|
||||
memset(&data, '\0', sizeof(data));
|
||||
gd = &data;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <bloblist.h>
|
||||
#include <errno.h>
|
||||
#include <fdtdec.h>
|
||||
#include <log.h>
|
||||
@@ -29,17 +30,17 @@ static int state_ensure_space(int extra_size)
|
||||
return 0;
|
||||
|
||||
size = used + extra_size;
|
||||
buf = malloc(size);
|
||||
buf = os_malloc(size);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = fdt_open_into(blob, buf, size);
|
||||
if (ret) {
|
||||
free(buf);
|
||||
os_free(buf);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
free(blob);
|
||||
os_free(blob);
|
||||
state->state_fdt = buf;
|
||||
return 0;
|
||||
}
|
||||
@@ -55,7 +56,7 @@ static int state_read_file(struct sandbox_state *state, const char *fname)
|
||||
printf("Cannot find sandbox state file '%s'\n", fname);
|
||||
return -ENOENT;
|
||||
}
|
||||
state->state_fdt = malloc(size);
|
||||
state->state_fdt = os_malloc(size);
|
||||
if (!state->state_fdt) {
|
||||
puts("No memory to read sandbox state\n");
|
||||
return -ENOMEM;
|
||||
@@ -77,7 +78,7 @@ static int state_read_file(struct sandbox_state *state, const char *fname)
|
||||
err_read:
|
||||
os_close(fd);
|
||||
err_open:
|
||||
free(state->state_fdt);
|
||||
os_free(state->state_fdt);
|
||||
state->state_fdt = NULL;
|
||||
|
||||
return ret;
|
||||
@@ -244,7 +245,7 @@ int sandbox_write_state(struct sandbox_state *state, const char *fname)
|
||||
/* Create a state FDT if we don't have one */
|
||||
if (!state->state_fdt) {
|
||||
size = 0x4000;
|
||||
state->state_fdt = malloc(size);
|
||||
state->state_fdt = os_malloc(size);
|
||||
if (!state->state_fdt) {
|
||||
puts("No memory to create FDT\n");
|
||||
return -ENOMEM;
|
||||
@@ -302,7 +303,7 @@ int sandbox_write_state(struct sandbox_state *state, const char *fname)
|
||||
err_write:
|
||||
os_close(fd);
|
||||
err_create:
|
||||
free(state->state_fdt);
|
||||
os_free(state->state_fdt);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -398,8 +399,12 @@ int state_uninit(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
log_info("Writing sandbox state\n");
|
||||
state = &main_state;
|
||||
|
||||
/* Finish the bloblist, so that it is correct before writing memory */
|
||||
bloblist_finish();
|
||||
|
||||
if (state->write_ram_buf) {
|
||||
err = os_write_ram_buf(state->ram_buf_fname);
|
||||
if (err) {
|
||||
@@ -419,8 +424,8 @@ int state_uninit(void)
|
||||
if (state->jumped_fname)
|
||||
os_unlink(state->jumped_fname);
|
||||
|
||||
if (state->state_fdt)
|
||||
free(state->state_fdt);
|
||||
os_free(state->state_fdt);
|
||||
os_free(state->ram_buf);
|
||||
memset(state, '\0', sizeof(*state));
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -32,7 +32,7 @@ int cleanup_before_linux (void)
|
||||
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
disable_interrupts();
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ int watchdog_disable(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset_cpu(unsigned long ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* Address error with SR.BL=1 first. */
|
||||
trigger_address_error();
|
||||
|
||||
@@ -143,7 +143,7 @@ int checkcpu(void)
|
||||
|
||||
/* System is not happy after keyboard reset... */
|
||||
debug("Issuing CF9 warm reset\n");
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
|
||||
ret = cpu_common_init();
|
||||
|
||||
@@ -540,7 +540,7 @@ void board_init_f(ulong dummy)
|
||||
spl_dram_init();
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_SPL_BUILD */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <netdev.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
#define CRM_SWRESET 0xff101044
|
||||
writel(0x1, (void *)CRM_SWRESET);
|
||||
|
||||
@@ -115,7 +115,7 @@ int board_init(void)
|
||||
/*
|
||||
* Board specific reset that is system reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
@@ -63,6 +63,6 @@ int dram_init_banksize(void)
|
||||
}
|
||||
|
||||
/* Nothing to be done here as handled by PSCI interface */
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ int v2m_cfg_write(u32 devfn, u32 data)
|
||||
}
|
||||
|
||||
/* Use the ARM Watchdog System to cause reset */
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
if (v2m_cfg_write(SYS_CFG_REBOOT | SYS_CFG_SITE_MB, 0))
|
||||
printf("Unable to reboot\n");
|
||||
|
||||
@@ -143,7 +143,7 @@ void *board_fdt_blob_setup(void)
|
||||
#endif
|
||||
|
||||
/* Actual reset is done via PSCI. */
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -322,6 +322,6 @@ int board_late_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ int dram_init_banksize(void)
|
||||
#define RST_CA57RESCNT (RST_BASE + 0x40)
|
||||
#define RST_CODE 0xA5A5000F
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
writel(RST_CODE, RST_CA57RESCNT);
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ static void bosch_check_reset_pin(void)
|
||||
printf("Resetting ...\n");
|
||||
writel(RESET_MASK, GPIO1_BASE + OMAP_GPIO_IRQSTATUS_SET_0);
|
||||
disable_interrupts();
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ int dram_init_banksize(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
psci_system_reset();
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
#include <dt-bindings/memory/bcm-ns3-mc.h>
|
||||
#include <broadcom/chimp.h>
|
||||
|
||||
/* Default reset-level = 3 and strap-val = 0 */
|
||||
#define L3_RESET 30
|
||||
|
||||
#define BANK_OFFSET(bank) ((u64)BCM_NS3_DDR_INFO_BASE + 8 + ((bank) * 16))
|
||||
|
||||
/*
|
||||
@@ -188,25 +185,10 @@ ulong board_get_usable_ram_top(ulong total_size)
|
||||
return BCM_NS3_MEM_END;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong level)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
u32 reset_level, strap_val;
|
||||
|
||||
/* Default reset type is L3 reset */
|
||||
if (!level) {
|
||||
/*
|
||||
* Encoding: U-Boot reset command expects decimal argument,
|
||||
* Boot strap val: Bits[3:0]
|
||||
* reset level: Bits[7:4]
|
||||
*/
|
||||
strap_val = L3_RESET % 10;
|
||||
level = L3_RESET / 10;
|
||||
reset_level = level % 10;
|
||||
psci_system_reset2(reset_level, strap_val);
|
||||
} else {
|
||||
/* U-Boot cmd "reset" with any arg will trigger L1 reset */
|
||||
psci_system_reset();
|
||||
}
|
||||
/* Perform a level 3 reset */
|
||||
psci_system_reset2(3, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_BOARD_SETUP
|
||||
|
||||
@@ -43,7 +43,7 @@ u32 get_board_rev(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ int dram_init(void)
|
||||
/*
|
||||
* Board specific reset that is system reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static void probe_sdram_size(long size)
|
||||
break;
|
||||
default:
|
||||
puts("Failed configuring DRAM, resetting...\n\n");
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
debug("%s: setting DRAM size to %ldM\n", __func__, size >> 20);
|
||||
config_ddr(303, &ioregs, &ddr3_data,
|
||||
|
||||
@@ -115,7 +115,7 @@ int dram_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ int board_init(void)
|
||||
/*
|
||||
* Board specific reset that is system reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ int board_init(void)
|
||||
/*
|
||||
* Board specific reset that is system reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
void reset_cpu(void)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ void board_init_f(ulong dummy)
|
||||
is_cpu_type(MXC_CPU_MX6SL)) {
|
||||
printf("cpu type 0x%x doesn't support 64-bit bus\n",
|
||||
get_cpu_type());
|
||||
reset_cpu(0);
|
||||
reset_cpu();
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_MX6SL
|
||||
|
||||
@@ -288,8 +288,8 @@ int last_stage_init(void)
|
||||
ccdc_eth_init();
|
||||
#endif
|
||||
ret = get_tpm(&tpm);
|
||||
if (ret || tpm_init(tpm) || tpm_startup(tpm, TPM_ST_CLEAR) ||
|
||||
tpm_continue_self_test(tpm)) {
|
||||
if (ret || tpm_init(tpm) || tpm1_startup(tpm, TPM_ST_CLEAR) ||
|
||||
tpm1_continue_self_test(tpm)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,8 +107,8 @@ static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size)
|
||||
uint8_t *ptr;
|
||||
uint16_t v16;
|
||||
|
||||
err = tpm_get_capability(tpm, TPM_CAP_NV_INDEX, index,
|
||||
info, sizeof(info));
|
||||
err = tpm1_get_capability(tpm, TPM_CAP_NV_INDEX, index, info,
|
||||
sizeof(info));
|
||||
if (err) {
|
||||
printf("tpm_get_capability(CAP_NV_INDEX, %08x) failed: %u\n",
|
||||
index, err);
|
||||
@@ -150,8 +150,8 @@ static int find_key(struct udevice *tpm, const uint8_t auth[20],
|
||||
unsigned int i;
|
||||
|
||||
/* fetch list of already loaded keys in the TPM */
|
||||
err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
|
||||
sizeof(buf));
|
||||
err = tpm1_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
|
||||
sizeof(buf));
|
||||
if (err)
|
||||
return -1;
|
||||
key_count = get_unaligned_be16(buf);
|
||||
@@ -162,8 +162,8 @@ static int find_key(struct udevice *tpm, const uint8_t auth[20],
|
||||
/* now search a(/ the) key which we can access with the given auth */
|
||||
for (i = 0; i < key_count; ++i) {
|
||||
buf_len = sizeof(buf);
|
||||
err = tpm_get_pub_key_oiap(tpm, key_handles[i], auth, buf,
|
||||
&buf_len);
|
||||
err = tpm1_get_pub_key_oiap(tpm, key_handles[i], auth, buf,
|
||||
&buf_len);
|
||||
if (err && err != TPM_AUTHFAIL)
|
||||
return -1;
|
||||
if (err)
|
||||
@@ -192,8 +192,8 @@ static int read_common_data(struct udevice *tpm)
|
||||
if (get_tpm_nv_size(tpm, NV_COMMON_DATA_INDEX, &size) ||
|
||||
size < NV_COMMON_DATA_MIN_SIZE)
|
||||
return 1;
|
||||
err = tpm_nv_read_value(tpm, NV_COMMON_DATA_INDEX,
|
||||
buf, min(sizeof(buf), size));
|
||||
err = tpm1_nv_read_value(tpm, NV_COMMON_DATA_INDEX, buf,
|
||||
min(sizeof(buf), size));
|
||||
if (err) {
|
||||
printf("tpm_nv_read_value() failed: %u\n", err);
|
||||
return 1;
|
||||
@@ -270,8 +270,8 @@ static struct h_reg *access_hreg(struct udevice *tpm, uint8_t spec,
|
||||
if (mode & HREG_RD) {
|
||||
if (!result->valid) {
|
||||
if (IS_PCR_HREG(spec)) {
|
||||
hre_tpm_err = tpm_pcr_read(tpm, HREG_IDX(spec),
|
||||
result->digest, 20);
|
||||
hre_tpm_err = tpm1_pcr_read(tpm, HREG_IDX(spec),
|
||||
result->digest, 20);
|
||||
result->valid = (hre_tpm_err == TPM_SUCCESS);
|
||||
} else if (IS_FIX_HREG(spec)) {
|
||||
switch (HREG_IDX(spec)) {
|
||||
@@ -357,8 +357,8 @@ static int hre_op_loadkey(struct udevice *tpm, struct h_reg *src_reg,
|
||||
return -1;
|
||||
if (find_key(tpm, src_reg->digest, dst_reg->digest, &parent_handle))
|
||||
return -1;
|
||||
hre_tpm_err = tpm_load_key2_oiap(tpm, parent_handle, key, key_size,
|
||||
src_reg->digest, &key_handle);
|
||||
hre_tpm_err = tpm1_load_key2_oiap(tpm, parent_handle, key, key_size,
|
||||
src_reg->digest, &key_handle);
|
||||
if (hre_tpm_err) {
|
||||
hre_err = HRE_E_TPM_FAILURE;
|
||||
return -1;
|
||||
@@ -474,8 +474,8 @@ do_bin_func:
|
||||
}
|
||||
|
||||
if (dst_reg && dst_modified && IS_PCR_HREG(dst_spec)) {
|
||||
hre_tpm_err = tpm_extend(tpm, HREG_IDX(dst_spec),
|
||||
dst_reg->digest, dst_reg->digest);
|
||||
hre_tpm_err = tpm1_extend(tpm, HREG_IDX(dst_spec),
|
||||
dst_reg->digest, dst_reg->digest);
|
||||
if (hre_tpm_err) {
|
||||
hre_err = HRE_E_TPM_FAILURE;
|
||||
return NULL;
|
||||
|
||||
@@ -23,15 +23,15 @@ int flush_keys(struct udevice *tpm)
|
||||
uint i;
|
||||
|
||||
/* fetch list of already loaded keys in the TPM */
|
||||
err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
|
||||
sizeof(buf));
|
||||
err = tpm1_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
|
||||
sizeof(buf));
|
||||
if (err)
|
||||
return -1;
|
||||
key_count = get_unaligned_be16(buf);
|
||||
ptr = buf + 2;
|
||||
for (i = 0; i < key_count; ++i, ptr += 4) {
|
||||
err = tpm_flush_specific(tpm, get_unaligned_be32(ptr),
|
||||
TPM_RT_KEY);
|
||||
err = tpm1_flush_specific(tpm, get_unaligned_be32(ptr),
|
||||
TPM_RT_KEY);
|
||||
if (err && err != TPM_KEY_OWNER_CONTROL)
|
||||
return err;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user