summaryrefslogtreecommitdiff
path: root/meta-facebook/meta-bletchley/recipes-bletchley
AgeCommit message (Collapse)AuthorFilesLines
2023-03-22meta-bletchley: remove bletchley-switch-diag toolPotin Lai2-41/+0
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I7b26c6ed3bebe259eeb2787420b682273a168082
2023-03-10meta-bletchley: elimiate gpiomon event messagesPotin Lai1-1/+1
Add silent option to elimiate event log messages from gpiomon command. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I15726bdeb510b7b7771a040656a41d84aae64d7f
2023-03-10meta-bletchley: move chassis and host power control service into ↵Potin Lai9-94/+3
phosphor-state-manager Move chassis and host power control services as part of PSM package to align with other platforms in meta-facebook. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I6e6afc0ad62d3b872b330202a4696b704d245911
2023-02-24meta-bletchley: use gpiomon instead of polling gpio valuePotin Lai3-32/+22
Remove gpio polling of switch detect pin in power-ctrl and motor-init. Use gpiomon and timeout commands instead to improve performance and timing issue. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I9e1eb26b070a57f424b341890733dc63c170bf79
2023-02-16meta-facebook: bletchley: reduce mapper-waitsPatrick Williams2-42/+30
There is not much value in the mapper-wait invocations since the providing service is well-known. Wait directly on the service. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9be5922229778faedf3cd6b85fba928866583672
2023-02-10meta-facebook: bletchley: board-type-checker: use /var/lib for sensor configPatrick Williams1-1/+5
phosphor-virtual-sensors now supports loading the config json from a `/var/lib` as high precedence over `/usr/share` and since `/var` is a writable file system, we should prefer this location for adding the config symlink. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Idfddd091e126b812ac68bbd06acc626ee137e437
2023-02-09meta-bletchley: apply power restore policy when host ac-onPotin Lai1-0/+1
We need to apply power restore policy when host ac from off to on. Add post command in host-ac-on@.service to restart phosphor-discover-system-state@.service. Tested results: ``` root@bletchley:~# busctl set-property xyz.openbmc_project.Settings /xyz/openbmc_project/control/host6/power_restore_policy xyz.openbmc_project.Control.Power.RestorePolicy PowerRestorePolicy s xyz.openbmc_project.Control.Power.RestorePolicy.Policy.AlwaysOn root@bletchley:~# busctl get-property xyz.openbmc_project.Settings /xyz/openbmc_project/control/host6/power_restore_policy xyz.openbmc_project.Control.Power.RestorePolicy PowerRestorePolicy s "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.AlwaysOn" root@bletchley:~# obmcutil -i=6 chassisoff root@bletchley:~# obmcutil -i=6 state CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.Off CurrentHostState : xyz.openbmc_project.State.Host.HostState.Off BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive root@bletchley:~# obmcutil -i=6 chassison root@bletchley:~# obmcutil -i=6 state CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.On CurrentHostState : xyz.openbmc_project.State.Host.HostState.Running BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive ``` Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I57dd159725dd75da651beec2c72410c187f9fc17
2023-01-06meta-bletchley: add usbmux utilityPotin Lai2-0/+126
There is a issue caused by switching USBMUX GPIO pin slowly. For example, when user set USBMUX GPIO pin to sled1, the USBMUX will first switch to sled3 and then switch to sled1 if there is a long interval between each gpioset command. 1. USBMUX is set to off initially USB2_SEL0_A = 1 USB2_SEL1_A = 1 USB2_SEL0_B = 1 USB2_SEL1_B = 1 2. Set USBMUX to sled1 USB2_SEL0_A = 0 USB2_SEL1_A = 0 USB2_SEL0_B = 1 USB2_SEL1_B = 1 ``` root@bletchley:~# gpioset $(gpiofind USB2_SEL0_A)=0 --> USBMUX set to sled3 first. root@bletchley:~# gpioset $(gpiofind USB2_SEL1_A)=0 --> then USBMUX set to sled1. ``` Add bletchley-usbmux-util to set USBMUX GPIO pins to selected sled, and avoid USB issues with slow mux switching. Change-Id: Id2a40b5908c1286929648cc433cb426a9c493e3a Signed-off-by: Potin Lai <potin.lai@quantatw.com>
2022-12-05meta-bletchley: add model setting for frontpanel boardPotin Lai2-45/+12
Add updating correct frontpanel board model, so EM can probe with correct configuration. Tested: - Main source: "Bletchley_FPB_HDC1080" ``` root@bletchley:~# busctl get-property xyz.openbmc_project.Settings \ > /xyz/openbmc_project/inventory/system/chassis/frontpanel \ > xyz.openbmc_project.Inventory.Decorator.Asset Model s "Bletchley_FPB_HDC1080" ``` - 2nd source: "Bletchley_FPB_SI7021" ``` root@bletchley:~# busctl get-property xyz.openbmc_project.Settings \ > /xyz/openbmc_project/inventory/system/chassis/frontpanel \ > xyz.openbmc_project.Inventory.Decorator.Asset Model s "Bletchley_FPB_SI7021" ``` Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I22b2641d72f5a6dc0674704b5959019e990c5eae
2022-12-03meta-bletchley: remove SLED LED dependency with host poweron poweroffPotin Lai3-13/+0
LED behaviors are implemented in bletchley-host-state-monitor, remove LED dependency from host-poweron and host-poweroff service. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ifdf4c0c588b5a3e1403e928b772a5c3fa3d5fc29
2022-11-29meta-bletchley: use BootMode property to select host boot mode.Potin Lai2-3/+45
Use BootMode to decide whether host should boot to Normal, Recovery or DFU mode. - xyz.openbmc_project.Control.Boot.Mode.Modes.Regular: Normal mode - xyz.openbmc_project.Control.Boot.Mode.Modes.Safe: Recovery mode - xyz.openbmc_project.Control.Boot.Mode.Modes.Setup: DFU mode Tested results: - Host normal on (xyz.openbmc_project.Control.Boot.Mode.Modes.Regular) root@bletchley:~# busctl set-property xyz.openbmc_project.Settings \ > /xyz/openbmc_project/control/host6/boot \ > xyz.openbmc_project.Control.Boot.Mode BootMode s \ > xyz.openbmc_project.Control.Boot.Mode.Modes.Regular root@bletchley:~# obmcutil -i=6 poweron root@bletchley:~# power-ctrl sled6 status On - Host boot recovery (xyz.openbmc_project.Control.Boot.Mode.Modes.Safe) root@bletchley:~# busctl set-property xyz.openbmc_project.Settings \ > /xyz/openbmc_project/control/host6/boot \ > xyz.openbmc_project.Control.Boot.Mode BootMode s \ > xyz.openbmc_project.Control.Boot.Mode.Modes.Safe root@bletchley:~# obmcutil -i=6 poweron root@bletchley:~# power-ctrl sled6 status Recovery - Host boot DFU (xyz.openbmc_project.Control.Boot.Mode.Modes.Setup) root@bletchley:~# busctl set-property xyz.openbmc_project.Settings \ > /xyz/openbmc_project/control/host6/boot \ > xyz.openbmc_project.Control.Boot.Mode BootMode s \ > xyz.openbmc_project.Control.Boot.Mode.Modes.Setup root@bletchley:~# obmcutil -i=6 poweron root@bletchley:~# power-ctrl sled6 status DFU Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I1eac8fb74f3702d9ce0ab9180b9d7e2e26df81f7
2022-11-29meta-bletchley: reduce burst times of motor-init-calibrationPotin Lai1-1/+1
We notice the motor-init-calibration service spend more than 20 seconds for one run, which doesn't match the stop conditions with current service setting(more than 5 runs in 90 sec). Becaused motor-init-calibration services keep restart, it caused BMC CPU remain high utilization and trigger reboot action by phosphor-health-monitor. Reduce StartLimitBurst to 2 to ensure the service stops after attempt 2 failed. Tested results: root@bletchley:~# journalctl -u motor-init-calibration@6.service | grep systemd Nov 16 22:18:00 bletchley systemd[1]: Starting Motor Initialize for sled6... Nov 16 22:18:25 bletchley systemd[1]: motor-init-calibration@6.service: Main process exited, code=exited, status=1/FAILURE Nov 16 22:18:26 bletchley systemd[1]: motor-init-calibration@6.service: Failed with result 'exit-code'. Nov 16 22:18:26 bletchley systemd[1]: Failed to start Motor Initialize for sled6. Nov 16 22:18:27 bletchley systemd[1]: motor-init-calibration@6.service: Scheduled restart job, restart counter is at 1. Nov 16 22:18:27 bletchley systemd[1]: Stopped Motor Initialize for sled6. Nov 16 22:18:27 bletchley systemd[1]: Starting Motor Initialize for sled6... Nov 16 22:18:46 bletchley systemd[1]: motor-init-calibration@6.service: Main process exited, code=exited, status=1/FAILURE Nov 16 22:18:46 bletchley systemd[1]: motor-init-calibration@6.service: Failed with result 'exit-code'. Nov 16 22:18:46 bletchley systemd[1]: Failed to start Motor Initialize for sled6. Nov 16 22:18:47 bletchley systemd[1]: motor-init-calibration@6.service: Scheduled restart job, restart counter is at 2. Nov 16 22:18:47 bletchley systemd[1]: Stopped Motor Initialize for sled6. Nov 16 22:18:47 bletchley systemd[1]: motor-init-calibration@6.service: Start request repeated too quickly. Nov 16 22:18:47 bletchley systemd[1]: motor-init-calibration@6.service: Failed with result 'exit-code'. Nov 16 22:18:47 bletchley systemd[1]: Failed to start Motor Initialize for sled6. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I45c423deceb3cedd9157a479e0f33f9dbf270b8f
2022-11-28state-management: move target relationship creationAndrew Geissler1-21/+0
The targets are within the phosphor-state-manager repository so the relationship between them should be defined within the corresponding recipe. Adding these to phosphor-state-manager also allows us to remove the duplicate logic in the bletchley layer. Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I8bc789ed25a937ed38840e398dd728782f8f368b
2022-11-01meta-bletchley: use mdio-tools instead mdio-utilPotin Lai2-3/+12
Introduce mdio-tools package to replace mdio-util script. This commit relies on the linux kernel patch below. LINK: https://lore.kernel.org/all/20221025055046.1704920-1-potin.lai.pt@gmail.com/ Tested Result: Check host status by power-ctrl which will call mdio internally. root@bletchley:~# power-ctrl sled6 status On Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I482dde297acb7797896d9b7ae07580104fb21540
2022-10-25meta-bletchley: add bletchley-host-state-monitor servicePotin Lai3-3/+216
Add a service for monitoring host power state by query port status via mdio bus. Test Results: - Poweron SLED6 root@bletchley:~# obmcutil -i=6 poweron root@bletchley:~# obmcutil -i=6 state CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.On CurrentHostState : xyz.openbmc_project.State.Host.HostState.Running BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive root@bletchley:~# journalctl -u bletchley-host-state-monitor ... Oct 24 07:55:17 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 5 Oct 24 07:55:18 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 4 Oct 24 07:55:22 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 5 Oct 24 07:55:23 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 4 Oct 24 07:55:27 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 5 Oct 24 07:55:29 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 4 Oct 24 07:55:30 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 3 Oct 24 07:55:31 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 2 Oct 24 07:55:33 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 1 Oct 24 07:55:34 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed, update host state to ON - Poweroff SLED6 root@bletchley:~# obmcutil -i=6 poweroff root@bletchley:~# obmcutil -i=6 state CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.Off CurrentHostState : xyz.openbmc_project.State.Host.HostState.Off BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive root@bletchley:~# journalctl -u bletchley-host-state-monitor Oct 21 09:38:21 bletchley systemd[1]: Started Bletchley host state monitoring. ... Oct 24 07:55:17 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 5 Oct 24 07:55:18 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 4 Oct 24 07:55:22 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 5 Oct 24 07:55:23 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 4 Oct 24 07:55:27 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 5 Oct 24 07:55:29 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 4 Oct 24 07:55:30 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 3 Oct 24 07:55:31 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 2 Oct 24 07:55:33 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:OFF, current:ON), check count: 1 Oct 24 07:55:34 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed, update host state to ON Oct 24 08:03:38 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:ON, current:OFF), check count: 5 Oct 24 08:03:39 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:ON, current:OFF), check count: 4 Oct 24 08:03:40 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:ON, current:OFF), check count: 3 Oct 24 08:03:42 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:ON, current:OFF), check count: 2 Oct 24 08:03:43 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed (previous:ON, current:OFF), check count: 1 Oct 24 08:03:44 bletchley bletchley-host-state-monitor[905]: SLED6: detected state changed, update host state to OFF Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I5916cd411c0d7d625b54f74c888aa380e00a1853
2022-10-24meta-bletchley: add switch diagnostics scriptPotin Lai2-0/+42
Add a switch diagnostics script to dump port register via mdio bus. Tested: root@bletchley:~# /usr/libexec/bletchley-switch-diag ======================================== Port 10 (BMC) **************************************** [00]: 0E07 (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07FE (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0001 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0000 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 001B (Debug Counters) ======================================== ======================================== Port 3 (SLED1) **************************************** [00]: 100F (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07FD (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0002 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0033 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 0000 (Debug Counters) ======================================== ======================================== Port 2 (SLED2) **************************************** [00]: 100F (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07FB (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0004 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0033 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 0000 (Debug Counters) ======================================== ======================================== Port 1 (SLED3) **************************************** [00]: 100F (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07F7 (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0008 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0033 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 0000 (Debug Counters) ======================================== ======================================== Port 7 (SLED4) **************************************** [00]: 100F (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07EF (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0010 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0033 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 0000 (Debug Counters) ======================================== ======================================== Port 6 (SLED5) **************************************** [00]: 1D4F (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07DF (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0020 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0033 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 0075 (Debug Counters) ======================================== ======================================== Port 5 (SLED6) **************************************** [00]: 1D4F (Port Status) [01]: 0003 (Physical Control) [02]: 0000 (Flow Control) [03]: 1920 (Switch Identifier) [04]: 007F (Port Control 0) [05]: 0000 (Port Control 1) [06]: 07BF (Port Based VLAN Map) [07]: 0001 (Default VLAN ID & Priority) [08]: 2080 (Port Control 2) [09]: 0001 (Egress Rate Control) [0A]: 8000 (Egress Rate Control 2) [0B]: 0040 (Port Association Vector) [0C]: 0000 (Port ATU Control) [0D]: 0000 (Override) [0E]: 0000 (Policy & MGMT Control) [10]: 0000 (Extended Port Control Operation) [11]: 0000 (Extended Port Control Data) [16]: 0033 (LED Control) [17]: 0000 (IP Priority Mapping Table) [18]: 0000 (IEEE Priority Mapping Table) [19]: 0000 (Port Control 3) [1B]: 8000 (Queue Counters) [1C]: 0000 (Queue Control) [1D]: 0000 (Queue Control 2) [1E]: 0000 (Enable & Cut Through) [1F]: 0058 (Debug Counters) ======================================== Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I3915e0747beeb8f8a3d06d3409ac55ed0cd50b41
2022-10-24meta-bletchley: introduce bletchley-system-state-initPotin Lai3-0/+81
Because Bletchley does not have IPMI between Bmc & Host, the Host init state will set to Off after Bmc booted. We require an extra service to check and set Host state & Chassis power state to correct state before doing any power action or power policy restore. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I680bc62559ea6f7df6dbe171b54d2cda0c7ae0d4
2022-09-06meta-bletchley: introduce board-type-checker-fpb servicePotin Lai3-0/+137
Add board-type-checker-fpb service for checking the board type (main or 2nd source) of front panel board. Base on the board type result, this service help probing i2c device with compatable driver and creating a softlink to link virtual sensor configuration to corresponding json file. This commit require a kernel patch to remove hdc1080 node from devicetree. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I2b9aabb41c9749f525fe5444fb519871f0a7796d
2022-09-06meta-bletchley: motor-ctrl: map host power action to obmc host targetPotin Lai2-5/+5
Mapping AC relay on/off to chassis power on/off: - host-ac-on@.service --> obmc-chassis-poweron@.target - host-ac-off@.service --> obmc-chassis-poweroff@.target Mapping host power button on/off to host starting/stopping - host-poweron@.service --> obmc-host-starting@.target - host-poweroff@.service --> obmc-host-stopping@.target Test Results: root@bletchley:~# obmcutil -i=6 poweron root@bletchley:~# obmcutil -i=6 state CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.On CurrentHostState : xyz.openbmc_project.State.Host.HostState.Running BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive root@bletchley:~# obmcutil -i=6 poweroff root@bletchley:~# obmcutil -i=6 state CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.Off CurrentHostState : xyz.openbmc_project.State.Host.HostState.Off BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I1fa2ec6d9233be61117149ac7f7d46f0417a6930
2022-09-06meta-bletchley: power-ctrl: add delay in do_action_on()Potin Lai1-0/+1
In Bletchley, we check host link status from switch to identify the host power state. During the power on process, the host (MAC mini) need some extra times to stable link status. Add extra 10 seconeds delay into do_action_on() to avoid get wrong host power state during stress testing of host power on/off. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ica628df42e29912029b44675aacdf555263cb6fa
2022-07-22meta-bletchley: bletchley-common-functions: add functionsPotin Lai1-0/+77
add below functions for flash binding on spi2 1. spi2_mux_select(): set spi2 mux by giving a sled index 2. bind_spi2_pnor(): set spi2 mux and bind pnor flash 3. unbind_spi2_pnor(): unbind pnor flash and unset spi2 mux Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I8cd626d2ee47e8812569a61b745d8181dee2f708
2022-07-22meta-bletchley: power-ctrl: add host cycle and reset actionsPotin Lai4-0/+96
Add host power cycle and power reset actions Cycle Action includes following steps: - 1. AC Off - 2. AC On - 3. Power On Reset Action includes following steps: - 1. Power Off - 2. Power On Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I17341ec30776413d428f35498d70534901d250b1
2022-07-18meta-bletchley: add systemd target for sled insertion and removalPotin Lai4-0/+37
Add target file for sled insertion and removal, add Requires for both motor-init-calibration & host-ac-on service in seld insertion target, and Conflicts in sled removal. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I020694f868a352b0bcd2754a54cadd4a7d5487e5
2022-07-18meta-bletchley: detect-gpio-present: sled present managerment servicePotin Lai3-0/+143
A service to monitor the presence status of sleds and perform corresponding actions when sleds are inserted or removed. This patch require phosphor-gpio-monitor-presence enabled and gpio-keys defined in kernel dts file, the LORE link as below. * https://lore.kernel.org/all/20220613095150.21917-4-potin.lai.pt@gmail.com/ Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Id43c7c5c40ccad904db3e6d55870b154a68626ca
2022-06-22meta-bletchley: motor-ctrl: fix host-ac-on failed during bmc bootPotin Lai6-4/+22
1. add service dependency to avoid host-ac-on service failed due to inventory (presence_sledX) property not avaliable. host-ac-on@X.service |- motor-init-calibration@X.service (Requires, After) |- phosphor-gpio-presence@presence-sledX.service (Requires, After) 2. simplify check method for ac-on & ac-off actions, just check host ac status before set ac on/off. 3. fix host-ac-on service shows failed when ac is aready turned on (ex: BMC reset), return 0 for both ac-on & ac-off actions no matter GPIO (power-hostX) set required or not. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I2c878dea05ea2511e6564c0980ba34dc28a46e2c
2022-06-22meta-bletchley: introduce Bletchley common functionsPotin Lai9-168/+125
Add a common functions script for reusing the functions which are called frequently. This patch depends on the patchs below: * https://lore.kernel.org/all/20220613095150.21917-4-potin.lai.pt@gmail.com/ Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I6e1602b00f1b0a19e77506be6eabe18c796e52fe
2022-06-02meta-bletchley: power-ctrl: action handler for each host statePotin Lai1-118/+326
1. add action handler for each host state, avoid action execute in the wrong host state. 2. add checking for Host in sleep mode 3. add last action record at /tmp/sledX-last-action for identify DFU and Recovery mode. ``` if (last_action == dfu) && (host_st == Off) host_st = DFU if (last_action == recovery) && (host_st == On) host_st = Recovery ``` Change-Id: I4c9c218fbe3f887c8bfe5cdcb64600261d67e30d Signed-off-by: Potin Lai <potin.lai@quantatw.com>
2022-05-15meta-bletchley: fw-update: change pnor flash binding commandPotin Lai1-2/+21
pnor flash interface switched from spi-gpio to spi-mem, update the bind and unbind command in script. This patch dependes on patch below: LINK: https://lore.kernel.org/all/20220509151118.4899-3-potin.lai.pt@gmail.com/ Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ib622f7f22dede5f40cf6a5b4cf3df93d5b191ad8
2022-05-15meta-bletchley: plat-svc: update gpio line namesPotin Lai1-4/+4
update gpio line names in bletchley-early-sys-init this patch depends on the pathcd below: LINK: https://lore.kernel.org/all/20220509151118.4899-5-potin.lai.pt@gmail.com/ Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I0ff7332378f63a812de1e500c196d6eb8ca1cd19
2022-05-13meta-bletchley: power-ctrl: fix host status checking in recovery modePotin Lai1-1/+1
recovery mode only can be triggered when host status is Off fix the wrong host power status checking when recovery mode triggered Tested: [Host status is On] root@bletchley:~# power-ctrl sled6 status On root@bletchley:~# power-ctrl sled6 recovery Please turn off host before trigger recovery mode [Host status is Off] root@bletchley:~# power-ctrl sled6 status Off root@bletchley:~# power-ctrl sled6 recovery Set host6 Recovery mode SLED6: pressing power button Motor go forward to press Power button Power button switch triggered SLED6: releasing host power button Motor reverse to initial position successful Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I40f57bd52d896d8e27d1ccec2e1c388986d28810
2022-05-12meta-bletchley: mdio-util: fix c22 write syntax errorPotin Lai1-1/+1
fix syntax error in c22 write command Tested: - Get switch PHY id by read/write SMI register root@bletchley:~# mdio-util c22 w 0 0x1c 0x19 0x0000 root@bletchley:~# mdio-util c22 w 0 0x1c 0x18 0x9434 root@bletchley:~# mdio-util c22 w 0 0x1c 0x18 0x9822 root@bletchley:~# mdio-util c22 r 0 0x1c 0x19 0x002b Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ie65a84c4485beb7f7600b36009027637c5fc7ed1
2022-04-28meta-bletchley: power-ctrl: add host recovery modePotin Lai1-1/+24
Add command to trigger host recovery mode Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I1067c347b975ef531a58e6022e3ef4d9f3eee67a
2022-04-28meta-bletchley: power-ctrl: add board revision checkPotin Lai1-15/+92
1. Add function for checking board revision 2. Because mdio not available at EVT, If it is EVT board, just check host status by dbus command. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I87d2b7b01ae9912ed9b4da7a4f0b3bb485c6029b
2022-04-28meta-bletchley: add usb-controller-update toolPotin Lai3-0/+151
Add usb-controller-update script for firmware updating. Tested results: root@bletchley:~# systemctl start flash-usb-controller@3.service root@bletchley:~# systemctl status flash-usb-controller@3.service ○ flash-usb-controller@3.service - Flash usb controller image on SLED 3 Loaded: loaded (/lib/systemd/system/flash-usb-controller@.service; static) Active: inactive (dead) Apr 22 02:52:52 bletchley systemd[1]: Starting Flash usb controller image on SLED 3... Apr 22 02:52:54 bletchley usb-controller-update[3915]: Bind mtd node success, path: /dev/mtd7 Apr 22 02:53:01 bletchley usb-controller-update[3937]: [293B blob data] Apr 22 02:53:01 bletchley usb-controller-update[3915]: Erase flash block done Apr 22 02:53:08 bletchley usb-controller-update[3940]: [438B blob data] Apr 22 02:53:10 bletchley usb-controller-update[3940]: [293B blob data] Apr 22 02:53:11 bletchley usb-controller-update[3940]: [293B blob data] Apr 22 02:53:11 bletchley usb-controller-update[3915]: Write firmware image done Apr 22 02:53:12 bletchley systemd[1]: flash-usb-controller@3.service: Deactivated successfully. Apr 22 02:53:12 bletchley systemd[1]: Finished Flash usb controller image on SLED 3. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Icd26fb3c7585461152c3b929a46dc16675d6c937
2022-04-15meta-bletchley: motro-ctrl: assign target for host power actionsPotin Lai1-2/+2
Assign host-poweron service to obmc-host-startmin target, and host-poweroff service to obmc-host-shutdown target. Tested results (obmcutil fixed at host6/chassis6): - Power On root@bletchley:~# obmcutil poweron root@bletchley:~# obmcutil hoststate CurrentHostState : xyz.openbmc_project.State.Host.HostState.Running root@bletchley:~# obmcutil chassisstate CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.On - Power Off root@bletchley:~# obmcutil poweroff root@bletchley:~# obmcutil hoststate CurrentHostState : xyz.openbmc_project.State.Host.HostState.Off root@bletchley:~# obmcutil chassisstate CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.Off Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ia1de25a49b87347a2e77ec45709a0bb3ed272be9
2022-04-14meta-bletchley: update fanX_good and sledX_good LED behaviourPotin Lai5-1/+50
Start fanX_good LED group during sysyem early init. Add sledX_good LED group start/stop service into obmc-host-startmin@X and obmc-host-shutdown@X targets. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ibfab75d6f08550806d320b8a95e67d5fd5bedf82
2022-04-13meta-bletchley: motor-ctrl: add host status checkingPotin Lai2-6/+101
Use mdio-util command to communicate with switch phy, and get port link status represent for host status. This feature is not support with EVT system due to MDIO0 is not connected. Tested on reworked EVT HW: root@bletchley:~# power-ctrl sled6 off Power off sled6 Motor go forward to press Power key Power key switch triggered Press power key for Sled6 5 seconds... Motor reverse to initial position successful root@bletchley:~# power-ctrl sled6 status Off root@bletchley:~# power-ctrl sled6 on Power on sled6 Motor go forward to press Power key Power key switch triggered Press power key for Sled6 0.5 seconds... Motor reverse to initial position successful root@bletchley:~# power-ctrl sled6 status On Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I523013447da9ed210499f5dca960f708292a4b33
2022-04-13meta-bletchley: Introduce mdio-utilPotin Lai2-0/+230
Introduce a MDIO Utility for AST2600 Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ia94078be73f2af443f745c7797111d9d94e8047b
2022-03-09meta-bletchley: motor-ctrl: Add retry and error handle to motor-init serviceAllen.Wang2-0/+29
1. While motor-init-calibration@.service fail,retry to start service with maximum count 5 times. 2. In case of service unexpected stopped while motor is running, add stop motor command after service stopped to avoid motor runs forever. 3. Add sled present check in motor-ctrl tool Change-Id: Ie636f3a7dbf656f8ea577bfffed150171f7f07be Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
2022-03-03meta-bletchley: motor-ctrl:check ac status before on/off and refine dfu cmdAllen.Wang1-8/+18
a) Block power on/off cmd if ac-relay is off. b) From official User Guide, to enter DFU mode must disconnect the Host from power for at least 10 seconds, but power from ac relay board maybe not be disappear immediately while pull ac-relay control gpio to low. Base on experiment result, expand wait time to 25 sec for workaround. Example: a) When sled2 is ac-off root@bletchley:/# power-ctrl sled2 on sled2 is ac-off, please turn on ac before power on root@bletchley:/# power-ctrl sled2 off sled2 is already ac-off b) Tested 10 times into dfu mode successfully root@bletchley:/# power-ctrl sled2 dfu Set host2 DFU mode SLED2: turn ac-off set_gpio: set power-host2 = 0 success SLED2: pressing power button Motor go forward to press Power button Power button switch triggered SLED2: turn ac-on set_gpio: set power-host2 = 1 success SLED2: releasing host power button Motor reverse to initial position successful Change-Id: Idb006ed1c58fd1736fc9410ca86d86a6ec87a6b9 Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
2022-02-15meta-bletchley: motor-ctrl: add support to trigger host DFU modePotin Lai1-0/+69
Add command to perform the steps below to trigger DFU mode on host 1. turn off host ac 2. press power button and wait at least 10 seconds 3. turn on host ac, and keep hold power button for 3 seconds 4. release host power button Example: root@bletchley:~# power-ctrl sled3 dfu Set host3 DFU mode SLED3: turn ac-off set_gpio: set power-host3 = 0 success SLED3: pressing power button Motor go forward to press Power button Power button switch triggered SLED3: turn ac-on set_gpio: set power-host3 = 1 success SLED3: releasing host power button Motor reverse to initial position successful Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I055b862ad5a1302050d5df1505a3470858c6ec58
2022-01-26meta-bletchley: motor-ctrl: Make init services auto startAllen.Wang1-2/+3
We want to do motor-init and turn on ac when system boot-up, make service instances link under /lib/systemd/system/multi-user.target.wants/ Change-Id: I53bc97270d111b90e0d70052f81a7e428805ead1 Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
2022-01-19meta-bletchley: motor-ctrl: clean up SYSTEMD variablesPatrick Williams1-14/+16
motor-ctrl recipe was reported to periodically fail with: ERROR: When reparsing motor-ctrl_0.1.bb:do_fetch, the basehash value changed from AAA to BBB. The metadata is not deterministic and this needs to be fixed. There was inconsistencies in the way the SYSTEMD services were defined and some of them appeared to not instantiate templates correctly. Clean them all up to match. Also perform trivial alphabetic sorting of some other variables. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9c66fa1106a4003041f39c68c1a43ef8b6a2c00e
2022-01-18meta-bletchley: motor-ctrl: add host ac-on and ac-off servicePotin Lai3-0/+26
1. add host-ac-on and host-ac-off service. 2. init host-ac-on during BMC boot. Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ie3954297e20f35c9d1f723d9d5e74cee91ec32ac
2022-01-05meta-bletchley: motor-ctrl: Change sled numbering to 1-basedAllen.Wang3-10/+10
switch sled to 1-based numbering to align with multi host systems tools only accept input sled1 to sled6 Change-Id: Ic372e011716d8de7edf2eebdf8667e44b2179e64 Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
2022-01-05meta-bletchley: motor-ctrl: enable motor by pwm and gpio driverAllen.Wang3-96/+37
1.enable bmc pwm output by sysfs 2.control motor vref by libgpiod-tools 3.Correct typo and formating Change-Id: Ie0a57a12e328913f007cb2014d4205ded99c91b3 Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
2021-12-29meta-bletchley: Add services to control step motorAllen.Wang7-0/+532
For Bletchley platform, we can only power on system by step motor to press power key. Add tools and service to initialize step motor and control system power by motor. Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com> Change-Id: Ic75352a037566d701b2e362743c527c370b0c2e5 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2021-12-22meta-bletchley: Add init service to setup systemHoward Chiu3-0/+118
To setup GPIOs and set fan speed to 70% Signed-off-by: Howard Chiu <howard.chiu@quantatw.com> Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I7a64e19b6e34bcab7013b382d19d7be6156bf87a