Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+175
View File
@@ -0,0 +1,175 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
+12
View File
@@ -0,0 +1,12 @@
Different components of meta-hpe are under different licenses (a mix
of MIT and Apache-2.0). Please see:
COPYING.Apache-2.0
COPYING.MIT (MIT)
All metadata is MIT licensed unless otherwise stated. Source code
included in tree for individual recipes is under the LICENSE stated in
the associated recipe (.bb file) unless otherwise stated.
License information for any other files is either explicitly stated
or defaults to Apache-2.0.
+4
View File
@@ -0,0 +1,4 @@
owners:
- jean-marie.verdun@hpe.com
- nhawkins48@gmail.com
+55
View File
@@ -0,0 +1,55 @@
OpenEmbedded/Yocto/OpenBMC BSP layer for Hewlett Packard Enterprise servers
====================================================
This layer supports OpenBMC firmware on supported Hewlett Packard Enterprise server
products.
The following system is supported.
## HPE DL360 Gen10 (Modified Proof of Concept)
The HPE DL360 Gen10 OpenBMC Proof of Concept is a two-socket, 1U general purpose server.
For more information, click [here](https://buy.hpe.com/us/en/servers/rack-servers/proliant-dl300-servers/proliant-dl360-server/hpe-proliant-dl360-gen10-server/p/1010007891)
**This is for experimental use only at this time. The thermal management configuration (fan PID calibration) is not complete.**
HPE ProLiant Gen10 products contain a custom BMC ASIC (called "GXP" here) that includes Hewlett Packard Enterprise Silicon Root of Trust technology. This feature was designed to ensure that only firmware released by Hewlett Packard Enterprise can run. In order to enable customers and partners to work with open firmware including OpenBMC, the DL360 layer described here will run only on a modified server or on the open source firmware CI system at https://osfci.tech/ci/.
This boot process for the GXP ASIC begins with a binary bootblock before starting U-Boot,
Linux, and the OpenBMC services.
### Configuration
Source the `setup` script as follows:
```
. ./setup dl360poc
```
Build
```
bitbake obmc-phosphor-image
```
Additional machine configurations will be made available in the future.
Contributing
------------
meta-hpe patches are reviewed using the Gerrit instance at
https://gerrit.openbmc.org.
Please submit patches to Gerrit. More information about using Gerrit can be found
[here](https://github.com/openbmc/docs/blob/master/CONTRIBUTING.md#submitting-changes-via-gerrit-server).
https://github.com/openbmc/meta-hpe is a hosting mirror only. GitHub
pull requests are not monitored and will not be accepted.
Patch checklist. Please ensure that patches adhere to the following guidelines:
- meta-hpe uses the [OE style
guidelines](https://www.openembedded.org/wiki/Styleguide).
- Follow [the seven rules of a great git commit
message](https://chris.beams.io/posts/git-commit/#seven-rules)
For questions or help, join us on the [mailing
list](https://lists.ozlabs.org/listinfo/openbmc) or in
[IRC](irc://freenode.net/openbmc).
@@ -0,0 +1,7 @@
touch_var_lib_systemd_clock() {
install -d ${IMAGE_ROOTFS}/var/lib/systemd/timesync/
touch ${IMAGE_ROOTFS}/var/lib/systemd/timesync/clock
}
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "touch_var_lib_systemd_clock; ", "", d)}'
+13
View File
@@ -0,0 +1,13 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/meta-common/recipes-*/*/*.bb \
${LAYERDIR}/meta-common/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "hpe-layer"
BBFILE_PATTERN_hpe-layer := "^${LAYERDIR}/meta-common/"
LAYERSERIES_COMPAT_hpe-layer = "langdale mickledore"
# Provide a variable that points the base of the hpe layer.
HPEBASE = '${@os.path.normpath("${LAYERDIR}/")}'
+21
View File
@@ -0,0 +1,21 @@
MACHINE_FEATURES += "\
obmc-phosphor-fan-mgmt \
obmc-phosphor-chassis-mgmt \
obmc-phosphor-flash-mgmt \
obmc-host-ipmi \
obmc-host-state-mgmt \
obmc-chassis-state-mgmt \
obmc-bmc-state-mgmt \
"
VIRTUAL-RUNTIME_obmc-host-state-manager ?= "x86-power-control"
VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "x86-power-control"
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-kcs"
PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-hpe-apps"
PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-hpe-apps"
PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-hpe-apps"
PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-hpe-apps"
#PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "hostboot-inventory-config-native"
IMAGE_CLASSES:append = " hpe-rootfs-postcommands"
+10
View File
@@ -0,0 +1,10 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "common-layer"
BBFILE_PATTERN_common-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_common-layer = "mickledore"
@@ -0,0 +1,20 @@
SUMMARY = "Enable Host Boot"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${HPEBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
inherit obmc-phosphor-systemd
HOST_BOOT_SERVICE = "host-boot-enable.service"
SYSTEMD_SERVICE:${PN} += "${HOST_BOOT_SERVICE}"
HOST_BOOT_FMT = "../${HOST_BOOT_SERVICE}:multi-user.target.wants/${HOST_BOOT_SERVICE}"
SYSTEMD_LINK_${PN} += "${HOST_BOOT_FMT}"
SRC_URI += "file://host-boot-enable.service"
SRC_URI += "file://host-boot-enable.sh"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/host-boot-enable.sh ${D}${bindir}
}
@@ -0,0 +1,15 @@
[Unit]
Description=Enable Host Boot
Wants=phosphor-ipmi-host.service
After=phosphor-ipmi-host.service
[Service]
Type=simple
ExecStart=/bin/sh -c "host-boot-enable.sh"
SyslogIdentifier=host-boot-enable
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,38 @@
#!/bin/sh
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
m=${m%/name}
m=${m##*/}
echo "$m"
}
set -- host-prime host-second vrom-prime vrom-second
for f in "$@"
do
image=$(findmtd "${f}")
if test -z "$image"
then
echo "Unable to find mtd partition for ${f}"
exit 1
fi
done
#enable vrom
# host-prime to vrom-prime
dd if="/dev/$(findmtd host-prime)" of="/dev/$(findmtd vrom-prime)"
# host-second to vrom-second
dd if="/dev/$(findmtd host-second)" of="/dev/$(findmtd vrom-second)"
echo 0x1800008a > /sys/class/soc/srom/vromoff
val=$(( ("$(devmem 0xd1000006 8)" && 0xff) | 0x04 ))
devmem 0xd1000006 8 $val
devmem 0xd1000018 8 0xff
while true
do
devmem 0xd100000f 8 0x14
sleep 1
done
@@ -0,0 +1,8 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
# platform configuration files
SRC_URI += "file://hpe-publish-uefi-version.sh"
do_install:append() {
install -D ${WORKDIR}/hpe-publish-uefi-version ${D}/usr/bin/hpe-publish-uefi-version
}
@@ -0,0 +1,43 @@
#!/bin/sh
#
# Copyright (c) 2021 Hewlett-Packard Development Company, L.P.
#
# 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.
#
# RL300 doesn't support VROM, so we will be reading directly from
# SPI-NOR. The whole process is a little bit slow but works
# Find an MTD /dev file by name
findmtd() {
echo "parameter $1"
m=$(grep -xl "$1" /sys/class/mtd/*/name)
m=${m%/name}
m=${m##*/}
echo "$m"
}
rom=uefi-master
echo "Checking for mtd partition ${rom}"
image=$(findmtd ${rom})
if test -z "$image"
then
echo "Unable to find mtd partition for ${rom}"
exit 1
fi
rom_mtd=${image}
uefi_version="hpe-uefi-version /dev/${rom_mtd}"
busctl set-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/bios_active xyz.openbmc_project.Software.Version Version s "$uefi_version"
busctl get-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/bios_active xyz.openbmc_project.Software.Version Version
@@ -0,0 +1,44 @@
SUMMARY = "GXP EHCI Owner Reset"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${HPEBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
inherit obmc-phosphor-systemd
DEPENDS += "phosphor-gpio-monitor"
RDEPENDS:${PN} += "phosphor-gpio-monitor-monitor"
SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/gpio/port_owner_udc0"
SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/gpio/port_owner_udc1"
SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/gpio/port_owner_udc2"
UDC0_GPIO = "port_owner_udc0"
UDC1_GPIO = "port_owner_udc1"
UDC2_GPIO = "port_owner_udc2"
TMPL_GPIO = "phosphor-gpio-monitor@.service"
INSTFMT_GPIO = "phosphor-gpio-monitor@{0}.service"
TGT_GPIO = "multi-user.target.requires"
FMT_GPIO = "../${TMPL_GPIO}:${TGT_GPIO}/${INSTFMT_GPIO}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_GPIO', 'UDC0_GPIO')}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_GPIO', 'UDC1_GPIO')}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_GPIO', 'UDC2_GPIO')}"
UDC0_VEHCI = "udc0"
UDC1_VEHCI = "udc1"
UDC2_VEHCI = "udc2"
TMPL_VEHCI = "host-ehci-owner-reset@.service"
INSTFMT_VEHCI = "host-ehci-owner-reset@{0}.service"
FMT_VEHCI = "${TMPL_VEHCI}:${INSTFMT_VEHCI}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_VEHCI', 'UDC0_VEHCI')}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_VEHCI', 'UDC1_VEHCI')}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT_VEHCI', 'UDC2_VEHCI')}"
SYSTEMD_SERVICE:${PN} += "host-ehci-owner-reset@.service"
SRC_URI += "file://udc-reconnect.sh"
SRC_URI += "file://host-ehci-owner-reset@.service"
do_install() {
install -d ${D}${bindir}
install -m 755 ${WORKDIR}/udc-reconnect.sh ${D}${bindir}
}
@@ -0,0 +1,11 @@
[Unit]
Description=GXP EHCI Owner Reset Service
Wants=start-ipkvm.service
After=start-ipkvm.service
StartLimitIntervalSec=0
[Service]
Type=oneshot
ExecStart=/bin/sh -c "udc-reconnect.sh %i"
SyslogIdentifier=host-ehci-owner-reset@%i
@@ -0,0 +1,5 @@
DEVPATH=/dev/input/by-path/platform-ahb@80000000:vuhc-event
KEY=200
POLARITY=1
TARGET=host-ehci-owner-reset@udc0.service
EXTRA_ARGS=--continue
@@ -0,0 +1,5 @@
DEVPATH=/dev/input/by-path/platform-ahb@80000000:vuhc-event
KEY=201
POLARITY=1
TARGET=host-ehci-owner-reset@udc1.service
EXTRA_ARGS=--continue
@@ -0,0 +1,5 @@
DEVPATH=/dev/input/by-path/platform-ahb@80000000:vuhc-event
KEY=202
POLARITY=1
TARGET=host-ehci-owner-reset@udc2.service
EXTRA_ARGS=--continue
@@ -0,0 +1,37 @@
#!/bin/sh
if [ "$1" = "udc0" ]; then
function=$(cat /sys/class/udc/80401000.udc/function)
if [ "func-$function" != "func-" ]; then
echo "UDC0 owner is changed"
echo disconnect > /sys/class/udc/80401000.udc/soft_connect
sleep 3
echo connect > /sys/class/udc/80401000.udc/soft_connect
else
echo "UDC0 is not attached"
fi
else
if [ "$1" = "udc1" ]; then
function=$(cat /sys/class/udc/80402000.udc/function)
if [ "func-$function" != "func-" ]; then
echo "UDC1 owner is changed"
echo disconnect > /sys/class/udc/80402000.udc/soft_connect
sleep 3
echo connect > /sys/class/udc/80402000.udc/soft_connect
else
echo "UDC1 is not attached"
fi
else
if [ "$1" = "udc2" ]; then
function=$(cat /sys/class/udc/80403000.udc/function)
if [ "func-$function" != "func-" ]; then
echo "UDC2 owner is changed"
echo disconnect > /sys/class/udc/80403000.udc/soft_connect
sleep 3
echo connect > /sys/class/udc/80403000.udc/soft_connect
else
echo "UDC2 is not attached"
fi
fi
fi
fi
@@ -0,0 +1,2 @@
SNOOP_DEVICE = "postcode"
@@ -0,0 +1,214 @@
inherit image_version
unset do_get_version[noexec]
do_get_version[depends] = "os-release"
# do_get_version() is copied from meta-phosphor/classes/image_version.bbclass and
# modified to append the date and time to the version if a file named "developer"
# exists in the openbmc/build directory
def do_get_version(d):
import configparser
import io
path = d.getVar('STAGING_DIR_TARGET', True) + d.getVar('sysconfdir', True)
path = os.path.join(path, 'os-release')
parser = configparser.SafeConfigParser(strict=False)
parser.optionxform = str
version = ''
try:
with open(path, 'r') as fd:
buf = '[root]\n' + fd.read()
fd = io.StringIO(buf)
parser.readfp(fd)
version = parser['root']['VERSION_ID']
dev_path = d.getVar('PWD', True)
dev_path = os.path.join(dev_path, 'developer')
if os.path.isfile(dev_path):
version = version[:-1] + str(d.getVar('IMAGE_VERSION_SUFFIX', True)).strip()
except:
pass
return version
HPE_GXP_BOOTBLOCK_IMAGE ?= "gxp-bootblock.bin"
HPE_UBOOT_SIGNING_HEADER ?= "hpe-uboot-header.section"
HPE_UBOOT_SIGNING_HEADER_512 ?= "hpe-uboot-header-512.section"
HPE_UBOOT_SIGNING_KEY ?= "hpe-uboot-signing-key.pem"
# Offsets that are the same for the standard image and secure boot image
FLASH_SIZE = "31552"
FLASH_UBOOT_OFFSET = "0"
UBOOT_IMG_SIZE = "393216"
FLASH_KERNEL_OFFSET = "512"
FLASH_ROFS_OFFSET = "5376"
FLASH_RWFS_OFFSET = "29184"
# Standard image offsets
FLASH_STANDARD_SECTION_OFFSET = "31552"
FLASH_STANDARD_SECTION_END = "32768"
# Secure boot offsets
# offset at 0x01f7_0000 / 1024 = 32192
FLASH_SECTION_OFFSET = "32192"
# end is offset + 576
FLASH_SECTION_END = "32768"
# offset at 0x01ee_0000 / 1024 = 31616
FLASH_SECTION2_OFFSET = "31616"
FLASH_SECTION2_END = "32192"
# offset at 0x01c0_0000 / 1024 = 28672
FLASH_UBOOT2_OFFSET = "28672"
do_generate_static[depends] += " \
gxp-bootblock:do_deploy \
gxp-bootblock:do_populate_sysroot \
"
make_image_links:append() {
ln -sf ${DEPLOY_DIR_IMAGE}/hpe-section image-section
if [ -f ${DEPLOY_DIR_IMAGE}/hpe-section2 ]
then
ln -sf ${DEPLOY_DIR_IMAGE}/hpe-section2 image-section2
fi
}
do_mk_static_symlinks:append() {
ln -sf hpe-section image-section
if [ -f ${DEPLOY_DIR_IMAGE}/hpe-section2 ]
then
ln -sf hpe-section2 image-section2
fi
}
do_generate_static:prepend() {
bb.build.exec_func("do_generate_hpe_image", d)
}
do_generate_static:append() {
# hpe-section2 and u-boot2 only exist in the secure boot image.
# If hpe-section2 exists, then this is secure boot.
if os.path.exists(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), 'hpe-section2')):
_append_image(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), 'hpe-section'),
int(d.getVar('FLASH_SECTION_OFFSET', True)),
int(d.getVar('FLASH_SECTION_END', True)))
_append_image(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), 'hpe-section2'),
int(d.getVar('FLASH_SECTION2_OFFSET', True)),
int(d.getVar('FLASH_SECTION2_END', True)))
_append_image(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), 'u-boot.%s' % d.getVar('UBOOT_SUFFIX',True)),
int(d.getVar('FLASH_UBOOT2_OFFSET', True)),
int(d.getVar('FLASH_RWFS_OFFSET', True)))
else:
_append_image(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), 'hpe-section'),
int(d.getVar('FLASH_STANDARD_SECTION_OFFSET', True)),
int(d.getVar('FLASH_STANDARD_SECTION_END', True)))
}
# Generate the secure boot image by default
do_generate_hpe_image() {
# Extract uboot 256K
dd if=/dev/zero bs=1k count=256 > ${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX}
dd bs=1k conv=notrunc seek=0 count=256\
if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
of=${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX}
# TODO - replace this openssl signing command line with whatever command you need to create a
# digital signature of ${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX}
openssl sha384 -sign ${DEPLOY_DIR_IMAGE}/${HPE_UBOOT_SIGNING_KEY} -out ${DEPLOY_DIR_IMAGE}/gxp_tmp.sig \
${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX}
# Cat U-Boot header+signature
cat ${DEPLOY_DIR_IMAGE}/${HPE_UBOOT_SIGNING_HEADER_512} ${DEPLOY_DIR_IMAGE}/gxp_tmp.sig \
> ${DEPLOY_DIR_IMAGE}/gxp-uboot.sig
# Create hpe-section
dd if=/dev/zero bs=1k count=576 > ${DEPLOY_DIR_IMAGE}/hpe-section
# Add U-Boot Header and Signature to hpe-section
dd bs=1k conv=notrunc seek=0 \
if=${DEPLOY_DIR_IMAGE}/gxp-uboot.sig \
of=${DEPLOY_DIR_IMAGE}/hpe-section
# Add gxp-bootblock to hpe-section
dd bs=1k conv=notrunc seek=64 \
if=${DEPLOY_DIR_IMAGE}/${HPE_GXP_BOOTBLOCK_IMAGE} \
of=${DEPLOY_DIR_IMAGE}/hpe-section
# hpe-section2 is the same as hpe-section up to this point
cp ${DEPLOY_DIR_IMAGE}/hpe-section ${DEPLOY_DIR_IMAGE}/hpe-section2
# Expand uboot to 384K
dd if=/dev/zero bs=1k count=384 > ${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX}
dd bs=1k conv=notrunc seek=0 count=384 \
if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
of=${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX}
# Remove unnecessary files
rm ${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
${DEPLOY_DIR_IMAGE}/gxp_tmp.sig \
${DEPLOY_DIR_IMAGE}/gxp-uboot.sig
mv ${DEPLOY_DIR_IMAGE}/u-boot-tmp.${UBOOT_SUFFIX} ${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX}
# Check uboot image size equals to 384K
size="$(wc -c < "${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX}")"
if [ ${size} -ne ${UBOOT_IMG_SIZE} ]
then
echo "ERROR: STATIC - uBoot image size ${size} incorrect. Please try it again."
exit 1
fi
}
make_tar_of_images() {
type=$1
shift
extra_files="$@"
# Create the tar archive
tar -h -cvf ${IMGDEPLOYDIR}/${IMAGE_NAME}.$type.mtd.tar \
image-u-boot image-kernel image-rofs image-rwfs image-section* $extra_files
# Create the min tar archive
tar -h -cvf ${IMGDEPLOYDIR}/${IMAGE_NAME}.$type.mtd.min.tar \
image-kernel image-rofs image-rwfs MANIFEST \
image-kernel.sig image-rofs.sig image-rwfs.sig MANIFEST.sig publickey
cd ${IMGDEPLOYDIR}
ln -sf ${IMAGE_NAME}.$type.mtd.tar ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$type.mtd.tar
ln -sf ${IMAGE_NAME}.$type.mtd.min.tar ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$type.mtd.min.tar
}
do_generate_static_tar[depends] += " obmc-phosphor-image:do_generate_static"
do_generate_static_tar() {
ln -sf ${S}/MANIFEST MANIFEST
ln -sf ${S}/publickey publickey
make_image_links ${OVERLAY_BASETYPE} ${IMAGE_BASETYPE}
# Check uboot image size equals to 384K
size="$(wc -c < "image-u-boot")"
if [ ${size} != ${UBOOT_IMG_SIZE} ]
then
echo "ERROR: TAR - uBoot image size ${size} incorrect. Please try it again."
exit 1
fi
if [ -f image-section2 ]
then
make_signatures image-u-boot image-kernel image-rofs image-rwfs image-section image-section2 MANIFEST publickey
else
make_signatures image-u-boot image-kernel image-rofs image-rwfs image-section MANIFEST publickey
fi
make_tar_of_images static MANIFEST publickey ${signature_files}
# Maintain non-standard legacy link.
cd ${IMGDEPLOYDIR}
ln -sf ${IMAGE_NAME}.static.mtd.tar ${IMGDEPLOYDIR}/${MACHINE}-${DATETIME}.tar
ln -sf ${IMAGE_NAME}.static.mtd.min.tar ${IMGDEPLOYDIR}/${MACHINE}-${DATETIME}.min.tar
}
@@ -0,0 +1,462 @@
#!/bin/sh
fslist="proc sys dev run"
rodir=run/initramfs/ro
rwdir=run/initramfs/rw
upper=$rwdir/cow
work=$rwdir/work
cd /
for f in $fslist
do
mkdir -p "$f"
done
mount dev dev -tdevtmpfs
mount sys sys -tsysfs
mount proc proc -tproc
if ! grep run proc/mounts
then
mount tmpfs run -t tmpfs -o mode=755,nodev
fi
mkdir -p $rodir $rwdir
cp -rp init shutdown update whitelist bin sbin usr lib etc var run/initramfs
# To start a interactive shell with job control at this point, run
# getty 38400 ttyS4
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
m=${m%/name}
m=${m##*/}
echo "$m"
}
blkid_fs_type() {
# Emulate util-linux's `blkid -s TYPE -o value $1`
# Example busybox blkid output:
# # blkid /dev/mtdblock5
# /dev/mtdblock5: TYPE="squashfs"
# Process output to extract TYPE value "squashfs".
blkid "$1" | sed -e 's/^.*TYPE="//' -e 's/".*$//'
}
probe_fs_type() {
fst=$(blkid_fs_type "$1")
echo "${fst:=jffs2}"
}
# This fw_get_env_var is a possibly broken version of fw_printenv that
# does not check the crc or flag byte.
# The u-boot environment starts with a crc32, followed by a flag byte
# when a redundannt environment is configured, followed by var=value\0 sets.
# The flag byte for nand is a 1 byte counter; for nor it is a 1 or 0 byte.
get_fw_env_var() {
# do we have 1 or 2 copies of the environment?
# count non-blank non-comment lines
# copies=$(grep -v ^# /etc/fw_env.config | grep -c [::alnum::])
# ... we could if we had the fw_env.config in the initramfs
copies=2
# * Change \n to \r and \0 to \n
# * Skip to the 5th byte to skip over crc
# * then skip to the first or 2nd byte to skip over flag if it exists
# * stop parsing at first empty line corresponding to the
# double \0 at the end of the environment.
# * print the value of the variable name passed as argument
envdev=$(findmtd u-boot-env)
if test -n "$envdev"
then
tr '\n\000' '\r\n' < "/dev/$envdev" |
tail -c +5 | tail -c +${copies-1} |
sed -ne '/^$/,$d' -e "s/^$1=//p"
fi
}
setup_resolv() {
runresolv=/run/systemd/resolve/resolv.conf
etcresolv=/etc/resolv.conf
if test ! -e $etcresolv -a ! -L $etcresolv
then
mkdir -p ${runresolv%/*}
ln -s $runresolv $etcresolv
fi
if test ! -f $runresolv
then
cat /proc/net/pnp > $runresolv
fi
return 0
}
try_tftp() {
# split into tftp:// host:port/ path/on/remote
# then spilt off / and then :port from the end of host:port/
# and : from the beginning of port
rest="${1#tftp://}"
path=${rest#*/}
host=${rest%"$path"}
host="${host%/}"
port="${host#"${host%:*}"}"
host="${host%"$port"}"
port="${port#:}"
setup_resolv
if test -z "$host" -o -z "$path"
then
debug_takeover "Invalid tftp download url '$url'."
elif echo "Downloading '$url' from $host ..." &&
! tftp -g -r "$path" -l /run/image-rofs "$host" ${port+"$port"}
then
debug_takeover "Download of '$url' failed."
fi
}
try_wget() {
setup_resolv
echo "Downloading '$1' ..."
if ! wget -O /run/image-rofs "$1"
then
debug_takeover "Download of '$url' failed."
fi
}
getch() {
old=$(stty -g)
stty raw -echo min 0 time 50
printf '%s' "$(dd bs=1 count=1 2>/dev/null)"
stty "$old"
}
debug_takeover() {
echo "$@"
echo "Press (Y/y) to log in and try to manually fix, force recovery in 5 seconds"
answer=$(getch)
if [ "$answer" != "y" ] && [ "$answer" != "Y" ] ;
then
mkdir -p /var/lock
envdev=$(findmtd u-boot-env)
echo "/dev/${envdev} 0x00000 0x10000" > /etc/fw_env.config
echo "/dev/${envdev} 0x10000 0x10000" >> /etc/fw_env.config
fw_setenv force_recovery 1
fw_setenv last_booterrmsg "$@"
devmem 0xc0000000 32 0x01
fi
cat << HERE
After fixing run exit to continue this script, or reboot -f to retry, or
touch /takeover and exit to become PID 1 allowing editing of this script.
HERE
while ! sulogin && ! test -f /takeover
do
echo getty failed, retrying
done
# Touch /takeover in the above getty to become pid 1
if test -e /takeover
then
cat << HERE
Takeover of init requested. Executing /bin/sh as PID 1.
When finished exec new init or cleanup and run reboot -f.
Warning: No job control! Shell exit will panic the system!
HERE
export PS1=init#\
exec /bin/sh
fi
}
# Check System Maintenace Switch 7 and load factory default
check_dip() {
devmem 0x800000b8 16 0xFF
dip=$(devmem 0x800000b8 16)
value1=$((( dip & 0xFF00 ) >> 8 ))
value2=$((( dip & 0x0040 ) >> 6 ))
if [ $value1 -eq 0 ] && [ $value2 -eq 1 ]
then
echo "Detect System Maintenace Switch 7 on. Will load factory default"
return 0
fi
return 1
}
rofs=$(findmtd rofs)
rwfs=$(findmtd rwfs)
rodev=/dev/mtdblock${rofs#mtd}
rwdev=/dev/mtdblock${rwfs#mtd}
# Set to y for yes, anything else for no.
force_rwfst_jffs2=y
flash_images_before_init=n
consider_download_files=y
consider_download_tftp=y
consider_download_http=y
consider_download_ftp=y
rofst=squashfs
rwfst=$(probe_fs_type "$rwdev")
roopts=ro
rwopts=rw
image=/run/initramfs/image-
trigger=${image}rwfs
init=/sbin/init
fsckbase=/sbin/fsck.
fsck=$fsckbase$rwfst
fsckopts=-a
optfile=/run/initramfs/init-options
optbase=/run/initramfs/init-options-base
urlfile=/run/initramfs/init-download-url
update=/run/initramfs/update
if test -e /${optfile##*/}
then
cp /${optfile##*/} $optfile
fi
if test -e /${optbase##*/}
then
cp /${optbase##*/} $optbase
else
touch $optbase
fi
if test ! -f $optfile
then
cat /proc/cmdline $optbase > $optfile
get_fw_env_var openbmcinit >> $optfile
get_fw_env_var openbmconce >> $optfile
fi
echo "rofs = $rofs $rofst rwfs = $rwfs $rwfst"
if grep -w debug-init-sh $optfile
then
debug_takeover "Debug initial shell requested by command line."
fi
if test "$consider_download_files" = "y" &&
grep -w openbmc-init-download-files $optfile
then
if test -f ${urlfile##*/}
then
cp ${urlfile##*/} $urlfile
fi
if test ! -f $urlfile
then
get_fw_env_var openbmcinitdownloadurl > $urlfile
fi
url="$(cat $urlfile)"
rest="${url#*://}"
proto="${url%"$rest"}"
if test -z "$url"
then
echo "Download url empty. Ignoring download request."
elif test -z "$proto"
then
echo "Download failed."
elif test "$proto" = tftp://
then
if test "$consider_download_tftp" = "y"
then
try_tftp "$url"
else
echo "Download failed."
fi
elif test "$proto" = http://
then
if test "$consider_download_http" = "y"
then
try_wget "$url"
else
echo "Download failed."
fi
elif test "$proto" = ftp://
then
if test "$consider_download_ftp" = "y"
then
try_wget "$url"
else
echo "Download failed."
fi
else
echo "Download failed."
fi
fi
# If there are images in root move them to /run/initramfs/ or /run/ now.
imagebasename=${image##*/}
if test -n "${imagebasename}" && ls /"${imagebasename}"* > /dev/null 2>&1
then
if test "$flash_images_before_init" = "y"
then
echo "Flash images found, will update before starting init."
mv /"${imagebasename}"* ${image%"$imagebasename"}
else
echo "Flash images found, will use but deferring flash update."
mv /"${imagebasename}"* /run/
fi
fi
if grep -w clean-rwfs-filesystem $optfile
then
echo "Cleaning of read-write overlay filesystem requested."
touch $trigger
fi
if grep -w factory-reset $optfile || check_dip
then
echo "Factory reset requested."
touch $trigger
do_save=--no-save-files
else
do_save=--save-files
fi
if test "$force_rwfst_jffs2" = "y" -a "$rwfst" != jffs2 -a ! -f $trigger
then
echo "Converting read-write overlay filesystem to jffs2 forced."
touch $trigger
fi
if ls $image* > /dev/null 2>&1
then
if ! test -x $update
then
debug_takeover "Flash update requested but $update missing!"
elif test -f $trigger -a ! -s $trigger
then
if [ $do_save = "--save-files" ]
then
echo "Saving selected files from read-write overlay filesystem."
else
echo "No files will be selected for save."
fi
$update --no-restore-files $do_save
echo "Clearing read-write overlay filesystem."
flash_eraseall "/dev/$rwfs"
echo "Restoring saved files to read-write overlay filesystem."
touch $trigger
$update --no-save-files --clean-saved-files
else
$update --clean-saved-files $do_save
fi
rwfst=$(probe_fs_type "$rwdev")
fsck=$fsckbase$rwfst
fi
if grep -w overlay-filesystem-in-ram $optfile
then
rwfst=none
fi
copyfiles=
if grep -w copy-files-to-ram $optfile
then
rwfst=none
copyfiles=y
fi
# It would be nice to do this after fsck but that mean rofs is mounted
# which triggers the mtd is mounted check
if test "$rwfst$copyfiles" = noney
then
touch $trigger
$update --copy-files --clean-saved-files --no-restore-files
fi
if grep -w copy-base-filesystem-to-ram $optfile &&
test ! -e /run/image-rofs && ! cp "$rodev" /run/image-rofs
then
# Remove any partial copy to avoid attempted usage later
if test -e /run/image-rofs
then
ls -l /run/image-rofs
rm -f /run/image-rofs
fi
debug_takeover "Copying $rodev to /run/image-rofs failed."
fi
if test -s /run/image-rofs
then
rodev=/run/image-rofs
roopts=$roopts,loop
fi
mount "$rodev" $rodir -t $rofst -o $roopts
if test -x "$rodir$fsck"
then
for fs in $fslist
do
mount --bind "$fs" "$rodir/$fs"
done
chroot $rodir "$fsck" $fsckopts "$rwdev"
rc=$?
for fs in $fslist
do
umount "$rodir/$fs"
done
if test $rc -gt 1
then
debug_takeover "fsck of read-write fs on $rwdev failed (rc=$rc)"
fi
elif test "$rwfst" != jffs2 -a "$rwfst" != none
then
echo "No '$fsck' in read only fs, skipping fsck."
fi
if test "$rwfst" = none
then
echo "Running with read-write overlay in RAM for this boot."
echo "No state will be preserved unless flash update performed."
elif ! mount "$rwdev" $rwdir -t "$rwfst" -o $rwopts
then
msg="$(cat)" << HERE
Mounting read-write $rwdev filesystem failed. Please fix and run
mount $rwdev $rwdir -t $rwfst -o $rwopts
to to continue, or do change nothing to run from RAM for this boot.
HERE
debug_takeover "$msg"
fi
rm -rf $work
mkdir -p $upper $work
mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root
while ! chroot /root /bin/sh -c "test -x '$init' -a -s '$init'"
do
msg="$(cat)" << HERE
Unable to confirm /sbin/init is an executable non-empty file
in merged file system mounted at /root.
Change Root test failed! Invoking emergency shell.
HERE
debug_takeover "$msg"
done
for f in $fslist
do
mount --move "$f" "root/$f"
done
# switch_root /root $init
exec chroot /root $init
@@ -0,0 +1,12 @@
FILESEXTRAPATHS:prepend :="${THISDIR}/files:"
SRC_URI += "file://gxp-obmc-init.sh \
"
do_install:append() {
install -m 0755 ${WORKDIR}/gxp-obmc-init.sh ${D}/init
}
FILES:${PN} += " /init /shutdown /update /whitelist /dev "
FILES:${PN} += " /init-options /init-download-url "
@@ -0,0 +1 @@
KERNEL=="ipmi-kcs1", SYMLINK+="ipmi_kcs1"
@@ -0,0 +1,9 @@
KCS_DEVICE = "ipmi_kcs1"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://99-ipmi-kcs.rules"
do_install:append() {
install -d ${D}${base_libdir}/udev/rules.d
install -m 0644 ${WORKDIR}/99-ipmi-kcs.rules ${D}${base_libdir}/udev/rules.d/
}
@@ -0,0 +1,49 @@
SUMMARY = "OpenBMC for HPE - Applications"
PR = "r1"
inherit packagegroup
PROVIDES = "${PACKAGES}"
PACKAGES = " \
${PN}-chassis \
${PN}-fans \
${PN}-flash \
${PN}-system \
"
PROVIDES += "virtual/obmc-chassis-mgmt"
PROVIDES += "virtual/obmc-fan-mgmt"
PROVIDES += "virtual/obmc-flash-mgmt"
PROVIDES += "virtual/obmc-system-mgmt"
RPROVIDES:${PN}-chassis += "virtual-obmc-chassis-mgmt"
RPROVIDES:${PN}-fans += "virtual-obmc-fan-mgmt"
RPROVIDES:${PN}-flash += "virtual-obmc-flash-mgmt"
RPROVIDES:${PN}-system += "virtual-obmc-system-mgmt"
SUMMARY:${PN}-chassis = "HPE Chassis"
RDEPENDS:${PN}-chassis = " \
obmc-phosphor-buttons-signals \
obmc-phosphor-buttons-handler \
phosphor-skeleton-control-power \
obmc-host-failure-reboots \
"
SUMMARY:${PN}-fans = "HPE Fans"
RDEPENDS:${PN}-fans = " \
phosphor-pid-control \
"
SUMMARY:${PN}-flash = "HPE Flash"
RDEPENDS:${PN}-flash = " \
"
SUMMARY:${PN}-system = "HPE System"
RDEPENDS:${PN}-system = " \
bmcweb \
webui-vue \
phosphor-ipmi-ipmb \
dbus-sensors \
host-ehci-owner-reset \
host-boot-enable \
"
@@ -0,0 +1,10 @@
RDEPENDS:${PN}-logging += "phosphor-logging"
RDEPENDS:${PN}-extras += " bmcweb \
webui-vue \
phosphor-image-signing \
phosphor-pid-control \
"
RDEPENDS:${PN}-fan-control = " \
${VIRTUAL-RUNTIME_obmc-fan-control} \
"
@@ -0,0 +1,152 @@
#!/bin/sh
hid_conf_directory="/sys/kernel/config/usb_gadget/obmc_hid"
dev_name="80401000.udc"
create_hid() {
# create gadget
mkdir "${hid_conf_directory}"
cd "${hid_conf_directory}" || exit 1
# add basic information
echo 0x0100 > bcdDevice
echo 0x0200 > bcdUSB
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x1d6b > idVendor # Linux Foundation
# create English locale
mkdir strings/0x409
echo "OpenBMC" > strings/0x409/manufacturer
echo "virtual_input" > strings/0x409/product
echo "OBMC0001" > strings/0x409/serialnumber
# Create HID keyboard function
mkdir functions/hid.0
echo 1 > functions/hid.0/protocol # 1: keyboard
echo 8 > functions/hid.0/report_length
echo 1 > functions/hid.0/subclass
# Binary HID keyboard descriptor
# 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
# 0x09, 0x06, // USAGE (Keyboard)
# 0xa1, 0x01, // COLLECTION (Application)
# 0x05, 0x07, // USAGE_PAGE (Keyboard)
# 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
# 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x25, 0x01, // LOGICAL_MAXIMUM (1)
# 0x75, 0x01, // REPORT_SIZE (1)
# 0x95, 0x08, // REPORT_COUNT (8)
# 0x81, 0x02, // INPUT (Data,Var,Abs)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x75, 0x08, // REPORT_SIZE (8)
# 0x81, 0x03, // INPUT (Data,Var,Abs)
# 0x95, 0x05, // REPORT_COUNT (5)
# 0x75, 0x01, // REPORT_SIZE (1)
# 0x05, 0x08, // USAGE_PAGE (LEDs)
# 0x19, 0x01, // USAGE_MINIMUM (Num Lock)
# 0x29, 0x05, // USAGE_MAXIMUM (Kana)
# 0x91, 0x02, // OUTPUT (Data,Var,Abs)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x75, 0x03, // REPORT_SIZE (3)
# 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
# 0x95, 0x06, // REPORT_COUNT (6)
# 0x75, 0x08, // REPORT_SIZE (8)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x25, 0x65, // LOGICAL_MAXIMUM (101)
# 0x05, 0x07, // USAGE_PAGE (Keyboard)
# 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
# 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
# 0x81, 0x00, // INPUT (Data,Ary,Abs)
# 0xc0 // END_COLLECTION
printf '\x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0' > functions/hid.0/report_desc
# Create HID mouse function
mkdir functions/hid.1
echo 2 > functions/hid.1/protocol # 2: mouse
echo 6 > functions/hid.1/report_length
echo 1 > functions/hid.1/subclass
# Binary HID mouse descriptor (absolute coordinate)
# 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
# 0x09, 0x02, // USAGE (Mouse)
# 0xa1, 0x01, // COLLECTION (Application)
# 0x09, 0x01, // USAGE (Pointer)
# 0xa1, 0x00, // COLLECTION (Physical)
# 0x05, 0x09, // USAGE_PAGE (Button)
# 0x19, 0x01, // USAGE_MINIMUM (Button 1)
# 0x29, 0x03, // USAGE_MAXIMUM (Button 3)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x25, 0x01, // LOGICAL_MAXIMUM (1)
# 0x95, 0x03, // REPORT_COUNT (3)
# 0x75, 0x01, // REPORT_SIZE (1)
# 0x81, 0x02, // INPUT (Data,Var,Abs)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x75, 0x05, // REPORT_SIZE (5)
# 0x81, 0x03, // INPUT (Cnst,Var,Abs)
# 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
# 0x09, 0x30, // USAGE (X)
# 0x09, 0x31, // USAGE (Y)
# 0x35, 0x00, // PHYSICAL_MINIMUM (0)
# 0x46, 0xff, 0x7f, // PHYSICAL_MAXIMUM (32767)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x26, 0xff, 0x7f, // LOGICAL_MAXIMUM (32767)
# 0x65, 0x11, // UNIT (SI Lin:Distance)
# 0x55, 0x00, // UNIT_EXPONENT (0)
# 0x75, 0x10, // REPORT_SIZE (16)
# 0x95, 0x02, // REPORT_COUNT (2)
# 0x81, 0x02, // INPUT (Data,Var,Abs)
# 0x09, 0x38, // Usage (Wheel)
# 0x15, 0xff, // LOGICAL_MINIMUM (-1)
# 0x25, 0x01, // LOGICAL_MAXIMUM (1)
# 0x35, 0x00, // PHYSICAL_MINIMUM (-127)
# 0x45, 0x00, // PHYSICAL_MAXIMUM (127)
# 0x75, 0x08, // REPORT_SIZE (8)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x81, 0x06, // INPUT (Data,Var,Rel)
# 0xc0, // END_COLLECTION
# 0xc0 // END_COLLECTION
printf '\x05\x01\x09\x02\xa1\x01\x09\x01\xa1\x00\x05\x09\x19\x01\x29\x03\x15\x00\x25\x01\x95\x03\x75\x01\x81\x02\x95\x01\x75\x05\x81\x03\x05\x01\x09\x30\x09\x31\x35\x00\x46\xff\x7f\x15\x00\x26\xff\x7f\x65\x11\x55\x00\x75\x10\x95\x02\x81\x02\x09\x38\x15\xff\x25\x01\x35\x00\x45\x00\x75\x08\x95\x01\x81\x06\xc0\xc0' > functions/hid.1/report_desc
# Create configuration
mkdir configs/c.1
mkdir configs/c.1/strings/0x409
echo 0xe0 > configs/c.1/bmAttributes
echo 200 > configs/c.1/MaxPower
echo "" > configs/c.1/strings/0x409/configuration
# Link HID functions to configuration
ln -s functions/hid.0 configs/c.1
ln -s functions/hid.1 configs/c.1
}
connect_hid() {
if ! grep -q "${dev_name}" UDC; then
echo "${dev_name}" > UDC
fi
}
disconnect_hid() {
if grep -q "${dev_name}" UDC; then
echo "" > UDC
fi
}
if [ ! -e "${hid_conf_directory}" ]; then
create_hid
else
cd "${hid_conf_directory}" || exit 1
fi
if [ "$1" = "connect" ]; then
connect_hid
elif [ "$1" = "disconnect" ]; then
disconnect_hid
else
echo >&2 "Invalid option: $1. Use 'connect' or 'disconnect'."
exit 1
fi
@@ -0,0 +1,11 @@
[Unit]
Description=OpenBMC ipKVM daemon
ConditionPathIsMountPoint=/sys/kernel/config
[Service]
Restart=always
ExecStartPre=/usr/bin/create_usbhid.sh disconnect
ExecStart=/usr/bin/obmc-ikvm -v /dev/video0 -k /dev/hidg0 -p /dev/hidg1 -u 80401000.udc
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,13 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
SRC_URI += " file://start-ipkvm.service "
SRC_URI += " file://create_usbhid.sh "
FILES:${PN} += " \
${systemd_system_unitdir}/start-ipkvm.service \
${bindir}/create_usbhid.sh \
"
do_install:append () {
install -D -m 0755 ${WORKDIR}/start-ipkvm.service ${D}${systemd_system_unitdir}
install -D -m 0755 ${WORKDIR}/create_usbhid.sh ${D}${bindir}
}
+10
View File
@@ -0,0 +1,10 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "dl360poc-layer"
BBFILE_PATTERN_dl360poc-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_dl360poc-layer = "langdale mickledore"
@@ -0,0 +1,9 @@
KERNEL_DEVICETREE = "gxp.dtb"
UBOOT_MACHINE = "gxp_defconfig"
require conf/machine/include/gxp.inc
require conf/machine/include/obmc-bsp-common.inc
require conf/machine/include/hpe.inc
VIRTUAL-RUNTIME_obmc-fan-control ?= "phosphor-pid-control"
@@ -0,0 +1,17 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-phosphor \
##OEROOT##/meta-hpe/meta-gxp \
##OEROOT##/meta-hpe \
##OEROOT##/meta-hpe/meta-dl360poc \
"
@@ -0,0 +1,255 @@
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at local.conf.extended
# which contains other examples of configuration which can be placed in this file
# but new users likely won't need any of them initially.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
#
# Machine Selection
#
MACHINE ??= "dl360poc"
#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
#DL_DIR ?= "${TOPDIR}/downloads"
#
# Where to place shared-state files
#
# BitBake has the capability to accelerate builds based on previously built output.
# This is done using "shared state" files which can be thought of as cache objects
# and this option determines where those files are placed.
#
# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
# from these files if no changes were made to the configuration. If changes were made
# to the configuration, only shared state files where the state was still valid would
# be used (done using checksums).
#
# The default is a sstate-cache directory under TOPDIR.
#
#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
#
# Where to place the build output
#
# This option specifies where the bulk of the building work should be done and
# where BitBake should place its temporary files and output. Keep in mind that
# this includes the extraction and compilation of many applications and the toolchain
# which can use Gigabytes of hard disk space.
#
# The default is a tmp directory under TOPDIR.
#
#TMPDIR = "${TOPDIR}/tmp"
#
# Default policy config
#
# The distribution setting controls which policy settings are used as defaults.
# The default value is fine for general Yocto project use, at least initially.
# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
DISTRO ?= "openbmc-phosphor"
# As an example of a subclass there is a "bleeding" edge policy configuration
# where many versions are set to the absolute latest code from the upstream
# source control systems. This is just mentioned here as an example, its not
# useful to most new users.
# DISTRO ?= "poky-bleeding"
#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends
# can be enabled at once and the first item listed in the variable will be used
# to generate the root filesystems.
# Options are:
# - 'package_deb' for debian style deb files
# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to ipk:
PACKAGE_CLASSES ?= "package_ipk"
#
# SDK target architecture
#
# This variable specifies the architecture to build SDK items for and means
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host).
# Supported values are i686, x86_64, aarch64
#SDKMACHINE ?= "i686"
SANITY_TESTED_DISTROS:append ?= " *"
#
# Extra image configuration defaults
#
# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
# images. Some of these options are added to certain image types automatically. The
# variable can contain the following options:
# "dbg-pkgs" - add -dbg packages for all installed packages
# (adds symbol information for debugging/profiling)
# "src-pkgs" - add -src packages for all installed packages
# (adds source code for debugging)
# "dev-pkgs" - add -dev packages for all installed packages
# (useful if you want to develop against libs in the image)
# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
# (useful if you want to run the package test suites)
# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
# "tools-debug" - add debugging tools (gdb, strace)
# "eclipse-debug" - add Eclipse remote debugging support
# "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
# "debug-tweaks" - make an image suitable for development
# e.g. ssh root access has a blank password
# There are other application targets that can be used here too, see
# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
# We default to enabling the debugging tweaks.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
#
# Additional image features
#
# The following is a list of additional classes to use when building images which
# enable extra features. Some available options which can be included in this variable
# are:
# - 'buildstats' collect build statistics
USER_CLASSES ?= "buildstats"
#
# Runtime testing of images
#
# The build system can test booting virtual machine images under qemu (an emulator)
# after any root filesystems are created and run tests against those images. It can also
# run tests against any SDK that are built. To enable this uncomment these lines.
# See classes/test{image,sdk}.bbclass for further details.
#IMAGE_CLASSES += "testimage testsdk"
#TESTIMAGE_AUTO:qemuall = "1"
#
# Interactive shell configuration
#
# Under certain circumstances the system may need input from you and to do this it
# can launch an interactive shell. It needs to do this since the build is
# multithreaded and needs to be able to handle the case where more than one parallel
# process may require the user's attention. The default is iterate over the available
# terminal types to find one that works.
#
# Examples of the occasions this may happen are when resolving patches which cannot
# be applied, to use the devshell or the kernel menuconfig
#
# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
# Note: currently, Konsole support only works for KDE 3.x due to the way
# newer Konsole versions behave
#OE_TERMINAL = "auto"
# By default disable interactive patch resolution (tasks will just fail instead):
PATCHRESOLVE = "noop"
#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less than 100MB or 1K inodes, perform a hard abort
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
# It's necessary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
#
# Shared-state files from other locations
#
# As mentioned above, shared state files are prebuilt cache data objects which can be
# used to accelerate build time. This variable can be used to configure the system
# to search other mirror locations for these objects before it builds the data itself.
#
# This can be a filesystem directory, or a remote url such as http or ftp. These
# would contain the sstate-cache results from previous builds (possibly from other
# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
# cache locations to check for the shared objects.
# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
# at the end as shown in the examples below. This will be substituted with the
# correct path within the directory structure.
#SSTATE_MIRRORS ?= "\
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
#file://.* file:///some/local/dir/sstate/PATH"
#
# Yocto Project SState Mirror
#
# The Yocto Project has prebuilt artefacts available for its releases, you can enable
# use of these by uncommenting the following line. This will mean the build uses
# the network to check for artefacts at the start of builds, which does slow it down
# equally, it will also speed up the builds by not having to build things if they are
# present in the cache. It assumes you can download something faster than you can build it
# which will depend on your network.
#
#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH"
#
# Qemu configuration
#
# By default native qemu will build with a builtin VNC server where graphical output can be
# seen. The line below enables the SDL UI frontend too.
#PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
# By default libsdl2-native will be built, if you want to use your host's libSDL instead of
# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
#ASSUME_PROVIDED += "libsdl2-native"
# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
# a handy set of menus for controlling the emulator.
#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
#
# Hash Equivalence
#
# Enable support for automatically running a local hash equivalence server and
# instruct bitbake to use a hash equivalence aware signature generator. Hash
# equivalence improves reuse of sstate by detecting when a given sstate
# artifact can be reused as equivalent, even if the current task hash doesn't
# match the one that generated the artifact.
#
# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format
#
#BB_HASHSERVE = "auto"
#BB_SIGNATURE_HANDLER = "OEEquivHash"
#
# Memory Resident Bitbake
#
# Bitbake's server component can stay in memory after the UI for the current command
# has completed. This means subsequent commands can run faster since there is no need
# for bitbake to reload cache files and so on. Number is in seconds, after which the
# server will shut down.
#
#BB_SERVER_TIMEOUT = "60"
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "2"
@@ -0,0 +1 @@
inherit gxp-bootblock-n-poc
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
@@ -0,0 +1,39 @@
#!/bin/sh
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
m=${m%/name}
m=${m##*/}
echo "$m"
}
set -- host-prime host-second vrom-prime vrom-second
for f in "$@"
do
image=$(findmtd "${f}")
if test -z "$image"
then
echo "Unable to find mtd partition for ${f}"
exit 1
fi
done
#enable vrom
# host-prime to vrom-prime
dd if="/dev/$(findmtd host-prime)" of="/dev/$(findmtd vrom-prime)"
# host-second to vrom-second
dd if="/dev/$(findmtd host-second)" of="/dev/$(findmtd vrom-second)"
echo 0x1800008a > /sys/class/soc/srom/vromoff
while true
do
devmem 0x8000005C 8 0
devmem 0xd1000306 8 5
devmem 0xd1000318 8 0x03
devmem 0xd100030f 8 0x04
sleep 1
done
@@ -0,0 +1,709 @@
/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
compatible = "HPE,GXP";
model = "GXP";
chosen {
bootargs = "earlyprintk console=ttyS0,115200 user_debug=31";
};
aliases {
ethernet0 = &umac0;
ethernet1 = &umac1;
};
memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x20000000>;
};
ahb@80000000 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
vic0: vic@ceff0000 {
compatible = "arm,pl192-vic";
interrupt-controller;
reg = <0xceff0000 0x1000>;
#interrupt-cells = <1>;
};
vic1: vic@80f00000 {
compatible = "arm,pl192-vic";
interrupt-controller;
reg = <0x80f00000 0x1000>;
#interrupt-cells = <1>;
};
timer0: timer@c0000080 {
compatible = "hpe,gxp-timer";
reg = <0xc0000080 0x1>, <0xc0000094 0x01>, <0xc0000088 0x08>;
interrupts = <0>;
interrupt-parent = <&vic0>;
clock-frequency = <400000000>;
};
watchdog: watchdog@c0000090 {
compatible = "hpe,gxp-wdt";
reg = <0xc0000090 0x02>, <0xc0000096 0x01>;
};
uartc: serial@c00000f0 {
compatible = "ns16550a";
reg = <0xc00000f0 0x8>;
interrupts = <19>;
interrupt-parent = <&vic0>;
clock-frequency = <1846153>;
reg-shift = <0>;
};
uarta: serial@c00000e0 {
compatible = "ns16550a";
reg = <0xc00000e0 0x8>;
interrupts = <17>;
interrupt-parent = <&vic0>;
clock-frequency = <1846153>;
reg-shift = <0>;
};
uartb: serial@c00000e8 {
compatible = "ns16550a";
reg = <0xc00000e8 0x8>;
interrupts = <18>;
interrupt-parent = <&vic0>;
clock-frequency = <1846153>;
reg-shift = <0>;
};
vuart_a_cfg: vuarta_cfg@80fc0230 {
compatible = "hpe,gxp-vuarta_cfg", "simple-mfd", "syscon";
reg = <0x80fc0230 0x100>;
reg-io-width = <1>;
};
vuart_a: vuart_a@80fd0200 {
compatible = "hpe,gxp-vuart";
reg = <0x80fd0200 0x100>;
interrupts = <2>;
interrupt-parent = <&vic1>;
clock-frequency = <1846153>;
reg-shift = <0>;
status = "okay";
serial-line = <3>;
vuart_cfg = <&vuart_a_cfg>;
};
usb0: ehci@cefe0000 {
compatible = "generic-ehci";
reg = <0xcefe0000 0x100>;
interrupts = <7>;
interrupt-parent = <&vic0>;
};
usb1: ohci@cefe0100 {
compatible = "generic-ohci";
reg = <0xcefe0100 0x110>;
interrupts = <6>;
interrupt-parent = <&vic0>;
};
spifi0: spifi@c0000200 {
compatible = "hpe,gxp-spifi";
reg = <0xc0000200 0x80>, <0xc000c000 0x100>, <0xf8000000 0x8000000>;
interrupts = <20>;
interrupt-parent = <&vic0>;
#address-cells = <1>;
#size-cells = <0>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
bmc@0 {
label = "bmc";
reg = <0x0 0x2000000>;
};
u-boot@0 {
label = "u-boot";
reg = <0x0 0x60000>;
};
u-boot-env@60000 {
label = "u-boot-env";
reg = <0x60000 0x20000>;
};
kernel@80000 {
label = "kernel";
reg = <0x80000 0x4c0000>;
};
rofs@540000 {
label = "rofs";
reg = <0x540000 0x1740000>;
};
rwfs@1c80000 {
label = "rwfs";
reg = <0x1c80000 0x250000>;
};
section@1edf000{
label = "section";
reg = <0x1ed0000 0x130000>;
};
};
};
flash@1 {
compatible = "jedec,spi-nor";
reg = <1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
host-prime@0 {
label = "host-prime";
reg = <0x0 0x02000000>;
};
host-second@0 {
label = "host-second";
reg = <0x02000000 0x02000000>;
};
};
};
};
sram@d0000000 {
compatible = "mtd-ram";
reg = <0xd0000000 0x80000>;
bank-width = <1>;
erase-size =<1>;
partition@0 {
label = "host-reserved";
reg = <0x0 0x10000>;
};
partition@10000 {
label = "nvram";
reg = <0x10000 0x70000>;
};
};
srom@80fc0000 {
compatible = "hpe,gxp-srom", "simple-mfd", "syscon";
reg = <0x80fc0000 0x100>;
};
vrom@58000000 {
compatible = "mtd-ram";
bank-width = <4>;
reg = <0x58000000 0x4000000>;
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "vrom-prime";
reg = <0x0 0x2000000>;
};
partition@2000000 {
label = "vrom-second";
reg = <0x2000000 0x2000000>;
};
};
i2cg: i2cg@c00000f8 {
compatible = "syscon";
reg = <0xc00000f8 0x08>;
};
i2c0: i2c@c0002000 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002000 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c1: i2c@c0002100 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002100 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c2: i2c@c0002200 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002200 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
24c02@50 {
compatible = "atmel,24c02";
pagesize = <8>;
reg = <0x50>;
};
};
i2c3: i2c@c0002300 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002300 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c4: i2c@c0002400 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002400 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c5: i2c@c0002500 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002500 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
};
i2c6: i2c@c0002600 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002600 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c7: i2c@c0002700 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002700 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
psu1: psu@58 {
compatible = "hpe,gxp-psu";
reg = <0x58>;
};
psu2: psu@59 {
compatible = "hpe,gxp-psu";
reg = <0x59>;
};
};
i2c8: i2c@c0002800 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002800 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c9: i2c@c0002900 {
compatible = "hpe,gxp-i2c";
reg = <0xc0002900 0x70>;
interrupts = <9>;
interrupt-parent = <&vic0>;
i2cg-handle = <&i2cg>;
#address-cells = <1>;
#size-cells = <0>;
};
i2cmux@4 {
compatible = "i2c-mux-reg";
i2c-parent = <&i2c4>;
reg = <0xd1000374 1>;
#address-cells = <1>;
#size-cells = <0>;
i2c4@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c4@3 {
reg = <3>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c4@4 {
reg = <4>;
#address-cells = <1>;
#size-cells = <0>;
};
};
i2cmux@6 {
compatible = "i2c-mux-reg";
i2c-parent = <&i2c6>;
reg = <0xd1000376 1>;
#address-cells = <1>;
#size-cells = <0>;
i2c6@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c6@2 {
reg = <2>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c6@3 {
reg = <3>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c6@4 {
reg = <4>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c6@5 {
reg = <5>;
#address-cells = <1>;
#size-cells = <0>;
};
};
mdio0: mdio@c0004080 {
compatible = "hpe,gxp-umac-mdio";
reg = <0xc0004080 0x10>;
#address-cells = <1>;
#size-cells = <0>;
ext_phy0: ethernt-phy@0 {
compatible = "marvell,88e1415","ethernet-phy-ieee802.3-c22";
phy-mode = "sgmii";
reg = <0>;
};
};
mdio1: mdio@c0005080 {
compatible = "hpe,gxp-umac-mdio";
reg = <0xc0005080 0x10>;
#address-cells = <1>;
#size-cells = <0>;
int_phy0: ethernt-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
phy-mode = "gmii";
reg = <0>;
};
int_phy1: ethernt-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
phy-mode = "gmii";
reg = <1>;
};
};
umac0: umac@c0004000 {
compatible = "hpe, gxp-umac";
reg = <0xc0004000 0x80>;
interrupts = <10>;
interrupt-parent = <&vic0>;
mac-address = [94 18 82 16 04 d8];
phy-handle = <&ext_phy0>;
int-phy-handle = <&int_phy0>;
};
umac1: umac@c0005000 {
compatible = "hpe, gxp-umac";
use-ncsi;
reg = <0xc0005000 0x80>;
interrupts = <11>;
interrupt-parent = <&vic0>;
mac-address = [94 18 82 16 04 d9];
phy-handle = <&int_phy1>;
};
kcs_conf: kcs_conf@80fc0430 {
compatible = "hpe,gxp-kcs-bmc-cfg", "simple-mfd", "syscon";
reg = <0x80fc0430 0x100>;
};
kcs_reg: kcs_reg@080fd0400 {
compatible = "hpe,gxp-kcs-bmc";
reg = <0x80fd0400 0x8>;
interrupts = <6>;
interrupt-parent = <&vic1>;
kcs_chan = <1>;
status = "okay";
kcs-bmc-cfg = <&kcs_conf>;
};
thumbnail: thumbnail@c0000500 {
compatible = "hpe,gxp-video-thumbnail";
reg = <0xc0000500 0x20>;
bits-per-pixel = <32>;
width = <1024>;
height = <768>;
};
xreg: xreg@d1000300 {
compatible = "hpe,gxp-xreg", "simple-mfd", "syscon";
reg = <0xd1000300 0xFF>;
interrupts = <26>;
interrupt-parent = <&vic0>;
#gpio-cells = <2>;
gpio-line-names =
"", "", "", "", "", "", "POWER", "HEARTBEAT", "FAN1_INST", "FAN2_INST",
"FAN3_INST", "FAN4_INST", "FAN5_INST", "FAN6_INST", "FAN7_INST", "FAN8_INST", "FAN9_INST", "FAN10_INST", "FAN11_INST", "FAN12_INST",
"FAN13_INST", "FAN14_INST", "FAN15_INST", "FAN16_INST", "FAN1_FAIL", "FAN2_FAIL", "FAN3_FAIL", "FAN4_FAIL", "FAN5_FAIL", "FAN6_FAIL",
"FAN7_FAIL", "FAN8_FAIL", "FAN9_FAIL", "FAN10_FAIL", "FAN11_FAIL", "FAN12_FAIL", "FAN13_FAIL", "FAN14_FAIL", "FAN15_FAIL", "FAN16_FAIL",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "IDENTIFY", "HEALTH_RED", "HEALTH_AMBER", "POWER_BUTTON",
"", "SIO_POWER_GOOD", "NMI_BUTTON", "RESET_BUTTON", "SIO_S5", "SIO_ONCONTROL", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "";
};
fanctrl: fanctrl@c1000c00 {
compatible = "hpe,gxp-fan-ctrl";
reg = <0xc1000c00 0x200>;
xreg_handle = <&xreg>;
fn2_handle = <&fn2>;
};
fn2: fn2@80200000 {
compatible = "hpe,gxp-fn2", "simple-mfd", "syscon";
reg = <0x80200000 0x100000>;
xreg_handle = <&xreg>;
interrupts = <0>;
interrupt-parent = <&vic1>;
#gpio-cells = <2>;
gpio-line-names =
"POWER_OUT", "PS_PWROK", "PCIERST", "POST_COMPLETE", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "";
chif {
compatible = "hpe,gxp-chif";
interrupts = <12>;
};
};
csm: csm@80000000 {
compatible = "hpe,gxp-csm", "simple-mfd", "syscon";
reg = <0x80000000 0x400>;
};
gpio: gpio@0 {
compatible = "hpe,gxp-gpio";
#gpio-cells = <2>;
csm_handle = <&csm>;
vuhc0_handle = <&vuhc0>;
gpio-line-names =
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "RESET_OUT", "NMI_OUT", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "";
};
leds: leds {
compatible = "gpio-leds";
power {
gpios = <&xreg 6 0>;
default-state = "off";
};
heartbeat {
gpios = <&xreg 7 0>;
default-state = "off";
};
identify {
gpios = <&xreg 56 0>;
default-state = "off";
};
health_red {
gpios = <&xreg 57 0>;
default-state = "off";
};
health_amber {
gpios = <&xreg 58 0>;
default-state = "off";
};
};
xreg_kyes: xreg_keys {
compatible = "gpio-keys-polled";
poll-interval = <100>;
IdButton {
label = "ID Button";
linux,code = <200>;
gpios = <&xreg 60 1>;
};
};
vuhc: vuhc {
compatible = "gpio-keys-polled";
poll-interval = <100>;
PortOwner@0 {
label = "Port Owner";
linux,code = <200>;
gpios = <&gpio 250 1>;
};
PortOwner@1 {
label = "Port Owner";
linux,code = <201>;
gpios = <&gpio 251 1>;
};
PortOwner@2 {
label = "Port Owner";
linux,code = <202>;
gpios = <&gpio 252 1>;
};
};
vuhc0: vuhc@80400080 {
compatible = "syscon";
reg = <0x80400000 0x80>;
};
udcg: udcg@80400800 {
compatible = "syscon";
reg = <0x80400800 0x200>;
};
udc0: udc@80401000 {
compatible = "hpe, gxp-udc";
reg = <0x80401000 0x1000>;
interrupts = <13>;
interrupt-parent = <&vic1>;
vdevnum = <0>;
fepnum = <4>;
udcg-handle = <&udcg>;
};
udc1: udc@80402000 {
compatible = "hpe, gxp-udc";
reg = <0x80402000 0x1000>;
interrupts = <13>;
interrupt-parent = <&vic1>;
vdevnum = <1>;
fepnum = <4>;
udcg-handle = <&udcg>;
};
udc2: udc@80403000 {
compatible = "hpe, gxp-udc";
reg = <0x80403000 0x1000>;
interrupts = <13>;
interrupt-parent = <&vic1>;
vdevnum = <2>;
fepnum = <4>;
udcg-handle = <&udcg>;
};
coretemp: coretemp@c0000130 {
compatible = "hpe,gxp-coretemp";
reg = <0xc0000130 0x8>;
};
syspower: syspower {
compatible = "hpe,gxp-power";
psu_phandle = <&psu1>, <&psu2>;
};
peci: peci@80000400 {
compatible = "hpe,gxp-peci";
reg = <0x80000400 0x200>;
interrupts = <22>;
interrupt-parent = <&vic1>;
};
};
clocks {
osc: osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-output-names = "osc";
clock-frequency = <33333333>;
};
iopclk: iopclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clocks = <&osc>;
clock-out-put-names = "iopclk";
clock-frequency = <400000000>;
};
memclk: memclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clocks = <&osc>;
clock-out-put-names = "memclk";
clock-frequency = <800000000>;
};
};
};
@@ -0,0 +1,15 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/linux-obmc:"
SRC_URI += "file://gxp.dts \
"
do_patch:append() {
for DTB in "${KERNEL_DEVICETREE}"; do
DT=`basename ${DTB} .dtb`
if [ -r "${WORKDIR}/${DT}.dts" ]; then
cp ${WORKDIR}/${DT}.dts \
${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts
fi
done
}
@@ -0,0 +1,21 @@
do_generate_hpe_image() {
# Add gxp-bootblock to hpe-section
dd bs=1k conv=notrunc seek=64 \
if=${DEPLOY_DIR_IMAGE}/${HPE_GXP_BOOTBLOCK_IMAGE} \
of=${DEPLOY_DIR_IMAGE}/hpe-section
}
do_generate_static_tar() {
ln -sf ${S}/MANIFEST MANIFEST
ln -sf ${S}/publickey publickey
make_image_links ${OVERLAY_BASETYPE} ${IMAGE_BASETYPE}
make_signatures image-u-boot image-kernel image-rofs image-rwfs image-section MANIFEST publickey
make_tar_of_images static MANIFEST publickey ${signature_files}
# Maintain non-standard legacy link.
cd ${IMGDEPLOYDIR}
ln -sf ${IMAGE_NAME}.static.mtd.tar ${IMGDEPLOYDIR}/${MACHINE}-${DATETIME}.tar
}
@@ -0,0 +1,13 @@
BBRANCH = "master"
SRC_URI = "git://github.com/HewlettPackard/gxp-bootblock.git;branch=${BBRANCH};protocol=https"
SRCREV = "bab416f8ca8c8465d308cfeb7f8d5abc21ba343b"
S = "${WORKDIR}/git"
inherit deploy
do_deploy () {
install -d ${DEPLOYDIR}
install -m 644 gxp-bootblock.bin ${DEPLOYDIR}/gxp-bootblock.bin
}
@@ -0,0 +1,20 @@
# TODO: Manually copy the U-Boot signing key and customer-key-block here:
HPE_GXP_KEY_FILES_DIR = "${COREBASE}/meta-hpe/meta-gxp/recipes-bsp/image/files"
inherit deploy
do_deploy () {
install -d ${DEPLOYDIR}
# Copy in the bootblock
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/gxp-bootblock.bin ${DEPLOYDIR}/gxp-bootblock.bin
# Copy in files from the files subdirectory
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/header.sig ${DEPLOYDIR}/hpe-uboot-header.section
# Copy in the U-Boot signing key
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/private_key.pem ${DEPLOYDIR}/hpe-uboot-signing-key.pem
# Copy in the customer keyblock
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/customer-key-block ${DEPLOYDIR}/customer-key-block
}
@@ -0,0 +1,5 @@
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
addtask deploy before do_build after do_compile
@@ -0,0 +1,19 @@
# TODO: Manually copy the U-Boot signing key here:
HPE_GXP_KEY_FILES_DIR = "${COREBASE}/meta-hpe/meta-gxp/recipes-bsp/image/files"
inherit deploy
do_deploy () {
install -d ${DEPLOYDIR}
# Copy in the bootblock
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/gxp2-bootblock.bin ${DEPLOYDIR}/gxp-bootblock.bin
# Copy in files from the files subdirectory
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/header.sig ${DEPLOYDIR}/hpe-uboot-header.section
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/header-512.sig ${DEPLOYDIR}/hpe-uboot-header-512.section
# Copy in the U-Boot signing key
install -m 644 ${HPE_GXP_KEY_FILES_DIR}/customer_private_key.pem ${DEPLOYDIR}/hpe-uboot-signing-key.pem
}
+12
View File
@@ -0,0 +1,12 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "gxp-layer"
BBFILE_PATTERN_gxp-layer = "^${LAYERDIR}/"
LAYERVERSION_gxp-layer = "1"
LAYERSERIES_COMPAT_gxp-layer = "langdale mickledore"
GXPBASE = '${@os.path.normpath("${LAYERDIR}/")}'
@@ -0,0 +1,14 @@
inherit uboot-sign
UBOOT_SIGN_ENABLE = "0"
UBOOT_SIGN_KEYDIR = "${COREBASE}/meta-hpe/meta-gxp/recipes-bsp/u-boot/u-boot-gxp/"
UBOOT_SIGN_KEYNAME = "dev"
FIT_HASH_ALG = "sha512"
UBOOT_FIT_HASH_ALG = "sha512"
concat_dtb_helper:append() {
if [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "$deployed_uboot_dtb_binary" ]; then
cd ${DEPLOYDIR}
cat ${UBOOT_NODTB_IMAGE} $deployed_uboot_dtb_binary | tee ${B}/${UBOOT_BINARY} > ${UBOOT_IMAGE}
fi
}
@@ -0,0 +1,22 @@
#@TYPE: Machine
#@NAME: HPE GXP
#@DESCRIPTION: Common machine configuration for the HPE GXP Chip
require conf/machine/include/hpe_soc.inc
UBOOT_ARCH ?= "arm"
DISTRO_FEATURES ?= "ipv4 ipv6"
SOC_FAMILY = "gxp-b1"
include conf/machine/include/soc-family.inc
MACHINEOVERRIDES .= ":gxp"
DEFAULTTUNE ?= "armv6-novfp"
require conf/machine/include/arm/arch-armv6.inc
UBOOT_MACHINE ?= "gxp_defconfig"
UBOOT_ENTRYPOINT ?= "0x40100000"
UBOOT_LOADADDRESS ?= "0x40100000"
@@ -0,0 +1,6 @@
PREFERRED_PROVIDER_virtual/kernel ?= "linux-obmc"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-gxp"
PREFERRED_PROVIDER_u-boot ?= "u-boot-gxp"
PREFERRED_PROVIDER_u-boot-fw-utils ?= "u-boot-fw-utils-gxp"
Binary file not shown.
@@ -0,0 +1 @@
inherit gxp-bootblock
@@ -0,0 +1,16 @@
HOMEPAGE = "https://github.com/HewlettPackard/gxp-uboot"
DEPENDS += "flex-native bison-native bc-native"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"
PE = "1"
# We use the revision in order to avoid having to fetch it from the
# repo during parse
SRCREV = "7e035b9bf331426919aa993a6bb1de3c837e5d3c"
UBRANCH = "v2020.10-gxp-openbmc"
SRC_URI = "git://github.com/HewlettPackard/gxp-uboot.git;branch=${UBRANCH};protocol=https"
S = "${WORKDIR}/git"
PV = "v2020.10+git${SRCPV}"
@@ -0,0 +1,25 @@
# Configuration file for fw_(printenv/setenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
# Furthermore, if the Flash sector size is omitted, this value is assumed to
# be the same as the Environment size, which is valid for NOR and SPI-dataflash
# NOR example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd1 0x0000 0x20000 0x20000
#/dev/mtd2 0x0000 0x4000 0x4000
# MTD SPI-dataflash example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd2 0x00000 0x20000
/dev/mtd/alt-u-boot-env 0x00000 0x10000
/dev/mtd/alt-u-boot-env 0x10000 0x10000
#/dev/mtd5 0x4200 0x4200
#/dev/mtd6 0x4200 0x4200
# NAND example
#/dev/mtd0 0x4000 0x4000 0x20000 2
# Block device example
#/dev/mmcblk0 0xc0000 0x20000
@@ -0,0 +1,25 @@
# Configuration file for fw_(printenv/setenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
# Furthermore, if the Flash sector size is omitted, this value is assumed to
# be the same as the Environment size, which is valid for NOR and SPI-dataflash
# NOR example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd1 0x0000 0x20000 0x20000
#/dev/mtd2 0x0000 0x4000 0x4000
# MTD SPI-dataflash example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd2 0x00000 0x20000
/dev/mtd/u-boot-env 0x00000 0x10000
/dev/mtd/u-boot-env 0x10000 0x10000
#/dev/mtd5 0x4200 0x4200
#/dev/mtd6 0x4200 0x4200
# NAND example
#/dev/mtd0 0x4000 0x4000 0x20000 2
# Block device example
#/dev/mmcblk0 0xc0000 0x20000
@@ -0,0 +1,43 @@
require u-boot-common-gxp_2020.10.inc
SRC_URI += "file://fw_env.config"
SRC_URI += "file://alt_fw_env.config"
SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
DEPENDS += "mtd-utils"
PROVIDES += "u-boot-fw-utils"
INSANE_SKIP:${PN} = "already-stripped"
EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
EXTRA_OEMAKE:class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
inherit uboot-config
do_compile () {
oe_runmake ${UBOOT_MACHINE}
oe_runmake envtools
}
do_install () {
install -d ${D}${base_sbindir}
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
install -d ${D}${sysconfdir}
install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
install -m 644 ${WORKDIR}/alt_fw_env.config ${D}${sysconfdir}/alt_fw_env.config
}
do_install:class-cross () {
install -d ${D}${bindir_cross}
install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv
}
SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
PACKAGE_ARCH = "${MACHINE_ARCH}"
BBCLASSEXTEND = "cross"
RDEPENDS:${PN} = "udev-gxp-mtd-partitions"
@@ -0,0 +1,8 @@
require recipes-bsp/u-boot/u-boot-common.inc
require recipes-bsp/u-boot/u-boot.inc
require u-boot-common-gxp_2020.10.inc
require conf/machine/include/fitimage-sign.inc
S = "${WORKDIR}/git"
PROVIDES += "u-boot"
@@ -0,0 +1,69 @@
#!/bin/sh
if [ $# -ne 2 ]
then
echo "usage: $0 <start|stop> <config>" >&2
exit 1
fi
action=$1
config=$2
gadget_name=mass-storage
gadget_dir=/sys/kernel/config/usb_gadget/$gadget_name
case "$config" in
0)
nbd_device=/dev/nbd0
;;
*)
echo "invalid config $config" >&2
exit 1
;;
esac
set -ex
case "$action" in
start)
mkdir -p $gadget_dir
(
cd $gadget_dir
# http://www.linux-usb.org/usb.ids
# |-> 1d6b Linux Foundation
# |-> 0104 Multifunction Composite Gadget
echo "0x1d6b" > idVendor
echo "0x0104" > idProduct
mkdir -p strings/0x409
echo "OpenBMC" > strings/0x409/manufacturer
echo "Virtual Media Device" > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo "config 1" > configs/c.1/strings/0x409/configuration
mkdir -p functions/mass_storage.usb0
ln -s functions/mass_storage.usb0 configs/c.1
echo 1 > functions/mass_storage.usb0/lun.0/removable
echo 1 > functions/mass_storage.usb0/lun.0/ro
echo 0 > functions/mass_storage.usb0/lun.0/cdrom
echo $nbd_device > functions/mass_storage.usb0/lun.0/file
echo "80402000.udc" > UDC
)
;;
stop)
(
cd $gadget_dir
echo "" > UDC
rm configs/c.1/mass_storage.usb0
rmdir functions/mass_storage.usb0
rmdir configs/c.1/strings/0x409
rmdir configs/c.1
rmdir strings/0x409
)
rmdir $gadget_dir
;;
*)
echo "invalid action $action" >&2
exit 1
esac
exit 0
@@ -0,0 +1,9 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
FILES:${PN} += "${sysconfdir}/nbd-proxy/state"
SRC_URI += "file://state_hook"
do_install:append() {
install -d ${D}${sysconfdir}/nbd-proxy/
install -m 0755 ${WORKDIR}/state_hook ${D}${sysconfdir}/nbd-proxy/state
}
@@ -0,0 +1 @@
CONFIG_FEATURE_FANCY_HEAD=y
@@ -0,0 +1,2 @@
SRC_URI += "file://FEATURE_FANCY_HEAD.cfg"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
@@ -0,0 +1,15 @@
SUMMARY = "udev rules for MTD partitions"
DESCRIPTION = "udev rules for MTD partitions"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
S = "${WORKDIR}"
SRC_URI += "file://76-gxp-mtd-partitions.rules"
RDEPENDS:${PN} += "udev"
do_install() {
install -d ${D}/${nonarch_base_libdir}/udev/rules.d
install -m 0644 ${WORKDIR}/76-gxp-mtd-partitions.rules ${D}/${nonarch_base_libdir}/udev/rules.d
}
@@ -0,0 +1 @@
ENV{DEVTYPE}=="mtd", SYMLINK+="mtd/%s{name}"
@@ -0,0 +1,25 @@
DESCRIPTION = "Linux kernel for GXP"
SECTION = "kernel"
LICENSE = "GPL-2.0-only"
PROVIDES += "virtual/kernel"
KCONFIG_MODE="--alldefconfig"
KSRC ?= "git://github.com/HewlettPackard/gxp-linux.git;branch=${KBRANCH};protocol=https"
SRC_URI = "${KSRC}"
SRC_URI += " file://defconfig"
FILESEXTRAPATHS:prepend_linux-obmc := "${THISDIR}/linux-obmc:"
LINUX_VERSION_EXTENSION ?= "-${SRCREV}"
PV = "${LINUX_VERSION}+git${SRCPV}"
inherit kernel
require recipes-kernel/linux/linux-yocto.inc
# From 4.16+ the COPYING file changed
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
KERNEL_FEATURES:remove = "phosphor-gpio-keys"
@@ -0,0 +1,287 @@
CONFIG_KERNEL_XZ=y
CONFIG_DEFAULT_HOSTNAME="gxp"
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_KALLSYMS_ALL=y
CONFIG_BPF_SYSCALL=y
CONFIG_EMBEDDED=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
CONFIG_ARCH_MULTI_V6=y
CONFIG_ARCH_HPE=y
CONFIG_ARCH_HPE_GXP=y
CONFIG_SECCOMP=y
# CONFIG_ATAGS is not set
# CONFIG_SUSPEND is not set
CONFIG_ARM_CRYPTO=y
CONFIG_CRYPTO_SHA1_ARM=y
CONFIG_CRYPTO_SHA256_ARM=y
CONFIG_CRYPTO_SHA512_ARM=y
CONFIG_CRYPTO_AES_ARM=y
CONFIG_CRYPTO_CHACHA20_NEON=y
CONFIG_CRYPTO_POLY1305_ARM=y
CONFIG_JUMP_LABEL=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_KSM=y
CONFIG_CLEANCACHE=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_UNIX=y
CONFIG_UNIX_DIAG=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_STATISTICS=y
CONFIG_INET=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
# CONFIG_IPV6_SIT is not set
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_BPFILTER=y
CONFIG_VLAN_8021Q=y
CONFIG_NETLINK_DIAG=y
CONFIG_NET_NCSI=y
# CONFIG_WIRELESS is not set
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_PLATRAM=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SPI_GXP_SPIFI=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_AURORA is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_GXP_UMAC=y
# CONFIG_USB_NET_DRIVERS is not set
# CONFIG_WLAN is not set
# CONFIG_INPUT_LEDS is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=6
CONFIG_SERIAL_8250_RUNTIME_UARTS=6
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_GXP_VUART=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_TTY_PRINTK=y
CONFIG_IPMI_HANDLER=y
CONFIG_IPMI_DEVICE_INTERFACE=y
CONFIG_IPMI_SI=y
CONFIG_IPMI_SSIF=y
CONFIG_HPE_KCS_IPMI_BMC=y
CONFIG_IPMB_DEVICE_INTERFACE=y
CONFIG_HW_RANDOM_TIMERIOMEM=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_GXP=y
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_EEPROM=y
CONFIG_SPI=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_GXP_XREG=y
CONFIG_GPIO_GXP=y
CONFIG_SENSORS_PECI_CPUTEMP=y
CONFIG_SENSORS_PECI_DIMMTEMP=y
CONFIG_SENSORS_SBTSI=y
CONFIG_SENSORS_EMC1403=y
CONFIG_SENSORS_GXP_FAN_CTRL=y
CONFIG_SENSORS_GXP_CORETEMP=y
CONFIG_SENSORS_GXP_PSU=y
CONFIG_SENSORS_GXP_POWER=y
CONFIG_WATCHDOG=y
CONFIG_GXP_WATCHDOG=y
CONFIG_MFD_SYSCON=y
CONFIG_FB=y
CONFIG_FB_THUMBNAIL=y
CONFIG_HAS_IOMEM =y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_GXP_THUMBNAIL=y
CONFIG_USB_HIDDEV=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_USB_GXP_UDC=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_MTD=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_GPIO=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_LEDS_TRIGGER_TRANSIENT=y
CONFIG_LEDS_TRIGGER_PANIC=y
# CONFIG_VIRTIO_MENU is not set
# CONFIG_VHOST_MENU is not set
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_HPE_GXP_XREG=y
CONFIG_HPE_GXP_FN2=y
CONFIG_HPE_GXP_CSM=y
CONFIG_HPE_GXP_SROM=y
CONFIG_HPE_GXP_CHIF=y
CONFIG_HPE_GXP_DBG=y
CONFIG_PECI=y
CONFIG_PECI_CHARDEV=y
CONFIG_PECI_GXP=y
CONFIG_FANOTIFY=y
CONFIG_AUTOFS_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_OVERLAY_FS_REDIRECT_DIR=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_UTF8=y
CONFIG_EXFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_JFFS2_FS=y
# CONFIG_JFFS2_FS_WRITEBUFFER is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
# CONFIG_JFFS2_FS_POSIX_ACL is not set
# CONFIG_JFFS2_FS_SECURITY is not set
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_UTF8=y
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_USER_API_HASH=y
# CONFIG_CRYPTO_HW is not set
CONFIG_CRC16=y
# CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set
# CONFIG_XZ_DEC_IA64 is not set
# CONFIG_XZ_DEC_SPARC is not set
CONFIG_PRINTK_TIME=y
CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_STACK_TRACER=y
CONFIG_SCHED_TRACER=y
CONFIG_STRICT_DEVMEM=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_LL_UART_8250=y
CONFIG_DEBUG_UART_PHYS=0xC00000F0
CONFIG_DEBUG_UART_VIRT=0xF00000F0
CONFIG_DEBUG_UART_8250_SHIFT=0
CONFIG_EARLY_PRINTK=y
CONFIG_TEST_KSTRTOX=y
CONFIG_IPMI_KCS_BMC_CDEV_IPMI=y
CONFIG_FUSE_FS=y
@@ -0,0 +1,10 @@
KBRANCH ?= "dev-5.14-gxp-openbmc"
LINUX_VERSION ?= "5.14.0"
SRCREV="4ff23625306630ce50d9454fca590fa9b2daeb53"
require linux-obmc.inc
require conf/machine/include/fitimage-sign.inc
# OpenBMC loads in kernel features via other mechanisms so this check
# in the kernel-yocto.bbclass is not required
#KERNEL_DANGLING_FEATURES_WARN_ONLY="1"
+10
View File
@@ -0,0 +1,10 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "rl300-g11-layer"
BBFILE_PATTERN_rl300-g11-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_rl300-g11-layer := "mickledore"
@@ -0,0 +1,9 @@
KERNEL_DEVICETREE = "gxp.dtb"
UBOOT_MACHINE = "gxp2_defconfig"
require conf/machine/include/gxp.inc
require conf/machine/include/obmc-bsp-common.inc
require conf/machine/include/hpe.inc
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-ssif"
@@ -0,0 +1,20 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-perl \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-openembedded/meta-webserver \
##OEROOT##/meta-phosphor \
##OEROOT##/meta-hpe \
##OEROOT##/meta-hpe/meta-common \
##OEROOT##/meta-hpe/meta-gxp \
##OEROOT##/meta-hpe/meta-rl300-g11 \
"
@@ -0,0 +1,282 @@
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at
# local.conf.sample.extended which contains other examples of configuration which
# can be placed in this file but new users likely won't need any of them
# initially. There's also site.conf.sample which contains examples of site specific
# information such as proxy server addresses.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= "qemuarm"
#MACHINE ?= "qemuarm64"
#MACHINE ?= "qemumips"
#MACHINE ?= "qemumips64"
#MACHINE ?= "qemuppc"
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
# There are also the following hardware board target machines included for
# demonstration purposes:
#
#MACHINE ?= "beaglebone-yocto"
#MACHINE ?= "genericx86"
#MACHINE ?= "genericx86-64"
#MACHINE ?= "edgerouter"
#
# This sets the default machine to be qemux86-64 if no other machine is selected:
MACHINE ??= "rl300-g11"
# These are some of the more commonly used values. Looking at the files in the
# meta/conf/machine directory, or the conf/machine directory of any additional layers
# you add in will show all the available machines.
#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
#DL_DIR ?= "${TOPDIR}/downloads"
#
# Where to place shared-state files
#
# BitBake has the capability to accelerate builds based on previously built output.
# This is done using "shared state" files which can be thought of as cache objects
# and this option determines where those files are placed.
#
# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
# from these files if no changes were made to the configuration. If changes were made
# to the configuration, only shared state files where the state was still valid would
# be used (done using checksums).
#
# The default is a sstate-cache directory under TOPDIR.
#
#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
#
# Where to place the build output
#
# This option specifies where the bulk of the building work should be done and
# where BitBake should place its temporary files and output. Keep in mind that
# this includes the extraction and compilation of many applications and the toolchain
# which can use Gigabytes of hard disk space.
#
# The default is a tmp directory under TOPDIR.
#
#TMPDIR = "${TOPDIR}/tmp"
#
# Default policy config
#
# The distribution setting controls which policy settings are used as defaults.
# The default value is fine for general Yocto project use, at least initially.
# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
DISTRO ?= "openbmc-phosphor"
# As an example of a subclass there is a "bleeding" edge policy configuration
# where many versions are set to the absolute latest code from the upstream
# source control systems. This is just mentioned here as an example, its not
# useful to most new users.
# DISTRO ?= "poky-bleeding"
#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends
# can be enabled at once and the first item listed in the variable will be used
# to generate the root filesystems.
# Options are:
# - 'package_deb' for debian style deb files
# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# OE-Core defaults to ipkg, whilst Poky defaults to rpm:
# PACKAGE_CLASSES ?= "package_rpm"
#
# SDK target architecture
#
# This variable specifies the architecture to build SDK items for and means
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host).
# Supported values are i686, x86_64, aarch64
#SDKMACHINE ?= "i686"
#
# Extra image configuration defaults
#
# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
# images. Some of these options are added to certain image types automatically. The
# variable can contain the following options:
# "dbg-pkgs" - add -dbg packages for all installed packages
# (adds symbol information for debugging/profiling)
# "src-pkgs" - add -src packages for all installed packages
# (adds source code for debugging)
# "dev-pkgs" - add -dev packages for all installed packages
# (useful if you want to develop against libs in the image)
# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
# (useful if you want to run the package test suites)
# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
# "tools-debug" - add debugging tools (gdb, strace)
# "eclipse-debug" - add Eclipse remote debugging support
# "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
# "debug-tweaks" - make an image suitable for development
# e.g. ssh root access has a blank password
# There are other application targets that can be used here too, see
# meta/classes-recipe/image.bbclass and
# meta/classes-recipe/core-image.bbclass for more details.
# We default to enabling the debugging tweaks.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
#
# Additional image features
#
# The following is a list of additional classes to use when building images which
# enable extra features. Some available options which can be included in this variable
# are:
# - 'buildstats' collect build statistics
USER_CLASSES ?= "buildstats"
#
# Runtime testing of images
#
# The build system can test booting virtual machine images under qemu (an emulator)
# after any root filesystems are created and run tests against those images. It can also
# run tests against any SDK that are built. To enable this uncomment these lines.
# See meta/classes-recipe/test{image,sdk}.bbclass for further details.
#IMAGE_CLASSES += "testimage testsdk"
#TESTIMAGE_AUTO:qemuall = "1"
#
# Interactive shell configuration
#
# Under certain circumstances the system may need input from you and to do this it
# can launch an interactive shell. It needs to do this since the build is
# multithreaded and needs to be able to handle the case where more than one parallel
# process may require the user's attention. The default is iterate over the available
# terminal types to find one that works.
#
# Examples of the occasions this may happen are when resolving patches which cannot
# be applied, to use the devshell or the kernel menuconfig
#
# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
# Note: currently, Konsole support only works for KDE 3.x due to the way
# newer Konsole versions behave
#OE_TERMINAL = "auto"
# By default disable interactive patch resolution (tasks will just fail instead):
PATCHRESOLVE = "noop"
#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less than 100MB or 1K inodes, perform a hard halt
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
# It's necessary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
#
# Shared-state files from other locations
#
# As mentioned above, shared state files are prebuilt cache data objects which can be
# used to accelerate build time. This variable can be used to configure the system
# to search other mirror locations for these objects before it builds the data itself.
#
# This can be a filesystem directory, or a remote url such as https or ftp. These
# would contain the sstate-cache results from previous builds (possibly from other
# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
# cache locations to check for the shared objects.
# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
# at the end as shown in the examples below. This will be substituted with the
# correct path within the directory structure.
#SSTATE_MIRRORS ?= "\
#file://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \
#file://.* file:///some/local/dir/sstate/PATH"
#
# Yocto Project SState Mirror
#
# The Yocto Project has prebuilt artefacts available for its releases, you can enable
# use of these by uncommenting the following lines. This will mean the build uses
# the network to check for artefacts at the start of builds, which does slow it down
# equally, it will also speed up the builds by not having to build things if they are
# present in the cache. It assumes you can download something faster than you can build it
# which will depend on your network.
# Note: For this to work you also need hash-equivalence passthrough to the matching server
#
#BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"
#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
#
# Qemu configuration
#
# By default native qemu will build with a builtin VNC server where graphical output can be
# seen. The line below enables the SDL UI frontend too.
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
# By default libsdl2-native will be built, if you want to use your host's libSDL instead of
# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
#ASSUME_PROVIDED += "libsdl2-native"
# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
# a handy set of menus for controlling the emulator.
#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
#
# Hash Equivalence
#
# Enable support for automatically running a local hash equivalence server and
# instruct bitbake to use a hash equivalence aware signature generator. Hash
# equivalence improves reuse of sstate by detecting when a given sstate
# artifact can be reused as equivalent, even if the current task hash doesn't
# match the one that generated the artifact.
#
# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format
#
#BB_HASHSERVE = "auto"
#BB_SIGNATURE_HANDLER = "OEEquivHash"
#
# Memory Resident Bitbake
#
# Bitbake's server component can stay in memory after the UI for the current command
# has completed. This means subsequent commands can run faster since there is no need
# for bitbake to reload cache files and so on. Number is in seconds, after which the
# server will shut down.
#
#BB_SERVER_TIMEOUT = "60"
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "2"
@@ -0,0 +1 @@
inherit gxp2-bootblock-n
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
@@ -0,0 +1,45 @@
#!/bin/sh
devmem 0xd1000008 8 128
devmem 0xd1000009 8 36
devmem 0xd1000041 8 255
devmem 0xd100004b 8 8
# Configure UART
# 4d is allocating UEFI SOC ROM to GXP
# 5d is allocating UEFI VAR ROM access to GXP
# devmem 0xd1000119 8 0x4d
devmem 0xc00000af 8 9
# enable UART on rl300
systemctl start obmc-console@ttyS1.service
devmem 0xd100011a 8 0x00
# setup PCIe ID
devmem 0x802f002e 16 0x03d8
# Check the current power status
currentstate=$(busctl get-property xyz.openbmc_project.State.Chassis0 /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis CurrentPowerState | awk '{ print $2 }')
if [ "$currentstate" = "\"xyz.openbmc_project.State.Chassis.PowerState.On\"" ]
then
systemctl stop phosphor-virtual-sensor.service
modprobe smpro-misc
modprobe smpro-errmon
modprobe smpro-hwmon
modprobe smpro-mfd
systemctl restart xyz.openbmc_project.ampere_host_error_monitor.service
systemctl restart xyz.openbmc_project.amperecpusensor.service
systemctl restart xyz.openbmc_project.EntityManager.service
systemctl restart phosphor-pid-control.service
systemctl start phosphor-virtual-sensor.service
else
# We can start the ROM Version check services
rmmod gxp_spifi_ctrl1
devmem 0xd1000119 8 0x4d
modprobe gxp_spifi_ctrl1
systemctl start com.hpe.hpe-uefi-version.service
fi
while true
do
sleep 1
done
@@ -0,0 +1 @@
RDEPENDS:${PN}-system += "ampere-platform-mgmt"
@@ -0,0 +1,81 @@
#!/bin/sh
# File which is managing GPIOS when detected. First parameter is which GPIOs that switched
if [ "$1" = "up" ]
then
systemctl stop xyz.openbmc_project.ampere_host_error_monitor.service
rmmod smpro_hwmon smpro_errmon smpro_misc smpro_mfd
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PGood b true
smproStatus=$(lsmod | grep smpro-mfd)
if [ "$smproStatus" = "" ]
then
# sleep 15
# We need to wait for the SoC to be ready to communicate - We just received the PGOOD signal
# The status is reported through an interrupt that we can poll at 2e within the CPLD address space (0xd100_00e2)
max_retry=5
sleep_time=5
success=0
while [ "$max_retry" != "0" ]
do
waitForSoC=$(devmem 0xd10000e2 8)
isAvailable=$(( waitForSoC & 0x2 ))
if [ "r$isAvailable" = "r2" ]
then
max_retry=0
success=1
else
max_retry=$(( max_retry - 1))
sleep $sleep_time
fi
done
if [ "$success" = "1" ]
then
# Activate local UBM (front NVME drive)
devmem 0xd1000087 8 5
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
devmem 0xd1000087 8 7
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
devmem 0xd1000087 8 9
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
devmem 0xd1000087 8 0xb
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
devmem 0xd1000088 8 5
i2ctransfer -y 4 w4@0x40 0x34 0xbf 0x00 0xe8
i2ctransfer -y 4 w2@0x40 0x34 0xa7 r1
modprobe smpro-misc
modprobe smpro-errmon
modprobe smpro-hwmon
modprobe smpro-mfd
systemctl restart xyz.openbmc_project.ampere_host_error_monitor.service
systemctl restart xyz.openbmc_project.amperecpusensor.service
systemctl restart xyz.openbmc_project.EntityManager.service
systemctl restart phosphor-pid-control.service
fi
# We shall add a condition here to make an emergency stop
fi
else
if [ "$1" = "down" ]
then
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PGood b false
# We can re-init the system
devmem 0xd1000009 8 0x24
# We need to check the reason why we have been shutdown
shutdownReason=$(devmem 0x80000074 16)
# If bit 10 is set Software initiated a shutdown we need to restart
isSet2=$( ${shutdownReason} | 0xFBFF )
if [ "$isSet2" = "65535" ]
then
echo "Restarting" >> /tmp/gpios
obmcutil poweron
fi
fi
fi
echo "$1" >> /tmp/gpios.txt
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 PowerOK
[Service]
ExecStart=/usr/bin/gpios-manager down
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 PowerOK
[Service]
ExecStart=/usr/bin/gpios-manager up
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,4 @@
#!/bin/sh
dbus-monitor --system --profile "type='method_call',path='/xyz/openbmc_project/state/host0',interface='org.freedesktop.DBus.Properties',member='Set'" | awk '/xyz.openbmc_project.State.Host/ { print "DONE" }' | while read -r ; do
/usr/bin/rl300Start.sh
done
@@ -0,0 +1,11 @@
[Unit]
Description=RL300 IPMI power sequencing request
After=dbus.service
[Service]
Restart=always
RestartSec=5
ExecStart=/usr/bin/ipmi-power-button-monitoring.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,12 @@
#!/bin/sh
# File which is managing GPIOS when detected. First parameter is which GPIOs that switched
if [ "$1" = "pressed" ]
then
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PButton b true
else
if [ "$1" = "released" ]
then
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PButton b false
fi
fi
echo "$1" >> /tmp/buttons.txt
@@ -0,0 +1,12 @@
[Unit]
Description=RL300 power sequencing manager
#After=dbus.service
After=xyz.openbmc_project.Chassis.Control.Power@0.service
[Service]
Restart=always
RestartSec=5
ExecStart=/usr/bin/startMonitoring.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 Power Button
[Service]
ExecStart=/usr/bin/power-button pressed
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 Power Button Release
[Service]
ExecStart=/usr/bin/power-button released
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,16 @@
#!/bin/sh
# A power up request has been made we must setup the system properly
# RL300 requires UEFI VAR ROM export through spi controller 1
# the machine needs to get out of Hold too
rmmod gxp_spifi_ctrl1
# vejmarie was 58
devmem 0xd1000119 32 0x5d
modprobe gxp_spifi_ctrl1
# clear previous reset reason
devmem 0x80000074 16 0x0
# Release the Soc
currentVal=$(devmem 0xD100011A 8)
currentVal=$(( currentVal | 1 << 3 ))
devmem 0xD100011A 8 "0x""${currentVal}"
@@ -0,0 +1,4 @@
#!/bin/sh
# We just started we have to update the Gpios status
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/test.json
@@ -0,0 +1,10 @@
[
{
"Name": "PowerGoodUp",
"LineName": "PS_PWROK",
"EventMon": "BOTH",
"TargetRising": "gpiosup.service",
"TargetFalling": "gpiosdown.service",
"Continue": true
}
]
@@ -0,0 +1,31 @@
inherit obmc-phosphor-systemd
SUMMARY = "Power Sequencing for HPE RL300 Gen11"
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "monitor-ipmi-power-transition.service power-sequencing.service gpiosdown.service gpiosup.service powerbuttonpressed.service powerbuttonreleased.service"
SRC_URI:append = " file://monitor-ipmi-power-transition.service file://ipmi-power-button-monitoring.sh file://rl300Start.sh file://power-sequencing.service file://gpiosdown.service file://gpiosup.service file://gpios-manager.sh file://test.json file://powerbuttonreleased.service file://powerbuttonpressed.service file://power-button.sh file://startMonitoring.sh"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
IMAGE_INSTALL += "power-sequencing "
FILES:${PN} = "/usr/share/gpios/* /usr/bin/* /etc/system/*"
do_install:append() {
install -d ${D}${sysconfdir}/system/
install -d ${D}/usr/share/gpios
install -d ${D}/usr/bin
install -m 0644 ${WORKDIR}/test.json ${D}/usr/share/gpios/test.json
install -m 0644 ${WORKDIR}/power-sequencing.service ${D}${sysconfdir}/system/power-sequencing.service
install -m 0644 ${WORKDIR}/gpiosup.service ${D}${sysconfdir}/system/gpiosup.service
install -m 0644 ${WORKDIR}/gpiosdown.service ${D}${sysconfdir}/system/gpiosdown.service
install -m 0644 ${WORKDIR}/powerbuttonpressed.service ${D}${sysconfdir}/system/powerbuttonpressed.service
install -m 0644 ${WORKDIR}/powerbuttonreleased.service ${D}${sysconfdir}/system/powerbuttonreleased.service
install -m 0644 ${WORKDIR}/monitor-ipmi-power-transition.service ${D}${sysconfdir}/system/monitor-ipmi-power-transition.service
install -m 0755 ${WORKDIR}/gpios-manager.sh ${D}/usr/bin/gpios-manager.sh
install -m 0755 ${WORKDIR}/startMonitoring.sh ${D}/usr/bin/startMonitoring.sh
install -m 0755 ${WORKDIR}/rl300Start.sh ${D}/usr/bin/rl300Start.sh
install -m 0755 ${WORKDIR}/ipmi-power-button-monitoring.sh ${D}/usr/bin/ipmi-power-button-monitoring.sh
install -m 0755 ${WORKDIR}/power-button.sh ${D}/usr/bin/power-button.sh
}
@@ -0,0 +1,11 @@
[Unit]
Description=RL300 power supply 1 monitoring
After=dbus.service
[Service]
Restart=always
RestartSec=5
ExecStart=startMonitoring1.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,10 @@
[
{
"Name": "PowerGoodUp",
"LineName": "PSU1_INST",
"EventMon": "BOTH",
"TargetRising": "psu1up.service",
"TargetFalling": "psu1down.service",
"Continue": true
}
]
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 PSU1 Manager
[Service]
ExecStart=/usr/bin/psus-manager.sh 1 down
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 PSU1 Manager
[Service]
ExecStart=/usr/bin/psus-manager.sh 1 up
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,11 @@
[Unit]
Description=RL300 power supply 2 monitoring
After=dbus.service
[Service]
Restart=always
RestartSec=5
ExecStart=startMonitoring2.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,10 @@
[
{
"Name": "psu2",
"LineName": "PSU2_INST",
"EventMon": "BOTH",
"TargetRising": "psu2up.service",
"TargetFalling": "psu2down.service",
"Continue": true
}
]
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 PSU2 Manager
[Service]
ExecStart=/usr/bin/psus-manager.sh 2 down
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,8 @@
[Unit]
Description=HPE RL300 PSU2 Manager
[Service]
ExecStart=/usr/bin/psus-manager.sh 2 up
[Install]
# WantedBy=multi-user.target
@@ -0,0 +1,7 @@
#!/bin/sh
# we need to restart FRU service and PSU Monitor everything else shall be ok
systemctl stop xyz.openbmc_project.psusensor.service
systemctl stop xyz.openbmc_project.GxpFruDevice.service
systemctl start xyz.openbmc_project.GxpFruDevice.service
systemctl start xyz.openbmc_project.psusensor.service
@@ -0,0 +1,10 @@
#!/bin/sh
myaddress=$(gpiofind PSU1_INST)
state=$(gpioget "$myaddress")
if [ "r$state" = "r1" ]
then
psus-manager 1 up
else
psus-manager 1 down
fi
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/psu1.json
@@ -0,0 +1,10 @@
#!/bin/sh
myaddress=$(gpiofind PSU2_INST)
state=$(gpioget "$myaddress")
if [ "r$state" = "r1" ]
then
psus-manager 2 up
else
psus-manager 2 down
fi
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/psu2.json
@@ -0,0 +1,30 @@
inherit obmc-phosphor-systemd
SUMMARY = "Power Supplies monitoring for HPE RL300 Gen11"
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "psu2-monitoring.service psu1-monitoring.service psu2up.service psu2down.service psu1down.service psu1up.service"
SRC_URI:append = " file://psu2-monitoring.service file://psu1-monitoring.service file://psus-manager.sh file://psu2up.service file://psu2down.service file://psu1down.service file://psu1up.service file://psu2.json file://psu1.json file://startMonitoring1.sh file://startMonitoring2.sh"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
IMAGE_INSTALL += "power-supplies-monitoring "
FILES:${PN} = "/usr/share/gpios/* /usr/bin/* /etc/system/*"
do_install:append() {
install -d ${D}${sysconfdir}/system/
install -d ${D}/usr/share/gpios
install -d ${D}/usr/bin
install -m 0644 ${WORKDIR}/psu1.json ${D}/usr/share/gpios/psu1.json
install -m 0644 ${WORKDIR}/psu2.json ${D}/usr/share/gpios/psu2.json
install -m 0644 ${WORKDIR}/psu2-monitoring.service ${D}${sysconfdir}/system/psu2-monitoring.service
install -m 0644 ${WORKDIR}/psu1-monitoring.service ${D}${sysconfdir}/system/psu1-monitoring.service
install -m 0644 ${WORKDIR}/psu2up.service ${D}${sysconfdir}/system/psu2up.service
install -m 0644 ${WORKDIR}/psu1up.service ${D}${sysconfdir}/system/psu1up.service
install -m 0644 ${WORKDIR}/psu1down.service ${D}${sysconfdir}/system/psu1down.service
install -m 0644 ${WORKDIR}/psu1down.service ${D}${sysconfdir}/system/psu1down.service
install -m 0755 ${WORKDIR}/psus-manager.sh ${D}/usr/bin/psus-manager.sh
install -m 0755 ${WORKDIR}/startMonitoring1.sh ${D}/usr/bin/startMonitoring1.sh
install -m 0755 ${WORKDIR}/startMonitoring2.sh ${D}/usr/bin/startMonitoring2.sh
}
@@ -0,0 +1,91 @@
{
"gpio_configs":[
{
"Name" : "IdButton",
"LineName" : "ID_BUTTON",
"Type" : "GPIO",
"Polarity" : "ActiveLow"
},
{
"Name" : "NMIButton",
"LineName" : "NMI_BUTTON",
"Type" : "GPIO",
"Polarity" : "ActiveLow"
},
{
"Name" : "NMIOut",
"LineName" : "NMI_OUT",
"Type" : "GPIO",
"Polarity" : "ActiveHigh"
},
{
"Name" : "PostComplete",
"LineName" : "POST_COMPLETE",
"Type" : "GPIO",
"Polarity" : "ActiveLow"
},
{
"Name" : "PowerButton",
"DbusName" : "xyz.openbmc_project.Chassis.Gpios",
"Path" : "/xyz/openbmc_project/chassis/gpios",
"Interface" : "xyz.openbmc_project.Chassis.Gpios",
"Property" : "PButton",
"Type" : "DBUS"
},
{
"Name" : "PowerOk",
"DbusName" : "xyz.openbmc_project.Chassis.Gpios",
"Path" : "/xyz/openbmc_project/chassis/gpios",
"Interface" : "xyz.openbmc_project.Chassis.Gpios",
"Property" : "PGood",
"Type" : "DBUS"
},
{
"Name" : "PowerOut",
"LineName" : "POWER_OUT",
"Type" : "GPIO",
"Polarity" : "ActiveHigh"
},
{
"Name" : "ResetButton",
"LineName" : "RESET_BUTTON",
"Type" : "GPIO",
"Polarity" : "ActiveLow"
},
{
"Name" : "ResetOut",
"LineName" : "RESET_OUT",
"Type" : "GPIO",
"Polarity" : "ActiveHigh"
},
{
"Name" : "SioOnControl",
"LineName" : "",
"Type" : "GPIO",
"Polarity" : "ActiveLow"
},
{
"Name" : "SioPowerGood",
"LineName" : "",
"Type" : "GPIO",
"Polarity" : "ActiveHigh"
},
{
"Name" : "SIOS5",
"LineName" : "",
"Type" : "GPIO",
"Polarity" : "ActiveLow"
}
],
"timing_configs":{
"PowerPulseMs": 200,
"ForceOffPulseMs": 15000,
"ResetPulseMs": 500,
"PowerCycleMs": 5000,
"SioPowerGoodWatchdogMs": 1000,
"PsPowerOKWatchdogMs": 8000,
"GracefulPowerOffS": 300,
"WarmResetCheckMs": 500,
"PowerOffSaveMs": 7000
}
}

Some files were not shown because too many files have changed in this diff Show More