developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" |
| 2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/backport-5.4:" |
| 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/pending-5.4:" |
| 4 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/hack-5.4:" |
| 5 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/patches-5.4:" |
developer | f79ad45 | 2022-07-12 11:37:54 +0800 | [diff] [blame] | 6 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/flow_patch:" |
developer | 3d4e457 | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 7 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/nf_hnat:" |
developer | 96dea74 | 2023-06-19 11:13:22 +0800 | [diff] [blame] | 8 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/wed3:" |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 9 | |
developer | 5dd0a6b | 2022-07-06 15:03:09 +0800 | [diff] [blame] | 10 | KBRANCH ?= "linux-5.4.y" |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 11 | |
developer | cc8110b | 2024-08-19 13:53:34 +0800 | [diff] [blame] | 12 | LINUX_VERSION ?= "5.4.281" |
| 13 | SRCREV_machine ?= "84d75fd864979b0228cfe7170a359c0a60f04a98" |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 14 | KMETA = "kernel-meta" |
| 15 | SRCREV_meta ?= "feeb59687bc0f054af837a5061f8d413ec7c93e9" |
| 16 | |
| 17 | DEPENDS_append = " kern-tools-native xz-native bc-native" |
| 18 | |
| 19 | SRC_URI = " \ |
developer | 5dd0a6b | 2022-07-06 15:03:09 +0800 | [diff] [blame] | 20 | git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=https;branch=${KBRANCH};name=machine \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 21 | 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 \ |
developer | d13f09a | 2022-06-01 19:25:09 +0800 | [diff] [blame] | 26 | file://003-rdkb-mtd-kernel-ubi-relayout.patch;apply=no \ |
developer | 4d6b46b | 2023-01-30 17:05:27 +0800 | [diff] [blame] | 27 | file://004-rdkb-hnat-bind-ifname.patch;apply=no \ |
developer | 550c7bf | 2024-06-28 19:15:12 +0800 | [diff] [blame] | 28 | file://002-bpi_r4-lan0_as_wan.patch;apply=no \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 29 | " |
developer | 266c529 | 2022-10-18 16:32:50 +0800 | [diff] [blame] | 30 | SRC_URI_append_mt7988 += " \ |
| 31 | file://mediatek/mt7988.cfg \ |
| 32 | " |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 33 | SRC_URI_append_mt7986 += " \ |
| 34 | file://mediatek/mt7986.cfg \ |
| 35 | " |
developer | 87a78c3 | 2024-10-17 17:04:30 +0800 | [diff] [blame] | 36 | SRC_URI_append_mt7987 += " \ |
| 37 | file://mediatek/mt7987.cfg \ |
| 38 | " |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 39 | SRC_URI_append_mt7986-32bit += " \ |
developer | 49e6396 | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 40 | 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 \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 43 | " |
developer | 21164f3 | 2022-04-22 16:48:46 +0800 | [diff] [blame] | 44 | SRC_URI_append += " \ |
| 45 | file://rdkb_cfg/iptables.cfg \ |
| 46 | file://rdkb_cfg/turris_rdkb.cfg \ |
| 47 | file://rdkb_cfg/openvswitch.cfg \ |
developer | 3d4e457 | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 48 | ${@bb.utils.contains('DISTRO_FEATURES', 'mt76', 'file://rdkb_cfg/mac80211.cfg', 'file://rdkb_cfg/nf_hnat.cfg', d)} \ |
developer | 21164f3 | 2022-04-22 16:48:46 +0800 | [diff] [blame] | 49 | file://rdkb_cfg/prplmesh.cfg \ |
developer | 2a13018 | 2022-05-30 16:13:51 +0800 | [diff] [blame] | 50 | file://rdkb_cfg/filogic_rdkb.cfg \ |
developer | a84877f | 2023-01-18 09:21:27 +0800 | [diff] [blame] | 51 | ${@bb.utils.contains('DISTRO_FEATURES','emmc','file://rdkb_cfg/emmc.cfg','',d)} \ |
developer | e67feac | 2023-08-11 17:38:58 +0800 | [diff] [blame] | 52 | ${@bb.utils.contains('DISTRO_FEATURES','ccn34','file://rdkb_cfg/tops.cfg','',d)} \ |
developer | d5b7596 | 2024-02-20 15:57:35 +0800 | [diff] [blame] | 53 | ${@bb.utils.contains('DISTRO_FEATURES','ccn34','file://rdkb_cfg/eip-197.cfg','',d)} \ |
developer | 21164f3 | 2022-04-22 16:48:46 +0800 | [diff] [blame] | 54 | " |
developer | 8c5c4b8 | 2023-04-14 13:35:33 +0800 | [diff] [blame] | 55 | |
developer | 96dea74 | 2023-06-19 11:13:22 +0800 | [diff] [blame] | 56 | SRC_URI_append += " \ |
developer | 8c5c4b8 | 2023-04-14 13:35:33 +0800 | [diff] [blame] | 57 | ${@bb.utils.contains('DISTRO_FEATURES','flow_offload','file://rdkb_cfg/bridge_netfilter.cfg','',d)} \ |
| 58 | " |
| 59 | |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 60 | require ${PN}-${PV}/generic/backport-5.4/backport-5.4.inc |
| 61 | |
| 62 | require ${PN}-${PV}/generic/pending-5.4/pending-5.4.inc |
| 63 | SRC_URI_remove = " \ |
| 64 | file://530-jffs2_make_lzma_available.patch \ |
| 65 | " |
| 66 | require ${PN}-${PV}/generic/hack-5.4/hack-5.4.inc |
| 67 | SRC_URI_remove = " \ |
| 68 | file://531-debloat_lzma.patch \ |
| 69 | " |
| 70 | require ${PN}-${PV}/mediatek/patches-5.4/patches-5.4.inc |
developer | 4191326 | 2022-12-19 19:45:32 +0800 | [diff] [blame] | 71 | |
developer | 49e6396 | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 72 | SRC_URI_remove_mt7986-32bit = " \ |
developer | 77beb69 | 2023-06-08 11:08:46 +0800 | [diff] [blame] | 73 | file://999-2020-pinctrl-add-mt7986-driver.patch \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 74 | " |
developer | 100f47c | 2023-02-15 13:25:01 +0800 | [diff] [blame] | 75 | SRC_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 | " |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 81 | require linux-mediatek.inc |
| 82 | |
| 83 | do_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 | |
| 89 | do_filogic_patches() { |
| 90 | cd ${S} |
developer | e6cee7d | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 91 | DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}" |
developer | 3d4e457 | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 92 | DISTRO_logan_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','logan','true','false',d)}" |
developer | 100f47c | 2023-02-15 13:25:01 +0800 | [diff] [blame] | 93 | DISTRO_secure_boot_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','secure_boot','true','false',d)}" |
developer | af13aa7 | 2023-08-21 19:44:20 +0800 | [diff] [blame] | 94 | DISTRO_ccn34_build_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','ccn34','true','false',d)}" |
developer | 550c7bf | 2024-06-28 19:15:12 +0800 | [diff] [blame] | 95 | DISTRO_LAN_AS_WAN_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','lan0_as_wan','true','false',d)}" |
developer | af13aa7 | 2023-08-21 19:44:20 +0800 | [diff] [blame] | 96 | 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 |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 101 | if [ ! -e patch_applied ]; then |
| 102 | patch -p1 < ${WORKDIR}/001-rdkb-eth-mtk-change-ifname-for.patch |
developer | d13f09a | 2022-06-01 19:25:09 +0800 | [diff] [blame] | 103 | patch -p1 < ${WORKDIR}/003-rdkb-mtd-kernel-ubi-relayout.patch |
developer | 550c7bf | 2024-06-28 19:15:12 +0800 | [diff] [blame] | 104 | if [ $DISTRO_LAN_AS_WAN_ENABLED = 'true' ]; then |
| 105 | patch -p1 < ${WORKDIR}/002-bpi_r4-lan0_as_wan.patch |
| 106 | fi |
developer | 49e6396 | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 107 | patch -p1 < ${WORKDIR}/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch |
developer | 655d8f0 | 2024-01-11 13:37:13 +0800 | [diff] [blame] | 108 | patch -p1 < ${WORKDIR}/999-1050-v6.4-backport-jitterrng-2.2.0.patch |
developer | 77beb69 | 2023-06-08 11:08:46 +0800 | [diff] [blame] | 109 | patch -p1 < ${WORKDIR}/999-2713-mt7531-gsw-internal_phy_calibration.patch |
| 110 | patch -p1 < ${WORKDIR}/999-2714-mt7531-gsw-port5_external_phy_init.patch |
developer | 655d8f0 | 2024-01-11 13:37:13 +0800 | [diff] [blame] | 111 | 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 |
developer | 0caf146 | 2024-05-31 18:09:32 +0800 | [diff] [blame] | 114 | patch -p1 < ${WORKDIR}/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch |
developer | 77beb69 | 2023-06-08 11:08:46 +0800 | [diff] [blame] | 115 | patch -p1 < ${WORKDIR}/999-2725-iwconfig-wireless-rate-fix.patch |
developer | e78dab5 | 2024-03-25 14:26:39 +0800 | [diff] [blame] | 116 | patch -p1 < ${WORKDIR}/999-2739-drivers_net_ethernet_mediatek_hnat.patch |
developer | 33759cf | 2024-10-11 15:19:50 +0800 | [diff] [blame] | 117 | patch -p1 < ${WORKDIR}/999-2743-drivers-net-dsa-mxl862xx-kernel-compatible.patch |
developer | 100f47c | 2023-02-15 13:25:01 +0800 | [diff] [blame] | 118 | 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 |
developer | e6cee7d | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 124 | if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then |
| 125 | for i in ${WORKDIR}/mediatek/flow_patch/*.patch; do patch -p1 < $i; done |
| 126 | fi |
developer | 3d4e457 | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 127 | if [ $DISTRO_logan_ENABLED = 'true' ]; then |
developer | cc326e2 | 2023-01-04 18:51:23 +0800 | [diff] [blame] | 128 | for i in ${WORKDIR}/mediatek/nf_hnat/6*.patch; do patch -p1 < $i; done |
developer | cabd7bd | 2023-06-08 14:49:44 +0800 | [diff] [blame] | 129 | for i in ${WORKDIR}/mediatek/nf_hnat/9*.patch; do patch -p1 < $i; done |
developer | 4d6b46b | 2023-01-30 17:05:27 +0800 | [diff] [blame] | 130 | patch -p1 < ${WORKDIR}/004-rdkb-hnat-bind-ifname.patch |
developer | 3d4e457 | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 131 | fi |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 132 | touch patch_applied |
| 133 | fi |
| 134 | } |
| 135 | |
| 136 | addtask filogic_patches after do_patch before do_compile |
developer | 3d4e457 | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 137 | |
developer | e67feac | 2023-08-11 17:38:58 +0800 | [diff] [blame] | 138 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES','logan','mtkhnat nf_flow_table_hw','',d)}" |
developer | 87a78c3 | 2024-10-17 17:04:30 +0800 | [diff] [blame] | 139 | KERNEL_MODULE_AUTOLOAD_mt7987 += "air_en8811h " |