soc/amd/common/block/pi: Fix AGESA heap deallocator

The deallocation was always subtracting the header, even when it
shouldn't. This caused problems for the allocator where buffer
sizes were incorrect and freed and used buffers could collide.
Fix the deallocation size.

Clear deallocated concatinated buffer header memory.

Fix the initial calculation of the total buffer size
available to be allocated.

TEST= Boot grunt.

Change-Id: I2789ddf72d662f24709dc5d9873741169cc4ef36
Signed-off-by: Marc Jones <>
Tested-by: build bot (Jenkins) <>
Reviewed-by: Aaron Durbin <>
1 file changed