OpenBIC
OpenSource Bridge-IC
plat_isr.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 PLAT_FUNC_H
18#define PLAT_FUNC_H
19
20#include <stdint.h>
21
22#define CXL_IOEXP_U14_ADDR (0x42 >> 1)
23#define CXL_IOEXP_U15_ADDR (0x44 >> 1)
24#define CXL_IOEXP_U16_ADDR (0x46 >> 1)
25#define CXL_IOEXP_U17_ADDR (0x48 >> 1)
26#define CXL_IOEXP_MUX_CHANNEL 0x10
27#define CXL_IOEXP_MB_RESET_BIT BIT(0)
28#define CXL_IOEXP_DEV_RESET_BIT BIT(2)
29#define CXL_IOEXP_ASIC_PERESET_BIT BIT(6)
30#define CXL_IOEXP_CONTROLLER_PWRGD_VAL 0x7F
31#define CXL_IOEXP_DIMM_PWRGD_VAL 0x07
32#define CXL_NOT_ALL_POWER_GOOD 0
33#define CXL_ALL_POWER_GOOD 1
34
35#define CXL_CONTROLLER_MUX_CHANNEL 0x01
36#define CXL_DRIVE_READY_DELAY_MS 1000
37#define CXL_DEBUG_SEL_DELAY_MS 500
38#define CXL_POWER_GOOD_DELAY_MS 12
39
45};
46
47typedef struct _cxl_work_info {
48 bool is_init;
49 uint8_t cxl_card_id;
50 uint8_t cxl_channel;
54 struct k_work_delayable device_reset_work;
55 struct k_work_delayable set_eid_work;
56 struct k_work_delayable perst_add_sel_work;
58
60extern bool is_interrupt_ongoing;
61
62void ISR_NORMAL_PWRGD();
71
72void init_cxl_work();
73int check_cxl_power_status(bool is_mutex);
74int set_cxl_device_reset_pin(uint8_t val, bool is_mutex);
75void cxl_ioexp_alert_handler(struct k_work *work_item);
76bool check_ioexp_status(uint8_t cxl_card_id);
77
78#endif
uint32_t val
Definition: plat_util.c:40
void ISR_NORMAL_PWRGD()
Definition: plat_isr.c:540
bool check_ioexp_status(uint8_t cxl_card_id)
Definition: plat_isr.c:415
cxl_work_info cxl_work_item[]
Definition: plat_isr.c:42
int set_cxl_device_reset_pin(uint8_t val, bool is_mutex)
Definition: plat_isr.c:209
void ISR_CXL_IOEXP_ALERT2()
Definition: plat_isr.c:579
void ISR_CXL_IOEXP_ALERT6()
Definition: plat_isr.c:603
void ISR_CXL_IOEXP_ALERT7()
Definition: plat_isr.c:609
void cxl_ioexp_alert_handler(struct k_work *work_item)
Definition: plat_isr.c:450
bool is_interrupt_ongoing
Definition: plat_isr.c:40
void ISR_CXL_IOEXP_ALERT5()
Definition: plat_isr.c:597
void ISR_CXL_IOEXP_ALERT1()
Definition: plat_isr.c:573
void ISR_CXL_IOEXP_ALERT3()
Definition: plat_isr.c:585
void init_cxl_work()
Definition: plat_isr.c:192
void ISR_CXL_IOEXP_ALERT4()
Definition: plat_isr.c:591
IOEXP_NAME
Definition: plat_isr.h:40
@ IOEXP_U16
Definition: plat_isr.h:43
@ IOEXP_U14
Definition: plat_isr.h:41
@ IOEXP_U17
Definition: plat_isr.h:44
@ IOEXP_U15
Definition: plat_isr.h:42
struct _cxl_work_info cxl_work_info
void ISR_CXL_IOEXP_ALERT0()
Definition: plat_isr.c:567
int check_cxl_power_status(bool is_mutex)
Definition: plat_isr.c:266
Definition: plat_isr.h:47
bool is_mb_reset
Definition: plat_isr.h:52
struct k_work_delayable device_reset_work
Definition: plat_isr.h:54
struct k_work_delayable perst_add_sel_work
Definition: plat_isr.h:56
bool is_init
Definition: plat_isr.h:48
uint8_t cxl_channel
Definition: plat_isr.h:50
bool is_device_reset
Definition: plat_isr.h:51
uint8_t cxl_card_id
Definition: plat_isr.h:49
struct k_work_delayable set_eid_work
Definition: plat_isr.h:55
bool is_pe_reset
Definition: plat_isr.h:53