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

fby3.5: hd: Support GPIO #379

Closed
wants to merge 4 commits into from

Conversation

Yi-Shum
Copy link
Collaborator

@Yi-Shum Yi-Shum commented Jul 6, 2022

Summary:

  • Support GPIO.

Dependency: #378

Test plan:

  • Build code: Pass
  • Get GPIO initial value: Pass

LOG

uart:~$ platform gpio list_all
[1  ] FM_BIOS_POST_CMPLT_BIC_N           : OD  | input (I) | 1(1)
[2  ] FM_CPU_BIC_SLP_S3_N                : PP  | input (I) | 1(1)
[3  ] APML_CPU_ALERT_BIC_N               : OD  | input (I) | 1(1)
[4  ] IRQ_UV_DETECT_N                    : OD  | input (I) | 1(1)
[6  ] PVDDCR_CPU0_BIC_OCP_N              : OD  | input (I) | 1(1)
[7  ] HSC_OCP_GPIO1_R                    : PP  | output(O) | 0(0)
[8  ] PVDDCR_CPU1_BIC_OCP_N              : OD  | input (I) | 1(1)
[9  ] RST_USB_HUB_R_N                    : OD  | output(I) | 1(1)
[10 ] P3V_BAT_SCALED_EN_R                : PP  | output(O) | 0(0)
[11 ] HDT_BIC_TRST_R_N                   : OD  | output(I) | 1(1)
[13 ] FM_CPU_BIC_SLP_S5_N                : PP  | input (I) | 1(1)
[15 ] PVDD11_S3_BIC_OCP_N                : OD  | input (I) | 1(1)
[16 ] FM_HSC_TIMER                       : OD  | input (I) | 0(0)
[17 ] IRQ_SMB_IO_LVC3_STBY_ALRT_N        : OD  | input (I) | 1(1)
[18 ] PVDDCR_CPU1_PMALERT_N              : OD  | input (I) | 1(1)
[20 ] FM_CPU_BIC_THERMTRIP_N             : OD  | input (I) | 1(1)
[21 ] FM_PRSNT_CPU_BIC_N                 : OD  | input (I) | 0(0)
[22 ] AUTH_PRSNT_BIC_N                   : OD  | input (I) | 1(1)
[23 ] RST_CPU_RESET_BIC_N                : OD  | input (I) | 1(1)
[24 ] PWRBTN_R1_N                        : OD  | input (I) | 1(1)
[25 ] RST_BMC_R_N                        : OD  | output(I) | 1(1)
[26 ] HDT_BIC_DBREQ_R_N                  : OD  | output(I) | 1(1)
[27 ] BMC_READY                          : PP  | output(O) | 1(1)
[28 ] BIC_READY                          : PP  | output(O) | 1(1)
[29 ] FM_SOL_UART_CH_SEL_R               : PP  | output(O) | 1(1)
[32 ] PWRGD_CPU_LVC3                     : PP  | input (I) | 1(1)
[33 ] CPU_ERROR_BIC_LVC3_R_N             : PP  | input (I) | 1(1)
[34 ] PVDD11_S3_PMALERT_N                : OD  | input (I) | 1(1)
[35 ] IRQ_HSC_ALERT1_N                   : OD  | input (I) | 0(0)
[36 ] SMB_SENSOR_LVC3_ALERT_N            : OD  | input (I) | 1(1)
[38 ] SYS_PWRBTN_BIC_N                   : OD  | input (I) | 1(1)
[39 ] RST_PLTRST_BIC_N                   : PP  | input (I) | 1(1)
[40 ] CPU_SMERR_BIC_N                    : OD  | input (I) | 1(1)
[41 ] IRQ_HSC_ALERT2_N                   : OD  | input (I) | 1(1)
[43 ] FM_BMC_DEBUG_ENABLE_N              : OD  | output(I) | 1(1)
[44 ] FM_DBP_PRESENT_N                   : OD  | input (I) | 1(1)
[45 ] FM_FAST_PROCHOT_EN_R_N             : PP  | output(O) | 0(0)
[49 ] FM_BIOS_MRC_DEBUG_MSG_DIS          : OD  | output(I) | 1(1)
[50 ] FAST_PROCHOT_N                     : OD  | input (I) | 1(1)
[52 ] BIC_JTAG_SEL_R                     : PP  | output(O) | 0(0)
[54 ] HSC_OCP_GPIO2_R                    : PP  | output(O) | 0(0)
[55 ] HSC_OCP_GPIO3_R                    : PP  | output(O) | 0(0)
[56 ] RST_RSMRST_BMC_N                   : PP  | input (I) | 1(1)
[59 ] FM_CPU_BIC_PROCHOT_LVT3_N          : OD  | input (I) | 1(1)
[90 ] BIC_JTAG_MUX_SEL                   : PP  | output(O) | 0(0)
[91 ] BOARD_ID2                          : PP  | input (I) | 0(0)
[92 ] PVDDCR_CPU0_PMALERT_N              : OD  | input (I) | 1(1)
[94 ] BOARD_ID0                          : PP  | input (I) | 0(0)
[95 ] BOARD_ID1                          : PP  | input (I) | 1(1)
[97 ] BOARD_ID3                          : PP  | input (I) | 0(0)
[100] BOARD_ID5                          : PP  | input (I) | 0(0)
[101] BOARD_ID4                          : PP  | input (I) | 0(0)
[159] HSC_TYPE_0                         : PP  | input (I) | 0(0)
[167] HSC_TYPE_1                         : PP  | input (I) | 0(0)

