Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support X470D4U #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions meta-asrock/meta-x470d4u/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -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 += "x470d4u-layer"
BBFILE_PATTERN_x470d4u-layer = "^${LAYERDIR}/"
LAYERSERIES_COMPAT_x470d4u-layer = "nanbield scarthgap"
21 changes: 21 additions & 0 deletions meta-asrock/meta-x470d4u/conf/machine/x470d4u.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
KMACHINE = "aspeed"
KERNEL_DEVICETREE = "aspeed/${KMACHINE}-bmc-asrock-${MACHINE}.dtb"

# FIXME: Don't use u-boot-aspeed-sdk because the host can not be booted by
# power button after the bmc is booted.
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 = "ast_g5_ncsi_config"

FLASH_SIZE = "32768"

require conf/machine/include/ast2500.inc
require conf/machine/include/obmc-bsp-common.inc
require conf/machine/include/asrock.inc

# FIXME: native qemu seems to depend on gdk-pixbuf2 on the host,
# but openbmc does not provide necessary versioned glib.
# To prevent build failure, remove native qemu
EXTRA_IMAGEDEPENDS:remove = "qemu-system-native qemu-helper-native"
IMAGE_CLASSES:remove = "qemuboot"
Original file line number Diff line number Diff line change
@@ -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-aspeed \
##OEROOT##/meta-asrock \
##OEROOT##/meta-asrock/meta-x470d4u \
"
17 changes: 17 additions & 0 deletions meta-asrock/meta-x470d4u/conf/templates/default/local.conf.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
MACHINE ??= "x470d4u"
DISTRO ?= "openbmc-phosphor"
PACKAGE_CLASSES ?= "package_ipk"
SANITY_TESTED_DISTROS:append ?= " *"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
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 \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
CONF_VERSION = "2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SUMMARY = "OpenBMC for ASRock - Applications"
PR = "r1"

inherit packagegroup

PROVIDES = "${PACKAGES}"
PACKAGES = " \
${PN}-flash \
${PN}-system \
"

PROVIDES += "virtual/obmc-flash-mgmt"
PROVIDES += "virtual/obmc-system-mgmt"

RPROVIDES:${PN}-flash += "virtual-obmc-flash-mgmt"
RPROVIDES:${PN}-system += "virtual-obmc-system-mgmt"

SUMMARY:${PN}-flash = "ASRock Flash"
RDEPENDS:${PN}-flash = " \
phosphor-ipmi-flash \
"

SUMMARY:${PN}-system = "ASRock System"
RDEPENDS:${PN}-system = " \
phosphor-host-postd \
phosphor-post-code-manager \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vm.panic_on_oom=2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append:x470d4u = " file://vm.conf"

FILES:${PN}:append:x470d4u = " ${sysconfdir}/sysctl.d/vm.conf"

do_install:append:x470d4u() {
install -m 644 -D ${WORKDIR}/vm.conf ${D}${sysconfdir}/sysctl.d/vm.conf
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
// SPDX-License-Identifier: GPL-2.0+
/dts-v1/;

#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
model = "Asrock Rack X470D4U";
compatible = "aspeed,ast2500";

chosen {
stdout-path = &uart5;
bootargs = "console=ttyS4,115200 earlyprintk";
};

memory@80000000 {
reg = <0x80000000 0x20000000>;
};

reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;

video_engine_memory: jpegbuffer {
size = <0x02000000>; /* 32M */
alignment = <0x01000000>;
compatible = "shared-dma-pool";
reusable;
};
};

iio-hwmon {
compatible = "iio-hwmon";
io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
<&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
<&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
<&adc 12>;
};
};

