Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
0002 /*
0003  * Copyright(c) 2015-2017 Intel Corporation.
0004  */
0005 
0006 #ifndef _ASPM_H
0007 #define _ASPM_H
0008 
0009 #include "hfi.h"
0010 
0011 extern uint aspm_mode;
0012 
0013 enum aspm_mode {
0014     ASPM_MODE_DISABLED = 0, /* ASPM always disabled, performance mode */
0015     ASPM_MODE_ENABLED = 1,  /* ASPM always enabled, power saving mode */
0016     ASPM_MODE_DYNAMIC = 2,  /* ASPM enabled/disabled dynamically */
0017 };
0018 
0019 void aspm_init(struct hfi1_devdata *dd);
0020 void aspm_exit(struct hfi1_devdata *dd);
0021 void aspm_hw_disable_l1(struct hfi1_devdata *dd);
0022 void __aspm_ctx_disable(struct hfi1_ctxtdata *rcd);
0023 void aspm_disable_all(struct hfi1_devdata *dd);
0024 void aspm_enable_all(struct hfi1_devdata *dd);
0025 
0026 static inline void aspm_ctx_disable(struct hfi1_ctxtdata *rcd)
0027 {
0028     /* Quickest exit for minimum impact */
0029     if (likely(!rcd->aspm_intr_supported))
0030         return;
0031 
0032     __aspm_ctx_disable(rcd);
0033 }
0034 
0035 #endif /* _ASPM_H */