1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
277b55e8cSThomas Abraham /*
377b55e8cSThomas Abraham  * Copyright (c) 2012 The Chromium OS Authors.
477b55e8cSThomas Abraham  */
577b55e8cSThomas Abraham 
677b55e8cSThomas Abraham #ifndef __ASM_ARCH_EXYNOS_SPL_H__
777b55e8cSThomas Abraham #define __ASM_ARCH_EXYNOS_SPL_H__
877b55e8cSThomas Abraham 
977b55e8cSThomas Abraham #include <asm/arch/dmc.h>
1077b55e8cSThomas Abraham #include <asm/arch/power.h>
1177b55e8cSThomas Abraham 
1277b55e8cSThomas Abraham #ifndef __ASSEMBLY__
1377b55e8cSThomas Abraham /* Parameters of early board initialization in SPL */
1477b55e8cSThomas Abraham struct spl_machine_param {
1577b55e8cSThomas Abraham 	/* Add fields as and when required */
1677b55e8cSThomas Abraham 	u32		signature;
1777b55e8cSThomas Abraham 	u32		version;	/* Version number */
1877b55e8cSThomas Abraham 	u32		size;		/* Size of block */
1977b55e8cSThomas Abraham 	/**
2077b55e8cSThomas Abraham 	 * Parameters we expect, in order, terminated with \0. Each parameter
2177b55e8cSThomas Abraham 	 * is a single character representing one 32-bit word in this
2277b55e8cSThomas Abraham 	 * structure.
2377b55e8cSThomas Abraham 	 *
2477b55e8cSThomas Abraham 	 * Valid characters in this string are:
2577b55e8cSThomas Abraham 	 *
2677b55e8cSThomas Abraham 	 * Code		Name
2777b55e8cSThomas Abraham 	 * v		mem_iv_size
2877b55e8cSThomas Abraham 	 * m		mem_type
2977b55e8cSThomas Abraham 	 * u		uboot_size
3077b55e8cSThomas Abraham 	 * b		boot_source
3177b55e8cSThomas Abraham 	 * f		frequency_mhz (memory frequency in MHz)
3277b55e8cSThomas Abraham 	 * a		ARM clock frequency in MHz
3377b55e8cSThomas Abraham 	 * s		serial base address
3477b55e8cSThomas Abraham 	 * i		i2c base address for early access (meant for PMIC)
3577b55e8cSThomas Abraham 	 * r		board rev GPIO numbers used to read board revision
3677b55e8cSThomas Abraham 	 *			(lower halfword=bit 0, upper=bit 1)
3777b55e8cSThomas Abraham 	 * M		Memory Manufacturer name
3877b55e8cSThomas Abraham 	 * \0		termination
3977b55e8cSThomas Abraham 	 */
4077b55e8cSThomas Abraham 	char		params[12];	/* Length must be word-aligned */
4177b55e8cSThomas Abraham 	u32		mem_iv_size;	/* Memory channel interleaving size */
4277b55e8cSThomas Abraham 	enum ddr_mode	mem_type;	/* Type of on-board memory */
4377b55e8cSThomas Abraham 	/*
44a187559eSBin Meng 	 * U-Boot size - The iROM mmc copy function used by the SPL takes a
45a187559eSBin Meng 	 * block count paramter to describe the U-Boot size unlike the spi
46a187559eSBin Meng 	 * boot copy function which just uses the U-Boot size directly. Align
47a187559eSBin Meng 	 * the U-Boot size to block size (512 bytes) when populating the SPL
4877b55e8cSThomas Abraham 	 * table only for mmc boot.
4977b55e8cSThomas Abraham 	 */
5077b55e8cSThomas Abraham 	u32		uboot_size;
5177b55e8cSThomas Abraham 	unsigned	boot_source;	/* Boot device */
5277b55e8cSThomas Abraham 	unsigned	frequency_mhz;	/* Frequency of memory in MHz */
5377b55e8cSThomas Abraham 	unsigned	arm_freq_mhz;	/* ARM Frequency in MHz */
5477b55e8cSThomas Abraham 	u32		serial_base;	/* Serial base address */
5577b55e8cSThomas Abraham 	u32		i2c_base;	/* i2c base address */
5677b55e8cSThomas Abraham 	u32		board_rev_gpios;	/* Board revision GPIOs */
5777b55e8cSThomas Abraham 	enum mem_manuf	mem_manuf;	/* Memory Manufacturer */
5877b55e8cSThomas Abraham } __attribute__((__packed__));
5977b55e8cSThomas Abraham #endif
6077b55e8cSThomas Abraham 
6177b55e8cSThomas Abraham /**
6277b55e8cSThomas Abraham  * Validate signature and return a pointer to the parameter table.  If the
6377b55e8cSThomas Abraham  * signature is invalid, call panic() and never return.
6477b55e8cSThomas Abraham  *
6577b55e8cSThomas Abraham  * @return pointer to the parameter table if signature matched or never return.
6677b55e8cSThomas Abraham  */
6777b55e8cSThomas Abraham struct spl_machine_param *spl_get_machine_params(void);
6877b55e8cSThomas Abraham 
6977b55e8cSThomas Abraham #endif /* __ASM_ARCH_EXYNOS_SPL_H__ */
70