spl.h 2.6 KB

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