diff --git a/meta-asrock/meta-x470d4u/conf/layer.conf b/meta-asrock/meta-x470d4u/conf/layer.conf new file mode 100644 index 000000000000..91019b5707c5 --- /dev/null +++ b/meta-asrock/meta-x470d4u/conf/layer.conf @@ -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" diff --git a/meta-asrock/meta-x470d4u/conf/machine/x470d4u.conf b/meta-asrock/meta-x470d4u/conf/machine/x470d4u.conf new file mode 100644 index 000000000000..0301fc690898 --- /dev/null +++ b/meta-asrock/meta-x470d4u/conf/machine/x470d4u.conf @@ -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" diff --git a/meta-asrock/meta-x470d4u/conf/templates/default/bblayers.conf.sample b/meta-asrock/meta-x470d4u/conf/templates/default/bblayers.conf.sample new file mode 100644 index 000000000000..1a82f5f67eac --- /dev/null +++ b/meta-asrock/meta-x470d4u/conf/templates/default/bblayers.conf.sample @@ -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 \ + " diff --git a/meta-asrock/meta-x470d4u/conf/templates/default/local.conf.sample b/meta-asrock/meta-x470d4u/conf/templates/default/local.conf.sample new file mode 100644 index 000000000000..f98876346406 --- /dev/null +++ b/meta-asrock/meta-x470d4u/conf/templates/default/local.conf.sample @@ -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" diff --git a/meta-asrock/meta-x470d4u/recipes-asrock/packagegroups/packagegroup-asrock-apps.bb b/meta-asrock/meta-x470d4u/recipes-asrock/packagegroups/packagegroup-asrock-apps.bb new file mode 100644 index 000000000000..6d2076e6fdae --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-asrock/packagegroups/packagegroup-asrock-apps.bb @@ -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 \ + " diff --git a/meta-asrock/meta-x470d4u/recipes-core/systemd/systemd/vm.conf b/meta-asrock/meta-x470d4u/recipes-core/systemd/systemd/vm.conf new file mode 100644 index 000000000000..10c1ac28cfa3 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-core/systemd/systemd/vm.conf @@ -0,0 +1 @@ +vm.panic_on_oom=2 diff --git a/meta-asrock/meta-x470d4u/recipes-core/systemd/systemd_%.bbappend b/meta-asrock/meta-x470d4u/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 000000000000..ae108a433bfc --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-core/systemd/systemd_%.bbappend @@ -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 +} diff --git a/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed/aspeed-bmc-asrock-x470d4u.dts b/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed/aspeed-bmc-asrock-x470d4u.dts new file mode 100644 index 000000000000..009c5709a6b3 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed/aspeed-bmc-asrock-x470d4u.dts @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +#include "aspeed-g5.dtsi" +#include + +/ { + 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 = ; + 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>; +}; diff --git a/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed/x470d4u.cfg b/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed/x470d4u.cfg new file mode 100644 index 000000000000..29af18af4058 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed/x470d4u.cfg @@ -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 diff --git a/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed_%.bbappend new file mode 100644 index 000000000000..d99f6e999e6d --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-kernel/linux/linux-aspeed_%.bbappend @@ -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 +} diff --git a/meta-asrock/meta-x470d4u/recipes-phosphor/configuration/entity-manager/asrock_x470d4u.json b/meta-asrock/meta-x470d4u/recipes-phosphor/configuration/entity-manager/asrock_x470d4u.json new file mode 100644 index 000000000000..f8b9759750a2 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-phosphor/configuration/entity-manager/asrock_x470d4u.json @@ -0,0 +1,156 @@ +{ + "Exposes": [ + { + "Index": 0, + "Name": "3VSB", + "ScaleFactor": 0.3979, + "Type": "ADC" + }, + { + "Index": 1, + "Name": "5VSB", + "ScaleFactor": 0.2683, + "Type": "ADC" + }, + { + "Index": 2, + "Name": "VCPU", + "ScaleFactor": 0.1, + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 3, + "Name": "VSOC", + "ScaleFactor": 0.6964, + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 4, + "Name": "VCCM", + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 5, + "Name": "APU_VDDP", + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 6, + "Name": "1.05V_PROM_S5", + "Type": "ADC" + }, + { + "Index": 7, + "Name": "2.5V_PROM", + "ScaleFactor": 0.5349, + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 8, + "Name": "1.05V_PROM_RUN", + "Type": "ADC", + "PowerState": "On" + }, + { + "BridgeGpio": [ + { + "Name": "HWM_BAT_EN", + "Polarity": "High", + "SetupTime": 0.5 + } + ], + "Index": 9, + "Name": "BAT", + "ScaleFactor": 0.3333, + "Type": "ADC" + }, + { + "Index": 10, + "Name": "3V", + "ScaleFactor": 0.3979, + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 11, + "Name": "5V", + "ScaleFactor": 0.3333, + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 12, + "Name": "12V", + "ScaleFactor": 0.0833, + "Type": "ADC", + "PowerState": "On" + }, + { + "Index": 0, + "Name": "FAN1", + "Type": "AspeedFan" + }, + { + "Index": 1, + "Name": "FAN2", + "Type": "AspeedFan" + }, + { + "Index": 2, + "Name": "FAN3", + "Type": "AspeedFan" + }, + { + "Index": 3, + "Name": "FAN4", + "Type": "AspeedFan" + }, + { + "Index": 4, + "Name": "FAN5", + "Type": "AspeedFan" + }, + { + "Index": 5, + "Name": "FAN6", + "Type": "AspeedFan" + }, + { + "Name": "BMC", + "Type": "BMC" + }, + { + "Address": "0x2d", + "Bus": 1, + "Name": "SYSTIN", + "Name1": "CPUTIN", + "Name10": "TSI0_TEMP", + "Name2": "AUXTIN0", + "Name3": "AUXTIN1", + "Name4": "AUXTIN2", + "Name5": "AUXTIN3", + "Name6": "PCH_CHIP_CPU_MAX_TEMP", + "Name7": "PCH_CHIP_TEMP", + "Name8": "PCH_CPU_TEMP", + "Name9": "PCH_MCH_TEMP", + "PowerState": "BiosPost", + "Type": "NCT6779" + } + ], + "Name": "ASRock X470D4U", + "Probe": [ + "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'X470D4U'})" + ], + "Type": "Board", + "xyz.openbmc_project.Inventory.Decorator.Asset": { + "Manufacturer": "$BOARD_MANUFACTURER", + "Model": "$BOARD_PRODUCT_NAME", + "PartNumber": "", + "SerialNumber": "$BOARD_SERIAL_NUMBER" + } +} diff --git a/meta-asrock/meta-x470d4u/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-asrock/meta-x470d4u/recipes-phosphor/configuration/entity-manager_%.bbappend new file mode 100644 index 000000000000..bfa637ea0f0c --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-phosphor/configuration/entity-manager_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" +SRC_URI:append = " file://asrock_x470d4u.json \ + " +do_install:append() { + install -d ${D}/usr/share/entity-manager/configurations + install -m 0444 ${WORKDIR}/*.json ${D}/usr/share/entity-manager/configurations +} diff --git a/meta-asrock/meta-x470d4u/recipes-phosphor/console/obmc-console/obmc-console.conf b/meta-asrock/meta-x470d4u/recipes-phosphor/console/obmc-console/obmc-console.conf new file mode 100644 index 000000000000..8cd204bd91e7 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-phosphor/console/obmc-console/obmc-console.conf @@ -0,0 +1,3 @@ +lpc-address = 0x2f8 +sirq = 3 +baud = 115200 diff --git a/meta-asrock/meta-x470d4u/recipes-phosphor/console/obmc-console_git.bbappend b/meta-asrock/meta-x470d4u/recipes-phosphor/console/obmc-console_git.bbappend new file mode 100644 index 000000000000..4fc41d058011 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-phosphor/console/obmc-console_git.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" diff --git a/meta-asrock/meta-x470d4u/recipes-x86/chassis/x86-power-control/power-config-host0.json b/meta-asrock/meta-x470d4u/recipes-x86/chassis/x86-power-control/power-config-host0.json new file mode 100644 index 000000000000..2d754ac8c352 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-x86/chassis/x86-power-control/power-config-host0.json @@ -0,0 +1,87 @@ +{ + "gpio_configs": [ + { + "Name": "IdButton", + "LineName": "", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "Name": "NMIButton", + "LineName": "", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "Name": "NMIOut", + "LineName": "", + "Type": "GPIO", + "Polarity": "ActiveHigh" + }, + { + "Name": "PostComplete", + "LineName": "FM_BIOS_POST_CMPLT_N", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "Name": "PowerButton", + "LineName": "BMC_PSIN", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "Name": "PowerOk", + "LineName": "PS_PWROK", + "Type": "GPIO", + "Polarity": "ActiveHigh" + }, + { + "Name": "PowerOut", + "LineName": "BMC_PSOUT", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "Name": "ResetButton", + "LineName": "BMC_RESETCON", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "Name": "ResetOut", + "LineName": "RESETCON", + "Type": "GPIO", + "Polarity": "ActiveLow" + }, + { + "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 + } +} diff --git a/meta-asrock/meta-x470d4u/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-asrock/meta-x470d4u/recipes-x86/chassis/x86-power-control_%.bbappend new file mode 100644 index 000000000000..f54fe0695470 --- /dev/null +++ b/meta-asrock/meta-x470d4u/recipes-x86/chassis/x86-power-control_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += " \ + file://power-config-host0.json \ + " + +do_install:append() { + install -d ${D}/${datadir}/${PN} + install -m 0644 ${WORKDIR}/power-config-host0.json ${D}/${datadir}/${PN} +} diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch index 20572b55c4cc..35229ae8900e 100644 --- a/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch +++ b/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch @@ -303,7 +303,7 @@ index 9396e1d..d0bb181 100644 + PWDICT tmp_pwp; + + memcpy(&tmp_pwp, pwp, sizeof(PWDICT)); -+ HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32); ++ HwmsHostToBigEndian((char *)tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32); + fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp); } }