• Stephan Gerhold's avatar
    arm64: dts: qcom: msm8916: Reserve MBA memory dynamically · b4f3a410
    Stephan Gerhold authored
    At a first glance the MBA memory region on MSM8916 looks intentionally
    placed at the fixed address 0x8ea00000. This is what the ELF headers of
    the firmware specify as base address, and the typical Qualcomm-specific
    bits suggest the binary is not relocatable.
    
    However, on a closer look this is pointless: Unlike other firmware
    images the hardware expects to have the raw ELF image loaded to the MBA
    region, including the ELF header (without parsing it at all). This
    means that we actually just load the ELF header (not the code!) at
    0x8ea00000. The real LOAD segments follow at arbitrary aligned
    addresses depending on the structure of the ELF binary.
    
    In practice it looks like we can use an arbitrary 1 MiB-aligned region
    for MBA. The downstream/vendor kernel just allocates this dynamically
    at an arbitrary (aligned) address.
    
    Drop the pointless fixed address and use the new dynamic reserved
    memory mechanism to allocate a region close to the others. This reduces
    gaps in the memory map and provides Linux with more contiguous memory.
    Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
    Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
    Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-5-b7089ec3e3a1@gerhold.netSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
    b4f3a410
msm8916.dtsi 60.6 KB