* [U-Boot] [PATCH 0/3] samsung: board: reserve dram for the secure firmware
@ 2015-02-17 13:50 Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 1/3] board: samsung: reserve memory " Przemyslaw Marczak
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Przemyslaw Marczak @ 2015-02-17 13:50 UTC (permalink / raw)
To: u-boot
Since the few exynos based boards requires memory reservation,
of last DRAM bank, the code could be in a common place.
This patchset moves the reservation code from odroid board file
to common samsung board file.
Przemyslaw Marczak (3):
board: samsung: reserve memory for the secure firmware
Odroid-XU3: enable the last dram bank and reserve 22MiB
Odroid U3: use common code for dram reservation
board/samsung/common/board.c | 6 ++++++
board/samsung/odroid/odroid.c | 4 ----
include/configs/odroid.h | 5 +++--
include/configs/odroid_xu3.h | 10 ++++------
4 files changed, 13 insertions(+), 12 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [U-Boot] [PATCH 1/3] board: samsung: reserve memory for the secure firmware
2015-02-17 13:50 [U-Boot] [PATCH 0/3] samsung: board: reserve dram for the secure firmware Przemyslaw Marczak
@ 2015-02-17 13:50 ` Przemyslaw Marczak
2015-03-04 12:19 ` Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 2/3] Odroid-XU3: enable the last dram bank and reserve 22MiB Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 3/3] Odroid U3: use common code for dram reservation Przemyslaw Marczak
2 siblings, 1 reply; 6+ messages in thread
From: Przemyslaw Marczak @ 2015-02-17 13:50 UTC (permalink / raw)
To: u-boot
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();
}
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/3] board: samsung: reserve memory for the secure firmware
2015-02-17 13:50 ` [U-Boot] [PATCH 1/3] board: samsung: reserve memory " Przemyslaw Marczak
@ 2015-03-04 12:19 ` Przemyslaw Marczak
2015-03-04 12:27 ` Minkyu Kang
0 siblings, 1 reply; 6+ messages in thread
From: Przemyslaw Marczak @ 2015-03-04 12:19 UTC (permalink / raw)
To: u-boot
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,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/3] board: samsung: reserve memory for the secure firmware
2015-03-04 12:19 ` Przemyslaw Marczak
@ 2015-03-04 12:27 ` Minkyu Kang
0 siblings, 0 replies; 6+ messages in thread
From: Minkyu Kang @ 2015-03-04 12:27 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/3] Odroid-XU3: enable the last dram bank and reserve 22MiB
2015-02-17 13:50 [U-Boot] [PATCH 0/3] samsung: board: reserve dram for the secure firmware Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 1/3] board: samsung: reserve memory " Przemyslaw Marczak
@ 2015-02-17 13:50 ` Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 3/3] Odroid U3: use common code for dram reservation Przemyslaw Marczak
2 siblings, 0 replies; 6+ messages in thread
From: Przemyslaw Marczak @ 2015-02-17 13:50 UTC (permalink / raw)
To: u-boot
This commit enables the last DRAM bank and reserves
the last 22 MiB of it, for the secure firmware.
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>
---
include/configs/odroid_xu3.h | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 9fa8660..c395020 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -25,13 +25,11 @@
#define CONFIG_CMD_MMC
-/*
- * FIXME: The number of bank is actually 8. But there is no way to reserve the
- * last 16 Mib in the last bank now. So I just excluded the last bank
- * temporally.
- */
-#define CONFIG_NR_DRAM_BANKS 7
+#define CONFIG_NR_DRAM_BANKS 8
#define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */
+/* Reserve the last 22 MiB for the secure firmware */
+#define CONFIG_SYS_MEM_TOP_HIDE (22UL << 20UL)
+#define CONFIG_TZSW_RESERVED_DRAM_SIZE CONFIG_SYS_MEM_TOP_HIDE
#define CONFIG_ENV_IS_IN_MMC
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/3] Odroid U3: use common code for dram reservation
2015-02-17 13:50 [U-Boot] [PATCH 0/3] samsung: board: reserve dram for the secure firmware Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 1/3] board: samsung: reserve memory " Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 2/3] Odroid-XU3: enable the last dram bank and reserve 22MiB Przemyslaw Marczak
@ 2015-02-17 13:50 ` Przemyslaw Marczak
2 siblings, 0 replies; 6+ messages in thread
From: Przemyslaw Marczak @ 2015-02-17 13:50 UTC (permalink / raw)
To: u-boot
This commit removes the dram reservation from board file,
because it is done in a common code.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
board/samsung/odroid/odroid.c | 4 ----
include/configs/odroid.h | 5 +++--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index bff6ac9..44e062b 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -424,10 +424,6 @@ int exynos_early_init_f(void)
int exynos_init(void)
{
- /* The last MB of memory is reserved for secure firmware */
- gd->ram_size -= SZ_1M;
- gd->bd->bi_dram[CONFIG_NR_DRAM_BANKS - 1].size -= SZ_1M;
-
board_gpio_init();
return 0;
diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index 9d5dbdc..46ec760 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -29,6 +29,9 @@
#define CONFIG_SYS_SDRAM_BASE 0x40000000
#define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */
#define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE
+/* Reserve the last 1 MiB for the secure firmware */
+#define CONFIG_SYS_MEM_TOP_HIDE (1UL << 20UL)
+#define CONFIG_TZSW_RESERVED_DRAM_SIZE CONFIG_SYS_MEM_TOP_HIDE
/* memtest works on */
#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
@@ -56,8 +59,6 @@
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_MEM_TOP_HIDE (SZ_1M) /* ram console */
-
#define CONFIG_SYS_MONITOR_BASE 0x00000000
#define CONFIG_ENV_IS_IN_MMC
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-04 12:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-17 13:50 [U-Boot] [PATCH 0/3] samsung: board: reserve dram for the secure firmware Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 1/3] board: samsung: reserve memory " Przemyslaw Marczak
2015-03-04 12:19 ` Przemyslaw Marczak
2015-03-04 12:27 ` Minkyu Kang
2015-02-17 13:50 ` [U-Boot] [PATCH 2/3] Odroid-XU3: enable the last dram bank and reserve 22MiB Przemyslaw Marczak
2015-02-17 13:50 ` [U-Boot] [PATCH 3/3] Odroid U3: use common code for dram reservation Przemyslaw Marczak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.