Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329092
b: refs/heads/master
c: 4a72742
h: refs/heads/master
v: v3
  • Loading branch information
Ashley Lai authored and Kent Yoder committed Aug 22, 2012
1 parent a3a0610 commit 280c3a1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 132f7629474424418a5cdd666796ad3cfa4dc0c5
refs/heads/master: 4a727429abec31c4f5d9607cebb4fb1cc21e1167
62 changes: 62 additions & 0 deletions trunk/arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,63 @@ static void __init prom_instantiate_rtas(void)
}

#ifdef CONFIG_PPC64
/*
* Allocate room for and instantiate Stored Measurement Log (SML)
*/
static void __init prom_instantiate_sml(void)
{
phandle ibmvtpm_node;
ihandle ibmvtpm_inst;
u32 entry = 0, size = 0;
u64 base;

prom_debug("prom_instantiate_sml: start...\n");

ibmvtpm_node = call_prom("finddevice", 1, 1, ADDR("/ibm,vtpm"));
prom_debug("ibmvtpm_node: %x\n", ibmvtpm_node);
if (!PHANDLE_VALID(ibmvtpm_node))
return;

ibmvtpm_inst = call_prom("open", 1, 1, ADDR("/ibm,vtpm"));
if (!IHANDLE_VALID(ibmvtpm_inst)) {
prom_printf("opening vtpm package failed (%x)\n", ibmvtpm_inst);
return;
}

if (call_prom_ret("call-method", 2, 2, &size,
ADDR("sml-get-handover-size"),
ibmvtpm_inst) != 0 || size == 0) {
prom_printf("SML get handover size failed\n");
return;
}

base = alloc_down(size, PAGE_SIZE, 0);
if (base == 0)
prom_panic("Could not allocate memory for sml\n");

prom_printf("instantiating sml at 0x%x...", base);

if (call_prom_ret("call-method", 4, 2, &entry,
ADDR("sml-handover"),
ibmvtpm_inst, size, base) != 0 || entry == 0) {
prom_printf("SML handover failed\n");
return;
}
prom_printf(" done\n");

reserve_mem(base, size);

prom_setprop(ibmvtpm_node, "/ibm,vtpm", "linux,sml-base",
&base, sizeof(base));
prom_setprop(ibmvtpm_node, "/ibm,vtpm", "linux,sml-size",
&size, sizeof(size));

prom_debug("sml base = 0x%x\n", base);
prom_debug("sml size = 0x%x\n", (long)size);

prom_debug("prom_instantiate_sml: end...\n");
}

/*
* Allocate room for and initialize TCE tables
*/
Expand Down Expand Up @@ -2916,6 +2973,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
prom_instantiate_opal();
#endif

#ifdef CONFIG_PPC64
/* instantiate sml */
prom_instantiate_sml();
#endif

/*
* On non-powermacs, put all CPUs in spin-loops.
*
Expand Down

0 comments on commit 280c3a1

Please sign in to comment.