diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common-small')
8 files changed, 273 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common-small/conf/layer.conf b/meta-openbmc-mods/meta-common-small/conf/layer.conf new file mode 100644 index 000000000..a8c66a9da --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/conf/layer.conf @@ -0,0 +1,11 @@ +# 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-small" +BBFILE_PATTERN_common-small = "^${LAYERDIR}/" +BBFILE_PRIORITY_common-small = "9" +LAYERSERIES_COMPAT_common-small = "gatesgarth hardknott honister" diff --git a/meta-openbmc-mods/meta-common-small/recipes-core/systemd/systemd_%.bbappend b/meta-openbmc-mods/meta-common-small/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 000000000..547b6ae30 --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,14 @@ +# add some configuration overrides for systemd default /usr/lib/tmpfiles.d/ + +LICENSE = "GPL-2.0" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +# Disable udev hwdb +RRECOMMENDS:${PN}:remove += "udev-hwdb" +PACKAGES:remove += "udev-hwdb" + +do_install:append() { + rm -rf ${D}${rootlibexecdir}/udev/hwdb.d + rm -f ${D}${sysconfdir}/udev/hwdb.bin +} diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/python/python-pycryptodomex.inc b/meta-openbmc-mods/meta-common-small/recipes-devtools/python/python-pycryptodomex.inc new file mode 100644 index 000000000..83aa4bcd8 --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/python/python-pycryptodomex.inc @@ -0,0 +1,28 @@ +SUMMARY = "Cryptographic library for Python" +DESCRIPTION = "PyCryptodome is a self-contained Python package of low-level\ + cryptographic primitives." +HOMEPAGE = "http://www.pycryptodome.org" +LICENSE = "PD & BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=6dc0e2a13d2f25d6f123c434b761faba" + +SRC_URI[md5sum] = "46ba513d95b6e323734074d960a7d57b" +SRC_URI[sha256sum] = "22d970cee5c096b9123415e183ae03702b2cd4d3ba3f0ced25c4e1aba3967167" + +inherit pypi + +RDEPENDS:${PN} += " \ + ${PYTHON_PN}-io \ + ${PYTHON_PN}-math \ +" + +RDEPENDS:${PN}-tests += " \ + ${PYTHON_PN}-unittest \ +" + +PACKAGES =+ "${PN}-tests" + +FILES:${PN}-tests += " \ + ${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/ \ + ${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/__pycache__/ \ +" +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/python/python3-pycryptodomex_3.9.4.bb b/meta-openbmc-mods/meta-common-small/recipes-devtools/python/python3-pycryptodomex_3.9.4.bb new file mode 100644 index 000000000..be66430e1 --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/python/python3-pycryptodomex_3.9.4.bb @@ -0,0 +1,2 @@ +require python-pycryptodomex.inc +inherit setuptools3 diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch new file mode 100644 index 000000000..4db72085d --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch @@ -0,0 +1,99 @@ +From 48aa1135cffd72d2c2f4067f3e96ae25d6dbfc30 Mon Sep 17 00:00:00 2001 +From: "Wludzik, Jozef" <jozef.wludzik@intel.com> +Date: Mon, 16 Nov 2020 15:48:04 +0100 +Subject: [PATCH] hw/arm/aspeed: Add an intel-ast2500 machine type + +Include the HW strap setting and some I2C temperature sensors. + +Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> +Signed-off-by: James Feist <james.feist@linux.intel.com> +--- + hw/arm/aspeed.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 54 insertions(+) + +diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c +index fcb1a7cd..514dca85 100644 +--- a/hw/arm/aspeed.c ++++ b/hw/arm/aspeed.c +@@ -68,6 +68,21 @@ struct AspeedMachineState { + SCU_HW_STRAP_MAC0_RGMII) & \ + ~SCU_HW_STRAP_2ND_BOOT_WDT) + ++/* intel ast2500 hardware value: 0xF3CCC286 */ ++#define INTEL_AST2500_BMC_HW_STRAP1 (( \ ++ AST2500_HW_STRAP1_DEFAULTS | \ ++ SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE | \ ++ SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE | \ ++ SCU_AST2500_HW_STRAP_UART_DEBUG | \ ++ SCU_AST2500_HW_STRAP_ESPI_ENABLE | \ ++ SCU_AST2500_HW_STRAP_DDR4_ENABLE | \ ++ SCU_HW_STRAP_GPIOE_PT_EN | \ ++ SCU_AST2400_HW_STRAP_ACPI_DIS | \ ++ SCU_HW_STRAP_CLK_48M_IN | \ ++ SCU_HW_STRAP_VGA_CLASS_CODE | \ ++ SCU_HW_STRAP_MAC1_RGMII) & \ ++ ~SCU_HW_STRAP_2ND_BOOT_WDT) ++ + /* Romulus hardware value: 0xF10AD206 */ + #define ROMULUS_BMC_HW_STRAP1 ( \ + AST2500_HW_STRAP1_DEFAULTS | \ +@@ -417,6 +432,24 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc) + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32); + } + ++static void intel_ast2500_i2c_init(AspeedMachineState *bmc) ++{ ++ AspeedSoCState *soc = &bmc->soc; ++ DeviceState *dev; ++ ++ dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp421", 0x4d)); ++ object_property_set_int(OBJECT(dev), "temperature0", 50000, &error_abort); ++ /* The s2600wf expects a TMP75 but a TMP105 is compatible */ ++ dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48)); ++ object_property_set_int(OBJECT(dev), "temperature", 50000, &error_abort); ++ dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49)); ++ object_property_set_int(OBJECT(dev), "temperature", 50000, &error_abort); ++ dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x4a)); ++ object_property_set_int(OBJECT(dev), "temperature", 50000, &error_abort); ++ dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x4b)); ++ object_property_set_int(OBJECT(dev), "temperature", 50000, &error_abort); ++} ++ + static void ast2600_evb_i2c_init(AspeedMachineState *bmc) + { + /* Start with some devices on our I2C busses */ +@@ -620,6 +653,23 @@ static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *data) + aspeed_soc_num_cpus(amc->soc_name); + }; + ++static void aspeed_machine_intel_ast2500_class_init(ObjectClass *oc, void *data) ++{ ++ MachineClass *mc = MACHINE_CLASS(oc); ++ AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc); ++ ++ mc->desc = "Intel AST2500 BMC (ARM1176)"; ++ amc->soc_name = "ast2500-a1"; ++ amc->hw_strap1 = INTEL_AST2500_BMC_HW_STRAP1; ++ amc->fmc_model = "n25q512a"; ++ amc->spi_model = "n25q512a"; ++ amc->num_cs = 1; ++ amc->i2c_init = intel_ast2500_i2c_init; ++ mc->default_ram_size = 512 * MiB; ++ mc->default_cpus = mc->min_cpus = mc->max_cpus = ++ aspeed_soc_num_cpus(amc->soc_name); ++}; ++ + static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data) + { + MachineClass *mc = MACHINE_CLASS(oc); +@@ -735,6 +785,10 @@ static const TypeInfo aspeed_machine_types[] = { + .name = MACHINE_TYPE_NAME("ast2500-evb"), + .parent = TYPE_ASPEED_MACHINE, + .class_init = aspeed_machine_ast2500_evb_class_init, ++ }, { ++ .name = MACHINE_TYPE_NAME("intel-ast2500"), ++ .parent = TYPE_ASPEED_MACHINE, ++ .class_init = aspeed_machine_intel_ast2500_class_init, + }, { + .name = MACHINE_TYPE_NAME("romulus-bmc"), + .parent = TYPE_ASPEED_MACHINE, diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-hw-arm-aspeed-Add-an-intel-ast2600-machine-type.patch b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-hw-arm-aspeed-Add-an-intel-ast2600-machine-type.patch new file mode 100644 index 000000000..2d5bd8faa --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-hw-arm-aspeed-Add-an-intel-ast2600-machine-type.patch @@ -0,0 +1,65 @@ +From 165f4bc884b9f9ed5bf568f5b930dba6835a2edd Mon Sep 17 00:00:00 2001 +From: "Wludzik, Jozef" <jozef.wludzik@intel.com> +Date: Mon, 16 Nov 2020 15:52:12 +0100 +Subject: [PATCH] hw/arm/aspeed: Add an intel-ast2600 machine type + +Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com> +--- + hw/arm/aspeed.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c +index 514dca85..be9e1455 100644 +--- a/hw/arm/aspeed.c ++++ b/hw/arm/aspeed.c +@@ -126,6 +126,10 @@ struct AspeedMachineState { + #define AST2600_EVB_HW_STRAP1 0x000000C0 + #define AST2600_EVB_HW_STRAP2 0x00000003 + ++/* Intel AST2600 hardware value */ ++#define INTEL_AST2600_HW_STRAP1 0x00000000 ++#define INTEL_AST2600_HW_STRAP2 0x00000040 ++ + /* Tacoma hardware value */ + #define TACOMA_BMC_HW_STRAP1 0x00000000 + #define TACOMA_BMC_HW_STRAP2 0x00000040 +@@ -670,6 +674,25 @@ static void aspeed_machine_intel_ast2500_class_init(ObjectClass *oc, void *data) + aspeed_soc_num_cpus(amc->soc_name); + }; + ++static void aspeed_machine_intel_ast2600_class_init(ObjectClass *oc, void *data) ++{ ++ MachineClass *mc = MACHINE_CLASS(oc); ++ AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc); ++ ++ mc->desc = "Intel AST2600 BMC (Cortex A7)"; ++ amc->soc_name = "ast2600-a1"; ++ amc->hw_strap1 = INTEL_AST2600_HW_STRAP1; ++ amc->hw_strap2 = INTEL_AST2600_HW_STRAP2; ++ amc->fmc_model = "n25q512a"; ++ amc->spi_model = "n25q512a"; ++ amc->num_cs = 1; ++ amc->macs_mask = ASPEED_MAC1_ON | ASPEED_MAC2_ON | ASPEED_MAC3_ON; ++ amc->i2c_init = intel_ast2500_i2c_init; ++ mc->default_ram_size = 1 * GiB; ++ mc->default_cpus = mc->min_cpus = mc->max_cpus = ++ aspeed_soc_num_cpus(amc->soc_name); ++}; ++ + static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data) + { + MachineClass *mc = MACHINE_CLASS(oc); +@@ -789,6 +812,10 @@ static const TypeInfo aspeed_machine_types[] = { + .name = MACHINE_TYPE_NAME("intel-ast2500"), + .parent = TYPE_ASPEED_MACHINE, + .class_init = aspeed_machine_intel_ast2500_class_init, ++ }, { ++ .name = MACHINE_TYPE_NAME("intel-ast2600"), ++ .parent = TYPE_ASPEED_MACHINE, ++ .class_init = aspeed_machine_intel_ast2600_class_init, + }, { + .name = MACHINE_TYPE_NAME("romulus-bmc"), + .parent = TYPE_ASPEED_MACHINE, +-- +2.16.6 + diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0003-Remove-clearing-aspeed-GPIO-registers.patch b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0003-Remove-clearing-aspeed-GPIO-registers.patch new file mode 100644 index 000000000..d1e9752a5 --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0003-Remove-clearing-aspeed-GPIO-registers.patch @@ -0,0 +1,30 @@ +From c0f3add0f49818992f752d04f33204ee1f27e885 Mon Sep 17 00:00:00 2001 +From: "Wludzik, Jozef" <jozef.wludzik@intel.com> +Date: Mon, 30 Nov 2020 14:32:52 +0100 +Subject: [PATCH] Remove clearing aspeed GPIO registers + +Removed clearing aspeed GPIO registers to omit clearing set GPIO +lines at machine initialization. It does not affect aspeed +simulation. intel-ast machines boot with success. + +Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com> +--- + hw/gpio/aspeed_gpio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c +index 985a259e05..9f93a10887 100644 +--- a/hw/gpio/aspeed_gpio.c ++++ b/hw/gpio/aspeed_gpio.c +@@ -830,7 +830,7 @@ static void aspeed_gpio_reset(DeviceState *dev) + AspeedGPIOState *s = ASPEED_GPIO(dev); + + /* TODO: respect the reset tolerance registers */ +- memset(s->sets, 0, sizeof(s->sets)); ++ //memset(s->sets, 0, sizeof(s->sets)); + } + + static void aspeed_gpio_realize(DeviceState *dev, Error **errp) +-- +2.16.6 + diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend new file mode 100644 index 000000000..1bc423139 --- /dev/null +++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend @@ -0,0 +1,24 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +SRC_URI += "file://0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch \ + file://0002-hw-arm-aspeed-Add-an-intel-ast2600-machine-type.patch \ + file://0003-Remove-clearing-aspeed-GPIO-registers.patch" + +QEMU_TARGETS = "arm" +EXTRA_OECONF = " \ + --prefix=${prefix} \ + --bindir=${bindir} \ + --includedir=${includedir} \ + --libdir=${libdir} \ + --mandir=${mandir} \ + --datadir=${datadir} \ + --docdir=${docdir}/${BPN} \ + --sysconfdir=${sysconfdir} \ + --libexecdir=${libexecdir} \ + --localstatedir=${localstatedir} \ + --disable-strip \ + --disable-werror \ + --extra-cflags='${CFLAGS}' \ + --extra-ldflags='${LDFLAGS}' \ + --python=${HOSTTOOLS_DIR}/python3 \ + ${PACKAGECONFIG_CONFARGS} \ + " |