diff options
367 files changed, 21219 insertions, 3641 deletions
@@ -3,7 +3,7 @@ VERSION = 2024 PATCHLEVEL = 10 SUBLEVEL = -EXTRAVERSION = -rc4 +EXTRAVERSION = -rc6 NAME = # *DOCUMENTATION* diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 56d4af518d8..b3fe3f3c535 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -262,11 +262,6 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += \ zynqmp-m-a2197-02-revA.dtb \ zynqmp-m-a2197-03-revA.dtb \ zynqmp-p-a2197-00-revA.dtb \ - zynqmp-p-a2197-00-revA-x-prc-01-revA.dtbo \ - zynqmp-p-a2197-00-revA-x-prc-02-revA.dtbo \ - zynqmp-p-a2197-00-revA-x-prc-03-revA.dtbo \ - zynqmp-p-a2197-00-revA-x-prc-04-revA.dtbo \ - zynqmp-p-a2197-00-revA-x-prc-05-revA.dtbo \ zynqmp-mini.dtb \ zynqmp-mini-emmc0.dtb \ zynqmp-mini-emmc1.dtb \ @@ -281,22 +276,10 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += \ zynqmp-mini-qspi-x2-stacked.dtb \ zynqmp-sc-revB.dtb \ zynqmp-sc-revC.dtb \ - zynqmp-sc-vek280-revA.dtbo \ - zynqmp-sc-vek280-revB.dtbo \ - zynqmp-sc-vhk158-revA.dtbo \ - zynqmp-sc-vpk120-revB.dtbo \ - zynqmp-sc-vpk180-revA.dtbo \ - zynqmp-sc-vpk180-revB.dtbo \ - zynqmp-sc-vn-p-b2197-00-revA.dtbo \ zynqmp-sm-k24-revA.dtb \ zynqmp-smk-k24-revA.dtb \ zynqmp-sm-k26-revA.dtb \ zynqmp-smk-k26-revA.dtb \ - zynqmp-sck-kd-g-revA.dtbo \ - zynqmp-sck-kr-g-revA.dtbo \ - zynqmp-sck-kr-g-revB.dtbo \ - zynqmp-sck-kv-g-revA.dtbo \ - zynqmp-sck-kv-g-revB.dtbo \ zynqmp-topic-miamimp-xilinx-xdp-v1r1.dtb \ zynqmp-vpk120-revA.dtb \ zynqmp-vp-x-a2785-00-revA.dtb \ @@ -324,6 +307,67 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += \ zynqmp-zc1751-xm017-dc3.dtb \ zynqmp-zc1751-xm018-dc4.dtb \ zynqmp-zc1751-xm019-dc5.dtb + +zynqmp-p-a2197-00-revA-x-prc-01-revA-dtbs := zynqmp-p-a2197-00-revA.dtb zynqmp-p-a2197-00-revA-x-prc-01-revA.dtbo +zynqmp-p-a2197-00-revA-x-prc-02-revA-dtbs := zynqmp-p-a2197-00-revA.dtb zynqmp-p-a2197-00-revA-x-prc-02-revA.dtbo +zynqmp-p-a2197-00-revA-x-prc-03-revA-dtbs := zynqmp-p-a2197-00-revA.dtb zynqmp-p-a2197-00-revA-x-prc-03-revA.dtbo +zynqmp-p-a2197-00-revA-x-prc-04-revA-dtbs := zynqmp-p-a2197-00-revA.dtb zynqmp-p-a2197-00-revA-x-prc-04-revA.dtbo +zynqmp-p-a2197-00-revA-x-prc-05-revA-dtbs := zynqmp-p-a2197-00-revA.dtb zynqmp-p-a2197-00-revA-x-prc-05-revA.dtbo + +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-p-a2197-00-revA-x-prc-01-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-p-a2197-00-revA-x-prc-02-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-p-a2197-00-revA-x-prc-03-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-p-a2197-00-revA-x-prc-04-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-p-a2197-00-revA-x-prc-05-revA.dtb + +zynqmp-sc-vek280-revA-dtbs := zynqmp-sc-revB.dtb zynqmp-sc-vek280-revA.dtbo +zynqmp-sc-vek280-revB-dtbs := zynqmp-sc-revC.dtb zynqmp-sc-vek280-revB.dtbo +zynqmp-sc-vhk158-revA-dtbs := zynqmp-sc-revB.dtb zynqmp-sc-vhk158-revA.dtbo +zynqmp-sc-vpk120-revB-dtbs := zynqmp-sc-revB.dtb zynqmp-sc-vpk120-revB.dtbo +zynqmp-sc-vpk180-revA-dtbs := zynqmp-sc-revB.dtb zynqmp-sc-vpk180-revA.dtbo +zynqmp-sc-vpk180-revB-dtbs := zynqmp-sc-revB.dtb zynqmp-sc-vpk180-revB.dtbo +zynqmp-sc-vn-p-b2197-00-revA-dtbs := zynqmp-sc-revB.dtb zynqmp-sc-vn-p-b2197-00-revA.dtbo + +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vek280-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vek280-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vhk158-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vpk120-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vpk180-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vpk180-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sc-vn-p-b2197-00-revA.dtb + +zynqmp-sm-k26-revA-sck-kv-g-revA-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kv-g-revA.dtbo +zynqmp-sm-k26-revA-sck-kv-g-revB-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kv-g-revB.dtbo +zynqmp-smk-k26-revA-sck-kv-g-revA-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kv-g-revA.dtbo +zynqmp-smk-k26-revA-sck-kv-g-revB-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kv-g-revB.dtbo + +zynqmp-sm-k26-revA-sck-kr-g-revA-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kr-g-revA.dtbo +zynqmp-sm-k26-revA-sck-kr-g-revB-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kr-g-revB.dtbo +zynqmp-smk-k26-revA-sck-kr-g-revA-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kr-g-revA.dtbo +zynqmp-smk-k26-revA-sck-kr-g-revB-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kr-g-revB.dtbo + +zynqmp-sm-k24-revA-sck-kd-g-revA-dtbs := zynqmp-sm-k24-revA.dtb zynqmp-sck-kd-g-revA.dtbo +zynqmp-smk-k24-revA-sck-kd-g-revA-dtbs := zynqmp-smk-k24-revA.dtb zynqmp-sck-kd-g-revA.dtbo +zynqmp-sm-k24-revA-sck-kv-g-revB-dtbs := zynqmp-sm-k24-revA.dtb zynqmp-sck-kv-g-revB.dtbo +zynqmp-smk-k24-revA-sck-kv-g-revB-dtbs := zynqmp-smk-k24-revA.dtb zynqmp-sck-kv-g-revB.dtbo +zynqmp-sm-k24-revA-sck-kr-g-revB-dtbs := zynqmp-sm-k24-revA.dtb zynqmp-sck-kr-g-revB.dtbo +zynqmp-smk-k24-revA-sck-kr-g-revB-dtbs := zynqmp-smk-k24-revA.dtb zynqmp-sck-kr-g-revB.dtbo + +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA-sck-kv-g-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA-sck-kv-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA-sck-kv-g-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA-sck-kv-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA-sck-kr-g-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA-sck-kr-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA-sck-kr-g-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA-sck-kr-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k24-revA-sck-kd-g-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k24-revA-sck-kd-g-revA.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k24-revA-sck-kv-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k24-revA-sck-kv-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k24-revA-sck-kr-g-revB.dtb +dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k24-revA-sck-kr-g-revB.dtb + dtb-$(CONFIG_ARCH_VERSAL) += \ versal-mini.dtb \ versal-mini-emmc0.dtb \ @@ -812,6 +856,7 @@ dtb-y += \ imx6q-icore-rqs.dtb \ imx6q-kp.dtb \ imx6q-logicpd.dtb \ + imx6q-lxr.dtb \ imx6q-marsboard.dtb \ imx6q-mccmon6.dtb\ imx6q-nitrogen6x.dtb \ diff --git a/arch/arm/dts/imx6q-lxr.dts b/arch/arm/dts/imx6q-lxr.dts new file mode 100644 index 00000000000..ae4f8eeb105 --- /dev/null +++ b/arch/arm/dts/imx6q-lxr.dts @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// +// Copyright 2024 Comvetia AG + +/dts-v1/; +#include "imx6q-phytec-pfla02.dtsi" + +/ { + model = "COMVETIA QSoIP LXR-2"; + compatible = "comvetia,imx6q-lxr", "phytec,imx6q-pfla02", "fsl,imx6q"; + + chosen { + stdout-path = &uart4; + }; + + spi { + compatible = "spi-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi_gpio>; + sck-gpios = <&gpio5 8 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio5 7 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + #address-cells = <1>; + #size-cells = <0>; + + fpga@0 { + compatible = "altr,fpga-passive-serial"; + reg = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fpga>; + nconfig-gpios = <&gpio4 18 GPIO_ACTIVE_LOW>; + nstat-gpios = <&gpio4 19 GPIO_ACTIVE_LOW>; + confd-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&ecspi3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ecspi3>; + cs-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + }; +}; + +&fec { + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&usdhc3 { + no-1-8-v; + status = "okay"; +}; + +&iomuxc { + pinctrl_fpga: fpgagrp { + fsl,pins = < + MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x1b0b0 + MX6QDL_PAD_DI0_PIN2__GPIO4_IO18 0x1b0b0 + MX6QDL_PAD_DI0_PIN3__GPIO4_IO19 0x1b0b0 + >; + }; + + pinctrl_spi_gpio: spigpiogrp { + fsl,pins = < + MX6QDL_PAD_DISP0_DAT14__GPIO5_IO08 0x1b0b0 + MX6QDL_PAD_DISP0_DAT13__GPIO5_IO07 0x1b0b0 + >; + }; +}; diff --git a/arch/arm/dts/imx6q-phytec-pfla02.dtsi b/arch/arm/dts/imx6q-phytec-pfla02.dtsi new file mode 100644 index 00000000000..500944bd2a0 --- /dev/null +++ b/arch/arm/dts/imx6q-phytec-pfla02.dtsi @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright 2013 Christian Hemp, Phytec Messtechnik GmbH + */ + +#include "imx6q.dtsi" +#include "imx6qdl-phytec-pfla02.dtsi" + +/ { + model = "Phytec phyFLEX-i.MX6 Quad"; + compatible = "phytec,imx6q-pfla02", "fsl,imx6q"; + + memory@10000000 { + device_type = "memory"; + reg = <0x10000000 0x80000000>; + }; +}; diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi new file mode 100644 index 00000000000..c0c47adc586 --- /dev/null +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi @@ -0,0 +1,467 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright 2013 Christian Hemp, Phytec Messtechnik GmbH + */ + +#include <dt-bindings/gpio/gpio.h> + +/ { + model = "Phytec phyFLEX-i.MX6 Quad"; + compatible = "phytec,imx6q-pfla02", "fsl,imx6q"; + + memory@10000000 { + device_type = "memory"; + reg = <0x10000000 0x80000000>; + }; + + reg_usb_otg_vbus: regulator-usb-otg-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_otg_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio4 15 0>; + enable-active-high; + }; + + reg_usb_h1_vbus: regulator-usb-h1-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1_vbus>; + regulator-name = "usb_h1_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 0 0>; + enable-active-high; + }; + + gpio_leds: leds { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + compatible = "gpio-leds"; + + led_green: led-green { + label = "phyflex:green"; + gpios = <&gpio1 30 0>; + }; + + led_red: led-red { + label = "phyflex:red"; + gpios = <&gpio2 31 0>; + }; + }; +}; + +&audmux { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_audmux>; + status = "disabled"; +}; + +&can1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flexcan1>; + status = "disabled"; +}; + +&ecspi3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ecspi3>; + status = "okay"; + cs-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>; + + som_flash: flash@0 { + compatible = "m25p80", "jedec,spi-nor"; + spi-max-frequency = <20000000>; + reg = <0>; + }; +}; + +&fec { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_enet>; + phy-handle = <ðphy>; + phy-mode = "rgmii"; + phy-reset-duration = <10>; /* in msecs */ + phy-reset-gpios = <&gpio3 23 GPIO_ACTIVE_LOW>; + phy-supply = <&vdd_eth_io_reg>; + status = "disabled"; + + fec_mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethphy: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + txc-skew-ps = <1680>; + rxc-skew-ps = <1860>; + }; + }; +}; + +&gpmi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpmi_nand>; + nand-on-flash-bbt; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + status = "okay"; + + som_eeprom: eeprom@50 { + compatible = "catalyst,24c32", "atmel,24c32"; + pagesize = <32>; + reg = <0x50>; + }; + + pmic@58 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pmic>; + compatible = "dlg,da9063"; + reg = <0x58>; + interrupt-parent = <&gpio2>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; /* active-low GPIO2_9 */ + #interrupt-cells = <2>; + interrupt-controller; + + regulators { + vddcore_reg: bcore1 { + regulator-min-microvolt = <730000>; + regulator-max-microvolt = <1380000>; + regulator-always-on; + }; + + vddsoc_reg: bcore2 { + regulator-min-microvolt = <730000>; + regulator-max-microvolt = <1380000>; + regulator-always-on; + }; + + vdd_ddr3_reg: bpro { + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + + vdd_3v3_reg: bperi { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vdd_buckmem_reg: bmem { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vdd_eth_reg: bio { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + }; + + vdd_eth_io_reg: ldo4 { + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + vdd_mx6_snvs_reg: ldo5 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + }; + + vdd_3v3_pmic_io_reg: ldo6 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vdd_sd0_reg: ldo9 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + vdd_sd1_reg: ldo10 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + vdd_mx6_high_reg: ldo11 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + }; + }; + + da9063_rtc: rtc { + compatible = "dlg,da9063-rtc"; + }; + + da9063_wdog: watchdog { + compatible = "dlg,da9063-watchdog"; + }; + + onkey { + compatible = "dlg,da9063-onkey"; + status = "disabled"; + }; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + clock-frequency = <100000>; +}; + +&i2c3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3>; + clock-frequency = <100000>; +}; + +&iomuxc { + imx6q-phytec-pfla02 { + pinctrl_ecspi3: ecspi3grp { + fsl,pins = < + MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO 0x100b1 + MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI 0x100b1 + MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK 0x100b1 + MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24 0x80000000 /* CS0 */ + >; + }; + + pinctrl_enet: enetgrp { + fsl,pins = < + MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0 + MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0 + MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b030 + MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b030 + MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b030 + MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b030 + MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b030 + MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b030 + MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0 + MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b030 + MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b030 + MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b030 + MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b030 + MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b030 + MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b030 + MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x1b0b0 + MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000 /* Reset GPIO */ + >; + }; + + pinctrl_flexcan1: flexcan1grp { + fsl,pins = < + MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x1b0b0 + MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX 0x1b0b0 + >; + }; + + pinctrl_gpmi_nand: gpminandgrp { + fsl,pins = < + MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1 + MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1 + MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1 + MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000 + MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1 + MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1 + MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1 + MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1 + MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1 + MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1 + MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1 + MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1 + MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1 + MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1 + MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1 + MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1 + MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1 + >; + }; + + pinctrl_i2c1: i2c1grp { + fsl,pins = < + MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1 + MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1 + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1 + MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1 + >; + }; + + pinctrl_i2c3: i2c3grp { + fsl,pins = < + MX6QDL_PAD_EIM_D17__I2C3_SCL 0x4001b8b1 + MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1 + >; + }; + + pinctrl_leds: ledsgrp { + fsl,pins = < + MX6QDL_PAD_ENET_TXD0__GPIO1_IO30 0x80000000 /* Green LED */ + MX6QDL_PAD_EIM_EB3__GPIO2_IO31 0x80000000 /* Red LED */ + >; + }; + + pinctrl_pcie: pciegrp { + fsl,pins = <MX6QDL_PAD_DI0_PIN15__GPIO4_IO17 0x80000000>; + }; + + pinctrl_pmic: pmicgrp { + fsl,pins = <MX6QDL_PAD_SD4_DAT1__GPIO2_IO09 0x80000000>; /* PMIC interrupt */ + }; + + pinctrl_uart3: uart3grp { + fsl,pins = < + MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1 + MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1 + MX6QDL_PAD_EIM_D31__UART3_RTS_B 0x1b0b1 + MX6QDL_PAD_EIM_D30__UART3_CTS_B 0x1b0b1 + >; + }; + + pinctrl_uart4: uart4grp { + fsl,pins = < + MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1 + MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1 + >; + }; + + pinctrl_usbh1_vbus: usbh1vbusgrp { + fsl,pins = < + MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x1b0b0 + >; + }; + + pinctrl_usbotg: usbotggrp { + fsl,pins = < + MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 + MX6QDL_PAD_KEY_COL4__USB_OTG_OC 0x1b0b0 + MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 + >; + }; + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < + MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059 + MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059 + MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059 + MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059 + MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059 + MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059 + >; + }; + + pinctrl_usdhc3: usdhc3grp { + fsl,pins = < + MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059 + MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059 + MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059 + MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059 + MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059 + MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059 + >; + }; + + pinctrl_usdhc3_cdwp: usdhc3cdwp { + fsl,pins = < + MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x80000000 + MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 + >; + }; + + pinctrl_audmux: audmuxgrp { + fsl,pins = < + MX6QDL_PAD_DISP0_DAT16__AUD5_TXC 0x130b0 + MX6QDL_PAD_DISP0_DAT17__AUD5_TXD 0x110b0 + MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS 0x130b0 + MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x130b0 + >; + }; + }; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie>; + reset-gpio = <&gpio4 17 GPIO_ACTIVE_LOW>; + status = "disabled"; +}; + +®_arm { + vin-supply = <&vddcore_reg>; +}; + +®_pu { + vin-supply = <&vddsoc_reg>; +}; + +®_soc { + vin-supply = <&vddsoc_reg>; +}; + +&uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart3>; + uart-has-rtscts; + status = "disabled"; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart4>; + status = "disabled"; +}; + +&usbh1 { + vbus-supply = <®_usb_h1_vbus>; + status = "disabled"; +}; + +&usbotg { + vbus-supply = <®_usb_otg_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg>; + disable-over-current; + status = "disabled"; +}; + +&usdhc2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc2>; + cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + vmmc-supply = <&vdd_sd1_reg>; + status = "disabled"; +}; + +&usdhc3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc3 + &pinctrl_usdhc3_cdwp>; + cd-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; + wp-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; + vmmc-supply = <&vdd_sd0_reg>; + status = "disabled"; +}; + +&wdog1 { + /* + * Rely on PMIC reboot handler. Internal i.MX6 watchdog, that is also + * used for reboot, does not reset all external PMIC voltages on reset. + */ + status = "disabled"; +}; diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi index c02e11def5f..d31bc822532 100644 --- a/arch/arm/dts/imx8mm-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-u-boot.dtsi @@ -122,6 +122,7 @@ binman_imx_fit: fit { description = "Configuration to load ATF before U-Boot"; + filename = "u-boot.itb"; #ifndef CONFIG_IMX_HAB fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; #endif diff --git a/arch/arm/dts/imx8mn-u-boot.dtsi b/arch/arm/dts/imx8mn-u-boot.dtsi index 732191f5205..6875c6d44ff 100644 --- a/arch/arm/dts/imx8mn-u-boot.dtsi +++ b/arch/arm/dts/imx8mn-u-boot.dtsi @@ -193,6 +193,7 @@ binman_imx_fit: fit { description = "Configuration to load ATF before U-Boot"; + filename = "u-boot.itb"; #ifndef CONFIG_IMX_HAB fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; #endif diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi b/arch/arm/dts/imx8mp-u-boot.dtsi index f2655a4d0c8..56749ccacd2 100644 --- a/arch/arm/dts/imx8mp-u-boot.dtsi +++ b/arch/arm/dts/imx8mp-u-boot.dtsi @@ -148,6 +148,7 @@ binman_imx_fit: fit { description = "Configuration to load ATF before U-Boot"; + filename = "u-boot.itb"; #ifndef CONFIG_IMX_HAB fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; #endif diff --git a/arch/arm/dts/imx8mq-u-boot.dtsi b/arch/arm/dts/imx8mq-u-boot.dtsi index e1cd6f8996d..d7a83a78f4d 100644 --- a/arch/arm/dts/imx8mq-u-boot.dtsi +++ b/arch/arm/dts/imx8mq-u-boot.dtsi @@ -106,11 +106,14 @@ binman_imx_fit: fit { description = "Configuration to load ATF before U-Boot"; + filename = "u-boot.itb"; #ifndef CONFIG_IMX_HAB fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; #endif #address-cells = <1>; + offset = <0x57c00>; + images { uboot { arch = "arm64"; diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi index 884f44239e1..27851b7d083 100644 --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi @@ -64,6 +64,10 @@ bootph-all; }; +&chipid { + bootph-all; +}; + &mcu_ringacc { reg = <0x0 0x2b800000 0x0 0x400000>, <0x0 0x2b000000 0x0 0x400000>, diff --git a/arch/arm/dts/r8a779g0-u-boot.dtsi b/arch/arm/dts/r8a779g0-u-boot.dtsi index cc8becac996..f60eba531e4 100644 --- a/arch/arm/dts/r8a779g0-u-boot.dtsi +++ b/arch/arm/dts/r8a779g0-u-boot.dtsi @@ -8,7 +8,6 @@ #include "r8a779x-u-boot.dtsi" &rpc { - reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x04000000>; bank-width = <2>; num-cs = <1>; }; diff --git a/arch/arm/dts/r8a779g0-white-hawk-u-boot.dtsi b/arch/arm/dts/r8a779g0-white-hawk-u-boot.dtsi index a102639010d..c3704d789e8 100644 --- a/arch/arm/dts/r8a779g0-white-hawk-u-boot.dtsi +++ b/arch/arm/dts/r8a779g0-white-hawk-u-boot.dtsi @@ -13,29 +13,9 @@ }; }; -&pfc { - qspi0_pins: qspi0 { - groups = "qspi0_ctrl", "qspi0_data4"; - function = "qspi0"; - }; -}; - &rpc { - pinctrl-0 = <&qspi0_pins>; - pinctrl-names = "default"; - - #address-cells = <1>; - #size-cells = <0>; - spi-max-frequency = <40000000>; - status = "disabled"; - - spi-flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "s25fs512s", "jedec,spi-nor"; - reg = <0>; + flash@0 { spi-tx-bus-width = <1>; spi-rx-bus-width = <1>; - spi-max-frequency = <40000000>; }; }; diff --git a/arch/arm/dts/versal-mini-emmc0.dts b/arch/arm/dts/versal-mini-emmc0.dts index 60b1c0e1fc4..b98ed16bc5f 100644 --- a/arch/arm/dts/versal-mini-emmc0.dts +++ b/arch/arm/dts/versal-mini-emmc0.dts @@ -28,7 +28,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <0x2>; diff --git a/arch/arm/dts/versal-mini-emmc1.dts b/arch/arm/dts/versal-mini-emmc1.dts index 751cc38ee5c..e6a5c2b699e 100644 --- a/arch/arm/dts/versal-mini-emmc1.dts +++ b/arch/arm/dts/versal-mini-emmc1.dts @@ -28,7 +28,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <0x2>; diff --git a/arch/arm/dts/versal-mini-ospi.dtsi b/arch/arm/dts/versal-mini-ospi.dtsi index 8735292a127..9ca0cf3c027 100644 --- a/arch/arm/dts/versal-mini-ospi.dtsi +++ b/arch/arm/dts/versal-mini-ospi.dtsi @@ -28,7 +28,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <0x2>; diff --git a/arch/arm/dts/versal-mini-qspi.dtsi b/arch/arm/dts/versal-mini-qspi.dtsi index 9347ea32c9c..57427e099f9 100644 --- a/arch/arm/dts/versal-mini-qspi.dtsi +++ b/arch/arm/dts/versal-mini-qspi.dtsi @@ -28,7 +28,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <0x2>; diff --git a/arch/arm/dts/zynq-cse-nand.dts b/arch/arm/dts/zynq-cse-nand.dts index 18f627f3d72..f1fb15902a7 100644 --- a/arch/arm/dts/zynq-cse-nand.dts +++ b/arch/arm/dts/zynq-cse-nand.dts @@ -31,7 +31,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/dts/zynq-cse-nor.dts b/arch/arm/dts/zynq-cse-nor.dts index a5c8a0813ff..8e60d17b944 100644 --- a/arch/arm/dts/zynq-cse-nor.dts +++ b/arch/arm/dts/zynq-cse-nor.dts @@ -31,7 +31,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/dts/zynq-cse-qspi.dtsi b/arch/arm/dts/zynq-cse-qspi.dtsi index 2e4afafebf5..3b7e6c79874 100644 --- a/arch/arm/dts/zynq-cse-qspi.dtsi +++ b/arch/arm/dts/zynq-cse-qspi.dtsi @@ -32,7 +32,7 @@ bootph-all; }; - amba: amba { + amba: axi { bootph-all; compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/dts/zynqmp-dlc21-revA.dts b/arch/arm/dts/zynqmp-dlc21-revA.dts index 2076271ac99..293d8e97b63 100644 --- a/arch/arm/dts/zynqmp-dlc21-revA.dts +++ b/arch/arm/dts/zynqmp-dlc21-revA.dts @@ -87,7 +87,6 @@ status = "okay"; phy-handle = <&phy0>; phy-mode = "sgmii"; /* DTG generates this properly 1512 */ - is-internal-pcspma; mdio: mdio { #address-cells = <1>; #size-cells = <0>; @@ -118,7 +117,7 @@ "USB1_DATA7", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */ "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "VCCO_500_RBIAS", "VCCO_501_RBIAS", "VCCO_502_RBIAS", "VCCO_500_RBIAS_LED", /* 95 - 99 */ "VCCO_501_RBIAS_LED", "VCCO_502_RBIAS_LED", "SYSCTLR_VCCINT_EN", "SYSCTLR_VCC_IO_SOC_EN", "SYSCTLR_VCC_PMC_EN", /* 100 - 104 */ diff --git a/arch/arm/dts/zynqmp-e-a2197-00-revA.dts b/arch/arm/dts/zynqmp-e-a2197-00-revA.dts index 0b97fa3f28a..4e0587fd441 100644 --- a/arch/arm/dts/zynqmp-e-a2197-00-revA.dts +++ b/arch/arm/dts/zynqmp-e-a2197-00-revA.dts @@ -155,7 +155,6 @@ phys = <&psgtr 0 PHY_TYPE_SGMII 0 0>; phy-handle = <&phy0>; phy-mode = "sgmii"; - is-internal-pcspma; mdio: mdio { #address-cells = <1>; #size-cells = <0>; diff --git a/arch/arm/dts/zynqmp-g-a2197-00-revA.dts b/arch/arm/dts/zynqmp-g-a2197-00-revA.dts index 36a0db44fd2..c439f778ca4 100644 --- a/arch/arm/dts/zynqmp-g-a2197-00-revA.dts +++ b/arch/arm/dts/zynqmp-g-a2197-00-revA.dts @@ -80,7 +80,6 @@ status = "okay"; phy-handle = <&phy0>; phy-mode = "sgmii"; - is-internal-pcspma; mdio: mdio { #address-cells = <1>; #size-cells = <0>; @@ -112,7 +111,7 @@ "", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */ "SYSCTLR_VERSAL_MODE0", "SYSCTLR_VERSAL_MODE1", /* 78 - 79 */ "SYSCTLR_VERSAL_MODE2", "SYSCTLR_VERSAL_MODE3", "SYSCTLR_POR_B_LS", "DC_PRSNT", "SYSCTLR_POWER_EN", /* 80 - 84 */ - "SYSCTLR_JTAG_S0", "SYSCTLR_JTAG_S1", "SYSCTLR_IIC_MUX0_RESET_B", "SYSCTLR_IIC_MUX1_RESET_B", "SYSCTLR_LP_I2C_SM_ALERT", /* 85 -89 */ + "SYSCTLR_JTAG_S0", "SYSCTLR_JTAG_S1", "SYSCTLR_IIC_MUX0_RESET_B", "SYSCTLR_IIC_MUX1_RESET_B", "SYSCTLR_LP_I2C_SM_ALERT", /* 85 - 89 */ "SYSCTLR_GPIO0", "SYSCTLR_GPIO1", "SYSCTLR_GPIO2", "SYSCTLR_GPIO3", "SYSCTLR_GPIO4", /* 90 - 94 */ "SYSCTLR_GPIO5", "VCCO_500_RBIAS", "VCCO_501_RBIAS", "VCCO_502_RBIAS", "VCCO_500_RBIAS_LED", /* 95 - 99 */ "VCCO_501_RBIAS_LED", "VCCO_502_RBIAS_LED", "SYSCTLR_VCCINT_EN", "SYSCTLR_VCC_IO_SOC_EN", "SYSCTLR_VCC_PMC_EN", /* 100 - 104 */ diff --git a/arch/arm/dts/zynqmp-m-a2197-01-revA.dts b/arch/arm/dts/zynqmp-m-a2197-01-revA.dts index 83b8a98d80c..d6cd193a449 100644 --- a/arch/arm/dts/zynqmp-m-a2197-01-revA.dts +++ b/arch/arm/dts/zynqmp-m-a2197-01-revA.dts @@ -101,7 +101,7 @@ }; &sdhci1 { /* sd1 MIO45-51 cd in place */ - status = "disable"; + status = "disabled"; no-1-8-v; disable-wp; xlnx,mio-bank = <1>; @@ -140,9 +140,9 @@ "USB1_DIR", "USB1_DATA2", "USB1_NXT", "USB1_DATA0", "USB1_DATA1", /* 65 - 69 */ "USB1_STP", "USB1_DATA3", "USB1_DATA4", "USB1_DATA5", "USB1_DATA6", /* 70 - 74 */ "USB1_DATA7", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */ - "", "", "", "", "", /* 78 - 79 */ + "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "", "", "", "", /* 95 - 99 */ "", "", "", "", "", /* 100 - 104 */ @@ -300,7 +300,7 @@ i2c@3 { /* MEM PMBUS - FIXME bug in schematics */ #address-cells = <1>; #size-cells = <0>; - /* reg = <3>; */ + reg = <3>; }; i2c@4 { /* LP_I2C_SM */ #address-cells = <1>; @@ -365,25 +365,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-m-a2197-02-revA.dts b/arch/arm/dts/zynqmp-m-a2197-02-revA.dts index dd37b726d3d..902fdd4de6c 100644 --- a/arch/arm/dts/zynqmp-m-a2197-02-revA.dts +++ b/arch/arm/dts/zynqmp-m-a2197-02-revA.dts @@ -97,7 +97,7 @@ }; &sdhci1 { /* sd1 MIO45-51 cd in place */ - status = "disable"; + status = "disabled"; no-1-8-v; disable-wp; xlnx,mio-bank = <1>; @@ -135,9 +135,9 @@ "USB1_DIR", "USB1_DATA2", "USB1_NXT", "USB1_DATA0", "USB1_DATA1", /* 65 - 69 */ "USB1_STP", "USB1_DATA3", "USB1_DATA4", "USB1_DATA5", "USB1_DATA6", /* 70 - 74 */ "USB1_DATA7", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */ - "", "", "", "", "", /* 78 - 79 */ + "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "", "", "", "", /* 95 - 99 */ "", "", "", "", "", /* 100 - 104 */ @@ -288,7 +288,7 @@ i2c@3 { /* MEM PMBUS - FIXME bug in schematics */ #address-cells = <1>; #size-cells = <0>; - /* reg = <3>; */ + reg = <3>; }; i2c@4 { /* LP_I2C_SM */ #address-cells = <1>; @@ -367,25 +367,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-m-a2197-03-revA.dts b/arch/arm/dts/zynqmp-m-a2197-03-revA.dts index 811cebafe9e..f3994bca4a0 100644 --- a/arch/arm/dts/zynqmp-m-a2197-03-revA.dts +++ b/arch/arm/dts/zynqmp-m-a2197-03-revA.dts @@ -97,7 +97,7 @@ }; &sdhci1 { /* sd1 MIO45-51 cd in place */ - status = "disable"; + status = "disabled"; no-1-8-v; disable-wp; xlnx,mio-bank = <1>; @@ -135,9 +135,9 @@ "USB1_DIR", "USB1_DATA2", "USB1_NXT", "USB1_DATA0", "USB1_DATA1", /* 65 - 69 */ "USB1_STP", "USB1_DATA3", "USB1_DATA4", "USB1_DATA5", "USB1_DATA6", /* 70 - 74 */ "USB1_DATA7", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */ - "", "", "", "", "", /* 78 - 79 */ + "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "", "", "", "", /* 95 - 99 */ "", "", "", "", "", /* 100 - 104 */ @@ -292,7 +292,7 @@ i2c@3 { /* MEM PMBUS - FIXME bug in schematics */ #address-cells = <1>; #size-cells = <0>; - /* reg = <3>; */ + reg = <3>; }; i2c@4 { /* LP_I2C_SM */ #address-cells = <1>; @@ -361,25 +361,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-mini-emmc0.dts b/arch/arm/dts/zynqmp-mini-emmc0.dts index 7823c58cb27..cf2219797a5 100644 --- a/arch/arm/dts/zynqmp-mini-emmc0.dts +++ b/arch/arm/dts/zynqmp-mini-emmc0.dts @@ -41,13 +41,13 @@ clock-frequency = <200000000>; }; - amba: amba { + amba: axi { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <2>; ranges; - sdhci0: sdhci@ff160000 { + sdhci0: mmc@ff160000 { bootph-all; compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a"; status = "disabled"; diff --git a/arch/arm/dts/zynqmp-mini-emmc1.dts b/arch/arm/dts/zynqmp-mini-emmc1.dts index 2f6ba95073a..4c9f56a8076 100644 --- a/arch/arm/dts/zynqmp-mini-emmc1.dts +++ b/arch/arm/dts/zynqmp-mini-emmc1.dts @@ -41,13 +41,13 @@ clock-frequency = <200000000>; }; - amba: amba { + amba: axi { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <2>; ranges; - sdhci1: sdhci@ff170000 { + sdhci1: mmc@ff170000 { bootph-all; compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a"; status = "disabled"; diff --git a/arch/arm/dts/zynqmp-mini-nand.dts b/arch/arm/dts/zynqmp-mini-nand.dts index e08a7840d8e..5e2135158cd 100644 --- a/arch/arm/dts/zynqmp-mini-nand.dts +++ b/arch/arm/dts/zynqmp-mini-nand.dts @@ -35,7 +35,7 @@ bootph-all; }; - amba: amba { + amba: axi { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <1>; diff --git a/arch/arm/dts/zynqmp-mini-qspi.dts b/arch/arm/dts/zynqmp-mini-qspi.dts index e35317f3e2d..917603dec61 100644 --- a/arch/arm/dts/zynqmp-mini-qspi.dts +++ b/arch/arm/dts/zynqmp-mini-qspi.dts @@ -36,7 +36,13 @@ bootph-all; }; - amba: amba { + misc_clk: misc-clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + }; + + amba: axi { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <1>; @@ -52,19 +58,13 @@ #address-cells = <1>; #size-cells = <0>; }; - - misc_clk: misc-clk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <125000000>; - }; }; }; &qspi { status = "okay"; flash0: flash@0 { - compatible = "n25q512a11", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; #address-cells = <1>; #size-cells = <1>; reg = <0x0>; diff --git a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-01-revA.dtso b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-01-revA.dtso index 197dc252353..82cc383dc4c 100644 --- a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-01-revA.dtso +++ b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-01-revA.dtso @@ -33,25 +33,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-02-revA.dtso b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-02-revA.dtso index 8eb6e40dd9d..11b15447246 100644 --- a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-02-revA.dtso +++ b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-02-revA.dtso @@ -33,25 +33,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-03-revA.dtso b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-03-revA.dtso index af7a3ce9c1a..9b4c8b3520d 100644 --- a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-03-revA.dtso +++ b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-03-revA.dtso @@ -33,25 +33,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-04-revA.dtso b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-04-revA.dtso index 29a6c2a627b..1b1bb365080 100644 --- a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-04-revA.dtso +++ b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-04-revA.dtso @@ -33,25 +33,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-05-revA.dtso b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-05-revA.dtso index 6ddf18cf643..8c16286a033 100644 --- a/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-05-revA.dtso +++ b/arch/arm/dts/zynqmp-p-a2197-00-revA-x-prc-05-revA.dtso @@ -33,25 +33,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-p-a2197-00-revA.dts b/arch/arm/dts/zynqmp-p-a2197-00-revA.dts index 5a60b86a574..ae52e8e996a 100644 --- a/arch/arm/dts/zynqmp-p-a2197-00-revA.dts +++ b/arch/arm/dts/zynqmp-p-a2197-00-revA.dts @@ -90,7 +90,6 @@ status = "okay"; phy-handle = <&phy0>; phy-mode = "sgmii"; /* DTG generates this properly 1512 */ - is-internal-pcspma; mdio: mdio { #address-cells = <1>; #size-cells = <0>; @@ -121,7 +120,7 @@ "USB1_DATA7", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */ "SYSCTLR_VERSAL_MODE0", "SYSCTLR_VERSAL_MODE1", /* 78 - 79 */ "SYSCTLR_VERSAL_MODE2", "SYSCTLR_VERSAL_MODE3", "SYSCTLR_POR_B_LS", "DC_PRSNT", "SYSCTLR_POWER_EN", /* 80 - 84 */ - "SYSCTLR_JTAG_S0", "SYSCTLR_JTAG_S1", "SYSCTLR_IIC_MUX0_RESET_B", "SYSCTLR_IIC_MUX1_RESET_B", "SYSCTLR_LP_I2C_SM_ALERT", /* 85 -89 */ + "SYSCTLR_JTAG_S0", "SYSCTLR_JTAG_S1", "SYSCTLR_IIC_MUX0_RESET_B", "SYSCTLR_IIC_MUX1_RESET_B", "SYSCTLR_LP_I2C_SM_ALERT", /* 85 - 89 */ "SYSCTLR_GPIO0", "SYSCTLR_GPIO1", "SYSCTLR_GPIO2", "SYSCTLR_GPIO3", "SYSCTLR_GPIO4", /* 90 - 94 */ "SYSCTLR_GPIO5", "VCCO_500_RBIAS", "VCCO_501_RBIAS", "VCCO_502_RBIAS", "VCCO_500_RBIAS_LED", /* 95 - 99 */ "VCCO_501_RBIAS_LED", "VCCO_502_RBIAS_LED", "SYSCTLR_VCCINT_EN", "SYSCTLR_VCC_IO_SOC_EN", "SYSCTLR_VCC_PMC_EN", /* 100 - 104 */ @@ -427,25 +426,25 @@ #gpio-cells = <2>; gpio-line-names = "sw4_1", "sw4_2", "sw4_3", "sw4_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "sw4_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "sw4_2"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "sw4_3"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-sc-revB.dts b/arch/arm/dts/zynqmp-sc-revB.dts index c1d713b5d89..1fcb5bfb928 100644 --- a/arch/arm/dts/zynqmp-sc-revB.dts +++ b/arch/arm/dts/zynqmp-sc-revB.dts @@ -104,7 +104,7 @@ "", "", "ETH_RESET_B", /* 75 - 77, MIO end and EMIO start */ "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "", "", "", "", /* 95 - 99 */ "", "", "", "", "", /* 100 - 104 */ diff --git a/arch/arm/dts/zynqmp-sc-vn-p-b2197-00-revA.dtso b/arch/arm/dts/zynqmp-sc-vn-p-b2197-00-revA.dtso index 5333767361f..620afba06e6 100644 --- a/arch/arm/dts/zynqmp-sc-vn-p-b2197-00-revA.dtso +++ b/arch/arm/dts/zynqmp-sc-vn-p-b2197-00-revA.dtso @@ -115,25 +115,25 @@ #gpio-cells = <2>; gpio-line-names = "xprc_sw_1", "xprc_sw_2", "xprc_sw_3", "xprc_sw_4", "", "", "", ""; - gtr-sel0 { + gtr-sel0-hog { gpio-hog; gpios = <0 0>; input; /* FIXME add meaning */ line-name = "xprc_sw_1"; }; - gtr-sel1 { + gtr-sel1-hog { gpio-hog; gpios = <1 0>; input; /* FIXME add meaning */ line-name = "xprc_sw_1"; }; - gtr-sel2 { + gtr-sel2-hog { gpio-hog; gpios = <2 0>; input; /* FIXME add meaning */ line-name = "xprc_sw_1"; }; - gtr-sel3 { + gtr-sel3-hog { gpio-hog; gpios = <3 0>; input; /* FIXME add meaning */ diff --git a/arch/arm/dts/zynqmp-sc-vpk180-revA.dtso b/arch/arm/dts/zynqmp-sc-vpk180-revA.dtso index 18625933ad3..ba5484573c9 100644 --- a/arch/arm/dts/zynqmp-sc-vpk180-revA.dtso +++ b/arch/arm/dts/zynqmp-sc-vpk180-revA.dtso @@ -16,6 +16,12 @@ &{/} { compatible = "xlnx,zynqmp-sc-vpk180-revA", "xlnx,zynqmp-vpk180-revA", "xlnx,zynqmp-vpk180", "xlnx,zynqmp"; + + vc7_xin: vc7-xin { + compatible = "fixed-clock"; + #clock-cells = <0x0>; + clock-frequency = <50000000>; + }; }; &i2c0 { diff --git a/arch/arm/dts/zynqmp-sck-kr-g-revA.dtso b/arch/arm/dts/zynqmp-sck-kr-g-revA.dtso index ce7c5eb6d34..6349a0e1087 100644 --- a/arch/arm/dts/zynqmp-sck-kr-g-revA.dtso +++ b/arch/arm/dts/zynqmp-sck-kr-g-revA.dtso @@ -195,7 +195,6 @@ phys = <&psgtr 0 PHY_TYPE_SGMII 0 0>; phy-handle = <&phy0>; phy-mode = "sgmii"; - is-internal-pcspma; assigned-clock-rates = <250000000>; }; diff --git a/arch/arm/dts/zynqmp-sck-kr-g-revB.dtso b/arch/arm/dts/zynqmp-sck-kr-g-revB.dtso index 0a0cbd2b69a..b0d737d3caf 100644 --- a/arch/arm/dts/zynqmp-sck-kr-g-revB.dtso +++ b/arch/arm/dts/zynqmp-sck-kr-g-revB.dtso @@ -216,7 +216,6 @@ phys = <&psgtr 0 PHY_TYPE_SGMII 0 0>; phy-handle = <&phy0>; phy-mode = "sgmii"; - is-internal-pcspma; assigned-clock-rates = <250000000>; }; diff --git a/arch/arm/dts/zynqmp-vp-x-a2785-00-revA.dts b/arch/arm/dts/zynqmp-vp-x-a2785-00-revA.dts index b626d1aacf5..7849f8c540b 100644 --- a/arch/arm/dts/zynqmp-vp-x-a2785-00-revA.dts +++ b/arch/arm/dts/zynqmp-vp-x-a2785-00-revA.dts @@ -117,7 +117,6 @@ status = "okay"; phy-handle = <&phy0>; phy-mode = "sgmii"; /* DTG generates this properly 1512 */ - is-internal-pcspma; /* phys = <&psgtr 0 PHY_TYPE_SGMII 0 0>; */ mdio: mdio { #address-cells = <1>; diff --git a/arch/arm/dts/zynqmp-vpk120-revA.dts b/arch/arm/dts/zynqmp-vpk120-revA.dts index e0632883e4e..4768fac71d0 100644 --- a/arch/arm/dts/zynqmp-vpk120-revA.dts +++ b/arch/arm/dts/zynqmp-vpk120-revA.dts @@ -118,7 +118,6 @@ status = "okay"; phy-handle = <&phy0>; phy-mode = "sgmii"; /* DTG generates this properly 1512 */ - is-internal-pcspma; /* phys = <&psgtr 0 PHY_TYPE_SGMII 0 0>; */ mdio: mdio { #address-cells = <1>; diff --git a/arch/arm/dts/zynqmp-zcu106-rev1.0.dts b/arch/arm/dts/zynqmp-zcu106-rev1.0.dts index a9b5826a777..f1ec314fdef 100644 --- a/arch/arm/dts/zynqmp-zcu106-rev1.0.dts +++ b/arch/arm/dts/zynqmp-zcu106-rev1.0.dts @@ -11,6 +11,6 @@ / { model = "ZynqMP ZCU106 Rev1.0"; - compatible = "xlnx,zynqmp-zcu106-rev1.0", "xlnx,zynqmp-zcu106-revA", + compatible = "xlnx,zynqmp-zcu106-rev1.0", "xlnx,zynqmp-zcu106", "xlnx,zynqmp"; }; diff --git a/arch/arm/dts/zynqmp-zcu111-revA.dts b/arch/arm/dts/zynqmp-zcu111-revA.dts index 787cf0d87f9..3a1580dfc40 100644 --- a/arch/arm/dts/zynqmp-zcu111-revA.dts +++ b/arch/arm/dts/zynqmp-zcu111-revA.dts @@ -494,7 +494,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <5>; - sc18is603@2f { /* sc18is602 - u93 */ + sc18is603: spi@2f { /* sc18is602 - u93 */ compatible = "nxp,sc18is603"; reg = <0x2f>; /* 4 gpios for CS not handled by driver */ diff --git a/arch/arm/dts/zynqmp-zcu1275-revB.dts b/arch/arm/dts/zynqmp-zcu1275-revB.dts index 4060dc3613a..ed83ba32791 100644 --- a/arch/arm/dts/zynqmp-zcu1275-revB.dts +++ b/arch/arm/dts/zynqmp-zcu1275-revB.dts @@ -43,6 +43,7 @@ &gem1 { status = "okay"; + phy-mode = "rgmii-id"; mdio { #address-cells = <1>; #size-cells = <0>; diff --git a/arch/arm/dts/zynqmp-zcu208-revA.dts b/arch/arm/dts/zynqmp-zcu208-revA.dts index a113e475082..88536e917d9 100644 --- a/arch/arm/dts/zynqmp-zcu208-revA.dts +++ b/arch/arm/dts/zynqmp-zcu208-revA.dts @@ -68,7 +68,7 @@ compatible = "iio-hwmon"; io-channels = <&vccint 0>, <&vccint 1>, <&vccint 2>, <&vccint 3>; }; - ina226-vccint-io-bram-ps { + ina226-vccint-io-bram { compatible = "iio-hwmon"; io-channels = <&vccint_io_bram_ps 0>, <&vccint_io_bram_ps 1>, <&vccint_io_bram_ps 2>, <&vccint_io_bram_ps 3>; }; @@ -205,7 +205,7 @@ "ENET_RX_CTRL", "ENET_MDC", "ENET_MDIO", /* 75 - 77, MIO end and EMIO start */ "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "", "", "", "", /* 95 - 99 */ "", "", "", "", "", /* 100 - 104 */ diff --git a/arch/arm/dts/zynqmp-zcu216-revA.dts b/arch/arm/dts/zynqmp-zcu216-revA.dts index 4d7d5d2e5ef..29087aa7cb9 100644 --- a/arch/arm/dts/zynqmp-zcu216-revA.dts +++ b/arch/arm/dts/zynqmp-zcu216-revA.dts @@ -68,7 +68,7 @@ compatible = "iio-hwmon"; io-channels = <&vccint 0>, <&vccint 1>, <&vccint 2>, <&vccint 3>; }; - ina226-vccint-io-bram-ps { + ina226-vccint-io-bram { compatible = "iio-hwmon"; io-channels = <&vccint_io_bram_ps 0>, <&vccint_io_bram_ps 1>, <&vccint_io_bram_ps 2>, <&vccint_io_bram_ps 3>; }; @@ -211,7 +211,7 @@ "ENET_RX_CTRL", "ENET_MDC", "ENET_MDIO", /* 75 - 77, MIO end and EMIO start */ "", "", /* 78 - 79 */ "", "", "", "", "", /* 80 - 84 */ - "", "", "", "", "", /* 85 -89 */ + "", "", "", "", "", /* 85 - 89 */ "", "", "", "", "", /* 90 - 94 */ "", "", "", "", "", /* 95 - 99 */ "", "", "", "", "", /* 100 - 104 */ diff --git a/arch/arm/dts/zynqmp-zcu670-revA.dts b/arch/arm/dts/zynqmp-zcu670-revA.dts index def3b53cef7..2928ebe56fc 100644 --- a/arch/arm/dts/zynqmp-zcu670-revA.dts +++ b/arch/arm/dts/zynqmp-zcu670-revA.dts @@ -71,7 +71,7 @@ compatible = "iio-hwmon"; io-channels = <&vccint 0>, <&vccint 1>, <&vccint 2>, <&vccint 3>; }; - ina226-vccint-io-bram-ps { + ina226-vccint-io-bram { compatible = "iio-hwmon"; io-channels = <&vccint_io_bram_ps 0>, <&vccint_io_bram_ps 1>, <&vccint_io_bram_ps 2>, <&vccint_io_bram_ps 3>; }; diff --git a/arch/arm/dts/zynqmp-zcu670-revB.dts b/arch/arm/dts/zynqmp-zcu670-revB.dts index 41f9a23d06a..1a99d1e08fb 100644 --- a/arch/arm/dts/zynqmp-zcu670-revB.dts +++ b/arch/arm/dts/zynqmp-zcu670-revB.dts @@ -71,7 +71,7 @@ compatible = "iio-hwmon"; io-channels = <&vccint 0>, <&vccint 1>, <&vccint 2>, <&vccint 3>; }; - ina226-vccint-io-bram-ps { + ina226-vccint-io-bram { compatible = "iio-hwmon"; io-channels = <&vccint_io_bram_ps 0>, <&vccint_io_bram_ps 1>, <&vccint_io_bram_ps 2>, <&vccint_io_bram_ps 3>; }; diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h index cbd2717f97c..b0468a1a136 100644 --- a/arch/arm/include/asm/arch-imx/cpu.h +++ b/arch/arm/include/asm/arch-imx/cpu.h @@ -68,6 +68,8 @@ #define MXC_CPU_IMX9321 0xC6 /* dummy ID */ #define MXC_CPU_IMX9312 0xC7 /* dummy ID */ #define MXC_CPU_IMX9311 0xC8 /* dummy ID */ +#define MXC_CPU_IMX9302 0xC9 /* dummy ID */ +#define MXC_CPU_IMX9301 0xCA /* dummy ID */ #define MXC_SOC_MX6 0x60 #define MXC_SOC_MX7 0x70 diff --git a/arch/arm/include/asm/arch-imx9/clock.h b/arch/arm/include/asm/arch-imx9/clock.h index 1ce6ac4c3a8..76f12118592 100644 --- a/arch/arm/include/asm/arch-imx9/clock.h +++ b/arch/arm/include/asm/arch-imx9/clock.h @@ -211,7 +211,8 @@ struct imx_clk_setting { u32 div; }; -int clock_init(void); +int clock_init_early(void); +int clock_init_late(void); u32 get_clk_src_rate(enum ccm_clk_src source); u32 get_lpuart_clk(void); void init_uart_clk(u32 index); diff --git a/arch/arm/include/asm/arch-imx9/imx-regs.h b/arch/arm/include/asm/arch-imx9/imx-regs.h index 76d241eab09..ef9538bd42e 100644 --- a/arch/arm/include/asm/arch-imx9/imx-regs.h +++ b/arch/arm/include/asm/arch-imx9/imx-regs.h @@ -25,6 +25,7 @@ #define ANATOP_BASE_ADDR 0x44480000UL #define BLK_CTRL_WAKEUPMIX_BASE_ADDR 0x42420000 +#define BLK_CTRL_NS_ANOMIX_BASE_ADDR 0x44210000 #define BLK_CTRL_S_ANOMIX_BASE_ADDR 0x444f0000 #define SRC_IPS_BASE_ADDR (0x44460000) @@ -38,6 +39,7 @@ #define SRC_MIX_SLICE_FUNC_STAT_PSW_STAT BIT(0) #define SRC_MIX_SLICE_FUNC_STAT_RST_STAT BIT(2) #define SRC_MIX_SLICE_FUNC_STAT_ISO_STAT BIT(4) +#define SRC_MIX_SLICE_FUNC_STAT_SSAR_STAT BIT(8) #define SRC_MIX_SLICE_FUNC_STAT_MEM_STAT BIT(12) #define IMG_CONTAINER_BASE (0x80000000UL) @@ -48,8 +50,16 @@ #define BCTRL_GPR_ENET_QOS_INTF_SEL_RGMII (0x1 << 1) #define BCTRL_GPR_ENET_QOS_CLK_GEN_EN (0x1 << 0) +#define TRDC_AON_BASE (0x44270000UL) +#define TRDC_WAKEUP_BASE (0x42460000UL) +#define TRDC_MEGA_BASE (0x42810000UL) +#define TRDC_NIC_BASE (0x49010000UL) + #define MARKETING_GRADING_MASK GENMASK(5, 4) #define SPEED_GRADING_MASK GENMASK(11, 6) +#define NUM_WORDS_PER_BANK 8 +#define HW_CFG1 19 +#define HW_CFG2 20 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) #include <asm/types.h> diff --git a/arch/arm/include/asm/arch-imx9/sys_proto.h b/arch/arm/include/asm/arch-imx9/sys_proto.h index 2f7a1292758..e4bf6a63424 100644 --- a/arch/arm/include/asm/arch-imx9/sys_proto.h +++ b/arch/arm/include/asm/arch-imx9/sys_proto.h @@ -8,7 +8,18 @@ #include <asm/mach-imx/sys_proto.h> +enum imx9_soc_voltage_mode { + VOLT_LOW_DRIVE = 0, + VOLT_NOMINAL_DRIVE, + VOLT_OVER_DRIVE, +}; + void soc_power_init(void); bool m33_is_rom_kicked(void); int m33_prepare(void); + +enum imx9_soc_voltage_mode soc_target_voltage_mode(void); + +#define is_voltage_mode(mode) (soc_target_voltage_mode() == (mode)) + #endif diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 31ae179b211..31ace977d2b 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -85,7 +85,8 @@ struct bd_info; #define is_imx93() (is_cpu_type(MXC_CPU_IMX93) || is_cpu_type(MXC_CPU_IMX9331) || \ is_cpu_type(MXC_CPU_IMX9332) || is_cpu_type(MXC_CPU_IMX9351) || \ is_cpu_type(MXC_CPU_IMX9322) || is_cpu_type(MXC_CPU_IMX9321) || \ - is_cpu_type(MXC_CPU_IMX9312) || is_cpu_type(MXC_CPU_IMX9311)) + is_cpu_type(MXC_CPU_IMX9312) || is_cpu_type(MXC_CPU_IMX9311) || \ + is_cpu_type(MXC_CPU_IMX9302) || is_cpu_type(MXC_CPU_IMX9301)) #define is_imx9351() (is_cpu_type(MXC_CPU_IMX9351)) #define is_imx9332() (is_cpu_type(MXC_CPU_IMX9332)) #define is_imx9331() (is_cpu_type(MXC_CPU_IMX9331)) @@ -93,6 +94,8 @@ struct bd_info; #define is_imx9321() (is_cpu_type(MXC_CPU_IMX9321)) #define is_imx9312() (is_cpu_type(MXC_CPU_IMX9312)) #define is_imx9311() (is_cpu_type(MXC_CPU_IMX9311)) +#define is_imx9302() (is_cpu_type(MXC_CPU_IMX9302)) +#define is_imx9301() (is_cpu_type(MXC_CPU_IMX9301)) #define is_imxrt1020() (is_cpu_type(MXC_CPU_IMXRT1020)) #define is_imxrt1050() (is_cpu_type(MXC_CPU_IMXRT1050)) @@ -275,4 +278,7 @@ void enable_ca7_smp(void); enum boot_device get_boot_device(void); +int disable_cpu_nodes(void *blob, const char * const *nodes_path, + u32 num_disabled_cores, u32 max_cores); +int fixup_thermal_trips(void *blob, const char *name); #endif diff --git a/arch/arm/mach-at91/include/mach/at91_common.h b/arch/arm/mach-at91/include/mach/at91_common.h index 683e539b1b3..8fec346c1e4 100644 --- a/arch/arm/mach-at91/include/mach/at91_common.h +++ b/arch/arm/mach-at91/include/mach/at91_common.h @@ -28,7 +28,7 @@ void at91_pllb_init(u32 pllar); void at91_mck_init(u32 mckr); void at91_mck_init_down(u32 mckr); void at91_pmc_init(void); -void mem_init(void); +void at91_mem_init(void); void at91_phy_reset(void); void at91_sdram_hw_init(void); void at91_mck_init(u32 mckr); diff --git a/arch/arm/mach-at91/spl_at91.c b/arch/arm/mach-at91/spl_at91.c index cde1700a283..0d1233cd109 100644 --- a/arch/arm/mach-at91/spl_at91.c +++ b/arch/arm/mach-at91/spl_at91.c @@ -142,7 +142,7 @@ void board_init_f(ulong dummy) preloader_console_init(); #endif - mem_init(); + at91_mem_init(); at91_spl_board_init(); } diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c index 62a7df8a195..7bfbadf0483 100644 --- a/arch/arm/mach-at91/spl_atmel.c +++ b/arch/arm/mach-at91/spl_atmel.c @@ -134,7 +134,7 @@ void board_init_f(ulong dummy) board_early_init_f(); - mem_init(); + at91_mem_init(); ret = spl_init(); if (ret) { diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 5262dca4ffd..f8903afc92e 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -21,6 +21,12 @@ obj-$(CONFIG_IMX_HAB) += hab.o obj-y += cpu.o endif +ifeq ($(SOC),$(filter $(SOC),imx8m imx9)) +ifneq ($(CONFIG_SPL_BUILD),y) +obj-y += fdt.o +endif +endif + ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) obj-y += cpu.o speed.o ifneq ($(CONFIG_MX51),y) diff --git a/arch/arm/mach-imx/fdt.c b/arch/arm/mach-imx/fdt.c new file mode 100644 index 00000000000..ac782e3ee63 --- /dev/null +++ b/arch/arm/mach-imx/fdt.c @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include <errno.h> +#include <fdtdec.h> +#include <malloc.h> +#include <asm/arch/sys_proto.h> + +static void disable_thermal_cpu_nodes(void *blob, u32 num_disabled_cores, u32 max_cores) +{ + static const char * const thermal_path[] = { + "/thermal-zones/cpu-thermal/cooling-maps/map0" + }; + + int nodeoff, cnt, i, ret, j; + u32 num_le32 = max_cores * 3; + u32 *cooling_dev = (u32 *)malloc(num_le32 * sizeof(__le32)); + + if (!cooling_dev) { + printf("failed to alloc cooling dev\n"); + return; + } + + for (i = 0; i < ARRAY_SIZE(thermal_path); i++) { + nodeoff = fdt_path_offset(blob, thermal_path[i]); + if (nodeoff < 0) + continue; /* Not found, skip it */ + + cnt = fdtdec_get_int_array_count(blob, nodeoff, "cooling-device", + cooling_dev, num_le32); + if (cnt < 0) + continue; + + if (cnt != num_le32) + printf("Warning: %s, cooling-device count %d\n", thermal_path[i], cnt); + + for (j = 0; j < cnt; j++) + cooling_dev[j] = cpu_to_fdt32(cooling_dev[j]); + + ret = fdt_setprop(blob, nodeoff, "cooling-device", &cooling_dev, + sizeof(__le32) * (num_le32 - num_disabled_cores * 3)); + if (ret < 0) { + printf("Warning: %s, cooling-device setprop failed %d\n", + thermal_path[i], ret); + continue; + } + + printf("Update node %s, cooling-device prop\n", thermal_path[i]); + } + + free(cooling_dev); +} + +int disable_cpu_nodes(void *blob, const char * const *nodes_path, u32 num_disabled_cores, + u32 max_cores) +{ + u32 i = 0; + int rc; + int nodeoff; + + if (max_cores == 0 || (num_disabled_cores > (max_cores - 1))) + return -EINVAL; + + i = max_cores - num_disabled_cores; + + for (; i < max_cores; i++) { + nodeoff = fdt_path_offset(blob, nodes_path[i]); + if (nodeoff < 0) + continue; /* Not found, skip it */ + + debug("Found %s node\n", nodes_path[i]); + + rc = fdt_del_node(blob, nodeoff); + if (rc < 0) { + printf("Unable to delete node %s, err=%s\n", + nodes_path[i], fdt_strerror(rc)); + } else { + printf("Delete node %s\n", nodes_path[i]); + } + } + + disable_thermal_cpu_nodes(blob, num_disabled_cores, max_cores); + + return 0; +} + +int fixup_thermal_trips(void *blob, const char *name) +{ + int minc, maxc; + int node, trip; + + node = fdt_path_offset(blob, "/thermal-zones"); + if (node < 0) + return node; + + node = fdt_subnode_offset(blob, node, name); + if (node < 0) + return node; + + node = fdt_subnode_offset(blob, node, "trips"); + if (node < 0) + return node; + + get_cpu_temp_grade(&minc, &maxc); + + fdt_for_each_subnode(trip, blob, node) { + const char *type; + int temp, ret; + + type = fdt_getprop(blob, trip, "type", NULL); + if (!type) + continue; + + temp = 0; + if (!strcmp(type, "critical")) + temp = 1000 * (maxc - 5); + else if (!strcmp(type, "passive")) + temp = 1000 * (maxc - 10); + if (temp) { + ret = fdt_setprop_u32(blob, trip, "temperature", temp); + if (ret) + return ret; + } + } + + return 0; +} diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 986687e9ce4..46974bf0618 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1184,117 +1184,6 @@ int disable_dsp_nodes(void *blob) return disable_fdt_nodes(blob, nodes_path_8mp, ARRAY_SIZE(nodes_path_8mp)); } -static void disable_thermal_cpu_nodes(void *blob, u32 disabled_cores) -{ - static const char * const thermal_path[] = { - "/thermal-zones/cpu-thermal/cooling-maps/map0" - }; - - int nodeoff, cnt, i, ret, j; - u32 cooling_dev[12]; - - for (i = 0; i < ARRAY_SIZE(thermal_path); i++) { - nodeoff = fdt_path_offset(blob, thermal_path[i]); - if (nodeoff < 0) - continue; /* Not found, skip it */ - - cnt = fdtdec_get_int_array_count(blob, nodeoff, "cooling-device", cooling_dev, 12); - if (cnt < 0) - continue; - - if (cnt != 12) - printf("Warning: %s, cooling-device count %d\n", thermal_path[i], cnt); - - for (j = 0; j < cnt; j++) - cooling_dev[j] = cpu_to_fdt32(cooling_dev[j]); - - ret = fdt_setprop(blob, nodeoff, "cooling-device", &cooling_dev, - sizeof(u32) * (12 - disabled_cores * 3)); - if (ret < 0) { - printf("Warning: %s, cooling-device setprop failed %d\n", - thermal_path[i], ret); - continue; - } - - printf("Update node %s, cooling-device prop\n", thermal_path[i]); - } -} - -static void disable_pmu_cpu_nodes(void *blob, u32 disabled_cores) -{ - static const char * const pmu_path[] = { - "/pmu" - }; - - int nodeoff, cnt, i, ret, j; - u32 irq_affinity[4]; - - for (i = 0; i < ARRAY_SIZE(pmu_path); i++) { - nodeoff = fdt_path_offset(blob, pmu_path[i]); - if (nodeoff < 0) - continue; /* Not found, skip it */ - - cnt = fdtdec_get_int_array_count(blob, nodeoff, "interrupt-affinity", - irq_affinity, 4); - if (cnt < 0) - continue; - - if (cnt != 4) - printf("Warning: %s, interrupt-affinity count %d\n", pmu_path[i], cnt); - - for (j = 0; j < cnt; j++) - irq_affinity[j] = cpu_to_fdt32(irq_affinity[j]); - - ret = fdt_setprop(blob, nodeoff, "interrupt-affinity", &irq_affinity, - sizeof(u32) * (4 - disabled_cores)); - if (ret < 0) { - printf("Warning: %s, interrupt-affinity setprop failed %d\n", - pmu_path[i], ret); - continue; - } - - printf("Update node %s, interrupt-affinity prop\n", pmu_path[i]); - } -} - -static int disable_cpu_nodes(void *blob, u32 disabled_cores) -{ - static const char * const nodes_path[] = { - "/cpus/cpu@1", - "/cpus/cpu@2", - "/cpus/cpu@3", - }; - u32 i = 0; - int rc; - int nodeoff; - - if (disabled_cores > 3) - return -EINVAL; - - i = 3 - disabled_cores; - - for (; i < 3; i++) { - nodeoff = fdt_path_offset(blob, nodes_path[i]); - if (nodeoff < 0) - continue; /* Not found, skip it */ - - debug("Found %s node\n", nodes_path[i]); - - rc = fdt_del_node(blob, nodeoff); - if (rc < 0) { - printf("Unable to delete node %s, err=%s\n", - nodes_path[i], fdt_strerror(rc)); - } else { - printf("Delete node %s\n", nodes_path[i]); - } - } - - disable_thermal_cpu_nodes(blob, disabled_cores); - disable_pmu_cpu_nodes(blob, disabled_cores); - - return 0; -} - static int cleanup_nodes_for_efi(void *blob) { static const char * const path[][2] = { @@ -1326,48 +1215,6 @@ static int cleanup_nodes_for_efi(void *blob) return 0; } -static int fixup_thermal_trips(void *blob, const char *name) -{ - int minc, maxc; - int node, trip; - - node = fdt_path_offset(blob, "/thermal-zones"); - if (node < 0) - return node; - - node = fdt_subnode_offset(blob, node, name); - if (node < 0) - return node; - - node = fdt_subnode_offset(blob, node, "trips"); - if (node < 0) - return node; - - get_cpu_temp_grade(&minc, &maxc); - - fdt_for_each_subnode(trip, blob, node) { - const char *type; - int temp, ret; - - type = fdt_getprop(blob, trip, "type", NULL); - if (!type) - continue; - - temp = 0; - if (!strcmp(type, "critical")) - temp = 1000 * maxc; - else if (!strcmp(type, "passive")) - temp = 1000 * (maxc - 10); - if (temp) { - ret = fdt_setprop_u32(blob, trip, "temperature", temp); - if (ret) - return ret; - } - } - - return 0; -} - #define OPTEE_SHM_SIZE 0x00400000 static int ft_add_optee_node(void *fdt, struct bd_info *bd) { @@ -1446,6 +1293,13 @@ static int ft_add_optee_node(void *fdt, struct bd_info *bd) int ft_system_setup(void *blob, struct bd_info *bd) { + static const char * const nodes_path[] = { + "/cpus/cpu@0", + "/cpus/cpu@1", + "/cpus/cpu@2", + "/cpus/cpu@3", + }; + #ifdef CONFIG_IMX8MQ int i = 0; int rc; @@ -1489,13 +1343,6 @@ usb_modify_speed: /* Disable the CPU idle for A0 chip since the HW does not support it */ if (is_soc_rev(CHIP_REV_1_0)) { - static const char * const nodes_path[] = { - "/cpus/cpu@0", - "/cpus/cpu@1", - "/cpus/cpu@2", - "/cpus/cpu@3", - }; - for (i = 0; i < ARRAY_SIZE(nodes_path); i++) { nodeoff = fdt_path_offset(blob, nodes_path[i]); if (nodeoff < 0) @@ -1527,16 +1374,16 @@ usb_modify_speed: } if (is_imx8md()) - disable_cpu_nodes(blob, 2); + disable_cpu_nodes(blob, nodes_path, 2, 4); #elif defined(CONFIG_IMX8MM) if (is_imx8mml() || is_imx8mmdl() || is_imx8mmsl()) disable_vpu_nodes(blob); if (is_imx8mmd() || is_imx8mmdl()) - disable_cpu_nodes(blob, 2); + disable_cpu_nodes(blob, nodes_path, 2, 4); else if (is_imx8mms() || is_imx8mmsl()) - disable_cpu_nodes(blob, 3); + disable_cpu_nodes(blob, nodes_path, 3, 4); #elif defined(CONFIG_IMX8MN) if (is_imx8mnl() || is_imx8mndl() || is_imx8mnsl()) @@ -1553,9 +1400,9 @@ usb_modify_speed: #endif if (is_imx8mnd() || is_imx8mndl() || is_imx8mnud()) - disable_cpu_nodes(blob, 2); + disable_cpu_nodes(blob, nodes_path, 2, 4); else if (is_imx8mns() || is_imx8mnsl() || is_imx8mnus()) - disable_cpu_nodes(blob, 3); + disable_cpu_nodes(blob, nodes_path, 3, 4); #elif defined(CONFIG_IMX8MP) if (is_imx8mpul()) { @@ -1582,7 +1429,7 @@ usb_modify_speed: disable_dsp_nodes(blob); if (is_imx8mpd()) - disable_cpu_nodes(blob, 2); + disable_cpu_nodes(blob, nodes_path, 2, 4); #endif cleanup_nodes_for_efi(blob); diff --git a/arch/arm/mach-imx/imx9/Kconfig b/arch/arm/mach-imx/imx9/Kconfig index e892da80fe8..4d32c28670d 100644 --- a/arch/arm/mach-imx/imx9/Kconfig +++ b/arch/arm/mach-imx/imx9/Kconfig @@ -5,11 +5,6 @@ config AHAB_BOOT help This option enables the support for AHAB secure boot. -config IMX9_LOW_DRIVE_MODE - bool "Configure to i.MX9 low drive mode" - help - This option enables the settings for iMX9 low drive mode. - config IMX9 bool select BINMAN @@ -30,6 +25,7 @@ choice config TARGET_IMX93_11X11_EVK bool "imx93_11x11_evk" + select OF_BOARD_FIXUP select IMX93 imply OF_UPSTREAM diff --git a/arch/arm/mach-imx/imx9/clock.c b/arch/arm/mach-imx/imx9/clock.c index 0abf4579a1e..12685f970de 100644 --- a/arch/arm/mach-imx/imx9/clock.c +++ b/arch/arm/mach-imx/imx9/clock.c @@ -41,6 +41,7 @@ static struct imx_fracpll_rate_table imx9_fracpll_tbl[] = { FRAC_PLL_RATE(466000000U, 1, 155, 8, 1, 3), /* 466Mhz */ FRAC_PLL_RATE(400000000U, 1, 200, 12, 0, 1), /* 400Mhz */ FRAC_PLL_RATE(300000000U, 1, 150, 12, 0, 1), + FRAC_PLL_RATE(233000000U, 1, 174, 18, 3, 4), /* 233Mhz */ }; /* return in khz */ @@ -603,7 +604,7 @@ void init_clk_usdhc(u32 index) { u32 div; - if (IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE)) + if (is_voltage_mode(VOLT_LOW_DRIVE)) div = 3; /* 266.67 Mhz */ else div = 2; /* 400 Mhz */ @@ -700,8 +701,7 @@ void set_arm_core_max_clk(void) #endif -#if IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE) -struct imx_clk_setting imx_clk_settings[] = { +struct imx_clk_setting imx_clk_ld_settings[] = { /* Set A55 clk to 500M */ {ARM_A55_CLK_ROOT, SYS_PLL_PFD0, 2}, /* Set A55 periphal to 200M */ @@ -728,7 +728,7 @@ struct imx_clk_setting imx_clk_settings[] = { /* NIC_APB to 133M */ {NIC_APB_CLK_ROOT, SYS_PLL_PFD1_DIV2, 3} }; -#else + struct imx_clk_setting imx_clk_settings[] = { /* * Set A55 clk to 500M. This clock root is normally used as intermediate @@ -762,9 +762,18 @@ struct imx_clk_setting imx_clk_settings[] = { /* NIC_APB to 133M */ {NIC_APB_CLK_ROOT, SYS_PLL_PFD1_DIV2, 3} }; -#endif -int clock_init(void) +void bus_clock_init_low_drive(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx_clk_ld_settings); i++) { + ccm_clk_root_cfg(imx_clk_ld_settings[i].clk_root, + imx_clk_ld_settings[i].src, imx_clk_ld_settings[i].div); + } +} + +void bus_clock_init(void) { int i; @@ -772,9 +781,11 @@ int clock_init(void) ccm_clk_root_cfg(imx_clk_settings[i].clk_root, imx_clk_settings[i].src, imx_clk_settings[i].div); } +} - if (IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE)) - set_arm_clk(MHZ(900)); +int clock_init_early(void) +{ + int i; /* allow for non-secure access */ for (i = 0; i < OSCPLL_END; i++) @@ -792,6 +803,19 @@ int clock_init(void) return 0; } +/* Set bus and A55 core clock per voltage mode */ +int clock_init_late(void) +{ + if (is_voltage_mode(VOLT_LOW_DRIVE)) { + bus_clock_init_low_drive(); + set_arm_core_max_clk(); + } else { + bus_clock_init(); + } + + return 0; +} + int set_clk_eqos(enum enet_freq type) { u32 eqos_post_div; diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c index f88e7a222dd..04b21207a28 100644 --- a/arch/arm/mach-imx/imx9/soc.c +++ b/arch/arm/mach-imx/imx9/soc.c @@ -96,10 +96,16 @@ int mmc_get_env_dev(void) */ u32 get_cpu_speed_grade_hz(void) { - u32 speed, max_speed; + int ret; + u32 bank, word, speed, max_speed; u32 val; - fuse_read(2, 3, &val); + bank = HW_CFG1 / NUM_WORDS_PER_BANK; + word = HW_CFG1 % NUM_WORDS_PER_BANK; + ret = fuse_read(bank, word, &val); + if (ret) + val = 0; /* If read fuse failed, return as blank fuse */ + val = FIELD_GET(SPEED_GRADING_MASK, val) & 0xF; speed = MHZ(2300) - val * MHZ(100); @@ -122,9 +128,15 @@ u32 get_cpu_speed_grade_hz(void) */ u32 get_cpu_temp_grade(int *minc, int *maxc) { - u32 val; + int ret; + u32 bank, word, val; + + bank = HW_CFG1 / NUM_WORDS_PER_BANK; + word = HW_CFG1 % NUM_WORDS_PER_BANK; + ret = fuse_read(bank, word, &val); + if (ret) + val = 0; /* If read fuse failed, return as blank fuse */ - fuse_read(2, 3, &val); val = FIELD_GET(MARKETING_GRADING_MASK, val); if (minc && maxc) { @@ -160,13 +172,29 @@ static void set_cpu_info(struct ele_get_info_data *info) static u32 get_cpu_variant_type(u32 type) { - /* word 19 */ - u32 val = readl((ulong)FSB_BASE_ADDR + 0x8000 + (19 << 2)); - u32 val2 = readl((ulong)FSB_BASE_ADDR + 0x8000 + (20 << 2)); + u32 bank, word, val, val2; + int ret; + + bank = HW_CFG1 / NUM_WORDS_PER_BANK; + word = HW_CFG1 % NUM_WORDS_PER_BANK; + ret = fuse_read(bank, word, &val); + if (ret) + val = 0; /* If read fuse failed, return as blank fuse */ + + bank = HW_CFG2 / NUM_WORDS_PER_BANK; + word = HW_CFG2 % NUM_WORDS_PER_BANK; + ret = fuse_read(bank, word, &val2); + if (ret) + val2 = 0; /* If read fuse failed, return as blank fuse */ + bool npu_disable = !!(val & BIT(13)); bool core1_disable = !!(val & BIT(15)); u32 pack_9x9_fused = BIT(4) | BIT(17) | BIT(19) | BIT(24); + /* Low performance 93 part */ + if (((val >> 6) & 0x3F) == 0xE && npu_disable) + return core1_disable ? MXC_CPU_IMX9301 : MXC_CPU_IMX9302; + if ((val2 & pack_9x9_fused) == pack_9x9_fused) type = MXC_CPU_IMX9322; @@ -216,15 +244,9 @@ static void disable_wdog(void __iomem *wdog_base) void init_wdog(void) { - u32 src_val; - disable_wdog((void __iomem *)WDG3_BASE_ADDR); disable_wdog((void __iomem *)WDG4_BASE_ADDR); disable_wdog((void __iomem *)WDG5_BASE_ADDR); - - src_val = readl(0x54460018); /* reset mask */ - src_val &= ~0x1c; - writel(src_val, 0x54460018); } static struct mm_region imx93_mem_map[] = { @@ -480,12 +502,21 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) if (ret) goto err; - mac[0] = val[1] >> 24; - mac[1] = val[1] >> 16; - mac[2] = val[0] >> 24; - mac[3] = val[0] >> 16; - mac[4] = val[0] >> 8; - mac[5] = val[0]; + if (is_imx93() && is_soc_rev(CHIP_REV_1_0)) { + mac[0] = val[1] >> 24; + mac[1] = val[1] >> 16; + mac[2] = val[0] >> 24; + mac[3] = val[0] >> 16; + mac[4] = val[0] >> 8; + mac[5] = val[0]; + } else { + mac[0] = val[0] >> 24; + mac[1] = val[0] >> 16; + mac[2] = val[0] >> 8; + mac[3] = val[0]; + mac[4] = val[1] >> 24; + mac[5] = val[1] >> 16; + } } debug("%s: MAC%d: %02x.%02x.%02x.%02x.%02x.%02x\n", @@ -507,64 +538,152 @@ int print_cpuinfo(void) return 0; } -static int fixup_thermal_trips(void *blob, const char *name) +void build_info(void) +{ + u32 fw_version, sha1, res, status; + int ret; + + printf("\nBuildInfo:\n"); + + ret = ele_get_fw_status(&status, &res); + if (ret) { + printf(" - ELE firmware status failed %d, 0x%x\n", ret, res); + } else if ((status & 0xff) == 1) { + ret = ele_get_fw_version(&fw_version, &sha1, &res); + if (ret) { + printf(" - ELE firmware version failed %d, 0x%x\n", ret, res); + } else { + printf(" - ELE firmware version %u.%u.%u-%x", + (fw_version & (0x00ff0000)) >> 16, + (fw_version & (0x0000fff0)) >> 4, + (fw_version & (0x0000000f)), sha1); + ((fw_version & (0x80000000)) >> 31) == 1 ? puts("-dirty\n") : puts("\n"); + } + } else { + printf(" - ELE firmware not included\n"); + } + puts("\n"); +} + +int arch_misc_init(void) +{ + build_info(); + return 0; +} + +struct low_drive_freq_entry { + const char *node_path; + u32 clk; + u32 new_rate; +}; + +static int low_drive_fdt_fix_clock(void *fdt, int node_off, u32 clk_index, u32 new_rate) { - int minc, maxc; - int node, trip; +#define MAX_ASSIGNED_CLKS 8 + int cnt, j; + u32 assignedclks[MAX_ASSIGNED_CLKS]; /* max 8 clocks*/ - node = fdt_path_offset(blob, "/thermal-zones"); - if (node < 0) - return node; + cnt = fdtdec_get_int_array_count(fdt, node_off, "assigned-clock-rates", + assignedclks, MAX_ASSIGNED_CLKS); + if (cnt > 0) { + if (cnt <= clk_index) + return -ENOENT; - node = fdt_subnode_offset(blob, node, name); - if (node < 0) - return node; + if (assignedclks[clk_index] <= new_rate) + return 0; - node = fdt_subnode_offset(blob, node, "trips"); - if (node < 0) - return node; + assignedclks[clk_index] = new_rate; + for (j = 0; j < cnt; j++) + assignedclks[j] = cpu_to_fdt32(assignedclks[j]); - get_cpu_temp_grade(&minc, &maxc); + return fdt_setprop(fdt, node_off, "assigned-clock-rates", &assignedclks, + cnt * sizeof(u32)); + } - fdt_for_each_subnode(trip, blob, node) { - const char *type; - int temp, ret; + return -ENOENT; +} - type = fdt_getprop(blob, trip, "type", NULL); - if (!type) - continue; +static int low_drive_freq_update(void *blob) +{ + int nodeoff, ret; + int i; - temp = 0; - if (!strcmp(type, "critical")) - temp = 1000 * maxc; - else if (!strcmp(type, "passive")) - temp = 1000 * (maxc - 10); - if (temp) { - ret = fdt_setprop_u32(blob, trip, "temperature", temp); - if (ret) - return ret; + /* Update kernel dtb clocks for low drive mode */ + struct low_drive_freq_entry table[] = { + {"/soc@0/bus@42800000/mmc@42850000", 0, 266666667}, + {"/soc@0/bus@42800000/mmc@42860000", 0, 266666667}, + {"/soc@0/bus@42800000/mmc@428b0000", 0, 266666667}, + }; + + for (i = 0; i < ARRAY_SIZE(table); i++) { + nodeoff = fdt_path_offset(blob, table[i].node_path); + if (nodeoff >= 0) { + ret = low_drive_fdt_fix_clock(blob, nodeoff, table[i].clk, + table[i].new_rate); + if (!ret) + printf("%s freq updated\n", table[i].node_path); + } + } + + return 0; +} + +#ifdef CONFIG_OF_BOARD_FIXUP +#ifndef CONFIG_SPL_BUILD +int board_fix_fdt(void *fdt) +{ + /* Update dtb clocks for low drive mode */ + if (is_voltage_mode(VOLT_LOW_DRIVE)) { + int nodeoff; + int i; + + struct low_drive_freq_entry table[] = { + {"/soc@0/bus@42800000/mmc@42850000", 0, 266666667}, + {"/soc@0/bus@42800000/mmc@42860000", 0, 266666667}, + {"/soc@0/bus@42800000/mmc@428b0000", 0, 266666667}, + }; + + for (i = 0; i < ARRAY_SIZE(table); i++) { + nodeoff = fdt_path_offset(fdt, table[i].node_path); + if (nodeoff >= 0) + low_drive_fdt_fix_clock(fdt, nodeoff, table[i].clk, + table[i].new_rate); } } return 0; } +#endif +#endif int ft_system_setup(void *blob, struct bd_info *bd) { + static const char * const nodes_path[] = { + "/cpus/cpu@0", + "/cpus/cpu@100", + }; + if (fixup_thermal_trips(blob, "cpu-thermal")) printf("Failed to update cpu-thermal trip(s)"); + if (is_imx9351() || is_imx9331() || is_imx9321() || is_imx9311() || is_imx9301()) + disable_cpu_nodes(blob, nodes_path, 1, 2); + + if (is_voltage_mode(VOLT_LOW_DRIVE)) + low_drive_freq_update(blob); + return 0; } #if defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) void get_board_serial(struct tag_serialnr *serialnr) { - printf("UID: 0x%x 0x%x 0x%x 0x%x\n", - gd->arch.uid[0], gd->arch.uid[1], gd->arch.uid[2], gd->arch.uid[3]); + printf("UID: %08x%08x%08x%08x\n", __be32_to_cpu(gd->arch.uid[0]), + __be32_to_cpu(gd->arch.uid[1]), __be32_to_cpu(gd->arch.uid[2]), + __be32_to_cpu(gd->arch.uid[3])); - serialnr->low = gd->arch.uid[0]; - serialnr->high = gd->arch.uid[3]; + serialnr->low = __be32_to_cpu(gd->arch.uid[1]); + serialnr->high = __be32_to_cpu(gd->arch.uid[0]); } #endif @@ -586,7 +705,7 @@ int arch_cpu_init(void) /* Disable wdog */ init_wdog(); - clock_init(); + clock_init_early(); trdc_early_init(); @@ -752,7 +871,7 @@ static int mix_power_init(enum mix_power_domain pd) /* power on */ clrbits_le32(&mix_regs->slice_sw_ctrl, BIT(31)); val = readl(&mix_regs->func_stat); - while (val & SRC_MIX_SLICE_FUNC_STAT_ISO_STAT) + while (val & SRC_MIX_SLICE_FUNC_STAT_SSAR_STAT) val = readl(&mix_regs->func_stat); return 0; @@ -792,7 +911,7 @@ int m33_prepare(void) (struct src_general_regs *)(ulong)SRC_GLOBAL_RBASE; struct blk_ctrl_s_aonmix_regs *s_regs = (struct blk_ctrl_s_aonmix_regs *)BLK_CTRL_S_ANOMIX_BASE_ADDR; - u32 val; + u32 val, i; if (m33_is_rom_kicked()) return -EPERM; @@ -817,6 +936,18 @@ int m33_prepare(void) /* Set ELE LP handshake for M33 reset */ setbits_le32(&s_regs->lp_handshake[0], BIT(6)); + /* OSCCA enabled, reconfigure TRDC for TCM access, otherwise ECC init will raise error */ + val = readl(BLK_CTRL_NS_ANOMIX_BASE_ADDR + 0x28); + if (val & BIT(0)) { + trdc_mbc_set_control(0x44270000, 1, 0, 0x6600); + + for (i = 0; i < 32; i++) + trdc_mbc_blk_config(0x44270000, 1, 3, 0, i, true, 0); + + for (i = 0; i < 32; i++) + trdc_mbc_blk_config(0x44270000, 1, 3, 1, i, true, 0); + } + /* Clear M33 TCM for ECC */ memset((void *)(ulong)0x201e0000, 0, 0x40000); @@ -864,3 +995,22 @@ int psci_sysreset_get_status(struct udevice *dev, char *buf, int size) return 0; } + +enum imx9_soc_voltage_mode soc_target_voltage_mode(void) +{ + u32 speed = get_cpu_speed_grade_hz(); + enum imx9_soc_voltage_mode voltage = VOLT_OVER_DRIVE; + + if (is_imx93()) { + if (speed == 1700000000) + voltage = VOLT_OVER_DRIVE; + else if (speed == 1400000000) + voltage = VOLT_NOMINAL_DRIVE; + else if (speed == 900000000 || speed == 800000000) + voltage = VOLT_LOW_DRIVE; + else + printf("Unexpected A55 freq %u, default to OD\n", speed); + } + + return voltage; +} diff --git a/arch/arm/mach-imx/imx9/trdc.c b/arch/arm/mach-imx/imx9/trdc.c index 8cdb28459a3..ef0f8b52a4d 100644 --- a/arch/arm/mach-imx/imx9/trdc.c +++ b/arch/arm/mach-imx/imx9/trdc.c @@ -4,12 +4,13 @@ */ #include <log.h> +#include <div64.h> +#include <hang.h> #include <linux/errno.h> #include <asm/io.h> #include <asm/types.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> -#include <div64.h> #include <asm/mach-imx/ele_api.h> #include <asm/mach-imx/mu_hal.h> @@ -18,6 +19,26 @@ #define MRC_MAX_NUM 2 #define MBC_NUM(HWCFG) (((HWCFG) >> 16) & 0xF) #define MRC_NUM(HWCFG) (((HWCFG) >> 24) & 0x1F) +#define MBC_BLK_NUM(GLBCFG) ((GLBCFG) & 0x3FF) + +enum { + /* Order following ELE API Spec, not change */ + TRDC_A, + TRDC_W, + TRDC_M, + TRDC_N, +}; + +/* Just make it easier to know what the parameter is */ +#define MBC(X) (X) +#define MRC(X) (X) +#define GLOBAL_ID(X) (X) +#define MEM(X) (X) +#define DOM(X) (X) +/* + *0|SPR|SPW|SPX,0|SUR|SUW|SWX, 0|NPR|NPW|NPX, 0|NUR|NUW|NUX + */ +#define PERM(X) (X) struct mbc_mem_dom { u32 mem_glbcfg[4]; @@ -134,6 +155,22 @@ static ulong trdc_get_mrc_base(ulong trdc_reg, u32 mrc_x) return trdc_reg + 0x10000 + 0x2000 * mbc_num + 0x1000 * mrc_x; } +static u32 trdc_mbc_blk_num(ulong trdc_reg, u32 mbc_x, u32 mem_x) +{ + struct trdc_mbc *mbc_base = (struct trdc_mbc *)trdc_get_mbc_base(trdc_reg, mbc_x); + struct mbc_mem_dom *mbc_dom; + u32 glbcfg; + + if (mbc_base == 0) + return 0; + + /* only first dom has the glbcfg */ + mbc_dom = &mbc_base->mem_dom[0]; + glbcfg = readl((uintptr_t)&mbc_dom->mem_glbcfg[mem_x]); + + return MBC_BLK_NUM(glbcfg); +} + int trdc_mbc_set_control(ulong trdc_reg, u32 mbc_x, u32 glbac_id, u32 glbac_val) { struct trdc_mbc *mbc_base = (struct trdc_mbc *)trdc_get_mbc_base(trdc_reg, mbc_x); @@ -363,69 +400,87 @@ int release_rdc(u8 xrdc) void trdc_early_init(void) { int ret = 0, i; + u32 blks; - ret |= release_rdc(0); - ret |= release_rdc(2); - ret |= release_rdc(1); - ret |= release_rdc(3); + ret |= release_rdc(TRDC_A); + ret |= release_rdc(TRDC_M); + ret |= release_rdc(TRDC_W); + ret |= release_rdc(TRDC_N); - if (!ret) { - /* Set OCRAM to RWX for secure, when OEM_CLOSE, the image is RX only */ - trdc_mbc_set_control(0x49010000, 3, 0, 0x7700); + if (ret) { + hang(); + return; + } + + /* Set OCRAM to RWX for secure, when OEM_CLOSE, the image is RX only */ + trdc_mbc_set_control(TRDC_NIC_BASE, MBC(3), GLOBAL_ID(0), PERM(0x7700)); - for (i = 0; i < 40; i++) - trdc_mbc_blk_config(0x49010000, 3, 3, 0, i, true, 0); + blks = trdc_mbc_blk_num(TRDC_NIC_BASE, MBC(3), MEM(0)); + for (i = 0; i < blks; i++) { + trdc_mbc_blk_config(TRDC_NIC_BASE, MBC(3), DOM(3), MEM(0), i, + true, GLOBAL_ID(0)); - for (i = 0; i < 40; i++) - trdc_mbc_blk_config(0x49010000, 3, 3, 1, i, true, 0); + trdc_mbc_blk_config(TRDC_NIC_BASE, MBC(3), DOM(3), MEM(1), i, + true, GLOBAL_ID(0)); - for (i = 0; i < 40; i++) - trdc_mbc_blk_config(0x49010000, 3, 0, 0, i, true, 0); + trdc_mbc_blk_config(TRDC_NIC_BASE, MBC(3), DOM(0), MEM(0), i, + true, GLOBAL_ID(0)); - for (i = 0; i < 40; i++) - trdc_mbc_blk_config(0x49010000, 3, 0, 1, i, true, 0); + trdc_mbc_blk_config(TRDC_NIC_BASE, MBC(3), DOM(0), MEM(1), i, + true, GLOBAL_ID(0)); } } void trdc_init(void) { /* TRDC mega */ - if (trdc_mrc_enabled(0x49010000)) { + if (trdc_mrc_enabled(TRDC_NIC_BASE)) { /* DDR */ - trdc_mrc_set_control(0x49010000, 0, 0, 0x7777); + trdc_mrc_set_control(TRDC_NIC_BASE, MRC(0), GLOBAL_ID(0), PERM(0x7777)); /* ELE */ - trdc_mrc_region_config(0x49010000, 0, 0, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(0), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* MTR */ - trdc_mrc_region_config(0x49010000, 0, 1, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(1), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* M33 */ - trdc_mrc_region_config(0x49010000, 0, 2, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(2), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* A55*/ - trdc_mrc_region_config(0x49010000, 0, 3, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(3), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* For USDHC1 to DDR, USDHC1 is default force to non-secure */ - trdc_mrc_region_config(0x49010000, 0, 5, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(5), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* For USDHC2 to DDR, USDHC2 is default force to non-secure */ - trdc_mrc_region_config(0x49010000, 0, 6, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(6), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* eDMA */ - trdc_mrc_region_config(0x49010000, 0, 7, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(7), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /*CoreSight, TestPort*/ - trdc_mrc_region_config(0x49010000, 0, 8, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(8), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /* DAP */ - trdc_mrc_region_config(0x49010000, 0, 9, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(9), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /*SoC masters */ - trdc_mrc_region_config(0x49010000, 0, 10, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(10), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); /*USB*/ - trdc_mrc_region_config(0x49010000, 0, 11, 0x80000000, 0xFFFFFFFF, false, 0); + trdc_mrc_region_config(TRDC_NIC_BASE, MRC(0), DOM(11), 0x80000000, + 0xFFFFFFFF, false, GLOBAL_ID(0)); } } @@ -504,78 +559,78 @@ void trdc_dump(void) printf("TRDC AONMIX MBC\n"); - trdc_mbc_control_dump(0x44270000, 0, 0); - trdc_mbc_control_dump(0x44270000, 1, 0); + trdc_mbc_control_dump(TRDC_AON_BASE, MBC(0), GLOBAL_ID(0)); + trdc_mbc_control_dump(TRDC_AON_BASE, MBC(1), GLOBAL_ID(0)); for (i = 0; i < 11; i++) - trdc_mbc_mem_dump(0x44270000, 0, 3, 0, i); + trdc_mbc_mem_dump(TRDC_AON_BASE, MBC(0), DOM(3), MEM(0), i); for (i = 0; i < 1; i++) - trdc_mbc_mem_dump(0x44270000, 0, 3, 1, i); + trdc_mbc_mem_dump(TRDC_AON_BASE, MBC(0), DOM(3), MEM(1), i); for (i = 0; i < 4; i++) - trdc_mbc_mem_dump(0x44270000, 1, 3, 0, i); + trdc_mbc_mem_dump(TRDC_AON_BASE, MBC(1), DOM(3), MEM(0), i); for (i = 0; i < 4; i++) - trdc_mbc_mem_dump(0x44270000, 1, 3, 1, i); + trdc_mbc_mem_dump(TRDC_AON_BASE, MBC(1), DOM(3), MEM(1), i); printf("TRDC WAKEUP MBC\n"); - trdc_mbc_control_dump(0x42460000, 0, 0); - trdc_mbc_control_dump(0x42460000, 1, 0); + trdc_mbc_control_dump(TRDC_WAKEUP_BASE, MBC(0), GLOBAL_ID(0)); + trdc_mbc_control_dump(TRDC_WAKEUP_BASE, MBC(1), GLOBAL_ID(0)); for (i = 0; i < 15; i++) - trdc_mbc_mem_dump(0x42460000, 0, 3, 0, i); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, MBC(0), DOM(3), MEM(0), i); - trdc_mbc_mem_dump(0x42460000, 0, 3, 1, 0); - trdc_mbc_mem_dump(0x42460000, 0, 3, 2, 0); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, MBC(0), DOM(3), MEM(1), 0); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, 0, 3, 2, 0); for (i = 0; i < 2; i++) - trdc_mbc_mem_dump(0x42460000, 1, 3, 0, i); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, MBC(1), DOM(3), MEM(0), i); - trdc_mbc_mem_dump(0x42460000, 1, 3, 1, 0); - trdc_mbc_mem_dump(0x42460000, 1, 3, 2, 0); - trdc_mbc_mem_dump(0x42460000, 1, 3, 3, 0); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, MBC(1), DOM(3), MEM(1), 0); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, 1, 3, 2, 0); + trdc_mbc_mem_dump(TRDC_WAKEUP_BASE, MBC(1), DOM(3), MEM(3), 0); printf("TRDC NICMIX MBC\n"); - trdc_mbc_control_dump(0x49010000, 0, 0); - trdc_mbc_control_dump(0x49010000, 1, 0); - trdc_mbc_control_dump(0x49010000, 2, 0); - trdc_mbc_control_dump(0x49010000, 3, 0); + trdc_mbc_control_dump(TRDC_NIC_BASE, MBC(0), GLOBAL_ID(0)); + trdc_mbc_control_dump(TRDC_NIC_BASE, MBC(1), GLOBAL_ID(0)); + trdc_mbc_control_dump(TRDC_NIC_BASE, MBC(2), GLOBAL_ID(0)); + trdc_mbc_control_dump(TRDC_NIC_BASE, MBC(3), GLOBAL_ID(0)); for (i = 0; i < 7; i++) - trdc_mbc_mem_dump(0x49010000, 0, 3, 0, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(0), DOM(3), MEM(0), i); for (i = 0; i < 2; i++) - trdc_mbc_mem_dump(0x49010000, 0, 3, 1, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(0), DOM(3), MEM(1), i); for (i = 0; i < 5; i++) - trdc_mbc_mem_dump(0x49010000, 0, 3, 2, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(0), DOM(3), MEM(2), i); for (i = 0; i < 6; i++) - trdc_mbc_mem_dump(0x49010000, 0, 3, 3, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(0), DOM(3), MEM(3), i); for (i = 0; i < 1; i++) - trdc_mbc_mem_dump(0x49010000, 1, 3, 0, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(1), DOM(3), MEM(0), i); for (i = 0; i < 1; i++) - trdc_mbc_mem_dump(0x49010000, 1, 3, 1, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(1), DOM(3), MEM(1), i); for (i = 0; i < 3; i++) - trdc_mbc_mem_dump(0x49010000, 1, 3, 2, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(1), DOM(3), MEM(2), i); for (i = 0; i < 3; i++) - trdc_mbc_mem_dump(0x49010000, 1, 3, 3, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(1), DOM(3), MEM(3), i); for (i = 0; i < 2; i++) - trdc_mbc_mem_dump(0x49010000, 2, 3, 0, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(2), DOM(3), MEM(0), i); for (i = 0; i < 2; i++) - trdc_mbc_mem_dump(0x49010000, 2, 3, 1, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(2), DOM(3), MEM(1), i); for (i = 0; i < 5; i++) - trdc_mbc_mem_dump(0x49010000, 3, 3, 0, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(3), DOM(3), MEM(0), i); for (i = 0; i < 5; i++) - trdc_mbc_mem_dump(0x49010000, 3, 3, 1, i); + trdc_mbc_mem_dump(TRDC_NIC_BASE, MBC(3), DOM(3), MEM(1), i); } #endif diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig index 7a567672251..1f8022ee685 100644 --- a/arch/arm/mach-imx/mx6/Kconfig +++ b/arch/arm/mach-imx/mx6/Kconfig @@ -541,6 +541,16 @@ config TARGET_LITEBOARD select BOARD_LATE_INIT select MX6UL_LITESOM +config TARGET_LXR2 + bool "Comvetia i.MX6Q LXR2" + depends on MX6Q + select BOARD_EARLY_INIT_F + select BOARD_LATE_INIT + select DM + select DM_THERMAL + select SUPPORT_SPL + imply CMD_DM + config TARGET_PCM058 bool "Phytec PCM058 i.MX6 Quad" depends on MX6Q @@ -696,6 +706,7 @@ source "board/boundary/nitrogen6x/Kconfig" source "board/bsh/imx6ulz_smm_m2/Kconfig" source "board/bticino/mamoj/Kconfig" source "board/compulab/cm_fx6/Kconfig" +source "board/comvetia/lxr2/Kconfig" source "board/dhelectronics/dh_imx6/Kconfig" source "board/embest/mx6boards/Kconfig" source "board/engicam/imx6q/Kconfig" diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 4a8328760eb..c1a1a333e6c 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -149,6 +149,7 @@ config TARGET_TURRIS_OMNIA select SPL_SYS_MALLOC_SIMPLE select SYS_I2C_MVTWSI select ATSHA204A + select I2C_EEPROM select ARMADA_38X_SUPPORT_OLD_DDR3_TRAINING config TARGET_TURRIS_MOX diff --git a/arch/arm/mach-omap2/omap3/emac.c b/arch/arm/mach-omap2/omap3/emac.c index 7348e92cabd..1e30a06361d 100644 --- a/arch/arm/mach-omap2/omap3/emac.c +++ b/arch/arm/mach-omap2/omap3/emac.c @@ -9,6 +9,7 @@ #include <net.h> #include <asm/io.h> #include <asm/arch/am35x_def.h> +#include <netdev.h> /* * Initializes on-chip ethernet controllers. diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index 8a57b8217ff..3fadf7e4122 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -25,7 +25,7 @@ #include <part.h> #include <ram.h> #include <syscon.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <u-boot/crc.h> #include <u-boot/sha256.h> #include <asm/cache.h> @@ -202,14 +202,6 @@ int board_late_init(void) int board_init(void) { - int ret; - -#ifdef CONFIG_DM_REGULATOR - ret = regulators_enable_boot_on(false); - if (ret) - debug("%s: Cannot enable boot on regulator\n", __func__); -#endif - return 0; } diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 0af297470a6..2ab2ceb5138 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -237,7 +237,6 @@ void __weak qcom_board_init(void) int board_init(void) { - regulators_enable_boot_on(false); show_psci_version(); qcom_of_fixup_nodes(); qcom_board_init(); diff --git a/arch/arm/mach-stm32mp/stm32mp1/psci.c b/arch/arm/mach-stm32mp/stm32mp1/psci.c index bfbf420fdb5..a02a8988a68 100644 --- a/arch/arm/mach-stm32mp/stm32mp1/psci.c +++ b/arch/arm/mach-stm32mp/stm32mp1/psci.c @@ -393,8 +393,7 @@ static int __secure secure_waitbits(u32 reg, u32 mask, u32 val) asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (start)); for (;;) { tmp = readl(reg); - tmp &= mask; - if ((tmp & val) == val) + if ((tmp & mask) == val) return 0; asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (end)); if ((end - start) > delay) diff --git a/arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c b/arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c index f096fe538d8..ca202bec8ee 100644 --- a/arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c +++ b/arch/arm/mach-stm32mp/stm32mp1/stm32mp15x.c @@ -148,8 +148,8 @@ static void security_init(void) */ clrsetbits_le32(TAMP_SMCR, TAMP_SMCR_BKPRWDPROT | TAMP_SMCR_BKPWDPROT, - FIELD_PREP(TAMP_SMCR_BKPRWDPROT, 0x20) | - FIELD_PREP(TAMP_SMCR_BKPWDPROT, 0x20)); + FIELD_PREP(TAMP_SMCR_BKPRWDPROT, 0x0A) | + FIELD_PREP(TAMP_SMCR_BKPWDPROT, 0x0F)); /* GPIOZ: deactivate the security */ writel(BIT(0), RCC_MP_AHB5ENSETR); diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index 7971e3b68d5..5c5838629b2 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -187,9 +187,6 @@ int board_init(void) warmboot_prepare_code(TEGRA_LP0_ADDR, TEGRA_LP0_SIZE); #endif - /* Set up boot-on regulators */ - regulators_enable_boot_on(_DEBUG); - return nvidia_board_init(); } diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h index 8cb6494e52c..49e449ebd61 100644 --- a/arch/arm/mach-zynqmp/include/mach/hardware.h +++ b/arch/arm/mach-zynqmp/include/mach/hardware.h @@ -42,6 +42,8 @@ #define CRLAPB_DBG_LPD_CTRL_SETUP_CLK 0x01002002 #define CRLAPB_RST_LPD_DBG_RESET 0 +#define CRL_APB_SOFT_RESET_CTRL_MASK 0x10 + struct crlapb_regs { u32 reserved0[36]; u32 cpu_r5_ctrl; /* 0x90 */ @@ -51,7 +53,9 @@ struct crlapb_regs { u32 timestamp_ref_ctrl; /* 0x128 */ u32 reserved3[53]; u32 boot_mode; /* 0x200 */ - u32 reserved4_0[7]; + u32 reserved4_0[5]; + u32 soft_reset; /* 0x218 */ + u32 reserved4_10; u32 reset_reason; /* 0x220 */ u32 reserved4_1[6]; u32 rst_lpd_top; /* 0x23C */ @@ -63,6 +67,8 @@ struct crlapb_regs { #define crlapb_base ((struct crlapb_regs *)ZYNQMP_CRL_APB_BASEADDR) +#define ZYNQMP_IOU_SECURE_SLCR 0xFF240000 + #define ZYNQMP_IOU_SCNTR_SECURE 0xFF260000 #define ZYNQMP_IOU_SCNTR_COUNTER_CONTROL_REGISTER_EN 0x1 #define ZYNQMP_IOU_SCNTR_COUNTER_CONTROL_REGISTER_HDBG 0x2 @@ -126,6 +132,9 @@ struct crfapb_regs { #define crfapb_base ((struct crfapb_regs *)ZYNQMP_CRF_APB_BASEADDR) +#define ZYNQMP_CCI_REG_CCI_MISC_CTRL 0xFD5E0040 +#define ZYNQMP_CCI_REG_CCI_MISC_CTRL_NIDEN BIT(1) + #define ZYNQMP_APU_BASEADDR 0xFD5C0000 struct apu_regs { diff --git a/arch/arm/mach-zynqmp/zynqmp.c b/arch/arm/mach-zynqmp/zynqmp.c index bf39c5472ea..3b4d9c60e5c 100644 --- a/arch/arm/mach-zynqmp/zynqmp.c +++ b/arch/arm/mach-zynqmp/zynqmp.c @@ -340,6 +340,30 @@ static int do_zynqmp_sha3(struct cmd_tbl *cmdtp, int flag, return CMD_RET_SUCCESS; } +static int do_zynqmp_reboot(struct cmd_tbl *cmdtp, int flag, + int argc, char * const argv[]) +{ + u32 multiboot; + int ret; + + if (argc != cmdtp->maxargs) + return CMD_RET_USAGE; + + multiboot = hextoul(argv[2], NULL); + + ret = zynqmp_mmio_write(0xFFCA0010, 0xfff, multiboot); + if (ret != 0) { + printf("Failed: mmio write\n"); + return ret; + } + + /* issue soft reset */ + writel(CRL_APB_SOFT_RESET_CTRL_MASK, &crlapb_base->soft_reset); + + /* never get here */ + return CMD_RET_SUCCESS; +} + static struct cmd_tbl cmd_zynqmp_sub[] = { U_BOOT_CMD_MKENT(secure, 5, 0, do_zynqmp_verify_secure, "", ""), U_BOOT_CMD_MKENT(pmufw, 4, 0, do_zynqmp_pmufw, "", ""), @@ -348,6 +372,7 @@ static struct cmd_tbl cmd_zynqmp_sub[] = { U_BOOT_CMD_MKENT(aes, 9, 0, do_zynqmp_aes, "", ""), U_BOOT_CMD_MKENT(rsa, 7, 0, do_zynqmp_rsa, "", ""), U_BOOT_CMD_MKENT(sha3, 5, 0, do_zynqmp_sha3, "", ""), + U_BOOT_CMD_MKENT(reboot, 3, 0, do_zynqmp_reboot, "", ""), #ifdef CONFIG_DEFINE_TCM_OCM_MMAP U_BOOT_CMD_MKENT(tcminit, 3, 0, do_zynqmp_tcm_init, "", ""), #endif @@ -387,6 +412,7 @@ U_BOOT_LONGHELP(zynqmp, " long at address $src. Optional key_addr\n" " can be specified if user key needs to\n" " be used for decryption\n" + "zynqmp reboot multiboot - soft reboot to multiboot offset\n" "zynqmp mmio_read address - read from address\n" "zynqmp mmio_write address mask value - write value after masking to\n" " address\n" diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index fa3b016c527..fa371027d45 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -46,6 +46,9 @@ config TARGET_TH1520_LPI4A config TARGET_XILINX_MBV bool "Support AMD/Xilinx MicroBlaze V" +config TARGET_ASPEED_AST2700_IBEX + bool "Support Ibex RISC-V cores on Aspeed AST2700 SoC" + endchoice config SYS_ICACHE_OFF @@ -81,6 +84,7 @@ config SPL_ZERO_MEM_BEFORE_USE # board-specific options below source "board/andestech/ae350/Kconfig" +source "board/aspeed/ibex_ast2700/Kconfig" source "board/emulation/qemu-riscv/Kconfig" source "board/microchip/mpfs_icicle/Kconfig" source "board/openpiton/riscv64/Kconfig" @@ -97,6 +101,7 @@ source "arch/riscv/cpu/andes/Kconfig" source "arch/riscv/cpu/cv1800b/Kconfig" source "arch/riscv/cpu/fu540/Kconfig" source "arch/riscv/cpu/fu740/Kconfig" +source "arch/riscv/cpu/ast2700/Kconfig" source "arch/riscv/cpu/generic/Kconfig" source "arch/riscv/cpu/jh7110/Kconfig" @@ -133,6 +138,7 @@ config FRAMEPOINTER config SPL_FRAMEPOINTER bool "Build SPL with frame pointer for stack unwinding" + depends on SPL help Choose this option to use the frame pointer so the stack can be unwound if needed. This is useful for tracing where faults came @@ -308,7 +314,10 @@ config TPL_USE_ARCH_STRNCMP endmenu config RISCV_ISA_A - def_bool y + bool "Standard extension for Atomic Instructions" + default y + help + Adds "A" to the ISA string passed to the compiler. config DMA_ADDR_T_64BIT bool @@ -437,7 +446,20 @@ config AVAILABLE_HARTS If disable this, it will send IPI by CPUs node numbers of device tree. config SHOW_REGS + default y bool "Show registers on unhandled exception" + help + By default only the program counter and the return address register + are shown in crash dumps. Enable this symbol to show all registers in + main U-Boot. + +config SPL_SHOW_REGS + bool "In SPL show registers on unhandled exception" + depends on SPL + help + By default only the program counter and the return address register + are shown in crash dumps. Enable this symbol to show all registers in + SPL. config RISCV_PRIV_1_9 bool "Use version 1.9 of the RISC-V priviledged specification" @@ -450,7 +472,7 @@ config RISCV_PRIV_1_9 memory is configured was also changed. config STACK_SIZE_SHIFT - int + int "Stack size shift" default 14 config OF_BOARD_FIXUP diff --git a/arch/riscv/cpu/ast2700/Kconfig b/arch/riscv/cpu/ast2700/Kconfig new file mode 100644 index 00000000000..b16f0fc7cad --- /dev/null +++ b/arch/riscv/cpu/ast2700/Kconfig @@ -0,0 +1,6 @@ +config RISCV_AST2700 + bool + imply CPU + imply CPU_RISCV + help + Run U-Boot on AST2700 with IBex RISC-V CPU integrated. diff --git a/arch/riscv/cpu/ast2700/Makefile b/arch/riscv/cpu/ast2700/Makefile new file mode 100644 index 00000000000..1f843c706ad --- /dev/null +++ b/arch/riscv/cpu/ast2700/Makefile @@ -0,0 +1 @@ +obj-y += cpu.o diff --git a/arch/riscv/cpu/ast2700/cpu.c b/arch/riscv/cpu/ast2700/cpu.c new file mode 100644 index 00000000000..c1540546a9a --- /dev/null +++ b/arch/riscv/cpu/ast2700/cpu.c @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> + * Copyright (C) 2024, Aspeed Technology Inc. + */ + +#include <irq_func.h> +#include <asm/cache.h> + +/* + * cleanup_before_linux() is called just before we call linux + * it prepares the processor for linux + * + * we disable interrupt and caches. + */ +int cleanup_before_linux(void) +{ + disable_interrupts(); + + cache_flush(); + + return 0; +} diff --git a/arch/riscv/cpu/u-boot-spl.lds b/arch/riscv/cpu/u-boot-spl.lds index d1113a59aa6..907094620bd 100644 --- a/arch/riscv/cpu/u-boot-spl.lds +++ b/arch/riscv/cpu/u-boot-spl.lds @@ -44,8 +44,6 @@ SECTIONS __binman_sym_end = .; } > .spl_mem - . = ALIGN(8); - _end = .; _image_binary_end = .; diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile index 17cda483e12..c4c44057bad 100644 --- a/arch/riscv/dts/Makefile +++ b/arch/riscv/dts/Makefile @@ -11,6 +11,7 @@ dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb dtb-$(CONFIG_TARGET_STARFIVE_VISIONFIVE2) += jh7110-starfive-visionfive-2.dtb dtb-$(CONFIG_TARGET_TH1520_LPI4A) += th1520-lichee-pi-4a.dtb dtb-$(CONFIG_TARGET_XILINX_MBV) += xilinx-mbv32.dtb +dtb-$(CONFIG_TARGET_ASPEED_AST2700_IBEX) += ast2700-ibex.dtb include $(srctree)/scripts/Makefile.dts diff --git a/arch/riscv/dts/ast2700-ibex.dts b/arch/riscv/dts/ast2700-ibex.dts new file mode 100644 index 00000000000..f7a05e5771b --- /dev/null +++ b/arch/riscv/dts/ast2700-ibex.dts @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "ast2700.dtsi" + +/ { + chosen { + stdout-path = &uart12; + tick-timer = &ast_ibex_timer; + }; + + memory@0 { + device_type = "memory"; + reg = <0x80000000 0x40000000>; + }; +}; + +&uart12 { + status = "okay"; + clock-frequency = <1846153>; +}; diff --git a/arch/riscv/dts/ast2700-u-boot.dtsi b/arch/riscv/dts/ast2700-u-boot.dtsi new file mode 100644 index 00000000000..ddc08a4bcef --- /dev/null +++ b/arch/riscv/dts/ast2700-u-boot.dtsi @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/ { + cpus { + bootph-all; + }; + + memory@80000000 { + bootph-all; + }; + + soc0: soc@12000000 { + bootph-all; + + sdrammc: sdrammc@12c00000 { + bootph-all; + }; + + syscon0: syscon@12c02000 { + bootph-all; + }; + }; + + soc1: soc@14000000 { + bootph-all; + + syscon1: syscon@14c02000 { + bootph-all; + }; + + uart12: serial@14c33b00 { + bootph-all; + }; + + ast_ibex_timer: timer { + bootph-all; + }; + }; + +}; diff --git a/arch/riscv/dts/ast2700.dtsi b/arch/riscv/dts/ast2700.dtsi new file mode 100644 index 00000000000..9b482dfdd84 --- /dev/null +++ b/arch/riscv/dts/ast2700.dtsi @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/ { + model = "Aspeed AST2700 Ibex BootMCU"; + compatible = "aspeed,ast2700-ibex"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "lowrisc,ibex"; + device_type = "cpu"; + reg = <0>; + comptaible = "riscv"; + riscv,isa = "rv32imc"; + }; + }; + + memory@80000000 { + reg = <0x80000000 0x80000000>; + }; + + soc0: soc@12000000 { + compatible = "aspeed,soc1","simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sdrammc: sdrammc@12c00000 { + compatible = "aspeed,ast2700-sdrammc"; + reg = <0x12c00000 0x3000>, <0x13000000 0x1000>; + aspeed,scu0 = <&syscon0>; + aspeed,scu1 = <&syscon1>; + }; + + syscon0: syscon@12c02000 { + compatible = "aspeed,ast2700-scu0", "syscon", "simple-mfd"; + reg = <0x12c02000 0x1000>; + ranges = <0 0x12c02000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + }; + }; + + soc1: soc@14000000 { + compatible = "aspeed,soc1","simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + syscon1: syscon@14c02000 { + compatible = "aspeed,ast2700-scu1", "syscon", "simple-mfd"; + reg = <0x14c02000 0x1000>; + ranges = <0 0x14c02000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + }; + + uart12: serial@14c33b00 { + compatible = "ns16550a"; + reg = <0x14c33b00 0x20>; + reg-shift = <2>; + no-loopback-test; + clock-frequency = <1846153>; + status = "disabled"; + }; + + ast_ibex_timer: timer { + compatible = "aspeed,ast2700-ibex-timer"; + clock-frequency = <200000000>; + }; + }; +}; diff --git a/arch/riscv/dts/cv18xx.dtsi b/arch/riscv/dts/cv18xx.dtsi index 4b0143450e8..8a7386b76e6 100644 --- a/arch/riscv/dts/cv18xx.dtsi +++ b/arch/riscv/dts/cv18xx.dtsi @@ -5,6 +5,7 @@ */ #include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/clock/sophgo,cv1800.h> / { #address-cells = <1>; @@ -45,13 +46,6 @@ #clock-cells = <0>; }; - sdhci_clk: sdhci-clock { - compatible = "fixed-clock"; - clock-frequency = <375000000>; - clock-output-names = "sdhci_clk"; - #clock-cells = <0>; - }; - eth_csrclk: eth-csrclk { compatible = "fixed-clock"; clock-frequency = <250000000>; @@ -66,13 +60,6 @@ #clock-cells = <0x0>; }; - spif_clk: spi-flash-clock { - compatible = "fixed-clock"; - clock-frequency = <300000000>; - clock-output-names = "spif_clk"; - #clock-cells = <0>; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&plic>; @@ -163,8 +150,8 @@ compatible = "sophgo,cv1800b-dwmac"; reg = <0x04070000 0x10000>; interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; - clocks = <ð_csrclk>, <ð_ptpclk>; - clock-names = "stmmaceth", "ptp_ref"; + clocks = <&clk CLK_ETH0_500M>, <&clk CLK_AXI4_ETH0>; + clock-names = "stmmaceth", "pclk"; status = "disabled"; }; @@ -172,7 +159,8 @@ compatible = "snps,dw-apb-uart"; reg = <0x04140000 0x100>; interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&osc>; + clocks = <&clk CLK_UART0>, <&clk CLK_APB_UART0>; + clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; reg-io-width = <4>; status = "disabled"; @@ -182,7 +170,8 @@ compatible = "snps,dw-apb-uart"; reg = <0x04150000 0x100>; interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&osc>; + clocks = <&clk CLK_UART4>, <&clk CLK_APB_UART4>; + clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; reg-io-width = <4>; status = "disabled"; @@ -192,7 +181,8 @@ compatible = "snps,dw-apb-uart"; reg = <0x04160000 0x100>; interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&osc>; + clocks = <&clk CLK_UART2>, <&clk CLK_APB_UART2>; + clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; reg-io-width = <4>; status = "disabled"; @@ -202,7 +192,8 @@ compatible = "snps,dw-apb-uart"; reg = <0x04170000 0x100>; interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&osc>; + clocks = <&clk CLK_UART3>, <&clk CLK_APB_UART3>; + clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; reg-io-width = <4>; status = "disabled"; @@ -212,7 +203,8 @@ compatible = "snps,dw-apb-uart"; reg = <0x041c0000 0x100>; interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&osc>; + clocks = <&clk CLK_UART4>, <&clk CLK_APB_UART4>; + clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; reg-io-width = <4>; status = "disabled"; @@ -222,8 +214,8 @@ compatible = "sophgo,cv1800b-dwcmshc"; reg = <0x4310000 0x1000>; interrupts = <36 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&sdhci_clk>; - clock-names = "core"; + clocks = <&clk CLK_AXI4_SD0>, <&clk CLK_SD0>; + clock-names = "core", "bus"; status = "disabled"; }; @@ -232,7 +224,7 @@ reg = <0x10000000 0x10000000>; #address-cells = <1>; #size-cells = <0>; - clocks = <&spif_clk>; + clocks = <&clk CLK_AHB_SF>; interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; diff --git a/arch/riscv/include/asm/arch-ast2700/fmc_hdr.h b/arch/riscv/include/asm/arch-ast2700/fmc_hdr.h new file mode 100644 index 00000000000..fbbcdb25cca --- /dev/null +++ b/arch/riscv/include/asm/arch-ast2700/fmc_hdr.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) ASPEED Technology Inc. + */ + +#ifndef __ASM_AST2700_FMC_HDR_H__ +#define __ASM_AST2700_FMC_HDR_H__ + +#include <linux/types.h> + +#define HDR_MAGIC 0x48545341 /* ASTH */ +#define HDR_PB_MAX 30 + +enum prebuilt_type { + PBT_END_MARK = 0x0, + + PBT_DDR4_PMU_TRAIN_IMEM, + PBT_DDR4_PMU_TRAIN_DMEM, + PBT_DDR4_2D_PMU_TRAIN_IMEM, + PBT_DDR4_2D_PMU_TRAIN_DMEM, + PBT_DDR5_PMU_TRAIN_IMEM, + PBT_DDR5_PMU_TRAIN_DMEM, + PBT_DP_FW, + PBT_UEFI_X64_AST2700, + + PBT_NUM +}; + +struct fmc_hdr_preamble { + uint32_t magic; + uint32_t version; +}; + +struct fmc_hdr_body { + uint32_t fmc_size; + union { + struct { + uint32_t type; + uint32_t size; + } pbs[0]; + uint32_t raz[29]; + }; +}; + +struct fmc_hdr { + struct fmc_hdr_preamble preamble; + struct fmc_hdr_body body; +} __packed; + +int fmc_hdr_get_prebuilt(uint32_t type, uint32_t *ofst, uint32_t *size); + +#endif diff --git a/arch/riscv/include/asm/arch-ast2700/scu.h b/arch/riscv/include/asm/arch-ast2700/scu.h new file mode 100644 index 00000000000..1aa7d38bace --- /dev/null +++ b/arch/riscv/include/asm/arch-ast2700/scu.h @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) Aspeed Technology Inc. + */ +#ifndef __ASM_AST2700_SCU_H__ +#define __ASM_AST2700_SCU_H__ + +/* SCU0: CPU-die SCU */ +#define SCU0_HWSTRAP 0x010 +#define SCU0_HWSTRAP_DIS_RVAS BIT(30) +#define SCU0_HWSTRAP_DIS_WDTFULL BIT(25) +#define SCU0_HWSTRAP_DISARMICE_TZ BIT(22) +#define SCU0_HWSTRAP_DISABLE_XHCI BIT(21) +#define SCU0_HWSTRAP_BOOTEMMCSPEED BIT(20) +#define SCU0_HWSTRAP_VGA_CC BIT(18) +#define SCU0_HWSTRAP_EN_OPROM BIT(17) +#define SCU0_HWSTRAP_DISARMICE BIT(16) +#define SCU0_HWSTRAP_TSPRSNTSEL BIT(9) +#define SCU0_HWSTRAP_DISDEBUG BIT(8) +#define SCU0_HWSTRAP_HCLKHPLL BIT(7) +#define SCU0_HWSTRAP_HCLKSEL GENMASK(6, 5) +#define SCU0_HWSTRAP_CPUHPLL BIT(4) +#define SCU0_HWSTRAP_HPLLFREQ GENMASK(3, 2) +#define SCU0_HWSTRAP_BOOTSPI BIT(1) +#define SCU0_HWSTRAP_HWSTRAP_DISCPU BIT(0) +#define SCU0_DBGCTL 0x0c8 +#define SCU0_DBGCTL_MASK GENMASK(14, 0) +#define SCU0_DBGCTL_UARTDBG BIT(1) +#define SCU0_RSTCTL1 0x200 +#define SCU0_RSTCTL1_EMMC BIT(17) +#define SCU0_RSTCTL1_HACE BIT(4) +#define SCU0_RSTCTL1_CLR 0x204 +#define SCU0_RSTCTL1_CLR_EMMC BIT(17) +#define SCU0_RSTCTL1_CLR_HACE BIT(4) +#define SCU0_CLKGATE1 0x240 +#define SCU0_CLKGATE1_EMMC BIT(27) +#define SCU0_CLKGATE1_HACE BIT(13) +#define SCU0_CLKGATE1_DDRPHY BIT(11) +#define SCU0_CLKGATE1_CLR 0x244 +#define SCU0_CLKGATE1_CLR_EMMC BIT(27) +#define SCU0_CLKGATE1_CLR_HACE BIT(13) +#define SCU0_CLKGATE1_CLR_DDRPHY BIT(11) +#define SCU0_VGA0_SCRATCH 0x900 +#define SCU0_VGA0_SCRATCH_DRAM_INIT BIT(6) +#define SCU0_PCI_MISC70 0xa70 +#define SCU0_PCI_MISC70_EN_PCIEXHCI0 BIT(3) +#define SCU0_PCI_MISC70_EN_PCIEEHCI0 BIT(2) +#define SCU0_PCI_MISC70_EN_PCIEVGA0 BIT(0) +#define SCU0_PCI_MISC80 0xa80 +#define SCU0_PCI_MISC80_EN_PCIEXHCI1 BIT(3) +#define SCU0_PCI_MISC80_EN_PCIEEHCI1 BIT(2) +#define SCU0_PCI_MISC80_EN_PCIEVGA1 BIT(0) +#define SCU0_PCI_MISCF0 0xaf0 +#define SCU0_PCI_MISCF0_EN_PCIEXHCI1 BIT(3) +#define SCU0_PCI_MISCF0_EN_PCIEEHCI1 BIT(2) +#define SCU0_PCI_MISCF0_EN_PCIEVGA1 BIT(0) +#define SCU0_WPROT1 0xe04 +#define SCU0_WPROT1_0C8 BIT(18) + +/* SCU1: IO-die SCU */ +#define SCU1_REVISION 0x000 +#define SCU1_REVISION_HWID GENMASK(23, 16) +#define SCU1_REVISION_CHIP_EFUSE GENMASK(15, 8) +#define SCU1_HWSTRAP1 0x010 +#define SCU1_HWSTRAP1_DIS_CPTRA BIT(30) +#define SCU1_HWSTRAP1_RECOVERY_USB_PORT GENMASK(29, 28) +#define SCU1_HWSTRAP1_RECOVERY_INTERFACE GENMASK(27, 26) +#define SCU1_HWSTRAP1_RECOVERY_I3C (BIT(26) | BIT(27)) +#define SCU1_HWSTRAP1_RECOVERY_I2C BIT(27) +#define SCU1_HWSTRAP1_RECOVERY_USB BIT(26) +#define SCU1_HWSTRAP1_SPI_FLASH_4_BYTE_MODE BIT(25) +#define SCU1_HWSTRAP1_SPI_FLASH_WAIT_READY BIT(24) +#define SCU1_HWSTRAP1_BOOT_UFS BIT(23) +#define SCU1_HWSTRAP1_DIS_ROM BIT(22) +#define SCU1_HWSTRAP1_DIS_CPTRAJTAG BIT(20) +#define SCU1_HWSTRAP1_UARTDBGSEL BIT(19) +#define SCU1_HWSTRAP1_DIS_UARTDBG BIT(18) +#define SCU1_HWSTRAP1_DIS_WDTFULL BIT(17) +#define SCU1_HWSTRAP1_DISDEBUG1 BIT(16) +#define SCU1_HWSTRAP1_LTPI0_IO_DRIVING GENMASK(15, 14) +#define SCU1_HWSTRAP1_ACPI_1 BIT(13) +#define SCU1_HWSTRAP1_ACPI_0 BIT(12) +#define SCU1_HWSTRAP1_BOOT_EMMC_UFS BIT(11) +#define SCU1_HWSTRAP1_DDR4 BIT(10) +#define SCU1_HWSTRAP1_LOW_SECURE BIT(8) +#define SCU1_HWSTRAP1_EN_EMCS BIT(7) +#define SCU1_HWSTRAP1_EN_GPIOPT BIT(6) +#define SCU1_HWSTRAP1_EN_SECBOOT BIT(5) +#define SCU1_HWSTRAP1_EN_RECOVERY_BOOT BIT(4) +#define SCU1_HWSTRAP1_LTPI0_EN BIT(3) +#define SCU1_HWSTRAP1_LTPI_IDX BIT(2) +#define SCU1_HWSTRAP1_LTPI1_EN BIT(1) +#define SCU1_HWSTRAP1_LTPI_MODE BIT(0) +#define SCU1_HWSTRAP2 0x030 +#define SCU1_HWSTRAP2_FMC_ABR_SINGLE_FLASH BIT(29) +#define SCU1_HWSTRAP2_FMC_ABR_CS_SWAP_DIS BIT(28) +#define SCU1_HWSTRAP2_SPI_TPM_PCR_EXT_EN BIT(27) +#define SCU1_HWSTRAP2_SPI_TPM_HASH_ALGO GENMASK(26, 25) +#define SCU1_HWSTRAP2_BOOT_SPI_FREQ GENMASK(24, 23) +#define SCU1_HWSTRAP2_RESERVED GENMASK(22, 19) +#define SCU1_HWSTRAP2_FWSPI_CRTM GENMASK(18, 17) +#define SCU1_HWSTRAP2_EN_FWSPIAUX BIT(16) +#define SCU1_HWSTRAP2_FWSPISIZE GENMASK(15, 13) +#define SCU1_HWSTRAP2_DIS_REC BIT(12) +#define SCU1_HWSTRAP2_EN_CPTRA_DBG BIT(11) +#define SCU1_HWSTRAP2_TPM_PCR_INDEX GENMASK(6, 2) +#define SCU1_HWSTRAP2_ROM_CLEAR_SRAM BIT(1) +#define SCU1_HWSTRAP2_ABR BIT(0) +#define SCU1_RSTLOG0 0x050 +#define SCU1_RSTLOG0_BMC_CPU BIT(12) +#define SCU1_RSTLOG0_ABR BIT(2) +#define SCU1_RSTLOG0_EXTRSTN BIT(1) +#define SCU1_RSTLOG0_SRST BIT(0) +#define SCU1_MISC1 0x0c0 +#define SCU1_MISC1_UARTDBG_ROUTE GENMASK(23, 22) +#define SCU1_MISC1_UART12_ROUTE GENMASK(21, 20) +#define SCU1_DBGCTL 0x0c8 +#define SCU1_DBGCTL_MASK GENMASK(7, 0) +#define SCU1_DBGCTL_UARTDBG BIT(6) +#define SCU1_RNG_DATA 0x0f4 +#define SCU1_RSTCTL1 0x200 +#define SCU1_RSTCTL1_I3C(x) (BIT(16) << (x)) +#define SCU1_RSTCTL1_CLR 0x204 +#define SCU1_RSTCTL1_CLR_I3C(x) (BIT(16) << (x)) +#define SCU1_RSTCTL2 0x220 +#define SCU1_RSTCTL2_LTPI1 BIT(22) +#define SCU1_RSTCTL2_LTPI0 BIT(20) +#define SCU1_RSTCTL2_I2C BIT(15) +#define SCU1_RSTCTL2_CPTRA BIT(9) +#define SCU1_RSTCTL2_CLR 0x224 +#define SCU1_RSTCTL2_CLR_I2C BIT(15) +#define SCU1_RSTCTL2_CLR_CPTRA BIT(9) +#define SCU1_CLKGATE1 0x240 +#define SCU1_CLKGATE1_I3C(x) (BIT(16) << (x)) +#define SCU1_CLKGATE1_I2C BIT(15) +#define SCU1_CLKGATE1_CLR 0x244 +#define SCU1_CLKGATE1_CLR_I3C(x) (BIT(16) << (x)) +#define SCU1_CLKGATE1_CLR_I2C BIT(15) +#define SCU1_CLKGATE2 0x260 +#define SCU1_CLKGATE2_LTPI1_TX BIT(19) +#define SCU1_CLKGATE2_LTPI_AHB BIT(10) +#define SCU1_CLKGATE2_LTPI0_TX BIT(9) +#define SCU1_CLKGATE2_CLR 0x264 + +#endif diff --git a/arch/riscv/include/asm/arch-ast2700/sdram.h b/arch/riscv/include/asm/arch-ast2700/sdram.h new file mode 100644 index 00000000000..daf48dd6ed1 --- /dev/null +++ b/arch/riscv/include/asm/arch-ast2700/sdram.h @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) Aspeed Technology Inc. + */ +#ifndef __ASM_AST2700_SDRAM_H__ +#define __ASM_AST2700_SDRAM_H__ + +struct sdrammc_regs { + u32 prot_key; + u32 intr_status; + u32 intr_clear; + u32 intr_mask; + u32 mcfg; + u32 mctl; + u32 msts; + u32 error_status; + u32 actime1; + u32 actime2; + u32 actime3; + u32 actime4; + u32 actime5; + u32 actime6; + u32 actime7; + u32 dfi_timing; + u32 dcfg; + u32 dctl; + u32 mrctl; + u32 mrwr; + u32 mrrd; + u32 mr01; + u32 mr23; + u32 mr45; + u32 mr67; + u32 refctl; + u32 refmng_ctl; + u32 refsts; + u32 zqctl; + u32 ecc_addr_range; + u32 ecc_failure_status; + u32 ecc_failure_addr; + u32 ecc_test_control; + u32 ecc_test_status; + u32 arbctl; + u32 enccfg; + u32 protect_lock_set; + u32 protect_lock_status; + u32 protect_lock_reset; + u32 enc_min_addr; + u32 enc_max_addr; + u32 enc_key[4]; + u32 enc_iv[3]; + u32 bistcfg; + u32 bist_addr; + u32 bist_size; + u32 bist_patt; + u32 bist_res; + u32 bist_fail_addr; + u32 bist_fail_data[4]; + u32 reserved2[2]; + u32 debug_control; + u32 debug_status; + u32 phy_intf_status; + u32 testcfg; + u32 gfmcfg; + u32 gfm0ctl; + u32 gfm1ctl; + u32 reserved3[0xf8]; +}; + +#define DRAMC_UNLK_KEY 0x1688a8a8 + +/* offset 0x04 */ +#define DRAMC_IRQSTA_PWRCTL_ERR BIT(16) +#define DRAMC_IRQSTA_PHY_ERR BIT(15) +#define DRAMC_IRQSTA_LOWPOWER_DONE BIT(12) +#define DRAMC_IRQSTA_FREQ_CHG_DONE BIT(11) +#define DRAMC_IRQSTA_REF_DONE BIT(10) +#define DRAMC_IRQSTA_ZQ_DONE BIT(9) +#define DRAMC_IRQSTA_BIST_DONE BIT(8) +#define DRAMC_IRQSTA_ECC_RCVY_ERR BIT(5) +#define DRAMC_IRQSTA_ECC_ERR BIT(4) +#define DRAMC_IRQSTA_PROT_ERR BIT(3) +#define DRAMC_IRQSTA_OVERSZ_ERR BIT(2) +#define DRAMC_IRQSTA_MR_DONE BIT(1) +#define DRAMC_IRQSTA_PHY_INIT_DONE BIT(0) + +/* offset 0x14 */ +#define DRAMC_MCTL_WB_SOFT_RESET BIT(24) +#define DRAMC_MCTL_PHY_CLK_DIS BIT(18) +#define DRAMC_MCTL_PHY_RESET BIT(17) +#define DRAMC_MCTL_PHY_POWER_ON BIT(16) +#define DRAMC_MCTL_FREQ_CHG_START BIT(3) +#define DRAMC_MCTL_PHY_LOWPOWER_START BIT(2) +#define DRAMC_MCTL_SELF_REF_START BIT(1) +#define DRAMC_MCTL_PHY_INIT_START BIT(0) + +/* offset 0x40 */ +#define DRAMC_DFICFG_WD_POL BIT(18) +#define DRAMC_DFICFG_CKE_OUT BIT(17) +#define DRAMC_DFICFG_RESET BIT(16) + +/* offset 0x48 */ +#define DRAMC_MRCTL_ERR_STATUS BIT(31) +#define DRAMC_MRCTL_READY_STATUS BIT(30) +#define DRAMC_MRCTL_MR_ADDR BIT(8) +#define DRAMC_MRCTL_CMD_DLL_RST BIT(7) +#define DRAMC_MRCTL_CMD_DQ_SEL BIT(6) +#define DRAMC_MRCTL_CMD_TYPE BIT(2) +#define DRAMC_MRCTL_CMD_WR_CTL BIT(1) +#define DRAMC_MRCTL_CMD_START BIT(0) + +/* offset 0xC0 */ +#define DRAMC_BISTRES_RUNNING BIT(10) +#define DRAMC_BISTRES_FAIL BIT(9) +#define DRAMC_BISTRES_DONE BIT(8) +#define DRAMC_BISTCFG_INIT_MODE BIT(7) +#define DRAMC_BISTCFG_PMODE GENMASK(6, 4) +#define DRAMC_BISTCFG_BMODE GENMASK(3, 2) +#define DRAMC_BISTCFG_ENABLE BIT(1) +#define DRAMC_BISTCFG_START BIT(0) +#define BIST_PMODE_CRC (3) +#define BIST_BMODE_RW_SWITCH (3) + +/* DRAMC048 MR Control Register */ +#define MR_TYPE_SHIFT 2 +#define MR_RW (0 << MR_TYPE_SHIFT) +#define MR_MPC BIT(2) +#define MR_VREFCS (2 << MR_TYPE_SHIFT) +#define MR_VREFCA (3 << MR_TYPE_SHIFT) +#define MR_ADDRESS_SHIFT 8 +#define MR_ADDR(n) (((n) << MR_ADDRESS_SHIFT) | DRAMC_MRCTL_CMD_WR_CTL) +#define MR_NUM_SHIFT 4 +#define MR_NUM(n) ((n) << MR_NUM_SHIFT) +#define MR_DLL_RESET BIT(7) +#define MR_1T_MODE BIT(16) + +#endif diff --git a/arch/riscv/include/asm/arch-ast2700/sli.h b/arch/riscv/include/asm/arch-ast2700/sli.h new file mode 100644 index 00000000000..42f0f9ac93d --- /dev/null +++ b/arch/riscv/include/asm/arch-ast2700/sli.h @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) Aspeed Technology Inc. + */ +#ifndef __ASM_AST2700_SLI_H__ +#define __ASM_AST2700_SLI_H__ + +#define SLI_CPU_ADRBASE 0x12c17000 +#define SLI_IOD_ADRBASE 0x14c1e000 +#define SLIM_CPU_BASE (SLI_CPU_ADRBASE + 0x000) +#define SLIH_CPU_BASE (SLI_CPU_ADRBASE + 0x200) +#define SLIV_CPU_BASE (SLI_CPU_ADRBASE + 0x400) +#define SLIM_IOD_BASE (SLI_IOD_ADRBASE + 0x000) +#define SLIH_IOD_BASE (SLI_IOD_ADRBASE + 0x200) +#define SLIV_IOD_BASE (SLI_IOD_ADRBASE + 0x400) + +#define SLI_CTRL_I 0x00 +#define SLIV_RAW_MODE BIT(15) +#define SLI_TX_MODE BIT(14) +#define SLI_RX_PHY_LAH_SEL_REV BIT(13) +#define SLI_RX_PHY_LAH_SEL_NEG BIT(12) +#define SLI_AUTO_SEND_TRN_OFF BIT(8) +#define SLI_CLEAR_BUS BIT(6) +#define SLI_TRANS_EN BIT(5) +#define SLI_CLEAR_RX BIT(2) +#define SLI_CLEAR_TX BIT(1) +#define SLI_RESET_TRIGGER BIT(0) +#define SLI_CTRL_II 0x04 +#define SLI_CTRL_III 0x08 +#define SLI_CLK_SEL GENMASK(31, 28) +#define SLI_CLK_500M 0x6 +#define SLI_CLK_200M 0x3 +#define SLI_PHYCLK_SEL GENMASK(27, 24) +#define SLI_PHYCLK_25M 0x0 +#define SLI_PHYCLK_800M 0x1 +#define SLI_PHYCLK_400M 0x2 +#define SLI_PHYCLK_200M 0x3 +#define SLI_PHYCLK_788M 0x5 +#define SLI_PHYCLK_500M 0x6 +#define SLI_PHYCLK_250M 0x7 +#define SLIH_PAD_DLY_TX1 GENMASK(23, 18) +#define SLIH_PAD_DLY_TX0 GENMASK(17, 12) +#define SLIH_PAD_DLY_RX1 GENMASK(11, 6) +#define SLIH_PAD_DLY_RX0 GENMASK(5, 0) +#define SLIM_PAD_DLY_RX3 GENMASK(23, 18) +#define SLIM_PAD_DLY_RX2 GENMASK(17, 12) +#define SLIM_PAD_DLY_RX1 GENMASK(11, 6) +#define SLIM_PAD_DLY_RX0 GENMASK(5, 0) +#define SLI_CTRL_IV 0x0c +#define SLIM_PAD_DLY_TX3 GENMASK(23, 18) +#define SLIM_PAD_DLY_TX2 GENMASK(17, 12) +#define SLIM_PAD_DLY_TX1 GENMASK(11, 6) +#define SLIM_PAD_DLY_TX0 GENMASK(5, 0) +#define SLI_INTR_EN 0x10 +#define SLI_INTR_STATUS 0x14 +#define SLI_INTR_RX_SYNC BIT(15) +#define SLI_INTR_RX_ERR BIT(13) +#define SLI_INTR_RX_NACK BIT(12) +#define SLI_INTR_RX_TRAIN_PKT BIT(10) +#define SLI_INTR_RX_DISCONN BIT(6) +#define SLI_INTR_TX_SUSPEND BIT(4) +#define SLI_INTR_TX_TRAIN BIT(3) +#define SLI_INTR_TX_IDLE BIT(2) +#define SLI_INTR_RX_SUSPEND BIT(1) +#define SLI_INTR_RX_IDLE BIT(0) +#define SLI_INTR_RX_ERRORS \ + (SLI_INTR_RX_ERR | SLI_INTR_RX_NACK | SLI_INTR_RX_DISCONN) + +#define SLIM_MARB_FUNC_I 0x60 +#define SLIM_SLI_MARB_RR BIT(0) + +#define SLI_TARGET_PHYCLK SLI_PHYCLK_400M +#define SLIH_DEFAULT_DELAY 11 +#if (SLI_TARGET_PHYCLK == SLI_PHYCLK_800M) || (SLI_TARGET_PHYCLK == SLI_PHYCLK_788M) +#define SLIM_DEFAULT_DELAY 5 +#define SLIM_LAH_CONFIG 1 +#else +#define SLIM_DEFAULT_DELAY 12 +#define SLIM_LAH_CONFIG 0 +#endif +#endif +int sli_init(void); diff --git a/arch/riscv/include/asm/bitops.h b/arch/riscv/include/asm/bitops.h index 35f1368b837..2f2994c4ddc 100644 --- a/arch/riscv/include/asm/bitops.h +++ b/arch/riscv/include/asm/bitops.h @@ -138,6 +138,43 @@ static inline unsigned long ffz(unsigned long word) return k; } +static inline int find_next_zero_bit(void *addr, int size, int offset) +{ + unsigned long *p = ((unsigned long *)addr) + (offset / BITS_PER_LONG); + unsigned long result = offset & ~(BITS_PER_LONG - 1); + unsigned long tmp; + + if (offset >= size) + return size; + size -= result; + offset &= (BITS_PER_LONG - 1); + if (offset) { + tmp = *(p++); + tmp |= ~0UL >> (BITS_PER_LONG - offset); + if (size < BITS_PER_LONG) + goto found_first; + if (~tmp) + goto found_middle; + size -= BITS_PER_LONG; + result += BITS_PER_LONG; + } + while (size & ~(BITS_PER_LONG - 1)) { + tmp = *(p++); + if (~tmp) + goto found_middle; + result += BITS_PER_LONG; + size -= BITS_PER_LONG; + } + if (!size) + return result; + tmp = *p; + +found_first: + tmp |= ~0UL << size; +found_middle: + return result + ffz(tmp); +} + /* * ffs: find first bit set. This is defined the same way as * the libc and compiler builtin ffs routines, therefore @@ -158,6 +195,9 @@ static inline unsigned long ffz(unsigned long word) #define hweight16(x) generic_hweight16(x) #define hweight8(x) generic_hweight8(x) +#define find_first_zero_bit(addr, size) \ + find_next_zero_bit((addr), (size), 0) + #define test_and_set_bit __test_and_set_bit #define test_and_clear_bit __test_and_clear_bit diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c index f9a1428a486..714cc92d03e 100644 --- a/arch/riscv/lib/interrupts.c +++ b/arch/riscv/lib/interrupts.c @@ -34,9 +34,8 @@ static void show_efi_loaded_images(uintptr_t epc) efi_print_image_infos((void *)epc); } -static void show_regs(struct pt_regs *regs) +static void __maybe_unused show_regs(struct pt_regs *regs) { -#ifdef CONFIG_SHOW_REGS printf("\nSP: " REG_FMT " GP: " REG_FMT " TP: " REG_FMT "\n", regs->sp, regs->gp, regs->tp); printf("T0: " REG_FMT " T1: " REG_FMT " T2: " REG_FMT "\n", @@ -57,7 +56,6 @@ static void show_regs(struct pt_regs *regs) regs->s10, regs->s11, regs->t3); printf("T4: " REG_FMT " T5: " REG_FMT " T6: " REG_FMT "\n", regs->t4, regs->t5, regs->t6); -#endif } static void __maybe_unused show_backtrace(struct pt_regs *regs) @@ -157,7 +155,8 @@ static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs) printf("EPC: " REG_FMT " RA: " REG_FMT " reloc adjusted\n", epc - gd->reloc_off, regs->ra - gd->reloc_off); - show_regs(regs); + if (CONFIG_IS_ENABLED(SHOW_REGS)) + show_regs(regs); if (CONFIG_IS_ENABLED(FRAMEPOINTER)) show_backtrace(regs); show_code(epc); diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index 4f15a560902..51ce40e7f08 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -109,8 +109,9 @@ void *phys_to_virt(phys_addr_t paddr) state = state_get_current(); list_for_each_entry(mentry, &state->mapmem_head, sibling_node) { if (mentry->tag == paddr) { - debug("%s: Used map from %lx to %p\n", __func__, - (ulong)paddr, mentry->ptr); + log_debug("Used map from %lx to %p\n", (ulong)paddr, + mentry->ptr); + mentry->refcnt++; return mentry->ptr; } } @@ -130,11 +131,12 @@ struct sandbox_mapmem_entry *find_tag(const void *ptr) list_for_each_entry(mentry, &state->mapmem_head, sibling_node) { if (mentry->ptr == ptr) { - debug("%s: Used map from %p to %lx\n", __func__, ptr, - mentry->tag); + log_debug("Used map from %p to %lx\n", ptr, + mentry->tag); return mentry; } } + return NULL; } @@ -156,7 +158,7 @@ phys_addr_t virt_to_phys(void *ptr) __func__, ptr, (ulong)gd->ram_size); os_abort(); } - debug("%s: Used map from %p to %lx\n", __func__, ptr, mentry->tag); + log_debug("Used map from %p to %lx\n", ptr, mentry->tag); return mentry->tag; } @@ -174,6 +176,7 @@ void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) __func__, (uint)paddr, len, plen); } map_len = len; + log_debug("pci map %lx -> %p\n", (ulong)paddr, ptr); return ptr; } #endif @@ -183,12 +186,30 @@ void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) void unmap_physmem(const void *ptr, unsigned long flags) { + struct sandbox_mapmem_entry *mentry; + #ifdef CONFIG_PCI if (map_dev) { pci_unmap_physmem(ptr, map_len, map_dev); map_dev = NULL; } #endif + + /* If it is in emulated RAM, we didn't create a tag, so nothing to do */ + if (is_in_sandbox_mem(ptr)) + return; + + mentry = find_tag(ptr); + if (mentry) { + if (!--mentry->refcnt) { + list_del(&mentry->sibling_node); + log_debug("Removed map from %p to %lx\n", ptr, + (ulong)mentry->tag); + free(mentry); + } + } else { + log_warning("Address not mapped: %p\n", ptr); + } } phys_addr_t map_to_sysmem(const void *ptr) @@ -217,11 +238,14 @@ phys_addr_t map_to_sysmem(const void *ptr) } mentry->tag = state->next_tag++; mentry->ptr = (void *)ptr; + mentry->refcnt = 0; list_add_tail(&mentry->sibling_node, &state->mapmem_head); - debug("%s: Added map from %p to %lx\n", __func__, ptr, - (ulong)mentry->tag); + log_debug("Added map from %p to %lx\n", ptr, + (ulong)mentry->tag); } + mentry->refcnt++; + /* * Return the tag as the address to use. A later call to map_sysmem() * will return ptr diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index a9ca79e76d2..49236db99c2 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -373,12 +373,13 @@ void state_reset_for_test(struct sandbox_state *state) memset(state->spi, '\0', sizeof(state->spi)); /* - * Set up the memory tag list. Use the top of emulated SDRAM for the - * first tag number, since that address offset is outside the legal - * range, and can be assumed to be a tag. + * Set up the memory tag list. We could use the top of emulated SDRAM + * for the first tag number, since that address offset is outside the + * legal SDRAM range, but PCI can have address there. So use a very + * large address instead */ INIT_LIST_HEAD(&state->mapmem_head); - state->next_tag = state->ram_size; + state->next_tag = 0xff000000; } bool autoboot_keyed(void) diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 6b50473ed41..e7dc01759e8 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -53,10 +53,13 @@ struct sandbox_wdt_info { * be returned, just as it would for a normal sandbox address. * * @tag: Address tag (a value which U-Boot uses to refer to the address) + * @refcnt: Number of references to this tag * @ptr: Associated pointer for that tag + * @sibling_node: Next node */ struct sandbox_mapmem_entry { ulong tag; + uint refcnt; void *ptr; struct list_head sibling_node; }; diff --git a/arch/sandbox/lib/pci_io.c b/arch/sandbox/lib/pci_io.c index 6040eacb594..5eff7c7d65d 100644 --- a/arch/sandbox/lib/pci_io.c +++ b/arch/sandbox/lib/pci_io.c @@ -8,6 +8,8 @@ * IO space access commands. */ +#define LOG_CATEGORY UCLASS_PCI + #include <command.h> #include <dm.h> #include <log.h> @@ -31,10 +33,11 @@ int pci_map_physmem(phys_addr_t paddr, unsigned long *lenp, if (ret) continue; *devp = dev; + log_debug("addr=%lx, dev=%s\n", (ulong)paddr, dev->name); return 0; } - debug("%s: failed: addr=%pap\n", __func__, &paddr); + log_debug("%s: failed: addr=%pap\n", __func__, &paddr); return -ENOSYS; } @@ -66,7 +69,7 @@ static int pci_io_read(unsigned int addr, ulong *valuep, pci_size_t size) } } - debug("%s: failed: addr=%x\n", __func__, addr); + log_debug("%s: failed: addr=%x\n", __func__, addr); return -ENOSYS; } @@ -87,7 +90,7 @@ static int pci_io_write(unsigned int addr, ulong value, pci_size_t size) } } - debug("%s: failed: addr=%x, value=%lx\n", __func__, addr, value); + log_debug("%s: failed: addr=%x, value=%lx\n", __func__, addr, value); return -ENOSYS; } diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index 2f29d26edf8..eb88ee7f1ed 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -23,6 +23,7 @@ #include <dt-bindings/gpio/gpio.h> #include <fdt_support.h> #include <hexdump.h> +#include <i2c_eeprom.h> #include <time.h> #include <turris-omnia-mcu-interface.h> #include <linux/bitops.h> @@ -46,6 +47,9 @@ DECLARE_GLOBAL_DATA_PTR; #define OMNIA_I2C_EEPROM_CHIP_LEN 2 #define OMNIA_I2C_EEPROM_MAGIC 0x0341a034 +#define OMNIA_RESET_TO_LOWER_DDR_SPEED 9 +#define OMNIA_LOWER_DDR_SPEED "1333H" + #define A385_SYS_RSTOUT_MASK MVEBU_REGISTER(0x18260) #define A385_SYS_RSTOUT_MASK_WD BIT(10) @@ -205,6 +209,20 @@ static u32 omnia_mcu_crc32(const void *p, size_t len) return ~bitrev32(crc); } +static int omnia_mcu_get_reset(void) +{ + u8 reset_status; + int ret; + + ret = omnia_mcu_read(CMD_GET_RESET, &reset_status, 1); + if (ret) { + printf("omnia_mcu_read failed: %i, reset status unknown!\n", ret); + return ret; + } + + return reset_status; +} + /* Can only be called after relocation, since it needs cleared BSS */ static int omnia_mcu_board_info(char *serial, u8 *mac, char *version) { @@ -462,20 +480,27 @@ static bool check_eeprom_crc(const void *buf, size_t size, u32 expected, return true; } +static struct udevice *omnia_get_eeprom(void) +{ + return omnia_get_i2c_chip("EEPROM", OMNIA_I2C_EEPROM_CHIP_ADDR, + OMNIA_I2C_EEPROM_CHIP_LEN); +} + static bool omnia_read_eeprom(struct omnia_eeprom *oep) { - struct udevice *chip; + struct udevice *eeprom = omnia_get_eeprom(); int ret; - chip = omnia_get_i2c_chip("EEPROM", OMNIA_I2C_EEPROM_CHIP_ADDR, - OMNIA_I2C_EEPROM_CHIP_LEN); - - if (!chip) + if (!eeprom) return false; - ret = dm_i2c_read(chip, 0, (void *)oep, sizeof(*oep)); + if (IS_ENABLED(CONFIG_SPL_BUILD)) + ret = dm_i2c_read(eeprom, 0, (void *)oep, sizeof(*oep)); + else + ret = i2c_eeprom_read(eeprom, 0, (void *)oep, sizeof(*oep)); + if (ret) { - printf("dm_i2c_read failed: %i, cannot read EEPROM\n", ret); + printf("cannot read EEPROM: %d\n", ret); return false; } @@ -497,6 +522,35 @@ static bool omnia_read_eeprom(struct omnia_eeprom *oep) return true; } +static void omnia_eeprom_set_lower_ddr_speed(void) +{ + struct udevice *eeprom = omnia_get_eeprom(); + struct omnia_eeprom oep; + int ret; + + if (!eeprom || !omnia_read_eeprom(&oep)) + return; + + puts("Setting DDR speed to " OMNIA_LOWER_DDR_SPEED " in EEPROM as requested by reset button... "); + + /* check if already set */ + if (!strncmp(oep.ddr_speed, OMNIA_LOWER_DDR_SPEED, sizeof(oep.ddr_speed)) && + (oep.old_ddr_training == 0 || oep.old_ddr_training == 0xff)) { + puts("was already set\n"); + return; + } + + strncpy(oep.ddr_speed, OMNIA_LOWER_DDR_SPEED, sizeof(oep.ddr_speed)); + oep.old_ddr_training = 0xff; + oep.crc2 = crc32(0, (const void *)&oep, offsetof(struct omnia_eeprom, crc2)); + + ret = i2c_eeprom_write(eeprom, 0, (const void *)&oep, sizeof(oep)); + if (ret) + printf("cannot write EEPROM: %d\n", ret); + else + puts("done\n"); +} + int omnia_get_ram_size_gb(void) { static int ram_size; @@ -526,6 +580,13 @@ bool board_use_old_ddr3_training(void) { struct omnia_eeprom oep; + /* + * If lower DDR speed is requested by reset button, we can't use old DDR + * training algorithm. + */ + if (omnia_mcu_get_reset() == OMNIA_RESET_TO_LOWER_DDR_SPEED) + return false; + if (!omnia_read_eeprom(&oep)) return false; @@ -706,13 +767,19 @@ static void fixup_speed_in_ddr_topology(struct mv_ddr_topology_map *topology) const struct omnia_ddr_speed *setting; const char *speed; static bool done; + int reset_status; if (done) return; done = true; - speed = omnia_get_ddr_speed(); + reset_status = omnia_mcu_get_reset(); + if (reset_status == OMNIA_RESET_TO_LOWER_DDR_SPEED) + speed = OMNIA_LOWER_DDR_SPEED; + else + speed = omnia_get_ddr_speed(); + if (!speed) return; @@ -729,7 +796,10 @@ static void fixup_speed_in_ddr_topology(struct mv_ddr_topology_map *topology) if (params->speed_bin_index == setting->speed_bin) return; - printf("Fixing up DDR3 speed (EEPROM defines %s)\n", speed); + if (reset_status == OMNIA_RESET_TO_LOWER_DDR_SPEED) + printf("Fixing up DDR3 speed to %s as requested by reset button\n", speed); + else + printf("Fixing up DDR3 speed (EEPROM defines %s)\n", speed); params->speed_bin_index = setting->speed_bin; params->memory_freq = setting->freq; @@ -766,8 +836,7 @@ static int set_regdomain(void) static void handle_reset_button(void) { const char * const vars[1] = { "bootcmd_rescue", }; - int ret; - u8 reset_status; + int reset_status; /* * Ensure that bootcmd_rescue has always stock value, so that running @@ -776,12 +845,12 @@ static void handle_reset_button(void) */ env_set_default_vars(1, (char * const *)vars, 0); - ret = omnia_mcu_read(CMD_GET_RESET, &reset_status, 1); - if (ret) { - printf("omnia_mcu_read failed: %i, reset status unknown!\n", - ret); + reset_status = omnia_mcu_get_reset(); + if (reset_status < 0) return; - } + + if (reset_status == OMNIA_RESET_TO_LOWER_DDR_SPEED) + return omnia_eeprom_set_lower_ddr_speed(); env_set_ulong("omnia_reset", reset_status); diff --git a/board/Marvell/octeontx2_cn913x/board.c b/board/Marvell/octeontx2_cn913x/board.c index 3d20cfb2fab..3ffe15d42b8 100644 --- a/board/Marvell/octeontx2_cn913x/board.c +++ b/board/Marvell/octeontx2_cn913x/board.c @@ -23,11 +23,6 @@ int board_early_init_f(void) int board_early_init_r(void) { - if (CONFIG_IS_ENABLED(DM_REGULATOR)) { - /* Check if any existing regulator should be turned down */ - regulators_enable_boot_off(false); - } - return 0; } diff --git a/board/amlogic/odroid-go-ultra/odroid-go-ultra.c b/board/amlogic/odroid-go-ultra/odroid-go-ultra.c index 8f3f2045d74..f9412071737 100644 --- a/board/amlogic/odroid-go-ultra/odroid-go-ultra.c +++ b/board/amlogic/odroid-go-ultra/odroid-go-ultra.c @@ -16,7 +16,5 @@ int mmc_get_env_dev(void) int board_init(void) { - regulators_enable_boot_on(_DEBUG); - return 0; } diff --git a/board/aspeed/ibex_ast2700/Kconfig b/board/aspeed/ibex_ast2700/Kconfig new file mode 100644 index 00000000000..469cea58d12 --- /dev/null +++ b/board/aspeed/ibex_ast2700/Kconfig @@ -0,0 +1,21 @@ +if TARGET_ASPEED_AST2700_IBEX + +config SYS_BOARD + default "ibex_ast2700" + +config SYS_VENDOR + default "aspeed" + +config SYS_CPU + default "ast2700" + +config SYS_CONFIG_NAME + default "ibex_ast2700" + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select RISCV_AST2700 + select SUPPORT_SPL + imply SPL_DRIVERS_MISC + +endif diff --git a/board/aspeed/ibex_ast2700/MAINTAINERS b/board/aspeed/ibex_ast2700/MAINTAINERS new file mode 100644 index 00000000000..777f582a20d --- /dev/null +++ b/board/aspeed/ibex_ast2700/MAINTAINERS @@ -0,0 +1,7 @@ +AST2700 using Ibex RISC-V Core as the boot MCU +M: Chia-Wei, Wang <chiawei_wang@aspeedtech.com> +S: Maintained +F: arch/riscv/include/asm/arch-ast2700/ +F: board/aspeed/ibex_ast2700/ +F: configs/ibex-ast2700_defconfig +F: include/configs/ibex_ast2700.h diff --git a/board/aspeed/ibex_ast2700/Makefile b/board/aspeed/ibex_ast2700/Makefile new file mode 100644 index 00000000000..3d8eea9166d --- /dev/null +++ b/board/aspeed/ibex_ast2700/Makefile @@ -0,0 +1,3 @@ +obj-y += ibex_ast2700.o +obj-y += fmc_hdr.o +obj-y += sli.o diff --git a/board/aspeed/ibex_ast2700/fmc_hdr.c b/board/aspeed/ibex_ast2700/fmc_hdr.c new file mode 100644 index 00000000000..2068a906f60 --- /dev/null +++ b/board/aspeed/ibex_ast2700/fmc_hdr.c @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) Aspeed Technology Inc. + */ + +#include <asm/arch/fmc_hdr.h> +#include <asm/io.h> +#include <asm/sections.h> +#include <errno.h> +#include <spl.h> +#include <string.h> + +int fmc_hdr_get_prebuilt(uint32_t type, uint32_t *ofst, uint32_t *size) +{ + struct fmc_hdr_preamble *preamble; + struct fmc_hdr_body *body; + struct fmc_hdr *hdr; + uint32_t t, s, o; + int i; + + if (type >= PBT_NUM) + return -EINVAL; + + if (!ofst || !size) + return -EINVAL; + + hdr = (struct fmc_hdr *)(_start - sizeof(*hdr)); + preamble = &hdr->preamble; + body = &hdr->body; + + if (preamble->magic != HDR_MAGIC) + return -EIO; + + for (i = 0, o = sizeof(*hdr) + body->fmc_size; i < HDR_PB_MAX; ++i) { + t = body->pbs[i].type; + s = body->pbs[i].size; + + /* skip if unrecognized, yet */ + if (t >= PBT_NUM) { + o += s; + continue; + } + + /* prebuilt end mark */ + if (t == 0 && s == 0) + break; + + /* return the prebuilt info if found */ + if (t == type) { + *ofst = o; + *size = s; + + goto found; + } + + /* update offset for next prebuilt */ + o += s; + } + + return -ENODATA; + +found: + return 0; +} diff --git a/board/aspeed/ibex_ast2700/ibex_ast2700.c b/board/aspeed/ibex_ast2700/ibex_ast2700.c new file mode 100644 index 00000000000..e697f9b8baa --- /dev/null +++ b/board/aspeed/ibex_ast2700/ibex_ast2700.c @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) Aspeed Technology Inc. + */ +#include <asm/io.h> +#include <asm/arch/sli.h> +#include <dm.h> +#include <ram.h> +#include <spl.h> + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + int ret; + struct udevice *dev; + struct ram_info ram; + + ret = uclass_get_device(UCLASS_RAM, 0, &dev); + if (ret) { + printf("cannot get DRAM driver\n"); + return ret; + } + + ret = ram_get_info(dev, &ram); + if (ret) { + printf("cannot get DRAM information\n"); + return ret; + } + + gd->ram_size = ram.size; + + return 0; +} + +int spl_board_init_f(void) +{ + sli_init(); + + dram_init(); + + return 0; +} + +struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size) +{ + return (struct legacy_img_hdr *)CONFIG_SYS_LOAD_ADDR; +} + +void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len) +{ + return (void *)spl_get_load_buffer(sectors, bl_len); +} + +u32 spl_boot_device(void) +{ + return BOOT_DEVICE_RAM; +} + +int board_init(void) +{ + struct udevice *dev; + int i = 0; + int ret; + + /* + * Loop over all MISC uclass drivers to call the comphy code + * and init all CP110 devices enabled in the DT + */ + while (1) { + /* Call the comphy code via the MISC uclass driver */ + ret = uclass_get_device(UCLASS_MISC, i++, &dev); + + /* We're done, once no further CP110 device is found */ + if (ret) + break; + } + + return 0; +} + +int board_late_init(void) +{ + return 0; +} diff --git a/board/aspeed/ibex_ast2700/sli.c b/board/aspeed/ibex_ast2700/sli.c new file mode 100644 index 00000000000..7868111d844 --- /dev/null +++ b/board/aspeed/ibex_ast2700/sli.c @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) Aspeed Technology Inc. + */ +#include <asm/io.h> +#include <asm/arch/sli.h> +#include <asm/arch/scu.h> +#include <linux/bitfield.h> +#include <linux/bitops.h> + +#define SLI_POLL_TIMEOUT_US 100 + +static void sli_clear_interrupt_status(uint32_t base) +{ + writel(-1, (void *)base + SLI_INTR_STATUS); +} + +static int sli_wait(uint32_t base, uint32_t mask) +{ + uint32_t value; + + sli_clear_interrupt_status(base); + + do { + value = readl((void *)base + SLI_INTR_STATUS); + if (value & SLI_INTR_RX_ERRORS) + return -1; + } while ((value & mask) != mask); + + return 0; +} + +static int sli_wait_suspend(uint32_t base) +{ + return sli_wait(base, SLI_INTR_TX_SUSPEND | SLI_INTR_RX_SUSPEND); +} + +/* + * CPU die --- downstream pads ---> I/O die + * CPU die <--- upstream pads ----- I/O die + * + * US/DS PAD[3:0] : SLIM[3:0] + * US/DS PAD[5:4] : SLIH[1:0] + * US/DS PAD[7:6] : SLIV[1:0] + */ +int sli_init(void) +{ + uint32_t value; + + /* The following training sequence is designed for AST2700A0 */ + value = FIELD_GET(SCU1_REVISION_HWID, readl(SCU1_REVISION)); + if (value) + return 0; + + /* Return if SLI had been calibrated */ + value = readl((void *)SLIH_IOD_BASE + SLI_CTRL_III); + value = FIELD_GET(SLI_CLK_SEL, value); + if (value) { + debug("SLI has been initialized\n"); + return 0; + } + + /* 25MHz PAD delay for AST2700A0 */ + value = SLI_RX_PHY_LAH_SEL_NEG | SLI_TRANS_EN | SLI_CLEAR_BUS; + writel(value, (void *)SLIH_IOD_BASE + SLI_CTRL_I); + writel(value, (void *)SLIM_IOD_BASE + SLI_CTRL_I); + writel(value | SLIV_RAW_MODE, (void *)SLIV_IOD_BASE + SLI_CTRL_I); + sli_wait_suspend(SLIH_IOD_BASE); + sli_wait_suspend(SLIH_CPU_BASE); + + return 0; +} diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c index 3bd94d0889d..af486e977e5 100644 --- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c +++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c @@ -125,7 +125,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct atmel_mpddrc_config ddr2; diff --git a/board/atmel/at91sam9n12ek/at91sam9n12ek.c b/board/atmel/at91sam9n12ek/at91sam9n12ek.c index afc0c0520e1..6f9abcbb127 100644 --- a/board/atmel/at91sam9n12ek/at91sam9n12ek.c +++ b/board/atmel/at91sam9n12ek/at91sam9n12ek.c @@ -167,7 +167,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c b/board/atmel/at91sam9x5ek/at91sam9x5ek.c index e5688c6cf13..f52b9a97731 100644 --- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c +++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c @@ -181,7 +181,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; diff --git a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c index 36995a927cf..cb3cd7ac9ae 100644 --- a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c +++ b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c @@ -146,7 +146,7 @@ static void ddrc_conf(struct atmel_mpddrc_config *ddrc) (8 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET)); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct atmel_mpddr *mpddrc = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC; diff --git a/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c b/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c index c775d593e58..15cbd0daa6f 100644 --- a/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c +++ b/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c @@ -208,7 +208,7 @@ static void ddrc_conf(struct atmel_mpddrc_config *ddrc) ddrc->cal_mr4 |= ATMEL_MPDDRC_CAL_MR4_MR4R(0xFFFE); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct atmel_mpddr *mpddrc = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC; diff --git a/board/atmel/sama5d2_icp/sama5d2_icp.c b/board/atmel/sama5d2_icp/sama5d2_icp.c index 986da01639f..6f0d578abf7 100644 --- a/board/atmel/sama5d2_icp/sama5d2_icp.c +++ b/board/atmel/sama5d2_icp/sama5d2_icp.c @@ -180,7 +180,7 @@ static void ddrc_conf(struct atmel_mpddrc_config *ddrc) (7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET)); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct atmel_mpddr *mpddrc = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC; diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index c8a8eb49826..d104736fa7c 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -146,7 +146,7 @@ static void ddrc_conf(struct atmel_mpddrc_config *ddrc) 7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct atmel_mpddr *mpddrc = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC; diff --git a/board/atmel/sama5d3_xplained/sama5d3_xplained.c b/board/atmel/sama5d3_xplained/sama5d3_xplained.c index 54cc3c4d900..f98322fb540 100644 --- a/board/atmel/sama5d3_xplained/sama5d3_xplained.c +++ b/board/atmel/sama5d3_xplained/sama5d3_xplained.c @@ -175,7 +175,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct atmel_mpddrc_config ddr2; diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index f2e1242fcb0..28079a81517 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -241,7 +241,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct atmel_mpddrc_config ddr2; diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c index 09ca16ca88c..f9112fc5321 100644 --- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c +++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c @@ -184,7 +184,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct atmel_mpddrc_config ddr2; diff --git a/board/atmel/sama5d4ek/sama5d4ek.c b/board/atmel/sama5d4ek/sama5d4ek.c index 1f8b85f0614..0bdc6adbdc8 100644 --- a/board/atmel/sama5d4ek/sama5d4ek.c +++ b/board/atmel/sama5d4ek/sama5d4ek.c @@ -169,7 +169,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct atmel_mpddrc_config ddr2; const struct atmel_mpddr *mpddr = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC; diff --git a/board/cobra5272/flash.c b/board/cobra5272/flash.c index 616842e62f4..7d81036647e 100644 --- a/board/cobra5272/flash.c +++ b/board/cobra5272/flash.c @@ -11,7 +11,7 @@ #include <irq_func.h> #include <stdio.h> #include <time.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <vsprintf.h> #include <linux/delay.h> #include <linux/string.h> @@ -135,22 +135,22 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) { ulong result; int iflag, cflag, prot, sect; - int rc = ERR_OK; + int rc = FL_ERR_OK; int chip1; ulong start; /* first look for protection bits */ if (info->flash_id == FLASH_UNKNOWN) - return ERR_UNKNOWN_FLASH_TYPE; + return FL_ERR_UNKNOWN_FLASH_TYPE; if ((s_first < 0) || (s_first > s_last)) { - return ERR_INVAL; + return FL_ERR_INVAL; } if ((info->flash_id & FLASH_VENDMASK) != (AMD_MANUFACT & FLASH_VENDMASK)) { - return ERR_UNKNOWN_FLASH_VENDOR; + return FL_ERR_UNKNOWN_FLASH_VENDOR; } prot = 0; @@ -160,7 +160,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) } } if (prot) - return ERR_PROTECTED; + return FL_ERR_PROTECTED; /* * Disable interrupts which might cause a timeout @@ -217,11 +217,11 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) MEM_FLASH_ADDR1 = CMD_READ_ARRAY; if (chip1 == ERR) { - rc = ERR_PROG_ERROR; + rc = FL_ERR_PROG_ERROR; goto outahere; } if (chip1 == TMO) { - rc = ERR_TIMEOUT; + rc = FL_ERR_TIMEOUT; goto outahere; } @@ -252,7 +252,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong data) { volatile u16 *addr = (volatile u16 *) dest; ulong result; - int rc = ERR_OK; + int rc = FL_ERR_OK; int cflag, iflag; int chip1; ulong start; @@ -262,7 +262,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong data) */ result = *addr; if ((result & data) != data) - return ERR_NOT_ERASED; + return FL_ERR_NOT_ERASED; /* * Disable interrupts which might cause a timeout @@ -302,7 +302,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong data) *addr = CMD_READ_ARRAY; if (chip1 == ERR || *addr != data) - rc = ERR_PROG_ERROR; + rc = FL_ERR_PROG_ERROR; if (iflag) enable_interrupts(); @@ -320,13 +320,13 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) if (addr & 1) { printf ("unaligned destination not supported\n"); - return ERR_ALIGN; + return FL_ERR_ALIGN; } #if 0 if (cnt & 1) { printf ("odd transfer sizes not supported\n"); - return ERR_ALIGN; + return FL_ERR_ALIGN; } #endif @@ -364,5 +364,5 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) cnt -= 1; } - return ERR_OK; + return FL_ERR_OK; } diff --git a/board/comvetia/lxr2/Kconfig b/board/comvetia/lxr2/Kconfig new file mode 100644 index 00000000000..93c7f49071c --- /dev/null +++ b/board/comvetia/lxr2/Kconfig @@ -0,0 +1,12 @@ +if TARGET_LXR2 + +config SYS_BOARD + default "lxr2" + +config SYS_VENDOR + default "comvetia" + +config SYS_CONFIG_NAME + default "lxr2" + +endif diff --git a/board/comvetia/lxr2/MAINTAINERS b/board/comvetia/lxr2/MAINTAINERS new file mode 100644 index 00000000000..25db90bb796 --- /dev/null +++ b/board/comvetia/lxr2/MAINTAINERS @@ -0,0 +1,6 @@ +COMVETIA LXR2 +M: Fabio Estevam <festevam@denx.de> +S: Maintained +F: board/comvetia/lxr2/ +F: include/configs/lxr2.h +F: configs/lxr2_defconfig diff --git a/board/comvetia/lxr2/Makefile b/board/comvetia/lxr2/Makefile new file mode 100644 index 00000000000..86b9284521c --- /dev/null +++ b/board/comvetia/lxr2/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y := lxr2.o diff --git a/board/comvetia/lxr2/lxr2.c b/board/comvetia/lxr2/lxr2.c new file mode 100644 index 00000000000..173263522bd --- /dev/null +++ b/board/comvetia/lxr2/lxr2.c @@ -0,0 +1,388 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Copyright (C) 2017 Stefano Babic <sbabic@denx.de> +// Copyright (C) 2024 Fabio Estevam <festevam@denx.de> + +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/crm_regs.h> +#include <asm/arch/mx6-ddr.h> +#include <asm/arch/iomux.h> +#include <asm/arch/mx6-pins.h> +#include <asm/mach-imx/iomux-v3.h> +#include <asm/mach-imx/boot_mode.h> + +#include <asm/mach-imx/spi.h> +#include <linux/errno.h> +#include <asm/gpio.h> +#include <nand.h> +#include <miiphy.h> +#include <netdev.h> +#include <asm/arch/sys_proto.h> +#include <asm/sections.h> +#include <linux/delay.h> + +#include <image.h> +#include <init.h> +#include <serial.h> +#include <spl.h> +#include <linux/sizes.h> +#include <mmc.h> +#include <fsl_esdhc_imx.h> + +DECLARE_GLOBAL_DATA_PTR; + +#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ + PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +#define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST) + +#define NAND_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST) + +int dram_init(void) +{ + gd->ram_size = imx_ddr_size(); + return 0; +} + +static const iomux_v3_cfg_t uart4_pads[] = { + MX6_PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), + MX6_PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), +}; + +static void setup_iomux_uart(void) +{ + imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads)); +} + +static void setup_gpmi_nand(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + + /* gate ENFC_CLK_ROOT clock first,before clk source switch */ + clrbits_le32(&mxc_ccm->CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK); + + /* config gpmi and bch clock to 100 MHz */ + clrsetbits_le32(&mxc_ccm->cs2cdr, + MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK | + MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK | + MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK, + MXC_CCM_CS2CDR_ENFC_CLK_PODF(0) | + MXC_CCM_CS2CDR_ENFC_CLK_PRED(3) | + MXC_CCM_CS2CDR_ENFC_CLK_SEL(3)); + + /* enable ENFC_CLK_ROOT clock */ + setbits_le32(&mxc_ccm->CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK); + + /* enable gpmi and bch clock gating */ + setbits_le32(&mxc_ccm->CCGR4, + MXC_CCM_CCGR4_RAWNAND_U_BCH_INPUT_APB_MASK | + MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_BCH_MASK | + MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_MASK | + MXC_CCM_CCGR4_RAWNAND_U_GPMI_INPUT_APB_MASK | + MXC_CCM_CCGR4_PL301_MX6QPER1_BCH_OFFSET); + + /* enable apbh clock gating */ + setbits_le32(&mxc_ccm->CCGR0, MXC_CCM_CCGR0_APBHDMA_MASK); +} + +int board_spi_cs_gpio(unsigned int bus, unsigned int cs) +{ + return IMX_GPIO_NR(4, 24); +} + +int board_early_init_f(void) +{ + setup_iomux_uart(); + + return 0; +} + +int board_init(void) +{ + /* address of boot parameters */ + gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; + + setup_gpmi_nand(); + + return 0; +} + +/* + * BOOT_CFG1, BOOT_CFG2, BOOT_CFG3, BOOT_CFG4 + * see Table 8-11 and Table 5-9 + * BOOT_CFG1[7] = 1 (boot from NAND) + * BOOT_CFG1[5] = 0 - raw NAND + * BOOT_CFG1[4] = 0 - default pad settings + * BOOT_CFG1[3:2] = 00 - devices = 1 + * BOOT_CFG1[1:0] = 00 - Row Address Cycles = 3 + * BOOT_CFG2[4:3] = 00 - Boot Search Count = 2 + * BOOT_CFG2[2:1] = 01 - Pages In Block = 64 + * BOOT_CFG2[0] = 0 - Reset time 12ms + */ +static const struct boot_mode board_boot_modes[] = { + /* NAND: 64pages per block, 3 row addr cycles, 2 copies of FCB/DBBT */ + {"nand", MAKE_CFGVAL(0x80, 0x02, 0x00, 0x00)}, + {"mmc0", MAKE_CFGVAL(0x40, 0x20, 0x00, 0x00)}, + {NULL, 0}, +}; + +int board_late_init(void) +{ + add_board_boot_modes(board_boot_modes); + + return 0; +} + +#ifdef CONFIG_SPL_BUILD +#include <spl.h> + +#define MX6_PHYFLEX_ERR006282 IMX_GPIO_NR(2, 11) +static void phyflex_err006282_workaround(void) +{ + /* + * Boards beginning with 1362.2 have the SD4_DAT3 pin connected + * to the CMIC. If this pin isn't toggled within 10s the boards + * reset. The pin is unconnected on older boards, so we do not + * need a check for older boards before applying this fixup. + */ + + gpio_request(MX6_PHYFLEX_ERR006282, "errata_gpio"); + gpio_direction_output(MX6_PHYFLEX_ERR006282, 0); + mdelay(2); + gpio_direction_output(MX6_PHYFLEX_ERR006282, 1); + mdelay(2); + gpio_set_value(MX6_PHYFLEX_ERR006282, 0); + + imx_iomux_v3_setup_pad(MX6_PAD_SD4_DAT3__GPIO2_IO11); + + gpio_direction_input(MX6_PHYFLEX_ERR006282); +} + +static const iomux_v3_cfg_t gpios_pads[] = { + MX6_PAD_SD4_DAT3__GPIO2_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_SD4_DAT4__GPIO2_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_SD4_DAT5__GPIO2_IO13 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_SD4_DAT6__GPIO2_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_SD4_DAT7__GPIO2_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_EIM_EB3__GPIO2_IO31 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_ENET_TXD0__GPIO1_IO30 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static void setup_gpios(void) +{ + imx_iomux_v3_setup_multiple_pads(gpios_pads, ARRAY_SIZE(gpios_pads)); +} + +static const struct mx6dq_iomux_ddr_regs mx6_ddr_ioregs = { + .dram_sdclk_0 = 0x00000030, + .dram_sdclk_1 = 0x00000030, + .dram_cas = 0x00000030, + .dram_ras = 0x00000030, + .dram_reset = 0x00000030, + .dram_sdcke0 = 0x00003000, + .dram_sdcke1 = 0x00003000, + .dram_sdba2 = 0x00000030, + .dram_sdodt0 = 0x00000030, + .dram_sdodt1 = 0x00000030, + + .dram_sdqs0 = 0x00000028, + .dram_sdqs1 = 0x00000028, + .dram_sdqs2 = 0x00000028, + .dram_sdqs3 = 0x00000028, + .dram_sdqs4 = 0x00000028, + .dram_sdqs5 = 0x00000028, + .dram_sdqs6 = 0x00000028, + .dram_sdqs7 = 0x00000028, + .dram_dqm0 = 0x00000028, + .dram_dqm1 = 0x00000028, + .dram_dqm2 = 0x00000028, + .dram_dqm3 = 0x00000028, + .dram_dqm4 = 0x00000028, + .dram_dqm5 = 0x00000028, + .dram_dqm6 = 0x00000028, + .dram_dqm7 = 0x00000028, +}; + +static const struct mx6dq_iomux_grp_regs mx6_grp_ioregs = { + .grp_ddr_type = 0x000C0000, + .grp_ddrmode_ctl = 0x00020000, + .grp_ddrpke = 0x00000000, + .grp_addds = 0x30, + .grp_ctlds = 0x30, + .grp_ddrmode = 0x00020000, + .grp_b0ds = 0x00000028, + .grp_b1ds = 0x00000028, + .grp_b2ds = 0x00000028, + .grp_b3ds = 0x00000028, + .grp_b4ds = 0x00000028, + .grp_b5ds = 0x00000028, + .grp_b6ds = 0x00000028, + .grp_b7ds = 0x00000028, +}; + +static const struct mx6_mmdc_calibration mx6_mmcd_calib = { + .p0_mpwldectrl0 = 0x00170018, + .p0_mpwldectrl1 = 0x003B0039, + .p1_mpwldectrl0 = 0x00350048, + .p1_mpwldectrl1 = 0x00410052, + .p0_mpdgctrl0 = 0x03600374, + .p0_mpdgctrl1 = 0x03680360, + .p1_mpdgctrl0 = 0x0370037C, + .p1_mpdgctrl1 = 0x03700350, + .p0_mprddlctl = 0x3A363234, + .p1_mprddlctl = 0x3634363C, + .p0_mpwrdlctl = 0x38383E3C, + .p1_mpwrdlctl = 0x422A483C, +}; + +/* MT41K64M16JT-125 (1Gb density) */ +static struct mx6_ddr3_cfg mem_ddr = { + .mem_speed = 1600, + .density = 1, + .width = 16, + .banks = 8, + .rowaddr = 13, + .coladdr = 10, + .pagesz = 2, + .trcd = 1375, + .trcmin = 4875, + .trasmin = 3500, + .SRT = 1, +}; + +static void ccgr_init(void) +{ + struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + + writel(0x00C03F3F, &ccm->CCGR0); + writel(0x0030FC03, &ccm->CCGR1); + writel(0x0FFFC000, &ccm->CCGR2); + writel(0x3FF00000, &ccm->CCGR3); + writel(0x00FFF300, &ccm->CCGR4); + writel(0x0F0000C3, &ccm->CCGR5); + writel(0x000003FF, &ccm->CCGR6); +} + +static void spl_dram_init(void) +{ + struct mx6_ddr_sysinfo sysinfo = { + .dsize = 2, + .cs_density = 6, + .ncs = 2, + .cs1_mirror = 1, + .rtt_wr = 1, + .rtt_nom = 1, + .walat = 1, + .ralat = 5, + .mif3_mode = 3, + .bi_on = 1, + .sde_to_rst = 0x10, + .rst_to_cke = 0x23, + .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, + .refr = 7, + }; + + mx6dq_dram_iocfg(64, &mx6_ddr_ioregs, &mx6_grp_ioregs); + mx6_dram_cfg(&sysinfo, &mx6_mmcd_calib, &mem_ddr); +} + +#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \ + PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ + PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +struct fsl_esdhc_cfg usdhc_cfg[1] = { + {USDHC3_BASE_ADDR}, +}; + +static const iomux_v3_cfg_t usdhc3_pads[] = { + MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +}; + +int board_mmc_init(struct bd_info *bis) +{ + imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); + usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); + usdhc_cfg[0].max_bus_width = 4; + gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk; + + return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); +} + +void board_boot_order(u32 *spl_boot_list) +{ + spl_boot_list[0] = spl_boot_device(); + + switch (spl_boot_list[0]) { + case BOOT_DEVICE_SPI: + spl_boot_list[1] = BOOT_DEVICE_UART; + break; + case BOOT_DEVICE_MMC1: + spl_boot_list[1] = BOOT_DEVICE_SPI; + spl_boot_list[2] = BOOT_DEVICE_UART; + break; + default: + printf("Boot device %x\n", spl_boot_list[0]); + } +} + +static const iomux_v3_cfg_t ecspi3_pads[] = { + MX6_PAD_DISP0_DAT0__ECSPI3_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL), + MX6_PAD_DISP0_DAT1__ECSPI3_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL), + MX6_PAD_DISP0_DAT2__ECSPI3_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL), + MX6_PAD_DISP0_DAT3__GPIO4_IO24 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static void setup_spi(void) +{ + imx_iomux_v3_setup_multiple_pads(ecspi3_pads, ARRAY_SIZE(ecspi3_pads)); + + enable_spi_clk(true, 2); +} + +void board_init_f(ulong dummy) +{ + /* setup clock gating */ + ccgr_init(); + + /* setup AIPS and disable watchdog */ + arch_cpu_init(); + + /* setup AXI */ + gpr_init(); + + board_early_init_f(); + + /* setup GP timer */ + timer_init(); + + /* UART clocks enabled and gd valid - init serial console */ + preloader_console_init(); + + setup_spi(); + + setup_gpios(); + + /* DDR initialization */ + spl_dram_init(); + + /* Clear the BSS. */ + memset(__bss_start, 0, __bss_end - __bss_start); + + phyflex_err006282_workaround(); + + /* load/boot image from boot device */ + board_init_r(NULL, 0); +} +#endif diff --git a/board/comvetia/lxr2/lxr2.env b/board/comvetia/lxr2/lxr2.env new file mode 100644 index 00000000000..ec213800222 --- /dev/null +++ b/board/comvetia/lxr2/lxr2.env @@ -0,0 +1,34 @@ +addcons=setenv bootargs ${bootargs} console=${console},${baudrate} +addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off +addmisc=setenv bootargs ${bootargs} ${miscargs} +addmtd=run mtdnand;run mtdspi;setenv bootargs ${bootargs} ${mtdparts} +altbootcmd=run swupdate +bootcmd=run nandboot;run swupdate +bootcount=2 +bootlimit=3 +console=ttymxc3 +cpu=armv7 +ethprime=FEC +fdt_addr_r=0x18000000 +fitfile=fitImage +flash-all-from-sd-card=env default -f -a;load mmc 0:1 10000000 u-boot.scr;source 10000000;saveenv +initrd_high=0xffffffff +kernel_addr_r=0x12000000 +loadaddr=0x12000000 +miscargs=panic=1 +mmcargs=setenv bootargs root=${mmcroot} rw rootwait +mmcboot=if run mmcload;then run mmcargs addcons addmisc;bootm;fi +mmcload=mmc rescan;load mmc 0:${mmcpart} ${kernel_addr_r} boot/fitImage +mmcpart=1 +mmcroot=/dev/mmcblk0p1 +mtdnand=setenv mtdparts mtdparts=gpmi-nand:40m(Kernels),860m(root),-(nand) +mtdspi=setenv mtdparts ${mtdparts}';spi2.0:1024k(bootloader),64k(env1),64k(env2),-(rescue)' +nanboot_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};run nandargs addip addcons addmtd addmisc;bootm +nandargs=setenv bootargs ubi.mtd=1 root=ubi0:rootfs${ubiroot} rootfstype=ubifs +nandboot=run mtdnand;ubi part Kernels;ubi readvol ${kernel_addr_r} kernel${ubiroot};run nandargs addip addcons addmtd addmisc;bootm ${kernel_addr_r} +net_nfs=tftp ${kernel_addr_r} ${board_name}/${bootfile};tftp ${fdt_addr_r} ${board_name}/${fdt_file};run nfsargs addip addcons addmtd addmisc;bootm ${kernel_addr_r} - ${fdt_addr_r} +net_nfs_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};run nfsargs addip addcons addmtd addmisc;bootm ${kernel_addr_r} +netmask=255.255.255.0 +nfsargs=setenv bootargs root=/dev/nfs nfsroot=${serverip}:${nfsroot},v3 panic=1 +swupdate=setenv bootargs root=/dev/ram;run addip addcons addmtd addmisc;sf probe;sf read ${kernel_addr_r} 120000 600000;sf read 14000000 730000 800000;bootm ${kernel_addr_r} 14000000 +ubiroot=1 diff --git a/board/conclusive/kstr-sama5d27/kstr-sama5d27.c b/board/conclusive/kstr-sama5d27/kstr-sama5d27.c index 64282ae9dc7..37750137ad9 100644 --- a/board/conclusive/kstr-sama5d27/kstr-sama5d27.c +++ b/board/conclusive/kstr-sama5d27/kstr-sama5d27.c @@ -182,7 +182,7 @@ static void ddrc_conf(struct atmel_mpddrc_config *ddrc) (8 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET)); } -void mem_init(void) +void at91_mem_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; struct atmel_mpddr *mpddrc = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC; diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c b/board/dhelectronics/dh_imx6/dh_imx6.c index c8dd30dfeaf..f2b14bf701a 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6.c +++ b/board/dhelectronics/dh_imx6/dh_imx6.c @@ -30,6 +30,7 @@ #include <fuse.h> #include <i2c_eeprom.h> #include <mmc.h> +#include <power/regulator.h> #include <usb.h> #include <linux/delay.h> #include <usb/ehci-ci.h> diff --git a/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c b/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c index c635735d89c..78aae412350 100644 --- a/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c +++ b/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c @@ -14,6 +14,7 @@ #include <malloc.h> #include <net.h> #include <miiphy.h> +#include <power/regulator.h> #include "lpddr4_timing.h" #include "../common/dh_common.h" diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index 4f4f537fee5..24c5f37c12f 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -622,8 +622,6 @@ static void board_init_regulator_av96(void) static void board_init_regulator(void) { board_init_regulator_av96(); - - regulators_enable_boot_on(_DEBUG); } #else static inline int board_get_regulator_buck3_nvm_uv_av96(int *uv) diff --git a/board/engicam/stm32mp1/stm32mp1.c b/board/engicam/stm32mp1/stm32mp1.c index bc2af66d8e9..56557d56429 100644 --- a/board/engicam/stm32mp1/stm32mp1.c +++ b/board/engicam/stm32mp1/stm32mp1.c @@ -37,9 +37,6 @@ int checkboard(void) /* board dependent setup after realloc */ int board_init(void) { - if (IS_ENABLED(CONFIG_DM_REGULATOR)) - regulators_enable_boot_on(_DEBUG); - return 0; } diff --git a/board/freescale/imx93_evk/Makefile b/board/freescale/imx93_evk/Makefile index 17956d24bf7..ede8d20ff5c 100644 --- a/board/freescale/imx93_evk/Makefile +++ b/board/freescale/imx93_evk/Makefile @@ -8,9 +8,5 @@ obj-y += imx93_evk.o ifdef CONFIG_SPL_BUILD obj-y += spl.o -ifdef CONFIG_IMX9_LOW_DRIVE_MODE -obj-$(CONFIG_IMX93_EVK_LPDDR4X) += lpddr4x_timing_ld.o -else -obj-$(CONFIG_IMX93_EVK_LPDDR4X) += lpddr4x_timing.o -endif +obj-$(CONFIG_IMX93_EVK_LPDDR4X) += lpddr4x_timing.o lpddr4x_timing_1866mts.o endif diff --git a/board/freescale/imx93_evk/lpddr4x_timing_1866mts.c b/board/freescale/imx93_evk/lpddr4x_timing_1866mts.c new file mode 100644 index 00000000000..f4e910b2536 --- /dev/null +++ b/board/freescale/imx93_evk/lpddr4x_timing_1866mts.c @@ -0,0 +1,1995 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright 2024 NXP + * + * Code generated with DDR Tool v3.4.0_8.3-4e2b550a. + * DDR PHY FW2022.01 + */ + +#include <linux/kernel.h> +#include <asm/arch/ddr.h> + +/* Initialize DDRC registers */ +static struct dram_cfg_param ddr_ddrc_cfg[] = { + {0x4e300110, 0x44100001}, + {0x4e300000, 0x8000ff}, + {0x4e300008, 0x0}, + {0x4e300080, 0x80000512}, + {0x4e300084, 0x0}, + {0x4e300114, 0x1002}, + {0x4e300260, 0x80}, + {0x4e300f04, 0x80}, + {0x4e300800, 0x43b30002}, + {0x4e300804, 0x1f1f1f1f}, + {0x4e301000, 0x0}, + {0x4e301240, 0x0}, + {0x4e301244, 0x0}, + {0x4e301248, 0x0}, + {0x4e30124c, 0x0}, + {0x4e301250, 0x0}, + {0x4e301254, 0x0}, + {0x4e301258, 0x0}, + {0x4e30125c, 0x0}, +}; + +/* dram fsp cfg */ +static struct dram_fsp_cfg ddr_dram_fsp_cfg[] = { + { + { + {0x4e300100, 0x12552100}, + {0x4e300104, 0xF877000E}, + {0x4e300108, 0x1816B4AA}, + {0x4e30010C, 0x0051E1E6}, + {0x4e300124, 0x0E3A0000}, + {0x4e300160, 0x00009101}, + {0x4e30016C, 0x30900000}, + {0x4e300170, 0x8A0A0508}, + {0x4e300250, 0x00000014}, + {0x4e300254, 0x00AA00AA}, + {0x4e300258, 0x00000008}, + {0x4e30025C, 0x00000400}, + {0x4e300300, 0x11281109}, + {0x4e300304, 0x00AA140A}, + {0x4e300308, 0x063C071E}, + }, + { + {0x01, 0xB4}, + {0x02, 0x1B}, + {0x03, 0x32}, + {0x0b, 0x46}, + {0x0c, 0x11}, + {0x0e, 0x11}, + {0x16, 0x04}, + }, + 0, + }, + { + { + {0x4e300100, 0x010A1000}, + {0x4e300104, 0xF855000A}, + {0x4e300108, 0x9492AA58}, + {0x4e30010C, 0x00310113}, + {0x4e300124, 0x071E0000}, + {0x4e300160, 0x00009100}, + {0x4e30016C, 0x30200000}, + {0x4e300170, 0x89090408}, + {0x4e300250, 0x0000000A}, + {0x4e300254, 0x00510051}, + {0x4e300258, 0x00000008}, + {0x4e30025C, 0x00000400}, + }, + { + {0x01, 0x94}, + {0x02, 0x9}, + {0x03, 0x32}, + {0x0b, 0x46}, + {0x0c, 0x11}, + {0x0e, 0x11}, + {0x16, 0x04}, + }, + 0, + }, + { + { + {0x4e300100, 0x00061000}, + {0x4e300104, 0xF855000A}, + {0x4e300108, 0x6E62FA48}, + {0x4e30010C, 0x0031010D}, + {0x4e300124, 0x04C50000}, + {0x4e300160, 0x00009100}, + {0x4e30016C, 0x30000000}, + {0x4e300170, 0x89090408}, + {0x4e300250, 0x00000007}, + {0x4e300254, 0x00340034}, + {0x4e300258, 0x00000008}, + {0x4e30025C, 0x00000400}, + }, + { + {0x01, 0x94}, + {0x02, 0x9}, + {0x03, 0x32}, + {0x0b, 0x46}, + {0x0c, 0x11}, + {0x0e, 0x11}, + {0x16, 0x04}, + }, + 1, + }, +}; + +/* PHY Initialize Configuration */ +static struct dram_cfg_param ddr_ddrphy_cfg[] = { + {0x100a0, 0x4}, + {0x100a1, 0x5}, + {0x100a2, 0x6}, + {0x100a3, 0x7}, + {0x100a4, 0x0}, + {0x100a5, 0x1}, + {0x100a6, 0x2}, + {0x100a7, 0x3}, + {0x110a0, 0x3}, + {0x110a1, 0x2}, + {0x110a2, 0x0}, + {0x110a3, 0x1}, + {0x110a4, 0x7}, + {0x110a5, 0x6}, + {0x110a6, 0x4}, + {0x110a7, 0x5}, + {0x1005f, 0x5ff}, + {0x1015f, 0x5ff}, + {0x1105f, 0x5ff}, + {0x1115f, 0x5ff}, + {0x11005f, 0x5ff}, + {0x11015f, 0x5ff}, + {0x11105f, 0x5ff}, + {0x11115f, 0x5ff}, + {0x21005f, 0x5ff}, + {0x21015f, 0x5ff}, + {0x21105f, 0x5ff}, + {0x21115f, 0x5ff}, + {0x55, 0x1ff}, + {0x1055, 0x1ff}, + {0x2055, 0x1ff}, + {0x200c5, 0xb}, + {0x1200c5, 0x3}, + {0x2200c5, 0x7}, + {0x2002e, 0x2}, + {0x12002e, 0x1}, + {0x22002e, 0x2}, + {0x90204, 0x0}, + {0x190204, 0x0}, + {0x290204, 0x0}, + {0x20024, 0x1e3}, + {0x2003a, 0x2}, + {0x2007d, 0x212}, + {0x2007c, 0x61}, + {0x120024, 0x1e3}, + {0x2003a, 0x2}, + {0x12007d, 0x212}, + {0x12007c, 0x61}, + {0x220024, 0x1e3}, + {0x2003a, 0x2}, + {0x22007d, 0x212}, + {0x22007c, 0x61}, + {0x20056, 0x3}, + {0x120056, 0x3}, + {0x220056, 0x3}, + {0x1004d, 0x600}, + {0x1014d, 0x600}, + {0x1104d, 0x600}, + {0x1114d, 0x600}, + {0x11004d, 0x600}, + {0x11014d, 0x600}, + {0x11104d, 0x600}, + {0x11114d, 0x600}, + {0x21004d, 0x600}, + {0x21014d, 0x600}, + {0x21104d, 0x600}, + {0x21114d, 0x600}, + {0x10049, 0xe00}, + {0x10149, 0xe00}, + {0x11049, 0xe00}, + {0x11149, 0xe00}, + {0x110049, 0xe00}, + {0x110149, 0xe00}, + {0x111049, 0xe00}, + {0x111149, 0xe00}, + {0x210049, 0xe00}, + {0x210149, 0xe00}, + {0x211049, 0xe00}, + {0x211149, 0xe00}, + {0x43, 0x60}, + {0x1043, 0x60}, + {0x2043, 0x60}, + {0x20018, 0x1}, + {0x20075, 0x4}, + {0x20050, 0x0}, + {0x2009b, 0x2}, + {0x20008, 0x1d3}, + {0x120008, 0xe9}, + {0x220008, 0x9c}, + {0x20088, 0x9}, + {0x200b2, 0x10c}, + {0x10043, 0x5a1}, + {0x10143, 0x5a1}, + {0x11043, 0x5a1}, + {0x11143, 0x5a1}, + {0x1200b2, 0x10c}, + {0x110043, 0x5a1}, + {0x110143, 0x5a1}, + {0x111043, 0x5a1}, + {0x111143, 0x5a1}, + {0x2200b2, 0x10c}, + {0x210043, 0x5a1}, + {0x210143, 0x5a1}, + {0x211043, 0x5a1}, + {0x211143, 0x5a1}, + {0x200fa, 0x2}, + {0x1200fa, 0x2}, + {0x2200fa, 0x2}, + {0x20019, 0x1}, + {0x120019, 0x1}, + {0x220019, 0x1}, + {0x200f0, 0x600}, + {0x200f1, 0x0}, + {0x200f2, 0x4444}, + {0x200f3, 0x8888}, + {0x200f4, 0x5655}, + {0x200f5, 0x0}, + {0x200f6, 0x0}, + {0x200f7, 0xf000}, + {0x1004a, 0x500}, + {0x1104a, 0x500}, + {0x20025, 0x0}, + {0x2002d, 0x0}, + {0x12002d, 0x0}, + {0x22002d, 0x0}, + {0x2002c, 0x0}, + {0x20021, 0x0}, + {0x200c7, 0x21}, + {0x1200c7, 0x41}, + {0x200ca, 0x24}, + {0x1200ca, 0x24}, +}; + +/* PHY trained csr */ +static struct dram_cfg_param ddr_ddrphy_trained_csr[] = { + {0x1005f, 0x0}, + {0x1015f, 0x0}, + {0x1105f, 0x0}, + {0x1115f, 0x0}, + {0x11005f, 0x0}, + {0x11015f, 0x0}, + {0x11105f, 0x0}, + {0x11115f, 0x0}, + {0x21005f, 0x0}, + {0x21015f, 0x0}, + {0x21105f, 0x0}, + {0x21115f, 0x0}, + {0x55, 0x0}, + {0x1055, 0x0}, + {0x2055, 0x0}, + {0x200c5, 0x0}, + {0x1200c5, 0x0}, + {0x2200c5, 0x0}, + {0x2002e, 0x0}, + {0x12002e, 0x0}, + {0x22002e, 0x0}, + {0x90204, 0x0}, + {0x190204, 0x0}, + {0x290204, 0x0}, + {0x20024, 0x0}, + {0x2003a, 0x0}, + {0x2007d, 0x0}, + {0x2007c, 0x0}, + {0x120024, 0x0}, + {0x12007d, 0x0}, + {0x12007c, 0x0}, + {0x220024, 0x0}, + {0x22007d, 0x0}, + {0x22007c, 0x0}, + {0x20056, 0x0}, + {0x120056, 0x0}, + {0x220056, 0x0}, + {0x1004d, 0x0}, + {0x1014d, 0x0}, + {0x1104d, 0x0}, + {0x1114d, 0x0}, + {0x11004d, 0x0}, + {0x11014d, 0x0}, + {0x11104d, 0x0}, + {0x11114d, 0x0}, + {0x21004d, 0x0}, + {0x21014d, 0x0}, + {0x21104d, 0x0}, + {0x21114d, 0x0}, + {0x10049, 0x0}, + {0x10149, 0x0}, + {0x11049, 0x0}, + {0x11149, 0x0}, + {0x110049, 0x0}, + {0x110149, 0x0}, + {0x111049, 0x0}, + {0x111149, 0x0}, + {0x210049, 0x0}, + {0x210149, 0x0}, + {0x211049, 0x0}, + {0x211149, 0x0}, + {0x43, 0x0}, + {0x1043, 0x0}, + {0x2043, 0x0}, + {0x20018, 0x0}, + {0x20075, 0x0}, + {0x20050, 0x0}, + {0x2009b, 0x0}, + {0x20008, 0x0}, + {0x120008, 0x0}, + {0x220008, 0x0}, + {0x20088, 0x0}, + {0x200b2, 0x0}, + {0x10043, 0x0}, + {0x10143, 0x0}, + {0x11043, 0x0}, + {0x11143, 0x0}, + {0x1200b2, 0x0}, + {0x110043, 0x0}, + {0x110143, 0x0}, + {0x111043, 0x0}, + {0x111143, 0x0}, + {0x2200b2, 0x0}, + {0x210043, 0x0}, + {0x210143, 0x0}, + {0x211043, 0x0}, + {0x211143, 0x0}, + {0x200fa, 0x0}, + {0x1200fa, 0x0}, + {0x2200fa, 0x0}, + {0x20019, 0x0}, + {0x120019, 0x0}, + {0x220019, 0x0}, + {0x200f0, 0x0}, + {0x200f1, 0x0}, + {0x200f2, 0x0}, + {0x200f3, 0x0}, + {0x200f4, 0x0}, + {0x200f5, 0x0}, + {0x200f6, 0x0}, + {0x200f7, 0x0}, + {0x1004a, 0x0}, + {0x1104a, 0x0}, + {0x20025, 0x0}, + {0x2002d, 0x0}, + {0x12002d, 0x0}, + {0x22002d, 0x0}, + {0x2002c, 0x0}, + {0xd0000, 0x0}, + {0x90000, 0x0}, + {0x90001, 0x0}, + {0x90002, 0x0}, + {0x90003, 0x0}, + {0x90004, 0x0}, + {0x90005, 0x0}, + {0x90029, 0x0}, + {0x9002a, 0x0}, + {0x9002b, 0x0}, + {0x9002c, 0x0}, + {0x9002d, 0x0}, + {0x9002e, 0x0}, + {0x9002f, 0x0}, + {0x90030, 0x0}, + {0x90031, 0x0}, + {0x90032, 0x0}, + {0x90033, 0x0}, + {0x90034, 0x0}, + {0x90035, 0x0}, + {0x90036, 0x0}, + {0x90037, 0x0}, + {0x90038, 0x0}, + {0x90039, 0x0}, + {0x9003a, 0x0}, + {0x9003b, 0x0}, + {0x9003c, 0x0}, + {0x9003d, 0x0}, + {0x9003e, 0x0}, + {0x9003f, 0x0}, + {0x90040, 0x0}, + {0x90041, 0x0}, + {0x90042, 0x0}, + {0x90043, 0x0}, + {0x90044, 0x0}, + {0x90045, 0x0}, + {0x90046, 0x0}, + {0x90047, 0x0}, + {0x90048, 0x0}, + {0x90049, 0x0}, + {0x9004a, 0x0}, + {0x9004b, 0x0}, + {0x9004c, 0x0}, + {0x9004d, 0x0}, + {0x9004e, 0x0}, + {0x9004f, 0x0}, + {0x90050, 0x0}, + {0x90051, 0x0}, + {0x90052, 0x0}, + {0x90053, 0x0}, + {0x90054, 0x0}, + {0x90055, 0x0}, + {0x90056, 0x0}, + {0x90057, 0x0}, + {0x90058, 0x0}, + {0x90059, 0x0}, + {0x9005a, 0x0}, + {0x9005b, 0x0}, + {0x9005c, 0x0}, + {0x9005d, 0x0}, + {0x9005e, 0x0}, + {0x9005f, 0x0}, + {0x90060, 0x0}, + {0x90061, 0x0}, + {0x90062, 0x0}, + {0x90063, 0x0}, + {0x90064, 0x0}, + {0x90065, 0x0}, + {0x90066, 0x0}, + {0x90067, 0x0}, + {0x90068, 0x0}, + {0x90069, 0x0}, + {0x9006a, 0x0}, + {0x9006b, 0x0}, + {0x9006c, 0x0}, + {0x9006d, 0x0}, + {0x9006e, 0x0}, + {0x9006f, 0x0}, + {0x90070, 0x0}, + {0x90071, 0x0}, + {0x90072, 0x0}, + {0x90073, 0x0}, + {0x90074, 0x0}, + {0x90075, 0x0}, + {0x90076, 0x0}, + {0x90077, 0x0}, + {0x90078, 0x0}, + {0x90079, 0x0}, + {0x9007a, 0x0}, + {0x9007b, 0x0}, + {0x9007c, 0x0}, + {0x9007d, 0x0}, + {0x9007e, 0x0}, + {0x9007f, 0x0}, + {0x90080, 0x0}, + {0x90081, 0x0}, + {0x90082, 0x0}, + {0x90083, 0x0}, + {0x90084, 0x0}, + {0x90085, 0x0}, + {0x90086, 0x0}, + {0x90087, 0x0}, + {0x90088, 0x0}, + {0x90089, 0x0}, + {0x9008a, 0x0}, + {0x9008b, 0x0}, + {0x9008c, 0x0}, + {0x9008d, 0x0}, + {0x9008e, 0x0}, + {0x9008f, 0x0}, + {0x90090, 0x0}, + {0x90091, 0x0}, + {0x90092, 0x0}, + {0x90093, 0x0}, + {0x90094, 0x0}, + {0x90095, 0x0}, + {0x90096, 0x0}, + {0x90097, 0x0}, + {0x90098, 0x0}, + {0x90099, 0x0}, + {0x9009a, 0x0}, + {0x9009b, 0x0}, + {0x9009c, 0x0}, + {0x9009d, 0x0}, + {0x9009e, 0x0}, + {0x9009f, 0x0}, + {0x900a0, 0x0}, + {0x900a1, 0x0}, + {0x900a2, 0x0}, + {0x900a3, 0x0}, + {0x900a4, 0x0}, + {0x900a5, 0x0}, + {0x900a6, 0x0}, + {0x900a7, 0x0}, + {0x900a8, 0x0}, + {0x900a9, 0x0}, + {0x40000, 0x0}, + {0x40020, 0x0}, + {0x40040, 0x0}, + {0x40060, 0x0}, + {0x40001, 0x0}, + {0x40021, 0x0}, + {0x40041, 0x0}, + {0x40061, 0x0}, + {0x40002, 0x0}, + {0x40022, 0x0}, + {0x40042, 0x0}, + {0x40062, 0x0}, + {0x40003, 0x0}, + {0x40023, 0x0}, + {0x40043, 0x0}, + {0x40063, 0x0}, + {0x40004, 0x0}, + {0x40024, 0x0}, + {0x40044, 0x0}, + {0x40064, 0x0}, + {0x40005, 0x0}, + {0x40025, 0x0}, + {0x40045, 0x0}, + {0x40065, 0x0}, + {0x40006, 0x0}, + {0x40026, 0x0}, + {0x40046, 0x0}, + {0x40066, 0x0}, + {0x40007, 0x0}, + {0x40027, 0x0}, + {0x40047, 0x0}, + {0x40067, 0x0}, + {0x40008, 0x0}, + {0x40028, 0x0}, + {0x40048, 0x0}, + {0x40068, 0x0}, + {0x40009, 0x0}, + {0x40029, 0x0}, + {0x40049, 0x0}, + {0x40069, 0x0}, + {0x4000a, 0x0}, + {0x4002a, 0x0}, + {0x4004a, 0x0}, + {0x4006a, 0x0}, + {0x4000b, 0x0}, + {0x4002b, 0x0}, + {0x4004b, 0x0}, + {0x4006b, 0x0}, + {0x4000c, 0x0}, + {0x4002c, 0x0}, + {0x4004c, 0x0}, + {0x4006c, 0x0}, + {0x4000d, 0x0}, + {0x4002d, 0x0}, + {0x4004d, 0x0}, + {0x4006d, 0x0}, + {0x4000e, 0x0}, + {0x4002e, 0x0}, + {0x4004e, 0x0}, + {0x4006e, 0x0}, + {0x4000f, 0x0}, + {0x4002f, 0x0}, + {0x4004f, 0x0}, + {0x4006f, 0x0}, + {0x40010, 0x0}, + {0x40030, 0x0}, + {0x40050, 0x0}, + {0x40070, 0x0}, + {0x40011, 0x0}, + {0x40031, 0x0}, + {0x40051, 0x0}, + {0x40071, 0x0}, + {0x40012, 0x0}, + {0x40032, 0x0}, + {0x40052, 0x0}, + {0x40072, 0x0}, + {0x40013, 0x0}, + {0x40033, 0x0}, + {0x40053, 0x0}, + {0x40073, 0x0}, + {0x40014, 0x0}, + {0x40034, 0x0}, + {0x40054, 0x0}, + {0x40074, 0x0}, + {0x40015, 0x0}, + {0x40035, 0x0}, + {0x40055, 0x0}, + {0x40075, 0x0}, + {0x40016, 0x0}, + {0x40036, 0x0}, + {0x40056, 0x0}, + {0x40076, 0x0}, + {0x40017, 0x0}, + {0x40037, 0x0}, + {0x40057, 0x0}, + {0x40077, 0x0}, + {0x40018, 0x0}, + {0x40038, 0x0}, + {0x40058, 0x0}, + {0x40078, 0x0}, + {0x40019, 0x0}, + {0x40039, 0x0}, + {0x40059, 0x0}, + {0x40079, 0x0}, + {0x4001a, 0x0}, + {0x4003a, 0x0}, + {0x4005a, 0x0}, + {0x4007a, 0x0}, + {0x900aa, 0x0}, + {0x900ab, 0x0}, + {0x900ac, 0x0}, + {0x900ad, 0x0}, + {0x900ae, 0x0}, + {0x900af, 0x0}, + {0x900b0, 0x0}, + {0x900b1, 0x0}, + {0x900b2, 0x0}, + {0x900b3, 0x0}, + {0x900b4, 0x0}, + {0x900b5, 0x0}, + {0x900b6, 0x0}, + {0x900b7, 0x0}, + {0x900b8, 0x0}, + {0x900b9, 0x0}, + {0x900ba, 0x0}, + {0x900bb, 0x0}, + {0x900bc, 0x0}, + {0x900bd, 0x0}, + {0x900be, 0x0}, + {0x900bf, 0x0}, + {0x900c0, 0x0}, + {0x900c1, 0x0}, + {0x900c2, 0x0}, + {0x900c3, 0x0}, + {0x900c4, 0x0}, + {0x900c5, 0x0}, + {0x900c6, 0x0}, + {0x900c7, 0x0}, + {0x900c8, 0x0}, + {0x900c9, 0x0}, + {0x900ca, 0x0}, + {0x900cb, 0x0}, + {0x900cc, 0x0}, + {0x900cd, 0x0}, + {0x900ce, 0x0}, + {0x900cf, 0x0}, + {0x900d0, 0x0}, + {0x900d1, 0x0}, + {0x900d2, 0x0}, + {0x900d3, 0x0}, + {0x900d4, 0x0}, + {0x900d5, 0x0}, + {0x900d6, 0x0}, + {0x900d7, 0x0}, + {0x900d8, 0x0}, + {0x900d9, 0x0}, + {0x900da, 0x0}, + {0x900db, 0x0}, + {0x900dc, 0x0}, + {0x900dd, 0x0}, + {0x900de, 0x0}, + {0x900df, 0x0}, + {0x900e0, 0x0}, + {0x900e1, 0x0}, + {0x900e2, 0x0}, + {0x900e3, 0x0}, + {0x900e4, 0x0}, + {0x900e5, 0x0}, + {0x900e6, 0x0}, + {0x900e7, 0x0}, + {0x900e8, 0x0}, + {0x900e9, 0x0}, + {0x900ea, 0x0}, + {0x900eb, 0x0}, + {0x900ec, 0x0}, + {0x900ed, 0x0}, + {0x900ee, 0x0}, + {0x900ef, 0x0}, + {0x900f0, 0x0}, + {0x900f1, 0x0}, + {0x900f2, 0x0}, + {0x900f3, 0x0}, + {0x900f4, 0x0}, + {0x900f5, 0x0}, + {0x900f6, 0x0}, + {0x900f7, 0x0}, + {0x900f8, 0x0}, + {0x900f9, 0x0}, + {0x900fa, 0x0}, + {0x900fb, 0x0}, + {0x900fc, 0x0}, + {0x900fd, 0x0}, + {0x900fe, 0x0}, + {0x900ff, 0x0}, + {0x90100, 0x0}, + {0x90101, 0x0}, + {0x90102, 0x0}, + {0x90103, 0x0}, + {0x90104, 0x0}, + {0x90105, 0x0}, + {0x90106, 0x0}, + {0x90107, 0x0}, + {0x90108, 0x0}, + {0x90109, 0x0}, + {0x9010a, 0x0}, + {0x9010b, 0x0}, + {0x9010c, 0x0}, + {0x9010d, 0x0}, + {0x9010e, 0x0}, + {0x9010f, 0x0}, + {0x90110, 0x0}, + {0x90111, 0x0}, + {0x90112, 0x0}, + {0x90113, 0x0}, + {0x90114, 0x0}, + {0x90115, 0x0}, + {0x90116, 0x0}, + {0x90117, 0x0}, + {0x90118, 0x0}, + {0x90119, 0x0}, + {0x9011a, 0x0}, + {0x9011b, 0x0}, + {0x9011c, 0x0}, + {0x9011d, 0x0}, + {0x9011e, 0x0}, + {0x9011f, 0x0}, + {0x90120, 0x0}, + {0x90121, 0x0}, + {0x90122, 0x0}, + {0x90123, 0x0}, + {0x90124, 0x0}, + {0x90125, 0x0}, + {0x90126, 0x0}, + {0x90127, 0x0}, + {0x90128, 0x0}, + {0x90129, 0x0}, + {0x9012a, 0x0}, + {0x9012b, 0x0}, + {0x9012c, 0x0}, + {0x9012d, 0x0}, + {0x9012e, 0x0}, + {0x9012f, 0x0}, + {0x90130, 0x0}, + {0x90131, 0x0}, + {0x90132, 0x0}, + {0x90133, 0x0}, + {0x90134, 0x0}, + {0x90135, 0x0}, + {0x90136, 0x0}, + {0x90137, 0x0}, + {0x90138, 0x0}, + {0x90139, 0x0}, + {0x9013a, 0x0}, + {0x9013b, 0x0}, + {0x9013c, 0x0}, + {0x9013d, 0x0}, + {0x9013e, 0x0}, + {0x9013f, 0x0}, + {0x90140, 0x0}, + {0x90141, 0x0}, + {0x90142, 0x0}, + {0x90143, 0x0}, + {0x90144, 0x0}, + {0x90145, 0x0}, + {0x90146, 0x0}, + {0x90147, 0x0}, + {0x90148, 0x0}, + {0x90149, 0x0}, + {0x9014a, 0x0}, + {0x9014b, 0x0}, + {0x9014c, 0x0}, + {0x9014d, 0x0}, + {0x9014e, 0x0}, + {0x9014f, 0x0}, + {0x90150, 0x0}, + {0x90151, 0x0}, + {0x90152, 0x0}, + {0x90153, 0x0}, + {0x90154, 0x0}, + {0x90155, 0x0}, + {0x90156, 0x0}, + {0x90157, 0x0}, + {0x90158, 0x0}, + {0x90159, 0x0}, + {0x9015a, 0x0}, + {0x9015b, 0x0}, + {0x9015c, 0x0}, + {0x9015d, 0x0}, + {0x9015e, 0x0}, + {0x9015f, 0x0}, + {0x90160, 0x0}, + {0x90161, 0x0}, + {0x90162, 0x0}, + {0x90163, 0x0}, + {0x90164, 0x0}, + {0x90165, 0x0}, + {0x90166, 0x0}, + {0x90167, 0x0}, + {0x90168, 0x0}, + {0x90169, 0x0}, + {0x9016a, 0x0}, + {0x9016b, 0x0}, + {0x9016c, 0x0}, + {0x9016d, 0x0}, + {0x9016e, 0x0}, + {0x9016f, 0x0}, + {0x90170, 0x0}, + {0x90171, 0x0}, + {0x90172, 0x0}, + {0x90173, 0x0}, + {0x90174, 0x0}, + {0x90175, 0x0}, + {0x90176, 0x0}, + {0x90177, 0x0}, + {0x90178, 0x0}, + {0x90179, 0x0}, + {0x9017a, 0x0}, + {0x9017b, 0x0}, + {0x9017c, 0x0}, + {0x9017d, 0x0}, + {0x9017e, 0x0}, + {0x9017f, 0x0}, + {0x90180, 0x0}, + {0x90181, 0x0}, + {0x90182, 0x0}, + {0x90183, 0x0}, + {0x90184, 0x0}, + {0x90006, 0x0}, + {0x90007, 0x0}, + {0x90008, 0x0}, + {0x90009, 0x0}, + {0x9000a, 0x0}, + {0x9000b, 0x0}, + {0xd00e7, 0x0}, + {0x90017, 0x0}, + {0x9001f, 0x0}, + {0x90026, 0x0}, + {0x400d0, 0x0}, + {0x400d1, 0x0}, + {0x400d2, 0x0}, + {0x400d3, 0x0}, + {0x400d4, 0x0}, + {0x400d5, 0x0}, + {0x400d6, 0x0}, + {0x400d7, 0x0}, + {0x200be, 0x0}, + {0x2000b, 0x0}, + {0x2000c, 0x0}, + {0x2000d, 0x0}, + {0x2000e, 0x0}, + {0x12000b, 0x0}, + {0x12000c, 0x0}, + {0x12000d, 0x0}, + {0x12000e, 0x0}, + {0x22000b, 0x0}, + {0x22000c, 0x0}, + {0x22000d, 0x0}, + {0x22000e, 0x0}, + {0x9000c, 0x0}, + {0x9000d, 0x0}, + {0x9000e, 0x0}, + {0x9000f, 0x0}, + {0x90010, 0x0}, + {0x90011, 0x0}, + {0x90012, 0x0}, + {0x90013, 0x0}, + {0x20010, 0x0}, + {0x20011, 0x0}, + {0x120010, 0x0}, + {0x120011, 0x0}, + {0x40080, 0x0}, + {0x40081, 0x0}, + {0x40082, 0x0}, + {0x40083, 0x0}, + {0x40084, 0x0}, + {0x40085, 0x0}, + {0x140080, 0x0}, + {0x140081, 0x0}, + {0x140082, 0x0}, + {0x140083, 0x0}, + {0x140084, 0x0}, + {0x140085, 0x0}, + {0x240080, 0x0}, + {0x240081, 0x0}, + {0x240082, 0x0}, + {0x240083, 0x0}, + {0x240084, 0x0}, + {0x240085, 0x0}, + {0x400fd, 0x0}, + {0x400f1, 0x0}, + {0x10011, 0x0}, + {0x10012, 0x0}, + {0x10013, 0x0}, + {0x10018, 0x0}, + {0x10002, 0x0}, + {0x100b2, 0x0}, + {0x101b4, 0x0}, + {0x102b4, 0x0}, + {0x103b4, 0x0}, + {0x104b4, 0x0}, + {0x105b4, 0x0}, + {0x106b4, 0x0}, + {0x107b4, 0x0}, + {0x108b4, 0x0}, + {0x11011, 0x0}, + {0x11012, 0x0}, + {0x11013, 0x0}, + {0x11018, 0x0}, + {0x11002, 0x0}, + {0x110b2, 0x0}, + {0x111b4, 0x0}, + {0x112b4, 0x0}, + {0x113b4, 0x0}, + {0x114b4, 0x0}, + {0x115b4, 0x0}, + {0x116b4, 0x0}, + {0x117b4, 0x0}, + {0x118b4, 0x0}, + {0x20089, 0x0}, + {0xc0080, 0x0}, + {0x200cb, 0x0}, + {0x10068, 0x0}, + {0x10069, 0x0}, + {0x10168, 0x0}, + {0x10169, 0x0}, + {0x10268, 0x0}, + {0x10269, 0x0}, + {0x10368, 0x0}, + {0x10369, 0x0}, + {0x10468, 0x0}, + {0x10469, 0x0}, + {0x10568, 0x0}, + {0x10569, 0x0}, + {0x10668, 0x0}, + {0x10669, 0x0}, + {0x10768, 0x0}, + {0x10769, 0x0}, + {0x10868, 0x0}, + {0x10869, 0x0}, + {0x100aa, 0x0}, + {0x10062, 0x0}, + {0x10001, 0x0}, + {0x100a0, 0x0}, + {0x100a1, 0x0}, + {0x100a2, 0x0}, + {0x100a3, 0x0}, + {0x100a4, 0x0}, + {0x100a5, 0x0}, + {0x100a6, 0x0}, + {0x100a7, 0x0}, + {0x11068, 0x0}, + {0x11069, 0x0}, + {0x11168, 0x0}, + {0x11169, 0x0}, + {0x11268, 0x0}, + {0x11269, 0x0}, + {0x11368, 0x0}, + {0x11369, 0x0}, + {0x11468, 0x0}, + {0x11469, 0x0}, + {0x11568, 0x0}, + {0x11569, 0x0}, + {0x11668, 0x0}, + {0x11669, 0x0}, + {0x11768, 0x0}, + {0x11769, 0x0}, + {0x11868, 0x0}, + {0x11869, 0x0}, + {0x110aa, 0x0}, + {0x11062, 0x0}, + {0x11001, 0x0}, + {0x110a0, 0x0}, + {0x110a1, 0x0}, + {0x110a2, 0x0}, + {0x110a3, 0x0}, + {0x110a4, 0x0}, + {0x110a5, 0x0}, + {0x110a6, 0x0}, + {0x110a7, 0x0}, + {0x80, 0x0}, + {0x1080, 0x0}, + {0x2080, 0x0}, + {0x10020, 0x0}, + {0x10080, 0x0}, + {0x10081, 0x0}, + {0x100d0, 0x0}, + {0x100d1, 0x0}, + {0x1008c, 0x0}, + {0x1008d, 0x0}, + {0x10180, 0x0}, + {0x10181, 0x0}, + {0x101d0, 0x0}, + {0x101d1, 0x0}, + {0x1018c, 0x0}, + {0x1018d, 0x0}, + {0x100c0, 0x0}, + {0x100c1, 0x0}, + {0x101c0, 0x0}, + {0x101c1, 0x0}, + {0x102c0, 0x0}, + {0x102c1, 0x0}, + {0x103c0, 0x0}, + {0x103c1, 0x0}, + {0x104c0, 0x0}, + {0x104c1, 0x0}, + {0x105c0, 0x0}, + {0x105c1, 0x0}, + {0x106c0, 0x0}, + {0x106c1, 0x0}, + {0x107c0, 0x0}, + {0x107c1, 0x0}, + {0x108c0, 0x0}, + {0x108c1, 0x0}, + {0x100ae, 0x0}, + {0x100af, 0x0}, + {0x11020, 0x0}, + {0x11080, 0x0}, + {0x11081, 0x0}, + {0x110d0, 0x0}, + {0x110d1, 0x0}, + {0x1108c, 0x0}, + {0x1108d, 0x0}, + {0x11180, 0x0}, + {0x11181, 0x0}, + {0x111d0, 0x0}, + {0x111d1, 0x0}, + {0x1118c, 0x0}, + {0x1118d, 0x0}, + {0x110c0, 0x0}, + {0x110c1, 0x0}, + {0x111c0, 0x0}, + {0x111c1, 0x0}, + {0x112c0, 0x0}, + {0x112c1, 0x0}, + {0x113c0, 0x0}, + {0x113c1, 0x0}, + {0x114c0, 0x0}, + {0x114c1, 0x0}, + {0x115c0, 0x0}, + {0x115c1, 0x0}, + {0x116c0, 0x0}, + {0x116c1, 0x0}, + {0x117c0, 0x0}, + {0x117c1, 0x0}, + {0x118c0, 0x0}, + {0x118c1, 0x0}, + {0x110ae, 0x0}, + {0x110af, 0x0}, + {0x90201, 0x0}, + {0x90202, 0x0}, + {0x90203, 0x0}, + {0x90205, 0x0}, + {0x90206, 0x0}, + {0x90207, 0x0}, + {0x90208, 0x0}, + {0x20020, 0x0}, + {0x100080, 0x0}, + {0x101080, 0x0}, + {0x102080, 0x0}, + {0x110020, 0x0}, + {0x110080, 0x0}, + {0x110081, 0x0}, + {0x1100d0, 0x0}, + {0x1100d1, 0x0}, + {0x11008c, 0x0}, + {0x11008d, 0x0}, + {0x110180, 0x0}, + {0x110181, 0x0}, + {0x1101d0, 0x0}, + {0x1101d1, 0x0}, + {0x11018c, 0x0}, + {0x11018d, 0x0}, + {0x1100c0, 0x0}, + {0x1100c1, 0x0}, + {0x1101c0, 0x0}, + {0x1101c1, 0x0}, + {0x1102c0, 0x0}, + {0x1102c1, 0x0}, + {0x1103c0, 0x0}, + {0x1103c1, 0x0}, + {0x1104c0, 0x0}, + {0x1104c1, 0x0}, + {0x1105c0, 0x0}, + {0x1105c1, 0x0}, + {0x1106c0, 0x0}, + {0x1106c1, 0x0}, + {0x1107c0, 0x0}, + {0x1107c1, 0x0}, + {0x1108c0, 0x0}, + {0x1108c1, 0x0}, + {0x1100ae, 0x0}, + {0x1100af, 0x0}, + {0x111020, 0x0}, + {0x111080, 0x0}, + {0x111081, 0x0}, + {0x1110d0, 0x0}, + {0x1110d1, 0x0}, + {0x11108c, 0x0}, + {0x11108d, 0x0}, + {0x111180, 0x0}, + {0x111181, 0x0}, + {0x1111d0, 0x0}, + {0x1111d1, 0x0}, + {0x11118c, 0x0}, + {0x11118d, 0x0}, + {0x1110c0, 0x0}, + {0x1110c1, 0x0}, + {0x1111c0, 0x0}, + {0x1111c1, 0x0}, + {0x1112c0, 0x0}, + {0x1112c1, 0x0}, + {0x1113c0, 0x0}, + {0x1113c1, 0x0}, + {0x1114c0, 0x0}, + {0x1114c1, 0x0}, + {0x1115c0, 0x0}, + {0x1115c1, 0x0}, + {0x1116c0, 0x0}, + {0x1116c1, 0x0}, + {0x1117c0, 0x0}, + {0x1117c1, 0x0}, + {0x1118c0, 0x0}, + {0x1118c1, 0x0}, + {0x1110ae, 0x0}, + {0x1110af, 0x0}, + {0x190201, 0x0}, + {0x190202, 0x0}, + {0x190203, 0x0}, + {0x190205, 0x0}, + {0x190206, 0x0}, + {0x190207, 0x0}, + {0x190208, 0x0}, + {0x120020, 0x0}, + {0x200080, 0x0}, + {0x201080, 0x0}, + {0x202080, 0x0}, + {0x210020, 0x0}, + {0x210080, 0x0}, + {0x210081, 0x0}, + {0x2100d0, 0x0}, + {0x2100d1, 0x0}, + {0x21008c, 0x0}, + {0x21008d, 0x0}, + {0x210180, 0x0}, + {0x210181, 0x0}, + {0x2101d0, 0x0}, + {0x2101d1, 0x0}, + {0x21018c, 0x0}, + {0x21018d, 0x0}, + {0x2100c0, 0x0}, + {0x2100c1, 0x0}, + {0x2101c0, 0x0}, + {0x2101c1, 0x0}, + {0x2102c0, 0x0}, + {0x2102c1, 0x0}, + {0x2103c0, 0x0}, + {0x2103c1, 0x0}, + {0x2104c0, 0x0}, + {0x2104c1, 0x0}, + {0x2105c0, 0x0}, + {0x2105c1, 0x0}, + {0x2106c0, 0x0}, + {0x2106c1, 0x0}, + {0x2107c0, 0x0}, + {0x2107c1, 0x0}, + {0x2108c0, 0x0}, + {0x2108c1, 0x0}, + {0x2100ae, 0x0}, + {0x2100af, 0x0}, + {0x211020, 0x0}, + {0x211080, 0x0}, + {0x211081, 0x0}, + {0x2110d0, 0x0}, + {0x2110d1, 0x0}, + {0x21108c, 0x0}, + {0x21108d, 0x0}, + {0x211180, 0x0}, + {0x211181, 0x0}, + {0x2111d0, 0x0}, + {0x2111d1, 0x0}, + {0x21118c, 0x0}, + {0x21118d, 0x0}, + {0x2110c0, 0x0}, + {0x2110c1, 0x0}, + {0x2111c0, 0x0}, + {0x2111c1, 0x0}, + {0x2112c0, 0x0}, + {0x2112c1, 0x0}, + {0x2113c0, 0x0}, + {0x2113c1, 0x0}, + {0x2114c0, 0x0}, + {0x2114c1, 0x0}, + {0x2115c0, 0x0}, + {0x2115c1, 0x0}, + {0x2116c0, 0x0}, + {0x2116c1, 0x0}, + {0x2117c0, 0x0}, + {0x2117c1, 0x0}, + {0x2118c0, 0x0}, + {0x2118c1, 0x0}, + {0x2110ae, 0x0}, + {0x2110af, 0x0}, + {0x290201, 0x0}, + {0x290202, 0x0}, + {0x290203, 0x0}, + {0x290205, 0x0}, + {0x290206, 0x0}, + {0x290207, 0x0}, + {0x290208, 0x0}, + {0x220020, 0x0}, + {0x20077, 0x0}, + {0x20072, 0x0}, + {0x20073, 0x0}, + {0x400c0, 0x0}, + {0x10040, 0x0}, + {0x10140, 0x0}, + {0x10240, 0x0}, + {0x10340, 0x0}, + {0x10440, 0x0}, + {0x10540, 0x0}, + {0x10640, 0x0}, + {0x10740, 0x0}, + {0x10840, 0x0}, + {0x11040, 0x0}, + {0x11140, 0x0}, + {0x11240, 0x0}, + {0x11340, 0x0}, + {0x11440, 0x0}, + {0x11540, 0x0}, + {0x11640, 0x0}, + {0x11740, 0x0}, + {0x11840, 0x0}, +}; + +/* P0 message block parameter for training firmware */ +static struct dram_cfg_param ddr_fsp0_cfg[] = { + {0xd0000, 0x0}, + {0x54003, 0x74a}, + {0x54004, 0x4}, + {0x54006, 0x15}, + {0x54008, 0x131f}, + {0x54009, 0xc8}, + {0x5400b, 0x4}, + {0x5400d, 0x100}, + {0x5400f, 0x100}, + {0x54012, 0x110}, + {0x54019, 0x1bb4}, + {0x5401a, 0x32}, + {0x5401b, 0x1146}, + {0x5401c, 0x1108}, + {0x5401e, 0x4}, + {0x5401f, 0x1bb4}, + {0x54020, 0x32}, + {0x54021, 0x1146}, + {0x54022, 0x1108}, + {0x54024, 0x4}, + {0x54032, 0xb400}, + {0x54033, 0x321b}, + {0x54034, 0x4600}, + {0x54035, 0x811}, + {0x54036, 0x11}, + {0x54037, 0x400}, + {0x54038, 0xb400}, + {0x54039, 0x321b}, + {0x5403a, 0x4600}, + {0x5403b, 0x811}, + {0x5403c, 0x11}, + {0x5403d, 0x400}, + {0xd0000, 0x1} +}; + +/* P1 message block parameter for training firmware */ +static struct dram_cfg_param ddr_fsp1_cfg[] = { + {0xd0000, 0x0}, + {0x54002, 0x1}, + {0x54003, 0x3a4}, + {0x54004, 0x4}, + {0x54006, 0x15}, + {0x54008, 0x121f}, + {0x54009, 0xc8}, + {0x5400b, 0x4}, + {0x5400d, 0x100}, + {0x5400f, 0x100}, + {0x54012, 0x110}, + {0x54019, 0x994}, + {0x5401a, 0x32}, + {0x5401b, 0x1146}, + {0x5401c, 0x1108}, + {0x5401e, 0x4}, + {0x5401f, 0x994}, + {0x54020, 0x32}, + {0x54021, 0x1146}, + {0x54022, 0x1108}, + {0x54024, 0x4}, + {0x54032, 0x9400}, + {0x54033, 0x3209}, + {0x54034, 0x4600}, + {0x54035, 0x811}, + {0x54036, 0x11}, + {0x54037, 0x400}, + {0x54038, 0x9400}, + {0x54039, 0x3209}, + {0x5403a, 0x4600}, + {0x5403b, 0x811}, + {0x5403c, 0x11}, + {0x5403d, 0x400}, + {0xd0000, 0x1} +}; + +/* P2 message block parameter for training firmware */ +static struct dram_cfg_param ddr_fsp2_cfg[] = { + {0xd0000, 0x0}, + {0x54002, 0x102}, + {0x54003, 0x270}, + {0x54004, 0x4}, + {0x54006, 0x15}, + {0x54008, 0x121f}, + {0x54009, 0xc8}, + {0x5400b, 0x4}, + {0x5400d, 0x100}, + {0x5400f, 0x100}, + {0x54012, 0x110}, + {0x54019, 0x994}, + {0x5401a, 0x32}, + {0x5401b, 0x1146}, + {0x5401c, 0x1100}, + {0x5401e, 0x4}, + {0x5401f, 0x994}, + {0x54020, 0x32}, + {0x54021, 0x1146}, + {0x54022, 0x1100}, + {0x54024, 0x4}, + {0x54032, 0x9400}, + {0x54033, 0x3209}, + {0x54034, 0x4600}, + {0x54035, 0x11}, + {0x54036, 0x11}, + {0x54037, 0x400}, + {0x54038, 0x9400}, + {0x54039, 0x3209}, + {0x5403a, 0x4600}, + {0x5403b, 0x11}, + {0x5403c, 0x11}, + {0x5403d, 0x400}, + {0xd0000, 0x1} +}; + +/* P0 2D message block parameter for training firmware */ +static struct dram_cfg_param ddr_fsp0_2d_cfg[] = { + {0xd0000, 0x0}, + {0x54003, 0x74a}, + {0x54004, 0x4}, + {0x54006, 0x15}, + {0x54008, 0x61}, + {0x54009, 0xc8}, + {0x5400b, 0x4}, + {0x5400d, 0x100}, + {0x5400f, 0x100}, + {0x54010, 0x2080}, + {0x54012, 0x110}, + {0x54019, 0x1bb4}, + {0x5401a, 0x32}, + {0x5401b, 0x1146}, + {0x5401c, 0x1108}, + {0x5401e, 0x4}, + {0x5401f, 0x1bb4}, + {0x54020, 0x32}, + {0x54021, 0x1146}, + {0x54022, 0x1108}, + {0x54024, 0x4}, + {0x54032, 0xb400}, + {0x54033, 0x321b}, + {0x54034, 0x4600}, + {0x54035, 0x811}, + {0x54036, 0x11}, + {0x54037, 0x400}, + {0x54038, 0xb400}, + {0x54039, 0x321b}, + {0x5403a, 0x4600}, + {0x5403b, 0x811}, + {0x5403c, 0x11}, + {0x5403d, 0x400}, + {0xd0000, 0x1} +}; + +/* DRAM PHY init engine image */ +static struct dram_cfg_param ddr_phy_pie[] = { + {0xd0000, 0x0}, + {0x90000, 0x10}, + {0x90001, 0x400}, + {0x90002, 0x10e}, + {0x90003, 0x0}, + {0x90004, 0x0}, + {0x90005, 0x8}, + {0x90029, 0xb}, + {0x9002a, 0x480}, + {0x9002b, 0x109}, + {0x9002c, 0x8}, + {0x9002d, 0x448}, + {0x9002e, 0x139}, + {0x9002f, 0x8}, + {0x90030, 0x478}, + {0x90031, 0x109}, + {0x90032, 0x0}, + {0x90033, 0xe8}, + {0x90034, 0x109}, + {0x90035, 0x2}, + {0x90036, 0x10}, + {0x90037, 0x139}, + {0x90038, 0xb}, + {0x90039, 0x7c0}, + {0x9003a, 0x139}, + {0x9003b, 0x44}, + {0x9003c, 0x633}, + {0x9003d, 0x159}, + {0x9003e, 0x14f}, + {0x9003f, 0x630}, + {0x90040, 0x159}, + {0x90041, 0x47}, + {0x90042, 0x633}, + {0x90043, 0x149}, + {0x90044, 0x4f}, + {0x90045, 0x633}, + {0x90046, 0x179}, + {0x90047, 0x8}, + {0x90048, 0xe0}, + {0x90049, 0x109}, + {0x9004a, 0x0}, + {0x9004b, 0x7c8}, + {0x9004c, 0x109}, + {0x9004d, 0x0}, + {0x9004e, 0x1}, + {0x9004f, 0x8}, + {0x90050, 0x30}, + {0x90051, 0x65a}, + {0x90052, 0x9}, + {0x90053, 0x0}, + {0x90054, 0x45a}, + {0x90055, 0x9}, + {0x90056, 0x0}, + {0x90057, 0x448}, + {0x90058, 0x109}, + {0x90059, 0x40}, + {0x9005a, 0x633}, + {0x9005b, 0x179}, + {0x9005c, 0x1}, + {0x9005d, 0x618}, + {0x9005e, 0x109}, + {0x9005f, 0x40c0}, + {0x90060, 0x633}, + {0x90061, 0x149}, + {0x90062, 0x8}, + {0x90063, 0x4}, + {0x90064, 0x48}, + {0x90065, 0x4040}, + {0x90066, 0x633}, + {0x90067, 0x149}, + {0x90068, 0x0}, + {0x90069, 0x4}, + {0x9006a, 0x48}, + {0x9006b, 0x40}, + {0x9006c, 0x633}, + {0x9006d, 0x149}, + {0x9006e, 0x0}, + {0x9006f, 0x658}, + {0x90070, 0x109}, + {0x90071, 0x10}, + {0x90072, 0x4}, + {0x90073, 0x18}, + {0x90074, 0x0}, + {0x90075, 0x4}, + {0x90076, 0x78}, + {0x90077, 0x549}, + {0x90078, 0x633}, + {0x90079, 0x159}, + {0x9007a, 0xd49}, + {0x9007b, 0x633}, + {0x9007c, 0x159}, + {0x9007d, 0x94a}, + {0x9007e, 0x633}, + {0x9007f, 0x159}, + {0x90080, 0x441}, + {0x90081, 0x633}, + {0x90082, 0x149}, + {0x90083, 0x42}, + {0x90084, 0x633}, + {0x90085, 0x149}, + {0x90086, 0x1}, + {0x90087, 0x633}, + {0x90088, 0x149}, + {0x90089, 0x0}, + {0x9008a, 0xe0}, + {0x9008b, 0x109}, + {0x9008c, 0xa}, + {0x9008d, 0x10}, + {0x9008e, 0x109}, + {0x9008f, 0x9}, + {0x90090, 0x3c0}, + {0x90091, 0x149}, + {0x90092, 0x9}, + {0x90093, 0x3c0}, + {0x90094, 0x159}, + {0x90095, 0x18}, + {0x90096, 0x10}, + {0x90097, 0x109}, + {0x90098, 0x0}, + {0x90099, 0x3c0}, + {0x9009a, 0x109}, + {0x9009b, 0x18}, + {0x9009c, 0x4}, + {0x9009d, 0x48}, + {0x9009e, 0x18}, + {0x9009f, 0x4}, + {0x900a0, 0x58}, + {0x900a1, 0xb}, + {0x900a2, 0x10}, + {0x900a3, 0x109}, + {0x900a4, 0x1}, + {0x900a5, 0x10}, + {0x900a6, 0x109}, + {0x900a7, 0x5}, + {0x900a8, 0x7c0}, + {0x900a9, 0x109}, + {0x40000, 0x811}, + {0x40020, 0x880}, + {0x40040, 0x0}, + {0x40060, 0x0}, + {0x40001, 0x4008}, + {0x40021, 0x83}, + {0x40041, 0x4f}, + {0x40061, 0x0}, + {0x40002, 0x4040}, + {0x40022, 0x83}, + {0x40042, 0x51}, + {0x40062, 0x0}, + {0x40003, 0x811}, + {0x40023, 0x880}, + {0x40043, 0x0}, + {0x40063, 0x0}, + {0x40004, 0x720}, + {0x40024, 0xf}, + {0x40044, 0x1740}, + {0x40064, 0x0}, + {0x40005, 0x16}, + {0x40025, 0x83}, + {0x40045, 0x4b}, + {0x40065, 0x0}, + {0x40006, 0x716}, + {0x40026, 0xf}, + {0x40046, 0x2001}, + {0x40066, 0x0}, + {0x40007, 0x716}, + {0x40027, 0xf}, + {0x40047, 0x2800}, + {0x40067, 0x0}, + {0x40008, 0x716}, + {0x40028, 0xf}, + {0x40048, 0xf00}, + {0x40068, 0x0}, + {0x40009, 0x720}, + {0x40029, 0xf}, + {0x40049, 0x1400}, + {0x40069, 0x0}, + {0x4000a, 0xe08}, + {0x4002a, 0xc15}, + {0x4004a, 0x0}, + {0x4006a, 0x0}, + {0x4000b, 0x625}, + {0x4002b, 0x15}, + {0x4004b, 0x0}, + {0x4006b, 0x0}, + {0x4000c, 0x4028}, + {0x4002c, 0x80}, + {0x4004c, 0x0}, + {0x4006c, 0x0}, + {0x4000d, 0xe08}, + {0x4002d, 0xc1a}, + {0x4004d, 0x0}, + {0x4006d, 0x0}, + {0x4000e, 0x625}, + {0x4002e, 0x1a}, + {0x4004e, 0x0}, + {0x4006e, 0x0}, + {0x4000f, 0x4040}, + {0x4002f, 0x80}, + {0x4004f, 0x0}, + {0x4006f, 0x0}, + {0x40010, 0x2604}, + {0x40030, 0x15}, + {0x40050, 0x0}, + {0x40070, 0x0}, + {0x40011, 0x708}, + {0x40031, 0x5}, + {0x40051, 0x0}, + {0x40071, 0x2002}, + {0x40012, 0x8}, + {0x40032, 0x80}, + {0x40052, 0x0}, + {0x40072, 0x0}, + {0x40013, 0x2604}, + {0x40033, 0x1a}, + {0x40053, 0x0}, + {0x40073, 0x0}, + {0x40014, 0x708}, + {0x40034, 0xa}, + {0x40054, 0x0}, + {0x40074, 0x2002}, + {0x40015, 0x4040}, + {0x40035, 0x80}, + {0x40055, 0x0}, + {0x40075, 0x0}, + {0x40016, 0x60a}, + {0x40036, 0x15}, + {0x40056, 0x1200}, + {0x40076, 0x0}, + {0x40017, 0x61a}, + {0x40037, 0x15}, + {0x40057, 0x1300}, + {0x40077, 0x0}, + {0x40018, 0x60a}, + {0x40038, 0x1a}, + {0x40058, 0x1200}, + {0x40078, 0x0}, + {0x40019, 0x642}, + {0x40039, 0x1a}, + {0x40059, 0x1300}, + {0x40079, 0x0}, + {0x4001a, 0x4808}, + {0x4003a, 0x880}, + {0x4005a, 0x0}, + {0x4007a, 0x0}, + {0x900aa, 0x0}, + {0x900ab, 0x790}, + {0x900ac, 0x11a}, + {0x900ad, 0x8}, + {0x900ae, 0x7aa}, + {0x900af, 0x2a}, + {0x900b0, 0x10}, + {0x900b1, 0x7b2}, + {0x900b2, 0x2a}, + {0x900b3, 0x0}, + {0x900b4, 0x7c8}, + {0x900b5, 0x109}, + {0x900b6, 0x10}, + {0x900b7, 0x10}, + {0x900b8, 0x109}, + {0x900b9, 0x10}, + {0x900ba, 0x2a8}, + {0x900bb, 0x129}, + {0x900bc, 0x8}, + {0x900bd, 0x370}, + {0x900be, 0x129}, + {0x900bf, 0xa}, + {0x900c0, 0x3c8}, + {0x900c1, 0x1a9}, + {0x900c2, 0xc}, + {0x900c3, 0x408}, + {0x900c4, 0x199}, + {0x900c5, 0x14}, + {0x900c6, 0x790}, + {0x900c7, 0x11a}, + {0x900c8, 0x8}, + {0x900c9, 0x4}, + {0x900ca, 0x18}, + {0x900cb, 0xe}, + {0x900cc, 0x408}, + {0x900cd, 0x199}, + {0x900ce, 0x8}, + {0x900cf, 0x8568}, + {0x900d0, 0x108}, + {0x900d1, 0x18}, + {0x900d2, 0x790}, + {0x900d3, 0x16a}, + {0x900d4, 0x8}, + {0x900d5, 0x1d8}, + {0x900d6, 0x169}, + {0x900d7, 0x10}, + {0x900d8, 0x8558}, + {0x900d9, 0x168}, + {0x900da, 0x1ff8}, + {0x900db, 0x85a8}, + {0x900dc, 0x1e8}, + {0x900dd, 0x50}, + {0x900de, 0x798}, + {0x900df, 0x16a}, + {0x900e0, 0x60}, + {0x900e1, 0x7a0}, + {0x900e2, 0x16a}, + {0x900e3, 0x8}, + {0x900e4, 0x8310}, + {0x900e5, 0x168}, + {0x900e6, 0x8}, + {0x900e7, 0xa310}, + {0x900e8, 0x168}, + {0x900e9, 0xa}, + {0x900ea, 0x408}, + {0x900eb, 0x169}, + {0x900ec, 0x6e}, + {0x900ed, 0x0}, + {0x900ee, 0x68}, + {0x900ef, 0x0}, + {0x900f0, 0x408}, + {0x900f1, 0x169}, + {0x900f2, 0x0}, + {0x900f3, 0x8310}, + {0x900f4, 0x168}, + {0x900f5, 0x0}, + {0x900f6, 0xa310}, + {0x900f7, 0x168}, + {0x900f8, 0x1ff8}, + {0x900f9, 0x85a8}, + {0x900fa, 0x1e8}, + {0x900fb, 0x68}, + {0x900fc, 0x798}, + {0x900fd, 0x16a}, + {0x900fe, 0x78}, + {0x900ff, 0x7a0}, + {0x90100, 0x16a}, + {0x90101, 0x68}, + {0x90102, 0x790}, + {0x90103, 0x16a}, + {0x90104, 0x8}, + {0x90105, 0x8b10}, + {0x90106, 0x168}, + {0x90107, 0x8}, + {0x90108, 0xab10}, + {0x90109, 0x168}, + {0x9010a, 0xa}, + {0x9010b, 0x408}, + {0x9010c, 0x169}, + {0x9010d, 0x58}, + {0x9010e, 0x0}, + {0x9010f, 0x68}, + {0x90110, 0x0}, + {0x90111, 0x408}, + {0x90112, 0x169}, + {0x90113, 0x0}, + {0x90114, 0x8b10}, + {0x90115, 0x168}, + {0x90116, 0x1}, + {0x90117, 0xab10}, + {0x90118, 0x168}, + {0x90119, 0x0}, + {0x9011a, 0x1d8}, + {0x9011b, 0x169}, + {0x9011c, 0x80}, + {0x9011d, 0x790}, + {0x9011e, 0x16a}, + {0x9011f, 0x18}, + {0x90120, 0x7aa}, + {0x90121, 0x6a}, + {0x90122, 0xa}, + {0x90123, 0x0}, + {0x90124, 0x1e9}, + {0x90125, 0x8}, + {0x90126, 0x8080}, + {0x90127, 0x108}, + {0x90128, 0xf}, + {0x90129, 0x408}, + {0x9012a, 0x169}, + {0x9012b, 0xc}, + {0x9012c, 0x0}, + {0x9012d, 0x68}, + {0x9012e, 0x9}, + {0x9012f, 0x0}, + {0x90130, 0x1a9}, + {0x90131, 0x0}, + {0x90132, 0x408}, + {0x90133, 0x169}, + {0x90134, 0x0}, + {0x90135, 0x8080}, + {0x90136, 0x108}, + {0x90137, 0x8}, + {0x90138, 0x7aa}, + {0x90139, 0x6a}, + {0x9013a, 0x0}, + {0x9013b, 0x8568}, + {0x9013c, 0x108}, + {0x9013d, 0xb7}, + {0x9013e, 0x790}, + {0x9013f, 0x16a}, + {0x90140, 0x1f}, + {0x90141, 0x0}, + {0x90142, 0x68}, + {0x90143, 0x8}, + {0x90144, 0x8558}, + {0x90145, 0x168}, + {0x90146, 0xf}, + {0x90147, 0x408}, + {0x90148, 0x169}, + {0x90149, 0xd}, + {0x9014a, 0x0}, + {0x9014b, 0x68}, + {0x9014c, 0x0}, + {0x9014d, 0x408}, + {0x9014e, 0x169}, + {0x9014f, 0x0}, + {0x90150, 0x8558}, + {0x90151, 0x168}, + {0x90152, 0x8}, + {0x90153, 0x3c8}, + {0x90154, 0x1a9}, + {0x90155, 0x3}, + {0x90156, 0x370}, + {0x90157, 0x129}, + {0x90158, 0x20}, + {0x90159, 0x2aa}, + {0x9015a, 0x9}, + {0x9015b, 0x8}, + {0x9015c, 0xe8}, + {0x9015d, 0x109}, + {0x9015e, 0x0}, + {0x9015f, 0x8140}, + {0x90160, 0x10c}, + {0x90161, 0x10}, + {0x90162, 0x8138}, + {0x90163, 0x104}, + {0x90164, 0x8}, + {0x90165, 0x448}, + {0x90166, 0x109}, + {0x90167, 0xf}, + {0x90168, 0x7c0}, + {0x90169, 0x109}, + {0x9016a, 0x0}, + {0x9016b, 0xe8}, + {0x9016c, 0x109}, + {0x9016d, 0x47}, + {0x9016e, 0x630}, + {0x9016f, 0x109}, + {0x90170, 0x8}, + {0x90171, 0x618}, + {0x90172, 0x109}, + {0x90173, 0x8}, + {0x90174, 0xe0}, + {0x90175, 0x109}, + {0x90176, 0x0}, + {0x90177, 0x7c8}, + {0x90178, 0x109}, + {0x90179, 0x8}, + {0x9017a, 0x8140}, + {0x9017b, 0x10c}, + {0x9017c, 0x0}, + {0x9017d, 0x478}, + {0x9017e, 0x109}, + {0x9017f, 0x0}, + {0x90180, 0x1}, + {0x90181, 0x8}, + {0x90182, 0x8}, + {0x90183, 0x4}, + {0x90184, 0x0}, + {0x90006, 0x8}, + {0x90007, 0x7c8}, + {0x90008, 0x109}, + {0x90009, 0x0}, + {0x9000a, 0x400}, + {0x9000b, 0x106}, + {0xd00e7, 0x400}, + {0x90017, 0x0}, + {0x9001f, 0x2b}, + {0x90026, 0x69}, + {0x400d0, 0x0}, + {0x400d1, 0x101}, + {0x400d2, 0x105}, + {0x400d3, 0x107}, + {0x400d4, 0x10f}, + {0x400d5, 0x202}, + {0x400d6, 0x20a}, + {0x400d7, 0x20b}, + {0x2003a, 0x2}, + {0x200be, 0x3}, + {0x2000b, 0x20d}, + {0x2000c, 0x74}, + {0x2000d, 0x48e}, + {0x2000e, 0x2c}, + {0x12000b, 0x107}, + {0x12000c, 0x3a}, + {0x12000d, 0x246}, + {0x12000e, 0x21}, + {0x22000b, 0xb0}, + {0x22000c, 0x27}, + {0x22000d, 0x186}, + {0x22000e, 0x10}, + {0x9000c, 0x0}, + {0x9000d, 0x173}, + {0x9000e, 0x60}, + {0x9000f, 0x6110}, + {0x90010, 0x2152}, + {0x90011, 0xdfbd}, + {0x90012, 0x2060}, + {0x90013, 0x6152}, + {0x20010, 0x5a}, + {0x20011, 0x3}, + {0x120010, 0x5a}, + {0x120011, 0x3}, + {0x40080, 0xe0}, + {0x40081, 0x12}, + {0x40082, 0xe0}, + {0x40083, 0x12}, + {0x40084, 0xe0}, + {0x40085, 0x12}, + {0x140080, 0xe0}, + {0x140081, 0x12}, + {0x140082, 0xe0}, + {0x140083, 0x12}, + {0x140084, 0xe0}, + {0x140085, 0x12}, + {0x240080, 0xe0}, + {0x240081, 0x12}, + {0x240082, 0xe0}, + {0x240083, 0x12}, + {0x240084, 0xe0}, + {0x240085, 0x12}, + {0x400fd, 0xf}, + {0x400f1, 0xe}, + {0x10011, 0x1}, + {0x10012, 0x1}, + {0x10013, 0x180}, + {0x10018, 0x1}, + {0x10002, 0x6209}, + {0x100b2, 0x1}, + {0x101b4, 0x1}, + {0x102b4, 0x1}, + {0x103b4, 0x1}, + {0x104b4, 0x1}, + {0x105b4, 0x1}, + {0x106b4, 0x1}, + {0x107b4, 0x1}, + {0x108b4, 0x1}, + {0x11011, 0x1}, + {0x11012, 0x1}, + {0x11013, 0x180}, + {0x11018, 0x1}, + {0x11002, 0x6209}, + {0x110b2, 0x1}, + {0x111b4, 0x1}, + {0x112b4, 0x1}, + {0x113b4, 0x1}, + {0x114b4, 0x1}, + {0x115b4, 0x1}, + {0x116b4, 0x1}, + {0x117b4, 0x1}, + {0x118b4, 0x1}, + {0x20089, 0x1}, + {0x20088, 0x19}, + {0xc0080, 0x0}, + {0xd0000, 0x1}, +}; + +static struct dram_fsp_msg ddr_dram_fsp_msg[] = { + { + /* P0 1866mts 1D */ + .drate = 1866, + .fw_type = FW_1D_IMAGE, + .fsp_cfg = ddr_fsp0_cfg, + .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_cfg), + }, + { + /* P1 933mts 1D */ + .drate = 933, + .fw_type = FW_1D_IMAGE, + .fsp_cfg = ddr_fsp1_cfg, + .fsp_cfg_num = ARRAY_SIZE(ddr_fsp1_cfg), + }, + { + /* P2 625mts 1D */ + .drate = 625, + .fw_type = FW_1D_IMAGE, + .fsp_cfg = ddr_fsp2_cfg, + .fsp_cfg_num = ARRAY_SIZE(ddr_fsp2_cfg), + }, + { + /* P0 1866mts 2D */ + .drate = 1866, + .fw_type = FW_2D_IMAGE, + .fsp_cfg = ddr_fsp0_2d_cfg, + .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_2d_cfg), + }, +}; + +/* ddr timing config params */ +struct dram_timing_info dram_timing_1866mts = { + .ddrc_cfg = ddr_ddrc_cfg, + .ddrc_cfg_num = ARRAY_SIZE(ddr_ddrc_cfg), + .ddrphy_cfg = ddr_ddrphy_cfg, + .ddrphy_cfg_num = ARRAY_SIZE(ddr_ddrphy_cfg), + .fsp_msg = ddr_dram_fsp_msg, + .fsp_msg_num = ARRAY_SIZE(ddr_dram_fsp_msg), + .ddrphy_trained_csr = ddr_ddrphy_trained_csr, + .ddrphy_trained_csr_num = ARRAY_SIZE(ddr_ddrphy_trained_csr), + .ddrphy_pie = ddr_phy_pie, + .ddrphy_pie_num = ARRAY_SIZE(ddr_phy_pie), + .fsp_table = { 1866, 933, 625, }, + .fsp_cfg = ddr_dram_fsp_cfg, + .fsp_cfg_num = ARRAY_SIZE(ddr_dram_fsp_cfg), +}; diff --git a/board/freescale/imx93_evk/lpddr4x_timing_ld.c b/board/freescale/imx93_evk/lpddr4x_timing_ld.c deleted file mode 100644 index f080322f112..00000000000 --- a/board/freescale/imx93_evk/lpddr4x_timing_ld.c +++ /dev/null @@ -1,1496 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright 2022 NXP - * - * Generated code from IMX_DDR_tool - * - * Align with uboot version: - * imx_v2019.04_5.4.x and above version - */ - -#include <linux/kernel.h> -#include <asm/arch/ddr.h> - -struct dram_cfg_param ddr_ddrc_cfg[] = { - /** Initialize DDRC registers **/ - { 0x4e300110, 0x44140001 }, - { 0x4e301000, 0x0 }, - { 0x4e300000, 0x8000ff }, - { 0x4e300008, 0x0 }, - { 0x4e300080, 0x80000512 }, - { 0x4e300084, 0x0 }, - { 0x4e300114, 0x2 }, - { 0x4e300260, 0x0 }, - { 0x4e30017c, 0x0 }, - { 0x4e300f04, 0x80 }, - { 0x4e300104, 0xaa77000e }, - { 0x4e300108, 0x1816b1aa }, - { 0x4e30010c, 0x5101e6 }, - { 0x4e300100, 0x12552100 }, - { 0x4e300160, 0x9002 }, - { 0x4e30016c, 0x30900000 }, - { 0x4e300250, 0x14 }, - { 0x4e300254, 0xaa00aa }, - { 0x4e300258, 0x8 }, - { 0x4e30025c, 0x400 }, - { 0x4e300300, 0x11281109 }, - { 0x4e300304, 0xaa110a }, - { 0x4e300308, 0x620071e }, - { 0x4e300170, 0x8a0a0508 }, - { 0x4e300124, 0xe3c0000 }, - { 0x4e300804, 0x1f1f1f1f }, - { 0x4e301240, 0x0 }, - { 0x4e301244, 0x0 }, - { 0x4e301248, 0x0 }, - { 0x4e30124c, 0x0 }, - { 0x4e301250, 0x0 }, - { 0x4e301254, 0x0 }, - { 0x4e301258, 0x0 }, - { 0x4e30125c, 0x0 }, -}; - -/* PHY Initialize Configuration */ -struct dram_cfg_param ddr_ddrphy_cfg[] = { - { 0x100a0, 0x4 }, - { 0x100a1, 0x5 }, - { 0x100a2, 0x6 }, - { 0x100a3, 0x7 }, - { 0x100a4, 0x0 }, - { 0x100a5, 0x1 }, - { 0x100a6, 0x2 }, - { 0x100a7, 0x3 }, - { 0x110a0, 0x3 }, - { 0x110a1, 0x2 }, - { 0x110a2, 0x0 }, - { 0x110a3, 0x1 }, - { 0x110a4, 0x7 }, - { 0x110a5, 0x6 }, - { 0x110a6, 0x4 }, - { 0x110a7, 0x5 }, - { 0x1005f, 0x5ff }, - { 0x1015f, 0x5ff }, - { 0x1105f, 0x5ff }, - { 0x1115f, 0x5ff }, - { 0x55, 0x1ff }, - { 0x1055, 0x1ff }, - { 0x2055, 0x1ff }, - { 0x200c5, 0xb }, - { 0x2002e, 0x2 }, - { 0x90204, 0x0 }, - { 0x20024, 0x1e3 }, - { 0x2003a, 0x2 }, - { 0x2007d, 0x212 }, - { 0x2007c, 0x61 }, - { 0x20056, 0x3 }, - { 0x1004d, 0xe00 }, - { 0x1014d, 0xe00 }, - { 0x1104d, 0xe00 }, - { 0x1114d, 0xe00 }, - { 0x10049, 0xe00 }, - { 0x10149, 0xe00 }, - { 0x11049, 0xe00 }, - { 0x11149, 0xe00 }, - { 0x43, 0x60 }, - { 0x1043, 0x60 }, - { 0x2043, 0x60 }, - { 0x20018, 0x1 }, - { 0x20075, 0x4 }, - { 0x20050, 0x0 }, - { 0x2009b, 0x2 }, - { 0x20008, 0x1d3 }, - { 0x20088, 0x9 }, - { 0x200b2, 0x10c }, - { 0x10043, 0x5a1 }, - { 0x10143, 0x5a1 }, - { 0x11043, 0x5a1 }, - { 0x11143, 0x5a1 }, - { 0x200fa, 0x2 }, - { 0x20019, 0x1 }, - { 0x200f0, 0x0 }, - { 0x200f1, 0x0 }, - { 0x200f2, 0x4444 }, - { 0x200f3, 0x8888 }, - { 0x200f4, 0x5555 }, - { 0x200f5, 0x0 }, - { 0x200f6, 0x0 }, - { 0x200f7, 0xf000 }, - { 0x1004a, 0x500 }, - { 0x1104a, 0x500 }, - { 0x20025, 0x0 }, - { 0x2002d, 0x0 }, - { 0x20021, 0x0 }, - { 0x2002c, 0x0 }, -}; - -/* ddr phy trained csr */ -struct dram_cfg_param ddr_ddrphy_trained_csr[] = { - { 0x200b2, 0x0 }, - { 0x1200b2, 0x0 }, - { 0x2200b2, 0x0 }, - { 0x200cb, 0x0 }, - { 0x10043, 0x0 }, - { 0x110043, 0x0 }, - { 0x210043, 0x0 }, - { 0x10143, 0x0 }, - { 0x110143, 0x0 }, - { 0x210143, 0x0 }, - { 0x11043, 0x0 }, - { 0x111043, 0x0 }, - { 0x211043, 0x0 }, - { 0x11143, 0x0 }, - { 0x111143, 0x0 }, - { 0x211143, 0x0 }, - { 0x12043, 0x0 }, - { 0x112043, 0x0 }, - { 0x212043, 0x0 }, - { 0x12143, 0x0 }, - { 0x112143, 0x0 }, - { 0x212143, 0x0 }, - { 0x13043, 0x0 }, - { 0x113043, 0x0 }, - { 0x213043, 0x0 }, - { 0x13143, 0x0 }, - { 0x113143, 0x0 }, - { 0x213143, 0x0 }, - { 0x80, 0x0 }, - { 0x100080, 0x0 }, - { 0x200080, 0x0 }, - { 0x1080, 0x0 }, - { 0x101080, 0x0 }, - { 0x201080, 0x0 }, - { 0x2080, 0x0 }, - { 0x102080, 0x0 }, - { 0x202080, 0x0 }, - { 0x3080, 0x0 }, - { 0x103080, 0x0 }, - { 0x203080, 0x0 }, - { 0x4080, 0x0 }, - { 0x104080, 0x0 }, - { 0x204080, 0x0 }, - { 0x5080, 0x0 }, - { 0x105080, 0x0 }, - { 0x205080, 0x0 }, - { 0x6080, 0x0 }, - { 0x106080, 0x0 }, - { 0x206080, 0x0 }, - { 0x7080, 0x0 }, - { 0x107080, 0x0 }, - { 0x207080, 0x0 }, - { 0x8080, 0x0 }, - { 0x108080, 0x0 }, - { 0x208080, 0x0 }, - { 0x9080, 0x0 }, - { 0x109080, 0x0 }, - { 0x209080, 0x0 }, - { 0x10080, 0x0 }, - { 0x110080, 0x0 }, - { 0x210080, 0x0 }, - { 0x10180, 0x0 }, - { 0x110180, 0x0 }, - { 0x210180, 0x0 }, - { 0x11080, 0x0 }, - { 0x111080, 0x0 }, - { 0x211080, 0x0 }, - { 0x11180, 0x0 }, - { 0x111180, 0x0 }, - { 0x211180, 0x0 }, - { 0x12080, 0x0 }, - { 0x112080, 0x0 }, - { 0x212080, 0x0 }, - { 0x12180, 0x0 }, - { 0x112180, 0x0 }, - { 0x212180, 0x0 }, - { 0x13080, 0x0 }, - { 0x113080, 0x0 }, - { 0x213080, 0x0 }, - { 0x13180, 0x0 }, - { 0x113180, 0x0 }, - { 0x213180, 0x0 }, - { 0x10081, 0x0 }, - { 0x110081, 0x0 }, - { 0x210081, 0x0 }, - { 0x10181, 0x0 }, - { 0x110181, 0x0 }, - { 0x210181, 0x0 }, - { 0x11081, 0x0 }, - { 0x111081, 0x0 }, - { 0x211081, 0x0 }, - { 0x11181, 0x0 }, - { 0x111181, 0x0 }, - { 0x211181, 0x0 }, - { 0x12081, 0x0 }, - { 0x112081, 0x0 }, - { 0x212081, 0x0 }, - { 0x12181, 0x0 }, - { 0x112181, 0x0 }, - { 0x212181, 0x0 }, - { 0x13081, 0x0 }, - { 0x113081, 0x0 }, - { 0x213081, 0x0 }, - { 0x13181, 0x0 }, - { 0x113181, 0x0 }, - { 0x213181, 0x0 }, - { 0x100d0, 0x0 }, - { 0x1100d0, 0x0 }, - { 0x2100d0, 0x0 }, - { 0x101d0, 0x0 }, - { 0x1101d0, 0x0 }, - { 0x2101d0, 0x0 }, - { 0x110d0, 0x0 }, - { 0x1110d0, 0x0 }, - { 0x2110d0, 0x0 }, - { 0x111d0, 0x0 }, - { 0x1111d0, 0x0 }, - { 0x2111d0, 0x0 }, - { 0x120d0, 0x0 }, - { 0x1120d0, 0x0 }, - { 0x2120d0, 0x0 }, - { 0x121d0, 0x0 }, - { 0x1121d0, 0x0 }, - { 0x2121d0, 0x0 }, - { 0x130d0, 0x0 }, - { 0x1130d0, 0x0 }, - { 0x2130d0, 0x0 }, - { 0x131d0, 0x0 }, - { 0x1131d0, 0x0 }, - { 0x2131d0, 0x0 }, - { 0x100d1, 0x0 }, - { 0x1100d1, 0x0 }, - { 0x2100d1, 0x0 }, - { 0x101d1, 0x0 }, - { 0x1101d1, 0x0 }, - { 0x2101d1, 0x0 }, - { 0x110d1, 0x0 }, - { 0x1110d1, 0x0 }, - { 0x2110d1, 0x0 }, - { 0x111d1, 0x0 }, - { 0x1111d1, 0x0 }, - { 0x2111d1, 0x0 }, - { 0x120d1, 0x0 }, - { 0x1120d1, 0x0 }, - { 0x2120d1, 0x0 }, - { 0x121d1, 0x0 }, - { 0x1121d1, 0x0 }, - { 0x2121d1, 0x0 }, - { 0x130d1, 0x0 }, - { 0x1130d1, 0x0 }, - { 0x2130d1, 0x0 }, - { 0x131d1, 0x0 }, - { 0x1131d1, 0x0 }, - { 0x2131d1, 0x0 }, - { 0x10068, 0x0 }, - { 0x10168, 0x0 }, - { 0x10268, 0x0 }, - { 0x10368, 0x0 }, - { 0x10468, 0x0 }, - { 0x10568, 0x0 }, - { 0x10668, 0x0 }, - { 0x10768, 0x0 }, - { 0x10868, 0x0 }, - { 0x11068, 0x0 }, - { 0x11168, 0x0 }, - { 0x11268, 0x0 }, - { 0x11368, 0x0 }, - { 0x11468, 0x0 }, - { 0x11568, 0x0 }, - { 0x11668, 0x0 }, - { 0x11768, 0x0 }, - { 0x11868, 0x0 }, - { 0x12068, 0x0 }, - { 0x12168, 0x0 }, - { 0x12268, 0x0 }, - { 0x12368, 0x0 }, - { 0x12468, 0x0 }, - { 0x12568, 0x0 }, - { 0x12668, 0x0 }, - { 0x12768, 0x0 }, - { 0x12868, 0x0 }, - { 0x13068, 0x0 }, - { 0x13168, 0x0 }, - { 0x13268, 0x0 }, - { 0x13368, 0x0 }, - { 0x13468, 0x0 }, - { 0x13568, 0x0 }, - { 0x13668, 0x0 }, - { 0x13768, 0x0 }, - { 0x13868, 0x0 }, - { 0x10069, 0x0 }, - { 0x10169, 0x0 }, - { 0x10269, 0x0 }, - { 0x10369, 0x0 }, - { 0x10469, 0x0 }, - { 0x10569, 0x0 }, - { 0x10669, 0x0 }, - { 0x10769, 0x0 }, - { 0x10869, 0x0 }, - { 0x11069, 0x0 }, - { 0x11169, 0x0 }, - { 0x11269, 0x0 }, - { 0x11369, 0x0 }, - { 0x11469, 0x0 }, - { 0x11569, 0x0 }, - { 0x11669, 0x0 }, - { 0x11769, 0x0 }, - { 0x11869, 0x0 }, - { 0x12069, 0x0 }, - { 0x12169, 0x0 }, - { 0x12269, 0x0 }, - { 0x12369, 0x0 }, - { 0x12469, 0x0 }, - { 0x12569, 0x0 }, - { 0x12669, 0x0 }, - { 0x12769, 0x0 }, - { 0x12869, 0x0 }, - { 0x13069, 0x0 }, - { 0x13169, 0x0 }, - { 0x13269, 0x0 }, - { 0x13369, 0x0 }, - { 0x13469, 0x0 }, - { 0x13569, 0x0 }, - { 0x13669, 0x0 }, - { 0x13769, 0x0 }, - { 0x13869, 0x0 }, - { 0x1008c, 0x0 }, - { 0x11008c, 0x0 }, - { 0x21008c, 0x0 }, - { 0x1018c, 0x0 }, - { 0x11018c, 0x0 }, - { 0x21018c, 0x0 }, - { 0x1108c, 0x0 }, - { 0x11108c, 0x0 }, - { 0x21108c, 0x0 }, - { 0x1118c, 0x0 }, - { 0x11118c, 0x0 }, - { 0x21118c, 0x0 }, - { 0x1208c, 0x0 }, - { 0x11208c, 0x0 }, - { 0x21208c, 0x0 }, - { 0x1218c, 0x0 }, - { 0x11218c, 0x0 }, - { 0x21218c, 0x0 }, - { 0x1308c, 0x0 }, - { 0x11308c, 0x0 }, - { 0x21308c, 0x0 }, - { 0x1318c, 0x0 }, - { 0x11318c, 0x0 }, - { 0x21318c, 0x0 }, - { 0x1008d, 0x0 }, - { 0x11008d, 0x0 }, - { 0x21008d, 0x0 }, - { 0x1018d, 0x0 }, - { 0x11018d, 0x0 }, - { 0x21018d, 0x0 }, - { 0x1108d, 0x0 }, - { 0x11108d, 0x0 }, - { 0x21108d, 0x0 }, - { 0x1118d, 0x0 }, - { 0x11118d, 0x0 }, - { 0x21118d, 0x0 }, - { 0x1208d, 0x0 }, - { 0x11208d, 0x0 }, - { 0x21208d, 0x0 }, - { 0x1218d, 0x0 }, - { 0x11218d, 0x0 }, - { 0x21218d, 0x0 }, - { 0x1308d, 0x0 }, - { 0x11308d, 0x0 }, - { 0x21308d, 0x0 }, - { 0x1318d, 0x0 }, - { 0x11318d, 0x0 }, - { 0x21318d, 0x0 }, - { 0x100c0, 0x0 }, - { 0x1100c0, 0x0 }, - { 0x2100c0, 0x0 }, - { 0x101c0, 0x0 }, - { 0x1101c0, 0x0 }, - { 0x2101c0, 0x0 }, - { 0x102c0, 0x0 }, - { 0x1102c0, 0x0 }, - { 0x2102c0, 0x0 }, - { 0x103c0, 0x0 }, - { 0x1103c0, 0x0 }, - { 0x2103c0, 0x0 }, - { 0x104c0, 0x0 }, - { 0x1104c0, 0x0 }, - { 0x2104c0, 0x0 }, - { 0x105c0, 0x0 }, - { 0x1105c0, 0x0 }, - { 0x2105c0, 0x0 }, - { 0x106c0, 0x0 }, - { 0x1106c0, 0x0 }, - { 0x2106c0, 0x0 }, - { 0x107c0, 0x0 }, - { 0x1107c0, 0x0 }, - { 0x2107c0, 0x0 }, - { 0x108c0, 0x0 }, - { 0x1108c0, 0x0 }, - { 0x2108c0, 0x0 }, - { 0x110c0, 0x0 }, - { 0x1110c0, 0x0 }, - { 0x2110c0, 0x0 }, - { 0x111c0, 0x0 }, - { 0x1111c0, 0x0 }, - { 0x2111c0, 0x0 }, - { 0x112c0, 0x0 }, - { 0x1112c0, 0x0 }, - { 0x2112c0, 0x0 }, - { 0x113c0, 0x0 }, - { 0x1113c0, 0x0 }, - { 0x2113c0, 0x0 }, - { 0x114c0, 0x0 }, - { 0x1114c0, 0x0 }, - { 0x2114c0, 0x0 }, - { 0x115c0, 0x0 }, - { 0x1115c0, 0x0 }, - { 0x2115c0, 0x0 }, - { 0x116c0, 0x0 }, - { 0x1116c0, 0x0 }, - { 0x2116c0, 0x0 }, - { 0x117c0, 0x0 }, - { 0x1117c0, 0x0 }, - { 0x2117c0, 0x0 }, - { 0x118c0, 0x0 }, - { 0x1118c0, 0x0 }, - { 0x2118c0, 0x0 }, - { 0x120c0, 0x0 }, - { 0x1120c0, 0x0 }, - { 0x2120c0, 0x0 }, - { 0x121c0, 0x0 }, - { 0x1121c0, 0x0 }, - { 0x2121c0, 0x0 }, - { 0x122c0, 0x0 }, - { 0x1122c0, 0x0 }, - { 0x2122c0, 0x0 }, - { 0x123c0, 0x0 }, - { 0x1123c0, 0x0 }, - { 0x2123c0, 0x0 }, - { 0x124c0, 0x0 }, - { 0x1124c0, 0x0 }, - { 0x2124c0, 0x0 }, - { 0x125c0, 0x0 }, - { 0x1125c0, 0x0 }, - { 0x2125c0, 0x0 }, - { 0x126c0, 0x0 }, - { 0x1126c0, 0x0 }, - { 0x2126c0, 0x0 }, - { 0x127c0, 0x0 }, - { 0x1127c0, 0x0 }, - { 0x2127c0, 0x0 }, - { 0x128c0, 0x0 }, - { 0x1128c0, 0x0 }, - { 0x2128c0, 0x0 }, - { 0x130c0, 0x0 }, - { 0x1130c0, 0x0 }, - { 0x2130c0, 0x0 }, - { 0x131c0, 0x0 }, - { 0x1131c0, 0x0 }, - { 0x2131c0, 0x0 }, - { 0x132c0, 0x0 }, - { 0x1132c0, 0x0 }, - { 0x2132c0, 0x0 }, - { 0x133c0, 0x0 }, - { 0x1133c0, 0x0 }, - { 0x2133c0, 0x0 }, - { 0x134c0, 0x0 }, - { 0x1134c0, 0x0 }, - { 0x2134c0, 0x0 }, - { 0x135c0, 0x0 }, - { 0x1135c0, 0x0 }, - { 0x2135c0, 0x0 }, - { 0x136c0, 0x0 }, - { 0x1136c0, 0x0 }, - { 0x2136c0, 0x0 }, - { 0x137c0, 0x0 }, - { 0x1137c0, 0x0 }, - { 0x2137c0, 0x0 }, - { 0x138c0, 0x0 }, - { 0x1138c0, 0x0 }, - { 0x2138c0, 0x0 }, - { 0x100c1, 0x0 }, - { 0x1100c1, 0x0 }, - { 0x2100c1, 0x0 }, - { 0x101c1, 0x0 }, - { 0x1101c1, 0x0 }, - { 0x2101c1, 0x0 }, - { 0x102c1, 0x0 }, - { 0x1102c1, 0x0 }, - { 0x2102c1, 0x0 }, - { 0x103c1, 0x0 }, - { 0x1103c1, 0x0 }, - { 0x2103c1, 0x0 }, - { 0x104c1, 0x0 }, - { 0x1104c1, 0x0 }, - { 0x2104c1, 0x0 }, - { 0x105c1, 0x0 }, - { 0x1105c1, 0x0 }, - { 0x2105c1, 0x0 }, - { 0x106c1, 0x0 }, - { 0x1106c1, 0x0 }, - { 0x2106c1, 0x0 }, - { 0x107c1, 0x0 }, - { 0x1107c1, 0x0 }, - { 0x2107c1, 0x0 }, - { 0x108c1, 0x0 }, - { 0x1108c1, 0x0 }, - { 0x2108c1, 0x0 }, - { 0x110c1, 0x0 }, - { 0x1110c1, 0x0 }, - { 0x2110c1, 0x0 }, - { 0x111c1, 0x0 }, - { 0x1111c1, 0x0 }, - { 0x2111c1, 0x0 }, - { 0x112c1, 0x0 }, - { 0x1112c1, 0x0 }, - { 0x2112c1, 0x0 }, - { 0x113c1, 0x0 }, - { 0x1113c1, 0x0 }, - { 0x2113c1, 0x0 }, - { 0x114c1, 0x0 }, - { 0x1114c1, 0x0 }, - { 0x2114c1, 0x0 }, - { 0x115c1, 0x0 }, - { 0x1115c1, 0x0 }, - { 0x2115c1, 0x0 }, - { 0x116c1, 0x0 }, - { 0x1116c1, 0x0 }, - { 0x2116c1, 0x0 }, - { 0x117c1, 0x0 }, - { 0x1117c1, 0x0 }, - { 0x2117c1, 0x0 }, - { 0x118c1, 0x0 }, - { 0x1118c1, 0x0 }, - { 0x2118c1, 0x0 }, - { 0x120c1, 0x0 }, - { 0x1120c1, 0x0 }, - { 0x2120c1, 0x0 }, - { 0x121c1, 0x0 }, - { 0x1121c1, 0x0 }, - { 0x2121c1, 0x0 }, - { 0x122c1, 0x0 }, - { 0x1122c1, 0x0 }, - { 0x2122c1, 0x0 }, - { 0x123c1, 0x0 }, - { 0x1123c1, 0x0 }, - { 0x2123c1, 0x0 }, - { 0x124c1, 0x0 }, - { 0x1124c1, 0x0 }, - { 0x2124c1, 0x0 }, - { 0x125c1, 0x0 }, - { 0x1125c1, 0x0 }, - { 0x2125c1, 0x0 }, - { 0x126c1, 0x0 }, - { 0x1126c1, 0x0 }, - { 0x2126c1, 0x0 }, - { 0x127c1, 0x0 }, - { 0x1127c1, 0x0 }, - { 0x2127c1, 0x0 }, - { 0x128c1, 0x0 }, - { 0x1128c1, 0x0 }, - { 0x2128c1, 0x0 }, - { 0x130c1, 0x0 }, - { 0x1130c1, 0x0 }, - { 0x2130c1, 0x0 }, - { 0x131c1, 0x0 }, - { 0x1131c1, 0x0 }, - { 0x2131c1, 0x0 }, - { 0x132c1, 0x0 }, - { 0x1132c1, 0x0 }, - { 0x2132c1, 0x0 }, - { 0x133c1, 0x0 }, - { 0x1133c1, 0x0 }, - { 0x2133c1, 0x0 }, - { 0x134c1, 0x0 }, - { 0x1134c1, 0x0 }, - { 0x2134c1, 0x0 }, - { 0x135c1, 0x0 }, - { 0x1135c1, 0x0 }, - { 0x2135c1, 0x0 }, - { 0x136c1, 0x0 }, - { 0x1136c1, 0x0 }, - { 0x2136c1, 0x0 }, - { 0x137c1, 0x0 }, - { 0x1137c1, 0x0 }, - { 0x2137c1, 0x0 }, - { 0x138c1, 0x0 }, - { 0x1138c1, 0x0 }, - { 0x2138c1, 0x0 }, - { 0x10020, 0x0 }, - { 0x110020, 0x0 }, - { 0x210020, 0x0 }, - { 0x11020, 0x0 }, - { 0x111020, 0x0 }, - { 0x211020, 0x0 }, - { 0x12020, 0x0 }, - { 0x112020, 0x0 }, - { 0x212020, 0x0 }, - { 0x13020, 0x0 }, - { 0x113020, 0x0 }, - { 0x213020, 0x0 }, - { 0x20072, 0x0 }, - { 0x20073, 0x0 }, - { 0x20074, 0x0 }, - { 0x100aa, 0x0 }, - { 0x110aa, 0x0 }, - { 0x120aa, 0x0 }, - { 0x130aa, 0x0 }, - { 0x20010, 0x0 }, - { 0x120010, 0x0 }, - { 0x220010, 0x0 }, - { 0x20011, 0x0 }, - { 0x120011, 0x0 }, - { 0x220011, 0x0 }, - { 0x100ae, 0x0 }, - { 0x1100ae, 0x0 }, - { 0x2100ae, 0x0 }, - { 0x100af, 0x0 }, - { 0x1100af, 0x0 }, - { 0x2100af, 0x0 }, - { 0x110ae, 0x0 }, - { 0x1110ae, 0x0 }, - { 0x2110ae, 0x0 }, - { 0x110af, 0x0 }, - { 0x1110af, 0x0 }, - { 0x2110af, 0x0 }, - { 0x120ae, 0x0 }, - { 0x1120ae, 0x0 }, - { 0x2120ae, 0x0 }, - { 0x120af, 0x0 }, - { 0x1120af, 0x0 }, - { 0x2120af, 0x0 }, - { 0x130ae, 0x0 }, - { 0x1130ae, 0x0 }, - { 0x2130ae, 0x0 }, - { 0x130af, 0x0 }, - { 0x1130af, 0x0 }, - { 0x2130af, 0x0 }, - { 0x20020, 0x0 }, - { 0x120020, 0x0 }, - { 0x220020, 0x0 }, - { 0x100a0, 0x0 }, - { 0x100a1, 0x0 }, - { 0x100a2, 0x0 }, - { 0x100a3, 0x0 }, - { 0x100a4, 0x0 }, - { 0x100a5, 0x0 }, - { 0x100a6, 0x0 }, - { 0x100a7, 0x0 }, - { 0x110a0, 0x0 }, - { 0x110a1, 0x0 }, - { 0x110a2, 0x0 }, - { 0x110a3, 0x0 }, - { 0x110a4, 0x0 }, - { 0x110a5, 0x0 }, - { 0x110a6, 0x0 }, - { 0x110a7, 0x0 }, - { 0x120a0, 0x0 }, - { 0x120a1, 0x0 }, - { 0x120a2, 0x0 }, - { 0x120a3, 0x0 }, - { 0x120a4, 0x0 }, - { 0x120a5, 0x0 }, - { 0x120a6, 0x0 }, - { 0x120a7, 0x0 }, - { 0x130a0, 0x0 }, - { 0x130a1, 0x0 }, - { 0x130a2, 0x0 }, - { 0x130a3, 0x0 }, - { 0x130a4, 0x0 }, - { 0x130a5, 0x0 }, - { 0x130a6, 0x0 }, - { 0x130a7, 0x0 }, - { 0x2007c, 0x0 }, - { 0x12007c, 0x0 }, - { 0x22007c, 0x0 }, - { 0x2007d, 0x0 }, - { 0x12007d, 0x0 }, - { 0x22007d, 0x0 }, - { 0x400fd, 0x0 }, - { 0x400c0, 0x0 }, - { 0x90201, 0x0 }, - { 0x190201, 0x0 }, - { 0x290201, 0x0 }, - { 0x90202, 0x0 }, - { 0x190202, 0x0 }, - { 0x290202, 0x0 }, - { 0x90203, 0x0 }, - { 0x190203, 0x0 }, - { 0x290203, 0x0 }, - { 0x90204, 0x0 }, - { 0x190204, 0x0 }, - { 0x290204, 0x0 }, - { 0x90205, 0x0 }, - { 0x190205, 0x0 }, - { 0x290205, 0x0 }, - { 0x90206, 0x0 }, - { 0x190206, 0x0 }, - { 0x290206, 0x0 }, - { 0x90207, 0x0 }, - { 0x190207, 0x0 }, - { 0x290207, 0x0 }, - { 0x90208, 0x0 }, - { 0x190208, 0x0 }, - { 0x290208, 0x0 }, - { 0x10062, 0x0 }, - { 0x10162, 0x0 }, - { 0x10262, 0x0 }, - { 0x10362, 0x0 }, - { 0x10462, 0x0 }, - { 0x10562, 0x0 }, - { 0x10662, 0x0 }, - { 0x10762, 0x0 }, - { 0x10862, 0x0 }, - { 0x11062, 0x0 }, - { 0x11162, 0x0 }, - { 0x11262, 0x0 }, - { 0x11362, 0x0 }, - { 0x11462, 0x0 }, - { 0x11562, 0x0 }, - { 0x11662, 0x0 }, - { 0x11762, 0x0 }, - { 0x11862, 0x0 }, - { 0x12062, 0x0 }, - { 0x12162, 0x0 }, - { 0x12262, 0x0 }, - { 0x12362, 0x0 }, - { 0x12462, 0x0 }, - { 0x12562, 0x0 }, - { 0x12662, 0x0 }, - { 0x12762, 0x0 }, - { 0x12862, 0x0 }, - { 0x13062, 0x0 }, - { 0x13162, 0x0 }, - { 0x13262, 0x0 }, - { 0x13362, 0x0 }, - { 0x13462, 0x0 }, - { 0x13562, 0x0 }, - { 0x13662, 0x0 }, - { 0x13762, 0x0 }, - { 0x13862, 0x0 }, - { 0x20077, 0x0 }, - { 0x10001, 0x0 }, - { 0x11001, 0x0 }, - { 0x12001, 0x0 }, - { 0x13001, 0x0 }, - { 0x10040, 0x0 }, - { 0x10140, 0x0 }, - { 0x10240, 0x0 }, - { 0x10340, 0x0 }, - { 0x10440, 0x0 }, - { 0x10540, 0x0 }, - { 0x10640, 0x0 }, - { 0x10740, 0x0 }, - { 0x10840, 0x0 }, - { 0x10030, 0x0 }, - { 0x10130, 0x0 }, - { 0x10230, 0x0 }, - { 0x10330, 0x0 }, - { 0x10430, 0x0 }, - { 0x10530, 0x0 }, - { 0x10630, 0x0 }, - { 0x10730, 0x0 }, - { 0x10830, 0x0 }, - { 0x11040, 0x0 }, - { 0x11140, 0x0 }, - { 0x11240, 0x0 }, - { 0x11340, 0x0 }, - { 0x11440, 0x0 }, - { 0x11540, 0x0 }, - { 0x11640, 0x0 }, - { 0x11740, 0x0 }, - { 0x11840, 0x0 }, - { 0x11030, 0x0 }, - { 0x11130, 0x0 }, - { 0x11230, 0x0 }, - { 0x11330, 0x0 }, - { 0x11430, 0x0 }, - { 0x11530, 0x0 }, - { 0x11630, 0x0 }, - { 0x11730, 0x0 }, - { 0x11830, 0x0 }, - { 0x12040, 0x0 }, - { 0x12140, 0x0 }, - { 0x12240, 0x0 }, - { 0x12340, 0x0 }, - { 0x12440, 0x0 }, - { 0x12540, 0x0 }, - { 0x12640, 0x0 }, - { 0x12740, 0x0 }, - { 0x12840, 0x0 }, - { 0x12030, 0x0 }, - { 0x12130, 0x0 }, - { 0x12230, 0x0 }, - { 0x12330, 0x0 }, - { 0x12430, 0x0 }, - { 0x12530, 0x0 }, - { 0x12630, 0x0 }, - { 0x12730, 0x0 }, - { 0x12830, 0x0 }, - { 0x13040, 0x0 }, - { 0x13140, 0x0 }, - { 0x13240, 0x0 }, - { 0x13340, 0x0 }, - { 0x13440, 0x0 }, - { 0x13540, 0x0 }, - { 0x13640, 0x0 }, - { 0x13740, 0x0 }, - { 0x13840, 0x0 }, - { 0x13030, 0x0 }, - { 0x13130, 0x0 }, - { 0x13230, 0x0 }, - { 0x13330, 0x0 }, - { 0x13430, 0x0 }, - { 0x13530, 0x0 }, - { 0x13630, 0x0 }, - { 0x13730, 0x0 }, - { 0x13830, 0x0 }, -}; - -/* P0 message block paremeter for training firmware */ -struct dram_cfg_param ddr_fsp0_cfg[] = { - { 0xd0000, 0x0 }, - { 0x54003, 0x74a }, - { 0x54004, 0x4 }, - { 0x54006, 0x15 }, - { 0x54008, 0x131f }, - { 0x54009, 0xc8 }, - { 0x5400b, 0x4 }, - { 0x5400c, 0x1 }, - { 0x5400d, 0x100 }, - { 0x5400f, 0x100 }, - { 0x54012, 0x110 }, - { 0x54019, 0x1bb4 }, - { 0x5401a, 0x32 }, - { 0x5401b, 0x1f46 }, - { 0x5401c, 0x1708 }, - { 0x5401e, 0x6 }, - { 0x5401f, 0x1bb4 }, - { 0x54020, 0x32 }, - { 0x54021, 0x1f46 }, - { 0x54022, 0x1708 }, - { 0x54024, 0x6 }, - { 0x54032, 0xb400 }, - { 0x54033, 0x321b }, - { 0x54034, 0x4600 }, - { 0x54035, 0x81f }, - { 0x54036, 0x17 }, - { 0x54037, 0x600 }, - { 0x54038, 0xb400 }, - { 0x54039, 0x321b }, - { 0x5403a, 0x4600 }, - { 0x5403b, 0x81f }, - { 0x5403c, 0x17 }, - { 0x5403d, 0x600 }, - { 0xd0000, 0x1 }, -}; - -/* P0 2D message block paremeter for training firmware */ -struct dram_cfg_param ddr_fsp0_2d_cfg[] = { - { 0xd0000, 0x0 }, - { 0x54003, 0x74a }, - { 0x54004, 0x4 }, - { 0x54006, 0x15 }, - { 0x54008, 0x61 }, - { 0x54009, 0xc8 }, - { 0x5400b, 0x4 }, - { 0x5400c, 0x1 }, - { 0x5400d, 0x100 }, - { 0x5400f, 0x100 }, - { 0x54010, 0x2080 }, - { 0x54012, 0x110 }, - { 0x54019, 0x1bb4 }, - { 0x5401a, 0x32 }, - { 0x5401b, 0x1f46 }, - { 0x5401c, 0x1708 }, - { 0x5401e, 0x6 }, - { 0x5401f, 0x1bb4 }, - { 0x54020, 0x32 }, - { 0x54021, 0x1f46 }, - { 0x54022, 0x1708 }, - { 0x54024, 0x6 }, - { 0x54032, 0xb400 }, - { 0x54033, 0x321b }, - { 0x54034, 0x4600 }, - { 0x54035, 0x81f }, - { 0x54036, 0x17 }, - { 0x54037, 0x600 }, - { 0x54038, 0xb400 }, - { 0x54039, 0x321b }, - { 0x5403a, 0x4600 }, - { 0x5403b, 0x81f }, - { 0x5403c, 0x17 }, - { 0x5403d, 0x600 }, - { 0xd0000, 0x1 }, -}; - -/* DRAM PHY init engine image */ -struct dram_cfg_param ddr_phy_pie[] = { - { 0xd0000, 0x0 }, - { 0x90000, 0x10 }, - { 0x90001, 0x400 }, - { 0x90002, 0x10e }, - { 0x90003, 0x0 }, - { 0x90004, 0x0 }, - { 0x90005, 0x8 }, - { 0x90029, 0xb }, - { 0x9002a, 0x480 }, - { 0x9002b, 0x109 }, - { 0x9002c, 0x8 }, - { 0x9002d, 0x448 }, - { 0x9002e, 0x139 }, - { 0x9002f, 0x8 }, - { 0x90030, 0x478 }, - { 0x90031, 0x109 }, - { 0x90032, 0x0 }, - { 0x90033, 0xe8 }, - { 0x90034, 0x109 }, - { 0x90035, 0x2 }, - { 0x90036, 0x10 }, - { 0x90037, 0x139 }, - { 0x90038, 0xb }, - { 0x90039, 0x7c0 }, - { 0x9003a, 0x139 }, - { 0x9003b, 0x44 }, - { 0x9003c, 0x633 }, - { 0x9003d, 0x159 }, - { 0x9003e, 0x14f }, - { 0x9003f, 0x630 }, - { 0x90040, 0x159 }, - { 0x90041, 0x47 }, - { 0x90042, 0x633 }, - { 0x90043, 0x149 }, - { 0x90044, 0x4f }, - { 0x90045, 0x633 }, - { 0x90046, 0x179 }, - { 0x90047, 0x8 }, - { 0x90048, 0xe0 }, - { 0x90049, 0x109 }, - { 0x9004a, 0x0 }, - { 0x9004b, 0x7c8 }, - { 0x9004c, 0x109 }, - { 0x9004d, 0x0 }, - { 0x9004e, 0x1 }, - { 0x9004f, 0x8 }, - { 0x90050, 0x30 }, - { 0x90051, 0x65a }, - { 0x90052, 0x9 }, - { 0x90053, 0x0 }, - { 0x90054, 0x45a }, - { 0x90055, 0x9 }, - { 0x90056, 0x0 }, - { 0x90057, 0x448 }, - { 0x90058, 0x109 }, - { 0x90059, 0x40 }, - { 0x9005a, 0x633 }, - { 0x9005b, 0x179 }, - { 0x9005c, 0x1 }, - { 0x9005d, 0x618 }, - { 0x9005e, 0x109 }, - { 0x9005f, 0x40c0 }, - { 0x90060, 0x633 }, - { 0x90061, 0x149 }, - { 0x90062, 0x8 }, - { 0x90063, 0x4 }, - { 0x90064, 0x48 }, - { 0x90065, 0x4040 }, - { 0x90066, 0x633 }, - { 0x90067, 0x149 }, - { 0x90068, 0x0 }, - { 0x90069, 0x4 }, - { 0x9006a, 0x48 }, - { 0x9006b, 0x40 }, - { 0x9006c, 0x633 }, - { 0x9006d, 0x149 }, - { 0x9006e, 0x0 }, - { 0x9006f, 0x658 }, - { 0x90070, 0x109 }, - { 0x90071, 0x10 }, - { 0x90072, 0x4 }, - { 0x90073, 0x18 }, - { 0x90074, 0x0 }, - { 0x90075, 0x4 }, - { 0x90076, 0x78 }, - { 0x90077, 0x549 }, - { 0x90078, 0x633 }, - { 0x90079, 0x159 }, - { 0x9007a, 0xd49 }, - { 0x9007b, 0x633 }, - { 0x9007c, 0x159 }, - { 0x9007d, 0x94a }, - { 0x9007e, 0x633 }, - { 0x9007f, 0x159 }, - { 0x90080, 0x441 }, - { 0x90081, 0x633 }, - { 0x90082, 0x149 }, - { 0x90083, 0x42 }, - { 0x90084, 0x633 }, - { 0x90085, 0x149 }, - { 0x90086, 0x1 }, - { 0x90087, 0x633 }, - { 0x90088, 0x149 }, - { 0x90089, 0x0 }, - { 0x9008a, 0xe0 }, - { 0x9008b, 0x109 }, - { 0x9008c, 0xa }, - { 0x9008d, 0x10 }, - { 0x9008e, 0x109 }, - { 0x9008f, 0x9 }, - { 0x90090, 0x3c0 }, - { 0x90091, 0x149 }, - { 0x90092, 0x9 }, - { 0x90093, 0x3c0 }, - { 0x90094, 0x159 }, - { 0x90095, 0x18 }, - { 0x90096, 0x10 }, - { 0x90097, 0x109 }, - { 0x90098, 0x0 }, - { 0x90099, 0x3c0 }, - { 0x9009a, 0x109 }, - { 0x9009b, 0x18 }, - { 0x9009c, 0x4 }, - { 0x9009d, 0x48 }, - { 0x9009e, 0x18 }, - { 0x9009f, 0x4 }, - { 0x900a0, 0x58 }, - { 0x900a1, 0xb }, - { 0x900a2, 0x10 }, - { 0x900a3, 0x109 }, - { 0x900a4, 0x1 }, - { 0x900a5, 0x10 }, - { 0x900a6, 0x109 }, - { 0x900a7, 0x5 }, - { 0x900a8, 0x7c0 }, - { 0x900a9, 0x109 }, - { 0x40000, 0x811 }, - { 0x40020, 0x880 }, - { 0x40040, 0x0 }, - { 0x40060, 0x0 }, - { 0x40001, 0x4008 }, - { 0x40021, 0x83 }, - { 0x40041, 0x4f }, - { 0x40061, 0x0 }, - { 0x40002, 0x4040 }, - { 0x40022, 0x83 }, - { 0x40042, 0x51 }, - { 0x40062, 0x0 }, - { 0x40003, 0x811 }, - { 0x40023, 0x880 }, - { 0x40043, 0x0 }, - { 0x40063, 0x0 }, - { 0x40004, 0x720 }, - { 0x40024, 0xf }, - { 0x40044, 0x1740 }, - { 0x40064, 0x0 }, - { 0x40005, 0x16 }, - { 0x40025, 0x83 }, - { 0x40045, 0x4b }, - { 0x40065, 0x0 }, - { 0x40006, 0x716 }, - { 0x40026, 0xf }, - { 0x40046, 0x2001 }, - { 0x40066, 0x0 }, - { 0x40007, 0x716 }, - { 0x40027, 0xf }, - { 0x40047, 0x2800 }, - { 0x40067, 0x0 }, - { 0x40008, 0x716 }, - { 0x40028, 0xf }, - { 0x40048, 0xf00 }, - { 0x40068, 0x0 }, - { 0x40009, 0x720 }, - { 0x40029, 0xf }, - { 0x40049, 0x1400 }, - { 0x40069, 0x0 }, - { 0x4000a, 0xe08 }, - { 0x4002a, 0xc15 }, - { 0x4004a, 0x0 }, - { 0x4006a, 0x0 }, - { 0x4000b, 0x625 }, - { 0x4002b, 0x15 }, - { 0x4004b, 0x0 }, - { 0x4006b, 0x0 }, - { 0x4000c, 0x4028 }, - { 0x4002c, 0x80 }, - { 0x4004c, 0x0 }, - { 0x4006c, 0x0 }, - { 0x4000d, 0xe08 }, - { 0x4002d, 0xc1a }, - { 0x4004d, 0x0 }, - { 0x4006d, 0x0 }, - { 0x4000e, 0x625 }, - { 0x4002e, 0x1a }, - { 0x4004e, 0x0 }, - { 0x4006e, 0x0 }, - { 0x4000f, 0x4040 }, - { 0x4002f, 0x80 }, - { 0x4004f, 0x0 }, - { 0x4006f, 0x0 }, - { 0x40010, 0x2604 }, - { 0x40030, 0x15 }, - { 0x40050, 0x0 }, - { 0x40070, 0x0 }, - { 0x40011, 0x708 }, - { 0x40031, 0x5 }, - { 0x40051, 0x0 }, - { 0x40071, 0x2002 }, - { 0x40012, 0x8 }, - { 0x40032, 0x80 }, - { 0x40052, 0x0 }, - { 0x40072, 0x0 }, - { 0x40013, 0x2604 }, - { 0x40033, 0x1a }, - { 0x40053, 0x0 }, - { 0x40073, 0x0 }, - { 0x40014, 0x708 }, - { 0x40034, 0xa }, - { 0x40054, 0x0 }, - { 0x40074, 0x2002 }, - { 0x40015, 0x4040 }, - { 0x40035, 0x80 }, - { 0x40055, 0x0 }, - { 0x40075, 0x0 }, - { 0x40016, 0x60a }, - { 0x40036, 0x15 }, - { 0x40056, 0x1200 }, - { 0x40076, 0x0 }, - { 0x40017, 0x61a }, - { 0x40037, 0x15 }, - { 0x40057, 0x1300 }, - { 0x40077, 0x0 }, - { 0x40018, 0x60a }, - { 0x40038, 0x1a }, - { 0x40058, 0x1200 }, - { 0x40078, 0x0 }, - { 0x40019, 0x642 }, - { 0x40039, 0x1a }, - { 0x40059, 0x1300 }, - { 0x40079, 0x0 }, - { 0x4001a, 0x4808 }, - { 0x4003a, 0x880 }, - { 0x4005a, 0x0 }, - { 0x4007a, 0x0 }, - { 0x900aa, 0x0 }, - { 0x900ab, 0x790 }, - { 0x900ac, 0x11a }, - { 0x900ad, 0x8 }, - { 0x900ae, 0x7aa }, - { 0x900af, 0x2a }, - { 0x900b0, 0x10 }, - { 0x900b1, 0x7b2 }, - { 0x900b2, 0x2a }, - { 0x900b3, 0x0 }, - { 0x900b4, 0x7c8 }, - { 0x900b5, 0x109 }, - { 0x900b6, 0x10 }, - { 0x900b7, 0x10 }, - { 0x900b8, 0x109 }, - { 0x900b9, 0x10 }, - { 0x900ba, 0x2a8 }, - { 0x900bb, 0x129 }, - { 0x900bc, 0x8 }, - { 0x900bd, 0x370 }, - { 0x900be, 0x129 }, - { 0x900bf, 0xa }, - { 0x900c0, 0x3c8 }, - { 0x900c1, 0x1a9 }, - { 0x900c2, 0xc }, - { 0x900c3, 0x408 }, - { 0x900c4, 0x199 }, - { 0x900c5, 0x14 }, - { 0x900c6, 0x790 }, - { 0x900c7, 0x11a }, - { 0x900c8, 0x8 }, - { 0x900c9, 0x4 }, - { 0x900ca, 0x18 }, - { 0x900cb, 0xe }, - { 0x900cc, 0x408 }, - { 0x900cd, 0x199 }, - { 0x900ce, 0x8 }, - { 0x900cf, 0x8568 }, - { 0x900d0, 0x108 }, - { 0x900d1, 0x18 }, - { 0x900d2, 0x790 }, - { 0x900d3, 0x16a }, - { 0x900d4, 0x8 }, - { 0x900d5, 0x1d8 }, - { 0x900d6, 0x169 }, - { 0x900d7, 0x10 }, - { 0x900d8, 0x8558 }, - { 0x900d9, 0x168 }, - { 0x900da, 0x1ff8 }, - { 0x900db, 0x85a8 }, - { 0x900dc, 0x1e8 }, - { 0x900dd, 0x50 }, - { 0x900de, 0x798 }, - { 0x900df, 0x16a }, - { 0x900e0, 0x60 }, - { 0x900e1, 0x7a0 }, - { 0x900e2, 0x16a }, - { 0x900e3, 0x8 }, - { 0x900e4, 0x8310 }, - { 0x900e5, 0x168 }, - { 0x900e6, 0x8 }, - { 0x900e7, 0xa310 }, - { 0x900e8, 0x168 }, - { 0x900e9, 0xa }, - { 0x900ea, 0x408 }, - { 0x900eb, 0x169 }, - { 0x900ec, 0x6e }, - { 0x900ed, 0x0 }, - { 0x900ee, 0x68 }, - { 0x900ef, 0x0 }, - { 0x900f0, 0x408 }, - { 0x900f1, 0x169 }, - { 0x900f2, 0x0 }, - { 0x900f3, 0x8310 }, - { 0x900f4, 0x168 }, - { 0x900f5, 0x0 }, - { 0x900f6, 0xa310 }, - { 0x900f7, 0x168 }, - { 0x900f8, 0x1ff8 }, - { 0x900f9, 0x85a8 }, - { 0x900fa, 0x1e8 }, - { 0x900fb, 0x68 }, - { 0x900fc, 0x798 }, - { 0x900fd, 0x16a }, - { 0x900fe, 0x78 }, - { 0x900ff, 0x7a0 }, - { 0x90100, 0x16a }, - { 0x90101, 0x68 }, - { 0x90102, 0x790 }, - { 0x90103, 0x16a }, - { 0x90104, 0x8 }, - { 0x90105, 0x8b10 }, - { 0x90106, 0x168 }, - { 0x90107, 0x8 }, - { 0x90108, 0xab10 }, - { 0x90109, 0x168 }, - { 0x9010a, 0xa }, - { 0x9010b, 0x408 }, - { 0x9010c, 0x169 }, - { 0x9010d, 0x58 }, - { 0x9010e, 0x0 }, - { 0x9010f, 0x68 }, - { 0x90110, 0x0 }, - { 0x90111, 0x408 }, - { 0x90112, 0x169 }, - { 0x90113, 0x0 }, - { 0x90114, 0x8b10 }, - { 0x90115, 0x168 }, - { 0x90116, 0x1 }, - { 0x90117, 0xab10 }, - { 0x90118, 0x168 }, - { 0x90119, 0x0 }, - { 0x9011a, 0x1d8 }, - { 0x9011b, 0x169 }, - { 0x9011c, 0x80 }, - { 0x9011d, 0x790 }, - { 0x9011e, 0x16a }, - { 0x9011f, 0x18 }, - { 0x90120, 0x7aa }, - { 0x90121, 0x6a }, - { 0x90122, 0xa }, - { 0x90123, 0x0 }, - { 0x90124, 0x1e9 }, - { 0x90125, 0x8 }, - { 0x90126, 0x8080 }, - { 0x90127, 0x108 }, - { 0x90128, 0xf }, - { 0x90129, 0x408 }, - { 0x9012a, 0x169 }, - { 0x9012b, 0xc }, - { 0x9012c, 0x0 }, - { 0x9012d, 0x68 }, - { 0x9012e, 0x9 }, - { 0x9012f, 0x0 }, - { 0x90130, 0x1a9 }, - { 0x90131, 0x0 }, - { 0x90132, 0x408 }, - { 0x90133, 0x169 }, - { 0x90134, 0x0 }, - { 0x90135, 0x8080 }, - { 0x90136, 0x108 }, - { 0x90137, 0x8 }, - { 0x90138, 0x7aa }, - { 0x90139, 0x6a }, - { 0x9013a, 0x0 }, - { 0x9013b, 0x8568 }, - { 0x9013c, 0x108 }, - { 0x9013d, 0xb7 }, - { 0x9013e, 0x790 }, - { 0x9013f, 0x16a }, - { 0x90140, 0x1f }, - { 0x90141, 0x0 }, - { 0x90142, 0x68 }, - { 0x90143, 0x8 }, - { 0x90144, 0x8558 }, - { 0x90145, 0x168 }, - { 0x90146, 0xf }, - { 0x90147, 0x408 }, - { 0x90148, 0x169 }, - { 0x90149, 0xd }, - { 0x9014a, 0x0 }, - { 0x9014b, 0x68 }, - { 0x9014c, 0x0 }, - { 0x9014d, 0x408 }, - { 0x9014e, 0x169 }, - { 0x9014f, 0x0 }, - { 0x90150, 0x8558 }, - { 0x90151, 0x168 }, - { 0x90152, 0x8 }, - { 0x90153, 0x3c8 }, - { 0x90154, 0x1a9 }, - { 0x90155, 0x3 }, - { 0x90156, 0x370 }, - { 0x90157, 0x129 }, - { 0x90158, 0x20 }, - { 0x90159, 0x2aa }, - { 0x9015a, 0x9 }, - { 0x9015b, 0x8 }, - { 0x9015c, 0xe8 }, - { 0x9015d, 0x109 }, - { 0x9015e, 0x0 }, - { 0x9015f, 0x8140 }, - { 0x90160, 0x10c }, - { 0x90161, 0x10 }, - { 0x90162, 0x8138 }, - { 0x90163, 0x104 }, - { 0x90164, 0x8 }, - { 0x90165, 0x448 }, - { 0x90166, 0x109 }, - { 0x90167, 0xf }, - { 0x90168, 0x7c0 }, - { 0x90169, 0x109 }, - { 0x9016a, 0x0 }, - { 0x9016b, 0xe8 }, - { 0x9016c, 0x109 }, - { 0x9016d, 0x47 }, - { 0x9016e, 0x630 }, - { 0x9016f, 0x109 }, - { 0x90170, 0x8 }, - { 0x90171, 0x618 }, - { 0x90172, 0x109 }, - { 0x90173, 0x8 }, - { 0x90174, 0xe0 }, - { 0x90175, 0x109 }, - { 0x90176, 0x0 }, - { 0x90177, 0x7c8 }, - { 0x90178, 0x109 }, - { 0x90179, 0x8 }, - { 0x9017a, 0x8140 }, - { 0x9017b, 0x10c }, - { 0x9017c, 0x0 }, - { 0x9017d, 0x478 }, - { 0x9017e, 0x109 }, - { 0x9017f, 0x0 }, - { 0x90180, 0x1 }, - { 0x90181, 0x8 }, - { 0x90182, 0x8 }, - { 0x90183, 0x4 }, - { 0x90184, 0x0 }, - { 0x90006, 0x8 }, - { 0x90007, 0x7c8 }, - { 0x90008, 0x109 }, - { 0x90009, 0x0 }, - { 0x9000a, 0x400 }, - { 0x9000b, 0x106 }, - { 0xd00e7, 0x400 }, - { 0x90017, 0x0 }, - { 0x9001f, 0x2b }, - { 0x90026, 0x69 }, - { 0x400d0, 0x0 }, - { 0x400d1, 0x101 }, - { 0x400d2, 0x105 }, - { 0x400d3, 0x107 }, - { 0x400d4, 0x10f }, - { 0x400d5, 0x202 }, - { 0x400d6, 0x20a }, - { 0x400d7, 0x20b }, - { 0x2003a, 0x2 }, - { 0x200be, 0x0 }, - { 0x2000b, 0x20c }, - { 0x2000c, 0x74 }, - { 0x2000d, 0x48e }, - { 0x2000e, 0x2c }, - { 0x9000c, 0x0 }, - { 0x9000d, 0x173 }, - { 0x9000e, 0x60 }, - { 0x9000f, 0x6110 }, - { 0x90010, 0x2152 }, - { 0x90011, 0xdfbd }, - { 0x90012, 0x2060 }, - { 0x90013, 0x6152 }, - { 0x20010, 0x5a }, - { 0x20011, 0x3 }, - { 0x40080, 0xe0 }, - { 0x40081, 0x12 }, - { 0x40082, 0xe0 }, - { 0x40083, 0x12 }, - { 0x40084, 0xe0 }, - { 0x40085, 0x12 }, - { 0x400fd, 0xf }, - { 0x400f1, 0xe }, - { 0x10011, 0x1 }, - { 0x10012, 0x1 }, - { 0x10013, 0x180 }, - { 0x10018, 0x1 }, - { 0x10002, 0x6209 }, - { 0x100b2, 0x1 }, - { 0x101b4, 0x1 }, - { 0x102b4, 0x1 }, - { 0x103b4, 0x1 }, - { 0x104b4, 0x1 }, - { 0x105b4, 0x1 }, - { 0x106b4, 0x1 }, - { 0x107b4, 0x1 }, - { 0x108b4, 0x1 }, - { 0x11011, 0x1 }, - { 0x11012, 0x1 }, - { 0x11013, 0x180 }, - { 0x11018, 0x1 }, - { 0x11002, 0x6209 }, - { 0x110b2, 0x1 }, - { 0x111b4, 0x1 }, - { 0x112b4, 0x1 }, - { 0x113b4, 0x1 }, - { 0x114b4, 0x1 }, - { 0x115b4, 0x1 }, - { 0x116b4, 0x1 }, - { 0x117b4, 0x1 }, - { 0x118b4, 0x1 }, - { 0x20089, 0x1 }, - { 0x20088, 0x19 }, - { 0xc0080, 0x0 }, - { 0xd0000, 0x1 } -}; - -struct dram_fsp_msg ddr_dram_fsp_msg[] = { - { - /* P0 1866mts 1D */ - .drate = 1866, - .fw_type = FW_1D_IMAGE, - .fsp_cfg = ddr_fsp0_cfg, - .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_cfg), - }, - { - /* P0 1866mts 2D */ - .drate = 1866, - .fw_type = FW_2D_IMAGE, - .fsp_cfg = ddr_fsp0_2d_cfg, - .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_2d_cfg), - }, -}; - -/* ddr timing config params */ -struct dram_timing_info dram_timing = { - .ddrc_cfg = ddr_ddrc_cfg, - .ddrc_cfg_num = ARRAY_SIZE(ddr_ddrc_cfg), - .ddrphy_cfg = ddr_ddrphy_cfg, - .ddrphy_cfg_num = ARRAY_SIZE(ddr_ddrphy_cfg), - .fsp_msg = ddr_dram_fsp_msg, - .fsp_msg_num = ARRAY_SIZE(ddr_dram_fsp_msg), - .ddrphy_trained_csr = ddr_ddrphy_trained_csr, - .ddrphy_trained_csr_num = ARRAY_SIZE(ddr_ddrphy_trained_csr), - .ddrphy_pie = ddr_phy_pie, - .ddrphy_pie_num = ARRAY_SIZE(ddr_phy_pie), - .fsp_table = { 1866, }, -}; diff --git a/board/freescale/imx93_evk/spl.c b/board/freescale/imx93_evk/spl.c index e5807134bb2..a214c04ddad 100644 --- a/board/freescale/imx93_evk/spl.c +++ b/board/freescale/imx93_evk/spl.c @@ -52,9 +52,16 @@ void spl_board_init(void) puts("Normal Boot\n"); } +extern struct dram_timing_info dram_timing_1866mts; void spl_dram_init(void) { - ddr_init(&dram_timing); + struct dram_timing_info *ptiming = &dram_timing; + + if (is_voltage_mode(VOLT_LOW_DRIVE)) + ptiming = &dram_timing_1866mts; + + printf("DDR: %uMTS\n", ptiming->fsp_msg[0].drate); + ddr_init(ptiming); } #if CONFIG_IS_ENABLED(DM_PMIC_PCA9450) @@ -62,6 +69,7 @@ int power_init_board(void) { struct udevice *dev; int ret; + unsigned int val = 0, buck_val; ret = pmic_get("pmic@25", &dev); if (ret == -ENODEV) { @@ -77,20 +85,41 @@ int power_init_board(void) /* enable DVS control through PMIC_STBY_REQ */ pmic_reg_write(dev, PCA9450_BUCK1CTRL, 0x59); - if (IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE)) { - /* 0.75v for Low drive mode - */ - pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x0c); - pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x0c); + ret = pmic_reg_read(dev, PCA9450_PWR_CTRL); + if (ret < 0) + return ret; + + val = ret; + + if (is_voltage_mode(VOLT_LOW_DRIVE)) { + buck_val = 0x0c; /* 0.8v for Low drive mode */ + printf("PMIC: Low Drive Voltage Mode\n"); + } else if (is_voltage_mode(VOLT_NOMINAL_DRIVE)) { + buck_val = 0x10; /* 0.85v for Nominal drive mode */ + printf("PMIC: Nominal Voltage Mode\n"); } else { - /* 0.9v for Over drive mode - */ - pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x18); - pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x18); + buck_val = 0x14; /* 0.9v for Over drive mode */ + printf("PMIC: Over Drive Voltage Mode\n"); + } + + if (val & PCA9450_REG_PWRCTRL_TOFF_DEB) { + pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, buck_val); + pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, buck_val); + } else { + pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, buck_val + 0x4); + pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, buck_val + 0x4); + } + + if (IS_ENABLED(CONFIG_IMX93_EVK_LPDDR4X)) { + /* Set VDDQ to 1.1V from buck2 */ + pmic_reg_write(dev, PCA9450_BUCK2OUT_DVS0, 0x28); } /* set standby voltage to 0.65v */ - pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x4); + if (val & PCA9450_REG_PWRCTRL_TOFF_DEB) + pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x0); + else + pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x4); /* I2C_LT_EN*/ pmic_reg_write(dev, 0xa, 0x3); @@ -123,9 +152,11 @@ void board_init_f(ulong dummy) debug("LC: 0x%x\n", gd->arch.lifecycle); } + clock_init_late(); + power_init_board(); - if (!IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE)) + if (!is_voltage_mode(VOLT_LOW_DRIVE)) set_arm_clk(get_cpu_speed_grade_hz()); /* Init power of mix */ diff --git a/board/freescale/m5253demo/flash.c b/board/freescale/m5253demo/flash.c index 334518a4bc9..ab5d2ebff64 100644 --- a/board/freescale/m5253demo/flash.c +++ b/board/freescale/m5253demo/flash.c @@ -72,7 +72,7 @@ int flash_get_offsets(ulong base, flash_info_t * info) } } - return ERR_OK; + return FL_ERR_OK; } void flash_print_info(flash_info_t * info) @@ -369,9 +369,9 @@ int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt) } if (cnt == 0) - return ERR_OK; + return FL_ERR_OK; - return ERR_OK; + return FL_ERR_OK; } /*----------------------------------------------------------------------- diff --git a/board/gardena/smart-gateway-at91sam/spl.c b/board/gardena/smart-gateway-at91sam/spl.c index fb3ec48f9c5..db9ba881884 100644 --- a/board/gardena/smart-gateway-at91sam/spl.c +++ b/board/gardena/smart-gateway-at91sam/spl.c @@ -110,7 +110,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; diff --git a/board/gardena/smart-gateway-mt7688/board.c b/board/gardena/smart-gateway-mt7688/board.c index c6b14bed41f..eb7fcd630a1 100644 --- a/board/gardena/smart-gateway-mt7688/board.c +++ b/board/gardena/smart-gateway-mt7688/board.c @@ -16,7 +16,7 @@ #include <linux/delay.h> #include <linux/stringify.h> #include <u-boot/crc.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/ctype.h> #include <linux/io.h> diff --git a/board/google/veyron/veyron.c b/board/google/veyron/veyron.c index bd8ce633772..674f19ba03c 100644 --- a/board/google/veyron/veyron.c +++ b/board/google/veyron/veyron.c @@ -57,10 +57,6 @@ static int veyron_init(void) if (ret) return log_msg_ret("s33", ret); - ret = regulators_enable_boot_on(false); - if (ret) - return log_msg_ret("boo", ret); - return 0; } #endif diff --git a/board/nuvoton/arbel_evb/arbel_evb.c b/board/nuvoton/arbel_evb/arbel_evb.c index 1f519219e7e..55e93a77f0f 100644 --- a/board/nuvoton/arbel_evb/arbel_evb.c +++ b/board/nuvoton/arbel_evb/arbel_evb.c @@ -59,17 +59,21 @@ int dram_init(void) int dram_init_banksize(void) { + phys_size_t ram_size = gd->ram_size; gd->bd->bi_dram[0].start = 0; - switch (gd->ram_size) { + #if defined(CONFIG_SYS_MEM_TOP_HIDE) + ram_size += CONFIG_SYS_MEM_TOP_HIDE; + #endif + switch (ram_size) { case DRAM_512MB_ECC_SIZE: case DRAM_512MB_SIZE: case DRAM_1GB_ECC_SIZE: case DRAM_1GB_SIZE: case DRAM_2GB_ECC_SIZE: case DRAM_2GB_SIZE: - gd->bd->bi_dram[0].size = gd->ram_size; + gd->bd->bi_dram[0].size = ram_size; gd->bd->bi_dram[1].start = 0; gd->bd->bi_dram[1].size = 0; break; diff --git a/board/phytec/phycore_imx93/spl.c b/board/phytec/phycore_imx93/spl.c index 5efa38a1442..17a8736c73f 100644 --- a/board/phytec/phycore_imx93/spl.c +++ b/board/phytec/phycore_imx93/spl.c @@ -130,7 +130,7 @@ void board_init_f(ulong dummy) debug("LC: 0x%x\n", gd->arch.lifecycle); } - clock_init(); + clock_init_late(); power_init_board(); diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index 56862bcb34d..68edd1ec282 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -88,10 +88,6 @@ int exynos_power_init(void) if (ret == -ENODEV) return 0; - ret = regulators_enable_boot_on(false); - if (ret) - return ret; - ret = exynos_set_regulator("vdd_mif", 1100000); if (ret) return ret; diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index 802596569c6..d97945e58fc 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -32,34 +32,18 @@ gd_t *gd; #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) -/* GUIDs for capsule updatable firmware images */ -#define SANDBOX_UBOOT_IMAGE_GUID \ - EFI_GUID(0x09d7cf52, 0x0720, 0x4710, 0x91, 0xd1, \ - 0x08, 0x46, 0x9b, 0x7f, 0xe9, 0xc8) - -#define SANDBOX_UBOOT_ENV_IMAGE_GUID \ - EFI_GUID(0x5a7021f5, 0xfef2, 0x48b4, 0xaa, 0xba, \ - 0x83, 0x2e, 0x77, 0x74, 0x18, 0xc0) - -#define SANDBOX_FIT_IMAGE_GUID \ - EFI_GUID(0x3673b45d, 0x6a7c, 0x46f3, 0x9e, 0x60, \ - 0xad, 0xab, 0xb0, 0x3f, 0x79, 0x37) - struct efi_fw_image fw_images[] = { #if defined(CONFIG_EFI_CAPSULE_FIRMWARE_RAW) { - .image_type_id = SANDBOX_UBOOT_IMAGE_GUID, .fw_name = u"SANDBOX-UBOOT", .image_index = 1, }, { - .image_type_id = SANDBOX_UBOOT_ENV_IMAGE_GUID, .fw_name = u"SANDBOX-UBOOT-ENV", .image_index = 2, }, #elif defined(CONFIG_EFI_CAPSULE_FIRMWARE_FIT) { - .image_type_id = SANDBOX_FIT_IMAGE_GUID, .fw_name = u"SANDBOX-FIT", .image_index = 1, }, diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c index 7d73d1f2b36..cd27fc1cc37 100644 --- a/board/siemens/corvus/board.c +++ b/board/siemens/corvus/board.c @@ -187,7 +187,7 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2) 2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET); } -void mem_init(void) +void at91_mem_init(void) { struct atmel_mpddrc_config ddr2; diff --git a/board/siemens/smartweb/smartweb.c b/board/siemens/smartweb/smartweb.c index 946fbc3f229..e9e4bc348cb 100644 --- a/board/siemens/smartweb/smartweb.c +++ b/board/siemens/smartweb/smartweb.c @@ -238,7 +238,7 @@ void at91_spl_board_init(void) | AT91_SDRAMC_TRP_VAL(2) | AT91_SDRAMC_TRCD_VAL(2) \ | AT91_SDRAMC_TRAS_VAL(5) | AT91_SDRAMC_TXSR_VAL(8)) -void mem_init(void) +void at91_mem_init(void) { struct at91_matrix *ma = (struct at91_matrix *)ATMEL_BASE_MATRIX; struct at91_port *port = (struct at91_port *)ATMEL_BASE_PIOC; diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index bda12a97708..3764ab48ab3 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -177,7 +177,7 @@ void sdramc_configure(unsigned int mask) sdramc_initialize(ATMEL_BASE_CS1, &setting); } -void mem_init(void) +void at91_mem_init(void) { unsigned int ram_size = 0; diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index 6e6e276cc74..5e5a45ee00d 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -15,7 +15,7 @@ #include <env.h> #include <init.h> #include <pci.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/global_data.h> #include <asm/processor.h> #include <asm/immap_85xx.h> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 97532a8156f..d5e5e776d2a 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -665,8 +665,6 @@ int board_init(void) if (board_is_stm32mp15x_dk2()) board_stm32mp15x_dk2_init(); - regulators_enable_boot_on(_DEBUG); - /* * sysconf initialisation done only when U-Boot is running in secure * done in TF-A for TFABOOT. diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c index b794b73b6bd..f55c6b5d34c 100644 --- a/board/starfive/visionfive2/spl.c +++ b/board/starfive/visionfive2/spl.c @@ -170,23 +170,32 @@ void spl_fdt_fixup_mars_cm(void *fdt) { const char *compat; const char *model; + int compat_size; spl_fdt_fixup_mars(fdt); if (!get_mmc_size_from_eeprom()) { int offset; + static const char + compat_cm_lite[] = "milkv,mars-cm-lite\0starfive,jh7110"; model = "Milk-V Mars CM Lite"; - compat = "milkv,mars-cm-lite\0starfive,jh7110"; + compat = compat_cm_lite; + compat_size = sizeof(compat_cm_lite); offset = fdt_path_offset(fdt, "/soc/pinctrl/mmc0-pins/mmc0-pins-rest"); /* GPIOMUX(22, GPOUT_SYS_SDIO0_RST, GPOEN_ENABLE, GPI_NONE) */ fdt_setprop_u32(fdt, offset, "pinmux", 0xff130016); } else { + static const char + compat_cm[] = "milkv,mars-cm\0starfive,jh7110"; + model = "Milk-V Mars CM"; - compat = "milkv,mars-cm\0starfive,jh7110"; + compat = compat_cm; + compat_size = sizeof(compat_cm); } - fdt_setprop(fdt, fdt_path_offset(fdt, "/"), "compatible", compat, sizeof(compat)); + fdt_setprop(fdt, fdt_path_offset(fdt, "/"), + "compatible", compat, compat_size); fdt_setprop_string(fdt, fdt_path_offset(fdt, "/"), "model", model); } diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 3440402ab46..5e5eb49ddf3 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -30,7 +30,7 @@ #include <soc.h> #include <linux/ctype.h> #include <linux/kernel.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include "fru.h" @@ -425,28 +425,25 @@ int board_late_init_xilinx(void) struct xilinx_board_description *desc; phys_size_t bootm_size = gd->ram_top - gd->ram_base; u64 bootscr_flash_offset, bootscr_flash_size; - - if (!IS_ENABLED(CONFIG_MICROBLAZE)) { - ulong scriptaddr; - u64 bootscr_address; - u64 bootscr_offset; - - /* Fetch bootscr_address/bootscr_offset from DT and update */ - if (!ofnode_read_bootscript_address(&bootscr_address, - &bootscr_offset)) { - if (bootscr_offset) - ret |= env_set_hex("scriptaddr", - gd->ram_base + - bootscr_offset); - else - ret |= env_set_hex("scriptaddr", - bootscr_address); - } else { - /* Update scriptaddr(bootscr offset) from env */ - scriptaddr = env_get_hex("scriptaddr", 0); + ulong scriptaddr; + u64 bootscr_address; + u64 bootscr_offset; + + /* Fetch bootscr_address/bootscr_offset from DT and update */ + if (!ofnode_read_bootscript_address(&bootscr_address, + &bootscr_offset)) { + if (bootscr_offset) ret |= env_set_hex("scriptaddr", - gd->ram_base + scriptaddr); - } + gd->ram_base + + bootscr_offset); + else + ret |= env_set_hex("scriptaddr", + bootscr_address); + } else { + /* Update scriptaddr(bootscr offset) from env */ + scriptaddr = env_get_hex("scriptaddr", 0); + ret |= env_set_hex("scriptaddr", + gd->ram_base + scriptaddr); } if (!ofnode_read_bootscript_flash(&bootscr_flash_offset, diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c index 1d67e3f3185..4d5913cff1d 100644 --- a/board/xilinx/versal-net/board.c +++ b/board/xilinx/versal-net/board.c @@ -12,6 +12,7 @@ #include <env_internal.h> #include <log.h> #include <malloc.h> +#include <spi.h> #include <time.h> #include <asm/cache.h> #include <asm/global_data.h> @@ -196,7 +197,6 @@ static u8 versal_net_get_bootmode(void) int spi_get_env_dev(void) { struct udevice *dev; - const char *mode = NULL; int bootseq = -1; switch (versal_net_get_bootmode()) { @@ -207,7 +207,6 @@ int spi_get_env_dev(void) debug("QSPI driver for QSPI device is not present\n"); break; } - mode = "xspi"; bootseq = dev_seq(dev); break; case QSPI_MODE_32BIT: @@ -217,7 +216,6 @@ int spi_get_env_dev(void) debug("QSPI driver for QSPI device is not present\n"); break; } - mode = "xspi"; bootseq = dev_seq(dev); break; case OSPI_MODE: @@ -227,7 +225,6 @@ int spi_get_env_dev(void) debug("OSPI driver for OSPI device is not present\n"); break; } - mode = "xspi"; bootseq = dev_seq(dev); break; default: diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index e6331c0e4d8..20a675c010d 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -72,6 +72,14 @@ int __maybe_unused psu_uboot_init(void) writel(ZYNQMP_PS_SYSMON_ANALOG_BUS_VAL, ZYNQMP_AMS_PS_SYSMON_ANALOG_BUS); + /* Disable secure access for boot devices */ + writel(0x04920492, ZYNQMP_IOU_SECURE_SLCR); + writel(0x00920492, ZYNQMP_IOU_SECURE_SLCR + 4); + + /* Enable CCI PMU events */ + writel(ZYNQMP_CCI_REG_CCI_MISC_CTRL_NIDEN, + ZYNQMP_CCI_REG_CCI_MISC_CTRL); + /* Delay is required for clocks to be propagated */ udelay(1000000); diff --git a/board/xilinx/zynqmp/zynqmp_kria.env b/board/xilinx/zynqmp/zynqmp_kria.env index 49ef3e7d753..d0e431ebb46 100644 --- a/board/xilinx/zynqmp/zynqmp_kria.env +++ b/board/xilinx/zynqmp/zynqmp_kria.env @@ -49,9 +49,19 @@ usb_boot_devices='usb0 usb1 usb2 usb3 usb4' som_cc_boot=if test ${card1_name} = SCK-KV-G; then setenv boot_targets mmc1 ${usb_boot_devices} pxe dhcp jtag && run distro_bootcmd; elif test ${card1_name} = SCK-KR-G; then setenv boot_targets ${usb_boot_devices} pxe dhcp jtag && run distro_bootcmd; else test ${card1_name} = SCK-KD-G; setenv boot_targets ${usb_boot_devices} pxe dhcp jtag && run distro_bootcmd; fi;" som_mmc_boot=setenv boot_targets mmc0 && run distro_bootcmd +# To disable bootmenu set enable_bootmenu=0 +enable_bootmenu=1 +check_cc_for_default_boot=if test ${card1_name} = SCK-KV-G || test ${card1_name} = SCK-KR-G || test ${card1_name} = SCK-KD-G; then setenv bootmenu_default 1; else setenv bootmenu_default 0; fi +som_bootmenu=if test ${enable_bootmenu} = 1; then run check_cc_for_default_boot; bootmenu; else run som_mmc_boot; fi + k26_starter=SMK-K26-XCL2G k24_starter=SMK-K24-XCL2G -bootcmd=setenv model $board_name && if setexpr model gsub .*$k24_starter* $k24_starter || setexpr model gsub .*$k26_starter* $k26_starter; then run som_cc_boot; else run som_mmc_boot; run som_cc_boot; fi +bootcmd=setenv model $board_name; setexpr model gsub ".*${k24_starter}.*" starter; setexpr model gsub ".*${k26_starter}.*" starter; if test ${model} = "starter"; then run som_cc_boot; else run som_bootmenu; fi + +# Boot menu +bootmenu_0=eMMC Boot=run som_mmc_boot +bootmenu_1=SD Boot=run som_cc_boot +bootmenu_delay=5 usb_hub_init=mw 1000 0056 && sleep 1 && i2c write 1000 2d aa 2 -s diff --git a/boot/Kconfig b/boot/Kconfig index 7ac34574079..925afe06a19 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1,5 +1,7 @@ menu "Boot options" +source "lib/efi_loader/Kconfig" + menu "Boot images" config ANDROID_BOOT_IMAGE diff --git a/boot/android_ab.c b/boot/android_ab.c index 143f373aae9..1196a189ed5 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -139,8 +139,13 @@ static int ab_control_store(struct blk_desc *dev_desc, { ulong abc_offset, abc_blocks, ret; - abc_offset = offset + - offsetof(struct bootloader_message_ab, slot_suffix) / + if (offset % part_info->blksz) { + log_err("ANDROID: offset not block aligned\n"); + return -EINVAL; + } + + abc_offset = (offset + + offsetof(struct bootloader_message_ab, slot_suffix)) / part_info->blksz; abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control), part_info->blksz); diff --git a/cmd/Kconfig b/cmd/Kconfig index 43f78a5aeb1..5ef3c8a8748 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1406,6 +1406,15 @@ config CMD_MMC_SWRITE Enable support for the "mmc swrite" command to write Android sparse images to eMMC. +config MMC_SPEED_MODE_SET + bool "set speed mode using mmc command" + help + Enable setting speed mode using mmc rescan and mmc dev commands. + The speed mode is provided as the last argument in these commands + and is indicated using the index from enum bus_mode in + include/mmc.h. A speed mode can be set only if it has already + been enabled in the device tree. + endif config CMD_CLONE @@ -1494,6 +1503,7 @@ config USE_ONENAND_BOARD_INIT config CMD_OSD bool "osd" + depends on OSD help Enable the 'osd' command which allows to query information from and write text data to a on-screen display (OSD) device; a virtual device @@ -2099,6 +2109,7 @@ config CMD_ETHSW config CMD_PXE bool "pxe" select PXE_UTILS + imply CMD_TFTPBOOT help Boot image via network using PXE protocol @@ -2971,16 +2982,6 @@ config CMD_UBIFS help UBIFS is a file system for flash devices which works on top of UBI. -config MMC_SPEED_MODE_SET - bool "set speed mode using mmc command" - depends on CMD_MMC - help - Enable setting speed mode using mmc rescan and mmc dev commands. - The speed mode is provided as the last argument in these commands - and is indicated using the index from enum bus_mode in - include/mmc.h. A speed mode can be set only if it has already - been enabled in the device tree. - config CMD_MESON bool "Amlogic Meson commands" depends on ARCH_MESON diff --git a/cmd/efi.c b/cmd/efi.c index 6bed2d743ba..687ccb52042 100644 --- a/cmd/efi.c +++ b/cmd/efi.c @@ -11,7 +11,7 @@ #include <log.h> #include <malloc.h> #include <sort.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/global_data.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/cmd/efi_common.c b/cmd/efi_common.c index c46764e6eea..d2f2b59e9e3 100644 --- a/cmd/efi_common.c +++ b/cmd/efi_common.c @@ -8,7 +8,7 @@ #include <efi.h> #include <efi_api.h> -#include <uuid.h> +#include <u-boot/uuid.h> void efi_show_tables(struct efi_system_table *systab) { diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 1a191eb9994..e040fe75fa1 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -665,7 +665,7 @@ enum efi_lo_dp_part { }; /** - * create_lo_dp() - create a special device path for our Boot### option + * create_lo_dp_part() - create a special device path for our Boot### option * * @dev: device * @part: disk partition @@ -1127,7 +1127,7 @@ static void show_efi_boot_opt(u16 *varname16) } /** - * show_efi_boot_dump() - dump all UEFI load options + * do_efi_boot_dump() - dump all UEFI load options * * @cmdtp: Command table * @flag: Command flag diff --git a/cmd/flash.c b/cmd/flash.c index de0e04f09cf..fd660ec477c 100644 --- a/cmd/flash.c +++ b/cmd/flash.c @@ -10,7 +10,7 @@ #include <command.h> #include <log.h> #include <vsprintf.h> -#include <uuid.h> +#include <u-boot/uuid.h> #if defined(CONFIG_CMD_MTDPARTS) #include <jffs2/jffs2.h> diff --git a/cmd/gpt.c b/cmd/gpt.c index 86b7701886a..27aea2df197 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -19,7 +19,7 @@ #include <part_efi.h> #include <part.h> #include <exports.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/ctype.h> #include <div64.h> #include <memalign.h> diff --git a/cmd/mem.c b/cmd/mem.c index 274348068c2..4d6fde28531 100644 --- a/cmd/mem.c +++ b/cmd/mem.c @@ -245,7 +245,7 @@ static int do_mem_cmp(struct cmd_tbl *cmdtp, int flag, int argc, int size; int rcode = 0; const char *type; - const void *buf1, *buf2, *base; + const void *buf1, *buf2, *base, *ptr1, *ptr2; ulong word1, word2; /* 64-bit if MEM_SUPPORT_64BIT_DATA */ if (argc != 4) @@ -270,22 +270,22 @@ static int do_mem_cmp(struct cmd_tbl *cmdtp, int flag, int argc, bytes = size * count; base = buf1 = map_sysmem(addr1, bytes); buf2 = map_sysmem(addr2, bytes); - for (ngood = 0; ngood < count; ++ngood) { + for (ngood = 0, ptr1 = buf1, ptr2 = buf2; ngood < count; ++ngood) { if (size == 4) { - word1 = *(u32 *)buf1; - word2 = *(u32 *)buf2; + word1 = *(u32 *)ptr1; + word2 = *(u32 *)ptr2; } else if (MEM_SUPPORT_64BIT_DATA && size == 8) { - word1 = *(ulong *)buf1; - word2 = *(ulong *)buf2; + word1 = *(ulong *)ptr1; + word2 = *(ulong *)ptr2; } else if (size == 2) { - word1 = *(u16 *)buf1; - word2 = *(u16 *)buf2; + word1 = *(u16 *)ptr1; + word2 = *(u16 *)ptr2; } else { - word1 = *(u8 *)buf1; - word2 = *(u8 *)buf2; + word1 = *(u8 *)ptr1; + word2 = *(u8 *)ptr2; } if (word1 != word2) { - ulong offset = buf1 - base; + ulong offset = ptr1 - base; printf("%s at 0x%08lx (%#0*lx) != %s at 0x%08lx (%#0*lx)\n", type, (ulong)(addr1 + offset), size, word1, type, (ulong)(addr2 + offset), size, word2); @@ -293,8 +293,8 @@ static int do_mem_cmp(struct cmd_tbl *cmdtp, int flag, int argc, break; } - buf1 += size; - buf2 += size; + ptr1 += size; + ptr2 += size; /* reset watchdog from time to time */ if ((ngood % (64 << 10)) == 0) diff --git a/cmd/mmc.c b/cmd/mmc.c index 9a841c25d3d..fe7899ec793 100644 --- a/cmd/mmc.c +++ b/cmd/mmc.c @@ -8,6 +8,7 @@ #include <command.h> #include <console.h> #include <display_options.h> +#include <mapmem.h> #include <memalign.h> #include <mmc.h> #include <part.h> @@ -350,12 +351,12 @@ static int do_mmc_read(struct cmd_tbl *cmdtp, int flag, { struct mmc *mmc; u32 blk, cnt, n; - void *addr; + void *ptr; if (argc != 4) return CMD_RET_USAGE; - addr = (void *)hextoul(argv[1], NULL); + ptr = map_sysmem(hextoul(argv[1], NULL), 0); blk = hextoul(argv[2], NULL); cnt = hextoul(argv[3], NULL); @@ -366,8 +367,9 @@ static int do_mmc_read(struct cmd_tbl *cmdtp, int flag, printf("MMC read: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); - n = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr); + n = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, ptr); printf("%d blocks read: %s\n", n, (n == cnt) ? "OK" : "ERROR"); + unmap_sysmem(ptr); return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE; } @@ -443,12 +445,12 @@ static int do_mmc_write(struct cmd_tbl *cmdtp, int flag, { struct mmc *mmc; u32 blk, cnt, n; - void *addr; + void *ptr; if (argc != 4) return CMD_RET_USAGE; - addr = (void *)hextoul(argv[1], NULL); + ptr = map_sysmem(hextoul(argv[1], NULL), 0); blk = hextoul(argv[2], NULL); cnt = hextoul(argv[3], NULL); @@ -463,8 +465,9 @@ static int do_mmc_write(struct cmd_tbl *cmdtp, int flag, printf("Error: card is write protected!\n"); return CMD_RET_FAILURE; } - n = blk_dwrite(mmc_get_blk_desc(mmc), blk, cnt, addr); + n = blk_dwrite(mmc_get_blk_desc(mmc), blk, cnt, ptr); printf("%d blocks written: %s\n", n, (n == cnt) ? "OK" : "ERROR"); + unmap_sysmem(ptr); return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE; } @@ -473,18 +476,26 @@ static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct mmc *mmc; + struct disk_partition info; u32 blk, cnt, n; - if (argc != 3) + if (argc < 2 || argc > 3) return CMD_RET_USAGE; - blk = hextoul(argv[1], NULL); - cnt = hextoul(argv[2], NULL); - mmc = init_mmc_device(curr_device, false); if (!mmc) return CMD_RET_FAILURE; + if (argc == 3) { + blk = hextoul(argv[1], NULL); + cnt = hextoul(argv[2], NULL); + } else if (part_get_info_by_name(mmc_get_blk_desc(mmc), argv[1], &info) >= 0) { + blk = info.start; + cnt = info.size; + } else { + return CMD_RET_FAILURE; + } + printf("MMC erase: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); @@ -1290,6 +1301,7 @@ U_BOOT_CMD( "mmc swrite addr blk#\n" #endif "mmc erase blk# cnt\n" + "mmc erase partname\n" "mmc rescan [mode]\n" "mmc part - lists available partition on current mmc device\n" "mmc dev [dev] [part] [mode] - show or set current mmc device [partition] and set mode\n" diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c index 64ae2ad2ce2..32b7d049074 100644 --- a/cmd/nvedit_efi.c +++ b/cmd/nvedit_efi.c @@ -15,7 +15,7 @@ #include <malloc.h> #include <mapmem.h> #include <rtc.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/kernel.h> /* diff --git a/cmd/read.c b/cmd/read.c index af54bd17654..8e21f004423 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -20,7 +20,7 @@ do_rw(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) struct disk_partition part_info; ulong offset, limit; uint blk, cnt, res; - void *addr; + void *ptr; int part; if (argc != 6) { @@ -33,7 +33,7 @@ do_rw(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (part < 0) return 1; - addr = map_sysmem(hextoul(argv[3], NULL), 0); + ptr = map_sysmem(hextoul(argv[3], NULL), 0); blk = hextoul(argv[4], NULL); cnt = hextoul(argv[5], NULL); @@ -48,13 +48,15 @@ do_rw(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (cnt + blk > limit) { printf("%s out of range\n", cmdtp->name); + unmap_sysmem(ptr); return 1; } if (IS_ENABLED(CONFIG_CMD_WRITE) && !strcmp(cmdtp->name, "write")) - res = blk_dwrite(dev_desc, offset + blk, cnt, addr); + res = blk_dwrite(dev_desc, offset + blk, cnt, ptr); else - res = blk_dread(dev_desc, offset + blk, cnt, addr); + res = blk_dread(dev_desc, offset + blk, cnt, ptr); + unmap_sysmem(ptr); if (res != cnt) { printf("%s error\n", cmdtp->name); diff --git a/cmd/riscv/exception.c b/cmd/riscv/exception.c index 2b58b1c449c..16e335327f1 100644 --- a/cmd/riscv/exception.c +++ b/cmd/riscv/exception.c @@ -36,6 +36,14 @@ static int do_ialign16(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } +static int do_rdcycle(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + printf("cycle = 0x%lx\n", csr_read(CSR_CYCLE)); + + return CMD_RET_SUCCESS; +} + static int do_unaligned(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -62,6 +70,8 @@ static struct cmd_tbl cmd_sub[] = { "", ""), U_BOOT_CMD_MKENT(ialign16, CONFIG_SYS_MAXARGS, 1, do_ialign16, "", ""), + U_BOOT_CMD_MKENT(rdcycle, CONFIG_SYS_MAXARGS, 1, do_rdcycle, + "", ""), U_BOOT_CMD_MKENT(unaligned, CONFIG_SYS_MAXARGS, 1, do_unaligned, "", ""), U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined, @@ -74,7 +84,8 @@ U_BOOT_LONGHELP(exception, " compressed - compressed instruction\n" " ebreak - breakpoint\n" " ialign16 - 16 bit aligned instruction\n" - " undefined - illegal instruction\n" - " unaligned - load address misaligned\n"); + " rdcycle - read cycle CSR\n" + " unaligned - load address misaligned\n" + " undefined - illegal instruction\n"); #include <exception.h> @@ -10,6 +10,7 @@ #include <div64.h> #include <dm.h> #include <log.h> +#include <lmb.h> #include <malloc.h> #include <mapmem.h> #include <spi.h> @@ -317,6 +318,13 @@ static int do_spi_flash_read_write(int argc, char *const argv[]) strncmp(argv[0], "write", 5) == 0) { int read; + if (CONFIG_IS_ENABLED(LMB)) { + if (lmb_read_check(addr, len)) { + printf("ERROR: trying to overwrite reserved memory...\n"); + return CMD_RET_FAILURE; + } + } + read = strncmp(argv[0], "read", 4) == 0; if (read) ret = spi_flash_read(flash, offset, len, buf); diff --git a/cmd/usb.c b/cmd/usb.c index 16c081bf128..13a2996c1f0 100644 --- a/cmd/usb.c +++ b/cmd/usb.c @@ -560,17 +560,6 @@ static int do_usbboot(struct cmd_tbl *cmdtp, int flag, int argc, } #endif /* CONFIG_USB_STORAGE */ -static int do_usb_stop_keyboard(int force) -{ -#if !defined CONFIG_DM_USB && defined CONFIG_USB_KEYBOARD - if (usb_kbd_deregister(force) != 0) { - printf("USB not stopped: usbkbd still using USB\n"); - return 1; - } -#endif - return 0; -} - static void do_usb_start(void) { bootstage_mark_name(BOOTSTAGE_ID_USB_START, "usb_start"); @@ -583,11 +572,6 @@ static void do_usb_start(void) /* try to recognize storage devices immediately */ usb_stor_curr_dev = usb_stor_scan(1); # endif -#ifndef CONFIG_DM_USB -# ifdef CONFIG_USB_KEYBOARD - drv_usb_kbd_init(); -# endif -#endif /* !CONFIG_DM_USB */ } #ifdef CONFIG_DM_USB @@ -633,8 +617,6 @@ static int do_usb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (strncmp(argv[1], "reset", 5) == 0) { printf("resetting USB...\n"); - if (do_usb_stop_keyboard(1) != 0) - return 1; usb_stop(); do_usb_start(); return 0; @@ -642,8 +624,6 @@ static int do_usb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (strncmp(argv[1], "stop", 4) == 0) { if (argc != 2) console_assign(stdin, "serial"); - if (do_usb_stop_keyboard(0) != 0) - return 1; printf("stopping USB..\n"); usb_stop(); return 0; diff --git a/cmd/x86/hob.c b/cmd/x86/hob.c index 2dd30808bd1..d3713cef331 100644 --- a/cmd/x86/hob.c +++ b/cmd/x86/hob.c @@ -5,7 +5,7 @@ #include <command.h> #include <efi.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/global_data.h> #include <asm/hob.h> #include <asm/fsp/fsp_hob.h> diff --git a/common/Kconfig b/common/Kconfig index 83c81edac20..957de0c5c02 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -934,6 +934,7 @@ menu "Update support" config UPDATE_COMMON bool select DFU_WRITE_ALT + imply CMD_TFTPBOOT config UPDATE_TFTP bool "Auto-update using fitImage via TFTP" @@ -986,7 +987,8 @@ config ANDROID_AB_BACKUP_OFFSET help If non-zero, a backup bootloader message starting at this offset in the partition will tried in the event that the primary one (starting - at offset 0) fails its checksum. + at offset 0) fails its checksum. The offset is in bytes and must be + multiple of the block size. endmenu diff --git a/common/cli_hush_modern.c b/common/cli_hush_modern.c index cd88c9de8ab..deb61c3389d 100644 --- a/common/cli_hush_modern.c +++ b/common/cli_hush_modern.c @@ -25,7 +25,7 @@ /* * BusyBox Version: UPDATE THIS WHEN PULLING NEW UPSTREAM REVISION! */ -#define BB_VER "1.35.0.git7d1c7d833785" +#define BB_VER "1.37.0.git23da5c4b716b" /* * Define hush features by the names used upstream. diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index 7874b399d14..ab5aa5f9b36 100644 --- a/common/cli_hush_upstream.c +++ b/common/cli_hush_upstream.c @@ -1651,12 +1651,22 @@ static int dup_CLOEXEC(int fd, int avoid_fd) newfd = fcntl(fd, F_DUPFD_CLOEXEC, avoid_fd + 1); if (newfd >= 0) { if (F_DUPFD_CLOEXEC == F_DUPFD) /* if old libc (w/o F_DUPFD_CLOEXEC) */ - fcntl(newfd, F_SETFD, FD_CLOEXEC); + close_on_exec_on(newfd); } else { /* newfd < 0 */ if (errno == EBUSY) goto repeat; if (errno == EINTR) goto repeat; + if (errno != EBADF) { + /* "echo >&9999" gets EINVAL trying to save fd 1 to above 9999. + * We could try saving it _below_ 9999 instead (how?), but + * this probably means that dup2(9999,1) to effectuate >&9999 + * would also not work: fd 9999 can't exist. + * (This differs from "echo >&99" where saving works, but + * subsequent dup2(99,1) fails if fd 99 is not open). + */ + bb_perror_msg("fcntl(%d,F_DUPFD,%d)", fd, avoid_fd + 1); + } } return newfd; } @@ -1677,7 +1687,7 @@ static int xdup_CLOEXEC_and_close(int fd, int avoid_fd) xfunc_die(); } if (F_DUPFD_CLOEXEC == F_DUPFD) /* if old libc (w/o F_DUPFD_CLOEXEC) */ - fcntl(newfd, F_SETFD, FD_CLOEXEC); + close_on_exec_on(newfd); close(fd); return newfd; } @@ -5851,6 +5861,15 @@ static struct pipe *parse_stream(char **pstring, } o_free_and_set_NULL(&ctx.word); done_pipe(&ctx, PIPE_SEQ); + + /* Do we sit inside of any if's, loops or case's? */ + if (HAS_KEYWORDS + IF_HAS_KEYWORDS(&& (ctx.ctx_res_w != RES_NONE || ctx.old_flag != 0)) + ) { + syntax_error_unterm_str("compound statement"); + goto parse_error_exitcode1; + } + pi = ctx.list_head; /* If we got nothing... */ /* (this makes bare "&" cmd a no-op. @@ -5873,7 +5892,7 @@ static struct pipe *parse_stream(char **pstring, // *heredoc_cnt_ptr = heredoc_cnt; debug_leave(); debug_printf_heredoc("parse_stream return heredoc_cnt:%d\n", heredoc_cnt); - debug_printf_parse("parse_stream return %p\n", pi); + debug_printf_parse("parse_stream return %p: EOF\n", pi); return pi; } @@ -8384,10 +8403,16 @@ static struct squirrel *add_squirrel(struct squirrel *sq, int fd, int avoid_fd) if (sq) for (; sq[i].orig_fd >= 0; i++) { /* If we collide with an already moved fd... */ if (fd == sq[i].moved_to) { - sq[i].moved_to = dup_CLOEXEC(sq[i].moved_to, avoid_fd); - debug_printf_redir("redirect_fd %d: already busy, moving to %d\n", fd, sq[i].moved_to); - if (sq[i].moved_to < 0) /* what? */ - xfunc_die(); + moved_to = dup_CLOEXEC(sq[i].moved_to, avoid_fd); + debug_printf_redir("redirect_fd %d: already busy, moving to %d\n", fd, moved_to); + if (moved_to < 0) { + /* "echo 2>/dev/tty 10>&9999" testcase: + * We move fd 2 to 10, then discover we need to move fd 10 + * (and not hit 9999) and the latter fails. + */ + return NULL; /* fcntl failed */ + } + sq[i].moved_to = moved_to; return sq; } if (fd == sq[i].orig_fd) { @@ -8401,7 +8426,7 @@ static struct squirrel *add_squirrel(struct squirrel *sq, int fd, int avoid_fd) moved_to = dup_CLOEXEC(fd, avoid_fd); debug_printf_redir("redirect_fd %d: previous fd is moved to %d (-1 if it was closed)\n", fd, moved_to); if (moved_to < 0 && errno != EBADF) - xfunc_die(); + return NULL; /* fcntl failed (not because fd is closed) */ return append_squirrel(sq, i, fd, moved_to); } @@ -8434,6 +8459,8 @@ static struct squirrel *add_squirrel_closed(struct squirrel *sq, int fd) */ static int save_fd_on_redirect(int fd, int avoid_fd, struct squirrel **sqp) { + struct squirrel *new_squirrel; + if (avoid_fd < 9) /* the important case here is that it can be -1 */ avoid_fd = 9; @@ -8497,7 +8524,10 @@ static int save_fd_on_redirect(int fd, int avoid_fd, struct squirrel **sqp) } /* Check whether it collides with any open fds (e.g. stdio), save fds as needed */ - *sqp = add_squirrel(*sqp, fd, avoid_fd); + new_squirrel = add_squirrel(*sqp, fd, avoid_fd); + if (!new_squirrel) + return -1; /* redirect error */ + *sqp = new_squirrel; return 0; /* "we did not close fd" */ } @@ -8568,8 +8598,11 @@ static int internally_opened_fd(int fd, struct squirrel *sq) return 0; } -/* squirrel != NULL means we squirrel away copies of stdin, stdout, - * and stderr if they are redirected. */ +/* sqp != NULL means we squirrel away copies of stdin, stdout, + * and stderr if they are redirected. + * If redirection fails, return 1. This will make caller + * skip command execution and restore already created redirect fds. + */ static int setup_redirects(struct command *prog, struct squirrel **sqp) { struct redir_struct *redir; @@ -8580,7 +8613,8 @@ static int setup_redirects(struct command *prog, struct squirrel **sqp) if (redir->rd_type == REDIRECT_HEREDOC2) { /* "rd_fd<<HERE" case */ - save_fd_on_redirect(redir->rd_fd, /*avoid:*/ 0, sqp); + if (save_fd_on_redirect(redir->rd_fd, /*avoid:*/ 0, sqp) < 0) + return 1; /* for REDIRECT_HEREDOC2, rd_filename holds _contents_ * of the heredoc */ debug_printf_redir("set heredoc '%s'\n", @@ -8600,7 +8634,7 @@ static int setup_redirects(struct command *prog, struct squirrel **sqp) * "cmd > <file" (2nd redirect starts too early) */ syntax_error("invalid redirect"); - continue; + return 1; } mode = redir_table[redir->rd_type].mode; p = expand_string_to_string(redir->rd_filename, @@ -8615,7 +8649,9 @@ static int setup_redirects(struct command *prog, struct squirrel **sqp) */ return 1; } - if (newfd == redir->rd_fd && sqp) { + if (newfd == redir->rd_fd && sqp + && sqp != ERR_PTR /* not a redirect in "exec" */ + ) { /* open() gave us precisely the fd we wanted. * This means that this fd was not busy * (not opened to anywhere). @@ -8637,6 +8673,8 @@ static int setup_redirects(struct command *prog, struct squirrel **sqp) /* if "N>&-": close redir->rd_fd (newfd is REDIRFD_CLOSE) */ closed = save_fd_on_redirect(redir->rd_fd, /*avoid:*/ newfd, sqp); + if (closed < 0) + return 1; /* error */ if (newfd == REDIRFD_CLOSE) { /* "N>&-" means "close me" */ if (!closed) { @@ -8650,13 +8688,16 @@ static int setup_redirects(struct command *prog, struct squirrel **sqp) * and second redirect closes 3! Restore code then closes 3 again. */ } else { - /* if newfd is a script fd or saved fd, simulate EBADF */ + /* if newfd is a script fd or saved fd, do not allow to use it */ if (internally_opened_fd(newfd, sqp && sqp != ERR_PTR ? *sqp : NULL)) { - //errno = EBADF; - //bb_perror_msg_and_die("can't duplicate file descriptor"); - newfd = -1; /* same effect as code above */ + bb_error_msg("fd#%d is not open", newfd); + return 1; + } + if (dup2(newfd, redir->rd_fd) < 0) { + /* "echo >&99" testcase */ + bb_perror_msg("dup2(%d,%d)", newfd, redir->rd_fd); + return 1; } - xdup2(newfd, redir->rd_fd); if (redir->rd_dup == REDIRFD_TO_FILE) /* "rd_fd > FILE" */ close(newfd); @@ -9731,6 +9772,7 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe) return rcode; } #endif +#endif /* !__U_BOOT__ */ /* Start all the jobs, but don't wait for anything to finish. * See checkjobs(). @@ -9758,6 +9800,38 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe) * backgrounded: cmd & { list } & * subshell: ( list ) [&] */ +static void set_G_ifs(void) +{ + /* Testcase: set -- q w e; (IFS='' echo "$*"; IFS=''; echo "$*"); echo "$*" + * Result should be 3 lines: q w e, qwe, q w e + */ + if (G.ifs_whitespace != G.ifs) + free(G.ifs_whitespace); + G.ifs = get_local_var_value("IFS"); + if (G.ifs) { + char *p; + G.ifs_whitespace = (char*)G.ifs; + p = skip_whitespace(G.ifs); + if (*p) { + /* Not all $IFS is whitespace */ + char *d; + int len = p - G.ifs; + p = skip_non_whitespace(p); + G.ifs_whitespace = xmalloc(len + strlen(p) + 1); /* can overestimate */ + d = mempcpy(G.ifs_whitespace, G.ifs, len); + while (*p) { + if (isspace(*p)) + *d++ = *p; + p++; + } + *d = '\0'; + } + } else { + G.ifs = defifs; + G.ifs_whitespace = (char*)G.ifs; + } +} +#ifndef __U_BOOT__ #if !ENABLE_HUSH_MODE_X #define redirect_and_varexp_helper(command, sqp, argv_expanded) \ redirect_and_varexp_helper(command, sqp) @@ -9810,34 +9884,7 @@ static NOINLINE int run_pipe(struct pipe *pi) debug_printf_exec("run_pipe start: members:%d\n", pi->num_cmds); debug_enter(); - /* Testcase: set -- q w e; (IFS='' echo "$*"; IFS=''; echo "$*"); echo "$*" - * Result should be 3 lines: q w e, qwe, q w e - */ - if (G.ifs_whitespace != G.ifs) - free(G.ifs_whitespace); - G.ifs = get_local_var_value("IFS"); - if (G.ifs) { - char *p; - G.ifs_whitespace = (char*)G.ifs; - p = skip_whitespace(G.ifs); - if (*p) { - /* Not all $IFS is whitespace */ - char *d; - int len = p - G.ifs; - p = skip_non_whitespace(p); - G.ifs_whitespace = xmalloc(len + strlen(p) + 1); /* can overestimate */ - d = mempcpy(G.ifs_whitespace, G.ifs, len); - while (*p) { - if (isspace(*p)) - *d++ = *p; - p++; - } - *d = '\0'; - } - } else { - G.ifs = defifs; - G.ifs_whitespace = (char*)G.ifs; - } + set_G_ifs(); #ifndef __U_BOOT__ IF_HUSH_JOB(pi->pgrp = -1;) @@ -10362,6 +10409,8 @@ static int run_list(struct pipe *pi) debug_enter(); #endif /* !__U_BOOT__ */ + set_G_ifs(); + #if ENABLE_HUSH_LOOPS /* Check syntax for "for" */ { @@ -11377,7 +11426,7 @@ int hush_main(int argc, char **argv) G_interactive_fd = dup_CLOEXEC(STDIN_FILENO, 254); if (G_interactive_fd < 0) { /* try to dup to any fd */ - G_interactive_fd = dup(STDIN_FILENO); + G_interactive_fd = dup_CLOEXEC(STDIN_FILENO, -1); if (G_interactive_fd < 0) { /* give up */ G_interactive_fd = 0; @@ -11387,8 +11436,6 @@ int hush_main(int argc, char **argv) } debug_printf("interactive_fd:%d\n", G_interactive_fd); if (G_interactive_fd) { - close_on_exec_on(G_interactive_fd); - if (G_saved_tty_pgrp) { /* If we were run as 'hush &', sleep until we are * in the foreground (tty pgrp == our pgrp). @@ -11463,9 +11510,6 @@ int hush_main(int argc, char **argv) G_interactive_fd = 0; } } - if (G_interactive_fd) { - close_on_exec_on(G_interactive_fd); - } install_special_sighandlers(); #else /* We have interactiveness code disabled */ diff --git a/common/console.c b/common/console.c index 52d6df8150f..c9e206aec41 100644 --- a/common/console.c +++ b/common/console.c @@ -4,6 +4,8 @@ * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it */ +#define LOG_CATEGORY LOGC_CONSOLE + #include <console.h> #include <debug_uart.h> #include <display_options.h> @@ -1242,3 +1244,37 @@ int console_init_r(void) } #endif /* CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */ + +int console_remove_by_name(const char *name) +{ + int err = 0; + +#if CONFIG_IS_ENABLED(CONSOLE_MUX) + int fnum; + + log_debug("removing console device %s\n", name); + for (fnum = 0; fnum < MAX_FILES; fnum++) { + struct stdio_dev **src, **dest; + int i; + + log_debug("file %d: %d devices: ", fnum, cd_count[fnum]); + src = console_devices[fnum]; + dest = src; + for (i = 0; i < cd_count[fnum]; i++, src++) { + struct stdio_dev *sdev = *src; + int ret = 0; + + if (!strcmp(sdev->name, name)) + ret = stdio_deregister_dev(sdev, true); + else + *dest++ = *src; + if (ret && !err) + err = ret; + } + cd_count[fnum] = dest - console_devices[fnum]; + log_debug("now %d\n", cd_count[fnum]); + } +#endif /* CONSOLE_MUX */ + + return err; +} diff --git a/common/flash.c b/common/flash.c index 24ddc8bee72..fd1b4ddf660 100644 --- a/common/flash.c +++ b/common/flash.c @@ -8,7 +8,7 @@ #include <flash.h> #include <log.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/string.h> #include <mtd/cfi_flash.h> @@ -110,13 +110,13 @@ addr2info(ulong addr) * Make sure all target addresses are within Flash bounds, * and no protected sectors are hit. * Returns: - * ERR_OK 0 - OK - * ERR_TIMEOUT 1 - write timeout - * ERR_NOT_ERASED 2 - Flash not erased - * ERR_PROTECTED 4 - target range includes protected sectors - * ERR_INVAL 8 - target address not in Flash memory - * ERR_ALIGN 16 - target address not aligned on boundary - * (only some targets require alignment) + * FL_ERR_OK 0 - OK + * FL_ERR_TIMEOUT 1 - write timeout + * FL_ERR_NOT_ERASED 2 - Flash not erased + * FL_ERR_PROTECTED 4 - target range includes protected sectors + * FL_ERR_INVAL 8 - target address not in Flash memory + * FL_ERR_ALIGN 16 - target address not aligned on boundary + * (only some targets require alignment) */ int flash_write(char *src, ulong addr, ulong cnt) @@ -131,11 +131,11 @@ flash_write(char *src, ulong addr, ulong cnt) __maybe_unused ulong cnt_orig = cnt; if (cnt == 0) { - return (ERR_OK); + return (FL_ERR_OK); } if (!info_first || !info_last) { - return (ERR_INVAL); + return (FL_ERR_INVAL); } for (info = info_first; info <= info_last; ++info) { @@ -146,7 +146,7 @@ flash_write(char *src, ulong addr, ulong cnt) if ((end >= info->start[i]) && (addr < e_addr) && (info->protect[i] != 0) ) { - return (ERR_PROTECTED); + return (FL_ERR_PROTECTED); } } } @@ -169,11 +169,11 @@ flash_write(char *src, ulong addr, ulong cnt) #if defined(CONFIG_FLASH_VERIFY) if (memcmp(src_orig, addr_orig, cnt_orig)) { printf("\nVerify failed!\n"); - return ERR_PROG_ERROR; + return FL_ERR_PROG_ERROR; } #endif /* CONFIG_SYS_FLASH_VERIFY_AFTER_WRITE */ - return (ERR_OK); + return (FL_ERR_OK); } /*----------------------------------------------------------------------- @@ -182,33 +182,33 @@ flash_write(char *src, ulong addr, ulong cnt) void flash_perror(int err) { switch (err) { - case ERR_OK: + case FL_ERR_OK: break; - case ERR_TIMEOUT: + case FL_ERR_TIMEOUT: puts ("Timeout writing to Flash\n"); break; - case ERR_NOT_ERASED: + case FL_ERR_NOT_ERASED: puts ("Flash not Erased\n"); break; - case ERR_PROTECTED: + case FL_ERR_PROTECTED: puts ("Can't write to protected Flash sectors\n"); break; - case ERR_INVAL: + case FL_ERR_INVAL: puts ("Outside available Flash\n"); break; - case ERR_ALIGN: + case FL_ERR_ALIGN: puts ("Start and/or end address not on sector boundary\n"); break; - case ERR_UNKNOWN_FLASH_VENDOR: + case FL_ERR_UNKNOWN_FLASH_VENDOR: puts ("Unknown Vendor of Flash\n"); break; - case ERR_UNKNOWN_FLASH_TYPE: + case FL_ERR_UNKNOWN_FLASH_TYPE: puts ("Unknown Type of Flash\n"); break; - case ERR_PROG_ERROR: + case FL_ERR_PROG_ERROR: puts ("General Flash Programming Error\n"); break; - case ERR_ABORTED: + case FL_ERR_ABORTED: puts("Flash Programming Aborted\n"); break; default: diff --git a/common/log.c b/common/log.c index dfee250b158..b83a6618900 100644 --- a/common/log.c +++ b/common/log.c @@ -31,6 +31,7 @@ static const char *const log_cat_name[] = { "event", "fs", "expo", + "console", }; _Static_assert(ARRAY_SIZE(log_cat_name) == LOGC_COUNT - LOGC_NONE, diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 3c44e329d62..137f94a1681 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1248,15 +1248,11 @@ config SPL_POWER_DOMAIN the drivers in drivers/power/domain as part of a SPL build. config SPL_RAM_SUPPORT - bool "Support booting from RAM" - default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ - help - Enable booting of an image in RAM. The image can be preloaded or - it can be loaded by SPL directly into RAM (e.g. using USB). + bool config SPL_RAM_DEVICE bool "Support booting from preloaded image in RAM" - depends on SPL_RAM_SUPPORT + select SPL_RAM_SUPPORT default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ help Enable booting of an image already loaded in RAM. The image has to diff --git a/common/usb_kbd.c b/common/usb_kbd.c index f3b4a3c94e6..bbfee23bc26 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -137,6 +137,11 @@ extern int __maybe_unused net_busy_flag; /* The period of time between two calls of usb_kbd_testc(). */ static unsigned long kbd_testc_tms; +int usb_kbd_remove_for_test(void) +{ + return console_remove_by_name(DEVNAME); +} + /* Puts character in the queue and sets up the in and out pointer. */ static void usb_kbd_put_queue(struct usb_kbd_pdata *data, u8 c) { @@ -612,7 +617,7 @@ static int probe_usb_keyboard(struct usb_device *dev) debug("USB KBD: register.\n"); memset(&usb_kbd_dev, 0, sizeof(struct stdio_dev)); strcpy(usb_kbd_dev.name, DEVNAME); - usb_kbd_dev.flags = DEV_FLAGS_INPUT; + usb_kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_DM; usb_kbd_dev.getc = usb_kbd_getc; usb_kbd_dev.tstc = usb_kbd_testc; usb_kbd_dev.priv = (void *)dev; @@ -643,71 +648,6 @@ static int probe_usb_keyboard(struct usb_device *dev) return 0; } -#if !CONFIG_IS_ENABLED(DM_USB) -/* Search for keyboard and register it if found. */ -int drv_usb_kbd_init(void) -{ - int error, i; - - debug("%s: Probing for keyboard\n", __func__); - /* Scan all USB Devices */ - for (i = 0; i < USB_MAX_DEVICE; i++) { - struct usb_device *dev; - - /* Get USB device. */ - dev = usb_get_dev_index(i); - if (!dev) - break; - - if (dev->devnum == -1) - continue; - - error = probe_usb_keyboard(dev); - if (!error) - return 1; - if (error && error != -ENOENT) - return error; - } - - /* No USB Keyboard found */ - return -1; -} - -/* Deregister the keyboard. */ -int usb_kbd_deregister(int force) -{ -#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) - struct stdio_dev *dev; - struct usb_device *usb_kbd_dev; - struct usb_kbd_pdata *data; - - dev = stdio_get_by_name(DEVNAME); - if (dev) { - usb_kbd_dev = (struct usb_device *)dev->priv; - data = usb_kbd_dev->privptr; -#if CONFIG_IS_ENABLED(CONSOLE_MUX) - if (iomux_replace_device(stdin, DEVNAME, force ? "nulldev" : "")) - return 1; -#endif - if (stdio_deregister_dev(dev, force) != 0) - return 1; -#ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE - destroy_int_queue(usb_kbd_dev, data->intq); -#endif - free(data->new); - free(data); - } - - return 0; -#else - return 1; -#endif -} - -#endif - -#if CONFIG_IS_ENABLED(DM_USB) - static int usb_kbd_probe(struct udevice *dev) { struct usb_device *udev = dev_get_parent_priv(dev); @@ -788,5 +728,3 @@ static const struct usb_device_id kbd_id_table[] = { }; U_BOOT_USB_DEVICE(usb_kbd, kbd_id_table); - -#endif diff --git a/configs/amd_versal2_virt_defconfig b/configs/amd_versal2_virt_defconfig index c4bf77186cd..78f6ffcc3a7 100644 --- a/configs/amd_versal2_virt_defconfig +++ b/configs/amd_versal2_virt_defconfig @@ -72,6 +72,7 @@ CONFIG_NETCONSOLE=y CONFIG_IP_DEFRAG=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_TFTP_BLOCKSIZE=4096 +CONFIG_SIMPLE_PM_BUS=y CONFIG_CLK_CCF=y CONFIG_CLK_SCMI=y CONFIG_DFU_RAM=y diff --git a/configs/arbel_evb_defconfig b/configs/arbel_evb_defconfig index 08753aebc00..9983d3a58b2 100644 --- a/configs/arbel_evb_defconfig +++ b/configs/arbel_evb_defconfig @@ -7,7 +7,7 @@ CONFIG_NR_DRAM_BANKS=2 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x06208000 CONFIG_ENV_SIZE=0x40000 -CONFIG_ENV_OFFSET=0x3C0000 +CONFIG_ENV_OFFSET=0x7C0000 CONFIG_ENV_SECT_SIZE=0x1000 CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="nuvoton-npcm845-evb" @@ -17,7 +17,7 @@ CONFIG_ARCH_NPCM8XX=y CONFIG_SYS_SKIP_UART_INIT=y CONFIG_TARGET_ARBEL_EVB=y CONFIG_SYS_LOAD_ADDR=0x06208000 -CONFIG_ENV_ADDR=0x803C0000 +CONFIG_ENV_ADDR=0x807C0000 CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SYS_BOOTM_LEN=0x1400000 diff --git a/configs/ibex-ast2700_defconfig b/configs/ibex-ast2700_defconfig new file mode 100644 index 00000000000..855615cc1ea --- /dev/null +++ b/configs/ibex-ast2700_defconfig @@ -0,0 +1,94 @@ +CONFIG_RISCV=y +CONFIG_SYS_DCACHE_OFF=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMMOVE is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set +CONFIG_TEXT_BASE=0x80000000 +CONFIG_SYS_MALLOC_LEN=0xf00 +CONFIG_SYS_MALLOC_F_LEN=0xf00 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x14bd7800 +CONFIG_ENV_SIZE=0x20000 +CONFIG_DEFAULT_DEVICE_TREE="ast2700-ibex" +CONFIG_SPL_TEXT_BASE=0x14bc0080 +CONFIG_DM_RESET=y +CONFIG_SPL_BSS_START_ADDR=0x14bd7800 +CONFIG_SPL_BSS_MAX_SIZE=0x800 +CONFIG_SPL_SIZE_LIMIT=0x16000 +CONFIG_SPL=y +CONFIG_SYS_MEM_TOP_HIDE=0x10000000 +CONFIG_SYS_LOAD_ADDR=0x83000000 +CONFIG_BUILD_TARGET="" +CONFIG_TARGET_ASPEED_AST2700_IBEX=y +# CONFIG_RISCV_ISA_F is not set +# CONFIG_RISCV_ISA_A is not set +# CONFIG_SPL_SMP is not set +CONFIG_XIP=y +CONFIG_SPL_XIP=y +# CONFIG_AVAILABLE_HARTS is not set +CONFIG_STACK_SIZE_SHIFT=11 +CONFIG_ENV_VARS_UBOOT_CONFIG=y +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_STACK_SIZE=0x100000 +CONFIG_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_SPL_LOAD_FIT_ADDRESS=0x200c0000 +# CONFIG_BOOTSTD is not set +CONFIG_SYS_BOOTM_LEN=0x4000000 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set +CONFIG_SYS_CBSIZE=256 +CONFIG_SYS_PBSIZE=276 +# CONFIG_CONSOLE_FLUSH_SUPPORT is not set +# CONFIG_CONSOLE_MUX is not set +CONFIG_SYS_STDIO_DEREGISTER=y +CONFIG_BOARD_LATE_INIT=y +CONFIG_SPL_MAX_SIZE=0x16000 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set +CONFIG_SPL_RAM_SUPPORT=y +CONFIG_SPL_RAM_DEVICE=y +# CONFIG_CMD_BOOTD is not set +# CONFIG_CMD_BOOTI is not set +# CONFIG_BOOTM_LINUX is not set +# CONFIG_BOOTM_NETBSD is not set +# CONFIG_BOOTM_PLAN9 is not set +# CONFIG_BOOTM_RTEMS is not set +# CONFIG_BOOTM_VXWORKS is not set +# CONFIG_CMD_ELF is not set +# CONFIG_CMD_FDT is not set +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_SAVEENV is not set +# CONFIG_CMD_CRC32 is not set +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_SYSBOOT=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_DEVICE_TREE_INCLUDES="ast2700-u-boot.dtsi" +# CONFIG_OF_TAG_MIGRATE is not set +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +# CONFIG_NET is not set +CONFIG_SYS_RX_ETH_BUFFER=2 +# CONFIG_DM_DEVICE_REMOVE is not set +# CONFIG_DM_SEQ_ALIAS is not set +# CONFIG_BLOCK_CACHE is not set +# CONFIG_CPU is not set +# CONFIG_GPIO is not set +# CONFIG_I2C is not set +CONFIG_MMC=y +CONFIG_SUPPORT_EMMC_BOOT=y +CONFIG_MMC_SDHCI=y +# CONFIG_MTD is not set +# CONFIG_POWER is not set +CONFIG_RAM=y +CONFIG_SPL_RAM=y +CONFIG_ASPEED_RAM=y +# CONFIG_RAM_SIFIVE is not set +CONFIG_SYS_NS16550=y +CONFIG_SYS_NS16550_MEM32=y +CONFIG_AST_IBEX_TIMER=y +CONFIG_VIDEO=y +# CONFIG_VIDEO_LOGO is not set +# CONFIG_RSA is not set +# CONFIG_EFI_LOADER is not set diff --git a/configs/imx93_11x11_evk_ld_defconfig b/configs/imx93_11x11_evk_ld_defconfig deleted file mode 100644 index fd33fd54762..00000000000 --- a/configs/imx93_11x11_evk_ld_defconfig +++ /dev/null @@ -1,127 +0,0 @@ -CONFIG_ARM=y -CONFIG_ARCH_IMX9=y -CONFIG_TEXT_BASE=0x80200000 -CONFIG_SYS_MALLOC_LEN=0x2000000 -CONFIG_SYS_MALLOC_F_LEN=0x18000 -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_NR_DRAM_BANKS=2 -CONFIG_ENV_SIZE=0x4000 -CONFIG_ENV_OFFSET=0x400000 -CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg" -CONFIG_DM_GPIO=y -CONFIG_DEFAULT_DEVICE_TREE="freescale/imx93-11x11-evk" -CONFIG_SPL_TEXT_BASE=0x2049A000 -CONFIG_IMX9_LOW_DRIVE_MODE=y -CONFIG_TARGET_IMX93_11X11_EVK=y -CONFIG_SYS_MONITOR_LEN=524288 -CONFIG_SPL_SERIAL=y -CONFIG_SPL_DRIVERS_MISC=y -CONFIG_SPL_STACK=0x20519dd0 -CONFIG_SPL_HAS_BSS_LINKER_SECTION=y -CONFIG_SPL_BSS_START_ADDR=0x2051a000 -CONFIG_SPL_BSS_MAX_SIZE=0x2000 -CONFIG_SPL=y -CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000 -CONFIG_SYS_LOAD_ADDR=0x80400000 -CONFIG_SYS_MEMTEST_START=0x80000000 -CONFIG_SYS_MEMTEST_END=0x90000000 -CONFIG_REMAKE_ELF=y -CONFIG_DISTRO_DEFAULTS=y -CONFIG_DEFAULT_FDT_FILE="imx93-11x11-evk.dtb" -CONFIG_SYS_CBSIZE=2048 -CONFIG_SYS_PBSIZE=2074 -CONFIG_BOARD_EARLY_INIT_F=y -CONFIG_BOARD_LATE_INIT=y -CONFIG_SPL_MAX_SIZE=0x26000 -CONFIG_SPL_BOARD_INIT=y -CONFIG_SPL_BOOTROM_SUPPORT=y -CONFIG_SPL_LOAD_IMX_CONTAINER=y -CONFIG_IMX_CONTAINER_CFG="arch/arm/mach-imx/imx9/container.cfg" -# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set -CONFIG_SPL_SYS_MALLOC=y -CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y -CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x83200000 -CONFIG_SPL_SYS_MALLOC_SIZE=0x80000 -CONFIG_SPL_SYS_MMCSD_RAW_MODE=y -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1040 -CONFIG_SPL_I2C=y -CONFIG_SPL_POWER=y -CONFIG_SPL_WATCHDOG=y -CONFIG_SYS_PROMPT="u-boot=> " -CONFIG_CMD_ERASEENV=y -# CONFIG_CMD_CRC32 is not set -CONFIG_CMD_MEMTEST=y -CONFIG_CMD_CLK=y -CONFIG_CMD_DFU=y -CONFIG_CMD_FUSE=y -CONFIG_CMD_GPIO=y -CONFIG_CMD_GPT=y -CONFIG_CMD_I2C=y -CONFIG_CMD_MMC=y -CONFIG_CMD_POWEROFF=y -CONFIG_CMD_SNTP=y -CONFIG_CMD_CACHE=y -CONFIG_CMD_RTC=y -CONFIG_CMD_TIME=y -CONFIG_CMD_GETTIME=y -CONFIG_CMD_TIMER=y -CONFIG_CMD_REGULATOR=y -CONFIG_CMD_HASH=y -CONFIG_CMD_EXT4_WRITE=y -CONFIG_OF_CONTROL=y -CONFIG_SPL_OF_CONTROL=y -CONFIG_ENV_OVERWRITE=y -CONFIG_ENV_IS_NOWHERE=y -CONFIG_ENV_IS_IN_MMC=y -CONFIG_SYS_RELOC_GD_ENV_ADDR=y -CONFIG_SYS_MMC_ENV_DEV=1 -CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -CONFIG_USE_ETHPRIME=y -CONFIG_ETHPRIME="eth0" -CONFIG_NET_RANDOM_ETHADDR=y -CONFIG_SPL_DM=y -CONFIG_REGMAP=y -CONFIG_SYSCON=y -CONFIG_CPU=y -CONFIG_CPU_IMX=y -CONFIG_IMX_RGPIO2P=y -CONFIG_DM_PCA953X=y -CONFIG_DM_I2C=y -CONFIG_SYS_I2C_IMX_LPI2C=y -CONFIG_SUPPORT_EMMC_BOOT=y -CONFIG_MMC_IO_VOLTAGE=y -CONFIG_MMC_UHS_SUPPORT=y -CONFIG_MMC_HS400_ES_SUPPORT=y -CONFIG_MMC_HS400_SUPPORT=y -CONFIG_FSL_USDHC=y -CONFIG_PHY_ANEG_TIMEOUT=20000 -CONFIG_PHY_REALTEK=y -CONFIG_DM_ETH_PHY=y -CONFIG_PHY_GIGE=y -CONFIG_DWC_ETH_QOS=y -CONFIG_DWC_ETH_QOS_IMX=y -CONFIG_FEC_MXC=y -CONFIG_MII=y -CONFIG_PINCTRL=y -CONFIG_SPL_PINCTRL=y -CONFIG_PINCTRL_IMX93=y -CONFIG_DM_PMIC=y -CONFIG_SPL_DM_PMIC_PCA9450=y -CONFIG_DM_REGULATOR=y -CONFIG_DM_REGULATOR_FIXED=y -CONFIG_DM_REGULATOR_GPIO=y -CONFIG_DM_RTC=y -CONFIG_RTC_EMULATION=y -CONFIG_DM_SERIAL=y -CONFIG_FSL_LPUART=y -CONFIG_SYSRESET=y -CONFIG_SYSRESET_CMD_POWEROFF=y -CONFIG_SYSRESET_PSCI=y -CONFIG_DM_THERMAL=y -CONFIG_IMX_TMU=y -CONFIG_ULP_WATCHDOG=y -CONFIG_WDT=y -CONFIG_LZO=y -CONFIG_BZIP2=y diff --git a/configs/lxr2_defconfig b/configs/lxr2_defconfig new file mode 100644 index 00000000000..855366d4215 --- /dev/null +++ b/configs/lxr2_defconfig @@ -0,0 +1,118 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX6=y +CONFIG_TEXT_BASE=0x17800000 +CONFIG_SYS_MALLOC_LEN=0xa00000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_SPL_GPIO=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SF_DEFAULT_SPEED=20000000 +CONFIG_ENV_SIZE=0x4000 +CONFIG_ENV_OFFSET=0x100000 +CONFIG_ENV_SECT_SIZE=0x10000 +CONFIG_MX6Q=y +CONFIG_TARGET_LXR2=y +CONFIG_DM_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="imx6q-lxr" +CONFIG_SPL_TEXT_BASE=0x00908000 +CONFIG_SYS_MONITOR_LEN=409600 +CONFIG_SPL_MMC=y +CONFIG_SPL_SERIAL=y +CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068 +CONFIG_SPL=y +CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y +CONFIG_ENV_OFFSET_REDUND=0x110000 +CONFIG_SPL_LIBDISK_SUPPORT=y +CONFIG_SPL_SPI_FLASH_SUPPORT=y +CONFIG_SPL_SPI=y +CONFIG_LTO=y +CONFIG_HAS_BOARD_SIZE_LIMIT=y +CONFIG_BOARD_SIZE_LIMIT=715766 +CONFIG_FIT=y +CONFIG_SPL_FIT_PRINT=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_SUPPORT_RAW_INITRD=y +CONFIG_SYS_PBSIZE=532 +CONFIG_SYS_CONSOLE_IS_IN_ENV=y +CONFIG_SPL_LEGACY_IMAGE_FORMAT=y +CONFIG_SPL_SYS_MALLOC=y +CONFIG_SPL_FIT_IMAGE_TINY=y +CONFIG_SPL_SPI_LOAD=y +CONFIG_SYS_SPI_U_BOOT_OFFS=0x11400 +CONFIG_HUSH_PARSER=y +CONFIG_SYS_MAXARGS=32 +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_SPL=y +CONFIG_CMD_SPL_WRITE_SIZE=0x20000 +CONFIG_CMD_MD5SUM=y +CONFIG_MD5SUM_VERIFY=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_NAND_TRIMFFS=y +CONFIG_CMD_PART=y +CONFIG_CMD_WDT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_MTDPARTS=y +CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand" +CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:40m(Kernels),860m(root),-(nand)" +CONFIG_CMD_UBI=y +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_EFI_PARTITION=y +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_ENV_OVERWRITE=y +CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_ARP_TIMEOUT=200 +CONFIG_BOUNCE_BUFFER=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_SYS_BOOTCOUNT_MAGIC=0xB0C4000 +CONFIG_SYS_BOOTCOUNT_BE=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MXC=y +CONFIG_FSL_USDHC=y +CONFIG_MTD=y +CONFIG_DM_MTD=y +CONFIG_MTD_RAW_NAND=y +CONFIG_NAND_MXS=y +CONFIG_NAND_MXS_DT=y +CONFIG_SYS_NAND_ONFI_DETECTION=y +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y +CONFIG_SYS_NAND_U_BOOT_OFFS=0xe00000 +CONFIG_DM_SPI_FLASH=y +CONFIG_SF_DEFAULT_BUS=2 +CONFIG_SPI_FLASH_SFDP_SUPPORT=y +CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_PHYLIB=y +CONFIG_PHY_MICREL=y +CONFIG_PHY_MICREL_KSZ90X1=y +CONFIG_FEC_MXC=y +CONFIG_RGMII=y +CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_SERIAL=y +CONFIG_MXC_UART=y +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_MXC_SPI=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_WATCHDOG=y +CONFIG_SYSRESET_WATCHDOG_AUTO=y +CONFIG_IMX_THERMAL=y diff --git a/configs/milkv_duo_defconfig b/configs/milkv_duo_defconfig index d350ec14eb1..1186763a73c 100644 --- a/configs/milkv_duo_defconfig +++ b/configs/milkv_duo_defconfig @@ -1,6 +1,6 @@ CONFIG_RISCV=y CONFIG_SYS_MALLOC_LEN=0x820000 -CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SYS_MALLOC_F_LEN=0x8000 CONFIG_NR_DRAM_BANKS=1 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82300000 @@ -26,6 +26,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_ENV_OVERWRITE=y CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_CLK_SOPHGO_CV1800B=y CONFIG_MMC=y CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index c8756a3a788..93f0bc53f9e 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -92,7 +92,6 @@ CONFIG_SPL_OF_TRANSLATE=y CONFIG_AHCI_PCI=y CONFIG_AHCI_MVEBU=y CONFIG_DM_PCA953X=y -CONFIG_I2C_EEPROM=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_MV=y CONFIG_DM_MTD=y diff --git a/configs/xilinx_versal_net_virt_defconfig b/configs/xilinx_versal_net_virt_defconfig index 40a9b16b9cf..776af9ae29f 100644 --- a/configs/xilinx_versal_net_virt_defconfig +++ b/configs/xilinx_versal_net_virt_defconfig @@ -73,6 +73,7 @@ CONFIG_NETCONSOLE=y CONFIG_IP_DEFRAG=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_TFTP_BLOCKSIZE=4096 +CONFIG_SIMPLE_PM_BUS=y CONFIG_CLK_VERSAL=y CONFIG_DFU_RAM=y CONFIG_ARM_FFA_TRANSPORT=y diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig index dc1754f6d18..0d4591411e1 100644 --- a/configs/xilinx_versal_virt_defconfig +++ b/configs/xilinx_versal_virt_defconfig @@ -72,6 +72,7 @@ CONFIG_NETCONSOLE=y CONFIG_IP_DEFRAG=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_TFTP_BLOCKSIZE=4096 +CONFIG_SIMPLE_PM_BUS=y CONFIG_CLK_VERSAL=y CONFIG_DFU_TIMEOUT=y CONFIG_DFU_RAM=y diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig index f8b6a3f1aa2..b2921df1d0d 100644 --- a/configs/xilinx_zynq_virt_defconfig +++ b/configs/xilinx_zynq_virt_defconfig @@ -94,6 +94,7 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SIMPLE_PM_BUS=y CONFIG_DFU_TIMEOUT=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y @@ -138,6 +139,7 @@ CONFIG_PHY_XILINX=y CONFIG_DM_ETH_PHY=y CONFIG_MII=y CONFIG_ZYNQ_GEM=y +CONFIG_POWER_DOMAIN=y CONFIG_ARM_DCC=y CONFIG_ZYNQ_SERIAL=y CONFIG_ZYNQ_SPI=y diff --git a/configs/xilinx_zynqmp_kria_defconfig b/configs/xilinx_zynqmp_kria_defconfig index 4c66c536d0f..5a07edf5cd2 100644 --- a/configs/xilinx_zynqmp_kria_defconfig +++ b/configs/xilinx_zynqmp_kria_defconfig @@ -117,6 +117,7 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SIMPLE_PM_BUS=y CONFIG_SATA=y CONFIG_SCSI_AHCI=y CONFIG_SATA_CEVA=y diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 1133134e3fe..491206998da 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -118,6 +118,7 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y CONFIG_SYS_FAULT_ECHO_LINK_DOWN=y CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SIMPLE_PM_BUS=y CONFIG_SATA=y CONFIG_SCSI_AHCI=y CONFIG_SATA_CEVA=y diff --git a/disk/part_efi.c b/disk/part_efi.c index b1a03bd165e..580821a6ee9 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -15,7 +15,7 @@ #include <blk.h> #include <log.h> #include <part.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/cache.h> #include <asm/global_data.h> #include <asm/unaligned.h> diff --git a/doc/arch/m68k.rst b/doc/arch/m68k.rst index 8474ece62c7..de7eb384955 100644 --- a/doc/arch/m68k.rst +++ b/doc/arch/m68k.rst @@ -82,9 +82,9 @@ A bash script similar to the one below may be used: Adopted toolchains ------------------ -Please check: -https://www.denx.de/wiki/U-Boot/ColdFireNotes - +Currently the `kernel.org cross-development toolchains +<https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/>`_ are +used in the project CI builds. ColdFire specific configuration options/settings ------------------------------------------------ diff --git a/doc/arch/mips.rst b/doc/arch/mips.rst index b8166087ddf..aeb58247943 100644 --- a/doc/arch/mips.rst +++ b/doc/arch/mips.rst @@ -8,9 +8,8 @@ Notes for the MIPS architecture port of U-Boot Toolchains ---------- - * `ELDK < DULG < DENX <http://www.denx.de/wiki/DULG/ELDK>`_ - * `Embedded Debian -- Cross-development toolchains <http://www.emdebian.org/crosstools.html>`_ * `Buildroot <http://buildroot.uclibc.org/>`_ + * `kernel.org cross-development toolchains <https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/>`_ Known Issues ------------ diff --git a/doc/arch/sandbox/sandbox.rst b/doc/arch/sandbox/sandbox.rst index 49675517246..a8b0d7f0395 100644 --- a/doc/arch/sandbox/sandbox.rst +++ b/doc/arch/sandbox/sandbox.rst @@ -655,15 +655,17 @@ Memory Map Sandbox has its own emulated memory starting at 0. Here are some of the things that are mapped into that memory: -======= ======================== =============================== -Addr Config Usage -======= ======================== =============================== - 100 CONFIG_SYS_FDT_LOAD_ADDR Device tree - b000 CONFIG_BLOBLIST_ADDR Blob list - 10000 CFG_MALLOC_F_ADDR Early memory allocation - f0000 CONFIG_PRE_CON_BUF_ADDR Pre-console buffer - 100000 TCG Event log TCG Event Log - 200000 CONFIG_TRACE_EARLY_ADDR Early trace buffer (if enabled). Also used - as the SPL load buffer in spl_test_load(). - 400000 CONFIG_TEXT_BASE Load buffer for U-Boot (sandbox_spl only) -======= ======================== =============================== +======== ======================== =============================== +Addr Config Usage +======== ======================== =============================== + 100 CONFIG_SYS_FDT_LOAD_ADDR Device tree + b000 CONFIG_BLOBLIST_ADDR Blob list + 10000 CFG_MALLOC_F_ADDR Early memory allocation + f0000 CONFIG_PRE_CON_BUF_ADDR Pre-console buffer + 100000 TCG Event log TCG Event Log + 200000 CONFIG_TRACE_EARLY_ADDR Early trace buffer (if enabled). Also used + 400000 CONFIG_TEXT_BASE Load buffer for U-Boot (sandbox_spl only) +10000000 PCI address space (see test.dts) + +ff000000 Memory-mapping tags start here +======== ======================== =============================== diff --git a/doc/board/aspeed/ibex-ast2700.rst b/doc/board/aspeed/ibex-ast2700.rst new file mode 100644 index 00000000000..511bd081ba2 --- /dev/null +++ b/doc/board/aspeed/ibex-ast2700.rst @@ -0,0 +1,26 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +IBex AST2700 +============ + +AST2700 integrates an IBex RISC-V 32-bits CPU as the boot MCU to execute the +first stage bootlaoder, namely SPL. + +Build +----- + +1. Prepare the toolchains and make sure the $PATH to toolchains is correct. +2. Use `make ibex-ast2700_defconfig` in u-boot root to build the image + +Running U-Boot SPL +------------------ + +The U-Boot SPL will boot in M mode and load the FIT image which includes +the 2nd stage bootloaders executed by the main processor Cortex-A35. + + +Burn U-Boot to SPI Flash +------------------------ + +Use SPI flash programmer (e.g. SF100) to program the u-book-spl.bin with the +offset 0x80 bytes to the SPI flash beginning. diff --git a/doc/board/aspeed/index.rst b/doc/board/aspeed/index.rst new file mode 100644 index 00000000000..d784c88494f --- /dev/null +++ b/doc/board/aspeed/index.rst @@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Aspeed +====== + +.. toctree:: + :maxdepth: 2 + + ibex-ast2700 diff --git a/doc/board/index.rst b/doc/board/index.rst index 417c128c7af..3fb7c84f10c 100644 --- a/doc/board/index.rst +++ b/doc/board/index.rst @@ -14,6 +14,7 @@ Board-specific doc anbernic/index apple/index armltd/index + aspeed/index asus/index atmel/index beacon/index diff --git a/doc/develop/process.rst b/doc/develop/process.rst index 0542b3fc124..0c6fb31e87b 100644 --- a/doc/develop/process.rst +++ b/doc/develop/process.rst @@ -23,9 +23,8 @@ Management Summary Phases of the Development Process --------------------------------- -U-Boot development takes place in `Release Cycles -<https://www.denx.de/wiki/U-Boot/ReleaseCycle>`_. A Release Cycle lasts -normally for three months. +U-Boot development takes place in a :doc:`release_cycle`. A Release Cycle +lasts normally for three months. The first three weeks of each Release Cycle are called *Merge Window*. diff --git a/doc/develop/release_cycle.rst b/doc/develop/release_cycle.rst index de1d3045b44..3cb63a0f402 100644 --- a/doc/develop/release_cycle.rst +++ b/doc/develop/release_cycle.rst @@ -75,9 +75,9 @@ For the next scheduled release, release candidates were made on:: * U-Boot v2024.10-rc4 was released on Mon 02 September 2024. -.. * U-Boot v2024.10-rc5 was released on Mon 16 September 2024. +* U-Boot v2024.10-rc5 was released on Mon 16 September 2024. -.. * U-Boot v2024.10-rc6 was released on Mon 30 September 2024. +* U-Boot v2024.10-rc6 was released on Mon 30 September 2024. Please note that the following dates are planned only and may be deviated from as needed. diff --git a/doc/develop/sending_patches.rst b/doc/develop/sending_patches.rst index 3f25b1d0466..e22b5e3e244 100644 --- a/doc/develop/sending_patches.rst +++ b/doc/develop/sending_patches.rst @@ -73,12 +73,13 @@ General Patch Submission Rules cover letter why they are ignored is desired. * Send your patches as plain text messages: no HTML, no MIME, no links, no - compression, no attachments. Just plain text. The best way the generate - patches is by using the ``git format-patch`` command. Please use the - ``master`` branch of the mainline U-Boot git repository - (``https://source.denx.de/u-boot/u-boot.git``) as reference, unless (usually - late in a release cycle) there has been an announcement to use the ``next`` - branch of this repository instead. + compression, no attachments. Just plain text. The best way to generate + patches is by using the ``git format-patch`` command. For a patch that is + fixing a bug or regression of some sort, please use the ``master`` branch of + the mainline U-Boot git repository located at + https://source.denx.de/u-boot/u-boot.git as reference. For new features, if + the ``next`` branch has been opened (which happens with the release of + ``-rc2``) that branch should be used, otherwise ``master`` is acceptable. * Make sure that your mailer does not mangle the patch by automatic changes like wrapping of longer lines etc. diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index d450b12bf80..94482758573 100644 --- a/doc/develop/uefi/uefi.rst +++ b/doc/develop/uefi/uefi.rst @@ -449,6 +449,33 @@ practice. Getting this information from the firmware itself is more secure, assuming the firmware has been verified by a previous stage boot loader. +Dynamic Firmware Update GUIDs +***************************** + +The image_type_id contains a GUID value which is specific to the image +and board being updated, that is to say it should uniquely identify the +board model (and revision if relevant) and image pair. Traditionally, +these GUIDs are generated manually and hardcoded on a per-board basis, +however this scheme makes it difficult to scale up to support many +boards. + +To address this, v5 GUIDs can be used to generate board-specific GUIDs +at runtime, based on the board's devicetree root compatible +(e.g. "qcom,qrb5165-rb5"). + +These strings are combined with the fw_image name to generate GUIDs for +each image. Support for dynamic UUIDs can be enabled by generating a new +namespace UUID and setting EFI_CAPSULE_NAMESPACE_GUID to it. Dynamic GUID +generation is only enabled if the image_type_id property is unset for your +firmware images, this is to avoid breaking existing boards with hardcoded +GUIDs. + +The mkeficapsule tool can be used to determine the GUIDs for a particular +board and image. It can be found in the tools directory. + +Firmware update images +********************** + The firmware images structure defines the GUID values, image index values and the name of the images that are to be updated through the capsule update feature. These values are to be defined as part of diff --git a/doc/develop/version.rst b/doc/develop/version.rst index 5c9046aa17a..de11836af45 100644 --- a/doc/develop/version.rst +++ b/doc/develop/version.rst @@ -9,7 +9,7 @@ release that came out in October 2020. Release candidates are tagged every few weeks as the project heads to the next release. So 2020.10-rc1 was the first release candidate (RC), tagged soon after 2020.07 was released. -See https://www.denx.de/wiki/view/U-Boot/ReleaseCycle for full details. +See :doc:`release_cycle` for full details. Within the build system, various Makefile variables are created, making use of VERSION, PATCHLEVEL and EXTRAVERSION defined at the top of 'Makefile'. There is diff --git a/doc/device-tree-bindings/bootcount-syscon.txt b/doc/device-tree-bindings/bootcount-syscon.txt index e124f7b6142..ea27b246c8a 100644 --- a/doc/device-tree-bindings/bootcount-syscon.txt +++ b/doc/device-tree-bindings/bootcount-syscon.txt @@ -1,6 +1,6 @@ Bootcount Configuration This is the implementation of the feature as described in -https://www.denx.de/wiki/DULG/UBootBootCountLimit. +https://docs.u-boot.org/en/latest/api/bootcount.html Required Properties: - compatible: must be "u-boot,bootcount-syscon". diff --git a/doc/mkeficapsule.1 b/doc/mkeficapsule.1 index c3d0f21488a..a726149ba2c 100644 --- a/doc/mkeficapsule.1 +++ b/doc/mkeficapsule.1 @@ -10,6 +10,9 @@ mkeficapsule \- Generate EFI capsule file for U-Boot .B mkeficapsule .RI [ options ] " " [ image-blob ] " " capsule-file +.B mkeficapsule +.RI guidgen " " [ GUID ] " " DTB " " IMAGE_NAME... + .SH "DESCRIPTION" The .B mkeficapsule @@ -42,6 +45,10 @@ multiple binary blobs in a single capsule file. This type of image file can be generated by .BR mkimage . +mkeficapsule can also be used to simulate the dynamic GUID generation used to +identify firmware images in capsule updates by providing the namespace guid, dtb +for the board, and a list of firmware images. + .SH "OPTIONS" .TP @@ -117,6 +124,22 @@ at every firmware update. .B "-d\fR,\fB --dump_sig" Dump signature data into *.p7 file +.SH "GUIDGEN OPTIONS" + +.TP +.B "[GUID]" +The namespace/salt GUID, by default this is EFI_CAPSULE_NAMESPACE_GUID. +The format is: + xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +.TP +.B DTB +The device tree blob file for the board. + +.TP +.B IMAGE_NAME... +The names of the firmware images to generate GUIDs for. + .PP .SH FILES .TP @@ -130,4 +153,4 @@ The directory in which all capsule files be placed Written by AKASHI Takahiro <takahiro.akashi@linaro.org> .SH HOMEPAGE -http://www.denx.de/wiki/U-Boot/WebHome +http://www.u-boot.org/ diff --git a/doc/usage/cmd/mmc.rst b/doc/usage/cmd/mmc.rst index 5a64400eeae..55391fda24c 100644 --- a/doc/usage/cmd/mmc.rst +++ b/doc/usage/cmd/mmc.rst @@ -15,6 +15,7 @@ Synopsis mmc read addr blk# cnt mmc write addr blk# cnt mmc erase blk# cnt + mmc erase partname mmc rescan [mode] mmc part mmc dev [dev] [part] [mode] @@ -44,12 +45,15 @@ The 'mmc write' command writes raw data to MMC device from memory address with b cnt block count -The 'mmc erase' command erases *cnt* blocks on the MMC device starting at block *blk#*. +The 'mmc erase' command erases *cnt* blocks on the MMC device starting at block *blk#* or +the entire partition specified by *partname*. blk# start block offset cnt block count + partname + partition name The 'mmc rescan' command scans the available MMC device. diff --git a/doc/usage/cmd/ums.rst b/doc/usage/cmd/ums.rst index 9d379e3c829..e96222785f2 100644 --- a/doc/usage/cmd/ums.rst +++ b/doc/usage/cmd/ums.rst @@ -48,7 +48,7 @@ Configuration ------------- The ums command is only available if CONFIG_CMD_USB_MASS_STORAGE=y -and depends on CONFIG_USB_USB_GADGET and CONFIG_BLK. +which depends on CONFIG_USB_GADGET_DOWNLOAD and CONFIG_BLK. Return value ------------ diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index b6ab31a314a..fa6d8e71281 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -6,7 +6,7 @@ menuconfig BOOTCOUNT_LIMIT bool "Enable support for checking boot count limit" help Enable checking for exceeding the boot count limit. - More information: http://www.denx.de/wiki/DULG/UBootBootCountLimit + More information: https://docs.u-boot.org/en/latest/api/bootcount.html if BOOTCOUNT_LIMIT diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 9acbc47fe8e..d9d518d7038 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -257,6 +257,7 @@ source "drivers/clk/mvebu/Kconfig" source "drivers/clk/owl/Kconfig" source "drivers/clk/qcom/Kconfig" source "drivers/clk/renesas/Kconfig" +source "drivers/clk/sophgo/Kconfig" source "drivers/clk/sunxi/Kconfig" source "drivers/clk/sifive/Kconfig" source "drivers/clk/starfive/Kconfig" diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 847b9b29110..f9b90a38b00 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -44,6 +44,7 @@ obj-$(CONFIG_CLK_QCOM) += qcom/ obj-$(CONFIG_CLK_RENESAS) += renesas/ obj-$(CONFIG_$(SPL_TPL_)CLK_SCMI) += clk_scmi.o obj-$(CONFIG_CLK_SIFIVE) += sifive/ +obj-$(CONFIG_CLK_SOPHGO) += sophgo/ obj-$(CONFIG_CLK_SUNXI) += sunxi/ obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ obj-$(CONFIG_CLK_VERSACLOCK) += clk_versaclock.o diff --git a/drivers/clk/analogbits/wrpll-cln28hpc.c b/drivers/clk/analogbits/wrpll-cln28hpc.c index a3cb109d357..537c696b727 100644 --- a/drivers/clk/analogbits/wrpll-cln28hpc.c +++ b/drivers/clk/analogbits/wrpll-cln28hpc.c @@ -81,7 +81,7 @@ static int __wrpll_calc_filter_range(unsigned long post_divr_freq) { if (post_divr_freq < MIN_POST_DIVR_FREQ || post_divr_freq > MAX_POST_DIVR_FREQ) { - WARN(1, "%s: post-divider reference freq out of range: %lu", + WARN(1, "%s: post-divider reference freq out of range: %lu\n", __func__, post_divr_freq); return -ERANGE; } @@ -229,7 +229,7 @@ int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate, int range; if (c->flags == 0) { - WARN(1, "%s called with uninitialized PLL config", __func__); + WARN(1, "%s called with uninitialized PLL config\n", __func__); return -EINVAL; } @@ -335,7 +335,7 @@ unsigned long wrpll_calc_output_rate(const struct wrpll_cfg *c, u64 n; if (c->flags & WRPLL_FLAGS_EXT_FEEDBACK_MASK) { - WARN(1, "external feedback mode not yet supported"); + WARN(1, "external feedback mode not yet supported\n"); return ULONG_MAX; } diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c index ceb2c6fab0d..e55a26ab8fd 100644 --- a/drivers/clk/sifive/fu540-prci.c +++ b/drivers/clk/sifive/fu540-prci.c @@ -58,7 +58,7 @@ static const struct __prci_clock_ops sifive_fu540_prci_tlclksel_clk_ops = { }; /* List of clock controls provided by the PRCI */ -struct __prci_clock __prci_init_clocks_fu540[] = { +static struct __prci_clock __prci_init_clocks_fu540[] = { [PRCI_CLK_COREPLL] = { .name = "corepll", .parent_name = "hfclk", @@ -83,3 +83,8 @@ struct __prci_clock __prci_init_clocks_fu540[] = { .ops = &sifive_fu540_prci_tlclksel_clk_ops, }, }; + +const struct prci_clk_desc prci_clk_fu540 = { + .clks = __prci_init_clocks_fu540, + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540), +}; diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h deleted file mode 100644 index 113301107da..00000000000 --- a/drivers/clk/sifive/fu540-prci.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2020-2021 SiFive, Inc. - * Zong Li - * Pragnesh Patel - */ - -#ifndef __SIFIVE_CLK_FU540_PRCI_H -#define __SIFIVE_CLK_FU540_PRCI_H - -#include "sifive-prci.h" - -#define NUM_CLOCK_FU540 4 - -extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540]; - -static const struct prci_clk_desc prci_clk_fu540 = { - .clks = __prci_init_clocks_fu540, - .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540), -}; - -#endif /* __SIFIVE_CLK_FU540_PRCI_H */ diff --git a/drivers/clk/sifive/fu740-prci.c b/drivers/clk/sifive/fu740-prci.c index 5edc864e4bd..4274b215d2f 100644 --- a/drivers/clk/sifive/fu740-prci.c +++ b/drivers/clk/sifive/fu740-prci.c @@ -102,7 +102,7 @@ static const struct __prci_clock_ops sifive_fu740_prci_pcieaux_clk_ops = { }; /* List of clock controls provided by the PRCI */ -struct __prci_clock __prci_init_clocks_fu740[] = { +static struct __prci_clock __prci_init_clocks_fu740[] = { [FU740_PRCI_CLK_COREPLL] = { .name = "corepll", .parent_name = "hfclk", @@ -156,3 +156,8 @@ struct __prci_clock __prci_init_clocks_fu740[] = { .pwd = &__prci_pcieaux_data, } }; + +const struct prci_clk_desc prci_clk_fu740 = { + .clks = __prci_init_clocks_fu740, + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740), +}; diff --git a/drivers/clk/sifive/fu740-prci.h b/drivers/clk/sifive/fu740-prci.h deleted file mode 100644 index b74f0789061..00000000000 --- a/drivers/clk/sifive/fu740-prci.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2020-2021 SiFive, Inc. - * Zong Li - * Pragnesh Patel - */ - -#ifndef __SIFIVE_CLK_FU740_PRCI_H -#define __SIFIVE_CLK_FU740_PRCI_H - -#include "sifive-prci.h" - -#define NUM_CLOCK_FU740 9 - -extern struct __prci_clock __prci_init_clocks_fu740[NUM_CLOCK_FU740]; - -static const struct prci_clk_desc prci_clk_fu740 = { - .clks = __prci_init_clocks_fu740, - .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740), -}; - -#endif /* __SIFIVE_CLK_FU740_PRCI_H */ diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index 5ea86062800..aa26d3a109b 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -33,8 +33,7 @@ #include <linux/math64.h> #include <dt-bindings/clock/sifive-fu740-prci.h> -#include "fu540-prci.h" -#include "fu740-prci.h" +#include "sifive-prci.h" /* * Private functions diff --git a/drivers/clk/sifive/sifive-prci.h b/drivers/clk/sifive/sifive-prci.h index 5ce33d61846..b391698081d 100644 --- a/drivers/clk/sifive/sifive-prci.h +++ b/drivers/clk/sifive/sifive-prci.h @@ -320,4 +320,8 @@ unsigned long sifive_prci_hfpclkplldiv_recalc_rate(struct __prci_clock *pc, int sifive_prci_clock_enable(struct __prci_clock *pc, bool enable); +/* Clock driver data */ +extern const struct prci_clk_desc prci_clk_fu540; +extern const struct prci_clk_desc prci_clk_fu740; + #endif /* __SIFIVE_CLK_SIFIVE_PRCI_H */ diff --git a/drivers/clk/sophgo/Kconfig b/drivers/clk/sophgo/Kconfig new file mode 100644 index 00000000000..59b51608fe6 --- /dev/null +++ b/drivers/clk/sophgo/Kconfig @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + +config CLK_SOPHGO + bool + +config CLK_SOPHGO_CV1800B + bool "Sophgo CV1800B clock support" + depends on CLK + select CLK_CCF + select CLK_SOPHGO + help + This enables support clock driver for Sophgo CV1800B SoC. diff --git a/drivers/clk/sophgo/Makefile b/drivers/clk/sophgo/Makefile new file mode 100644 index 00000000000..caec76222be --- /dev/null +++ b/drivers/clk/sophgo/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + +obj-y += clk-ip.o clk-pll.o +obj-$(CONFIG_CLK_SOPHGO_CV1800B) += clk-cv1800b.o diff --git a/drivers/clk/sophgo/clk-common.h b/drivers/clk/sophgo/clk-common.h new file mode 100644 index 00000000000..95b82e968d0 --- /dev/null +++ b/drivers/clk/sophgo/clk-common.h @@ -0,0 +1,74 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + * + */ + +#ifndef __CLK_SOPHGO_COMMON_H__ +#define __CLK_SOPHGO_COMMON_H__ + +#include <linux/bitops.h> +#include <linux/io.h> + +#define CV1800B_CLK_OSC 1 +#define CV1800B_CLK_BYPASS 2 +#define CV1800B_CLK_ID_TRANSFORM(_id) ((_id) + 3) + +struct cv1800b_clk_regbit { + u32 offset; + u8 shift; +}; + +struct cv1800b_clk_regfield { + u32 offset; + u8 shift; + u8 width; +}; + +#define CV1800B_CLK_REGBIT(_offset, _shift) \ + { \ + .offset = _offset, \ + .shift = _shift, \ + } + +#define CV1800B_CLK_REGFIELD(_offset, _shift, _width) \ + { \ + .offset = _offset, \ + .shift = _shift, \ + .width = _width, \ + } + +static inline u32 cv1800b_clk_getbit(void *base, struct cv1800b_clk_regbit *bit) +{ + return readl(base + bit->offset) & (BIT(bit->shift)); +} + +static inline u32 cv1800b_clk_setbit(void *base, struct cv1800b_clk_regbit *bit) +{ + return setbits_le32(base + bit->offset, BIT(bit->shift)); +} + +static inline u32 cv1800b_clk_clrbit(void *base, struct cv1800b_clk_regbit *bit) +{ + return clrbits_le32(base + bit->offset, BIT(bit->shift)); +} + +static inline u32 cv1800b_clk_getfield(void *base, + struct cv1800b_clk_regfield *field) +{ + u32 mask = GENMASK(field->shift + field->width - 1, field->shift); + + return (readl(base + field->offset) & mask) >> field->shift; +} + +static inline void +cv1800b_clk_setfield(void *base, struct cv1800b_clk_regfield *field, u32 val) +{ + u32 mask = GENMASK(field->shift + field->width - 1, field->shift); + u32 new_val = (readl(base + field->offset) & ~mask) | + ((val << field->shift) & mask); + + return writel(new_val, base + field->offset); +} + +#endif /* __CLK_SOPHGO_COMMON_H__ */ diff --git a/drivers/clk/sophgo/clk-cv1800b.c b/drivers/clk/sophgo/clk-cv1800b.c new file mode 100644 index 00000000000..d946ea57a46 --- /dev/null +++ b/drivers/clk/sophgo/clk-cv1800b.c @@ -0,0 +1,754 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + */ + +#include <clk-uclass.h> +#include <dm.h> +#include <linux/clk-provider.h> + +#include "clk-common.h" +#include "clk-cv1800b.h" +#include "clk-ip.h" +#include "clk-pll.h" + +static const char *const clk_cam_parents[] = { + "clk_cam0pll", + "clk_cam0pll_d2", + "clk_cam0pll_d3", + "clk_mipimpll_d3" +}; + +static const char *const clk_tpu_parents[] = { + "clk_tpll", + "clk_a0pll", + "clk_mipimpll", + "clk_fpll" +}; + +static const char *const clk_axi4_parents[] = { "clk_fpll", "clk_disppll" }; +static const char *const clk_aud_parents[] = { "clk_a0pll", "clk_a24m" }; +static const char *const clk_cam0_200_parents[] = { "osc", "clk_disppll" }; + +static const char *const clk_vip_sys_parents[] = { + "clk_mipimpll", + "clk_cam0pll", + "clk_disppll", + "clk_fpll" +}; + +static const char *const clk_axi_video_codec_parents[] = { + "clk_a0pll", + "clk_mipimpll", + "clk_cam1pll", + "clk_fpll" +}; + +static const char *const clk_vc_src0_parents[] = { + "clk_disppll", + "clk_mipimpll", + "clk_cam1pll", + "clk_fpll" +}; + +static const struct cv1800b_mmux_parent_info clk_c906_0_parents[] = { + { "clk_tpll", 0, 0 }, + { "clk_a0pll", 0, 1 }, + { "clk_mipimpll", 0, 2 }, + { "clk_mpll", 0, 3 }, + { "clk_fpll", 1, 0 }, +}; + +static const struct cv1800b_mmux_parent_info clk_c906_1_parents[] = { + { "clk_tpll", 0, 0 }, + { "clk_a0pll", 0, 1 }, + { "clk_disppll", 0, 2 }, + { "clk_mpll", 0, 3 }, + { "clk_fpll", 1, 0 }, +}; + +static const struct cv1800b_mmux_parent_info clk_a53_parents[] = { + { "clk_tpll", 0, 0 }, + { "clk_a0pll", 0, 1 }, + { "clk_mipimpll", 0, 2 }, + { "clk_mpll", 0, 3 }, + { "clk_fpll", 1, 0 }, +}; + +static struct cv1800b_clk_gate cv1800b_gate_info[] = { + CV1800B_GATE(CLK_XTAL_AP, "clk_xtal_ap", "osc", REG_CLK_EN_0, 3, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_RTC_25M, "clk_rtc_25m", "osc", REG_CLK_EN_0, 8, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TEMPSEN, "clk_tempsen", "osc", REG_CLK_EN_0, 9, 0), + CV1800B_GATE(CLK_SARADC, "clk_saradc", "osc", REG_CLK_EN_0, 10, 0), + CV1800B_GATE(CLK_EFUSE, "clk_efuse", "osc", REG_CLK_EN_0, 11, 0), + CV1800B_GATE(CLK_APB_EFUSE, "clk_apb_efuse", "osc", REG_CLK_EN_0, 12, 0), + CV1800B_GATE(CLK_DEBUG, "clk_debug", "osc", REG_CLK_EN_0, 13, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_XTAL_MISC, "clk_xtal_misc", "osc", REG_CLK_EN_0, 14, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_APB_WDT, "clk_apb_wdt", "osc", REG_CLK_EN_1, 7, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_WGN, "clk_wgn", "osc", REG_CLK_EN_3, 22, 0), + CV1800B_GATE(CLK_WGN0, "clk_wgn0", "osc", REG_CLK_EN_3, 23, 0), + CV1800B_GATE(CLK_WGN1, "clk_wgn1", "osc", REG_CLK_EN_3, 24, 0), + CV1800B_GATE(CLK_WGN2, "clk_wgn2", "osc", REG_CLK_EN_3, 25, 0), + CV1800B_GATE(CLK_KEYSCAN, "clk_keyscan", "osc", REG_CLK_EN_3, 26, 0), + CV1800B_GATE(CLK_TPU_FAB, "clk_tpu_fab", "clk_mipimpll", REG_CLK_EN_0, 5, 0), + CV1800B_GATE(CLK_AHB_ROM, "clk_ahb_rom", "clk_axi4", REG_CLK_EN_0, 6, 0), + CV1800B_GATE(CLK_AXI4_EMMC, "clk_axi4_emmc", "clk_axi4", REG_CLK_EN_0, 15, 0), + CV1800B_GATE(CLK_AXI4_SD0, "clk_axi4_sd0", "clk_axi4", REG_CLK_EN_0, 18, 0), + CV1800B_GATE(CLK_AXI4_SD1, "clk_axi4_sd1", "clk_axi4", REG_CLK_EN_0, 21, 0), + CV1800B_GATE(CLK_AXI4_ETH0, "clk_axi4_eth0", "clk_axi4", REG_CLK_EN_0, 26, 0), + CV1800B_GATE(CLK_AXI4_ETH1, "clk_axi4_eth1", "clk_axi4", REG_CLK_EN_0, 28, 0), + CV1800B_GATE(CLK_AHB_SF, "clk_ahb_sf", "clk_axi4", REG_CLK_EN_1, 0, 0), + CV1800B_GATE(CLK_SDMA_AXI, "clk_sdma_axi", "clk_axi4", REG_CLK_EN_1, 1, 0), + CV1800B_GATE(CLK_APB_I2C, "clk_apb_i2c", "clk_axi4", REG_CLK_EN_1, 6, 0), + CV1800B_GATE(CLK_APB_SPI0, "clk_apb_spi0", "clk_axi4", REG_CLK_EN_1, 9, 0), + CV1800B_GATE(CLK_APB_SPI1, "clk_apb_spi1", "clk_axi4", REG_CLK_EN_1, 10, 0), + CV1800B_GATE(CLK_APB_SPI2, "clk_apb_spi2", "clk_axi4", REG_CLK_EN_1, 11, 0), + CV1800B_GATE(CLK_APB_SPI3, "clk_apb_spi3", "clk_axi4", REG_CLK_EN_1, 12, 0), + CV1800B_GATE(CLK_APB_UART0, "clk_apb_uart0", "clk_axi4", REG_CLK_EN_1, 15, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_APB_UART1, "clk_apb_uart1", "clk_axi4", REG_CLK_EN_1, 17, 0), + CV1800B_GATE(CLK_APB_UART2, "clk_apb_uart2", "clk_axi4", REG_CLK_EN_1, 19, 0), + CV1800B_GATE(CLK_APB_UART3, "clk_apb_uart3", "clk_axi4", REG_CLK_EN_1, 21, 0), + CV1800B_GATE(CLK_APB_UART4, "clk_apb_uart4", "clk_axi4", REG_CLK_EN_1, 23, 0), + CV1800B_GATE(CLK_APB_I2S0, "clk_apb_i2s0", "clk_axi4", REG_CLK_EN_1, 24, 0), + CV1800B_GATE(CLK_APB_I2S1, "clk_apb_i2s1", "clk_axi4", REG_CLK_EN_1, 25, 0), + CV1800B_GATE(CLK_APB_I2S2, "clk_apb_i2s2", "clk_axi4", REG_CLK_EN_1, 26, 0), + CV1800B_GATE(CLK_APB_I2S3, "clk_apb_i2s3", "clk_axi4", REG_CLK_EN_1, 27, 0), + CV1800B_GATE(CLK_AXI4_USB, "clk_axi4_usb", "clk_axi4", REG_CLK_EN_1, 28, 0), + CV1800B_GATE(CLK_APB_USB, "clk_apb_usb", "clk_axi4", REG_CLK_EN_1, 29, 0), + CV1800B_GATE(CLK_APB_I2C0, "clk_apb_i2c0", "clk_axi4", REG_CLK_EN_3, 17, 0), + CV1800B_GATE(CLK_APB_I2C1, "clk_apb_i2c1", "clk_axi4", REG_CLK_EN_3, 18, 0), + CV1800B_GATE(CLK_APB_I2C2, "clk_apb_i2c2", "clk_axi4", REG_CLK_EN_3, 19, 0), + CV1800B_GATE(CLK_APB_I2C3, "clk_apb_i2c3", "clk_axi4", REG_CLK_EN_3, 20, 0), + CV1800B_GATE(CLK_APB_I2C4, "clk_apb_i2c4", "clk_axi4", REG_CLK_EN_3, 21, 0), + CV1800B_GATE(CLK_AHB_SF1, "clk_ahb_sf1", "clk_axi4", REG_CLK_EN_3, 27, 0), + CV1800B_GATE(CLK_APB_AUDSRC, "clk_apb_audsrc", "clk_axi4", REG_CLK_EN_4, 2, 0), + CV1800B_GATE(CLK_DDR_AXI_REG, "clk_ddr_axi_reg", "clk_axi6", REG_CLK_EN_0, 7, + CLK_IS_CRITICAL), + CV1800B_GATE(CLK_APB_GPIO, "clk_apb_gpio", "clk_axi6", REG_CLK_EN_0, 29, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_APB_GPIO_INTR, "clk_apb_gpio_intr", "clk_axi6", REG_CLK_EN_0, 30, + CLK_IS_CRITICAL), + CV1800B_GATE(CLK_APB_JPEG, "clk_apb_jpeg", "clk_axi6", REG_CLK_EN_2, 13, CLK_IGNORE_UNUSED), + CV1800B_GATE(CLK_APB_H264C, "clk_apb_h264c", "clk_axi6", REG_CLK_EN_2, 14, 0), + CV1800B_GATE(CLK_APB_H265C, "clk_apb_h265c", "clk_axi6", REG_CLK_EN_2, 15, 0), + CV1800B_GATE(CLK_PM, "clk_pm", "clk_axi6", REG_CLK_EN_3, 8, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_CFG_REG_VIP, "clk_cfg_reg_vip", "clk_axi6", REG_CLK_EN_3, 31, 0), + CV1800B_GATE(CLK_CFG_REG_VC, "clk_cfg_reg_vc", "clk_axi6", REG_CLK_EN_4, 0, + CLK_IGNORE_UNUSED), + CV1800B_GATE(CLK_PWM, "clk_pwm", "clk_pwm_src", REG_CLK_EN_1, 8, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_UART0, "clk_uart0", "clk_cam0_200", REG_CLK_EN_1, 14, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_UART1, "clk_uart1", "clk_cam0_200", REG_CLK_EN_1, 16, 0), + CV1800B_GATE(CLK_UART2, "clk_uart2", "clk_cam0_200", REG_CLK_EN_1, 18, 0), + CV1800B_GATE(CLK_UART3, "clk_uart3", "clk_cam0_200", REG_CLK_EN_1, 20, 0), + CV1800B_GATE(CLK_UART4, "clk_uart4", "clk_cam0_200", REG_CLK_EN_1, 22, 0), + CV1800B_GATE(CLK_H264C, "clk_h264c", "clk_axi_video_codec", REG_CLK_EN_2, 10, 0), + CV1800B_GATE(CLK_H265C, "clk_h265c", "clk_axi_video_codec", REG_CLK_EN_2, 11, 0), + CV1800B_GATE(CLK_JPEG, "clk_jpeg", "clk_axi_video_codec", REG_CLK_EN_2, 12, + CLK_IGNORE_UNUSED), + CV1800B_GATE(CLK_CSI_MAC0_VIP, "clk_csi_mac0_vip", "clk_axi_vip", REG_CLK_EN_2, 18, 0), + CV1800B_GATE(CLK_CSI_MAC1_VIP, "clk_csi_mac1_vip", "clk_axi_vip", REG_CLK_EN_2, 19, 0), + CV1800B_GATE(CLK_ISP_TOP_VIP, "clk_isp_top_vip", "clk_axi_vip", REG_CLK_EN_2, 20, 0), + CV1800B_GATE(CLK_IMG_D_VIP, "clk_img_d_vip", "clk_axi_vip", REG_CLK_EN_2, 21, 0), + CV1800B_GATE(CLK_IMG_V_VIP, "clk_img_v_vip", "clk_axi_vip", REG_CLK_EN_2, 22, 0), + CV1800B_GATE(CLK_SC_TOP_VIP, "clk_sc_top_vip", "clk_axi_vip", REG_CLK_EN_2, 23, 0), + CV1800B_GATE(CLK_SC_D_VIP, "clk_sc_d_vip", "clk_axi_vip", REG_CLK_EN_2, 24, 0), + CV1800B_GATE(CLK_SC_V1_VIP, "clk_sc_v1_vip", "clk_axi_vip", REG_CLK_EN_2, 25, 0), + CV1800B_GATE(CLK_SC_V2_VIP, "clk_sc_v2_vip", "clk_axi_vip", REG_CLK_EN_2, 26, 0), + CV1800B_GATE(CLK_SC_V3_VIP, "clk_sc_v3_vip", "clk_axi_vip", REG_CLK_EN_2, 27, 0), + CV1800B_GATE(CLK_DWA_VIP, "clk_dwa_vip", "clk_axi_vip", REG_CLK_EN_2, 28, 0), + CV1800B_GATE(CLK_BT_VIP, "clk_bt_vip", "clk_axi_vip", REG_CLK_EN_2, 29, 0), + CV1800B_GATE(CLK_DISP_VIP, "clk_disp_vip", "clk_axi_vip", REG_CLK_EN_2, 30, 0), + CV1800B_GATE(CLK_DSI_MAC_VIP, "clk_dsi_mac_vip", "clk_axi_vip", REG_CLK_EN_2, 31, 0), + CV1800B_GATE(CLK_LVDS0_VIP, "clk_lvds0_vip", "clk_axi_vip", REG_CLK_EN_3, 0, 0), + CV1800B_GATE(CLK_LVDS1_VIP, "clk_lvds1_vip", "clk_axi_vip", REG_CLK_EN_3, 1, 0), + CV1800B_GATE(CLK_CSI0_RX_VIP, "clk_csi0_rx_vip", "clk_axi_vip", REG_CLK_EN_3, 2, 0), + CV1800B_GATE(CLK_CSI1_RX_VIP, "clk_csi1_rx_vip", "clk_axi_vip", REG_CLK_EN_3, 3, 0), + CV1800B_GATE(CLK_PAD_VI_VIP, "clk_pad_vi_vip", "clk_axi_vip", REG_CLK_EN_3, 4, 0), + CV1800B_GATE(CLK_PAD_VI1_VIP, "clk_pad_vi1_vip", "clk_axi_vip", REG_CLK_EN_3, 30, 0), + CV1800B_GATE(CLK_PAD_VI2_VIP, "clk_pad_vi2_vip", "clk_axi_vip", REG_CLK_EN_4, 7, 0), + CV1800B_GATE(CLK_CSI_BE_VIP, "clk_csi_be_vip", "clk_axi_vip", REG_CLK_EN_4, 8, 0), + CV1800B_GATE(CLK_VIP_IP0, "clk_vip_ip0", "clk_axi_vip", REG_CLK_EN_4, 9, 0), + CV1800B_GATE(CLK_VIP_IP1, "clk_vip_ip1", "clk_axi_vip", REG_CLK_EN_4, 10, 0), + CV1800B_GATE(CLK_VIP_IP2, "clk_vip_ip2", "clk_axi_vip", REG_CLK_EN_4, 11, 0), + CV1800B_GATE(CLK_VIP_IP3, "clk_vip_ip3", "clk_axi_vip", REG_CLK_EN_4, 12, 0), + CV1800B_GATE(CLK_IVE_VIP, "clk_ive_vip", "clk_axi_vip", REG_CLK_EN_4, 17, 0), + CV1800B_GATE(CLK_RAW_VIP, "clk_raw_vip", "clk_axi_vip", REG_CLK_EN_4, 18, 0), + CV1800B_GATE(CLK_OSDC_VIP, "clk_osdc_vip", "clk_axi_vip", REG_CLK_EN_4, 19, 0), + CV1800B_GATE(CLK_CSI_MAC2_VIP, "clk_csi_mac2_vip", "clk_axi_vip", REG_CLK_EN_4, 20, 0), + CV1800B_GATE(CLK_CAM0_VIP, "clk_cam0_vip", "clk_axi_vip", REG_CLK_EN_4, 21, 0), + CV1800B_GATE(CLK_TIMER0, "clk_timer0", "clk_xtal_misc", REG_CLK_EN_3, 9, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER1, "clk_timer1", "clk_xtal_misc", REG_CLK_EN_3, 10, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER2, "clk_timer2", "clk_xtal_misc", REG_CLK_EN_3, 11, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER3, "clk_timer3", "clk_xtal_misc", REG_CLK_EN_3, 12, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER4, "clk_timer4", "clk_xtal_misc", REG_CLK_EN_3, 13, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER5, "clk_timer5", "clk_xtal_misc", REG_CLK_EN_3, 14, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER6, "clk_timer6", "clk_xtal_misc", REG_CLK_EN_3, 15, CLK_IS_CRITICAL), + CV1800B_GATE(CLK_TIMER7, "clk_timer7", "clk_xtal_misc", REG_CLK_EN_3, 16, CLK_IS_CRITICAL), +}; + +struct cv1800b_clk_div cv1800b_div_info[] = { + CV1800B_DIV(CLK_1M, "clk_1m", "osc", REG_CLK_EN_3, 5, + REG_DIV_CLK_1M, 16, 6, 25, CLK_IS_CRITICAL), + CV1800B_DIV(CLK_EMMC_100K, "clk_emmc_100k", "clk_1m", REG_CLK_EN_0, 17, + REG_DIV_CLK_EMMC_100K, 16, 8, 10, 0), + CV1800B_DIV(CLK_SD0_100K, "clk_sd0_100k", "clk_1m", REG_CLK_EN_0, 20, + REG_DIV_CLK_SD0_100K, 16, 8, 10, 0), + CV1800B_DIV(CLK_SD1_100K, "clk_sd1_100k", "clk_1m", REG_CLK_EN_0, 23, + REG_DIV_CLK_SD1_100K, 16, 8, 10, 0), + CV1800B_DIV(CLK_GPIO_DB, "clk_gpio_db", "clk_1m", REG_CLK_EN_0, 31, + REG_DIV_CLK_GPIO_DB, 16, 16, 10, CLK_IS_CRITICAL) +}; + +struct cv1800b_clk_bypass_div cv1800b_bypass_div_info[] = { + CV1800B_BYPASS_DIV(CLK_AP_DEBUG, "clk_ap_debug", "clk_fpll", REG_CLK_EN_4, 5, + REG_DIV_CLK_AP_DEBUG, 16, 4, 5, REG_CLK_BYP_1, 4, CLK_IS_CRITICAL), + CV1800B_BYPASS_DIV(CLK_SRC_RTC_SYS_0, "clk_src_rtc_sys_0", "clk_fpll", REG_CLK_EN_4, 6, + REG_DIV_CLK_RTCSYS_SRC_0, 16, 4, 5, REG_CLK_BYP_1, 5, CLK_IS_CRITICAL), + CV1800B_BYPASS_DIV(CLK_CPU_GIC, "clk_cpu_gic", "clk_fpll", REG_CLK_EN_0, 2, + REG_DIV_CLK_CPU_GIC, 16, 4, 5, REG_CLK_BYP_0, 2, CLK_IS_CRITICAL), + CV1800B_BYPASS_DIV(CLK_ETH0_500M, "clk_eth0_500m", "clk_fpll", REG_CLK_EN_0, 25, + REG_DIV_CLK_GPIO_DB, 16, 4, 3, REG_CLK_BYP_0, 9, 0), + CV1800B_BYPASS_DIV(CLK_ETH1_500M, "clk_eth1_500m", "clk_fpll", REG_CLK_EN_0, 27, + REG_DIV_CLK_GPIO_DB, 16, 4, 3, REG_CLK_BYP_0, 10, 0), + CV1800B_BYPASS_DIV(CLK_AXI6, "clk_axi6", "clk_fpll", REG_CLK_EN_2, 2, REG_DIV_CLK_AXI6, 16, + 4, 15, REG_CLK_BYP_0, 20, CLK_IS_CRITICAL), + CV1800B_BYPASS_DIV(CLK_SPI, "clk_spi", "clk_fpll", REG_CLK_EN_3, 6, REG_DIV_CLK_SPI, 16, 6, + 8, REG_CLK_BYP_0, 30, 0), + CV1800B_BYPASS_DIV(CLK_DISP_SRC_VIP, "clk_disp_src_vip", "clk_disppll", REG_CLK_EN_2, 7, + REG_DIV_CLK_DISP_SRC_VIP, 16, 4, 8, REG_CLK_BYP_0, 25, 0), + CV1800B_BYPASS_DIV(CLK_CPU_AXI0, "clk_cpu_axi0", "clk_axi4", REG_CLK_EN_0, 1, + REG_DIV_CLK_CPU_AXI0, 16, 4, 3, REG_CLK_BYP_0, 1, CLK_IS_CRITICAL), + CV1800B_BYPASS_DIV(CLK_DSI_ESC, "clk_dsi_esc", "clk_axi6", REG_CLK_EN_2, 3, + REG_DIV_CLK_DSI_ESC, 16, 4, 5, REG_CLK_BYP_0, 21, 0), + CV1800B_BYPASS_DIV(CLK_I2C, "clk_i2c", "clk_axi6", REG_CLK_EN_3, 7, REG_DIV_CLK_I2C, 16, 4, + 1, REG_CLK_BYP_0, 31, 0), +}; + +struct cv1800b_clk_fixed_div cv1800b_fixed_div_info[] = { + CV1800B_FIXED_DIV(CLK_CAM0PLL_D2, "clk_cam0pll_d2", "clk_cam0pll", + REG_CAM0PLL_CLK_CSR, 1, 2, + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), + CV1800B_FIXED_DIV(CLK_CAM0PLL_D3, "clk_cam0pll_d3", "clk_cam0pll", + REG_CAM0PLL_CLK_CSR, 2, 3, + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), + CV1800B_FIXED_DIV(CLK_MIPIMPLL_D3, "clk_mipimpll_d3", "clk_mipimpll", + REG_MIPIMPLL_CLK_CSR, 2, 3, + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), + CV1800B_FIXED_DIV(CLK_USB_33K, "clk_usb_33k", "clk_1m", + REG_CLK_EN_1, 31, 3, + 0), +}; + +struct cv1800b_clk_bypass_fixed_div cv1800b_bypass_fixed_div_info[] = { + CV1800B_BYPASS_FIXED_DIV(CLK_USB_125M, "clk_usb_125m", "clk_fpll", + REG_CLK_EN_1, 30, 12, + REG_CLK_BYP_0, 17, + CLK_SET_RATE_PARENT), + CV1800B_BYPASS_FIXED_DIV(CLK_USB_12M, "clk_usb_12m", "clk_fpll", + REG_CLK_EN_2, 0, 125, + REG_CLK_BYP_0, 18, + CLK_SET_RATE_PARENT), + CV1800B_BYPASS_FIXED_DIV(CLK_VC_SRC1, "clk_vc_src1", "clk_fpll", + REG_CLK_EN_3, 28, 2, + REG_CLK_BYP_1, 0, + CLK_SET_RATE_PARENT), + CV1800B_BYPASS_FIXED_DIV(CLK_VC_SRC2, "clk_vc_src2", "clk_fpll", + REG_CLK_EN_4, 3, 3, + REG_CLK_BYP_1, 3, + CLK_SET_RATE_PARENT), +}; + +struct cv1800b_clk_mux cv1800b_mux_info[] = { + CV1800B_MUX(CLK_CAM0, "clk_cam0", clk_cam_parents, + REG_CLK_EN_2, 16, + REG_CLK_CAM0_SRC_DIV, 16, 6, 0, + REG_CLK_CAM0_SRC_DIV, 8, 2, + CLK_IGNORE_UNUSED), + CV1800B_MUX(CLK_CAM1, "clk_cam1", clk_cam_parents, + REG_CLK_EN_2, 17, + REG_CLK_CAM1_SRC_DIV, 16, 6, 0, + REG_CLK_CAM1_SRC_DIV, 8, 2, + CLK_IGNORE_UNUSED), +}; + +struct cv1800b_clk_bypass_mux cv1800b_bypass_mux_info[] = { + CV1800B_BYPASS_MUX(CLK_TPU, "clk_tpu", clk_tpu_parents, + REG_CLK_EN_0, 4, + REG_DIV_CLK_TPU, 16, 4, 3, + REG_DIV_CLK_TPU, 8, 2, + REG_CLK_BYP_0, 3, + 0), + CV1800B_BYPASS_MUX(CLK_EMMC, "clk_emmc", clk_axi4_parents, + REG_CLK_EN_0, 16, + REG_DIV_CLK_EMMC, 16, 5, 15, + REG_DIV_CLK_EMMC, 8, 2, + REG_CLK_BYP_0, 5, + 0), + CV1800B_BYPASS_MUX(CLK_SD0, "clk_sd0", clk_axi4_parents, + REG_CLK_EN_0, 19, + REG_DIV_CLK_SD0, 16, 5, 15, + REG_DIV_CLK_SD0, 8, 2, + REG_CLK_BYP_0, 6, + 0), + CV1800B_BYPASS_MUX(CLK_SD1, "clk_sd1", clk_axi4_parents, + REG_CLK_EN_0, 22, + REG_DIV_CLK_SD1, 16, 5, 15, + REG_DIV_CLK_SD1, 8, 2, + REG_CLK_BYP_0, 7, + 0), + CV1800B_BYPASS_MUX(CLK_SPI_NAND, "clk_spi_nand", clk_axi4_parents, + REG_CLK_EN_0, 24, + REG_DIV_CLK_SPI_NAND, 16, 5, 8, + REG_DIV_CLK_SPI_NAND, 8, 2, + REG_CLK_BYP_0, 8, + 0), + CV1800B_BYPASS_MUX(CLK_AXI4, "clk_axi4", clk_axi4_parents, + REG_CLK_EN_2, 1, + REG_DIV_CLK_AXI4, 16, 4, 5, + REG_DIV_CLK_AXI4, 8, 2, + REG_CLK_BYP_0, 19, + CLK_IS_CRITICAL), + CV1800B_BYPASS_MUX(CLK_PWM_SRC, "clk_pwm_src", clk_axi4_parents, + REG_CLK_EN_4, 4, + REG_DIV_CLK_PWM_SRC_0, 16, 6, 10, + REG_DIV_CLK_PWM_SRC_0, 8, 2, + REG_CLK_BYP_0, 15, + CLK_IS_CRITICAL), + CV1800B_BYPASS_MUX(CLK_AUDSRC, "clk_audsrc", clk_aud_parents, + REG_CLK_EN_4, 1, + REG_DIV_CLK_AUDSRC, 16, 8, 18, + REG_DIV_CLK_AUDSRC, 8, 2, + REG_CLK_BYP_1, 2, + 0), + CV1800B_BYPASS_MUX(CLK_SDMA_AUD0, "clk_sdma_aud0", clk_aud_parents, + REG_CLK_EN_1, 2, + REG_DIV_CLK_SDMA_AUD0, 16, 8, 18, + REG_DIV_CLK_SDMA_AUD0, 8, 2, + REG_CLK_BYP_0, 11, + 0), + CV1800B_BYPASS_MUX(CLK_SDMA_AUD1, "clk_sdma_aud1", clk_aud_parents, + REG_CLK_EN_1, 3, + REG_DIV_CLK_SDMA_AUD1, 16, 8, 18, + REG_DIV_CLK_SDMA_AUD1, 8, 2, + REG_CLK_BYP_0, 12, + 0), + CV1800B_BYPASS_MUX(CLK_SDMA_AUD2, "clk_sdma_aud2", clk_aud_parents, + REG_CLK_EN_1, 3, + REG_DIV_CLK_SDMA_AUD2, 16, 8, 18, + REG_DIV_CLK_SDMA_AUD2, 8, 2, + REG_CLK_BYP_0, 13, + 0), + CV1800B_BYPASS_MUX(CLK_SDMA_AUD3, "clk_sdma_aud3", clk_aud_parents, + REG_CLK_EN_1, 3, + REG_DIV_CLK_SDMA_AUD3, 16, 8, 18, + REG_DIV_CLK_SDMA_AUD3, 8, 2, + REG_CLK_BYP_0, 14, + 0), + CV1800B_BYPASS_MUX(CLK_CAM0_200, "clk_cam0_200", clk_cam0_200_parents, + REG_CLK_EN_1, 13, + REG_DIV_CLK_CAM0_200, 16, 4, 1, + REG_DIV_CLK_CAM0_200, 8, 2, + REG_CLK_BYP_0, 16, + CLK_IS_CRITICAL), + CV1800B_BYPASS_MUX(CLK_AXI_VIP, "clk_axi_vip", clk_vip_sys_parents, + REG_CLK_EN_2, 4, + REG_DIV_CLK_AXI_VIP, 16, 4, 3, + REG_DIV_CLK_AXI_VIP, 8, 2, + REG_CLK_BYP_0, 22, + 0), + CV1800B_BYPASS_MUX(CLK_SRC_VIP_SYS_0, "clk_src_vip_sys_0", clk_vip_sys_parents, + REG_CLK_EN_2, 5, + REG_DIV_CLK_SRC_VIP_SYS_0, 16, 4, 6, + REG_DIV_CLK_SRC_VIP_SYS_0, 8, 2, + REG_CLK_BYP_0, 23, + 0), + CV1800B_BYPASS_MUX(CLK_SRC_VIP_SYS_1, "clk_src_vip_sys_1", clk_vip_sys_parents, + REG_CLK_EN_2, 6, + REG_DIV_CLK_SRC_VIP_SYS_1, 16, 4, 6, + REG_DIV_CLK_SRC_VIP_SYS_1, 8, 2, + REG_CLK_BYP_0, 24, + 0), + CV1800B_BYPASS_MUX(CLK_SRC_VIP_SYS_2, "clk_src_vip_sys_2", clk_vip_sys_parents, + REG_CLK_EN_3, 29, + REG_DIV_CLK_SRC_VIP_SYS_2, 16, 4, 2, + REG_DIV_CLK_SRC_VIP_SYS_2, 8, 2, + REG_CLK_BYP_1, 1, + 0), + CV1800B_BYPASS_MUX(CLK_SRC_VIP_SYS_3, "clk_src_vip_sys_3", clk_vip_sys_parents, + REG_CLK_EN_4, 15, + REG_DIV_CLK_SRC_VIP_SYS_3, 16, 4, 2, + REG_DIV_CLK_SRC_VIP_SYS_3, 8, 2, + REG_CLK_BYP_1, 8, + 0), + CV1800B_BYPASS_MUX(CLK_SRC_VIP_SYS_4, "clk_src_vip_sys_4", clk_vip_sys_parents, + REG_CLK_EN_4, 16, + REG_DIV_CLK_SRC_VIP_SYS_4, 16, 4, 3, + REG_DIV_CLK_SRC_VIP_SYS_4, 8, 2, + REG_CLK_BYP_1, 9, + 0), + CV1800B_BYPASS_MUX(CLK_AXI_VIDEO_CODEC, "clk_axi_video_codec", clk_axi_video_codec_parents, + REG_CLK_EN_2, 8, + REG_DIV_CLK_AXI_VIDEO_CODEC, 16, 4, 2, + REG_DIV_CLK_AXI_VIDEO_CODEC, 8, 2, + REG_CLK_BYP_0, 26, + 0), + CV1800B_BYPASS_MUX(CLK_VC_SRC0, "clk_vc_src0", clk_vc_src0_parents, + REG_CLK_EN_2, 9, + REG_DIV_CLK_VC_SRC0, 16, 4, 2, + REG_DIV_CLK_VC_SRC0, 8, 2, + REG_CLK_BYP_0, 27, + 0), +}; + +struct cv1800b_clk_mmux cv1800b_mmux_info[] = { + CV1800B_MMUX(CLK_C906_0, "clk_c906_0", clk_c906_0_parents, + REG_CLK_EN_4, 13, + REG_DIV_CLK_C906_0_0, 16, 4, 1, + REG_DIV_CLK_C906_0_1, 16, 4, 2, + REG_DIV_CLK_C906_0_0, 8, 2, + REG_DIV_CLK_C906_0_1, 8, 2, + REG_CLK_BYP_1, 6, + REG_CLK_SEL_0, 23, + CLK_IS_CRITICAL | CLK_GET_RATE_NOCACHE), + CV1800B_MMUX(CLK_C906_1, "clk_c906_1", clk_c906_1_parents, + REG_CLK_EN_4, 14, + REG_DIV_CLK_C906_1_0, 16, 4, 2, + REG_DIV_CLK_C906_1_1, 16, 4, 3, + REG_DIV_CLK_C906_1_0, 8, 2, + REG_DIV_CLK_C906_1_1, 8, 2, + REG_CLK_BYP_1, 7, + REG_CLK_SEL_0, 24, + CLK_IS_CRITICAL | CLK_GET_RATE_NOCACHE), + CV1800B_MMUX(CLK_A53, "clk_a53", clk_a53_parents, + REG_CLK_EN_0, 0, + REG_DIV_CLK_A53_0, 16, 4, 1, + REG_DIV_CLK_A53_1, 16, 4, 2, + REG_DIV_CLK_A53_0, 8, 2, + REG_DIV_CLK_A53_1, 8, 2, + REG_CLK_BYP_0, 0, + REG_CLK_SEL_0, 0, + CLK_IS_CRITICAL | CLK_GET_RATE_NOCACHE), +}; + +static struct cv1800b_clk_audio cv1800b_audio_info[] = { + CV1800B_AUDIO(CLK_A24M, "clk_a24m", "clk_mipimpll", + REG_APLL_FRAC_DIV_CTRL, 0, + REG_APLL_FRAC_DIV_CTRL, 3, + REG_APLL_FRAC_DIV_CTRL, 1, + REG_APLL_FRAC_DIV_CTRL, 2, + REG_APLL_FRAC_DIV_M, 0, 22, + REG_APLL_FRAC_DIV_N, 0, 22, + 0), +}; + +static struct cv1800b_clk_ipll cv1800b_ipll_info[] = { + CV1800B_IPLL(CLK_FPLL, "clk_fpll", "osc", REG_FPLL_CSR, + REG_PLL_G6_CTRL, 8, + REG_PLL_G6_STATUS, 2, + CLK_IS_CRITICAL), + CV1800B_IPLL(CLK_MIPIMPLL, "clk_mipimpll", "osc", REG_MIPIMPLL_CSR, + REG_PLL_G2_CTRL, 0, + REG_PLL_G2_STATUS, 0, + CLK_IS_CRITICAL), +}; + +static struct cv1800b_clk_fpll cv1800b_fpll_info[] = { + CV1800B_FPLL(CLK_MPLL, "clk_mpll", "osc", REG_MPLL_CSR, + REG_PLL_G6_CTRL, 0, + REG_PLL_G6_STATUS, 0, + REG_PLL_G6_SSC_SYN_CTRL, 2, + REG_PLL_G6_SSC_SYN_CTRL, 0, + REG_MPLL_SSC_SYN_CTRL, REG_MPLL_SSC_SYN_SET, + CLK_IS_CRITICAL), + CV1800B_FPLL(CLK_TPLL, "clk_tpll", "osc", REG_TPLL_CSR, + REG_PLL_G6_CTRL, 4, + REG_PLL_G6_STATUS, 1, + REG_PLL_G6_SSC_SYN_CTRL, 3, + REG_PLL_G6_SSC_SYN_CTRL, 0, + REG_TPLL_SSC_SYN_CTRL, REG_TPLL_SSC_SYN_SET, + CLK_IS_CRITICAL), + CV1800B_FPLL(CLK_A0PLL, "clk_a0pll", "clk_mipimpll", REG_A0PLL_CSR, + REG_PLL_G2_CTRL, 4, + REG_PLL_G2_STATUS, 1, + REG_PLL_G2_SSC_SYN_CTRL, 2, + REG_PLL_G2_SSC_SYN_CTRL, 0, + REG_A0PLL_SSC_SYN_CTRL, REG_A0PLL_SSC_SYN_SET, + CLK_IS_CRITICAL), + CV1800B_FPLL(CLK_DISPPLL, "clk_disppll", "clk_mipimpll", REG_DISPPLL_CSR, + REG_PLL_G2_CTRL, 8, + REG_PLL_G2_STATUS, 2, + REG_PLL_G2_SSC_SYN_CTRL, 3, + REG_PLL_G2_SSC_SYN_CTRL, 0, + REG_DISPPLL_SSC_SYN_CTRL, REG_DISPPLL_SSC_SYN_SET, + CLK_IS_CRITICAL), + CV1800B_FPLL(CLK_CAM0PLL, "clk_cam0pll", "clk_mipimpll", REG_CAM0PLL_CSR, + REG_PLL_G2_CTRL, 12, + REG_PLL_G2_STATUS, 3, + REG_PLL_G2_SSC_SYN_CTRL, 4, + REG_PLL_G2_SSC_SYN_CTRL, 0, + REG_CAM0PLL_SSC_SYN_CTRL, REG_CAM0PLL_SSC_SYN_SET, + CLK_IGNORE_UNUSED), + CV1800B_FPLL(CLK_CAM1PLL, "clk_cam1pll", "clk_mipimpll", REG_CAM1PLL_CSR, + REG_PLL_G2_CTRL, 16, + REG_PLL_G2_STATUS, 4, + REG_PLL_G2_SSC_SYN_CTRL, 5, + REG_PLL_G2_SSC_SYN_CTRL, 0, + REG_CAM1PLL_SSC_SYN_CTRL, REG_CAM1PLL_SSC_SYN_SET, + CLK_IS_CRITICAL), +}; + +static int cv1800b_register_clk(struct udevice *dev) +{ + struct clk osc; + ulong osc_rate; + void *base = devfdt_get_addr_ptr(dev); + int i, ret; + + ret = clk_get_by_index(dev, 0, &osc); + if (ret) { + pr_err("Failed to get clock\n"); + return ret; + } + + osc_rate = clk_get_rate(&osc); + clk_dm(CV1800B_CLK_OSC, clk_register_fixed_rate(NULL, "osc", osc_rate)); + clk_dm(CV1800B_CLK_BYPASS, clk_register_fixed_rate(NULL, "bypass", osc_rate)); + + for (i = 0; i < ARRAY_SIZE(cv1800b_ipll_info); i++) { + struct cv1800b_clk_ipll *ipll = &cv1800b_ipll_info[i]; + + ipll->base = base; + ret = clk_register(&ipll->clk, "cv1800b_clk_ipll", ipll->name, + ipll->parent_name); + if (ret) { + pr_err("Failed to register ipll %s\n", ipll->name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_fpll_info); i++) { + struct cv1800b_clk_fpll *fpll = &cv1800b_fpll_info[i]; + + fpll->ipll.base = base; + ret = clk_register(&fpll->ipll.clk, "cv1800b_clk_fpll", + fpll->ipll.name, fpll->ipll.parent_name); + if (ret) { + pr_err("Failed to register fpll %s\n", fpll->ipll.name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_div_info); i++) { + struct cv1800b_clk_div *div = &cv1800b_div_info[i]; + + div->base = base; + ret = clk_register(&div->clk, "cv1800b_clk_div", div->name, + div->parent_name); + if (ret) { + pr_err("Failed to register div %s\n", div->name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_fixed_div_info); i++) { + struct cv1800b_clk_fixed_div *fixed_div = + &cv1800b_fixed_div_info[i]; + + fixed_div->base = base; + ret = clk_register(&fixed_div->clk, "cv1800b_clk_fixed_div", + fixed_div->name, fixed_div->parent_name); + if (ret) { + pr_err("Failed to register fixed div %s\n", + fixed_div->name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_bypass_fixed_div_info); i++) { + struct cv1800b_clk_bypass_fixed_div *bypass_fixed_div = + &cv1800b_bypass_fixed_div_info[i]; + + bypass_fixed_div->div.base = base; + ret = clk_register(&bypass_fixed_div->div.clk, + "cv1800b_clk_bypass_fixed_div", + bypass_fixed_div->div.name, + bypass_fixed_div->div.parent_name); + if (ret) { + pr_err("Failed to register bypass fixed div %s\n", + bypass_fixed_div->div.name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_mux_info); i++) { + struct cv1800b_clk_mux *mux = &cv1800b_mux_info[i]; + int parent; + + mux->base = base; + parent = cv1800b_clk_getfield(base, &mux->mux); + ret = clk_register(&mux->clk, "cv1800b_clk_mux", mux->name, + mux->parent_names[parent]); + if (ret) { + pr_err("Failed to register mux %s\n", mux->name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_mmux_info); i++) { + struct cv1800b_clk_mmux *mmux = &cv1800b_mmux_info[i]; + int clk_sel, parent, idx; + + mmux->base = base; + clk_sel = cv1800b_clk_getbit(base, &mmux->clk_sel) ? 0 : 1; + parent = cv1800b_clk_getfield(base, &mmux->mux[clk_sel]); + for (idx = 0; idx < mmux->num_parents; idx++) { + if (clk_sel == mmux->parent_infos[idx].clk_sel && + parent == mmux->parent_infos[idx].index) + break; + } + ret = clk_register(&mmux->clk, "cv1800b_clk_mmux", mmux->name, + mmux->parent_infos[idx].name); + if (ret) { + pr_err("Failed to register mmux %s\n", mmux->name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_audio_info); i++) { + struct cv1800b_clk_audio *audio = &cv1800b_audio_info[i]; + + audio->base = base; + ret = clk_register(&audio->clk, "cv1800b_clk_audio", + audio->name, audio->parent_name); + if (ret) { + pr_err("Failed to register audio %s\n", audio->name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_bypass_mux_info); i++) { + struct cv1800b_clk_bypass_mux *bypass_mux = + &cv1800b_bypass_mux_info[i]; + int parent; + + bypass_mux->mux.base = base; + parent = cv1800b_clk_getfield(base, &bypass_mux->mux.mux); + ret = clk_register(&bypass_mux->mux.clk, + "cv1800b_clk_bypass_mux", + bypass_mux->mux.name, + bypass_mux->mux.parent_names[parent]); + if (ret) { + pr_err("Failed to register bypass mux %s\n", + bypass_mux->mux.name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_bypass_div_info); i++) { + struct cv1800b_clk_bypass_div *bypass_div = + &cv1800b_bypass_div_info[i]; + + bypass_div->div.base = base; + ret = clk_register(&bypass_div->div.clk, + "cv1800b_clk_bypass_div", + bypass_div->div.name, + bypass_div->div.parent_name); + if (ret) { + pr_err("Failed to register bypass div %s\n", + bypass_div->div.name); + return ret; + } + } + + for (i = 0; i < ARRAY_SIZE(cv1800b_gate_info); i++) { + struct cv1800b_clk_gate *gate = &cv1800b_gate_info[i]; + + gate->base = base; + ret = clk_register(&gate->clk, "cv1800b_clk_gate", gate->name, + gate->parent_name); + if (ret) { + pr_err("Failed to register gate %s\n", gate->name); + return ret; + } + } + return 0; +} + +static int cv1800b_clk_probe(struct udevice *dev) +{ + return cv1800b_register_clk(dev); +} + +static int cv1800b_clk_enable(struct clk *clk) +{ + struct clk *c; + int err = clk_get_by_id(CV1800B_CLK_ID_TRANSFORM(clk->id), &c); + + if (err) + return err; + return clk_enable(c); +} + +static int cv1800b_clk_disable(struct clk *clk) +{ + struct clk *c; + int err = clk_get_by_id(CV1800B_CLK_ID_TRANSFORM(clk->id), &c); + + if (err) + return err; + return clk_disable(c); +} + +static ulong cv1800b_clk_get_rate(struct clk *clk) +{ + struct clk *c; + int err = clk_get_by_id(CV1800B_CLK_ID_TRANSFORM(clk->id), &c); + + if (err) + return err; + return clk_get_rate(c); +} + +static ulong cv1800b_clk_set_rate(struct clk *clk, ulong rate) +{ + struct clk *c; + int err = clk_get_by_id(CV1800B_CLK_ID_TRANSFORM(clk->id), &c); + + if (err) + return err; + return clk_set_rate(c, rate); +} + +static int cv1800b_clk_set_parent(struct clk *clk, struct clk *parent) +{ + struct clk *c, *p; + int err = clk_get_by_id(CV1800B_CLK_ID_TRANSFORM(clk->id), &c); + + if (err) + return err; + err = clk_get_by_id(CV1800B_CLK_ID_TRANSFORM(parent->id), &p); + if (err) + return err; + return clk_set_parent(c, p); +} + +const struct clk_ops cv1800b_clk_ops = { + .enable = cv1800b_clk_enable, + .disable = cv1800b_clk_disable, + .get_rate = cv1800b_clk_get_rate, + .set_rate = cv1800b_clk_set_rate, + .set_parent = cv1800b_clk_set_parent, +}; + +static const struct udevice_id cv1800b_clk_of_match[] = { + { .compatible = "sophgo,cv1800-clk" }, + { }, +}; + +U_BOOT_DRIVER(sophgo_clk) = { + .name = "cv1800b_clk", + .id = UCLASS_CLK, + .of_match = cv1800b_clk_of_match, + .probe = cv1800b_clk_probe, + .ops = &cv1800b_clk_ops, + .flags = DM_FLAG_PRE_RELOC, +}; diff --git a/drivers/clk/sophgo/clk-cv1800b.h b/drivers/clk/sophgo/clk-cv1800b.h new file mode 100644 index 00000000000..1e7107b5d05 --- /dev/null +++ b/drivers/clk/sophgo/clk-cv1800b.h @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> + */ + +#ifndef _CLK_SOPHGO_CV1800_H_ +#define _CLK_SOPHGO_CV1800_H_ + +#include <dt-bindings/clock/sophgo,cv1800.h> + +#define CV1800_CLK_MAX (CLK_XTAL_AP + 1) +#define CV1810_CLK_MAX (CLK_DISP_SRC_VIP + 1) + +#define REG_PLL_G2_CTRL 0x800 +#define REG_PLL_G2_STATUS 0x804 +#define REG_MIPIMPLL_CSR 0x808 +#define REG_A0PLL_CSR 0x80C +#define REG_DISPPLL_CSR 0x810 +#define REG_CAM0PLL_CSR 0x814 +#define REG_CAM1PLL_CSR 0x818 +#define REG_PLL_G2_SSC_SYN_CTRL 0x840 +#define REG_A0PLL_SSC_SYN_CTRL 0x850 +#define REG_A0PLL_SSC_SYN_SET 0x854 +#define REG_A0PLL_SSC_SYN_SPAN 0x858 +#define REG_A0PLL_SSC_SYN_STEP 0x85C +#define REG_DISPPLL_SSC_SYN_CTRL 0x860 +#define REG_DISPPLL_SSC_SYN_SET 0x864 +#define REG_DISPPLL_SSC_SYN_SPAN 0x868 +#define REG_DISPPLL_SSC_SYN_STEP 0x86C +#define REG_CAM0PLL_SSC_SYN_CTRL 0x870 +#define REG_CAM0PLL_SSC_SYN_SET 0x874 +#define REG_CAM0PLL_SSC_SYN_SPAN 0x878 +#define REG_CAM0PLL_SSC_SYN_STEP 0x87C +#define REG_CAM1PLL_SSC_SYN_CTRL 0x880 +#define REG_CAM1PLL_SSC_SYN_SET 0x884 +#define REG_CAM1PLL_SSC_SYN_SPAN 0x888 +#define REG_CAM1PLL_SSC_SYN_STEP 0x88C +#define REG_APLL_FRAC_DIV_CTRL 0x890 +#define REG_APLL_FRAC_DIV_M 0x894 +#define REG_APLL_FRAC_DIV_N 0x898 +#define REG_MIPIMPLL_CLK_CSR 0x8A0 +#define REG_A0PLL_CLK_CSR 0x8A4 +#define REG_DISPPLL_CLK_CSR 0x8A8 +#define REG_CAM0PLL_CLK_CSR 0x8AC +#define REG_CAM1PLL_CLK_CSR 0x8B0 +#define REG_CLK_CAM0_SRC_DIV 0x8C0 +#define REG_CLK_CAM1_SRC_DIV 0x8C4 + +/* top_pll_g6 */ +#define REG_PLL_G6_CTRL 0x900 +#define REG_PLL_G6_STATUS 0x904 +#define REG_MPLL_CSR 0x908 +#define REG_TPLL_CSR 0x90C +#define REG_FPLL_CSR 0x910 +#define REG_PLL_G6_SSC_SYN_CTRL 0x940 +#define REG_DPLL_SSC_SYN_CTRL 0x950 +#define REG_DPLL_SSC_SYN_SET 0x954 +#define REG_DPLL_SSC_SYN_SPAN 0x958 +#define REG_DPLL_SSC_SYN_STEP 0x95C +#define REG_MPLL_SSC_SYN_CTRL 0x960 +#define REG_MPLL_SSC_SYN_SET 0x964 +#define REG_MPLL_SSC_SYN_SPAN 0x968 +#define REG_MPLL_SSC_SYN_STEP 0x96C +#define REG_TPLL_SSC_SYN_CTRL 0x970 +#define REG_TPLL_SSC_SYN_SET 0x974 +#define REG_TPLL_SSC_SYN_SPAN 0x978 +#define REG_TPLL_SSC_SYN_STEP 0x97C + +/* clkgen */ +#define REG_CLK_EN_0 0x000 +#define REG_CLK_EN_1 0x004 +#define REG_CLK_EN_2 0x008 +#define REG_CLK_EN_3 0x00C +#define REG_CLK_EN_4 0x010 +#define REG_CLK_SEL_0 0x020 +#define REG_CLK_BYP_0 0x030 +#define REG_CLK_BYP_1 0x034 + +#define REG_DIV_CLK_A53_0 0x040 +#define REG_DIV_CLK_A53_1 0x044 +#define REG_DIV_CLK_CPU_AXI0 0x048 +#define REG_DIV_CLK_CPU_GIC 0x050 +#define REG_DIV_CLK_TPU 0x054 +#define REG_DIV_CLK_EMMC 0x064 +#define REG_DIV_CLK_EMMC_100K 0x06C +#define REG_DIV_CLK_SD0 0x070 +#define REG_DIV_CLK_SD0_100K 0x078 +#define REG_DIV_CLK_SD1 0x07C +#define REG_DIV_CLK_SD1_100K 0x084 +#define REG_DIV_CLK_SPI_NAND 0x088 +#define REG_DIV_CLK_ETH0_500M 0x08C +#define REG_DIV_CLK_ETH1_500M 0x090 +#define REG_DIV_CLK_GPIO_DB 0x094 +#define REG_DIV_CLK_SDMA_AUD0 0x098 +#define REG_DIV_CLK_SDMA_AUD1 0x09C +#define REG_DIV_CLK_SDMA_AUD2 0x0A0 +#define REG_DIV_CLK_SDMA_AUD3 0x0A4 +#define REG_DIV_CLK_CAM0_200 0x0A8 +#define REG_DIV_CLK_AXI4 0x0B8 +#define REG_DIV_CLK_AXI6 0x0BC +#define REG_DIV_CLK_DSI_ESC 0x0C4 +#define REG_DIV_CLK_AXI_VIP 0x0C8 +#define REG_DIV_CLK_SRC_VIP_SYS_0 0x0D0 +#define REG_DIV_CLK_SRC_VIP_SYS_1 0x0D8 +#define REG_DIV_CLK_DISP_SRC_VIP 0x0E0 +#define REG_DIV_CLK_AXI_VIDEO_CODEC 0x0E4 +#define REG_DIV_CLK_VC_SRC0 0x0EC +#define REG_DIV_CLK_1M 0x0FC +#define REG_DIV_CLK_SPI 0x100 +#define REG_DIV_CLK_I2C 0x104 +#define REG_DIV_CLK_SRC_VIP_SYS_2 0x110 +#define REG_DIV_CLK_AUDSRC 0x118 +#define REG_DIV_CLK_PWM_SRC_0 0x120 +#define REG_DIV_CLK_AP_DEBUG 0x128 +#define REG_DIV_CLK_RTCSYS_SRC_0 0x12C +#define REG_DIV_CLK_C906_0_0 0x130 +#define REG_DIV_CLK_C906_0_1 0x134 +#define REG_DIV_CLK_C906_1_0 0x138 +#define REG_DIV_CLK_C906_1_1 0x13C +#define REG_DIV_CLK_SRC_VIP_SYS_3 0x140 +#define REG_DIV_CLK_SRC_VIP_SYS_4 0x144 + +#endif /* _CLK_SOPHGO_CV1800_H_ */ diff --git a/drivers/clk/sophgo/clk-ip.c b/drivers/clk/sophgo/clk-ip.c new file mode 100644 index 00000000000..d571fa671b0 --- /dev/null +++ b/drivers/clk/sophgo/clk-ip.c @@ -0,0 +1,594 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com> + */ + +#include <dm.h> +#include <div64.h> +#include <linux/clk-provider.h> +#include <linux/io.h> + +#include "clk-common.h" +#include "clk-ip.h" + +static int get_parent_index(struct clk *clk, const char *const *parent_name, + u8 num_parents) +{ + const char *name = clk_hw_get_name(clk); + int i; + + for (i = 0; i < num_parents; i++) { + if (!strcmp(name, parent_name[i])) + return i; + } + + return -1; +} + +/* GATE */ +#define to_cv1800b_clk_gate(_clk) \ + container_of(_clk, struct cv1800b_clk_gate, clk) + +static int gate_enable(struct clk *clk) +{ + struct cv1800b_clk_gate *gate = to_cv1800b_clk_gate(clk); + + return cv1800b_clk_setbit(gate->base, &gate->gate); +} + +static int gate_disable(struct clk *clk) +{ + struct cv1800b_clk_gate *gate = to_cv1800b_clk_gate(clk); + + return cv1800b_clk_clrbit(gate->base, &gate->gate); +} + +static ulong gate_get_rate(struct clk *clk) +{ + return clk_get_parent_rate(clk); +} + +const struct clk_ops cv1800b_clk_gate_ops = { + .disable = gate_disable, + .enable = gate_enable, + .get_rate = gate_get_rate, +}; + +U_BOOT_DRIVER(cv1800b_clk_gate) = { + .name = "cv1800b_clk_gate", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_gate_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +/* DIV */ +#define CLK_DIV_EN_FACTOR BIT(3) + +#define to_cv1800b_clk_div(_clk) container_of(_clk, struct cv1800b_clk_div, clk) + +static int div_enable(struct clk *clk) +{ + struct cv1800b_clk_div *div = to_cv1800b_clk_div(clk); + + return cv1800b_clk_setbit(div->base, &div->gate); +} + +static int div_disable(struct clk *clk) +{ + struct cv1800b_clk_div *div = to_cv1800b_clk_div(clk); + + return cv1800b_clk_clrbit(div->base, &div->gate); +} + +static ulong div_get_rate(struct clk *clk) +{ + struct cv1800b_clk_div *div = to_cv1800b_clk_div(clk); + ulong val; + + if (div->div_init == 0 || + readl(div->base + div->div.offset) & CLK_DIV_EN_FACTOR) + val = cv1800b_clk_getfield(div->base, &div->div); + else + val = div->div_init; + + return DIV_ROUND_UP_ULL(clk_get_parent_rate(clk), val); +} + +static ulong div_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_div *div = to_cv1800b_clk_div(clk); + ulong parent_rate = clk_get_parent_rate(clk); + u32 val; + + val = DIV_ROUND_UP_ULL(parent_rate, rate); + val = min_t(u32, val, clk_div_mask(div->div.width)); + + cv1800b_clk_setfield(div->base, &div->div, val); + if (div->div_init > 0) + setbits_le32(div->base + div->div.offset, CLK_DIV_EN_FACTOR); + + return DIV_ROUND_UP_ULL(parent_rate, val); +} + +const struct clk_ops cv1800b_clk_div_ops = { + .disable = div_disable, + .enable = div_enable, + .get_rate = div_get_rate, + .set_rate = div_set_rate, +}; + +U_BOOT_DRIVER(cv1800b_clk_div) = { + .name = "cv1800b_clk_div", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_div_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +#define to_cv1800b_clk_bypass_div(_clk) \ + container_of(_clk, struct cv1800b_clk_bypass_div, div.clk) + +static ulong bypass_div_get_rate(struct clk *clk) +{ + struct cv1800b_clk_bypass_div *div = to_cv1800b_clk_bypass_div(clk); + + if (cv1800b_clk_getbit(div->div.base, &div->bypass)) + return 0; + + return div_get_rate(clk); +} + +static ulong bypass_div_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_bypass_div *div = to_cv1800b_clk_bypass_div(clk); + + if (cv1800b_clk_getbit(div->div.base, &div->bypass)) + return 0; + + return div_set_rate(clk, rate); +} + +static int bypass_div_set_parent(struct clk *clk, struct clk *pclk) +{ + struct cv1800b_clk_bypass_div *div = to_cv1800b_clk_bypass_div(clk); + + if (pclk->id == CV1800B_CLK_BYPASS) { + cv1800b_clk_setbit(div->div.base, &div->bypass); + return 0; + } + + if (strcmp(clk_hw_get_name(pclk), div->div.parent_name)) + return -EINVAL; + + cv1800b_clk_clrbit(div->div.base, &div->bypass); + return 0; +} + +const struct clk_ops cv1800b_clk_bypass_div_ops = { + .disable = div_disable, + .enable = div_enable, + .get_rate = bypass_div_get_rate, + .set_rate = bypass_div_set_rate, + .set_parent = bypass_div_set_parent, +}; + +U_BOOT_DRIVER(cv1800b_clk_bypass_div) = { + .name = "cv1800b_clk_bypass_div", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_bypass_div_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +/* FIXED DIV */ +#define to_cv1800b_clk_fixed_div(_clk) \ + container_of(_clk, struct cv1800b_clk_fixed_div, clk) + +static int fixed_div_enable(struct clk *clk) +{ + struct cv1800b_clk_fixed_div *div = to_cv1800b_clk_fixed_div(clk); + + return cv1800b_clk_setbit(div->base, &div->gate); +} + +static int fixed_div_disable(struct clk *clk) +{ + struct cv1800b_clk_fixed_div *div = to_cv1800b_clk_fixed_div(clk); + + return cv1800b_clk_clrbit(div->base, &div->gate); +} + +static ulong fixed_div_get_rate(struct clk *clk) +{ + struct cv1800b_clk_fixed_div *div = to_cv1800b_clk_fixed_div(clk); + + return DIV_ROUND_UP_ULL(clk_get_parent_rate(clk), div->div); +} + +const struct clk_ops cv1800b_clk_fixed_div_ops = { + .disable = fixed_div_disable, + .enable = fixed_div_enable, + .get_rate = fixed_div_get_rate, +}; + +U_BOOT_DRIVER(cv1800b_clk_fixed_div) = { + .name = "cv1800b_clk_fixed_div", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_fixed_div_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +#define to_cv1800b_clk_bypass_fixed_div(_clk) \ + container_of(_clk, struct cv1800b_clk_bypass_fixed_div, div.clk) + +static ulong bypass_fixed_div_get_rate(struct clk *clk) +{ + struct cv1800b_clk_bypass_fixed_div *div = + to_cv1800b_clk_bypass_fixed_div(clk); + + if (cv1800b_clk_getbit(div->div.base, &div->bypass)) + return 0; + + return fixed_div_get_rate(clk); +} + +static int bypass_fixed_div_set_parent(struct clk *clk, struct clk *pclk) +{ + struct cv1800b_clk_bypass_fixed_div *div = + to_cv1800b_clk_bypass_fixed_div(clk); + + if (pclk->id == CV1800B_CLK_BYPASS) { + cv1800b_clk_setbit(div->div.base, &div->bypass); + return 0; + } + + if (strcmp(clk_hw_get_name(pclk), div->div.parent_name)) + return -EINVAL; + + cv1800b_clk_clrbit(div->div.base, &div->bypass); + return 0; +} + +const struct clk_ops cv1800b_clk_bypass_fixed_div_ops = { + .disable = fixed_div_disable, + .enable = fixed_div_enable, + .get_rate = bypass_fixed_div_get_rate, + .set_parent = bypass_fixed_div_set_parent, +}; + +U_BOOT_DRIVER(cv1800b_clk_bypass_fixed_div) = { + .name = "cv1800b_clk_bypass_fixed_div", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_bypass_fixed_div_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +/* MUX */ +#define to_cv1800b_clk_mux(_clk) container_of(_clk, struct cv1800b_clk_mux, clk) + +static int mux_enable(struct clk *clk) +{ + struct cv1800b_clk_mux *mux = to_cv1800b_clk_mux(clk); + + return cv1800b_clk_setbit(mux->base, &mux->gate); +} + +static int mux_disable(struct clk *clk) +{ + struct cv1800b_clk_mux *mux = to_cv1800b_clk_mux(clk); + + return cv1800b_clk_clrbit(mux->base, &mux->gate); +} + +static ulong mux_get_rate(struct clk *clk) +{ + struct cv1800b_clk_mux *mux = to_cv1800b_clk_mux(clk); + ulong val; + + if (mux->div_init == 0 || + readl(mux->base + mux->div.offset) & CLK_DIV_EN_FACTOR) + val = cv1800b_clk_getfield(mux->base, &mux->div); + else + val = mux->div_init; + + return DIV_ROUND_UP_ULL(clk_get_parent_rate(clk), val); +} + +static ulong mux_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_mux *mux = to_cv1800b_clk_mux(clk); + ulong parent_rate = clk_get_parent_rate(clk); + ulong val; + + val = DIV_ROUND_UP_ULL(parent_rate, rate); + val = min_t(u32, val, clk_div_mask(mux->div.width)); + + cv1800b_clk_setfield(mux->base, &mux->div, val); + if (mux->div_init > 0) + setbits_le32(mux->base + mux->div.offset, CLK_DIV_EN_FACTOR); + + return DIV_ROUND_UP_ULL(parent_rate, val); +} + +static int mux_set_parent(struct clk *clk, struct clk *pclk) +{ + struct cv1800b_clk_mux *mux = to_cv1800b_clk_mux(clk); + int index = get_parent_index(pclk, mux->parent_names, mux->num_parents); + + if (index < 0) + return -EINVAL; + + cv1800b_clk_setfield(mux->base, &mux->mux, index); + return 0; +} + +const struct clk_ops cv1800b_clk_mux_ops = { + .disable = mux_disable, + .enable = mux_enable, + .get_rate = mux_get_rate, + .set_rate = mux_set_rate, + .set_parent = mux_set_parent, +}; + +U_BOOT_DRIVER(cv1800b_clk_mux) = { + .name = "cv1800b_clk_mux", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_mux_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +#define to_cv1800b_clk_bypass_mux(_clk) \ + container_of(_clk, struct cv1800b_clk_bypass_mux, mux.clk) + +static ulong bypass_mux_get_rate(struct clk *clk) +{ + struct cv1800b_clk_bypass_mux *mux = to_cv1800b_clk_bypass_mux(clk); + + if (cv1800b_clk_getbit(mux->mux.base, &mux->bypass)) + return 0; + + return mux_get_rate(clk); +} + +static ulong bypass_mux_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_bypass_mux *mux = to_cv1800b_clk_bypass_mux(clk); + + if (cv1800b_clk_getbit(mux->mux.base, &mux->bypass)) + return 0; + + return mux_set_rate(clk, rate); +} + +static int bypass_mux_set_parent(struct clk *clk, struct clk *pclk) +{ + struct cv1800b_clk_bypass_mux *mux = to_cv1800b_clk_bypass_mux(clk); + int index; + + if (pclk->id == CV1800B_CLK_BYPASS) { + cv1800b_clk_setbit(mux->mux.base, &mux->bypass); + return 0; + } + + index = get_parent_index(pclk, mux->mux.parent_names, + mux->mux.num_parents); + if (index < 0) + return -EINVAL; + + cv1800b_clk_clrbit(mux->mux.base, &mux->bypass); + cv1800b_clk_setfield(mux->mux.base, &mux->mux.mux, index); + return 0; +} + +const struct clk_ops cv1800b_clk_bypass_mux_ops = { + .disable = mux_disable, + .enable = mux_enable, + .get_rate = bypass_mux_get_rate, + .set_rate = bypass_mux_set_rate, + .set_parent = bypass_mux_set_parent, +}; + +U_BOOT_DRIVER(cv1800b_clk_bypass_mux) = { + .name = "cv1800b_clk_bypass_mux", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_bypass_mux_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +/* MMUX */ +#define to_cv1800b_clk_mmux(_clk) \ + container_of(_clk, struct cv1800b_clk_mmux, clk) + +static int mmux_enable(struct clk *clk) +{ + struct cv1800b_clk_mmux *mmux = to_cv1800b_clk_mmux(clk); + + return cv1800b_clk_setbit(mmux->base, &mmux->gate); +} + +static int mmux_disable(struct clk *clk) +{ + struct cv1800b_clk_mmux *mmux = to_cv1800b_clk_mmux(clk); + + return cv1800b_clk_clrbit(mmux->base, &mmux->gate); +} + +static ulong mmux_get_rate(struct clk *clk) +{ + struct cv1800b_clk_mmux *mmux = to_cv1800b_clk_mmux(clk); + int clk_sel = 1; + ulong reg, val; + + if (cv1800b_clk_getbit(mmux->base, &mmux->bypass)) + return 0; + + if (cv1800b_clk_getbit(mmux->base, &mmux->clk_sel)) + clk_sel = 0; + + reg = readl(mmux->base + mmux->div[clk_sel].offset); + + if (mmux->div_init[clk_sel] == 0 || reg & CLK_DIV_EN_FACTOR) + val = cv1800b_clk_getfield(mmux->base, &mmux->div[clk_sel]); + else + val = mmux->div_init[clk_sel]; + + return DIV_ROUND_UP_ULL(clk_get_parent_rate(clk), val); +} + +static ulong mmux_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_mmux *mmux = to_cv1800b_clk_mmux(clk); + int clk_sel = 1; + ulong parent_rate = clk_get_parent_rate(clk); + ulong val; + + if (cv1800b_clk_getbit(mmux->base, &mmux->bypass)) + return 0; + + if (cv1800b_clk_getbit(mmux->base, &mmux->clk_sel)) + clk_sel = 0; + + val = DIV_ROUND_UP_ULL(parent_rate, rate); + val = min_t(u32, val, clk_div_mask(mmux->div[clk_sel].width)); + + cv1800b_clk_setfield(mmux->base, &mmux->div[clk_sel], val); + if (mmux->div_init[clk_sel] > 0) + setbits_le32(mmux->base + mmux->div[clk_sel].offset, + CLK_DIV_EN_FACTOR); + + return DIV_ROUND_UP_ULL(parent_rate, val); +} + +static int mmux_set_parent(struct clk *clk, struct clk *pclk) +{ + struct cv1800b_clk_mmux *mmux = to_cv1800b_clk_mmux(clk); + const char *pname = clk_hw_get_name(pclk); + int i; + u8 clk_sel, index; + + if (pclk->id == CV1800B_CLK_BYPASS) { + cv1800b_clk_setbit(mmux->base, &mmux->bypass); + return 0; + } + + for (i = 0; i < mmux->num_parents; i++) { + if (!strcmp(pname, mmux->parent_infos[i].name)) + break; + } + + if (i == mmux->num_parents) + return -EINVAL; + + clk_sel = mmux->parent_infos[i].clk_sel; + index = mmux->parent_infos[i].index; + cv1800b_clk_clrbit(mmux->base, &mmux->bypass); + if (clk_sel) + cv1800b_clk_clrbit(mmux->base, &mmux->clk_sel); + else + cv1800b_clk_setbit(mmux->base, &mmux->clk_sel); + + cv1800b_clk_setfield(mmux->base, &mmux->mux[clk_sel], index); + return 0; +} + +const struct clk_ops cv1800b_clk_mmux_ops = { + .disable = mmux_disable, + .enable = mmux_enable, + .get_rate = mmux_get_rate, + .set_rate = mmux_set_rate, + .set_parent = mmux_set_parent, +}; + +U_BOOT_DRIVER(cv1800b_clk_mmux) = { + .name = "cv1800b_clk_mmux", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_mmux_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +/* AUDIO CLK */ +#define to_cv1800b_clk_audio(_clk) \ + container_of(_clk, struct cv1800b_clk_audio, clk) + +static int aclk_enable(struct clk *clk) +{ + struct cv1800b_clk_audio *aclk = to_cv1800b_clk_audio(clk); + + cv1800b_clk_setbit(aclk->base, &aclk->src_en); + cv1800b_clk_setbit(aclk->base, &aclk->output_en); + return 0; +} + +static int aclk_disable(struct clk *clk) +{ + struct cv1800b_clk_audio *aclk = to_cv1800b_clk_audio(clk); + + cv1800b_clk_clrbit(aclk->base, &aclk->src_en); + cv1800b_clk_clrbit(aclk->base, &aclk->output_en); + return 0; +} + +static ulong aclk_get_rate(struct clk *clk) +{ + struct cv1800b_clk_audio *aclk = to_cv1800b_clk_audio(clk); + u64 parent_rate = clk_get_parent_rate(clk); + u32 m, n; + + if (!cv1800b_clk_getbit(aclk->base, &aclk->div_en)) + return 0; + + m = cv1800b_clk_getfield(aclk->base, &aclk->m); + n = cv1800b_clk_getfield(aclk->base, &aclk->n); + + return DIV_ROUND_UP_ULL(n * parent_rate, m * 2); +} + +static u32 gcd(u32 a, u32 b) +{ + u32 t; + + while (b != 0) { + t = a % b; + a = b; + b = t; + } + return a; +} + +static void aclk_determine_mn(ulong parent_rate, ulong rate, u32 *m, u32 *n) +{ + u32 tm = parent_rate / 2; + u32 tn = rate; + u32 tcommon = gcd(tm, tn); + *m = tm / tcommon; + *n = tn / tcommon; +} + +static ulong aclk_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_audio *aclk = to_cv1800b_clk_audio(clk); + ulong parent_rate = clk_get_parent_rate(clk); + u32 m, n; + + aclk_determine_mn(parent_rate, rate, &m, &n); + + cv1800b_clk_setfield(aclk->base, &aclk->m, m); + cv1800b_clk_setfield(aclk->base, &aclk->n, n); + + cv1800b_clk_setbit(aclk->base, &aclk->div_en); + cv1800b_clk_setbit(aclk->base, &aclk->div_up); + + return DIV_ROUND_UP_ULL(parent_rate * n, m * 2); +} + +const struct clk_ops cv1800b_clk_audio_ops = { + .disable = aclk_disable, + .enable = aclk_enable, + .get_rate = aclk_get_rate, + .set_rate = aclk_set_rate, +}; + +U_BOOT_DRIVER(cv1800b_clk_audio) = { + .name = "cv1800b_clk_audio", + .id = UCLASS_CLK, + .ops = &cv1800b_clk_audio_ops, + .flags = DM_FLAG_PRE_RELOC, +}; diff --git a/drivers/clk/sophgo/clk-ip.h b/drivers/clk/sophgo/clk-ip.h new file mode 100644 index 00000000000..09d15d86dc9 --- /dev/null +++ b/drivers/clk/sophgo/clk-ip.h @@ -0,0 +1,288 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + * + */ + +#ifndef __CLK_SOPHGO_IP_H__ +#define __CLK_SOPHGO_IP_H__ + +#include <clk.h> + +#include "clk-common.h" + +struct cv1800b_mmux_parent_info { + const char *name; + u8 clk_sel; + u8 index; +}; + +struct cv1800b_clk_gate { + struct clk clk; + const char *name; + const char *parent_name; + void __iomem *base; + struct cv1800b_clk_regbit gate; +}; + +struct cv1800b_clk_div { + struct clk clk; + const char *name; + const char *parent_name; + void __iomem *base; + struct cv1800b_clk_regbit gate; + struct cv1800b_clk_regfield div; + int div_init; +}; + +struct cv1800b_clk_bypass_div { + struct cv1800b_clk_div div; + struct cv1800b_clk_regbit bypass; +}; + +struct cv1800b_clk_fixed_div { + struct clk clk; + const char *name; + const char *parent_name; + void __iomem *base; + struct cv1800b_clk_regbit gate; + int div; +}; + +struct cv1800b_clk_bypass_fixed_div { + struct cv1800b_clk_fixed_div div; + struct cv1800b_clk_regbit bypass; +}; + +struct cv1800b_clk_mux { + struct clk clk; + const char *name; + const char * const *parent_names; + u8 num_parents; + void __iomem *base; + struct cv1800b_clk_regbit gate; + struct cv1800b_clk_regfield div; + int div_init; + struct cv1800b_clk_regfield mux; +}; + +struct cv1800b_clk_bypass_mux { + struct cv1800b_clk_mux mux; + struct cv1800b_clk_regbit bypass; +}; + +struct cv1800b_clk_mmux { + struct clk clk; + const char *name; + const struct cv1800b_mmux_parent_info *parent_infos; + u8 num_parents; + void __iomem *base; + struct cv1800b_clk_regbit gate; + struct cv1800b_clk_regfield div[2]; + int div_init[2]; + struct cv1800b_clk_regfield mux[2]; + struct cv1800b_clk_regbit bypass; + struct cv1800b_clk_regbit clk_sel; +}; + +struct cv1800b_clk_audio { + struct clk clk; + const char *name; + const char *parent_name; + void __iomem *base; + struct cv1800b_clk_regbit src_en; + struct cv1800b_clk_regbit output_en; + struct cv1800b_clk_regbit div_en; + struct cv1800b_clk_regbit div_up; + struct cv1800b_clk_regfield m; + struct cv1800b_clk_regfield n; +}; + +#define CV1800B_GATE(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_name = _parent, \ + .gate = CV1800B_CLK_REGBIT(_gate_offset, _gate_shift), \ + } + +#define CV1800B_DIV(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _div_offset, _div_shift, _div_width, \ + _div_init, _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_name = _parent, \ + .gate = CV1800B_CLK_REGBIT(_gate_offset, _gate_shift), \ + .div = CV1800B_CLK_REGFIELD(_div_offset, _div_shift, \ + _div_width), \ + .div_init = _div_init, \ + } + +#define CV1800B_BYPASS_DIV(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _div_offset, _div_shift, \ + _div_width, _div_init, \ + _bypass_offset, _bypass_shift, \ + _flags) \ + { \ + .div = CV1800B_DIV(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _div_offset, _div_shift, _div_width, \ + _div_init, _flags), \ + .bypass = CV1800B_CLK_REGBIT(_bypass_offset, \ + _bypass_shift), \ + } + +#define CV1800B_FIXED_DIV(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _div, _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_name = _parent, \ + .gate = CV1800B_CLK_REGBIT(_gate_offset, _gate_shift), \ + .div = _div, \ + } + +#define CV1800B_BYPASS_FIXED_DIV(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _div, \ + _bypass_offset, _bypass_shift, \ + _flags) \ + { \ + .div = CV1800B_FIXED_DIV(_id, _name, _parent, \ + _gate_offset, _gate_shift, \ + _div, _flags), \ + .bypass = CV1800B_CLK_REGBIT(_bypass_offset, \ + _bypass_shift) \ + } + +#define CV1800B_MUX(_id, _name, _parents, \ + _gate_offset, _gate_shift, \ + _div_offset, _div_shift, _div_width, _div_init, \ + _mux_offset, _mux_shift, _mux_width, \ + _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_names = _parents, \ + .num_parents = ARRAY_SIZE(_parents), \ + .gate = CV1800B_CLK_REGBIT(_gate_offset, _gate_shift), \ + .div = CV1800B_CLK_REGFIELD(_div_offset, _div_shift, \ + _div_width), \ + .div_init = _div_init, \ + .mux = CV1800B_CLK_REGFIELD(_mux_offset, _mux_shift, \ + _mux_width), \ + } + +#define CV1800B_BYPASS_MUX(_id, _name, _parents, \ + _gate_offset, _gate_shift, \ + _div_offset, _div_shift, \ + _div_width, _div_init, \ + _mux_offset, _mux_shift, _mux_width, \ + _bypass_offset, _bypass_shift, \ + _flags) \ + { \ + .mux = CV1800B_MUX(_id, _name, _parents, \ + _gate_offset, _gate_shift, \ + _div_offset, _div_shift, \ + _div_width, _div_init, \ + _mux_offset, _mux_shift, _mux_width, \ + _flags), \ + .bypass = CV1800B_CLK_REGBIT(_bypass_offset, \ + _bypass_shift), \ + } + +#define CV1800B_MMUX(_id, _name, _parents, \ + _gate_offset, _gate_shift, \ + _div0_offset, _div0_shift, _div0_width, _div0_init,\ + _div1_offset, _div1_shift, _div1_width, _div1_init,\ + _mux0_offset, _mux0_shift, _mux0_width, \ + _mux1_offset, _mux1_shift, _mux1_width, \ + _bypass_offset, _bypass_shift, \ + _clk_sel_offset, _clk_sel_shift, \ + _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_infos = _parents, \ + .num_parents = ARRAY_SIZE(_parents), \ + .gate = CV1800B_CLK_REGBIT(_gate_offset, _gate_shift), \ + .div = { \ + CV1800B_CLK_REGFIELD(_div0_offset, _div0_shift, \ + _div0_width), \ + CV1800B_CLK_REGFIELD(_div1_offset, _div1_shift, \ + _div1_width), \ + }, \ + .div_init = { _div0_init, _div1_init }, \ + .mux = { \ + CV1800B_CLK_REGFIELD(_mux0_offset, _mux0_shift, \ + _mux0_width), \ + CV1800B_CLK_REGFIELD(_mux1_offset, _mux1_shift, \ + _mux1_width), \ + }, \ + .bypass = CV1800B_CLK_REGBIT(_bypass_offset, \ + _bypass_shift), \ + .clk_sel = CV1800B_CLK_REGBIT(_clk_sel_offset, \ + _clk_sel_shift), \ + } + +#define CV1800B_AUDIO(_id, _name, _parent, \ + _src_en_offset, _src_en_shift, \ + _output_en_offset, _output_en_shift, \ + _div_en_offset, _div_en_shift, \ + _div_up_offset, _div_up_shift, \ + _m_offset, _m_shift, _m_width, \ + _n_offset, _n_shift, _n_width, \ + _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_name = _parent, \ + .src_en = CV1800B_CLK_REGBIT(_src_en_offset, \ + _src_en_shift), \ + .output_en = CV1800B_CLK_REGBIT(_output_en_offset, \ + _output_en_shift), \ + .div_en = CV1800B_CLK_REGBIT(_div_en_offset, \ + _div_en_shift), \ + .div_up = CV1800B_CLK_REGBIT(_div_up_offset, \ + _div_up_shift), \ + .m = CV1800B_CLK_REGFIELD(_m_offset, _m_shift, \ + _m_width), \ + .n = CV1800B_CLK_REGFIELD(_n_offset, _n_shift, \ + _n_width), \ + } + +extern const struct clk_ops cv1800b_clk_gate_ops; +extern const struct clk_ops cv1800b_clk_div_ops; +extern const struct clk_ops cv1800b_clk_bypass_div_ops; +extern const struct clk_ops cv1800b_clk_fixed_div_ops; +extern const struct clk_ops cv1800b_clk_bypass_fixed_div_ops; +extern const struct clk_ops cv1800b_clk_mux_ops; +extern const struct clk_ops cv1800b_clk_bypass_mux_ops; +extern const struct clk_ops cv1800b_clk_mmux_ops; +extern const struct clk_ops cv1800b_clk_audio_ops; + +#endif /* __CLK_SOPHGO_IP_H__ */ diff --git a/drivers/clk/sophgo/clk-pll.c b/drivers/clk/sophgo/clk-pll.c new file mode 100644 index 00000000000..c99aa0b4e44 --- /dev/null +++ b/drivers/clk/sophgo/clk-pll.c @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + */ + +#include <clk-uclass.h> +#include <dm.h> +#include <div64.h> +#include <linux/bitfield.h> +#include <linux/clk-provider.h> +#include <linux/kernel.h> + +#include "clk-common.h" +#include "clk-pll.h" + +#define PLL_PRE_DIV_MIN 1 +#define PLL_PRE_DIV_MAX 127 +#define PLL_POST_DIV_MIN 1 +#define PLL_POST_DIV_MAX 127 +#define PLL_DIV_MIN 6 +#define PLL_DIV_MAX 127 +#define PLL_ICTRL_MIN 0 +#define PLL_ICTRL_MAX 7 +#define PLL_MODE_MIN 0 +#define PLL_MODE_MAX 3 +#define FOR_RANGE(x, RANGE) for (x = RANGE##_MIN; x <= RANGE##_MAX; x++) + +#define PLL_ICTRL GENMASK(26, 24) +#define PLL_DIV_SEL GENMASK(23, 17) +#define PLL_SEL_MODE GENMASK(16, 15) +#define PLL_POST_DIV_SEL GENMASK(14, 8) +#define PLL_PRE_DIV_SEL GENMASK(6, 0) +#define PLL_MASK_ALL (PLL_ICTRL | PLL_DIV_SEL | PLL_SEL_MODE | PLL_POST_DIV_SEL | PLL_PRE_DIV_SEL) + +/* IPLL */ +#define to_clk_ipll(dev) container_of(dev, struct cv1800b_clk_ipll, clk) + +static int cv1800b_ipll_enable(struct clk *clk) +{ + struct cv1800b_clk_ipll *pll = to_clk_ipll(clk); + + cv1800b_clk_clrbit(pll->base, &pll->pll_pwd); + return 0; +} + +static int cv1800b_ipll_disable(struct clk *clk) +{ + struct cv1800b_clk_ipll *pll = to_clk_ipll(clk); + + cv1800b_clk_setbit(pll->base, &pll->pll_pwd); + return 0; +} + +static ulong cv1800b_ipll_get_rate(struct clk *clk) +{ + struct cv1800b_clk_ipll *pll = to_clk_ipll(clk); + + ulong parent_rate = clk_get_parent_rate(clk); + u32 reg = readl(pll->base + pll->pll_reg); + u32 pre_div = FIELD_GET(PLL_PRE_DIV_SEL, reg); + u32 post_div = FIELD_GET(PLL_POST_DIV_SEL, reg); + u32 div = FIELD_GET(PLL_DIV_SEL, reg); + + return DIV_ROUND_DOWN_ULL(parent_rate * div, pre_div * post_div); +} + +static ulong cv1800b_ipll_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_ipll *pll = to_clk_ipll(clk); + ulong parent_rate = clk_get_parent_rate(clk); + u32 pre_div, post_div, div; + u32 pre_div_sel, post_div_sel, div_sel; + ulong new_rate, best_rate = 0; + u32 mode, ictrl; + u32 test, val; + + FOR_RANGE(pre_div, PLL_PRE_DIV) + { + FOR_RANGE(post_div, PLL_POST_DIV) + { + FOR_RANGE(div, PLL_DIV) + { + new_rate = + DIV_ROUND_DOWN_ULL(parent_rate * div, pre_div * post_div); + if (rate - new_rate < rate - best_rate) { + best_rate = new_rate; + pre_div_sel = pre_div; + post_div_sel = post_div; + div_sel = div; + } + } + } + } + + FOR_RANGE(mode, PLL_MODE) + { + FOR_RANGE(ictrl, PLL_ICTRL) + { + test = 184 * (1 + mode) * (1 + ictrl) / 2; + if (test > 20 * div_sel && test < 35 * div_sel) { + val = FIELD_PREP(PLL_PRE_DIV_SEL, pre_div_sel) | + FIELD_PREP(PLL_POST_DIV_SEL, post_div_sel) | + FIELD_PREP(PLL_DIV_SEL, div_sel) | + FIELD_PREP(PLL_ICTRL, ictrl) | + FIELD_PREP(PLL_SEL_MODE, mode); + clrsetbits_le32(pll->base + pll->pll_reg, PLL_MASK_ALL, val); + return best_rate; + } + } + } + + return -EINVAL; +} + +const struct clk_ops cv1800b_ipll_ops = { + .enable = cv1800b_ipll_enable, + .disable = cv1800b_ipll_disable, + .get_rate = cv1800b_ipll_get_rate, + .set_rate = cv1800b_ipll_set_rate, +}; + +U_BOOT_DRIVER(cv1800b_clk_ipll) = { + .name = "cv1800b_clk_ipll", + .id = UCLASS_CLK, + .ops = &cv1800b_ipll_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +/* FPLL */ +#define to_clk_fpll(dev) container_of(dev, struct cv1800b_clk_fpll, ipll.clk) + +static ulong cv1800b_fpll_get_rate(struct clk *clk) +{ + struct cv1800b_clk_fpll *pll = to_clk_fpll(clk); + u32 val, syn_set; + u32 pre_div, post_div, div; + u8 mult = 1; + ulong divisor, remainder, rate; + + if (!cv1800b_clk_getbit(pll->ipll.base, &pll->syn.en)) + return cv1800b_ipll_get_rate(clk); + + syn_set = readl(pll->ipll.base + pll->syn.set); + if (syn_set == 0) + return 0; + + val = readl(pll->ipll.base + pll->ipll.pll_reg); + pre_div = FIELD_GET(PLL_PRE_DIV_SEL, val); + post_div = FIELD_GET(PLL_POST_DIV_SEL, val); + div = FIELD_GET(PLL_DIV_SEL, val); + + if (cv1800b_clk_getbit(pll->ipll.base, &pll->syn.clk_half)) + mult = 2; + + divisor = (ulong)pre_div * post_div * syn_set; + rate = (clk_get_parent_rate(clk) * div) << 25; + remainder = rate % divisor; + rate /= divisor; + return rate * mult + DIV_ROUND_CLOSEST_ULL(remainder * mult, divisor); +} + +static ulong cv1800b_find_syn(ulong rate, ulong parent_rate, ulong pre_div, ulong post_div, + ulong div, u32 *syn) +{ + u32 syn_min = (4 << 26) + 1; + u32 syn_max = U32_MAX; + u32 mid; + ulong new_rate; + u32 mult = 1; + ulong divisor, remainder; + + while (syn_min < syn_max) { + mid = ((ulong)syn_min + syn_max) / 2; + divisor = pre_div * post_div * mid; + new_rate = (parent_rate * div) << 25; + remainder = do_div(new_rate, divisor); + new_rate = new_rate * mult + DIV_ROUND_CLOSEST_ULL(remainder * mult, divisor); + if (new_rate > rate) { + syn_max = mid + 1; + } else if (new_rate < rate) { + syn_min = mid - 1; + } else { + syn_min = mid; + break; + } + } + *syn = syn_min; + return new_rate; +} + +static ulong cv1800b_fpll_set_rate(struct clk *clk, ulong rate) +{ + struct cv1800b_clk_fpll *pll = to_clk_fpll(clk); + ulong parent_rate = clk_get_parent_rate(clk); + u32 pre_div, post_div, div; + u32 pre_div_sel, post_div_sel, div_sel; + u32 syn, syn_sel; + ulong new_rate, best_rate = 0; + u32 mult = 1; + u32 mode, ictrl; + + if (!cv1800b_clk_getbit(pll->ipll.base, &pll->syn.en)) + return cv1800b_ipll_set_rate(clk, rate); + + if (cv1800b_clk_getbit(pll->ipll.base, &pll->syn.clk_half)) + mult = 2; + + FOR_RANGE(pre_div, PLL_PRE_DIV) + { + FOR_RANGE(post_div, PLL_POST_DIV) + { + FOR_RANGE(div, PLL_DIV) + { + new_rate = cv1800b_find_syn(rate, parent_rate, pre_div, post_div, + div, &syn); + if (rate - new_rate < rate - best_rate) { + best_rate = new_rate; + pre_div_sel = pre_div; + post_div_sel = post_div; + div_sel = div; + syn_sel = syn; + } + } + } + } + + FOR_RANGE(mode, PLL_MODE) + { + FOR_RANGE(ictrl, PLL_ICTRL) + { + u32 test = 184 * (1 + mode) * (1 + ictrl) / 2; + + if (test > 10 * div_sel && test <= 24 * div_sel) { + u32 val = FIELD_PREP(PLL_PRE_DIV_SEL, pre_div_sel) | + FIELD_PREP(PLL_POST_DIV_SEL, post_div_sel) | + FIELD_PREP(PLL_DIV_SEL, div_sel) | + FIELD_PREP(PLL_ICTRL, ictrl) | + FIELD_PREP(PLL_SEL_MODE, mode); + clrsetbits_le32(pll->ipll.base + pll->ipll.pll_reg, PLL_MASK_ALL, + val); + writel(syn_sel, pll->ipll.base + pll->syn.set); + return best_rate; + } + } + } + + return -EINVAL; +} + +static int cv1800b_fpll_set_parent(struct clk *clk, struct clk *parent) +{ + struct cv1800b_clk_fpll *pll = to_clk_fpll(clk); + + if (parent->id == CV1800B_CLK_BYPASS) + cv1800b_clk_setbit(pll->ipll.base, &pll->syn.en); + else + cv1800b_clk_clrbit(pll->ipll.base, &pll->syn.en); + + return 0; +} + +const struct clk_ops cv1800b_fpll_ops = { + .enable = cv1800b_ipll_enable, + .disable = cv1800b_ipll_disable, + .get_rate = cv1800b_fpll_get_rate, + .set_rate = cv1800b_fpll_set_rate, + .set_parent = cv1800b_fpll_set_parent, +}; + +U_BOOT_DRIVER(cv1800b_clk_fpll) = { + .name = "cv1800b_clk_fpll", + .id = UCLASS_CLK, + .ops = &cv1800b_fpll_ops, + .flags = DM_FLAG_PRE_RELOC, +}; diff --git a/drivers/clk/sophgo/clk-pll.h b/drivers/clk/sophgo/clk-pll.h new file mode 100644 index 00000000000..bea9bd8a437 --- /dev/null +++ b/drivers/clk/sophgo/clk-pll.h @@ -0,0 +1,74 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2024, Kongyang Liu <seashell11234455@gmail.com> + * + */ + +#ifndef __clk_SOPHGO_PLL_H__ +#define __clk_SOPHGO_PLL_H__ + +#include <clk.h> + +#include "clk-common.h" + +struct cv1800b_clk_synthesizer { + struct cv1800b_clk_regbit en; + struct cv1800b_clk_regbit clk_half; + u32 ctrl; + u32 set; +}; + +struct cv1800b_clk_ipll { + struct clk clk; + const char *name; + const char *parent_name; + void __iomem *base; + u32 pll_reg; + struct cv1800b_clk_regbit pll_pwd; + struct cv1800b_clk_regbit pll_status; +}; + +struct cv1800b_clk_fpll { + struct cv1800b_clk_ipll ipll; + struct cv1800b_clk_synthesizer syn; +}; + +#define CV1800B_IPLL(_id, _name, _parent_name, _pll_reg, _pll_pwd_offset, \ + _pll_pwd_shift, _pll_status_offset, _pll_status_shift, \ + _flags) \ + { \ + .clk = { \ + .id = CV1800B_CLK_ID_TRANSFORM(_id), \ + .flags = _flags, \ + }, \ + .name = _name, \ + .parent_name = _parent_name, \ + .pll_reg = _pll_reg, \ + .pll_pwd = CV1800B_CLK_REGBIT(_pll_pwd_offset, _pll_pwd_shift), \ + .pll_status = CV1800B_CLK_REGBIT(_pll_status_offset, \ + _pll_status_shift), \ + } + +#define CV1800B_FPLL(_id, _name, _parent_name, _pll_reg, _pll_pwd_offset, \ + _pll_pwd_shift, _pll_status_offset, _pll_status_shift, \ + _syn_en_offset, _syn_en_shift, _syn_clk_half_offset, \ + _syn_clk_half_shift, _syn_ctrl_offset, _syn_set_offset, \ + _flags) \ + { \ + .ipll = CV1800B_IPLL(_id, _name, _parent_name, _pll_reg, \ + _pll_pwd_offset, _pll_pwd_shift, \ + _pll_status_offset, _pll_status_shift, \ + _flags), \ + .syn = { \ + .en = CV1800B_CLK_REGBIT(_syn_en_offset, _syn_en_shift),\ + .clk_half = CV1800B_CLK_REGBIT(_syn_clk_half_offset, \ + _syn_clk_half_shift), \ + .ctrl = _syn_ctrl_offset, \ + .set = _syn_set_offset, \ + }, \ + } + +extern const struct clk_ops cv1800b_ipll_ops; +extern const struct clk_ops cv1800b_fpll_ops; + +#endif /* __clk_SOPHGO_PLL_H__ */ diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c index 60deca963a6..6c0a8c0cbe4 100644 --- a/drivers/cpu/imx8_cpu.c +++ b/drivers/cpu/imx8_cpu.c @@ -60,6 +60,10 @@ static const char *get_imx_type_str(u32 imxtype) return "93(12)";/* iMX93 9x9 Dual core without NPU */ case MXC_CPU_IMX9311: return "93(11)";/* iMX93 9x9 Single core without NPU */ + case MXC_CPU_IMX9302: + return "93(02)";/* iMX93 900Mhz Low performance Dual core without NPU */ + case MXC_CPU_IMX9301: + return "93(01)";/* iMX93 900Mhz Low performance Single core without NPU */ default: return "??"; } diff --git a/drivers/crypto/aspeed/Kconfig b/drivers/crypto/aspeed/Kconfig index 9bf317177aa..473e3e5a863 100644 --- a/drivers/crypto/aspeed/Kconfig +++ b/drivers/crypto/aspeed/Kconfig @@ -18,3 +18,13 @@ config ASPEED_ACRY Enabling this allows the use of RSA/ECC operations in hardware without requiring the software implementations. It also improves performance and saves code size. + +config ASPEED_CPTRA_SHA + bool "Caliptra SHA ACC for Aspeed AST27xx SoCs" + depends on DM_HASH + help + Select this option to enable a driver for using the SHA accelerator provided + by Caliptra 1.0, which is integrated in AST27xx BMC SoCs. + + Enabling this allows the use of SHA operations in hardware. Note that only + SHA384 and SHA512 are supported by Caliptra 1.0. diff --git a/drivers/crypto/aspeed/Makefile b/drivers/crypto/aspeed/Makefile index 58b55fc46e4..570587e744f 100644 --- a/drivers/crypto/aspeed/Makefile +++ b/drivers/crypto/aspeed/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_ASPEED_HACE) += aspeed_hace.o obj-$(CONFIG_ASPEED_ACRY) += aspeed_acry.o +obj-$(CONFIG_ASPEED_CPTRA_SHA) += cptra_sha.o diff --git a/drivers/crypto/aspeed/cptra_sha.c b/drivers/crypto/aspeed/cptra_sha.c new file mode 100644 index 00000000000..26b97bdd92b --- /dev/null +++ b/drivers/crypto/aspeed/cptra_sha.c @@ -0,0 +1,258 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright 2024 ASPEED Technology Inc. + */ +#include <asm/io.h> +#include <config.h> +#include <dm.h> +#include <linux/bitfield.h> +#include <linux/bitops.h> +#include <linux/iopoll.h> +#include <malloc.h> +#include <u-boot/hash.h> +#include <watchdog.h> + +/* SHA register offsets */ +#define CPTRA_SHA_LOCK 0x00 +#define CPTRA_SHA_USER 0x04 +#define CPTRA_SHA_MODE 0x08 +#define CPTRA_SHA_MODE_ENDIAN BIT(2) +#define CPTRA_SHA_MODE_SEL GENMASK(1, 0) +#define CPTRA_SHA_DLEN 0x10 +#define CPTRA_SHA_DATAIN 0x14 +#define CPTRA_SHA_EXEC 0x18 +#define CPTRA_SHA_STS 0x1c +#define CPTRA_SHA_STS_SOC_LOCK BIT(1) +#define CPTRA_SHA_STS_VLD BIT(0) +#define CPTRA_SHA_DIGEST(n) (0x20 + ((n) << 2)) +#define CPTRA_SHA_CTRL 0x60 +#define CPTRA_SHA_CTRL_ZEROIZE BIT(0) + +enum cptra_sha_modes { + CPTRA_SHA384_STREAM, + CPTRA_SHA512_STREAM, +}; + +struct cptra_sha_ctx { + enum HASH_ALGO algo; + uint32_t dgst_len; +}; + +struct cptra_sha { + void *regs; +}; + +static int cptra_sha_init(struct udevice *dev, enum HASH_ALGO algo, void **ctxp) +{ + struct cptra_sha_ctx *cs_ctx; + struct cptra_sha *cs; + uint32_t mode; + uint32_t reg; + int rc; + + cs_ctx = malloc(sizeof(struct cptra_sha_ctx)); + if (!cs_ctx) + return -ENOMEM; + + memset(cs_ctx, 0, sizeof(struct cptra_sha_ctx)); + + cs_ctx->algo = algo; + + switch (algo) { + case HASH_ALGO_SHA384: + mode = CPTRA_SHA384_STREAM; + cs_ctx->dgst_len = 48; + break; + case HASH_ALGO_SHA512: + mode = CPTRA_SHA512_STREAM; + cs_ctx->dgst_len = 64; + break; + default: + rc = -EINVAL; + goto free_n_out; + }; + + cs = dev_get_priv(dev); + + /* get CPTRA SHA lock */ + if (readl_poll_timeout(cs->regs + CPTRA_SHA_LOCK, reg, reg == 0, 1000000)) + return -EBUSY; + + /* zero clear SHA */ + writel(CPTRA_SHA_CTRL_ZEROIZE, cs->regs + CPTRA_SHA_CTRL); + + /* zero clear length */ + writel(0x0, cs->regs + CPTRA_SHA_DLEN); + + /* set SHA mode */ + reg = readl(cs->regs + CPTRA_SHA_MODE); + reg &= ~(CPTRA_SHA_MODE_SEL); + reg |= FIELD_PREP(CPTRA_SHA_MODE_SEL, mode); + writel(reg, cs->regs + CPTRA_SHA_MODE); + + *ctxp = cs_ctx; + + return 0; + +free_n_out: + free(cs_ctx); + + return rc; +} + +static int cptra_sha_update(struct udevice *dev, void *ctx, const void *ibuf, uint32_t ilen) +{ + struct cptra_sha *cs; + uint32_t din_be; + uint32_t dlen_sum; + uint8_t *p8; + uint32_t i; + + cs = dev_get_priv(dev); + + /* update length */ + dlen_sum = readl(cs->regs + CPTRA_SHA_DLEN) + ilen; + writel(dlen_sum, cs->regs + CPTRA_SHA_DLEN); + + din_be = 0; + for (i = 0, p8 = (uint8_t *)ibuf; i < ilen; ++i) { + if (i && (i % sizeof(din_be) == 0)) { + writel(din_be, cs->regs + CPTRA_SHA_DATAIN); + din_be = 0; + } + + din_be <<= 8; + din_be |= p8[i]; + } + + if (i % sizeof(din_be)) + din_be <<= (8 * (sizeof(din_be) - (i % sizeof(din_be)))); + + writel(din_be, cs->regs + CPTRA_SHA_DATAIN); + + return 0; +} + +static int cptra_sha_finish(struct udevice *dev, void *ctx, void *obuf) +{ + struct cptra_sha_ctx *cs_ctx; + struct cptra_sha *cs; + uint32_t i, *p32; + uint32_t sts; + + cs = dev_get_priv(dev); + cs_ctx = (struct cptra_sha_ctx *)ctx; + + /* trigger SHA calculation */ + writel(0x1, cs->regs + CPTRA_SHA_EXEC); + + /* wait for completion */ + while (1) { + sts = readl(cs->regs + CPTRA_SHA_STS); + if (sts & CPTRA_SHA_STS_VLD) + break; + } + + /* get the SHA digest in big-endian */ + p32 = (uint32_t *)obuf; + for (i = 0; i < (cs_ctx->dgst_len / sizeof(*p32)); ++i, p32++) + *p32 = be32_to_cpu(readl(cs->regs + CPTRA_SHA_DIGEST(i))); + + /* release CPTRA SHA lock */ + writel(0x1, cs->regs + CPTRA_SHA_LOCK); + + free(cs_ctx); + + return 0; +} + +static int cptra_sha_digest_wd(struct udevice *dev, enum HASH_ALGO algo, + const void *ibuf, const uint32_t ilen, + void *obuf, uint32_t chunk_sz) +{ + const void *cur, *end; + uint32_t chunk; + void *ctx; + int rc; + + rc = cptra_sha_init(dev, algo, &ctx); + if (rc) + return rc; + + if (IS_ENABLED(CONFIG_HW_WATCHDOG) || CONFIG_IS_ENABLED(WATCHDOG)) { + cur = ibuf; + end = ibuf + ilen; + + while (cur < end) { + chunk = end - cur; + if (chunk > chunk_sz) + chunk = chunk_sz; + + rc = cptra_sha_update(dev, ctx, cur, chunk); + if (rc) + return rc; + + cur += chunk; + schedule(); + } + } else { + rc = cptra_sha_update(dev, ctx, ibuf, ilen); + if (rc) + return rc; + } + + rc = cptra_sha_finish(dev, ctx, obuf); + if (rc) + return rc; + + return 0; +} + +static int cptra_sha_digest(struct udevice *dev, enum HASH_ALGO algo, + const void *ibuf, const uint32_t ilen, void *obuf) +{ + /* re-use the watchdog version with input length as the chunk_sz */ + return cptra_sha_digest_wd(dev, algo, ibuf, ilen, obuf, ilen); +} + +static int cptra_sha_probe(struct udevice *dev) +{ + struct cptra_sha *cs = dev_get_priv(dev); + + cs->regs = (void *)devfdt_get_addr(dev); + if (cs->regs == (void *)FDT_ADDR_T_NONE) { + debug("cannot map Caliptra SHA ACC registers\n"); + return -ENODEV; + } + + return 0; +} + +static int cptra_sha_remove(struct udevice *dev) +{ + return 0; +} + +static const struct hash_ops cptra_sha_ops = { + .hash_init = cptra_sha_init, + .hash_update = cptra_sha_update, + .hash_finish = cptra_sha_finish, + .hash_digest_wd = cptra_sha_digest_wd, + .hash_digest = cptra_sha_digest, +}; + +static const struct udevice_id cptra_sha_ids[] = { + { .compatible = "aspeed,ast2700-cptra-sha" }, + { } +}; + +U_BOOT_DRIVER(aspeed_cptra_sha) = { + .name = "aspeed_cptra_sha", + .id = UCLASS_HASH, + .of_match = cptra_sha_ids, + .ops = &cptra_sha_ops, + .probe = cptra_sha_probe, + .remove = cptra_sha_remove, + .priv_auto = sizeof(struct cptra_sha), + .flags = DM_FLAG_PRE_RELOC, +}; diff --git a/drivers/ddr/imx/phy/ddrphy_utils.c b/drivers/ddr/imx/phy/ddrphy_utils.c index cf5bdad7abe..14278f5ad8f 100644 --- a/drivers/ddr/imx/phy/ddrphy_utils.c +++ b/drivers/ddr/imx/phy/ddrphy_utils.c @@ -148,6 +148,10 @@ void ddrphy_init_set_dfi_clk(unsigned int drate) dram_pll_init(MHZ(266)); dram_disable_bypass(); break; + case 933: + dram_pll_init(MHZ(233)); + dram_disable_bypass(); + break; case 667: dram_pll_init(MHZ(167)); dram_disable_bypass(); diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index 971204758aa..aadd7e8cf7f 100644 --- a/drivers/dfu/Kconfig +++ b/drivers/dfu/Kconfig @@ -7,7 +7,7 @@ config DFU config DFU_OVER_USB bool select HASH - depends on USB_GADGET + depends on USB_GADGET_DOWNLOAD config DFU_OVER_TFTP bool diff --git a/drivers/firmware/arm-ffa/arm-ffa-uclass.c b/drivers/firmware/arm-ffa/arm-ffa-uclass.c index e0767fc7551..96c64964bb7 100644 --- a/drivers/firmware/arm-ffa/arm-ffa-uclass.c +++ b/drivers/firmware/arm-ffa/arm-ffa-uclass.c @@ -11,7 +11,7 @@ #include <log.h> #include <malloc.h> #include <string.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/global_data.h> #include <dm/device-internal.h> #include <dm/devres.h> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 7e702c3ae85..96b0e20d669 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -3039,6 +3039,20 @@ static int mmc_complete_init(struct mmc *mmc) return err; } +static void __maybe_unused mmc_cyclic_cd_poll(struct cyclic_info *c) +{ + struct mmc *m = CONFIG_IS_ENABLED(CYCLIC, (container_of(c, struct mmc, cyclic)), (NULL)); + + if (!m->has_init) + return; + + if (mmc_getcd(m)) + return; + + mmc_deinit(m); + m->has_init = 0; +} + int mmc_init(struct mmc *mmc) { int err = 0; @@ -3061,6 +3075,14 @@ int mmc_init(struct mmc *mmc) if (err) pr_info("%s: %d, time %lu\n", __func__, err, get_timer(start)); + if (CONFIG_IS_ENABLED(CYCLIC, (!mmc->cyclic.func), (NULL))) { + /* Register cyclic function for card detect polling */ + CONFIG_IS_ENABLED(CYCLIC, (cyclic_register(&mmc->cyclic, + mmc_cyclic_cd_poll, + 100 * 1000, + mmc->cfg->name))); + } + return err; } @@ -3068,6 +3090,9 @@ int mmc_deinit(struct mmc *mmc) { u32 caps_filtered; + if (CONFIG_IS_ENABLED(CYCLIC, (mmc->cyclic.func), (NULL))) + CONFIG_IS_ENABLED(CYCLIC, (cyclic_unregister(&mmc->cyclic))); + if (!CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) && !CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) && !CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)) diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 28d2b456fbf..24d0556cd37 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -105,6 +105,19 @@ struct arasan_sdhci_priv { struct reset_ctl_bulk resets; }; +enum arasan_sdhci_compatible { + SDHCI_COMPATIBLE_SDHCI_89A, + SDHCI_COMPATIBLE_VERSAL_NET_EMMC, +}; + +static bool arasan_sdhci_is_compatible(struct udevice *dev, + enum arasan_sdhci_compatible family) +{ + enum arasan_sdhci_compatible compat = dev_get_driver_data(dev); + + return compat == family; +} + /* For Versal platforms zynqmp_mmio_write() won't be available */ __weak int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value) { @@ -422,7 +435,7 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) mdelay(1); - if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) + if (arasan_sdhci_is_compatible(mmc->dev, SDHCI_COMPATIBLE_SDHCI_89A)) arasan_zynqmp_dll_reset(host, priv->node_id); sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); @@ -470,7 +483,7 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) udelay(1); - if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) + if (arasan_sdhci_is_compatible(mmc->dev, SDHCI_COMPATIBLE_SDHCI_89A)) arasan_zynqmp_dll_reset(host, priv->node_id); /* Enable only interrupts served by the SD controller */ @@ -858,7 +871,7 @@ static int arasan_sdhci_set_tapdelay(struct sdhci_host *host) dev_dbg(dev, "%s, host:%s, mode:%d\n", __func__, host->name, timing); if (IS_ENABLED(CONFIG_ARCH_ZYNQMP) && - device_is_compatible(dev, "xlnx,zynqmp-8.9a")) { + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_SDHCI_89A)) { ret = sdhci_zynqmp_sampleclk_set_phase(host, iclk_phase); if (ret) return ret; @@ -869,7 +882,7 @@ static int arasan_sdhci_set_tapdelay(struct sdhci_host *host) } else if ((IS_ENABLED(CONFIG_ARCH_VERSAL) || IS_ENABLED(CONFIG_ARCH_VERSAL_NET) || IS_ENABLED(CONFIG_ARCH_VERSAL2)) && - device_is_compatible(dev, "xlnx,versal-8.9a")) { + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_SDHCI_89A)) { ret = sdhci_versal_sampleclk_set_phase(host, iclk_phase); if (ret) return ret; @@ -879,7 +892,7 @@ static int arasan_sdhci_set_tapdelay(struct sdhci_host *host) return ret; } else if ((IS_ENABLED(CONFIG_ARCH_VERSAL_NET) || IS_ENABLED(CONFIG_ARCH_VERSAL2)) && - device_is_compatible(dev, "xlnx,versal-net-emmc")) { + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_VERSAL_NET_EMMC)) { if (mmc->clock >= MIN_PHY_CLK_HZ) if (iclk_phase == VERSAL_NET_EMMC_ICLK_PHASE_DDR52_DLY_CHAIN) iclk_phase = VERSAL_NET_EMMC_ICLK_PHASE_DDR52_DLL; @@ -933,7 +946,7 @@ static void arasan_dt_parse_clk_phases(struct udevice *dev) int i; if (IS_ENABLED(CONFIG_ARCH_ZYNQMP) && - device_is_compatible(dev, "xlnx,zynqmp-8.9a")) { + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_SDHCI_89A)) { for (i = 0; i <= MMC_TIMING_MMC_HS400; i++) { clk_data->clk_phase_in[i] = zynqmp_iclk_phases[i]; clk_data->clk_phase_out[i] = zynqmp_oclk_phases[i]; @@ -948,7 +961,7 @@ static void arasan_dt_parse_clk_phases(struct udevice *dev) if ((IS_ENABLED(CONFIG_ARCH_VERSAL) || IS_ENABLED(CONFIG_ARCH_VERSAL_NET) || IS_ENABLED(CONFIG_ARCH_VERSAL2)) && - device_is_compatible(dev, "xlnx,versal-8.9a")) { + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_SDHCI_89A)) { for (i = 0; i <= MMC_TIMING_MMC_HS400; i++) { clk_data->clk_phase_in[i] = versal_iclk_phases[i]; clk_data->clk_phase_out[i] = versal_oclk_phases[i]; @@ -957,7 +970,7 @@ static void arasan_dt_parse_clk_phases(struct udevice *dev) if ((IS_ENABLED(CONFIG_ARCH_VERSAL_NET) || IS_ENABLED(CONFIG_ARCH_VERSAL2)) && - device_is_compatible(dev, "xlnx,versal-net-emmc")) { + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_VERSAL_NET_EMMC)) { for (i = 0; i <= MMC_TIMING_MMC_HS400; i++) { clk_data->clk_phase_in[i] = versal_net_emmc_iclk_phases[i]; clk_data->clk_phase_out[i] = versal_net_emmc_oclk_phases[i]; @@ -1101,7 +1114,7 @@ static int arasan_sdhci_probe(struct udevice *dev) host = priv->host; #if defined(CONFIG_ARCH_ZYNQMP) && defined(CONFIG_ZYNQMP_FIRMWARE) - if (device_is_compatible(dev, "xlnx,zynqmp-8.9a")) { + if (arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_SDHCI_89A)) { ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_SD_CONFIG); if (!ret) { @@ -1111,7 +1124,7 @@ static int arasan_sdhci_probe(struct udevice *dev) } } #endif - if (device_is_compatible(dev, "xlnx,versal-net-emmc")) + if (arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_VERSAL_NET_EMMC)) priv->internal_phy_reg = true; ret = clk_get_by_index(dev, 0, &clk); @@ -1145,7 +1158,7 @@ static int arasan_sdhci_probe(struct udevice *dev) host->quirks |= SDHCI_QUIRK_NO_1_8_V; if (CONFIG_IS_ENABLED(ARCH_VERSAL_NET) && - device_is_compatible(dev, "xlnx,versal-net-emmc")) + arasan_sdhci_is_compatible(dev, SDHCI_COMPATIBLE_VERSAL_NET_EMMC)) host->quirks |= SDHCI_QUIRK_CAPS_BIT63_FOR_HS400; plat->cfg.f_max = CONFIG_ZYNQ_SDHCI_MAX_FREQ; @@ -1228,8 +1241,8 @@ static int arasan_sdhci_bind(struct udevice *dev) } static const struct udevice_id arasan_sdhci_ids[] = { - { .compatible = "arasan,sdhci-8.9a" }, - { .compatible = "xlnx,versal-net-emmc" }, + { .compatible = "arasan,sdhci-8.9a", .data = SDHCI_COMPATIBLE_SDHCI_89A }, + { .compatible = "xlnx,versal-net-emmc", .data = SDHCI_COMPATIBLE_VERSAL_NET_EMMC }, { } }; diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c index c26615821c8..e5c8df750b7 100644 --- a/drivers/mtd/altera_qspi.c +++ b/drivers/mtd/altera_qspi.c @@ -96,7 +96,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) ret = mtd_erase(mtd, &instr); flash_set_verbose(0); if (ret) - return ERR_PROTECTED; + return FL_ERR_PROTECTED; puts(" done\n"); return 0; @@ -114,7 +114,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) ret = mtd_write(mtd, to, cnt, &retlen, src); if (ret) - return ERR_PROTECTED; + return FL_ERR_PROTECTED; return 0; } diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index a7826e81c17..e50502824ac 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -593,11 +593,11 @@ static int flash_status_check(flash_info_t *info, flash_sect_t sector, flash_read_long(info, sector, 0)); flash_write_cmd(info, sector, 0, info->cmd_reset); udelay(1); - return ERR_TIMEOUT; + return FL_ERR_TIMEOUT; } udelay(1); /* also triggers watchdog */ } - return ERR_OK; + return FL_ERR_OK; } /*----------------------------------------------------------------------- @@ -616,9 +616,9 @@ static int flash_full_status_check(flash_info_t *info, flash_sect_t sector, case CFI_CMDSET_INTEL_PROG_REGIONS: case CFI_CMDSET_INTEL_EXTENDED: case CFI_CMDSET_INTEL_STANDARD: - if (retcode == ERR_OK && + if (retcode == FL_ERR_OK && !flash_isset(info, sector, 0, FLASH_STATUS_DONE)) { - retcode = ERR_INVAL; + retcode = FL_ERR_INVAL; printf("Flash %s error at address %lx\n", prompt, info->start[sector]); if (flash_isset(info, sector, 0, FLASH_STATUS_ECLBS | @@ -627,14 +627,14 @@ static int flash_full_status_check(flash_info_t *info, flash_sect_t sector, } else if (flash_isset(info, sector, 0, FLASH_STATUS_ECLBS)) { puts("Block Erase Error.\n"); - retcode = ERR_NOT_ERASED; + retcode = FL_ERR_NOT_ERASED; } else if (flash_isset(info, sector, 0, FLASH_STATUS_PSLBS)) { puts("Locking Error\n"); } if (flash_isset(info, sector, 0, FLASH_STATUS_DPS)) { puts("Block locked.\n"); - retcode = ERR_PROTECTED; + retcode = FL_ERR_PROTECTED; } if (flash_isset(info, sector, 0, FLASH_STATUS_VPENS)) puts("Vpp Low Error.\n"); @@ -702,12 +702,12 @@ static int flash_status_poll(flash_info_t *info, void *src, void *dst, if (get_timer(start) > tout) { printf("Flash %s timeout at address %lx data %lx\n", prompt, (ulong)dst, (ulong)flash_read8(dst)); - return ERR_TIMEOUT; + return FL_ERR_TIMEOUT; } udelay(1); /* also triggers watchdog */ } #endif /* CONFIG_SYS_CFI_FLASH_STATUS_POLL */ - return ERR_OK; + return FL_ERR_OK; } /*----------------------------------------------------------------------- @@ -810,7 +810,7 @@ static int flash_write_cfiword(flash_info_t *info, ulong dest, cfiword_t cword) break; } if (!flag) - return ERR_NOT_ERASED; + return FL_ERR_NOT_ERASED; /* Disable interrupts which might cause a timeout here */ flag = disable_interrupts(); @@ -899,7 +899,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp, shift = 3; break; default: - retcode = ERR_INVAL; + retcode = FL_ERR_INVAL; goto out_unmap; } @@ -930,7 +930,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp, } } if (!flag) { - retcode = ERR_NOT_ERASED; + retcode = FL_ERR_NOT_ERASED; goto out_unmap; } @@ -950,7 +950,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp, retcode = flash_status_check(info, sector, info->buffer_write_tout, "write to buffer"); - if (retcode == ERR_OK) { + if (retcode == FL_ERR_OK) { /* reduce the number of loops by the width of * the port */ @@ -975,7 +975,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp, src += 8, dst += 8; break; default: - retcode = ERR_INVAL; + retcode = FL_ERR_INVAL; goto out_unmap; } } @@ -1025,7 +1025,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp, } break; default: - retcode = ERR_INVAL; + retcode = FL_ERR_INVAL; goto out_unmap; } @@ -1043,7 +1043,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp, default: debug("Unknown Command Set\n"); - retcode = ERR_INVAL; + retcode = FL_ERR_INVAL; break; } @@ -1389,7 +1389,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) if (i > cnt) i = cnt; rc = flash_write_cfibuffer(info, wp, src, i); - if (rc != ERR_OK) + if (rc != FL_ERR_OK) return rc; i -= i & (info->portwidth - 1); wp += i; @@ -1398,7 +1398,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) FLASH_SHOW_PROGRESS(scale, dots, digit, i); /* Only check every once in a while */ if ((cnt & 0xFFFF) < buffered_size && ctrlc()) - return ERR_ABORTED; + return FL_ERR_ABORTED; } #else while (cnt >= info->portwidth) { @@ -1413,7 +1413,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) FLASH_SHOW_PROGRESS(scale, dots, digit, info->portwidth); /* Only check every once in a while */ if ((cnt & 0xFFFF) < info->portwidth && ctrlc()) - return ERR_ABORTED; + return FL_ERR_ABORTED; } #endif /* CONFIG_SYS_FLASH_USE_BUFFER_WRITE */ diff --git a/drivers/mtd/nvmxip/nvmxip-uclass.c b/drivers/mtd/nvmxip/nvmxip-uclass.c index 254f04e0b99..d18bd0e3d6b 100644 --- a/drivers/mtd/nvmxip/nvmxip-uclass.c +++ b/drivers/mtd/nvmxip/nvmxip-uclass.c @@ -47,19 +47,13 @@ int nvmxip_probe(struct udevice *udev) return ret; } - log_info("[%s]: the block device %s ready for use\n", udev->name, bdev_name); + log_debug("[%s]: the block device %s ready for use\n", udev->name, + bdev_name); return 0; } -static int nvmxip_post_bind(struct udevice *udev) -{ - dev_or_flags(udev, DM_FLAG_PROBE_AFTER_BIND); - return 0; -} - UCLASS_DRIVER(nvmxip) = { .name = "nvmxip", .id = UCLASS_NVMXIP, - .post_bind = nvmxip_post_bind, }; diff --git a/drivers/mtd/renesas_rpc_hf.c b/drivers/mtd/renesas_rpc_hf.c index 941f2040983..03545822b07 100644 --- a/drivers/mtd/renesas_rpc_hf.c +++ b/drivers/mtd/renesas_rpc_hf.c @@ -387,6 +387,7 @@ static int rpc_hf_probe(struct udevice *dev) static const struct udevice_id rpc_hf_ids[] = { { .compatible = "renesas,r7s72100-rpc-if" }, { .compatible = "renesas,rcar-gen3-rpc-if" }, + { .compatible = "renesas,rcar-gen4-rpc-if" }, {} }; diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index aea611fef52..8f7a77e7169 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -44,6 +44,12 @@ #define DEFAULT_READY_WAIT_JIFFIES (40UL * HZ) +/* + * For full-chip erase, calibrated to a 2MB flash (M25P16); should be scaled up + * for larger flash + */ +#define CHIP_ERASE_2MB_READY_WAIT_JIFFIES (40UL * HZ) + #define ROUND_UP_TO(x, y) (((x) + (y) - 1) / (y) * (y)) struct sfdp_parameter_header { @@ -855,6 +861,20 @@ static int spi_nor_wait_till_ready(struct spi_nor *nor) DEFAULT_READY_WAIT_JIFFIES); } +static int spi_nor_erase_chip_wait_till_ready(struct spi_nor *nor, unsigned long size) +{ + /* + * Scale the timeout linearly with the size of the flash, with + * a minimum calibrated to an old 2MB flash. We could try to + * pull these from CFI/SFDP, but these values should be good + * enough for now. + */ + unsigned long timeout = max(CHIP_ERASE_2MB_READY_WAIT_JIFFIES, + CHIP_ERASE_2MB_READY_WAIT_JIFFIES * + (unsigned long)(size / SZ_2M)); + return spi_nor_wait_till_ready_with_timeout(nor, timeout); +} + #ifdef CONFIG_SPI_FLASH_BAR /* * This "clean_bar" is necessary in a situation when one was accessing @@ -989,7 +1009,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) { struct spi_nor *nor = mtd_to_spi_nor(mtd); bool addr_known = false; - u32 addr, len, rem; + u32 addr, len, rem, max_size; int ret, err; dev_dbg(nor->dev, "at 0x%llx, len %lld\n", (long long)instr->addr, @@ -1003,6 +1023,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) addr = instr->addr; len = instr->len; + max_size = instr->len; instr->state = MTD_ERASING; addr_known = true; @@ -1035,7 +1056,13 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) addr += ret; len -= ret; - ret = spi_nor_wait_till_ready(nor); + if (max_size == mtd->size && + !(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) { + ret = spi_nor_erase_chip_wait_till_ready(nor, mtd->size); + } else { + ret = spi_nor_wait_till_ready(nor); + } + if (ret) goto erase_err; } diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c index e1125458a62..e06f4462b5a 100644 --- a/drivers/mux/mmio.c +++ b/drivers/mux/mmio.c @@ -31,6 +31,7 @@ static const struct mux_control_ops mux_mmio_ops = { static const struct udevice_id mmio_mux_of_match[] = { { .compatible = "mmio-mux" }, + { .compatible = "reg-mux" }, { /* sentinel */ }, }; @@ -45,7 +46,11 @@ static int mmio_mux_probe(struct udevice *dev) int ret; int i; - regmap = syscon_node_to_regmap(dev_ofnode(dev->parent)); + if (ofnode_device_is_compatible(dev_ofnode(dev), "mmio-mux")) + regmap = syscon_node_to_regmap(dev_ofnode(dev->parent)); + else + regmap_init_mem(dev_ofnode(dev), ®map); + if (IS_ERR(regmap)) { ret = PTR_ERR(regmap); dev_err(dev, "failed to get regmap: %d\n", ret); diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 6ed325517c0..e7d0ddfe25a 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -468,6 +468,7 @@ config FTMAC100 config FTGMAC100 bool "Ftgmac100 Ethernet Support" select PHYLIB + depends on NET help This driver supports the Faraday's FTGMAC100 Gigabit SoC Ethernet controller that can be found on Aspeed SoCs (which diff --git a/drivers/net/aspeed_mdio.c b/drivers/net/aspeed_mdio.c index f2e4392aa9a..2e1f3cdf11a 100644 --- a/drivers/net/aspeed_mdio.c +++ b/drivers/net/aspeed_mdio.c @@ -113,6 +113,7 @@ static int aspeed_mdio_probe(struct udevice *dev) static const struct udevice_id aspeed_mdio_ids[] = { { .compatible = "aspeed,ast2600-mdio" }, + { .compatible = "aspeed,ast2700-mdio" }, { } }; diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 0a0d92bc2cd..d6d5cb52fdd 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -615,8 +615,7 @@ static int fecmxc_init(struct udevice *dev) if (fec->xcv_type != SEVENWIRE) miiphy_restart_aneg(dev); #endif - fec_open(dev); - return 0; + return fec_open(dev); } /** @@ -818,6 +817,9 @@ static int fecmxc_recv(struct udevice *dev, int flags, uchar **packetp) return -ENOMEM; } + if (!(readl(&fec->eth->ecntrl) & FEC_ECNTRL_ETHER_EN)) + return 0; + /* Check if any critical events have happened */ ievent = readl(&fec->eth->ievent); writel(ievent, &fec->eth->ievent); @@ -1210,10 +1212,13 @@ static int fecmxc_set_ref_clk(struct clk *clk_ref, phy_interface_t interface) else if (interface == PHY_INTERFACE_MODE_RGMII || interface == PHY_INTERFACE_MODE_RGMII_ID || interface == PHY_INTERFACE_MODE_RGMII_RXID || - interface == PHY_INTERFACE_MODE_RGMII_TXID) + interface == PHY_INTERFACE_MODE_RGMII_TXID) { freq = 125000000; - else + if (is_imx93()) + freq = freq << 1; + } else { return -EINVAL; + } ret = clk_set_rate(clk_ref, freq); if (ret < 0) diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index 19f3f0fef07..63fe4b2d33c 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -26,7 +26,8 @@ #include "fm.h" -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) && !defined(BITBANGMII) +#if ((defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) && \ + !defined(CONFIG_BITBANGMII)) #define TBIANA_SETTINGS (TBIANA_ASYMMETRIC_PAUSE | TBIANA_SYMMETRIC_PAUSE | \ TBIANA_FULL_DUPLEX) @@ -701,8 +702,11 @@ static int init_phy(struct fm_eth *fm_eth) supported |= SUPPORTED_2500baseX_Full; #endif +#if (CONFIG_IS_ENABLED(MII) || CONFIG_IS_ENABLED(CMD_MII)) && \ + !CONFIG_IS_ENABLED(BITBANGMII) if (fm_eth->type == FM_ETH_1G_E) dtsec_init_phy(fm_eth); +#endif #ifdef CONFIG_PHYLIB #ifdef CONFIG_DM_MDIO diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c index 8781e50a48d..f5ea2e72d1b 100644 --- a/drivers/net/ftgmac100.c +++ b/drivers/net/ftgmac100.c @@ -26,6 +26,7 @@ #include <linux/io.h> #include <linux/iopoll.h> #include <linux/printk.h> +#include <linux/bitfield.h> #include "ftgmac100.h" @@ -57,6 +58,15 @@ enum ftgmac100_model { FTGMAC100_MODEL_FARADAY, FTGMAC100_MODEL_ASPEED, + FTGMAC100_MODEL_ASPEED_AST2700, +}; + +union ftgmac100_dma_addr { + dma_addr_t addr; + struct { + u32 lo; + u32 hi; + }; }; /** @@ -96,6 +106,8 @@ struct ftgmac100_data { /* End of RX/TX ring buffer bits. Depend on model */ u32 rxdes0_edorr_mask; u32 txdes0_edotr_mask; + + bool is_ast2700; }; /* @@ -222,7 +234,7 @@ static int ftgmac100_phy_init(struct udevice *dev) struct phy_device *phydev; int ret; - if (IS_ENABLED(CONFIG_DM_MDIO)) + if (IS_ENABLED(CONFIG_DM_MDIO) && priv->phy_mode != PHY_INTERFACE_MODE_NCSI) phydev = dm_eth_phy_connect(dev); else phydev = phy_connect(priv->bus, priv->phy_addr, dev, priv->phy_mode); @@ -320,8 +332,9 @@ static int ftgmac100_start(struct udevice *dev) struct eth_pdata *plat = dev_get_plat(dev); struct ftgmac100_data *priv = dev_get_priv(dev); struct ftgmac100 *ftgmac100 = priv->iobase; + union ftgmac100_dma_addr dma_addr = {.hi = 0, .lo = 0}; struct phy_device *phydev = priv->phydev; - unsigned int maccr; + unsigned int maccr, dblac, desc_size; ulong start, end; int ret; int i; @@ -341,6 +354,7 @@ static int ftgmac100_start(struct udevice *dev) priv->rx_index = 0; for (i = 0; i < PKTBUFSTX; i++) { + priv->txdes[i].txdes2 = 0; priv->txdes[i].txdes3 = 0; priv->txdes[i].txdes0 = 0; } @@ -351,7 +365,14 @@ static int ftgmac100_start(struct udevice *dev) flush_dcache_range(start, end); for (i = 0; i < PKTBUFSRX; i++) { - priv->rxdes[i].rxdes3 = (unsigned int)net_rx_packets[i]; + unsigned int ip_align = 0; + + dma_addr.addr = (dma_addr_t)net_rx_packets[i]; + priv->rxdes[i].rxdes2 = FIELD_PREP(FTGMAC100_RXDES2_RXBUF_BADR_HI, dma_addr.hi); + /* For IP alignment */ + if ((dma_addr.lo & (PKTALIGN - 1)) == 0) + ip_align = 2; + priv->rxdes[i].rxdes3 = dma_addr.lo + ip_align; priv->rxdes[i].rxdes0 = 0; } priv->rxdes[PKTBUFSRX - 1].rxdes0 = priv->rxdes0_edorr_mask; @@ -361,10 +382,25 @@ static int ftgmac100_start(struct udevice *dev) flush_dcache_range(start, end); /* transmit ring */ - writel((u32)priv->txdes, &ftgmac100->txr_badr); + dma_addr.addr = (dma_addr_t)priv->txdes; + writel(dma_addr.lo, &ftgmac100->txr_badr); + writel(dma_addr.hi, &ftgmac100->txr_badr_hi); /* receive ring */ - writel((u32)priv->rxdes, &ftgmac100->rxr_badr); + dma_addr.addr = (dma_addr_t)priv->rxdes; + writel(dma_addr.lo, &ftgmac100->rxr_badr); + writel(dma_addr.hi, &ftgmac100->rxr_badr_hi); + + /* Configure TX/RX decsriptor size + * This size is calculated based on cache line. + */ + desc_size = ARCH_DMA_MINALIGN / FTGMAC100_DESC_UNIT; + /* The descriptor size is at least 2 descriptor units. */ + if (desc_size < 2) + desc_size = 2; + dblac = readl(&ftgmac100->dblac) & ~GENMASK(19, 12); + dblac |= FTGMAC100_DBLAC_RXDES_SIZE(desc_size) | FTGMAC100_DBLAC_TXDES_SIZE(desc_size); + writel(dblac, &ftgmac100->dblac); /* poll receive descriptor automatically */ writel(FTGMAC100_APTC_RXPOLL_CNT(1), &ftgmac100->aptc); @@ -382,6 +418,10 @@ static int ftgmac100_start(struct udevice *dev) FTGMAC100_MACCR_RX_RUNT | FTGMAC100_MACCR_RX_BROADPKT; + if (priv->is_ast2700 && (priv->phydev->interface == PHY_INTERFACE_MODE_RMII || + priv->phydev->interface == PHY_INTERFACE_MODE_NCSI)) + maccr |= FTGMAC100_MACCR_RMII_ENABLE; + writel(maccr, &ftgmac100->maccr); ret = phy_startup(phydev); @@ -410,6 +450,14 @@ static int ftgmac100_free_pkt(struct udevice *dev, uchar *packet, int length) ulong des_end = des_start + roundup(sizeof(*curr_des), ARCH_DMA_MINALIGN); + /* + * Make sure there are no stale data in write-back over this area, which + * might get written into the memory while the ftgmac100 also writes + * into the same memory area. + */ + flush_dcache_range((ulong)net_rx_packets[priv->rx_index], + (ulong)net_rx_packets[priv->rx_index] + PKTSIZE_ALIGN); + /* Release buffer to DMA and flush descriptor */ curr_des->rxdes0 &= ~FTGMAC100_RXDES0_RXPKT_RDY; flush_dcache_range(des_start, des_end); @@ -431,9 +479,11 @@ static int ftgmac100_recv(struct udevice *dev, int flags, uchar **packetp) ulong des_start = ((ulong)curr_des) & ~(ARCH_DMA_MINALIGN - 1); ulong des_end = des_start + roundup(sizeof(*curr_des), ARCH_DMA_MINALIGN); - ulong data_start = curr_des->rxdes3; + union ftgmac100_dma_addr data_start = { .lo = 0, .hi = 0 }; ulong data_end; + data_start.hi = FIELD_GET(FTGMAC100_RXDES2_RXBUF_BADR_HI, curr_des->rxdes2); + data_start.lo = curr_des->rxdes3; invalidate_dcache_range(des_start, des_end); if (!(curr_des->rxdes0 & FTGMAC100_RXDES0_RXPKT_RDY)) @@ -453,9 +503,9 @@ static int ftgmac100_recv(struct udevice *dev, int flags, uchar **packetp) __func__, priv->rx_index, rxlen); /* Invalidate received data */ - data_end = data_start + roundup(rxlen, ARCH_DMA_MINALIGN); - invalidate_dcache_range(data_start, data_end); - *packetp = (uchar *)data_start; + data_end = data_start.addr + roundup(rxlen, ARCH_DMA_MINALIGN); + invalidate_dcache_range(data_start.addr, data_end); + *packetp = (uchar *)data_start.addr; return rxlen; } @@ -481,6 +531,7 @@ static int ftgmac100_send(struct udevice *dev, void *packet, int length) struct ftgmac100_data *priv = dev_get_priv(dev); struct ftgmac100 *ftgmac100 = priv->iobase; struct ftgmac100_txdes *curr_des = &priv->txdes[priv->tx_index]; + union ftgmac100_dma_addr dma_addr; ulong des_start = ((ulong)curr_des) & ~(ARCH_DMA_MINALIGN - 1); ulong des_end = des_start + roundup(sizeof(*curr_des), ARCH_DMA_MINALIGN); @@ -499,10 +550,12 @@ static int ftgmac100_send(struct udevice *dev, void *packet, int length) length = (length < ETH_ZLEN) ? ETH_ZLEN : length; - curr_des->txdes3 = (unsigned int)packet; + dma_addr.addr = (dma_addr_t)packet; + curr_des->txdes2 = FIELD_PREP(FTGMAC100_TXDES2_TXBUF_BADR_HI, dma_addr.hi); + curr_des->txdes3 = dma_addr.lo; /* Flush data to be sent */ - data_start = curr_des->txdes3; + data_start = (ulong)dma_addr.addr; data_end = data_start + roundup(length, ARCH_DMA_MINALIGN); flush_dcache_range(data_start, data_end); @@ -565,6 +618,11 @@ static int ftgmac100_of_to_plat(struct udevice *dev) if (dev_get_driver_data(dev) == FTGMAC100_MODEL_ASPEED) { priv->rxdes0_edorr_mask = BIT(30); priv->txdes0_edotr_mask = BIT(30); + priv->is_ast2700 = false; + } else if (dev_get_driver_data(dev) == FTGMAC100_MODEL_ASPEED_AST2700) { + priv->rxdes0_edorr_mask = BIT(30); + priv->txdes0_edotr_mask = BIT(30); + priv->is_ast2700 = true; } else { priv->rxdes0_edorr_mask = BIT(15); priv->txdes0_edotr_mask = BIT(15); @@ -655,10 +713,11 @@ static const struct eth_ops ftgmac100_ops = { }; static const struct udevice_id ftgmac100_ids[] = { - { .compatible = "faraday,ftgmac100", .data = FTGMAC100_MODEL_FARADAY }, - { .compatible = "aspeed,ast2500-mac", .data = FTGMAC100_MODEL_ASPEED }, - { .compatible = "aspeed,ast2600-mac", .data = FTGMAC100_MODEL_ASPEED }, - { } + { .compatible = "faraday,ftgmac100", .data = FTGMAC100_MODEL_FARADAY }, + { .compatible = "aspeed,ast2500-mac", .data = FTGMAC100_MODEL_ASPEED }, + { .compatible = "aspeed,ast2600-mac", .data = FTGMAC100_MODEL_ASPEED }, + { .compatible = "aspeed,ast2700-mac", .data = FTGMAC100_MODEL_ASPEED_AST2700 }, + {} }; U_BOOT_DRIVER(ftgmac100) = { diff --git a/drivers/net/ftgmac100.h b/drivers/net/ftgmac100.h index f7874ae68b6..c38b57c9541 100644 --- a/drivers/net/ftgmac100.h +++ b/drivers/net/ftgmac100.h @@ -66,6 +66,13 @@ struct ftgmac100 { unsigned int rx_runt; /* 0xc0 */ unsigned int rx_crcer_ftl; /* 0xc4 */ unsigned int rx_col_lost; /* 0xc8 */ + unsigned int reserved[43]; /* 0xcc - 0x174 */ + unsigned int txr_badr_lo; /* 0x178, defined in ast2700 */ + unsigned int txr_badr_hi; /* 0x17c, defined in ast2700 */ + unsigned int hptxr_badr_lo; /* 0x180, defined in ast2700 */ + unsigned int hptxr_badr_hi; /* 0x184, defined in ast2700 */ + unsigned int rxr_badr_lo; /* 0x188, defined in ast2700 */ + unsigned int rxr_badr_hi; /* 0x18c, defined in ast2700 */ }; /* @@ -111,6 +118,7 @@ struct ftgmac100 { #define FTGMAC100_DBLAC_TXBURST_SIZE(x) (((x) & 0x3) << 10) #define FTGMAC100_DBLAC_RXDES_SIZE(x) (((x) & 0xf) << 12) #define FTGMAC100_DBLAC_TXDES_SIZE(x) (((x) & 0xf) << 16) +#define FTGMAC100_DESC_UNIT 8 #define FTGMAC100_DBLAC_IFG_CNT(x) (((x) & 0x7) << 20) #define FTGMAC100_DBLAC_IFG_INC BIT(23) @@ -157,6 +165,7 @@ struct ftgmac100 { #define FTGMAC100_MACCR_RX_BROADPKT BIT(17) #define FTGMAC100_MACCR_DISCARD_CRCERR BIT(18) #define FTGMAC100_MACCR_FAST_MODE BIT(19) +#define FTGMAC100_MACCR_RMII_ENABLE BIT(20) /* defined in ast2700 */ #define FTGMAC100_MACCR_SW_RST BIT(31) /* @@ -183,7 +192,7 @@ struct ftgmac100_txdes { unsigned int txdes1; unsigned int txdes2; /* not used by HW */ unsigned int txdes3; /* TXBUF_BADR */ -} __aligned(16); +} __aligned(ARCH_DMA_MINALIGN); #define FTGMAC100_TXDES0_TXBUF_SIZE(x) ((x) & 0x3fff) #define FTGMAC100_TXDES0_EDOTR BIT(15) @@ -201,6 +210,8 @@ struct ftgmac100_txdes { #define FTGMAC100_TXDES1_TX2FIC BIT(30) #define FTGMAC100_TXDES1_TXIC BIT(31) +#define FTGMAC100_TXDES2_TXBUF_BADR_HI GENMASK(18, 16) + /* * Receive descriptor, aligned to 16 bytes */ @@ -209,7 +220,7 @@ struct ftgmac100_rxdes { unsigned int rxdes1; unsigned int rxdes2; /* not used by HW */ unsigned int rxdes3; /* RXBUF_BADR */ -} __aligned(16); +} __aligned(ARCH_DMA_MINALIGN); #define FTGMAC100_RXDES0_VDBC(x) ((x) & 0x3fff) #define FTGMAC100_RXDES0_EDORR BIT(15) @@ -240,4 +251,6 @@ struct ftgmac100_rxdes { #define FTGMAC100_RXDES1_UDP_CHKSUM_ERR BIT(26) #define FTGMAC100_RXDES1_IP_CHKSUM_ERR BIT(27) +#define FTGMAC100_RXDES2_RXBUF_BADR_HI GENMASK(18, 16) + #endif /* __FTGMAC100_H */ diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 73064b2af68..a9efc509814 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -368,6 +368,7 @@ config PHY_FIXED config PHY_NCSI bool "NC-SI based PHY" + depends on NET endif #PHYLIB diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index fe7d1084450..461805ae53f 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -228,7 +228,6 @@ struct zynq_gem_priv { struct clk tx_clk; struct clk pclk; u32 max_speed; - bool int_pcs; bool dma_64bit; u32 clk_en_info; struct reset_ctl_bulk resets; @@ -504,8 +503,7 @@ static int zynq_gem_init(struct udevice *dev) * Set SGMII enable PCS selection only if internal PCS/PMA * core is used and interface is SGMII. */ - if (priv->interface == PHY_INTERFACE_MODE_SGMII && - priv->int_pcs) { + if (priv->interface == PHY_INTERFACE_MODE_SGMII) { nwconfig |= ZYNQ_GEM_NWCFG_SGMII_ENBL | ZYNQ_GEM_NWCFG_PCS_SEL; } @@ -529,8 +527,7 @@ static int zynq_gem_init(struct udevice *dev) writel(nwcfg, ®s->nwcfg); #ifdef CONFIG_ARM64 - if (priv->interface == PHY_INTERFACE_MODE_SGMII && - priv->int_pcs) { + if (priv->interface == PHY_INTERFACE_MODE_SGMII) { /* * Disable AN for fixed link configuration, enable otherwise. * Must be written after PCS_SEL is set in nwconfig, @@ -992,8 +989,6 @@ static int zynq_gem_of_to_plat(struct udevice *dev) return -EINVAL; priv->interface = pdata->phy_interface; - priv->int_pcs = dev_read_bool(dev, "is-internal-pcspma"); - priv->clk_en_info = dev_get_driver_data(dev); return 0; diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index f5e23f36c56..2c9d5a12127 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -1126,7 +1126,7 @@ static int cdns_sierra_phy_probe(struct udevice *dev) sp->autoconf = dev_read_bool(dev, "cdns,autoconf"); - dev_info(dev, "sierra probed\n"); + dev_dbg(dev, "sierra probed\n"); return 0; clk_disable: diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c index ff49819b58d..67e564f85c3 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -48,6 +48,7 @@ #define GPIO_OES 0x70 /* Output Enable Set */ #define GPIO_OEC 0x74 /* Output Enable Clear */ +#define NPCM8XX_NUM_GPIO_BANK 8 #define NPCM8XX_GPIO_PER_BANK 32 #define GPIOX_OFFSET 16 @@ -967,6 +968,18 @@ static int npcm8xx_pinconf_set(struct udevice *dev, unsigned int selector, } #endif +static void npcm8xx_pinctrl_clear_events(struct npcm8xx_pinctrl_priv *priv) +{ + void __iomem *base; + int i; + + for (i = 0; i < NPCM8XX_NUM_GPIO_BANK; i++) { + base = priv->gpio_base + (0x1000 * i); + clrbits_le32(base + GPIO_EVEN, 0xFFFFFFFF); + setbits_le32(base + GPIO_EVST, 0xFFFFFFFF); + } +} + static struct pinctrl_ops npcm8xx_pinctrl_ops = { .set_state = pinctrl_generic_set_state, .get_pins_count = npcm8xx_get_pins_count, @@ -1001,6 +1014,11 @@ static int npcm8xx_pinctrl_probe(struct udevice *dev) if (IS_ERR(priv->rst_regmap)) return -EINVAL; + /* + * Clear all previous gpio events, otherwise it may produce + * unexpected interrupts during kernel booting. + */ + npcm8xx_pinctrl_clear_events(priv); return 0; } diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 88a8525b3c4..decd0802c84 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -55,14 +55,16 @@ int regulator_set_value(struct udevice *dev, int uV) struct dm_regulator_uclass_plat *uc_pdata; int ret, old_uV = uV, is_enabled = 0; + if (!ops || !ops->set_value) + return -ENOSYS; + uc_pdata = dev_get_uclass_plat(dev); if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV) return -EINVAL; if (uc_pdata->max_uV != -ENODATA && uV > uc_pdata->max_uV) return -EINVAL; - - if (!ops || !ops->set_value) - return -ENOSYS; + if (uV == -ENODATA) + return -EINVAL; if (uc_pdata->ramp_delay) { is_enabled = regulator_get_enable(dev); @@ -85,14 +87,16 @@ int regulator_set_suspend_value(struct udevice *dev, int uV) const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); struct dm_regulator_uclass_plat *uc_pdata; + if (!ops || !ops->set_suspend_value) + return -ENOSYS; + uc_pdata = dev_get_uclass_plat(dev); if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV) return -EINVAL; if (uc_pdata->max_uV != -ENODATA && uV > uc_pdata->max_uV) return -EINVAL; - - if (!ops->set_suspend_value) - return -ENOSYS; + if (uV == -ENODATA) + return -EINVAL; return ops->set_suspend_value(dev, uV); } @@ -101,7 +105,7 @@ int regulator_get_suspend_value(struct udevice *dev) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); - if (!ops->get_suspend_value) + if (!ops || !ops->get_suspend_value) return -ENOSYS; return ops->get_suspend_value(dev); @@ -136,14 +140,16 @@ int regulator_set_current(struct udevice *dev, int uA) const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); struct dm_regulator_uclass_plat *uc_pdata; + if (!ops || !ops->set_current) + return -ENOSYS; + uc_pdata = dev_get_uclass_plat(dev); if (uc_pdata->min_uA != -ENODATA && uA < uc_pdata->min_uA) return -EINVAL; if (uc_pdata->max_uA != -ENODATA && uA > uc_pdata->max_uA) return -EINVAL; - - if (!ops || !ops->set_current) - return -ENOSYS; + if (uA == -ENODATA) + return -EINVAL; return ops->set_current(dev, uA); } @@ -210,7 +216,7 @@ int regulator_set_suspend_enable(struct udevice *dev, bool enable) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); - if (!ops->set_suspend_enable) + if (!ops || !ops->set_suspend_enable) return -ENOSYS; return ops->set_suspend_enable(dev, enable); @@ -220,7 +226,7 @@ int regulator_get_suspend_enable(struct udevice *dev) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); - if (!ops->get_suspend_enable) + if (!ops || !ops->get_suspend_enable) return -ENOSYS; return ops->get_suspend_enable(dev); @@ -299,7 +305,7 @@ int regulator_autoset(struct udevice *dev) if (ret == -ENOSYS) ret = 0; - if (!ret && uc_pdata->suspend_on) { + if (!ret && uc_pdata->suspend_on && uc_pdata->suspend_uV != -ENODATA) { ret = regulator_set_suspend_value(dev, uc_pdata->suspend_uV); if (ret == -ENOSYS) ret = 0; @@ -308,6 +314,11 @@ int regulator_autoset(struct udevice *dev) return ret; } + if (uc_pdata->force_off) { + ret = regulator_set_enable(dev, false); + goto out; + } + if (!uc_pdata->always_on && !uc_pdata->boot_on) { ret = -EMEDIUMTYPE; goto out; @@ -334,17 +345,6 @@ out: return ret; } -int regulator_unset(struct udevice *dev) -{ - struct dm_regulator_uclass_plat *uc_pdata; - - uc_pdata = dev_get_uclass_plat(dev); - if (uc_pdata && uc_pdata->force_off) - return regulator_set_enable(dev, false); - - return -EMEDIUMTYPE; -} - static void regulator_show(struct udevice *dev, int ret) { struct dm_regulator_uclass_plat *uc_pdata; @@ -433,6 +433,8 @@ static int regulator_post_bind(struct udevice *dev) const char *property = "regulator-name"; uc_pdata = dev_get_uclass_plat(dev); + uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on"); + uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on"); /* Regulator's mandatory constraint */ uc_pdata->name = dev_read_string(dev, property); @@ -444,13 +446,21 @@ static int regulator_post_bind(struct udevice *dev) return -EINVAL; } - if (regulator_name_is_unique(dev, uc_pdata->name)) - return 0; + if (!regulator_name_is_unique(dev, uc_pdata->name)) { + debug("'%s' of dev: '%s', has nonunique value: '%s\n", + property, dev->name, uc_pdata->name); + return -EINVAL; + } - debug("'%s' of dev: '%s', has nonunique value: '%s\n", - property, dev->name, uc_pdata->name); + /* + * In case the regulator has regulator-always-on or + * regulator-boot-on DT property, trigger probe() to + * configure its default state during startup. + */ + if (uc_pdata->always_on || uc_pdata->boot_on) + dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND); - return -EINVAL; + return 0; } static int regulator_pre_probe(struct udevice *dev) @@ -473,8 +483,6 @@ static int regulator_pre_probe(struct udevice *dev) -ENODATA); uc_pdata->max_uA = dev_read_u32_default(dev, "regulator-max-microamp", -ENODATA); - uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on"); - uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on"); uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay", 0); uc_pdata->force_off = dev_read_bool(dev, "regulator-force-boot-off"); @@ -504,56 +512,18 @@ static int regulator_pre_probe(struct udevice *dev) return 0; } -int regulators_enable_boot_on(bool verbose) +static int regulator_post_probe(struct udevice *dev) { - struct udevice *dev; - struct uclass *uc; int ret; - ret = uclass_get(UCLASS_REGULATOR, &uc); - if (ret) + ret = regulator_autoset(dev); + if (ret && ret != -EMEDIUMTYPE && ret != -EALREADY && ret != ENOSYS) return ret; - for (uclass_first_device(UCLASS_REGULATOR, &dev); - dev; - uclass_next_device(&dev)) { - ret = regulator_autoset(dev); - if (ret == -EMEDIUMTYPE || ret == -EALREADY) { - ret = 0; - continue; - } - if (verbose) - regulator_show(dev, ret); - if (ret == -ENOSYS) - ret = 0; - } - - return ret; -} - -int regulators_enable_boot_off(bool verbose) -{ - struct udevice *dev; - struct uclass *uc; - int ret; - ret = uclass_get(UCLASS_REGULATOR, &uc); - if (ret) - return ret; - for (uclass_first_device(UCLASS_REGULATOR, &dev); - dev; - uclass_next_device(&dev)) { - ret = regulator_unset(dev); - if (ret == -EMEDIUMTYPE) { - ret = 0; - continue; - } - if (verbose) - regulator_show(dev, ret); - if (ret == -ENOSYS) - ret = 0; - } + if (_DEBUG) + regulator_show(dev, ret); - return ret; + return 0; } UCLASS_DRIVER(regulator) = { @@ -561,5 +531,6 @@ UCLASS_DRIVER(regulator) = { .name = "regulator", .post_bind = regulator_post_bind, .pre_probe = regulator_pre_probe, + .post_probe = regulator_post_probe, .per_device_plat_auto = sizeof(struct dm_regulator_uclass_plat), }; diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c index 34e61511d88..375d06e3207 100644 --- a/drivers/power/regulator/rk8xx.c +++ b/drivers/power/regulator/rk8xx.c @@ -381,7 +381,7 @@ static int _buck_set_value(struct udevice *pmic, int buck, int uvolt) val = ((uvolt - info->min_uv) / info->step_uv) + info->min_sel; debug("%s: volt=%d, buck=%d, reg=0x%x, mask=0x%x, val=0x%x\n", - __func__, uvolt, buck + 1, info->vsel_reg, mask, val); + __func__, uvolt, buck, info->vsel_reg, mask, val); if (priv->variant == RK816_ID) { pmic_clrsetbits(pmic, info->vsel_reg, mask, val); @@ -415,7 +415,7 @@ static int _buck_set_enable(struct udevice *pmic, int buck, bool enable) break; case RK806_ID: value = RK806_POWER_EN_CLRSETBITS(buck % 4, enable); - en_reg = RK806_POWER_EN((buck + 1) / 4); + en_reg = RK806_POWER_EN(buck / 4); ret = pmic_reg_write(pmic, en_reg, value); break; case RK808_ID: @@ -470,7 +470,7 @@ static int _buck_set_suspend_value(struct udevice *pmic, int buck, int uvolt) val = ((uvolt - info->min_uv) / info->step_uv) + info->min_sel; debug("%s: volt=%d, buck=%d, reg=0x%x, mask=0x%x, val=0x%x\n", - __func__, uvolt, buck + 1, info->vsel_sleep_reg, mask, val); + __func__, uvolt, buck, info->vsel_sleep_reg, mask, val); return pmic_clrsetbits(pmic, info->vsel_sleep_reg, mask, val); } @@ -494,7 +494,7 @@ static int _buck_get_enable(struct udevice *pmic, int buck) break; case RK806_ID: mask = BIT(buck % 4); - ret = pmic_reg_read(pmic, RK806_POWER_EN((buck + 1) / 4)); + ret = pmic_reg_read(pmic, RK806_POWER_EN(buck / 4)); break; case RK808_ID: case RK818_ID: @@ -539,12 +539,13 @@ static int _buck_set_suspend_enable(struct udevice *pmic, int buck, bool enable) { u8 reg; - if (buck + 1 >= 9) { + if (buck >= 8) { + /* BUCK9 and BUCK10 */ reg = RK806_POWER_SLP_EN1; - mask = BIT(buck + 1 - 3); + mask = BIT(buck - 2); } else { reg = RK806_POWER_SLP_EN0; - mask = BIT(buck + 1); + mask = BIT(buck); } ret = pmic_clrsetbits(pmic, reg, mask, enable ? mask : 0); } @@ -590,12 +591,13 @@ static int _buck_get_suspend_enable(struct udevice *pmic, int buck) { u8 reg; - if (buck + 1 >= 9) { + if (buck >= 8) { + /* BUCK9 and BUCK10 */ reg = RK806_POWER_SLP_EN1; - mask = BIT(buck + 1 - 3); + mask = BIT(buck - 2); } else { reg = RK806_POWER_SLP_EN0; - mask = BIT(buck + 1); + mask = BIT(buck); } val = pmic_reg_read(pmic, reg); } diff --git a/drivers/ram/Makefile b/drivers/ram/Makefile index c9c46cc17a8..fdb2e78ec9e 100644 --- a/drivers/ram/Makefile +++ b/drivers/ram/Makefile @@ -14,7 +14,7 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_K3_AM654_DDRSS) += k3-am654-ddrss.o obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ -obj-$(CONFIG_ARCH_ASPEED) += aspeed/ +obj-$(CONFIG_ASPEED_RAM) += aspeed/ obj-$(CONFIG_K3_DDRSS) += k3-ddrss/ obj-$(CONFIG_IMXRT_SDRAM) += imxrt_sdram.o diff --git a/drivers/ram/aspeed/Kconfig b/drivers/ram/aspeed/Kconfig index 0deab8649b6..e4918460de6 100644 --- a/drivers/ram/aspeed/Kconfig +++ b/drivers/ram/aspeed/Kconfig @@ -1,6 +1,7 @@ menuconfig ASPEED_RAM bool "ASPEED SDRAM configuration" - depends on RAM && ARCH_ASPEED + depends on RAM + depends on ARCH_ASPEED || TARGET_ASPEED_AST2700_IBEX default ARCH_ASPEED help Configuration options for DDR SDRAM on ASPEED systems. @@ -8,8 +9,6 @@ menuconfig ASPEED_RAM RAM initialisation is always built in for the platform. This menu allows customisation of the configuration used. -if ASPEED_RAM - config ASPEED_DDR4_DUALX8 bool "Enable Dual X8 DDR4 die" depends on ASPEED_RAM @@ -74,4 +73,24 @@ config ASPEED_DDR4_1600 select DDR4 target data rate at 1600M endchoice -endif # End of ASPEED_RAM +choice + prompt "AST2700 DDR target date rate" + default ASPEED_DDR_3200 + depends on ASPEED_RAM + depends on TARGET_ASPEED_AST2700_IBEX + +config ASPEED_DDR_1600 + bool "1600 Mbps" + help + select DDR target data rate at 1600M + +config ASPEED_DDR_2400 + bool "2400 Mbps" + help + select DDR target data rate at 2400M + +config ASPEED_DDR_3200 + bool "3200 Mbps" + help + select DDR target data rate at 3200M +endchoice diff --git a/drivers/ram/aspeed/Makefile b/drivers/ram/aspeed/Makefile index 7ac10af1c22..1f0b22c8e9f 100644 --- a/drivers/ram/aspeed/Makefile +++ b/drivers/ram/aspeed/Makefile @@ -2,3 +2,4 @@ # obj-$(CONFIG_ASPEED_AST2500) += sdram_ast2500.o obj-$(CONFIG_ASPEED_AST2600) += sdram_ast2600.o +obj-$(CONFIG_TARGET_ASPEED_AST2700_IBEX) += sdram_ast2700.o diff --git a/drivers/ram/aspeed/dwc_ddrphy_phyinit_ddr4-3200-nodimm-train2D.c b/drivers/ram/aspeed/dwc_ddrphy_phyinit_ddr4-3200-nodimm-train2D.c new file mode 100644 index 00000000000..de593c17fad --- /dev/null +++ b/drivers/ram/aspeed/dwc_ddrphy_phyinit_ddr4-3200-nodimm-train2D.c @@ -0,0 +1,2700 @@ +// SPDX-License-Identifier: GPL-2.0+ +// [dwc_ddrphy_phyinit_main] Start of dwc_ddrphy_phyinit_main() +// [dwc_ddrphy_phyinit_sequence] Start of dwc_ddrphy_phyinit_sequence() +// [dwc_ddrphy_phyinit_initStruct] Start of dwc_ddrphy_phyinit_initStruct() +// [dwc_ddrphy_phyinit_initStruct] End of dwc_ddrphy_phyinit_initStruct() +// [dwc_ddrphy_phyinit_setDefault] Start of dwc_ddrphy_phyinit_setDefault() +// [dwc_ddrphy_phyinit_setDefault] End of dwc_ddrphy_phyinit_setDefault() + +////############################################################## +// +//// dwc_ddrphy_phyinit_userCustom_overrideUserInput is a user-editable function. User can edit this function according to their needs. +//// +//// The purpose of dwc_ddrphy_phyinit_userCustom_overrideUserInput() is to override any +//// any field in Phyinit data structure set by dwc_ddrphy_phyinit_setDefault() +//// User should only override values in userInputBasic and userInputAdvanced. +//// IMPORTANT: in this function, user shall not override any values in the +//// messageblock directly on the data structue as the might be overwritten by +//// dwc_ddrphy_phyinit_calcMb(). Use dwc_ddrphy_phyinit_setMb() to set +//// messageblock parameters for override values to remain pervasive if +//// desired +// +////############################################################## + +dwc_ddrphy_phyinit_userCustom_overrideUserInput(); +// +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramType' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DimmType' to 0x4 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumDbyte' to 0x2 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumActiveDbyteDfi0' to 0x2 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumAnib' to 0xa +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumRank_dfi0' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[0]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[1]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[2]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[3]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumPStates' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Frequency[0]' to 0x640 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PllBypass[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DfiFreqRatio[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Dfi1Exists' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'D4RxPreambleLength[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'D4TxPreambleLength[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'ExtCalResVal' to 0xf0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Is2Ttiming[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'ODTImpedance[0]' to 0x78 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxImpedance[0]' to 0x3c +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'MemAlertEn' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'MtestPUImp' to 0xf0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DisDynAdrTri[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PhyMstrTrainInterval[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PhyMstrMaxReqToAck[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PhyMstrCtrlMode[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'WDQSExt' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'CalInterval' to 0x9 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'CalOnce' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'RxEnBackOff' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TrainSequenceCtrl' to 0x31f +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'SnpsUmctlOpt' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'SnpsUmctlF0RC5x[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewRiseDQ[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewFallDQ[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewRiseAC' to 0x45 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewFallAC' to 0xa +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'IsHighVDD' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewRiseCK' to 0x52 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewFallCK' to 0x12 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DisablePmuEcc' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnableMAlertAsync' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Apb32BitMode' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tDQS2DQ' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tDQSCK' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_override' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][1]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][2]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][3]' to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MsgMisc to 0x7 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].Pstate to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].PllBypassEn to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].DRAMFreq to 0xc80 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].PhyVref to 0x40 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].DramType to 0x2 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].DisabledDbyte to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].EnabledDQs to 0x10 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].CsPresent to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].CsPresentD0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].CsPresentD1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AddrMirror to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].PhyCfg to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].SequenceCtrl to 0x31f +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].HdtCtrl to 0xc8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].PhyConfigOverride to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].DFIMRLMargin to 0x2 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR0 to 0x2150 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR1 to 0x101 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR2 to 0x228 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR3 to 0x400 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR4 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR5 to 0x500 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].MR6 to 0x104f +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].X16Present to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].CsSetupGDDec to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl4 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl5 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl6 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].AcsmOdtCtrl7 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR0Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR1Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR2Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].VrefDqR3Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].ALT_CAS_L to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].ALT_WCAS_L to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].D4Misc to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].ExtTrainOpt to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_1D[0].NVDIMM to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MsgMisc to 0x7 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].Pstate to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].PllBypassEn to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].DRAMFreq to 0xc80 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].PhyVref to 0x40 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].DramType to 0x2 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].DisabledDbyte to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].EnabledDQs to 0x10 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].CsPresent to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].CsPresentD0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].CsPresentD1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AddrMirror to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].PhyCfg to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].SequenceCtrl to 0x31f +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].HdtCtrl to 0xc8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].PhyConfigOverride to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].DFIMRLMargin to 0x2 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR0 to 0x2150 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR1 to 0x101 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR2 to 0x228 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR3 to 0x400 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR4 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR5 to 0x500 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].MR6 to 0x104f +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].X16Present to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].CsSetupGDDec to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl4 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl5 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl6 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].AcsmOdtCtrl7 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR0Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR1Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR2Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib0 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib1 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib2 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib3 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib4 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib5 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib6 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib7 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib8 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib9 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib10 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib11 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib12 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib13 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib14 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib15 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib16 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib17 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib18 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].VrefDqR3Nib19 to 0xf +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].ALT_CAS_L to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].ALT_WCAS_L to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].D4Misc to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].ExtTrainOpt to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR4U_2D[0].NVDIMM to 0x0 +// [dwc_ddrphy_phyinit_userCustom_overrideUserInput] End of dwc_ddrphy_phyinit_userCustom_overrideUserInput() +//[dwc_ddrphy_phyinit_calcMb] Start of dwc_ddrphy_phyinit_calcMb() +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].DramType override to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].Pstate override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].DRAMFreq override to 0xc80 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].PllBypassEn override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].EnabledDQs override to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].PhyCfg override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].DisabledDbyte override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_1D[0].X16Present override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].DramType to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].Pstate to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].DRAMFreq to 0x856 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].PllBypassEn to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].EnabledDQs to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].PhyCfg to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].DisabledDbyte to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[1].X16Present to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].DramType to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].Pstate to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].DRAMFreq to 0x74a +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].PllBypassEn to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].EnabledDQs to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].PhyCfg to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].DisabledDbyte to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[2].X16Present to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].DramType to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].Pstate to 0x3 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].DRAMFreq to 0x640 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].PllBypassEn to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].EnabledDQs to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].PhyCfg to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].DisabledDbyte to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR4U_1D[3].X16Present to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].DramType override to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].Pstate override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].DRAMFreq override to 0xc80 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].PllBypassEn override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].EnabledDQs override to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].PhyCfg override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].DisabledDbyte override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR4U_2D[0].X16Present override to 0x0 +////[dwc_ddrphy_phyinit_calcMb] TG_active[0] = 1 +////[dwc_ddrphy_phyinit_calcMb] TG_active[1] = 0 +////[dwc_ddrphy_phyinit_calcMb] TG_active[2] = 0 +////[dwc_ddrphy_phyinit_calcMb] TG_active[3] = 0 +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=0] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=0] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=0] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=1] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=1] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=1] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=2] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=2] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=2] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=3] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=3] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=3] = 0 ps +//[dwc_ddrphy_phyinit_calcMb] End of dwc_ddrphy_phyinit_calcMb() +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // Printing values in user input structure +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] pUserInputBasic->Frequency[0] = 1600 +//// [phyinit_print_dat] pUserInputBasic->Frequency[1] = 1067 +//// [phyinit_print_dat] pUserInputBasic->Frequency[2] = 933 +//// [phyinit_print_dat] pUserInputBasic->Frequency[3] = 800 +//// [phyinit_print_dat] pUserInputBasic->NumAnib = 10 +//// [phyinit_print_dat] pUserInputBasic->DramType = 0 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitValOvr = 0 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[0] = 3 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[1] = 3 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[2] = 3 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[3] = 3 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[0] = 1 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[1] = 1 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[2] = 1 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[3] = 1 +//// [phyinit_print_dat] pUserInputBasic->NumActiveDbyteDfi0 = 2 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[0] = 0 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[1] = 0 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[2] = 0 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[3] = 0 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[0] = 16 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[1] = 16 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[2] = 16 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[3] = 16 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[0] = 0 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[1] = 0 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[2] = 0 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[3] = 0 +//// [phyinit_print_dat] pUserInputBasic->Dfi1Exists = 0 +//// [phyinit_print_dat] pUserInputBasic->Train2D = 0 +//// [phyinit_print_dat] pUserInputBasic->NumRank_dfi0 = 1 +//// [phyinit_print_dat] pUserInputBasic->DimmType = 4 +//// [phyinit_print_dat] pUserInputBasic->NumPStates = 1 +//// [phyinit_print_dat] pUserInputBasic->NumDbyte = 2 +//// [phyinit_print_dat] pUserInputAdvanced->DisablePmuEcc = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[1] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[2] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[3] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[4] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[5] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[6] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[7] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlOpt = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[0] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[1] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[2] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[3] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallAC = 10 +//// [phyinit_print_dat] pUserInputAdvanced->CalOnce = 0 +//// [phyinit_print_dat] pUserInputAdvanced->ExtCalResVal = 240 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[2] = 11 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[3] = 11 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[4] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[5] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[6] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[7] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->CalInterval = 9 +//// [phyinit_print_dat] pUserInputAdvanced->IsHighVDD = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseAC = 69 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseCK = 82 +//// [phyinit_print_dat] pUserInputAdvanced->RedundantCs_en = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TrainSequenceCtrl = 799 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->MtestPUImp = 240 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[1] = 3 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[2] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[3] = 3 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[4] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[5] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[6] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[7] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AlertRecoveryEnable = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->VREGCtrl_LP2_PwrSavings_En = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[1] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[2] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[3] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallCK = 18 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[0] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[1] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[2] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[3] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->en_16LogicalRanks_3DS = 0 +//// [phyinit_print_dat] pUserInputAdvanced->RstRxTrkState = 0 +//// [phyinit_print_dat] pUserInputAdvanced->Is2Ttiming[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->Is2Ttiming[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->Is2Ttiming[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->Is2Ttiming[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->MemAlertEn = 0 +//// [phyinit_print_dat] pUserInputAdvanced->rtt_term_en = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->WDQSExt = 0 +//// [phyinit_print_dat] pUserInputAdvanced->en_3DS = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[0] = 120 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[1] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[2] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[3] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->EnableMAlertAsync = 0 +//// [phyinit_print_dat] pUserInputAdvanced->Apb32BitMode = 1 +//// [phyinit_print_dat] pUserInputAdvanced->Nibble_ECC = 15 +//// [phyinit_print_dat] pUserInputAdvanced->RxEnBackOff = 1 +//// [phyinit_print_dat] pUserInputAdvanced->ATxImpedance = 53247 +//// [phyinit_print_dat] pUserInputSim->tDQS2DQ = 0 +//// [phyinit_print_dat] pUserInputSim->tDQSCK = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[0] = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[1] = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[2] = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[3] = 0 +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // Printing values of 1D message block input/inout fields, PState=0 +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] mb_DDR4U_1D[0].AdvTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MsgMisc = 0x7 +//// [phyinit_print_dat] mb_DDR4U_1D[0].Pstate = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PllBypassEn = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DRAMFreq = 0xc80 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PhyVref = 0x40 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DramType = 0x2 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DisabledDbyte = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].EnabledDQs = 0x10 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsPresent = 0x1 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsPresentD0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsPresentD1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AddrMirror = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PhyCfg = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].SequenceCtrl = 0x31f +//// [phyinit_print_dat] mb_DDR4U_1D[0].HdtCtrl = 0xc8 +//// [phyinit_print_dat] mb_DDR4U_1D[0].Rx2D_CmdSpacing = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MREP_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DWL_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PhyConfigOverride = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DFIMRLMargin = 0x2 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DDR4_RXEN_OFFSET = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR0 = 0x2150 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR1 = 0x101 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR2 = 0x228 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR3 = 0x400 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR5 = 0x500 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR6 = 0x104f +//// [phyinit_print_dat] mb_DDR4U_1D[0].X16Present = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsSetupGDDec = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].ALT_CAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].ALT_WCAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].D4Misc = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].ExtTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].NVDIMM = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AdvTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MsgMisc = 0x7 +//// [phyinit_print_dat] mb_DDR4U_1D[0].Pstate = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PllBypassEn = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DRAMFreq = 0xc80 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PhyVref = 0x40 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DramType = 0x2 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DisabledDbyte = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].EnabledDQs = 0x10 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsPresent = 0x1 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsPresentD0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsPresentD1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AddrMirror = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PhyCfg = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].SequenceCtrl = 0x31f +//// [phyinit_print_dat] mb_DDR4U_1D[0].HdtCtrl = 0xc8 +//// [phyinit_print_dat] mb_DDR4U_1D[0].Rx2D_CmdSpacing = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MREP_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DWL_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].PhyConfigOverride = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DFIMRLMargin = 0x2 +//// [phyinit_print_dat] mb_DDR4U_1D[0].DDR4_RXEN_OFFSET = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR0 = 0x2150 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR1 = 0x101 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR2 = 0x228 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR3 = 0x400 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR5 = 0x500 +//// [phyinit_print_dat] mb_DDR4U_1D[0].MR6 = 0x104f +//// [phyinit_print_dat] mb_DDR4U_1D[0].X16Present = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].CsSetupGDDec = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].RTT_NOM_WR_PARK7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].AcsmOdtCtrl7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR0Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR1Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR2Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].VrefDqR3Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_1D[0].ALT_CAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].ALT_WCAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].D4Misc = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].ExtTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_1D[0].NVDIMM = 0x0 +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // Printing values of 2D message block input/inout fields, PState=0 +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] mb_DDR4U_2D[0].AdvTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MsgMisc = 0x7 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Pstate = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PllBypassEn = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DRAMFreq = 0xc80 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PhyVref = 0x40 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DramType = 0x2 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DisabledDbyte = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].EnabledDQs = 0x10 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsPresent = 0x1 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsPresentD0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsPresentD1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AddrMirror = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PhyCfg = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].SequenceCtrl = 0x31f +//// [phyinit_print_dat] mb_DDR4U_2D[0].HdtCtrl = 0xc8 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].TX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Share2DVrefResult = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Delay_Weight2D = 0x20 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Voltage_Weight2D = 0x80 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Rx2D_CmdSpacing = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MREP_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DWL_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PhyConfigOverride = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DFIMRLMargin = 0x2 +//// [phyinit_print_dat] mb_DDR4U_2D[0].VoltageRange2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR1_EQU_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].advSearch_rd2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].advSearch_wr2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].moreDebug2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR6_EQU_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].TX2D_DB_DFE_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsWriteNoise = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AdvTrainOpt2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Misc2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR0 = 0x2150 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR1 = 0x101 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR2 = 0x228 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR3 = 0x400 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR5 = 0x500 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR6 = 0x104f +//// [phyinit_print_dat] mb_DDR4U_2D[0].X16Present = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsSetupGDDec = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].ALT_CAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].ALT_WCAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].D4Misc = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].ExtTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].NVDIMM = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AdvTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MsgMisc = 0x7 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Pstate = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PllBypassEn = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DRAMFreq = 0xc80 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PhyVref = 0x40 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DramType = 0x2 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DisabledDbyte = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].EnabledDQs = 0x10 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsPresent = 0x1 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsPresentD0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsPresentD1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AddrMirror = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PhyCfg = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].SequenceCtrl = 0x31f +//// [phyinit_print_dat] mb_DDR4U_2D[0].HdtCtrl = 0xc8 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].TX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Share2DVrefResult = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Delay_Weight2D = 0x20 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Voltage_Weight2D = 0x80 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Rx2D_CmdSpacing = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MREP_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DWL_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].PhyConfigOverride = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].DFIMRLMargin = 0x2 +//// [phyinit_print_dat] mb_DDR4U_2D[0].VoltageRange2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR1_EQU_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].advSearch_rd2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].advSearch_wr2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].moreDebug2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR6_EQU_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].TX2D_DB_DFE_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsWriteNoise = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AdvTrainOpt2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].Misc2D = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR0 = 0x2150 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR1 = 0x101 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR2 = 0x228 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR3 = 0x400 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR5 = 0x500 +//// [phyinit_print_dat] mb_DDR4U_2D[0].MR6 = 0x104f +//// [phyinit_print_dat] mb_DDR4U_2D[0].X16Present = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].CsSetupGDDec = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].RTT_NOM_WR_PARK7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl0 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl1 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl2 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl3 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl4 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl5 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl6 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].AcsmOdtCtrl7 = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR0Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR1Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR2Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib0 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib1 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib2 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib3 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib4 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib5 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib6 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib7 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib8 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib9 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib10 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib11 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib12 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib13 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib14 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib15 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib16 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib17 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib18 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].VrefDqR3Nib19 = 0xf +//// [phyinit_print_dat] mb_DDR4U_2D[0].ALT_CAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].ALT_WCAS_L = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].D4Misc = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].ExtTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR4U_2D[0].NVDIMM = 0x0 + +////############################################################## +//// +//// Step (A) : Bring up VDD, VDDQ, and VAA +//// +//// The power supplies can come up and stabilize in any order. +//// While the power supplies are coming up, all outputs will be unknown and +//// the values of the inputs are don't cares. +//// +////############################################################## + +dwc_ddrphy_phyinit_userCustom_A_bringupPower(); + +//[dwc_ddrphy_phyinit_userCustom_A_bringupPower] End of dwc_ddrphy_phyinit_userCustom_A_bringupPower() +// +// +////############################################################## +//// +//// 4.3.2(B) Start Clocks and Reset the PHY +//// +//// Following is one possbile sequence to reset the PHY. Other sequences are also possible. +//// See section 5.2.2 of the PUB for other possible reset sequences. +//// +//// 1. Drive PwrOkIn to 0. Note: Reset, DfiClk, and APBCLK can be X. +//// 2. Start DfiClk and APBCLK +//// 3. Drive Reset to 1 and PRESETn_APB to 0. +//// Note: The combination of PwrOkIn=0 and Reset=1 signals a cold reset to the PHY. +//// 4. Wait a minimum of 8 cycles. +//// 5. Drive PwrOkIn to 1. Once the PwrOkIn is asserted (and Reset is still asserted), +//// DfiClk synchronously switches to any legal input frequency. +//// 6. Wait a minimum of 64 cycles. Note: This is the reset period for the PHY. +//// 7. Drive Reset to 0. Note: All DFI and APB inputs must be driven at valid reset states before the deassertion of Reset. +//// 8. Wait a minimum of 1 Cycle. +//// 9. Drive PRESETn_APB to 1 to de-assert reset on the ABP bus. +////10. The PHY is now in the reset state and is ready to accept APB transactions. +//// +////############################################################## +// +// +dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy(sdrammc); + +//// [dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy] End of dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy() +// + +////############################################################## +//// +//// Step (C) Initialize PHY Configuration +//// +//// Load the required PHY configuration registers for the appropriate mode and memory configuration +//// +////############################################################## +// + +//// [phyinit_C_initPhyConfig] Start of dwc_ddrphy_phyinit_C_initPhyConfig() +//// [phyinit_C_initPhyConfig] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x1 +dwc_ddrphy_apb_wr(0x200a6, 0x2); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for MASTER +dwc_ddrphy_apb_wr(0x20066, 0x0); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all DBYTEs +dwc_ddrphy_apb_wr(0x10066, 0x0); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x11066, 0x0); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all ANIBs +dwc_ddrphy_apb_wr(0x66, 0x0); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x1066, 0x0); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x2066, 0x0); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x3066, 0x0); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x4066, 0x0); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x5066, 0x0); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x6066, 0x0); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x7066, 0x0); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x8066, 0x0); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x9066, 0x0); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl1::VshDAC to 0x31 for MASTER +dwc_ddrphy_apb_wr(0x20029, 0xc4); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl1_p0 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl1::VshDAC to 0x31 for all DBYTEs +dwc_ddrphy_apb_wr(0x10029, 0xc4); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x11029, 0xc4); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl1_p0 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl1::VshDAC to 0x31 for all ANIBs +dwc_ddrphy_apb_wr(0x29, 0xc4); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x1029, 0xc4); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x2029, 0xc4); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x3029, 0xc4); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x4029, 0xc4); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x5029, 0xc4); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x6029, 0xc4); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x7029, 0xc4); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x8029, 0xc4); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x9029, 0xc4); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxSlewRate::CsrTxSrc to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxSlewRate::TxPreDrvMode to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxSlewRate to 0x0 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for TxSlewRate::CsrTxSrc are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult the "Output Slew Rate" section of HSpice Model App Note in specific technology for recommended settings + +dwc_ddrphy_apb_wr(0x1005f, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxSlewRate_b0_p0 +dwc_ddrphy_apb_wr(0x1015f, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxSlewRate_b1_p0 +dwc_ddrphy_apb_wr(0x1105f, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxSlewRate_b0_p0 +dwc_ddrphy_apb_wr(0x1115f, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxSlewRate_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::ATxPreDrvMode to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 0 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 0 to 0x11e +dwc_ddrphy_apb_wr(0x55, 0x11e); // DWC_DDRPHYA_ANIB0_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 1 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 1 to 0x11e +dwc_ddrphy_apb_wr(0x1055, 0x11e); // DWC_DDRPHYA_ANIB1_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 2 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 2 to 0x11e +dwc_ddrphy_apb_wr(0x2055, 0x11e); // DWC_DDRPHYA_ANIB2_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 3 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 3 to 0x11e +dwc_ddrphy_apb_wr(0x3055, 0x11e); // DWC_DDRPHYA_ANIB3_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 4 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 4 to 0x11e +dwc_ddrphy_apb_wr(0x4055, 0x11e); // DWC_DDRPHYA_ANIB4_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 5 to 0x15a +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 5 to 0x15a +dwc_ddrphy_apb_wr(0x5055, 0x15a); // DWC_DDRPHYA_ANIB5_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 6 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 6 to 0x11e +dwc_ddrphy_apb_wr(0x6055, 0x11e); // DWC_DDRPHYA_ANIB6_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 7 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 7 to 0x11e +dwc_ddrphy_apb_wr(0x7055, 0x11e); // DWC_DDRPHYA_ANIB7_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 8 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 8 to 0x11e +dwc_ddrphy_apb_wr(0x8055, 0x11e); // DWC_DDRPHYA_ANIB8_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 9 to 0x11e +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 9 to 0x11e +dwc_ddrphy_apb_wr(0x9055, 0x11e); // DWC_DDRPHYA_ANIB9_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for ATxSlewRate::CsrATxSrc are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult the "Output Slew Rate" section of HSpice Model App Note in specific technology for recommended settings + +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride::CsrTxOvSrc to 0x172 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride::TxCalBaseN to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride::TxCalBaseP to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride to 0x372 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for CalPreDriverOverride::CsrTxOvSrc are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult the "Output Slew Rate" section of HSpice Model App Note in specific technology for recommended settings + +dwc_ddrphy_apb_wr(0x2008c, 0x372); // DWC_DDRPHYA_MASTER0_base0_CalPreDriverOverride +//// [phyinit_C_initPhyConfig] PUB revision is 0x0350. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl2::PllFreqSel to 0x19 based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200c5, 0x19); // DWC_DDRPHYA_MASTER0_base0_PllCtrl2_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl1::PllCpPropCtrl to 0x3 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl1::PllCpIntCtrl to 0x1 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl1 to 0x61 based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200c7, 0x61); // DWC_DDRPHYA_MASTER0_base0_PllCtrl1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllTestMode to 0x400f based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200ca, 0x400f); // DWC_DDRPHYA_MASTER0_base0_PllTestMode_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl4::PllCpPropGsCtrl to 0x6 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl4::PllCpIntGsCtrl to 0x12 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl4 to 0xd2 based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200cc, 0xd2); // DWC_DDRPHYA_MASTER0_base0_PllCtrl4_p0 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for PllCtrl1 and PllTestMode are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult technology specific PHY Databook for recommended settings + +// +////############################################################## +//// +//// Program ARdPtrInitVal based on Frequency and PLL Bypass inputs +//// The values programmed here assume ideal properties of DfiClk +//// and Pclk including: +//// - DfiClk skew +//// - DfiClk jitter +//// - DfiClk PVT variations +//// - Pclk skew +//// - Pclk jitter +//// +//// PLL Bypassed mode: +//// For MemClk frequency > 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 2-5 +//// For MemClk frequency < 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 1-5 +//// +//// PLL Enabled mode: +//// For MemClk frequency > 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 1-5 +//// For MemClk frequency < 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 0-5 +//// +////############################################################## +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ARdPtrInitVal to 0x1 +dwc_ddrphy_apb_wr(0x2002e, 0x1); // DWC_DDRPHYA_MASTER0_base0_ARdPtrInitVal_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DisPtrInitClrTxTracking to 0x0 +dwc_ddrphy_apb_wr(0x20051, 0x0); // DWC_DDRPHYA_MASTER0_base0_PtrInitTrackingModeCntrl_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::TwoTckRxDqsPre to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::TwoTckTxDqsPre to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::PositionDfeInit to 0x2 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::DDR5RxPreamble to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::DDR5RxPostamble to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl to 0x8 +dwc_ddrphy_apb_wr(0x20024, 0x8); // DWC_DDRPHYA_MASTER0_base0_DqsPreambleControl_p0 +//// [phyinit_C_initPhyConfig] Programming DbyteDllModeCntrl::DllRxPreambleMode to 0x1 +//// [phyinit_C_initPhyConfig] Programming DbyteDllModeCntrl::DllRxBurstLengthMode to 0x0 +//// [phyinit_C_initPhyConfig] Programming DbyteDllModeCntrl to 0x2 +dwc_ddrphy_apb_wr(0x2003a, 0x2); // DWC_DDRPHYA_MASTER0_base0_DbyteDllModeCntrl +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxOdtDrvStren::TxOdtStrenPu to 0x4 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxOdtDrvStren::TxOdtStrenPd to 0x0 +dwc_ddrphy_apb_wr(0x1004d, 0x4); // DWC_DDRPHYA_DBYTE0_base0_TxOdtDrvStren_b0_p0 +dwc_ddrphy_apb_wr(0x1014d, 0x4); // DWC_DDRPHYA_DBYTE0_base0_TxOdtDrvStren_b1_p0 +dwc_ddrphy_apb_wr(0x1104d, 0x4); // DWC_DDRPHYA_DBYTE1_base0_TxOdtDrvStren_b0_p0 +dwc_ddrphy_apb_wr(0x1114d, 0x4); // DWC_DDRPHYA_DBYTE1_base0_TxOdtDrvStren_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ADrvStrenP to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ADrvStrenN to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ATxReserved13x12 to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ATxCalBaseN to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ATxCalBaseP to 0x1 +dwc_ddrphy_apb_wr(0x43, 0xcfff); // DWC_DDRPHYA_ANIB0_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x1043, 0xcfff); // DWC_DDRPHYA_ANIB1_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x2043, 0xcfff); // DWC_DDRPHYA_ANIB2_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x3043, 0xcfff); // DWC_DDRPHYA_ANIB3_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x4043, 0xcfff); // DWC_DDRPHYA_ANIB4_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x5043, 0xcfff); // DWC_DDRPHYA_ANIB5_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x6043, 0xcfff); // DWC_DDRPHYA_ANIB6_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x7043, 0xcfff); // DWC_DDRPHYA_ANIB7_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x8043, 0xcfff); // DWC_DDRPHYA_ANIB8_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x9043, 0xcfff); // DWC_DDRPHYA_ANIB9_base0_ATxImpedance +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl0::TxStrenEqHiPu to 0xc +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl0::TxStrenEqLoPd to 0xc +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl1::TxStrenPu to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl1::TxStrenPd to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl2::TxStrenEqLoPu to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl2::TxStrenEqHiPd to 0x0 +dwc_ddrphy_apb_wr(0x10041, 0x30c); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl0_b0_p0 +dwc_ddrphy_apb_wr(0x10049, 0xfff); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl1_b0_p0 +dwc_ddrphy_apb_wr(0x1004b, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl2_b0_p0 +dwc_ddrphy_apb_wr(0x10141, 0x30c); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl0_b1_p0 +dwc_ddrphy_apb_wr(0x10149, 0xfff); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl1_b1_p0 +dwc_ddrphy_apb_wr(0x1014b, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl2_b1_p0 +dwc_ddrphy_apb_wr(0x11041, 0x30c); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl0_b0_p0 +dwc_ddrphy_apb_wr(0x11049, 0xfff); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl1_b0_p0 +dwc_ddrphy_apb_wr(0x1104b, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl2_b0_p0 +dwc_ddrphy_apb_wr(0x11141, 0x30c); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl0_b1_p0 +dwc_ddrphy_apb_wr(0x11149, 0xfff); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl1_b1_p0 +dwc_ddrphy_apb_wr(0x1114b, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl2_b1_p0 +//// [phyinit_C_initPhyConfig] Programming DfiMode to 0x1 +dwc_ddrphy_apb_wr(0x20018, 0x1); // DWC_DDRPHYA_MASTER0_base0_DfiMode +//// [phyinit_C_initPhyConfig] Programming DfiCAMode to 0x2 +dwc_ddrphy_apb_wr(0x20075, 0x2); // DWC_DDRPHYA_MASTER0_base0_DfiCAMode +//// [phyinit_C_initPhyConfig] Programming CalDrvStr0::CalDrvStrPd50 to 0x2 +//// [phyinit_C_initPhyConfig] Programming CalDrvStr0::CalDrvStrPu50 to 0x2 +dwc_ddrphy_apb_wr(0x20050, 0x82); // DWC_DDRPHYA_MASTER0_base0_CalDrvStr0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalUclkInfo::CalUClkTicksPer1uS to 0x320 +dwc_ddrphy_apb_wr(0x20008, 0x320); // DWC_DDRPHYA_MASTER0_base0_CalUclkInfo_p0 +//// [phyinit_C_initPhyConfig] Programming CalRate::CalInterval to 0x9 +//// [phyinit_C_initPhyConfig] Programming CalRate::CalOnce to 0x0 +dwc_ddrphy_apb_wr(0x20088, 0x9); // DWC_DDRPHYA_MASTER0_base0_CalRate +//// [phyinit_C_initPhyConfig] Pstate=0, Programming VrefInGlobal::GlobalVrefInSel to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming VrefInGlobal::GlobalVrefInDAC to 0x1f +//// [phyinit_C_initPhyConfig] Pstate=0, Programming VrefInGlobal to 0xf8 +dwc_ddrphy_apb_wr(0x200b2, 0xf8); // DWC_DDRPHYA_MASTER0_base0_VrefInGlobal_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=0, Upper/Lower=0) to 0x2500 +dwc_ddrphy_apb_wr(0x10043, 0x2500); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl_b0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=0, Upper/Lower=1) to 0x2500 +dwc_ddrphy_apb_wr(0x10143, 0x2500); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=1, Upper/Lower=0) to 0x2500 +dwc_ddrphy_apb_wr(0x11043, 0x2500); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl_b0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=1, Upper/Lower=1) to 0x2500 +dwc_ddrphy_apb_wr(0x11143, 0x2500); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl2 to 0x1c +dwc_ddrphy_apb_wr(0x1004c, 0x1c); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl2_p0 +dwc_ddrphy_apb_wr(0x1104c, 0x1c); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl2_p0 +//// [phyinit_C_initPhyConfig] Programming ATxOdtDrvStren of ANIB_0 to 0x0 +dwc_ddrphy_apb_wr(0x42, 0x0); // DWC_DDRPHYA_ANIB0_base0_ATxOdtDrvStren +//// [phyinit_C_initPhyConfig] Programming ATxOdtDrvStren of ANIB_0 to 0x0 +dwc_ddrphy_apb_wr(0x42, 0x0); // DWC_DDRPHYA_ANIB0_base0_ATxOdtDrvStren +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TristateModeCA::DisDynAdrTri_p0 to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TristateModeCA::DDR2TMode_p0 to 0x0 +dwc_ddrphy_apb_wr(0x20019, 0x5); // DWC_DDRPHYA_MASTER0_base0_TristateModeCA_p0 +//// [phyinit_C_initPhyConfig] Programming DfiFreqXlat* +dwc_ddrphy_apb_wr(0x200f0, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat0 +dwc_ddrphy_apb_wr(0x200f1, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat1 +dwc_ddrphy_apb_wr(0x200f2, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat2 +dwc_ddrphy_apb_wr(0x200f3, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat3 +dwc_ddrphy_apb_wr(0x200f4, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat4 +dwc_ddrphy_apb_wr(0x200f5, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat5 +dwc_ddrphy_apb_wr(0x200f6, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat6 +dwc_ddrphy_apb_wr(0x200f7, 0xf000); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat7 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY0 to 0x64 +dwc_ddrphy_apb_wr(0x2000b, 0x64); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY1 to 0xc8 +dwc_ddrphy_apb_wr(0x2000c, 0xc8); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY2 to 0x2bc +dwc_ddrphy_apb_wr(0x2000d, 0x2bc); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY2_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY3 to 0x2c +dwc_ddrphy_apb_wr(0x2000e, 0x2c); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY3_p0 +//// [phyinit_C_initPhyConfig] Disabling DBYTE 0 Lane 8 (DBI) Receiver to save power. +dwc_ddrphy_apb_wr(0x1004a, 0x500); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl1 +//// [phyinit_C_initPhyConfig] Disabling DBYTE 1 Lane 8 (DBI) Receiver to save power. +dwc_ddrphy_apb_wr(0x1104a, 0x500); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl1 +//// [phyinit_C_initPhyConfig] Programming MasterX4Config::X4TG to 0x0 +dwc_ddrphy_apb_wr(0x20025, 0x0); // DWC_DDRPHYA_MASTER0_base0_MasterX4Config +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming GPR7(csrAlertRecovery) to 0x0 +dwc_ddrphy_apb_wr(0x90307, 0x0); // DWC_DDRPHYA_INITENG0_base0_Seq0BGPR7_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DMIPinPresent::RdDbiEnabled to 0x0 +dwc_ddrphy_apb_wr(0x2002d, 0x0); // DWC_DDRPHYA_MASTER0_base0_DMIPinPresent_p0 +// [phyinit_C_initPhyConfig] Programming TimingModeCntrl::Dly64Prec to 0x0 +dwc_ddrphy_apb_wr(0x20040, 0x0); // DWC_DDRPHYA_MASTER0_base0_TimingModeCntrl +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x1 for MASTER +dwc_ddrphy_apb_wr(0x20066, 0x1); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x1 for all DBYTEs +dwc_ddrphy_apb_wr(0x10066, 0x1); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x11066, 0x1); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x1 for all ANIBs +dwc_ddrphy_apb_wr(0x66, 0x1); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x1066, 0x1); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x2066, 0x1); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x3066, 0x1); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x4066, 0x1); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x5066, 0x1); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x6066, 0x1); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x7066, 0x1); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x8066, 0x1); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x9066, 0x1); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming AcClkDLLControl to 0x1080 +dwc_ddrphy_apb_wr(0x200ea, 0x1080); // DWC_DDRPHYA_MASTER0_base0_AcClkDLLControl_p0 +// [phyinit_C_initPhyConfig] Programming ArcPmuEccCtl to 0x1 +dwc_ddrphy_apb_wr(0xc0086, 0x1); // DWC_DDRPHYA_DRTUB0_ArcPmuEccCtl +// [phyinit_C_initPhyConfig] Programming VREGCtrl2 to 0x9820 for MASTER +dwc_ddrphy_apb_wr(0x2002b, 0x9820); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl2 +// [phyinit_C_initPhyConfig] Programming VREGCtrl2 to 0x8020 for all DBYTEs +dwc_ddrphy_apb_wr(0x1002b, 0x8020); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x1102b, 0x8020); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl2 +// [phyinit_C_initPhyConfig] Programming VREGCtrl2 to 0x8020 for all ANIBs +dwc_ddrphy_apb_wr(0x2b, 0x8020); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x102b, 0x8020); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x202b, 0x8020); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x302b, 0x8020); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x402b, 0x8020); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x502b, 0x8020); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x602b, 0x8020); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x702b, 0x8020); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x802b, 0x8020); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x902b, 0x8020); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl2 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for MASTER +dwc_ddrphy_apb_wr(0x20066, 0x0); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all DBYTEs +dwc_ddrphy_apb_wr(0x10066, 0x0); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x11066, 0x0); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all ANIBs +dwc_ddrphy_apb_wr(0x66, 0x0); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x1066, 0x0); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x2066, 0x0); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x3066, 0x0); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x4066, 0x0); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x5066, 0x0); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x6066, 0x0); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x7066, 0x0); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x8066, 0x0); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x9066, 0x0); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Programming VrefDAC0 to 0x3f for all DBYTEs and lanes +// [phyinit_C_initPhyConfig] Programming VrefDAC1 to 0x3f for all DBYTEs and lanes +// [phyinit_C_initPhyConfig] Programming VrefDAC2 to 0x3f for all DBYTEs and lanes +// [phyinit_C_initPhyConfig] Programming VrefDAC3 to 0x3f for all DBYTEs and lanes +dwc_ddrphy_apb_wr(0x10040, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r0_p0 +dwc_ddrphy_apb_wr(0x10030, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r0 +dwc_ddrphy_apb_wr(0x10050, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r0 +dwc_ddrphy_apb_wr(0x10060, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r0 +dwc_ddrphy_apb_wr(0x10140, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r1_p0 +dwc_ddrphy_apb_wr(0x10130, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r1 +dwc_ddrphy_apb_wr(0x10150, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r1 +dwc_ddrphy_apb_wr(0x10160, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r1 +dwc_ddrphy_apb_wr(0x10240, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r2_p0 +dwc_ddrphy_apb_wr(0x10230, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r2 +dwc_ddrphy_apb_wr(0x10250, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r2 +dwc_ddrphy_apb_wr(0x10260, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r2 +dwc_ddrphy_apb_wr(0x10340, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r3_p0 +dwc_ddrphy_apb_wr(0x10330, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r3 +dwc_ddrphy_apb_wr(0x10350, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r3 +dwc_ddrphy_apb_wr(0x10360, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r3 +dwc_ddrphy_apb_wr(0x10440, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r4_p0 +dwc_ddrphy_apb_wr(0x10430, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r4 +dwc_ddrphy_apb_wr(0x10450, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r4 +dwc_ddrphy_apb_wr(0x10460, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r4 +dwc_ddrphy_apb_wr(0x10540, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r5_p0 +dwc_ddrphy_apb_wr(0x10530, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r5 +dwc_ddrphy_apb_wr(0x10550, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r5 +dwc_ddrphy_apb_wr(0x10560, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r5 +dwc_ddrphy_apb_wr(0x10640, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r6_p0 +dwc_ddrphy_apb_wr(0x10630, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r6 +dwc_ddrphy_apb_wr(0x10650, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r6 +dwc_ddrphy_apb_wr(0x10660, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r6 +dwc_ddrphy_apb_wr(0x10740, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r7_p0 +dwc_ddrphy_apb_wr(0x10730, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r7 +dwc_ddrphy_apb_wr(0x10750, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r7 +dwc_ddrphy_apb_wr(0x10760, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r7 +dwc_ddrphy_apb_wr(0x10840, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r8_p0 +dwc_ddrphy_apb_wr(0x10830, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r8 +dwc_ddrphy_apb_wr(0x10850, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r8 +dwc_ddrphy_apb_wr(0x10860, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r8 +dwc_ddrphy_apb_wr(0x11040, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r0_p0 +dwc_ddrphy_apb_wr(0x11030, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r0 +dwc_ddrphy_apb_wr(0x11050, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r0 +dwc_ddrphy_apb_wr(0x11060, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r0 +dwc_ddrphy_apb_wr(0x11140, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r1_p0 +dwc_ddrphy_apb_wr(0x11130, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r1 +dwc_ddrphy_apb_wr(0x11150, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r1 +dwc_ddrphy_apb_wr(0x11160, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r1 +dwc_ddrphy_apb_wr(0x11240, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r2_p0 +dwc_ddrphy_apb_wr(0x11230, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r2 +dwc_ddrphy_apb_wr(0x11250, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r2 +dwc_ddrphy_apb_wr(0x11260, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r2 +dwc_ddrphy_apb_wr(0x11340, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r3_p0 +dwc_ddrphy_apb_wr(0x11330, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r3 +dwc_ddrphy_apb_wr(0x11350, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r3 +dwc_ddrphy_apb_wr(0x11360, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r3 +dwc_ddrphy_apb_wr(0x11440, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r4_p0 +dwc_ddrphy_apb_wr(0x11430, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r4 +dwc_ddrphy_apb_wr(0x11450, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r4 +dwc_ddrphy_apb_wr(0x11460, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r4 +dwc_ddrphy_apb_wr(0x11540, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r5_p0 +dwc_ddrphy_apb_wr(0x11530, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r5 +dwc_ddrphy_apb_wr(0x11550, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r5 +dwc_ddrphy_apb_wr(0x11560, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r5 +dwc_ddrphy_apb_wr(0x11640, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r6_p0 +dwc_ddrphy_apb_wr(0x11630, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r6 +dwc_ddrphy_apb_wr(0x11650, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r6 +dwc_ddrphy_apb_wr(0x11660, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r6 +dwc_ddrphy_apb_wr(0x11740, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r7_p0 +dwc_ddrphy_apb_wr(0x11730, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r7 +dwc_ddrphy_apb_wr(0x11750, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r7 +dwc_ddrphy_apb_wr(0x11760, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r7 +dwc_ddrphy_apb_wr(0x11840, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r8_p0 +dwc_ddrphy_apb_wr(0x11830, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r8 +dwc_ddrphy_apb_wr(0x11850, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r8 +dwc_ddrphy_apb_wr(0x11860, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r8 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DfiFreqRatio_p0 to 0x1 +dwc_ddrphy_apb_wr(0x200fa, 0x1); // DWC_DDRPHYA_MASTER0_base0_DfiFreqRatio_p0 +//// [phyinit_C_initPhyConfig] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x0 +dwc_ddrphy_apb_wr(0x200a6, 0x0); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=0) to 0xc +dwc_ddrphy_apb_wr(0x28, 0xc); // DWC_DDRPHYA_ANIB0_base0_AForceTriCont +//// [phyinit_C_initPhyConfig] End of dwc_ddrphy_phyinit_C_initPhyConfig() +// +// +////############################################################## +//// +//// dwc_ddrphy_phyinit_userCustom_customPreTrain is a user-editable function. +//// +//// The purpose of dwc_ddrphy_phyinit_userCustom_customPreTrain() is to override any +//// any message block fields calculated by Phyinit in dwc_ddrphy_phyinit_calcMb() or to +//// override any CSR values programmed by Phyinit in dwc_ddrphy_phyinit_C_initPhyConfig(). +//// This function is executed before training and thus any override here might affect +//// training result. +//// +//// IMPORTANT: in this function, user shall not override any values in userInputBasic and +//// userInputAdvanced data structures. Use dwc_ddrphy_phyinit_userCustom_overrideUserInput() +//// to modify values in those data structures. +//// +////############################################################## +// +//// [phyinit_userCustom_customPreTrain] Start of dwc_ddrphy_phyinit_userCustom_customPreTrain() +//// [phyinit_userCustom_customPreTrain] End of dwc_ddrphy_phyinit_userCustom_customPreTrain() +//// [dwc_ddrphy_phyinit_D_loadIMEM, 1D] Start of dwc_ddrphy_phyinit_D_loadIMEM (Train2D=0) +// +// +////############################################################## +//// +//// (D) Load the 1D IMEM image +//// +//// This function loads the training firmware IMEM image into the SRAM. +//// See PhyInit App Note for detailed description and function usage +//// +////############################################################## +// +// +//// [dwc_ddrphy_phyinit_D_loadIMEM, 1D] Programming MemResetL to 0x2 +dwc_ddrphy_apb_wr(0x20060, 0x2); // DWC_DDRPHYA_MASTER0_base0_MemResetL +// [dwc_ddrphy_phyinit_storeIncvFile] Reading input file: /home/jerry_ku/Project/Development/ast2700dev/ddr45phy_tsmc12/coreConsultant/config3_3.50a/2022-12-12-16-52-55/firmware/Latest/training/ddr4/ddr4_pmu_train_imem.incv + +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_WriteOutMem] STARTING 32bit write. offset 0x50000 size 0x8000 +//#ifdef TRAIN_LOADBIN +dwc_ddrphy_phyinit_userCustom_D_loadIMEM(sdrammc, 0); +//// [dwc_ddrphy_phyinit_WriteOutMem] DONE. Index 0x8000 +//// 2. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +//// This allows the firmware unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_D_loadIMEM, 1D] End of dwc_ddrphy_phyinit_D_loadIMEM() +// +// +////############################################################## +//// +//// 4.3.5(E) Set the PHY input clocks to the desired frequency for pstate 0 +//// +//// Set the PHY input Dfi Clk to the desired operating frequency associated with the given Pstate. Before proceeding to the next step, +//// the clock should be stable at the new frequency. For more information on clocking requirements, see "Clocks" on page <XXX>. +//// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_E_setDfiClk(sdrammc); + +// +//// [dwc_ddrphy_phyinit_userCustom_E_setDfiClk] End of dwc_ddrphy_phyinit_userCustom_E_setDfiClk() +//// [phyinit_F_loadDMEM, 1D] Start of dwc_ddrphy_phyinit_F_loadDMEM (pstate=0, Train2D=0) +// +// +////############################################################## +//// +//// 4.3.5(F) Load the 1D DMEM image and write the 1D Message Block parameters for the training firmware +//// +//// The procedure is as follows: +//// +////############################################################## +// +// +// +//// 1. Load the firmware DMEM segment to initialize the data structures. +// +//// 2. Write the Firmware Message Block with the required contents detailing the training parameters. +// +// [dwc_ddrphy_phyinit_storeIncvFile] Reading input file: /home/jerry_ku/Project/Development/ast2700dev/ddr45phy_tsmc12/coreConsultant/config3_3.50a/2022-12-12-16-52-55/firmware/Latest/training/ddr4/ddr4_pmu_train_dmem.incv + +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_WriteOutMem] STARTING 32bit write. offset 0x58000 size 0x8000 +//#ifdef TRAIN_LOADBIN +dwc_ddrphy_phyinit_userCustom_F_loadDMEM(sdrammc, 0, 0); + +dwc_ddrphy_apb_wr_32b(0x58000, 0x100); +dwc_ddrphy_apb_wr_32b(0x58002, 0xc800000); +dwc_ddrphy_apb_wr_32b(0x58004, 0x0); +dwc_ddrphy_apb_wr_32b(0x58006, 0x10000240); +dwc_ddrphy_apb_wr_32b(0x58008, 0x1); +dwc_ddrphy_apb_wr_32b(0x5800a, 0x31f0000); +dwc_ddrphy_apb_wr_32b(0x5800c, 0xc8); +dwc_ddrphy_apb_wr_32b(0x5800e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58010, 0x0); +dwc_ddrphy_apb_wr_32b(0x58012, 0x2); +dwc_ddrphy_apb_wr_32b(0x58014, 0x0); +dwc_ddrphy_apb_wr_32b(0x58016, 0x0); +dwc_ddrphy_apb_wr_32b(0x58018, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58020, 0x0); +dwc_ddrphy_apb_wr_32b(0x58022, 0x0); +dwc_ddrphy_apb_wr_32b(0x58024, 0x0); +dwc_ddrphy_apb_wr_32b(0x58026, 0x0); +dwc_ddrphy_apb_wr_32b(0x58028, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802e, 0x21500000); +dwc_ddrphy_apb_wr_32b(0x58030, 0x2280101); +dwc_ddrphy_apb_wr_32b(0x58032, 0x400); +dwc_ddrphy_apb_wr_32b(0x58034, 0x104f0500); +dwc_ddrphy_apb_wr_32b(0x58036, 0x0); +dwc_ddrphy_apb_wr_32b(0x58038, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58040, 0x0); +dwc_ddrphy_apb_wr_32b(0x58042, 0xf0f0000); +dwc_ddrphy_apb_wr_32b(0x58044, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58046, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58048, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5804a, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5804c, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5804e, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58050, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58052, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58054, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58056, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58058, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5805a, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5805c, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5805e, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58060, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58062, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58064, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58066, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58068, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5806a, 0xf0f); +dwc_ddrphy_apb_wr_32b(0x5806c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5806e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58070, 0x0); +dwc_ddrphy_apb_wr_32b(0x58072, 0x0); +dwc_ddrphy_apb_wr_32b(0x58074, 0x0); +dwc_ddrphy_apb_wr_32b(0x58076, 0x0); +dwc_ddrphy_apb_wr_32b(0x58078, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58080, 0x0); +dwc_ddrphy_apb_wr_32b(0x58082, 0x0); +dwc_ddrphy_apb_wr_32b(0x58084, 0x0); +dwc_ddrphy_apb_wr_32b(0x58086, 0x0); +dwc_ddrphy_apb_wr_32b(0x58088, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58090, 0x0); +dwc_ddrphy_apb_wr_32b(0x58092, 0x0); +dwc_ddrphy_apb_wr_32b(0x58094, 0x0); +dwc_ddrphy_apb_wr_32b(0x58096, 0x0); +dwc_ddrphy_apb_wr_32b(0x58098, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809e, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x580bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580be, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x580cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580da, 0x0); +dwc_ddrphy_apb_wr_32b(0x580dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580de, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fe, 0x0); +dwc_ddrphy_apb_wr_32b(0x58100, 0x0); +dwc_ddrphy_apb_wr_32b(0x58102, 0x0); +dwc_ddrphy_apb_wr_32b(0x58104, 0x0); +dwc_ddrphy_apb_wr_32b(0x58106, 0x0); +dwc_ddrphy_apb_wr_32b(0x58108, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58110, 0x0); +dwc_ddrphy_apb_wr_32b(0x58112, 0x0); +dwc_ddrphy_apb_wr_32b(0x58114, 0x0); +dwc_ddrphy_apb_wr_32b(0x58116, 0x0); +dwc_ddrphy_apb_wr_32b(0x58118, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58120, 0x0); +dwc_ddrphy_apb_wr_32b(0x58122, 0x0); +dwc_ddrphy_apb_wr_32b(0x58124, 0x0); +dwc_ddrphy_apb_wr_32b(0x58126, 0x0); +dwc_ddrphy_apb_wr_32b(0x58128, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58130, 0x0); +dwc_ddrphy_apb_wr_32b(0x58132, 0x0); +dwc_ddrphy_apb_wr_32b(0x58134, 0x0); +dwc_ddrphy_apb_wr_32b(0x58136, 0x0); +dwc_ddrphy_apb_wr_32b(0x58138, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58140, 0x0); +dwc_ddrphy_apb_wr_32b(0x58142, 0x0); +dwc_ddrphy_apb_wr_32b(0x58144, 0x0); +dwc_ddrphy_apb_wr_32b(0x58146, 0x0); +dwc_ddrphy_apb_wr_32b(0x58148, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58150, 0x0); +dwc_ddrphy_apb_wr_32b(0x58152, 0x0); +dwc_ddrphy_apb_wr_32b(0x58154, 0x0); +dwc_ddrphy_apb_wr_32b(0x58156, 0x0); +dwc_ddrphy_apb_wr_32b(0x58158, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58160, 0x0); +dwc_ddrphy_apb_wr_32b(0x58162, 0x0); +dwc_ddrphy_apb_wr_32b(0x58164, 0x0); +dwc_ddrphy_apb_wr_32b(0x58166, 0x0); +dwc_ddrphy_apb_wr_32b(0x58168, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58170, 0x0); +dwc_ddrphy_apb_wr_32b(0x58172, 0x0); +dwc_ddrphy_apb_wr_32b(0x58174, 0x0); +dwc_ddrphy_apb_wr_32b(0x58176, 0x0); +dwc_ddrphy_apb_wr_32b(0x58178, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58180, 0x0); +dwc_ddrphy_apb_wr_32b(0x58182, 0x0); +dwc_ddrphy_apb_wr_32b(0x58184, 0x0); +dwc_ddrphy_apb_wr_32b(0x58186, 0x0); +dwc_ddrphy_apb_wr_32b(0x58188, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58190, 0x0); +dwc_ddrphy_apb_wr_32b(0x58192, 0x0); +dwc_ddrphy_apb_wr_32b(0x58194, 0x0); +dwc_ddrphy_apb_wr_32b(0x58196, 0x0); +dwc_ddrphy_apb_wr_32b(0x58198, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819e, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x581bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581be, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x581cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581da, 0x0); +dwc_ddrphy_apb_wr_32b(0x581dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581de, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fe, 0x0); +//// [dwc_ddrphy_phyinit_WriteOutMem] DONE. Index 0x8000 +//// 2. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +//// This allows the firmware unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_F_loadDMEM, 1D] End of dwc_ddrphy_phyinit_F_loadDMEM() +// +// +////############################################################## +//// +//// 4.3.7(G) Execute the Training Firmware +//// +//// The training firmware is executed with the following procedure: +//// +////############################################################## +// +// +//// 1. Reset the firmware microcontroller by writing the MicroReset CSR to set the StallToMicro and +//// ResetToMicro fields to 1 (all other fields should be zero). +//// Then rewrite the CSR so that only the StallToMicro remains set (all other fields should be zero). +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +dwc_ddrphy_apb_wr(0xd0099, 0x9); // DWC_DDRPHYA_APBONLY0_MicroReset +dwc_ddrphy_apb_wr(0xd0099, 0x1); // DWC_DDRPHYA_APBONLY0_MicroReset +// +//// 2. Begin execution of the training firmware by setting the MicroReset CSR to 4'b0000. +dwc_ddrphy_apb_wr(0xd0099, 0x0); // DWC_DDRPHYA_APBONLY0_MicroReset +// +//// 3. Wait for the training firmware to complete by following the procedure in "uCtrl Initialization and Mailbox Messaging" +//// 4.3.7 3. Wait for the training firmware to complete. Implement timeout function or follow the procedure in "3.4 Running the firmware" of the Training Firmware Application Note to poll the Mailbox message. +dwc_ddrphy_phyinit_userCustom_G_waitFwDone(sdrammc); + +//// [dwc_ddrphy_phyinit_userCustom_G_waitFwDone] End of dwc_ddrphy_phyinit_userCustom_G_waitFwDone() +//// 4. Halt the microcontroller." +dwc_ddrphy_apb_wr(0xd0099, 0x1); // DWC_DDRPHYA_APBONLY0_MicroReset +dwc_ddrphy_apb_wr(0x20089, 0x0); // DWC_DDRPHYA_MASTER0_base0_CalZap +//// [dwc_ddrphy_phyinit_G_execFW] End of dwc_ddrphy_phyinit_G_execFW() +// +// +////############################################################## +//// +//// 4.3.8(H) Read the Message Block results +//// +//// The procedure is as follows: +//// +////############################################################## +// +// +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +// +//2. Read the Firmware Message Block to obtain the results from the training. +//This can be accomplished by issuing APB read commands to the DMEM addresses. +//Example: +//if (Train2D) +//{ +// _read_2d_message_block_outputs_ +//} +//else +//{ +// _read_1d_message_block_outputs_ +//} +//This can be accomplished by issuing APB read commands to the DMEM addresses. +dwc_ddrphy_phyinit_userCustom_H_readMsgBlock(sdrammc, 0); + +//[dwc_ddrphy_phyinit_userCustom_H_readMsgBlock] End of dwc_ddrphy_phyinit_userCustom_H_readMsgBlock() +//// 3. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// 4. If training is required at another frequency, repeat the operations starting at step (E). +//// [dwc_ddrphy_phyinit_H_readMsgBlock] End of dwc_ddrphy_phyinit_H_readMsgBlock() +// +// +////############################################################## +//// +//// 4.3.5(E) Set the PHY input clocks to the desired frequency for pstate 0 +//// +//// Set the PHY input Dfi Clk to the desired operating frequency associated with the given Pstate. Before proceeding to the next step, +//// the clock should be stable at the new frequency. For more information on clocking requirements, see "Clocks" on page <XXX>. +//// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_E_setDfiClk(sdrammc); + +// +//// [dwc_ddrphy_phyinit_userCustom_E_setDfiClk] End of dwc_ddrphy_phyinit_userCustom_E_setDfiClk() +//// [dwc_ddrphy_phyinit_D_loadIMEM, 2D] Start of dwc_ddrphy_phyinit_D_loadIMEM (Train2D=1) +// +// +////############################################################## +//// +//// (D) Load the 2D IMEM image +//// +//// This function loads the training firmware IMEM image into the SRAM. +//// See PhyInit App Note for detailed description and function usage +//// +////############################################################## +// +// +// [dwc_ddrphy_phyinit_storeIncvFile] Reading input file: /home/jerry_ku/Project/Development/ast2700dev/ddr45phy_tsmc12/coreConsultant/config3_3.50a/2022-12-12-16-52-55/firmware/Latest/training/ddr4_2d/ddr4_2d_pmu_train_imem.incv + +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_WriteOutMem] STARTING 32bit write. offset 0x50000 size 0x8000 +dwc_ddrphy_phyinit_userCustom_D_loadIMEM(sdrammc, 1); +//// [dwc_ddrphy_phyinit_WriteOutMem] DONE. Index 0x8000 +//// 2. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +//// This allows the firmware unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_D_loadIMEM, 2D] End of dwc_ddrphy_phyinit_D_loadIMEM() +//// [phyinit_F_loadDMEM, 2D] Start of dwc_ddrphy_phyinit_F_loadDMEM (pstate=0, Train2D=1) +// +// +////############################################################## +//// +//// 4.3.5(F) Load the 2D DMEM image and write the 2D Message Block parameters for the training firmware +//// +//// The procedure is as follows: +//// +////############################################################## +// +// +// +//// 1. Load the firmware DMEM segment to initialize the data structures. +// +//// 2. Write the Firmware Message Block with the required contents detailing the training parameters. +// +// [dwc_ddrphy_phyinit_storeIncvFile] Reading input file: /home/jerry_ku/Project/Development/ast2700dev/ddr45phy_tsmc12/coreConsultant/config3_3.50a/2022-12-12-16-52-55/firmware/Latest/training/ddr4_2d/ddr4_2d_pmu_train_dmem.incv + +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_WriteOutMem] STARTING 32bit write. offset 0x58000 size 0x8000 +dwc_ddrphy_phyinit_userCustom_F_loadDMEM(sdrammc, 0, 1); +dwc_ddrphy_apb_wr_32b(0x58000, 0x100); +dwc_ddrphy_apb_wr_32b(0x58002, 0xc800000); +dwc_ddrphy_apb_wr_32b(0x58004, 0x0); +dwc_ddrphy_apb_wr_32b(0x58006, 0x10000240); +dwc_ddrphy_apb_wr_32b(0x58008, 0x1); +//printf("- <DWC_DDRPHY/TRAIN>: Override 2D DMEM image for SequenceCtrl, RX2D_TrainOpt, TX2D_TrainOpt, Delay_Weight2D, and Voltage_Weight2D\n"); +// uint16_t SequenceCtrl; // Byte offset 0x16, CSR Addr 0x5800b, Direction=In + // SequenceCtrl[0] = Run DevInit - Device/PHY initialization. Should always be set + // SequenceCtrl[5] = Run rd2D - 2d read dqs training + // SequenceCtrl[6] = Run wr2D - 2d write dq training +dwc_ddrphy_apb_wr_32b(0x5800a, 0x0610000); + +// Redmine 1392: To speed up data collection, set the voltage and delay step size in Rx2D_TrainOpt and Tx2D_TrainOpt to its maximum value. +// uint8_t HdtCtrl; // Byte offset 0x18, CSR Addr 0x5800c, Direction=In + // 0x04 = Maximal debug messages (e.g., Eye contours) + // 0x05 = Detailed debug messages (e.g. Eye delays) + // 0x0A = Coarse debug messages (e.g. rank information) + // 0xC8 = Stage completion + // 0xC9 = Assertion messages + // 0xFF = Firmware completion messages only +// uint8_t RX2D_TrainOpt; // Byte offset 0x19, CSR Addr 0x5800c, Direction=In +// uint8_t TX2D_TrainOpt; // Byte offset 0x1a, CSR Addr 0x5800d, Direction=In + #ifdef DWC_DEBUG +//dwc_ddrphy_apb_wr_32b(0x5800c, 0x001e1e0a); + #else +//dwc_ddrphy_apb_wr_32b(0x5800c, 0x001e1ec8); +dwc_ddrphy_apb_wr_32b(0x5800c, 0x000000c8); + #endif +// uint8_t Delay_Weight2D; // Byte offset 0x1c, CSR Addr 0x5800e, Direction=In +// uint8_t Voltage_Weight2D; // Byte offset 0x1d, CSR Addr 0x5800e, Direction=In +dwc_ddrphy_apb_wr_32b(0x5800e, 0x8020); + +dwc_ddrphy_apb_wr_32b(0x58010, 0x0); +dwc_ddrphy_apb_wr_32b(0x58012, 0x2); +dwc_ddrphy_apb_wr_32b(0x58014, 0x0); +dwc_ddrphy_apb_wr_32b(0x58016, 0x0); +dwc_ddrphy_apb_wr_32b(0x58018, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58020, 0x0); +dwc_ddrphy_apb_wr_32b(0x58022, 0x0); +dwc_ddrphy_apb_wr_32b(0x58024, 0x0); +dwc_ddrphy_apb_wr_32b(0x58026, 0x0); +dwc_ddrphy_apb_wr_32b(0x58028, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802e, 0x21500000); +dwc_ddrphy_apb_wr_32b(0x58030, 0x2280101); +dwc_ddrphy_apb_wr_32b(0x58032, 0x400); +dwc_ddrphy_apb_wr_32b(0x58034, 0x104f0500); +dwc_ddrphy_apb_wr_32b(0x58036, 0x0); +dwc_ddrphy_apb_wr_32b(0x58038, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58040, 0x0); +dwc_ddrphy_apb_wr_32b(0x58042, 0xf0f0000); +dwc_ddrphy_apb_wr_32b(0x58044, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58046, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58048, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5804a, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5804c, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5804e, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58050, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58052, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58054, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58056, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58058, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5805a, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5805c, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5805e, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58060, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58062, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58064, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58066, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x58068, 0xf0f0f0f); +dwc_ddrphy_apb_wr_32b(0x5806a, 0xf0f); +dwc_ddrphy_apb_wr_32b(0x5806c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5806e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58070, 0x0); +dwc_ddrphy_apb_wr_32b(0x58072, 0x0); +dwc_ddrphy_apb_wr_32b(0x58074, 0x0); +dwc_ddrphy_apb_wr_32b(0x58076, 0x0); +dwc_ddrphy_apb_wr_32b(0x58078, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58080, 0x0); +dwc_ddrphy_apb_wr_32b(0x58082, 0x0); +dwc_ddrphy_apb_wr_32b(0x58084, 0x0); +dwc_ddrphy_apb_wr_32b(0x58086, 0x0); +dwc_ddrphy_apb_wr_32b(0x58088, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58090, 0x0); +dwc_ddrphy_apb_wr_32b(0x58092, 0x0); +dwc_ddrphy_apb_wr_32b(0x58094, 0x0); +dwc_ddrphy_apb_wr_32b(0x58096, 0x0); +dwc_ddrphy_apb_wr_32b(0x58098, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809e, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x580bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580be, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x580cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580da, 0x0); +dwc_ddrphy_apb_wr_32b(0x580dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580de, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fe, 0x0); +dwc_ddrphy_apb_wr_32b(0x58100, 0x0); +dwc_ddrphy_apb_wr_32b(0x58102, 0x0); +dwc_ddrphy_apb_wr_32b(0x58104, 0x0); +dwc_ddrphy_apb_wr_32b(0x58106, 0x0); +dwc_ddrphy_apb_wr_32b(0x58108, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58110, 0x0); +dwc_ddrphy_apb_wr_32b(0x58112, 0x0); +dwc_ddrphy_apb_wr_32b(0x58114, 0x0); +dwc_ddrphy_apb_wr_32b(0x58116, 0x0); +dwc_ddrphy_apb_wr_32b(0x58118, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58120, 0x0); +dwc_ddrphy_apb_wr_32b(0x58122, 0x0); +dwc_ddrphy_apb_wr_32b(0x58124, 0x0); +dwc_ddrphy_apb_wr_32b(0x58126, 0x0); +dwc_ddrphy_apb_wr_32b(0x58128, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58130, 0x0); +dwc_ddrphy_apb_wr_32b(0x58132, 0x0); +dwc_ddrphy_apb_wr_32b(0x58134, 0x0); +dwc_ddrphy_apb_wr_32b(0x58136, 0x0); +dwc_ddrphy_apb_wr_32b(0x58138, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58140, 0x0); +dwc_ddrphy_apb_wr_32b(0x58142, 0x0); +dwc_ddrphy_apb_wr_32b(0x58144, 0x0); +dwc_ddrphy_apb_wr_32b(0x58146, 0x0); +dwc_ddrphy_apb_wr_32b(0x58148, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58150, 0x0); +dwc_ddrphy_apb_wr_32b(0x58152, 0x0); +dwc_ddrphy_apb_wr_32b(0x58154, 0x0); +dwc_ddrphy_apb_wr_32b(0x58156, 0x0); +dwc_ddrphy_apb_wr_32b(0x58158, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58160, 0x0); +dwc_ddrphy_apb_wr_32b(0x58162, 0x0); +dwc_ddrphy_apb_wr_32b(0x58164, 0x0); +dwc_ddrphy_apb_wr_32b(0x58166, 0x0); +dwc_ddrphy_apb_wr_32b(0x58168, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58170, 0x0); +dwc_ddrphy_apb_wr_32b(0x58172, 0x0); +dwc_ddrphy_apb_wr_32b(0x58174, 0x0); +dwc_ddrphy_apb_wr_32b(0x58176, 0x0); +dwc_ddrphy_apb_wr_32b(0x58178, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58180, 0x0); +dwc_ddrphy_apb_wr_32b(0x58182, 0x0); +dwc_ddrphy_apb_wr_32b(0x58184, 0x0); +dwc_ddrphy_apb_wr_32b(0x58186, 0x0); +dwc_ddrphy_apb_wr_32b(0x58188, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58190, 0x0); +dwc_ddrphy_apb_wr_32b(0x58192, 0x0); +dwc_ddrphy_apb_wr_32b(0x58194, 0x0); +dwc_ddrphy_apb_wr_32b(0x58196, 0x0); +dwc_ddrphy_apb_wr_32b(0x58198, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819e, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x581bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581be, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x581cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581da, 0x0); +dwc_ddrphy_apb_wr_32b(0x581dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581de, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fe, 0x0); +//// [dwc_ddrphy_phyinit_WriteOutMem] DONE. Index 0x8000 +//// 2. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +//// This allows the firmware unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_F_loadDMEM, 2D] End of dwc_ddrphy_phyinit_F_loadDMEM() +// +// +////############################################################## +//// +//// 4.3.7(G) Execute the Training Firmware +//// +//// The training firmware is executed with the following procedure: +//// +////############################################################## +// +// +//// 1. Reset the firmware microcontroller by writing the MicroReset CSR to set the StallToMicro and +//// ResetToMicro fields to 1 (all other fields should be zero). +//// Then rewrite the CSR so that only the StallToMicro remains set (all other fields should be zero). +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +dwc_ddrphy_apb_wr(0xd0099, 0x9); // DWC_DDRPHYA_APBONLY0_MicroReset +dwc_ddrphy_apb_wr(0xd0099, 0x1); // DWC_DDRPHYA_APBONLY0_MicroReset +// +//// 2. Begin execution of the training firmware by setting the MicroReset CSR to 4'b0000. +dwc_ddrphy_apb_wr(0xd0099, 0x0); // DWC_DDRPHYA_APBONLY0_MicroReset +// +//// 3. Wait for the training firmware to complete by following the procedure in "uCtrl Initialization and Mailbox Messaging" +//// 4.3.7 3. Wait for the training firmware to complete. Implement timeout function or follow the procedure in "3.4 Running the firmware" of the Training Firmware Application Note to poll the Mailbox message. +dwc_ddrphy_phyinit_userCustom_G_waitFwDone(sdrammc); + +//// [dwc_ddrphy_phyinit_userCustom_G_waitFwDone] End of dwc_ddrphy_phyinit_userCustom_G_waitFwDone() +//// 4. Halt the microcontroller." +dwc_ddrphy_apb_wr(0xd0099, 0x1); // DWC_DDRPHYA_APBONLY0_MicroReset +dwc_ddrphy_apb_wr(0x20089, 0x0); // DWC_DDRPHYA_MASTER0_base0_CalZap +//// [dwc_ddrphy_phyinit_G_execFW] End of dwc_ddrphy_phyinit_G_execFW() +// +// +////############################################################## +//// +//// 4.3.8(H) Read the Message Block results +//// +//// The procedure is as follows: +//// +////############################################################## +// +// +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +// +//2. Read the Firmware Message Block to obtain the results from the training. +//This can be accomplished by issuing APB read commands to the DMEM addresses. +//Example: +//if (Train2D) +//{ +// _read_2d_message_block_outputs_ +//} +//else +//{ +// _read_1d_message_block_outputs_ +//} +//This can be accomplished by issuing APB read commands to the DMEM addresses. +dwc_ddrphy_phyinit_userCustom_H_readMsgBlock(sdrammc, 1); + +//[dwc_ddrphy_phyinit_userCustom_H_readMsgBlock] End of dwc_ddrphy_phyinit_userCustom_H_readMsgBlock() +//// 3. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// 4. If training is required at another frequency, repeat the operations starting at step (E). +//// [dwc_ddrphy_phyinit_H_readMsgBlock] End of dwc_ddrphy_phyinit_H_readMsgBlock() +//// [initRuntimeConfigEnableBits] Start of initRuntimeConfigEnableBits() +//// [initRuntimeConfigEnableBits] enableBits[0] = 0x00000009 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A0 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A1 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A2 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A3 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] enableBits[1] = 0x00000000 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B0 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B1 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B2 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B3 = 0x000000ff, rtt_required = 0x0000000f +//// [initRuntimeConfigEnableBits] enableBits[2] = 0x00000000 +//// [initRuntimeConfigEnableBits] End of initRuntimeConfigEnableBits() +//// [phyinit_I_loadPIEImage] Start of dwc_ddrphy_phyinit_I_loadPIEImage() +// +// +////############################################################## +//// +//// 4.3.9(I) Load PHY Init Engine Image +//// +//// Load the PHY Initialization Engine memory with the provided initialization sequence. +//// +////############################################################## +// +// +//// Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_I_loadPIEImage] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x1 +dwc_ddrphy_apb_wr(0x200a6, 0x2); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +//// [phyinit_I_loadPIEImage] Programming PIE Production Code +//// [phyinit_LoadPIECodeSections] Start of dwc_ddrphy_phyinit_LoadPIECodeSections() +//// [phyinit_LoadPIECodeSections] Moving start address from 0 to 90000 +dwc_ddrphy_apb_wr(0x90000, 0x10); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b0s0 +dwc_ddrphy_apb_wr(0x90001, 0x400); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b0s1 +dwc_ddrphy_apb_wr(0x90002, 0x10e); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b0s2 +dwc_ddrphy_apb_wr(0x90003, 0x0); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b1s0 +dwc_ddrphy_apb_wr(0x90004, 0x0); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b1s1 +dwc_ddrphy_apb_wr(0x90005, 0x8); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b1s2 +//// [phyinit_LoadPIECodeSections] Moving start address from 90006 to 90029 +dwc_ddrphy_apb_wr(0x90029, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b0s0 +dwc_ddrphy_apb_wr(0x9002a, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b0s1 +dwc_ddrphy_apb_wr(0x9002b, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b0s2 +dwc_ddrphy_apb_wr(0x9002c, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b1s0 +dwc_ddrphy_apb_wr(0x9002d, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b1s1 +dwc_ddrphy_apb_wr(0x9002e, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b1s2 +dwc_ddrphy_apb_wr(0x9002f, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b2s0 +dwc_ddrphy_apb_wr(0x90030, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b2s1 +dwc_ddrphy_apb_wr(0x90031, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b2s2 +dwc_ddrphy_apb_wr(0x90032, 0xb); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b3s0 +dwc_ddrphy_apb_wr(0x90033, 0x480); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b3s1 +dwc_ddrphy_apb_wr(0x90034, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b3s2 +dwc_ddrphy_apb_wr(0x90035, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b4s0 +dwc_ddrphy_apb_wr(0x90036, 0x448); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b4s1 +dwc_ddrphy_apb_wr(0x90037, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b4s2 +dwc_ddrphy_apb_wr(0x90038, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b5s0 +dwc_ddrphy_apb_wr(0x90039, 0x478); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b5s1 +dwc_ddrphy_apb_wr(0x9003a, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b5s2 +dwc_ddrphy_apb_wr(0x9003b, 0x2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b6s0 +dwc_ddrphy_apb_wr(0x9003c, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b6s1 +dwc_ddrphy_apb_wr(0x9003d, 0x139); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b6s2 +dwc_ddrphy_apb_wr(0x9003e, 0xf); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b7s0 +dwc_ddrphy_apb_wr(0x9003f, 0x7c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b7s1 +dwc_ddrphy_apb_wr(0x90040, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b7s2 +dwc_ddrphy_apb_wr(0x90041, 0x107); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b8s0 +dwc_ddrphy_apb_wr(0x90042, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b8s1 +dwc_ddrphy_apb_wr(0x90043, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b8s2 +dwc_ddrphy_apb_wr(0x90044, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b9s0 +dwc_ddrphy_apb_wr(0x90045, 0xe0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b9s1 +dwc_ddrphy_apb_wr(0x90046, 0x139); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b9s2 +dwc_ddrphy_apb_wr(0x90047, 0x147); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b10s0 +dwc_ddrphy_apb_wr(0x90048, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b10s1 +dwc_ddrphy_apb_wr(0x90049, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b10s2 +dwc_ddrphy_apb_wr(0x9004a, 0x14f); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b11s0 +dwc_ddrphy_apb_wr(0x9004b, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b11s1 +dwc_ddrphy_apb_wr(0x9004c, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b11s2 +dwc_ddrphy_apb_wr(0x9004d, 0x7); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b12s0 +dwc_ddrphy_apb_wr(0x9004e, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b12s1 +dwc_ddrphy_apb_wr(0x9004f, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b12s2 +dwc_ddrphy_apb_wr(0x90050, 0x47); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b13s0 +dwc_ddrphy_apb_wr(0x90051, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b13s1 +dwc_ddrphy_apb_wr(0x90052, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b13s2 +dwc_ddrphy_apb_wr(0x90053, 0x4f); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b14s0 +dwc_ddrphy_apb_wr(0x90054, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b14s1 +dwc_ddrphy_apb_wr(0x90055, 0x179); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b14s2 +dwc_ddrphy_apb_wr(0x90056, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b15s0 +dwc_ddrphy_apb_wr(0x90057, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b15s1 +dwc_ddrphy_apb_wr(0x90058, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b15s2 +dwc_ddrphy_apb_wr(0x90059, 0x11); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b16s0 +dwc_ddrphy_apb_wr(0x9005a, 0x530); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b16s1 +dwc_ddrphy_apb_wr(0x9005b, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b16s2 +dwc_ddrphy_apb_wr(0x9005c, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b17s0 +dwc_ddrphy_apb_wr(0x9005d, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b17s1 +dwc_ddrphy_apb_wr(0x9005e, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b17s2 +dwc_ddrphy_apb_wr(0x9005f, 0x14f); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b18s0 +dwc_ddrphy_apb_wr(0x90060, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b18s1 +dwc_ddrphy_apb_wr(0x90061, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b18s2 +dwc_ddrphy_apb_wr(0x90062, 0x2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b19s0 +dwc_ddrphy_apb_wr(0x90063, 0x45a); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b19s1 +dwc_ddrphy_apb_wr(0x90064, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b19s2 +dwc_ddrphy_apb_wr(0x90065, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b20s0 +dwc_ddrphy_apb_wr(0x90066, 0x530); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b20s1 +dwc_ddrphy_apb_wr(0x90067, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b20s2 +dwc_ddrphy_apb_wr(0x90068, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b21s0 +dwc_ddrphy_apb_wr(0x90069, 0x65a); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b21s1 +dwc_ddrphy_apb_wr(0x9006a, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b21s2 +dwc_ddrphy_apb_wr(0x9006b, 0x41); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b22s0 +dwc_ddrphy_apb_wr(0x9006c, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b22s1 +dwc_ddrphy_apb_wr(0x9006d, 0x179); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b22s2 +dwc_ddrphy_apb_wr(0x9006e, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b23s0 +dwc_ddrphy_apb_wr(0x9006f, 0x618); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b23s1 +dwc_ddrphy_apb_wr(0x90070, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b23s2 +dwc_ddrphy_apb_wr(0x90071, 0x40c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b24s0 +dwc_ddrphy_apb_wr(0x90072, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b24s1 +dwc_ddrphy_apb_wr(0x90073, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b24s2 +dwc_ddrphy_apb_wr(0x90074, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b25s0 +dwc_ddrphy_apb_wr(0x90075, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b25s1 +dwc_ddrphy_apb_wr(0x90076, 0x48); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b25s2 +dwc_ddrphy_apb_wr(0x90077, 0x4040); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b26s0 +dwc_ddrphy_apb_wr(0x90078, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b26s1 +dwc_ddrphy_apb_wr(0x90079, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b26s2 +dwc_ddrphy_apb_wr(0x9007a, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b27s0 +dwc_ddrphy_apb_wr(0x9007b, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b27s1 +dwc_ddrphy_apb_wr(0x9007c, 0x48); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b27s2 +dwc_ddrphy_apb_wr(0x9007d, 0x40); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b28s0 +dwc_ddrphy_apb_wr(0x9007e, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b28s1 +dwc_ddrphy_apb_wr(0x9007f, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b28s2 +dwc_ddrphy_apb_wr(0x90080, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b29s0 +dwc_ddrphy_apb_wr(0x90081, 0x658); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b29s1 +dwc_ddrphy_apb_wr(0x90082, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b29s2 +dwc_ddrphy_apb_wr(0x90083, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b30s0 +dwc_ddrphy_apb_wr(0x90084, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b30s1 +dwc_ddrphy_apb_wr(0x90085, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b30s2 +dwc_ddrphy_apb_wr(0x90086, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b31s0 +dwc_ddrphy_apb_wr(0x90087, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b31s1 +dwc_ddrphy_apb_wr(0x90088, 0x78); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b31s2 +dwc_ddrphy_apb_wr(0x90089, 0x549); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b32s0 +dwc_ddrphy_apb_wr(0x9008a, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b32s1 +dwc_ddrphy_apb_wr(0x9008b, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b32s2 +dwc_ddrphy_apb_wr(0x9008c, 0xd49); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b33s0 +dwc_ddrphy_apb_wr(0x9008d, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b33s1 +dwc_ddrphy_apb_wr(0x9008e, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b33s2 +dwc_ddrphy_apb_wr(0x9008f, 0x94c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b34s0 +dwc_ddrphy_apb_wr(0x90090, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b34s1 +dwc_ddrphy_apb_wr(0x90091, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b34s2 +dwc_ddrphy_apb_wr(0x90092, 0x94c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b35s0 +dwc_ddrphy_apb_wr(0x90093, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b35s1 +dwc_ddrphy_apb_wr(0x90094, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b35s2 +dwc_ddrphy_apb_wr(0x90095, 0x442); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b36s0 +dwc_ddrphy_apb_wr(0x90096, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b36s1 +dwc_ddrphy_apb_wr(0x90097, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b36s2 +dwc_ddrphy_apb_wr(0x90098, 0x42); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b37s0 +dwc_ddrphy_apb_wr(0x90099, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b37s1 +dwc_ddrphy_apb_wr(0x9009a, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b37s2 +dwc_ddrphy_apb_wr(0x9009b, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b38s0 +dwc_ddrphy_apb_wr(0x9009c, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b38s1 +dwc_ddrphy_apb_wr(0x9009d, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b38s2 +dwc_ddrphy_apb_wr(0x9009e, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b39s0 +dwc_ddrphy_apb_wr(0x9009f, 0xe0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b39s1 +dwc_ddrphy_apb_wr(0x900a0, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b39s2 +dwc_ddrphy_apb_wr(0x900a1, 0xa); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b40s0 +dwc_ddrphy_apb_wr(0x900a2, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b40s1 +dwc_ddrphy_apb_wr(0x900a3, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b40s2 +dwc_ddrphy_apb_wr(0x900a4, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b41s0 +dwc_ddrphy_apb_wr(0x900a5, 0x3c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b41s1 +dwc_ddrphy_apb_wr(0x900a6, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b41s2 +dwc_ddrphy_apb_wr(0x900a7, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b42s0 +dwc_ddrphy_apb_wr(0x900a8, 0x3c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b42s1 +dwc_ddrphy_apb_wr(0x900a9, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b42s2 +dwc_ddrphy_apb_wr(0x900aa, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b43s0 +dwc_ddrphy_apb_wr(0x900ab, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b43s1 +dwc_ddrphy_apb_wr(0x900ac, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b43s2 +dwc_ddrphy_apb_wr(0x900ad, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b44s0 +dwc_ddrphy_apb_wr(0x900ae, 0x3c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b44s1 +dwc_ddrphy_apb_wr(0x900af, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b44s2 +dwc_ddrphy_apb_wr(0x900b0, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b45s0 +dwc_ddrphy_apb_wr(0x900b1, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b45s1 +dwc_ddrphy_apb_wr(0x900b2, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b45s2 +dwc_ddrphy_apb_wr(0x900b3, 0xc); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b46s0 +dwc_ddrphy_apb_wr(0x900b4, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b46s1 +dwc_ddrphy_apb_wr(0x900b5, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b46s2 +dwc_ddrphy_apb_wr(0x900b6, 0x3); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b47s0 +dwc_ddrphy_apb_wr(0x900b7, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b47s1 +dwc_ddrphy_apb_wr(0x900b8, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b47s2 +dwc_ddrphy_apb_wr(0x900b9, 0x7); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b48s0 +dwc_ddrphy_apb_wr(0x900ba, 0x7c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b48s1 +dwc_ddrphy_apb_wr(0x900bb, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b48s2 +//// [phyinit_LoadPIECodeSections] Matched ANY enable_bits = 8, type = 0 +dwc_ddrphy_apb_wr(0x900bc, 0x3a); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b49s0 +dwc_ddrphy_apb_wr(0x900bd, 0x1e2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b49s1 +dwc_ddrphy_apb_wr(0x900be, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b49s2 +dwc_ddrphy_apb_wr(0x900bf, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b50s0 +dwc_ddrphy_apb_wr(0x900c0, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b50s1 +dwc_ddrphy_apb_wr(0x900c1, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b50s2 +dwc_ddrphy_apb_wr(0x900c2, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b51s0 +dwc_ddrphy_apb_wr(0x900c3, 0x8140); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b51s1 +dwc_ddrphy_apb_wr(0x900c4, 0x10c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b51s2 +dwc_ddrphy_apb_wr(0x900c5, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b52s0 +dwc_ddrphy_apb_wr(0x900c6, 0x8138); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b52s1 +dwc_ddrphy_apb_wr(0x900c7, 0x10c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b52s2 +//// [phyinit_LoadPIECodeSections] Matched ANY enable_bits = 1, type = 0 +dwc_ddrphy_apb_wr(0x900c8, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b53s0 +dwc_ddrphy_apb_wr(0x900c9, 0x400); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b53s1 +dwc_ddrphy_apb_wr(0x900ca, 0x10e); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b53s2 +dwc_ddrphy_apb_wr(0x900cb, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b54s0 +dwc_ddrphy_apb_wr(0x900cc, 0x448); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b54s1 +dwc_ddrphy_apb_wr(0x900cd, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b54s2 +dwc_ddrphy_apb_wr(0x900ce, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b55s0 +dwc_ddrphy_apb_wr(0x900cf, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b55s1 +dwc_ddrphy_apb_wr(0x900d0, 0x101); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b55s2 +dwc_ddrphy_apb_wr(0x900d1, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b56s0 +dwc_ddrphy_apb_wr(0x900d2, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b56s1 +dwc_ddrphy_apb_wr(0x900d3, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b56s2 +dwc_ddrphy_apb_wr(0x900d4, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b57s0 +dwc_ddrphy_apb_wr(0x900d5, 0x448); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b57s1 +dwc_ddrphy_apb_wr(0x900d6, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b57s2 +dwc_ddrphy_apb_wr(0x900d7, 0xf); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b58s0 +dwc_ddrphy_apb_wr(0x900d8, 0x7c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b58s1 +dwc_ddrphy_apb_wr(0x900d9, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b58s2 +dwc_ddrphy_apb_wr(0x900da, 0x7); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s0 +dwc_ddrphy_apb_wr(0x900db, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s1 +dwc_ddrphy_apb_wr(0x900dc, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s2 +dwc_ddrphy_apb_wr(0x900dd, 0x47); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b60s0 +dwc_ddrphy_apb_wr(0x900de, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b60s1 +dwc_ddrphy_apb_wr(0x900df, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b60s2 +dwc_ddrphy_apb_wr(0x900e0, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b61s0 +dwc_ddrphy_apb_wr(0x900e1, 0x618); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b61s1 +dwc_ddrphy_apb_wr(0x900e2, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b61s2 +dwc_ddrphy_apb_wr(0x900e3, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b62s0 +dwc_ddrphy_apb_wr(0x900e4, 0xe0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b62s1 +dwc_ddrphy_apb_wr(0x900e5, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b62s2 +dwc_ddrphy_apb_wr(0x900e6, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b63s0 +dwc_ddrphy_apb_wr(0x900e7, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b63s1 +dwc_ddrphy_apb_wr(0x900e8, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b63s2 +dwc_ddrphy_apb_wr(0x900e9, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b64s0 +dwc_ddrphy_apb_wr(0x900ea, 0x8140); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b64s1 +dwc_ddrphy_apb_wr(0x900eb, 0x10c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b64s2 +dwc_ddrphy_apb_wr(0x900ec, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b65s0 +dwc_ddrphy_apb_wr(0x900ed, 0x478); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b65s1 +dwc_ddrphy_apb_wr(0x900ee, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b65s2 +dwc_ddrphy_apb_wr(0x900ef, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b66s0 +dwc_ddrphy_apb_wr(0x900f0, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b66s1 +dwc_ddrphy_apb_wr(0x900f1, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b66s2 +dwc_ddrphy_apb_wr(0x900f2, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b67s0 +dwc_ddrphy_apb_wr(0x900f3, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b67s1 +dwc_ddrphy_apb_wr(0x900f4, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b67s2 +dwc_ddrphy_apb_wr(0x900f5, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b68s0 +dwc_ddrphy_apb_wr(0x900f6, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b68s1 +dwc_ddrphy_apb_wr(0x900f7, 0x101); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b68s2 +//// [phyinit_LoadPIECodeSections] Moving start address from 900f8 to 90006 +dwc_ddrphy_apb_wr(0x90006, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b0s0 +dwc_ddrphy_apb_wr(0x90007, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b0s1 +dwc_ddrphy_apb_wr(0x90008, 0x8); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b0s2 +dwc_ddrphy_apb_wr(0x90009, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b1s0 +dwc_ddrphy_apb_wr(0x9000a, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b1s1 +dwc_ddrphy_apb_wr(0x9000b, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b1s2 +//// [phyinit_LoadPIECodeSections] Moving start address from 9000c to d00e7 +dwc_ddrphy_apb_wr(0xd00e7, 0x400); // DWC_DDRPHYA_APBONLY0_SequencerOverride +//// [phyinit_LoadPIECodeSections] End of dwc_ddrphy_phyinit_LoadPIECodeSections() +//seq0b_LoadPstateSeqProductionCode(): --------------------------------------------------------------------------------------------------- +//seq0b_LoadPstateSeqProductionCode(): Programming the 0B sequencer 0b0000 start vector registers with 0. +//seq0b_LoadPstateSeqProductionCode(): Programming the 0B sequencer 0b1111 start vector register with 56. +//seq0b_LoadPstateSeqProductionCode(): --------------------------------------------------------------------------------------------------- +dwc_ddrphy_apb_wr(0x90017, 0x0); // DWC_DDRPHYA_INITENG0_base0_StartVector0b0 +dwc_ddrphy_apb_wr(0x90026, 0x38); // DWC_DDRPHYA_INITENG0_base0_StartVector0b15 +dwc_ddrphy_apb_wr(0x9000c, 0x0); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag0 +dwc_ddrphy_apb_wr(0x9000d, 0x173); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag1 +dwc_ddrphy_apb_wr(0x9000e, 0x60); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag2 +dwc_ddrphy_apb_wr(0x9000f, 0x6110); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag3 +dwc_ddrphy_apb_wr(0x90010, 0x2152); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag4 +dwc_ddrphy_apb_wr(0x90011, 0xdfbd); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag5 +dwc_ddrphy_apb_wr(0x90012, 0xffff); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag6 +dwc_ddrphy_apb_wr(0x90013, 0x6152); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag7 +//// [phyinit_I_loadPIEImage] Programming D4PowerControl::D4CATxDllLP to 0x1 +//// [phyinit_I_loadPIEImage] Programming AcLcdlMasDis to 0xfff +dwc_ddrphy_apb_wr(0x2006d, 0x1); // DWC_DDRPHYA_MASTER0_base0_D4PowerControl +dwc_ddrphy_apb_wr(0x200e8, 0xfff); // DWC_DDRPHYA_MASTER0_base0_AcLcdlMasDis +//// [phyinit_I_loadPIEImage] Turn on calibration and hold idle until dfi_init_start is asserted sequence is triggered. +//// [phyinit_I_loadPIEImage] Programming CalZap to 0x1 +//// [phyinit_I_loadPIEImage] Programming CalRate::CalRun to 0x1 +//// [phyinit_I_loadPIEImage] Programming CalRate to 0x19 +dwc_ddrphy_apb_wr(0x20089, 0x1); // DWC_DDRPHYA_MASTER0_base0_CalZap +dwc_ddrphy_apb_wr(0x20088, 0x19); // DWC_DDRPHYA_MASTER0_base0_CalRate +//// [phyinit_I_loadPIEImage] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x0 +dwc_ddrphy_apb_wr(0x200a6, 0x0); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +//// Disabling Ucclk (PMU) and Hclk (training hardware) +dwc_ddrphy_apb_wr(0xc0080, 0x0); // DWC_DDRPHYA_DRTUB0_UcclkHclkEnables +//// Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_I_loadPIEImage] End of dwc_ddrphy_phyinit_I_loadPIEImage() +// +// +////############################################################## +//// +//// dwc_ddrphy_phyinit_userCustom_customPostTrain is a user-editable function. +//// +//// The purpose of dwc_ddrphy_phyinit_userCustom_customPostTrain() is to override any +//// CSR values programmed by the training firmware or dwc_ddrphy_phyinit_progCsrSkipTrain() +//// This function is executed after training +//// +//// IMPORTANT: in this function, user shall not override any values in userInputBasic and +//// userInputAdvanced data structures. Only CSR programming should be done in this function. +//// +//// Sequence of Events in this function are: +//// 1. Enable APB access. +//// 2. Issue register writes +//// 3. Isolate APB access. +// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_customPostTrain(); + +//// [dwc_ddrphy_phyinit_userCustom_customPostTrain] End of dwc_ddrphy_phyinit_userCustom_customPostTrain() +//// [dwc_ddrphy_phyinit_userCustom_J_enterMissionMode] Start of dwc_ddrphy_phyinit_userCustom_J_enterMissionMode() +// +// +////############################################################## +//// +//// 4.3.10(J) Initialize the PHY to Mission Mode through DFI Initialization +//// +//// Initialize the PHY to mission mode as follows: +//// +//// 1. Set the PHY input clocks to the desired frequency. +//// 2. Initialize the PHY to mission mode by performing DFI Initialization. +//// Please see the DFI specification for more information. See the DFI frequency bus encoding in section <XXX>. +//// Note: The PHY training firmware initializes the DRAM state. if skip +//// training is used, the DRAM state is not initialized. +//// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_J_enterMissionMode(sdrammc); + +// +//// [dwc_ddrphy_phyinit_userCustom_J_enterMissionMode] End of dwc_ddrphy_phyinit_userCustom_J_enterMissionMode() +// [dwc_ddrphy_phyinit_sequence] End of dwc_ddrphy_phyinit_sequence() +// [dwc_ddrphy_phyinit_main] End of dwc_ddrphy_phyinit_main() diff --git a/drivers/ram/aspeed/dwc_ddrphy_phyinit_ddr5-3200-nodimm-train2D.c b/drivers/ram/aspeed/dwc_ddrphy_phyinit_ddr5-3200-nodimm-train2D.c new file mode 100644 index 00000000000..d21bcda6fb8 --- /dev/null +++ b/drivers/ram/aspeed/dwc_ddrphy_phyinit_ddr5-3200-nodimm-train2D.c @@ -0,0 +1,6930 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) ASPEED Technology Inc. + */ +// [dwc_ddrphy_phyinit_main] Start of dwc_ddrphy_phyinit_main() +// [dwc_ddrphy_phyinit_sequence] Start of dwc_ddrphy_phyinit_sequence() +// [dwc_ddrphy_phyinit_initStruct] Start of dwc_ddrphy_phyinit_initStruct() +// [dwc_ddrphy_phyinit_initStruct] End of dwc_ddrphy_phyinit_initStruct() +// [dwc_ddrphy_phyinit_setDefault] Start of dwc_ddrphy_phyinit_setDefault() +// [dwc_ddrphy_phyinit_setDefault] End of dwc_ddrphy_phyinit_setDefault() + +////############################################################## +// +//// dwc_ddrphy_phyinit_userCustom_overrideUserInput is a user-editable function. User can edit this function according to their needs. +//// +//// The purpose of dwc_ddrphy_phyinit_userCustom_overrideUserInput() is to override any +//// any field in Phyinit data structure set by dwc_ddrphy_phyinit_setDefault() +//// User should only override values in userInputBasic and userInputAdvanced. +//// IMPORTANT: in this function, user shall not override any values in the +//// messageblock directly on the data structue as the might be overwritten by +//// dwc_ddrphy_phyinit_calcMb(). Use dwc_ddrphy_phyinit_setMb() to set +//// messageblock parameters for override values to remain pervasive if +//// desired +// +////############################################################## + +dwc_ddrphy_phyinit_userCustom_overrideUserInput(); +// +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramType' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DimmType' to 0x4 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumDbyte' to 0x2 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumActiveDbyteDfi0' to 0x2 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumActiveDbyteDfi1' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumAnib' to 0xa +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumRank_dfi0' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumRank_dfi1' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[0]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[1]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[2]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DramDataWidth[3]' to 0x10 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'NumPStates' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Frequency[0]' to 0x640 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PllBypass[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DfiFreqRatio[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Dfi1Exists' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'ExtCalResVal' to 0xf0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'ODTImpedance[0]' to 0x78 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxImpedance[0]' to 0x3c +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'MemAlertEn' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'MtestPUImp' to 0xf0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DisDynAdrTri[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PhyMstrTrainInterval[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PhyMstrMaxReqToAck[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'PhyMstrCtrlMode[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'WDQSExt' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'CalInterval' to 0x9 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'CalOnce' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'RxEnBackOff' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TrainSequenceCtrl' to 0x837f +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'SnpsUmctlOpt' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'SnpsUmctlF0RC5x[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewRiseDQ[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewFallDQ[0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewRiseAC' to 0x66 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewFallAC' to 0x26 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'IsHighVDD' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewRiseCK' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'TxSlewFallCK' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnTdqs2dqTrackingTg0[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnTdqs2dqTrackingTg1[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnTdqs2dqTrackingTg2[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnTdqs2dqTrackingTg3[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DqsOscRunTimeSel[0]' to 0x100 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnRxDqsTracking[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'D5TxDqPreambleCtrl[0]' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'D5DisableRetraining' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'DisablePmuEcc' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'EnableMAlertAsync' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'Apb32BitMode' to 0x1 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tDQS2DQ' to 0x2ee +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tDQSCK' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_override' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][0]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][1]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][2]' to 0x0 +//// [dwc_ddrphy_phyinit_setUserInput] Setting PHYINIT field 'tCASL_add[0][3]' to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MsgMisc to 0x7 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].Pstate to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].PllBypassEn to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].DRAMFreq to 0xc80 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].PhyVref to 0x40 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].D5Misc to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].WL_ADJ to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].SequenceCtrl to 0x837f +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].HdtCtrl to 0xc8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].PhyCfg to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].DFIMRLMargin to 0x2 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].X16Present to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].UseBroadcastMR to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].DisabledDbyte to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].CATrainOpt to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].PhyConfigOverride to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].EnabledDQsChA to 0x10 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].CsPresentChA to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_A0 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_A0 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_A0 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_A0 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_A0 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_A0 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_A0 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_A0 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_A0 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_A0 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_A0 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_A0 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_A0 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_A0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_A1 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_A1 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_A1 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_A1 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_A1 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_A1 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_A1 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_A1 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_A1 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_A1 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_A1 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_A1 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_A1 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_A1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_A2 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_A2 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_A2 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_A2 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_A2 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_A2 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_A2 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_A2 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_A2 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_A2 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_A2 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_A2 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_A2 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_A2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_A3 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_A3 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_A3 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_A3 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_A3 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_A3 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_A3 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_A3 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_A3 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_A3 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_A3 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_A3 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_A3 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_A3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].EnabledDQsChB to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].CsPresentChB to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_B0 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_B0 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_B0 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_B0 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_B0 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_B0 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_B0 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_B0 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_B0 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_B0 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_B0 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_B0 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_B0 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_B0 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_B1 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_B1 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_B1 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_B1 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_B1 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_B1 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_B1 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_B1 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_B1 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_B1 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_B1 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_B1 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_B1 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_B1 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_B2 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_B2 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_B2 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_B2 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_B2 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_B2 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_B2 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_B2 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_B2 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_B2 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_B2 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_B2 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_B2 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_B2 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR0_B3 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR2_B3 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR3_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR4_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR5_B3 to 0x20 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR6_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR8_B3 to 0x8 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR10_B3 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR11_B3 to 0x2d +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR12_B3 to 0xd6 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR13_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR14_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR15_B3 to 0x3 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR111_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR32_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR33_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR34_B3 to 0x11 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR35_B3 to 0x4 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR37_B3 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR38_B3 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR39_B3 to 0x2c +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR50_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR51_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].MR52_B3 to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].WL_ADJ_START to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].WL_ADJ_END to 0x0 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].RCW00_ChA_D0 to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].RCW00_ChA_D1 to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].RCW00_ChB_D0 to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].RCW00_ChB_D1 to 0x1 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib0 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib1 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib2 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib3 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib4 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib5 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib6 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib7 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib8 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib9 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib10 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib11 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib12 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib13 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib14 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib15 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib16 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib17 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib18 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR0Nib19 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib0 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib1 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib2 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib3 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib4 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib5 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib6 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib7 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib8 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib9 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib10 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib11 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib12 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib13 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib14 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib15 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib16 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib17 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib18 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR1Nib19 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib0 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib1 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib2 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib3 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib4 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib5 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib6 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib7 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib8 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib9 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib10 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib11 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib12 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib13 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib14 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib15 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib16 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib17 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib18 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR2Nib19 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib0 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib1 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib2 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib3 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib4 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib5 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib6 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib7 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib8 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib9 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib10 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib11 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib12 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib13 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib14 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib15 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib16 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib17 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib18 to 0x17 +// [dwc_ddrphy_phyinit_setMb] Setting mb_DDR5U_1D[0].VrefDqR3Nib19 to 0x17 +// [dwc_ddrphy_phyinit_userCustom_overrideUserInput] End of dwc_ddrphy_phyinit_userCustom_overrideUserInput() +//[dwc_ddrphy_phyinit_calcMb] Start of dwc_ddrphy_phyinit_calcMb() +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR5U_1D[0].Pstate override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR5U_1D[0].DRAMFreq override to 0xc80 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR5U_1D[0].PllBypassEn override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR5U_1D[0].X16Present override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR5U_1D[0].EnabledDQsChA override to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] mb_DDR5U_1D[0].EnabledDQsChB override to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[1].Pstate to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[1].DRAMFreq to 0x856 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[1].PllBypassEn to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[1].X16Present to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[1].EnabledDQsChA to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[1].EnabledDQsChB to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[2].Pstate to 0x2 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[2].DRAMFreq to 0x74a +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[2].PllBypassEn to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[2].X16Present to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[2].EnabledDQsChA to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[2].EnabledDQsChB to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[3].Pstate to 0x3 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[3].DRAMFreq to 0x640 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[3].PllBypassEn to 0x0 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[3].X16Present to 0x1 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[3].EnabledDQsChA to 0x10 +//// [dwc_ddrphy_phyinit_softSetMb] Setting mb_DDR5U_1D[3].EnabledDQsChB to 0x0 +////[dwc_ddrphy_phyinit_calcMb] TG_active[0] = 1 +////[dwc_ddrphy_phyinit_calcMb] TG_active[1] = 0 +////[dwc_ddrphy_phyinit_calcMb] TG_active[2] = 0 +////[dwc_ddrphy_phyinit_calcMb] TG_active[3] = 0 +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=0] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=0] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=0] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=1] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=1] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=1] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=2] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=2] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=2] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_CK [pstate=0][tg=3] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] tDIMM_DQ [pstate=0][tg=3] = 0 ps +////[dwc_ddrphy_phyinit_calcMb] userInputSim.tCASL_add[pstate=0][tg=3] = 0 ps +//[dwc_ddrphy_phyinit_calcMb] End of dwc_ddrphy_phyinit_calcMb() +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // Printing values in user input structure +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[0] = 16 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[1] = 16 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[2] = 16 +//// [phyinit_print_dat] pUserInputBasic->DramDataWidth[3] = 16 +//// [phyinit_print_dat] pUserInputBasic->NumActiveDbyteDfi1 = 0 +//// [phyinit_print_dat] pUserInputBasic->DramType = 1 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitValOvr = 0 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[0] = 3 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[1] = 3 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[2] = 3 +//// [phyinit_print_dat] pUserInputBasic->ARdPtrInitVal[3] = 3 +//// [phyinit_print_dat] pUserInputBasic->Dfi1Exists = 0 +//// [phyinit_print_dat] pUserInputBasic->Frequency[0] = 1600 +//// [phyinit_print_dat] pUserInputBasic->Frequency[1] = 1067 +//// [phyinit_print_dat] pUserInputBasic->Frequency[2] = 933 +//// [phyinit_print_dat] pUserInputBasic->Frequency[3] = 800 +//// [phyinit_print_dat] pUserInputBasic->NumActiveDbyteDfi0 = 2 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[0] = 0 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[1] = 0 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[2] = 0 +//// [phyinit_print_dat] pUserInputBasic->DisPtrInitClrTxTracking[3] = 0 +//// [phyinit_print_dat] pUserInputBasic->NumRank_dfi0 = 1 +//// [phyinit_print_dat] pUserInputBasic->NumPStates = 1 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[0] = 0 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[1] = 0 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[2] = 0 +//// [phyinit_print_dat] pUserInputBasic->PllBypass[3] = 0 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[0] = 1 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[1] = 1 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[2] = 1 +//// [phyinit_print_dat] pUserInputBasic->DfiFreqRatio[3] = 1 +//// [phyinit_print_dat] pUserInputBasic->NumAnib = 10 +//// [phyinit_print_dat] pUserInputBasic->DimmType = 4 +//// [phyinit_print_dat] pUserInputBasic->NumRank_dfi1 = 0 +//// [phyinit_print_dat] pUserInputBasic->NumDbyte = 2 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg1[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg1[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg1[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg1[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg0[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg0[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg0[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg0[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlF0RC5x[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl2[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->IsHighVDD = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DramByteSwap[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->ExtCalResVal = 240 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4TxPreambleLength[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->RxEnBackOff = 1 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[4] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[5] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[6] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvLaneSel[7] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->CalOnce = 0 +//// [phyinit_print_dat] pUserInputAdvanced->Apb32BitMode = 1 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseCK = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallAC = 38 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallCK = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisablePmuEcc = 1 +//// [phyinit_print_dat] pUserInputAdvanced->SnpsUmctlOpt = 0 +//// [phyinit_print_dat] pUserInputAdvanced->WDQSExt = 0 +//// [phyinit_print_dat] pUserInputAdvanced->VREGCtrl_LP2_PwrSavings_En = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseAC = 102 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DisDynAdrTri[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[4] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[5] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[6] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AnibRcvEn[7] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg3[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg3[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg3[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg3[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrTrainInterval[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->rtt_term_en = 0 +//// [phyinit_print_dat] pUserInputAdvanced->AlertRecoveryEnable = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewRiseDQ[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->en_16LogicalRanks_3DS = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[1] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[2] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->D4RxPreambleLength[3] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrCtrlMode[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxSlewFallDQ[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[4] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[5] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[6] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->NvAnibRcvSel[7] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[0] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[1] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[2] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedanceCtrl1[3] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->Nibble_ECC = 15 +//// [phyinit_print_dat] pUserInputAdvanced->D5DisableRetraining = 0 +//// [phyinit_print_dat] pUserInputAdvanced->DqsOscRunTimeSel[0] = 256 +//// [phyinit_print_dat] pUserInputAdvanced->DqsOscRunTimeSel[1] = 256 +//// [phyinit_print_dat] pUserInputAdvanced->DqsOscRunTimeSel[2] = 256 +//// [phyinit_print_dat] pUserInputAdvanced->DqsOscRunTimeSel[3] = 256 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[0] = 120 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[1] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[2] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->ODTImpedance[3] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->MtestPUImp = 240 +//// [phyinit_print_dat] pUserInputAdvanced->EnableMAlertAsync = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[0] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->PhyMstrMaxReqToAck[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->RedundantCs_en = 0 +//// [phyinit_print_dat] pUserInputAdvanced->CalInterval = 9 +//// [phyinit_print_dat] pUserInputAdvanced->D5TxDqPreambleCtrl[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->D5TxDqPreambleCtrl[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D5TxDqPreambleCtrl[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->D5TxDqPreambleCtrl[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->MemAlertEn = 0 +//// [phyinit_print_dat] pUserInputAdvanced->ATxImpedance = 53247 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg2[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg2[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg2[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnTdqs2dqTrackingTg2[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->en_3DS = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnRxDqsTracking[0] = 1 +//// [phyinit_print_dat] pUserInputAdvanced->EnRxDqsTracking[1] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnRxDqsTracking[2] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->EnRxDqsTracking[3] = 0 +//// [phyinit_print_dat] pUserInputAdvanced->RstRxTrkState = 0 +//// [phyinit_print_dat] pUserInputAdvanced->TrainSequenceCtrl = 33663 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[0] = 60 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[1] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[2] = 25 +//// [phyinit_print_dat] pUserInputAdvanced->TxImpedance[3] = 25 +//// [phyinit_print_dat] pUserInputSim->tDQS2DQ = 750 +//// [phyinit_print_dat] pUserInputSim->tDQSCK = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[0] = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[1] = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[2] = 0 +//// [phyinit_print_dat] pUserInputSim->tSTAOFF[3] = 0 +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // Printing values of 1D message block input/inout fields, PState=0 +//// [phyinit_print_dat] // +//// [phyinit_print_dat] // #################################################### +//// [phyinit_print_dat] mb_DDR5U_1D[0].AdvTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MsgMisc = 0x7 +//// [phyinit_print_dat] mb_DDR5U_1D[0].Pstate = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PllBypassEn = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DRAMFreq = 0xc80 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RXEN_ADJ = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RX2D_DFE_Misc = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PhyVref = 0x40 +//// [phyinit_print_dat] mb_DDR5U_1D[0].D5Misc = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WL_ADJ = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].SequenceCtrl = 0x837f +//// [phyinit_print_dat] mb_DDR5U_1D[0].HdtCtrl = 0xc8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PhyCfg = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFIMRLMargin = 0x2 +//// [phyinit_print_dat] mb_DDR5U_1D[0].X16Present = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].UseBroadcastMR = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].D5Quickboot = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDbyte = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].CATrainOpt = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].TX2D_DFE_Misc = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].TX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].Share2DVrefResult = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MRE_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DWL_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PhyConfigOverride = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].EnabledDQsChA = 0x10 +//// [phyinit_print_dat] mb_DDR5U_1D[0].CsPresentChA = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A0 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A0 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A0 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A0 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A1 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A1 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A1 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A1 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A2 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A2 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A2 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A2 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A3 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A3 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A3 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A3 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].EnabledDQsChB = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].CsPresentChB = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B0 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B0 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B0 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B0 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B1 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B1 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B1 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B1 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B2 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B2 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B2 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B2 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B3 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B3 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B3 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B3 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WL_ADJ_START = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WL_ADJ_END = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChA_D0 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChA_D1 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChB_D0 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChB_D1 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].AdvTrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MsgMisc = 0x7 +//// [phyinit_print_dat] mb_DDR5U_1D[0].Pstate = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PllBypassEn = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DRAMFreq = 0xc80 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RXEN_ADJ = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RX2D_DFE_Misc = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PhyVref = 0x40 +//// [phyinit_print_dat] mb_DDR5U_1D[0].D5Misc = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WL_ADJ = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].SequenceCtrl = 0x837f +//// [phyinit_print_dat] mb_DDR5U_1D[0].HdtCtrl = 0xc8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PhyCfg = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFIMRLMargin = 0x2 +//// [phyinit_print_dat] mb_DDR5U_1D[0].X16Present = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].UseBroadcastMR = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].D5Quickboot = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDbyte = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].CATrainOpt = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].TX2D_DFE_Misc = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].TX2D_TrainOpt = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].Share2DVrefResult = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MRE_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DWL_MIN_PULSE = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].PhyConfigOverride = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].EnabledDQsChA = 0x10 +//// [phyinit_print_dat] mb_DDR5U_1D[0].CsPresentChA = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A0 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A0 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A0 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A0 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A1 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A1 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A1 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A1 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A2 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A2 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A2 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A2 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_A3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_A3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_A3 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_A3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_A3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A3 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_A3 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_A3 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_A3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_A3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_A3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_A3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_A3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_A3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].EnabledDQsChB = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].CsPresentChB = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B0 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B0 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B0 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B0 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B0 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B0 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B0 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B0 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B0_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B1 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B1 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B1 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B1 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B1 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B1 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B1 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B1 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B1_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B2 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B2 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B2 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B2 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B2 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B2 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B2 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B2 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B2_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR0_B3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR2_B3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR4_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR5_B3 = 0x20 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR6_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR8_B3 = 0x8 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR10_B3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B3 = 0x2d +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B3 = 0xd6 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR14_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR15_B3 = 0x3 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR111_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR34_B3 = 0x11 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR35_B3 = 0x4 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR32_ORG_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR37_B3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR38_B3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR39_B3 = 0x2c +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR11_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR12_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR13_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_ORG_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR33_B3_next = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR50_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR51_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR52_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DFE_GainBias_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WR_RD_RTT_PARK_B3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WL_ADJ_START = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].WL_ADJ_END = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChA_D0 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChA_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChA_D1 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChA_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChB_D0 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChB_D0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW00_ChB_D1 = 0x1 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW01_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW02_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW03_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW04_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW05_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW06_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW07_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW08_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW09_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW0F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW10_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW11_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW12_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW13_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW14_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW15_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW16_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW17_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW18_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW19_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW1F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW20_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW21_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW22_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW23_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW24_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW25_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW26_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW27_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW28_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW29_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW2F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW30_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW31_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW32_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW33_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW34_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW35_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW36_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW37_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW38_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW39_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW3F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW40_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW41_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW42_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW43_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW44_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW45_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW46_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW47_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW48_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW49_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW4F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW50_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW51_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW52_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW53_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW54_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW55_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW56_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW57_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW58_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW59_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW5F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW60_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW61_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW62_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW63_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW64_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW65_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW66_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW67_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW68_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW69_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW6F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW70_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW71_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW72_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW73_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW74_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW75_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW76_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW77_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW78_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW79_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].RCW7F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW00_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW01_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW02_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW03_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW04_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW05_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW06_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW07_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW08_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW09_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW0F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW10_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW11_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW12_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW13_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW14_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW15_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW16_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW17_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW18_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW19_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW1F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW20_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW21_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW22_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW23_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW24_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW25_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW26_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW27_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW28_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW29_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW2F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW30_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW31_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW32_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW33_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW34_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW35_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW36_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW37_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW38_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW39_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW3F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW40_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW41_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW42_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW43_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW44_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW45_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW46_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW47_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW48_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW49_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW4F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW50_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW51_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW52_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW53_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW54_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW55_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW56_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW57_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW58_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW59_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW5F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW60_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW61_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW62_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW63_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW64_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW65_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW66_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW67_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW68_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW69_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW6F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW70_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW71_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW72_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW73_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW74_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW75_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW76_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW77_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW78_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW79_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7A_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7B_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7C_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7D_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7E_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].BCW7F_ChB_D1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR0Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR1Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR2Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib0 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib1 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib2 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib3 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib4 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib5 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib6 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib7 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib8 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib9 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib10 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib11 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib12 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib13 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib14 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib15 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib16 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib17 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib18 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefDqR3Nib19 = 0x17 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R0Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R1Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R2Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].MR3R3Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR0Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR1Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR2Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCSR3Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR0Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR1Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR2Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib4 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib5 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib6 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib7 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib8 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib9 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib10 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib11 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib12 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib13 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib14 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib15 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib16 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib17 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib18 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].VrefCAR3Nib19 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR0 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR1 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR2 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB0LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB1LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB2LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB3LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB4LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB5LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB6LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB7LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB8LaneR3 = 0x0 +//// [phyinit_print_dat] mb_DDR5U_1D[0].DisabledDB9LaneR3 = 0x0 + +////############################################################## +//// +//// Step (A) : Bring up VDD, VDDQ, and VAA +//// +//// The power supplies can come up and stabilize in any order. +//// While the power supplies are coming up, all outputs will be unknown and +//// the values of the inputs are don't cares. +//// +////############################################################## + +dwc_ddrphy_phyinit_userCustom_A_bringupPower(); + +//[dwc_ddrphy_phyinit_userCustom_A_bringupPower] End of dwc_ddrphy_phyinit_userCustom_A_bringupPower() +// +// +////############################################################## +//// +//// 4.3.2(B) Start Clocks and Reset the PHY +//// +//// Following is one possbile sequence to reset the PHY. Other sequences are also possible. +//// See section 5.2.2 of the PUB for other possible reset sequences. +//// +//// 1. Drive PwrOkIn to 0. Note: Reset, DfiClk, and APBCLK can be X. +//// 2. Start DfiClk and APBCLK +//// 3. Drive Reset to 1 and PRESETn_APB to 0. +//// Note: The combination of PwrOkIn=0 and Reset=1 signals a cold reset to the PHY. +//// 4. Wait a minimum of 8 cycles. +//// 5. Drive PwrOkIn to 1. Once the PwrOkIn is asserted (and Reset is still asserted), +//// DfiClk synchronously switches to any legal input frequency. +//// 6. Wait a minimum of 64 cycles. Note: This is the reset period for the PHY. +//// 7. Drive Reset to 0. Note: All DFI and APB inputs must be driven at valid reset states before the deassertion of Reset. +//// 8. Wait a minimum of 1 Cycle. +//// 9. Drive PRESETn_APB to 1 to de-assert reset on the ABP bus. +////10. The PHY is now in the reset state and is ready to accept APB transactions. +//// +////############################################################## +// +// +dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy(sdrammc); + +//// [dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy] End of dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy() +// + +////############################################################## +//// +//// Step (C) Initialize PHY Configuration +//// +//// Load the required PHY configuration registers for the appropriate mode and memory configuration +//// +////############################################################## +// + +//// [phyinit_C_initPhyConfig] Start of dwc_ddrphy_phyinit_C_initPhyConfig() +//// [phyinit_C_initPhyConfig] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x1 +dwc_ddrphy_apb_wr(0x200a6, 0x2); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for MASTER +dwc_ddrphy_apb_wr(0x20066, 0x0); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all DBYTEs +dwc_ddrphy_apb_wr(0x10066, 0x0); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x11066, 0x0); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all ANIBs +dwc_ddrphy_apb_wr(0x66, 0x0); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x1066, 0x0); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x2066, 0x0); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x3066, 0x0); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x4066, 0x0); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x5066, 0x0); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x6066, 0x0); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x7066, 0x0); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x8066, 0x0); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x9066, 0x0); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl1::VshDAC to 0x16 for MASTER +dwc_ddrphy_apb_wr(0x20029, 0x58); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl1_p0 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl1::VshDAC to 0x16 for all DBYTEs +dwc_ddrphy_apb_wr(0x10029, 0x58); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x11029, 0x58); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl1_p0 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl1::VshDAC to 0x16 for all ANIBs +dwc_ddrphy_apb_wr(0x29, 0x58); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x1029, 0x58); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x2029, 0x58); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x3029, 0x58); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x4029, 0x58); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x5029, 0x58); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x6029, 0x58); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x7029, 0x58); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x8029, 0x58); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x9029, 0x58); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl1_p0 +dwc_ddrphy_apb_wr(0x90301, 0x59); // DWC_DDRPHYA_INITENG0_base0_Seq0BGPR1_p0 +dwc_ddrphy_apb_wr(0x90302, 0x58); // DWC_DDRPHYA_INITENG0_base0_Seq0BGPR2_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxSlewRate::CsrTxSrc to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxSlewRate::TxPreDrvMode to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxSlewRate to 0x0 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for TxSlewRate::CsrTxSrc are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult the "Output Slew Rate" section of HSpice Model App Note in specific technology for recommended settings + +dwc_ddrphy_apb_wr(0x1005f, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxSlewRate_b0_p0 +dwc_ddrphy_apb_wr(0x1015f, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxSlewRate_b1_p0 +dwc_ddrphy_apb_wr(0x1105f, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxSlewRate_b0_p0 +dwc_ddrphy_apb_wr(0x1115f, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxSlewRate_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::ATxPreDrvMode to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 0 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 0 to 0x1be +dwc_ddrphy_apb_wr(0x55, 0x1be); // DWC_DDRPHYA_ANIB0_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 1 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 1 to 0x1be +dwc_ddrphy_apb_wr(0x1055, 0x1be); // DWC_DDRPHYA_ANIB1_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 2 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 2 to 0x1be +dwc_ddrphy_apb_wr(0x2055, 0x1be); // DWC_DDRPHYA_ANIB2_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 3 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 3 to 0x1be +dwc_ddrphy_apb_wr(0x3055, 0x1be); // DWC_DDRPHYA_ANIB3_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 4 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 4 to 0x1be +dwc_ddrphy_apb_wr(0x4055, 0x1be); // DWC_DDRPHYA_ANIB4_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 5 to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 5 to 0x0 +dwc_ddrphy_apb_wr(0x5055, 0x0); // DWC_DDRPHYA_ANIB5_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 6 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 6 to 0x1be +dwc_ddrphy_apb_wr(0x6055, 0x1be); // DWC_DDRPHYA_ANIB6_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 7 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 7 to 0x1be +dwc_ddrphy_apb_wr(0x7055, 0x1be); // DWC_DDRPHYA_ANIB7_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 8 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 8 to 0x1be +dwc_ddrphy_apb_wr(0x8055, 0x1be); // DWC_DDRPHYA_ANIB8_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate::CsrATxSrc ANIB 9 to 0x1be +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxSlewRate ANIB 9 to 0x1be +dwc_ddrphy_apb_wr(0x9055, 0x1be); // DWC_DDRPHYA_ANIB9_base0_ATxSlewRate_p0 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for ATxSlewRate::CsrATxSrc are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult the "Output Slew Rate" section of HSpice Model App Note in specific technology for recommended settings + +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride::CsrTxOvSrc to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride::TxCalBaseN to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride::TxCalBaseP to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalPreDriverOverride to 0x300 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for CalPreDriverOverride::CsrTxOvSrc are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult the "Output Slew Rate" section of HSpice Model App Note in specific technology for recommended settings + +dwc_ddrphy_apb_wr(0x2008c, 0x300); // DWC_DDRPHYA_MASTER0_base0_CalPreDriverOverride +//// [phyinit_C_initPhyConfig] PUB revision is 0x0350. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl2::PllFreqSel to 0x19 based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200c5, 0x19); // DWC_DDRPHYA_MASTER0_base0_PllCtrl2_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl1::PllCpPropCtrl to 0x3 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl1::PllCpIntCtrl to 0x1 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl1 to 0x61 based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200c7, 0x21); // DWC_DDRPHYA_MASTER0_base0_PllCtrl1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllTestMode to 0x400f based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200ca, 0x402f); // DWC_DDRPHYA_MASTER0_base0_PllTestMode_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl4::PllCpPropGsCtrl to 0x6 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl4::PllCpIntGsCtrl to 0x12 based on DfiClk frequency = 800. +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming PllCtrl4 to 0xd2 based on DfiClk frequency = 800. +dwc_ddrphy_apb_wr(0x200cc, 0x17f); // DWC_DDRPHYA_MASTER0_base0_PllCtrl4_p0 +//// [phyinit_C_initPhyConfig] ### NOTE ### Optimal setting for PllCtrl1 and PllTestMode are technology specific. +//// [phyinit_C_initPhyConfig] ### NOTE ### Please consult technology specific PHY Databook for recommended settings + +// +////############################################################## +//// +//// Program ARdPtrInitVal based on Frequency and PLL Bypass inputs +//// The values programmed here assume ideal properties of DfiClk +//// and Pclk including: +//// - DfiClk skew +//// - DfiClk jitter +//// - DfiClk PVT variations +//// - Pclk skew +//// - Pclk jitter +//// +//// PLL Bypassed mode: +//// For MemClk frequency > 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 2-5 +//// For MemClk frequency < 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 1-5 +//// +//// PLL Enabled mode: +//// For MemClk frequency > 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 1-5 +//// For MemClk frequency < 933MHz, the valid range of ARdPtrInitVal_p0[3:0] is: 0-5 +//// +////############################################################## +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ARdPtrInitVal to 0x1 +dwc_ddrphy_apb_wr(0x2002e, 0x1); // DWC_DDRPHYA_MASTER0_base0_ARdPtrInitVal_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DisPtrInitClrTxTracking to 0x0 +dwc_ddrphy_apb_wr(0x20051, 0x0); // DWC_DDRPHYA_MASTER0_base0_PtrInitTrackingModeCntrl_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::TwoTckRxDqsPre to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::TwoTckTxDqsPre to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::PositionDfeInit to 0x2 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::DDR5RxPreamble to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl::DDR5RxPostamble to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreambleControl to 0x88 +dwc_ddrphy_apb_wr(0x20024, 0x88); // DWC_DDRPHYA_MASTER0_base0_DqsPreambleControl_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreamblePattern::EnTxDqsPreamblePattern to 0x7 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreamblePattern::TxDqsPreamblePattern to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPreamblePattern to 0x701 +dwc_ddrphy_apb_wr(0x200a1, 0x701); // DWC_DDRPHYA_MASTER0_base0_DqsPreamblePattern_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPostamblePattern::EnTxDqsPostamblePattern to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPostamblePattern::TxDqsPostamblePattern to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqsPostamblePattern to 0x0 +dwc_ddrphy_apb_wr(0x200a2, 0x0); // DWC_DDRPHYA_MASTER0_base0_DqsPostamblePattern_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DmPreamblePattern::EnTxDmPreamblePattern to 0xf +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DmPreamblePattern::TxDmPreamblePattern to 0xf +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DmPreamblePattern to 0xf5 +dwc_ddrphy_apb_wr(0x200fe, 0xf5); // DWC_DDRPHYA_MASTER0_base0_DmPreamblePattern_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqPreamblePatternU0::EnTxDqPreamblePatternU0 to 0xf +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqPreamblePatternU0::TxDqPreamblePatternU0 to 0xf +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqPreamblePatternU0 to 0xf5 +dwc_ddrphy_apb_wr(0x200fc, 0xf5); // DWC_DDRPHYA_MASTER0_base0_DqPreamblePatternU0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqPreamblePatternU1::EnTxDqPreamblePatternU1 to 0xf +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqPreamblePatternU1::TxDqPreamblePatternU1 to 0xf +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DqPreamblePatternU1 to 0xf5 +dwc_ddrphy_apb_wr(0x200fd, 0xf5); // DWC_DDRPHYA_MASTER0_base0_DqPreamblePatternU1_p0 +//// [phyinit_C_initPhyConfig] Programming DbyteDllModeCntrl::DllRxPreambleMode to 0x1 +//// [phyinit_C_initPhyConfig] Programming DbyteDllModeCntrl::DllRxBurstLengthMode to 0x0 +//// [phyinit_C_initPhyConfig] Programming DbyteDllModeCntrl to 0x2 +dwc_ddrphy_apb_wr(0x2003a, 0x2); // DWC_DDRPHYA_MASTER0_base0_DbyteDllModeCntrl +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxOdtDrvStren::TxOdtStrenPu to 0x4 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxOdtDrvStren::TxOdtStrenPd to 0x0 +dwc_ddrphy_apb_wr(0x1004d, 0x104); // DWC_DDRPHYA_DBYTE0_base0_TxOdtDrvStren_b0_p0 +dwc_ddrphy_apb_wr(0x1014d, 0x104); // DWC_DDRPHYA_DBYTE0_base0_TxOdtDrvStren_b1_p0 +dwc_ddrphy_apb_wr(0x1104d, 0x104); // DWC_DDRPHYA_DBYTE1_base0_TxOdtDrvStren_b0_p0 +dwc_ddrphy_apb_wr(0x1114d, 0x104); // DWC_DDRPHYA_DBYTE1_base0_TxOdtDrvStren_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ADrvStrenP to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ADrvStrenN to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ATxReserved13x12 to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ATxCalBaseN to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming ATxImpedance::ATxCalBaseP to 0x1 +dwc_ddrphy_apb_wr(0x43, 0xcfff); // DWC_DDRPHYA_ANIB0_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x1043, 0xcfff); // DWC_DDRPHYA_ANIB1_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x2043, 0xcfff); // DWC_DDRPHYA_ANIB2_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x3043, 0xcfff); // DWC_DDRPHYA_ANIB3_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x4043, 0xcfff); // DWC_DDRPHYA_ANIB4_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x5043, 0xcfff); // DWC_DDRPHYA_ANIB5_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x6043, 0xcfff); // DWC_DDRPHYA_ANIB6_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x7043, 0xcfff); // DWC_DDRPHYA_ANIB7_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x8043, 0xcfff); // DWC_DDRPHYA_ANIB8_base0_ATxImpedance +dwc_ddrphy_apb_wr(0x9043, 0xcfff); // DWC_DDRPHYA_ANIB9_base0_ATxImpedance +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl0::TxStrenEqHiPu to 0xc +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl0::TxStrenEqLoPd to 0xc +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl1::TxStrenPu to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl1::TxStrenPd to 0x3f +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl2::TxStrenEqLoPu to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TxImpedanceCtrl2::TxStrenEqHiPd to 0x0 +dwc_ddrphy_apb_wr(0x10041, 0x30c); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl0_b0_p0 +dwc_ddrphy_apb_wr(0x10049, 0x79e); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl1_b0_p0 +dwc_ddrphy_apb_wr(0x1004b, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl2_b0_p0 +dwc_ddrphy_apb_wr(0x10141, 0x30c); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl0_b1_p0 +dwc_ddrphy_apb_wr(0x10149, 0x79e); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl1_b1_p0 +dwc_ddrphy_apb_wr(0x1014b, 0x0); // DWC_DDRPHYA_DBYTE0_base0_TxImpedanceCtrl2_b1_p0 +dwc_ddrphy_apb_wr(0x11041, 0x30c); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl0_b0_p0 +dwc_ddrphy_apb_wr(0x11049, 0x79e); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl1_b0_p0 +dwc_ddrphy_apb_wr(0x1104b, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl2_b0_p0 +dwc_ddrphy_apb_wr(0x11141, 0x30c); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl0_b1_p0 +dwc_ddrphy_apb_wr(0x11149, 0x79e); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl1_b1_p0 +dwc_ddrphy_apb_wr(0x1114b, 0x0); // DWC_DDRPHYA_DBYTE1_base0_TxImpedanceCtrl2_b1_p0 +//// [phyinit_C_initPhyConfig] Programming DfiMode to 0x1 +dwc_ddrphy_apb_wr(0x20018, 0x1); // DWC_DDRPHYA_MASTER0_base0_DfiMode +//// [phyinit_C_initPhyConfig] Programming DfiCAMode to 0x10 +dwc_ddrphy_apb_wr(0x20075, 0x10); // DWC_DDRPHYA_MASTER0_base0_DfiCAMode +//// [phyinit_C_initPhyConfig] Programming CalDrvStr0::CalDrvStrPd50 to 0x2 +//// [phyinit_C_initPhyConfig] Programming CalDrvStr0::CalDrvStrPu50 to 0x2 +dwc_ddrphy_apb_wr(0x20050, 0x82); // DWC_DDRPHYA_MASTER0_base0_CalDrvStr0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming CalUclkInfo::CalUClkTicksPer1uS to 0x320 +dwc_ddrphy_apb_wr(0x20008, 0x320); // DWC_DDRPHYA_MASTER0_base0_CalUclkInfo_p0 +//// [phyinit_C_initPhyConfig] Programming CalRate::CalInterval to 0x9 +//// [phyinit_C_initPhyConfig] Programming CalRate::CalOnce to 0x0 +dwc_ddrphy_apb_wr(0x20088, 0x9); // DWC_DDRPHYA_MASTER0_base0_CalRate +//// [phyinit_C_initPhyConfig] Pstate=0, Programming VrefInGlobal::GlobalVrefInSel to 0x0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming VrefInGlobal::GlobalVrefInDAC to 0x1f +//// [phyinit_C_initPhyConfig] Pstate=0, Programming VrefInGlobal to 0xf8 +dwc_ddrphy_apb_wr(0x200b2, 0xf8); // DWC_DDRPHYA_MASTER0_base0_VrefInGlobal_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=0, Upper/Lower=0) to 0x2900 +dwc_ddrphy_apb_wr(0x10043, 0x2900); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl_b0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=0, Upper/Lower=1) to 0x2900 +dwc_ddrphy_apb_wr(0x10143, 0x2900); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=1, Upper/Lower=0) to 0x2900 +dwc_ddrphy_apb_wr(0x11043, 0x2900); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl_b0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl (Byte=1, Upper/Lower=1) to 0x2900 +dwc_ddrphy_apb_wr(0x11143, 0x2900); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl_b1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Programming DqDqsRcvCntrl2 to 0x1c +dwc_ddrphy_apb_wr(0x1004c, 0x1c); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl2_p0 +dwc_ddrphy_apb_wr(0x1104c, 0x1c); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl2_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TristateModeCA::DisDynAdrTri_p0 to 0x1 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming TristateModeCA::DDR2TMode_p0 to 0x0 +dwc_ddrphy_apb_wr(0x20019, 0x5); // DWC_DDRPHYA_MASTER0_base0_TristateModeCA_p0 +//// [phyinit_C_initPhyConfig] Programming DfiFreqXlat* +dwc_ddrphy_apb_wr(0x200f0, 0x0); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat0 +dwc_ddrphy_apb_wr(0x200f1, 0x0); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat1 +dwc_ddrphy_apb_wr(0x200f2, 0x4444); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat2 +dwc_ddrphy_apb_wr(0x200f3, 0x8888); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat3 +dwc_ddrphy_apb_wr(0x200f4, 0x5555); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat4 +dwc_ddrphy_apb_wr(0x200f5, 0x0); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat5 +dwc_ddrphy_apb_wr(0x200f6, 0x0); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat6 +dwc_ddrphy_apb_wr(0x200f7, 0xf000); // DWC_DDRPHYA_MASTER0_base0_DfiFreqXlat7 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY0 to 0x64 +dwc_ddrphy_apb_wr(0x2000b, 0x64); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY0_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY1 to 0xc8 +dwc_ddrphy_apb_wr(0x2000c, 0xc8); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY1_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY2 to 0x2bc +dwc_ddrphy_apb_wr(0x2000d, 0x2bc); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY2_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming Seq0BDLY3 to 0x2c +dwc_ddrphy_apb_wr(0x2000e, 0x2c); // DWC_DDRPHYA_MASTER0_base0_Seq0BDLY3_p0 +//// [phyinit_C_initPhyConfig] Disabling DBYTE 0 Lane 8 (DBI) Receiver to save power. +dwc_ddrphy_apb_wr(0x1004a, 0x500); // DWC_DDRPHYA_DBYTE0_base0_DqDqsRcvCntrl1 +//// [phyinit_C_initPhyConfig] Disabling DBYTE 1 Lane 8 (DBI) Receiver to save power. +dwc_ddrphy_apb_wr(0x1104a, 0x500); // DWC_DDRPHYA_DBYTE1_base0_DqDqsRcvCntrl1 +//// [phyinit_C_initPhyConfig] Programming MasterX4Config::X4TG to 0x0 +dwc_ddrphy_apb_wr(0x20025, 0x0); // DWC_DDRPHYA_MASTER0_base0_MasterX4Config +// [phyinit_C_initPhyConfig] Programming DfiDataEnLatency::WLm13 and RLm13 +dwc_ddrphy_apb_wr(0x2019a, 0x18); // DWC_DDRPHYA_MASTER0_base0_DfiDataEnLatency +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, rd_Crc = 0 cwl= 24 , cl = 26 mr_cl =2 MR0_A0 = 0x8 +dwc_ddrphy_apb_wr(0x400f5, 0x1200); // DWC_DDRPHYA_ACSM0_base0_AcsmCtrl5_p0 +dwc_ddrphy_apb_wr(0x400f6, 0x10); // DWC_DDRPHYA_ACSM0_base0_AcsmCtrl6_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0RxEnPulse to 2062 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0RxValPulse to 2062 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0RdcsPulse to 2062 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0TxEnPulse to 2060 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0WrcsPulse to 2060 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0SnoopPulse to 2062 +dwc_ddrphy_apb_wr(0x20120, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0RxEnPulse_p0 +dwc_ddrphy_apb_wr(0x20121, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0RxValPulse_p0 +dwc_ddrphy_apb_wr(0x20124, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0RdcsPulse_p0 +dwc_ddrphy_apb_wr(0x20122, 0x80c); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0TxEnPulse_p0 +dwc_ddrphy_apb_wr(0x20123, 0x80c); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0WrcsPulse_p0 +dwc_ddrphy_apb_wr(0x20125, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0SnoopPulse_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM0SnoopVal to 801 +dwc_ddrphy_apb_wr(0x2012e, 0x321); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0SnoopVal +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1RxEnPulse to 2062 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1RxValPulse to 2062 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1RdcsPulse to 2062 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1TxEnPulse to 2060 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1WrcsPulse to 2060 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1SnoopPulse to 2062 +dwc_ddrphy_apb_wr(0x20140, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1RxEnPulse_p0 +dwc_ddrphy_apb_wr(0x20141, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1RxValPulse_p0 +dwc_ddrphy_apb_wr(0x20144, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1RdcsPulse_p0 +dwc_ddrphy_apb_wr(0x20142, 0x80c); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1TxEnPulse_p0 +dwc_ddrphy_apb_wr(0x20143, 0x80c); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1WrcsPulse_p0 +dwc_ddrphy_apb_wr(0x20145, 0x80e); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1SnoopPulse_p0 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming D5ACSM1SnoopVal to 801 +dwc_ddrphy_apb_wr(0x2014e, 0x321); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1SnoopVal +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming GPR7(csrAlertRecovery) to 0x0 +dwc_ddrphy_apb_wr(0x90307, 0x0); // DWC_DDRPHYA_INITENG0_base0_Seq0BGPR7_p0 +// [phyinit_C_initPhyConfig] Programming TimingModeCntrl::Dly64Prec to 0x1 +dwc_ddrphy_apb_wr(0x20040, 0x1); // DWC_DDRPHYA_MASTER0_base0_TimingModeCntrl +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x1 for MASTER +dwc_ddrphy_apb_wr(0x20066, 0x1); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x1 for all DBYTEs +dwc_ddrphy_apb_wr(0x10066, 0x1); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x11066, 0x1); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x1 for all ANIBs +dwc_ddrphy_apb_wr(0x66, 0x1); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x1066, 0x1); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x2066, 0x1); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x3066, 0x1); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x4066, 0x1); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x5066, 0x1); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x6066, 0x1); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x7066, 0x1); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x8066, 0x1); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x9066, 0x1); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming AcClkDLLControl to 0x1080 +dwc_ddrphy_apb_wr(0x200ea, 0x1080); // DWC_DDRPHYA_MASTER0_base0_AcClkDLLControl_p0 +// [phyinit_C_initPhyConfig] Programming ArcPmuEccCtl to 0x1 +dwc_ddrphy_apb_wr(0xc0086, 0x1); // DWC_DDRPHYA_DRTUB0_ArcPmuEccCtl +// [phyinit_C_initPhyConfig] Programming VREGCtrl2 to 0x9820 for MASTER +dwc_ddrphy_apb_wr(0x2002b, 0x9820); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl2 +// [phyinit_C_initPhyConfig] Programming VREGCtrl2 to 0x8020 for all DBYTEs +dwc_ddrphy_apb_wr(0x1002b, 0x8020); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x1102b, 0x8020); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl2 +// [phyinit_C_initPhyConfig] Programming VREGCtrl2 to 0x8020 for all ANIBs +dwc_ddrphy_apb_wr(0x2b, 0x8020); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x102b, 0x8020); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x202b, 0x8020); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x302b, 0x8020); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x402b, 0x8020); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x502b, 0x8020); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x602b, 0x8020); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x702b, 0x8020); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x802b, 0x8020); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl2 +dwc_ddrphy_apb_wr(0x902b, 0x8020); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl2 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for MASTER +dwc_ddrphy_apb_wr(0x20066, 0x0); // DWC_DDRPHYA_MASTER0_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all DBYTEs +dwc_ddrphy_apb_wr(0x10066, 0x0); // DWC_DDRPHYA_DBYTE0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x11066, 0x0); // DWC_DDRPHYA_DBYTE1_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming VREGCtrl3::VshCtrlUpdate to 0x0 for all ANIBs +dwc_ddrphy_apb_wr(0x66, 0x0); // DWC_DDRPHYA_ANIB0_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x1066, 0x0); // DWC_DDRPHYA_ANIB1_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x2066, 0x0); // DWC_DDRPHYA_ANIB2_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x3066, 0x0); // DWC_DDRPHYA_ANIB3_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x4066, 0x0); // DWC_DDRPHYA_ANIB4_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x5066, 0x0); // DWC_DDRPHYA_ANIB5_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x6066, 0x0); // DWC_DDRPHYA_ANIB6_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x7066, 0x0); // DWC_DDRPHYA_ANIB7_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x8066, 0x0); // DWC_DDRPHYA_ANIB8_base0_VREGCtrl3 +dwc_ddrphy_apb_wr(0x9066, 0x0); // DWC_DDRPHYA_ANIB9_base0_VREGCtrl3 +// [phyinit_C_initPhyConfig] Programming VrefDAC0 to 0x3f for all DBYTEs and lanes +// [phyinit_C_initPhyConfig] Programming VrefDAC1 to 0x3f for all DBYTEs and lanes +// [phyinit_C_initPhyConfig] Programming VrefDAC2 to 0x3f for all DBYTEs and lanes +// [phyinit_C_initPhyConfig] Programming VrefDAC3 to 0x3f for all DBYTEs and lanes +dwc_ddrphy_apb_wr(0x10040, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r0_p0 +dwc_ddrphy_apb_wr(0x10030, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r0 +dwc_ddrphy_apb_wr(0x10050, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r0 +dwc_ddrphy_apb_wr(0x10060, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r0 +dwc_ddrphy_apb_wr(0x10140, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r1_p0 +dwc_ddrphy_apb_wr(0x10130, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r1 +dwc_ddrphy_apb_wr(0x10150, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r1 +dwc_ddrphy_apb_wr(0x10160, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r1 +dwc_ddrphy_apb_wr(0x10240, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r2_p0 +dwc_ddrphy_apb_wr(0x10230, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r2 +dwc_ddrphy_apb_wr(0x10250, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r2 +dwc_ddrphy_apb_wr(0x10260, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r2 +dwc_ddrphy_apb_wr(0x10340, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r3_p0 +dwc_ddrphy_apb_wr(0x10330, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r3 +dwc_ddrphy_apb_wr(0x10350, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r3 +dwc_ddrphy_apb_wr(0x10360, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r3 +dwc_ddrphy_apb_wr(0x10440, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r4_p0 +dwc_ddrphy_apb_wr(0x10430, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r4 +dwc_ddrphy_apb_wr(0x10450, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r4 +dwc_ddrphy_apb_wr(0x10460, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r4 +dwc_ddrphy_apb_wr(0x10540, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r5_p0 +dwc_ddrphy_apb_wr(0x10530, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r5 +dwc_ddrphy_apb_wr(0x10550, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r5 +dwc_ddrphy_apb_wr(0x10560, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r5 +dwc_ddrphy_apb_wr(0x10640, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r6_p0 +dwc_ddrphy_apb_wr(0x10630, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r6 +dwc_ddrphy_apb_wr(0x10650, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r6 +dwc_ddrphy_apb_wr(0x10660, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r6 +dwc_ddrphy_apb_wr(0x10740, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r7_p0 +dwc_ddrphy_apb_wr(0x10730, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r7 +dwc_ddrphy_apb_wr(0x10750, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r7 +dwc_ddrphy_apb_wr(0x10760, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r7 +dwc_ddrphy_apb_wr(0x10840, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC0_r8_p0 +dwc_ddrphy_apb_wr(0x10830, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC1_r8 +dwc_ddrphy_apb_wr(0x10850, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC2_r8 +dwc_ddrphy_apb_wr(0x10860, 0x3f); // DWC_DDRPHYA_DBYTE0_base0_VrefDAC3_r8 +dwc_ddrphy_apb_wr(0x11040, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r0_p0 +dwc_ddrphy_apb_wr(0x11030, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r0 +dwc_ddrphy_apb_wr(0x11050, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r0 +dwc_ddrphy_apb_wr(0x11060, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r0 +dwc_ddrphy_apb_wr(0x11140, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r1_p0 +dwc_ddrphy_apb_wr(0x11130, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r1 +dwc_ddrphy_apb_wr(0x11150, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r1 +dwc_ddrphy_apb_wr(0x11160, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r1 +dwc_ddrphy_apb_wr(0x11240, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r2_p0 +dwc_ddrphy_apb_wr(0x11230, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r2 +dwc_ddrphy_apb_wr(0x11250, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r2 +dwc_ddrphy_apb_wr(0x11260, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r2 +dwc_ddrphy_apb_wr(0x11340, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r3_p0 +dwc_ddrphy_apb_wr(0x11330, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r3 +dwc_ddrphy_apb_wr(0x11350, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r3 +dwc_ddrphy_apb_wr(0x11360, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r3 +dwc_ddrphy_apb_wr(0x11440, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r4_p0 +dwc_ddrphy_apb_wr(0x11430, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r4 +dwc_ddrphy_apb_wr(0x11450, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r4 +dwc_ddrphy_apb_wr(0x11460, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r4 +dwc_ddrphy_apb_wr(0x11540, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r5_p0 +dwc_ddrphy_apb_wr(0x11530, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r5 +dwc_ddrphy_apb_wr(0x11550, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r5 +dwc_ddrphy_apb_wr(0x11560, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r5 +dwc_ddrphy_apb_wr(0x11640, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r6_p0 +dwc_ddrphy_apb_wr(0x11630, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r6 +dwc_ddrphy_apb_wr(0x11650, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r6 +dwc_ddrphy_apb_wr(0x11660, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r6 +dwc_ddrphy_apb_wr(0x11740, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r7_p0 +dwc_ddrphy_apb_wr(0x11730, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r7 +dwc_ddrphy_apb_wr(0x11750, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r7 +dwc_ddrphy_apb_wr(0x11760, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r7 +dwc_ddrphy_apb_wr(0x11840, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC0_r8_p0 +dwc_ddrphy_apb_wr(0x11830, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC1_r8 +dwc_ddrphy_apb_wr(0x11850, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC2_r8 +dwc_ddrphy_apb_wr(0x11860, 0x3f); // DWC_DDRPHYA_DBYTE1_base0_VrefDAC3_r8 +//// [phyinit_C_initPhyConfig] Pstate=0, Memclk=1600MHz, Programming DfiFreqRatio_p0 to 0x1 +dwc_ddrphy_apb_wr(0x200fa, 0x1); // DWC_DDRPHYA_MASTER0_base0_DfiFreqRatio_p0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg0 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg1 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg2 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg3 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg0 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg1 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg2 (dbyte=0) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg3 (dbyte=0) to 0x0 +dwc_ddrphy_apb_wr(0x100aa, 0x0); // DWC_DDRPHYA_DBYTE0_base0_PptCtlStatic +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg0 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg1 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg2 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::DOCByteSelTg3 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg0 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg1 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg2 (dbyte=1) to 0x0 +//// [phyinit_C_initPhyConfig] Programming PptCtlStatic::NoX4onUpperNibbleTg3 (dbyte=1) to 0x0 +dwc_ddrphy_apb_wr(0x110aa, 0x0); // DWC_DDRPHYA_DBYTE1_base0_PptCtlStatic +//// [phyinit_C_initPhyConfig] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x0 +dwc_ddrphy_apb_wr(0x200a6, 0x0); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=0) to 0xc +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=4) to 0x8 +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=6) to 0xf +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=7) to 0xf +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=8) to 0xf +//// [phyinit_C_initPhyConfig] Programming AForceTriCont (anib=9) to 0xf +dwc_ddrphy_apb_wr(0x28, 0xc); // DWC_DDRPHYA_ANIB0_base0_AForceTriCont +dwc_ddrphy_apb_wr(0x4028, 0x8); // DWC_DDRPHYA_ANIB4_base0_AForceTriCont +dwc_ddrphy_apb_wr(0x6028, 0xf); // DWC_DDRPHYA_ANIB6_base0_AForceTriCont +dwc_ddrphy_apb_wr(0x7028, 0xf); // DWC_DDRPHYA_ANIB7_base0_AForceTriCont +dwc_ddrphy_apb_wr(0x8028, 0xf); // DWC_DDRPHYA_ANIB8_base0_AForceTriCont +dwc_ddrphy_apb_wr(0x9028, 0xf); // DWC_DDRPHYA_ANIB9_base0_AForceTriCont +//// [phyinit_C_initPhyConfig] End of dwc_ddrphy_phyinit_C_initPhyConfig() +// +// +////############################################################## +//// +//// dwc_ddrphy_phyinit_userCustom_customPreTrain is a user-editable function. +//// +//// The purpose of dwc_ddrphy_phyinit_userCustom_customPreTrain() is to override any +//// any message block fields calculated by Phyinit in dwc_ddrphy_phyinit_calcMb() or to +//// override any CSR values programmed by Phyinit in dwc_ddrphy_phyinit_C_initPhyConfig(). +//// This function is executed before training and thus any override here might affect +//// training result. +//// +//// IMPORTANT: in this function, user shall not override any values in userInputBasic and +//// userInputAdvanced data structures. Use dwc_ddrphy_phyinit_userCustom_overrideUserInput() +//// to modify values in those data structures. +//// +////############################################################## +// +//// [phyinit_userCustom_customPreTrain] Start of dwc_ddrphy_phyinit_userCustom_customPreTrain() +//// [phyinit_userCustom_customPreTrain] End of dwc_ddrphy_phyinit_userCustom_customPreTrain() +//// [dwc_ddrphy_phyinit_D_loadIMEM, 1D] Start of dwc_ddrphy_phyinit_D_loadIMEM (Train2D=0) +// +// +////############################################################## +//// +//// (D) Load the 1D IMEM image +//// +//// This function loads the training firmware IMEM image into the SRAM. +//// See PhyInit App Note for detailed description and function usage +//// +////############################################################## +// +// +//// [dwc_ddrphy_phyinit_D_loadIMEM, 1D] Programming MemResetL to 0x2 +dwc_ddrphy_apb_wr(0x20060, 0x2); // DWC_DDRPHYA_MASTER0_base0_MemResetL +// [dwc_ddrphy_phyinit_storeIncvFile] Reading input file: /home/jerry_ku/Project/Development/ast2700dev/ddr45phy_tsmc12/coreConsultant/config3_3.50a/2022-12-12-17-01-49/firmware/Latest/training/ddr5/ddr5_pmu_train_imem.incv + +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_WriteOutMem] STARTING 32bit write. offset 0x50000 size 0x8000 +dwc_ddrphy_phyinit_userCustom_D_loadIMEM(sdrammc, 0); + +//// [dwc_ddrphy_phyinit_WriteOutMem] DONE. Index 0x8000 +//// 2. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +//// This allows the firmware unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_D_loadIMEM, 1D] End of dwc_ddrphy_phyinit_D_loadIMEM() +// +// +////############################################################## +//// +//// 4.3.5(E) Set the PHY input clocks to the desired frequency for pstate 0 +//// +//// Set the PHY input Dfi Clk to the desired operating frequency associated with the given Pstate. Before proceeding to the next step, +//// the clock should be stable at the new frequency. For more information on clocking requirements, see "Clocks" on page <XXX>. +//// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_E_setDfiClk(sdrammc); + +// +//// [dwc_ddrphy_phyinit_userCustom_E_setDfiClk] End of dwc_ddrphy_phyinit_userCustom_E_setDfiClk() +//// [phyinit_F_loadDMEM, 1D] Start of dwc_ddrphy_phyinit_F_loadDMEM (pstate=0, Train2D=0) +// +// +////############################################################## +//// +//// 4.3.5(F) Load the 1D DMEM image and write the 1D Message Block parameters for the training firmware +//// +//// The procedure is as follows: +//// +////############################################################## +// +// +// +//// 1. Load the firmware DMEM segment to initialize the data structures. +// +//// 2. Write the Firmware Message Block with the required contents detailing the training parameters. +// +// [dwc_ddrphy_phyinit_storeIncvFile] Reading input file: /home/jerry_ku/Project/Development/ast2700dev/ddr45phy_tsmc12/coreConsultant/config3_3.50a/2022-12-12-17-01-49/firmware/Latest/training/ddr5/ddr5_pmu_train_dmem.incv + +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [dwc_ddrphy_phyinit_WriteOutMem] STARTING 32bit write. offset 0x58000 size 0x8000 + +dwc_ddrphy_phyinit_userCustom_F_loadDMEM(sdrammc, 0, 0); + +dwc_ddrphy_apb_wr_32b(0x58000, 0x100); +dwc_ddrphy_apb_wr_32b(0x58002, 0xc800000); +dwc_ddrphy_apb_wr_32b(0x58004, 0x0); +dwc_ddrphy_apb_wr_32b(0x58006, 0x40); +if (IS_ENABLED(CONFIG_ASPEED_PHY_TRAINING_MESSAGE)) + dwc_ddrphy_apb_wr_32b(0x58008, 0x04827f); +else + dwc_ddrphy_apb_wr_32b(0x58008, 0xc8827f); +// Redmine 1392: Set X16Present=1 by Synopsys's comment +// 0x5800b[7:0]=DFIMRLMargin, 0x5800b[15:8]=X16Present +dwc_ddrphy_apb_wr_32b(0x5800a, 0x01020000); +// Redmine 1456: Skip_CA13_during_CAtraining during DDR5 +dwc_ddrphy_apb_wr_32b(0x5800c, 0x10000001); +// Redmine 1392: To speed up data collection, set the voltage and delay step size in Rx2D_TrainOpt and Tx2D_TrainOpt to its maximum value. +// uint8_t RX2D_TrainOpt; // Byte offset 0x1d, CSR Addr 0x5800e, Direction=In +// uint8_t TX2D_TrainOpt; // Byte offset 0x1e, CSR Addr 0x5800f, Direction=In +//dwc_ddrphy_apb_wr_32b(0x5800e, 0x001e1e00); +//#elif defined(TRAIN_1D) +//printf("- <DWC_DDRPHY TRAIN>: Enable RdDQS1D, WrDQ1D for 1D training"); +// #ifdef DWC_DEBUG +//printf("- <DWC_DDRPHY TRAIN>: Debug level = 0x05: Detailed debug messages (e.g. Eye delays)"); +//dwc_ddrphy_apb_wr_32b(0x58008, 0x05821f); +// #else +//printf("- <DWC_DDRPHY TRAIN>: Debug level = 0xC8: Stage completion"); +//dwc_ddrphy_apb_wr_32b(0x58008, 0xc8821f); +// #endif +//// Redmine 1392: Set X16Present=1 by Synopsys's comment +//dwc_ddrphy_apb_wr_32b(0x5800a, 0x01020000); +//// Redmine 1456: Skip_CA13_during_CAtraining during DDR5 +//dwc_ddrphy_apb_wr_32b(0x5800c, 0x18000001); +//// Redmine 1392: To speed up data collection, set the voltage and delay step size in Rx2D_TrainOpt and Tx2D_TrainOpt to its maximum value. +//// uint8_t RX2D_TrainOpt; // Byte offset 0x1d, CSR Addr 0x5800e, Direction=In +//// uint8_t TX2D_TrainOpt; // Byte offset 0x1e, CSR Addr 0x5800f, Direction=In +//dwc_ddrphy_apb_wr_32b(0x5800e, 0x001e1e00); +//#else +//dwc_ddrphy_apb_wr_32b(0x58008, 0xc8837f); +//dwc_ddrphy_apb_wr_32b(0x5800a, 0x20000); +//dwc_ddrphy_apb_wr_32b(0x5800c, 0x8000001); +//dwc_ddrphy_apb_wr_32b(0x5800e, 0x0); +//#endif +dwc_ddrphy_apb_wr_32b(0x58010, 0x0); +dwc_ddrphy_apb_wr_32b(0x58012, 0x110); +dwc_ddrphy_apb_wr_32b(0x58014, 0x0); +dwc_ddrphy_apb_wr_32b(0x58016, 0x0); +dwc_ddrphy_apb_wr_32b(0x58018, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5801e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58020, 0x0); +dwc_ddrphy_apb_wr_32b(0x58022, 0x0); +dwc_ddrphy_apb_wr_32b(0x58024, 0x0); +dwc_ddrphy_apb_wr_32b(0x58026, 0x0); +dwc_ddrphy_apb_wr_32b(0x58028, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5802e, 0x84080000); //MR0 0x5802f=0x8(CL=26), MR2 0x5802f=0x84(OP[2]=1 2N mode, OP[7]=enable internal WL training) +dwc_ddrphy_apb_wr_32b(0x58030, 0x200000); //MR5 0x58031=0x20(OP[5]=1 DM enable, OP[2:1]=0 pu 34ohm, 1=40ohm, 2=48ohm, OP7:6]=pd) +dwc_ddrphy_apb_wr_32b(0x58032, 0x2d000800); //MR8 0x58032=0x08(OP[4:3]=1 Write preamble 2 tCK) MR10 0x58033=0x2d(Vref 75%) +dwc_ddrphy_apb_wr_32b(0x58034, 0xd62d); +dwc_ddrphy_apb_wr_32b(0x58036, 0x04240003); //MR32 0x58037=0x24(OP[2:0]=4 CK ODT 80, OP[5:3]=4 CS ODT 80ohm), MR33 0x58037=0x4(OP[2:0]=4 CA ODTt 80ohm) +dwc_ddrphy_apb_wr_32b(0x58038, 0x2c000499); //MR34 0x58038(OP[5:3]=3 RTT_WR 80) +dwc_ddrphy_apb_wr_32b(0x5803a, 0x2c2c); +dwc_ddrphy_apb_wr_32b(0x5803c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5803e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58040, 0x0); +dwc_ddrphy_apb_wr_32b(0x58042, 0x408); +dwc_ddrphy_apb_wr_32b(0x58044, 0x8000020); +dwc_ddrphy_apb_wr_32b(0x58046, 0xd62d2d00); +dwc_ddrphy_apb_wr_32b(0x58048, 0x30000); +dwc_ddrphy_apb_wr_32b(0x5804a, 0x4110000); +dwc_ddrphy_apb_wr_32b(0x5804c, 0x2c2c2c00); +dwc_ddrphy_apb_wr_32b(0x5804e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58050, 0x0); +dwc_ddrphy_apb_wr_32b(0x58052, 0x0); +dwc_ddrphy_apb_wr_32b(0x58054, 0x4080000); +dwc_ddrphy_apb_wr_32b(0x58056, 0x200000); +dwc_ddrphy_apb_wr_32b(0x58058, 0x2d000800); +dwc_ddrphy_apb_wr_32b(0x5805a, 0xd62d); +dwc_ddrphy_apb_wr_32b(0x5805c, 0x3); +dwc_ddrphy_apb_wr_32b(0x5805e, 0x2c000411); +dwc_ddrphy_apb_wr_32b(0x58060, 0x2c2c); +dwc_ddrphy_apb_wr_32b(0x58062, 0x0); +dwc_ddrphy_apb_wr_32b(0x58064, 0x0); +dwc_ddrphy_apb_wr_32b(0x58066, 0x0); +dwc_ddrphy_apb_wr_32b(0x58068, 0x408); +dwc_ddrphy_apb_wr_32b(0x5806a, 0x8000020); +dwc_ddrphy_apb_wr_32b(0x5806c, 0xd62d2d00); +dwc_ddrphy_apb_wr_32b(0x5806e, 0x30000); +dwc_ddrphy_apb_wr_32b(0x58070, 0x4110000); +dwc_ddrphy_apb_wr_32b(0x58072, 0x2c2c2c00); +dwc_ddrphy_apb_wr_32b(0x58074, 0x0); +dwc_ddrphy_apb_wr_32b(0x58076, 0x0); +dwc_ddrphy_apb_wr_32b(0x58078, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5807e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58080, 0x0); +dwc_ddrphy_apb_wr_32b(0x58082, 0x0); +dwc_ddrphy_apb_wr_32b(0x58084, 0x0); +dwc_ddrphy_apb_wr_32b(0x58086, 0x0); +dwc_ddrphy_apb_wr_32b(0x58088, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5808e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58090, 0x0); +dwc_ddrphy_apb_wr_32b(0x58092, 0x0); +dwc_ddrphy_apb_wr_32b(0x58094, 0x0); +dwc_ddrphy_apb_wr_32b(0x58096, 0x0); +dwc_ddrphy_apb_wr_32b(0x58098, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5809e, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580a4, 0x4080000); +dwc_ddrphy_apb_wr_32b(0x580a6, 0x200000); +dwc_ddrphy_apb_wr_32b(0x580a8, 0x2d000800); +dwc_ddrphy_apb_wr_32b(0x580aa, 0xd62d); +dwc_ddrphy_apb_wr_32b(0x580ac, 0x3); +dwc_ddrphy_apb_wr_32b(0x580ae, 0x2c000411); +dwc_ddrphy_apb_wr_32b(0x580b0, 0x2c2c); +dwc_ddrphy_apb_wr_32b(0x580b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580b8, 0x408); +dwc_ddrphy_apb_wr_32b(0x580ba, 0x8000020); +dwc_ddrphy_apb_wr_32b(0x580bc, 0xd62d2d00); +dwc_ddrphy_apb_wr_32b(0x580be, 0x30000); +dwc_ddrphy_apb_wr_32b(0x580c0, 0x4110000); +dwc_ddrphy_apb_wr_32b(0x580c2, 0x2c2c2c00); +dwc_ddrphy_apb_wr_32b(0x580c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ca, 0x4080000); +dwc_ddrphy_apb_wr_32b(0x580cc, 0x200000); +dwc_ddrphy_apb_wr_32b(0x580ce, 0x2d000800); +dwc_ddrphy_apb_wr_32b(0x580d0, 0xd62d); +dwc_ddrphy_apb_wr_32b(0x580d2, 0x3); +dwc_ddrphy_apb_wr_32b(0x580d4, 0x2c000411); +dwc_ddrphy_apb_wr_32b(0x580d6, 0x2c2c); +dwc_ddrphy_apb_wr_32b(0x580d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580da, 0x0); +dwc_ddrphy_apb_wr_32b(0x580dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580de, 0x408); +dwc_ddrphy_apb_wr_32b(0x580e0, 0x8000020); +dwc_ddrphy_apb_wr_32b(0x580e2, 0xd62d2d00); +dwc_ddrphy_apb_wr_32b(0x580e4, 0x30000); +dwc_ddrphy_apb_wr_32b(0x580e6, 0x4110000); +dwc_ddrphy_apb_wr_32b(0x580e8, 0x2c2c2c00); +dwc_ddrphy_apb_wr_32b(0x580ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x580ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x580f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x580fe, 0xa00060); // WL_ADJ_START, WL_ADJ_END +dwc_ddrphy_apb_wr_32b(0x58100, 0x1); +dwc_ddrphy_apb_wr_32b(0x58102, 0x0); +dwc_ddrphy_apb_wr_32b(0x58104, 0x0); +dwc_ddrphy_apb_wr_32b(0x58106, 0x0); +dwc_ddrphy_apb_wr_32b(0x58108, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5810e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58110, 0x0); +dwc_ddrphy_apb_wr_32b(0x58112, 0x0); +dwc_ddrphy_apb_wr_32b(0x58114, 0x0); +dwc_ddrphy_apb_wr_32b(0x58116, 0x0); +dwc_ddrphy_apb_wr_32b(0x58118, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5811e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58120, 0x0); +dwc_ddrphy_apb_wr_32b(0x58122, 0x0); +dwc_ddrphy_apb_wr_32b(0x58124, 0x0); +dwc_ddrphy_apb_wr_32b(0x58126, 0x0); +dwc_ddrphy_apb_wr_32b(0x58128, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5812e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58130, 0x0); +dwc_ddrphy_apb_wr_32b(0x58132, 0x0); +dwc_ddrphy_apb_wr_32b(0x58134, 0x0); +dwc_ddrphy_apb_wr_32b(0x58136, 0x0); +dwc_ddrphy_apb_wr_32b(0x58138, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5813e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58140, 0x0); +dwc_ddrphy_apb_wr_32b(0x58142, 0x0); +dwc_ddrphy_apb_wr_32b(0x58144, 0x0); +dwc_ddrphy_apb_wr_32b(0x58146, 0x0); +dwc_ddrphy_apb_wr_32b(0x58148, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5814e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58150, 0x0); +dwc_ddrphy_apb_wr_32b(0x58152, 0x0); +dwc_ddrphy_apb_wr_32b(0x58154, 0x0); +dwc_ddrphy_apb_wr_32b(0x58156, 0x0); +dwc_ddrphy_apb_wr_32b(0x58158, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5815e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58160, 0x0); +dwc_ddrphy_apb_wr_32b(0x58162, 0x0); +dwc_ddrphy_apb_wr_32b(0x58164, 0x0); +dwc_ddrphy_apb_wr_32b(0x58166, 0x0); +dwc_ddrphy_apb_wr_32b(0x58168, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5816e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58170, 0x0); +dwc_ddrphy_apb_wr_32b(0x58172, 0x0); +dwc_ddrphy_apb_wr_32b(0x58174, 0x0); +dwc_ddrphy_apb_wr_32b(0x58176, 0x0); +dwc_ddrphy_apb_wr_32b(0x58178, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5817e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58180, 0x1); +dwc_ddrphy_apb_wr_32b(0x58182, 0x0); +dwc_ddrphy_apb_wr_32b(0x58184, 0x0); +dwc_ddrphy_apb_wr_32b(0x58186, 0x0); +dwc_ddrphy_apb_wr_32b(0x58188, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5818e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58190, 0x0); +dwc_ddrphy_apb_wr_32b(0x58192, 0x0); +dwc_ddrphy_apb_wr_32b(0x58194, 0x0); +dwc_ddrphy_apb_wr_32b(0x58196, 0x0); +dwc_ddrphy_apb_wr_32b(0x58198, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5819e, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x581bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581be, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x581cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581da, 0x0); +dwc_ddrphy_apb_wr_32b(0x581dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581de, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x581ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x581f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x581fe, 0x0); +dwc_ddrphy_apb_wr_32b(0x58200, 0x1); +dwc_ddrphy_apb_wr_32b(0x58202, 0x0); +dwc_ddrphy_apb_wr_32b(0x58204, 0x0); +dwc_ddrphy_apb_wr_32b(0x58206, 0x0); +dwc_ddrphy_apb_wr_32b(0x58208, 0x0); +dwc_ddrphy_apb_wr_32b(0x5820a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5820c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5820e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58210, 0x0); +dwc_ddrphy_apb_wr_32b(0x58212, 0x0); +dwc_ddrphy_apb_wr_32b(0x58214, 0x0); +dwc_ddrphy_apb_wr_32b(0x58216, 0x0); +dwc_ddrphy_apb_wr_32b(0x58218, 0x0); +dwc_ddrphy_apb_wr_32b(0x5821a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5821c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5821e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58220, 0x0); +dwc_ddrphy_apb_wr_32b(0x58222, 0x0); +dwc_ddrphy_apb_wr_32b(0x58224, 0x0); +dwc_ddrphy_apb_wr_32b(0x58226, 0x0); +dwc_ddrphy_apb_wr_32b(0x58228, 0x0); +dwc_ddrphy_apb_wr_32b(0x5822a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5822c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5822e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58230, 0x0); +dwc_ddrphy_apb_wr_32b(0x58232, 0x0); +dwc_ddrphy_apb_wr_32b(0x58234, 0x0); +dwc_ddrphy_apb_wr_32b(0x58236, 0x0); +dwc_ddrphy_apb_wr_32b(0x58238, 0x0); +dwc_ddrphy_apb_wr_32b(0x5823a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5823c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5823e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58240, 0x0); +dwc_ddrphy_apb_wr_32b(0x58242, 0x0); +dwc_ddrphy_apb_wr_32b(0x58244, 0x0); +dwc_ddrphy_apb_wr_32b(0x58246, 0x0); +dwc_ddrphy_apb_wr_32b(0x58248, 0x0); +dwc_ddrphy_apb_wr_32b(0x5824a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5824c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5824e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58250, 0x0); +dwc_ddrphy_apb_wr_32b(0x58252, 0x0); +dwc_ddrphy_apb_wr_32b(0x58254, 0x0); +dwc_ddrphy_apb_wr_32b(0x58256, 0x0); +dwc_ddrphy_apb_wr_32b(0x58258, 0x0); +dwc_ddrphy_apb_wr_32b(0x5825a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5825c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5825e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58260, 0x0); +dwc_ddrphy_apb_wr_32b(0x58262, 0x0); +dwc_ddrphy_apb_wr_32b(0x58264, 0x0); +dwc_ddrphy_apb_wr_32b(0x58266, 0x0); +dwc_ddrphy_apb_wr_32b(0x58268, 0x0); +dwc_ddrphy_apb_wr_32b(0x5826a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5826c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5826e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58270, 0x0); +dwc_ddrphy_apb_wr_32b(0x58272, 0x0); +dwc_ddrphy_apb_wr_32b(0x58274, 0x0); +dwc_ddrphy_apb_wr_32b(0x58276, 0x0); +dwc_ddrphy_apb_wr_32b(0x58278, 0x0); +dwc_ddrphy_apb_wr_32b(0x5827a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5827c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5827e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58280, 0x1); +dwc_ddrphy_apb_wr_32b(0x58282, 0x0); +dwc_ddrphy_apb_wr_32b(0x58284, 0x0); +dwc_ddrphy_apb_wr_32b(0x58286, 0x0); +dwc_ddrphy_apb_wr_32b(0x58288, 0x0); +dwc_ddrphy_apb_wr_32b(0x5828a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5828c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5828e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58290, 0x0); +dwc_ddrphy_apb_wr_32b(0x58292, 0x0); +dwc_ddrphy_apb_wr_32b(0x58294, 0x0); +dwc_ddrphy_apb_wr_32b(0x58296, 0x0); +dwc_ddrphy_apb_wr_32b(0x58298, 0x0); +dwc_ddrphy_apb_wr_32b(0x5829a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5829c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5829e, 0x0); +dwc_ddrphy_apb_wr_32b(0x582a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x582a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x582a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x582a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x582a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x582aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x582b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x582b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x582b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x582b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x582b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x582bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x582be, 0x0); +dwc_ddrphy_apb_wr_32b(0x582c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x582c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x582c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x582c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x582c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x582cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x582d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x582d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x582d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x582d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x582d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x582da, 0x0); +dwc_ddrphy_apb_wr_32b(0x582dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x582de, 0x0); +dwc_ddrphy_apb_wr_32b(0x582e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x582e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x582e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x582e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x582e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x582ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x582f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x582f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x582f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x582f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x582f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x582fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x582fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x582fe, 0x0); +dwc_ddrphy_apb_wr_32b(0x58300, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58302, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58304, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58306, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58308, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x5830a, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x5830c, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x5830e, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58310, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58312, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58314, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58316, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58318, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x5831a, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x5831c, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x5831e, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58320, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58322, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58324, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58326, 0x17171717); +dwc_ddrphy_apb_wr_32b(0x58328, 0x0); +dwc_ddrphy_apb_wr_32b(0x5832a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5832c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5832e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58330, 0x0); +dwc_ddrphy_apb_wr_32b(0x58332, 0x0); +dwc_ddrphy_apb_wr_32b(0x58334, 0x0); +dwc_ddrphy_apb_wr_32b(0x58336, 0x0); +dwc_ddrphy_apb_wr_32b(0x58338, 0x0); +dwc_ddrphy_apb_wr_32b(0x5833a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5833c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5833e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58340, 0x0); +dwc_ddrphy_apb_wr_32b(0x58342, 0x0); +dwc_ddrphy_apb_wr_32b(0x58344, 0x0); +dwc_ddrphy_apb_wr_32b(0x58346, 0x0); +dwc_ddrphy_apb_wr_32b(0x58348, 0x0); +dwc_ddrphy_apb_wr_32b(0x5834a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5834c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5834e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58350, 0x0); +dwc_ddrphy_apb_wr_32b(0x58352, 0x0); +dwc_ddrphy_apb_wr_32b(0x58354, 0x0); +dwc_ddrphy_apb_wr_32b(0x58356, 0x0); +dwc_ddrphy_apb_wr_32b(0x58358, 0x0); +dwc_ddrphy_apb_wr_32b(0x5835a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5835c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5835e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58360, 0x0); +dwc_ddrphy_apb_wr_32b(0x58362, 0x0); +dwc_ddrphy_apb_wr_32b(0x58364, 0x0); +dwc_ddrphy_apb_wr_32b(0x58366, 0x0); +dwc_ddrphy_apb_wr_32b(0x58368, 0x0); +dwc_ddrphy_apb_wr_32b(0x5836a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5836c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5836e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58370, 0x0); +dwc_ddrphy_apb_wr_32b(0x58372, 0x0); +dwc_ddrphy_apb_wr_32b(0x58374, 0x0); +dwc_ddrphy_apb_wr_32b(0x58376, 0x0); +dwc_ddrphy_apb_wr_32b(0x58378, 0x0); +dwc_ddrphy_apb_wr_32b(0x5837a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5837c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5837e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58380, 0x0); +dwc_ddrphy_apb_wr_32b(0x58382, 0x0); +dwc_ddrphy_apb_wr_32b(0x58384, 0x0); +dwc_ddrphy_apb_wr_32b(0x58386, 0x0); +dwc_ddrphy_apb_wr_32b(0x58388, 0x0); +dwc_ddrphy_apb_wr_32b(0x5838a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5838c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5838e, 0x0); +dwc_ddrphy_apb_wr_32b(0x58390, 0x0); +dwc_ddrphy_apb_wr_32b(0x58392, 0x0); +dwc_ddrphy_apb_wr_32b(0x58394, 0x0); +dwc_ddrphy_apb_wr_32b(0x58396, 0x0); +dwc_ddrphy_apb_wr_32b(0x58398, 0x0); +dwc_ddrphy_apb_wr_32b(0x5839a, 0x0); +dwc_ddrphy_apb_wr_32b(0x5839c, 0x0); +dwc_ddrphy_apb_wr_32b(0x5839e, 0x0); +dwc_ddrphy_apb_wr_32b(0x583a0, 0x0); +dwc_ddrphy_apb_wr_32b(0x583a2, 0x0); +dwc_ddrphy_apb_wr_32b(0x583a4, 0x0); +dwc_ddrphy_apb_wr_32b(0x583a6, 0x0); +dwc_ddrphy_apb_wr_32b(0x583a8, 0x0); +dwc_ddrphy_apb_wr_32b(0x583aa, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ac, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ae, 0x0); +dwc_ddrphy_apb_wr_32b(0x583b0, 0x0); +dwc_ddrphy_apb_wr_32b(0x583b2, 0x0); +dwc_ddrphy_apb_wr_32b(0x583b4, 0x0); +dwc_ddrphy_apb_wr_32b(0x583b6, 0x0); +dwc_ddrphy_apb_wr_32b(0x583b8, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ba, 0x0); +dwc_ddrphy_apb_wr_32b(0x583bc, 0x0); +dwc_ddrphy_apb_wr_32b(0x583be, 0x0); +dwc_ddrphy_apb_wr_32b(0x583c0, 0x0); +dwc_ddrphy_apb_wr_32b(0x583c2, 0x0); +dwc_ddrphy_apb_wr_32b(0x583c4, 0x0); +dwc_ddrphy_apb_wr_32b(0x583c6, 0x0); +dwc_ddrphy_apb_wr_32b(0x583c8, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ca, 0x0); +dwc_ddrphy_apb_wr_32b(0x583cc, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ce, 0x0); +dwc_ddrphy_apb_wr_32b(0x583d0, 0x0); +dwc_ddrphy_apb_wr_32b(0x583d2, 0x0); +dwc_ddrphy_apb_wr_32b(0x583d4, 0x0); +dwc_ddrphy_apb_wr_32b(0x583d6, 0x0); +dwc_ddrphy_apb_wr_32b(0x583d8, 0x0); +dwc_ddrphy_apb_wr_32b(0x583da, 0x0); +dwc_ddrphy_apb_wr_32b(0x583dc, 0x0); +dwc_ddrphy_apb_wr_32b(0x583de, 0x0); +dwc_ddrphy_apb_wr_32b(0x583e0, 0x0); +dwc_ddrphy_apb_wr_32b(0x583e2, 0x0); +dwc_ddrphy_apb_wr_32b(0x583e4, 0x0); +dwc_ddrphy_apb_wr_32b(0x583e6, 0x0); +dwc_ddrphy_apb_wr_32b(0x583e8, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ea, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ec, 0x0); +dwc_ddrphy_apb_wr_32b(0x583ee, 0x0); +dwc_ddrphy_apb_wr_32b(0x583f0, 0x0); +dwc_ddrphy_apb_wr_32b(0x583f2, 0x0); +dwc_ddrphy_apb_wr_32b(0x583f4, 0x0); +dwc_ddrphy_apb_wr_32b(0x583f6, 0x0); +dwc_ddrphy_apb_wr_32b(0x583f8, 0x0); +dwc_ddrphy_apb_wr_32b(0x583fa, 0x0); +dwc_ddrphy_apb_wr_32b(0x583fc, 0x0); +dwc_ddrphy_apb_wr_32b(0x583fe, 0x0); +//// [dwc_ddrphy_phyinit_WriteOutMem] DONE. Index 0x8000 +//// 2. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +//// This allows the firmware unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_F_loadDMEM, 1D] End of dwc_ddrphy_phyinit_F_loadDMEM() +// +// +////############################################################## +//// +//// 4.3.7(G) Execute the Training Firmware +//// +//// The training firmware is executed with the following procedure: +//// +////############################################################## +// +// +//// 1. Reset the firmware microcontroller by writing the MicroReset CSR to set the StallToMicro and +//// ResetToMicro fields to 1 (all other fields should be zero). +//// Then rewrite the CSR so that only the StallToMicro remains set (all other fields should be zero). +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +dwc_ddrphy_apb_wr(0xd0099, 0x9); // DWC_DDRPHYA_APBONLY0_MicroReset +dwc_ddrphy_apb_wr(0xd0099, 0x1); // DWC_DDRPHYA_APBONLY0_MicroReset +// +//// 2. Begin execution of the training firmware by setting the MicroReset CSR to 4'b0000. +dwc_ddrphy_apb_wr(0xd0099, 0x0); // DWC_DDRPHYA_APBONLY0_MicroReset +// +//// 3. Wait for the training firmware to complete by following the procedure in "uCtrl Initialization and Mailbox Messaging" +//// 4.3.7 3. Wait for the training firmware to complete. Implement timeout function or follow the procedure in "3.4 Running the firmware" of the Training Firmware Application Note to poll the Mailbox message. +dwc_ddrphy_phyinit_userCustom_G_waitFwDone(sdrammc); + +//// [dwc_ddrphy_phyinit_userCustom_G_waitFwDone] End of dwc_ddrphy_phyinit_userCustom_G_waitFwDone() +//// 4. Halt the microcontroller." +dwc_ddrphy_apb_wr(0xd0099, 0x1); // DWC_DDRPHYA_APBONLY0_MicroReset +dwc_ddrphy_apb_wr(0x20089, 0x0); // DWC_DDRPHYA_MASTER0_base0_CalZap +//// [dwc_ddrphy_phyinit_G_execFW] End of dwc_ddrphy_phyinit_G_execFW() +// +// +////############################################################## +//// +//// 4.3.8(H) Read the Message Block results +//// +//// The procedure is as follows: +//// +////############################################################## +// +// +//// 1. Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +// +//2. Read the Firmware Message Block to obtain the results from the training. +//This can be accomplished by issuing APB read commands to the DMEM addresses. +//Example: +//if (Train2D) +//{ +// _read_2d_message_block_outputs_ +//} +//else +//{ +// _read_1d_message_block_outputs_ +//} +//This can be accomplished by issuing APB read commands to the DMEM addresses. +dwc_ddrphy_phyinit_userCustom_H_readMsgBlock(sdrammc, 0); + +//[dwc_ddrphy_phyinit_userCustom_H_readMsgBlock] End of dwc_ddrphy_phyinit_userCustom_H_readMsgBlock() +//// 3. Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// 4. If training is required at another frequency, repeat the operations starting at step (E). +//// [dwc_ddrphy_phyinit_H_readMsgBlock] End of dwc_ddrphy_phyinit_H_readMsgBlock() +//// [initRuntimeConfigEnableBits] Start of initRuntimeConfigEnableBits() +//// [initRuntimeConfigEnableBits] enableBits[0] = 0x00000009 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A0 = 0x00000000, rtt_required = 0x00000001 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A1 = 0x00000000, rtt_required = 0x00000002 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A2 = 0x00000000, rtt_required = 0x00000004 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_A3 = 0x00000000, rtt_required = 0x00000008 +//// [initRuntimeConfigEnableBits] enableBits[1] = 0x00000000 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B0 = 0x00000000, rtt_required = 0x00000001 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B1 = 0x00000000, rtt_required = 0x00000002 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B2 = 0x00000000, rtt_required = 0x00000004 +//// [initRuntimeConfigEnableBits] WR_RD_RTT_PARK_B3 = 0x00000000, rtt_required = 0x00000008 +//// [initRuntimeConfigEnableBits] enableBits[2] = 0x00000000 +//// [initRuntimeConfigEnableBits] End of initRuntimeConfigEnableBits() +//// [phyinit_I_loadPIEImage] Start of dwc_ddrphy_phyinit_I_loadPIEImage() +// +// +////############################################################## +//// +//// 4.3.9(I) Load PHY Init Engine Image +//// +//// Load the PHY Initialization Engine memory with the provided initialization sequence. +//// +////############################################################## +// +// +//// Enable access to the internal CSRs by setting the MicroContMuxSel CSR to 0. +//// This allows the memory controller unrestricted access to the configuration CSRs. +dwc_ddrphy_apb_wr(0xd0000, 0x0); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_I_loadPIEImage] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x1 +dwc_ddrphy_apb_wr(0x200a6, 0x2); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +//// [phyinit_I_loadPIEImage] Programming PIE Production Code +//// [phyinit_LoadPIECodeSections] Start of dwc_ddrphy_phyinit_LoadPIECodeSections() +//// [phyinit_LoadPIECodeSections] Moving start address from 0 to 90000 +dwc_ddrphy_apb_wr(0x90000, 0x10); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b0s0 +dwc_ddrphy_apb_wr(0x90001, 0x400); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b0s1 +dwc_ddrphy_apb_wr(0x90002, 0x10e); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b0s2 +dwc_ddrphy_apb_wr(0x90003, 0x0); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b1s0 +dwc_ddrphy_apb_wr(0x90004, 0x0); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b1s1 +dwc_ddrphy_apb_wr(0x90005, 0x8); // DWC_DDRPHYA_INITENG0_base0_PreSequenceReg0b1s2 +//// [phyinit_LoadPIECodeSections] Moving start address from 90006 to 41000 +dwc_ddrphy_apb_wr(0x41000, 0x3fff); +dwc_ddrphy_apb_wr(0x41001, 0xff00); +dwc_ddrphy_apb_wr(0x41002, 0x3f); +dwc_ddrphy_apb_wr(0x41003, 0x2c1); +dwc_ddrphy_apb_wr(0x41004, 0x3fff); +dwc_ddrphy_apb_wr(0x41005, 0xff00); +dwc_ddrphy_apb_wr(0x41006, 0x3f); +dwc_ddrphy_apb_wr(0x41007, 0xa01); +dwc_ddrphy_apb_wr(0x41008, 0x3fff); +dwc_ddrphy_apb_wr(0x41009, 0xff00); +dwc_ddrphy_apb_wr(0x4100a, 0x3f); +dwc_ddrphy_apb_wr(0x4100b, 0x1); +dwc_ddrphy_apb_wr(0x4100c, 0xffff); +dwc_ddrphy_apb_wr(0x4100d, 0xff03); +dwc_ddrphy_apb_wr(0x4100e, 0x3ff); +dwc_ddrphy_apb_wr(0x4100f, 0x0); +dwc_ddrphy_apb_wr(0x41010, 0xffff); +dwc_ddrphy_apb_wr(0x41011, 0xff03); +dwc_ddrphy_apb_wr(0x41012, 0x3ff); +dwc_ddrphy_apb_wr(0x41013, 0x1c1); +dwc_ddrphy_apb_wr(0x41014, 0xffff); +dwc_ddrphy_apb_wr(0x41015, 0xff03); +dwc_ddrphy_apb_wr(0x41016, 0x3ff); +dwc_ddrphy_apb_wr(0x41017, 0x1); +dwc_ddrphy_apb_wr(0x41018, 0xffff); +dwc_ddrphy_apb_wr(0x41019, 0xff03); +dwc_ddrphy_apb_wr(0x4101a, 0x3ff); +dwc_ddrphy_apb_wr(0x4101b, 0x2c1); +dwc_ddrphy_apb_wr(0x4101c, 0xffff); +dwc_ddrphy_apb_wr(0x4101d, 0xff03); +dwc_ddrphy_apb_wr(0x4101e, 0x3ff); +dwc_ddrphy_apb_wr(0x4101f, 0x101); +dwc_ddrphy_apb_wr(0x41020, 0x3fff); +dwc_ddrphy_apb_wr(0x41021, 0xff00); +dwc_ddrphy_apb_wr(0x41022, 0x3f); +dwc_ddrphy_apb_wr(0x41023, 0x1); +dwc_ddrphy_apb_wr(0x41024, 0x3fff); +dwc_ddrphy_apb_wr(0x41025, 0xff00); +dwc_ddrphy_apb_wr(0x41026, 0x3ff); +dwc_ddrphy_apb_wr(0x41027, 0x1); +dwc_ddrphy_apb_wr(0x41028, 0xffff); +dwc_ddrphy_apb_wr(0x41029, 0xff03); +dwc_ddrphy_apb_wr(0x4102a, 0x3ff); +dwc_ddrphy_apb_wr(0x4102b, 0x2c1); +dwc_ddrphy_apb_wr(0x4102c, 0xffff); +dwc_ddrphy_apb_wr(0x4102d, 0xff03); +dwc_ddrphy_apb_wr(0x4102e, 0x3ff); +dwc_ddrphy_apb_wr(0x4102f, 0xf901); +dwc_ddrphy_apb_wr(0x41030, 0xffff); +dwc_ddrphy_apb_wr(0x41031, 0xff03); +dwc_ddrphy_apb_wr(0x41032, 0x3ff); +dwc_ddrphy_apb_wr(0x41033, 0x2c1); +dwc_ddrphy_apb_wr(0x41034, 0xffff); +dwc_ddrphy_apb_wr(0x41035, 0xff03); +dwc_ddrphy_apb_wr(0x41036, 0x3ff); +dwc_ddrphy_apb_wr(0x41037, 0x5901); +dwc_ddrphy_apb_wr(0x41038, 0x5a5); +dwc_ddrphy_apb_wr(0x41039, 0x4000); +dwc_ddrphy_apb_wr(0x4103a, 0x3c0); +dwc_ddrphy_apb_wr(0x4103b, 0x1); +dwc_ddrphy_apb_wr(0x4103c, 0xc000); +dwc_ddrphy_apb_wr(0x4103d, 0x3); +dwc_ddrphy_apb_wr(0x4103e, 0x3c0); +dwc_ddrphy_apb_wr(0x4103f, 0x0); +dwc_ddrphy_apb_wr(0x41040, 0xc000); +dwc_ddrphy_apb_wr(0x41041, 0x3); +dwc_ddrphy_apb_wr(0x41042, 0x3c0); +dwc_ddrphy_apb_wr(0x41043, 0x2c1); +dwc_ddrphy_apb_wr(0x41044, 0xc000); +dwc_ddrphy_apb_wr(0x41045, 0x3); +dwc_ddrphy_apb_wr(0x41046, 0x3c0); +dwc_ddrphy_apb_wr(0x41047, 0xa01); +dwc_ddrphy_apb_wr(0x41048, 0xef); +dwc_ddrphy_apb_wr(0x41049, 0xef00); +dwc_ddrphy_apb_wr(0x4104a, 0x3c0); +dwc_ddrphy_apb_wr(0x4104b, 0x1); +dwc_ddrphy_apb_wr(0x4104c, 0xc000); +dwc_ddrphy_apb_wr(0x4104d, 0x3); +dwc_ddrphy_apb_wr(0x4104e, 0x3c0); +dwc_ddrphy_apb_wr(0x4104f, 0x0); +dwc_ddrphy_apb_wr(0x41050, 0xc000); +dwc_ddrphy_apb_wr(0x41051, 0x3); +dwc_ddrphy_apb_wr(0x41052, 0x3c0); +dwc_ddrphy_apb_wr(0x41053, 0x2c1); +dwc_ddrphy_apb_wr(0x41054, 0xc000); +dwc_ddrphy_apb_wr(0x41055, 0x3); +dwc_ddrphy_apb_wr(0x41056, 0x3c0); +dwc_ddrphy_apb_wr(0x41057, 0xff01); +dwc_ddrphy_apb_wr(0x41058, 0xc000); +dwc_ddrphy_apb_wr(0x41059, 0x3); +dwc_ddrphy_apb_wr(0x4105a, 0x3c0); +dwc_ddrphy_apb_wr(0x4105b, 0x2c1); +dwc_ddrphy_apb_wr(0x4105c, 0xc000); +dwc_ddrphy_apb_wr(0x4105d, 0x3); +dwc_ddrphy_apb_wr(0x4105e, 0x3c0); +dwc_ddrphy_apb_wr(0x4105f, 0xff01); +dwc_ddrphy_apb_wr(0x41060, 0xc000); +dwc_ddrphy_apb_wr(0x41061, 0x3); +dwc_ddrphy_apb_wr(0x41062, 0x3c0); +dwc_ddrphy_apb_wr(0x41063, 0x2c1); +dwc_ddrphy_apb_wr(0x41064, 0xc000); +dwc_ddrphy_apb_wr(0x41065, 0x3); +dwc_ddrphy_apb_wr(0x41066, 0x3c0); +dwc_ddrphy_apb_wr(0x41067, 0xa01); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 0 +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 4, type = 0 +dwc_ddrphy_apb_wr(0x41068, 0x85d5); +dwc_ddrphy_apb_wr(0x41069, 0x63); +dwc_ddrphy_apb_wr(0x4106a, 0x3c0); +dwc_ddrphy_apb_wr(0x4106b, 0x400); +dwc_ddrphy_apb_wr(0x4106c, 0xc000); +dwc_ddrphy_apb_wr(0x4106d, 0x3); +dwc_ddrphy_apb_wr(0x4106e, 0x3c0); +dwc_ddrphy_apb_wr(0x4106f, 0x0); +dwc_ddrphy_apb_wr(0x41070, 0xc000); +dwc_ddrphy_apb_wr(0x41071, 0x3); +dwc_ddrphy_apb_wr(0x41072, 0x3c0); +dwc_ddrphy_apb_wr(0x41073, 0x2c1); +dwc_ddrphy_apb_wr(0x41074, 0xc000); +dwc_ddrphy_apb_wr(0x41075, 0x3); +dwc_ddrphy_apb_wr(0x41076, 0x3c0); +dwc_ddrphy_apb_wr(0x41077, 0x1001); +dwc_ddrphy_apb_wr(0x41078, 0x85f5); +dwc_ddrphy_apb_wr(0x41079, 0x63); +dwc_ddrphy_apb_wr(0x4107a, 0x3c0); +dwc_ddrphy_apb_wr(0x4107b, 0x800); +dwc_ddrphy_apb_wr(0x4107c, 0xc000); +dwc_ddrphy_apb_wr(0x4107d, 0x3); +dwc_ddrphy_apb_wr(0x4107e, 0x3c0); +dwc_ddrphy_apb_wr(0x4107f, 0x0); +dwc_ddrphy_apb_wr(0x41080, 0xc000); +dwc_ddrphy_apb_wr(0x41081, 0x3); +dwc_ddrphy_apb_wr(0x41082, 0x3c0); +dwc_ddrphy_apb_wr(0x41083, 0x2c1); +dwc_ddrphy_apb_wr(0x41084, 0xc000); +dwc_ddrphy_apb_wr(0x41085, 0x3); +dwc_ddrphy_apb_wr(0x41086, 0x3c0); +dwc_ddrphy_apb_wr(0x41087, 0x1001); +dwc_ddrphy_apb_wr(0x41088, 0x45d5); +dwc_ddrphy_apb_wr(0x41089, 0x63); +dwc_ddrphy_apb_wr(0x4108a, 0x3c0); +dwc_ddrphy_apb_wr(0x4108b, 0x401); +dwc_ddrphy_apb_wr(0x4108c, 0xc000); +dwc_ddrphy_apb_wr(0x4108d, 0x3); +dwc_ddrphy_apb_wr(0x4108e, 0x3c0); +dwc_ddrphy_apb_wr(0x4108f, 0x1); +dwc_ddrphy_apb_wr(0x41090, 0xc000); +dwc_ddrphy_apb_wr(0x41091, 0x3); +dwc_ddrphy_apb_wr(0x41092, 0x3c0); +dwc_ddrphy_apb_wr(0x41093, 0x2c1); +dwc_ddrphy_apb_wr(0x41094, 0xc000); +dwc_ddrphy_apb_wr(0x41095, 0x3); +dwc_ddrphy_apb_wr(0x41096, 0x3c0); +dwc_ddrphy_apb_wr(0x41097, 0x1001); +dwc_ddrphy_apb_wr(0x41098, 0x45f5); +dwc_ddrphy_apb_wr(0x41099, 0x63); +dwc_ddrphy_apb_wr(0x4109a, 0x3c0); +dwc_ddrphy_apb_wr(0x4109b, 0x801); +dwc_ddrphy_apb_wr(0x4109c, 0xc000); +dwc_ddrphy_apb_wr(0x4109d, 0x3); +dwc_ddrphy_apb_wr(0x4109e, 0x3c0); +dwc_ddrphy_apb_wr(0x4109f, 0x1); +dwc_ddrphy_apb_wr(0x410a0, 0xc000); +dwc_ddrphy_apb_wr(0x410a1, 0x3); +dwc_ddrphy_apb_wr(0x410a2, 0x3c0); +dwc_ddrphy_apb_wr(0x410a3, 0x2c1); +dwc_ddrphy_apb_wr(0x410a4, 0xc000); +dwc_ddrphy_apb_wr(0x410a5, 0x3); +dwc_ddrphy_apb_wr(0x410a6, 0x3c0); +dwc_ddrphy_apb_wr(0x410a7, 0x1001); +dwc_ddrphy_apb_wr(0x410a8, 0xc5d5); +dwc_ddrphy_apb_wr(0x410a9, 0x62); +dwc_ddrphy_apb_wr(0x410aa, 0x3c0); +dwc_ddrphy_apb_wr(0x410ab, 0x402); +dwc_ddrphy_apb_wr(0x410ac, 0xc000); +dwc_ddrphy_apb_wr(0x410ad, 0x3); +dwc_ddrphy_apb_wr(0x410ae, 0x3c0); +dwc_ddrphy_apb_wr(0x410af, 0x2); +dwc_ddrphy_apb_wr(0x410b0, 0xc000); +dwc_ddrphy_apb_wr(0x410b1, 0x3); +dwc_ddrphy_apb_wr(0x410b2, 0x3c0); +dwc_ddrphy_apb_wr(0x410b3, 0x2c1); +dwc_ddrphy_apb_wr(0x410b4, 0xc000); +dwc_ddrphy_apb_wr(0x410b5, 0x3); +dwc_ddrphy_apb_wr(0x410b6, 0x3c0); +dwc_ddrphy_apb_wr(0x410b7, 0x1001); +dwc_ddrphy_apb_wr(0x410b8, 0xc5f5); +dwc_ddrphy_apb_wr(0x410b9, 0x62); +dwc_ddrphy_apb_wr(0x410ba, 0x3c0); +dwc_ddrphy_apb_wr(0x410bb, 0x802); +dwc_ddrphy_apb_wr(0x410bc, 0xc000); +dwc_ddrphy_apb_wr(0x410bd, 0x3); +dwc_ddrphy_apb_wr(0x410be, 0x3c0); +dwc_ddrphy_apb_wr(0x410bf, 0x2); +dwc_ddrphy_apb_wr(0x410c0, 0xc000); +dwc_ddrphy_apb_wr(0x410c1, 0x3); +dwc_ddrphy_apb_wr(0x410c2, 0x3c0); +dwc_ddrphy_apb_wr(0x410c3, 0x2c1); +dwc_ddrphy_apb_wr(0x410c4, 0xc000); +dwc_ddrphy_apb_wr(0x410c5, 0x3); +dwc_ddrphy_apb_wr(0x410c6, 0x3c0); +dwc_ddrphy_apb_wr(0x410c7, 0x1001); +dwc_ddrphy_apb_wr(0x410c8, 0xc5d5); +dwc_ddrphy_apb_wr(0x410c9, 0x61); +dwc_ddrphy_apb_wr(0x410ca, 0x3c0); +dwc_ddrphy_apb_wr(0x410cb, 0x403); +dwc_ddrphy_apb_wr(0x410cc, 0xc000); +dwc_ddrphy_apb_wr(0x410cd, 0x3); +dwc_ddrphy_apb_wr(0x410ce, 0x3c0); +dwc_ddrphy_apb_wr(0x410cf, 0x3); +dwc_ddrphy_apb_wr(0x410d0, 0xc000); +dwc_ddrphy_apb_wr(0x410d1, 0x3); +dwc_ddrphy_apb_wr(0x410d2, 0x3c0); +dwc_ddrphy_apb_wr(0x410d3, 0x2c1); +dwc_ddrphy_apb_wr(0x410d4, 0xc000); +dwc_ddrphy_apb_wr(0x410d5, 0x3); +dwc_ddrphy_apb_wr(0x410d6, 0x3c0); +dwc_ddrphy_apb_wr(0x410d7, 0x1001); +dwc_ddrphy_apb_wr(0x410d8, 0xc5f5); +dwc_ddrphy_apb_wr(0x410d9, 0x61); +dwc_ddrphy_apb_wr(0x410da, 0x3c0); +dwc_ddrphy_apb_wr(0x410db, 0x803); +dwc_ddrphy_apb_wr(0x410dc, 0xc000); +dwc_ddrphy_apb_wr(0x410dd, 0x3); +dwc_ddrphy_apb_wr(0x410de, 0x3c0); +dwc_ddrphy_apb_wr(0x410df, 0x3); +dwc_ddrphy_apb_wr(0x410e0, 0xc000); +dwc_ddrphy_apb_wr(0x410e1, 0x3); +dwc_ddrphy_apb_wr(0x410e2, 0x3c0); +dwc_ddrphy_apb_wr(0x410e3, 0x2c1); +dwc_ddrphy_apb_wr(0x410e4, 0xc000); +dwc_ddrphy_apb_wr(0x410e5, 0x3); +dwc_ddrphy_apb_wr(0x410e6, 0x3c0); +dwc_ddrphy_apb_wr(0x410e7, 0x1d01); +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 2, type = 0 +dwc_ddrphy_apb_wr(0x410e8, 0x213); +dwc_ddrphy_apb_wr(0x410e9, 0x0); +dwc_ddrphy_apb_wr(0x410ea, 0x3c0); +dwc_ddrphy_apb_wr(0x410eb, 0x1); +dwc_ddrphy_apb_wr(0x410ec, 0xc000); +dwc_ddrphy_apb_wr(0x410ed, 0x3); +dwc_ddrphy_apb_wr(0x410ee, 0x3c0); +dwc_ddrphy_apb_wr(0x410ef, 0x0); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 0 +dwc_ddrphy_apb_wr(0x410f0, 0xc000); +dwc_ddrphy_apb_wr(0x410f1, 0x3); +dwc_ddrphy_apb_wr(0x410f2, 0x3c0); +dwc_ddrphy_apb_wr(0x410f3, 0x2c1); +dwc_ddrphy_apb_wr(0x410f4, 0xc000); +dwc_ddrphy_apb_wr(0x410f5, 0x3); +dwc_ddrphy_apb_wr(0x410f6, 0x3c0); +dwc_ddrphy_apb_wr(0x410f7, 0xef00); +dwc_ddrphy_apb_wr(0x410f8, 0xc000); +dwc_ddrphy_apb_wr(0x410f9, 0x3); +dwc_ddrphy_apb_wr(0x410fa, 0x3c0); +dwc_ddrphy_apb_wr(0x410fb, 0x2c1); +dwc_ddrphy_apb_wr(0x410fc, 0xc000); +dwc_ddrphy_apb_wr(0x410fd, 0x3); +dwc_ddrphy_apb_wr(0x410fe, 0x3c0); +dwc_ddrphy_apb_wr(0x410ff, 0x5900); +dwc_ddrphy_apb_wr(0x41100, 0x217); +dwc_ddrphy_apb_wr(0x41101, 0x1700); +dwc_ddrphy_apb_wr(0x41102, 0x3c2); +dwc_ddrphy_apb_wr(0x41103, 0x1); +dwc_ddrphy_apb_wr(0x41104, 0xc000); +dwc_ddrphy_apb_wr(0x41105, 0x3); +dwc_ddrphy_apb_wr(0x41106, 0x3c0); +dwc_ddrphy_apb_wr(0x41107, 0x0); +dwc_ddrphy_apb_wr(0x41108, 0xc000); +dwc_ddrphy_apb_wr(0x41109, 0x3); +dwc_ddrphy_apb_wr(0x4110a, 0x3c0); +dwc_ddrphy_apb_wr(0x4110b, 0x2c1); +dwc_ddrphy_apb_wr(0x4110c, 0xc000); +dwc_ddrphy_apb_wr(0x4110d, 0x3); +dwc_ddrphy_apb_wr(0x4110e, 0x3c0); +dwc_ddrphy_apb_wr(0x4110f, 0x400); +dwc_ddrphy_apb_wr(0x41110, 0x3fff); +dwc_ddrphy_apb_wr(0x41111, 0xff00); +dwc_ddrphy_apb_wr(0x41112, 0x3f); +dwc_ddrphy_apb_wr(0x41113, 0x2e1); +dwc_ddrphy_apb_wr(0x41114, 0x3fff); +dwc_ddrphy_apb_wr(0x41115, 0xff00); +dwc_ddrphy_apb_wr(0x41116, 0x3f); +dwc_ddrphy_apb_wr(0x41117, 0xa21); +dwc_ddrphy_apb_wr(0x41118, 0x3fff); +dwc_ddrphy_apb_wr(0x41119, 0xff00); +dwc_ddrphy_apb_wr(0x4111a, 0x3f); +dwc_ddrphy_apb_wr(0x4111b, 0x21); +dwc_ddrphy_apb_wr(0x4111c, 0xffff); +dwc_ddrphy_apb_wr(0x4111d, 0xff03); +dwc_ddrphy_apb_wr(0x4111e, 0x3ff); +dwc_ddrphy_apb_wr(0x4111f, 0x20); +dwc_ddrphy_apb_wr(0x41120, 0xffff); +dwc_ddrphy_apb_wr(0x41121, 0xff03); +dwc_ddrphy_apb_wr(0x41122, 0x3ff); +dwc_ddrphy_apb_wr(0x41123, 0x1e1); +dwc_ddrphy_apb_wr(0x41124, 0xffff); +dwc_ddrphy_apb_wr(0x41125, 0xff03); +dwc_ddrphy_apb_wr(0x41126, 0x3ff); +dwc_ddrphy_apb_wr(0x41127, 0x21); +dwc_ddrphy_apb_wr(0x41128, 0xffff); +dwc_ddrphy_apb_wr(0x41129, 0xff03); +dwc_ddrphy_apb_wr(0x4112a, 0x3ff); +dwc_ddrphy_apb_wr(0x4112b, 0x2e1); +dwc_ddrphy_apb_wr(0x4112c, 0xffff); +dwc_ddrphy_apb_wr(0x4112d, 0xff03); +dwc_ddrphy_apb_wr(0x4112e, 0x3ff); +dwc_ddrphy_apb_wr(0x4112f, 0x121); +dwc_ddrphy_apb_wr(0x41130, 0x3fff); +dwc_ddrphy_apb_wr(0x41131, 0xff00); +dwc_ddrphy_apb_wr(0x41132, 0x3ff); +dwc_ddrphy_apb_wr(0x41133, 0x21); +dwc_ddrphy_apb_wr(0x41134, 0x3fff); +dwc_ddrphy_apb_wr(0x41135, 0xff00); +dwc_ddrphy_apb_wr(0x41136, 0x3ff); +dwc_ddrphy_apb_wr(0x41137, 0x21); +dwc_ddrphy_apb_wr(0x41138, 0x3fff); +dwc_ddrphy_apb_wr(0x41139, 0xff00); +dwc_ddrphy_apb_wr(0x4113a, 0x3ff); +dwc_ddrphy_apb_wr(0x4113b, 0x21); +dwc_ddrphy_apb_wr(0x4113c, 0xffff); +dwc_ddrphy_apb_wr(0x4113d, 0xff03); +dwc_ddrphy_apb_wr(0x4113e, 0x3ff); +dwc_ddrphy_apb_wr(0x4113f, 0x21); +dwc_ddrphy_apb_wr(0x41140, 0xffff); +dwc_ddrphy_apb_wr(0x41141, 0xff03); +dwc_ddrphy_apb_wr(0x41142, 0x3ff); +dwc_ddrphy_apb_wr(0x41143, 0x2e1); +dwc_ddrphy_apb_wr(0x41144, 0xffff); +dwc_ddrphy_apb_wr(0x41145, 0xff03); +dwc_ddrphy_apb_wr(0x41146, 0x3ff); +dwc_ddrphy_apb_wr(0x41147, 0xf921); +dwc_ddrphy_apb_wr(0x41148, 0xffff); +dwc_ddrphy_apb_wr(0x41149, 0xff03); +dwc_ddrphy_apb_wr(0x4114a, 0x3ff); +dwc_ddrphy_apb_wr(0x4114b, 0x2e1); +dwc_ddrphy_apb_wr(0x4114c, 0xffff); +dwc_ddrphy_apb_wr(0x4114d, 0xff03); +dwc_ddrphy_apb_wr(0x4114e, 0x3ff); +dwc_ddrphy_apb_wr(0x4114f, 0x5921); +dwc_ddrphy_apb_wr(0x41150, 0x5a5); +dwc_ddrphy_apb_wr(0x41151, 0xa500); +dwc_ddrphy_apb_wr(0x41152, 0x3c5); +dwc_ddrphy_apb_wr(0x41153, 0x21); +dwc_ddrphy_apb_wr(0x41154, 0xc040); +dwc_ddrphy_apb_wr(0x41155, 0x4003); +dwc_ddrphy_apb_wr(0x41156, 0x3c0); +dwc_ddrphy_apb_wr(0x41157, 0x20); +dwc_ddrphy_apb_wr(0x41158, 0xc000); +dwc_ddrphy_apb_wr(0x41159, 0x3); +dwc_ddrphy_apb_wr(0x4115a, 0x3c0); +dwc_ddrphy_apb_wr(0x4115b, 0x2e1); +dwc_ddrphy_apb_wr(0x4115c, 0xc000); +dwc_ddrphy_apb_wr(0x4115d, 0x3); +dwc_ddrphy_apb_wr(0x4115e, 0x3c0); +dwc_ddrphy_apb_wr(0x4115f, 0xa21); +dwc_ddrphy_apb_wr(0x41160, 0xef); +dwc_ddrphy_apb_wr(0x41161, 0xef00); +dwc_ddrphy_apb_wr(0x41162, 0x3c0); +dwc_ddrphy_apb_wr(0x41163, 0x21); +dwc_ddrphy_apb_wr(0x41164, 0xc000); +dwc_ddrphy_apb_wr(0x41165, 0x3); +dwc_ddrphy_apb_wr(0x41166, 0x3c0); +dwc_ddrphy_apb_wr(0x41167, 0x20); +dwc_ddrphy_apb_wr(0x41168, 0xc000); +dwc_ddrphy_apb_wr(0x41169, 0x3); +dwc_ddrphy_apb_wr(0x4116a, 0x3c0); +dwc_ddrphy_apb_wr(0x4116b, 0x2e1); +dwc_ddrphy_apb_wr(0x4116c, 0xc000); +dwc_ddrphy_apb_wr(0x4116d, 0x3); +dwc_ddrphy_apb_wr(0x4116e, 0x3c0); +dwc_ddrphy_apb_wr(0x4116f, 0xff21); +dwc_ddrphy_apb_wr(0x41170, 0xc000); +dwc_ddrphy_apb_wr(0x41171, 0x3); +dwc_ddrphy_apb_wr(0x41172, 0x3c0); +dwc_ddrphy_apb_wr(0x41173, 0x2e1); +dwc_ddrphy_apb_wr(0x41174, 0xc000); +dwc_ddrphy_apb_wr(0x41175, 0x3); +dwc_ddrphy_apb_wr(0x41176, 0x3c0); +dwc_ddrphy_apb_wr(0x41177, 0xff21); +dwc_ddrphy_apb_wr(0x41178, 0xc000); +dwc_ddrphy_apb_wr(0x41179, 0x3); +dwc_ddrphy_apb_wr(0x4117a, 0x3c0); +dwc_ddrphy_apb_wr(0x4117b, 0x2e1); +dwc_ddrphy_apb_wr(0x4117c, 0xc000); +dwc_ddrphy_apb_wr(0x4117d, 0x3); +dwc_ddrphy_apb_wr(0x4117e, 0x3c0); +dwc_ddrphy_apb_wr(0x4117f, 0xa21); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000000, type = 1 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 0 +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 4, type = 0 +dwc_ddrphy_apb_wr(0x41180, 0x85d5); +dwc_ddrphy_apb_wr(0x41181, 0xd563); +dwc_ddrphy_apb_wr(0x41182, 0x3c5); +dwc_ddrphy_apb_wr(0x41183, 0x420); +dwc_ddrphy_apb_wr(0x41184, 0xc000); +dwc_ddrphy_apb_wr(0x41185, 0x3); +dwc_ddrphy_apb_wr(0x41186, 0x3c0); +dwc_ddrphy_apb_wr(0x41187, 0x20); +dwc_ddrphy_apb_wr(0x41188, 0xc000); +dwc_ddrphy_apb_wr(0x41189, 0x3); +dwc_ddrphy_apb_wr(0x4118a, 0x3c0); +dwc_ddrphy_apb_wr(0x4118b, 0x2c1); +dwc_ddrphy_apb_wr(0x4118c, 0xc000); +dwc_ddrphy_apb_wr(0x4118d, 0x3); +dwc_ddrphy_apb_wr(0x4118e, 0x3c0); +dwc_ddrphy_apb_wr(0x4118f, 0x1001); +dwc_ddrphy_apb_wr(0x41190, 0x85f5); +dwc_ddrphy_apb_wr(0x41191, 0xf563); +dwc_ddrphy_apb_wr(0x41192, 0x3c5); +dwc_ddrphy_apb_wr(0x41193, 0x820); +dwc_ddrphy_apb_wr(0x41194, 0xc000); +dwc_ddrphy_apb_wr(0x41195, 0x3); +dwc_ddrphy_apb_wr(0x41196, 0x3c0); +dwc_ddrphy_apb_wr(0x41197, 0x20); +dwc_ddrphy_apb_wr(0x41198, 0xc000); +dwc_ddrphy_apb_wr(0x41199, 0x3); +dwc_ddrphy_apb_wr(0x4119a, 0x3c0); +dwc_ddrphy_apb_wr(0x4119b, 0x2c1); +dwc_ddrphy_apb_wr(0x4119c, 0xc000); +dwc_ddrphy_apb_wr(0x4119d, 0x3); +dwc_ddrphy_apb_wr(0x4119e, 0x3c0); +dwc_ddrphy_apb_wr(0x4119f, 0x1001); +dwc_ddrphy_apb_wr(0x411a0, 0x45d5); +dwc_ddrphy_apb_wr(0x411a1, 0xd563); +dwc_ddrphy_apb_wr(0x411a2, 0x3c5); +dwc_ddrphy_apb_wr(0x411a3, 0x421); +dwc_ddrphy_apb_wr(0x411a4, 0xc000); +dwc_ddrphy_apb_wr(0x411a5, 0x3); +dwc_ddrphy_apb_wr(0x411a6, 0x3c0); +dwc_ddrphy_apb_wr(0x411a7, 0x21); +dwc_ddrphy_apb_wr(0x411a8, 0xc000); +dwc_ddrphy_apb_wr(0x411a9, 0x3); +dwc_ddrphy_apb_wr(0x411aa, 0x3c0); +dwc_ddrphy_apb_wr(0x411ab, 0x2c1); +dwc_ddrphy_apb_wr(0x411ac, 0xc000); +dwc_ddrphy_apb_wr(0x411ad, 0x3); +dwc_ddrphy_apb_wr(0x411ae, 0x3c0); +dwc_ddrphy_apb_wr(0x411af, 0x1001); +dwc_ddrphy_apb_wr(0x411b0, 0x45f5); +dwc_ddrphy_apb_wr(0x411b1, 0xf563); +dwc_ddrphy_apb_wr(0x411b2, 0x3c5); +dwc_ddrphy_apb_wr(0x411b3, 0x821); +dwc_ddrphy_apb_wr(0x411b4, 0xc000); +dwc_ddrphy_apb_wr(0x411b5, 0x3); +dwc_ddrphy_apb_wr(0x411b6, 0x3c0); +dwc_ddrphy_apb_wr(0x411b7, 0x21); +dwc_ddrphy_apb_wr(0x411b8, 0xc000); +dwc_ddrphy_apb_wr(0x411b9, 0x3); +dwc_ddrphy_apb_wr(0x411ba, 0x3c0); +dwc_ddrphy_apb_wr(0x411bb, 0x2c1); +dwc_ddrphy_apb_wr(0x411bc, 0xc000); +dwc_ddrphy_apb_wr(0x411bd, 0x3); +dwc_ddrphy_apb_wr(0x411be, 0x3c0); +dwc_ddrphy_apb_wr(0x411bf, 0x1001); +dwc_ddrphy_apb_wr(0x411c0, 0xc5d5); +dwc_ddrphy_apb_wr(0x411c1, 0xd562); +dwc_ddrphy_apb_wr(0x411c2, 0x3c5); +dwc_ddrphy_apb_wr(0x411c3, 0x422); +dwc_ddrphy_apb_wr(0x411c4, 0xc000); +dwc_ddrphy_apb_wr(0x411c5, 0x3); +dwc_ddrphy_apb_wr(0x411c6, 0x3c0); +dwc_ddrphy_apb_wr(0x411c7, 0x22); +dwc_ddrphy_apb_wr(0x411c8, 0xc000); +dwc_ddrphy_apb_wr(0x411c9, 0x3); +dwc_ddrphy_apb_wr(0x411ca, 0x3c0); +dwc_ddrphy_apb_wr(0x411cb, 0x2c1); +dwc_ddrphy_apb_wr(0x411cc, 0xc000); +dwc_ddrphy_apb_wr(0x411cd, 0x3); +dwc_ddrphy_apb_wr(0x411ce, 0x3c0); +dwc_ddrphy_apb_wr(0x411cf, 0x1001); +dwc_ddrphy_apb_wr(0x411d0, 0xc5f5); +dwc_ddrphy_apb_wr(0x411d1, 0xf562); +dwc_ddrphy_apb_wr(0x411d2, 0x3c5); +dwc_ddrphy_apb_wr(0x411d3, 0x822); +dwc_ddrphy_apb_wr(0x411d4, 0xc000); +dwc_ddrphy_apb_wr(0x411d5, 0x3); +dwc_ddrphy_apb_wr(0x411d6, 0x3c0); +dwc_ddrphy_apb_wr(0x411d7, 0x22); +dwc_ddrphy_apb_wr(0x411d8, 0xc000); +dwc_ddrphy_apb_wr(0x411d9, 0x3); +dwc_ddrphy_apb_wr(0x411da, 0x3c0); +dwc_ddrphy_apb_wr(0x411db, 0x2c1); +dwc_ddrphy_apb_wr(0x411dc, 0xc000); +dwc_ddrphy_apb_wr(0x411dd, 0x3); +dwc_ddrphy_apb_wr(0x411de, 0x3c0); +dwc_ddrphy_apb_wr(0x411df, 0x1001); +dwc_ddrphy_apb_wr(0x411e0, 0xc5d5); +dwc_ddrphy_apb_wr(0x411e1, 0xd561); +dwc_ddrphy_apb_wr(0x411e2, 0x3c5); +dwc_ddrphy_apb_wr(0x411e3, 0x423); +dwc_ddrphy_apb_wr(0x411e4, 0xc000); +dwc_ddrphy_apb_wr(0x411e5, 0x3); +dwc_ddrphy_apb_wr(0x411e6, 0x3c0); +dwc_ddrphy_apb_wr(0x411e7, 0x23); +dwc_ddrphy_apb_wr(0x411e8, 0xc000); +dwc_ddrphy_apb_wr(0x411e9, 0x3); +dwc_ddrphy_apb_wr(0x411ea, 0x3c0); +dwc_ddrphy_apb_wr(0x411eb, 0x2c1); +dwc_ddrphy_apb_wr(0x411ec, 0xc000); +dwc_ddrphy_apb_wr(0x411ed, 0x3); +dwc_ddrphy_apb_wr(0x411ee, 0x3c0); +dwc_ddrphy_apb_wr(0x411ef, 0x1001); +dwc_ddrphy_apb_wr(0x411f0, 0xc5f5); +dwc_ddrphy_apb_wr(0x411f1, 0xf561); +dwc_ddrphy_apb_wr(0x411f2, 0x3c5); +dwc_ddrphy_apb_wr(0x411f3, 0x823); +dwc_ddrphy_apb_wr(0x411f4, 0xc000); +dwc_ddrphy_apb_wr(0x411f5, 0x3); +dwc_ddrphy_apb_wr(0x411f6, 0x3c0); +dwc_ddrphy_apb_wr(0x411f7, 0x23); +dwc_ddrphy_apb_wr(0x411f8, 0xc000); +dwc_ddrphy_apb_wr(0x411f9, 0x3); +dwc_ddrphy_apb_wr(0x411fa, 0x3c0); +dwc_ddrphy_apb_wr(0x411fb, 0x2c1); +dwc_ddrphy_apb_wr(0x411fc, 0xc000); +dwc_ddrphy_apb_wr(0x411fd, 0x3); +dwc_ddrphy_apb_wr(0x411fe, 0x3c0); +dwc_ddrphy_apb_wr(0x411ff, 0x1d01); +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 2, type = 0 +dwc_ddrphy_apb_wr(0x41200, 0x213); +dwc_ddrphy_apb_wr(0x41201, 0x1300); +dwc_ddrphy_apb_wr(0x41202, 0x3c2); +dwc_ddrphy_apb_wr(0x41203, 0x21); +dwc_ddrphy_apb_wr(0x41204, 0xc000); +dwc_ddrphy_apb_wr(0x41205, 0x3); +dwc_ddrphy_apb_wr(0x41206, 0x3c0); +dwc_ddrphy_apb_wr(0x41207, 0x20); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 0 +dwc_ddrphy_apb_wr(0x41208, 0xc000); +dwc_ddrphy_apb_wr(0x41209, 0x3); +dwc_ddrphy_apb_wr(0x4120a, 0x3c0); +dwc_ddrphy_apb_wr(0x4120b, 0x2e1); +dwc_ddrphy_apb_wr(0x4120c, 0xc000); +dwc_ddrphy_apb_wr(0x4120d, 0x3); +dwc_ddrphy_apb_wr(0x4120e, 0x3c0); +dwc_ddrphy_apb_wr(0x4120f, 0xef20); +dwc_ddrphy_apb_wr(0x41210, 0xc000); +dwc_ddrphy_apb_wr(0x41211, 0x3); +dwc_ddrphy_apb_wr(0x41212, 0x3c0); +dwc_ddrphy_apb_wr(0x41213, 0x2e1); +dwc_ddrphy_apb_wr(0x41214, 0xc000); +dwc_ddrphy_apb_wr(0x41215, 0x3); +dwc_ddrphy_apb_wr(0x41216, 0x3c0); +dwc_ddrphy_apb_wr(0x41217, 0x5920); +dwc_ddrphy_apb_wr(0x41218, 0x217); +dwc_ddrphy_apb_wr(0x41219, 0x1700); +dwc_ddrphy_apb_wr(0x4121a, 0x3c2); +dwc_ddrphy_apb_wr(0x4121b, 0x21); +dwc_ddrphy_apb_wr(0x4121c, 0xc000); +dwc_ddrphy_apb_wr(0x4121d, 0x3); +dwc_ddrphy_apb_wr(0x4121e, 0x3c0); +dwc_ddrphy_apb_wr(0x4121f, 0x20); +dwc_ddrphy_apb_wr(0x41220, 0xc000); +dwc_ddrphy_apb_wr(0x41221, 0x3); +dwc_ddrphy_apb_wr(0x41222, 0x3c0); +dwc_ddrphy_apb_wr(0x41223, 0x2e1); +dwc_ddrphy_apb_wr(0x41224, 0xc000); +dwc_ddrphy_apb_wr(0x41225, 0x3); +dwc_ddrphy_apb_wr(0x41226, 0x3c0); +dwc_ddrphy_apb_wr(0x41227, 0x420); +//// [phyinit_LoadPIECodeSections] Moving start address from 41228 to 42000 +dwc_ddrphy_apb_wr(0x42000, 0x3fff); +dwc_ddrphy_apb_wr(0x42001, 0xff00); +dwc_ddrphy_apb_wr(0x42002, 0x3f); +dwc_ddrphy_apb_wr(0x42003, 0x2c1); +dwc_ddrphy_apb_wr(0x42004, 0x3fff); +dwc_ddrphy_apb_wr(0x42005, 0xff00); +dwc_ddrphy_apb_wr(0x42006, 0x3f); +dwc_ddrphy_apb_wr(0x42007, 0xa01); +dwc_ddrphy_apb_wr(0x42008, 0x3fff); +dwc_ddrphy_apb_wr(0x42009, 0xff00); +dwc_ddrphy_apb_wr(0x4200a, 0x3f); +dwc_ddrphy_apb_wr(0x4200b, 0x1); +dwc_ddrphy_apb_wr(0x4200c, 0xffff); +dwc_ddrphy_apb_wr(0x4200d, 0xff03); +dwc_ddrphy_apb_wr(0x4200e, 0x3ff); +dwc_ddrphy_apb_wr(0x4200f, 0x0); +dwc_ddrphy_apb_wr(0x42010, 0xffff); +dwc_ddrphy_apb_wr(0x42011, 0xff03); +dwc_ddrphy_apb_wr(0x42012, 0x3ff); +dwc_ddrphy_apb_wr(0x42013, 0x1c1); +dwc_ddrphy_apb_wr(0x42014, 0xffff); +dwc_ddrphy_apb_wr(0x42015, 0xff03); +dwc_ddrphy_apb_wr(0x42016, 0x3ff); +dwc_ddrphy_apb_wr(0x42017, 0x1); +dwc_ddrphy_apb_wr(0x42018, 0xffff); +dwc_ddrphy_apb_wr(0x42019, 0xff03); +dwc_ddrphy_apb_wr(0x4201a, 0x3ff); +dwc_ddrphy_apb_wr(0x4201b, 0x2c1); +dwc_ddrphy_apb_wr(0x4201c, 0xffff); +dwc_ddrphy_apb_wr(0x4201d, 0xff03); +dwc_ddrphy_apb_wr(0x4201e, 0x3ff); +dwc_ddrphy_apb_wr(0x4201f, 0x101); +dwc_ddrphy_apb_wr(0x42020, 0x3fff); +dwc_ddrphy_apb_wr(0x42021, 0xff00); +dwc_ddrphy_apb_wr(0x42022, 0x3f); +dwc_ddrphy_apb_wr(0x42023, 0x1); +dwc_ddrphy_apb_wr(0x42024, 0x3fff); +dwc_ddrphy_apb_wr(0x42025, 0xff00); +dwc_ddrphy_apb_wr(0x42026, 0x3ff); +dwc_ddrphy_apb_wr(0x42027, 0x1); +dwc_ddrphy_apb_wr(0x42028, 0xffff); +dwc_ddrphy_apb_wr(0x42029, 0xff03); +dwc_ddrphy_apb_wr(0x4202a, 0x3ff); +dwc_ddrphy_apb_wr(0x4202b, 0x2c1); +dwc_ddrphy_apb_wr(0x4202c, 0xffff); +dwc_ddrphy_apb_wr(0x4202d, 0xff03); +dwc_ddrphy_apb_wr(0x4202e, 0x3ff); +dwc_ddrphy_apb_wr(0x4202f, 0xf901); +dwc_ddrphy_apb_wr(0x42030, 0xffff); +dwc_ddrphy_apb_wr(0x42031, 0xff03); +dwc_ddrphy_apb_wr(0x42032, 0x3ff); +dwc_ddrphy_apb_wr(0x42033, 0x2c1); +dwc_ddrphy_apb_wr(0x42034, 0xffff); +dwc_ddrphy_apb_wr(0x42035, 0xff03); +dwc_ddrphy_apb_wr(0x42036, 0x3ff); +dwc_ddrphy_apb_wr(0x42037, 0x5901); +dwc_ddrphy_apb_wr(0x42038, 0x5a5); +dwc_ddrphy_apb_wr(0x42039, 0x4000); +dwc_ddrphy_apb_wr(0x4203a, 0x3c0); +dwc_ddrphy_apb_wr(0x4203b, 0x1); +dwc_ddrphy_apb_wr(0x4203c, 0xc000); +dwc_ddrphy_apb_wr(0x4203d, 0x3); +dwc_ddrphy_apb_wr(0x4203e, 0x3c0); +dwc_ddrphy_apb_wr(0x4203f, 0x0); +dwc_ddrphy_apb_wr(0x42040, 0xc000); +dwc_ddrphy_apb_wr(0x42041, 0x3); +dwc_ddrphy_apb_wr(0x42042, 0x3c0); +dwc_ddrphy_apb_wr(0x42043, 0x2c1); +dwc_ddrphy_apb_wr(0x42044, 0xc000); +dwc_ddrphy_apb_wr(0x42045, 0x3); +dwc_ddrphy_apb_wr(0x42046, 0x3c0); +dwc_ddrphy_apb_wr(0x42047, 0xa01); +dwc_ddrphy_apb_wr(0x42048, 0xef); +dwc_ddrphy_apb_wr(0x42049, 0xef00); +dwc_ddrphy_apb_wr(0x4204a, 0x3c0); +dwc_ddrphy_apb_wr(0x4204b, 0x1); +dwc_ddrphy_apb_wr(0x4204c, 0xc000); +dwc_ddrphy_apb_wr(0x4204d, 0x3); +dwc_ddrphy_apb_wr(0x4204e, 0x3c0); +dwc_ddrphy_apb_wr(0x4204f, 0x0); +dwc_ddrphy_apb_wr(0x42050, 0xc000); +dwc_ddrphy_apb_wr(0x42051, 0x3); +dwc_ddrphy_apb_wr(0x42052, 0x3c0); +dwc_ddrphy_apb_wr(0x42053, 0x2c1); +dwc_ddrphy_apb_wr(0x42054, 0xc000); +dwc_ddrphy_apb_wr(0x42055, 0x3); +dwc_ddrphy_apb_wr(0x42056, 0x3c0); +dwc_ddrphy_apb_wr(0x42057, 0xff01); +dwc_ddrphy_apb_wr(0x42058, 0xc000); +dwc_ddrphy_apb_wr(0x42059, 0x3); +dwc_ddrphy_apb_wr(0x4205a, 0x3c0); +dwc_ddrphy_apb_wr(0x4205b, 0x2c1); +dwc_ddrphy_apb_wr(0x4205c, 0xc000); +dwc_ddrphy_apb_wr(0x4205d, 0x3); +dwc_ddrphy_apb_wr(0x4205e, 0x3c0); +dwc_ddrphy_apb_wr(0x4205f, 0xff01); +dwc_ddrphy_apb_wr(0x42060, 0xc000); +dwc_ddrphy_apb_wr(0x42061, 0x3); +dwc_ddrphy_apb_wr(0x42062, 0x3c0); +dwc_ddrphy_apb_wr(0x42063, 0x2c1); +dwc_ddrphy_apb_wr(0x42064, 0xc000); +dwc_ddrphy_apb_wr(0x42065, 0x3); +dwc_ddrphy_apb_wr(0x42066, 0x3c0); +dwc_ddrphy_apb_wr(0x42067, 0xa01); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 0 +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 4, type = 0 +dwc_ddrphy_apb_wr(0x42068, 0x85d5); +dwc_ddrphy_apb_wr(0x42069, 0x63); +dwc_ddrphy_apb_wr(0x4206a, 0x3c0); +dwc_ddrphy_apb_wr(0x4206b, 0x400); +dwc_ddrphy_apb_wr(0x4206c, 0xc000); +dwc_ddrphy_apb_wr(0x4206d, 0x3); +dwc_ddrphy_apb_wr(0x4206e, 0x3c0); +dwc_ddrphy_apb_wr(0x4206f, 0x0); +dwc_ddrphy_apb_wr(0x42070, 0xc000); +dwc_ddrphy_apb_wr(0x42071, 0x3); +dwc_ddrphy_apb_wr(0x42072, 0x3c0); +dwc_ddrphy_apb_wr(0x42073, 0x2c1); +dwc_ddrphy_apb_wr(0x42074, 0xc000); +dwc_ddrphy_apb_wr(0x42075, 0x3); +dwc_ddrphy_apb_wr(0x42076, 0x3c0); +dwc_ddrphy_apb_wr(0x42077, 0x1001); +dwc_ddrphy_apb_wr(0x42078, 0x85f5); +dwc_ddrphy_apb_wr(0x42079, 0x63); +dwc_ddrphy_apb_wr(0x4207a, 0x3c0); +dwc_ddrphy_apb_wr(0x4207b, 0x800); +dwc_ddrphy_apb_wr(0x4207c, 0xc000); +dwc_ddrphy_apb_wr(0x4207d, 0x3); +dwc_ddrphy_apb_wr(0x4207e, 0x3c0); +dwc_ddrphy_apb_wr(0x4207f, 0x0); +dwc_ddrphy_apb_wr(0x42080, 0xc000); +dwc_ddrphy_apb_wr(0x42081, 0x3); +dwc_ddrphy_apb_wr(0x42082, 0x3c0); +dwc_ddrphy_apb_wr(0x42083, 0x2c1); +dwc_ddrphy_apb_wr(0x42084, 0xc000); +dwc_ddrphy_apb_wr(0x42085, 0x3); +dwc_ddrphy_apb_wr(0x42086, 0x3c0); +dwc_ddrphy_apb_wr(0x42087, 0x1001); +dwc_ddrphy_apb_wr(0x42088, 0x45d5); +dwc_ddrphy_apb_wr(0x42089, 0x63); +dwc_ddrphy_apb_wr(0x4208a, 0x3c0); +dwc_ddrphy_apb_wr(0x4208b, 0x401); +dwc_ddrphy_apb_wr(0x4208c, 0xc000); +dwc_ddrphy_apb_wr(0x4208d, 0x3); +dwc_ddrphy_apb_wr(0x4208e, 0x3c0); +dwc_ddrphy_apb_wr(0x4208f, 0x1); +dwc_ddrphy_apb_wr(0x42090, 0xc000); +dwc_ddrphy_apb_wr(0x42091, 0x3); +dwc_ddrphy_apb_wr(0x42092, 0x3c0); +dwc_ddrphy_apb_wr(0x42093, 0x2c1); +dwc_ddrphy_apb_wr(0x42094, 0xc000); +dwc_ddrphy_apb_wr(0x42095, 0x3); +dwc_ddrphy_apb_wr(0x42096, 0x3c0); +dwc_ddrphy_apb_wr(0x42097, 0x1001); +dwc_ddrphy_apb_wr(0x42098, 0x45f5); +dwc_ddrphy_apb_wr(0x42099, 0x63); +dwc_ddrphy_apb_wr(0x4209a, 0x3c0); +dwc_ddrphy_apb_wr(0x4209b, 0x801); +dwc_ddrphy_apb_wr(0x4209c, 0xc000); +dwc_ddrphy_apb_wr(0x4209d, 0x3); +dwc_ddrphy_apb_wr(0x4209e, 0x3c0); +dwc_ddrphy_apb_wr(0x4209f, 0x1); +dwc_ddrphy_apb_wr(0x420a0, 0xc000); +dwc_ddrphy_apb_wr(0x420a1, 0x3); +dwc_ddrphy_apb_wr(0x420a2, 0x3c0); +dwc_ddrphy_apb_wr(0x420a3, 0x2c1); +dwc_ddrphy_apb_wr(0x420a4, 0xc000); +dwc_ddrphy_apb_wr(0x420a5, 0x3); +dwc_ddrphy_apb_wr(0x420a6, 0x3c0); +dwc_ddrphy_apb_wr(0x420a7, 0x1001); +dwc_ddrphy_apb_wr(0x420a8, 0xc5d5); +dwc_ddrphy_apb_wr(0x420a9, 0x62); +dwc_ddrphy_apb_wr(0x420aa, 0x3c0); +dwc_ddrphy_apb_wr(0x420ab, 0x402); +dwc_ddrphy_apb_wr(0x420ac, 0xc000); +dwc_ddrphy_apb_wr(0x420ad, 0x3); +dwc_ddrphy_apb_wr(0x420ae, 0x3c0); +dwc_ddrphy_apb_wr(0x420af, 0x2); +dwc_ddrphy_apb_wr(0x420b0, 0xc000); +dwc_ddrphy_apb_wr(0x420b1, 0x3); +dwc_ddrphy_apb_wr(0x420b2, 0x3c0); +dwc_ddrphy_apb_wr(0x420b3, 0x2c1); +dwc_ddrphy_apb_wr(0x420b4, 0xc000); +dwc_ddrphy_apb_wr(0x420b5, 0x3); +dwc_ddrphy_apb_wr(0x420b6, 0x3c0); +dwc_ddrphy_apb_wr(0x420b7, 0x1001); +dwc_ddrphy_apb_wr(0x420b8, 0xc5f5); +dwc_ddrphy_apb_wr(0x420b9, 0x62); +dwc_ddrphy_apb_wr(0x420ba, 0x3c0); +dwc_ddrphy_apb_wr(0x420bb, 0x802); +dwc_ddrphy_apb_wr(0x420bc, 0xc000); +dwc_ddrphy_apb_wr(0x420bd, 0x3); +dwc_ddrphy_apb_wr(0x420be, 0x3c0); +dwc_ddrphy_apb_wr(0x420bf, 0x2); +dwc_ddrphy_apb_wr(0x420c0, 0xc000); +dwc_ddrphy_apb_wr(0x420c1, 0x3); +dwc_ddrphy_apb_wr(0x420c2, 0x3c0); +dwc_ddrphy_apb_wr(0x420c3, 0x2c1); +dwc_ddrphy_apb_wr(0x420c4, 0xc000); +dwc_ddrphy_apb_wr(0x420c5, 0x3); +dwc_ddrphy_apb_wr(0x420c6, 0x3c0); +dwc_ddrphy_apb_wr(0x420c7, 0x1001); +dwc_ddrphy_apb_wr(0x420c8, 0xc5d5); +dwc_ddrphy_apb_wr(0x420c9, 0x61); +dwc_ddrphy_apb_wr(0x420ca, 0x3c0); +dwc_ddrphy_apb_wr(0x420cb, 0x403); +dwc_ddrphy_apb_wr(0x420cc, 0xc000); +dwc_ddrphy_apb_wr(0x420cd, 0x3); +dwc_ddrphy_apb_wr(0x420ce, 0x3c0); +dwc_ddrphy_apb_wr(0x420cf, 0x3); +dwc_ddrphy_apb_wr(0x420d0, 0xc000); +dwc_ddrphy_apb_wr(0x420d1, 0x3); +dwc_ddrphy_apb_wr(0x420d2, 0x3c0); +dwc_ddrphy_apb_wr(0x420d3, 0x2c1); +dwc_ddrphy_apb_wr(0x420d4, 0xc000); +dwc_ddrphy_apb_wr(0x420d5, 0x3); +dwc_ddrphy_apb_wr(0x420d6, 0x3c0); +dwc_ddrphy_apb_wr(0x420d7, 0x1001); +dwc_ddrphy_apb_wr(0x420d8, 0xc5f5); +dwc_ddrphy_apb_wr(0x420d9, 0x61); +dwc_ddrphy_apb_wr(0x420da, 0x3c0); +dwc_ddrphy_apb_wr(0x420db, 0x803); +dwc_ddrphy_apb_wr(0x420dc, 0xc000); +dwc_ddrphy_apb_wr(0x420dd, 0x3); +dwc_ddrphy_apb_wr(0x420de, 0x3c0); +dwc_ddrphy_apb_wr(0x420df, 0x3); +dwc_ddrphy_apb_wr(0x420e0, 0xc000); +dwc_ddrphy_apb_wr(0x420e1, 0x3); +dwc_ddrphy_apb_wr(0x420e2, 0x3c0); +dwc_ddrphy_apb_wr(0x420e3, 0x2c1); +dwc_ddrphy_apb_wr(0x420e4, 0xc000); +dwc_ddrphy_apb_wr(0x420e5, 0x3); +dwc_ddrphy_apb_wr(0x420e6, 0x3c0); +dwc_ddrphy_apb_wr(0x420e7, 0x1d01); +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 2, type = 0 +dwc_ddrphy_apb_wr(0x420e8, 0x213); +dwc_ddrphy_apb_wr(0x420e9, 0x0); +dwc_ddrphy_apb_wr(0x420ea, 0x3c0); +dwc_ddrphy_apb_wr(0x420eb, 0x1); +dwc_ddrphy_apb_wr(0x420ec, 0xc000); +dwc_ddrphy_apb_wr(0x420ed, 0x3); +dwc_ddrphy_apb_wr(0x420ee, 0x3c0); +dwc_ddrphy_apb_wr(0x420ef, 0x0); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 0 +dwc_ddrphy_apb_wr(0x420f0, 0xc000); +dwc_ddrphy_apb_wr(0x420f1, 0x3); +dwc_ddrphy_apb_wr(0x420f2, 0x3c0); +dwc_ddrphy_apb_wr(0x420f3, 0x2c1); +dwc_ddrphy_apb_wr(0x420f4, 0xc000); +dwc_ddrphy_apb_wr(0x420f5, 0x3); +dwc_ddrphy_apb_wr(0x420f6, 0x3c0); +dwc_ddrphy_apb_wr(0x420f7, 0xef00); +dwc_ddrphy_apb_wr(0x420f8, 0xc000); +dwc_ddrphy_apb_wr(0x420f9, 0x3); +dwc_ddrphy_apb_wr(0x420fa, 0x3c0); +dwc_ddrphy_apb_wr(0x420fb, 0x2c1); +dwc_ddrphy_apb_wr(0x420fc, 0xc000); +dwc_ddrphy_apb_wr(0x420fd, 0x3); +dwc_ddrphy_apb_wr(0x420fe, 0x3c0); +dwc_ddrphy_apb_wr(0x420ff, 0x5900); +dwc_ddrphy_apb_wr(0x42100, 0x217); +dwc_ddrphy_apb_wr(0x42101, 0x1700); +dwc_ddrphy_apb_wr(0x42102, 0x3c2); +dwc_ddrphy_apb_wr(0x42103, 0x1); +dwc_ddrphy_apb_wr(0x42104, 0xc000); +dwc_ddrphy_apb_wr(0x42105, 0x3); +dwc_ddrphy_apb_wr(0x42106, 0x3c0); +dwc_ddrphy_apb_wr(0x42107, 0x0); +dwc_ddrphy_apb_wr(0x42108, 0xc000); +dwc_ddrphy_apb_wr(0x42109, 0x3); +dwc_ddrphy_apb_wr(0x4210a, 0x3c0); +dwc_ddrphy_apb_wr(0x4210b, 0x2c1); +dwc_ddrphy_apb_wr(0x4210c, 0xc000); +dwc_ddrphy_apb_wr(0x4210d, 0x3); +dwc_ddrphy_apb_wr(0x4210e, 0x3c0); +dwc_ddrphy_apb_wr(0x4210f, 0x400); +dwc_ddrphy_apb_wr(0x42110, 0x3fff); +dwc_ddrphy_apb_wr(0x42111, 0xff00); +dwc_ddrphy_apb_wr(0x42112, 0x3f); +dwc_ddrphy_apb_wr(0x42113, 0x2e1); +dwc_ddrphy_apb_wr(0x42114, 0x3fff); +dwc_ddrphy_apb_wr(0x42115, 0xff00); +dwc_ddrphy_apb_wr(0x42116, 0x3f); +dwc_ddrphy_apb_wr(0x42117, 0xa21); +dwc_ddrphy_apb_wr(0x42118, 0x3fff); +dwc_ddrphy_apb_wr(0x42119, 0xff00); +dwc_ddrphy_apb_wr(0x4211a, 0x3f); +dwc_ddrphy_apb_wr(0x4211b, 0x21); +dwc_ddrphy_apb_wr(0x4211c, 0xffff); +dwc_ddrphy_apb_wr(0x4211d, 0xff03); +dwc_ddrphy_apb_wr(0x4211e, 0x3ff); +dwc_ddrphy_apb_wr(0x4211f, 0x20); +dwc_ddrphy_apb_wr(0x42120, 0xffff); +dwc_ddrphy_apb_wr(0x42121, 0xff03); +dwc_ddrphy_apb_wr(0x42122, 0x3ff); +dwc_ddrphy_apb_wr(0x42123, 0x1e1); +dwc_ddrphy_apb_wr(0x42124, 0xffff); +dwc_ddrphy_apb_wr(0x42125, 0xff03); +dwc_ddrphy_apb_wr(0x42126, 0x3ff); +dwc_ddrphy_apb_wr(0x42127, 0x21); +dwc_ddrphy_apb_wr(0x42128, 0xffff); +dwc_ddrphy_apb_wr(0x42129, 0xff03); +dwc_ddrphy_apb_wr(0x4212a, 0x3ff); +dwc_ddrphy_apb_wr(0x4212b, 0x2e1); +dwc_ddrphy_apb_wr(0x4212c, 0xffff); +dwc_ddrphy_apb_wr(0x4212d, 0xff03); +dwc_ddrphy_apb_wr(0x4212e, 0x3ff); +dwc_ddrphy_apb_wr(0x4212f, 0x121); +dwc_ddrphy_apb_wr(0x42130, 0x3fff); +dwc_ddrphy_apb_wr(0x42131, 0xff00); +dwc_ddrphy_apb_wr(0x42132, 0x3ff); +dwc_ddrphy_apb_wr(0x42133, 0x21); +dwc_ddrphy_apb_wr(0x42134, 0x3fff); +dwc_ddrphy_apb_wr(0x42135, 0xff00); +dwc_ddrphy_apb_wr(0x42136, 0x3ff); +dwc_ddrphy_apb_wr(0x42137, 0x21); +dwc_ddrphy_apb_wr(0x42138, 0x3fff); +dwc_ddrphy_apb_wr(0x42139, 0xff00); +dwc_ddrphy_apb_wr(0x4213a, 0x3ff); +dwc_ddrphy_apb_wr(0x4213b, 0x21); +dwc_ddrphy_apb_wr(0x4213c, 0xffff); +dwc_ddrphy_apb_wr(0x4213d, 0xff03); +dwc_ddrphy_apb_wr(0x4213e, 0x3ff); +dwc_ddrphy_apb_wr(0x4213f, 0x21); +dwc_ddrphy_apb_wr(0x42140, 0xffff); +dwc_ddrphy_apb_wr(0x42141, 0xff03); +dwc_ddrphy_apb_wr(0x42142, 0x3ff); +dwc_ddrphy_apb_wr(0x42143, 0x2e1); +dwc_ddrphy_apb_wr(0x42144, 0xffff); +dwc_ddrphy_apb_wr(0x42145, 0xff03); +dwc_ddrphy_apb_wr(0x42146, 0x3ff); +dwc_ddrphy_apb_wr(0x42147, 0xf921); +dwc_ddrphy_apb_wr(0x42148, 0xffff); +dwc_ddrphy_apb_wr(0x42149, 0xff03); +dwc_ddrphy_apb_wr(0x4214a, 0x3ff); +dwc_ddrphy_apb_wr(0x4214b, 0x2e1); +dwc_ddrphy_apb_wr(0x4214c, 0xffff); +dwc_ddrphy_apb_wr(0x4214d, 0xff03); +dwc_ddrphy_apb_wr(0x4214e, 0x3ff); +dwc_ddrphy_apb_wr(0x4214f, 0x5921); +dwc_ddrphy_apb_wr(0x42150, 0x5a5); +dwc_ddrphy_apb_wr(0x42151, 0xa500); +dwc_ddrphy_apb_wr(0x42152, 0x3c5); +dwc_ddrphy_apb_wr(0x42153, 0x21); +dwc_ddrphy_apb_wr(0x42154, 0xc040); +dwc_ddrphy_apb_wr(0x42155, 0x4003); +dwc_ddrphy_apb_wr(0x42156, 0x3c0); +dwc_ddrphy_apb_wr(0x42157, 0x20); +dwc_ddrphy_apb_wr(0x42158, 0xc000); +dwc_ddrphy_apb_wr(0x42159, 0x3); +dwc_ddrphy_apb_wr(0x4215a, 0x3c0); +dwc_ddrphy_apb_wr(0x4215b, 0x2e1); +dwc_ddrphy_apb_wr(0x4215c, 0xc000); +dwc_ddrphy_apb_wr(0x4215d, 0x3); +dwc_ddrphy_apb_wr(0x4215e, 0x3c0); +dwc_ddrphy_apb_wr(0x4215f, 0xa21); +dwc_ddrphy_apb_wr(0x42160, 0xef); +dwc_ddrphy_apb_wr(0x42161, 0xef00); +dwc_ddrphy_apb_wr(0x42162, 0x3c0); +dwc_ddrphy_apb_wr(0x42163, 0x21); +dwc_ddrphy_apb_wr(0x42164, 0xc000); +dwc_ddrphy_apb_wr(0x42165, 0x3); +dwc_ddrphy_apb_wr(0x42166, 0x3c0); +dwc_ddrphy_apb_wr(0x42167, 0x20); +dwc_ddrphy_apb_wr(0x42168, 0xc000); +dwc_ddrphy_apb_wr(0x42169, 0x3); +dwc_ddrphy_apb_wr(0x4216a, 0x3c0); +dwc_ddrphy_apb_wr(0x4216b, 0x2e1); +dwc_ddrphy_apb_wr(0x4216c, 0xc000); +dwc_ddrphy_apb_wr(0x4216d, 0x3); +dwc_ddrphy_apb_wr(0x4216e, 0x3c0); +dwc_ddrphy_apb_wr(0x4216f, 0xff21); +dwc_ddrphy_apb_wr(0x42170, 0xc000); +dwc_ddrphy_apb_wr(0x42171, 0x3); +dwc_ddrphy_apb_wr(0x42172, 0x3c0); +dwc_ddrphy_apb_wr(0x42173, 0x2e1); +dwc_ddrphy_apb_wr(0x42174, 0xc000); +dwc_ddrphy_apb_wr(0x42175, 0x3); +dwc_ddrphy_apb_wr(0x42176, 0x3c0); +dwc_ddrphy_apb_wr(0x42177, 0xff21); +dwc_ddrphy_apb_wr(0x42178, 0xc000); +dwc_ddrphy_apb_wr(0x42179, 0x3); +dwc_ddrphy_apb_wr(0x4217a, 0x3c0); +dwc_ddrphy_apb_wr(0x4217b, 0x2e1); +dwc_ddrphy_apb_wr(0x4217c, 0xc000); +dwc_ddrphy_apb_wr(0x4217d, 0x3); +dwc_ddrphy_apb_wr(0x4217e, 0x3c0); +dwc_ddrphy_apb_wr(0x4217f, 0xa21); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 200000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 400000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 1000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 2000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 4000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 8000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80000000, type = 2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 10, type = 0 +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 4, type = 0 +dwc_ddrphy_apb_wr(0x42180, 0x85d5); +dwc_ddrphy_apb_wr(0x42181, 0xd563); +dwc_ddrphy_apb_wr(0x42182, 0x3c5); +dwc_ddrphy_apb_wr(0x42183, 0x420); +dwc_ddrphy_apb_wr(0x42184, 0xc000); +dwc_ddrphy_apb_wr(0x42185, 0x3); +dwc_ddrphy_apb_wr(0x42186, 0x3c0); +dwc_ddrphy_apb_wr(0x42187, 0x20); +dwc_ddrphy_apb_wr(0x42188, 0xc000); +dwc_ddrphy_apb_wr(0x42189, 0x3); +dwc_ddrphy_apb_wr(0x4218a, 0x3c0); +dwc_ddrphy_apb_wr(0x4218b, 0x2c1); +dwc_ddrphy_apb_wr(0x4218c, 0xc000); +dwc_ddrphy_apb_wr(0x4218d, 0x3); +dwc_ddrphy_apb_wr(0x4218e, 0x3c0); +dwc_ddrphy_apb_wr(0x4218f, 0x1001); +dwc_ddrphy_apb_wr(0x42190, 0x85f5); +dwc_ddrphy_apb_wr(0x42191, 0xf563); +dwc_ddrphy_apb_wr(0x42192, 0x3c5); +dwc_ddrphy_apb_wr(0x42193, 0x820); +dwc_ddrphy_apb_wr(0x42194, 0xc000); +dwc_ddrphy_apb_wr(0x42195, 0x3); +dwc_ddrphy_apb_wr(0x42196, 0x3c0); +dwc_ddrphy_apb_wr(0x42197, 0x20); +dwc_ddrphy_apb_wr(0x42198, 0xc000); +dwc_ddrphy_apb_wr(0x42199, 0x3); +dwc_ddrphy_apb_wr(0x4219a, 0x3c0); +dwc_ddrphy_apb_wr(0x4219b, 0x2c1); +dwc_ddrphy_apb_wr(0x4219c, 0xc000); +dwc_ddrphy_apb_wr(0x4219d, 0x3); +dwc_ddrphy_apb_wr(0x4219e, 0x3c0); +dwc_ddrphy_apb_wr(0x4219f, 0x1001); +dwc_ddrphy_apb_wr(0x421a0, 0x45d5); +dwc_ddrphy_apb_wr(0x421a1, 0xd563); +dwc_ddrphy_apb_wr(0x421a2, 0x3c5); +dwc_ddrphy_apb_wr(0x421a3, 0x421); +dwc_ddrphy_apb_wr(0x421a4, 0xc000); +dwc_ddrphy_apb_wr(0x421a5, 0x3); +dwc_ddrphy_apb_wr(0x421a6, 0x3c0); +dwc_ddrphy_apb_wr(0x421a7, 0x21); +dwc_ddrphy_apb_wr(0x421a8, 0xc000); +dwc_ddrphy_apb_wr(0x421a9, 0x3); +dwc_ddrphy_apb_wr(0x421aa, 0x3c0); +dwc_ddrphy_apb_wr(0x421ab, 0x2c1); +dwc_ddrphy_apb_wr(0x421ac, 0xc000); +dwc_ddrphy_apb_wr(0x421ad, 0x3); +dwc_ddrphy_apb_wr(0x421ae, 0x3c0); +dwc_ddrphy_apb_wr(0x421af, 0x1001); +dwc_ddrphy_apb_wr(0x421b0, 0x45f5); +dwc_ddrphy_apb_wr(0x421b1, 0xf563); +dwc_ddrphy_apb_wr(0x421b2, 0x3c5); +dwc_ddrphy_apb_wr(0x421b3, 0x821); +dwc_ddrphy_apb_wr(0x421b4, 0xc000); +dwc_ddrphy_apb_wr(0x421b5, 0x3); +dwc_ddrphy_apb_wr(0x421b6, 0x3c0); +dwc_ddrphy_apb_wr(0x421b7, 0x21); +dwc_ddrphy_apb_wr(0x421b8, 0xc000); +dwc_ddrphy_apb_wr(0x421b9, 0x3); +dwc_ddrphy_apb_wr(0x421ba, 0x3c0); +dwc_ddrphy_apb_wr(0x421bb, 0x2c1); +dwc_ddrphy_apb_wr(0x421bc, 0xc000); +dwc_ddrphy_apb_wr(0x421bd, 0x3); +dwc_ddrphy_apb_wr(0x421be, 0x3c0); +dwc_ddrphy_apb_wr(0x421bf, 0x1001); +dwc_ddrphy_apb_wr(0x421c0, 0xc5d5); +dwc_ddrphy_apb_wr(0x421c1, 0xd562); +dwc_ddrphy_apb_wr(0x421c2, 0x3c5); +dwc_ddrphy_apb_wr(0x421c3, 0x422); +dwc_ddrphy_apb_wr(0x421c4, 0xc000); +dwc_ddrphy_apb_wr(0x421c5, 0x3); +dwc_ddrphy_apb_wr(0x421c6, 0x3c0); +dwc_ddrphy_apb_wr(0x421c7, 0x22); +dwc_ddrphy_apb_wr(0x421c8, 0xc000); +dwc_ddrphy_apb_wr(0x421c9, 0x3); +dwc_ddrphy_apb_wr(0x421ca, 0x3c0); +dwc_ddrphy_apb_wr(0x421cb, 0x2c1); +dwc_ddrphy_apb_wr(0x421cc, 0xc000); +dwc_ddrphy_apb_wr(0x421cd, 0x3); +dwc_ddrphy_apb_wr(0x421ce, 0x3c0); +dwc_ddrphy_apb_wr(0x421cf, 0x1001); +dwc_ddrphy_apb_wr(0x421d0, 0xc5f5); +dwc_ddrphy_apb_wr(0x421d1, 0xf562); +dwc_ddrphy_apb_wr(0x421d2, 0x3c5); +dwc_ddrphy_apb_wr(0x421d3, 0x822); +dwc_ddrphy_apb_wr(0x421d4, 0xc000); +dwc_ddrphy_apb_wr(0x421d5, 0x3); +dwc_ddrphy_apb_wr(0x421d6, 0x3c0); +dwc_ddrphy_apb_wr(0x421d7, 0x22); +dwc_ddrphy_apb_wr(0x421d8, 0xc000); +dwc_ddrphy_apb_wr(0x421d9, 0x3); +dwc_ddrphy_apb_wr(0x421da, 0x3c0); +dwc_ddrphy_apb_wr(0x421db, 0x2c1); +dwc_ddrphy_apb_wr(0x421dc, 0xc000); +dwc_ddrphy_apb_wr(0x421dd, 0x3); +dwc_ddrphy_apb_wr(0x421de, 0x3c0); +dwc_ddrphy_apb_wr(0x421df, 0x1001); +dwc_ddrphy_apb_wr(0x421e0, 0xc5d5); +dwc_ddrphy_apb_wr(0x421e1, 0xd561); +dwc_ddrphy_apb_wr(0x421e2, 0x3c5); +dwc_ddrphy_apb_wr(0x421e3, 0x423); +dwc_ddrphy_apb_wr(0x421e4, 0xc000); +dwc_ddrphy_apb_wr(0x421e5, 0x3); +dwc_ddrphy_apb_wr(0x421e6, 0x3c0); +dwc_ddrphy_apb_wr(0x421e7, 0x23); +dwc_ddrphy_apb_wr(0x421e8, 0xc000); +dwc_ddrphy_apb_wr(0x421e9, 0x3); +dwc_ddrphy_apb_wr(0x421ea, 0x3c0); +dwc_ddrphy_apb_wr(0x421eb, 0x2c1); +dwc_ddrphy_apb_wr(0x421ec, 0xc000); +dwc_ddrphy_apb_wr(0x421ed, 0x3); +dwc_ddrphy_apb_wr(0x421ee, 0x3c0); +dwc_ddrphy_apb_wr(0x421ef, 0x1001); +dwc_ddrphy_apb_wr(0x421f0, 0xc5f5); +dwc_ddrphy_apb_wr(0x421f1, 0xf561); +dwc_ddrphy_apb_wr(0x421f2, 0x3c5); +dwc_ddrphy_apb_wr(0x421f3, 0x823); +dwc_ddrphy_apb_wr(0x421f4, 0xc000); +dwc_ddrphy_apb_wr(0x421f5, 0x3); +dwc_ddrphy_apb_wr(0x421f6, 0x3c0); +dwc_ddrphy_apb_wr(0x421f7, 0x23); +dwc_ddrphy_apb_wr(0x421f8, 0xc000); +dwc_ddrphy_apb_wr(0x421f9, 0x3); +dwc_ddrphy_apb_wr(0x421fa, 0x3c0); +dwc_ddrphy_apb_wr(0x421fb, 0x2c1); +dwc_ddrphy_apb_wr(0x421fc, 0xc000); +dwc_ddrphy_apb_wr(0x421fd, 0x3); +dwc_ddrphy_apb_wr(0x421fe, 0x3c0); +dwc_ddrphy_apb_wr(0x421ff, 0x1d01); +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 2, type = 0 +dwc_ddrphy_apb_wr(0x42200, 0x213); +dwc_ddrphy_apb_wr(0x42201, 0x1300); +dwc_ddrphy_apb_wr(0x42202, 0x3c2); +dwc_ddrphy_apb_wr(0x42203, 0x21); +dwc_ddrphy_apb_wr(0x42204, 0xc000); +dwc_ddrphy_apb_wr(0x42205, 0x3); +dwc_ddrphy_apb_wr(0x42206, 0x3c0); +dwc_ddrphy_apb_wr(0x42207, 0x20); +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 0 +dwc_ddrphy_apb_wr(0x42208, 0xc000); +dwc_ddrphy_apb_wr(0x42209, 0x3); +dwc_ddrphy_apb_wr(0x4220a, 0x3c0); +dwc_ddrphy_apb_wr(0x4220b, 0x2e1); +dwc_ddrphy_apb_wr(0x4220c, 0xc000); +dwc_ddrphy_apb_wr(0x4220d, 0x3); +dwc_ddrphy_apb_wr(0x4220e, 0x3c0); +dwc_ddrphy_apb_wr(0x4220f, 0xef20); +dwc_ddrphy_apb_wr(0x42210, 0xc000); +dwc_ddrphy_apb_wr(0x42211, 0x3); +dwc_ddrphy_apb_wr(0x42212, 0x3c0); +dwc_ddrphy_apb_wr(0x42213, 0x2e1); +dwc_ddrphy_apb_wr(0x42214, 0xc000); +dwc_ddrphy_apb_wr(0x42215, 0x3); +dwc_ddrphy_apb_wr(0x42216, 0x3c0); +dwc_ddrphy_apb_wr(0x42217, 0x5920); +dwc_ddrphy_apb_wr(0x42218, 0x217); +dwc_ddrphy_apb_wr(0x42219, 0x1700); +dwc_ddrphy_apb_wr(0x4221a, 0x3c2); +dwc_ddrphy_apb_wr(0x4221b, 0x21); +dwc_ddrphy_apb_wr(0x4221c, 0xc000); +dwc_ddrphy_apb_wr(0x4221d, 0x3); +dwc_ddrphy_apb_wr(0x4221e, 0x3c0); +dwc_ddrphy_apb_wr(0x4221f, 0x20); +dwc_ddrphy_apb_wr(0x42220, 0xc000); +dwc_ddrphy_apb_wr(0x42221, 0x3); +dwc_ddrphy_apb_wr(0x42222, 0x3c0); +dwc_ddrphy_apb_wr(0x42223, 0x2e1); +dwc_ddrphy_apb_wr(0x42224, 0xc000); +dwc_ddrphy_apb_wr(0x42225, 0x3); +dwc_ddrphy_apb_wr(0x42226, 0x3c0); +dwc_ddrphy_apb_wr(0x42227, 0x420); +//// [phyinit_LoadPIECodeSections] Moving start address from 42228 to 90029 +dwc_ddrphy_apb_wr(0x90029, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b0s0 +dwc_ddrphy_apb_wr(0x9002a, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b0s1 +dwc_ddrphy_apb_wr(0x9002b, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b0s2 +dwc_ddrphy_apb_wr(0x9002c, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b1s0 +dwc_ddrphy_apb_wr(0x9002d, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b1s1 +dwc_ddrphy_apb_wr(0x9002e, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b1s2 +dwc_ddrphy_apb_wr(0x9002f, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b2s0 +dwc_ddrphy_apb_wr(0x90030, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b2s1 +dwc_ddrphy_apb_wr(0x90031, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b2s2 +dwc_ddrphy_apb_wr(0x90032, 0xb); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b3s0 +dwc_ddrphy_apb_wr(0x90033, 0x480); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b3s1 +dwc_ddrphy_apb_wr(0x90034, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b3s2 +dwc_ddrphy_apb_wr(0x90035, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b4s0 +dwc_ddrphy_apb_wr(0x90036, 0x448); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b4s1 +dwc_ddrphy_apb_wr(0x90037, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b4s2 +dwc_ddrphy_apb_wr(0x90038, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b5s0 +dwc_ddrphy_apb_wr(0x90039, 0x478); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b5s1 +dwc_ddrphy_apb_wr(0x9003a, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b5s2 +dwc_ddrphy_apb_wr(0x9003b, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b6s0 +dwc_ddrphy_apb_wr(0x9003c, 0xe8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b6s1 +dwc_ddrphy_apb_wr(0x9003d, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b6s2 +dwc_ddrphy_apb_wr(0x9003e, 0x2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b7s0 +dwc_ddrphy_apb_wr(0x9003f, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b7s1 +dwc_ddrphy_apb_wr(0x90040, 0x139); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b7s2 +dwc_ddrphy_apb_wr(0x90041, 0xf); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b8s0 +dwc_ddrphy_apb_wr(0x90042, 0x7c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b8s1 +dwc_ddrphy_apb_wr(0x90043, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b8s2 +dwc_ddrphy_apb_wr(0x90044, 0x107); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b9s0 +dwc_ddrphy_apb_wr(0x90045, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b9s1 +dwc_ddrphy_apb_wr(0x90046, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b9s2 +dwc_ddrphy_apb_wr(0x90047, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b10s0 +dwc_ddrphy_apb_wr(0x90048, 0xe0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b10s1 +dwc_ddrphy_apb_wr(0x90049, 0x139); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b10s2 +dwc_ddrphy_apb_wr(0x9004a, 0x147); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b11s0 +dwc_ddrphy_apb_wr(0x9004b, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b11s1 +dwc_ddrphy_apb_wr(0x9004c, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b11s2 +dwc_ddrphy_apb_wr(0x9004d, 0x14f); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b12s0 +dwc_ddrphy_apb_wr(0x9004e, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b12s1 +dwc_ddrphy_apb_wr(0x9004f, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b12s2 +dwc_ddrphy_apb_wr(0x90050, 0x7); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b13s0 +dwc_ddrphy_apb_wr(0x90051, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b13s1 +dwc_ddrphy_apb_wr(0x90052, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b13s2 +dwc_ddrphy_apb_wr(0x90053, 0x47); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b14s0 +dwc_ddrphy_apb_wr(0x90054, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b14s1 +dwc_ddrphy_apb_wr(0x90055, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b14s2 +dwc_ddrphy_apb_wr(0x90056, 0x4f); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b15s0 +dwc_ddrphy_apb_wr(0x90057, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b15s1 +dwc_ddrphy_apb_wr(0x90058, 0x179); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b15s2 +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 800, type = 0 +dwc_ddrphy_apb_wr(0x90059, 0x100); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b16s0 +dwc_ddrphy_apb_wr(0x9005a, 0x15c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b16s1 +dwc_ddrphy_apb_wr(0x9005b, 0x139); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b16s2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800, type = 0 +dwc_ddrphy_apb_wr(0x9005c, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b17s0 +dwc_ddrphy_apb_wr(0x9005d, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b17s1 +dwc_ddrphy_apb_wr(0x9005e, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b17s2 +dwc_ddrphy_apb_wr(0x9005f, 0x11); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b18s0 +dwc_ddrphy_apb_wr(0x90060, 0x530); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b18s1 +dwc_ddrphy_apb_wr(0x90061, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b18s2 +dwc_ddrphy_apb_wr(0x90062, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b19s0 +dwc_ddrphy_apb_wr(0x90063, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b19s1 +dwc_ddrphy_apb_wr(0x90064, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b19s2 +dwc_ddrphy_apb_wr(0x90065, 0x14f); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b20s0 +dwc_ddrphy_apb_wr(0x90066, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b20s1 +dwc_ddrphy_apb_wr(0x90067, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b20s2 +dwc_ddrphy_apb_wr(0x90068, 0x2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b21s0 +dwc_ddrphy_apb_wr(0x90069, 0x45a); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b21s1 +dwc_ddrphy_apb_wr(0x9006a, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b21s2 +dwc_ddrphy_apb_wr(0x9006b, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b22s0 +dwc_ddrphy_apb_wr(0x9006c, 0x530); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b22s1 +dwc_ddrphy_apb_wr(0x9006d, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b22s2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 800, type = 0 +dwc_ddrphy_apb_wr(0x9006e, 0xc100); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b23s0 +dwc_ddrphy_apb_wr(0x9006f, 0x15c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b23s1 +dwc_ddrphy_apb_wr(0x90070, 0x139); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b23s2 +dwc_ddrphy_apb_wr(0x90071, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b24s0 +dwc_ddrphy_apb_wr(0x90072, 0x65a); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b24s1 +dwc_ddrphy_apb_wr(0x90073, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b24s2 +dwc_ddrphy_apb_wr(0x90074, 0x41); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b25s0 +dwc_ddrphy_apb_wr(0x90075, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b25s1 +dwc_ddrphy_apb_wr(0x90076, 0x179); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b25s2 +dwc_ddrphy_apb_wr(0x90077, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b26s0 +dwc_ddrphy_apb_wr(0x90078, 0x618); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b26s1 +dwc_ddrphy_apb_wr(0x90079, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b26s2 +dwc_ddrphy_apb_wr(0x9007a, 0x40c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b27s0 +dwc_ddrphy_apb_wr(0x9007b, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b27s1 +dwc_ddrphy_apb_wr(0x9007c, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b27s2 +dwc_ddrphy_apb_wr(0x9007d, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b28s0 +dwc_ddrphy_apb_wr(0x9007e, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b28s1 +dwc_ddrphy_apb_wr(0x9007f, 0x48); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b28s2 +dwc_ddrphy_apb_wr(0x90080, 0x4040); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b29s0 +dwc_ddrphy_apb_wr(0x90081, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b29s1 +dwc_ddrphy_apb_wr(0x90082, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b29s2 +dwc_ddrphy_apb_wr(0x90083, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b30s0 +dwc_ddrphy_apb_wr(0x90084, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b30s1 +dwc_ddrphy_apb_wr(0x90085, 0x48); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b30s2 +dwc_ddrphy_apb_wr(0x90086, 0x40); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b31s0 +dwc_ddrphy_apb_wr(0x90087, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b31s1 +dwc_ddrphy_apb_wr(0x90088, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b31s2 +dwc_ddrphy_apb_wr(0x90089, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b32s0 +dwc_ddrphy_apb_wr(0x9008a, 0x658); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b32s1 +dwc_ddrphy_apb_wr(0x9008b, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b32s2 +dwc_ddrphy_apb_wr(0x9008c, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b33s0 +dwc_ddrphy_apb_wr(0x9008d, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b33s1 +dwc_ddrphy_apb_wr(0x9008e, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b33s2 +dwc_ddrphy_apb_wr(0x9008f, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b34s0 +dwc_ddrphy_apb_wr(0x90090, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b34s1 +dwc_ddrphy_apb_wr(0x90091, 0x78); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b34s2 +dwc_ddrphy_apb_wr(0x90092, 0x549); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b35s0 +dwc_ddrphy_apb_wr(0x90093, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b35s1 +dwc_ddrphy_apb_wr(0x90094, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b35s2 +dwc_ddrphy_apb_wr(0x90095, 0xd49); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b36s0 +dwc_ddrphy_apb_wr(0x90096, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b36s1 +dwc_ddrphy_apb_wr(0x90097, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b36s2 +dwc_ddrphy_apb_wr(0x90098, 0x94c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b37s0 +dwc_ddrphy_apb_wr(0x90099, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b37s1 +dwc_ddrphy_apb_wr(0x9009a, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b37s2 +dwc_ddrphy_apb_wr(0x9009b, 0x94c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b38s0 +dwc_ddrphy_apb_wr(0x9009c, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b38s1 +dwc_ddrphy_apb_wr(0x9009d, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b38s2 +dwc_ddrphy_apb_wr(0x9009e, 0x442); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b39s0 +dwc_ddrphy_apb_wr(0x9009f, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b39s1 +dwc_ddrphy_apb_wr(0x900a0, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b39s2 +dwc_ddrphy_apb_wr(0x900a1, 0x42); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b40s0 +dwc_ddrphy_apb_wr(0x900a2, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b40s1 +dwc_ddrphy_apb_wr(0x900a3, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b40s2 +dwc_ddrphy_apb_wr(0x900a4, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b41s0 +dwc_ddrphy_apb_wr(0x900a5, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b41s1 +dwc_ddrphy_apb_wr(0x900a6, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b41s2 +dwc_ddrphy_apb_wr(0x900a7, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b42s0 +dwc_ddrphy_apb_wr(0x900a8, 0xe0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b42s1 +dwc_ddrphy_apb_wr(0x900a9, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b42s2 +dwc_ddrphy_apb_wr(0x900aa, 0xa); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b43s0 +dwc_ddrphy_apb_wr(0x900ab, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b43s1 +dwc_ddrphy_apb_wr(0x900ac, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b43s2 +dwc_ddrphy_apb_wr(0x900ad, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b44s0 +dwc_ddrphy_apb_wr(0x900ae, 0x3c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b44s1 +dwc_ddrphy_apb_wr(0x900af, 0x149); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b44s2 +dwc_ddrphy_apb_wr(0x900b0, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b45s0 +dwc_ddrphy_apb_wr(0x900b1, 0x3c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b45s1 +dwc_ddrphy_apb_wr(0x900b2, 0x159); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b45s2 +dwc_ddrphy_apb_wr(0x900b3, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b46s0 +dwc_ddrphy_apb_wr(0x900b4, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b46s1 +dwc_ddrphy_apb_wr(0x900b5, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b46s2 +dwc_ddrphy_apb_wr(0x900b6, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b47s0 +dwc_ddrphy_apb_wr(0x900b7, 0x3c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b47s1 +dwc_ddrphy_apb_wr(0x900b8, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b47s2 +dwc_ddrphy_apb_wr(0x900b9, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b48s0 +dwc_ddrphy_apb_wr(0x900ba, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b48s1 +dwc_ddrphy_apb_wr(0x900bb, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b48s2 +dwc_ddrphy_apb_wr(0x900bc, 0xc); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b49s0 +dwc_ddrphy_apb_wr(0x900bd, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b49s1 +dwc_ddrphy_apb_wr(0x900be, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b49s2 +dwc_ddrphy_apb_wr(0x900bf, 0x3); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b50s0 +dwc_ddrphy_apb_wr(0x900c0, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b50s1 +dwc_ddrphy_apb_wr(0x900c1, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b50s2 +dwc_ddrphy_apb_wr(0x900c2, 0x7); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b51s0 +dwc_ddrphy_apb_wr(0x900c3, 0x7c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b51s1 +dwc_ddrphy_apb_wr(0x900c4, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b51s2 +//// [phyinit_LoadPIECodeSections] Matched ANY enable_bits = 8, type = 0 +dwc_ddrphy_apb_wr(0x900c5, 0x3a); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b52s0 +dwc_ddrphy_apb_wr(0x900c6, 0x1e2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b52s1 +dwc_ddrphy_apb_wr(0x900c7, 0x9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b52s2 +dwc_ddrphy_apb_wr(0x900c8, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b53s0 +dwc_ddrphy_apb_wr(0x900c9, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b53s1 +dwc_ddrphy_apb_wr(0x900ca, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b53s2 +dwc_ddrphy_apb_wr(0x900cb, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b54s0 +dwc_ddrphy_apb_wr(0x900cc, 0x400); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b54s1 +dwc_ddrphy_apb_wr(0x900cd, 0x16e); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b54s2 +dwc_ddrphy_apb_wr(0x900ce, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b55s0 +dwc_ddrphy_apb_wr(0x900cf, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b55s1 +dwc_ddrphy_apb_wr(0x900d0, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b55s2 +dwc_ddrphy_apb_wr(0x900d1, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b56s0 +dwc_ddrphy_apb_wr(0x900d2, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b56s1 +dwc_ddrphy_apb_wr(0x900d3, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b56s2 +dwc_ddrphy_apb_wr(0x900d4, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b57s0 +dwc_ddrphy_apb_wr(0x900d5, 0x978); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b57s1 +dwc_ddrphy_apb_wr(0x900d6, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b57s2 +dwc_ddrphy_apb_wr(0x900d7, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b58s0 +dwc_ddrphy_apb_wr(0x900d8, 0xa78); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b58s1 +dwc_ddrphy_apb_wr(0x900d9, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b58s2 +dwc_ddrphy_apb_wr(0x900da, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s0 +dwc_ddrphy_apb_wr(0x900db, 0x980); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s1 +dwc_ddrphy_apb_wr(0x900dc, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s2 +dwc_ddrphy_apb_wr(0x900dd, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b60s0 +dwc_ddrphy_apb_wr(0x900de, 0xa80); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b60s1 +dwc_ddrphy_apb_wr(0x900df, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b60s2 +dwc_ddrphy_apb_wr(0x900e0, 0x32); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b61s0 +dwc_ddrphy_apb_wr(0x900e1, 0x952); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b61s1 +dwc_ddrphy_apb_wr(0x900e2, 0x69); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b61s2 +dwc_ddrphy_apb_wr(0x900e3, 0x32); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b62s0 +dwc_ddrphy_apb_wr(0x900e4, 0xa52); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b62s1 +dwc_ddrphy_apb_wr(0x900e5, 0x69); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b62s2 +dwc_ddrphy_apb_wr(0x900e6, 0x2); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b63s0 +dwc_ddrphy_apb_wr(0x900e7, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b63s1 +dwc_ddrphy_apb_wr(0x900e8, 0x68); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b63s2 +dwc_ddrphy_apb_wr(0x900e9, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b64s0 +dwc_ddrphy_apb_wr(0x900ea, 0x370); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b64s1 +dwc_ddrphy_apb_wr(0x900eb, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b64s2 +dwc_ddrphy_apb_wr(0x900ec, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b65s0 +dwc_ddrphy_apb_wr(0x900ed, 0x1400); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b65s1 +dwc_ddrphy_apb_wr(0x900ee, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b65s2 +dwc_ddrphy_apb_wr(0x900ef, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b66s0 +dwc_ddrphy_apb_wr(0x900f0, 0x8e8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b66s1 +dwc_ddrphy_apb_wr(0x900f1, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b66s2 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 20, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 80, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 40, type = 0 +//// [phyinit_LoadPIECodeSections] No match for ANY enable_bits = 100, type = 0 +//// [phyinit_LoadPIECodeSections] Matched NO enable_bits = 2, type = 0 +dwc_ddrphy_apb_wr(0x900f2, 0x2cd); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b67s0 +dwc_ddrphy_apb_wr(0x900f3, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b67s1 +dwc_ddrphy_apb_wr(0x900f4, 0x68); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b67s2 +dwc_ddrphy_apb_wr(0x900f5, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b68s0 +dwc_ddrphy_apb_wr(0x900f6, 0x8e8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b68s1 +dwc_ddrphy_apb_wr(0x900f7, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b68s2 +dwc_ddrphy_apb_wr(0x900f8, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b69s0 +dwc_ddrphy_apb_wr(0x900f9, 0x3c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b69s1 +dwc_ddrphy_apb_wr(0x900fa, 0x1e9); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b69s2 +dwc_ddrphy_apb_wr(0x900fb, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b70s0 +dwc_ddrphy_apb_wr(0x900fc, 0x370); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b70s1 +dwc_ddrphy_apb_wr(0x900fd, 0x169); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b70s2 +dwc_ddrphy_apb_wr(0x900fe, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b71s0 +dwc_ddrphy_apb_wr(0x900ff, 0xe8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b71s1 +dwc_ddrphy_apb_wr(0x90100, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b71s2 +dwc_ddrphy_apb_wr(0x90101, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b72s0 +dwc_ddrphy_apb_wr(0x90102, 0x8140); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b72s1 +dwc_ddrphy_apb_wr(0x90103, 0x10c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b72s2 +dwc_ddrphy_apb_wr(0x90104, 0x10); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b73s0 +dwc_ddrphy_apb_wr(0x90105, 0x8138); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b73s1 +dwc_ddrphy_apb_wr(0x90106, 0x10c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b73s2 +//// [phyinit_LoadPIECodeSections] Matched ANY enable_bits = 1, type = 0 +dwc_ddrphy_apb_wr(0x90107, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b74s0 +dwc_ddrphy_apb_wr(0x90108, 0x400); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b74s1 +dwc_ddrphy_apb_wr(0x90109, 0x10e); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b74s2 +dwc_ddrphy_apb_wr(0x9010a, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b75s0 +dwc_ddrphy_apb_wr(0x9010b, 0x448); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b75s1 +dwc_ddrphy_apb_wr(0x9010c, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b75s2 +dwc_ddrphy_apb_wr(0x9010d, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b76s0 +dwc_ddrphy_apb_wr(0x9010e, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b76s1 +dwc_ddrphy_apb_wr(0x9010f, 0x101); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b76s2 +dwc_ddrphy_apb_wr(0x90110, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b77s0 +dwc_ddrphy_apb_wr(0x90111, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b77s1 +dwc_ddrphy_apb_wr(0x90112, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b77s2 +dwc_ddrphy_apb_wr(0x90113, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b78s0 +dwc_ddrphy_apb_wr(0x90114, 0x448); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b78s1 +dwc_ddrphy_apb_wr(0x90115, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b78s2 +dwc_ddrphy_apb_wr(0x90116, 0xf); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b79s0 +dwc_ddrphy_apb_wr(0x90117, 0x7c0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b79s1 +dwc_ddrphy_apb_wr(0x90118, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b79s2 +dwc_ddrphy_apb_wr(0x90119, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b80s0 +dwc_ddrphy_apb_wr(0x9011a, 0xe8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b80s1 +dwc_ddrphy_apb_wr(0x9011b, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b80s2 +dwc_ddrphy_apb_wr(0x9011c, 0x7); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b81s0 +dwc_ddrphy_apb_wr(0x9011d, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b81s1 +dwc_ddrphy_apb_wr(0x9011e, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b81s2 +dwc_ddrphy_apb_wr(0x9011f, 0x47); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b82s0 +dwc_ddrphy_apb_wr(0x90120, 0x630); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b82s1 +dwc_ddrphy_apb_wr(0x90121, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b82s2 +dwc_ddrphy_apb_wr(0x90122, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b83s0 +dwc_ddrphy_apb_wr(0x90123, 0x618); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b83s1 +dwc_ddrphy_apb_wr(0x90124, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b83s2 +dwc_ddrphy_apb_wr(0x90125, 0x18); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b84s0 +dwc_ddrphy_apb_wr(0x90126, 0xe0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b84s1 +dwc_ddrphy_apb_wr(0x90127, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b84s2 +dwc_ddrphy_apb_wr(0x90128, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b85s0 +dwc_ddrphy_apb_wr(0x90129, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b85s1 +dwc_ddrphy_apb_wr(0x9012a, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b85s2 +dwc_ddrphy_apb_wr(0x9012b, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b86s0 +dwc_ddrphy_apb_wr(0x9012c, 0x8140); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b86s1 +dwc_ddrphy_apb_wr(0x9012d, 0x10c); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b86s2 +dwc_ddrphy_apb_wr(0x9012e, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b87s0 +dwc_ddrphy_apb_wr(0x9012f, 0x478); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b87s1 +dwc_ddrphy_apb_wr(0x90130, 0x109); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b87s2 +dwc_ddrphy_apb_wr(0x90131, 0x0); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b88s0 +dwc_ddrphy_apb_wr(0x90132, 0x1); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b88s1 +dwc_ddrphy_apb_wr(0x90133, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b88s2 +dwc_ddrphy_apb_wr(0x90134, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b89s0 +dwc_ddrphy_apb_wr(0x90135, 0x4); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b89s1 +dwc_ddrphy_apb_wr(0x90136, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b89s2 +dwc_ddrphy_apb_wr(0x90137, 0x8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b90s0 +dwc_ddrphy_apb_wr(0x90138, 0x7c8); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b90s1 +dwc_ddrphy_apb_wr(0x90139, 0x101); // DWC_DDRPHYA_INITENG0_base0_SequenceReg0b90s2 +//// [phyinit_LoadPIECodeSections] Moving start address from 9013a to 90006 +dwc_ddrphy_apb_wr(0x90006, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b0s0 +dwc_ddrphy_apb_wr(0x90007, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b0s1 +dwc_ddrphy_apb_wr(0x90008, 0x8); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b0s2 +dwc_ddrphy_apb_wr(0x90009, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b1s0 +dwc_ddrphy_apb_wr(0x9000a, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b1s1 +dwc_ddrphy_apb_wr(0x9000b, 0x0); // DWC_DDRPHYA_INITENG0_base0_PostSequenceReg0b1s2 +//// [phyinit_LoadPIECodeSections] Moving start address from 9000c to d00e7 +dwc_ddrphy_apb_wr(0xd00e7, 0x400); // DWC_DDRPHYA_APBONLY0_SequencerOverride +//// [phyinit_LoadPIECodeSections] End of dwc_ddrphy_phyinit_LoadPIECodeSections() +dwc_ddrphy_apb_wr(0x20240, 0x4300); // DWC_DDRPHYA_MASTER0_base0_D5ACSMPtrXlat0 +dwc_ddrphy_apb_wr(0x20242, 0x8944); // DWC_DDRPHYA_MASTER0_base0_D5ACSMPtrXlat2 +dwc_ddrphy_apb_wr(0x20241, 0x4300); // DWC_DDRPHYA_MASTER0_base0_D5ACSMPtrXlat1 +dwc_ddrphy_apb_wr(0x20243, 0x8944); // DWC_DDRPHYA_MASTER0_base0_D5ACSMPtrXlat3 +//seq0b_LoadPstateSeqProductionCode(): --------------------------------------------------------------------------------------------------- +//seq0b_LoadPstateSeqProductionCode(): Programming the 0B sequencer 0b0000 start vector registers with 0. +//seq0b_LoadPstateSeqProductionCode(): Programming the 0B sequencer 0b1000 start vector register with 54. +//seq0b_LoadPstateSeqProductionCode(): Programming the 0B sequencer 0b1111 start vector register with 77. +//seq0b_LoadPstateSeqProductionCode(): --------------------------------------------------------------------------------------------------- +dwc_ddrphy_apb_wr(0x90017, 0x0); // DWC_DDRPHYA_INITENG0_base0_StartVector0b0 +dwc_ddrphy_apb_wr(0x9001f, 0x36); // DWC_DDRPHYA_INITENG0_base0_StartVector0b8 +dwc_ddrphy_apb_wr(0x90026, 0x4d); // DWC_DDRPHYA_INITENG0_base0_StartVector0b15 +dwc_ddrphy_apb_wr(0x9000c, 0x0); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag0 +dwc_ddrphy_apb_wr(0x9000d, 0x173); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag1 +dwc_ddrphy_apb_wr(0x9000e, 0x60); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag2 +dwc_ddrphy_apb_wr(0x9000f, 0x6110); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag3 +dwc_ddrphy_apb_wr(0x90010, 0x2152); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag4 +dwc_ddrphy_apb_wr(0x90011, 0xdfbd); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag5 +dwc_ddrphy_apb_wr(0x90012, 0x8060); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag6 +dwc_ddrphy_apb_wr(0x90013, 0x6152); // DWC_DDRPHYA_INITENG0_base0_Seq0BDisableFlag7 +//// [phyinit_I_loadPIEImage] Enabling Phy Master Interface for DRAM drift compensation +//// [phyinit_I_loadPIEImage] Pstate=0, Memclk=1600MHz, Programming PPTTrainSetup::PhyMstrTrainInterval to 0x0 +//// [phyinit_I_loadPIEImage] Pstate=0, Memclk=1600MHz, Programming PPTTrainSetup::PhyMstrMaxReqToAck to 0x0 +dwc_ddrphy_apb_wr(0x20010, 0x0); // DWC_DDRPHYA_MASTER0_base0_PPTTrainSetup_p0 +//// [phyinit_I_loadPIEImage] Pstate=0, Memclk=1600MHz, Programming PPTTrainSetup2::PhyMstrFreqOverride to 0x3 +dwc_ddrphy_apb_wr(0x20011, 0x3); // DWC_DDRPHYA_MASTER0_base0_PPTTrainSetup2_p0 +//// [phyinit_I_loadPIEImage] Programming D5ACSMXlatSelect to 0x1 +dwc_ddrphy_apb_wr(0x20281, 0x1); // DWC_DDRPHYA_MASTER0_base0_D5ACSMXlatSelect +//// [phyinit_I_loadPIEImage] Programming DbyteRxEnTrain::EnDqsSampNegRxEn to 0x1 +dwc_ddrphy_apb_wr(0x2003b, 0x2); // DWC_DDRPHYA_MASTER0_base0_DbyteRxEnTrain +//// [phyinit_I_loadPIEImage] Pstate=0, Memclk=1600MHz, Programming TrackingModeCntrl to 0x131f +dwc_ddrphy_apb_wr(0x20041, 0x131f); // DWC_DDRPHYA_MASTER0_base0_TrackingModeCntrl_p0 +//// [phyinit_I_loadPIEImage] Programming D5ACSM0MaskCs to 0xe +dwc_ddrphy_apb_wr(0x20131, 0xe); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0MaskCs +//// [phyinit_I_loadPIEImage] Programming D5ACSM1MaskCs to 0xf +dwc_ddrphy_apb_wr(0x20151, 0xf); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1MaskCs +//// [phyinit_I_loadPIEImage] Pstate=0, Memclk=1600MHz, Programming Seq0BGPR6[0] with OuterLoopRepeatCnt values to 0x2 +dwc_ddrphy_apb_wr(0x90306, 0x2); // DWC_DDRPHYA_INITENG0_base0_Seq0BGPR6_p0 +//// [phyinit_I_loadPIEImage] Programming D5ACSM<0/1>OuterLoopRepeatCnt=2 +dwc_ddrphy_apb_wr(0x2012a, 0x2); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0OuterLoopRepeatCnt +dwc_ddrphy_apb_wr(0x2014a, 0x2); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1OuterLoopRepeatCnt +//// [phyinit_I_loadPIEImage] Programming D5ACSM<0/1>AddressMask=7ff +dwc_ddrphy_apb_wr(0x20126, 0x7ff); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0AddressMask +dwc_ddrphy_apb_wr(0x20146, 0x7ff); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1AddressMask +//// [phyinit_I_loadPIEImage] Programming D5ACSM<0/1>AlgaIncVal=1 +dwc_ddrphy_apb_wr(0x20127, 0x1); // DWC_DDRPHYA_MASTER0_base0_D5ACSM0AlgaIncVal +dwc_ddrphy_apb_wr(0x20147, 0x1); // DWC_DDRPHYA_MASTER0_base0_D5ACSM1AlgaIncVal +//// [phyinit_I_loadPIEImage] Turn on calibration and hold idle until dfi_init_start is asserted sequence is triggered. +//// [phyinit_I_loadPIEImage] Programming CalZap to 0x1 +//// [phyinit_I_loadPIEImage] Programming CalRate::CalRun to 0x1 +//// [phyinit_I_loadPIEImage] Programming CalRate to 0x19 +dwc_ddrphy_apb_wr(0x20089, 0x1); // DWC_DDRPHYA_MASTER0_base0_CalZap +dwc_ddrphy_apb_wr(0x20088, 0x19); // DWC_DDRPHYA_MASTER0_base0_CalRate +//// [phyinit_I_loadPIEImage] Programming ForceClkGaterEnables::ForcePubDxClkEnLow to 0x0 +dwc_ddrphy_apb_wr(0x200a6, 0x0); // DWC_DDRPHYA_MASTER0_base0_ForceClkGaterEnables +//// Disabling Ucclk (PMU) and Hclk (training hardware) +dwc_ddrphy_apb_wr(0xc0080, 0x0); // DWC_DDRPHYA_DRTUB0_UcclkHclkEnables +//// Isolate the APB access from the internal CSRs by setting the MicroContMuxSel CSR to 1. +dwc_ddrphy_apb_wr(0xd0000, 0x1); // DWC_DDRPHYA_APBONLY0_MicroContMuxSel +//// [phyinit_userCustom_wait] Wait 40 DfiClks +//// [phyinit_I_loadPIEImage] End of dwc_ddrphy_phyinit_I_loadPIEImage() +// +// +////############################################################## +//// +//// dwc_ddrphy_phyinit_userCustom_customPostTrain is a user-editable function. +//// +//// The purpose of dwc_ddrphy_phyinit_userCustom_customPostTrain() is to override any +//// CSR values programmed by the training firmware or dwc_ddrphy_phyinit_progCsrSkipTrain() +//// This function is executed after training +//// +//// IMPORTANT: in this function, user shall not override any values in userInputBasic and +//// userInputAdvanced data structures. Only CSR programming should be done in this function. +//// +//// Sequence of Events in this function are: +//// 1. Enable APB access. +//// 2. Issue register writes +//// 3. Isolate APB access. +// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_customPostTrain(); + +//// [dwc_ddrphy_phyinit_userCustom_customPostTrain] End of dwc_ddrphy_phyinit_userCustom_customPostTrain() +//// [dwc_ddrphy_phyinit_userCustom_J_enterMissionMode] Start of dwc_ddrphy_phyinit_userCustom_J_enterMissionMode() +// +// +////############################################################## +//// +//// 4.3.10(J) Initialize the PHY to Mission Mode through DFI Initialization +//// +//// Initialize the PHY to mission mode as follows: +//// +//// 1. Set the PHY input clocks to the desired frequency. +//// 2. Initialize the PHY to mission mode by performing DFI Initialization. +//// Please see the DFI specification for more information. See the DFI frequency bus encoding in section <XXX>. +//// Note: The PHY training firmware initializes the DRAM state. if skip +//// training is used, the DRAM state is not initialized. +//// +////############################################################## +// +dwc_ddrphy_phyinit_userCustom_J_enterMissionMode(sdrammc); + +// +//// [dwc_ddrphy_phyinit_userCustom_J_enterMissionMode] End of dwc_ddrphy_phyinit_userCustom_J_enterMissionMode() +// [dwc_ddrphy_phyinit_sequence] End of dwc_ddrphy_phyinit_sequence() +// [dwc_ddrphy_phyinit_main] End of dwc_ddrphy_phyinit_main() diff --git a/drivers/ram/aspeed/sdram_ast2700.c b/drivers/ram/aspeed/sdram_ast2700.c new file mode 100644 index 00000000000..4a019c4edb1 --- /dev/null +++ b/drivers/ram/aspeed/sdram_ast2700.c @@ -0,0 +1,1036 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) ASPEED Technology Inc. + */ +#include <asm/io.h> +#include <asm/arch/fmc_hdr.h> +#include <asm/arch/scu.h> +#include <asm/arch/sdram.h> +#include <config.h> +#include <dm.h> +#include <linux/bitfield.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/sizes.h> +#include <ram.h> + +enum ddr_type { + DDR4_1600 = 0x0, + DDR4_2400, + DDR4_3200, + DDR5_3200, + + DDR_TYPES +}; + +enum ddr_size { + DDR_SIZE_256MB, + DDR_SIZE_512MB, + DDR_SIZE_1GB, + DDR_SIZE_2GB, + + DDR_SIZE_MAX, +}; + +#define IS_DDR4(t) \ + (((t) <= DDR4_3200) ? 1 : 0) + +struct sdrammc_ac_timing { + u32 t_cl; + u32 t_cwl; + u32 t_bl; + u32 t_rcd; /* ACT-to-read/write command delay */ + u32 t_rp; /* PRE command period */ + u32 t_ras; /* ACT-to-PRE command delay */ + u32 t_rrd; /* ACT-to-ACT delay for different BG */ + u32 t_rrd_l; /* ACT-to-ACT delay for same BG */ + u32 t_faw; /* Four active window */ + u32 t_rtp; /* Read-to-PRE command delay */ + u32 t_wtr; /* Minimum write to read command for different BG */ + u32 t_wtr_l; /* Minimum write to read command for same BG */ + u32 t_wtr_a; /* Write to read command for same BG with auto precharge */ + u32 t_wtp; /* Minimum write to precharge command delay */ + u32 t_rtw; /* minimum read to write command */ + u32 t_ccd_l; /* CAS-to-CAS delay for same BG */ + u32 t_dllk; /* DLL locking time */ + u32 t_cksre; /* valid clock before after self-refresh or power-down entry/exit process */ + u32 t_pd; /* power-down entry to exit minimum width */ + u32 t_xp; /* exit power-down to valid command delay */ + u32 t_rfc; /* refresh time period */ + u32 t_mrd; + u32 t_refsbrd; + u32 t_rfcsb; + u32 t_cshsr; + u32 t_zq; +}; + +static const struct sdrammc_ac_timing ac_table[] = { + [DDR4_1600] = { + .t_cl = 10, .t_cwl = 9, .t_bl = 8, .t_rcd = 10, + .t_rp = 10, .t_ras = 28, .t_rrd = 5, .t_rrd_l = 6, + .t_faw = 28, .t_rtp = 6, .t_wtr = 2, .t_wtr_l = 6, + .t_wtr_a = 0, .t_wtp = 12, .t_rtw = 0, .t_ccd_l = 5, + .t_dllk = 597, .t_cksre = 8, .t_pd = 4, .t_xp = 5, + .t_rfc = 880, .t_mrd = 24, .t_refsbrd = 0, .t_rfcsb = 0, + .t_cshsr = 0, .t_zq = 80, + }, + [DDR4_2400] = { + .t_cl = 15, .t_cwl = 12, .t_bl = 8, .t_rcd = 16, + .t_rp = 16, .t_ras = 39, .t_rrd = 7, .t_rrd_l = 8, + .t_faw = 37, .t_rtp = 10, .t_wtr = 4, .t_wtr_l = 10, + .t_wtr_a = 0, .t_wtp = 19, .t_rtw = 0, .t_ccd_l = 7, + .t_dllk = 768, .t_cksre = 13, .t_pd = 7, .t_xp = 8, + .t_rfc = 880, .t_mrd = 24, .t_refsbrd = 0, .t_rfcsb = 0, + .t_cshsr = 0, .t_zq = 80, + }, + [DDR4_3200] = { + .t_cl = 20, .t_cwl = 16, .t_bl = 8, .t_rcd = 20, + .t_rp = 20, .t_ras = 52, .t_rrd = 9, .t_rrd_l = 11, + .t_faw = 48, .t_rtp = 12, .t_wtr = 4, .t_wtr_l = 12, + .t_wtr_a = 0, .t_wtp = 24, .t_rtw = 0, .t_ccd_l = 8, + .t_dllk = 1023, .t_cksre = 16, .t_pd = 8, .t_xp = 10, + .t_rfc = 880, .t_mrd = 24, .t_refsbrd = 0, .t_rfcsb = 0, + .t_cshsr = 0, .t_zq = 80, + }, + [DDR5_3200] = { + .t_cl = 26, .t_cwl = 24, .t_bl = 16, .t_rcd = 26, + .t_rp = 26, .t_ras = 52, .t_rrd = 8, .t_rrd_l = 8, + .t_faw = 40, .t_rtp = 12, .t_wtr = 4, .t_wtr_l = 16, + .t_wtr_a = 36, .t_wtp = 48, .t_rtw = 0, .t_ccd_l = 8, + .t_dllk = 1024, .t_cksre = 9, .t_pd = 13, .t_xp = 13, + .t_rfc = 880, .t_mrd = 23, .t_refsbrd = 48, .t_rfcsb = 208, + .t_cshsr = 30, + .t_zq = 48, + }, +}; + +struct sdrammc { + u32 type; + void __iomem *regs; + void __iomem *phy; + void __iomem *scu0; + void __iomem *scu1; + const struct sdrammc_ac_timing *ac; + struct ram_info info; +}; + +static size_t ast2700_sdrammc_get_vga_mem_size(struct sdrammc *sdrammc) +{ + struct sdrammc_regs *regs = sdrammc->regs; + void *scu0 = sdrammc->scu0; + size_t vga_memsz[] = { + SZ_32M, + SZ_64M, + }; + u32 reg, sel, dual = 0; + + sel = readl(®s->gfmcfg) & 0x1; + + reg = readl(scu0 + SCU0_PCI_MISC70); + if (reg & SCU0_PCI_MISC70_EN_PCIEVGA0) { + debug("VGA0:%dMB\n", vga_memsz[sel] / SZ_1M); + dual++; + } + + reg = readl(scu0 + SCU0_PCI_MISC80); + if (reg & SCU0_PCI_MISC80_EN_PCIEVGA1) { + debug("VGA1:%dMB\n", vga_memsz[sel] / SZ_1M); + dual++; + } + + return vga_memsz[sel] * dual; +} + +static int sdrammc_calc_size(struct sdrammc *sdrammc) +{ + struct sdrammc_regs *regs = sdrammc->regs; + u32 val, test_pattern = 0xdeadbeef; + size_t sz; + + struct { + u32 size; + int rfc[2]; + } ddr_capacity[] = { + { 0x10000000UL, {208, 256} }, /* 256MB */ + { 0x20000000UL, {208, 416} }, /* 512MB */ + { 0x40000000UL, {208, 560} }, /* 1GB */ + { 0x80000000UL, {472, 880} }, /* 2GB */ + }; + + /* Configure ram size to max to enable whole area */ + val = readl(®s->mcfg); + val &= ~(0x7 << 2); + writel(val | (DDR_SIZE_2GB << 2), ®s->mcfg); + + /* Clear basement. */ + writel(0, (void *)CFG_SYS_SDRAM_BASE); + + for (sz = DDR_SIZE_2GB - 1; sz > DDR_SIZE_256MB; sz--) { + test_pattern = (test_pattern << 4) + sz; + writel(test_pattern, (void *)(CFG_SYS_SDRAM_BASE + ddr_capacity[sz].size)); + + if (readl((void *)CFG_SYS_SDRAM_BASE) != test_pattern) + break; + } + + /* re-configure ram size to dramc. */ + val = readl(®s->mcfg); + val &= ~(0x7 << 2); + writel(val | ((sz + 1) << 2), ®s->mcfg); + + /* update rfc in ac_timing5 register. */ + val = readl(®s->actime5); + val &= ~(0x3ff); + val |= (ddr_capacity[sz + 1].rfc[IS_DDR4(sdrammc->type)] >> 1); + writel(val, ®s->actime5); + + /* report actual ram base and size to kernel */ + sdrammc->info.base = CFG_SYS_SDRAM_BASE; + sdrammc->info.size = ddr_capacity[sz + 1].size; + + /* reserve the VGA memory */ + sdrammc->info.size -= ast2700_sdrammc_get_vga_mem_size(sdrammc); + + return 0; +} + +static int sdrammc_bist(struct sdrammc *sdrammc, u32 addr, u32 size, u32 cfg, u32 timeout) +{ + struct sdrammc_regs *regs = sdrammc->regs; + u32 val; + u32 err = 0; + + writel(0, ®s->bistcfg); + writel(cfg, ®s->bistcfg); + writel(addr >> 4, ®s->bist_addr); + writel(size >> 4, ®s->bist_size); + writel(0x89abcdef, ®s->bist_patt); + writel(cfg | DRAMC_BISTCFG_START, ®s->bistcfg); + + while (!(readl(®s->intr_status) & DRAMC_IRQSTA_BIST_DONE)) + ; + + writel(DRAMC_IRQSTA_BIST_DONE, ®s->intr_clear); + + val = readl(®s->bist_res); + + if (val & DRAMC_BISTRES_DONE) { + if (val & DRAMC_BISTRES_FAIL) + err++; + } else { + err++; + } + + return err; +} + +static void sdrammc_enable_refresh(struct sdrammc *sdrammc) +{ + struct sdrammc_regs *regs = sdrammc->regs; + + /* refresh update */ + clrbits_le32(®s->refctl, 0x8000); +} + +static void sdrammc_mr_send(struct sdrammc *sdrammc, u32 ctrl, u32 op) +{ + struct sdrammc_regs *regs = sdrammc->regs; + + writel(op, ®s->mrwr); + writel(ctrl | DRAMC_MRCTL_CMD_START, ®s->mrctl); + + while (!(readl(®s->intr_status) & DRAMC_IRQSTA_MR_DONE)) + ; + + writel(DRAMC_IRQSTA_MR_DONE, ®s->intr_clear); +} + +static void sdrammc_config_mrs(struct sdrammc *sdrammc) +{ + const struct sdrammc_ac_timing *ac = sdrammc->ac; + struct sdrammc_regs *regs = sdrammc->regs; + u32 mr0_cas, mr0_rtp, mr0_val; + u32 mr6_tccd_l, mr6_val; + u32 mr2_cwl, mr2_val; + u32 mr1_val; + u32 mr3_val; + u32 mr4_val; + u32 mr5_val; + + if (!IS_DDR4(sdrammc->type)) + return; + + //------------------------------------------------------------------- + // CAS Latency (Table-15) + //------------------------------------------------------------------- + switch (ac->t_cl) { + case 9: + mr0_cas = 0x00; //5'b00000; + break; + case 10: + mr0_cas = 0x01; //5'b00001; + break; + case 11: + mr0_cas = 0x02; //5'b00010; + break; + case 12: + mr0_cas = 0x03; //5'b00011; + break; + case 13: + mr0_cas = 0x04; //5'b00100; + break; + case 14: + mr0_cas = 0x05; //5'b00101; + break; + case 15: + mr0_cas = 0x06; //5'b00110; + break; + case 16: + mr0_cas = 0x07; //5'b00111; + break; + case 18: + mr0_cas = 0x08; //5'b01000; + break; + case 20: + mr0_cas = 0x09; //5'b01001; + break; + case 22: + mr0_cas = 0x0a; //5'b01010; + break; + case 24: + mr0_cas = 0x0b; //5'b01011; + break; + case 23: + mr0_cas = 0x0c; //5'b01100; + break; + case 17: + mr0_cas = 0x0d; //5'b01101; + break; + case 19: + mr0_cas = 0x0e; //5'b01110; + break; + case 21: + mr0_cas = 0x0f; //5'b01111; + break; + case 25: + mr0_cas = 0x10; //5'b10000; + break; + case 26: + mr0_cas = 0x11; //5'b10001; + break; + case 27: + mr0_cas = 0x12; //5'b10010; + break; + case 28: + mr0_cas = 0x13; //5'b10011; + break; + case 30: + mr0_cas = 0x15; //5'b10101; + break; + case 32: + mr0_cas = 0x17; //5'b10111; + break; + } + + //------------------------------------------------------------------- + // WR and RTP (Table-14) + //------------------------------------------------------------------- + switch (ac->t_rtp) { + case 5: + mr0_rtp = 0x0; //4'b0000; + break; + case 6: + mr0_rtp = 0x1; //4'b0001; + break; + case 7: + mr0_rtp = 0x2; //4'b0010; + break; + case 8: + mr0_rtp = 0x3; //4'b0011; + break; + case 9: + mr0_rtp = 0x4; //4'b0100; + break; + case 10: + mr0_rtp = 0x5; //4'b0101; + break; + case 12: + mr0_rtp = 0x6; //4'b0110; + break; + case 11: + mr0_rtp = 0x7; //4'b0111; + break; + case 13: + mr0_rtp = 0x8; //4'b1000; + break; + } + + //------------------------------------------------------------------- + // CAS Write Latency (Table-21) + //------------------------------------------------------------------- + switch (ac->t_cwl) { + case 9: + mr2_cwl = 0x0; // 3'b000; // 1600 + break; + case 10: + mr2_cwl = 0x1; // 3'b001; // 1866 + break; + case 11: + mr2_cwl = 0x2; // 3'b010; // 2133 + break; + case 12: + mr2_cwl = 0x3; // 3'b011; // 2400 + break; + case 14: + mr2_cwl = 0x4; // 3'b100; // 2666 + break; + case 16: + mr2_cwl = 0x5; // 3'b101; // 2933/3200 + break; + case 18: + mr2_cwl = 0x6; // 3'b110; + break; + case 20: + mr2_cwl = 0x7; // 3'b111; + break; + } + + //------------------------------------------------------------------- + // tCCD_L and tDLLK + //------------------------------------------------------------------- + switch (ac->t_ccd_l) { + case 4: + mr6_tccd_l = 0x0; //3'b000; // rate <= 1333 + break; + case 5: + mr6_tccd_l = 0x1; //3'b001; // 1333 < rate <= 1866 + break; + case 6: + mr6_tccd_l = 0x2; //3'b010; // 1866 < rate <= 2400 + break; + case 7: + mr6_tccd_l = 0x3; //3'b011; // 2400 < rate <= 2666 + break; + case 8: + mr6_tccd_l = 0x4; //3'b100; // 2666 < rate <= 3200 + break; + } + + /* + * mr0_val = + * mr0_rtp[3], // 13 + * mr0_cas[4], // 12 + * mr0_rtp[2:0], // 13,11-9: WR and RTP + * 1'b0, // 8: DLL reset + * 1'b0, // 7: TM + * mr0_cas[3:1], // 6-4,2: CAS latency + * 1'b0, // 3: sequential + * mr0_cas[0], + * 2'b00 // 1-0: burst length + */ + mr0_val = ((mr0_cas & 0x1) << 2) | + (((mr0_cas >> 1) & 0x7) << 4) | + (((mr0_cas >> 4) & 0x1) << 12) | + ((mr0_rtp & 0x7) << 9) | + (((mr0_rtp >> 3) & 0x1) << 13); + + /* + * 3'b2 //[10:8]: rtt_nom, 000:disable,001:rzq/4,010:rzq/2,011:rzq/6,100:rzq/1,101:rzq/5,110:rzq/3,111:rzq/7 + * 1'b0 //[7]: write leveling enable + * 2'b0 //[6:5]: reserved + * 2'b0 //[4:3]: additive latency + * 2'b0 //[2:1]: output driver impedance + * 1'b1 //[0]: enable dll + */ + mr1_val = 0x201; + + /* + * [10:9]: rtt_wr, 00:dynamic odt off, 01:rzq/2, 10:rzq/1, 11: hi-z + * [8]: 0 + */ + mr2_val = ((mr2_cwl & 0x7) << 3) | 0x200; + + mr3_val = 0; + + mr4_val = 0; + + /* + * mr5_val = { + * 1'b0, // 13: RFU + * 1'b0, // 12: read DBI + * 1'b0, // 11: write DBI + * 1'b1, // 10: Data mask + * 1'b0, // 9: C/A parity persistent error + * 3'b000, // 8-6: RTT_PARK (disable) + * 1'b1, // 5: ODT input buffer during power down mode + * 1'b0, // 4: C/A parity status + * 1'b0, // 3: CRC error clear + * 3'b0 // 2-0: C/A parity latency mode + * }; + */ + mr5_val = 0x420; + + /* + * mr6_val = { + * 1'b0, // 13, 9-8: RFU + * mr6_tccd_l[2:0], // 12-10: tCCD_L + * 2'b0, // 13, 9-8: RFU + * 1'b0, // 7: VrefDQ training enable + * 1'b0, // 6: VrefDQ training range + * 6'b0 // 5-0: VrefDQ training value + * }; + */ + mr6_val = ((mr6_tccd_l & 0x7) << 10); + + writel((mr1_val << 16) + mr0_val, ®s->mr01); + writel((mr3_val << 16) + mr2_val, ®s->mr23); + writel((mr5_val << 16) + mr4_val, ®s->mr45); + writel(mr6_val, ®s->mr67); + + /* Power-up initialization sequence */ + sdrammc_mr_send(sdrammc, MR_ADDR(3), 0); + sdrammc_mr_send(sdrammc, MR_ADDR(6), 0); + sdrammc_mr_send(sdrammc, MR_ADDR(5), 0); + sdrammc_mr_send(sdrammc, MR_ADDR(4), 0); + sdrammc_mr_send(sdrammc, MR_ADDR(2), 0); + sdrammc_mr_send(sdrammc, MR_ADDR(1), 0); + sdrammc_mr_send(sdrammc, MR_ADDR(0), 0); +} + +static void sdrammc_exit_self_refresh(struct sdrammc *sdrammc) +{ + struct sdrammc_regs *regs = sdrammc->regs; + + /* exit self-refresh after phy init */ + setbits_le32(®s->mctl, DRAMC_MCTL_SELF_REF_START); + + /* query if self-ref done */ + while (!(readl(®s->intr_status) & DRAMC_IRQSTA_REF_DONE)) + ; + + /* clear status */ + writel(DRAMC_IRQSTA_REF_DONE, ®s->intr_clear); + udelay(1); +} + +/* user-customized functions for the vendor PHY init code */ +#define DWC_PHY_IMEM_OFST 0x50000 +#define DWC_PHY_DMEM_OFST 0x58000 +#define DWC_PHY_MB_START_STREAM_MSG 0x8 +#define DWC_PHY_MB_TRAIN_SUCCESS 0x7 +#define DWC_PHY_MB_TRAIN_FAIL 0xff + +#define dwc_ddrphy_apb_wr(addr, data) \ + writew((data), sdrammc->phy + ((addr) << 1)) + +#define dwc_ddrphy_apb_rd(addr) \ + readw(sdrammc->phy + ((addr) << 1)) + +#define dwc_ddrphy_apb_wr_32b(addr, data) \ + writel((data), sdrammc->phy + ((addr) << 1)) + +#define dwc_ddrphy_apb_rd_32b(addr) \ + readl(sdrammc->phy + ((addr) << 1)) + +void dwc_get_mailbox(struct sdrammc *sdrammc, const int mode, u32 *mbox) +{ + u32 val; + + /* 1. Poll the UctWriteProtShadow, looking for a 0 */ + while (dwc_ddrphy_apb_rd(0xd0004) & BIT(0)) + ; + + /* 2. When a 0 is seen, read the UctWriteOnlyShadow register to get the major message number. */ + *mbox = dwc_ddrphy_apb_rd(0xd0032) & 0xffff; + + /* 3. If reading a streaming or SMBus message, also read the UctDatWriteOnlyShadow register. */ + if (mode) { + val = (dwc_ddrphy_apb_rd(0xd0034)) & 0xffff; + *mbox |= (val << 16); + } + + /* 4. Write the DctWriteProt to 0 to acknowledge the reception of the message */ + dwc_ddrphy_apb_wr(0xd0031, 0); + + /* 5. Poll the UctWriteProtShadow, looking for a 1 */ + while (!(dwc_ddrphy_apb_rd(0xd0004) & BIT(0))) + ; + + /* 6. When a 1 is seen, write the DctWriteProt to 1 to complete the protocol */ + dwc_ddrphy_apb_wr(0xd0031, 1); +} + +uint32_t dwc_readMsgBlock(struct sdrammc *sdrammc, const u32 addr_half) +{ + u32 data_word; + + data_word = dwc_ddrphy_apb_rd_32b((addr_half >> 1) << 1); + + if (addr_half & 0x1) + data_word = data_word >> 16; + else + data_word &= 0xffff; + + return data_word; +} + +int dwc_ddrphy_phyinit_userCustom_H_readMsgBlock(struct sdrammc *sdrammc, int train2D) +{ + u32 msg; + + if (IS_DDR4(sdrammc->type)) { + /* DWC_PHY_DDR4_MB_RESULT */ + msg = dwc_readMsgBlock(sdrammc, 0x5800a); + if (msg & 0xff) + debug("%s: Training Failure index (0x%x)\n", __func__, msg); + else + debug("%s: %dD Training Passed\n", __func__, train2D ? 2 : 1); + } else { + /* DWC_PHY_DDR5_MB_RESULT */ + msg = dwc_readMsgBlock(sdrammc, 0x58007); + if (msg & 0xff00) + debug("%s: Training Failure index (0x%x)\n", __func__, msg); + else + debug("%s: DDR5 1D/2D Training Passed\n", __func__); + + /* DWC_PHY_DDR5_MB_RESULT_ADR */ + msg = dwc_readMsgBlock(sdrammc, 0x5800a); + debug("%s: Result Address Offset (0x%x)\n", __func__, msg); + } + + return 0; +} + +void dwc_ddrphy_phyinit_userCustom_A_bringupPower(void) +{ + /* do nothing */ +} + +void dwc_ddrphy_phyinit_userCustom_B_startClockResetPhy(struct sdrammc *sdrammc) +{ + struct sdrammc_regs *regs = sdrammc->regs; + + /* + * 1. Drive PwrOkIn to 0. Note: Reset, DfiClk, and APBCLK can be X. + * 2. Start DfiClk and APBCLK + * 3. Drive Reset to 1 and PRESETn_APB to 0. + * Note: The combination of PwrOkIn=0 and Reset=1 signals a cold reset to the PHY. + */ + writel(DRAMC_MCTL_PHY_RESET, ®s->mctl); + udelay(2); + + /* + * 5. Drive PwrOkIn to 1. Once the PwrOkIn is asserted (and Reset is still asserted), + * DfiClk synchronously switches to any legal input frequency. + */ + writel(DRAMC_MCTL_PHY_RESET | DRAMC_MCTL_PHY_POWER_ON, ®s->mctl); + udelay(2); + + /* + * 7. Drive Reset to 0. Note: All DFI and APB inputs must be driven at valid reset states + * before the deassertion of Reset. + */ + writel(DRAMC_MCTL_PHY_POWER_ON, ®s->mctl); + udelay(2); + + /* + * 9. Drive PRESETn_APB to 1 to de-assert reset on the ABP bus. + * 10. The PHY is now in the reset state and is ready to accept APB transactions. + */ +} + +void dwc_ddrphy_phyinit_userCustom_overrideUserInput(void) +{ + /* do nothing */ +} + +void dwc_ddrphy_phyinit_userCustom_customPostTrain(void) +{ + /* do nothing */ +} + +void dwc_ddrphy_phyinit_userCustom_E_setDfiClk(struct sdrammc *sdrammc) +{ + dwc_ddrphy_apb_wr(0xd0031, 1); /* DWC_DCTWRITEPROT */ + dwc_ddrphy_apb_wr(0xd0033, 1); /* DWC_UCTWRITEPROT */ +} + +void dwc_ddrphy_phyinit_userCustom_G_waitFwDone(struct sdrammc *sdrammc) +{ + u32 mbox, msg = 0; + + while (msg != DWC_PHY_MB_TRAIN_SUCCESS && msg != DWC_PHY_MB_TRAIN_FAIL) { + dwc_get_mailbox(sdrammc, 0, &mbox); + msg = mbox & 0xffff; + } +} + +void dwc_ddrphy_phyinit_userCustom_J_enterMissionMode(struct sdrammc *sdrammc) +{ + struct sdrammc_regs *regs = sdrammc->regs; + u32 val; + + /* + * 1. Set the PHY input clocks to the desired frequency. + * 2. Initialize the PHY to mission mode by performing DFI Initialization. + * Please see the DFI specification for more information. See the DFI frequency bus encoding in section <XXX>. + * Note: The PHY training firmware initializes the DRAM state. if skip + * training is used, the DRAM state is not initialized. + */ + + writel(0xffffffff, (void *)®s->intr_mask); + + writel(0x0, (void *)®s->dcfg); + + if (!IS_DDR4(sdrammc->type)) { + dwc_ddrphy_apb_wr(0xd0000, 0); /* DWC_DDRPHYA_APBONLY0_MicroContMuxSel */ + dwc_ddrphy_apb_wr(0x20240, 0x3900); /* DWC_DDRPHYA_MASTER0_base0_D5ACSMPtr0lat0 */ + dwc_ddrphy_apb_wr(0x900da, 8); /* DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s0 */ + dwc_ddrphy_apb_wr(0xd0000, 1); /* DWC_DDRPHYA_APBONLY0_MicroContMuxSel */ + } + + /* phy init start */ + val = readl((void *)®s->mctl); + val = val | DRAMC_MCTL_PHY_INIT_START; + writel(val, (void *)®s->mctl); + + /* wait phy complete */ + while (1) { + val = readl(®s->intr_status) & DRAMC_IRQSTA_PHY_INIT_DONE; + if (val == DRAMC_IRQSTA_PHY_INIT_DONE) + break; + } + + writel(0xffff, (void *)®s->intr_clear); + + while (readl((void *)®s->intr_status)) + ; + + if (!IS_DDR4(sdrammc->type)) { + dwc_ddrphy_apb_wr(0xd0000, 0); /* DWC_DDRPHYA_APBONLY0_MicroContMuxSel */ + dwc_ddrphy_apb_wr(0x20240, 0x4300); /* DWC_DDRPHYA_MASTER0_base0_D5ACSMPtr0lat0 */ + dwc_ddrphy_apb_wr(0x900da, 0); /* DWC_DDRPHYA_INITENG0_base0_SequenceReg0b59s0 */ + dwc_ddrphy_apb_wr(0xd0000, 1); /* DWC_DDRPHYA_APBONLY0_MicroContMuxSel */ + } +} + +int dwc_ddrphy_phyinit_userCustom_D_loadIMEM(struct sdrammc *sdrammc, const int train2D) +{ + u32 imem_ofst, imem_size; + u32 pb_type; + + if (IS_DDR4(sdrammc->type)) + pb_type = (train2D) ? PBT_DDR4_2D_PMU_TRAIN_IMEM : PBT_DDR4_PMU_TRAIN_IMEM; + else + pb_type = PBT_DDR5_PMU_TRAIN_IMEM; + + fmc_hdr_get_prebuilt(pb_type, &imem_ofst, &imem_size); + + memcpy(sdrammc->phy + (DWC_PHY_IMEM_OFST << 1), + (void *)(0x20000000 + imem_ofst), imem_size); + + return 0; +} + +int dwc_ddrphy_phyinit_userCustom_F_loadDMEM(struct sdrammc *sdrammc, + const int pState, const int train2D) +{ + u32 dmem_ofst, dmem_size; + u32 pb_type; + + if (IS_DDR4(sdrammc->type)) + pb_type = (train2D) ? PBT_DDR4_2D_PMU_TRAIN_DMEM : PBT_DDR4_PMU_TRAIN_DMEM; + else + pb_type = PBT_DDR5_PMU_TRAIN_DMEM; + + fmc_hdr_get_prebuilt(pb_type, &dmem_ofst, &dmem_size); + + memcpy(sdrammc->phy + (DWC_PHY_DMEM_OFST << 1), + (void *)(0x20000000 + dmem_ofst), dmem_size); + + return 0; +} + +static void sdrammc_dwc_phy_init(struct sdrammc *sdrammc) +{ + /* enable ddr phy free-run clock */ + writel(SCU0_CLKGATE1_CLR_DDRPHY, sdrammc->scu0 + SCU0_CLKGATE1_CLR); + + /* include the vendor-provided PHY init code */ + if (IS_DDR4(sdrammc->type)) { + #include "dwc_ddrphy_phyinit_ddr4-3200-nodimm-train2D.c" + } else { + #include "dwc_ddrphy_phyinit_ddr5-3200-nodimm-train2D.c" + } +} + +static void sdrammc_config_ac_timing(struct sdrammc *sdrammc) +{ + const struct sdrammc_ac_timing *ac = sdrammc->ac; + struct sdrammc_regs *regs = sdrammc->regs; + u32 actime; + +#define ACTIME1(ccd, rrd_l, rrd, mrd) \ + (((ccd) << 24) | \ + (((rrd_l) >> 1) << 16) | \ + (((rrd) >> 1) << 8) | \ + ((mrd) >> 1)) + +#define ACTIME2(faw, rp, ras, rcd) \ + ((((faw) >> 1) << 24) | \ + (((rp) >> 1) << 16) | \ + (((ras) >> 1) << 8) | \ + ((rcd) >> 1)) + +#define ACTIME3(wtr, rtw, wtp, rtp) \ + ((((wtr) >> 1) << 24) | \ + (((rtw) >> 1) << 16) | \ + (((wtp) >> 1) << 8) | \ + ((rtp) >> 1)) + +#define ACTIME4(wtr_a, wtr_l) \ + ((((wtr_a) >> 1) << 8) | \ + ((wtr_l) >> 1)) + +#define ACTIME5(refsbrd, rfcsb, rfc) \ + ((((refsbrd) >> 1) << 20) | \ + (((rfcsb) >> 1) << 10) | \ + ((rfc) >> 1)) + +#define ACTIME6(cshsr, pd, xp, cksre) \ + ((((cshsr) >> 1) << 24) | \ + (((pd) >> 1) << 16) | \ + (((xp) >> 1) << 8) | \ + ((cksre) >> 1)) + +#define ACTIME7(zqcs, dllk) \ + ((((zqcs) >> 1) << 10) | \ + ((dllk) >> 1)) + + actime = ACTIME1(ac->t_ccd_l, ac->t_rrd_l, ac->t_rrd, ac->t_mrd); + writel(actime, ®s->actime1); + + actime = ACTIME2(ac->t_faw, ac->t_rp, ac->t_ras, ac->t_rcd); + writel(actime, ®s->actime2); + + actime = ACTIME3(ac->t_cwl + ac->t_bl / 2 + ac->t_wtr, + ac->t_cl - ac->t_cwl + (ac->t_bl / 2) + 2, + ac->t_cwl + ac->t_bl / 2 + ac->t_wtp, + ac->t_rtp); + writel(actime, ®s->actime3); + + actime = ACTIME4(ac->t_cwl + ac->t_bl / 2 + ac->t_wtr_a, + ac->t_cwl + ac->t_bl / 2 + ac->t_wtr_l); + writel(actime, ®s->actime4); + + actime = ACTIME5(ac->t_refsbrd, ac->t_rfcsb, ac->t_rfc); + writel(actime, ®s->actime5); + + actime = ACTIME6(ac->t_cshsr, ac->t_pd, ac->t_xp, ac->t_cksre); + writel(actime, ®s->actime6); + + actime = ACTIME7(ac->t_zq, ac->t_dllk); + writel(actime, ®s->actime7); +} + +static void sdrammc_config_registers(struct sdrammc *sdrammc) +{ + const struct sdrammc_ac_timing *ac = sdrammc->ac; + struct sdrammc_regs *regs = sdrammc->regs; + u32 reg; + + u32 dram_size = 5; + u32 t_phy_wrdata; + u32 t_phy_wrlat; + u32 t_phy_rddata_en; + u32 t_phy_odtlat; + u32 t_phy_odtext; + + if (IS_DDR4(sdrammc->type)) { + t_phy_wrlat = ac->t_cwl - 5 - 4; + t_phy_rddata_en = ac->t_cl - 5 - 4; + t_phy_wrdata = 2; + t_phy_odtlat = ac->t_cwl - 5 - 4; + t_phy_odtext = 0; + } else { + t_phy_wrlat = ac->t_cwl - 13 - 3; + t_phy_rddata_en = ac->t_cl - 13 - 3; + t_phy_wrdata = 6; + t_phy_odtlat = 0; + t_phy_odtext = 0; + } + + writel(0x20 + (dram_size << 2) + !!!IS_DDR4(sdrammc->type), ®s->mcfg); + + reg = (t_phy_odtext << 20) + (t_phy_odtlat << 16) + + (t_phy_rddata_en << 10) + (t_phy_wrdata << 6) + + t_phy_wrlat; + writel(reg, ®s->dfi_timing); + writel(0, ®s->dctl); + + writel(0x40b48200, ®s->refctl); + + writel(0x42aa1800, ®s->zqctl); + + writel(0, ®s->arbctl); + + if (!IS_DDR4(sdrammc->type)) + writel(0, ®s->refmng_ctl); + + writel(0xffffffff, ®s->intr_mask); +} + +static void sdrammc_init(struct sdrammc *sdrammc) +{ + u32 reg; + + reg = readl(sdrammc->scu1 + SCU1_HWSTRAP1); + + if (reg & SCU1_HWSTRAP1_DDR4) { + if (IS_ENABLED(CONFIG_ASPEED_DDR_1600)) + sdrammc->type = DDR4_1600; + else if (IS_ENABLED(CONFIG_ASPEED_DDR_2400)) + sdrammc->type = DDR4_2400; + else if (IS_ENABLED(CONFIG_ASPEED_DDR_3200)) + sdrammc->type = DDR4_3200; + } else { + sdrammc->type = DDR5_3200; + } + + sdrammc->ac = &ac_table[sdrammc->type]; + + sdrammc_config_ac_timing(sdrammc); + sdrammc_config_registers(sdrammc); +} + +static int ast2700_sdrammc_probe(struct udevice *dev) +{ + struct sdrammc *sdrammc = dev_get_priv(dev); + struct sdrammc_regs *regs = sdrammc->regs; + u32 bistcfg; + u32 reg; + int rc; + + /* skip DRAM init if already done */ + reg = readl(sdrammc->scu0 + SCU0_VGA0_SCRATCH); + if (reg & SCU0_VGA0_SCRATCH_DRAM_INIT) + goto out; + + /* unlock DRAM controller */ + writel(DRAMC_UNLK_KEY, ®s->prot_key); + + sdrammc_init(sdrammc); + + sdrammc_dwc_phy_init(sdrammc); + + sdrammc_exit_self_refresh(sdrammc); + + sdrammc_config_mrs(sdrammc); + + sdrammc_enable_refresh(sdrammc); + + bistcfg = FIELD_PREP(DRAMC_BISTCFG_PMODE, BIST_PMODE_CRC) | + FIELD_PREP(DRAMC_BISTCFG_BMODE, BIST_BMODE_RW_SWITCH) | + DRAMC_BISTCFG_ENABLE; + + rc = sdrammc_bist(sdrammc, 0, 0x10000, bistcfg, 0x200000); + if (rc) { + debug("bist test failed, type=%d\n", sdrammc->type); + return rc; + } + + /* set DRAM init flag */ + reg |= SCU0_VGA0_SCRATCH_DRAM_INIT; + writel(reg, sdrammc->scu0 + SCU0_VGA0_SCRATCH); + +out: + sdrammc_calc_size(sdrammc); + + return 0; +} + +static int ast2700_sdrammc_of_to_plat(struct udevice *dev) +{ + struct sdrammc *sdrammc = dev_get_priv(dev); + u32 phandle; + ofnode node; + int rc; + + sdrammc->regs = (struct sdrammc_regs *)devfdt_get_addr_index(dev, 0); + if (sdrammc->regs == (void *)FDT_ADDR_T_NONE) { + debug("cannot map DRAM register\n"); + return -ENODEV; + } + + sdrammc->phy = (void *)devfdt_get_addr_index(dev, 1); + if (sdrammc->phy == (void *)FDT_ADDR_T_NONE) { + debug("cannot map PHY memory\n"); + return -ENODEV; + } + + rc = ofnode_read_u32(dev_ofnode(dev), "aspeed,scu0", &phandle); + if (rc) { + debug("cannot find SCU0 handle\n"); + return -ENODEV; + } + + node = ofnode_get_by_phandle(phandle); + if (!ofnode_valid(node)) { + debug("cannot get SCU0 node\n"); + return -ENODEV; + } + + sdrammc->scu0 = (void *)ofnode_get_addr(node); + if (sdrammc->scu0 == (void *)FDT_ADDR_T_NONE) { + debug("cannot map SCU0 register\n"); + return -ENODEV; + } + + rc = ofnode_read_u32(dev_ofnode(dev), "aspeed,scu1", &phandle); + if (rc) { + debug("cannot find SCU1 handle\n"); + return -ENODEV; + } + + node = ofnode_get_by_phandle(phandle); + if (!ofnode_valid(node)) { + debug("cannot get SCU1 node\n"); + return -ENODEV; + } + + sdrammc->scu1 = (void *)ofnode_get_addr(node); + if (sdrammc->scu1 == (void *)FDT_ADDR_T_NONE) { + debug("cannot map SCU1 register\n"); + return -ENODEV; + } + + return 0; +} + +static int ast2700_sdrammc_get_info(struct udevice *dev, struct ram_info *info) +{ + struct sdrammc *sdrammc = dev_get_priv(dev); + + *info = sdrammc->info; + + return 0; +} + +static struct ram_ops ast2700_sdrammc_ops = { + .get_info = ast2700_sdrammc_get_info, +}; + +static const struct udevice_id ast2700_sdrammc_ids[] = { + { .compatible = "aspeed,ast2700-sdrammc" }, + { } +}; + +U_BOOT_DRIVER(sdrammc_ast2700) = { + .name = "aspeed_ast2700_sdrammc", + .id = UCLASS_RAM, + .of_match = ast2700_sdrammc_ids, + .ops = &ast2700_sdrammc_ops, + .of_to_plat = ast2700_sdrammc_of_to_plat, + .probe = ast2700_sdrammc_probe, + .priv_auto = sizeof(struct sdrammc), +}; diff --git a/drivers/ram/k3-ddrss/lpddr4.c b/drivers/ram/k3-ddrss/lpddr4.c index 11ef242a37b..9f9abfeca48 100644 --- a/drivers/ram/k3-ddrss/lpddr4.c +++ b/drivers/ram/k3-ddrss/lpddr4.c @@ -155,10 +155,11 @@ u32 lpddr4_start(const lpddr4_privatedata *pd) u32 result = 0U; result = lpddr4_startsf(pd); - if (result == (u32)0) { + if (result == (u32)0) result = lpddr4_enablepiinitiator(pd); + if (result == (u32)0) result = lpddr4_startsequencecontroller(pd); - } + return result; } diff --git a/drivers/spi/renesas_rpc_spi.c b/drivers/spi/renesas_rpc_spi.c index e6b602cf7b4..f1e6f9f4e01 100644 --- a/drivers/spi/renesas_rpc_spi.c +++ b/drivers/spi/renesas_rpc_spi.c @@ -145,6 +145,12 @@ #define RPC_PHYCNT_WBUF BIT(2) #define RPC_PHYCNT_MEM(v) (((v) & 0x3) << 0) +#define RPCIF_PHYOFFSET1 0x0080 /* R/W */ +#define RPCIF_PHYOFFSET1_DDRTMG(v) (((v) & 0x3) << 28) + +#define RPCIF_PHYOFFSET2 0x0084 /* R/W */ +#define RPCIF_PHYOFFSET2_OCTTMG(v) (((v) & 0x7) << 8) + #define RPC_PHYINT 0x0088 /* R/W */ #define RPC_PHYINT_RSTEN BIT(18) #define RPC_PHYINT_WPEN BIT(17) @@ -227,6 +233,12 @@ static int rpc_spi_claim_bus(struct udevice *dev, bool manual) struct udevice *bus = dev->parent; struct rpc_spi_priv *priv = dev_get_priv(bus); + setbits_le32(priv->regs + RPCIF_PHYOFFSET1, + RPCIF_PHYOFFSET1_DDRTMG(3)); + clrsetbits_le32(priv->regs + RPCIF_PHYOFFSET2, + RPCIF_PHYOFFSET2_OCTTMG(7), + RPCIF_PHYOFFSET2_OCTTMG(4)); + /* NOTE: The 0x260 are undocumented bits, but they must be set. */ writel(RPC_PHYCNT_CAL | rpc_spi_get_strobe_delay() | 0x260, priv->regs + RPC_PHYCNT); @@ -277,24 +289,24 @@ static int rpc_spi_mem_exec_op(struct spi_slave *spi, writel(RPC_DRCMR_CMD(op->cmd.opcode), priv->regs + RPC_DRCMR); smenr |= RPC_DRENR_CDE; - writel(0, priv->regs + RPC_DREAR); if (op->addr.nbytes == 4) { writel(RPC_DREAR_EAV(offset >> 25) | RPC_DREAR_EAC(1), priv->regs + RPC_DREAR); smenr |= RPC_DRENR_ADE(0xF); } else if (op->addr.nbytes == 3) { + writel(0, priv->regs + RPC_DREAR); smenr |= RPC_DRENR_ADE(0x7); } else { + writel(0, priv->regs + RPC_DREAR); smenr |= RPC_DRENR_ADE(0); } - writel(0, priv->regs + RPC_DRDMCR); - if (op->dummy.nbytes) { - writel(8 * op->dummy.nbytes - 1, priv->regs + RPC_DRDMCR); + if (op->dummy.nbytes) smenr |= RPC_DRENR_DME; - } + writel(8 * op->dummy.nbytes - 1, priv->regs + RPC_DRDMCR); writel(0, priv->regs + RPC_DROPR); + writel(0, priv->regs + RPC_DRDRENR); writel(smenr, priv->regs + RPC_DRENR); memcpy_fromio(din, (void *)(priv->extr + offset), op->data.nbytes); @@ -453,6 +465,7 @@ static const struct dm_spi_ops rpc_spi_ops = { static const struct udevice_id rpc_spi_ids[] = { { .compatible = "renesas,r7s72100-rpc-if" }, { .compatible = "renesas,rcar-gen3-rpc-if" }, + { .compatible = "renesas,rcar-gen4-rpc-if" }, { } }; diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index 6b1de82ae38..cb6fc0e7fda 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -106,6 +106,12 @@ config AST_TIMER This is mostly because they all share several registers which makes it difficult to completely separate them. +config AST_IBEX_TIMER + bool "Aspeed ast2700 Ibex timer" + depends on TIMER + help + Select this to enable a timer support for the Ibex RV32-based MCUs in AST2700. + config ATCPIT100_TIMER bool "ATCPIT100 timer support" depends on TIMER diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile index fb95c8899e3..fec4af392e6 100644 --- a/drivers/timer/Makefile +++ b/drivers/timer/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_$(SPL_)ANDES_PLMT_TIMER) += andes_plmt_timer.o obj-$(CONFIG_ARC_TIMER) += arc_timer.o obj-$(CONFIG_ARM_TWD_TIMER) += arm_twd_timer.o obj-$(CONFIG_AST_TIMER) += ast_timer.o +obj-$(CONFIG_AST_IBEX_TIMER) += ast_ibex_timer.o obj-$(CONFIG_ATCPIT100_TIMER) += atcpit100_timer.o obj-$(CONFIG_$(SPL_)ATMEL_PIT_TIMER) += atmel_pit_timer.o obj-$(CONFIG_$(SPL_)ATMEL_TCB_TIMER) += atmel_tcb_timer.o diff --git a/drivers/timer/ast_ibex_timer.c b/drivers/timer/ast_ibex_timer.c new file mode 100644 index 00000000000..261839661e9 --- /dev/null +++ b/drivers/timer/ast_ibex_timer.c @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2024 Aspeed Technology Inc. + */ + +#include <asm/csr.h> +#include <asm/io.h> +#include <dm.h> +#include <errno.h> +#include <timer.h> + +#define CSR_MCYCLE 0xb00 +#define CSR_MCYCLEH 0xb80 + +static u64 ast_ibex_timer_get_count(struct udevice *dev) +{ + uint32_t cnt_l, cnt_h; + + cnt_l = csr_read(CSR_MCYCLE); + cnt_h = csr_read(CSR_MCYCLEH); + + return ((uint64_t)cnt_h << 32) | cnt_l; +} + +static int ast_ibex_timer_probe(struct udevice *dev) +{ + return 0; +} + +static const struct timer_ops ast_ibex_timer_ops = { + .get_count = ast_ibex_timer_get_count, +}; + +static const struct udevice_id ast_ibex_timer_ids[] = { + { .compatible = "aspeed,ast2700-ibex-timer" }, + { } +}; + +U_BOOT_DRIVER(ast_ibex_timer) = { + .name = "ast_ibex_timer", + .id = UCLASS_TIMER, + .of_match = ast_ibex_timer_ids, + .probe = ast_ibex_timer_probe, + .ops = &ast_ibex_timer_ops, +}; diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index a972d87c7ad..311aaa7e67f 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -99,7 +99,8 @@ config USB_STORAGE config USB_KEYBOARD bool "USB Keyboard support" - select DM_KEYBOARD if DM_USB + depends on DM_USB + select DM_KEYBOARD select SYS_STDIO_DEREGISTER ---help--- Say Y here if you want to use a USB keyboard for U-Boot command line diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 32b2c412068..ac7e469469a 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -965,6 +965,12 @@ int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep, if (priv_dev->dev_ver <= DEV_VER_V2) cdns3_wa1_tray_restore_cycle_bit(priv_dev, priv_ep); + /* Flush TRBs */ + flush_dcache_range((unsigned long)priv_ep->trb_pool, + (unsigned long)priv_ep->trb_pool + + ROUND(sizeof(struct cdns3_trb) * priv_ep->num_trbs, + CONFIG_SYS_CACHELINE_SIZE)); + trace_cdns3_prepare_trb(priv_ep, priv_req->trb); /* @@ -1153,6 +1159,13 @@ static void cdns3_transfer_completed(struct cdns3_device *priv_dev, priv_ep->endpoint.desc->bEndpointAddress); #endif + /* Invalidate TRBs */ + invalidate_dcache_range((unsigned long)priv_ep->trb_pool, + (unsigned long)priv_ep->trb_pool + + ROUND(sizeof(struct cdns3_trb) * + priv_ep->num_trbs, + CONFIG_SYS_CACHELINE_SIZE)); + if (!cdns3_request_handled(priv_ep, priv_req)) goto prepare_next_td; diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 4621a6fd5e6..f20a16e3e7d 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -323,7 +323,8 @@ config SPL_DFU bool "Support DFU (Device Firmware Upgrade) in SPL" select SPL_HASH select SPL_DFU_NO_RESET - depends on SPL_RAM_SUPPORT + select SPL_RAM_SUPPORT + depends on DFU_OVER_USB help This feature enables the DFU (Device Firmware Upgrade) in SPL with RAM memory device support. The ROM code will load and execute @@ -16,7 +16,7 @@ #include <spi_flash.h> #include <search.h> #include <errno.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/cache.h> #include <asm/global_data.h> #include <dm/device-internal.h> diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c index 1149a3b2007..350cff0cbca 100644 --- a/fs/btrfs/btrfs.c +++ b/fs/btrfs/btrfs.c @@ -7,7 +7,7 @@ #include <config.h> #include <malloc.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/time.h> #include "btrfs.h" #include "crypto/hash.h" diff --git a/fs/btrfs/compat.h b/fs/btrfs/compat.h index 02173dea5f4..4596b9d1dd3 100644 --- a/fs/btrfs/compat.h +++ b/fs/btrfs/compat.h @@ -5,7 +5,7 @@ #include <linux/errno.h> #include <fs_internal.h> -#include <uuid.h> +#include <u-boot/uuid.h> /* Provide a compatibility layer to make code syncing easier */ diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 34d9d535121..14efe7218df 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include <fs_internal.h> #include <log.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <memalign.h> #include "kernel-shared/btrfs_tree.h" #include "common/rbtree-utils.h" diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index da59cb008fc..15587e92e3e 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -27,7 +27,7 @@ #include <div64.h> #include <malloc.h> #include <part.h> -#include <uuid.h> +#include <u-boot/uuid.h> int ext4fs_symlinknest; struct ext_filesystem ext_fs; diff --git a/include/configs/arbel.h b/include/configs/arbel.h index 61f6a5e2438..b5f684e88fe 100644 --- a/include/configs/arbel.h +++ b/include/configs/arbel.h @@ -16,7 +16,7 @@ { 9600, 14400, 19200, 38400, 57600, 115200, 230400, 380400, 460800, 921600 } /* Default environemnt variables */ -#define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80400000\0" \ +#define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80800000\0" \ "stdin=serial\0" \ "stdout=serial\0" \ "stderr=serial\0" \ diff --git a/include/configs/ibex_ast2700.h b/include/configs/ibex_ast2700.h new file mode 100644 index 00000000000..0f6850f7240 --- /dev/null +++ b/include/configs/ibex_ast2700.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) Aspeed Technology Inc. + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CFG_SYS_UBOOT_BASE CONFIG_TEXT_BASE +#define CFG_SYS_SDRAM_BASE 0x80000000 + +#endif /* __CONFIG_H */ diff --git a/include/configs/lxr2.h b/include/configs/lxr2.h new file mode 100644 index 00000000000..d8d37a42228 --- /dev/null +++ b/include/configs/lxr2.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +// Copyright (C) Stefano Babic <sbabic@denx.de> + +#ifndef __LXR2_CONFIG_H +#define __LXR2_CONFIG_H + +#include <config_distro_bootcmd.h> + +#include "mx6_common.h" + +#define PHYS_SDRAM_SIZE SZ_1G + +/* Physical Memory Map */ +#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR + +#define CFG_SYS_SDRAM_BASE PHYS_SDRAM +#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR +#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE + +#define CFG_SYS_FSL_ESDHC_ADDR 0 +#define CFG_MXC_UART_BASE UART4_BASE + +#endif diff --git a/include/console.h b/include/console.h index 6b6d0f9de73..57fdb0834c1 100644 --- a/include/console.h +++ b/include/console.h @@ -179,6 +179,14 @@ void console_puts_select_stderr(bool serial_only, const char *s); */ int console_clear(void); +/** + * console_remove_by_name() - Remove a console by its stdio name + * + * This must only be used in tests. It removes any use of the named stdio device + * from the console tables. + */ +int console_remove_by_name(const char *name); + /* * CONSOLE multiplexing. */ diff --git a/include/dt-bindings/clock/sophgo,cv1800.h b/include/dt-bindings/clock/sophgo,cv1800.h new file mode 100644 index 00000000000..cfbeca25a65 --- /dev/null +++ b/include/dt-bindings/clock/sophgo,cv1800.h @@ -0,0 +1,176 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * Copyright (C) 2023 Sophgo Ltd. + */ + +#ifndef __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ +#define __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ + +#define CLK_MPLL 0 +#define CLK_TPLL 1 +#define CLK_FPLL 2 +#define CLK_MIPIMPLL 3 +#define CLK_A0PLL 4 +#define CLK_DISPPLL 5 +#define CLK_CAM0PLL 6 +#define CLK_CAM1PLL 7 + +#define CLK_MIPIMPLL_D3 8 +#define CLK_CAM0PLL_D2 9 +#define CLK_CAM0PLL_D3 10 + +#define CLK_TPU 11 +#define CLK_TPU_FAB 12 +#define CLK_AHB_ROM 13 +#define CLK_DDR_AXI_REG 14 +#define CLK_RTC_25M 15 +#define CLK_SRC_RTC_SYS_0 16 +#define CLK_TEMPSEN 17 +#define CLK_SARADC 18 +#define CLK_EFUSE 19 +#define CLK_APB_EFUSE 20 +#define CLK_DEBUG 21 +#define CLK_AP_DEBUG 22 +#define CLK_XTAL_MISC 23 +#define CLK_AXI4_EMMC 24 +#define CLK_EMMC 25 +#define CLK_EMMC_100K 26 +#define CLK_AXI4_SD0 27 +#define CLK_SD0 28 +#define CLK_SD0_100K 29 +#define CLK_AXI4_SD1 30 +#define CLK_SD1 31 +#define CLK_SD1_100K 32 +#define CLK_SPI_NAND 33 +#define CLK_ETH0_500M 34 +#define CLK_AXI4_ETH0 35 +#define CLK_ETH1_500M 36 +#define CLK_AXI4_ETH1 37 +#define CLK_APB_GPIO 38 +#define CLK_APB_GPIO_INTR 39 +#define CLK_GPIO_DB 40 +#define CLK_AHB_SF 41 +#define CLK_AHB_SF1 42 +#define CLK_A24M 43 +#define CLK_AUDSRC 44 +#define CLK_APB_AUDSRC 45 +#define CLK_SDMA_AXI 46 +#define CLK_SDMA_AUD0 47 +#define CLK_SDMA_AUD1 48 +#define CLK_SDMA_AUD2 49 +#define CLK_SDMA_AUD3 50 +#define CLK_I2C 51 +#define CLK_APB_I2C 52 +#define CLK_APB_I2C0 53 +#define CLK_APB_I2C1 54 +#define CLK_APB_I2C2 55 +#define CLK_APB_I2C3 56 +#define CLK_APB_I2C4 57 +#define CLK_APB_WDT 58 +#define CLK_PWM_SRC 59 +#define CLK_PWM 60 +#define CLK_SPI 61 +#define CLK_APB_SPI0 62 +#define CLK_APB_SPI1 63 +#define CLK_APB_SPI2 64 +#define CLK_APB_SPI3 65 +#define CLK_1M 66 +#define CLK_CAM0_200 67 +#define CLK_PM 68 +#define CLK_TIMER0 69 +#define CLK_TIMER1 70 +#define CLK_TIMER2 71 +#define CLK_TIMER3 72 +#define CLK_TIMER4 73 +#define CLK_TIMER5 74 +#define CLK_TIMER6 75 +#define CLK_TIMER7 76 +#define CLK_UART0 77 +#define CLK_APB_UART0 78 +#define CLK_UART1 79 +#define CLK_APB_UART1 80 +#define CLK_UART2 81 +#define CLK_APB_UART2 82 +#define CLK_UART3 83 +#define CLK_APB_UART3 84 +#define CLK_UART4 85 +#define CLK_APB_UART4 86 +#define CLK_APB_I2S0 87 +#define CLK_APB_I2S1 88 +#define CLK_APB_I2S2 89 +#define CLK_APB_I2S3 90 +#define CLK_AXI4_USB 91 +#define CLK_APB_USB 92 +#define CLK_USB_125M 93 +#define CLK_USB_33K 94 +#define CLK_USB_12M 95 +#define CLK_AXI4 96 +#define CLK_AXI6 97 +#define CLK_DSI_ESC 98 +#define CLK_AXI_VIP 99 +#define CLK_SRC_VIP_SYS_0 100 +#define CLK_SRC_VIP_SYS_1 101 +#define CLK_SRC_VIP_SYS_2 102 +#define CLK_SRC_VIP_SYS_3 103 +#define CLK_SRC_VIP_SYS_4 104 +#define CLK_CSI_BE_VIP 105 +#define CLK_CSI_MAC0_VIP 106 +#define CLK_CSI_MAC1_VIP 107 +#define CLK_CSI_MAC2_VIP 108 +#define CLK_CSI0_RX_VIP 109 +#define CLK_CSI1_RX_VIP 110 +#define CLK_ISP_TOP_VIP 111 +#define CLK_IMG_D_VIP 112 +#define CLK_IMG_V_VIP 113 +#define CLK_SC_TOP_VIP 114 +#define CLK_SC_D_VIP 115 +#define CLK_SC_V1_VIP 116 +#define CLK_SC_V2_VIP 117 +#define CLK_SC_V3_VIP 118 +#define CLK_DWA_VIP 119 +#define CLK_BT_VIP 120 +#define CLK_DISP_VIP 121 +#define CLK_DSI_MAC_VIP 122 +#define CLK_LVDS0_VIP 123 +#define CLK_LVDS1_VIP 124 +#define CLK_PAD_VI_VIP 125 +#define CLK_PAD_VI1_VIP 126 +#define CLK_PAD_VI2_VIP 127 +#define CLK_CFG_REG_VIP 128 +#define CLK_VIP_IP0 129 +#define CLK_VIP_IP1 130 +#define CLK_VIP_IP2 131 +#define CLK_VIP_IP3 132 +#define CLK_IVE_VIP 133 +#define CLK_RAW_VIP 134 +#define CLK_OSDC_VIP 135 +#define CLK_CAM0_VIP 136 +#define CLK_AXI_VIDEO_CODEC 137 +#define CLK_VC_SRC0 138 +#define CLK_VC_SRC1 139 +#define CLK_VC_SRC2 140 +#define CLK_H264C 141 +#define CLK_APB_H264C 142 +#define CLK_H265C 143 +#define CLK_APB_H265C 144 +#define CLK_JPEG 145 +#define CLK_APB_JPEG 146 +#define CLK_CAM0 147 +#define CLK_CAM1 148 +#define CLK_WGN 149 +#define CLK_WGN0 150 +#define CLK_WGN1 151 +#define CLK_WGN2 152 +#define CLK_KEYSCAN 153 +#define CLK_CFG_REG_VC 154 +#define CLK_C906_0 155 +#define CLK_C906_1 156 +#define CLK_A53 157 +#define CLK_CPU_AXI0 158 +#define CLK_CPU_GIC 159 +#define CLK_XTAL_AP 160 + +// Only for CV181x +#define CLK_DISP_SRC_VIP 161 + +#endif /* __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ */ diff --git a/include/efi.h b/include/efi.h index d5af2139946..84640cf7b25 100644 --- a/include/efi.h +++ b/include/efi.h @@ -74,7 +74,7 @@ struct efi_device_path { * struct { u32 a; u16; b; u16 c; u8 d[8]; }; which is 4-byte * aligned. */ -typedef struct { +typedef struct efi_guid { u8 b[16]; } efi_guid_t __attribute__((aligned(4))); diff --git a/include/efi_variable.h b/include/efi_variable.h index 223bb9a4a5b..4065cf45eca 100644 --- a/include/efi_variable.h +++ b/include/efi_variable.h @@ -38,7 +38,7 @@ efi_status_t efi_get_variable_int(const u16 *variable_name, void *data, u64 *timep); /** - * efi_set_variable() - set value of a UEFI variable + * efi_set_variable_int() - set value of a UEFI variable * * @variable_name: name of the variable * @vendor: vendor GUID diff --git a/include/event.h b/include/event.h index fb353ad623e..75141a192a4 100644 --- a/include/event.h +++ b/include/event.h @@ -385,7 +385,7 @@ static inline int event_notify_null(enum event_t type) int event_uninit(void); /** - * event_uninit() - Set up dynamic events + * event_init() - Set up dynamic events * * Init a list of dynamic event handlers, so that these can be added as * needed diff --git a/include/expo.h b/include/expo.h index 264745f7f01..c235fa2709d 100644 --- a/include/expo.h +++ b/include/expo.h @@ -42,7 +42,7 @@ enum expoact_type { * * @type: Action type (EXPOACT_NONE if there is no action) * @select: Used for EXPOACT_POINT_ITEM and EXPOACT_SELECT - * @id: ID number of the object affected. + * @select.id: ID number of the object affected. */ struct expo_action { enum expoact_type type; diff --git a/include/flash.h b/include/flash.h index 60babe8a805..32bc65e7b60 100644 --- a/include/flash.h +++ b/include/flash.h @@ -127,16 +127,16 @@ void flash_perror(int err); /*----------------------------------------------------------------------- * return codes from flash_write(): */ -#define ERR_OK 0 -#define ERR_TIMEOUT 1 -#define ERR_NOT_ERASED 2 -#define ERR_PROTECTED 4 -#define ERR_INVAL 8 -#define ERR_ALIGN 16 -#define ERR_UNKNOWN_FLASH_VENDOR 32 -#define ERR_UNKNOWN_FLASH_TYPE 64 -#define ERR_PROG_ERROR 128 -#define ERR_ABORTED 256 +#define FL_ERR_OK 0 +#define FL_ERR_TIMEOUT 1 +#define FL_ERR_NOT_ERASED 2 +#define FL_ERR_PROTECTED 4 +#define FL_ERR_INVAL 8 +#define FL_ERR_ALIGN 16 +#define FL_ERR_UNKNOWN_FLASH_VENDOR 32 +#define FL_ERR_UNKNOWN_FLASH_TYPE 64 +#define FL_ERR_PROG_ERROR 128 +#define FL_ERR_ABORTED 256 /*----------------------------------------------------------------------- * Protection Flags for flash_protect(): diff --git a/include/fwu.h b/include/fwu.h index 77ec65e6180..6441de370c9 100644 --- a/include/fwu.h +++ b/include/fwu.h @@ -10,7 +10,7 @@ #include <efi.h> #include <fwu_mdata.h> #include <mtd.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/types.h> @@ -417,4 +417,15 @@ int fwu_state_machine_updates(bool trial_state, uint32_t update_index); */ int fwu_init(void); +/** + * fwu_bank_accepted() - Has the bank been accepted + * @data: Version agnostic FWU metadata information + * @bank: Update bank to check + * + * Check in the given bank if all the images have been accepted. + * + * Return: true if all images accepted, false otherwise + */ +bool fwu_bank_accepted(struct fwu_data *data, uint32_t bank); + #endif /* _FWU_H_ */ diff --git a/include/getopt.h b/include/getopt.h index 8645082da2a..0cf7ee84d6f 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -20,11 +20,9 @@ struct getopt_state { * parsed all of @argv, then @index will equal @argc. */ int index; - /* private: */ /** @arg_index: Index within the current argument */ int arg_index; union { - /* public: */ /** * @opt: Option being parsed when an error occurs. @opt is only * valid when getopt() returns ``?`` or ``:``. @@ -35,7 +33,6 @@ struct getopt_state { * is only valid when getopt() returns an option character. */ char *arg; - /* private: */ }; }; diff --git a/include/lmb.h b/include/lmb.h index fc2daaa7bfc..aee2f9fcdaa 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -111,6 +111,11 @@ struct lmb *lmb_get(void); int lmb_push(struct lmb *store); void lmb_pop(struct lmb *store); +static inline int lmb_read_check(phys_addr_t addr, phys_size_t len) +{ + return lmb_alloc_addr(addr, len) == addr ? 0 : -1; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_LMB_H */ diff --git a/include/log.h b/include/log.h index 69dcb339543..7c25bf0b081 100644 --- a/include/log.h +++ b/include/log.h @@ -104,6 +104,8 @@ enum log_category_t { LOGC_FS, /** @LOGC_EXPO: Related to expo handling */ LOGC_EXPO, + /** @LOGC_CONSOLE: Related to the console and stdio */ + LOGC_CONSOLE, /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT, /** @LOGC_END: Sentinel value for lists of log categories */ diff --git a/include/mmc.h b/include/mmc.h index f508cd15700..0044ff8bef7 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -14,6 +14,7 @@ #include <linux/sizes.h> #include <linux/compiler.h> #include <linux/dma-direction.h> +#include <cyclic.h> #include <part.h> struct bd_info; @@ -757,6 +758,8 @@ struct mmc { bool hs400_tuning:1; enum bus_mode user_speed_mode; /* input speed mode from user */ + + CONFIG_IS_ENABLED(CYCLIC, (struct cyclic_info cyclic)); }; #if CONFIG_IS_ENABLED(DM_MMC) diff --git a/include/os.h b/include/os.h index 4371270a1ee..ae3ca6d42a2 100644 --- a/include/os.h +++ b/include/os.h @@ -24,7 +24,7 @@ struct sandbox_state; int os_printf(const char *format, ...); /** - * Access to the OS read() system call + * os_read() - access the OS read() system call * * @fd: File descriptor as returned by os_open() * @buf: Buffer to place data @@ -34,7 +34,7 @@ int os_printf(const char *format, ...); ssize_t os_read(int fd, void *buf, size_t count); /** - * Access to the OS write() system call + * os_write() - access the OS write() system call * * @fd: File descriptor as returned by os_open() * @buf: Buffer containing data to write @@ -44,7 +44,7 @@ ssize_t os_read(int fd, void *buf, size_t count); ssize_t os_write(int fd, const void *buf, size_t count); /** - * Access to the OS lseek() system call + * os_lseek() - access the OS lseek() system call * * @fd: File descriptor as returned by os_open() * @offset: File offset (based on whence) @@ -67,7 +67,7 @@ off_t os_lseek(int fd, off_t offset, int whence); off_t os_filesize(int fd); /** - * Access to the OS open() system call + * os_open() - access the OS open() system call * * @pathname: Pathname of file to open * @flags: Flags, like OS_O_RDONLY, OS_O_RDWR @@ -162,7 +162,7 @@ void os_raise_sigalrm(void); void os_tty_raw(int fd, bool allow_sigs); /** - * os_fs_restore() - restore the tty to its original mode + * os_fd_restore() - restore the tty to its original mode * * Call this to restore the original terminal mode, after it has been changed * by os_tty_raw(). This is an internal function. @@ -207,14 +207,14 @@ void *os_realloc(void *ptr, size_t length); void os_usleep(unsigned long usec); /** - * Gets a monotonic increasing number of nano seconds from the OS + * os_get_nsec() - get monotonically increasing number of nano seconds from OS * - * Return: a monotonic increasing time scaled in nano seconds + * Return: a monotoniccally increasing time scaled in nano seconds */ uint64_t os_get_nsec(void); /** - * Parse arguments and update sandbox state. + * os_parse_args() - parse arguments and update sandbox state. * * @state: sandbox state to update * @argc: argument count diff --git a/include/part.h b/include/part.h index 54b986cee63..797b542ef1f 100644 --- a/include/part.h +++ b/include/part.h @@ -8,7 +8,7 @@ #include <blk.h> #include <ide.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linker_lists.h> #include <linux/errno.h> #include <linux/list.h> diff --git a/include/power/pca9450.h b/include/power/pca9450.h index b8219d535ad..f896d829d37 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -54,6 +54,8 @@ enum { PCA9450_REG_NUM, }; +#define PCA9450_REG_PWRCTRL_TOFF_DEB BIT(5) + int power_pca9450_init(unsigned char bus, unsigned char addr); enum { diff --git a/include/power/regulator.h b/include/power/regulator.h index bb07a814c79..8a914dfc74f 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -415,26 +415,6 @@ int regulator_get_mode(struct udevice *dev); int regulator_set_mode(struct udevice *dev, int mode_id); /** - * regulators_enable_boot_on() - enable regulators needed for boot - * - * This enables all regulators which are marked to be on at boot time. This - * only works for regulators which don't have a range for voltage/current, - * since in that case it is not possible to know which value to use. - * - * This effectively calls regulator_autoset() for every regulator. - */ -int regulators_enable_boot_on(bool verbose); - -/** - * regulators_enable_boot_off() - disable regulators needed for boot - * - * This disables all regulators which are marked to be off at boot time. - * - * This effectively calls regulator_unset() for every regulator. - */ -int regulators_enable_boot_off(bool verbose); - -/** * regulator_autoset: setup the voltage/current on a regulator * * The setup depends on constraints found in device's uclass's platform data @@ -454,18 +434,6 @@ int regulators_enable_boot_off(bool verbose); int regulator_autoset(struct udevice *dev); /** - * regulator_unset: turn off a regulator - * - * The setup depends on constraints found in device's uclass's platform data - * (struct dm_regulator_uclass_platdata): - * - * - Disable - will set - if 'force_off' is set to true, - * - * The function returns on the first-encountered error. - */ -int regulator_unset(struct udevice *dev); - -/** * regulator_autoset_by_name: setup the regulator given by its uclass's * platform data name field. The setup depends on constraints found in device's * uclass's platform data (struct dm_regulator_uclass_plat): @@ -629,11 +597,6 @@ static inline int regulator_set_mode(struct udevice *dev, int mode_id) return -ENOSYS; } -static inline int regulators_enable_boot_on(bool verbose) -{ - return -ENOSYS; -} - static inline int regulator_autoset(struct udevice *dev) { return -ENOSYS; diff --git a/include/rkmtd.h b/include/rkmtd.h index 145fede6c84..b7479036b39 100644 --- a/include/rkmtd.h +++ b/include/rkmtd.h @@ -11,7 +11,7 @@ #define __RKMTD__ #include <part_efi.h> -#include <uuid.h> +#include <u-boot/uuid.h> #define LBA 64 + 512 + 33 diff --git a/include/sandbox_efi_capsule.h b/include/sandbox_efi_capsule.h index 3e288e8a84a..84d45ec5cfd 100644 --- a/include/sandbox_efi_capsule.h +++ b/include/sandbox_efi_capsule.h @@ -6,9 +6,9 @@ #if !defined(_SANDBOX_EFI_CAPSULE_H_) #define _SANDBOX_EFI_CAPSULE_H_ -#define SANDBOX_UBOOT_IMAGE_GUID "09d7cf52-0720-4710-91d1-08469b7fe9c8" -#define SANDBOX_UBOOT_ENV_IMAGE_GUID "5a7021f5-fef2-48b4-aaba-832e777418c0" -#define SANDBOX_FIT_IMAGE_GUID "3673b45d-6a7c-46f3-9e60-adabb03f7937" +#define SANDBOX_UBOOT_IMAGE_GUID "985f2937-7c2e-5e9a-8a5e-8e063312964b" +#define SANDBOX_UBOOT_ENV_IMAGE_GUID "9e339473-c2eb-530a-a69b-0cd6bbbed40e" +#define SANDBOX_FIT_IMAGE_GUID "46610520-469e-59dc-a8dd-c11832b877ea" #define SANDBOX_INCORRECT_GUID "058b7d83-50d5-4c47-a195-60d86ad341c4" #define UBOOT_FIT_IMAGE "u-boot_bin_env.itb" diff --git a/include/uuid.h b/include/u-boot/uuid.h index f5a941250f4..7f8414dc906 100644 --- a/include/uuid.h +++ b/include/u-boot/uuid.h @@ -11,6 +11,7 @@ #define __UUID_H__ #include <linux/bitops.h> +#include <linux/kconfig.h> /* * UUID - Universally Unique IDentifier - 128 bits unique number. @@ -46,8 +47,8 @@ * When converting to a binary UUID, le means the field should be converted * to little endian and be means it should be converted to big endian. * - * UUID is also used as GUID (Globally Unique Identifier) with the same binary - * format but it differs in string format like below. + * UUID is also used as GUID (Globally Unique Identifier) with the same format + * but with some fields stored in little endian. * * GUID: * 0 9 14 19 24 @@ -69,8 +70,8 @@ struct uuid { /* Bits of a bitmask specifying the output format for GUIDs */ #define UUID_STR_FORMAT_STD 0 -#define UUID_STR_FORMAT_GUID BIT(0) -#define UUID_STR_UPPER_CASE BIT(1) +#define UUID_STR_FORMAT_GUID 0x1 +#define UUID_STR_UPPER_CASE 0x2 /* Use UUID_STR_LEN + 1 for string space */ #define UUID_STR_LEN 36 @@ -143,6 +144,18 @@ void gen_rand_uuid(unsigned char *uuid_bin); */ void gen_rand_uuid_str(char *uuid_str, int str_format); +struct efi_guid; + +/** + * gen_v5_guid() - generate little endian v5 GUID from namespace and other seed data. + * + * @namespace: pointer to UUID namespace salt + * @guid: pointer to allocated GUID output + * @...: NULL terminated list of seed data as pairs of pointers + * to data and their lengths + */ +void gen_v5_guid(const struct uuid *namespace, struct efi_guid *guid, ...); + /** * uuid_str_to_le_bin() - Convert string UUID to little endian binary data. * @uuid_str: pointer to UUID string diff --git a/include/usb.h b/include/usb.h index fcbe2146f7d..be37ed272e1 100644 --- a/include/usb.h +++ b/include/usb.h @@ -250,20 +250,12 @@ int usb_host_eth_scan(int mode); #endif -#ifdef CONFIG_USB_KEYBOARD - /* * USB Keyboard reports are 8 bytes in boot protocol. * Appendix B of HID Device Class Definition 1.11 */ #define USB_KBD_BOOT_REPORT_SIZE 8 -int drv_usb_kbd_init(void); -int usb_kbd_deregister(int force); - -#endif -/* routines */ - /* * usb_init() - initialize the USB Controllers * @@ -1100,4 +1092,16 @@ struct usb_generic_descriptor **usb_emul_find_descriptor( */ void usb_show_tree(void); +/** + * usb_kbd_remove_for_test() - Remove any USB keyboard + * + * This can only be called from test_pre_run(). It removes the USB keyboard from + * the console system so that the USB device can be dropped + */ +#if CONFIG_IS_ENABLED(USB_KEYBOARD) +int usb_kbd_remove_for_test(void); +#else +static inline int usb_kbd_remove_for_test(void) { return 0; } +#endif + #endif /*_USB_H_ */ diff --git a/lib/Kconfig b/lib/Kconfig index 5f282ecb543..1dd4f271595 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -73,6 +73,7 @@ config HAVE_PRIVATE_LIBGCC config LIB_UUID bool + select SHA1 config RANDOM_UUID bool "GPT Random UUID generation" @@ -1081,8 +1082,6 @@ config SMBIOS_PARSER help A simple parser for SMBIOS data. -source "lib/efi/Kconfig" -source "lib/efi_loader/Kconfig" source "lib/optee/Kconfig" config TEST_FDTDEC diff --git a/lib/acpi/acpi_dp.c b/lib/acpi/acpi_dp.c index 6733809986a..5714acce088 100644 --- a/lib/acpi/acpi_dp.c +++ b/lib/acpi/acpi_dp.c @@ -9,7 +9,7 @@ #include <dm.h> #include <log.h> #include <malloc.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <acpi/acpigen.h> #include <acpi/acpi_dp.h> #include <dm/acpi.h> diff --git a/lib/acpi/acpigen.c b/lib/acpi/acpigen.c index b95cabb9149..ecff5a50d50 100644 --- a/lib/acpi/acpigen.c +++ b/lib/acpi/acpigen.c @@ -10,7 +10,7 @@ #include <dm.h> #include <log.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <acpi/acpigen.h> #include <acpi/acpi_device.h> #include <acpi/acpi_table.h> diff --git a/lib/efi/Kconfig b/lib/efi/Kconfig index c2b9bb73f71..81ed3e66b34 100644 --- a/lib/efi/Kconfig +++ b/lib/efi/Kconfig @@ -1,3 +1,6 @@ +menu "U-Boot as UEFI application" + depends on X86 + config EFI bool "Support running U-Boot from EFI" depends on X86 @@ -72,3 +75,5 @@ config EFI_RAM_SIZE use. U-Boot allocates this from EFI on start-up (along with a few other smaller amounts) and it can never be increased after that. It is used as the RAM size in with U-Boot. + +endmenu diff --git a/lib/efi/efi_app.c b/lib/efi/efi_app.c index 88332c3c910..9b94a93ee4f 100644 --- a/lib/efi/efi_app.c +++ b/lib/efi/efi_app.c @@ -17,7 +17,7 @@ #include <init.h> #include <malloc.h> #include <sysreset.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm/global_data.h> #include <linux/err.h> #include <linux/types.h> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 6ffefa9103f..e58b8825605 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -1,3 +1,5 @@ +menu "UEFI Support" + config EFI_LOADER bool "Support running UEFI applications" depends on OF_LIBFDT && ( \ @@ -41,13 +43,58 @@ config EFI_BINARY_EXEC You may enable CMD_BOOTEFI_BINARY so that you can use bootefi command to do that. -config EFI_BOOTMGR - bool "UEFI Boot Manager" +config EFI_SECURE_BOOT + bool "Enable EFI secure boot support" + depends on EFI_LOADER && FIT_SIGNATURE + select HASH + select SHA256 + select RSA + select RSA_VERIFY_WITH_PKEY + select IMAGE_SIGN_INFO + select ASYMMETRIC_KEY_TYPE + select ASYMMETRIC_PUBLIC_KEY_SUBTYPE + select X509_CERTIFICATE_PARSER + select PKCS7_MESSAGE_PARSER + select PKCS7_VERIFY + select MSCODE_PARSER + select EFI_SIGNATURE_SUPPORT + help + Select this option to enable EFI secure boot support. + Once SecureBoot mode is enforced, any EFI binary can run only if + it is signed with a trusted key. To do that, you need to install, + at least, PK, KEK and db. + +config EFI_SIGNATURE_SUPPORT + bool + +menu "UEFI services" + +config EFI_GET_TIME + bool "GetTime() runtime service" + depends on DM_RTC default y help - Select this option if you want to select the UEFI binary to be booted - via UEFI variables Boot####, BootOrder, and BootNext. You should also - normally enable CMD_BOOTEFI_BOOTMGR so that the command is available. + Provide the GetTime() runtime service at boottime. This service + can be used by an EFI application to read the real time clock. + +config EFI_SET_TIME + bool "SetTime() runtime service" + depends on EFI_GET_TIME + default y if ARCH_QEMU || SANDBOX + help + Provide the SetTime() runtime service at boottime. This service + can be used by an EFI application to adjust the real time clock. + +config EFI_HAVE_RUNTIME_RESET + # bool "Reset runtime service is available" + bool + default y + depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ + SANDBOX || SYSRESET_SBI || SYSRESET_X86 + +endmenu + +menu "UEFI Variables" choice prompt "Store for non-volatile UEFI variables" @@ -172,30 +219,18 @@ config EFI_VAR_BUF_SIZE Minimum 4096, default 131072 -config EFI_GET_TIME - bool "GetTime() runtime service" - depends on DM_RTC - default y +config EFI_PLATFORM_LANG_CODES + string "Language codes supported by firmware" + default "en-US" help - Provide the GetTime() runtime service at boottime. This service - can be used by an EFI application to read the real time clock. + This value is used to initialize the PlatformLangCodes variable. Its + value is a semicolon (;) separated list of language codes in native + RFC 4646 format, e.g. "en-US;de-DE". The first language code is used + to initialize the PlatformLang variable. -config EFI_SET_TIME - bool "SetTime() runtime service" - depends on EFI_GET_TIME - default y if ARCH_QEMU || SANDBOX - help - Provide the SetTime() runtime service at boottime. This service - can be used by an EFI application to adjust the real time clock. +endmenu -config EFI_SCROLL_ON_CLEAR_SCREEN - bool "Avoid overwriting previous output on clear screen" - help - Instead of erasing the screen content when the console screen should - be cleared, emit blank new lines so that previous output is scrolled - out of sight rather than overwritten. On serial consoles this allows - to capture complete boot logs (except for interactive menus etc.) - and can ease debugging related issues. +menu "Capsule support" config EFI_HAVE_CAPSULE_SUPPORT bool @@ -237,6 +272,18 @@ config EFI_CAPSULE_ON_DISK_EARLY executed as part of U-Boot initialisation so that they will surely take place whatever is set to distro_bootcmd. +config EFI_CAPSULE_NAMESPACE_GUID + string "Namespace for dynamic capsule GUIDs" + # v4 UUID as a default for upstream U-Boot boards + default "8c9f137e-91dc-427b-b2d6-b420faebaf2a" + depends on EFI_HAVE_CAPSULE_SUPPORT + help + Define the namespace or "salt" GUID used to generate the per-image + GUIDs. This should be a GUID in the standard 8-4-4-4-12 format. + + Device vendors are expected to generate their own namespace GUID + to avoid conflicts with upstream/community images. + config EFI_CAPSULE_FIRMWARE bool @@ -309,6 +356,10 @@ config EFI_CAPSULE_CRT_FILE embedded in the platform's device tree and used for capsule authentication at the time of capsule update. +endmenu + +menu "UEFI protocol support" + config EFI_DEVICE_PATH_TO_TEXT bool "Device path to text protocol" default y @@ -362,39 +413,6 @@ config EFI_UNICODE_CAPITALIZATION endif -config EFI_LOADER_BOUNCE_BUFFER - bool "EFI Applications use bounce buffers for DMA operations" - help - Some hardware does not support DMA to full 64bit addresses. For this - hardware we can create a bounce buffer so that payloads don't have to - worry about platform details. - -config EFI_PLATFORM_LANG_CODES - string "Language codes supported by firmware" - default "en-US" - help - This value is used to initialize the PlatformLangCodes variable. Its - value is a semicolon (;) separated list of language codes in native - RFC 4646 format, e.g. "en-US;de-DE". The first language code is used - to initialize the PlatformLang variable. - -config EFI_HAVE_RUNTIME_RESET - # bool "Reset runtime service is available" - bool - default y - depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ - SANDBOX || SYSRESET_SBI || SYSRESET_X86 - -config EFI_GRUB_ARM32_WORKAROUND - bool "Workaround for GRUB on 32bit ARM" - default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU - default y - depends on ARM && !ARM64 - help - GRUB prior to version 2.04 requires U-Boot to disable caches. This - workaround currently is also needed on systems with caches that - cannot be managed via CP15. - config EFI_RNG_PROTOCOL bool "EFI_RNG_PROTOCOL support" depends on DM_RNG @@ -447,29 +465,36 @@ config EFI_LOAD_FILE2_INITRD installed and Linux 5.7+ will ignore any initrd=<ramdisk> command line argument. -config EFI_SECURE_BOOT - bool "Enable EFI secure boot support" - depends on EFI_LOADER && FIT_SIGNATURE - select HASH - select SHA256 - select RSA - select RSA_VERIFY_WITH_PKEY - select IMAGE_SIGN_INFO - select ASYMMETRIC_KEY_TYPE - select ASYMMETRIC_PUBLIC_KEY_SUBTYPE - select X509_CERTIFICATE_PARSER - select PKCS7_MESSAGE_PARSER - select PKCS7_VERIFY - select MSCODE_PARSER - select EFI_SIGNATURE_SUPPORT +config EFI_RISCV_BOOT_PROTOCOL + bool "RISCV_EFI_BOOT_PROTOCOL support" + default y + depends on RISCV help - Select this option to enable EFI secure boot support. - Once SecureBoot mode is enforced, any EFI binary can run only if - it is signed with a trusted key. To do that, you need to install, - at least, PK, KEK and db. + The EFI_RISCV_BOOT_PROTOCOL is used to transfer the boot hart ID + to the next boot stage. It should be enabled as it is meant to + replace the transfer via the device-tree. The latter is not + possible on systems using ACPI. -config EFI_SIGNATURE_SUPPORT - bool +endmenu + +menu "Misc options" +config EFI_LOADER_BOUNCE_BUFFER + bool "EFI Applications use bounce buffers for DMA operations" + depends on ARM64 + help + Some hardware does not support DMA to full 64bit addresses. For this + hardware we can create a bounce buffer so that payloads don't have to + worry about platform details. + +config EFI_GRUB_ARM32_WORKAROUND + bool "Workaround for GRUB on 32bit ARM" + default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU + default y + depends on ARM && !ARM64 + help + GRUB prior to version 2.04 requires U-Boot to disable caches. This + workaround currently is also needed on systems with caches that + cannot be managed via CP15. config EFI_ESRT bool "Enable the UEFI ESRT generation" @@ -496,15 +521,26 @@ config EFI_EBBR_2_1_CONFORMANCE help Enabling this option adds the EBBRv2.1 conformance entry to the ECPT UEFI table. -config EFI_RISCV_BOOT_PROTOCOL - bool "RISCV_EFI_BOOT_PROTOCOL support" +config EFI_SCROLL_ON_CLEAR_SCREEN + bool "Avoid overwriting previous output on clear screen" + help + Instead of erasing the screen content when the console screen should + be cleared, emit blank new lines so that previous output is scrolled + out of sight rather than overwritten. On serial consoles this allows + to capture complete boot logs (except for interactive menus etc.) + and can ease debugging related issues. + +endmenu + +menu "EFI bootmanager" + +config EFI_BOOTMGR + bool "UEFI Boot Manager" default y - depends on RISCV help - The EFI_RISCV_BOOT_PROTOCOL is used to transfer the boot hart ID - to the next boot stage. It should be enabled as it is meant to - replace the transfer via the device-tree. The latter is not - possible on systems using ACPI. + Select this option if you want to select the UEFI binary to be booted + via UEFI variables Boot####, BootOrder, and BootNext. You should also + normally enable CMD_BOOTEFI_BOOTMGR so that the command is available. config EFI_HTTP_BOOT bool "EFI HTTP Boot support" @@ -514,5 +550,10 @@ config EFI_HTTP_BOOT help Enabling this option adds EFI HTTP Boot support. It allows to directly boot from network. +endmenu endif + +source "lib/efi/Kconfig" + +endmenu diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 589d3996b68..a3aa2b8d1b9 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -380,14 +380,15 @@ err: } /** - * efi_bootmgr_release_uridp_resource() - cleanup uri device path resource + * efi_bootmgr_release_uridp() - cleanup uri device path resource * * @ctx: event context * Return: status code */ -efi_status_t efi_bootmgr_release_uridp_resource(struct uridp_context *ctx) +efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx) { efi_status_t ret = EFI_SUCCESS; + efi_status_t ret2 = EFI_SUCCESS; if (!ctx) return ret; @@ -407,32 +408,33 @@ efi_status_t efi_bootmgr_release_uridp_resource(struct uridp_context *ctx) /* cleanup for PE-COFF image */ if (ctx->mem_handle) { - ret = efi_uninstall_multiple_protocol_interfaces( - ctx->mem_handle, &efi_guid_device_path, ctx->loaded_dp, - NULL); - if (ret != EFI_SUCCESS) + ret2 = efi_uninstall_multiple_protocol_interfaces(ctx->mem_handle, + &efi_guid_device_path, + ctx->loaded_dp, + NULL); + if (ret2 != EFI_SUCCESS) log_err("Uninstall device_path protocol failed\n"); } efi_free_pool(ctx->loaded_dp); free(ctx); - return ret; + return ret == EFI_SUCCESS ? ret2 : ret; } /** - * efi_bootmgr_image_return_notify() - return to efibootmgr callback + * efi_bootmgr_http_return() - return to efibootmgr callback * * @event: the event for which this notification function is registered * @context: event context */ -static void EFIAPI efi_bootmgr_image_return_notify(struct efi_event *event, - void *context) +static void EFIAPI efi_bootmgr_http_return(struct efi_event *event, + void *context) { efi_status_t ret; EFI_ENTRY("%p, %p", event, context); - ret = efi_bootmgr_release_uridp_resource(context); + ret = efi_bootmgr_release_uridp(context); EFI_EXIT(ret); } @@ -533,7 +535,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, /* create event for cleanup when the image returns or error occurs */ ret = efi_create_event(EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - efi_bootmgr_image_return_notify, ctx, + efi_bootmgr_http_return, ctx, &efi_guid_event_group_return_to_efibootmgr, &event); if (ret != EFI_SUCCESS) { @@ -544,7 +546,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, return ret; err: - efi_bootmgr_release_uridp_resource(ctx); + efi_bootmgr_release_uridp(ctx); return ret; } diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 635088f25a1..f8a4a7c6ef4 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -20,6 +20,7 @@ #include <sort.h> #include <sysreset.h> #include <asm/global_data.h> +#include <u-boot/uuid.h> #include <crypto/pkcs7.h> #include <crypto/pkcs7_parser.h> @@ -563,9 +564,14 @@ static efi_status_t efi_capsule_update_firmware( bool fw_accept_os; if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { - if (fwu_empty_capsule_checks_pass() && - fwu_empty_capsule(capsule_data)) - return fwu_empty_capsule_process(capsule_data); + if (fwu_empty_capsule(capsule_data)) { + if (fwu_empty_capsule_checks_pass()) { + return fwu_empty_capsule_process(capsule_data); + } else { + log_err("FWU empty capsule checks failed. Cannot start update\n"); + return EFI_INVALID_PARAMETER; + } + } if (!fwu_update_checks_pass()) { log_err("FWU checks failed. Cannot start update\n"); diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index c944c10b216..9d9f786a6db 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -100,7 +100,7 @@ static int term_get_char(s32 *c) } /** - * Receive and parse a reply from the terminal. + * term_read_reply() - receive and parse a reply from the terminal * * @n: array of return values * @num: number of return values expected @@ -181,7 +181,7 @@ static efi_status_t EFIAPI efi_cout_output_string( } pos = buf; utf16_utf8_strcpy(&pos, string); - fputs(stdout, buf); + puts(buf); free(buf); /* diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 0f684590f22..9de3b95d073 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -17,7 +17,7 @@ #include <nvme.h> #include <efi_loader.h> #include <part.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <asm-generic/unaligned.h> #include <linux/compat.h> /* U16_MAX */ diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 222001d6a3b..c92d8ccf004 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -295,7 +295,7 @@ out: } /** - * efi_file_open_() + * efi_file_open() - open file synchronously * * This function implements the Open service of the File Protocol. * See the UEFI spec for details. diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index ba5aba098c0..6650c2b8071 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c @@ -246,6 +246,55 @@ void efi_firmware_fill_version_info(struct efi_firmware_image_descriptor *image_ } /** + * efi_gen_capsule_guids - generate GUIDs for the images + * + * Generate the image_type_id for each image in the update_info.images array + * using the first compatible from the device tree and a salt + * UUID defined at build time. + * + * Returns: status code + */ +static efi_status_t efi_gen_capsule_guids(void) +{ + int ret, i; + struct uuid namespace; + const char *compatible; /* Full array including null bytes */ + struct efi_fw_image *fw_array; + + fw_array = update_info.images; + /* Check if we need to run (there are images and we didn't already generate their IDs) */ + if (!update_info.num_images || + memchr_inv(&fw_array[0].image_type_id, 0, sizeof(fw_array[0].image_type_id))) + return EFI_SUCCESS; + + ret = uuid_str_to_bin(CONFIG_EFI_CAPSULE_NAMESPACE_GUID, + (unsigned char *)&namespace, UUID_STR_FORMAT_GUID); + if (ret) { + log_debug("%s: EFI_CAPSULE_NAMESPACE_GUID is invalid: %d\n", __func__, ret); + return EFI_INVALID_PARAMETER; + } + + compatible = ofnode_read_string(ofnode_root(), "compatible"); + if (!compatible) { + log_debug("%s: model or compatible not defined\n", __func__); + return EFI_INVALID_PARAMETER; + } + + for (i = 0; i < update_info.num_images; i++) { + gen_v5_guid(&namespace, + &fw_array[i].image_type_id, + compatible, strlen(compatible), + fw_array[i].fw_name, u16_strlen(fw_array[i].fw_name) * sizeof(uint16_t), + NULL); + + log_debug("Image %ls UUID %pUl\n", fw_array[i].fw_name, + &fw_array[i].image_type_id); + } + + return EFI_SUCCESS; +} + +/** * efi_fill_image_desc_array - populate image descriptor array * @image_info_size: Size of @image_info * @image_info: Image information @@ -272,7 +321,7 @@ static efi_status_t efi_fill_image_desc_array( { size_t total_size; struct efi_fw_image *fw_array; - int i; + int i, ret; total_size = sizeof(*image_info) * update_info.num_images; @@ -283,6 +332,10 @@ static efi_status_t efi_fill_image_desc_array( } *image_info_size = total_size; + ret = efi_gen_capsule_guids(); + if (ret != EFI_SUCCESS) + return ret; + fw_array = update_info.images; *descriptor_count = update_info.num_images; *descriptor_version = EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION; diff --git a/lib/efi_loader/efi_rng.c b/lib/efi_loader/efi_rng.c index 9bad7ed6931..4734f95eee1 100644 --- a/lib/efi_loader/efi_rng.c +++ b/lib/efi_loader/efi_rng.c @@ -91,7 +91,7 @@ back: } /** - * rng_getrng() - get random value + * getrng() - get random value * * This function implement the GetRng() service of the EFI random number * generator protocol. See the UEFI spec for details. diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c index 627bb9123cf..d48700a352b 100644 --- a/lib/efi_loader/efi_unicode_collation.c +++ b/lib/efi_loader/efi_unicode_collation.c @@ -266,7 +266,7 @@ static void EFIAPI efi_fat_to_str(struct efi_unicode_collation_protocol *this, } /** - * efi_fat_to_str() - convert a utf-16 string to legal characters for a FAT + * efi_str_to_fat() - convert a utf-16 string to legal characters for a FAT * file name in an OEM code page * * @this: unicode collation protocol instance diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index e888c52efe3..f3533f4def3 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -16,7 +16,7 @@ #include <malloc.h> #include <rtc.h> #include <search.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <crypto/pkcs7_parser.h> #include <linux/compat.h> #include <u-boot/crc.h> diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index bd72822c0b7..586177de0c8 100644 --- a/lib/efi_loader/helloworld.c +++ b/lib/efi_loader/helloworld.c @@ -2,6 +2,9 @@ /* * Hello world EFI application * + * Copyright (c) 2016 Google, Inc + * Written by Simon Glass <sjg@chromium.org> + * * Copyright 2020, Heinrich Schuchardt <xypron.glpk@gmx.de> * * This test program is used to test the invocation of an EFI application. diff --git a/lib/fwu_updates/Kconfig b/lib/fwu_updates/Kconfig index 51b7fbbefd3..a722107c129 100644 --- a/lib/fwu_updates/Kconfig +++ b/lib/fwu_updates/Kconfig @@ -40,6 +40,7 @@ config FWU_MDATA_V1 config FWU_MDATA_V2 bool "Enable support FWU Metadata version 2" + depends on !FWU_MDATA_V1 help The FWU specification supports two versions of the metadata structure. This option enables support for FWU diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c index c7fc8987beb..7f085a0211f 100644 --- a/lib/fwu_updates/fwu.c +++ b/lib/fwu_updates/fwu.c @@ -28,6 +28,31 @@ enum { IMAGE_ACCEPT_CLEAR, }; +/** + * fwu_bank_accepted() - Has the bank been accepted + * @data: Version agnostic FWU metadata information + * @bank: Update bank to check + * + * Check in the given bank if all the images have been accepted. + * + * Return: true if all images accepted, false otherwise + */ +bool fwu_bank_accepted(struct fwu_data *data, uint32_t bank) +{ + u32 i; + struct fwu_image_entry *img_entry; + struct fwu_image_bank_info *img_bank_info; + + img_entry = &data->fwu_images[0]; + for (i = 0; i < CONFIG_FWU_NUM_IMAGES_PER_BANK; i++) { + img_bank_info = &img_entry[i].img_bank_info[bank]; + if (!img_bank_info->accepted) + return false; + } + + return true; +} + static int trial_counter_update(u16 *trial_state_ctr) { bool delete; @@ -88,6 +113,8 @@ static int fwu_trial_count_update(void) ret = fwu_revert_boot_index(); if (ret) log_err("Unable to revert active_index\n"); + + trial_counter_update(NULL); ret = 1; } else { log_info("Trial State count: attempt %d out of %d\n", @@ -737,8 +764,8 @@ static int fwu_boottime_checks(void) return 0; in_trial = in_trial_state(); - if (!in_trial || (ret = fwu_trial_count_update()) > 0) - ret = trial_counter_update(NULL); + + ret = in_trial ? fwu_trial_count_update() : trial_counter_update(NULL); if (!ret) boottime_check = 1; diff --git a/lib/fwu_updates/fwu_mtd.c b/lib/fwu_updates/fwu_mtd.c index c14203b9dd3..554723046f6 100644 --- a/lib/fwu_updates/fwu_mtd.c +++ b/lib/fwu_updates/fwu_mtd.c @@ -10,7 +10,7 @@ #include <log.h> #include <malloc.h> #include <mtd.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <stdio.h> #include <dm/ofnode.h> diff --git a/lib/fwu_updates/fwu_v1.c b/lib/fwu_updates/fwu_v1.c index efb8d515008..c311a8857a6 100644 --- a/lib/fwu_updates/fwu_v1.c +++ b/lib/fwu_updates/fwu_v1.c @@ -52,11 +52,14 @@ static void fwu_data_init(void) memcpy(dst_img_info, src_img_info, image_info_size); } -static int fwu_trial_state_update(bool trial_state) +static int fwu_trial_state_update(bool trial_state, uint32_t bank) { int ret; struct fwu_data *data = fwu_get_data(); + if (!trial_state && !fwu_bank_accepted(data, bank)) + return 0; + if (trial_state) { ret = fwu_trial_state_ctr_start(); if (ret) @@ -112,9 +115,9 @@ void fwu_populate_mdata_image_info(struct fwu_data *data) * Return: 0 if OK, -ve on error */ int fwu_state_machine_updates(bool trial_state, - __maybe_unused uint32_t update_index) + uint32_t update_index) { - return fwu_trial_state_update(trial_state); + return fwu_trial_state_update(trial_state, update_index); } /** @@ -146,6 +149,7 @@ int fwu_init(void) { int ret; uint32_t mdata_size; + struct fwu_mdata mdata = {0}; fwu_get_mdata_size(&mdata_size); @@ -157,10 +161,16 @@ int fwu_init(void) * Now read the entire structure, both copies, and * validate that the copies. */ - ret = fwu_get_mdata(NULL); + ret = fwu_get_mdata(&mdata); if (ret) return ret; + if (mdata.version != 0x1) { + log_err("FWU metadata version %u. Expected value of %u\n", + mdata.version, FWU_MDATA_VERSION); + return -EINVAL; + } + fwu_data_init(); return 0; diff --git a/lib/fwu_updates/fwu_v2.c b/lib/fwu_updates/fwu_v2.c index 108bc9bb4ac..ce46904ff2e 100644 --- a/lib/fwu_updates/fwu_v2.c +++ b/lib/fwu_updates/fwu_v2.c @@ -10,6 +10,9 @@ #include <linux/types.h> #define FWU_MDATA_VERSION 0x2U +#define FWU_IMG_DESC_OFFSET 0x20U + +static struct fwu_mdata g_mdata; static inline struct fwu_fw_store_desc *fwu_get_fw_desc(struct fwu_mdata *mdata) { @@ -58,24 +61,6 @@ static int fwu_mdata_sanity_checks(void) struct fwu_data *data = fwu_get_data(); struct fwu_mdata *mdata = data->fwu_mdata; - if (mdata->version != FWU_MDATA_VERSION) { - log_err("FWU metadata version %u. Expected value of %u\n", - mdata->version, FWU_MDATA_VERSION); - return -EINVAL; - } - - if (!mdata->desc_offset) { - log_err("No image information provided with the Metadata. "); - log_err("Image information expected in the metadata\n"); - return -EINVAL; - } - - if (mdata->desc_offset != 0x20) { - log_err("Descriptor Offset(0x%x) in the FWU Metadata not equal to 0x20\n", - mdata->desc_offset); - return -EINVAL; - } - num_banks = fwu_get_fw_desc(mdata)->num_banks; num_images = fwu_get_fw_desc(mdata)->num_images; @@ -100,6 +85,9 @@ static int fwu_bank_state_update(bool trial_state, uint32_t bank) struct fwu_data *data = fwu_get_data(); struct fwu_mdata *mdata = data->fwu_mdata; + if (!trial_state && !fwu_bank_accepted(data, bank)) + return 0; + mdata->bank_state[bank] = data->bank_state[bank] = trial_state ? FWU_BANK_VALID : FWU_BANK_ACCEPTED; @@ -127,6 +115,35 @@ static int fwu_trial_state_start(uint update_index) return 0; } +static bool fwu_get_mdata_mandatory(uint part) +{ + int ret = 0; + struct udevice *fwu_dev = fwu_get_dev(); + + memset(&g_mdata, 0, sizeof(struct fwu_mdata)); + + ret = fwu_read_mdata(fwu_dev, &g_mdata, + part == PRIMARY_PART ? true : false, + sizeof(struct fwu_mdata)); + if (ret) + return false; + + if (g_mdata.version != FWU_MDATA_VERSION) { + log_err("FWU partition %u has metadata version %u. Expected value of %u\n", + part, g_mdata.version, FWU_MDATA_VERSION); + return false; + } + + if (g_mdata.desc_offset != FWU_IMG_DESC_OFFSET) { + log_err("Descriptor Offset(0x%x) in the FWU Metadata partition %u not equal to 0x20\n", + g_mdata.desc_offset, part); + log_err("Image information expected in the metadata\n"); + return false; + } + + return true; +} + /** * fwu_populate_mdata_image_info() - Populate the image information * of the metadata @@ -187,24 +204,14 @@ int fwu_state_machine_updates(bool trial_state, uint32_t update_index) */ int fwu_get_mdata_size(uint32_t *mdata_size) { - int ret = 0; - struct fwu_mdata mdata = { 0 }; struct fwu_data *data = fwu_get_data(); - struct udevice *fwu_dev = fwu_get_dev(); if (data->metadata_size) { *mdata_size = data->metadata_size; return 0; } - ret = fwu_read_mdata(fwu_dev, &mdata, 1, - sizeof(struct fwu_mdata)); - if (ret) { - log_err("FWU metadata read failed\n"); - return ret; - } - - *mdata_size = mdata.metadata_size; + *mdata_size = g_mdata.metadata_size; if (!*mdata_size) return -EINVAL; @@ -224,21 +231,23 @@ int fwu_get_mdata_size(uint32_t *mdata_size) int fwu_init(void) { int ret; - struct fwu_mdata mdata = { 0 }; - struct udevice *fwu_dev = fwu_get_dev(); /* * First we read only the top level structure * and get the size of the complete structure. + * Try reading the first partition first, if + * that does not work, try the secondary + * partition. The idea is, if one of the + * partitions is corrupted, it should be restored + * from the intact partition. */ - ret = fwu_read_mdata(fwu_dev, &mdata, 1, - sizeof(struct fwu_mdata)); - if (ret) { + if (!fwu_get_mdata_mandatory(PRIMARY_PART) && + !fwu_get_mdata_mandatory(SECONDARY_PART)) { log_err("FWU metadata read failed\n"); - return ret; + return -1; } - ret = fwu_mdata_copies_allocate(mdata.metadata_size); + ret = fwu_mdata_copies_allocate(g_mdata.metadata_size); if (ret) return ret; diff --git a/lib/uuid.c b/lib/uuid.c index dfa2320ba26..11b86ffb02e 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -7,21 +7,35 @@ * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> */ -#define LOG_CATEGOT LOGC_CORE - +#ifndef USE_HOSTCC #include <command.h> #include <efi_api.h> #include <env.h> #include <rand.h> #include <time.h> -#include <uuid.h> -#include <linux/ctype.h> -#include <errno.h> #include <asm/io.h> #include <part_efi.h> #include <malloc.h> #include <dm/uclass.h> #include <rng.h> +#include <linux/ctype.h> +#include <hexdump.h> +#else +#include <stdarg.h> +#include <stdint.h> +#include <eficapsule.h> +#include <ctype.h> +#endif +#include <linux/types.h> +#include <errno.h> +#include <linux/kconfig.h> +#include <u-boot/uuid.h> +#include <u-boot/sha1.h> + +#ifdef USE_HOSTCC +/* polyfill hextoul to avoid pulling in strto.c */ +#define hextoul(cp, endp) strtoul(cp, endp, 16) +#endif int uuid_str_valid(const char *uuid) { @@ -51,6 +65,7 @@ static const struct { const char *string; efi_guid_t guid; } list_guid[] = { +#ifndef USE_HOSTCC #ifdef CONFIG_PARTITION_TYPE_GUID {"system", PARTITION_SYSTEM_GUID}, {"mbr", LEGACY_MBR_PARTITION_GUID}, @@ -231,6 +246,7 @@ static const struct { { "EFI_MEM_STATUS_CODE_REC", EFI_MEM_STATUS_CODE_REC }, { "EFI_GUID_EFI_ACPI1", EFI_GUID_EFI_ACPI1 }, #endif +#endif /* !USE_HOSTCC */ }; int uuid_guid_get_bin(const char *guid_str, unsigned char *guid_bin) @@ -266,7 +282,6 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin, uint64_t tmp64; if (!uuid_str_valid(uuid_str)) { - log_debug("not valid\n"); #ifdef CONFIG_PARTITION_TYPE_GUID if (!uuid_guid_get_bin(uuid_str, uuid_bin)) return 0; @@ -297,7 +312,7 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin, tmp16 = cpu_to_be16(hextoul(uuid_str + 19, NULL)); memcpy(uuid_bin + 8, &tmp16, 2); - tmp64 = cpu_to_be64(simple_strtoull(uuid_str + 24, NULL, 16)); + tmp64 = cpu_to_be64(hextoul(uuid_str + 24, NULL)); memcpy(uuid_bin + 10, (char *)&tmp64 + 2, 6); return 0; @@ -305,9 +320,9 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin, int uuid_str_to_le_bin(const char *uuid_str, unsigned char *uuid_bin) { - u16 tmp16; - u32 tmp32; - u64 tmp64; + uint16_t tmp16; + uint32_t tmp32; + uint64_t tmp64; if (!uuid_str_valid(uuid_str) || !uuid_bin) return -EINVAL; @@ -324,7 +339,7 @@ int uuid_str_to_le_bin(const char *uuid_str, unsigned char *uuid_bin) tmp16 = cpu_to_le16(hextoul(uuid_str + 19, NULL)); memcpy(uuid_bin + 8, &tmp16, 2); - tmp64 = cpu_to_le64(simple_strtoull(uuid_str + 24, NULL, 16)); + tmp64 = cpu_to_le64(hextoul(uuid_str + 24, NULL)); memcpy(uuid_bin + 10, &tmp64, 6); return 0; @@ -333,11 +348,11 @@ int uuid_str_to_le_bin(const char *uuid_str, unsigned char *uuid_bin) void uuid_bin_to_str(const unsigned char *uuid_bin, char *uuid_str, int str_format) { - const u8 uuid_char_order[UUID_BIN_LEN] = {0, 1, 2, 3, 4, 5, 6, 7, 8, + const uint8_t uuid_char_order[UUID_BIN_LEN] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - const u8 guid_char_order[UUID_BIN_LEN] = {3, 2, 1, 0, 5, 4, 7, 6, 8, + const uint8_t guid_char_order[UUID_BIN_LEN] = {3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15}; - const u8 *char_order; + const uint8_t *char_order; const char *format; int i; @@ -369,6 +384,57 @@ void uuid_bin_to_str(const unsigned char *uuid_bin, char *uuid_str, } } +static void configure_uuid(struct uuid *uuid, unsigned char version) +{ + uint16_t tmp; + + /* Configure variant/version bits */ + tmp = be16_to_cpu(uuid->time_hi_and_version); + tmp = (tmp & ~UUID_VERSION_MASK) | (version << UUID_VERSION_SHIFT); + uuid->time_hi_and_version = cpu_to_be16(tmp); + + uuid->clock_seq_hi_and_reserved &= ~UUID_VARIANT_MASK; + uuid->clock_seq_hi_and_reserved |= (UUID_VARIANT << UUID_VARIANT_SHIFT); +} + +void gen_v5_guid(const struct uuid *namespace, struct efi_guid *guid, ...) +{ + sha1_context ctx; + va_list args; + const uint8_t *data; + uint32_t *tmp32; + uint16_t *tmp16; + uint8_t hash[SHA1_SUM_LEN]; + + sha1_starts(&ctx); + /* Hash the namespace UUID as salt */ + sha1_update(&ctx, (unsigned char *)namespace, UUID_BIN_LEN); + va_start(args, guid); + + while ((data = va_arg(args, const uint8_t *))) { + unsigned int len = va_arg(args, size_t); + + sha1_update(&ctx, data, len); + } + + va_end(args); + sha1_finish(&ctx, hash); + + /* Truncate the hash into output UUID, it is already big endian */ + memcpy(guid, hash, sizeof(*guid)); + + configure_uuid((struct uuid *)guid, 5); + + /* Make little endian */ + tmp32 = (uint32_t *)&guid->b[0]; + *tmp32 = cpu_to_le32(be32_to_cpu(*tmp32)); + tmp16 = (uint16_t *)&guid->b[4]; + *tmp16 = cpu_to_le16(be16_to_cpu(*tmp16)); + tmp16 = (uint16_t *)&guid->b[6]; + *tmp16 = cpu_to_le16(be16_to_cpu(*tmp16)); +} + +#ifndef USE_HOSTCC #if defined(CONFIG_RANDOM_UUID) || defined(CONFIG_CMD_UUID) void gen_rand_uuid(unsigned char *uuid_bin) { @@ -395,13 +461,7 @@ void gen_rand_uuid(unsigned char *uuid_bin) for (i = 0; i < 4; i++) ptr[i] = rand(); - clrsetbits_be16(&uuid->time_hi_and_version, - UUID_VERSION_MASK, - UUID_VERSION << UUID_VERSION_SHIFT); - - clrsetbits_8(&uuid->clock_seq_hi_and_reserved, - UUID_VARIANT_MASK, - UUID_VARIANT << UUID_VARIANT_SHIFT); + configure_uuid(uuid, UUID_VERSION); memcpy(uuid_bin, uuid, 16); } @@ -458,3 +518,4 @@ U_BOOT_CMD(guid, CONFIG_SYS_MAXARGS, 1, do_uuid, ); #endif /* CONFIG_CMD_UUID */ #endif /* CONFIG_RANDOM_UUID || CONFIG_CMD_UUID */ +#endif /* !USE_HOSTCC */ diff --git a/lib/vsprintf.c b/lib/vsprintf.c index cfd1f1914ed..e5802866632 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -18,7 +18,7 @@ #include <div64.h> #include <hexdump.h> #include <stdarg.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <stdio.h> #include <vsprintf.h> #include <linux/ctype.h> diff --git a/net/bootp.c b/net/bootp.c index 9dfb50749b4..512ab2ed7c8 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -15,7 +15,7 @@ #include <log.h> #include <net.h> #include <rand.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/delay.h> #include <net/tftp.h> #include "bootp.h" diff --git a/net/tftp.c b/net/tftp.c index b5d227d8bc2..d6744bc24e2 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -82,7 +82,6 @@ static ulong tftp_block_wrap; static ulong tftp_block_wrap_offset; static int tftp_state; static ulong tftp_load_addr; -static ulong tftp_load_size; #ifdef CONFIG_TFTP_TSIZE /* The file size reported by the server */ static int tftp_tsize; @@ -159,13 +158,8 @@ static inline int store_block(int block, uchar *src, unsigned int len) void *ptr; if (CONFIG_IS_ENABLED(LMB)) { - ulong end_addr = tftp_load_addr + tftp_load_size; - - if (!end_addr) - end_addr = ULONG_MAX; - if (store_addr < tftp_load_addr || - store_addr + len > end_addr) { + lmb_read_check(store_addr, len)) { puts("\nTFTP error: "); puts("trying to overwrite reserved memory...\n"); return -1; @@ -712,19 +706,8 @@ static void tftp_timeout_handler(void) } } -/* Initialize tftp_load_addr and tftp_load_size from image_load_addr and lmb */ static int tftp_init_load_addr(void) { - if (CONFIG_IS_ENABLED(LMB)) { - phys_size_t max_size; - - max_size = lmb_get_free_size(image_load_addr); - if (!max_size) - return -1; - - tftp_load_size = max_size; - } - tftp_load_addr = image_load_addr; return 0; } diff --git a/net/wget.c b/net/wget.c index 4a168641c65..b4251e0f293 100644 --- a/net/wget.c +++ b/net/wget.c @@ -8,6 +8,7 @@ #include <command.h> #include <display_options.h> #include <env.h> +#include <efi_loader.h> #include <image.h> #include <lmb.h> #include <mapmem.h> @@ -64,26 +65,6 @@ static unsigned int retry_tcp_ack_num; /* TCP retry acknowledge number*/ static unsigned int retry_tcp_seq_num; /* TCP retry sequence number */ static int retry_len; /* TCP retry length */ -static ulong wget_load_size; - -/** - * wget_init_max_size() - initialize maximum load size - * - * Return: 0 if success, -1 if fails - */ -static int wget_init_load_size(void) -{ - phys_size_t max_size; - - max_size = lmb_get_free_size(image_load_addr); - if (!max_size) - return -1; - - wget_load_size = max_size; - - return 0; -} - /** * store_block() - store block in memory * @src: source of data @@ -97,13 +78,8 @@ static inline int store_block(uchar *src, unsigned int offset, unsigned int len) uchar *ptr; if (CONFIG_IS_ENABLED(LMB)) { - ulong end_addr = image_load_addr + wget_load_size; - - if (!end_addr) - end_addr = ULONG_MAX; - if (store_addr < image_load_addr || - store_addr + len > end_addr) { + lmb_read_check(store_addr, len)) { printf("\nwget error: "); printf("trying to overwrite reserved memory...\n"); return -1; @@ -196,13 +172,6 @@ void wget_fail(char *error_message, unsigned int tcp_seq_num, wget_send(action, tcp_seq_num, tcp_ack_num, 0); } -void wget_success(u8 action, unsigned int tcp_seq_num, - unsigned int tcp_ack_num, int len, int packets) -{ - printf("Packets received %d, Transfer Successful\n", packets); - wget_send(action, tcp_seq_num, tcp_ack_num, len); -} - /* * Interfaces of U-BOOT */ @@ -432,6 +401,9 @@ static void wget_handler(uchar *pkt, u16 dport, case WGET_TRANSFERRED: printf("Packets received %d, Transfer Successful\n", packets); net_set_state(wget_loop_state); + efi_set_bootdev("Net", "", image_url, + map_sysmem(image_load_addr, 0), + net_boot_file_size); break; } } @@ -493,15 +465,6 @@ void wget_start(void) debug_cond(DEBUG_WGET, "\nwget:Load address: 0x%lx\nLoading: *\b", image_load_addr); - if (CONFIG_IS_ENABLED(LMB)) { - if (wget_init_load_size()) { - printf("\nwget error: "); - printf("trying to overwrite reserved memory...\n"); - net_set_state(NETLOOP_FAIL); - return; - } - } - net_set_timeout_handler(wget_timeout, wget_timeout_handler); tcp_set_tcp_handler(wget_handler); diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 62e0207f91b..5daceb26061 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -32,6 +32,10 @@ baseprereq = $(basename $(notdir $<)) escsq = $(subst $(squote),'\$(squote)',$1) ### +# real prerequisites without phony targets +real-prereqs = $(filter-out $(PHONY), $^) + +### # Easy method for doing a status message kecho := : quiet_kecho := echo diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 99cc29595b4..90aed148c44 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -293,6 +293,7 @@ $(obj)/%.o: $(src)/%.S FORCE targets += $(real-objs-y) $(real-objs-m) $(lib-y) targets += $(extra-y) $(MAKECMDGOALS) $(always) +targets += $(real-dtb-y) $(lib-y) $(always-y) # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index df754d1d9f0..54403040f00 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -47,6 +47,13 @@ obj-m := $(filter-out %/, $(obj-m)) subdir-ym := $(sort $(subdir-y) $(subdir-m)) +# Expand $(foo-objs) $(foo-y) etc. by replacing their individuals +suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s)))) +# List composite targets that are constructed by combining other targets +multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $m))) +# List primitive targets that are compiled from source files +real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $(call suffix-search, $m, $2, $3), $m)) + # if $(foo-objs) exists, foo.o is a composite object multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) @@ -58,6 +65,13 @@ single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m))) multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)) $($(m:.o=-y))) multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y))) +# Composite DTB (i.e. DTB constructed by overlay) +multi-dtb-y := $(call multi-search, $(dtb-y), .dtb, -dtbs) +# Primitive DTB compiled from *.dts +real-dtb-y := $(call real-search, $(dtb-y), .dtb, -dtbs) +# Base DTB that overlay is applied onto (each first word of $(*-dtbs) expansion) +base-dtb-y := $(foreach m, $(multi-dtb-y), $(firstword $(call suffix-search, $m, .dtb, -dtbs))) + # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to # tell kbuild to descend subdir-obj-y := $(filter %/built-in.o, $(obj-y)) @@ -69,6 +83,7 @@ real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y) # Add subdir path extra-y := $(addprefix $(obj)/,$(extra-y)) +always-y := $(addprefix $(obj)/,$(always-y)) always := $(addprefix $(obj)/,$(always)) targets := $(addprefix $(obj)/,$(targets)) modorder := $(addprefix $(obj)/,$(modorder)) @@ -83,6 +98,8 @@ multi-used-y := $(addprefix $(obj)/,$(multi-used-y)) multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y)) multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) +multi-dtb-y := $(addprefix $(obj)/,$(multi-dtb-y)) +real-dtb-y := $(addprefix $(obj)/,$(real-dtb-y)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) # These flags are needed for modversions and compiling, so we define them here @@ -185,9 +202,6 @@ endif dtsi_include_list = $(strip $(u_boot_dtsi_options_debug) \ $(notdir $(firstword $(u_boot_dtsi_options)))) -# The CONFIG_DEVICE_TREE_INCLUDES also need to be included -dtsi_include_list += $(CONFIG_DEVICE_TREE_INCLUDES) - # Modified for U-Boot upstream_dtsi_include = $(addprefix -I, $(srctree)/dts/upstream/src/ \ $(sort $(dir $(wildcard $(srctree)/dts/upstream/src/$(ARCH)/*/*))) \ @@ -304,6 +318,9 @@ endif DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) +# Set -@ if the target is a base DTB that overlay is applied onto +DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@) + # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_dt_S_dtb= DTBS $@ # Modified for U-Boot @@ -350,7 +367,7 @@ quiet_cmd_dtc = DTC $@ # And finally any custom .dtsi fragments specified with CONFIG_DEVICE_TREE_INCLUDES cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ (cat $< > $(pre-tmp)); \ - $(foreach f,$(subst $(quote),,$(dtsi_include_list)), \ + $(foreach f,$(subst $(quote),,$(dtsi_include_list) $(CONFIG_DEVICE_TREE_INCLUDES)), \ echo '$(pound)include "$(f)"' >> $(pre-tmp);) \ $(HOSTCC) -E $(dtc_cpp_flags) -I$(obj) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ $(DTC) -O dtb -o $@ -b 0 \ @@ -425,6 +442,13 @@ cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE $(call if_changed_dep,dtco) +quiet_cmd_fdtoverlay = DTOVL $@ + cmd_fdtoverlay = fdtoverlay -o $@ -i $(real-prereqs) + +$(multi-dtb-y): FORCE + $(call if_changed,fdtoverlay) +$(call multi_depend, $(multi-dtb-y), .dtb, -dtbs) + # Fonts # --------------------------------------------------------------------------- diff --git a/scripts/pylint.base b/scripts/pylint.base index c7d141ed393..bc39e2385a3 100644 --- a/scripts/pylint.base +++ b/scripts/pylint.base @@ -1,229 +1,311 @@ -test_conftest.py 6.56 -test_multiplexed_log.py 7.49 -test_test.py 8.18 +test_conftest.py 6.78 +test_multiplexed_log.py 7.68 +test_test.py 9.00 +test_tests_fit_util.py 7.19 +test_tests_fs_helper.py 10.00 test_tests_test_000_version.py 7.50 -test_tests_test_android_test_ab.py 6.50 -test_tests_test_android_test_abootimg.py 6.09 -test_tests_test_android_test_avb.py 5.52 -test_tests_test_bind.py -2.99 +test_tests_test_android_test_ab.py 7.00 +test_tests_test_android_test_abootimg.py 6.52 +test_tests_test_android_test_avb.py 6.38 +test_tests_test_bind.py 8.89 test_tests_test_bootmenu.py 10.00 +test_tests_test_bootstage.py 7.14 test_tests_test_button.py 3.33 -test_tests_test_dfu.py 5.45 -test_tests_test_dm.py 9.52 -test_tests_test_efi_capsule_capsule_defs.py 6.67 -test_tests_test_efi_capsule_conftest.py 1.86 -test_tests_test_efi_capsule_test_capsule_firmware.py 4.52 -test_tests_test_efi_capsule_test_capsule_firmware_signed.py 4.85 -test_tests_test_efi_fit.py 8.16 -test_tests_test_efi_loader.py 7.38 -test_tests_test_efi_secboot_conftest.py -3.29 -test_tests_test_efi_secboot_defs.py 6.67 -test_tests_test_efi_secboot_test_authvar.py 8.93 -test_tests_test_efi_secboot_test_signed.py 8.41 -test_tests_test_efi_secboot_test_signed_intca.py 8.10 -test_tests_test_efi_secboot_test_unsigned.py 8.00 -test_tests_test_efi_selftest.py 6.36 -test_tests_test_env.py 7.15 -test_tests_test_extension.py 2.14 -test_tests_test_fit.py 6.83 -test_tests_test_fit_ecdsa.py 7.94 -test_tests_test_fit_hashes.py 7.70 -test_tests_test_fpga.py 1.81 -test_tests_test_fs_conftest.py 5.13 +test_tests_test_cat_conftest.py 10.00 +test_tests_test_cat_test_cat.py 10.00 +test_tests_test_cleanup_build.py 10.00 +test_tests_test_dfu.py 6.23 +test_tests_test_dm.py 8.98 +test_tests_test_efi_bootmgr_conftest.py 10.00 +test_tests_test_efi_bootmgr_test_efi_bootmgr.py 10.00 +test_tests_test_efi_capsule_capsule_common.py 10.00 +test_tests_test_efi_capsule_capsule_defs.py 10.00 +test_tests_test_efi_capsule_conftest.py 3.26 +test_tests_test_efi_capsule_test_capsule_firmware_fit.py 10.00 +test_tests_test_efi_capsule_test_capsule_firmware_raw.py 9.62 +test_tests_test_efi_capsule_test_capsule_firmware_signed_fit.py 9.74 +test_tests_test_efi_capsule_test_capsule_firmware_signed_raw.py 9.75 +test_tests_test_efi_fit.py 8.84 +test_tests_test_efi_loader.py 8.00 +test_tests_test_efi_secboot_conftest.py 0.00 +test_tests_test_efi_secboot_defs.py 10.00 +test_tests_test_efi_secboot_test_authvar.py 9.38 +test_tests_test_efi_secboot_test_signed.py 8.60 +test_tests_test_efi_secboot_test_signed_intca.py 8.81 +test_tests_test_efi_secboot_test_unsigned.py 8.75 +test_tests_test_efi_selftest.py 8.07 +test_tests_test_eficonfig_conftest.py 10.00 +test_tests_test_eficonfig_test_eficonfig.py 9.47 +test_tests_test_env.py 7.76 +test_tests_test_event_dump.py 2.22 +test_tests_test_extension.py 2.50 +test_tests_test_fit.py 7.54 +test_tests_test_fit_auto_signed.py 9.09 +test_tests_test_fit_ecdsa.py 8.29 +test_tests_test_fit_hashes.py 7.94 +test_tests_test_fpga.py 2.94 +test_tests_test_fs_conftest.py 5.21 test_tests_test_fs_fstest_defs.py 8.33 test_tests_test_fs_fstest_helpers.py 4.29 -test_tests_test_fs_test_basic.py 0.60 -test_tests_test_fs_test_ext.py 0.00 +test_tests_test_fs_test_basic.py 1.90 +test_tests_test_fs_test_erofs.py 8.97 +test_tests_test_fs_test_ext.py 1.48 test_tests_test_fs_test_fs_cmd.py 8.00 -test_tests_test_fs_test_mkdir.py 1.96 -test_tests_test_fs_test_squashfs_sqfs_common.py 8.41 -test_tests_test_fs_test_squashfs_test_sqfs_load.py 7.46 -test_tests_test_fs_test_squashfs_test_sqfs_ls.py 8.00 -test_tests_test_fs_test_symlink.py 1.22 -test_tests_test_fs_test_unlink.py 2.78 -test_tests_test_gpio.py 6.09 -test_tests_test_gpt.py 7.67 +test_tests_test_fs_test_fs_fat.py 2.50 +test_tests_test_fs_test_mkdir.py 3.04 +test_tests_test_fs_test_squashfs_sqfs_common.py 8.38 +test_tests_test_fs_test_squashfs_test_sqfs_load.py 7.63 +test_tests_test_fs_test_squashfs_test_sqfs_ls.py 8.04 +test_tests_test_fs_test_symlink.py 2.04 +test_tests_test_fs_test_unlink.py 4.07 +test_tests_test_gpio.py 7.60 +test_tests_test_gpt.py 8.55 test_tests_test_handoff.py 5.00 -test_tests_test_help.py 5.00 -test_tests_test_hush_if_test.py 9.27 -test_tests_test_log.py 8.64 +test_tests_test_help.py 8.64 +test_tests_test_i2c.py 7.42 +test_tests_test_kconfig.py 5.38 +test_tests_test_log.py 8.75 test_tests_test_lsblk.py 8.00 test_tests_test_md.py 3.64 +test_tests_test_mdio.py 6.82 +test_tests_test_memtest.py 8.39 +test_tests_test_mii.py 8.55 +test_tests_test_mmc.py 7.01 test_tests_test_mmc_rd.py 6.05 test_tests_test_mmc_wr.py 3.33 -test_tests_test_net.py 6.84 +test_tests_test_net.py 8.43 +test_tests_test_net_boot.py 8.23 +test_tests_test_of_migrate.py 7.86 test_tests_test_ofplatdata.py 5.71 +test_tests_test_optee_rpmb.py 0.00 test_tests_test_part.py 8.00 -test_tests_test_pinmux.py 3.27 +test_tests_test_pinmux.py 3.40 test_tests_test_pstore.py 2.31 test_tests_test_qfw.py 8.75 +test_tests_test_reset.py 9.55 test_tests_test_sandbox_exit.py 6.50 +test_tests_test_sandbox_opts.py 1.11 +test_tests_test_saveenv.py 7.87 test_tests_test_scp03.py 3.33 -test_tests_test_sf.py 7.13 +test_tests_test_scsi.py 8.47 +test_tests_test_semihosting_conftest.py 10.00 +test_tests_test_semihosting_test_hostfs.py 10.00 +test_tests_test_sf.py 7.45 test_tests_test_shell_basics.py 9.58 -test_tests_test_sleep.py 7.78 -test_tests_test_spl.py 2.22 +test_tests_test_sleep.py 8.28 +test_tests_test_smbios.py 9.47 +test_tests_test_source.py 7.20 +test_tests_test_spl.py 6.67 test_tests_test_stackprotector.py 5.71 -test_tests_test_tpm2.py 8.51 -test_tests_test_ums.py 6.32 +test_tests_test_tpm2.py 8.45 +test_tests_test_trace.py 8.70 +test_tests_test_ums.py 5.92 test_tests_test_unknown_cmd.py 5.00 -test_tests_test_ut.py 7.06 -test_tests_test_vboot.py 6.01 -test_tests_vboot_evil.py 8.95 +test_tests_test_upl.py 5.33 +test_tests_test_usb.py 7.08 +test_tests_test_ut.py 9.44 +test_tests_test_vbe.py 7.22 +test_tests_test_vbe_vpl.py 6.11 +test_tests_test_vboot.py 5.37 +test_tests_test_vpl.py 2.22 +test_tests_test_xxd_conftest.py 10.00 +test_tests_test_xxd_test_xxd.py 10.00 +test_tests_test_zynq_secure.py 7.60 +test_tests_test_zynqmp_rpu.py 7.54 +test_tests_test_zynqmp_secure.py 7.68 +test_tests_vboot_evil.py 9.45 test_tests_vboot_forge.py 9.22 -test_u_boot_console_base.py 7.08 -test_u_boot_console_exec_attach.py 9.23 -test_u_boot_console_sandbox.py 8.06 -test_u_boot_spawn.py 7.65 -test_u_boot_utils.py 6.94 -tools_binman_bintool 8.59 +test_u_boot_console_base.py 7.73 +test_u_boot_console_exec_attach.py 9.62 +test_u_boot_console_sandbox.py 8.64 +test_u_boot_spawn.py 8.57 +test_u_boot_utils.py 7.83 +tools_binman_bintool 9.16 tools_binman_bintool_test 9.87 -tools_binman_btool__testing 6.09 +tools_binman_btool__testing 6.52 +tools_binman_btool_bootgen 4.50 +tools_binman_btool_btool_gzip 0.00 +tools_binman_btool_bzip2 0.00 tools_binman_btool_cbfstool 7.83 -tools_binman_btool_fiptool 7.62 -tools_binman_btool_futility 7.39 +tools_binman_btool_cst 5.00 +tools_binman_btool_fdt_add_pubkey 7.00 +tools_binman_btool_fdtgrep 5.20 +tools_binman_btool_fiptool 7.22 +tools_binman_btool_futility 6.67 tools_binman_btool_ifwitool 3.81 -tools_binman_btool_lz4 6.30 +tools_binman_btool_lz4 4.76 tools_binman_btool_lzma_alone 6.97 -tools_binman_btool_mkimage 7.86 -tools_binman_cbfs_util 8.46 -tools_binman_cbfs_util_test 9.38 -tools_binman_cmdline 9.03 -tools_binman_comp_util 6.88 -tools_binman_control 5.01 -tools_binman_elf 6.98 -tools_binman_elf_test 5.62 -tools_binman_entry 3.55 -tools_binman_entry_test 5.34 -tools_binman_etype__testing 0.83 -tools_binman_etype_atf_bl31 -6.00 -tools_binman_etype_atf_fip 0.29 -tools_binman_etype_blob -1.58 -tools_binman_etype_blob_dtb -10.00 -tools_binman_etype_blob_ext -19.09 +tools_binman_btool_lzop 0.00 +tools_binman_btool_mkeficapsule 7.69 +tools_binman_btool_mkimage 6.36 +tools_binman_btool_openssl 4.63 +tools_binman_btool_xz 0.00 +tools_binman_btool_zstd 0.00 +tools_binman_cbfs_util 8.93 +tools_binman_cbfs_util_test 9.81 +tools_binman_cmdline 9.33 +tools_binman_control 6.92 +tools_binman_elf 7.52 +tools_binman_elf_test 8.40 +tools_binman_entry 6.40 +tools_binman_entry_test 6.99 +tools_binman_etype__testing 2.02 +tools_binman_etype_alternates_fdt 5.09 +tools_binman_etype_atf_bl31 0.00 +tools_binman_etype_atf_fip 0.44 +tools_binman_etype_blob 0.41 +tools_binman_etype_blob_dtb 0.21 +tools_binman_etype_blob_ext 0.00 tools_binman_etype_blob_ext_list 0.00 -tools_binman_etype_blob_named_by_arg -7.78 -tools_binman_etype_blob_phase -5.00 -tools_binman_etype_cbfs -1.44 +tools_binman_etype_blob_named_by_arg 0.00 +tools_binman_etype_blob_phase 0.50 +tools_binman_etype_cbfs 1.86 tools_binman_etype_collection 2.67 -tools_binman_etype_cros_ec_rw -6.00 -tools_binman_etype_fdtmap -3.28 -tools_binman_etype_files -7.43 -tools_binman_etype_fill -6.43 -tools_binman_etype_fit 6.31 -tools_binman_etype_fmap -0.29 -tools_binman_etype_gbb 0.83 -tools_binman_etype_image_header 5.77 -tools_binman_etype_intel_cmc -12.50 +tools_binman_etype_cros_ec_rw 0.00 +tools_binman_etype_efi_capsule 3.33 +tools_binman_etype_efi_empty_capsule 0.00 +tools_binman_etype_encrypted 1.43 +tools_binman_etype_fdtmap 0.16 +tools_binman_etype_files 0.00 +tools_binman_etype_fill 0.00 +tools_binman_etype_fit 7.52 +tools_binman_etype_fmap 0.54 +tools_binman_etype_gbb 1.35 +tools_binman_etype_image_header 4.81 +tools_binman_etype_intel_cmc 0.00 tools_binman_etype_intel_descriptor 4.62 tools_binman_etype_intel_fit 0.00 tools_binman_etype_intel_fit_ptr 2.35 -tools_binman_etype_intel_fsp -12.50 -tools_binman_etype_intel_fsp_m -12.50 -tools_binman_etype_intel_fsp_s -12.50 -tools_binman_etype_intel_fsp_t -12.50 -tools_binman_etype_intel_ifwi 2.88 -tools_binman_etype_intel_me -12.50 -tools_binman_etype_intel_mrc -10.00 -tools_binman_etype_intel_refcode -10.00 -tools_binman_etype_intel_vbt -12.50 -tools_binman_etype_intel_vga -12.50 -tools_binman_etype_mkimage 1.47 -tools_binman_etype_opensbi -6.00 -tools_binman_etype_powerpc_mpc85xx_bootpg_resetvec -10.00 -tools_binman_etype_scp -6.00 -tools_binman_etype_section 4.57 -tools_binman_etype_tee_os -6.00 -tools_binman_etype_text -0.48 -tools_binman_etype_u_boot -15.71 -tools_binman_etype_u_boot_dtb -12.22 -tools_binman_etype_u_boot_dtb_with_ucode 0.39 -tools_binman_etype_u_boot_elf -8.42 +tools_binman_etype_intel_fsp 0.00 +tools_binman_etype_intel_fsp_m 0.00 +tools_binman_etype_intel_fsp_s 0.00 +tools_binman_etype_intel_fsp_t 0.00 +tools_binman_etype_intel_ifwi 3.13 +tools_binman_etype_intel_me 0.00 +tools_binman_etype_intel_mrc 0.00 +tools_binman_etype_intel_refcode 0.00 +tools_binman_etype_intel_vbt 0.00 +tools_binman_etype_intel_vga 0.00 +tools_binman_etype_mkimage 4.88 +tools_binman_etype_null 0.00 +tools_binman_etype_nxp_imx8mcst 2.44 +tools_binman_etype_nxp_imx8mimage 0.00 +tools_binman_etype_opensbi 0.00 +tools_binman_etype_powerpc_mpc85xx_bootpg_resetvec 0.00 +tools_binman_etype_pre_load 3.68 +tools_binman_etype_rockchip_tpl 0.00 +tools_binman_etype_scp 0.00 +tools_binman_etype_section 6.04 +tools_binman_etype_tee_os 4.00 +tools_binman_etype_text 0.00 +tools_binman_etype_ti_board_config 5.40 +tools_binman_etype_ti_dm 0.00 +tools_binman_etype_ti_secure 4.22 +tools_binman_etype_ti_secure_rom 2.22 +tools_binman_etype_u_boot 0.00 +tools_binman_etype_u_boot_dtb 0.00 +tools_binman_etype_u_boot_dtb_with_ucode 1.73 +tools_binman_etype_u_boot_elf 0.00 tools_binman_etype_u_boot_env 0.74 -tools_binman_etype_u_boot_expanded -10.00 -tools_binman_etype_u_boot_img -15.71 -tools_binman_etype_u_boot_nodtb -15.71 -tools_binman_etype_u_boot_spl -10.91 -tools_binman_etype_u_boot_spl_bss_pad -9.29 -tools_binman_etype_u_boot_spl_dtb -12.22 -tools_binman_etype_u_boot_spl_elf -15.71 -tools_binman_etype_u_boot_spl_expanded -9.09 -tools_binman_etype_u_boot_spl_nodtb -10.91 -tools_binman_etype_u_boot_spl_with_ucode_ptr -5.00 -tools_binman_etype_u_boot_tpl -10.91 -tools_binman_etype_u_boot_tpl_bss_pad -9.29 -tools_binman_etype_u_boot_tpl_dtb -12.22 -tools_binman_etype_u_boot_tpl_dtb_with_ucode -7.50 -tools_binman_etype_u_boot_tpl_elf -15.71 -tools_binman_etype_u_boot_tpl_expanded -9.09 -tools_binman_etype_u_boot_tpl_nodtb -10.91 -tools_binman_etype_u_boot_tpl_with_ucode_ptr -20.83 +tools_binman_etype_u_boot_expanded 0.00 +tools_binman_etype_u_boot_img 0.00 +tools_binman_etype_u_boot_nodtb 0.00 +tools_binman_etype_u_boot_spl 0.00 +tools_binman_etype_u_boot_spl_bss_pad 0.00 +tools_binman_etype_u_boot_spl_dtb 0.00 +tools_binman_etype_u_boot_spl_elf 0.00 +tools_binman_etype_u_boot_spl_expanded 0.00 +tools_binman_etype_u_boot_spl_nodtb 0.00 +tools_binman_etype_u_boot_spl_pubkey_dtb 1.21 +tools_binman_etype_u_boot_spl_with_ucode_ptr 0.00 +tools_binman_etype_u_boot_tpl 0.00 +tools_binman_etype_u_boot_tpl_bss_pad 0.00 +tools_binman_etype_u_boot_tpl_dtb 0.00 +tools_binman_etype_u_boot_tpl_dtb_with_ucode 0.00 +tools_binman_etype_u_boot_tpl_elf 0.00 +tools_binman_etype_u_boot_tpl_expanded 0.00 +tools_binman_etype_u_boot_tpl_nodtb 0.00 +tools_binman_etype_u_boot_tpl_with_ucode_ptr 0.00 tools_binman_etype_u_boot_ucode 1.52 -tools_binman_etype_u_boot_with_ucode_ptr -0.71 -tools_binman_etype_vblock 0.27 -tools_binman_etype_x86_reset16 -15.71 -tools_binman_etype_x86_reset16_spl -15.71 -tools_binman_etype_x86_reset16_tpl -15.71 -tools_binman_etype_x86_start16 -15.71 -tools_binman_etype_x86_start16_spl -15.71 -tools_binman_etype_x86_start16_tpl -15.71 -tools_binman_fdt_test 10.00 +tools_binman_etype_u_boot_vpl 0.00 +tools_binman_etype_u_boot_vpl_bss_pad 0.00 +tools_binman_etype_u_boot_vpl_dtb 0.00 +tools_binman_etype_u_boot_vpl_elf 0.00 +tools_binman_etype_u_boot_vpl_expanded 0.00 +tools_binman_etype_u_boot_vpl_nodtb 0.00 +tools_binman_etype_u_boot_with_ucode_ptr 0.00 +tools_binman_etype_vblock 0.79 +tools_binman_etype_x509_cert 3.10 +tools_binman_etype_x86_reset16 0.00 +tools_binman_etype_x86_reset16_spl 0.00 +tools_binman_etype_x86_reset16_tpl 0.00 +tools_binman_etype_x86_start16 0.00 +tools_binman_etype_x86_start16_spl 0.00 +tools_binman_etype_x86_start16_tpl 0.00 +tools_binman_etype_xilinx_bootgen 6.06 +tools_binman_fdt_test 7.74 tools_binman_fip_util 9.85 tools_binman_fip_util_test 10.00 -tools_binman_fmap_util 6.88 -tools_binman_ftest 7.46 -tools_binman_image 7.12 -tools_binman_image_test 4.48 -tools_binman_main 4.86 -tools_binman_setup 5.00 -tools_binman_state 4.15 -tools_buildman_board 7.82 -tools_buildman_bsettings 1.71 -tools_buildman_builder 6.92 -tools_buildman_builderthread 7.48 -tools_buildman_cfgutil 7.83 -tools_buildman_cmdline 8.89 -tools_buildman_control 8.12 -tools_buildman_func_test 7.18 -tools_buildman_kconfiglib 7.49 -tools_buildman_main -1.11 -tools_buildman_test 6.56 -tools_buildman_toolchain 6.44 -tools_concurrencytest_concurrencytest 7.26 -tools_dtoc_dtb_platdata 7.90 -tools_dtoc_fdt 4.46 -tools_dtoc_fdt_util 6.80 -tools_dtoc_main 7.78 -tools_dtoc_setup 5.00 -tools_dtoc_src_scan 8.91 -tools_dtoc_test_dtoc 8.56 -tools_dtoc_test_fdt 6.88 -tools_dtoc_test_src_scan 9.43 -tools_efivar 6.71 +tools_binman_fmap_util 6.94 +tools_binman_ftest 8.04 +tools_binman_image 7.29 +tools_binman_image_test 5.52 +tools_binman_main 5.63 +tools_binman_setup 0.00 +tools_binman_state 4.88 +tools_buildman_board 6.36 +tools_buildman_boards 9.72 +tools_buildman_bsettings 5.00 +tools_buildman_builder 7.66 +tools_buildman_builderthread 9.63 +tools_buildman_cfgutil 10.00 +tools_buildman_cmdline 10.00 +tools_buildman_control 9.26 +tools_buildman_func_test 8.38 +tools_buildman_kconfiglib 8.33 +tools_buildman_main 8.10 +tools_buildman_test 7.16 +tools_buildman_toolchain 6.99 +tools_dtoc_dtb_platdata 8.10 +tools_dtoc_fdt 6.31 +tools_dtoc_fdt_util 7.62 +tools_dtoc_main 8.54 +tools_dtoc_setup 0.00 +tools_dtoc_src_scan 9.14 +tools_dtoc_test_dtoc 8.97 +tools_dtoc_test_fdt 9.93 +tools_dtoc_test_src_scan 9.46 +tools_efivar 7.39 tools_endian-swap 9.29 -tools_microcode-tool 7.25 -tools_moveconfig 8.34 +tools_expo 9.72 +tools_key2dtsi 7.14 +tools_microcode-tool 6.55 tools_patman___init__ 0.00 -tools_patman_checkpatch 8.48 -tools_patman_command 5.51 -tools_patman_commit 4.50 -tools_patman_control 8.14 -tools_patman_cros_subprocess 7.76 -tools_patman_func_test 8.51 -tools_patman_get_maintainer 7.06 -tools_patman_gitutil 6.65 -tools_patman_main 7.90 -tools_patman_patchstream 9.11 +tools_patman___main__ 9.44 +tools_patman_checkpatch 8.90 +tools_patman_cmdline 10.00 +tools_patman_commit 6.43 +tools_patman_control 8.29 +tools_patman_func_test 9.02 +tools_patman_get_maintainer 7.50 +tools_patman_gitutil 7.37 +tools_patman_patchstream 9.21 tools_patman_project 7.78 -tools_patman_series 6.16 -tools_patman_settings 5.89 +tools_patman_series 7.54 +tools_patman_settings 7.94 tools_patman_setup 5.00 -tools_patman_status 8.62 -tools_patman_terminal 8.00 -tools_patman_test_checkpatch 7.75 -tools_patman_test_util 7.64 -tools_patman_tools 5.68 -tools_patman_tout 5.31 -tools_rkmux 6.90 -tools_rmboard 7.76 +tools_patman_status 8.52 +tools_patman_test_checkpatch 8.51 +tools_patman_test_settings 8.78 +tools_qconfig 9.79 +tools_rkmux 7.10 +tools_rmboard 8.06 +tools_u_bootlib___init__.py 0.00 +tools_u_bootlib___main__.py 7.78 +tools_u_bootlib_command.py 6.48 +tools_u_bootlib_cros_subprocess.py 9.25 +tools_u_bootlib_terminal.py 8.50 +tools_u_bootlib_test_util.py 7.31 +tools_u_bootlib_tools.py 6.97 +tools_u_bootlib_tout.py 6.56 tools_zynqmp_pm_cfg_obj_convert 6.67 diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index 23ebc61ff52..c635d06ec25 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -16,13 +16,6 @@ #include <test/ut.h> #include "bootstd_common.h" -/* Allow reseting the USB-started flag */ -#if defined(CONFIG_USB_HOST) || defined(CONFIG_USB_GADGET) -extern bool usb_started; -#else -#include <usb.h> -#endif - /* Check 'bootdev list' command */ static int bootdev_test_cmd_list(struct unit_test_state *uts) { @@ -197,7 +190,7 @@ static int bootdev_test_order(struct unit_test_state *uts) test_set_skip_delays(true); /* Start up USB which gives us three additional bootdevs */ - usb_started = false; + bootstd_reset_usb(); ut_assertok(run_command("usb start", 0)); /* @@ -313,7 +306,7 @@ static int bootdev_test_prio(struct unit_test_state *uts) test_set_eth_enable(false); /* Start up USB which gives us three additional bootdevs */ - usb_started = false; + bootstd_reset_usb(); ut_assertok(run_command("usb start", 0)); ut_assertok(bootstd_test_drop_bootdev_order(uts)); @@ -352,7 +345,7 @@ static int bootdev_test_hunter(struct unit_test_state *uts) { struct bootstd_priv *std; - usb_started = false; + bootstd_reset_usb(); test_set_skip_delays(true); /* get access to the used hunters */ @@ -392,7 +385,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) struct bootstd_priv *std; test_set_skip_delays(true); - usb_started = false; + bootstd_reset_usb(); /* get access to the used hunters */ ut_assertok(bootstd_get_priv(&std)); @@ -520,7 +513,7 @@ BOOTSTD_TEST(bootdev_test_bootable, UTF_DM | UTF_SCAN_FDT); /* Check hunting for bootdev of a particular priority */ static int bootdev_test_hunt_prio(struct unit_test_state *uts) { - usb_started = false; + bootstd_reset_usb(); test_set_skip_delays(true); ut_assertok(bootdev_hunt_prio(BOOTDEVP_4_SCAN_FAST, false)); @@ -548,7 +541,7 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts) struct bootstd_priv *std; int mflags; - usb_started = false; + bootstd_reset_usb(); /* get access to the used hunters */ ut_assertok(bootstd_get_priv(&std)); diff --git a/test/boot/bootstd_common.c b/test/boot/bootstd_common.c index e50539500a0..ff8ed2303b3 100644 --- a/test/boot/bootstd_common.c +++ b/test/boot/bootstd_common.c @@ -11,6 +11,7 @@ #include <dm.h> #include <memalign.h> #include <mmc.h> +#include <usb.h> #include <linux/log2.h> #include <test/suites.h> #include <test/ut.h> @@ -88,6 +89,11 @@ int bootstd_test_check_mmc_hunter(struct unit_test_state *uts) return 0; } +void bootstd_reset_usb(void) +{ + usb_started = false; +} + int do_ut_bootstd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = UNIT_TEST_SUITE_START(bootstd_test); diff --git a/test/boot/bootstd_common.h b/test/boot/bootstd_common.h index 4a126e43ff4..e29036c897c 100644 --- a/test/boot/bootstd_common.h +++ b/test/boot/bootstd_common.h @@ -53,4 +53,12 @@ int bootstd_setup_for_tests(void); */ int bootstd_test_check_mmc_hunter(struct unit_test_state *uts); +/** + * bootstd_reset_usb() - Reset the USB subsystem + * + * Resets USB so that it can be started (and scanning) again. This is useful in + * tests which need to use USB. + */ +void bootstd_reset_usb(void); + #endif diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c index e1a9cdffb04..b14137e589a 100644 --- a/test/cmd/mbr.c +++ b/test/cmd/mbr.c @@ -14,10 +14,14 @@ #include <asm/global_data.h> #include <dm/device-internal.h> #include <dm/lists.h> +#include <linux/sizes.h> #include <test/suites.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR; + +#define BLKSZ SZ_512 /* block size */ + /* * Requirements for running test manually: * mmc6.img - File size needs to be at least 12 MiB @@ -50,7 +54,7 @@ static char * mbr_parts_tail = "'"; 000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| */ -static unsigned mbr_cmp_start = 0x1B8; +static unsigned int mbr_cmp_start = 0x1b8; static unsigned mbr_cmp_size = 0x48; static unsigned char mbr_parts_ref_p1[] = { 0x78, 0x56, 0x34, 0x12, 0x00, 0x00, 0x80, 0x05, @@ -228,9 +232,11 @@ static unsigned build_mbr_parts(char *buf, size_t buf_size, unsigned num_parts) static int mbr_test_run(struct unit_test_state *uts) { struct blk_desc *mmc_dev_desc; - unsigned char mbr_wbuf[512], ebr_wbuf[512], rbuf[512]; + unsigned char *mbr_wbuf, *ebr_wbuf, *rbuf; char mbr_parts_buf[256]; - ulong mbr_wa, ebr_wa, ra, ebr_blk, mbr_parts_max; + ulong addr = 0x1000; /* start address for buffers */ + ulong mbr_wa = addr, ebr_wa = addr + BLKSZ, ra = addr + BLKSZ * 2; + ulong ebr_blk, mbr_parts_max; struct udevice *dev; ofnode root, node; @@ -254,10 +260,10 @@ static int mbr_test_run(struct unit_test_state *uts) ut_assertf(sizeof(mbr_parts_buf) >= mbr_parts_max, "Buffer avail: %ld; buffer req: %ld\n", sizeof(mbr_parts_buf), mbr_parts_max); - mbr_wa = map_to_sysmem(mbr_wbuf); - ebr_wa = map_to_sysmem(ebr_wbuf); - ra = map_to_sysmem(rbuf); - ebr_blk = (ulong)0xB00000 / 0x200; + mbr_wbuf = map_sysmem(mbr_wa, BLKSZ); + ebr_wbuf = map_sysmem(ebr_wa, BLKSZ); + rbuf = map_sysmem(ra, BLKSZ); + ebr_blk = (ulong)0xb00000 / BLKSZ; /* Make sure mmc6 exists */ ut_asserteq(6, blk_get_device_by_str("mmc", "6", &mmc_dev_desc)); @@ -267,28 +273,29 @@ static int mbr_test_run(struct unit_test_state *uts) ut_assert_console_end(); /* Make sure mmc6 is 12+ MiB in size */ - ut_assertok(run_commandf("mmc read 0x%lx 0x%lx 1", ra, (ulong)0xBFFE00 / 0x200)); + ut_assertok(run_commandf("mmc read %lx %lx 1", ra, + (ulong)0xbffe00 / BLKSZ)); /* Test one MBR partition */ init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__); ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 1)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); - ut_assertok(memcmp(mbr_wbuf, rbuf, 512)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); + ut_assertok(memcmp(mbr_wbuf, rbuf, BLKSZ)); + ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextlinen("MMC read: dev # 6"); ut_assert_nextline("MBR: write success!"); ut_assertok(run_commandf("mbr verify mmc 6")); ut_assert_nextline("MBR: verify success!"); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| @@ -297,33 +304,33 @@ static int mbr_test_run(struct unit_test_state *uts) 000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| */ - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); for (unsigned i = 0; i < mbr_cmp_size; i++) { ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p1[i], - "1P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n", + "1P MBR+0x%04X: expected %#02X, actual: %#02X\n", mbr_cmp_start + i, mbr_parts_ref_p1[i], rbuf[mbr_cmp_start + i]); } /* Test two MBR partitions */ init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__); ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 2)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); - ut_assertok(memcmp(mbr_wbuf, rbuf, 512)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); + ut_assertok(memcmp(mbr_wbuf, rbuf, BLKSZ)); + ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextline("MBR: write success!"); ut_assertok(run_commandf("mbr verify mmc 6")); ut_assert_nextline("MBR: verify success!"); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| @@ -332,33 +339,33 @@ static int mbr_test_run(struct unit_test_state *uts) 000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| */ - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); for (unsigned i = 0; i < mbr_cmp_size; i++) { ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p2[i], - "2P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n", + "2P MBR+0x%04X: expected %#02X, actual: %#02X\n", mbr_cmp_start + i, mbr_parts_ref_p2[i], rbuf[mbr_cmp_start + i]); } /* Test three MBR partitions */ init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__); ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 3)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); - ut_assertok(memcmp(mbr_wbuf, rbuf, 512)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); + ut_assertok(memcmp(mbr_wbuf, rbuf, BLKSZ)); + ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextline("MBR: write success!"); ut_assertok(run_commandf("mbr verify mmc 6")); ut_assert_nextline("MBR: verify success!"); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| @@ -367,33 +374,33 @@ static int mbr_test_run(struct unit_test_state *uts) 000001e0 06 01 0e 66 25 01 00 50 00 00 00 08 00 00 00 00 |...f%..P........| 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| */ - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); for (unsigned i = 0; i < mbr_cmp_size; i++) { ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p3[i], - "3P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n", + "3P MBR+0x%04X: expected %#02X, actual: %#02X\n", mbr_cmp_start + i, mbr_parts_ref_p3[i], rbuf[mbr_cmp_start + i]); } /* Test four MBR partitions */ init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__); ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 4)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); - ut_assertok(memcmp(mbr_wbuf, rbuf, 512)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); + ut_assertok(memcmp(mbr_wbuf, rbuf, BLKSZ)); + ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextline("MBR: write success!"); ut_assertok(run_commandf("mbr verify mmc 6")); ut_assert_nextline("MBR: verify success!"); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| @@ -402,25 +409,25 @@ static int mbr_test_run(struct unit_test_state *uts) 000001e0 06 01 0e 66 25 01 00 50 00 00 00 08 00 00 00 66 |...f%..P.......f| 000001f0 26 01 0e 87 06 01 00 58 00 00 00 08 00 00 55 aa |&......X......U.| */ - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); for (unsigned i = 0; i < mbr_cmp_size; i++) { ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p4[i], - "4P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n", + "4P MBR+0x%04X: expected %#02X, actual: %#02X\n", mbr_cmp_start + i, mbr_parts_ref_p4[i], rbuf[mbr_cmp_start + i]); } /* Test five MBR partitions */ init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__); ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 5)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); - ut_assertok(memcmp(mbr_wbuf, rbuf, 512)); - ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk)); - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); - ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); + ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); + ut_assertok(memcmp(mbr_wbuf, rbuf, BLKSZ)); + ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); + ut_assertok(memcmp(ebr_wbuf, rbuf, BLKSZ)); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertf(0 == run_commandf("mbr write mmc 6"), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assert_nextline("MBR: write success!"); @@ -434,11 +441,11 @@ static int mbr_test_run(struct unit_test_state *uts) 000001e0 06 01 0e 66 25 01 00 50 00 00 00 08 00 00 00 66 |...f%..P.......f| 000001f0 26 01 05 a7 26 01 00 58 00 00 00 10 00 00 55 aa |&...&..X......U.| */ - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra)); for (unsigned i = 0; i < mbr_cmp_size; i++) { ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p5[i], - "5P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n", + "5P MBR+0x%04X: expected %#02X, actual: %#02X\n", mbr_cmp_start + i, mbr_parts_ref_p5[i], rbuf[mbr_cmp_start + i]); } /* @@ -448,13 +455,16 @@ static int mbr_test_run(struct unit_test_state *uts) 00b001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00b001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| */ - memset(rbuf, 0, sizeof(rbuf)); - ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); + memset(rbuf, '\0', BLKSZ); + ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk)); for (unsigned i = 0; i < ebr_cmp_size; i++) { ut_assertf(rbuf[ebr_cmp_start + i] == ebr_parts_ref_p5[i], - "5P EBR+0x%04X: expected 0x%02X, actual: 0x%02X\n", + "5P EBR+0x%04X: expected %#02X, actual: %#02X\n", ebr_cmp_start + i, ebr_parts_ref_p5[i], rbuf[ebr_cmp_start + i]); } + unmap_sysmem(mbr_wbuf); + unmap_sysmem(ebr_wbuf); + unmap_sysmem(rbuf); return 0; } @@ -469,9 +479,3 @@ int do_ut_mbr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return cmd_ut_category("mbr", "mbr_test_", tests, n_ents, argc, argv); } - -static int dm_test_cmd_mbr(struct unit_test_state *uts) -{ - return mbr_test_run(uts); -} -DM_TEST(dm_test_cmd_mbr, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/dm/acpi_dp.c b/test/dm/acpi_dp.c index eaeda2b8a7a..038806004b5 100644 --- a/test/dm/acpi_dp.c +++ b/test/dm/acpi_dp.c @@ -7,7 +7,7 @@ */ #include <dm.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <acpi/acpigen.h> #include <acpi/acpi_dp.h> #include <asm/unaligned.h> diff --git a/test/dm/acpigen.c b/test/dm/acpigen.c index 3e912fadaef..23c16bd9866 100644 --- a/test/dm/acpigen.c +++ b/test/dm/acpigen.c @@ -9,7 +9,7 @@ #include <dm.h> #include <irq.h> #include <malloc.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <acpi/acpigen.h> #include <acpi/acpi_device.h> #include <acpi/acpi_table.h> diff --git a/test/dm/panel.c b/test/dm/panel.c index ce835c96ed0..ec85a9b1e6e 100644 --- a/test/dm/panel.c +++ b/test/dm/panel.c @@ -33,7 +33,7 @@ static int dm_test_panel(struct unit_test_state *uts) ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, &enable, &polarity)); ut_asserteq(false, enable); - ut_asserteq(false, regulator_get_enable(reg)); + ut_asserteq(true, regulator_get_enable(reg)); ut_assertok(panel_enable_backlight(dev)); ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, diff --git a/test/dm/regulator.c b/test/dm/regulator.c index 532bbd82376..449748ad52f 100644 --- a/test/dm/regulator.c +++ b/test/dm/regulator.c @@ -186,7 +186,7 @@ int dm_test_power_regulator_set_enable_if_allowed(struct unit_test_state *uts) /* Get BUCK1 - always on regulator */ platname = regulator_names[BUCK1][PLATNAME]; - ut_assertok(regulator_autoset_by_name(platname, &dev_autoset)); + ut_asserteq(-EALREADY, regulator_autoset_by_name(platname, &dev_autoset)); ut_assertok(regulator_get_by_platname(platname, &dev)); /* Try disabling always-on regulator */ @@ -288,7 +288,7 @@ static int dm_test_power_regulator_autoset(struct unit_test_state *uts) * Expected output state: uV=1200000; uA=200000; output enabled */ platname = regulator_names[BUCK1][PLATNAME]; - ut_assertok(regulator_autoset_by_name(platname, &dev_autoset)); + ut_asserteq(-EALREADY, regulator_autoset_by_name(platname, &dev_autoset)); /* Check, that the returned device is proper */ ut_assertok(regulator_get_by_platname(platname, &dev)); diff --git a/test/hush/dollar.c b/test/hush/dollar.c index 91b097017c2..077dcd62c0e 100644 --- a/test/hush/dollar.c +++ b/test/hush/dollar.c @@ -52,29 +52,22 @@ static int hush_test_simple_dollar(struct unit_test_state *uts) ut_asserteq(1, run_command("dollar_foo='bar quux", 0)); /* Next line contains error message */ ut_assert_skipline(); - - if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) { - /* - * For some strange reasons, the console is not empty after - * running above command. - * So, we reset it to not have side effects for other tests. - */ - console_record_reset_enable(); - } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) { - ut_assert_console_end(); - } + ut_assert_console_end(); ut_asserteq(1, run_command("dollar_foo=bar quux\"", 0)); - /* Two next lines contain error message */ - ut_assert_skipline(); + /* Next line contains error message */ ut_assert_skipline(); - - if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) { - /* See above comments. */ - console_record_reset_enable(); - } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) { - ut_assert_console_end(); + /* + * Old parser prints the error message on two lines: + * Unknown command 'quux + * ' - try 'help' + * While the new only prints it on one: + * syntax error: unterminated \" + */ + if (gd->flags & GD_FLG_HUSH_OLD_PARSER) { + ut_assert_skipline(); } + ut_assert_console_end(); ut_assertok(run_command("dollar_foo='bar \"quux'", 0)); diff --git a/test/lib/uuid.c b/test/lib/uuid.c index 8fe65dbf78b..d00e9563a47 100644 --- a/test/lib/uuid.c +++ b/test/lib/uuid.c @@ -8,13 +8,18 @@ * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> */ -#include <uuid.h> +#include <charset.h> +#include <u-boot/uuid.h> #include <test/lib.h> #include <test/test.h> #include <test/ut.h> +#include <efi.h> + /* test UUID */ #define TEST_SVC_UUID "ed32d533-4209-99e6-2d72-cdd998a79cc0" +/* U-Boot default fw image namespace */ +#define DEFAULT_FW_IMAGE_NAMESPACE "8c9f137e-91dc-427b-b2d6-b420faebaf2a" #define UUID_SIZE 16 @@ -37,3 +42,120 @@ static int lib_test_uuid_to_le(struct unit_test_state *uts) return 0; } LIB_TEST(lib_test_uuid_to_le, 0); + +#if defined(CONFIG_RANDOM_UUID) || defined(CONFIG_CMD_UUID) +/* Test UUID attribute bits (version, variant) */ +static int lib_test_uuid_bits(struct unit_test_state *uts) +{ + unsigned char uuid[16]; + efi_guid_t guid; + int i; + + /* + * Reduce the chance of a randomly generated UUID disguising + * a regression by testing multiple times. + */ + for (i = 0; i < 5; i++) { + /* Test UUID v4 */ + gen_rand_uuid((unsigned char *)&uuid); + + printf("v4 UUID: %pUb\n", (efi_guid_t *)uuid); + + /* version 4 */ + ut_assert((uuid[6] & 0xf0) == 0x40); + /* variant 1 */ + ut_assert((uuid[8] & UUID_VARIANT_MASK) == (UUID_VARIANT << UUID_VARIANT_SHIFT)); + + /* Test v5, use the v4 UUID as the namespace */ + gen_v5_guid((struct uuid *)uuid, + &guid, "test", 4, NULL); + + printf("v5 GUID: %pUl\n", (efi_guid_t *)uuid); + + /* This is a GUID so bits 6 and 7 are swapped (little endian). Version 5 */ + ut_assert((guid.b[7] & 0xf0) == 0x50); + /* variant 1 */ + ut_assert((guid.b[8] & UUID_VARIANT_MASK) == (UUID_VARIANT << UUID_VARIANT_SHIFT)); + } + + return 0; +} + +LIB_TEST(lib_test_uuid_bits, 0); +#endif + +struct dynamic_uuid_test_data { + const char *compatible; + const u16 *images[4]; + const char *expected_uuids[4]; +}; + +static int lib_test_dynamic_uuid_case(struct unit_test_state *uts, + const struct dynamic_uuid_test_data *data) +{ + struct uuid namespace; + int j; + + ut_assertok(uuid_str_to_bin(DEFAULT_FW_IMAGE_NAMESPACE, (unsigned char *)&namespace, + UUID_STR_FORMAT_GUID)); + + for (j = 0; data->images[j]; j++) { + const char *expected_uuid = data->expected_uuids[j]; + const u16 *image = data->images[j]; + efi_guid_t uuid; + char uuid_str[37]; + + gen_v5_guid(&namespace, &uuid, + data->compatible, strlen(data->compatible), + image, u16_strlen(image) * sizeof(uint16_t), + NULL); + uuid_bin_to_str((unsigned char *)&uuid, uuid_str, UUID_STR_FORMAT_GUID); + + ut_asserteq_str(expected_uuid, uuid_str); + } + + return 0; +} + +static int lib_test_dynamic_uuid(struct unit_test_state *uts) +{ + int ret, i; + const struct dynamic_uuid_test_data test_data[] = { + { + .compatible = "sandbox", + .images = { + u"SANDBOX-UBOOT", + u"SANDBOX-UBOOT-ENV", + u"SANDBOX-FIT", + NULL, + }, + .expected_uuids = { + "985f2937-7c2e-5e9a-8a5e-8e063312964b", + "9e339473-c2eb-530a-a69b-0cd6bbbed40e", + "46610520-469e-59dc-a8dd-c11832b877ea", + NULL, + } + }, + { + .compatible = "qcom,qrb4210-rb2", + .images = { + u"QUALCOMM-UBOOT", + NULL, + }, + .expected_uuids = { + "d5021fac-8dd0-5ed7-90c2-763c304aaf86", + NULL, + } + }, + }; + + for (i = 0; i < ARRAY_SIZE(test_data); i++) { + ret = lib_test_dynamic_uuid_case(uts, &test_data[i]); + if (ret) + return ret; + } + + return 0; +} + +LIB_TEST(lib_test_dynamic_uuid, 0); diff --git a/test/py/tests/test_bootstage.py b/test/py/tests/test_bootstage.py index a9eb9f0b4a1..bd71a1af3a2 100644 --- a/test/py/tests/test_bootstage.py +++ b/test/py/tests/test_bootstage.py @@ -33,7 +33,7 @@ def test_bootstage_report(u_boot_console): @pytest.mark.buildconfigspec('bootstage') @pytest.mark.buildconfigspec('cmd_bootstage') @pytest.mark.buildconfigspec('bootstage_stash') -def test_bootstage_stash(u_boot_console): +def test_bootstage_stash_and_unstash(u_boot_console): f = u_boot_console.config.env.get('env__bootstage_cmd_file', None) if not f: pytest.skip('No bootstage environment file is defined') @@ -55,13 +55,8 @@ def test_bootstage_stash(u_boot_console): # Check expected string in last column of output output_last_col = ''.join([i.split()[-1] for i in output.split('\n')]) assert expected_text in output_last_col - return addr, size -@pytest.mark.buildconfigspec('bootstage') -@pytest.mark.buildconfigspec('cmd_bootstage') -@pytest.mark.buildconfigspec('bootstage_stash') -def test_bootstage_unstash(u_boot_console): - addr, size = test_bootstage_stash(u_boot_console) + # Check that unstash works as expected u_boot_console.run_command('bootstage unstash %x %x' % (addr, size)) output = u_boot_console.run_command('echo $?') assert output.endswith('0') diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py index 11bcdc2bb29..a726c71c113 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_fit.py @@ -147,7 +147,7 @@ class TestEfiCapsuleFirmwareFit(): verify_content(u_boot_console, '150000', 'u-boot-env:Old') else: # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT. - assert '3673B45D-6A7C-46F3-9E60-ADABB03F7937' in ''.join(output) + assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output) assert 'ESRT: fw_version=5' in ''.join(output) assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output) diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py index f3a2dff5c2c..8a790405c7c 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py @@ -145,10 +145,10 @@ class TestEfiCapsuleFirmwareRaw: 'efidebug capsule esrt']) # ensure that SANDBOX_UBOOT_ENV_IMAGE_GUID is in the ESRT. - assert '5A7021F5-FEF2-48B4-AABA-832E777418C0' in ''.join(output) + assert '9E339473-C2EB-530A-A69B-0CD6BBBED40E' in ''.join(output) # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT. - assert '09D7CF52-0720-4710-91D1-08469B7FE9C8' in ''.join(output) + assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output) check_file_removed(u_boot_console, disk_img, capsule_files) @@ -199,12 +199,12 @@ class TestEfiCapsuleFirmwareRaw: verify_content(u_boot_console, '150000', 'u-boot-env:Old') else: # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT. - assert '09D7CF52-0720-4710-91D1-08469B7FE9C8' in ''.join(output) + assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output) assert 'ESRT: fw_version=5' in ''.join(output) assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output) # ensure that SANDBOX_UBOOT_ENV_IMAGE_GUID is in the ESRT. - assert '5A7021F5-FEF2-48B4-AABA-832E777418C0' in ''.join(output) + assert '9E339473-C2EB-530A-A69B-0CD6BBBED40E' in ''.join(output) assert 'ESRT: fw_version=10' in ''.join(output) assert 'ESRT: lowest_supported_fw_version=7' in ''.join(output) diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py index 44a58baa310..debbce8bdbd 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py @@ -157,7 +157,7 @@ class TestEfiCapsuleFirmwareSignedFit(): 'efidebug capsule esrt']) # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT. - assert '3673B45D-6A7C-46F3-9E60-ADABB03F7937' in ''.join(output) + assert '46610520-469E-59DC-A8DD-C11832B877EA' in ''.join(output) assert 'ESRT: fw_version=5' in ''.join(output) assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output) diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py index 83a10e160b8..439bd71b3a7 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py @@ -151,12 +151,12 @@ class TestEfiCapsuleFirmwareSignedRaw(): 'efidebug capsule esrt']) # ensure that SANDBOX_UBOOT_IMAGE_GUID is in the ESRT. - assert '09D7CF52-0720-4710-91D1-08469B7FE9C8' in ''.join(output) + assert '985F2937-7C2E-5E9A-8A5E-8E063312964B' in ''.join(output) assert 'ESRT: fw_version=5' in ''.join(output) assert 'ESRT: lowest_supported_fw_version=3' in ''.join(output) # ensure that SANDBOX_UBOOT_ENV_IMAGE_GUID is in the ESRT. - assert '5A7021F5-FEF2-48B4-AABA-832E777418C0' in ''.join(output) + assert '9E339473-C2EB-530A-A69B-0CD6BBBED40E' in ''.join(output) assert 'ESRT: fw_version=10' in ''.join(output) assert 'ESRT: lowest_supported_fw_version=7' in ''.join(output) diff --git a/test/py/tests/test_efi_capsule/version.dtso b/test/py/tests/test_efi_capsule/version.dtso index 07850cc6064..3aebb5b64fb 100644 --- a/test/py/tests/test_efi_capsule/version.dtso +++ b/test/py/tests/test_efi_capsule/version.dtso @@ -8,17 +8,17 @@ image1 { lowest-supported-version = <3>; image-index = <1>; - image-type-id = "09D7CF52-0720-4710-91D1-08469B7FE9C8"; + image-type-id = "985F2937-7C2E-5E9A-8A5E-8E063312964B"; }; image2 { lowest-supported-version = <7>; image-index = <2>; - image-type-id = "5A7021F5-FEF2-48B4-AABA-832E777418C0"; + image-type-id = "9E339473-C2EB-530A-A69B-0CD6BBBED40E"; }; image3 { lowest-supported-version = <3>; image-index = <1>; - image-type-id = "3673B45D-6A7C-46F3-9E60-ADABB03F7937"; + image-type-id = "46610520-469E-59DC-A8DD-C11832B877EA"; }; }; }; diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py index 85473a9049b..5f3b448a066 100644 --- a/test/py/tests/test_efi_loader.py +++ b/test/py/tests/test_efi_loader.py @@ -45,11 +45,18 @@ env__efi_loader_helloworld_file = { 'crc32': 'c2244b26', # CRC32 check sum 'addr': 0x40400000, # load address } + +# False if the helloworld EFI over HTTP boot test should be performed. +# If HTTP boot testing is not possible or desired, set this variable to True or +# ommit it. +env__efi_helloworld_net_http_test_skip = True """ import pytest import u_boot_utils +PROTO_TFTP, PROTO_HTTP = range(0, 2) + net_set_up = False def test_efi_pre_commands(u_boot_console): @@ -110,10 +117,10 @@ def test_efi_setup_static(u_boot_console): global net_set_up net_set_up = True -def fetch_tftp_file(u_boot_console, env_conf): - """Grab an env described file via TFTP and return its address +def fetch_file(u_boot_console, env_conf, proto): + """Grab an env described file via TFTP or HTTP and return its address - A file as described by an env config <env_conf> is downloaded from the TFTP + A file as described by an env config <env_conf> is downloaded from the server. The address to that file is returned. """ if not net_set_up: @@ -128,7 +135,13 @@ def fetch_tftp_file(u_boot_console, env_conf): addr = u_boot_utils.find_ram_base(u_boot_console) fn = f['fn'] - output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) + if proto == PROTO_TFTP: + cmd = 'tftpboot' + elif proto == PROTO_HTTP: + cmd = 'wget' + else: + assert False + output = u_boot_console.run_command('%s %x %s' % (cmd, addr, fn)) expected_text = 'Bytes transferred = ' sz = f.get('size', None) if sz: @@ -147,22 +160,40 @@ def fetch_tftp_file(u_boot_console, env_conf): return addr +def do_test_efi_helloworld_net(u_boot_console, proto): + addr = fetch_file(u_boot_console, 'env__efi_loader_helloworld_file', proto) + + output = u_boot_console.run_command('bootefi %x' % addr) + expected_text = 'Hello, world' + assert expected_text in output + expected_text = '## Application failed' + assert expected_text not in output + @pytest.mark.buildconfigspec('of_control') @pytest.mark.buildconfigspec('cmd_bootefi_hello_compile') -def test_efi_helloworld_net(u_boot_console): +@pytest.mark.buildconfigspec('cmd_tftpboot') +def test_efi_helloworld_net_tftp(u_boot_console): """Run the helloworld.efi binary via TFTP. The helloworld.efi file is downloaded from the TFTP server and is executed using the fallback device tree at $fdtcontroladdr. """ - addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_helloworld_file') + do_test_efi_helloworld_net(u_boot_console, PROTO_TFTP); - output = u_boot_console.run_command('bootefi %x' % addr) - expected_text = 'Hello, world' - assert expected_text in output - expected_text = '## Application failed' - assert expected_text not in output +@pytest.mark.buildconfigspec('of_control') +@pytest.mark.buildconfigspec('cmd_bootefi_hello_compile') +@pytest.mark.buildconfigspec('cmd_wget') +def test_efi_helloworld_net_http(u_boot_console): + """Run the helloworld.efi binary via HTTP. + + The helloworld.efi file is downloaded from the HTTP server and is executed + using the fallback device tree at $fdtcontroladdr. + """ + if u_boot_console.config.env.get('env__efi_helloworld_net_http_test_skip', True): + pytest.skip('helloworld.efi HTTP test is not enabled!') + + do_test_efi_helloworld_net(u_boot_console, PROTO_HTTP); @pytest.mark.buildconfigspec('cmd_bootefi_hello') def test_efi_helloworld_builtin(u_boot_console): @@ -178,6 +209,7 @@ def test_efi_helloworld_builtin(u_boot_console): @pytest.mark.buildconfigspec('of_control') @pytest.mark.buildconfigspec('cmd_bootefi') +@pytest.mark.buildconfigspec('cmd_tftpboot') def test_efi_grub_net(u_boot_console): """Run the grub.efi binary via TFTP. @@ -185,7 +217,7 @@ def test_efi_grub_net(u_boot_console): executed. """ - addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_grub_file') + addr = fetch_file(u_boot_console, 'env__efi_loader_grub_file', PROTO_TFTP) u_boot_console.run_command('bootefi %x' % addr, wait_for_prompt=False) diff --git a/test/py/tests/test_net_boot.py b/test/py/tests/test_net_boot.py index 63309fe82e1..d7d74356928 100644 --- a/test/py/tests/test_net_boot.py +++ b/test/py/tests/test_net_boot.py @@ -75,7 +75,7 @@ env__net_pxe_bootable_file = { 'check_pattern': 'ERROR', } -# False or omitted if a PXE boot test should be tested. +# False if a PXE boot test should be tested. # If PXE boot testing is not possible or desired, set this variable to True. # For example: If pxe configuration file is not proper to boot env__pxe_boot_test_skip = False diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index 05e15830590..39aa1035e34 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -1,6 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. +""" +Unit-test runner + +Provides a test_ut() function which is used by conftest.py to run each unit +test one at a time, as well setting up some files needed by the tests. +# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. +""" import collections import getpass import gzip @@ -44,8 +50,8 @@ def setup_image(cons, mmc_dev, part_type, second_part=False): if second_part: spec += '\ntype=c' - u_boot_utils.run_and_log(cons, 'qemu-img create %s 20M' % fname) - u_boot_utils.run_and_log(cons, 'sudo sfdisk %s' % fname, + u_boot_utils.run_and_log(cons, f'qemu-img create {fname} 20M') + u_boot_utils.run_and_log(cons, f'sudo sfdisk {fname}', stdin=spec.encode('utf-8')) return fname, mnt @@ -61,13 +67,13 @@ def mount_image(cons, fname, mnt, fstype): Returns: str: Name of loop device used """ - out = u_boot_utils.run_and_log(cons, 'sudo losetup --show -f -P %s' % fname) + out = u_boot_utils.run_and_log(cons, f'sudo losetup --show -f -P {fname}') loop = out.strip() part = f'{loop}p1' u_boot_utils.run_and_log(cons, f'sudo mkfs.{fstype} {part}') opts = '' if fstype == 'vfat': - opts += f' -o uid={os.getuid()},gid={os.getgid()}' + opts += f' -o uid={os.getuid()},gid={os.getgid()}' u_boot_utils.run_and_log(cons, f'sudo mount -o loop {part} {mnt}{opts}') u_boot_utils.run_and_log(cons, f'sudo chown {getpass.getuser()} {mnt}') return loop @@ -82,9 +88,7 @@ def copy_prepared_image(cons, mmc_dev, fname): """ infname = os.path.join(cons.config.source_dir, f'test/py/tests/bootstd/mmc{mmc_dev}.img.xz') - u_boot_utils.run_and_log( - cons, - ['sh', '-c', 'xz -dc %s >%s' % (infname, fname)]) + u_boot_utils.run_and_log(cons, ['sh', '-c', f'xz -dc {infname} >{fname}']) def setup_bootmenu_image(cons): """Create a 20MB disk image with a single ext4 partition @@ -101,9 +105,6 @@ def setup_bootmenu_image(cons): loop = mount_image(cons, fname, mnt, 'ext4') mounted = True - vmlinux = 'Image' - initrd = 'uInitrd' - dtbdir = 'dtb' script = '''# DO NOT EDIT THIS FILE # # Please edit /boot/armbianEnv.txt to set supported parameters @@ -177,12 +178,12 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} # Recompile with: # mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr -''' % (mmc_dev) +''' bootdir = os.path.join(mnt, 'boot') mkdir_cond(bootdir) cmd_fname = os.path.join(bootdir, 'boot.cmd') scr_fname = os.path.join(bootdir, 'boot.scr') - with open(cmd_fname, 'w') as outf: + with open(cmd_fname, 'w', encoding='ascii') as outf: print(script, file=outf) infname = os.path.join(cons.config.source_dir, @@ -212,13 +213,12 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} complete = True except ValueError as exc: - print('Falled to create image, failing back to prepared copy: %s', - str(exc)) + print(f'Falled to create image, failing back to prepared copy: {exc}') finally: if mounted: - u_boot_utils.run_and_log(cons, 'sudo umount --lazy %s' % mnt) + u_boot_utils.run_and_log(cons, f'sudo umount --lazy {mnt}') if loop: - u_boot_utils.run_and_log(cons, 'sudo losetup -d %s' % loop) + u_boot_utils.run_and_log(cons, f'sudo losetup -d {loop}') if not complete: copy_prepared_image(cons, mmc_dev, fname) @@ -254,32 +254,32 @@ label Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) ext = os.path.join(mnt, 'extlinux') mkdir_cond(ext) - with open(os.path.join(ext, 'extlinux.conf'), 'w') as fd: + conf = os.path.join(ext, 'extlinux.conf') + with open(conf, 'w', encoding='ascii') as fd: print(script, file=fd) inf = os.path.join(cons.config.persistent_data_dir, 'inf') with open(inf, 'wb') as fd: fd.write(gzip.compress(b'vmlinux')) - u_boot_utils.run_and_log(cons, 'mkimage -f auto -d %s %s' % - (inf, os.path.join(mnt, vmlinux))) + u_boot_utils.run_and_log( + cons, f'mkimage -f auto -d {inf} {os.path.join(mnt, vmlinux)}') - with open(os.path.join(mnt, initrd), 'w') as fd: + with open(os.path.join(mnt, initrd), 'w', encoding='ascii') as fd: print('initrd', file=fd) mkdir_cond(os.path.join(mnt, dtbdir)) - dtb_file = os.path.join(mnt, '%s/sandbox.dtb' % dtbdir) + dtb_file = os.path.join(mnt, f'{dtbdir}/sandbox.dtb') u_boot_utils.run_and_log( - cons, 'dtc -o %s' % dtb_file, stdin=b'/dts-v1/; / {};') + cons, f'dtc -o {dtb_file}', stdin=b'/dts-v1/; / {};') complete = True except ValueError as exc: - print('Falled to create image, failing back to prepared copy: %s', - str(exc)) + print(f'Falled to create image, failing back to prepared copy: {exc}') finally: if mounted: - u_boot_utils.run_and_log(cons, 'sudo umount --lazy %s' % mnt) + u_boot_utils.run_and_log(cons, f'sudo umount --lazy {mnt}') if loop: - u_boot_utils.run_and_log(cons, 'sudo losetup -d %s' % loop) + u_boot_utils.run_and_log(cons, f'sudo losetup -d {loop}') if not complete: copy_prepared_image(cons, mmc_dev, fname) @@ -303,7 +303,8 @@ def setup_cros_image(cons): Return: bytes: Packed-kernel data """ - kern_part = os.path.join(cons.config.result_dir, 'kern-part-{arch}.bin') + kern_part = os.path.join(cons.config.result_dir, + f'kern-part-{arch}.bin') u_boot_utils.run_and_log( cons, f'futility vbutil_kernel --pack {kern_part} ' @@ -332,7 +333,7 @@ def setup_cros_image(cons): mmc_dev = 5 fname = os.path.join(cons.config.source_dir, f'mmc{mmc_dev}.img') - u_boot_utils.run_and_log(cons, 'qemu-img create %s 20M' % fname) + u_boot_utils.run_and_log(cons, f'qemu-img create {fname} 20M') #mnt = os.path.join(cons.config.persistent_data_dir, 'mnt') #mkdir_cond(mnt) u_boot_utils.run_and_log(cons, f'cgpt create {fname}') @@ -381,20 +382,20 @@ def setup_cros_image(cons): u_boot_utils.run_and_log(cons, f'cgpt boot -p {fname}') out = u_boot_utils.run_and_log(cons, f'cgpt show -q {fname}') - '''We expect something like this: - 8239 2048 1 Basic data - 45 2048 2 ChromeOS kernel - 8238 1 3 ChromeOS rootfs - 2093 2048 4 ChromeOS kernel - 8237 1 5 ChromeOS rootfs - 41 1 6 ChromeOS kernel - 42 1 7 ChromeOS rootfs - 4141 2048 8 Basic data - 43 1 9 ChromeOS reserved - 44 1 10 ChromeOS reserved - 40 1 11 ChromeOS firmware - 6189 2048 12 EFI System Partition - ''' + + # We expect something like this: + # 8239 2048 1 Basic data + # 45 2048 2 ChromeOS kernel + # 8238 1 3 ChromeOS rootfs + # 2093 2048 4 ChromeOS kernel + # 8237 1 5 ChromeOS rootfs + # 41 1 6 ChromeOS kernel + # 42 1 7 ChromeOS rootfs + # 4141 2048 8 Basic data + # 43 1 9 ChromeOS reserved + # 44 1 10 ChromeOS reserved + # 40 1 11 ChromeOS firmware + # 6189 2048 12 EFI System Partition # Create a dict (indexed by partition number) containing the above info for line in out.splitlines(): @@ -446,7 +447,7 @@ def setup_android_image(cons): mmc_dev = 7 fname = os.path.join(cons.config.source_dir, f'mmc{mmc_dev}.img') - u_boot_utils.run_and_log(cons, 'qemu-img create %s 20M' % fname) + u_boot_utils.run_and_log(cons, f'qemu-img create {fname} 20M') u_boot_utils.run_and_log(cons, f'cgpt create {fname}') ptr = 40 @@ -498,11 +499,12 @@ def setup_android_image(cons): with open(fname, 'wb') as outf: outf.write(disk_data) - print('wrote to {}'.format(fname)) + print(f'wrote to {fname}') return fname def setup_cedit_file(cons): + """Set up a .dtb file for use with testing expo and configuration editor""" infname = os.path.join(cons.config.source_dir, 'test/boot/files/expo_layout.dts') inhname = os.path.join(cons.config.source_dir, @@ -584,7 +586,7 @@ def test_ut(u_boot_console, ut_subtest): # ut hush hush_test_simple_dollar prints "Unknown command" on purpose. with u_boot_console.disable_check('unknown_command'): output = u_boot_console.run_command('ut ' + ut_subtest) - assert('Unknown command \'quux\' - try \'help\'' in output) + assert 'Unknown command \'quux\' - try \'help\'' in output else: output = u_boot_console.run_command('ut ' + ut_subtest) assert output.endswith('Failures: 0') diff --git a/test/test-main.c b/test/test-main.c index 63e8be0ccd1..b3d3e24cdce 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -12,6 +12,7 @@ #include <net.h> #include <of_live.h> #include <os.h> +#include <usb.h> #include <dm/ofnode.h> #include <dm/root.h> #include <dm/test.h> @@ -289,6 +290,43 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) { ut_assertok(event_init()); + /* + * Remove any USB keyboard, so that we can add and remove USB devices + * in tests. + * + * For UT_TESTF_DM tests, the old driver model state is saved and + * restored across each test. Within in each test there is therefore a + * new driver model state, which means that any USB keyboard device in + * stdio points to the old state. + * + * This is fine in most cases. But if a non-UT_TESTF_DM test starts up + * USB (thus creating a stdio record pointing to the USB keyboard + * device) then when the test finishes, the new driver model state is + * freed, meaning that there is now a stale pointer in stdio. + * + * This means that any future UT_TESTF_DM test which uses stdin will + * cause the console system to call tstc() on the stale device pointer, + * causing a crash. + * + * We don't want to fix this by enabling UT_TESTF_DM for all tests as + * this causes other problems. For example, bootflow_efi relies on + * U-Boot going through a proper init - without that we don't have the + * TCG measurement working and get an error + * 'tcg2 measurement fails(0x8000000000000007)'. Once we tidy up how EFI + * runs tests (e.g. get rid of all the restarting of U-Boot) we could + * potentially make the bootstd tests set UT_TESTF_DM, but other tests + * might do the same thing. + * + * We could add a test flag to declare that USB is being used, but that + * seems unnecessary, at least for now. We could detect USB being used + * in a test, but there is no obvious drawback to clearing out stale + * pointers always. + * + * So just remove any USB keyboards from the console tables. This allows + * UT_TESTF_DM and non-UT_TESTF_DM tests to coexist happily. + */ + usb_kbd_remove_for_test(); + if (test->flags & UTF_DM) ut_assertok(dm_test_pre_run(uts)); diff --git a/tools/Makefile b/tools/Makefile index 6a4280e3668..ee08a9675df 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -246,12 +246,12 @@ HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include HOSTCFLAGS_mkeficapsule.o += \ $(shell pkg-config --cflags gnutls 2> /dev/null || echo "") -HOSTCFLAGS_mkeficapsule.o += \ - $(shell pkg-config --cflags uuid 2> /dev/null || echo "") HOSTLDLIBS_mkeficapsule += \ $(shell pkg-config --libs gnutls 2> /dev/null || echo "-lgnutls") -HOSTLDLIBS_mkeficapsule += \ - $(shell pkg-config --libs uuid 2> /dev/null || echo "-luuid") +mkeficapsule-objs := generated/lib/uuid.o \ + generated/lib/sha1.o \ + $(LIBFDT_OBJS) \ + mkeficapsule.o hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst index 0cafc36bdcb..f9a3a42183b 100644 --- a/tools/binman/binman.rst +++ b/tools/binman/binman.rst @@ -494,12 +494,18 @@ point into the image. For example, say SPL is at the start of the image and linked to start at address 80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded -to 80108000, with SPL at 80108000 and U-Boot at 80110000. +to 80108000, with SPL at 80108000 and U-Boot at 80110000. In other words, the +positions are calculated relative to the start address of the image to which +they are being written. For x86 devices (with the end-at-4gb property) this base address is not added since it is assumed that images are XIP and the offsets already include the address. +For non-x86 cases where the symbol is used as a flash offset, the symbols-base +property can be set to that offset (e.g. 0), so that the unadjusted image-pos +is written into the image. + While U-Boot's symbol updating is handled automatically by the u-boot-spl entry type (and others), it is possible to use this feature with any blob. To do this, add a `write-symbols` (boolean) property to the node, set the ELF @@ -741,6 +747,17 @@ insert-template: properties are brought into the target node. See Templates_ below for more information. +symbols-base: + When writing symbols into a binary, the value of that symbol is assumed to + be relative to the base address of the binary. This allow the binary to be + loaded in memory at its base address, so that symbols point into the binary + correctly. In some cases the binary is in fact not yet in memory, but must + be read from storage. In this case there is no base address for the symbols. + This property can be set to 0 to indicate this. Other values for + symbols-base are allowed, but care must be taken that the code which uses + the symbol is aware of the base being used. If omitted, the binary's base + address is used. + The attributes supported for images and sections are described below. Several are similar to those for entries. diff --git a/tools/binman/btool/fdtgrep.py b/tools/binman/btool/fdtgrep.py index da1f8c7bf4e..446b2f4144b 100644 --- a/tools/binman/btool/fdtgrep.py +++ b/tools/binman/btool/fdtgrep.py @@ -74,8 +74,7 @@ class Bintoolfdtgrep(bintool.Bintool): (with only neceesary nodes and properties) Returns: - CommandResult: Resulting output from the bintool, or None if the - tool is not present + str or bytes: Resulting stdout from the bintool """ if phase == 'tpl': tag = 'bootph-pre-sram' diff --git a/tools/binman/elf.py b/tools/binman/elf.py index a4694056391..c75f4478813 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -234,7 +234,7 @@ def GetSymbolOffset(elf_fname, sym_name, base_sym=None): return val - base def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, - base_sym=None): + base_sym=None, base_addr=None): """Replace all symbols in an entry with their correct values The entry contents is updated so that values for referenced symbols will be @@ -247,7 +247,10 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, entry entry: Entry to process section: Section which can be used to lookup symbol values - base_sym: Base symbol marking the start of the image + base_sym: Base symbol marking the start of the image (__image_copy_start + by default) + base_addr (int): Base address to use for the entry being written. If + None then the value of base_sym is used Returns: int: Number of symbols written @@ -277,7 +280,8 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, if not base and not is_elf: tout.debug(f'LookupAndWriteSymbols: no base: elf_fname={elf_fname}, base_sym={base_sym}, is_elf={is_elf}') return 0 - base_addr = 0 if is_elf else base.address + if base_addr is None: + base_addr = 0 if is_elf else base.address count = 0 for name, sym in syms.items(): if name.startswith('_binman'): @@ -301,8 +305,8 @@ def LookupAndWriteSymbols(elf_fname, entry, section, is_elf=False, value = BINMAN_SYM_MAGIC_VALUE else: # Look up the symbol in our entry tables. - value = section.GetImage().LookupImageSymbol(name, sym.weak, - msg, base_addr) + value = section.GetImage().GetImageSymbolValue(name, sym.weak, + msg, base_addr) if value is None: value = -1 pack_string = pack_string.lower() diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index b64134123c1..2f22639dffc 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -37,7 +37,7 @@ class FakeSection: """A fake Section object, used for testing This has the minimum feature set needed to support testing elf functions. - A LookupSymbol() function is provided which returns a fake value for amu + A GetSymbolValue() function is provided which returns a fake value for any symbol requested. """ def __init__(self, sym_value=1): @@ -46,7 +46,7 @@ class FakeSection: def GetPath(self): return 'section_path' - def LookupImageSymbol(self, name, weak, msg, base_addr): + def GetImageSymbolValue(self, name, weak, msg, base_addr): """Fake implementation which returns the same value for all symbols""" return self.sym_value diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index 12482703782..d82f7b89203 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -221,7 +221,7 @@ FIPs so that binman and other tools can access the entire image correctly. .. _FIP: https://trustedfirmware-a.readthedocs.io/en/latest/design/firmware-design.html#firmware-image-package-fip .. _`TF-A source tree`: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git -.. _`send a patch`: https://www.denx.de/wiki/U-Boot/Patches +.. _`send a patch`: https://docs.u-boot.org/en/latest/develop/sending_patches.html diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 6d2f3789940..68f8d62bba9 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -108,6 +108,9 @@ class Entry(object): not need to be done again. This is only used with 'binman replace', to stop sections from being rebuilt if their entries have not been replaced + symbols_base (int): Use this value as the assumed load address of the + target entry, when calculating the symbol value. If None, this is + 0 for blobs and the image-start address for ELF files """ fake_dir = None @@ -159,6 +162,7 @@ class Entry(object): self.preserve = False self.build_done = False self.no_write_symbols = False + self.symbols_base = None @staticmethod def FindEntryClass(etype, expanded): @@ -324,6 +328,7 @@ class Entry(object): self.preserve = fdt_util.GetBool(self._node, 'preserve') self.no_write_symbols = fdt_util.GetBool(self._node, 'no-write-symbols') + self.symbols_base = fdt_util.GetInt(self._node, 'symbols-base') def GetDefaultFilename(self): return None @@ -576,8 +581,16 @@ class Entry(object): def GetEntryArgsOrProps(self, props, required=False): """Return the values of a set of properties + Looks up the named entryargs and returns the value for each. If any + required ones are missing, the error is reported to the user. + Args: - props: List of EntryArg objects + props (list of EntryArg): List of entry arguments to look up + required (bool): True if these entry arguments are required + + Returns: + list of values: one for each item in props, the type is determined + by the EntryArg's 'datatype' property (str or int) Raises: ValueError if a property is not found @@ -698,14 +711,22 @@ class Entry(object): def WriteSymbols(self, section): """Write symbol values into binary files for access at run time + As a special case, if symbols_base is not specified and this is an + end-at-4gb image, a symbols_base of 0 is used + Args: section: Section containing the entry """ if self.auto_write_symbols and not self.no_write_symbols: # Check if we are writing symbols into an ELF file is_elf = self.GetDefaultFilename() == self.elf_fname + + symbols_base = self.symbols_base + if symbols_base is None and self.GetImage()._end_4gb: + symbols_base = 0 + elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage(), - is_elf, self.elf_base_sym) + is_elf, self.elf_base_sym, symbols_base) def CheckEntries(self): """Check that the entry offsets are correct diff --git a/tools/binman/etype/atf_fip.py b/tools/binman/etype/atf_fip.py index 73a3f85b9f4..636e073afc8 100644 --- a/tools/binman/etype/atf_fip.py +++ b/tools/binman/etype/atf_fip.py @@ -163,7 +163,7 @@ class Entry_atf_fip(Entry_section): .. _FIP: https://trustedfirmware-a.readthedocs.io/en/latest/design/firmware-design.html#firmware-image-package-fip .. _`TF-A source tree`: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git - .. _`send a patch`: https://www.denx.de/wiki/U-Boot/Patches + .. _`send a patch`: https://docs.u-boot.org/en/latest/develop/sending_patches.html """ def __init__(self, section, etype, node): # Put this here to allow entry-docs and help to work without libfdt @@ -248,7 +248,7 @@ class Entry_atf_fip(Entry_section): fent = entry._fip_entry entry.size = fent.size entry.offset = fent.offset - entry.image_pos = self.image_pos + entry.offset + entry.SetImagePos(image_pos + self.offset) def ReadChildData(self, child, decomp=True, alt_format=None): if not self.reader: diff --git a/tools/binman/etype/blob_phase.py b/tools/binman/etype/blob_phase.py index 951d9934050..09bb89b3b78 100644 --- a/tools/binman/etype/blob_phase.py +++ b/tools/binman/etype/blob_phase.py @@ -57,3 +57,8 @@ class Entry_blob_phase(Entry_section): if self.no_write_symbols: for entry in self._entries.values(): entry.no_write_symbols = True + + # Propagate the symbols-base property + if self.symbols_base is not None: + for entry in self._entries.values(): + entry.symbols_base = self.symbols_base diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py index 575aa624f6c..124fa1e4ffc 100644 --- a/tools/binman/etype/cbfs.py +++ b/tools/binman/etype/cbfs.py @@ -245,7 +245,7 @@ class Entry_cbfs(Entry): cfile = entry._cbfs_file entry.size = cfile.data_len entry.offset = cfile.calced_cbfs_offset - entry.image_pos = self.image_pos + entry.offset + entry.SetImagePos(image_pos + self.offset) if entry._cbfs_compress: entry.uncomp_size = cfile.memlen diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py index 5941545d0b2..9f06cc88e6e 100644 --- a/tools/binman/etype/efi_capsule.py +++ b/tools/binman/etype/efi_capsule.py @@ -24,7 +24,7 @@ def get_binman_test_guid(type_str): The actual GUID value (str) """ TYPE_TO_GUID = { - 'binman-test' : '09d7cf52-0720-4710-91d1-08469b7fe9c8' + 'binman-test' : '985f2937-7c2e-5e9a-8a5e-8e063312964b' } return TYPE_TO_GUID[type_str] @@ -151,6 +151,8 @@ class Entry_efi_capsule(Entry_section): return tools.read_file(capsule_fname) else: # Bintool is missing; just use the input data as the output + if not self.GetAllowMissing(): + self.Raise("Missing tool: 'mkeficapsule'") self.record_missing_bintool(self.mkeficapsule) return data diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index ee44e5a1cd6..0abe1c78c43 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py @@ -6,9 +6,10 @@ """Entry-type module for producing a FIT""" import glob -import libfdt import os +import libfdt + from binman.entry import Entry, EntryArg from binman.etype.section import Entry_section from binman import elf @@ -23,6 +24,7 @@ OPERATIONS = { 'split-elf': OP_SPLIT_ELF, } +# pylint: disable=invalid-name class Entry_fit(Entry_section): """Flat Image Tree (FIT) @@ -94,7 +96,10 @@ class Entry_fit(Entry_section): can be provided as a directory. Each .dtb file in the directory is processed, , e.g.:: - fit,fdt-list-dir = "arch/arm/dts + fit,fdt-list-dir = "arch/arm/dts"; + + In this case the input directories are ignored and all devicetree + files must be in that directory. Substitutions ~~~~~~~~~~~~~ @@ -381,31 +386,46 @@ class Entry_fit(Entry_section): def __init__(self, section, etype, node): """ Members: - _fit: FIT file being built - _entries: dict from Entry_section: + _fit (str): FIT file being built + _fit_props (list of str): 'fit,...' properties found in the + top-level node + _fdts (list of str): Filenames of .dtb files to process + _fdt_dir (str): Directory to scan to find .dtb files, or None + _fit_list_prop (str): Name of the EntryArg containing a list of .dtb + files + _fit_default_dt (str): Name of the EntryArg containing the default + .dtb file + _entries (dict of entries): from Entry_section: key: relative path to entry Node (from the base of the FIT) value: Entry_section object comprising the contents of this node - _priv_entries: Internal copy of _entries which includes 'generator' - entries which are used to create the FIT, but should not be - processed as real entries. This is set up once we have the - entries - _loadables: List of generated split-elf nodes, each a node name + _priv_entries (dict of entries): Internal copy of _entries which + includes 'generator' entries which are used to create the FIT, + but should not be processed as real entries. This is set up once + we have the entries + _loadables (list of str): List of generated split-elf nodes, each + a node name + _remove_props (list of str): Value of of-spl-remove-props EntryArg, + the list of properties to remove with fdtgrep + mkimage (Bintool): mkimage tool + fdtgrep (Bintool): fdtgrep tool """ super().__init__(section, etype, node) self._fit = None self._fit_props = {} self._fdts = None self._fdt_dir = None - self.mkimage = None - self.fdtgrep = None + self._fit_list_prop = None + self._fit_default_dt = None self._priv_entries = {} self._loadables = [] self._remove_props = [] - props, = self.GetEntryArgsOrProps( - [EntryArg('of-spl-remove-props', str)], required=False) + props = self.GetEntryArgsOrProps( + [EntryArg('of-spl-remove-props', str)], required=False)[0] if props: self._remove_props = props.split() + self.mkimage = None + self.fdtgrep = None def ReadNode(self): super().ReadNode() @@ -414,8 +434,8 @@ class Entry_fit(Entry_section): self._fit_props[pname] = prop self._fit_list_prop = self._fit_props.get('fit,fdt-list') if self._fit_list_prop: - fdts, = self.GetEntryArgsOrProps( - [EntryArg(self._fit_list_prop.value, str)]) + fdts = self.GetEntryArgsOrProps( + [EntryArg(self._fit_list_prop.value, str)])[0] if fdts is not None: self._fdts = fdts.split() else: @@ -431,7 +451,7 @@ class Entry_fit(Entry_section): self._fit_default_dt = self.GetEntryArgsOrProps([EntryArg('default-dt', str)])[0] - def _get_operation(self, base_node, node): + def _get_operation(self, node): """Get the operation referenced by a subnode Args: @@ -550,6 +570,9 @@ class Entry_fit(Entry_section): phase (str): Phase to generate for ('tpl', 'vpl', 'spl') outfile (str): Output filename to write the grepped FDT contents to (with only neceesary nodes and properties) + + Returns: + str or bytes: Resulting stdout from fdtgrep """ return self.fdtgrep.create_for_phase(infile, phase, outfile, self._remove_props) @@ -557,9 +580,6 @@ class Entry_fit(Entry_section): def _build_input(self): """Finish the FIT by adding the 'data' properties to it - Arguments: - fdt: FIT to update - Returns: bytes: New fdt contents """ @@ -580,13 +600,17 @@ class Entry_fit(Entry_section): if val.startswith('@'): if not self._fdts: return - if not self._fit_default_dt: + default_dt = self._fit_default_dt + if not default_dt: self.Raise("Generated 'default' node requires default-dt entry argument") - if self._fit_default_dt not in self._fdts: - self.Raise( - f"default-dt entry argument '{self._fit_default_dt}' " - f"not found in fdt list: {', '.join(self._fdts)}") - seq = self._fdts.index(self._fit_default_dt) + if default_dt not in self._fdts: + if self._fdt_dir: + default_dt = os.path.basename(default_dt) + if default_dt not in self._fdts: + self.Raise( + f"default-dt entry argument '{self._fit_default_dt}' " + f"not found in fdt list: {', '.join(self._fdts)}") + seq = self._fdts.index(default_dt) val = val[1:].replace('DEFAULT-SEQ', str(seq + 1)) fsw.property_string(pname, val) return @@ -634,7 +658,7 @@ class Entry_fit(Entry_section): result.append(name) return firmware, result - def _gen_fdt_nodes(base_node, node, depth, in_images): + def _gen_fdt_nodes(node, depth, in_images): """Generate FDT nodes This creates one node for each member of self._fdts using the @@ -654,7 +678,10 @@ class Entry_fit(Entry_section): # Generate nodes for each FDT for seq, fdt_fname in enumerate(self._fdts): node_name = node.name[1:].replace('SEQ', str(seq + 1)) - fname = tools.get_input_filename(fdt_fname + '.dtb') + if self._fdt_dir: + fname = os.path.join(self._fdt_dir, fdt_fname + '.dtb') + else: + fname = tools.get_input_filename(fdt_fname + '.dtb') fdt_phase = None with fsw.add_node(node_name): for pname, prop in node.props.items(): @@ -688,8 +715,9 @@ class Entry_fit(Entry_section): # Add data for 'images' nodes (but not 'config') if depth == 1 and in_images: if fdt_phase: + leaf = os.path.basename(fdt_fname) phase_fname = tools.get_output_filename( - f'{fdt_fname}-{fdt_phase}.dtb') + f'{leaf}-{fdt_phase}.dtb') self._run_fdtgrep(fname, fdt_phase, phase_fname) data = tools.read_file(phase_fname) else: @@ -707,11 +735,10 @@ class Entry_fit(Entry_section): else: self.Raise("Generator node requires 'fit,fdt-list' property") - def _gen_split_elf(base_node, node, depth, segments, entry_addr): + def _gen_split_elf(node, depth, segments, entry_addr): """Add nodes for the ELF file, one per group of contiguous segments Args: - base_node (Node): Template node from the binman definition node (Node): Node to replace (in the FIT being built) depth: Current node depth (0 is the base 'fit' node) segments (list): list of segments, each: @@ -742,7 +769,7 @@ class Entry_fit(Entry_section): with fsw.add_node(subnode.name): _add_node(node, depth + 1, subnode) - def _gen_node(base_node, node, depth, in_images, entry): + def _gen_node(node, depth, in_images, entry): """Generate nodes from a template This creates one or more nodes depending on the fit,operation being @@ -758,8 +785,6 @@ class Entry_fit(Entry_section): If the file is missing, nothing is generated. Args: - base_node (Node): Base Node of the FIT (with 'description' - property) node (Node): Generator node to process depth (int): Current node depth (0 is the base 'fit' node) in_images (bool): True if this is inside the 'images' node, so @@ -767,13 +792,12 @@ class Entry_fit(Entry_section): entry (entry_Section): Entry for the section containing the contents of this node """ - oper = self._get_operation(base_node, node) + oper = self._get_operation(node) if oper == OP_GEN_FDT_NODES: - _gen_fdt_nodes(base_node, node, depth, in_images) + _gen_fdt_nodes(node, depth, in_images) elif oper == OP_SPLIT_ELF: # Entry_section.ObtainContents() either returns True or # raises an exception. - data = None missing_opt_list = [] entry.ObtainContents() entry.Pack(0) @@ -795,7 +819,7 @@ class Entry_fit(Entry_section): self._raise_subnode( node, f'Failed to read ELF file: {str(exc)}') - _gen_split_elf(base_node, node, depth, segments, entry_addr) + _gen_split_elf(node, depth, segments, entry_addr) def _add_node(base_node, depth, node): """Add nodes to the output FIT @@ -826,7 +850,6 @@ class Entry_fit(Entry_section): fsw.property('data', bytes(data)) for subnode in node.subnodes: - subnode_path = f'{rel_path}/{subnode.name}' if has_images and not self.IsSpecialSubnode(subnode): # This subnode is a content node not meant to appear in # the FIT (e.g. "/images/kernel/u-boot"), so don't call @@ -834,7 +857,7 @@ class Entry_fit(Entry_section): pass elif self.GetImage().generate and subnode.name.startswith('@'): entry = self._priv_entries.get(subnode.name) - _gen_node(base_node, subnode, depth, in_images, entry) + _gen_node(subnode, depth, in_images, entry) # This is a generator (template) entry, so remove it from # the list of entries used by PackEntries(), etc. Otherwise # it will appear in the binman output @@ -876,7 +899,10 @@ class Entry_fit(Entry_section): """ if self.build_done: return - super().SetImagePos(image_pos) + + # Skip the section processing, since we do that below. Just call the + # entry method + Entry.SetImagePos(self, image_pos) # If mkimage is missing we'll have empty data, # which will cause a FDT_ERR_BADMAGIC error @@ -886,7 +912,7 @@ class Entry_fit(Entry_section): fdt = Fdt.FromData(self.GetData()) fdt.Scan() - for image_name, section in self._entries.items(): + for image_name, entry in self._entries.items(): path = f"/images/{image_name}" node = fdt.GetNode(path) @@ -914,10 +940,12 @@ class Entry_fit(Entry_section): # This should never happen else: # pragma: no cover + offset = None + size = None self.Raise(f'{path}: missing data properties') - section.SetOffsetSize(offset, size) - section.SetImagePos(self.image_pos) + entry.SetOffsetSize(offset, size) + entry.SetImagePos(image_pos + self.offset) def AddBintools(self, btools): super().AddBintools(btools) @@ -947,7 +975,7 @@ class Entry_fit(Entry_section): if input_fname: fname = input_fname else: - fname = tools.get_output_filename('%s.fit' % uniq) + fname = tools.get_output_filename(f'{uniq}.fit') tools.write_file(fname, self.GetData()) args.append(fname) diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py index 3585120b79b..8ad177b3b65 100644 --- a/tools/binman/etype/nxp_imx8mimage.py +++ b/tools/binman/etype/nxp_imx8mimage.py @@ -27,7 +27,8 @@ class Entry_nxp_imx8mimage(Entry_mkimage): def __init__(self, section, etype, node): super().__init__(section, etype, node) - self.required_props = ['nxp,boot-from', 'nxp,rom-version', 'nxp,loader-address'] + self.required_props = ['nxp,boot-from', 'nxp,rom-version', + 'nxp,loader-address'] def ReadNode(self): super().ReadNode() diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 30c1041c7e8..f4f48c00e87 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -563,13 +563,13 @@ class Entry_section(Entry): return entry.GetData(required) def LookupEntry(self, entries, sym_name, msg): - """Look up the entry for an ENF symbol + """Look up the entry for a binman symbol Args: entries (dict): entries to search: key: entry name value: Entry object - sym_name: Symbol name in the ELF file to look up in the format + sym_name: Symbol name to look up in the format _binman_<entry>_prop_<property> where <entry> is the name of the entry and <property> is the property to find (e.g. _binman_u_boot_prop_offset). As a special case, you can append @@ -606,11 +606,10 @@ class Entry_section(Entry): entry = entries[name] return entry, entry_name, prop_name - def LookupSymbol(self, sym_name, optional, msg, base_addr, entries=None): - """Look up a symbol in an ELF file + def GetSymbolValue(self, sym_name, optional, msg, base_addr, entries=None): + """Get the value of a Binman symbol - Looks up a symbol in an ELF file. Only entry types which come from an - ELF image can be used by this function. + Look up a Binman symbol and obtain its value. At present the only entry properties supported are: offset @@ -618,7 +617,7 @@ class Entry_section(Entry): size Args: - sym_name: Symbol name in the ELF file to look up in the format + sym_name: Symbol name to look up in the format _binman_<entry>_prop_<property> where <entry> is the name of the entry and <property> is the property to find (e.g. _binman_u_boot_prop_offset). As a special case, you can append @@ -628,12 +627,10 @@ class Entry_section(Entry): optional: True if the symbol is optional. If False this function will raise if the symbol is not found msg: Message to display if an error occurs - base_addr: Base address of image. This is added to the returned - image_pos in most cases so that the returned position indicates - where the targetted entry/binary has actually been loaded. But - if end-at-4gb is used, this is not done, since the binary is - already assumed to be linked to the ROM position and using - execute-in-place (XIP). + base_addr (int): Base address of image. This is added to the + returned value of image-pos so that the returned position + indicates where the targeted entry/binary has actually been + loaded Returns: Value that should be assigned to that symbol, or None if it was @@ -656,10 +653,10 @@ class Entry_section(Entry): if prop_name == 'offset': return entry.offset elif prop_name == 'image_pos': - value = entry.image_pos - if not self.GetImage()._end_4gb: - value += base_addr - return value + if not entry.image_pos: + tout.info(f'Symbol-writing: no value for {entry._node.path}') + return None + return base_addr + entry.image_pos if prop_name == 'size': return entry.size else: diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 93f3d22cf57..e3f231e4bcc 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -125,7 +125,7 @@ TEE_ADDR = 0x5678 # Firmware Management Protocol(FMP) GUID FW_MGMT_GUID = '6dcbd5ed-e82d-4c44-bda1-7194199ad92a' # Image GUID specified in the DTS -CAPSULE_IMAGE_GUID = '09d7cf52-0720-4710-91d1-08469b7fe9c8' +CAPSULE_IMAGE_GUID = '985F2937-7C2E-5E9A-8A5E-8E063312964B' # Windows cert GUID WIN_CERT_TYPE_EFI_GUID = '4aafd29d-68df-49ee-8aa9-347d375665a7' # Empty capsule GUIDs @@ -403,8 +403,10 @@ class TestFunctional(unittest.TestCase): test_section_timeout: True to force the first time to timeout, as used in testThreadTimeout() update_fdt_in_elf: Value to pass with --update-fdt-in-elf=xxx - force_missing_tools (str): comma-separated list of bintools to + force_missing_bintools (str): comma-separated list of bintools to regard as missing + ignore_missing (bool): True to return success even if there are + missing blobs or bintools output_dir: Specific output directory to use for image using -O Returns: @@ -503,8 +505,9 @@ class TestFunctional(unittest.TestCase): return dtb.GetContents() def _DoReadFileDtb(self, fname, use_real_dtb=False, use_expanded=False, - map=False, update_dtb=False, entry_args=None, - reset_dtbs=True, extra_indirs=None, threads=None): + verbosity=None, map=False, update_dtb=False, + entry_args=None, reset_dtbs=True, extra_indirs=None, + threads=None): """Run binman and return the resulting image This runs binman with a given test file and then reads the resulting @@ -521,6 +524,7 @@ class TestFunctional(unittest.TestCase): But in some test we need the real contents. use_expanded: True to use expanded entries where available, e.g. 'u-boot-expanded' instead of 'u-boot' + verbosity: Verbosity level to use (0-3, None=don't set it) map: True to output map files for the images update_dtb: Update the offset and size of each entry in the device tree before packing it into the image @@ -557,7 +561,8 @@ class TestFunctional(unittest.TestCase): try: retcode = self._DoTestFile(fname, map=map, update_dtb=update_dtb, entry_args=entry_args, use_real_dtb=use_real_dtb, - use_expanded=use_expanded, extra_indirs=extra_indirs, + use_expanded=use_expanded, verbosity=verbosity, + extra_indirs=extra_indirs, threads=threads) self.assertEqual(0, retcode) out_dtb_fname = tools.get_output_filename('u-boot.dtb.out') @@ -1498,18 +1503,22 @@ class TestFunctional(unittest.TestCase): self.assertEqual(U_BOOT_SPL_NODTB_DATA, data[:len(U_BOOT_SPL_NODTB_DATA)]) def checkSymbols(self, dts, base_data, u_boot_offset, entry_args=None, - use_expanded=False, no_write_symbols=False): + use_expanded=False, no_write_symbols=False, + symbols_base=None): """Check the image contains the expected symbol values Args: dts: Device tree file to use for test base_data: Data before and after 'u-boot' section - u_boot_offset: Offset of 'u-boot' section in image + u_boot_offset (int): Offset of 'u-boot' section in image, or None if + the offset not available due to it being in a compressed section entry_args: Dict of entry args to supply to binman key: arg name value: value of that arg use_expanded: True to use expanded entries where available, e.g. 'u-boot-expanded' instead of 'u-boot' + symbols_base (int): Value to expect for symbols-base in u-boot-spl, + None if none """ elf_fname = self.ElfTestFile('u_boot_binman_syms') syms = elf.GetSymbols(elf_fname, ['binman', 'image']) @@ -1520,22 +1529,64 @@ class TestFunctional(unittest.TestCase): self._SetupSplElf('u_boot_binman_syms') data = self._DoReadFileDtb(dts, entry_args=entry_args, - use_expanded=use_expanded)[0] + use_expanded=use_expanded, + verbosity=None if u_boot_offset else 3)[0] + + # The lz4-compressed version of the U-Boot data is 19 bytes long + comp_uboot_len = 19 + # The image should contain the symbols from u_boot_binman_syms.c # Note that image_pos is adjusted by the base address of the image, # which is 0x10 in our test image - sym_values = struct.pack('<LLQLL', elf.BINMAN_SYM_MAGIC_VALUE, - 0x00, u_boot_offset + len(U_BOOT_DATA), - 0x10 + u_boot_offset, 0x04) + # If u_boot_offset is None, Binman should write -1U into the image + vals2 = (elf.BINMAN_SYM_MAGIC_VALUE, 0x00, + u_boot_offset + len(U_BOOT_DATA) if u_boot_offset else + len(U_BOOT_SPL_DATA) + 1 + comp_uboot_len, + 0x10 + u_boot_offset if u_boot_offset else 0xffffffff, 0x04) + + # u-boot-spl has a symbols-base property, so take that into account if + # required. The caller must supply the value + vals = list(vals2) + if symbols_base is not None: + vals[3] = symbols_base + u_boot_offset + vals = tuple(vals) + + sym_values = struct.pack('<LLQLL', *vals) + sym_values2 = struct.pack('<LLQLL', *vals2) if no_write_symbols: - expected = (base_data + - tools.get_bytes(0xff, 0x38 - len(base_data)) + - U_BOOT_DATA + base_data) + self.assertEqual( + base_data + + tools.get_bytes(0xff, 0x38 - len(base_data)) + + U_BOOT_DATA + base_data, data) else: - expected = (sym_values + base_data[24:] + - tools.get_bytes(0xff, 1) + U_BOOT_DATA + sym_values + - base_data[24:]) - self.assertEqual(expected, data) + got_vals = struct.unpack('<LLQLL', data[:24]) + + # For debugging: + #print('expect:', list(f'{v:x}' for v in vals)) + #print(' got:', list(f'{v:x}' for v in got_vals)) + + self.assertEqual(vals, got_vals) + self.assertEqual(sym_values, data[:24]) + + blen = len(base_data) + self.assertEqual(base_data[24:], data[24:blen]) + self.assertEqual(0xff, data[blen]) + + if u_boot_offset: + ofs = blen + 1 + len(U_BOOT_DATA) + self.assertEqual(U_BOOT_DATA, data[blen + 1:ofs]) + else: + ofs = blen + 1 + comp_uboot_len + + self.assertEqual(sym_values2, data[ofs:ofs + 24]) + self.assertEqual(base_data[24:], data[ofs + 24:]) + + # Just repeating the above asserts all at once, for clarity + if u_boot_offset: + expected = (sym_values + base_data[24:] + + tools.get_bytes(0xff, 1) + U_BOOT_DATA + + sym_values2 + base_data[24:]) + self.assertEqual(expected, data) def testSymbols(self): """Test binman can assign symbols embedded in U-Boot""" @@ -4181,7 +4232,8 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('172_scp.dts') self.assertEqual(SCP_DATA, data[:len(SCP_DATA)]) - def CheckFitFdt(self, dts='170_fit_fdt.dts', use_fdt_list=True): + def CheckFitFdt(self, dts='170_fit_fdt.dts', use_fdt_list=True, + default_dt=None): """Check an image with an FIT with multiple FDT images""" def _CheckFdt(seq, expected_data): """Check the FDT nodes @@ -4225,6 +4277,8 @@ class TestFunctional(unittest.TestCase): } if use_fdt_list: entry_args['of-list'] = 'test-fdt1 test-fdt2' + if default_dt: + entry_args['default-dt'] = default_dt data = self._DoReadFileDtb( dts, entry_args=entry_args, @@ -7624,7 +7678,22 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFitFdtListDir(self): """Test an image with an FIT with FDT images using fit,fdt-list-dir""" - self.CheckFitFdt('333_fit_fdt_dir.dts', False) + old_dir = os.getcwd() + try: + os.chdir(self._indir) + self.CheckFitFdt('333_fit_fdt_dir.dts', False) + finally: + os.chdir(old_dir) + + def testFitFdtListDirDefault(self): + """Test an FIT fit,fdt-list-dir where the default DT in is a subdir""" + old_dir = os.getcwd() + try: + os.chdir(self._indir) + self.CheckFitFdt('333_fit_fdt_dir.dts', False, + default_dt='rockchip/test-fdt2') + finally: + os.chdir(old_dir) def testFitFdtCompat(self): """Test an image with an FIT with compatible in the config nodes""" @@ -7690,6 +7759,51 @@ fdt fdtmap Extract the devicetree blob from the fdtmap # Make sure the other node is gone self.assertIsNone(dtb.GetNode('/node/other-node')) + def testMkeficapsuleMissing(self): + """Test that binman complains if mkeficapsule is missing""" + with self.assertRaises(ValueError) as e: + self._DoTestFile('311_capsule.dts', + force_missing_bintools='mkeficapsule') + self.assertIn("Node '/binman/efi-capsule': Missing tool: 'mkeficapsule'", + str(e.exception)) + + def testMkeficapsuleMissingOk(self): + """Test that binman deals with mkeficapsule being missing""" + with test_util.capture_sys_output() as (stdout, stderr): + ret = self._DoTestFile('311_capsule.dts', + force_missing_bintools='mkeficapsule', + allow_missing=True) + self.assertEqual(103, ret) + err = stderr.getvalue() + self.assertRegex(err, "Image 'image'.*missing bintools.*: mkeficapsule") + + def testSymbolsBase(self): + """Test handling of symbols-base""" + self.checkSymbols('336_symbols_base.dts', U_BOOT_SPL_DATA, 0x1c, + symbols_base=0) + + def testSymbolsBaseExpanded(self): + """Test handling of symbols-base with expanded entries""" + entry_args = { + 'spl-dtb': '1', + } + self.checkSymbols('337_symbols_base_expand.dts', U_BOOT_SPL_NODTB_DATA + + U_BOOT_SPL_DTB_DATA, 0x38, + entry_args=entry_args, use_expanded=True, + symbols_base=0) + + def testSymbolsCompressed(self): + """Test binman complains about symbols from a compressed section""" + with test_util.capture_sys_output() as (stdout, stderr): + self.checkSymbols('338_symbols_comp.dts', U_BOOT_SPL_DATA, None) + out = stdout.getvalue() + self.assertIn('Symbol-writing: no value for /binman/section/u-boot', + out) + + def testNxpImx8Image(self): + """Test that binman can produce an iMX8 image""" + self._DoTestFile('339_nxp_imx8.dts') + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/image.py b/tools/binman/image.py index 702c9055585..24ce0af7c72 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -381,11 +381,10 @@ class Image(section.Entry_section): selected_entries.append(entry) return selected_entries, lines, widths - def LookupImageSymbol(self, sym_name, optional, msg, base_addr): - """Look up a symbol in an ELF file + def GetImageSymbolValue(self, sym_name, optional, msg, base_addr): + """Get the value of a Binman symbol - Looks up a symbol in an ELF file. Only entry types which come from an - ELF image can be used by this function. + Look up a Binman symbol and obtain its value. This searches through this image including all of its subsections. @@ -405,12 +404,10 @@ class Image(section.Entry_section): optional: True if the symbol is optional. If False this function will raise if the symbol is not found msg: Message to display if an error occurs - base_addr: Base address of image. This is added to the returned - image_pos in most cases so that the returned position indicates - where the targeted entry/binary has actually been loaded. But - if end-at-4gb is used, this is not done, since the binary is - already assumed to be linked to the ROM position and using - execute-in-place (XIP). + base_addr (int): Base address of image. This is added to the + returned value of image-pos so that the returned position + indicates where the targeted entry/binary has actually been + loaded Returns: Value that should be assigned to that symbol, or None if it was @@ -423,8 +420,8 @@ class Image(section.Entry_section): entries = OrderedDict() entries_by_name = {} self._CollectEntries(entries, entries_by_name, self) - return self.LookupSymbol(sym_name, optional, msg, base_addr, - entries_by_name) + return self.GetSymbolValue(sym_name, optional, msg, base_addr, + entries_by_name) def CollectBintools(self): """Collect all the bintools used by this image diff --git a/tools/binman/image_test.py b/tools/binman/image_test.py index bd51c1e55d1..7d65e2d589a 100644 --- a/tools/binman/image_test.py +++ b/tools/binman/image_test.py @@ -13,7 +13,7 @@ class TestImage(unittest.TestCase): def testInvalidFormat(self): image = Image('name', 'node', test=True) with self.assertRaises(ValueError) as e: - image.LookupSymbol('_binman_something_prop_', False, 'msg', 0) + image.GetSymbolValue('_binman_something_prop_', False, 'msg', 0) self.assertIn( "msg: Symbol '_binman_something_prop_' has invalid format", str(e.exception)) @@ -22,7 +22,7 @@ class TestImage(unittest.TestCase): image = Image('name', 'node', test=True) image._entries = {} with self.assertRaises(ValueError) as e: - image.LookupSymbol('_binman_type_prop_pname', False, 'msg', 0) + image.GetSymbolValue('_binman_type_prop_pname', False, 'msg', 0) self.assertIn("msg: Entry 'type' not found in list ()", str(e.exception)) @@ -30,7 +30,7 @@ class TestImage(unittest.TestCase): image = Image('name', 'node', test=True) image._entries = {} with capture_sys_output() as (stdout, stderr): - val = image.LookupSymbol('_binman_type_prop_pname', True, 'msg', 0) + val = image.GetSymbolValue('_binman_type_prop_pname', True, 'msg', 0) self.assertEqual(val, None) self.assertEqual("Warning: msg: Entry 'type' not found in list ()\n", stderr.getvalue()) @@ -40,5 +40,5 @@ class TestImage(unittest.TestCase): image = Image('name', 'node', test=True) image._entries = {'u-boot': 1} with self.assertRaises(ValueError) as e: - image.LookupSymbol('_binman_u_boot_prop_bad', False, 'msg', 0) + image.GetSymbolValue('_binman_u_boot_prop_bad', False, 'msg', 0) self.assertIn("msg: No such property 'bad", str(e.exception)) diff --git a/tools/binman/test/336_symbols_base.dts b/tools/binman/test/336_symbols_base.dts new file mode 100644 index 00000000000..e4dccd38c22 --- /dev/null +++ b/tools/binman/test/336_symbols_base.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + pad-byte = <0xff>; + u-boot-spl { + symbols-base = <0>; + }; + + u-boot { + offset = <0x1c>; + }; + + u-boot-spl2 { + type = "u-boot-spl"; + }; + }; +}; diff --git a/tools/binman/test/337_symbols_base_expand.dts b/tools/binman/test/337_symbols_base_expand.dts new file mode 100644 index 00000000000..5a777ae63b8 --- /dev/null +++ b/tools/binman/test/337_symbols_base_expand.dts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + pad-byte = <0xff>; + u-boot-spl { + symbols-base = <0>; + }; + + u-boot { + offset = <0x38>; + no-expanded; + }; + + u-boot-spl2 { + type = "u-boot-spl"; + }; + }; +}; diff --git a/tools/binman/test/338_symbols_comp.dts b/tools/binman/test/338_symbols_comp.dts new file mode 100644 index 00000000000..15008507cfd --- /dev/null +++ b/tools/binman/test/338_symbols_comp.dts @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + pad-byte = <0xff>; + u-boot-spl { + }; + + section { + offset = <0x1c>; + compress = "lz4"; + + u-boot { + }; + }; + + u-boot-spl2 { + type = "u-boot-spl"; + }; + }; +}; diff --git a/tools/binman/test/339_nxp_imx8.dts b/tools/binman/test/339_nxp_imx8.dts new file mode 100644 index 00000000000..cb512ae9aa2 --- /dev/null +++ b/tools/binman/test/339_nxp_imx8.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + nxp-imx8mimage { + args; /* TODO: Needed by mkimage etype superclass */ + nxp,boot-from = "sd"; + nxp,rom-version = <1>; + nxp,loader-address = <0x10>; + }; + }; +}; diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index c4384f53e8d..4090d328b30 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -22,6 +22,7 @@ from buildman import toolchain from patman import gitutil from u_boot_pylib import command from u_boot_pylib import terminal +from u_boot_pylib import tools from u_boot_pylib.terminal import tprint # This indicates an new int or hex Kconfig property with no default @@ -263,7 +264,8 @@ class Builder: adjust_cfg=None, allow_missing=False, no_lto=False, reproducible_builds=False, force_build=False, force_build_failures=False, force_reconfig=False, - in_tree=False, force_config_on_failure=False, make_func=None): + in_tree=False, force_config_on_failure=False, make_func=None, + dtc_skip=False): """Create a new Builder object Args: @@ -312,6 +314,7 @@ class Builder: force_config_on_failure (bool): Reconfigure the build before retrying a failed build make_func (function): Function to call to run 'make' + dtc_skip (bool): True to skip building dtc and use the system one """ self.toolchains = toolchains self.base_dir = base_dir @@ -354,6 +357,12 @@ class Builder: self.in_tree = in_tree self.force_config_on_failure = force_config_on_failure self.fallback_mrproper = fallback_mrproper + if dtc_skip: + self.dtc = shutil.which('dtc') + if not self.dtc: + raise ValueError('Cannot find dtc') + else: + self.dtc = None if not self.squash_config_y: self.config_filenames += EXTRA_CONFIG_FILENAMES @@ -407,6 +416,22 @@ class Builder: def signal_handler(self, signal, frame): sys.exit(1) + def make_environment(self, toolchain): + """Create the environment to use for building + + Args: + toolchain (Toolchain): Toolchain to use for building + + Returns: + dict: + key (str): Variable name + value (str): Variable value + """ + env = toolchain.MakeEnvironment(self.full_path) + if self.dtc: + env[b'DTC'] = tools.to_bytes(self.dtc) + return env + def set_display_options(self, show_errors=False, show_sizes=False, show_detail=False, show_bloat=False, list_error_boards=False, show_config=False, diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index bbe2f6f0d24..b5afee61aff 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -406,7 +406,7 @@ class BuilderThread(threading.Thread): the next incremental build """ # Set up the environment and command line - env = self.toolchain.MakeEnvironment(self.builder.full_path) + env = self.builder.make_environment(self.toolchain) mkdir(out_dir) args, cwd, src_dir = self._build_args(brd, out_dir, out_rel_dir, @@ -574,7 +574,7 @@ class BuilderThread(threading.Thread): outf.write(f'{result.return_code}') # Write out the image and function size information and an objdump - env = result.toolchain.MakeEnvironment(self.builder.full_path) + env = self.builder.make_environment(self.toolchain) with open(os.path.join(build_dir, 'out-env'), 'wb') as outf: for var in sorted(env.keys()): outf.write(b'%s="%s"' % (var, env[var])) @@ -755,6 +755,14 @@ class BuilderThread(threading.Thread): self.mrproper, self.builder.config_only, True, self.builder.force_build_failures, job.work_in_output, job.adjust_cfg) + failed = result.return_code or result.stderr + if failed and not self.mrproper: + result, request_config = self.run_commit(None, brd, work_dir, + True, self.builder.fallback_mrproper, + self.builder.config_only, True, + self.builder.force_build_failures, + job.work_in_output, job.adjust_cfg) + result.commit_upto = 0 self._write_result(result, job.keep_outputs, job.work_in_output) self._send_result(result) diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index b8ff3bf1ab2..e873611e596 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -1030,6 +1030,9 @@ of the source tree, thus allowing rapid tested evolution of the code:: ./tools/buildman/buildman -Pr tegra +Note also the `--dtc-skip` option which uses the system device-tree compiler to +avoid needing to build it for each board. This can save 10-20% of build time. +An alternative is to set DTC=/path/to/dtc when running buildman. Checking configuration ---------------------- diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py index 544a391a464..7573e5bdfe8 100644 --- a/tools/buildman/cmdline.py +++ b/tools/buildman/cmdline.py @@ -46,6 +46,8 @@ def add_upto_m(parser): help='Show detailed size delta for each board in the -S summary') parser.add_argument('-D', '--debug', action='store_true', help='Enabling debugging (provides a full traceback on error)') + parser.add_argument('--dtc-skip', action='store_true', default=False, + help='Skip building of dtc and use the system version') parser.add_argument('-e', '--show_errors', action='store_true', default=False, help='Show errors and warnings') parser.add_argument('-E', '--warnings-as-errors', action='store_true', diff --git a/tools/buildman/control.py b/tools/buildman/control.py index d3d027f02ab..55d4d770c5c 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -809,7 +809,8 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None, force_build = args.force_build, force_build_failures = args.force_build_failures, force_reconfig = args.force_reconfig, in_tree = args.in_tree, - force_config_on_failure=not args.quick, make_func=make_func) + force_config_on_failure=not args.quick, make_func=make_func, + dtc_skip=args.dtc_skip) TEST_BUILDER = builder diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 5eed013d51c..15801f6097f 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -36,6 +36,16 @@ main: /usr/sbin x86: i386 x86_64 ''' +settings_data_wrapper = ''' +# Buildman settings file + +[toolchain] +main: /usr/sbin + +[toolchain-wrapper] +wrapper = ccache +''' + migration = '''===================== WARNING ====================== This board does not use CONFIG_DM. CONFIG_DM will be compulsory starting with the v2020.01 release. @@ -606,6 +616,9 @@ class TestBuild(unittest.TestCase): tc.GetEnvArgs(toolchain.VAR_ARCH)) self.assertEqual('', tc.GetEnvArgs(toolchain.VAR_MAKE_ARGS)) + tc = self.toolchains.Select('sandbox') + self.assertEqual('', tc.GetEnvArgs(toolchain.VAR_CROSS_COMPILE)) + self.toolchains.Add('/path/to/x86_64-linux-gcc', test=False) tc = self.toolchains.Select('x86') self.assertEqual('/path/to', @@ -614,6 +627,39 @@ class TestBuild(unittest.TestCase): self.assertEqual('HOSTCC=clang CC=clang', tc.GetEnvArgs(toolchain.VAR_MAKE_ARGS)) + # Test config with ccache wrapper + bsettings.setup(None) + bsettings.add_file(settings_data_wrapper) + + tc = self.toolchains.Select('arm') + self.assertEqual('ccache arm-linux-', + tc.GetEnvArgs(toolchain.VAR_CROSS_COMPILE)) + + tc = self.toolchains.Select('sandbox') + self.assertEqual('', tc.GetEnvArgs(toolchain.VAR_CROSS_COMPILE)) + + def testMakeEnvironment(self): + """Test the MakeEnvironment function""" + tc = self.toolchains.Select('arm') + env = tc.MakeEnvironment(False) + self.assertEqual(env[b'CROSS_COMPILE'], b'arm-linux-') + + tc = self.toolchains.Select('sandbox') + env = tc.MakeEnvironment(False) + self.assertTrue(b'CROSS_COMPILE' not in env) + + # Test config with ccache wrapper + bsettings.setup(None) + bsettings.add_file(settings_data_wrapper) + + tc = self.toolchains.Select('arm') + env = tc.MakeEnvironment(False) + self.assertEqual(env[b'CROSS_COMPILE'], b'ccache arm-linux-') + + tc = self.toolchains.Select('sandbox') + env = tc.MakeEnvironment(False) + self.assertTrue(b'CROSS_COMPILE' not in env) + def testPrepareOutputSpace(self): def _Touch(fname): tools.write_file(os.path.join(base_dir, fname), b'') @@ -953,6 +999,37 @@ class TestBuild(unittest.TestCase): self.assertEqual( {b'CROSS_COMPILE': b'fred aarch64-linux-', b'LC_ALL': b'C'}, diff) + def test_skip_dtc(self): + """Test skipping building the dtc tool""" + old_path = os.getenv('PATH') + try: + os.environ['PATH'] = self.base_dir + + # Check a missing tool + with self.assertRaises(ValueError) as exc: + builder.Builder(self.toolchains, self.base_dir, None, 0, 2, + dtc_skip=True) + self.assertIn('Cannot find dtc', str(exc.exception)) + + # Create a fake tool to use + dtc = os.path.join(self.base_dir, 'dtc') + tools.write_file(dtc, b'xx') + os.chmod(dtc, 0o777) + + build = builder.Builder(self.toolchains, self.base_dir, None, 0, 2, + dtc_skip=True) + toolchain = self.toolchains.Select('arm') + env = build.make_environment(toolchain) + self.assertIn(b'DTC', env) + + # Try the normal case, i.e. not skipping the dtc build + build = builder.Builder(self.toolchains, self.base_dir, None, 0, 2) + toolchain = self.toolchains.Select('arm') + env = build.make_environment(toolchain) + self.assertNotIn(b'DTC', env) + finally: + os.environ['PATH'] = old_path + if __name__ == "__main__": unittest.main() diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index 6ca79c2c0f9..a7d7883b851 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -159,6 +159,8 @@ class Toolchain: if which == VAR_CROSS_COMPILE: wrapper = self.GetWrapper() base = '' if self.arch == 'sandbox' else self.path + if (base == '' and self.cross == ''): + return '' return wrapper + os.path.join(base, self.cross) elif which == VAR_PATH: return self.path @@ -208,10 +210,10 @@ class Toolchain: if self.override_toolchain: # We'll use MakeArgs() to provide this pass - elif full_path: + elif full_path and self.cross: env[b'CROSS_COMPILE'] = tools.to_bytes( wrapper + os.path.join(self.path, self.cross)) - else: + elif self.cross: env[b'CROSS_COMPILE'] = tools.to_bytes(wrapper + self.cross) # Detect a Python virtualenv and avoid defeating it diff --git a/tools/eficapsule.h b/tools/eficapsule.h index 6efd07d2eb6..97d077536d5 100644 --- a/tools/eficapsule.h +++ b/tools/eficapsule.h @@ -24,7 +24,7 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -typedef struct { +typedef struct efi_guid { uint8_t b[16]; } efi_guid_t __aligned(8); diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index 1b53151d41a..49f5b7849e4 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -16,16 +16,20 @@ #include <sys/stat.h> #include <sys/types.h> -#include <uuid/uuid.h> #include <gnutls/gnutls.h> #include <gnutls/pkcs7.h> #include <gnutls/abstract.h> #include <version.h> +#include <libfdt.h> +#include <u-boot/uuid.h> #include "eficapsule.h" +// Matches CONFIG_EFI_CAPSULE_NAMESPACE_GUID +#define DEFAULT_NAMESPACE_GUID "8c9f137e-91dc-427b-b2d6-b420faebaf2a" + static const char *tool_name = "mkeficapsule"; efi_guid_t efi_guid_fm_capsule = EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID; @@ -56,9 +60,20 @@ static struct option options[] = { {NULL, 0, NULL, 0}, }; -static void print_usage(void) +static void print_usage_guidgen(void) { - fprintf(stderr, "Usage: %s [options] <image blob> <output file>\n" + fprintf(stderr, "%s guidgen [GUID] DTB IMAGE_NAME...\n" + "Options:\n" + + "\tGUID Namespace GUID (default: %s)\n" + "\tDTB Device Tree Blob\n" + "\tIMAGE_NAME... One or more names of fw_images to generate GUIDs for\n", + tool_name, DEFAULT_NAMESPACE_GUID); +} + +static void print_usage_mkeficapsule(void) +{ + fprintf(stderr, "Usage:\n\n%s [options] <image blob> <output file>\n" "Options:\n" "\t-g, --guid <guid string> guid for image blob type\n" @@ -74,8 +89,9 @@ static void print_usage(void) "\t-o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff\n" "\t-D, --dump-capsule dump the contents of the capsule headers\n" "\t-V, --version show version number\n" - "\t-h, --help print a help message\n", + "\t-h, --help print a help message\n\n", tool_name); + print_usage_guidgen(); } /** @@ -578,37 +594,6 @@ err: return ret; } -/** - * convert_uuid_to_guid() - convert UUID to GUID - * @buf: UUID binary - * - * UUID and GUID have the same data structure, but their binary - * formats are different due to the endianness. See lib/uuid.c. - * Since uuid_parse() can handle only UUID, this function must - * be called to get correct data for GUID when parsing a string. - * - * The correct data will be returned in @buf. - */ -void convert_uuid_to_guid(unsigned char *buf) -{ - unsigned char c; - - c = buf[0]; - buf[0] = buf[3]; - buf[3] = c; - c = buf[1]; - buf[1] = buf[2]; - buf[2] = c; - - c = buf[4]; - buf[4] = buf[5]; - buf[5] = c; - - c = buf[6]; - buf[6] = buf[7]; - buf[7] = c; -} - static int create_empty_capsule(char *path, efi_guid_t *guid, bool fw_accept) { struct efi_capsule_header header = { 0 }; @@ -654,20 +639,10 @@ err: static void print_guid(void *ptr) { - int i; - efi_guid_t *guid = ptr; - const uint8_t seq[] = { - 3, 2, 1, 0, '-', 5, 4, '-', 7, 6, - '-', 8, 9, '-', 10, 11, 12, 13, 14, 15 }; - - for (i = 0; i < ARRAY_SIZE(seq); i++) { - if (seq[i] == '-') - putchar(seq[i]); - else - printf("%02X", guid->b[seq[i]]); - } + static char buf[37] = { 0 }; - printf("\n"); + uuid_bin_to_str(ptr, buf, UUID_STR_FORMAT_GUID | UUID_STR_UPPER_CASE); + printf("%s\n", buf); } static uint32_t dump_fmp_payload_header( @@ -861,6 +836,129 @@ static void dump_capsule_contents(char *capsule_file) } } +static struct fdt_header *load_dtb(const char *path) +{ + struct fdt_header *dtb; + ssize_t dtb_size; + FILE *f; + + /* Open and parse DTB */ + f = fopen(path, "r"); + if (!f) { + fprintf(stderr, "Cannot open %s\n", path); + return NULL; + } + + if (fseek(f, 0, SEEK_END)) { + fprintf(stderr, "Cannot seek to the end of %s: %s\n", + path, strerror(errno)); + return NULL; + } + + dtb_size = ftell(f); + if (dtb_size < 0) { + fprintf(stderr, "Cannot ftell %s: %s\n", + path, strerror(errno)); + return NULL; + } + + fseek(f, 0, SEEK_SET); + + dtb = malloc(dtb_size); + if (!dtb) { + fprintf(stderr, "Can't allocated %ld\n", dtb_size); + return NULL; + } + + if (fread(dtb, dtb_size, 1, f) != 1) { + fprintf(stderr, "Can't read %ld bytes from %s\n", + dtb_size, path); + free(dtb); + return NULL; + } + + fclose(f); + + return dtb; +} + +#define MAX_IMAGE_NAME_LEN 128 +static int genguid(int argc, char **argv) +{ + int idx = 2, ret; + unsigned char namespace[16]; + struct efi_guid image_type_id; + const char *dtb_path; + struct fdt_header *dtb; + const char *compatible; + int compatlen, namelen; + uint16_t fw_image[MAX_IMAGE_NAME_LEN]; + + if (argc < 2) { + fprintf(stderr, "Usage: "); + print_usage_guidgen(); + return -1; + } + + if (uuid_str_to_bin(argv[1], namespace, UUID_STR_FORMAT_GUID)) { + uuid_str_to_bin(DEFAULT_NAMESPACE_GUID, namespace, UUID_STR_FORMAT_GUID); + dtb_path = argv[1]; + } else { + dtb_path = argv[2]; + idx = 3; + } + + if (idx == argc) { + fprintf(stderr, "Usage: "); + print_usage_guidgen(); + return -1; + } + + dtb = load_dtb(dtb_path); + if (!dtb) + return -1; + + ret = fdt_check_header(dtb); + if (ret) { + fprintf(stderr, "Invalid DTB header: %d\n", ret); + return -1; + } + + compatible = fdt_getprop(dtb, 0, "compatible", &compatlen); + if (!compatible) { + fprintf(stderr, "No compatible string found in DTB\n"); + return -1; + } + if (strnlen(compatible, compatlen) >= compatlen) { + fprintf(stderr, "Compatible string not null-terminated\n"); + return -1; + } + + printf("Generating GUIDs for %s with namespace %s:\n", + compatible, DEFAULT_NAMESPACE_GUID); + for (; idx < argc; idx++) { + memset(fw_image, 0, sizeof(fw_image)); + namelen = strlen(argv[idx]); + if (namelen > MAX_IMAGE_NAME_LEN) { + fprintf(stderr, "Image name too long: %s\n", argv[idx]); + return -1; + } + + for (int i = 0; i < namelen; i++) + fw_image[i] = (uint16_t)argv[idx][i]; + + gen_v5_guid((struct uuid *)&namespace, &image_type_id, + compatible, strlen(compatible), + fw_image, namelen * sizeof(uint16_t), + NULL); + + printf("%s: ", argv[idx]); + print_guid(&image_type_id); + } + + return 0; +} + /** * main - main entry function of mkeficapsule * @argc: Number of arguments @@ -885,6 +983,13 @@ int main(int argc, char **argv) int c, idx; struct fmp_payload_header_params fmp_ph_params = { 0 }; + /* Generate dynamic GUIDs */ + if (argc > 1 && !strcmp(argv[1], "guidgen")) { + if (genguid(argc - 1, argv + 1)) + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); + } + guid = NULL; index = 0; instance = 0; @@ -907,11 +1012,10 @@ int main(int argc, char **argv) "Image type already specified\n"); exit(EXIT_FAILURE); } - if (uuid_parse(optarg, uuid_buf)) { + if (uuid_str_to_bin(optarg, uuid_buf, UUID_STR_FORMAT_GUID)) { fprintf(stderr, "Wrong guid format\n"); exit(EXIT_FAILURE); } - convert_uuid_to_guid(uuid_buf); guid = (efi_guid_t *)uuid_buf; break; case 'i': @@ -977,7 +1081,7 @@ int main(int argc, char **argv) printf("mkeficapsule version %s\n", PLAIN_VERSION); exit(EXIT_SUCCESS); default: - print_usage(); + print_usage_mkeficapsule(); exit(EXIT_FAILURE); } } @@ -1000,7 +1104,7 @@ int main(int argc, char **argv) ((argc != optind + 1) || ((capsule_type == CAPSULE_ACCEPT) && !guid) || ((capsule_type == CAPSULE_REVERT) && guid)))) { - print_usage(); + print_usage_mkeficapsule(); exit(EXIT_FAILURE); } |