Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GT: Add OEM_1S_GET_FW_VERSION in platform code #337

Closed

Conversation

Quanta-YangChen
Copy link
Collaborator

Summary:

  • Request:
    Data[0] : Component ID:
    VR0 0
    VR1 1
    BIC 2
    PEX0 3
    PEX1 4
    PEX2 5
    PEX3 6
    CPLD 7
    NIC0 8
    NIC1 9
    NIC2 10
    NIC3 11
    NIC4 12
    NIC5 13
    NIC6 14
    NIC7 15

  • Response:
    data[0] = component id
    data[1] = firmware version length
    data[2] ~ data[length + 1] = firmware version

  • Add all MCTP instances for NIC0-NIC7.

  • Send PLDM firmware update command GetParameter to each NIC then store to local array for later use in OEM command.

  • Use the same component id define in the firmware update and get the firmware version function.

  • Remove check need init condition to avoid accessing SPI without initializing and returning wrong data.

  • According to the RENESAS programming guide get the VR version and update the remaining number.

  • Add a 3S timer to send MCTP/PLDM-related commands to the device after BIC power on.

  • Add send command to the device in DC on ISR.

Dependency: #334

Test plan:
Build code: Pass

Log:

  1. Get VR0 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x00
    00 15 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 00 05 09 d0 b8 d3 1b

  2. Get VR1 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x01
    00 15 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 01 05 09 d0 b8 d3 1b

  3. Get BIC version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x02
    00 17 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 02 07 20 22 22 01 47 54 00

  4. Get PEX0 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x03
    00 14 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 03 04 00 00 01 a6

  5. Get PEX1 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x04
    00 14 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 04 04 00 00 01 a6

  6. Get PEX2 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x05
    00 14 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 05 04 00 00 01 a6

  7. Get PEX3 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x06
    00 14 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 06 04 2c 0d 00 00

  8. Get CPLD version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x07
    00 14 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 07 04 01 00 00 02

  9. Get NIC0 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x08
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 08 0a 32 38 2e 39 38 2e 35 34 31 36

  10. Get NIC1 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x09
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 09 0a 32 38 2e 39 38 2e 35 34 31 36

  11. Get NIC2 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x0A
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 0a 0a 32 38 2e 39 38 2e 35 34 31 36

  12. Get NIC3 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x0B
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 0b 0a 32 38 2e 39 38 2e 35 34 31 36

  13. Get NIC4 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x0C
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 0c 0a 32 38 2e 39 38 2e 35 34 31 36

  14. Get NIC5 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x0D
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 0d 0a 32 38 2e 39 38 2e 35 34 31 36

  15. Get NIC6 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x0E
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 0e 0a 32 38 2e 39 38 2e 35 34 31 36

  16. Get NIC7 version
    root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x0b 0x15 0xa0 0x00 0x0F
    00 1a 01 00 3f 01 00 15 a0 00 e4 0b 00 15 a0 00 0f 0a 32 38 2e 39 38 2e 35 34 31 36

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 15, 2022
Summary:
- Support TMP75 sensor reading
- Support VR sensor reading
- Support ADC sensor reading
- Support HSC sensor reading
- Support PEX sensor reading
- Support NVME sensor reading
- Because PEX can only access when DC ON, so add one ISR if DC on then do pex89000_init later.
- Add mutex to protect some bus which has i2c mux.

Test Plan:
- Build code: Pass
Summary:
- Add command in oem_1s_handler.c to read multiple sensor
- NetFn: 0x38/Cmd: 0x88
- Request:
	Data 0 ~ Data N (N less than or equal to 32) multiple sensor number
  Response:
  	[sensor num][decimal byte 0][decimal byte 1][fraction byte 0][fraction byte 1][status] * N
	Note: If the sensor number is not support will response 6 bytes 0xff

Test plan:
- Build code: Pass
Summary:
- Request:
	Data[0] -> Component ID:
		VR0     0
		VR1     1
		BIC 	2
		PEX0 	3
		PEX1	4
		PEX2	5
		PEX3	6
		CPLD	7
		NIC0    8
		NIC1    9
		NIC2    10
		NIC3    11
		NIC4    12
		NIC5    13
		NIC6    14
		NIC7    15
- Response:
	data[0] = component id
  	data[1] = firmware version length
  	data[2] ~ data[length + 1] = firmware version

- Add all mctp instance for NIC0-NIC7.
- Send PLDM firmware update command GetParameter to each NIC then store to local array for later use in oem command.
- Use the same component id define in firmware update and get firmware version function.
- Remove check need init condition to avoid to access SPI without initialize and return wrong data.
- According RENESAS programming guide to get VR version and update remaining number.
- Add 3S timer to send mctp/pldm related command to device after BIC power on.
- Add send command to device in DC on ISR.
@facebook-github-bot
Copy link
Contributor

@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@GoldenBug GoldenBug closed this Jun 22, 2022
@GoldenBug
Copy link
Contributor

Merged

facebook-github-bot pushed a commit that referenced this pull request Jun 22, 2022
Summary:
- Add command to bridge i2c message to the component, the procedure as below:
    1. Lock the bus mutex if have it.
    2. Change the i2c mux channel if have it.
    3. Bridge i2c command.
    4. Unlock the bus mutex if have it.
- NetFn: 0x38 CMD: 0x74
- Component ID:
	VR0: 0
	VR1: 1
- Request format:
	data[0]: component id
	data[1]: number of bytes to read, 1 based. 0 = no byte to read.
	data[2]-data[N]: data to write

Dependency: #337

Pull Request resolved: #340

Test Plan:
- Build code: Pass

Log:
1. Read VR0 version
root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x74 0x15 0xa0 0x00 0x00 0x00 0xc7 0x3f 0x00
00 0e 01 00 3f 01 00 15 a0 00 e4 74 00 15 a0 00

root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x74 0x15 0xa0 0x00 0x00 0x04 0xc5 0xC1
00 12 01 00 3f 01 00 15 a0 00 e4 74 00 15 a0 00 09 d0 b8 d3

2. Read VR1 version
root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x74 0x15 0xa0 0x00 0x01 0x00 0xc7 0x3f 0x00
00 0e 01 00 3f 01 00 15 a0 00 e4 74 00 15 a0 00

root@bmc-oob:~# mctp-util 3 0x40 0x0a 0x01 0x80 0x3f 0x01 0x15 0xa0 0x00 0xe0 0x74 0x15 0xa0 0x00 0x01 0x04 0xc5 0xC1
00 12 01 00 3f 01 00 15 a0 00 e4 74 00 15 a0 00 09 d0 b8 d3

Reviewed By: zhdaniel12

Differential Revision: D37234353

Pulled By: GoldenBug

fbshipit-source-id: a1db54d70b0188e4cab650a76aea5950c05cbbb4
@Quanta-YangChen Quanta-YangChen deleted the PR/add_get_version_cmd branch August 16, 2022 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants