[PATCH v2 7/8] qoriq: new target

Stijn Tintel stijn at linux-ipv6.be
Tue Dec 21 09:36:25 PST 2021


On 21/12/2021 16:49, Rui Salvaterra wrote:
> Hi, Stijn,
>
> Nice to see this! :) A few nits/comments/questions below…
>
> On Mon, 20 Dec 2021 at 19:01, Stijn Tintel <stijn at linux-ipv6.be> wrote:
>> Add a new target named "qoriq", that will support boards using PowerPC
>> processors from NXP's QorIQ brand.
>>
>> This doesn't actually add support for any board yet, so that
>> installation instructions can go in the commit message of the commit
>> that adds actual support for a board.
>>
>> Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
>> ---
>>  package/kernel/linux/modules/other.mk |   2 +-
>>  target/linux/qoriq/Makefile           |  23 ++
>>  target/linux/qoriq/config-5.10        | 384 ++++++++++++++++++++++++++
>>  target/linux/qoriq/generic/target.mk  |   3 +
>>  target/linux/qoriq/image/Makefile     |  36 +++
>>  target/linux/qoriq/image/generic.mk   |   0
>>  6 files changed, 447 insertions(+), 1 deletion(-)
>>  create mode 100644 target/linux/qoriq/Makefile
>>  create mode 100644 target/linux/qoriq/config-5.10
>>  create mode 100644 target/linux/qoriq/generic/target.mk
>>  create mode 100644 target/linux/qoriq/image/Makefile
>>  create mode 100644 target/linux/qoriq/image/generic.mk
>>
>> diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
>> index fdcc089025..f712c95c8e 100644
>> --- a/package/kernel/linux/modules/other.mk
>> +++ b/package/kernel/linux/modules/other.mk
>> @@ -992,7 +992,7 @@ $(eval $(call KernelPackage,ptp))
>>  define KernelPackage/ptp-qoriq
>>    SUBMENU:=$(OTHER_MENU)
>>    TITLE:=Freescale QorIQ PTP support
>> -  DEPENDS:=@TARGET_mpc85xx +kmod-ptp
>> +  DEPENDS:=@(TARGET_mpc85xx||TARGET_qoriq) +kmod-ptp
>>    KCONFIG:=CONFIG_PTP_1588_CLOCK_QORIQ
>>    FILES:=$(LINUX_DIR)/drivers/ptp/ptp-qoriq.ko
>>    AUTOLOAD:=$(call AutoProbe,ptp-qoriq)
>> diff --git a/target/linux/qoriq/Makefile b/target/linux/qoriq/Makefile
>> new file mode 100644
>> index 0000000000..960ab32c98
>> --- /dev/null
>> +++ b/target/linux/qoriq/Makefile
>> @@ -0,0 +1,23 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +#
>> +# Copyright (C) 2021 Stijn Tintel <stijn at linux-ipv6.be>
>> +
>> +include $(TOPDIR)/rules.mk
>> +
>> +ARCH:=powerpc64
>> +BOARD:=qoriq
>> +BOARDNAME:=NXP QorIQ (PowerPC)
>> +CPU_TYPE:=e5500
>> +FEATURES:=boot-part ext4 fpu legacy-sdcard powerpc64 ramdisk root-part rtc source-only
>> +SUBTARGETS:=generic
>> +
>> +KERNEL_PATCHVER:=5.10
>> +KERNEL_TESTING_PATCHVER:=5.10
> Should we keep TESTING_PATCHVER when it's the same version?
Dropped.
>
>> +
>> +KERNELNAME:=zImage
>> +
>> +include $(INCLUDE_DIR)/target.mk
>> +
>> +DEFAULT_PACKAGES += e2fsprogs uboot-envtools
>> +
>> +$(eval $(call BuildTarget))
>> diff --git a/target/linux/qoriq/config-5.10 b/target/linux/qoriq/config-5.10
>> new file mode 100644
>> index 0000000000..6984e60475
>> --- /dev/null
>> +++ b/target/linux/qoriq/config-5.10
>> @@ -0,0 +1,384 @@
>> +CONFIG_64BIT=y
>> +CONFIG_ALTIVEC=y
>> +CONFIG_ARCH_DMA_ADDR_T_64BIT=y
>> +CONFIG_ARCH_HIBERNATION_POSSIBLE=y
>> +CONFIG_ARCH_KEEP_MEMBLOCK=y
>> +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
>> +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
>> +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
>> +CONFIG_ARCH_MMAP_RND_BITS=18
>> +CONFIG_ARCH_MMAP_RND_BITS_MAX=32
>> +CONFIG_ARCH_MMAP_RND_BITS_MIN=18
>> +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
>> +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
>> +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
>> +CONFIG_ARCH_SELECT_MEMORY_MODEL=y
>> +CONFIG_ARCH_SPARSEMEM_ENABLE=y
>> +CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
>> +CONFIG_ASN1=y
>> +CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
>> +CONFIG_AUDIT_ARCH=y
>> +CONFIG_BLK_DEV_SD=y
>> +CONFIG_BLK_MQ_PCI=y
>> +CONFIG_BLK_PM=y
>> +CONFIG_BLK_SCSI_REQUEST=y
>> +CONFIG_BLOCK_COMPAT=y
>> +CONFIG_BOOKE=y
>> +CONFIG_CLKDEV_LOOKUP=y
>> +CONFIG_CLK_QORIQ=y
>> +CONFIG_CLONE_BACKWARDS=y
>> +CONFIG_CLZ_TAB=y
>> +CONFIG_COMMON_CLK=y
>> +CONFIG_COMPAT=y
>> +CONFIG_COMPAT_32BIT_TIME=y
> We shouldn't need 32-bit time_t compatibility, since we're building
> from scratch.
Dropped.
>
>> +CONFIG_COMPAT_BINFMT_ELF=y
>> +CONFIG_COMPAT_NETLINK_MESSAGES=y
>> +CONFIG_COMPAT_OLD_SIGACTION=y
>> +CONFIG_CONSOLE_TRANSLATIONS=y
>> +CONFIG_CORENET_GENERIC=y
>> +# CONFIG_CPUFREQ_DT is not set
>> +CONFIG_CPU_BIG_ENDIAN=y
>> +CONFIG_CPU_FREQ=y
>> +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
>> +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
>> +# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
>> +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
> I see a Qoriq-specific cpufreq driver selected (down below), but we're
> defaulting to performance here. Is frequency scaling actually working,
> or is it disabled for performance/latency reasons?
On the e6500 (M300), it is not usable due to erratum A-008083. The e5500
(M200, BSAP-3040) does not have this problem so I prefer to leave it
enabled. Enabled all governors and selected schedutil as the default,
analog to several other targets.
>
>> +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
>> +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
>> +# CONFIG_CPU_FREQ_STAT is not set
>> +CONFIG_CPU_IDLE=y
>> +CONFIG_CPU_IDLE_GOV_LADDER=y
>> +CONFIG_CPU_IDLE_GOV_TEO=y
> Do we need both ladder and TEO? TEO should be the best option, nowadays.
Side effect of not having enabled tickless idle, fixed.
>
>> +CONFIG_CPU_ISOLATION=y
>> +CONFIG_CPU_RMAP=y
>> +CONFIG_CRC16=y
>> +CONFIG_CRYPTO_AUTHENC=y
>> +CONFIG_CRYPTO_CRC32C=y
>> +# CONFIG_CRYPTO_CRC32C_VPMSUM is not set
>> +CONFIG_CRYPTO_DES=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y
>> +# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
>> +# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
>> +CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
>> +# CONFIG_CRYPTO_DEV_NX is not set
>> +CONFIG_CRYPTO_ECB=y
>> +CONFIG_CRYPTO_ENGINE=y
>> +CONFIG_CRYPTO_GF128MUL=y
>> +CONFIG_CRYPTO_HW=y
>> +CONFIG_CRYPTO_LIB_DES=y
>> +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
>> +# CONFIG_CRYPTO_MD5_PPC is not set
>> +CONFIG_CRYPTO_NULL2=y
>> +CONFIG_CRYPTO_RNG=y
>> +CONFIG_CRYPTO_RNG2=y
>> +CONFIG_CRYPTO_RSA=y
>> +# CONFIG_CRYPTO_SHA1_PPC is not set
>> +CONFIG_CRYPTO_XTS=y
>> +CONFIG_DATA_SHIFT=12
>> +CONFIG_DEBUG_INFO=y
>> +CONFIG_DEBUG_INFO_DWARF4=y
>> +CONFIG_DEFAULT_UIMAGE=y
>> +CONFIG_DMADEVICES=y
>> +CONFIG_DMA_ENGINE=y
>> +CONFIG_DMA_OF=y
>> +CONFIG_DMA_OPS=y
>> +CONFIG_DMA_OPS_BYPASS=y
>> +CONFIG_DTC=y
>> +CONFIG_DUMMY_CONSOLE=y
>> +CONFIG_DYNAMIC_DEBUG=y
>> +CONFIG_E500=y
>> +# CONFIG_E5500_CPU is not set
>> +CONFIG_E6500_CPU=y
> This is confusing. Isn't the CPU an e5500? I haven't looked at the
> kconfig, so I'm not sure how this appears when make(ing)
> kernel_menuconfig.
The M300 is an e6500. I've downgraded CPU_TYPE to e5500 to be able to
support both e5500 and e6500 in the generic subtarget to avoid having
different subtargets. Now for the kernel part, selecting E5500_CPU will
result in -mcpu=powerpc64 rather than -mcpu=e5500. As the only
difference is the presence of AltiVec or not, and the kernel does
runtime detection anyway, I'd prefer to keep E6500 here. For musl,
runtime detection will be enabled only when AltiVec support is not
defined at compile time, so using e5500 for CPU_TYPE will result in an
unneeded runtime check on E6500, but we need that for the E5500 based
models that will be supported in the future.
>
>> +CONFIG_EARLY_PRINTK=y
>> +CONFIG_EDAC=y
>> +CONFIG_EDAC_ATOMIC_SCRUB=y
>> +# CONFIG_EDAC_CPC925 is not set
>> +# CONFIG_EDAC_DEBUG is not set
>> +CONFIG_EDAC_LEGACY_SYSFS=y
>> +CONFIG_EDAC_MPC85XX=y
>> +CONFIG_EDAC_SUPPORT=y
>> +CONFIG_EPAPR_PARAVIRT=y
>> +CONFIG_EXT4_FS=y
>> +CONFIG_EXT4_FS_POSIX_ACL=y
>> +CONFIG_FIXED_PHY=y
>> +CONFIG_FORCE_MAX_ZONEORDER=13
>> +# CONFIG_FSL_BMAN_TEST is not set
>> +CONFIG_FSL_CORENET_CF=y
>> +CONFIG_FSL_CORENET_RCPM=y
>> +CONFIG_FSL_DMA=y
>> +CONFIG_FSL_DPAA=y
>> +# CONFIG_FSL_DPAA_CHECKING is not set
>> +CONFIG_FSL_DPAA_ETH=y
>> +CONFIG_FSL_EMB_PERFMON=y
>> +CONFIG_FSL_FMAN=y
>> +CONFIG_FSL_GUTS=y
>> +CONFIG_FSL_IFC=y
>> +CONFIG_FSL_LBC=y
>> +CONFIG_FSL_MPIC_TIMER_WAKEUP=y
>> +CONFIG_FSL_PAMU=y
>> +CONFIG_FSL_PCI=y
>> +# CONFIG_FSL_QMAN_TEST is not set
>> +CONFIG_FSL_SOC=y
>> +CONFIG_FSL_SOC_BOOKE=y
>> +CONFIG_FSL_XGMAC_MDIO=y
>> +CONFIG_FS_IOMAP=y
>> +CONFIG_FS_MBCACHE=y
>> +CONFIG_FS_POSIX_ACL=y
>> +CONFIG_FTL=y
>> +CONFIG_FUNCTION_ERROR_INJECTION=y
>> +CONFIG_FW_LOADER_PAGED_BUF=y
>> +CONFIG_GDB_SCRIPTS=y
>> +CONFIG_GENERIC_ALLOCATOR=y
>> +CONFIG_GENERIC_BUG=y
>> +CONFIG_GENERIC_CLOCKEVENTS=y
>> +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
>> +CONFIG_GENERIC_CMOS_UPDATE=y
>> +# CONFIG_GENERIC_CPU is not set
>> +CONFIG_GENERIC_CPU_AUTOPROBE=y
>> +CONFIG_GENERIC_CPU_VULNERABILITIES=y
>> +CONFIG_GENERIC_EARLY_IOREMAP=y
>> +CONFIG_GENERIC_IRQ_MIGRATION=y
>> +CONFIG_GENERIC_IRQ_SHOW=y
>> +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
>> +CONFIG_GENERIC_ISA_DMA=y
>> +CONFIG_GENERIC_MSI_IRQ=y
>> +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
>> +CONFIG_GENERIC_PCI_IOMAP=y
>> +CONFIG_GENERIC_PHY=y
>> +CONFIG_GENERIC_SMP_IDLE_THREAD=y
>> +CONFIG_GENERIC_STRNCPY_FROM_USER=y
>> +CONFIG_GENERIC_STRNLEN_USER=y
>> +CONFIG_GENERIC_TIME_VSYSCALL=y
>> +# CONFIG_GEN_RTC is not set
>> +# CONFIG_GIANFAR is not set
>> +CONFIG_GLOB=y
>> +CONFIG_GPIOLIB=y
>> +CONFIG_GPIO_GENERIC=y
>> +CONFIG_GPIO_MPC8XXX=y
>> +CONFIG_GRO_CELLS=y
>> +# CONFIG_HANGCHECK_TIMER is not set
>> +# CONFIG_HARDENED_USERCOPY is not set
>> +CONFIG_HAS_DMA=y
>> +CONFIG_HAS_IOMEM=y
>> +CONFIG_HAS_IOPORT_MAP=y
>> +CONFIG_HWMON=y
>> +CONFIG_HW_CONSOLE=y
>> +CONFIG_HW_RANDOM=y
>> +CONFIG_HZ_PERIODIC=y
> Do we have tickless idle? If so, it should be enabled (instead of
> periodic ticks), in order to save power, unless there's a specific
> reason to disable it.
Good catch. Enabled tickless idle.
>
>> +CONFIG_ILLEGAL_POINTER_VALUE=0x5deadbeef0000000
>> +CONFIG_INITRAMFS_SOURCE=""
>> +CONFIG_INPUT=y
>> +CONFIG_IOMMU_API=y
>> +# CONFIG_IOMMU_DEBUGFS is not set
>> +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
>> +CONFIG_IOMMU_HELPER=y
>> +CONFIG_IOMMU_SUPPORT=y
>> +CONFIG_IRQCHIP=y
>> +CONFIG_IRQ_DOMAIN=y
>> +CONFIG_IRQ_DOMAIN_HIERARCHY=y
>> +CONFIG_IRQ_FORCED_THREADING=y
>> +CONFIG_IRQ_WORK=y
>> +CONFIG_ISA_DMA_API=y
>> +CONFIG_JBD2=y
>> +CONFIG_KALLSYMS=y
>> +CONFIG_KERNEL_GZIP=y
>> +CONFIG_KERNEL_START=0xc000000000000000
>> +CONFIG_KPROBES=y
>> +CONFIG_KRETPROBES=y
>> +# CONFIG_LD_HEAD_STUB_CATCH is not set
>> +CONFIG_LIBFDT=y
>> +CONFIG_LLD_VERSION=0
>> +CONFIG_LOCK_DEBUGGING_SUPPORT=y
>> +CONFIG_LOCK_SPIN_ON_OWNER=y
>> +CONFIG_MAGIC_SYSRQ=y
>> +CONFIG_MATH_EMULATION=y
> The e5500 should implement a complete IEEE 754 compliant FPU,
> according to the datasheet. I don't see a reason to enable any math
> emulation.
It does not implement fsqrt nor fsqrts. As musl hardcodes sqrt and sqrtf
to use these ASM instructions, this is required to avoid SIGILL.
>
> [snipped the rest, as it looks sane]
>
> Cheers,
> Rui

Thanks,
Stijn




More information about the openwrt-devel mailing list