OpenBIC
OpenSource Bridge-IC
intel_dimm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef DIMM_H
18#define DIMM_H
19
20#include <stdbool.h>
21#include <stdint.h>
22
23#define CMD_GET_CPU_MEMORY_TEMP 0x4B
24#define CMD_GET_CPU_MEMORY_TEMP_DATA_LEN 12
25#define RESPONSE_DIMM_TEMP_INDEX 3
26
27/* Get CPU and memory temperature command request */
28#define CHANNEL_0_4_DIMM_NUM_0 BIT(0)
29#define CHANNEL_0_4_DIMM_NUM_1 BIT(1)
30#define CHANNEL_0_4_DIMM_NUM_2 BIT(2)
31#define CHANNEL_0_4_DIMM_NUM_3 BIT(3)
32#define CHANNEL_1_5_DIMM_NUM_0 BIT(4)
33#define CHANNEL_1_5_DIMM_NUM_1 BIT(5)
34#define CHANNEL_1_5_DIMM_NUM_2 BIT(6)
35#define CHANNEL_1_5_DIMM_NUM_3 BIT(7)
36#define CHANNEL_2_6_DIMM_NUM_0 BIT(8)
37#define CHANNEL_2_6_DIMM_NUM_1 BIT(9)
38#define CHANNEL_2_6_DIMM_NUM_2 BIT(10)
39#define CHANNEL_2_6_DIMM_NUM_3 BIT(11)
40#define CHANNEL_3_7_DIMM_NUM_0 BIT(12)
41#define CHANNEL_3_7_DIMM_NUM_1 BIT(13)
42#define CHANNEL_3_7_DIMM_NUM_2 BIT(14)
43#define CHANNEL_3_7_DIMM_NUM_3 BIT(15)
44
54};
55
61};
62
67};
68
72};
73
75 uint8_t intel_id[3];
76 uint8_t set_read_cpu0 : 1;
77 uint8_t set_read_cpu1 : 1;
78 uint8_t set_read_cpu2 : 1;
79 uint8_t set_read_cpu3 : 1;
80 uint8_t set_use_cpu : 2;
81 uint8_t set_memory_channel : 1;
82 uint8_t set_request_format : 1;
88
90 ADDR_DIMM_CHANNEL_0_4 = 0x90, // slave address for channel 0 and channel 4
91 ADDR_DIMM_CHANNEL_1_5 = 0x94, // slave address for channel 1 and channel 5
92 ADDR_DIMM_CHANNEL_2_6 = 0x98, // slave address for channel 2 and channel 6
93 ADDR_DIMM_CHANNEL_3_7 = 0x9C, // slave address for channel 3 and channel 7
94};
95
96enum BUS_ID {
97 BUS_ID_DIMM_CHANNEL_0_TO_3, // bus id for channel 0~3
98 BUS_ID_DIMM_CHANNEL_4_TO_7, // bus id for channel 4~7
99};
100
101int pal_get_pmic_pwr(uint8_t sensor_num, uint8_t *data);
102int pal_get_spd_temp(uint8_t sensor_num, uint8_t *data);
103
104#endif
DIMM_CHANNEL_ADDR
Definition: intel_dimm.h:89
@ ADDR_DIMM_CHANNEL_2_6
Definition: intel_dimm.h:92
@ ADDR_DIMM_CHANNEL_3_7
Definition: intel_dimm.h:93
@ ADDR_DIMM_CHANNEL_1_5
Definition: intel_dimm.h:91
@ ADDR_DIMM_CHANNEL_0_4
Definition: intel_dimm.h:90
int pal_get_pmic_pwr(uint8_t sensor_num, uint8_t *data)
Definition: i3c_dimm.c:26
BUS_ID
Definition: intel_dimm.h:96
@ BUS_ID_DIMM_CHANNEL_4_TO_7
Definition: intel_dimm.h:98
@ BUS_ID_DIMM_CHANNEL_0_TO_3
Definition: intel_dimm.h:97
int pal_get_spd_temp(uint8_t sensor_num, uint8_t *data)
Definition: i3c_dimm.c:31
DIMM_CHANNEL_NUM
Definition: intel_dimm.h:45
@ DIMM_CHANNEL_NUM_3
Definition: intel_dimm.h:49
@ DIMM_CHANNEL_NUM_0
Definition: intel_dimm.h:46
@ DIMM_CHANNEL_NUM_6
Definition: intel_dimm.h:52
@ DIMM_CHANNEL_NUM_5
Definition: intel_dimm.h:51
@ DIMM_CHANNEL_NUM_7
Definition: intel_dimm.h:53
@ DIMM_CHANNEL_NUM_4
Definition: intel_dimm.h:50
@ DIMM_CHANNEL_NUM_1
Definition: intel_dimm.h:47
@ DIMM_CHANNEL_NUM_2
Definition: intel_dimm.h:48
DIMM_NUMBER
Definition: intel_dimm.h:56
@ DIMM_NUMBER_1
Definition: intel_dimm.h:58
@ DIMM_NUMBER_2
Definition: intel_dimm.h:59
@ DIMM_NUMBER_3
Definition: intel_dimm.h:60
@ DIMM_NUMBER_0
Definition: intel_dimm.h:57
struct _get_cpu_memory_temp_req get_cpu_memory_temp_req
CPU_USE_RANGE
Definition: intel_dimm.h:63
@ USE_CPU_0_TO_3
Definition: intel_dimm.h:64
@ USE_CPU_8_TO_11
Definition: intel_dimm.h:66
@ USE_CPU_4_TO_7
Definition: intel_dimm.h:65
MEMORY_CHANNEL
Definition: intel_dimm.h:69
@ MEMORY_CHANNEL_4_TO_7
Definition: intel_dimm.h:71
@ MEMORY_CHANNEL_0_TO_3
Definition: intel_dimm.h:70
uint8_t data[]
Definition: isl69259.c:2
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: intel_dimm.h:74
uint8_t intel_id[3]
Definition: intel_dimm.h:75
uint16_t cpu0_read_dimm_req
Definition: intel_dimm.h:83
uint8_t set_use_cpu
Definition: intel_dimm.h:80
uint8_t set_memory_channel
Definition: intel_dimm.h:81
uint16_t cpu1_read_dimm_req
Definition: intel_dimm.h:84
uint8_t set_request_format
Definition: intel_dimm.h:82
uint16_t cpu3_read_dimm_req
Definition: intel_dimm.h:86
uint8_t set_read_cpu2
Definition: intel_dimm.h:78
uint16_t cpu2_read_dimm_req
Definition: intel_dimm.h:85
uint8_t set_read_cpu3
Definition: intel_dimm.h:79
uint8_t set_read_cpu1
Definition: intel_dimm.h:77
uint8_t set_read_cpu0
Definition: intel_dimm.h:76