From d5b780c5b1a7f6d7f12d3305dcfd36413a429c39 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sat, 2 May 2020 21:48:46 +0200 Subject: nb/intel/sandybridge: Redefine IOSAV_SUBSEQUENCE Instead of directly writing values to the IOSAV registers, use a struct and some helper functions to provide a cleaner interface for the IOSAV. Having IOSAV_SUBSEQUENCE refer to a static function is weird, but we will remove this macro in a follow-up that does not change the binary. Tested on Asus P8Z77-V LX2, still boots. Change-Id: I73f13c18a739c5586a7415966f9017c2335fdfd1 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/40980 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/northbridge/intel/sandybridge/raminit_common.h | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'src/northbridge/intel/sandybridge/raminit_common.h') diff --git a/src/northbridge/intel/sandybridge/raminit_common.h b/src/northbridge/intel/sandybridge/raminit_common.h index c544cdebaf..6e76cbc0bb 100644 --- a/src/northbridge/intel/sandybridge/raminit_common.h +++ b/src/northbridge/intel/sandybridge/raminit_common.h @@ -34,6 +34,63 @@ #define IOSAV_WR (0xf201) #define IOSAV_NOP (0xf207) +struct iosav_ssq { + /* IOSAV_n_SP_CMD_CTRL */ + union { + struct { + u32 command : 16; + u32 ranksel_ap : 2; + u32 : 14; + }; + u32 raw; + } sp_cmd_ctrl; + + /* IOSAV_n_SUBSEQ_CTRL */ + union { + struct { + u32 cmd_executions : 9; + u32 : 1; + u32 cmd_delay_gap : 5; + u32 : 1; + u32 post_ssq_wait : 9; + u32 : 1; + u32 data_direction : 2; + u32 : 4; + }; + u32 raw; + } subseq_ctrl; + + /* IOSAV_n_SP_CMD_ADDR */ + union { + struct { + u32 address : 16; + u32 rowbits : 3; + u32 : 1; + u32 bank : 3; + u32 : 1; + u32 rank : 2; + u32 : 6; + }; + u32 raw; + } sp_cmd_addr; + + /* IOSAV_n_ADDR_UPDATE */ + union { + struct { + u32 inc_addr_1 : 1; + u32 inc_addr_8 : 1; + u32 inc_bank : 1; + u32 inc_rank : 2; + u32 addr_wrap : 5; + u32 lfsr_upd : 2; + u32 upd_rate : 4; + u32 lfsr_xors : 2; + u32 : 14; + }; + u32 raw; + } addr_update; +}; + /* FIXME: Vendor BIOS uses 64 but our algorithms are less performant and even 1 seems to be enough in practice. */ #define NUM_PATTERNS 4 -- cgit v1.2.3