xref: /openbmc/u-boot/board/samsung/smdk5250/smdk5250_spl.c (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
29c46f034SRajeshwari Shinde /*
39c46f034SRajeshwari Shinde  * Copyright (c) 2012 The Chromium OS Authors.
49c46f034SRajeshwari Shinde  */
59c46f034SRajeshwari Shinde 
69c46f034SRajeshwari Shinde #include <common.h>
79c46f034SRajeshwari Shinde #include <asm/arch/cpu.h>
89c46f034SRajeshwari Shinde #include <asm/arch/spl.h>
99c46f034SRajeshwari Shinde #include <asm/arch/clk.h>
109c46f034SRajeshwari Shinde 
119c46f034SRajeshwari Shinde #define SIGNATURE	0xdeadbeef
129c46f034SRajeshwari Shinde 
139c46f034SRajeshwari Shinde /* Parameters of early board initialization in SPL */
149c46f034SRajeshwari Shinde static struct spl_machine_param machine_param
159c46f034SRajeshwari Shinde 		__attribute__((section(".machine_param"))) = {
169c46f034SRajeshwari Shinde 	.signature	= SIGNATURE,
179c46f034SRajeshwari Shinde 	.version	= 1,
189c46f034SRajeshwari Shinde 	.params		= "vmubfasirM",
199c46f034SRajeshwari Shinde 	.size		= sizeof(machine_param),
209c46f034SRajeshwari Shinde 
219c46f034SRajeshwari Shinde 	.mem_iv_size	= 0x1f,
229c46f034SRajeshwari Shinde 	.mem_type	= DDR_MODE_DDR3,
239c46f034SRajeshwari Shinde 
249c46f034SRajeshwari Shinde 	/*
259c46f034SRajeshwari Shinde 	 * Set uboot_size to 0x100000 bytes.
269c46f034SRajeshwari Shinde 	 *
279c46f034SRajeshwari Shinde 	 * This is an overly conservative value chosen to accommodate all
289c46f034SRajeshwari Shinde 	 * possible U-Boot image.  You are advised to set this value to a
299c46f034SRajeshwari Shinde 	 * smaller realistic size via scripts that modifies the .machine_param
309c46f034SRajeshwari Shinde 	 * section of output U-Boot image.
319c46f034SRajeshwari Shinde 	 */
329c46f034SRajeshwari Shinde 	.uboot_size	= 0x100000,
339c46f034SRajeshwari Shinde 
349c46f034SRajeshwari Shinde 	.boot_source	= BOOT_MODE_OM,
359c46f034SRajeshwari Shinde 	.frequency_mhz	= 800,
369c46f034SRajeshwari Shinde 	.arm_freq_mhz	= 1700,
379c46f034SRajeshwari Shinde 	.serial_base	= 0x12c30000,
389c46f034SRajeshwari Shinde 	.i2c_base	= 0x12c60000,
399c46f034SRajeshwari Shinde 	.mem_manuf	= MEM_MANUF_SAMSUNG,
409c46f034SRajeshwari Shinde };
419c46f034SRajeshwari Shinde 
spl_get_machine_params(void)429c46f034SRajeshwari Shinde struct spl_machine_param *spl_get_machine_params(void)
439c46f034SRajeshwari Shinde {
449c46f034SRajeshwari Shinde 	if (machine_param.signature != SIGNATURE) {
459c46f034SRajeshwari Shinde 		/* Will hang if SIGNATURE dont match */
469c46f034SRajeshwari Shinde 		while (1)
479c46f034SRajeshwari Shinde 			;
489c46f034SRajeshwari Shinde 	}
499c46f034SRajeshwari Shinde 
509c46f034SRajeshwari Shinde 	return &machine_param;
519c46f034SRajeshwari Shinde }
52