]> git.ipfire.org Git - thirdparty/u-boot.git/commit
ddr: fsl: Make bank_addr_bits reflect actual bits
authorSean Anderson <sean.anderson@seco.com>
Tue, 30 Aug 2022 21:01:07 +0000 (17:01 -0400)
committerPeng Fan <peng.fan@nxp.com>
Tue, 6 Sep 2022 01:28:46 +0000 (09:28 +0800)
commit6f6fbb334cc72cd5183cfe9a5b9fd31bc5d404d7
tree3ee398ca5bfa10319f6e493f4ba415d92edcf9af
parent96624d7b47530bb3e0009c01aa64d8e5279f95bd
ddr: fsl: Make bank_addr_bits reflect actual bits

In both the Freescale DDR controller and the SPD spec, bank address bits
are stored as the number of bank address bits minus 2. For example, if a
chip had 8 banks (3 total bank address bits), the value of
bank_addr_bits would be 1. This is rather surprising for users
configuring their memory manually, since they can't set bank_addr_bits
to the actual number of bank address bits. Rectify this.

There is at least one example of this kind of mistake already, in
board/freescale/t102xrdb/ddr.c. The documented MT40A512M8HX has two bank
address bits, but bank_addr_bits was set to 2, implying 4 bank address
bits. Such a value is reserved in BA_BITS_CS, but I suspect the
controller simply ignores the top bit, making this kind of mistake
harmless, if misleading.

Fixes: e8a7f1c32b5 ("powerpc/t1023rdb: Add T1023 RDB board support")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
board/freescale/ls1043ardb/ddr.c
drivers/ddr/fsl/ctrl_regs.c
drivers/ddr/fsl/ddr4_dimm_params.c