- Samsung Galaxy S III mini (GT-I8190) "golden"
- Samsung Galaxy S Advance (GT-I9070) "janice"
- Samsung Galaxy Xcover 2 (GT-S7710) "skomer"
+ - Samsung Galaxy Ace 2 (GT-I8160) "codina"
and likely others as well (untested).
- Samsung Galaxy S III mini (GT-I8190) "golden"
- Samsung Galaxy S Advance (GT-I9070) "janice"
- Samsung Galaxy Xcover 2 (GT-S7710) "skomer"
+ - Samsung Galaxy Ace 2 (GT-I8160) "codina"
and likely others as well (untested).
*/
#include <common.h>
#include <init.h>
+#include <log.h>
#include <asm/global_data.h>
+#include <asm/setup.h>
+#include <asm/system.h>
DECLARE_GLOBAL_DATA_PTR;
+/* Parse atags provided by Samsung bootloader to get available memory */
+static ulong fw_mach __section(".data");
+static ulong fw_atags __section(".data");
+
+void save_boot_params(ulong r0, ulong r1, ulong r2, ulong r3)
+{
+ fw_mach = r1;
+ fw_atags = r2;
+ save_boot_params_ret();
+}
+
+static const struct tag *fw_atags_get(void)
+{
+ const struct tag *tags = (const struct tag *)fw_atags;
+
+ if (tags->hdr.tag != ATAG_CORE) {
+ log_err("Invalid atags: tag 0x%x at %p\n", tags->hdr.tag, tags);
+ return NULL;
+ }
+
+ return tags;
+}
+
int dram_init(void)
{
- gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_SDRAM_SIZE);
+ const struct tag *t, *tags = fw_atags_get();
+
+ if (!tags)
+ return -EINVAL;
+
+ for_each_tag(t, tags) {
+ if (t->hdr.tag != ATAG_MEM)
+ continue;
+
+ debug("Memory: %#x-%#x (size %#x)\n", t->u.mem.start,
+ t->u.mem.start + t->u.mem.size, t->u.mem.size);
+ gd->ram_size += t->u.mem.size;
+ }
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ const struct tag *t, *tags = fw_atags_get();
+ unsigned int bank = 0;
+
+ if (!tags)
+ return -EINVAL;
+
+ for_each_tag(t, tags) {
+ if (t->hdr.tag != ATAG_MEM)
+ continue;
+
+ gd->bd->bi_dram[bank].start = t->u.mem.start;
+ gd->bd->bi_dram[bank].size = t->u.mem.size;
+ if (++bank == CONFIG_NR_DRAM_BANKS)
+ break;
+ }
return 0;
}
int board_init(void)
{
+ gd->bd->bi_arch_number = fw_mach;
+ gd->bd->bi_boot_params = fw_atags;
return 0;
}
CONFIG_ARM=y
CONFIG_ARCH_U8500=y
CONFIG_SYS_TEXT_BASE=0x100000
-CONFIG_NR_DRAM_BANKS=1
+CONFIG_NR_DRAM_BANKS=2
CONFIG_DEFAULT_DEVICE_TREE="ste-ux500-samsung-stemmy"
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_HUSH_PARSER=y
#include <linux/sizes.h>
-#define CONFIG_SKIP_LOWLEVEL_INIT /* Loaded by another bootloader */
-#define CONFIG_SYS_MALLOC_LEN SZ_2M
+/*
+ * The "stemmy" U-Boot port is designed to be chainloaded by the Samsung
+ * bootloader on devices based on ST-Ericsson Ux500. Therefore, we skip most
+ * low-level initialization and rely on configuration provided by the Samsung
+ * bootloader. New images are loaded at the same address for compatibility.
+ */
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_TEXT_BASE
-/* Physical Memory Map */
-#define PHYS_SDRAM_1 0x00000000 /* DDR-SDRAM Bank #1 */
-#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
-#define CONFIG_SYS_SDRAM_SIZE SZ_1G
-#define CONFIG_SYS_INIT_RAM_SIZE 0x00100000
-#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_SDRAM_BASE + \
- CONFIG_SYS_INIT_RAM_SIZE - \
- GENERATED_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_GBL_DATA_OFFSET
+#define CONFIG_SYS_MALLOC_LEN SZ_2M
/* FIXME: This should be loaded from device tree... */
#define CONFIG_SYS_L2_PL310
#define CONFIG_SYS_PL310_BASE 0xa0412000
-#define CONFIG_SYS_LOAD_ADDR 0x00100000
-
#endif