blob: e4713126f3788173d5f92d96593c44f8cd84adca [file] [log] [blame]
developerec4ebe42022-04-12 11:17:45 +08001FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
2FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/backport-5.4:"
3FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/pending-5.4:"
4FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/hack-5.4:"
5FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/patches-5.4:"
developer3262bf82022-07-12 11:37:54 +08006FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/flow_patch:"
developerda660eb2023-01-04 17:20:43 +08007FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/nf_hnat:"
developerec4ebe42022-04-12 11:17:45 +08008
developer9c038292022-07-06 15:03:09 +08009KBRANCH ?= "linux-5.4.y"
developerec4ebe42022-04-12 11:17:45 +080010
developer3d5faf22022-11-29 18:07:22 +080011LINUX_VERSION ?= "5.4.225"
12SRCREV_machine ?= "4d2a309b5c28a2edc0900542d22fec3a5a22243b"
developerec4ebe42022-04-12 11:17:45 +080013KMETA = "kernel-meta"
14SRCREV_meta ?= "feeb59687bc0f054af837a5061f8d413ec7c93e9"
15
16DEPENDS_append = " kern-tools-native xz-native bc-native"
17
18SRC_URI = " \
developer9c038292022-07-06 15:03:09 +080019 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=https;branch=${KBRANCH};name=machine \
developerec4ebe42022-04-12 11:17:45 +080020 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA} \
21 file://generic \
22 file://mediatek \
23 file://generic/defconfig \
24 file://001-rdkb-eth-mtk-change-ifname-for.patch;apply=no \
developer75572322022-06-01 19:25:09 +080025 file://003-rdkb-mtd-kernel-ubi-relayout.patch;apply=no \
developerec4ebe42022-04-12 11:17:45 +080026 "
developer86fe0612022-10-18 16:32:50 +080027SRC_URI_append_mt7988 += " \
28 file://mediatek/mt7988.cfg \
29"
developerec4ebe42022-04-12 11:17:45 +080030SRC_URI_append_mt7986 += " \
31 file://mediatek/mt7986.cfg \
32"
33SRC_URI_append_mt7986-32bit += " \
developer53810fa2022-04-19 10:14:08 +080034 file://mediatek/patches-32bit-5.4/mt7986-32bit.cfg \
35 file://mediatek/patches-32bit-5.4/401-pinctrl-add-mt7986-driver-32bit.patch \
36 file://mediatek/patches-32bit-5.4/999-add_armv7_support_for_panther.patch \
developerec4ebe42022-04-12 11:17:45 +080037"
developerc436bdc2022-04-22 16:48:46 +080038SRC_URI_append += " \
39 file://rdkb_cfg/iptables.cfg \
40 file://rdkb_cfg/turris_rdkb.cfg \
41 file://rdkb_cfg/openvswitch.cfg \
developerda660eb2023-01-04 17:20:43 +080042 ${@bb.utils.contains('DISTRO_FEATURES', 'mt76', 'file://rdkb_cfg/mac80211.cfg', 'file://rdkb_cfg/nf_hnat.cfg', d)} \
developerc436bdc2022-04-22 16:48:46 +080043 file://rdkb_cfg/prplmesh.cfg \
developer50c864c2022-05-30 16:13:51 +080044 file://rdkb_cfg/filogic_rdkb.cfg \
developerc436bdc2022-04-22 16:48:46 +080045"
developerec4ebe42022-04-12 11:17:45 +080046require ${PN}-${PV}/generic/backport-5.4/backport-5.4.inc
47
48require ${PN}-${PV}/generic/pending-5.4/pending-5.4.inc
49SRC_URI_remove = " \
50 file://530-jffs2_make_lzma_available.patch \
51 "
52require ${PN}-${PV}/generic/hack-5.4/hack-5.4.inc
53SRC_URI_remove = " \
54 file://531-debloat_lzma.patch \
55 "
56require ${PN}-${PV}/mediatek/patches-5.4/patches-5.4.inc
developera05a7ec2022-12-19 19:45:32 +080057
developer53810fa2022-04-19 10:14:08 +080058SRC_URI_remove_mt7986-32bit = " \
59 file://401-pinctrl-add-mt7986-driver.patch \
developerec4ebe42022-04-12 11:17:45 +080060 "
61require linux-mediatek.inc
62
63do_patch_prepend () {
64 cp -Rfp ${WORKDIR}/generic/files/* ${S}/
65 cp -Rfp ${WORKDIR}/generic/files-5.4/* ${S}/
66 cp -Rfp ${WORKDIR}/mediatek/files-5.4/* ${S}/
67}
68
69do_filogic_patches() {
70 cd ${S}
developerddae1502022-11-16 18:00:20 +080071 DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}"
developerda660eb2023-01-04 17:20:43 +080072 DISTRO_logan_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','logan','true','false',d)}"
developerec4ebe42022-04-12 11:17:45 +080073 if [ ! -e patch_applied ]; then
74 patch -p1 < ${WORKDIR}/001-rdkb-eth-mtk-change-ifname-for.patch
developer75572322022-06-01 19:25:09 +080075 patch -p1 < ${WORKDIR}/003-rdkb-mtd-kernel-ubi-relayout.patch
developer53810fa2022-04-19 10:14:08 +080076 patch -p1 < ${WORKDIR}/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch
developera05a7ec2022-12-19 19:45:32 +080077 patch -p1 < ${WORKDIR}/738-mt7531-gsw-internal_phy_calibration.patch
78 patch -p1 < ${WORKDIR}/739-mt7531-gsw-port5_external_phy_init.patch
79 patch -p1 < ${WORKDIR}/753-net-mt753x-phy-coverity-scan.patch
developer53810fa2022-04-19 10:14:08 +080080 patch -p1 < ${WORKDIR}/9010-iwconfig-wireless-rate-fix.patch
developerddae1502022-11-16 18:00:20 +080081 if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then
82 for i in ${WORKDIR}/mediatek/flow_patch/*.patch; do patch -p1 < $i; done
83 fi
developerda660eb2023-01-04 17:20:43 +080084 if [ $DISTRO_logan_ENABLED = 'true' ]; then
85 for i in ${WORKDIR}/mediatek/nf_hnat/*.patch; do patch -p1 < $i; done
86 fi
developerec4ebe42022-04-12 11:17:45 +080087 touch patch_applied
88 fi
89}
90
91addtask filogic_patches after do_patch before do_compile
developerda660eb2023-01-04 17:20:43 +080092
93KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES','logan','mtkhnat nf_flow_table_hw','',d)}"