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