This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDSIDK572: DDR size in kernel

Part Number: TMDSIDK572

Hi

I would to know why the Linux kernel does not get all memory reported by U-Boot (in memory node of device tree, 1GB or 2GB) and why there is a significant difference between IDKs.

We are using SDK6.1.0.8.

IDK572 (2 GB DRAM)

Memory: 1673104K/1897472K available (10240K kernel code, 341K rwdata, 2744K rodata, 2048K init, 277K bss, 35952K reserved, 188416K cma-reserved, 1283072K highmem)

IDK574-HS (2 GB DRAM)

Memory: 1833968K/2057216K available (8192K kernel code, 317K rwdata, 2496K rodata, 2048K init, 304K bss, 34832K reserved, 188416K cma-reserved, 246208K highmem)

In both cases U-boot passes the full 2GB:

hexdump /proc/device-tree/memory@0/reg

0000000 0000 0000 0080 0000 0000 0000 0080 0000

 

Another example is

IDK571 (2 GB DRAM)

Memory: 642028K/848896K available (10240K kernel code, 341K rwdata, 2744K rodata, 2048K init, 277K bss, 26644K reserved, 180224K cma-reserved, 234496K highmem)

 hexdump /proc/device-tree/memory@80000000/reg

0000000 0000 0000 0080 0000 0000 0000 0040 0000

 

I checked the Kernel code and it's physpages which is printed

kernel (mem_init_print_info) and here,          physpages = get_num_physpages() is printed
 
pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK cma-reserved"
#ifdef    CONFIG_HIGHMEM
                                ", %luK highmem"
#endif
                                "%s%s)\n",
                                nr_free_pages() << (PAGE_SHIFT - 10),
                                physpages << (PAGE_SHIFT - 10),
                                codesize >> 10, datasize >> 10, rosize >> 10,
                                (init_data_size + init_code_size) >> 10, bss_size >> 10,
                                (physpages - totalram_pages - totalcma_pages) << (PAGE_SHIFT - 10),
                                totalcma_pages << (PAGE_SHIFT - 10),
#ifdef    CONFIG_HIGHMEM
                                totalhigh_pages << (PAGE_SHIFT - 10),
#endif

                                str ? ", " : "", str ? str : "");

Best regards, Chris

kernel (mem_init_print_info) and here,          physpages = get_num_physpages() is printed
 
pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK cma-reserved"
#ifdef    CONFIG_HIGHMEM
                                ", %luK highmem"
#endif
                                "%s%s)\n",
                                nr_free_pages() << (PAGE_SHIFT - 10),
                                physpages << (PAGE_SHIFT - 10),
                                codesize >> 10, datasize >> 10, rosize >> 10,
                                (init_data_size + init_code_size) >> 10, bss_size >> 10,
                                (physpages - totalram_pages - totalcma_pages) << (PAGE_SHIFT - 10),
                                totalcma_pages << (PAGE_SHIFT - 10),
#ifdef    CONFIG_HIGHMEM
                                totalhigh_pages << (PAGE_SHIFT - 10),
#endif
                                str ? ", " : "", str ? str : "");