blob: 59bb7e08d47b61e0f989c99e23afdb3cd122ad62 [file] [log] [blame]
Rajeshwari Shindeff843842012-07-03 20:02:51 +00001/*
2 * Copyright (c) 2012 The Chromium OS Authors.
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23#ifndef __ASM_ARCH_EXYNOS_SPL_H__
24#define __ASM_ARCH_EXYNOS_SPL_H__
25
26#include <asm/arch-exynos/dmc.h>
27
28enum boot_mode {
29 /*
30 * Assign the OM pin values for respective boot modes.
31 * Exynos4 does not support spi boot and the mmc boot OM
32 * pin values are the same across Exynos4 and Exynos5.
33 */
34 BOOT_MODE_MMC = 4,
Rajeshwari Shindebff6d0a2013-06-25 19:17:06 +053035 BOOT_MODE_EMMC = 8, /* EMMC4.4 */
Rajeshwari Shindeff843842012-07-03 20:02:51 +000036 BOOT_MODE_SERIAL = 20,
37 /* Boot based on Operating Mode pin settings */
38 BOOT_MODE_OM = 32,
39 BOOT_MODE_USB, /* Boot using USB download */
40};
41
42#ifndef __ASSEMBLY__
43/* Parameters of early board initialization in SPL */
44struct spl_machine_param {
45 /* Add fields as and when required */
46 u32 signature;
47 u32 version; /* Version number */
48 u32 size; /* Size of block */
49 /**
50 * Parameters we expect, in order, terminated with \0. Each parameter
51 * is a single character representing one 32-bit word in this
52 * structure.
53 *
54 * Valid characters in this string are:
55 *
56 * Code Name
57 * v mem_iv_size
58 * m mem_type
59 * u uboot_size
60 * b boot_source
61 * f frequency_mhz (memory frequency in MHz)
62 * a ARM clock frequency in MHz
63 * s serial base address
64 * i i2c base address for early access (meant for PMIC)
65 * r board rev GPIO numbers used to read board revision
66 * (lower halfword=bit 0, upper=bit 1)
67 * M Memory Manufacturer name
68 * \0 termination
69 */
70 char params[12]; /* Length must be word-aligned */
71 u32 mem_iv_size; /* Memory channel interleaving size */
72 enum ddr_mode mem_type; /* Type of on-board memory */
73 /*
74 * U-boot size - The iROM mmc copy function used by the SPL takes a
75 * block count paramter to describe the u-boot size unlike the spi
76 * boot copy function which just uses the u-boot size directly. Align
77 * the u-boot size to block size (512 bytes) when populating the SPL
78 * table only for mmc boot.
79 */
80 u32 uboot_size;
81 enum boot_mode boot_source; /* Boot device */
Rajeshwari Shindeff843842012-07-03 20:02:51 +000082 unsigned frequency_mhz; /* Frequency of memory in MHz */
83 unsigned arm_freq_mhz; /* ARM Frequency in MHz */
84 u32 serial_base; /* Serial base address */
85 u32 i2c_base; /* i2c base address */
Simon Glassedac8a52013-02-18 20:32:59 +000086 u32 board_rev_gpios; /* Board revision GPIOs */
87 enum mem_manuf mem_manuf; /* Memory Manufacturer */
Rajeshwari Shindeff843842012-07-03 20:02:51 +000088} __attribute__((__packed__));
89#endif
90
91/**
92 * Validate signature and return a pointer to the parameter table. If the
93 * signature is invalid, call panic() and never return.
94 *
95 * @return pointer to the parameter table if signature matched or never return.
96 */
97struct spl_machine_param *spl_get_machine_params(void);
98
99#endif /* __ASM_ARCH_EXYNOS_SPL_H__ */