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