Summary:
- Initialize HalfDome BIC.
- Create project config, dts files, file header, and CMake file.
- Add project code in meta-facebook/yv35-hd/.

Test plan:
- Build code: PASS
- Can access BIC console: PASS

LOG:
1. Build code pass.
```
$ west build -b ast1030_evb -p auto ./meta-facebook/yv35-hd/
...
[254/261] Linking C executable zephyr/zephyr_prebuilt.elf

[261/261] Linking C executable zephyr/Y35BHD.elf
Memory region         Used Size  Region Size  %age Used
         SRAM_NC:        152 KB       320 KB     47.50%
           FLASH:          0 GB         0 GB
            SRAM:      385440 B       448 KB     84.02%
        IDT_LIST:          0 GB         2 KB      0.00%
```
2. BIC console:
```
[00:00:00.002,000] <wrn> usb_dc_aspe*** Booting Zephyr OS build v00.01.05-5-g6163ab05ded5  ***
Hello, welcome to yv35 halfdome ffff.ff.ff
```
@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 Jul 6, 2022
@Yi-Shum Yi-Shum mentioned this pull request Jul 6, 2022
@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.

Summary:
- Support IPMB handler.

Test plan:
- Build code: Pass
- Check IPMB is workable: Pass

LOG:
```
root@bmc-oob:~# bic-util slot1 0x18 0x1
00 80 FF FF 02 BF 15 A0 00 00 00 00 00 00 00
```
Summary:
- Support GPIO.

Test plan:
- Build code: Pass
- Get GPIO initial value: Pass

