Attention is currently required from: Julius Werner, Moritz Fischer. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/50887 )
Change subject: soc/rockchip/rk3399/sdram: Use rank_mask in CA training ......................................................................
Patch Set 1:
(1 comment)
File src/soc/rockchip/rk3399/sdram.c:
https://review.coreboot.org/c/coreboot/+/50887/comment/cfea3486_81043001 PS1, Line 629: rank_mask = (rank == 1) ? 0x1 : 0x3;
Does `rank` here mean `number of ranks`?
I've checked the next change and saw that it adds the same piece of code elsewhere. Maybe factor it out into a function?
static u32 get_rank_mask(u32 channel, const struct rk3399_sdram_params *params) { const u32 rank = params->ch[channel].rank;
/* required rank mask is different for LPDDR4 */ if (params->dramtype == LPDDR4) return (rank == 1) ? 0x5 : 0xf; else return (rank == 1) ? 0x1 : 0x3; }
Then you can use it as follows:
const u32 rank_mask = get_rank_mask(channel, params);