commit | 622992b429d1c91babce6d6588485ee73f3084c4 | [log] [tgz] |
---|---|---|
author | Michael Neuling <mikey@neuling.org> | Tue Jan 17 11:09:15 2017 -0600 |
committer | Cyril Bur <cyril.bur@au1.ibm.com> | Wed Jan 18 13:12:32 2017 +1100 |
tree | 6d1d8279b16981f5f2a81e119eadf106597c8c06 | |
parent | e8f2de1f3157902736900b53b06d12abf0f0261d [diff] |
Fix MBOX_C_RESET_STATE command crash Currently MBOX_C_RESET_STATE tries to access context->fds[LPC_CTRL_FD].fd but it's set to a negative value to avoid being part of the poll loop. This causes MBOX_C_RESET_STATE command crashes with: [MBOXD 1479755597.524480127] Couldn't MAP the host LPC bus to the platform flash [MBOXD 1479755597.524710309] Couldn't point the LPC BUS back to actual flash [MBOXD 1479755597.525068895] Error handling MBOX event: Bad file descriptor This patches removes the negative FDs and setups up a polls FD number for the number of FDs to poll. Signed-off-by: Michael Neuling <mikey@neuling.org>
Copyright 2016 IBM
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
The autotools of this requires the autotools-archive package for your system
Notes on messages:
Byte 0: COMMAND Byte 1: Sequence Byte 2-12: Data Byte 13: Response code Byte 14: Host controlled status reg Byte 15: BMC controlled status reg
RESET_STATE GET_MBOX_INFO GET_FLASH_INFO READ_WINDOW CLOSE_WINDOW WRITE_WINDOW WRITE_DIRTY WRITE_FENCE COMPLETED_COMMANDS ACK
Unique message sequence number
SUCCESS PARAM_ERROR WRITE_ERROR SYSTEM_ERROR TIMEOUT
Command: RESET_STATE Data: - Response: - Command: GET_MBOX_INFO Data: Data 0: API version Response: Data 0: API version Data 1-2: read window size in blk size Data 3-4: write window size in blk size Command: CLOSE_WINDOW Data: - Response: - Command: GET_FLASH_INFO Data: - Response: Data 0-3: Flash size Data 4-7: Erase granule Command: READ_WINDOW Data: Data 0-1: Read window offset in blk size Response: Data 0-1: Read window pos in blk size Command: WRITE_WINDOW Data: Data 0-1: Write window offset in blk size Response: Data 0-1: Write window pos in blk size Command: WRITE_DIRTY Data: Data 0-1: Offset within window in blk size Data 2-5: Number of dirty bytes Response: - Command WRITE_FENCE Data: Data 0-1: Offset within window in blk size Data 2-5: Number of dirty bytes Response: - Command: ACK Data: Bits in the BMC reg to ack Response: *clears the bits* - Command: COMPLETED_COMMANDS Data: - Response: Data 0: Number of seq numbers to follow Data 1-N: Completed sequence numbers BMC notifications: If the BMC needs to tell the host something then it simply writes to Byte 15. The host should have interrupts enabled on that register, or otherwise be checking it regularly. - BMC reboot - Command complete The host should issue a command complete request to find out the sequence numbers to commands which have completed