blob: aba338ee03446398e80f25db6ce7743ac05ac66c [file] [log] [blame]
developerf11ee162022-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:"
developerf79ad452022-07-12 11:37:54 +08006FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/flow_patch:"
developer3d4e4572023-01-04 17:20:43 +08007FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/nf_hnat:"
developerf11ee162022-04-12 11:17:45 +08008
developer5dd0a6b2022-07-06 15:03:09 +08009KBRANCH ?= "linux-5.4.y"
developerf11ee162022-04-12 11:17:45 +080010
developerab414ae2023-01-30 13:12:50 +080011LINUX_VERSION ?= "5.4.230"
12SRCREV_machine ?= "90245959a5b936ee013266e5d1e6a508ed69274e"
developerf11ee162022-04-12 11:17:45 +080013KMETA = "kernel-meta"
14SRCREV_meta ?= "feeb59687bc0f054af837a5061f8d413ec7c93e9"
15
16DEPENDS_append = " kern-tools-native xz-native bc-native"
17
18SRC_URI = " \
developer5dd0a6b2022-07-06 15:03:09 +080019 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=https;branch=${KBRANCH};name=machine \
developerf11ee162022-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 \
developerd13f09a2022-06-01 19:25:09 +080025 file://003-rdkb-mtd-kernel-ubi-relayout.patch;apply=no \
developer4d6b46b2023-01-30 17:05:27 +080026 file://004-rdkb-hnat-bind-ifname.patch;apply=no \
developerf11ee162022-04-12 11:17:45 +080027 "
developer266c5292022-10-18 16:32:50 +080028SRC_URI_append_mt7988 += " \
29 file://mediatek/mt7988.cfg \
30"
developerf11ee162022-04-12 11:17:45 +080031SRC_URI_append_mt7986 += " \
32 file://mediatek/mt7986.cfg \
33"
34SRC_URI_append_mt7986-32bit += " \
developer49e63962022-04-19 10:14:08 +080035 file://mediatek/patches-32bit-5.4/mt7986-32bit.cfg \
36 file://mediatek/patches-32bit-5.4/401-pinctrl-add-mt7986-driver-32bit.patch \
37 file://mediatek/patches-32bit-5.4/999-add_armv7_support_for_panther.patch \
developerf11ee162022-04-12 11:17:45 +080038"
developer21164f32022-04-22 16:48:46 +080039SRC_URI_append += " \
40 file://rdkb_cfg/iptables.cfg \
41 file://rdkb_cfg/turris_rdkb.cfg \
42 file://rdkb_cfg/openvswitch.cfg \
developer3d4e4572023-01-04 17:20:43 +080043 ${@bb.utils.contains('DISTRO_FEATURES', 'mt76', 'file://rdkb_cfg/mac80211.cfg', 'file://rdkb_cfg/nf_hnat.cfg', d)} \
developer21164f32022-04-22 16:48:46 +080044 file://rdkb_cfg/prplmesh.cfg \
developer2a130182022-05-30 16:13:51 +080045 file://rdkb_cfg/filogic_rdkb.cfg \
developera84877f2023-01-18 09:21:27 +080046 ${@bb.utils.contains('DISTRO_FEATURES','emmc','file://rdkb_cfg/emmc.cfg','',d)} \
developer21164f32022-04-22 16:48:46 +080047"
developerf11ee162022-04-12 11:17:45 +080048require ${PN}-${PV}/generic/backport-5.4/backport-5.4.inc
49
50require ${PN}-${PV}/generic/pending-5.4/pending-5.4.inc
51SRC_URI_remove = " \
52 file://530-jffs2_make_lzma_available.patch \
53 "
54require ${PN}-${PV}/generic/hack-5.4/hack-5.4.inc
55SRC_URI_remove = " \
56 file://531-debloat_lzma.patch \
57 "
58require ${PN}-${PV}/mediatek/patches-5.4/patches-5.4.inc
developer41913262022-12-19 19:45:32 +080059
developer49e63962022-04-19 10:14:08 +080060SRC_URI_remove_mt7986-32bit = " \
61 file://401-pinctrl-add-mt7986-driver.patch \
developerf11ee162022-04-12 11:17:45 +080062 "
63require linux-mediatek.inc
64
65do_patch_prepend () {
66 cp -Rfp ${WORKDIR}/generic/files/* ${S}/
67 cp -Rfp ${WORKDIR}/generic/files-5.4/* ${S}/
68 cp -Rfp ${WORKDIR}/mediatek/files-5.4/* ${S}/
69}
70
71do_filogic_patches() {
72 cd ${S}
developere6cee7d2022-11-16 18:00:20 +080073 DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}"
developer3d4e4572023-01-04 17:20:43 +080074 DISTRO_logan_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','logan','true','false',d)}"
developerf11ee162022-04-12 11:17:45 +080075 if [ ! -e patch_applied ]; then
76 patch -p1 < ${WORKDIR}/001-rdkb-eth-mtk-change-ifname-for.patch
developerd13f09a2022-06-01 19:25:09 +080077 patch -p1 < ${WORKDIR}/003-rdkb-mtd-kernel-ubi-relayout.patch
developer49e63962022-04-19 10:14:08 +080078 patch -p1 < ${WORKDIR}/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch
developer41913262022-12-19 19:45:32 +080079 patch -p1 < ${WORKDIR}/738-mt7531-gsw-internal_phy_calibration.patch
80 patch -p1 < ${WORKDIR}/739-mt7531-gsw-port5_external_phy_init.patch
81 patch -p1 < ${WORKDIR}/753-net-mt753x-phy-coverity-scan.patch
developer49e63962022-04-19 10:14:08 +080082 patch -p1 < ${WORKDIR}/9010-iwconfig-wireless-rate-fix.patch
developere6cee7d2022-11-16 18:00:20 +080083 if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then
84 for i in ${WORKDIR}/mediatek/flow_patch/*.patch; do patch -p1 < $i; done
85 fi
developer3d4e4572023-01-04 17:20:43 +080086 if [ $DISTRO_logan_ENABLED = 'true' ]; then
developercc326e22023-01-04 18:51:23 +080087 for i in ${WORKDIR}/mediatek/nf_hnat/6*.patch; do patch -p1 < $i; done
88 for i in ${WORKDIR}/mediatek/nf_hnat/10*.patch; do patch -p1 < $i; done
developer4d6b46b2023-01-30 17:05:27 +080089 patch -p1 < ${WORKDIR}/004-rdkb-hnat-bind-ifname.patch
developer3d4e4572023-01-04 17:20:43 +080090 fi
developerf11ee162022-04-12 11:17:45 +080091 touch patch_applied
92 fi
93}
94
95addtask filogic_patches after do_patch before do_compile
developer3d4e4572023-01-04 17:20:43 +080096
97KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES','logan','mtkhnat nf_flow_table_hw','',d)}"