summaryrefslogtreecommitdiff
path: root/board/samsung
diff options
context:
space:
mode:
Diffstat (limited to 'board/samsung')
-rw-r--r--board/samsung/common/board.c13
-rw-r--r--board/samsung/common/misc.c6
-rw-r--r--board/samsung/goni/Kconfig6
-rw-r--r--board/samsung/odroid/odroid.c35
-rw-r--r--board/samsung/smdkc100/Kconfig6
5 files changed, 34 insertions, 32 deletions
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index da2245f..2e17da8 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -82,13 +82,19 @@ 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();
}
int dram_init(void)
{
- int i;
+ unsigned int i;
u32 addr;
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
@@ -100,7 +106,7 @@ int dram_init(void)
void dram_init_banksize(void)
{
- int i;
+ unsigned int i;
u32 addr, size;
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
@@ -338,9 +344,6 @@ int arch_early_init_r(void)
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
-#ifdef CONFIG_SET_DFU_ALT_INFO
- set_dfu_alt_info();
-#endif
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
set_board_info();
#endif
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 4538ac7..1a77c82 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -22,7 +22,7 @@
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_SET_DFU_ALT_INFO
-void set_dfu_alt_info(void)
+void set_dfu_alt_info(char *interface, char *devstr)
{
size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
@@ -34,13 +34,13 @@ void set_dfu_alt_info(void)
puts("DFU alt info setting: ");
- alt_setting = get_dfu_alt_boot();
+ alt_setting = get_dfu_alt_boot(interface, devstr);
if (alt_setting) {
setenv("dfu_alt_boot", alt_setting);
offset = snprintf(buf, buf_size, "%s", alt_setting);
}
- alt_setting = get_dfu_alt_system();
+ alt_setting = get_dfu_alt_system(interface, devstr);
if (alt_setting) {
if (offset)
alt_sep = ";";
diff --git a/board/samsung/goni/Kconfig b/board/samsung/goni/Kconfig
index 2c5d3fc..006e864 100644
--- a/board/samsung/goni/Kconfig
+++ b/board/samsung/goni/Kconfig
@@ -13,12 +13,12 @@ config SYS_CONFIG_NAME
default "s5p_goni"
config DM
- default y if !SPL_BUILD
+ default y
config DM_GPIO
- default y if !SPL_BUILD
+ default y
config DM_SERIAL
- default y if !SPL_BUILD
+ default y
endif
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index bff6ac9..ae41c29 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -15,6 +15,7 @@
#include <power/pmic.h>
#include <power/max77686_pmic.h>
#include <errno.h>
+#include <mmc.h>
#include <usb.h>
#include <usb/s3c_udc.h>
#include <samsung/misc.h>
@@ -61,27 +62,29 @@ const char *get_board_type(void)
#endif
#ifdef CONFIG_SET_DFU_ALT_INFO
-char *get_dfu_alt_system(void)
+char *get_dfu_alt_system(char *interface, char *devstr)
{
return getenv("dfu_alt_system");
}
-char *get_dfu_alt_boot(void)
+char *get_dfu_alt_boot(char *interface, char *devstr)
{
+ struct mmc *mmc;
char *alt_boot;
+ int dev_num;
+
+ dev_num = simple_strtoul(devstr, NULL, 10);
+
+ mmc = find_mmc_device(dev_num);
+ if (!mmc)
+ return NULL;
+
+ if (mmc_init(mmc))
+ return NULL;
+
+ alt_boot = IS_SD(mmc) ? CONFIG_DFU_ALT_BOOT_SD :
+ CONFIG_DFU_ALT_BOOT_EMMC;
- switch (get_boot_mode()) {
- case BOOT_MODE_SD:
- alt_boot = CONFIG_DFU_ALT_BOOT_SD;
- break;
- case BOOT_MODE_EMMC:
- case BOOT_MODE_EMMC_SD:
- alt_boot = CONFIG_DFU_ALT_BOOT_EMMC;
- break;
- default:
- alt_boot = NULL;
- break;
- }
return alt_boot;
}
#endif
@@ -424,10 +427,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/board/samsung/smdkc100/Kconfig b/board/samsung/smdkc100/Kconfig
index 996fe3c..ea87166 100644
--- a/board/samsung/smdkc100/Kconfig
+++ b/board/samsung/smdkc100/Kconfig
@@ -13,12 +13,12 @@ config SYS_CONFIG_NAME
default "smdkc100"
config DM
- default y if !SPL_BUILD
+ default y
config DM_GPIO
- default y if !SPL_BUILD
+ default y
config DM_SERIAL
- default y if !SPL_BUILD
+ default y
endif