Skip to content

Commit 11d2ef5

Browse files
committed
board: mt7988: add env var for ramsize
R4: BPI-R4> printenv ram_gb ram_gb=4 R4Pro: BPI-R4> printenv ram_gb ram_gb=8
1 parent 0271420 commit 11d2ef5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

board/mediatek/mt7988/mt7988_rfb.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
#include <asm/io.h>
99
#include <linux/libfdt.h>
1010
#include <fdt_support.h>
11+
#include <asm/global_data.h>
1112

1213
#define MT7988_BOOT_NOR 0
1314
#define MT7988_BOOT_SPIM_NAND 1
1415
#define MT7988_BOOT_EMMC 2
1516
#define MT7988_BOOT_SNFI_NAND 3
1617

18+
DECLARE_GLOBAL_DATA_PTR;
19+
1720
int board_init(void)
1821
{
1922
return 0;
@@ -47,9 +50,18 @@ void getBootDevice(void)
4750
env_set("bootmedia",media);
4851
}
4952

53+
void getRAMSize(void)
54+
{
55+
if (gd->ram_size > (6ULL << 30))
56+
env_set("ram_gb", "8");
57+
else
58+
env_set("ram_gb", "4");
59+
}
60+
5061
int board_late_init(void)
5162
{
5263
getBootDevice();
64+
getRAMSize();
5365
return 0;
5466
}
5567

0 commit comments

Comments
 (0)