What version of kernel did you use? How did you turn off CMA? What errors did you encounter?
For image V171028 you can use boot.ini file to set u-boot environment variables.
You need a SD card with fat32 filesystem, put boot.ini file in it and insert it to VIM, when system bootup will read and parse environment variables in boot.ini file.
I built the kernel from https://github.com/khadas/linux so assume latest version. I turned off CMA using both menuconfig and by editing the kvim_defconfig file, by commenting out CONFIG_CMA=y and CONFIG_DMA_CMA=y, tried the combinations of these one by one and both together and get the same error.
first error is bypass_4K being an unused variable and generates an error because of strict rules. When i modified the source to the extract below to remove that error then there are a huge number of errors generated after that, bits of structs missing etc.
#ifdef CONFIG_CMA
static int bypass_4K; #endif
Think the need for CMA is pretty well embedded. Having said that im happy to turn off lots of features as running this headless without a need for GPU so if you know of any way to get past it then im willing to strip lots of the kernel out!
Have tried a boot.ini file on an otherwise blank FAT32 formatted SD card, but couldnt get it to change the boot. My USB to serial device doesnt seem to be working as i just get gibberish out, so getting another one. The boot.ini file was:
well adding cma=100 to the command line appears to have fully stopped it working lol - cant even get it to boot into upgrade mode now! Thru the buttons or Mregister and still cant get serial working (unless anyone can translate this \�-�V�79�;�����3�=��su}W�}wsy���y���_ay���[yM���]YY^���W�-��^+k��%V����UY{��� lol)! Will continue to play
Im trying to make the CMA smaller - though i think i went the wrong way with the numbers, but didnt want to get to 0 straight away given the issue compiling the kernel. But now sadly i have a deveice that wont boot, so im kind of stuck! How do you guys do the initial programme of the devices? Is there somethign i could try?
ive got it back to being recognised on my computer and flashing an image now works ok - but still not booting afterwards. Have ordered a new board as well. Will update if i get it working again or when the new one arrives.
Should have copied your DTS fix the first time instead of messing with u-boot stuff!
Yes - thats where I am now. Image burns ok, but nothing on reset - no hdmi output, no network connection. Have tried erase all flash - but nothing
Still cant get serial working - is there a recomended serial to usb adaptor, ive tried two and they both output garbage. Have got correct settings and followed the guide in docs on how to set it up
@numbqq - Ive got my new VIM2 now - trying to get to a point where i have hugepages on and CMA off.
I have used the Fenix scripts to build now - makes the process easier.
Ive got hugepages on my adding the followign lines to project/fenix/linux/arch/arm64/configs/kvim_defconfig (also added it to defconfig and kvim_defconfig_buildroot for good measure so i didnt have to build mulitple times)
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
Using the Fenix scripts then the file (arch/arm64/boot/dts/amlogic/ep-box.dts) you linked to above to change isnt there, but there is a kvim2_linux.dts so i put the changes into that instead. Then i did a make clean and then built again according to fenix scripts instructions - but when i burn the image it doesnt boot (at least doesnt get as far as getting an IP address) as i cant see it on the network.
yeah - have tried two and have tried swapping contacts over. Ive used one of them on a microcontroller project before and it worked fine there. Connections are as per http://docs.khadas.com/develop/SetupSerialTool/ using three wires for 0v, tx and rx.
Will find another serial device to connect to make sure its all still working
ok, thanks will give that a go - kind of deleting stuff in the dark to be honest! Wouldnt mind if it didnt take so long to build and for me to find out it didnt work lol
I don’t know your build setup but modifying device tree should be pretty easy: simply run make kvim.dtb in you kernel dir after you modify the tree and you’ll get a dtb almost in an instant.
It’s been a while since I’ve worked this low level but CMA should clear out pages (eg inode cache) that others request. On ARM however we use this space for a LOT for things other platforms may have in hardware. I would start by stripping down every driver from the kernel you don’t need (eg audio, video, …) and use serial to get a TTY. Basically get to the level of busybox and then run your application with minimal software.
@guruevi what im seeing (if im reading the output of cat /proc/meminof right!) is that CMA is holding on to its memory allocation and not giving it up - im trying to allocate as many hugepages as i can for my application and cant get much above the 1250 size even with a reboot.
So having done a load more reading and following the tips here - is all i need to do change the dts file and recompile that to remove hardware / drivers from the kernel at boot time rather than recompile the kernel each time? That would save me a lot of time! Sorry if thats a noob question but im a noob when it comes to messing with kernels!
You should be able to reclaim that memory by only modifying device tree but I cannot promise you that it won’t crash - if it does, you would need to deselect the drivers in kernel options and recompile the kernel.