For a custom device a memory carveout is necessary. I see the following snippet in the device tree source (decompiled from the current system’s dtb to be absolutely sure):
generic_carveout {
compatible = "nvidia,generic_carveout";
size = <0x0 0x0>;
alignment = <0x0 0x100000>;
alloc-ranges = <0x0 0x0 0x1 0x0>;
no-map;
status = "okay";
linux,phandle = <0xc5>;
phandle = <0xc5>;
};
grid-of-semaphores {
compatible = "nvidia,gosmem";
size = <0x0 0x6000>;
alignment = <0x0 0x1000>;
no-map;
status = "okay";
cvdevs = <0xc0 0xc1 0xc2 0xc3 0x86 0x8d>;
linux,phandle = <0xc4>;
phandle = <0xc4>;
};
ramoops_carveout {
compatible = "nvidia,ramoops";
size = <0x0 0x200000>;
alignment = <0x0 0x10000>;
alloc-ranges = <0x0 0x0 0x1 0x0>;
no-map;
status = "okay";
linux,phandle = <0x1bb>;
phandle = <0x1bb>;
};
vpr-carveout {
compatible = "nvidia,vpr-carveout";
size = <0x0 0x2a000000>;
alignment = <0x0 0x400000>;
alloc-ranges = <0x0 0x80000000 0x0 0x70000000>;
reusable;
linux,phandle = <0x1bc>;
phandle = <0x1bc>;
};
I also see during boot:
OF: reserved mem: initialized node ramoops_carveout, compatible id nvidia,ramoops
OF: reserved mem: initialized node grid-of-semaphores, compatible id nvidia,gosmem
As you see, I’ve turned on generic_carveout for a test, however it does not show up in the kernel log. What am I missing, how to create custom memory reserve?
If the reserve is assigned dynamically, how can one get the physical address of it?