xref: /openbmc/google-ipmi-sys/cpld.hpp (revision 444b5ea4847ea7c014114094d4b63672122f9786)
1a2056e9cSWilly Tu // Copyright 2021 Google LLC
2a2056e9cSWilly Tu //
3a2056e9cSWilly Tu // Licensed under the Apache License, Version 2.0 (the "License");
4a2056e9cSWilly Tu // you may not use this file except in compliance with the License.
5a2056e9cSWilly Tu // You may obtain a copy of the License at
6a2056e9cSWilly Tu //
7a2056e9cSWilly Tu //      http://www.apache.org/licenses/LICENSE-2.0
8a2056e9cSWilly Tu //
9a2056e9cSWilly Tu // Unless required by applicable law or agreed to in writing, software
10a2056e9cSWilly Tu // distributed under the License is distributed on an "AS IS" BASIS,
11a2056e9cSWilly Tu // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12a2056e9cSWilly Tu // See the License for the specific language governing permissions and
13a2056e9cSWilly Tu // limitations under the License.
14a2056e9cSWilly Tu 
154d49ae65SPatrick Venture #pragma once
164d49ae65SPatrick Venture 
17bb90d4fdSPatrick Venture #include "handler.hpp"
18bb90d4fdSPatrick Venture 
192c9e1625SWilliam A. Kennington III #include <ipmid/api.h>
204d49ae65SPatrick Venture 
21ff3cd8e9SWilly Tu #include <ipmid/api-types.hpp>
22*444b5ea4SPatrick Williams 
23b4e3704cSWilly Tu #include <span>
24ff3cd8e9SWilly Tu 
254d49ae65SPatrick Venture namespace google
264d49ae65SPatrick Venture {
274d49ae65SPatrick Venture namespace ipmi
284d49ae65SPatrick Venture {
294d49ae65SPatrick Venture 
30ff3cd8e9SWilly Tu struct CpldReply
31ff3cd8e9SWilly Tu {
32ff3cd8e9SWilly Tu     uint8_t major;
33ff3cd8e9SWilly Tu     uint8_t minor;
34ff3cd8e9SWilly Tu     uint8_t point;
35ff3cd8e9SWilly Tu     uint8_t subpoint;
36ff3cd8e9SWilly Tu } __attribute__((packed));
37ff3cd8e9SWilly Tu 
384d49ae65SPatrick Venture // Given a cpld identifier, return a version if available.
39b4e3704cSWilly Tu Resp cpldVersion(std::span<const uint8_t> data,
40ff3cd8e9SWilly Tu                  const HandlerInterface* handler);
414d49ae65SPatrick Venture 
424d49ae65SPatrick Venture } // namespace ipmi
434d49ae65SPatrick Venture } // namespace google
44