From: Daniel Golle <daniel@makrotopia.org>
To: Alastair D'Silva <alastair@d-silva.org>
Cc: u-boot@lists.u-boot-project.org, Tom Rini <trini@konsulko.com>,
Andre Przywara <andre.przywara@arm.com>,
Hans de Goede <hdegoede@redhat.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jaehoon Chung <jh80.chung@samsung.com>,
Lukasz Majewski <lukma@nabladev.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Peng Fan <peng.fan@nxp.com>,
Tanmay Kathpalia <tanmay.kathpalia@altera.com>,
Yixun Lan <dlan@kernel.org>, Yixun Lan <dlan@gentoo.org>,
Enzo Adriano <enzo.adriano.code@gmail.com>,
Junhui Liu <junhui.liu@pigmoral.tech>,
Alastair D'Silva <alastair@d-silva.org>
Subject: Re: [PATCH 17/26] sunxi: dram: a733: Add ARC PMU 1D/2D eye training firmware
Date: Thu, 26 Nov 2026 19:06:53 +0000 [thread overview]
Message-ID: <awiDTdTwKwnvPoBp@makrotopia.org> (raw)
In-Reply-To: <20261113023236.569054-18-alastair@d-silva.org>
Hi Alastair,
On Fri, 13 Nov 2026 13:32:27 +1100, Alastair D'Silva wrote:
> [...]
> + is_pm0_mode1 = (is_pm_0 && is_mode_1);
> + is_cond_or_m0 = is_pm0_mode1 || mode_zero_cond;
> + is_mode0_pm1 = (is_mode_0 && is_pm_1);
> + step_val = is_mode0_pm1 ? lo_margin_val : 0x50U;
> + is_eval_active = is_mode0_pm1 || is_cond_or_m0;
> + timing_reg_alt_b = is_eval_active ? step_val : 0x51U;
> +
> + alt_reg_sel = (is_mode_1 && is_pm_1) || is_eval_active;
> + hi_margin_val = alt_reg_sel ? 0x4fU : 0x4eU;
> + pass_reg_a = alt_reg_sel || (is_mode_0 && is_pm_2);
> + keep_pass_regs = pass_reg_a || (is_pm_2 && is_mode_1);
The selection of the delay registers to sweep is wrong for three
combinations, all with a non-zero swizzle flag: operating mode 0 with
sweep mode 0, operating mode 0 with sweep mode 1, and operating mode 1
with sweep mode 0. In the per-bit scan this sweeps CSR 0x50 where the
two per-bit delays 0x4e/0x4f are meant. On my Orange Pi 4 Pro (4 GiB,
see my reply to patch 15) most per-bit delays then stay at or next to
their reset value 0x40 and CSR 0x50 is left at 0x7f on every lane;
after the vendor boot0 it reads 0x35.
Suggested change:
diff --git a/arch/arm/mach-sunxi/pmu/pmu_eye.c b/arch/arm/mach-sunxi/pmu/pmu_eye.c
index 1c1ebb35363..9fb59d99a82 100644
--- a/arch/arm/mach-sunxi/pmu/pmu_eye.c
+++ b/arch/arm/mach-sunxi/pmu/pmu_eye.c
@@ -2529,12 +2529,12 @@ void pmu_cal_margin_matrix_scan_eval(u32 channel, u32 rank, u32 slice,
is_pm0_mode1 = (is_pm_0 && is_mode_1);
is_cond_or_m0 = is_pm0_mode1 || mode_zero_cond;
is_mode0_pm1 = (is_mode_0 && is_pm_1);
- step_val = is_mode0_pm1 ? lo_margin_val : 0x50U;
+ step_val = is_cond_or_m0 ? lo_margin_val : 0x50U;
is_eval_active = is_mode0_pm1 || is_cond_or_m0;
timing_reg_alt_b = is_eval_active ? step_val : 0x51U;
alt_reg_sel = (is_mode_1 && is_pm_1) || is_eval_active;
- hi_margin_val = alt_reg_sel ? 0x4fU : 0x4eU;
+ hi_margin_val = mode_zero_cond ? 0x4fU : 0x4eU;
pass_reg_a = alt_reg_sel || (is_mode_0 && is_pm_2);
keep_pass_regs = pass_reg_a || (is_pm_2 && is_mode_1);
With it CSR 0x50 ends up at 0x35 on all lanes of both channels and the
per-bit delays are trained. With pin swizzle disabled the flag is zero
and the change has no effect.
Cheers
Daniel
next prev parent reply other threads:[~2026-11-26 19:07 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 2:32 [PATCH 00/26] sunxi: Add Allwinner A733 (sun60i) and Orange Pi 4 Pro support Alastair D'Silva
2026-11-13 2:32 ` [PATCH 01/26] power: regulator: axp: Fix AXP318W ELDO voltage mask Alastair D'Silva
2026-11-20 0:06 ` Andre Przywara
2026-11-13 2:32 ` [PATCH 02/26] power: pmic: axp: Fix AXP318W sysreset shutdown register Alastair D'Silva
2026-11-13 2:32 ` [PATCH 03/26] power: axp: Extend AXP318W SPL support with DCDC6/7 and LDOs Alastair D'Silva
2026-11-13 2:32 ` [PATCH 04/26] dt-bindings: clk: sun60i-a733-ccu: Add Allwinner A733 support Alastair D'Silva
2026-11-13 2:32 ` [PATCH 05/26] mmc: sunxi: Scale data transfer timeout with transfer size Alastair D'Silva
2026-11-13 2:32 ` [PATCH 06/26] gpio: a733: add initial support Alastair D'Silva
2026-11-13 2:32 ` [PATCH 07/26] pinctrl: sunxi: " Alastair D'Silva
2026-11-13 2:32 ` [PATCH 08/26] clock: reset: " Alastair D'Silva
2026-11-13 2:32 ` [PATCH 09/26] clock: a733: implement support for mmc/uart Alastair D'Silva
2026-11-13 2:32 ` [PATCH 10/26] sunxi: mmc: enable support for A733 Alastair D'Silva
2026-11-13 2:32 ` [PATCH 11/26] sunxi: a733: uart: setup serial console Alastair D'Silva
2026-11-13 2:32 ` [PATCH 12/26] arm64: spl: Support disposable .init.rodata section after _image_binary_end Alastair D'Silva
2026-11-13 2:32 ` [PATCH 13/26] sunxi: fel: Add Allwinner A733 ERET FEL return support Alastair D'Silva
2026-11-19 23:53 ` Andre Przywara
2026-11-13 2:32 ` [PATCH 14/26] sunxi: dram: a733: Add ARC PMU register, ABI, and build definitions Alastair D'Silva
2026-11-13 2:32 ` [PATCH 15/26] sunxi: dram: a733: Add ARC PMU primitives, clock, telemetry, and CBT Alastair D'Silva
2026-11-26 19:06 ` Daniel Golle
2026-11-13 2:32 ` [PATCH 16/26] sunxi: dram: a733: Add ARC PMU deskew and BIST training firmware Alastair D'Silva
2026-11-13 2:32 ` [PATCH 17/26] sunxi: dram: a733: Add ARC PMU 1D/2D eye " Alastair D'Silva
2026-11-26 19:06 ` Daniel Golle [this message]
2026-11-13 2:32 ` [PATCH 18/26] sunxi: dram: a733: Add ARC PMU training state machine Alastair D'Silva
2026-11-26 19:07 ` Daniel Golle
2026-11-13 2:32 ` [PATCH 19/26] sunxi: dram: a733: Add Allwinner A733 LPDDR5 DRAM driver Alastair D'Silva
2026-11-13 2:32 ` [PATCH 20/26] sunxi: sun60i: initial support for A733 SoC Alastair D'Silva
2026-11-13 2:32 ` [PATCH 21/26] doc: sunxi: Document Allwinner A733 LPDDR5 PMU architecture Alastair D'Silva
2026-11-13 2:32 ` [PATCH 22/26] phy: sunxi: Add Allwinner A733 Cadence Combo PHY driver Alastair D'Silva
2026-11-13 2:32 ` [PATCH 23/26] pci: sunxi: Add Allwinner A733 DesignWare PCIe host controller driver Alastair D'Silva
2026-11-20 19:43 ` Neil Armstrong
2026-11-13 2:32 ` [PATCH 24/26] sunxi: Add NVMe to distro boot targets Alastair D'Silva
2026-11-13 2:32 ` [PATCH 25/26] arm64: dts: allwinner: add A733 SoC description Alastair D'Silva
2026-11-13 2:32 ` [PATCH 26/26] sunxi: Add Xunlong Orange Pi 4 Pro board support Alastair D'Silva
2026-11-13 7:28 ` [PATCH 00/26] sunxi: Add Allwinner A733 (sun60i) and Orange Pi 4 Pro support Alastair D'Silva
2026-11-20 0:31 ` Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awiDTdTwKwnvPoBp@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=alastair@d-silva.org \
--cc=andre.przywara@arm.com \
--cc=dlan@gentoo.org \
--cc=dlan@kernel.org \
--cc=enzo.adriano.code@gmail.com \
--cc=hdegoede@redhat.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jh80.chung@samsung.com \
--cc=junhui.liu@pigmoral.tech \
--cc=lukma@nabladev.com \
--cc=neil.armstrong@linaro.org \
--cc=peng.fan@nxp.com \
--cc=tanmay.kathpalia@altera.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox