hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** @file
*
*  Copyright 2020 NXP
*
*  SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
 
#ifndef MEMORY_INIT_PEI_LIB_H_
#define MEMORY_INIT_PEI_LIB_H_
 
#include <Uefi.h>
 
// Specifies the Maximum regions onto which DDR memory can be mapped in
// a Platform
#define MAX_DRAM_REGIONS    3
 
// Unique SMC call to retrieve the total DDR RAM size installed in system
// and the SOC  memory map regions to which DDR RAM is mapped
// This SMC call works in this way:
// x1 = -1 : return x0: SMC_OK, x1: total DDR Ram size
// x1 >= number of DRAM regions to which DDR RAM is mapped : return x0: SMC_UNK
// 0 <= x1 < number of DRAM regions to which DDR RAM is mapped : return
//           x0: SMC_OK, x1: Base address of DRAM region,
//           x2: Size of DRAM region
#define SMC_DRAM_BANK_INFO  (0xC200FF12)
 
#define SMC_DRAM_TOTAL_DRAM_ARG1  (-1)
 
// Return values from SMC calls. return values are always in x0
#define SMC_OK              (0)
#define SMC_UNK             (-1)
 
// Regions in SOC memory map to which DDR RAM is mapped.
typedef struct {
  UINTN  BaseAddress;
  UINTN  Size;
} DRAM_REGION_INFO;
 
#endif // MEMORY_INIT_PEI_LIB_H_