xref: /OK3568_Linux_fs/u-boot/arch/arm/mach-exynos/include/mach/spl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (c) 2012 The Chromium OS Authors.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
5*4882a593Smuzhiyun  */
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifndef __ASM_ARCH_EXYNOS_SPL_H__
8*4882a593Smuzhiyun #define __ASM_ARCH_EXYNOS_SPL_H__
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include <asm/arch/dmc.h>
11*4882a593Smuzhiyun #include <asm/arch/power.h>
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #ifndef __ASSEMBLY__
14*4882a593Smuzhiyun /* Parameters of early board initialization in SPL */
15*4882a593Smuzhiyun struct spl_machine_param {
16*4882a593Smuzhiyun 	/* Add fields as and when required */
17*4882a593Smuzhiyun 	u32		signature;
18*4882a593Smuzhiyun 	u32		version;	/* Version number */
19*4882a593Smuzhiyun 	u32		size;		/* Size of block */
20*4882a593Smuzhiyun 	/**
21*4882a593Smuzhiyun 	 * Parameters we expect, in order, terminated with \0. Each parameter
22*4882a593Smuzhiyun 	 * is a single character representing one 32-bit word in this
23*4882a593Smuzhiyun 	 * structure.
24*4882a593Smuzhiyun 	 *
25*4882a593Smuzhiyun 	 * Valid characters in this string are:
26*4882a593Smuzhiyun 	 *
27*4882a593Smuzhiyun 	 * Code		Name
28*4882a593Smuzhiyun 	 * v		mem_iv_size
29*4882a593Smuzhiyun 	 * m		mem_type
30*4882a593Smuzhiyun 	 * u		uboot_size
31*4882a593Smuzhiyun 	 * b		boot_source
32*4882a593Smuzhiyun 	 * f		frequency_mhz (memory frequency in MHz)
33*4882a593Smuzhiyun 	 * a		ARM clock frequency in MHz
34*4882a593Smuzhiyun 	 * s		serial base address
35*4882a593Smuzhiyun 	 * i		i2c base address for early access (meant for PMIC)
36*4882a593Smuzhiyun 	 * r		board rev GPIO numbers used to read board revision
37*4882a593Smuzhiyun 	 *			(lower halfword=bit 0, upper=bit 1)
38*4882a593Smuzhiyun 	 * M		Memory Manufacturer name
39*4882a593Smuzhiyun 	 * \0		termination
40*4882a593Smuzhiyun 	 */
41*4882a593Smuzhiyun 	char		params[12];	/* Length must be word-aligned */
42*4882a593Smuzhiyun 	u32		mem_iv_size;	/* Memory channel interleaving size */
43*4882a593Smuzhiyun 	enum ddr_mode	mem_type;	/* Type of on-board memory */
44*4882a593Smuzhiyun 	/*
45*4882a593Smuzhiyun 	 * U-Boot size - The iROM mmc copy function used by the SPL takes a
46*4882a593Smuzhiyun 	 * block count paramter to describe the U-Boot size unlike the spi
47*4882a593Smuzhiyun 	 * boot copy function which just uses the U-Boot size directly. Align
48*4882a593Smuzhiyun 	 * the U-Boot size to block size (512 bytes) when populating the SPL
49*4882a593Smuzhiyun 	 * table only for mmc boot.
50*4882a593Smuzhiyun 	 */
51*4882a593Smuzhiyun 	u32		uboot_size;
52*4882a593Smuzhiyun 	unsigned	boot_source;	/* Boot device */
53*4882a593Smuzhiyun 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
54*4882a593Smuzhiyun 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
55*4882a593Smuzhiyun 	u32		serial_base;	/* Serial base address */
56*4882a593Smuzhiyun 	u32		i2c_base;	/* i2c base address */
57*4882a593Smuzhiyun 	u32		board_rev_gpios;	/* Board revision GPIOs */
58*4882a593Smuzhiyun 	enum mem_manuf	mem_manuf;	/* Memory Manufacturer */
59*4882a593Smuzhiyun } __attribute__((__packed__));
60*4882a593Smuzhiyun #endif
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun /**
63*4882a593Smuzhiyun  * Validate signature and return a pointer to the parameter table.  If the
64*4882a593Smuzhiyun  * signature is invalid, call panic() and never return.
65*4882a593Smuzhiyun  *
66*4882a593Smuzhiyun  * @return pointer to the parameter table if signature matched or never return.
67*4882a593Smuzhiyun  */
68*4882a593Smuzhiyun struct spl_machine_param *spl_get_machine_params(void);
69*4882a593Smuzhiyun 
70*4882a593Smuzhiyun #endif /* __ASM_ARCH_EXYNOS_SPL_H__ */
71