Skip to content
  • Sean Anderson's avatar
    ddr: fsl: Make bank_addr_bits reflect actual bits · 6f6fbb33
    Sean Anderson authored and Peng Fan's avatar Peng Fan committed
    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: e8a7f1c3
    
     ("powerpc/t1023rdb: Add T1023 RDB board support")
    Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
    Signed-off-by: Peng Fan's avatarPeng Fan <peng.fan@nxp.com>
    6f6fbb33