Blame view

recipes-kernel/linux/linux-smarcimx8mq_5.10.bb 3.12 KB
632c1e3a6   Eric Lee   Yocto Gatesgarth ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  # Copyright (C) 2013-2016 Freescale Semiconductor
  # Copyright 2017-2021 NXP
  # Released under the MIT license (see COPYING.MIT for the terms)
  
  SUMMARY = "Linux Kernel provided and supported by NXP"
  DESCRIPTION = "Linux Kernel provided and supported by NXP with focus on \
  i.MX Family Reference Boards. It includes support for many IPs such as GPU, VPU and IPU."
  
  require recipes-kernel/linux/linux-imx.inc
  
  LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
  
  DEPENDS += "lzop-native bc-native"
  
  SRCBRANCH = "smarc_8mq_lf-5.10.y"
  LOCALVERSION = "-1.0.0"
  KERNEL_DEFCONFIG = "${S}/arch/arm64/configs/smarcimx8mq_defconfig"
  
  KERNEL_SRC ?= "git@git.embedian.com:developer/smarc-fsl-linux-kernel.git;protocol=git"
  SRC_URI = "${EMB_KERNEL_MIRROR};protocol=ssh;branch=${SRCBRANCH}"
4791f7fe5   Eric Lee   Fix Linux kernel ...
21
  SRCREV = "c4aa46bd382d293fac44fd4bee31f698ebe7b940"
632c1e3a6   Eric Lee   Yocto Gatesgarth ...
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  
  LINUX_VERSION = "5.10.9"
  
  FILES_${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo "
  
  KERNEL_CONFIG_COMMAND = "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} olddefconfig"
  
  FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
  
  DEFAULT_PREFERENCE = "1"
  
  DO_CONFIG_V7_COPY = "no"
  DO_CONFIG_V7_COPY_mx6 = "yes"
  DO_CONFIG_V7_COPY_mx7 = "yes"
  DO_CONFIG_V7_COPY_mx8 = "no"
  
  # Add setting for LF Mainline build
  IMX_KERNEL_CONFIG_AARCH32 = "imx_v7_defconfig"
  IMX_KERNEL_CONFIG_AARCH64 = "smarcimx8mq_defconfig"
  KBUILD_DEFCONFIG ?= ""
  KBUILD_DEFCONFIG_mx6= "${IMX_KERNEL_CONFIG_AARCH32}"
  KBUILD_DEFCONFIG_mx7= "${IMX_KERNEL_CONFIG_AARCH32}"
  KBUILD_DEFCONFIG_mx8= "${IMX_KERNEL_CONFIG_AARCH64}"
  
  
  # Use a verbatim copy of the defconfig from the linux-imx repo.
  # IMPORTANT: This task effectively disables kernel config fragments
  # since the config fragments applied in do_kernel_configme are replaced.
  addtask copy_defconfig after do_kernel_configme before do_preconfigure
  do_copy_defconfig () {
      install -d ${B}
      if [ ${DO_CONFIG_V7_COPY} = "yes" ]; then
          # copy latest IMX_KERNEL_CONFIG_AARCH32 to use for mx6, mx6ul and mx7
          mkdir -p ${B}
          cp ${S}/arch/arm/configs/${IMX_KERNEL_CONFIG_AARCH32} ${B}/.config
      else
          # copy latest IMX_KERNEL_CONFIG_AARCH64 to use for mx8
          mkdir -p ${B}
          cp ${S}/arch/arm64/configs/${IMX_KERNEL_CONFIG_AARCH64} ${B}/.config
      fi
  }
  
  DELTA_KERNEL_DEFCONFIG ?= ""
  #DELTA_KERNEL_DEFCONFIG_mx8 = "imx.config"
  
  do_merge_delta_config[dirs] = "${B}"
  do_merge_delta_config[depends] += " \
      flex-native:do_populate_sysroot \
      bison-native:do_populate_sysroot \
  "
  do_merge_delta_config() {
      for deltacfg in ${DELTA_KERNEL_DEFCONFIG}; do
          if [ -f ${S}/arch/${ARCH}/configs/${deltacfg} ]; then
              ${KERNEL_CONFIG_COMMAND}
              oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} ${deltacfg}
          elif [ -f "${WORKDIR}/${deltacfg}" ]; then
              ${S}/scripts/kconfig/merge_config.sh -m .config ${WORKDIR}/${deltacfg}
          elif [ -f "${deltacfg}" ]; then
              ${S}/scripts/kconfig/merge_config.sh -m .config ${deltacfg}
          fi
      done
      cp .config ${WORKDIR}/defconfig
  }
  addtask merge_delta_config before do_preconfigure after do_copy_defconfig
  
  COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"