blob: e558eb853525b808e034b51b584e2fd996709731 [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:"
developer96dea742023-06-19 11:13:22 +08008FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/wed3:"
developerf11ee162022-04-12 11:17:45 +08009
developer5dd0a6b2022-07-06 15:03:09 +080010KBRANCH ?= "linux-5.4.y"
developerf11ee162022-04-12 11:17:45 +080011
developercc8110b2024-08-19 13:53:34 +080012LINUX_VERSION ?= "5.4.281"
13SRCREV_machine ?= "84d75fd864979b0228cfe7170a359c0a60f04a98"
developerf11ee162022-04-12 11:17:45 +080014KMETA = "kernel-meta"
15SRCREV_meta ?= "feeb59687bc0f054af837a5061f8d413ec7c93e9"
16
17DEPENDS_append = " kern-tools-native xz-native bc-native"
18
19SRC_URI = " \
developer5dd0a6b2022-07-06 15:03:09 +080020 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=https;branch=${KBRANCH};name=machine \
developerf11ee162022-04-12 11:17:45 +080021 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA} \
22 file://generic \
23 file://mediatek \
24 file://generic/defconfig \
25 file://001-rdkb-eth-mtk-change-ifname-for.patch;apply=no \
developerd13f09a2022-06-01 19:25:09 +080026 file://003-rdkb-mtd-kernel-ubi-relayout.patch;apply=no \
developer4d6b46b2023-01-30 17:05:27 +080027 file://004-rdkb-hnat-bind-ifname.patch;apply=no \
developer550c7bf2024-06-28 19:15:12 +080028 file://002-bpi_r4-lan0_as_wan.patch;apply=no \
developerf11ee162022-04-12 11:17:45 +080029 "
developer266c5292022-10-18 16:32:50 +080030SRC_URI_append_mt7988 += " \
31 file://mediatek/mt7988.cfg \
32"
developerf11ee162022-04-12 11:17:45 +080033SRC_URI_append_mt7986 += " \
34 file://mediatek/mt7986.cfg \
35"
developer87a78c32024-10-17 17:04:30 +080036SRC_URI_append_mt7987 += " \
37 file://mediatek/mt7987.cfg \
38"
developerf11ee162022-04-12 11:17:45 +080039SRC_URI_append_mt7986-32bit += " \
developer49e63962022-04-19 10:14:08 +080040 file://mediatek/patches-32bit-5.4/mt7986-32bit.cfg \
41 file://mediatek/patches-32bit-5.4/401-pinctrl-add-mt7986-driver-32bit.patch \
42 file://mediatek/patches-32bit-5.4/999-add_armv7_support_for_panther.patch \
developerf11ee162022-04-12 11:17:45 +080043"
developer21164f32022-04-22 16:48:46 +080044SRC_URI_append += " \
45 file://rdkb_cfg/iptables.cfg \
46 file://rdkb_cfg/turris_rdkb.cfg \
47 file://rdkb_cfg/openvswitch.cfg \
developer3d4e4572023-01-04 17:20:43 +080048 ${@bb.utils.contains('DISTRO_FEATURES', 'mt76', 'file://rdkb_cfg/mac80211.cfg', 'file://rdkb_cfg/nf_hnat.cfg', d)} \
developer21164f32022-04-22 16:48:46 +080049 file://rdkb_cfg/prplmesh.cfg \
developer2a130182022-05-30 16:13:51 +080050 file://rdkb_cfg/filogic_rdkb.cfg \
developera84877f2023-01-18 09:21:27 +080051 ${@bb.utils.contains('DISTRO_FEATURES','emmc','file://rdkb_cfg/emmc.cfg','',d)} \
developere67feac2023-08-11 17:38:58 +080052 ${@bb.utils.contains('DISTRO_FEATURES','ccn34','file://rdkb_cfg/tops.cfg','',d)} \
developerd5b75962024-02-20 15:57:35 +080053 ${@bb.utils.contains('DISTRO_FEATURES','ccn34','file://rdkb_cfg/eip-197.cfg','',d)} \
developer21164f32022-04-22 16:48:46 +080054"
developer8c5c4b82023-04-14 13:35:33 +080055
developer96dea742023-06-19 11:13:22 +080056SRC_URI_append += " \
developer8c5c4b82023-04-14 13:35:33 +080057 ${@bb.utils.contains('DISTRO_FEATURES','flow_offload','file://rdkb_cfg/bridge_netfilter.cfg','',d)} \
58"
59
developerf11ee162022-04-12 11:17:45 +080060require ${PN}-${PV}/generic/backport-5.4/backport-5.4.inc
61
62require ${PN}-${PV}/generic/pending-5.4/pending-5.4.inc
63SRC_URI_remove = " \
64 file://530-jffs2_make_lzma_available.patch \
65 "
66require ${PN}-${PV}/generic/hack-5.4/hack-5.4.inc
67SRC_URI_remove = " \
68 file://531-debloat_lzma.patch \
69 "
70require ${PN}-${PV}/mediatek/patches-5.4/patches-5.4.inc
developer41913262022-12-19 19:45:32 +080071
developer49e63962022-04-19 10:14:08 +080072SRC_URI_remove_mt7986-32bit = " \
developer77beb692023-06-08 11:08:46 +080073 file://999-2020-pinctrl-add-mt7986-driver.patch \
developerf11ee162022-04-12 11:17:45 +080074 "
developer100f47c2023-02-15 13:25:01 +080075SRC_URI_append_secureboot += " \
76 file://0404-mtdsplit-dm-verity.patch;apply=no \
77 file://0800-dm-verity-redo-hash-for-safexel-sha256.patch;apply=no \
78 file://0801-dm-support-get-device-by-part-uuid-and-label.patch;apply=no \
79 file://0802-dm-expose-create-parameter-to-sysfs.patch;apply=no \
80"
developerf11ee162022-04-12 11:17:45 +080081require linux-mediatek.inc
82
83do_patch_prepend () {
84 cp -Rfp ${WORKDIR}/generic/files/* ${S}/
85 cp -Rfp ${WORKDIR}/generic/files-5.4/* ${S}/
86 cp -Rfp ${WORKDIR}/mediatek/files-5.4/* ${S}/
87}
88
89do_filogic_patches() {
90 cd ${S}
developere6cee7d2022-11-16 18:00:20 +080091 DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}"
developer3d4e4572023-01-04 17:20:43 +080092 DISTRO_logan_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','logan','true','false',d)}"
developer100f47c2023-02-15 13:25:01 +080093 DISTRO_secure_boot_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','secure_boot','true','false',d)}"
developeraf13aa72023-08-21 19:44:20 +080094 DISTRO_ccn34_build_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','ccn34','true','false',d)}"
developer550c7bf2024-06-28 19:15:12 +080095 DISTRO_LAN_AS_WAN_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','lan0_as_wan','true','false',d)}"
developeraf13aa72023-08-21 19:44:20 +080096 if [ $DISTRO_ccn34_build_ENABLED = 'true' ]; then
97 rm -rf ${WORKDIR}/mediatek/nf_hnat/999-40*.patch
98 rm -rf ${WORKDIR}/mediatek/nf_hnat/999-41*.patch
99 rm -rf ${WORKDIR}/mediatek/nf_hnat/999-45*.patch
100 fi
developerf11ee162022-04-12 11:17:45 +0800101 if [ ! -e patch_applied ]; then
102 patch -p1 < ${WORKDIR}/001-rdkb-eth-mtk-change-ifname-for.patch
developerd13f09a2022-06-01 19:25:09 +0800103 patch -p1 < ${WORKDIR}/003-rdkb-mtd-kernel-ubi-relayout.patch
developer550c7bf2024-06-28 19:15:12 +0800104 if [ $DISTRO_LAN_AS_WAN_ENABLED = 'true' ]; then
105 patch -p1 < ${WORKDIR}/002-bpi_r4-lan0_as_wan.patch
106 fi
developer49e63962022-04-19 10:14:08 +0800107 patch -p1 < ${WORKDIR}/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch
developer655d8f02024-01-11 13:37:13 +0800108 patch -p1 < ${WORKDIR}/999-1050-v6.4-backport-jitterrng-2.2.0.patch
developer77beb692023-06-08 11:08:46 +0800109 patch -p1 < ${WORKDIR}/999-2713-mt7531-gsw-internal_phy_calibration.patch
110 patch -p1 < ${WORKDIR}/999-2714-mt7531-gsw-port5_external_phy_init.patch
developer655d8f02024-01-11 13:37:13 +0800111 patch -p1 < ${WORKDIR}/999-2737-net-mt753x-phy-coverity-scan.patch
112 patch -p1 < ${WORKDIR}/999-1710-v6.2-net-phy-add-phylink-pcs-support.patch
113 patch -p1 < ${WORKDIR}/999-1712-v6.2-net-phy-add-phylink-rate-matching-support.patch
developer0caf1462024-05-31 18:09:32 +0800114 patch -p1 < ${WORKDIR}/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch
developer77beb692023-06-08 11:08:46 +0800115 patch -p1 < ${WORKDIR}/999-2725-iwconfig-wireless-rate-fix.patch
developere78dab52024-03-25 14:26:39 +0800116 patch -p1 < ${WORKDIR}/999-2739-drivers_net_ethernet_mediatek_hnat.patch
developer33759cf2024-10-11 15:19:50 +0800117 patch -p1 < ${WORKDIR}/999-2743-drivers-net-dsa-mxl862xx-kernel-compatible.patch
developer100f47c2023-02-15 13:25:01 +0800118 if [ $DISTRO_secure_boot_ENABLED = 'true' ]; then
119 patch -p1 < ${WORKDIR}/0404-mtdsplit-dm-verity.patch
120 patch -p1 < ${WORKDIR}/0800-dm-verity-redo-hash-for-safexel-sha256.patch
121 patch -p1 < ${WORKDIR}/0801-dm-support-get-device-by-part-uuid-and-label.patch
122 patch -p1 < ${WORKDIR}/0802-dm-expose-create-parameter-to-sysfs.patch
123 fi
developere6cee7d2022-11-16 18:00:20 +0800124 if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then
125 for i in ${WORKDIR}/mediatek/flow_patch/*.patch; do patch -p1 < $i; done
126 fi
developer3d4e4572023-01-04 17:20:43 +0800127 if [ $DISTRO_logan_ENABLED = 'true' ]; then
developercc326e22023-01-04 18:51:23 +0800128 for i in ${WORKDIR}/mediatek/nf_hnat/6*.patch; do patch -p1 < $i; done
developercabd7bd2023-06-08 14:49:44 +0800129 for i in ${WORKDIR}/mediatek/nf_hnat/9*.patch; do patch -p1 < $i; done
developer4d6b46b2023-01-30 17:05:27 +0800130 patch -p1 < ${WORKDIR}/004-rdkb-hnat-bind-ifname.patch
developer3d4e4572023-01-04 17:20:43 +0800131 fi
developerf11ee162022-04-12 11:17:45 +0800132 touch patch_applied
133 fi
134}
135
136addtask filogic_patches after do_patch before do_compile
developer3d4e4572023-01-04 17:20:43 +0800137
developere67feac2023-08-11 17:38:58 +0800138KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES','logan','mtkhnat nf_flow_table_hw','',d)}"
developer87a78c32024-10-17 17:04:30 +0800139KERNEL_MODULE_AUTOLOAD_mt7987 += "air_en8811h "