diff --git a/.gitignore b/.gitignore index efe0df2945f1..4bbee94230e2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ customrc *.sw? .repo/ .vscode/ +images/ +artifacts/ diff --git a/README.md b/README.md index 5e42437ea382..62a476758310 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Prerequisites + +The documents related to `x11ssh` platform, are in `./docs/` directory. + # OpenBMC [![Build Status](https://jenkins.openbmc.org/buildStatus/icon?job=latest-master)](https://jenkins.openbmc.org/job/latest-master/) diff --git a/dockerfile b/dockerfile new file mode 100644 index 000000000000..327355e94d3e --- /dev/null +++ b/dockerfile @@ -0,0 +1,41 @@ +# Use the latest Ubuntu image +FROM ubuntu:latest + +# Set environment variables for non-interactive installs +ENV DEBIAN_FRONTEND=noninteractive + +# Update and install required packages +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + gcc \ + g++ \ + make \ + file \ + wget \ + gawk \ + diffstat \ + bzip2 \ + cpio \ + chrpath \ + zstd \ + lz4 \ + python3 \ + vim \ + locales \ + patch \ + curl \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +# Set up locales +RUN locale-gen en_US.UTF-8 \ + && update-locale LANG=en_US.UTF-8 + +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +# Set user and the working directory inside the container +WORKDIR /project-data +USER ubuntu + diff --git a/docs/building_x11ssh_image.md b/docs/building_x11ssh_image.md new file mode 100644 index 000000000000..b42d8fd246f7 --- /dev/null +++ b/docs/building_x11ssh_image.md @@ -0,0 +1,189 @@ +# Building OpenBMC for `x11ssh` platform. + +This document will guide you through building OpenBMC for `x11ssh` platform. + +## Prerequisites + +### Hardware requirements + +To build OpenBMC you'll need solid machine. The machine with following +configuration has been proven to be insufficient. + +Partial output of `fastfetch`. +``` +CPU: 12th Gen Intel(R) Core(TM) i7-1260P (16) @ 4.70 GHz +Memory: 10.16 GiB / 15.44 GiB (66%) +``` + +Building failed due to insufficient RAM memory available, even when no other +user processes were running. + +## Building `x11ssh` configuration + +### Building docker container + +The image will be built inside the docker container, it should provide a +reproducible environment with all necessary tools installed. + +Steps: +1. Create docker container. + ```shell + docker build -t ubuntu-latests-openbmc . + ``` +1. Run the container + ```shell + ./run.sh + ``` + +### Building OpenBMC image + +Perform following steps to build `openbmc` for x11ssh. + +Steps: +1. Source setup file with `x11ssh` configuration. + ```shell + source setup x11ssh + ``` +1. Build the image (this will take a while) + ```shell + bitbake obmc-phosphor-image + ``` + Generated image file should be inside following directory: + ```shell + ./build/x11ssh/tmp/deploy/images/x11ssh/obmc-phosphor-image-x11ssh.static.mtd + ``` + +## Running the image in qemu + +To test if the image works, one might run it inside `qemu`. + +Steps: +1. (Optional) Copy build image to local directory. + ``` + mkdir images + cp ./build/x11ssh/tmp/deploy/images/x11ssh/obmc-phosphor-image-x11ssh.static.mtd images/ + ``` +1. Run the built image inside qemu. + ``` + ./runqemu.sh images/obmc-phosphor-image-x11ssh.static.mtd + ``` + On success, you shall be greeted with login prompt. +1. Exit qemu via key combination. + ``` + CTRL+a, x + ``` + +## Flashing + +This section describes recovery/flashing process. + +### Chip location and details + +The flash memory for BMC on `x11ssh` platform is Macronix MX25L25635F in 16-PIN +SOP package. Documentation can be found +[here](https://www.macronix.com/Lists/Datasheet/Attachments/8666/MX25L25635F,%203V,%20256Mb,%20v1.5.pdf). + +The picture below shows the chip location on the `x11ssh` motherboard, marked +with a red circle. + +![motherboard](./img/mobo.jpg) + +Below is the detailed view of the chip. The circles highlight the dot and a +notch used to identify pin 1 of the chip. The pin 1 is highlighted in red. + +![chip](./img/macronix.jpg) + +### Connecting RTE + +The image can be flashed using +[RTE](https://shop.3mdeb.com/shop/open-source-hardware/rte/?srsltid=AfmBOoqP5uST8J6MRdp41I-dletjgiEX6e77Oa18S1fsuCWHbAFzD_jI). +Below is the pinout of the chip. + +![pinout](./img/pinout.png) + +_Source_: +[Macronix](https://www.macronix.com/Lists/Datasheet/Attachments/8666/MX25L25635F,%203V,%20256Mb,%20v1.5.pdf) + +The chip needs to be connected to the SPI header on RTE. The pinout for the +the header is as follows. +```text + ______ + > | | +Vcc 3.3V ----1 2---- GND + | | + MOSI ----3 4---- CS + | | + MISO ----5 6---- CLK + |______| +``` + +Here's a table of connections + +| RTE PIN | FLASH MEM. PIN | +|---------|----------------| +| 1 | 2 | +| 2 | 10 | +| 3 | 15 | +| 4 | 7 | +| 5 | 8 | +| 6 | 16 | + + +### Flashing the image + +1. Verify the flash is properly detected. + +```bash + flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=1000 +``` + +1. (If necessary) Backup the image. A good practice is to perform this at least +3 times and verify if checksums are matching. + +```bash +flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=1000 -r #image_name# +``` + +1. Flash the image + +```bash +flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=1000 -w obmc-phosphor-image-x11ssh.static.mtd +``` + +Result + +```text +flashrom v1.3.0 on Linux 5.4.69 (armv7l) +flashrom is free software, get the source code at https://flashrom.org + +Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). +Found Macronix flash chip "MX25L25635F/MX25L25645G" (32768 kB, SPI) on linux_spi. +=== +This flash part has status UNTESTED for operations: WP +The test status of this chip may have been updated in the latest development +version of flashrom. If you are running the latest development version, +please email a report to flashrom@flashrom.org if any of the above operations +work correctly for you with this flash chip. Please include the flashrom log +file for all operations you tested (see the man page for details), and mention +which mainboard or programmer you tested in the subject line. +Thanks for your help! +Reading old flash chip contents... done. +Erasing and writing flash chip... Erase/write done. +Verifying flash... VERIFIED. + +``` + +## User accounts + +The root with `0penBmc` password is created by default. It can be used +to log in via serial. + +To make root be able to access WebUI, the necessary privileges need to be +assigned. Execute following command on serial to assign the root user necessary +privileges to be able to access webui. + +```bash +busctl set-property xyz.openbmc_project.User.Manager \ +/xyz/openbmc_project/user/root \ +xyz.openbmc_project.User.Attributes UserPrivilege s 'priv-admin' +``` diff --git a/docs/img/macronix.jpg b/docs/img/macronix.jpg new file mode 100644 index 000000000000..8af1f4774ace Binary files /dev/null and b/docs/img/macronix.jpg differ diff --git a/docs/img/mobo.jpg b/docs/img/mobo.jpg new file mode 100644 index 000000000000..2080ffc6b5d4 Binary files /dev/null and b/docs/img/mobo.jpg differ diff --git a/docs/img/pinout.png b/docs/img/pinout.png new file mode 100644 index 000000000000..6c9c93a8fe0e Binary files /dev/null and b/docs/img/pinout.png differ diff --git a/meta-supermicro/meta-x11ssh/conf/layer.conf b/meta-supermicro/meta-x11ssh/conf/layer.conf new file mode 100644 index 000000000000..4c600c0f37a7 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/conf/layer.conf @@ -0,0 +1,12 @@ +# 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 += "x11ssh" +BBFILE_PATTERN_x11ssh = "" + +BBFILE_PRIORITY_x11ssh = "5" +LAYERSERIES_COMPAT_x11ssh = "scarthgap styhead" diff --git a/meta-supermicro/meta-x11ssh/conf/machine/x11ssh.conf b/meta-supermicro/meta-x11ssh/conf/machine/x11ssh.conf new file mode 100644 index 000000000000..3b338286a8ab --- /dev/null +++ b/meta-supermicro/meta-x11ssh/conf/machine/x11ssh.conf @@ -0,0 +1,24 @@ +KMACHINE = "aspeed" +KERNEL_DEVICETREE = "aspeed/aspeed-bmc-supermicro-x11ssh.dtb" + +require conf/machine/include/ast2400.inc +require conf/machine/include/obmc-bsp-common.inc +require conf/machine/include/supermicro.inc + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-aspeed" +PREFERRED_PROVIDER_u-boot = "u-boot-aspeed" +PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-aspeed" +UBOOT_MACHINE:x11ssh = "ast_g4_phy_defconfig" +UBOOT_DEVICETREE = "ast2400-evb" +UBOOT_ENTRYPOINT = "0x40008000" +UBOOT_LOADADDRESS = "0x40008000" + +FLASH_SIZE = "32768" + +VIRTUAL-RUNTIME_skeleton_workbook = "supermicro-${MACHINE}-config" + +VIRTUAL-RUNTIME_obmc-host-state-manager = "x86-power-control" +VIRTUAL-RUNTIME_obmc-chassis-state-manager = "x86-power-control" +VIRTUAL-RUNTIME_obmc-discover-system-state = "x86-power-control" + +PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "x11ssh-led-manager-config-native" diff --git a/meta-supermicro/meta-x11ssh/conf/templates/default/bblayers.conf.sample b/meta-supermicro/meta-x11ssh/conf/templates/default/bblayers.conf.sample new file mode 100644 index 000000000000..85a31d8daf85 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/conf/templates/default/bblayers.conf.sample @@ -0,0 +1,19 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "8" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/poky/meta-poky \ + ##OEROOT##/meta-openembedded/meta-oe \ + ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ + ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-phosphor \ + ##OEROOT##/meta-aspeed \ + ##OEROOT##/meta-supermicro \ + ##OEROOT##/meta-supermicro/meta-x11ssh \ + " diff --git a/meta-supermicro/meta-x11ssh/conf/templates/default/conf-notes.txt b/meta-supermicro/meta-x11ssh/conf/templates/default/conf-notes.txt new file mode 100644 index 000000000000..9b3c01a55654 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/conf/templates/default/conf-notes.txt @@ -0,0 +1,2 @@ +Common targets are: + obmc-phosphor-image diff --git a/meta-supermicro/meta-x11ssh/conf/templates/default/local.conf.sample b/meta-supermicro/meta-x11ssh/conf/templates/default/local.conf.sample new file mode 100644 index 000000000000..8b0ba79861bb --- /dev/null +++ b/meta-supermicro/meta-x11ssh/conf/templates/default/local.conf.sample @@ -0,0 +1,17 @@ +MACHINE ??= "x11" +DISTRO ?= "openbmc-phosphor" +PACKAGE_CLASSES ?= "package_rpm" +SANITY_TESTED_DISTROS:append ?= " *" +USER_CLASSES ?= "buildstats" +PATCHRESOLVE = "noop" +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + STOPTASKS,/tmp,100M,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K \ + ABORT,/tmp,10M,1K" +CONF_VERSION = "2" +INHERIT += "extrausers" diff --git a/meta-supermicro/meta-x11ssh/recipes-bsp/u-boot/u-boot-aspeed/0001-supermicro-x11ssh-serial-routing-for-BMC-on-COM2.patch b/meta-supermicro/meta-x11ssh/recipes-bsp/u-boot/u-boot-aspeed/0001-supermicro-x11ssh-serial-routing-for-BMC-on-COM2.patch new file mode 100644 index 000000000000..9ba6f7b8469d --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-bsp/u-boot/u-boot-aspeed/0001-supermicro-x11ssh-serial-routing-for-BMC-on-COM2.patch @@ -0,0 +1,67 @@ +From e7b419ac3256d70effe1d7d638f31856730133a4 Mon Sep 17 00:00:00 2001 +From: Mateusz Kusiak +Date: Tue, 29 Apr 2025 16:04:18 +0200 +Subject: [PATCH] supermicro-x11ssh: serial routing for BMC on COM2 + +This commit enables serial routing, so BMC can output to serial. +The commit is heavily based on: +https://github.com/osresearch/u-bmc/commit/8b7d1ae02a33bbfda7487b6a2162a3317a355f00 + +Upstream-Status: Inappropriate [testing] +Signed-off-by: Mateusz Kusiak +--- + arch/arm/mach-aspeed/platform_g4.S | 38 +++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/mach-aspeed/platform_g4.S b/arch/arm/mach-aspeed/platform_g4.S +index 0cdbdbfccf0e..9e61bdf482b4 100644 +--- a/arch/arm/mach-aspeed/platform_g4.S ++++ b/arch/arm/mach-aspeed/platform_g4.S +@@ -342,7 +342,43 @@ set_MPLL: + and r1, r2, r1 + str r1, [r0] + +-/* Debug - UART console message */ ++/* Debug - UART console message on the serial port */ ++#define CONFIG_DRAM_UART_TO_UART2 ++#ifdef CONFIG_DRAM_UART_TO_UART1 ++ // route the BMC debug uart5 to the COM1 DB9 on the backplane ++ ldr r0, =0x1e78909c @ route UART5 to UART Port1, 2016.08.29 ++ ldr r1, =0x10000004 ++ str r1, [r0] ++ ldr r0, =0x1e6e2084 ++ ldr r1, [r0] ++ mov r2, #0xC0 @ Enable pinmux of TXD1/RXD1 ++ orr r1, r1, r2, lsl #16 ++ str r1, [r0] ++#endif ++#ifdef CONFIG_DRAM_UART_TO_UART2 ++ // route the BMC debug uart5 to the COM2 header on the mainboard ++ // and enable the /dev/ttyS0 serial output from the x86 (BMC IO1?) on the DB9 (UART1?) ++ ldr r0, =0x1e78909c // LPC Host Interface Control Register A (HICRA) p564 ++ ldr r1, =( 0 \ ++ | (0x2 << 28) /* Route IO2 to UART5 (sel5DW) */ \ ++ | (0x3 << 3) /* Route UART5 to IO2 (sel2IO) */ \ ++ | (0x0 << 16) /* Route IO1 to UART1 (sel1DW) */ \ ++ | (0x0 << 0) /* Route UART1 to IO1 (sel1IO) */ \ ++ ) ++ str r1, [r0] ++ ++ ldr r0, =0x1e6e2084 // System Control Unit Multi-function pin control #2 (SCU84) p345 ++ ldr r1, [r0] ++ ldr r2, =(0 \ ++ | (1 << 31) /* Enable UART2 RXD1 */ \ ++ | (1 << 30) /* Enable UART2 TXD1 */ \ ++ | (1 << 23) /* Enable UART1 RXD1 */ \ ++ | (1 << 22) /* Enable UART1 TXD1 */ \ ++ ) ++ orr r1, r1, r2, lsl #0 ++ str r1, [r0] ++#endif ++ + ldr r0, =0x1e78400c + mov r1, #0x83 + str r1, [r0] +-- +2.49.0 + diff --git a/meta-supermicro/meta-x11ssh/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bbappend b/meta-supermicro/meta-x11ssh/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bbappend new file mode 100644 index 000000000000..521eb781237b --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0001-supermicro-x11ssh-serial-routing-for-BMC-on-COM2.patch" diff --git a/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed/x11ssh/0001-ARM-dts-aspeed-Add-dts-for-Supermicro-X11SSH.patch b/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed/x11ssh/0001-ARM-dts-aspeed-Add-dts-for-Supermicro-X11SSH.patch new file mode 100644 index 000000000000..fb5c7f7cefd1 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed/x11ssh/0001-ARM-dts-aspeed-Add-dts-for-Supermicro-X11SSH.patch @@ -0,0 +1,216 @@ +From eec818ccf16a153371e80882f9033cd68f46eacc Mon Sep 17 00:00:00 2001 +From: Mateusz Kusiak +Date: Mon, 7 Apr 2025 17:32:58 +0200 +Subject: [PATCH] ARM: dts: aspeed: Add dts for Supermicro X11SSH + +This commit adds dts file for Supermicro X11SSH platform. + +Based on the: +https://github.com/Keno/openbmc-linux/commit/2443d1129e95943da1ba86768934489dca548321.patch + +Upstream-Status: Inappropriate [testing] +Signed-off-by: Mateusz Kusiak +--- + arch/arm/boot/dts/aspeed/Makefile | 1 + + .../aspeed/aspeed-bmc-supermicro-x11ssh.dts | 143 ++++++++++++++++++ + 2 files changed, 144 insertions(+) + create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-supermicro-x11ssh.dts + +diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile +index 220210c318fd..96e1abfba5b5 100644 +--- a/arch/arm/boot/dts/aspeed/Makefile ++++ b/arch/arm/boot/dts/aspeed/Makefile +@@ -72,6 +72,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ + aspeed-bmc-quanta-q71l.dtb \ + aspeed-bmc-quanta-s6q.dtb \ + aspeed-bmc-supermicro-x11spi.dtb \ ++ aspeed-bmc-supermicro-x11ssh.dtb \ + aspeed-bmc-inventec-starscream.dtb \ + aspeed-bmc-inventec-transformers.dtb \ + aspeed-bmc-tyan-s7106.dtb \ +diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-supermicro-x11ssh.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-supermicro-x11ssh.dts +new file mode 100644 +index 000000000000..ce15f815b164 +--- /dev/null ++++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-supermicro-x11ssh.dts +@@ -0,0 +1,143 @@ ++//Based on the: https://github.com/Keno/openbmc-linux/commit/2443d1129e95943da1ba86768934489dca548321.patch ++/dts-v1/; ++ ++#include "aspeed-g4.dtsi" ++#include ++ ++/ { ++ model = "Supermicro X11SSH BMC"; ++ compatible = "supermicro,x1ssh-bmc", "aspeed,ast2400"; ++ ++ aliases { ++ serial4 = &uart5; ++ }; ++ ++ chosen { ++ stdout-path = &uart5; ++ bootargs = "console=ttyS4,115200 earlycon"; ++ }; ++ ++ memory { ++ /* 128 MiB DDR3 memory */ ++ reg = <0x40000000 0x08000000>; ++ }; ++ ++ reserved-memory { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ vga_memory: framebuffer@47000000 { ++ no-map; ++ reg = <0x47000000 0x01000000>; /* 16MB */ ++ }; ++ ++ flash_memory: region@98000000 { ++ no-map; ++ reg = <0x98000000 0x01000000>; /* 16MB */ ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ uid { ++ gpios = <&gpio ASPEED_GPIO(D, 6) GPIO_ACTIVE_HIGH>; ++ }; ++ ++ heartbeat { ++ gpios = <&gpio ASPEED_GPIO(D, 7) GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++}; ++ ++&fmc { ++ status = "okay"; ++ flash@0 { ++ status = "okay"; ++ m25p,fast-read; ++#include "openbmc-flash-layout.dtsi" ++ }; ++}; ++ ++&spi { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_spi1debug_default>; ++ ++ flash@0 { ++ status = "okay"; ++ label = "pnor"; ++ m25p,fast-read; ++ }; ++}; ++ ++&pinctrl { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_flbusy_default &pinctrl_flwp_default ++ ++ &pinctrl_vgahs_default &pinctrl_vgavs_default ++ &pinctrl_ddcclk_default &pinctrl_ddcdat_default>; ++}; ++ ++&mac0 { ++ status = "okay"; ++ ++ use-ncsi; ++ no-hw-checksum; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_rmii1_default>; ++}; ++ ++ ++&uart5 { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++}; ++ ++&i2c1 { ++ status = "okay"; ++}; ++ ++&i2c2 { ++ status = "okay"; ++}; ++ ++&i2c3 { ++ status = "okay"; ++}; ++ ++&i2c4 { ++ status = "okay"; ++}; ++ ++&i2c5 { ++ status = "okay"; ++}; ++ ++&i2c6 { ++ status = "okay"; ++}; ++ ++&i2c7 { ++ status = "okay"; ++}; ++ ++&vuart { ++ status = "okay"; ++}; ++ ++&lpc_ctrl { ++ status = "okay"; ++ memory-region = <&flash_memory>; ++ flash = <&spi>; ++}; ++ ++&wdt2 { ++ status = "okay"; ++}; ++ ++&gpio { ++ status = "okay"; ++ gpio-line-names = ++ /*A0-A7*/ "","","","","","","","", ++ /*B0-B7*/ "","","","","","","","", ++ /*C0-C7*/ "","POWER_BTN_N","","","","","","", ++ /*D0-D7*/ "","","","","","","POWER_LED_N","UID_LED_N", ++ /*E0-E7*/ "","","RESET_BTN_N","","BIOS_MUX_N","","","", ++ /*F0-F7*/ "","","","","","","","", ++ /*G0-G7*/ "","","","","","","","", ++ /*H0-H7*/ "","","","","","","","", ++ /*I0-I7*/ "","","","","","","","", ++ /*J0-J7*/ "","","","","","","","", ++ /*K0-K7*/ "","","","","","","","", ++ /*L0-L7*/ "","","","","","","","", ++ /*M0-M7*/ "","","","","","","","", ++ /*N0-N7*/ "","","","","","","","", ++ /*O0-O7*/ "","","","","","","","", ++ /*P0-P7*/ "","","","","","","","", ++ /*Q0-Q7*/ "","","","","","","","", ++ /*R0-R7*/ "","","","","","","","", ++ /*S0-S7*/ "","","","","","","","", ++ /*T0-T7*/ "","","","","","","","", ++ /*U0-U7*/ "","","","","","","","", ++ /*V0-V7*/ "","","","","","","","", ++ /*W0-W7*/ "","","","","","","","", ++ /*X0-X7*/ "","","","","","","","", ++ /*Y0-Y7*/ "","","","","","","","", ++ /*Z0-Z7*/ "","","","","","","","", ++ /*AA0-AA7*/ "","","","","","","","", ++ /*AB0-AB7*/ "","","","","","","","", ++ /*AC0-AC7*/ "","","","","","","",""; ++}; +-- +2.49.0 + diff --git a/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed/x11ssh/0001-g4-Add-kcs-definitions-in-dts.patch b/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed/x11ssh/0001-g4-Add-kcs-definitions-in-dts.patch new file mode 100644 index 000000000000..5501c3d4ff51 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed/x11ssh/0001-g4-Add-kcs-definitions-in-dts.patch @@ -0,0 +1,60 @@ +From 5b2b854d6ffe8c711b50cf4838d4f48c38f96a7b Mon Sep 17 00:00:00 2001 +From: Mateusz Kusiak +Date: Mon, 25 Aug 2025 11:33:38 +0200 +Subject: [PATCH] g4: Add kcs definitions in dts + +Add kcs interface definitions for aspeed g4 BMCs (ast2400). + +Upstream-Status: Inappropriate [testing] +Signed-off-by: Mateusz Kusiak +--- + arch/arm/boot/dts/aspeed/aspeed-g4.dtsi | 28 +++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi +index 7b1982c116f1..758530a1dfaf 100644 +--- a/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi ++++ b/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi +@@ -373,6 +373,34 @@ lpc: lpc@1e789000 { + #size-cells = <1>; + ranges = <0x0 0x1e789000 0x1000>; + ++ // When enabled, get's created on boot. ++ // When used under service, the service does not fail, no info in webui. ++ kcs1: kcs@24 { ++ compatible = "aspeed,ast2400-kcs-bmc-v2"; ++ reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; ++ interrupts = <8>; ++ clocks = <&syscon ASPEED_CLK_GATE_LCLK>; ++ aspeed,lpc-io-reg = <0xca2>; ++ status = "enabled"; ++ }; ++ ++ // When enabled, get's created on boot. ++ // When used under service, the service does not fail, no info in webui. ++ kcs2: kcs@28 { ++ compatible = "aspeed,ast2400-kcs-bmc-v2"; ++ reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; ++ interrupts = <8>; ++ clocks = <&syscon ASPEED_CLK_GATE_LCLK>; ++ aspeed,lpc-io-reg = <0xca2>; ++ status = "disabled"; ++ }; ++ ++ // When enabled, doesn't get created on boot. ++ kcs3: kcs@2c { ++ compatible = "aspeed,ast2400-kcs-bmc-v2"; ++ reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; ++ interrupts = <8>; ++ clocks = <&syscon ASPEED_CLK_GATE_LCLK>; ++ aspeed,lpc-io-reg = <0xca2>; ++ status = "enabled"; ++ }; ++ ++ + lpc_ctrl: lpc-ctrl@80 { + compatible = "aspeed,ast2400-lpc-ctrl"; + reg = <0x80 0x10>; +-- +2.50.1 + diff --git a/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed_%.bbappend new file mode 100644 index 000000000000..144293e09df7 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-kernel/linux/linux-aspeed_%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0001-ARM-dts-aspeed-Add-dts-for-Supermicro-X11SSH.patch" +SRC_URI += "file://0001-g4-Add-kcs-definitions-in-dts.patch" diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/chassis/x86-power-control/power-config-host0.json b/meta-supermicro/meta-x11ssh/recipes-phosphor/chassis/x86-power-control/power-config-host0.json new file mode 100644 index 000000000000..3d6c104ec310 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/chassis/x86-power-control/power-config-host0.json @@ -0,0 +1,34 @@ +{ + "gpio_configs": [ + { + "Name" : "PowerButton", + "LineName" : "POWER_BTN_N", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "ResetButton", + "LineName" : "RESET_BTN_N", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "BiosMux", + "LineName" : "BIOS_MUX_N", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "PowerLed", + "LineName" : "POWER_LED_N", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + }, + { + "Name" : "UIDLed", + "LineName" : "UID_LED_N", + "Type" : "GPIO", + "Polarity" : "ActiveLow" + } + ] +} diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/chassis/x86-power-control_%.bbappend b/meta-supermicro/meta-x11ssh/recipes-phosphor/chassis/x86-power-control_%.bbappend new file mode 100644 index 000000000000..ff5c7a20ef76 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/chassis/x86-power-control_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += " file://power-config-host0.json" + +do_install:append() { + install -d ${D}${datadir}/x86-power-control/ + install -m 0644 ${WORKDIR}/sources-unpack/power-config-host0.json ${D}${datadir}/x86-power-control/ +} + +EXTRA_OECMAKE = "-DWITH_RESETBUTTON=OFF" + diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-supermicro/meta-x11ssh/recipes-phosphor/images/obmc-phosphor-image.bbappend new file mode 100644 index 000000000000..9fc8218406d6 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/images/obmc-phosphor-image.bbappend @@ -0,0 +1,7 @@ +# Remove some features so image fits in available flash size +IMAGE_FEATURES:remove = "obmc-telemetry" +IMAGE_FEATURES:remove = "obmc-devtools" +IMAGE_FEATURES:remove = "obmc-debug-collector" +IMAGE_FEATURES:remove = "obmc-logging-mgmt" +IMAGE_FEATURES:remove = "obmc-remote-logging-mgmt" +BMC_IMAGE_BASE_INSTALL:remove = "packagegroup-obmc-apps-extras" diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/interfaces/bmcweb/0001-bmcweb.service-Fix-WatchdogSec.patch b/meta-supermicro/meta-x11ssh/recipes-phosphor/interfaces/bmcweb/0001-bmcweb.service-Fix-WatchdogSec.patch new file mode 100644 index 000000000000..e8dbd4b6250a --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/interfaces/bmcweb/0001-bmcweb.service-Fix-WatchdogSec.patch @@ -0,0 +1,33 @@ +From 3e6ee0b9b940d5005a65a47d8794dbacffcfdea4 Mon Sep 17 00:00:00 2001 +From: Mateusz Kusiak +Date: Wed, 9 Apr 2025 11:36:33 +0200 +Subject: [PATCH] bmcweb.service: Fix WatchdogSec + +The issue here is that the variable that's being referenced for +WatchdogSec is actualy named "WATCHDOG_TIMEOUT_SECONDS". + +The issue for this has been submitted: +https://github.com/openbmc/bmcweb/issues/306 + +Upstream-Status: Inappropriate [testing] +Signed-off-by: Mateusz Kusiak +--- + config/bmcweb.service.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/bmcweb.service.in b/config/bmcweb.service.in +index 78a92fea4ced..038b46d9d1c3 100644 +--- a/config/bmcweb.service.in ++++ b/config/bmcweb.service.in +@@ -10,7 +10,7 @@ ExecStart=@MESON_INSTALL_PREFIX@/libexec/bmcwebd + Type=simple + WorkingDirectory=/home/root + SyslogLevelPrefix=true +-WatchdogSec=@WATCHDOG_TIMEOUT@s ++WatchdogSec=@WATCHDOG_TIMEOUT_SECONDS@s + + [Install] + WantedBy=network.target +-- +2.49.0 + diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-supermicro/meta-x11ssh/recipes-phosphor/interfaces/bmcweb_%.bbappend new file mode 100644 index 000000000000..523b2e3ff1b0 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -0,0 +1,6 @@ +# Include patch +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-bmcweb.service-Fix-WatchdogSec.patch" + +#Set default watchdog for 60s +EXTRA_OEMESON += "-Dwatchdog-timeout-seconds=60" diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json b/meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json new file mode 100644 index 000000000000..d15d6f7b8bbd --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json @@ -0,0 +1,178 @@ +{ + "0": { + "name": "Ipmb", + "is_valid": true, + "active_sessions": 0, + "channel_info": { + "medium_type": "ipmb", + "protocol_type": "ipmb-1.0", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "1": { + "name": "eth0", + "is_valid": true, + "active_sessions": 0, + "channel_info": { + "medium_type": "lan-802.3", + "protocol_type": "ipmb-1.0", + "session_supported": "multi-session", + "is_ipmi": true + } + }, + "2": { + "name": "eth1", + "is_valid": true, + "active_sessions": 0, + "channel_info": { + "medium_type": "lan-802.3", + "protocol_type": "ipmb-1.0", + "session_supported": "multi-session", + "is_ipmi": true + } + }, + "3": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "4": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "5": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "6": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "7": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "8": { + "name": "INTRABMC", + "is_valid": true, + "active_sessions": 0, + "channel_info": { + "medium_type": "oem", + "protocol_type": "oem", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "9": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "10": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "11": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "12": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "13": { + "name": "RESERVED", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "reserved", + "protocol_type": "na", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "14": { + "name": "SELF", + "is_valid": false, + "active_sessions": 0, + "channel_info": { + "medium_type": "ipmb", + "protocol_type": "ipmb-1.0", + "session_supported": "session-less", + "is_ipmi": true + } + }, + "15": { + "name": "kcs1", + "is_valid": true, + "active_sessions": 0, + "channel_info": { + "medium_type": "system-interface", + "protocol_type": "kcs", + "session_supported": "session-less", + "is_ipmi": true + } + } +} diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bbappend b/meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bbappend new file mode 100644 index 000000000000..9a70fd030514 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bbappend @@ -0,0 +1,7 @@ +# meta-supermicro/meta-x11ssh/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bbappend + +# Override the channel configuration +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +# Override KCS_DEVICE for X11SSH platform +KCS_DEVICE = "ipmi-kcs1" diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/leds/x11ssh-led-manager-config-native.bb b/meta-supermicro/meta-x11ssh/recipes-phosphor/leds/x11ssh-led-manager-config-native.bb new file mode 100644 index 000000000000..e7234749575a --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/leds/x11ssh-led-manager-config-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "Phosphor LED Group Management for Supermicro X11SSH" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" +PR = "r1" + +inherit native + +PROVIDES += "virtual/phosphor-led-manager-config-native" + +SRC_URI += "file://led.yaml" + +# Overwrites the default led.yaml +do_install() { + SRC=${WORKDIR}/sources-unpack/ + DEST=${D}${datadir}/phosphor-led-manager + install -D ${SRC}/led.yaml ${DEST}/led.yaml +} diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/leds/x11ssh-led-manager-config/led.yaml b/meta-supermicro/meta-x11ssh/recipes-phosphor/leds/x11ssh-led-manager-config/led.yaml new file mode 100644 index 000000000000..c91db1b7fa1a --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/leds/x11ssh-led-manager-config/led.yaml @@ -0,0 +1,23 @@ +BmcBooted: + heartbeat: + Action: 'Blink' + DutyOn: 50 + Period: 0 + Priority: 'Blink' +EnclosureIdentify: + uid: + Action: 'Blink' + DutyOn: 50 + Period: 1000 + Priority: 'Blink' +LampTest: + heartbeat: + Action: 'Blink' + DutyOn: 50 + Period: 1000 + Priority: 'Blink' + uid: + Action: 'Blink' + DutyOn: 50 + Period: 1000 + Priority: 'Blink' diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json b/meta-supermicro/meta-x11ssh/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json new file mode 100644 index 000000000000..2c35d93fe078 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json @@ -0,0 +1,41 @@ +{ + "gpio_configs": { + + "power_config": { + "power_up_outs": [ + {"name": "POWER_BTN_N", "polarity": false} + ], + "reset_outs": [ + {"name": "RESET_BTN_N", "polarity": false} + ] + } + }, + + "gpio_definitions": [ + { + "name": "POWER_BTN_N", + "pin": "C1", + "direction": "both" + }, + { + "name": "RESET_BTN_N", + "pin": "E2", + "direction": "both" + }, + { + "name": "BIOS_MUX_N", + "pin": "E4", + "direction": "out" + }, + { + "name": "POWER_LED_N", + "pin": "D6", + "direction": "out" + }, + { + "name": "UID_LED_N", + "pin": "D7", + "direction": "out" + } + ] +} diff --git a/meta-supermicro/meta-x11ssh/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend b/meta-supermicro/meta-x11ssh/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend new file mode 100644 index 000000000000..eadb7e4a4884 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-phosphor/skeleton/obmc-libobmc-intf_%.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS:append := "${THISDIR}/${PN}:" diff --git a/meta-supermicro/meta-x11ssh/recipes-supermicro/packagegroups/packagegroup-supermicro-apps.bbappend b/meta-supermicro/meta-x11ssh/recipes-supermicro/packagegroups/packagegroup-supermicro-apps.bbappend new file mode 100644 index 000000000000..0c77563d2b50 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes-supermicro/packagegroups/packagegroup-supermicro-apps.bbappend @@ -0,0 +1,3 @@ +# Remove phosphor state manager +# https://github.com/openbmc/phosphor-state-manager/issues/20 +RDEPENDS:${PN}-chassis:remove = "phosphor-state-manager" diff --git a/meta-supermicro/meta-x11ssh/recipes.txt b/meta-supermicro/meta-x11ssh/recipes.txt new file mode 100644 index 000000000000..c58366847778 --- /dev/null +++ b/meta-supermicro/meta-x11ssh/recipes.txt @@ -0,0 +1 @@ +recipes-phosphor - Phosphor OpenBMC applications and configuration diff --git a/notes.md b/notes.md new file mode 100644 index 000000000000..eef3cbcb8a26 --- /dev/null +++ b/notes.md @@ -0,0 +1,29 @@ +On Fedora + +1) install deps + +```sh +sudo dnf install git python3 gcc g++ gawk which bzip2 chrpath cpio \ + hostname file diffutils diffstat lz4 wget zstd rpcgen patch +``` + +2) also needed to install perl module + +```sh +sudo dnf install perl-Thread-Queue +``` + +3) prepare build env + +```sh +source setup x11 +``` + +4) run bitbake + +```sh +bitbake obmc-phosphor-image +``` + +Build should start as I make changes to resolve parsing errors, they should be +handled better. diff --git a/poky/scripts/builder_to_rte.sh b/poky/scripts/builder_to_rte.sh new file mode 100755 index 000000000000..65fa1914b463 --- /dev/null +++ b/poky/scripts/builder_to_rte.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +set -euo pipefail + +usage() { + echo "This script copies latest build openbmc image to rte." + echo "Usage: $0 [--suffix ]" + exit 1 +} + +# --- Check if 'builder' exists in /etc/hosts --- +if ! grep -qw "builder" /etc/hosts; then + echo "Error: 'builder' is not defined in /etc/hosts" + exit 1 +fi + +# --- Parse arguments --- +SUFFIX="" +TARGET_IP="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --suffix) + shift + [[ $# -gt 0 ]] || usage + SUFFIX="$1" + ;; + -*) + usage + ;; + *) + TARGET_IP="$1" + ;; + esac + shift +done + +if [[ -z "$TARGET_IP" ]]; then + usage +fi + +# --- Variables --- +SRC_PATH="builder@builder:/project-data/$USER/openbmc/build/x11ssh/tmp/deploy/images/x11ssh/obmc-phosphor-image-x11ssh.static.mtd" +DEST_FILENAME="obmc-phosphor-image-x11ssh${SUFFIX:+_$SUFFIX}.static.mtd" +DEST_PATH="/data/test_images/$DEST_FILENAME" +DEST="root@${TARGET_IP}:${DEST_PATH}" + +# --- Perform scp --- +scp "$SRC_PATH" "$DEST" + +# --- Print destination --- +echo "Image copied to: $DEST_PATH" + diff --git a/run.sh b/run.sh new file mode 100755 index 000000000000..8f7aec4d94e5 --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +docker run -it --rm -v "$(pwd)":/project-data -w /project-data ubuntu-latests-openbmc + diff --git a/runqemu.sh b/runqemu.sh new file mode 100755 index 000000000000..75566efa89fa --- /dev/null +++ b/runqemu.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Default image path +DEFAULT_IMAGE="./build/x11ssh/tmp/deploy/images/x11ssh/obmc-phosphor-image-x11ssh.static.mtd" + +# Use the first argument as image path if provided, else use default +IMAGE_PATH="${1:-$DEFAULT_IMAGE}" +IMAGE_BASE_NAME=$(basename $IMAGE_PATH) + +# Create artifacts dir if it does not exist for dtb dump +mkdir -p ./artifacts/ 2> /dev/null + +# Check if the file exists +if [ ! -f "$IMAGE_PATH" ]; then + echo "Error: File '$IMAGE_PATH' not found." + exit 1 +fi + +# Run QEMU with the verified image +qemu-system-arm -machine supermicrox11-bmc,dumpdtb=/tmp/test.dtb \ + -drive file="$IMAGE_PATH",format=raw,if=mtd \ + -m 256 \ + -nographic \ + -net nic \ + -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostfwd=udp:127.0.0.1:2623-:623,hostname=qemu \ +# -S -gdb tcp::1234 # Enable this to dump memory via gdb + diff --git a/shell.sh b/shell.sh new file mode 100755 index 000000000000..b1673e3c1479 --- /dev/null +++ b/shell.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# $HOME seems necessary for npm's cache +docker run --rm -it \ + -u "$(id -u):$(id -g)" \ + -v $(pwd):$(pwd) \ + -w $(pwd) \ + -e HOME=$PWD/.home \ + 3mdeb/yocto-docker \ + /bin/bash