LOG
```
uart:~$ platform gpio list_all
[1  ] FM_BIOS_POST_CMPLT_BIC_N           : OD  | input (I) | 1(1)
[2  ] FM_CPU_BIC_SLP_S3_N                : PP  | input (I) | 1(1)
[3  ] APML_CPU_ALERT_BIC_N               : OD  | input (I) | 1(1)
[4  ] IRQ_UV_DETECT_N                    : OD  | input (I) | 1(1)
[6  ] PVDDCR_CPU0_BIC_OCP_N              : OD  | input (I) | 1(1)
[7  ] HSC_OCP_GPIO1_R                    : PP  | output(O) | 0(0)
[8  ] PVDDCR_CPU1_BIC_OCP_N              : OD  | input (I) | 1(1)
[9  ] RST_USB_HUB_R_N                    : OD  | output(I) | 1(1)
[10 ] P3V_BAT_SCALED_EN_R                : PP  | output(O) | 0(0)
[11 ] HDT_BIC_TRST_R_N                   : OD  | output(I) | 1(1)
[13 ] FM_CPU_BIC_SLP_S5_N                : PP  | input (I) | 1(1)
[15 ] PVDD11_S3_BIC_OCP_N                : OD  | input (I) | 1(1)
[16 ] FM_HSC_TIMER                       : OD  | input (I) | 0(0)
[17 ] IRQ_SMB_IO_LVC3_STBY_ALRT_N        : OD  | input (I) | 1(1)
[18 ] PVDDCR_CPU1_PMALERT_N              : OD  | input (I) | 1(1)
[20 ] FM_CPU_BIC_THERMTRIP_N             : OD  | input (I) | 1(1)
[21 ] FM_PRSNT_CPU_BIC_N                 : OD  | input (I) | 0(0)
[22 ] AUTH_PRSNT_BIC_N                   : OD  | input (I) | 1(1)
[23 ] RST_CPU_RESET_BIC_N                : OD  | input (I) | 1(1)
[24 ] PWRBTN_R1_N                        : OD  | input (I) | 1(1)
[25 ] RST_BMC_R_N                        : OD  | output(I) | 1(1)
[26 ] HDT_BIC_DBREQ_R_N                  : OD  | output(I) | 1(1)
[27 ] BMC_READY                          : PP  | output(O) | 1(1)
[28 ] BIC_READY                          : PP  | output(O) | 1(1)
[29 ] FM_SOL_UART_CH_SEL_R               : PP  | output(O) | 1(1)
[32 ] PWRGD_CPU_LVC3                     : PP  | input (I) | 1(1)
[33 ] CPU_ERROR_BIC_LVC3_R_N             : PP  | input (I) | 1(1)
[34 ] PVDD11_S3_PMALERT_N                : OD  | input (I) | 1(1)
[35 ] IRQ_HSC_ALERT1_N                   : OD  | input (I) | 0(0)
[36 ] SMB_SENSOR_LVC3_ALERT_N            : OD  | input (I) | 1(1)
[38 ] SYS_PWRBTN_BIC_N                   : OD  | input (I) | 1(1)
[39 ] RST_PLTRST_BIC_N                   : PP  | input (I) | 1(1)
[40 ] CPU_SMERR_BIC_N                    : OD  | input (I) | 1(1)
[41 ] IRQ_HSC_ALERT2_N                   : OD  | input (I) | 1(1)
[43 ] FM_BMC_DEBUG_ENABLE_N              : OD  | output(I) | 1(1)
[44 ] FM_DBP_PRESENT_N                   : OD  | input (I) | 1(1)
[45 ] FM_FAST_PROCHOT_EN_R_N             : PP  | output(O) | 0(0)
[49 ] FM_BIOS_MRC_DEBUG_MSG_DIS          : OD  | output(I) | 1(1)
[50 ] FAST_PROCHOT_N                     : OD  | input (I) | 1(1)
[52 ] BIC_JTAG_SEL_R                     : PP  | output(O) | 0(0)
[54 ] HSC_OCP_GPIO2_R                    : PP  | output(O) | 0(0)
[55 ] HSC_OCP_GPIO3_R                    : PP  | output(O) | 0(0)
[56 ] RST_RSMRST_BMC_N                   : PP  | input (I) | 1(1)
[59 ] FM_CPU_BIC_PROCHOT_LVT3_N          : OD  | input (I) | 1(1)
[90 ] BIC_JTAG_MUX_SEL                   : PP  | output(O) | 0(0)
[91 ] BOARD_ID2                          : PP  | input (I) | 0(0)
[92 ] PVDDCR_CPU0_PMALERT_N              : OD  | input (I) | 1(1)
[94 ] BOARD_ID0                          : PP  | input (I) | 0(0)
[95 ] BOARD_ID1                          : PP  | input (I) | 1(1)
[97 ] BOARD_ID3                          : PP  | input (I) | 0(0)
[100] BOARD_ID5                          : PP  | input (I) | 0(0)
[101] BOARD_ID4                          : PP  | input (I) | 0(0)
[159] HSC_TYPE_0                         : PP  | input (I) | 0(0)
[167] HSC_TYPE_1                         : PP  | input (I) | 0(0)
```
@facebook-github-bot
Copy link
Contributor

@Yi-Shum has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot pushed a commit that referenced this pull request Jul 8, 2022
Summary:
- Support read and write FRU.

Dependency: #379

Pull Request resolved: #381

Test Plan:
- Build code: Pass
- Read FRU: Pass
- Write FRU: Pass

LOG:
Use CraterLake FRU for test
Write:
```
root@bmc-oob:~# fruid-util slot1 --write fru.bin
```
Read:
```
root@bmc-oob:~# fruid-util slot1

FRU Information           : Server board 1
---------------           : ------------------
Chassis Type              : Rack Mount Chassis
Board Mfg Date            : Tue Feb  8 04:12:00 2022
Board Mfg                 : Quanta
Board Product             : Crater Lake-Class1
Board Serial              : TWG1820400141
Board Part Number         : 33F0EMA02Y0
Board FRU ID              : FRU Ver 0.03
Board Custom Data 1       : 02-000497
Board Custom Data 2       : BDT
Product Manufacturer      : Quanta
Product Name              : Crater Lake EVT2
Product Version           : YoCL35
```

Reviewed By: garnermic

Differential Revision: D37679075

Pulled By: GoldenBug

fbshipit-source-id: edbaa42972da89f751cc1450eabb45a44a48240c
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.

2 participants