emc: Rename Device to Rank

This commit is contained in:
CTCaer 2020-11-15 13:23:37 +02:00
parent bbc3f41493
commit 485edb4883
3 changed files with 23 additions and 16 deletions

View file

@ -684,10 +684,13 @@ enum
typedef struct _emc_mr_data_t typedef struct _emc_mr_data_t
{ {
u8 dev0_ch0; // Device 0.
u8 dev0_ch1; u8 rank0_ch0;
u8 dev1_ch0; u8 rank0_ch1;
u8 dev1_ch1;
// Device 1.
u8 rank1_ch0;
u8 rank1_ch1;
} emc_mr_data_t; } emc_mr_data_t;
#endif #endif

View file

@ -85,12 +85,16 @@ static void _sdram_req_mrr_data(u32 data, bool dual_channel)
emc_mr_data_t sdram_read_mrx(emc_mr_t mrx) emc_mr_data_t sdram_read_mrx(emc_mr_t mrx)
{ {
emc_mr_data_t data; emc_mr_data_t data;
// Device 0.
_sdram_req_mrr_data((1 << 31) | (mrx << 16), EMC_CHAN0); _sdram_req_mrr_data((1 << 31) | (mrx << 16), EMC_CHAN0);
data.dev0_ch0 = EMC(EMC_MRR) & 0xFF; data.rank0_ch0 = EMC(EMC_MRR) & 0xFF;
data.dev0_ch1 = (EMC(EMC_MRR) & 0xFF00 >> 8); data.rank0_ch1 = (EMC(EMC_MRR) & 0xFF00 >> 8);
// Device 1.
_sdram_req_mrr_data((1 << 30) | (mrx << 16), EMC_CHAN1); _sdram_req_mrr_data((1 << 30) | (mrx << 16), EMC_CHAN1);
data.dev1_ch0 = EMC(EMC_MRR) & 0xFF; data.rank1_ch0 = EMC(EMC_MRR) & 0xFF;
data.dev1_ch1 = (EMC(EMC_MRR) & 0xFF00 >> 8); data.rank1_ch1 = (EMC(EMC_MRR) & 0xFF00 >> 8);
return data; return data;
} }

View file

@ -610,7 +610,7 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
emc_mr_data_t ram_rev1 = sdram_read_mrx(MR7_REV_ID2); emc_mr_data_t ram_rev1 = sdram_read_mrx(MR7_REV_ID2);
emc_mr_data_t ram_density = sdram_read_mrx(MR8_DENSITY); emc_mr_data_t ram_density = sdram_read_mrx(MR8_DENSITY);
s_printf(txt_buf, "#00DDFF LPDDR4 SDRAM ##FF8000 Slot 0 | Slot 1:#\n#FF8000 Vendor:# "); s_printf(txt_buf, "#00DDFF LPDDR4 SDRAM ##FF8000 Slot 0 | Slot 1:#\n#FF8000 Vendor:# ");
switch (ram_vendor.dev0_ch0) switch (ram_vendor.rank0_ch0)
{ {
case 1: case 1:
strcat(txt_buf, "Samsung"); strcat(txt_buf, "Samsung");
@ -625,8 +625,8 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
strcat(txt_buf, "Unknown"); strcat(txt_buf, "Unknown");
break; break;
} }
s_printf(txt_buf + strlen(txt_buf), " (%d) #FF8000 |# ", ram_vendor.dev0_ch0); s_printf(txt_buf + strlen(txt_buf), " (%d) #FF8000 |# ", ram_vendor.rank0_ch0);
switch (ram_vendor.dev1_ch0) switch (ram_vendor.rank1_ch0)
{ {
case 1: case 1:
strcat(txt_buf, "Samsung"); strcat(txt_buf, "Samsung");
@ -642,8 +642,8 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
break; break;
} }
s_printf(txt_buf + strlen(txt_buf), " (%d)\n#FF8000 Rev ID:# %04X #FF8000 |# %04X\n#FF8000 Density:# ", s_printf(txt_buf + strlen(txt_buf), " (%d)\n#FF8000 Rev ID:# %04X #FF8000 |# %04X\n#FF8000 Density:# ",
ram_vendor.dev1_ch0, (ram_rev0.dev0_ch0 << 8) | ram_rev1.dev0_ch0, (ram_rev0.dev1_ch0 << 8) | ram_rev1.dev1_ch0); ram_vendor.rank1_ch0, (ram_rev0.rank0_ch0 << 8) | ram_rev1.rank0_ch0, (ram_rev0.rank1_ch0 << 8) | ram_rev1.rank1_ch0);
switch ((ram_density.dev0_ch0 & 0x3C) >> 2) switch ((ram_density.rank0_ch0 & 0x3C) >> 2)
{ {
case 2: case 2:
strcat(txt_buf, " x 512MB"); strcat(txt_buf, " x 512MB");
@ -658,8 +658,8 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
strcat(txt_buf, " x Unk"); strcat(txt_buf, " x Unk");
break; break;
} }
s_printf(txt_buf + strlen(txt_buf), " (%d) #FF8000 |# ", (ram_density.dev0_ch0 & 0x3C) >> 2); s_printf(txt_buf + strlen(txt_buf), " (%d) #FF8000 |# ", (ram_density.rank0_ch0 & 0x3C) >> 2);
switch ((ram_density.dev1_ch0 & 0x3C) >> 2) switch ((ram_density.rank1_ch0 & 0x3C) >> 2)
{ {
case 2: case 2:
strcat(txt_buf, " x 512MB"); strcat(txt_buf, " x 512MB");
@ -674,7 +674,7 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
strcat(txt_buf, " x Unk"); strcat(txt_buf, " x Unk");
break; break;
} }
s_printf(txt_buf + strlen(txt_buf), " (%d)\n\n", (ram_density.dev1_ch0 & 0x3C) >> 2); s_printf(txt_buf + strlen(txt_buf), " (%d)\n\n", (ram_density.rank1_ch0 & 0x3C) >> 2);
// Display info. // Display info.
u8 display_rev = (nyx_str->info.disp_id >> 8) & 0xFF; u8 display_rev = (nyx_str->info.disp_id >> 8) & 0xFF;