From 9729b8223b418aca8e46b8301459e423cf2eabbd Mon Sep 17 00:00:00 2001 From: Benjamin Fair Date: Thu, 11 Apr 2019 14:18:32 -0700 Subject: meta-quanta: gsj: move non-phosphor recipes out of recipes-phosphor The usb-network and quanta-nvme-powerctrl recipes aren't part of phosphor, so move them to the machine-spceific recipes-gsj folder instead. (From meta-quanta rev: a5787aa49f88aac01eed521e1b3e8f85b73f5c54) Change-Id: I22b68e1e83dbd0ee3f98288052ffb302b7ef1ff5 Signed-off-by: Benjamin Fair Signed-off-by: Brad Bishop --- .../recipes-gsj/quanta-nvme-powerctrl/README.md | 50 +++++++++++++++ .../quanta-nvme-powerctrl/files/init_once.sh | 60 ++++++++++++++++++ .../quanta-nvme-powerctrl/files/nvme_gpio.service | 10 +++ .../files/nvme_powermanager.service | 12 ++++ .../files/nvme_powermanager.sh | 73 ++++++++++++++++++++++ .../quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb | 32 ++++++++++ .../usb-network/files/00-bmc-usb0.network | 7 +++ .../usb-network/files/usb_network.service | 9 +++ .../recipes-gsj/usb-network/files/usb_network.sh | 27 ++++++++ .../recipes-gsj/usb-network/usb-network.bb | 29 +++++++++ .../quanta-nvme-powerctrl/README.md | 50 --------------- .../quanta-nvme-powerctrl/files/init_once.sh | 60 ------------------ .../quanta-nvme-powerctrl/files/nvme_gpio.service | 10 --- .../files/nvme_powermanager.service | 12 ---- .../files/nvme_powermanager.sh | 73 ---------------------- .../quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb | 32 ---------- .../usb-network/files/00-bmc-usb0.network | 7 --- .../usb-network/files/usb_network.service | 9 --- .../usb-network/files/usb_network.sh | 27 -------- .../recipes-phosphor/usb-network/usb-network.bb | 29 --------- 20 files changed, 309 insertions(+), 309 deletions(-) create mode 100644 meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/README.md create mode 100644 meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/init_once.sh create mode 100644 meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_gpio.service create mode 100644 meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.service create mode 100644 meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.sh create mode 100644 meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb create mode 100644 meta-quanta/meta-gsj/recipes-gsj/usb-network/files/00-bmc-usb0.network create mode 100644 meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.service create mode 100644 meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.sh create mode 100644 meta-quanta/meta-gsj/recipes-gsj/usb-network/usb-network.bb delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/README.md delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/init_once.sh delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_gpio.service delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.service delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.sh delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/00-bmc-usb0.network delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.service delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.sh delete mode 100644 meta-quanta/meta-gsj/recipes-phosphor/usb-network/usb-network.bb (limited to 'meta-quanta') diff --git a/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/README.md b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/README.md new file mode 100644 index 000000000..51a9e8fe5 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/README.md @@ -0,0 +1,50 @@ +### NVME SSD Power Control Manager + +#### Description + The Package is Mantain for SSD power control and related noification handle Deamon + +#### Design + nvme_gpio.service for initinal related GPIOs ( PRESENT, PWR, PWRGD, RST_U2 ) and according PRESENT signal fix HW PWR default output signal. + + nvme_powermanager.service loop for monitor PRESENT signal and update PWR output. + +#### Process + + * Plugging + 1. U2_[SSD_index]PRSNT_N will be input low + 2. Set PWR_U2_[SSD_index]_EN to high + 3. Check PWRGD_U2_[SSD_index] is high + 4-1. If PWRGD_U2_[SSD_index] is high (PWR Good) + - Wait 5ms + - Enable PCI Clock by SMBus 9FGL0851 + - Wait 100ms + - Reset RST_BMC_U2 [low->high] + - Send Assert to tell package could read SSD status. + + 4-2. If PWRGD_U2_[SSD_index] is low (PWR Fail) + - Disable Clock by SMBus + - Wait 100ms + - Set RST_BMC_U2_[SSD_index]_R_N to low + - Set LED_U2_FAULT to high + + * Removing + 1. U2_[SSD_index]PRSNT_N will be input high + 2. Disable Clock by SMBus 9FGL0851 + 3. PWR_U2_[SSD_index]_EN to low + 4. Check PWRGD_U2_[SSD_index] is low + 5. Send Assert to tell package update SSD status. + + +#### TODO + + 1. After power on ssd, bmc send command to 9FGL0851 (on SMBus8 0x68) for enable PCI clock, and send RST_BMC_U2 pin rsing event (set low, wait 500ms, set high). The Host could rescan PCI and detect SSD device. + +#### Test + + 1. PRESENT detect SSD: The Default Hardware is implement. + 2. Initial SSD slot Power output: nvme_gpio service has test on Module. It could sucess initial gpios and setting correct power output. + 3. Detect PRESENT and change power setting: nvme_powermanager service has tested on Module. It could success detect SSD plugged or removal change PWR output. + 4. NVME-MI connect: Ensure SSD power is ready then it will notify quanta NVME-MI package could read SSD information. + 5. FAULT LED handle: When detect power output irregular by PWRGD pin, the service will trigger related FAULT LED. + + diff --git a/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/init_once.sh b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/init_once.sh new file mode 100644 index 000000000..2ea02ef8d --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/init_once.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +function set_gpio() { + #$1 gpio pin + echo $1 > /sys/class/gpio/export +} + +function set_gpio_direction(){ + #$1 gpio pin, $2 'in','high','low' + echo $2 > /sys/class/gpio/gpio$1/direction +} + +function read_gpio_input(){ + #$1 read input gpio pin + cat /sys/class/gpio/gpio$1/value +} + +function read_present_set_related_power(){ + #$1 read present gpio, $2 output power gpio,$3 output direction + var=$(cat /sys/class/gpio/gpio$1/value) + # present 0 is plugged,present 1 is removal + if [ "$var" == "0" ];then + set_gpio_direction $2 "high" + else + set_gpio_direction $2 "low" + fi +} + + +## Initial U2_PRESNET_N +U2_PRESENT=( 148 149 150 151 152 153 154 155 ) +for i in "${U2_PRESENT[@]}"; +do + set_gpio $i; + set_gpio_direction $i 'in'; +done + +## Initial POWER_U2_EN +POWER_U2=( 195 196 202 199 198 197 127 126 ) +for i in "${POWER_U2[@]}"; +do + set_gpio $i; +done + +## Initial PWRGD_U2 +PWRGD_U2=( 161 162 163 164 165 166 167 168 ) +for i in "${PWRGD_U2[@]}"; +do + set_gpio $i; + set_gpio_direction $i 'in'; +done + +### Initial SSD Power reference U2_PRESNET_N +for i in {0..7}; +do + read_present_set_related_power "${U2_PRESENT[$i]}" "${POWER_U2[$i]}"; +done + + +exit 0; \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_gpio.service b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_gpio.service new file mode 100644 index 000000000..a5073d3a5 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_gpio.service @@ -0,0 +1,10 @@ +[Unit] +Description = configure GPIO for SSD Power Control +Wants=org.openbmc.records.events.service +After=org.openbmc.records.events.service xyz.openbmc_project.nvme.manager.service + +[Service] +ExecStart=/usr/bin/init_once.sh + +[Install] +WantedBy=obmc-standby.target \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.service b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.service new file mode 100644 index 000000000..4a4cd6288 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.service @@ -0,0 +1,12 @@ +[Unit] +Description=SSD NVME Power Manager +Wants=org.openbmc.records.events.service +After=org.openbmc.records.events.service nvme_gpio.service xyz.openbmc_project.nvme.manager.service + +[Service] +ExecStart=/usr/bin/nvme_powermanager.sh +Restart=always + + +[Install] +WantedBy=obmc-standby.target \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.sh b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.sh new file mode 100644 index 000000000..91beec566 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/files/nvme_powermanager.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +U2_PRESENT_STATUS=( 1 1 1 1 1 1 1 1 ) +U2_PRESENT=( 148 149 150 151 152 153 154 155 ) +POWER_U2=( 195 196 202 199 198 197 127 126 ) +PWRGD_U2=( 161 162 163 164 165 166 167 168 ) + + +function set_gpio_direction(){ + #$1 gpio pin, $2 'in','high','low' + echo $2 > /sys/class/gpio/gpio$1/direction +} + +function read_present_set_related_power(){ + #$1 read present number, $2 output power gpio + var="${U2_PRESENT_STATUS[$1]}" + # present 0 is plugged,present 1 is removal + if [ "$var" == "0" ];then + set_gpio_direction $2 "high" + else + set_gpio_direction $2 "low" + fi +} + +function update_u2_status(){ + #$1 read present gpio + var=$(cat /sys/class/gpio/gpio$2/value) + U2_PRESENT_STATUS[$1]="$var" +} + +function check_present_and_powergood(){ + #$2 present gpio, $3 powergood gpio + present=$(cat /sys/class/gpio/gpio$2/value) + pwrgd=$(cat /sys/class/gpio/gpio$3/value) + path=`expr $1` + if [ "$present" -eq 0 ] && [ "$pwrgd" -eq 1 ];then + busctl set-property xyz.openbmc_project.nvme.manager /xyz/openbmc_project/nvme/$path xyz.openbmc_project.Inventory.Item Present b true + else + busctl set-property xyz.openbmc_project.nvme.manager /xyz/openbmc_project/nvme/$path xyz.openbmc_project.Inventory.Item Present b false + if [ "$present" -eq "$pwrgd" ];then + #set fault led + busctl set-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/led\_u2\_$1\_fault xyz.openbmc_project.Led.Group Asserted b true + else + busctl set-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/led\_u2\_$1\_fault xyz.openbmc_project.Led.Group Asserted b false + fi + + fi + + +} + +##Initial U2 present status +for i in {0..7}; +do + update_u2_status $i "${U2_PRESENT[$i]}" +done + + +## Loop while +while : +do + for i in {0..7}; + do + ## 1 scend scan all loop + sleep 0.125 + read=$(cat /sys/class/gpio/gpio${U2_PRESENT[$i]}/value) + if [ "${U2_PRESENT_STATUS[$1]}" != read ];then + update_u2_status $i "${U2_PRESENT[$i]}" + read_present_set_related_power $i "${POWER_U2[$i]}" + check_present_and_powergood $i "${U2_PRESENT[$i]}" "${POWER_U2[$i]}" + fi + done +done diff --git a/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb new file mode 100644 index 000000000..8d0aa8c72 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb @@ -0,0 +1,32 @@ +SUMMARY = "Phosphor OpenBMC Quanta NVME Power Control Service" +DESCRIPTION = "Phosphor OpenBMC Quanta NVME Power Control Daemon." +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +FILESEXTRAPATHS_append := "${THISDIR}/files:" + +inherit systemd + +DEPENDS += "systemd" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "bash" + +SRC_URI += "file://init_once.sh \ + file://nvme_powermanager.sh \ + file://nvme_gpio.service \ + file://nvme_powermanager.service \ + " + +do_install () { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/init_once.sh ${D}${bindir}/ + install -m 0755 ${WORKDIR}/nvme_powermanager.sh ${D}${bindir}/ + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/nvme_gpio.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/nvme_powermanager.service ${D}${systemd_unitdir}/system +} + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "nvme_gpio.service nvme_powermanager.service" diff --git a/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/00-bmc-usb0.network b/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/00-bmc-usb0.network new file mode 100644 index 000000000..94839637b --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/00-bmc-usb0.network @@ -0,0 +1,7 @@ +[Match] +Name=usb0 +[Address] +Address=169.254.95.118/16 +[Network] +LinkLocalAddressing=yes +IPv6AcceptRA=no diff --git a/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.service b/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.service new file mode 100644 index 000000000..913f5fbee --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.service @@ -0,0 +1,9 @@ +[Unit] +Description=enable usb network + +[Service] +Type=oneshot +ExecStart=/bin/bash -c '/usr/sbin/usb_network.sh' + +[Install] +WantedBy=multi-user.target diff --git a/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.sh b/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.sh new file mode 100644 index 000000000..45fa888be --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cd /sys/kernel/config/usb_gadget + +if [ ! -f "g1" ]; then + mkdir g1 + cd g1 + + echo 0x1d6b > idVendor # Linux foundation + echo 0x0104 > idProduct # Multifunction composite gadget + mkdir -p strings/0x409 + echo "Linux" > strings/0x409/manufacturer + echo "Ethernet/RNDIS gadget" > strings/0x409/product + + mkdir -p configs/c.1 + echo 100 > configs/c.1/MaxPower + mkdir -p configs/c.1/strings/0x409 + echo "RNDIS" > configs/c.1/strings/0x409/configuration + + mkdir -p functions/rndis.usb0 + + ln -s functions/rndis.usb0 configs/c.1 + + echo f0839000.udc > UDC + +fi +exit 0 diff --git a/meta-quanta/meta-gsj/recipes-gsj/usb-network/usb-network.bb b/meta-quanta/meta-gsj/recipes-gsj/usb-network/usb-network.bb new file mode 100644 index 000000000..591ca5afd --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-gsj/usb-network/usb-network.bb @@ -0,0 +1,29 @@ +FILESEXTRAPATHS_append := "${THISDIR}/files:" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +DEPENDS += "systemd" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "bash" + +SRC_URI += "file://usb_network.sh \ + file://usb_network.service \ + file://00-bmc-usb0.network" + +do_install() { + install -d ${D}/${sbindir} + install -m 0755 ${WORKDIR}/usb_network.sh ${D}/${sbindir} + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/usb_network.service ${D}${systemd_unitdir}/system + + install -d ${D}${sysconfdir_native}/systemd/network/ + install -m 0644 ${WORKDIR}/00-bmc-usb0.network ${D}${sysconfdir_native}/systemd/network +} + +NATIVE_SYSTEMD_SUPPORT = "1" +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "usb_network.service" +FILES_${PN} += "${sysconfdir_native}/systemd/network/00-bmc-usb0.network" + +inherit allarch systemd \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/README.md b/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/README.md deleted file mode 100644 index 51a9e8fe5..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/README.md +++ /dev/null @@ -1,50 +0,0 @@ -### NVME SSD Power Control Manager - -#### Description - The Package is Mantain for SSD power control and related noification handle Deamon - -#### Design - nvme_gpio.service for initinal related GPIOs ( PRESENT, PWR, PWRGD, RST_U2 ) and according PRESENT signal fix HW PWR default output signal. - - nvme_powermanager.service loop for monitor PRESENT signal and update PWR output. - -#### Process - - * Plugging - 1. U2_[SSD_index]PRSNT_N will be input low - 2. Set PWR_U2_[SSD_index]_EN to high - 3. Check PWRGD_U2_[SSD_index] is high - 4-1. If PWRGD_U2_[SSD_index] is high (PWR Good) - - Wait 5ms - - Enable PCI Clock by SMBus 9FGL0851 - - Wait 100ms - - Reset RST_BMC_U2 [low->high] - - Send Assert to tell package could read SSD status. - - 4-2. If PWRGD_U2_[SSD_index] is low (PWR Fail) - - Disable Clock by SMBus - - Wait 100ms - - Set RST_BMC_U2_[SSD_index]_R_N to low - - Set LED_U2_FAULT to high - - * Removing - 1. U2_[SSD_index]PRSNT_N will be input high - 2. Disable Clock by SMBus 9FGL0851 - 3. PWR_U2_[SSD_index]_EN to low - 4. Check PWRGD_U2_[SSD_index] is low - 5. Send Assert to tell package update SSD status. - - -#### TODO - - 1. After power on ssd, bmc send command to 9FGL0851 (on SMBus8 0x68) for enable PCI clock, and send RST_BMC_U2 pin rsing event (set low, wait 500ms, set high). The Host could rescan PCI and detect SSD device. - -#### Test - - 1. PRESENT detect SSD: The Default Hardware is implement. - 2. Initial SSD slot Power output: nvme_gpio service has test on Module. It could sucess initial gpios and setting correct power output. - 3. Detect PRESENT and change power setting: nvme_powermanager service has tested on Module. It could success detect SSD plugged or removal change PWR output. - 4. NVME-MI connect: Ensure SSD power is ready then it will notify quanta NVME-MI package could read SSD information. - 5. FAULT LED handle: When detect power output irregular by PWRGD pin, the service will trigger related FAULT LED. - - diff --git a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/init_once.sh b/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/init_once.sh deleted file mode 100644 index 2ea02ef8d..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/init_once.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -function set_gpio() { - #$1 gpio pin - echo $1 > /sys/class/gpio/export -} - -function set_gpio_direction(){ - #$1 gpio pin, $2 'in','high','low' - echo $2 > /sys/class/gpio/gpio$1/direction -} - -function read_gpio_input(){ - #$1 read input gpio pin - cat /sys/class/gpio/gpio$1/value -} - -function read_present_set_related_power(){ - #$1 read present gpio, $2 output power gpio,$3 output direction - var=$(cat /sys/class/gpio/gpio$1/value) - # present 0 is plugged,present 1 is removal - if [ "$var" == "0" ];then - set_gpio_direction $2 "high" - else - set_gpio_direction $2 "low" - fi -} - - -## Initial U2_PRESNET_N -U2_PRESENT=( 148 149 150 151 152 153 154 155 ) -for i in "${U2_PRESENT[@]}"; -do - set_gpio $i; - set_gpio_direction $i 'in'; -done - -## Initial POWER_U2_EN -POWER_U2=( 195 196 202 199 198 197 127 126 ) -for i in "${POWER_U2[@]}"; -do - set_gpio $i; -done - -## Initial PWRGD_U2 -PWRGD_U2=( 161 162 163 164 165 166 167 168 ) -for i in "${PWRGD_U2[@]}"; -do - set_gpio $i; - set_gpio_direction $i 'in'; -done - -### Initial SSD Power reference U2_PRESNET_N -for i in {0..7}; -do - read_present_set_related_power "${U2_PRESENT[$i]}" "${POWER_U2[$i]}"; -done - - -exit 0; \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_gpio.service b/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_gpio.service deleted file mode 100644 index a5073d3a5..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_gpio.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description = configure GPIO for SSD Power Control -Wants=org.openbmc.records.events.service -After=org.openbmc.records.events.service xyz.openbmc_project.nvme.manager.service - -[Service] -ExecStart=/usr/bin/init_once.sh - -[Install] -WantedBy=obmc-standby.target \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.service b/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.service deleted file mode 100644 index 4a4cd6288..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=SSD NVME Power Manager -Wants=org.openbmc.records.events.service -After=org.openbmc.records.events.service nvme_gpio.service xyz.openbmc_project.nvme.manager.service - -[Service] -ExecStart=/usr/bin/nvme_powermanager.sh -Restart=always - - -[Install] -WantedBy=obmc-standby.target \ No newline at end of file diff --git a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.sh b/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.sh deleted file mode 100644 index 91beec566..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/files/nvme_powermanager.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -U2_PRESENT_STATUS=( 1 1 1 1 1 1 1 1 ) -U2_PRESENT=( 148 149 150 151 152 153 154 155 ) -POWER_U2=( 195 196 202 199 198 197 127 126 ) -PWRGD_U2=( 161 162 163 164 165 166 167 168 ) - - -function set_gpio_direction(){ - #$1 gpio pin, $2 'in','high','low' - echo $2 > /sys/class/gpio/gpio$1/direction -} - -function read_present_set_related_power(){ - #$1 read present number, $2 output power gpio - var="${U2_PRESENT_STATUS[$1]}" - # present 0 is plugged,present 1 is removal - if [ "$var" == "0" ];then - set_gpio_direction $2 "high" - else - set_gpio_direction $2 "low" - fi -} - -function update_u2_status(){ - #$1 read present gpio - var=$(cat /sys/class/gpio/gpio$2/value) - U2_PRESENT_STATUS[$1]="$var" -} - -function check_present_and_powergood(){ - #$2 present gpio, $3 powergood gpio - present=$(cat /sys/class/gpio/gpio$2/value) - pwrgd=$(cat /sys/class/gpio/gpio$3/value) - path=`expr $1` - if [ "$present" -eq 0 ] && [ "$pwrgd" -eq 1 ];then - busctl set-property xyz.openbmc_project.nvme.manager /xyz/openbmc_project/nvme/$path xyz.openbmc_project.Inventory.Item Present b true - else - busctl set-property xyz.openbmc_project.nvme.manager /xyz/openbmc_project/nvme/$path xyz.openbmc_project.Inventory.Item Present b false - if [ "$present" -eq "$pwrgd" ];then - #set fault led - busctl set-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/led\_u2\_$1\_fault xyz.openbmc_project.Led.Group Asserted b true - else - busctl set-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/led\_u2\_$1\_fault xyz.openbmc_project.Led.Group Asserted b false - fi - - fi - - -} - -##Initial U2 present status -for i in {0..7}; -do - update_u2_status $i "${U2_PRESENT[$i]}" -done - - -## Loop while -while : -do - for i in {0..7}; - do - ## 1 scend scan all loop - sleep 0.125 - read=$(cat /sys/class/gpio/gpio${U2_PRESENT[$i]}/value) - if [ "${U2_PRESENT_STATUS[$1]}" != read ];then - update_u2_status $i "${U2_PRESENT[$i]}" - read_present_set_related_power $i "${POWER_U2[$i]}" - check_present_and_powergood $i "${U2_PRESENT[$i]}" "${POWER_U2[$i]}" - fi - done -done diff --git a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb b/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb deleted file mode 100644 index 8d0aa8c72..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/quanta-nvme-powerctrl/quanta-nvme-powerctrl.bb +++ /dev/null @@ -1,32 +0,0 @@ -SUMMARY = "Phosphor OpenBMC Quanta NVME Power Control Service" -DESCRIPTION = "Phosphor OpenBMC Quanta NVME Power Control Daemon." -PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" - -FILESEXTRAPATHS_append := "${THISDIR}/files:" - -inherit systemd - -DEPENDS += "systemd" -RDEPENDS_${PN} += "libsystemd" -RDEPENDS_${PN} += "bash" - -SRC_URI += "file://init_once.sh \ - file://nvme_powermanager.sh \ - file://nvme_gpio.service \ - file://nvme_powermanager.service \ - " - -do_install () { - install -d ${D}${bindir} - install -m 0755 ${WORKDIR}/init_once.sh ${D}${bindir}/ - install -m 0755 ${WORKDIR}/nvme_powermanager.sh ${D}${bindir}/ - - install -d ${D}${systemd_unitdir}/system/ - install -m 0644 ${WORKDIR}/nvme_gpio.service ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/nvme_powermanager.service ${D}${systemd_unitdir}/system -} - -SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} = "nvme_gpio.service nvme_powermanager.service" diff --git a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/00-bmc-usb0.network b/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/00-bmc-usb0.network deleted file mode 100644 index 94839637b..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/00-bmc-usb0.network +++ /dev/null @@ -1,7 +0,0 @@ -[Match] -Name=usb0 -[Address] -Address=169.254.95.118/16 -[Network] -LinkLocalAddressing=yes -IPv6AcceptRA=no diff --git a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.service b/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.service deleted file mode 100644 index 913f5fbee..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=enable usb network - -[Service] -Type=oneshot -ExecStart=/bin/bash -c '/usr/sbin/usb_network.sh' - -[Install] -WantedBy=multi-user.target diff --git a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.sh b/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.sh deleted file mode 100644 index 45fa888be..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/files/usb_network.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -cd /sys/kernel/config/usb_gadget - -if [ ! -f "g1" ]; then - mkdir g1 - cd g1 - - echo 0x1d6b > idVendor # Linux foundation - echo 0x0104 > idProduct # Multifunction composite gadget - mkdir -p strings/0x409 - echo "Linux" > strings/0x409/manufacturer - echo "Ethernet/RNDIS gadget" > strings/0x409/product - - mkdir -p configs/c.1 - echo 100 > configs/c.1/MaxPower - mkdir -p configs/c.1/strings/0x409 - echo "RNDIS" > configs/c.1/strings/0x409/configuration - - mkdir -p functions/rndis.usb0 - - ln -s functions/rndis.usb0 configs/c.1 - - echo f0839000.udc > UDC - -fi -exit 0 diff --git a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/usb-network.bb b/meta-quanta/meta-gsj/recipes-phosphor/usb-network/usb-network.bb deleted file mode 100644 index 591ca5afd..000000000 --- a/meta-quanta/meta-gsj/recipes-phosphor/usb-network/usb-network.bb +++ /dev/null @@ -1,29 +0,0 @@ -FILESEXTRAPATHS_append := "${THISDIR}/files:" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" - -DEPENDS += "systemd" -RDEPENDS_${PN} += "libsystemd" -RDEPENDS_${PN} += "bash" - -SRC_URI += "file://usb_network.sh \ - file://usb_network.service \ - file://00-bmc-usb0.network" - -do_install() { - install -d ${D}/${sbindir} - install -m 0755 ${WORKDIR}/usb_network.sh ${D}/${sbindir} - - install -d ${D}${systemd_unitdir}/system/ - install -m 0644 ${WORKDIR}/usb_network.service ${D}${systemd_unitdir}/system - - install -d ${D}${sysconfdir_native}/systemd/network/ - install -m 0644 ${WORKDIR}/00-bmc-usb0.network ${D}${sysconfdir_native}/systemd/network -} - -NATIVE_SYSTEMD_SUPPORT = "1" -SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} = "usb_network.service" -FILES_${PN} += "${sysconfdir_native}/systemd/network/00-bmc-usb0.network" - -inherit allarch systemd \ No newline at end of file -- cgit v1.2.3