diff mbox

[U-Boot,1/3] board: samsung: reserve memory for the secure firmware

Message ID 1424181027-7097-2-git-send-email-p.marczak@samsung.com
State Accepted
Delegated to: Minkyu Kang
Headers show

Commit Message

Przemyslaw Marczak Feb. 17, 2015, 1:50 p.m. UTC
Since more than one board requires memory reservation
for the secure firmware, the reservation code can be
made in a common code.
Now, to reserve some part of the the last bank,
board config should define:
- CONFIG_TZSW_RESERVED_DRAM - len in bytes
- CONFIG_NR_DRAM_BANKS - number of memory banks

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Hyungwon Hwang <human.hwang@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
 board/samsung/common/board.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Przemyslaw Marczak March 4, 2015, 12:19 p.m. UTC | #1
Hello Minkyu,

On 02/17/2015 02:50 PM, Przemyslaw Marczak wrote:
> Since more than one board requires memory reservation
> for the secure firmware, the reservation code can be
> made in a common code.
> Now, to reserve some part of the the last bank,
> board config should define:
> - CONFIG_TZSW_RESERVED_DRAM - len in bytes
> - CONFIG_NR_DRAM_BANKS - number of memory banks
>
> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
> Cc: Akshay Saraswat <akshay.s@samsung.com>
> Cc: Hyungwon Hwang <human.hwang@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>   board/samsung/common/board.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
> index da2245f..a2123cd 100644
> --- a/board/samsung/common/board.c
> +++ b/board/samsung/common/board.c
> @@ -82,7 +82,13 @@ int board_init(void)
>   	}
>   	boot_temp_check();
>   #endif
> +#ifdef CONFIG_TZSW_RESERVED_DRAM_SIZE
> +	/* The last few MB of memory can be reserved for secure firmware */
> +	ulong size = CONFIG_TZSW_RESERVED_DRAM_SIZE;
>
> +	gd->ram_size -= size;
> +	gd->bd->bi_dram[CONFIG_NR_DRAM_BANKS - 1].size -= size;
> +#endif
>   	return exynos_init();
>   }
>
>

There are no comments, so can you apply this patchset?

Best regards,
Minkyu Kang March 4, 2015, 12:27 p.m. UTC | #2
Hi,

On 04/03/15 21:19, Przemyslaw Marczak wrote:
> Hello Minkyu,
> 
> On 02/17/2015 02:50 PM, Przemyslaw Marczak wrote:
>> Since more than one board requires memory reservation
>> for the secure firmware, the reservation code can be
>> made in a common code.
>> Now, to reserve some part of the the last bank,
>> board config should define:
>> - CONFIG_TZSW_RESERVED_DRAM - len in bytes
>> - CONFIG_NR_DRAM_BANKS - number of memory banks
>>
>> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
>> Cc: Akshay Saraswat <akshay.s@samsung.com>
>> Cc: Hyungwon Hwang <human.hwang@samsung.com>
>> Cc: Minkyu Kang <mk7.kang@samsung.com>
>> ---
>>   board/samsung/common/board.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>> index da2245f..a2123cd 100644
>> --- a/board/samsung/common/board.c
>> +++ b/board/samsung/common/board.c
>> @@ -82,7 +82,13 @@ int board_init(void)
>>       }
>>       boot_temp_check();
>>   #endif
>> +#ifdef CONFIG_TZSW_RESERVED_DRAM_SIZE
>> +    /* The last few MB of memory can be reserved for secure firmware */
>> +    ulong size = CONFIG_TZSW_RESERVED_DRAM_SIZE;
>>
>> +    gd->ram_size -= size;
>> +    gd->bd->bi_dram[CONFIG_NR_DRAM_BANKS - 1].size -= size;
>> +#endif
>>       return exynos_init();
>>   }
>>
>>
> 
> There are no comments, so can you apply this patchset?
> 
> Best regards,

applied to u-boot-samsung.

Thanks,
Minkyu Kang.
diff mbox

Patch

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index da2245f..a2123cd 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -82,7 +82,13 @@  int board_init(void)
 	}
 	boot_temp_check();
 #endif
+#ifdef CONFIG_TZSW_RESERVED_DRAM_SIZE
+	/* The last few MB of memory can be reserved for secure firmware */
+	ulong size = CONFIG_TZSW_RESERVED_DRAM_SIZE;
 
+	gd->ram_size -= size;
+	gd->bd->bi_dram[CONFIG_NR_DRAM_BANKS - 1].size -= size;
+#endif
 	return exynos_init();
 }