&gpio {
status = "okay";
gpio-line-names =
/* A */ "", "", "", "", "", "", "", "",
/* B */ "FM_BIOS_POST_CMPLT_N", "", "", "", "", "PS_PWROK", "", "",
/* C */ "", "", "", "", "", "", "", "",
/* D */ "BMC_PSIN", "BMC_PSOUT", "BMC_RESETCON", "RESETCON", "", "", "", "",
/* E */ "", "", "", "", "", "", "", "",
/* F */ "", "", "", "", "", "", "", "",
/* G */ "HWM_BAT_EN", "", "", "", "", "", "", "",
/* H */ "", "", "", "", "", "", "", "",
/* I */ "", "", "", "", "", "", "", "",
/* J */ "BMC_READY", "", "", "", "", "", "", "",
/* K */ "", "", "", "", "", "", "", "",
/* L */ "", "", "", "", "", "", "", "",
/* M */ "", "", "", "", "", "", "", "",
/* N */ "", "", "", "", "", "", "", "",
/* O */ "", "", "", "", "", "", "", "",
/* P */ "", "", "", "", "", "", "", "",
/* Q */ "", "", "", "", "", "", "", "",
/* R */ "", "", "", "", "", "", "", "",
/* S */ "", "", "", "", "", "", "", "",
/* T */ "", "", "", "", "", "", "", "",
/* U */ "", "", "", "", "", "", "", "",
/* V */ "", "", "", "", "", "", "", "",
/* W */ "", "", "", "", "", "", "", "",
/* X */ "", "", "", "", "", "", "", "",
/* Y */ "", "", "", "", "", "", "", "",
/* Z */ "", "", "", "", "", "", "", "",
/* AA */ "", "", "", "", "", "", "", "",
/* AB */ "", "", "", "", "", "", "", "",
/* AC */ "", "", "", "", "", "", "", "";

/* Assert BMC_READY so BIOS doesn't sit around waiting for it */
bmc-ready {
gpio-hog;
gpios = <ASPEED_GPIO(J, 0) GPIO_ACTIVE_LOW>;
output-high;
};
};

&fmc {
status = "okay";
flash@0 {
status = "okay";
label = "bmc";
m25p,fast-read;
spi-max-frequency = <10000000>;
#include "openbmc-flash-layout.dtsi"
};
};

&uart5 {
status = "okay";
};

&vuart {
status = "okay";
};

&mac0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
};

&mac1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_rmii2_default &pinctrl_mdio2_default>;
use-ncsi;
};

&i2c1 {
status = "okay";
};

&i2c7 {
status = "okay";

eeprom@57 {
compatible = "st,24c128", "atmel,24c128";
reg = <0x57>;
pagesize = <16>;
};
};

&vhub {
status = "okay";
};

&lpc_snoop {
status = "okay";
snoop-ports = <0x80>;
};

&video {
status = "okay";
memory-region = <&video_engine_memory>;
};

&pwm_tacho {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm0_default
&pinctrl_pwm1_default
&pinctrl_pwm2_default
&pinctrl_pwm3_default
&pinctrl_pwm4_default
&pinctrl_pwm5_default>;
fan@0 {
reg = <0x00>;
aspeed,fan-tach-ch = /bits/ 8 <0x00>;
};
fan@1 {
reg = <0x01>;
aspeed,fan-tach-ch = /bits/ 8 <0x01>;
};
fan@2 {
reg = <0x02>;
aspeed,fan-tach-ch = /bits/ 8 <0x02>;
};
fan@3 {
reg = <0x03>;
aspeed,fan-tach-ch = /bits/ 8 <0x03>;
};
fan@4 {
reg = <0x04>;
aspeed,fan-tach-ch = /bits/ 8 <0x04>;
};
fan@5 {
reg = <0x05>;
aspeed,fan-tach-ch = /bits/ 8 <0x05>;
};
};

&adc {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc0_default
&pinctrl_adc1_default
&pinctrl_adc2_default
&pinctrl_adc3_default
&pinctrl_adc4_default
&pinctrl_adc5_default
&pinctrl_adc6_default
&pinctrl_adc7_default
&pinctrl_adc8_default
&pinctrl_adc9_default
&pinctrl_adc10_default
&pinctrl_adc11_default
&pinctrl_adc12_default>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# include i2c super-i/o driver, but not host-side (lpc) driver
CONFIG_SENSORS_NCT6775_CORE=y
CONFIG_SENSORS_NCT6775_I2C=y
CONFIG_SENSORS_NCT6775=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append:x470d4u = " \
file://aspeed-bmc-asrock-x470d4u.dts \
file://x470d4u.cfg \
"

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/aspeed
fi
done
}
Loading