summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
blob: 233132911cf68f65357d833a57921db331fc49ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
DISABLE_OVERSCAN = "1"
TOTAL_BOARD_MEM = "3072"

do_deploy:append:raspberrypi4() {
    # ENABLE CAN
    if [ "${ENABLE_CAN}" = "1" ]; then
        echo "# Enable CAN" >> ${DEPLOYDIR}/bootfiles/config.txt
        echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bootfiles/config.txt
    fi

    # ENABLE DUAL CANFD
    if [ "${ENABLE_DUAL_CAN_FD}" = "1" ]; then
        echo "# Enable CANFD" >> ${DEPLOYDIR}/bootfiles/config.txt
        echo "dtoverlay=mcp251xfd-can0,oscillator=16000000,interrupt=25" >> ${DEPLOYDIR}/bootfiles/config.txt
        echo "dtoverlay=mcp251xfd-can1,oscillator=16000000,interrupt=24" >> ${DEPLOYDIR}/bootfiles/config.txt
    fi

    # Handle setup with armstub file
    if [ -n "${ARMSTUB}" ]; then
        echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bootfiles/config.txt
        echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bootfiles/config.txt
        case "${ARMSTUB}" in
            *-gic.bin)
                echo  "enable_gic=1" >> ${DEPLOYDIR}/bootfiles/config.txt
                ;;
        esac
    fi

    if [ "${AGL_XEN_WANTED}" = "1" ]; then
        echo "total_mem=${TOTAL_BOARD_MEM}" >> ${DEPLOYDIR}/bootfiles/config.txt
    fi
}

do_deploy:append() {
    if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then
        sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bootfiles/config.txt
    fi

    if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then
        sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bootfiles/config.txt
    fi

    echo "avoid_warnings=2" >> ${DEPLOYDIR}/bootfiles/config.txt
    echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bootfiles/config.txt
    echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bootfiles/config.txt
    echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bootfiles/config.txt
    echo "dtparam=audio=on" >> ${DEPLOYDIR}/bootfiles/config.txt
}

do_deploy:append:raspberrypi4() {
    echo -e "\n[pi4]" >> ${DEPLOYDIR}/bootfiles/config.txt
    echo "max_framebuffers=2" >> ${DEPLOYDIR}/bootfiles/config.txt
}