From 4d7cbe0a55902af30467eaf307b43e8cc53741d0 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:04 +0200 Subject: [PATCH 01/14] kernel: video-dma: explicitly state packaged modules Because wildcard in variable stating packaged modules, the filtering for built-in kernel modules didn't work and would cause a packaging failure. Signed-off-by: Tomasz Maciej Nowak --- package/kernel/linux/modules/video.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 018f5644b0..ff04e3b5de 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -1181,7 +1181,9 @@ define KernelPackage/video-dma KCONFIG:= \ CONFIG_VIDEOBUF2_DMA_CONTIG \ CONFIG_VIDEOBUF2_DMA_SG - FILES:= $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-dma-*.ko + FILES:= \ + $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-dma-contig.ko \ + $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-dma-sg.ko AUTOLOAD:=$(call AutoLoad,66,videobuf2-dma-contig videobuf2-dma-sg) $(call AddDepends/video) endef From c1a09173abddda2da7edc81188665d8bcfd75253 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:05 +0200 Subject: [PATCH 02/14] tegra: refresh 5.15 config Reduce diffstat in kernel config on new version introduction. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/config-5.15 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/tegra/config-5.15 b/target/linux/tegra/config-5.15 index 257ffda252..1600dd7f21 100644 --- a/target/linux/tegra/config-5.15 +++ b/target/linux/tegra/config-5.15 @@ -157,6 +157,7 @@ CONFIG_DMA_SHARED_BUFFER=y CONFIG_DNOTIFY=y CONFIG_DRM=y CONFIG_DRM_BRIDGE=y +CONFIG_DRM_DP_AUX_BUS=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 CONFIG_DRM_KMS_HELPER=y @@ -186,6 +187,7 @@ CONFIG_FB_SYS_IMAGEBLIT=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y +CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y @@ -297,6 +299,7 @@ CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y +CONFIG_NVMEM_LAYOUTS=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y From b693eca4684da89dda735f24c75d4f46e2c4f000 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:06 +0200 Subject: [PATCH 03/14] kernel/tegra: Create kernel files for v6.6 (from v5.15) This is an automatically generated commit. When doing `git bisect`, consider `git bisect --skip`. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/{config-5.15 => config-6.6} | 0 ...cover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch | 0 .../101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/tegra/{config-5.15 => config-6.6} (100%) rename target/linux/tegra/{patches-5.15 => patches-6.6}/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch (100%) rename target/linux/tegra/{patches-5.15 => patches-6.6}/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch (100%) diff --git a/target/linux/tegra/config-5.15 b/target/linux/tegra/config-6.6 similarity index 100% rename from target/linux/tegra/config-5.15 rename to target/linux/tegra/config-6.6 diff --git a/target/linux/tegra/patches-5.15/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch b/target/linux/tegra/patches-6.6/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch similarity index 100% rename from target/linux/tegra/patches-5.15/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch rename to target/linux/tegra/patches-6.6/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch diff --git a/target/linux/tegra/patches-5.15/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch similarity index 100% rename from target/linux/tegra/patches-5.15/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch rename to target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch From 2f7b5d5472dd4c35148486007f989231898188ab Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:07 +0200 Subject: [PATCH 04/14] kernel/tegra: Restore kernel files for v5.15 This is an automatically generated commit which aids following Kernel patch history, as git will see the move and copy as a rename thus defeating the purpose. For the original discussion see: https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/config-5.15 | 507 ++++++++++++++++++ ...interrupts-due-to-tegra2-silicon-bug.patch | 77 +++ ...enable-front-panel-leds-in-TrimSlice.patch | 46 ++ 3 files changed, 630 insertions(+) create mode 100644 target/linux/tegra/config-5.15 create mode 100644 target/linux/tegra/patches-5.15/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch create mode 100644 target/linux/tegra/patches-5.15/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch diff --git a/target/linux/tegra/config-5.15 b/target/linux/tegra/config-5.15 new file mode 100644 index 0000000000..1600dd7f21 --- /dev/null +++ b/target/linux/tegra/config-5.15 @@ -0,0 +1,507 @@ +CONFIG_AC97_BUS=y +# CONFIG_AHCI_TEGRA is not set +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y +CONFIG_ARCH_NR_GPIO=1024 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_TEGRA=y +# CONFIG_ARCH_TEGRA_114_SOC is not set +# CONFIG_ARCH_TEGRA_124_SOC is not set +CONFIG_ARCH_TEGRA_2x_SOC=y +# CONFIG_ARCH_TEGRA_3x_SOC is not set +CONFIG_ARM=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_ERRATA_720789=y +CONFIG_ARM_ERRATA_754327=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_PL172_MPMC is not set +# CONFIG_ARM_SMMU is not set +# CONFIG_ARM_TEGRA124_CPUFREQ is not set +CONFIG_ARM_TEGRA20_CPUFREQ=y +CONFIG_ARM_TEGRA_CPUIDLE=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ASN1=y +CONFIG_ATA=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_BSG=y +CONFIG_BLK_DEV_BSG_COMMON=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_PM=y +CONFIG_BOUNCE=y +CONFIG_CACHE_L2X0=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CLZ_TAB=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONTIG_ALLOC=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +# CONFIG_CPU_FREQ_STAT is not set +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_AES_ARM=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CRYPTD=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_ECHAINIV=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LZ4=y +CONFIG_CRYPTO_LZ4HC=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_RSA=y +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA1_ARM=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA256_ARM=y +CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_SHA512_ARM=y +CONFIG_CRYPTO_TWOFISH=y +CONFIG_CRYPTO_TWOFISH_COMMON=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +# CONFIG_DEVFREQ_GOV_PASSIVE is not set +# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set +# CONFIG_DEVFREQ_GOV_POWERSAVE is not set +CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y +# CONFIG_DEVFREQ_GOV_USERSPACE is not set +CONFIG_DEVFREQ_THERMAL=y +# CONFIG_DEVPORT is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_CMA=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y +CONFIG_DMA_REMAP=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DNOTIFY=y +CONFIG_DRM=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_DP_AUX_BUS=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_MIPI_DSI=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_DRM_TEGRA=y +# CONFIG_DRM_TEGRA_DEBUG is not set +# CONFIG_DRM_TEGRA_STAGING is not set +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_EXTCON=y +CONFIG_F2FS_FS=y +CONFIG_FB=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FUNCTION_ALIGNMENT=0 +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y +CONFIG_GLOB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_TEGRA=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_SMP=y +CONFIG_HDMI=y +CONFIG_HID=y +CONFIG_HIDRAW=y +CONFIG_HID_GENERIC=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HWMON=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_TEGRA=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INTERCONNECT=y +CONFIG_IOMMU_API=y +# CONFIG_IOMMU_DEBUGFS is not set +CONFIG_IOMMU_DEFAULT_DMA_STRICT=y +CONFIG_IOMMU_IOVA=y +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set +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_JBD2=y +CONFIG_KCMP=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KMAP_LOCAL=y +CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZ4HC_COMPRESS=y +CONFIG_LZ4_COMPRESS=y +CONFIG_LZ4_DECOMPRESS=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MEMFD_CREATE=y +CONFIG_MEMORY=y +CONFIG_MEMORY_ISOLATION=y +# CONFIG_MFD_ACER_A500_EC is not set +# CONFIG_MFD_NVEC is not set +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_CQHCI=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_TEGRA=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MPILIB=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +# CONFIG_NEON is not set +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NLS=y +CONFIG_NR_CPUS=4 +CONFIG_NVMEM=y +CONFIG_NVMEM_LAYOUTS=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IOMMU=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_PERFORMANCE is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_PME=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCI_TEGRA=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHY_TEGRA_XUSB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_TEGRA=y +CONFIG_PINCTRL_TEGRA20=y +CONFIG_PINCTRL_TEGRA_XUSB=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_PL310_ERRATA_769419=y +CONFIG_PL353_SMC=y +CONFIG_PM=y +CONFIG_PM_CLK=y +CONFIG_PM_DEVFREQ=y +# CONFIG_PM_DEVFREQ_EVENT is not set +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +CONFIG_PM_OPP=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_SUPPLY=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_PWM=y +CONFIG_PWM_SYSFS=y +CONFIG_PWM_TEGRA=y +CONFIG_RAS=y +CONFIG_RATIONAL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_GPIO=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_TEGRA=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_NVMEM=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_PROC_FS is not set +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_TEGRA=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_TEGRA=y +CONFIG_SERIO=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SND=y +# CONFIG_SND_COMPRESS_OFFLOAD is not set +CONFIG_SND_DMAENGINE_PCM=y +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_HDA_TEGRA is not set +CONFIG_SND_JACK=y +CONFIG_SND_JACK_INPUT_DEV=y +# CONFIG_SND_PCI is not set +CONFIG_SND_PCM=y +# CONFIG_SND_PROC_FS is not set +CONFIG_SND_SIMPLE_CARD=y +CONFIG_SND_SIMPLE_CARD_UTILS=y +CONFIG_SND_SOC=y +CONFIG_SND_SOC_AC97_BUS=y +CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y +CONFIG_SND_SOC_I2C_AND_SPI=y +CONFIG_SND_SOC_TEGRA=y +# CONFIG_SND_SOC_TEGRA186_DSPK is not set +CONFIG_SND_SOC_TEGRA20_AC97=y +CONFIG_SND_SOC_TEGRA20_DAS=y +CONFIG_SND_SOC_TEGRA20_I2S=y +CONFIG_SND_SOC_TEGRA20_SPDIF=y +# CONFIG_SND_SOC_TEGRA210_ADMAIF is not set +# CONFIG_SND_SOC_TEGRA210_AHUB is not set +# CONFIG_SND_SOC_TEGRA210_DMIC is not set +# CONFIG_SND_SOC_TEGRA210_I2S is not set +# CONFIG_SND_SOC_TEGRA30_AHUB is not set +# CONFIG_SND_SOC_TEGRA30_I2S is not set +# CONFIG_SND_SOC_TEGRA_ALC5632 is not set +CONFIG_SND_SOC_TEGRA_MACHINE_DRV=y +# CONFIG_SND_SOC_TEGRA_MAX98090 is not set +# CONFIG_SND_SOC_TEGRA_RT5640 is not set +# CONFIG_SND_SOC_TEGRA_RT5677 is not set +# CONFIG_SND_SOC_TEGRA_SGTL5000 is not set +CONFIG_SND_SOC_TEGRA_TRIMSLICE=y +# CONFIG_SND_SOC_TEGRA_WM8753 is not set +# CONFIG_SND_SOC_TEGRA_WM8903 is not set +# CONFIG_SND_SOC_TEGRA_WM9712 is not set +CONFIG_SND_SOC_TLV320AIC23=y +CONFIG_SND_SOC_TLV320AIC23_I2C=y +# CONFIG_SND_USB is not set +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOC_BUS=y +CONFIG_SOC_TEGRA20_VOLTAGE_COUPLER=y +CONFIG_SOC_TEGRA_FLOWCTRL=y +CONFIG_SOC_TEGRA_FUSE=y +CONFIG_SOC_TEGRA_PMC=y +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +# CONFIG_SPI_TEGRA114 is not set +CONFIG_SPI_TEGRA20_SFLASH=y +CONFIG_SPI_TEGRA20_SLINK=y +# CONFIG_SPI_TEGRA210_QUAD is not set +CONFIG_SRCU=y +CONFIG_SWP_EMULATE=y +CONFIG_SYNC_FILE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TEGRA20_APB_DMA=y +CONFIG_TEGRA20_EMC=y +CONFIG_TEGRA_AHB=y +CONFIG_TEGRA_GMI=y +CONFIG_TEGRA_HOST1X=y +CONFIG_TEGRA_HOST1X_FIREWALL=y +CONFIG_TEGRA_IOMMU_GART=y +# CONFIG_TEGRA_IOMMU_SMMU is not set +# CONFIG_TEGRA_IVC is not set +CONFIG_TEGRA_MC=y +# CONFIG_TEGRA_SOCTHERM is not set +CONFIG_TEGRA_TIMER=y +CONFIG_TEGRA_WATCHDOG=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +# CONFIG_UACCE is not set +# CONFIG_UCLAMP_TASK is not set +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB=y +CONFIG_USB_CHIPIDEA=y +CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_CHIPIDEA_TEGRA=y +CONFIG_USB_CHIPIDEA_UDC=y +CONFIG_USB_COMMON=y +CONFIG_USB_CONN_GPIO=y +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_EHCI_TEGRA=y +CONFIG_USB_GADGET=y +CONFIG_USB_HID=y +CONFIG_USB_HIDDEV=y +CONFIG_USB_PHY=y +CONFIG_USB_ROLE_SWITCH=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_TEGRA_PHY=y +# CONFIG_USB_TEGRA_XUDC is not set +CONFIG_USB_ULPI=y +CONFIG_USB_ULPI_BUS=y +CONFIG_USB_ULPI_VIEWPORT=y +# CONFIG_USB_XHCI_TEGRA is not set +CONFIG_USE_OF=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_XPS=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/tegra/patches-5.15/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch b/target/linux/tegra/patches-5.15/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch new file mode 100644 index 0000000000..8f01f73eb2 --- /dev/null +++ b/target/linux/tegra/patches-5.15/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch @@ -0,0 +1,77 @@ +From patchwork Fri Jul 13 11:32:42 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: serial8250 on tegra hsuart: recover from spurious interrupts due to + tegra2 silicon bug +X-Patchwork-Submitter: "David R. Piegdon" +X-Patchwork-Id: 943440 +Message-Id: <4676ea34-69ce-5422-1ded-94218b89f7d9@p23q.org> +To: linux-tegra@vger.kernel.org +Date: Fri, 13 Jul 2018 11:32:42 +0000 +From: "David R. Piegdon" +List-Id: + +Hi, +a while back I sent a few mails regarding spurious interrupts in the +UARTA (hsuart) block of the Tegra2 SoC, when using the 8250 driver for +it instead of the hsuart driver. After going down a pretty deep +debugging/testing hole, I think I found a patch that fixes the issue. So +far testing in a reboot-cycle suggests that the error frequency dropped +from >3% of all reboots to at least <0.05% of all reboots. Tests +continue to run over the weekend. + +The patch below already is a second iteration; the first did not reset +the MCR or contain the lines below '// clear interrupts'. This resulted +in no more spurious interrupts, but in a few % of spurious interrupts +that were recovered the UART block did not receive any characters any +more. So further resetting was required to fully reacquire operational +state of the UART block. + +I'd love any comments/suggestions on this! + +Cheers, + +David + +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -134,6 +134,38 @@ static irqreturn_t serial8250_interrupt( + + if (l == i->head && pass_counter++ > PASS_LIMIT) + break; ++ ++#ifdef CONFIG_ARCH_TEGRA_2x_SOC ++ if (!handled && (port->type == PORT_TEGRA)) { ++ /* ++ * Fix Tegra 2 CPU silicon bug where sometimes ++ * "TX holding register empty" interrupts result in a ++ * bad (metastable?) state in Tegras HSUART IP core. ++ * Only way to recover seems to be to reset all ++ * interrupts as well as the TX queue and the MCR. ++ * But we don't want to loose any outgoing characters, ++ * so only do it if the RX and TX queues are empty. ++ */ ++ unsigned char lsr = port->serial_in(port, UART_LSR); ++ const unsigned char fifo_empty_mask = ++ (UART_LSR_TEMT | UART_LSR_THRE); ++ if (((lsr & (UART_LSR_DR | fifo_empty_mask)) == ++ fifo_empty_mask)) { ++ port->serial_out(port, UART_IER, 0); ++ port->serial_out(port, UART_MCR, 0); ++ serial8250_clear_and_reinit_fifos(up); ++ port->serial_out(port, UART_MCR, up->mcr); ++ port->serial_out(port, UART_IER, up->ier); ++ // clear interrupts ++ serial_port_in(port, UART_LSR); ++ serial_port_in(port, UART_RX); ++ serial_port_in(port, UART_IIR); ++ serial_port_in(port, UART_MSR); ++ up->lsr_saved_flags = 0; ++ up->msr_saved_flags = 0; ++ } ++ } ++#endif + } while (l != end); + + spin_unlock(&i->lock); diff --git a/target/linux/tegra/patches-5.15/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-5.15/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch new file mode 100644 index 0000000000..b1e210b212 --- /dev/null +++ b/target/linux/tegra/patches-5.15/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch @@ -0,0 +1,46 @@ +--- a/arch/arm/boot/dts/tegra20-trimslice.dts ++++ b/arch/arm/boot/dts/tegra20-trimslice.dts +@@ -201,16 +201,17 @@ + conf_ata { + nvidia,pins = "ata", "atc", "atd", "ate", + "crtp", "dap2", "dap3", "dap4", "dta", +- "dtb", "dtc", "dtd", "dte", "gmb", +- "gme", "i2cp", "pta", "slxc", "slxd", +- "spdi", "spdo", "uda"; ++ "dtb", "dtc", "dtd", "gmb", "gme", ++ "i2cp", "pta", "slxc", "slxd", "spdi", ++ "spdo", "uda"; + nvidia,pull = ; + nvidia,tristate = ; + }; + conf_atb { + nvidia,pins = "atb", "cdev1", "cdev2", "dap1", +- "gma", "gmc", "gmd", "gpu", "gpu7", +- "gpv", "sdio1", "slxa", "slxk", "uac"; ++ "dte", "gma", "gmc", "gmd", "gpu", ++ "gpu7", "gpv", "sdio1", "slxa", "slxk", ++ "uac"; + nvidia,pull = ; + nvidia,tristate = ; + }; +@@ -396,6 +397,20 @@ + }; + }; + ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ ds2 { ++ label = "trimslice:green:right"; ++ gpios = <&gpio TEGRA_GPIO(D, 2) GPIO_ACTIVE_LOW>; ++ }; ++ ++ ds3 { ++ label = "trimslice:green:left"; ++ gpios = <&gpio TEGRA_GPIO(BB, 5) GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ + poweroff { + compatible = "gpio-poweroff"; + gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>; From 4ff770e76353be65dec3677e73872342f5abfb88 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:08 +0200 Subject: [PATCH 05/14] tegra: 6.6: refresh config and patches Simple refresh to get rid of any fuzz and drop serial patch. With few bug fixes around tegra serial driver the spurious IRQ didn't appear any more during test. Let's see how long that'll last. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/config-6.6 | 93 +++++++++++++++---- ...interrupts-due-to-tegra2-silicon-bug.patch | 77 --------------- ...enable-front-panel-leds-in-TrimSlice.patch | 6 +- 3 files changed, 76 insertions(+), 100 deletions(-) delete mode 100644 target/linux/tegra/patches-6.6/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch diff --git a/target/linux/tegra/config-6.6 b/target/linux/tegra/config-6.6 index 1600dd7f21..4326326d3c 100644 --- a/target/linux/tegra/config-6.6 +++ b/target/linux/tegra/config-6.6 @@ -9,11 +9,11 @@ CONFIG_ARCH_MULTIPLATFORM=y CONFIG_ARCH_MULTI_V6_V7=y CONFIG_ARCH_MULTI_V7=y CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y -CONFIG_ARCH_NR_GPIO=1024 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_STACKWALK=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_TEGRA=y # CONFIG_ARCH_TEGRA_114_SOC is not set @@ -23,12 +23,11 @@ CONFIG_ARCH_TEGRA_2x_SOC=y CONFIG_ARM=y CONFIG_ARM_AMBA=y CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_CRYPTO=y CONFIG_ARM_ERRATA_720789=y CONFIG_ARM_ERRATA_754327=y CONFIG_ARM_ERRATA_764369=y CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HAS_GROUP_RELOCS=y CONFIG_ARM_HEAVY_MB=y CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y @@ -54,7 +53,11 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BOUNCE=y +CONFIG_BUFFER_HEAD=y CONFIG_CACHE_L2X0=y +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y @@ -70,7 +73,10 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set # CONFIG_CMA_SYSFS is not set CONFIG_COMMON_CLK=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CONTIG_ALLOC=y CONFIG_CPUFREQ_DT=y CONFIG_CPUFREQ_DT_PLATDEV=y @@ -97,6 +103,8 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_HAS_ASID=y CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_PABRT_V7=y CONFIG_CPU_PM=y CONFIG_CPU_RMAP=y @@ -117,10 +125,14 @@ CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y CONFIG_CRYPTO_ECHAINIV=y +CONFIG_CRYPTO_GENIV=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_GF128MUL=y +CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_LZ4=y CONFIG_CRYPTO_LZ4HC=y CONFIG_CRYPTO_LZO=y @@ -133,12 +145,16 @@ CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA1_ARM=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA256_ARM=y +CONFIG_CRYPTO_SHA3=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_SHA512_ARM=y CONFIG_CRYPTO_TWOFISH=y CONFIG_CRYPTO_TWOFISH_COMMON=y +CONFIG_CURRENT_POINTER_IN_TPIDRURO=y CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DDR=y CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" # CONFIG_DEVFREQ_GOV_PASSIVE is not set # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set @@ -152,11 +168,13 @@ CONFIG_DMA_CMA=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y CONFIG_DMA_SHARED_BUFFER=y CONFIG_DNOTIFY=y CONFIG_DRM=y CONFIG_DRM_BRIDGE=y +CONFIG_DRM_DISPLAY_DP_HELPER=y +CONFIG_DRM_DISPLAY_HDMI_HELPER=y +CONFIG_DRM_DISPLAY_HELPER=y CONFIG_DRM_DP_AUX_BUS=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 @@ -171,15 +189,16 @@ CONFIG_DRM_TEGRA=y CONFIG_DTC=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_EXT4_FS=y CONFIG_EXTCON=y CONFIG_F2FS_FS=y CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y +CONFIG_FB_CORE=y CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_DMAMEM_HELPERS=y +CONFIG_FB_SYSMEM_HELPERS=y +CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y CONFIG_FB_SYS_FOPS=y @@ -189,6 +208,9 @@ CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GCC10_NO_ARRAY_BOUNDS=y +CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y @@ -206,7 +228,6 @@ CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_PHY=y CONFIG_GENERIC_PINCONF=y @@ -222,19 +243,18 @@ CONFIG_GLOB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_CDEV=y CONFIG_GPIO_TEGRA=y -CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y CONFIG_HAS_IOPORT_MAP=y CONFIG_HAVE_SMP=y CONFIG_HDMI=y -CONFIG_HID=y -CONFIG_HIDRAW=y -CONFIG_HID_GENERIC=y CONFIG_HIGHMEM=y CONFIG_HIGHPTE=y +CONFIG_HOTPLUG_CORE_SYNC=y +CONFIG_HOTPLUG_CORE_SYNC_DEAD=y CONFIG_HOTPLUG_CPU=y CONFIG_HWMON=y CONFIG_HZ_FIXED=0 @@ -247,15 +267,20 @@ CONFIG_I2C_TEGRA=y CONFIG_INITRAMFS_SOURCE="" CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_VIVALDIFMAP=y CONFIG_INTERCONNECT=y +# CONFIG_IOMMUFD is not set CONFIG_IOMMU_API=y # CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set CONFIG_IOMMU_DEFAULT_DMA_STRICT=y +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set CONFIG_IOMMU_IOVA=y # CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y @@ -273,7 +298,6 @@ CONFIG_LZ4_COMPRESS=y CONFIG_LZ4_DECOMPRESS=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y -CONFIG_MEMFD_CREATE=y CONFIG_MEMORY=y CONFIG_MEMORY_ISOLATION=y # CONFIG_MFD_ACER_A500_EC is not set @@ -288,14 +312,19 @@ CONFIG_MMC_SDHCI_IO_ACCESSORS=y # CONFIG_MMC_SDHCI_PCI is not set CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SDHCI_TEGRA=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MPILIB=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_SRCU_NMI_SAFE=y # CONFIG_NEON is not set +CONFIG_NET_EGRESS=y CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_INGRESS=y +CONFIG_NET_XGRESS=y CONFIG_NLS=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y @@ -314,6 +343,10 @@ CONFIG_OUTER_CACHE=y CONFIG_OUTER_CACHE_SYNC=y CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y CONFIG_PCI=y CONFIG_PCIEAER=y CONFIG_PCIEASPM=y @@ -326,7 +359,6 @@ CONFIG_PCIE_PME=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCI_TEGRA=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 @@ -348,11 +380,13 @@ CONFIG_PM_OPP=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO=y CONFIG_POWER_SUPPLY=y +CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_PWM=y CONFIG_PWM_SYSFS=y CONFIG_PWM_TEGRA=y +CONFIG_RANDSTRUCT_NONE=y CONFIG_RAS=y CONFIG_RATIONAL=y CONFIG_REGMAP=y @@ -387,6 +421,7 @@ CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y CONFIG_SND=y +CONFIG_SND_AUDIO_GRAPH_CARD=y # CONFIG_SND_COMPRESS_OFFLOAD is not set CONFIG_SND_DMAENGINE_PCM=y # CONFIG_SND_DRIVERS is not set @@ -395,28 +430,41 @@ CONFIG_SND_JACK=y CONFIG_SND_JACK_INPUT_DEV=y # CONFIG_SND_PCI is not set CONFIG_SND_PCM=y +CONFIG_SND_PCM_ELD=y +CONFIG_SND_PCM_IEC958=y # CONFIG_SND_PROC_FS is not set CONFIG_SND_SIMPLE_CARD=y CONFIG_SND_SIMPLE_CARD_UTILS=y CONFIG_SND_SOC=y CONFIG_SND_SOC_AC97_BUS=y CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y +CONFIG_SND_SOC_HDMI_CODEC=y CONFIG_SND_SOC_I2C_AND_SPI=y CONFIG_SND_SOC_TEGRA=y +# CONFIG_SND_SOC_TEGRA186_ASRC is not set # CONFIG_SND_SOC_TEGRA186_DSPK is not set CONFIG_SND_SOC_TEGRA20_AC97=y CONFIG_SND_SOC_TEGRA20_DAS=y CONFIG_SND_SOC_TEGRA20_I2S=y CONFIG_SND_SOC_TEGRA20_SPDIF=y # CONFIG_SND_SOC_TEGRA210_ADMAIF is not set +# CONFIG_SND_SOC_TEGRA210_ADX is not set # CONFIG_SND_SOC_TEGRA210_AHUB is not set +# CONFIG_SND_SOC_TEGRA210_AMX is not set # CONFIG_SND_SOC_TEGRA210_DMIC is not set # CONFIG_SND_SOC_TEGRA210_I2S is not set +# CONFIG_SND_SOC_TEGRA210_MIXER is not set +# CONFIG_SND_SOC_TEGRA210_MVC is not set +# CONFIG_SND_SOC_TEGRA210_OPE is not set +# CONFIG_SND_SOC_TEGRA210_SFC is not set # CONFIG_SND_SOC_TEGRA30_AHUB is not set # CONFIG_SND_SOC_TEGRA30_I2S is not set # CONFIG_SND_SOC_TEGRA_ALC5632 is not set +# CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD is not set CONFIG_SND_SOC_TEGRA_MACHINE_DRV=y +# CONFIG_SND_SOC_TEGRA_MAX98088 is not set # CONFIG_SND_SOC_TEGRA_MAX98090 is not set +# CONFIG_SND_SOC_TEGRA_RT5631 is not set # CONFIG_SND_SOC_TEGRA_RT5640 is not set # CONFIG_SND_SOC_TEGRA_RT5677 is not set # CONFIG_SND_SOC_TEGRA_SGTL5000 is not set @@ -433,6 +481,7 @@ CONFIG_SOC_TEGRA20_VOLTAGE_COUPLER=y CONFIG_SOC_TEGRA_FLOWCTRL=y CONFIG_SOC_TEGRA_FUSE=y CONFIG_SOC_TEGRA_PMC=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_SOUND=y CONFIG_SOUND_OSS_CORE=y CONFIG_SOUND_OSS_CORE_PRECLAIM=y @@ -444,29 +493,33 @@ CONFIG_SPI_MEM=y CONFIG_SPI_TEGRA20_SFLASH=y CONFIG_SPI_TEGRA20_SLINK=y # CONFIG_SPI_TEGRA210_QUAD is not set -CONFIG_SRCU=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_SWP_EMULATE=y CONFIG_SYNC_FILE=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y +# CONFIG_TEGRA186_TIMER is not set CONFIG_TEGRA20_APB_DMA=y CONFIG_TEGRA20_EMC=y +# CONFIG_TEGRA210_ADMA is not set +# CONFIG_TEGRA_ACONNECT is not set CONFIG_TEGRA_AHB=y CONFIG_TEGRA_GMI=y CONFIG_TEGRA_HOST1X=y +CONFIG_TEGRA_HOST1X_CONTEXT_BUS=y CONFIG_TEGRA_HOST1X_FIREWALL=y CONFIG_TEGRA_IOMMU_GART=y # CONFIG_TEGRA_IOMMU_SMMU is not set # CONFIG_TEGRA_IVC is not set CONFIG_TEGRA_MC=y -# CONFIG_TEGRA_SOCTHERM is not set +CONFIG_TEGRA_SOCTHERM=y CONFIG_TEGRA_TIMER=y CONFIG_TEGRA_WATCHDOG=y +CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y -# CONFIG_UACCE is not set # CONFIG_UCLAMP_TASK is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y @@ -481,8 +534,6 @@ CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_HCD_PLATFORM is not set CONFIG_USB_EHCI_TEGRA=y CONFIG_USB_GADGET=y -CONFIG_USB_HID=y -CONFIG_USB_HIDDEV=y CONFIG_USB_PHY=y CONFIG_USB_ROLE_SWITCH=y CONFIG_USB_SUPPORT=y @@ -495,6 +546,8 @@ CONFIG_USB_ULPI_VIEWPORT=y CONFIG_USE_OF=y CONFIG_VFP=y CONFIG_VFPv3=y +CONFIG_VIDEO_CMDLINE=y +CONFIG_VIDEO_NOMODESET=y CONFIG_WATCHDOG_CORE=y # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set CONFIG_XPS=y diff --git a/target/linux/tegra/patches-6.6/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch b/target/linux/tegra/patches-6.6/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch deleted file mode 100644 index 8f01f73eb2..0000000000 --- a/target/linux/tegra/patches-6.6/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch +++ /dev/null @@ -1,77 +0,0 @@ -From patchwork Fri Jul 13 11:32:42 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: serial8250 on tegra hsuart: recover from spurious interrupts due to - tegra2 silicon bug -X-Patchwork-Submitter: "David R. Piegdon" -X-Patchwork-Id: 943440 -Message-Id: <4676ea34-69ce-5422-1ded-94218b89f7d9@p23q.org> -To: linux-tegra@vger.kernel.org -Date: Fri, 13 Jul 2018 11:32:42 +0000 -From: "David R. Piegdon" -List-Id: - -Hi, -a while back I sent a few mails regarding spurious interrupts in the -UARTA (hsuart) block of the Tegra2 SoC, when using the 8250 driver for -it instead of the hsuart driver. After going down a pretty deep -debugging/testing hole, I think I found a patch that fixes the issue. So -far testing in a reboot-cycle suggests that the error frequency dropped -from >3% of all reboots to at least <0.05% of all reboots. Tests -continue to run over the weekend. - -The patch below already is a second iteration; the first did not reset -the MCR or contain the lines below '// clear interrupts'. This resulted -in no more spurious interrupts, but in a few % of spurious interrupts -that were recovered the UART block did not receive any characters any -more. So further resetting was required to fully reacquire operational -state of the UART block. - -I'd love any comments/suggestions on this! - -Cheers, - -David - ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -134,6 +134,38 @@ static irqreturn_t serial8250_interrupt( - - if (l == i->head && pass_counter++ > PASS_LIMIT) - break; -+ -+#ifdef CONFIG_ARCH_TEGRA_2x_SOC -+ if (!handled && (port->type == PORT_TEGRA)) { -+ /* -+ * Fix Tegra 2 CPU silicon bug where sometimes -+ * "TX holding register empty" interrupts result in a -+ * bad (metastable?) state in Tegras HSUART IP core. -+ * Only way to recover seems to be to reset all -+ * interrupts as well as the TX queue and the MCR. -+ * But we don't want to loose any outgoing characters, -+ * so only do it if the RX and TX queues are empty. -+ */ -+ unsigned char lsr = port->serial_in(port, UART_LSR); -+ const unsigned char fifo_empty_mask = -+ (UART_LSR_TEMT | UART_LSR_THRE); -+ if (((lsr & (UART_LSR_DR | fifo_empty_mask)) == -+ fifo_empty_mask)) { -+ port->serial_out(port, UART_IER, 0); -+ port->serial_out(port, UART_MCR, 0); -+ serial8250_clear_and_reinit_fifos(up); -+ port->serial_out(port, UART_MCR, up->mcr); -+ port->serial_out(port, UART_IER, up->ier); -+ // clear interrupts -+ serial_port_in(port, UART_LSR); -+ serial_port_in(port, UART_RX); -+ serial_port_in(port, UART_IIR); -+ serial_port_in(port, UART_MSR); -+ up->lsr_saved_flags = 0; -+ up->msr_saved_flags = 0; -+ } -+ } -+#endif - } while (l != end); - - spin_unlock(&i->lock); diff --git a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch index b1e210b212..9ec7f8b839 100644 --- a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch +++ b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch @@ -1,5 +1,5 @@ ---- a/arch/arm/boot/dts/tegra20-trimslice.dts -+++ b/arch/arm/boot/dts/tegra20-trimslice.dts +--- a/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts ++++ b/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts @@ -201,16 +201,17 @@ conf_ata { nvidia,pins = "ata", "atc", "atd", "ate", @@ -23,7 +23,7 @@ nvidia,pull = ; nvidia,tristate = ; }; -@@ -396,6 +397,20 @@ +@@ -408,6 +409,20 @@ }; }; From 192ab0903fe77ada1c4d8cabd2d5105887df038b Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:09 +0200 Subject: [PATCH 06/14] tegra: add testing 6.6 kernel Preliminary support. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/Makefile | 1 + target/linux/tegra/image/Makefile | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target/linux/tegra/Makefile b/target/linux/tegra/Makefile index 43ca154e8a..3513e2751e 100644 --- a/target/linux/tegra/Makefile +++ b/target/linux/tegra/Makefile @@ -13,6 +13,7 @@ CPU_SUBTYPE := vfpv3-d16 SUBTARGETS := generic KERNEL_PATCHVER := 5.15 +KERNEL_TESTING_PATCHVER := 6.6 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index da0b3813bb..7103b6d36e 100644 --- a/target/linux/tegra/image/Makefile +++ b/target/linux/tegra/image/Makefile @@ -10,8 +10,8 @@ define Build/tegra-sdcard mkdir -p $@.boot $(CP) $(KDIR)/$(KERNEL_NAME) $@.boot $(if $(DEVICE_DTS),\ - $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \ - $(CP) $(DTS_DIR)/*.dtb $@.boot) + $(foreach dtb,$(DEVICE_DTS),$(CP) $(DEVICE_DTS_DIR)/$(dtb).dtb $@.boot), \ + $(CP) $(DEVICE_DTS_DIR)/*.dtb $@.boot) mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ -n '$(DEVICE_TITLE) OpenWrt bootscript' \ -d $(BOOT_SCRIPT) \ @@ -32,6 +32,11 @@ DEVICE_VARS += BOOT_SCRIPT UBOOT define Device/Default BOOT_SCRIPT := generic-bootscript +ifeq ($(KERNEL),6.6) + DEVICE_DTS_DIR := $$(DTS_DIR)/nvidia +else + DEVICE_DTS_DIR := $$(DTS_DIR) +endif IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := append-rootfs | pad-extra 128k | tegra-sdcard | gzip | append-metadata KERNEL_NAME := zImage From b1bddb1d355553527c12985ae4c048ffddacbd0d Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 29 May 2024 16:24:10 +0200 Subject: [PATCH 07/14] tegra: enable VDE driver Upstream commit 83b7f0b8aeab ("ARM: tegra: Add OPP tables and power domains to Tegra20 device-trees") added power domains to all devices supporting power management and one of them is Video Decoder Engine. Because of lacking driver for VDE, its power gate couldn't be driven which inhibited reboot of the whole device. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/config-6.6 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/target/linux/tegra/config-6.6 b/target/linux/tegra/config-6.6 index 4326326d3c..c3ffff01dc 100644 --- a/target/linux/tegra/config-6.6 +++ b/target/linux/tegra/config-6.6 @@ -298,6 +298,12 @@ CONFIG_LZ4_COMPRESS=y CONFIG_LZ4_DECOMPRESS=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_MEDIA_CONTROLLER_REQUEST_API=y +CONFIG_MEDIA_PLATFORM_DRIVERS=y +CONFIG_MEDIA_PLATFORM_SUPPORT=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEDIA_SUPPORT_FILTER=y CONFIG_MEMORY=y CONFIG_MEMORY_ISOLATION=y # CONFIG_MFD_ACER_A500_EC is not set @@ -494,6 +500,8 @@ CONFIG_SPI_TEGRA20_SFLASH=y CONFIG_SPI_TEGRA20_SLINK=y # CONFIG_SPI_TEGRA210_QUAD is not set CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y CONFIG_SWP_EMULATE=y CONFIG_SYNC_FILE=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -544,10 +552,22 @@ CONFIG_USB_ULPI_BUS=y CONFIG_USB_ULPI_VIEWPORT=y # CONFIG_USB_XHCI_TEGRA is not set CONFIG_USE_OF=y +CONFIG_V4L2_H264=y +CONFIG_V4L2_MEM2MEM_DEV=y +CONFIG_V4L_MEM2MEM_DRIVERS=y +CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VFP=y CONFIG_VFPv3=y +CONFIG_VIDEOBUF2_CORE=y +CONFIG_VIDEOBUF2_DMA_CONTIG=y +CONFIG_VIDEOBUF2_DMA_SG=y +CONFIG_VIDEOBUF2_MEMOPS=y +CONFIG_VIDEOBUF2_V4L2=y CONFIG_VIDEO_CMDLINE=y +CONFIG_VIDEO_DEV=y CONFIG_VIDEO_NOMODESET=y +CONFIG_VIDEO_TEGRA_VDE=y +CONFIG_VIDEO_V4L2_I2C=y CONFIG_WATCHDOG_CORE=y # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set CONFIG_XPS=y From a39d9693e66dea73d9753c7c0bae1378c2e97fed Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 31 May 2024 13:08:02 +0200 Subject: [PATCH 08/14] imagebuilder: fix broken IB_STANDALONE option Fix broken IB_STANDALONE option for OPKG due to an error in ifdef logic where we weren't adding the required entry to reference the local files in repositories.conf Rework the ifdef to more explicit and restore original functionality of this option. While at it also provide different README for APK or OPKG. Fixes: d788ab376f85 ("build: add APK package build capabilities") Link: https://github.com/openwrt/openwrt/pull/15599 Signed-off-by: Christian Marangi --- target/imagebuilder/Makefile | 11 ++++++++--- target/imagebuilder/files/README.apk.md | 10 ++++++++++ .../imagebuilder/files/{README.md => README.opkg.md} | 0 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 target/imagebuilder/files/README.apk.md rename target/imagebuilder/files/{README.md => README.opkg.md} (100%) diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index ef32d2cf7c..7fd2aa0920 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -43,24 +43,29 @@ $(BIN_DIR)/$(IB_NAME).tar.zst: clean $(INSTALL_DIR) $(PKG_BUILD_DIR)/packages -ifeq ($(CONFIG_IB_STANDALONE),) ifneq ($(CONFIG_USE_APK),) + ifeq ($(CONFIG_IB_STANDALONE),) $(call FeedSourcesAppendAPK,$(PKG_BUILD_DIR)/repositories) $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories + endif + + $(INSTALL_DATA) ./files/README.apk.md $(PKG_BUILD_DIR)/packages/README.md else + ifeq ($(CONFIG_IB_STANDALONE),) echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf $(call FeedSourcesAppendOPKG,$(PKG_BUILD_DIR)/repositories.conf) $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf + endif + # create an empty package index so `opkg` doesn't report an error touch $(PKG_BUILD_DIR)/packages/Packages - $(INSTALL_DATA) ./files/README.md $(PKG_BUILD_DIR)/packages/ + $(INSTALL_DATA) ./files/README.opkg.md $(PKG_BUILD_DIR)/packages/README.md echo '' >> $(PKG_BUILD_DIR)/repositories.conf echo '## This is the local package repository, do not remove!' >> $(PKG_BUILD_DIR)/repositories.conf echo 'src imagebuilder file:packages' >> $(PKG_BUILD_DIR)/repositories.conf endif -endif ifeq ($(CONFIG_BUILDBOT),) ifeq ($(CONFIG_IB_STANDALONE),) diff --git a/target/imagebuilder/files/README.apk.md b/target/imagebuilder/files/README.apk.md new file mode 100644 index 0000000000..e82a937e37 --- /dev/null +++ b/target/imagebuilder/files/README.apk.md @@ -0,0 +1,10 @@ +# ./packages folder + +Add `.apk` packages to this folder will allow the ImageBuilder to install them. + +For more complex setups consider adding a custom feed containing packages. + + file:///path/to/Packages.adb + +Whenever the ImageBuilder builds a firmware image this folder will be reloaded +and a new package index created. diff --git a/target/imagebuilder/files/README.md b/target/imagebuilder/files/README.opkg.md similarity index 100% rename from target/imagebuilder/files/README.md rename to target/imagebuilder/files/README.opkg.md From 37f20d8c34f04253037c03513e3a4d67b5f242da Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sun, 5 May 2024 03:42:44 -0400 Subject: [PATCH 09/14] tools/gnulib: unmangle fts header on macOS The gnulib fts header is meant to not be overwritten in any way by the host system's copy of fts.h and was therefore given a unique name instead. This is fine if the built libgnu library is directly linked with the target library, but if we want to keep them isolated we end up having the definitions being mangled anyway when the next object to link against included the fts.h header. On some macOS platforms, the use of __DARWIN_INODE64 is messing with the link name for fts functions, resulting in: Undefined symbols for architecture x86_64: "_rpl_fts_close$INODE64", referenced from: ... Create a local fts header for gnulib that completely blocks the macOS host fts header. An alternative and more upstream friendly fix would be to rename fts_.h to fts.h and add the macOS-only include guard to that file within it's own include guard, but that would be a massive patch, so do this for now. Tested-by: Georgi Valkov # macOS Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15368 Signed-off-by: Robert Marko --- .../patches/120-unmangle-darwin-fts-h.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/gnulib/patches/120-unmangle-darwin-fts-h.patch diff --git a/tools/gnulib/patches/120-unmangle-darwin-fts-h.patch b/tools/gnulib/patches/120-unmangle-darwin-fts-h.patch new file mode 100644 index 0000000000..19e46b9103 --- /dev/null +++ b/tools/gnulib/patches/120-unmangle-darwin-fts-h.patch @@ -0,0 +1,19 @@ +--- /dev/null ++++ b/lib/fts.h +@@ -0,0 +1,6 @@ ++#ifdef __APPLE__ ++# define _FTS_H_ 1 ++# include ++#else ++# include_next ++#endif +--- a/modules/fts ++++ b/modules/fts +@@ -2,6 +2,7 @@ Description: + Traverse a file hierarchy. + + Files: ++lib/fts.h + lib/fts_.h + lib/fts.c + lib/fts-cycle.c From 7822908bf313e1e0f1ae76d92588063160e94be2 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 1 May 2024 15:21:38 -0400 Subject: [PATCH 10/14] tools/elfutils: install a subset of the elfutils binaries Install binaries that are not common with binutils instead of none at all. This adds a negligible time to the build. Building shared libraries is disabled, so the AM_LDFLAGS can be reset without the rpath-link option which is unrecognized by clang. Some of the binaries depend on functions that are defined using a "strong alias" instead of a normal definition, but this is disabled by our patches in order to work on macOS, so use the identical function directly instead. Add fnmatch from gnulib with GNU extensions which is needed for usage of the FNM_EXTMATCH flag. Handle a "Wunused-const-variable" error with the same preprocessor conditional used to include the function that the variable is used in. Ref: f64bd4b6c ("tools/elfutils: only build required components") Tested-by: Georgi Valkov # macOS Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15368 Signed-off-by: Robert Marko --- tools/elfutils/Makefile | 10 ++++- tools/elfutils/patches/100-portability.patch | 43 ++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index 466fc31271..b66d064e2b 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -17,6 +17,8 @@ PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils PKG_FIXUP:=autoreconf PKG_INSTALL:=1 +PKG_PROGRAMS:=elflint findtextrel elfcmp unstrip stack elfcompress elfclassify srcfiles + PKG_SUBDIRS := \ libgnu \ config \ @@ -27,7 +29,8 @@ PKG_SUBDIRS := \ libebl \ libdwelf \ libdwfl \ - libdw + libdw \ + src PKG_GNULIB_BASE:=libgnu @@ -41,6 +44,7 @@ PKG_GNULIB_ARGS = \ PKG_GNULIB_MODS = \ argp \ + fnmatch-gnu \ fts \ obstack \ progname \ @@ -49,6 +53,10 @@ PKG_GNULIB_MODS = \ include $(INCLUDE_DIR)/host-build.mk +HOST_MAKE_FLAGS += \ + AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \ + bin_PROGRAMS='$(PKG_PROGRAMS)' EXEEXT= + ifeq ($(HOST_OS),Darwin) HOST_CFLAGS += -I/opt/homebrew/include endif diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch index 6f7564731b..980b117f21 100644 --- a/tools/elfutils/patches/100-portability.patch +++ b/tools/elfutils/patches/100-portability.patch @@ -898,3 +898,46 @@ #include +--- a/libebl/eblopenbackend.c ++++ b/libebl/eblopenbackend.c +@@ -198,8 +198,6 @@ static bool default_object_note (const c + uint32_t descsz, const char *desc); + static bool default_debugscn_p (const char *name); + static bool default_copy_reloc_p (int reloc); +-static bool default_none_reloc_p (int reloc); +-static bool default_relative_reloc_p (int reloc); + static bool default_check_special_symbol (Elf *elf, + const GElf_Sym *sym, + const char *name, +@@ -251,8 +249,8 @@ fill_defaults (Ebl *result) + result->object_note = default_object_note; + result->debugscn_p = default_debugscn_p; + result->copy_reloc_p = default_copy_reloc_p; +- result->none_reloc_p = default_none_reloc_p; +- result->relative_reloc_p = default_relative_reloc_p; ++ result->none_reloc_p = default_copy_reloc_p; ++ result->relative_reloc_p = default_copy_reloc_p; + result->check_special_symbol = default_check_special_symbol; + result->data_marker_symbol = default_data_marker_symbol; + result->check_st_other_bits = default_check_st_other_bits; +@@ -634,8 +632,6 @@ default_copy_reloc_p (int reloc __attrib + { + return false; + } +-strong_alias (default_copy_reloc_p, default_none_reloc_p) +-strong_alias (default_copy_reloc_p, default_relative_reloc_p) + + static bool + default_check_special_symbol (Elf *elf __attribute__ ((unused)), +--- a/src/srcfiles.cxx ++++ b/src/srcfiles.cxx +@@ -78,7 +78,9 @@ ARGP_PROGRAM_VERSION_HOOK_DEF = print_ve + /* Bug report address. */ + ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT; + ++#ifdef HAVE_LIBARCHIVE + constexpr size_t BUFFER_SIZE = 8192; ++#endif + + /* Definitions of arguments for argp functions. */ + static const struct argp_option options[] = From 5f47ccc0ea596248fdb458b933ef8a406f574f8a Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 1 May 2024 17:47:26 -0400 Subject: [PATCH 11/14] tools/elfutils: do not directly link gnulib to libelf The compiled library resulting from importing gnulib has been linked to libelf in order to easily cover other link dependencies. However, this is not appropriate for linking libelf to other programs as it bloats the resulting libelf library, and may result in multiple defintions of symbols based on whether or not certain modules from gnulib are included while elfutils already has it's own definition of a function. This is not a problem while building elfutils, because gnulib has it's own way of creating function aliases and special declarations that allow the linker to ignore the original function definitions, however, when libelf is used to link to something else, this results in an error at link time. The gnulib manual recommended linking the libraries directly, but those who have written it may not have considered how this can affect the ability to link that library in other builds, they likely assume the build targets would not be a dependency. Fix this by removing the linking between gnulib and libelf and instead overriding Make variables in order to add linking between gnulib and each of the binaries provided by elfutils, using Make functions to avoid applying it to other subdirectories. The function tdestroy() would still be missing on macOS, but the existence of the gnulib tsearch object having been built is an indicator of whether or not it is needed because it is only built conditionally by gnulib, so include linking that object only when it exists. Block the unnecessary replacement of some functions by gnulib so that future linking with libelf doesn't require the associated gnulib "rpl" prefixed functions. These replacements are very strict in order to correct minor bugs that don't have a real impact in almost all cases or new standards requirements that are not yet in effect or used. Tested-by: Georgi Valkov # macOS Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15368 Signed-off-by: Robert Marko --- tools/elfutils/Makefile | 6 ++++++ tools/elfutils/patches/100-portability.patch | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index b66d064e2b..39e7f80b4a 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -53,8 +53,14 @@ PKG_GNULIB_MODS = \ include $(INCLUDE_DIR)/host-build.mk +export $(PKG_GNULIB_BASE)=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE).la +export $(PKG_GNULIB_BASE)_tsearch=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-tsearch.lo + HOST_MAKE_FLAGS += \ AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \ + LIBS+='$$$$(if $$$$(findstring $(lastword $(PKG_SUBDIRS)),$$$$(subdir)), $$$$($(PKG_GNULIB_BASE)))' \ + LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_tsearch))' \ + REPLACE_FCNTL=0 REPLACE_FREE=0 REPLACE_FSTAT=0 REPLACE_OPEN=0 \ bin_PROGRAMS='$(PKG_PROGRAMS)' EXEEXT= ifeq ($(HOST_OS),Darwin) diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch index 980b117f21..09ee8daf1f 100644 --- a/tools/elfutils/patches/100-portability.patch +++ b/tools/elfutils/patches/100-portability.patch @@ -198,7 +198,7 @@ pkginclude_HEADERS = elf-knowledge.h -libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ -+libelf_la_LIBADD = ../libgnu/libgnu.la ../lib/libeu.la -lz $(zstd_LIBS) -lpthread ++libelf_la_LIBADD = ../lib/libeu.la -lz $(zstd_LIBS) -lpthread +libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c \ elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ gelf_getclass.c elf_getbase.c elf_getident.c \ From 4454361e54b749bdc0b524092aea2366b5d5ed98 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 31 May 2024 15:47:15 +0200 Subject: [PATCH 12/14] tools/elfutils: pass -O2 in HOST_CXXFLAGS Trying to compile elfutils on Fedora 40 with GCC 14.1.1 will fail with: /home/robimarko/Building/AX3600/qualcommax/staging_dir/host/bin/g++ -std=c++11 -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/home/robimarko/Building/AX3600/qualcommax/staging_dir/host/share/locale"' -DDEBUGPRED=0 -DSRCDIR=\"/home/robimarko/Building/AX3600/qualcommax/build_dir/host/elfutils-0.191/src\" -DOBJDIR=\"/home/robimarko/Building/AX3600/qualcommax/build_dir/host/elfutils-0.191/src\" -I. -I.. -I../libgnu -I../libgnu -I. -I. -I../lib -I.. -I./../libelf -I./../libebl -I./../libdw -I./../libdwelf -I./../libdwfl -I./../libasm -I../debuginfod -I/home/robimarko/Building/AX3600/qualcommax/staging_dir/host/include -std=c++11 -Wall -Wshadow -Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference -Wimplicit-fallthrough=5 -Werror -Wunused -Wextra -Wstack-usage=262144 -D_FORTIFY_SOURCE=3 -c -o srcfiles.o srcfiles.cxx In file included from /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h:39, from /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h:2521, from /usr/include/c++/14/cstdlib:41, from ../libgnu/gettext.h:56, from ../libgnu/eu-config.h:62, from ../config.h:2378, from srcfiles.cxx:31: /usr/include/features.h:414:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] 414 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ^~~~~~~ cc1plus: all warnings being treated as errors So, lets do as the error says and pass -O2 in HOST_CXXFLAGS like we already do by default in HOST_CFLAGS. Link: https://github.com/openwrt/openwrt/pull/15368 Signed-off-by: Robert Marko --- tools/elfutils/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index 39e7f80b4a..0fbf1aedad 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -68,6 +68,7 @@ ifeq ($(HOST_OS),Darwin) endif HOST_CFLAGS += -Wno-error -fPIC +HOST_CXXFLAGS += -O2 HOST_CONFIGURE_ARGS += \ --without-libintl-prefix \ From ab9bb79d8e30a574c7628c73c4522429805d9307 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Thu, 30 May 2024 23:07:22 -0700 Subject: [PATCH 13/14] build: add option KERNEL_DEBUG_INFO_BTF_MODULES The recent kernel v6.6.31 update broke BTF-enabled builds since upstream Linux added a prompt for config option DEBUG_INFO_BTF_MODULES in commit 2166cb2e21 ("bpf, kconfig: Fix DEBUG_INFO_BTF_MODULES Kconfig definition"). Fix by updating Config-kernel.in to add the option, cleaning up a related dependency and whitespace also. Fixes: 10d77b9bc3 ("kernel: bump 6.6 to 6.6.31") Signed-off-by: Tony Ambardar --- config/Config-kernel.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 0acd320504..2d90abcfe8 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -435,7 +435,6 @@ config KERNEL_DEBUG_INFO This will compile your kernel and modules with debug information. config KERNEL_DEBUG_INFO_BTF - bool "Enable additional BTF type information" depends on !HOST_OS_MACOS depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED @@ -447,9 +446,13 @@ config KERNEL_DEBUG_INFO_BTF Required to run BPF CO-RE applications. +config KERNEL_DEBUG_INFO_BTF_MODULES + def_bool y + depends on KERNEL_DEBUG_INFO_BTF + config KERNEL_MODULE_ALLOW_BTF_MISMATCH bool "Allow loading modules with non-matching BTF type info" - depends on KERNEL_DEBUG_INFO_BTF + depends on KERNEL_DEBUG_INFO_BTF_MODULES help For modules whose split BTF does not match vmlinux, load without BTF rather than refusing to load. The default behavior with From 8619d7af67c28ff974373c9a2937da1025cd81e5 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Fri, 5 Jan 2024 18:42:53 +0100 Subject: [PATCH 14/14] kirkwood: add D-Link DNS-320L support Dual-slot NAS based on Marvell Kirkwood. Specifications: - Marvell 88F6702 @1GHz - 256Mb RAM - 128Mb NAND - 1x GbE LAN (Marvell 88E1318R) - 1x USB 2.0 - 2x SATA - Weltrend WT69P3 ("supervisor" MCU chip) - Serial on J2 (115200,8n1) - Newer bootROM so kwboot-ing via serial is possible Notes: - The Weltrend MCU is controlled by the package added in utils/dns320l-mcu. - The original MAC address is stored in the "mini firmware" image's first 17 bytes. - Compared to the original MTD layout, the uImage+rootfs are now stored in a common ubi partition. Installation: 1. Serial console - Connect your levelshifter to the serial console on J2 (refer to the wiki page for pinout) 2. Update u-boot - Download the u-boot.kwb image for the device - Powercycle the NAS - Run "kwboot -b u-boot-dns320l/u-boot.kwb /dev/ttyUSB0 -p" - Connect to the serial console with minicom - tftp 0x0800000 u-boot-dns320l/u-boot.kwb (Please note that "PHY reset timed out" seems to be customary on kirkwood devices, the egiga0 interface works regardless.) - nand erase 0x0 100000 - nand write 0x0800000 0x0 0x100000 - reset 3. Install OpenWrt - Boot up the initramfs image - tftpboot 0x800000 openwrt-kirkwood-generic-dlink_dns320l-initramfs-uImage; bootm 0x800000 - Download the sysupgrade image and perform sysupgrade Signed-off-by: Zoltan HERPAI Reviewed-by: Pawel Dembicki --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/kirkwood | 1 + package/boot/uboot-kirkwood/Makefile | 8 +- .../uboot-kirkwood/patches/190-dns-320l.patch | 387 ++++++++++++++++++ package/utils/dns320l-mcu/Makefile | 36 ++ .../utils/dns320l-mcu/files/dns320l-mcu.init | 14 + .../base-files/etc/board.d/02_network | 4 + .../arch/arm/boot/dts/kirkwood-dns320l.dts | 202 +++++++++ .../arm/boot/dts/marvell/kirkwood-dns320l.dts | 202 +++++++++ target/linux/kirkwood/image/Makefile | 8 + .../kirkwood/patches-6.1/118-dns-320l.patch | 35 ++ .../kirkwood/patches-6.6/118-dns-320l.patch | 35 ++ 12 files changed, 932 insertions(+), 2 deletions(-) create mode 100644 package/boot/uboot-kirkwood/patches/190-dns-320l.patch create mode 100644 package/utils/dns320l-mcu/Makefile create mode 100644 package/utils/dns320l-mcu/files/dns320l-mcu.init create mode 100644 target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts create mode 100644 target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts create mode 100644 target/linux/kirkwood/patches-6.1/118-dns-320l.patch create mode 100644 target/linux/kirkwood/patches-6.6/118-dns-320l.patch diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 00aa424162..d4446167b7 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2024.01 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 1b07640cd3..b6b483ac4f 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -15,6 +15,7 @@ case "$board" in checkpoint,l-50|\ cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ +dlink,dns320l|\ globalscale,sheevaplug|\ iom,ix2-200|\ iom,ix4-200d|\ diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 92a814ac4f..7338e5d868 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_VERSION:=2020.04 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 @@ -20,6 +20,11 @@ define U-Boot/Default BUILD_SUBTARGET:=generic endef +define U-Boot/dns320l + NAME:=D-Link DNS-320L + BUILD_DEVICES:=dlink_dns320l +endef + define U-Boot/dockstar NAME:=Seagate DockStar BUILD_DEVICES:=seagate_dockstar @@ -106,6 +111,7 @@ define U-Boot/sheevaplug endef UBOOT_TARGETS := \ + dns320l \ dockstar dockstar_second_stage \ goflexhome \ ib62x0 ib62x0_second_stage \ diff --git a/package/boot/uboot-kirkwood/patches/190-dns-320l.patch b/package/boot/uboot-kirkwood/patches/190-dns-320l.patch new file mode 100644 index 0000000000..3cf642e174 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/190-dns-320l.patch @@ -0,0 +1,387 @@ +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -28,6 +28,9 @@ config TARGET_POGO_E02 + config TARGET_POGOPLUGV4 + bool "Pogoplug V4 Board" + ++config TARGET_DNS320L ++ bool "dns320l Board" ++ + config TARGET_DNS325 + bool "dns325 Board" + +@@ -93,6 +96,7 @@ source "board/Marvell/sheevaplug/Kconfig + source "board/buffalo/lsxl/Kconfig" + source "board/cloudengines/pogo_e02/Kconfig" + source "board/cloudengines/pogoplugv4/Kconfig" ++source "board/d-link/dns320l/Kconfig" + source "board/d-link/dns325/Kconfig" + source "board/iomega/iconnect/Kconfig" + source "board/keymile/Kconfig" +--- /dev/null ++++ b/board/d-link/dns320l/dns320l.c +@@ -0,0 +1,113 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2015 ++ * Gerald Kerma ++ * Tony Dinh ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "dns320l.h" ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* ++ * default gpio configuration ++ * There are maximum 64 gpios controlled through 2 sets of registers ++ * the below configuration configures mainly initial LED status ++ */ ++ mvebu_config_gpio(DNS320L_OE_VAL_LOW, DNS320L_OE_VAL_HIGH, ++ DNS320L_OE_LOW, DNS320L_OE_HIGH); ++ ++ /* (all LEDs & power off active high) */ ++ /* Multi-Purpose Pins Functionality configuration */ ++ static const u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW_SDA, ++ MPP9_TW_SCK, ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, ++ MPP13_GPIO, ++ MPP14_GPIO, ++ MPP15_GPIO, ++ MPP16_GPIO, ++ MPP17_GPIO, ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_SATA1_ACTn, /* sata1(left) status led */ ++ MPP21_SATA0_ACTn, /* sata0(right) status led */ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, ++ MPP29_GPIO, ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ ++ kw_gpio_set_value(DNS320L_GPIO_SATA_EN , 1); ++ ++ return 0; ++} ++ ++int board_init(void) ++{ ++ /* address of boot parameters */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and initialize PHY */ ++void reset_phy(void) ++{ ++ u16 reg; ++ u16 phyaddr; ++ char *name = "egiga0"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* read PHY dev address */ ++ if (miiphy_read(name, 0xee, 0xee, (u16 *) &phyaddr)) { ++ printf("could not read PHY dev address\n"); ++ return; ++ } ++ ++ /* set RGMII delay */ ++ miiphy_write(name, phyaddr, MV88E1318_PGADR_REG, MV88E1318_MAC_CTRL_PG); ++ miiphy_read(name, phyaddr, MV88E1318_MAC_CTRL_REG, ®); ++ reg |= (MV88E1318_RGMII_RX_CTRL | MV88E1318_RGMII_TX_CTRL); ++ miiphy_write(name, phyaddr, MV88E1318_MAC_CTRL_REG, reg); ++ miiphy_write(name, phyaddr, MV88E1318_PGADR_REG, 0); ++ ++ /* reset PHY */ ++ if (miiphy_reset(name, phyaddr)) ++ return; ++ ++ printf("MV88E1318 PHY initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ +--- /dev/null ++++ b/board/d-link/dns320l/dns320l.h +@@ -0,0 +1,39 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2011 ++ * Stefan Herbrechtsmeier ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef __DNS320L_H ++#define __DNS320L_H ++ ++/* GPIO configuration */ ++#define DNS320L_GPIO_SATA_EN 24 ++#define HDD_L_GREEN_LED (1 << 22) ++#define HDD_R_GREEN_LED (1 << 23) ++#define USB_BLUE_LED (1 << 25) ++#define USB_ORANGE_LED (1 << 26) ++ ++#define DNS320L_OE_LOW (~(HDD_L_GREEN_LED | HDD_R_GREEN_LED | \ ++ USB_BLUE_LED | USB_ORANGE_LED)) ++#define DNS320L_OE_VAL_LOW (0) ++ ++/* high GPIO's */ ++#define WATCHDOG_SIGNAL (1 << 14) ++ ++#define DNS320L_OE_HIGH (~(WATCHDOG_SIGNAL)) ++#define DNS320L_OE_VAL_HIGH ((WATCHDOG_SIGNAL)) ++ ++/* PHY related */ ++#define MV88E1318_PGADR_REG 22 ++#define MV88E1318_MAC_CTRL_PG 2 ++#define MV88E1318_MAC_CTRL_REG 21 ++#define MV88E1318_RGMII_TX_CTRL (1 << 4) ++#define MV88E1318_RGMII_RX_CTRL (1 << 5) ++ ++#endif /* __DNS320L_H */ +--- /dev/null ++++ b/board/d-link/dns320l/Kconfig +@@ -0,0 +1,18 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (C) 2015 ++# Gerald Kerma ++# Tony Dinh ++ ++if TARGET_DNS320L ++ ++config SYS_BOARD ++ default "dns320l" ++ ++config SYS_VENDOR ++ default "d-link" ++ ++config SYS_CONFIG_NAME ++ default "dns320l" ++ ++endif +--- /dev/null ++++ b/board/d-link/dns320l/kwbimage.cfg +@@ -0,0 +1,41 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (C) 2015 ++# Gerald Kerma ++# Tony Dinh ++# Refer to doc/README.kwbimage for more details about how-to ++# configure and create kirkwood boot images. ++# ++ ++# Boot Media configurations ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++# Configure RGMII-0 interface pad voltage to 1.8V ++DATA 0xFFD100e0 0x1b1b1b9b ++ ++DATA 0xFFD01400 0x43010c30 ++DATA 0xFFD01404 0x39543000 ++DATA 0xFFD01408 0x22125451 ++DATA 0xFFD0140C 0x00000833 ++DATA 0xFFD01410 0x0000000C ++DATA 0xFFD01414 0x00000000 ++DATA 0xFFD01418 0x00000000 ++DATA 0xFFD0141C 0x00000652 ++DATA 0xFFD01420 0x00000004 ++DATA 0xFFD01424 0x0000F17F ++DATA 0xFFD01428 0x00085520 ++DATA 0xFFD0147c 0x00008552 ++DATA 0xFFD01504 0x0FFFFFF1 ++DATA 0xFFD01508 0x10000000 ++DATA 0xFFD0150C 0x00000000 ++DATA 0xFFD01514 0x00000000 ++DATA 0xFFD0151C 0x00000000 ++DATA 0xFFD01494 0x00010000 ++DATA 0xFFD01498 0x00000000 ++DATA 0xFFD0149C 0x0000E403 ++DATA 0xFFD01480 0x00000001 ++DATA 0xFFD20134 0x66666666 ++DATA 0xFFD20138 0x66666666 ++DATA 0x0 0x0 +--- /dev/null ++++ b/board/d-link/dns320l/MAINTAINERS +@@ -0,0 +1,8 @@ ++NSA310S BOARD ++M: Gerald Kerma ++M: Tony Dinh ++M: Luka Perkov ++S: Maintained ++F: board/d-link/dns320l/ ++F: include/configs/dns320l.h ++F: configs/dns320l_defconfig +--- /dev/null ++++ b/board/d-link/dns320l/Makefile +@@ -0,0 +1,7 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (C) 2015 ++# Gerald Kerma ++# Tony Dinh ++ ++obj-y := dns320l.o +--- /dev/null ++++ b/configs/dns320l_defconfig +@@ -0,0 +1,48 @@ ++CONFIG_ARM=y ++CONFIG_SYS_DCACHE_OFF=y ++CONFIG_ARCH_CPU_INIT=y ++CONFIG_KIRKWOOD=y ++CONFIG_SYS_TEXT_BASE=0x600000 ++CONFIG_TARGET_DNS320L=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x100000 ++CONFIG_NR_DRAM_BANKS=2 ++CONFIG_BOOTDELAY=3 ++CONFIG_USE_PREBOOT=y ++# CONFIG_DISPLAY_BOARDINFO is not set ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="dns320l => " ++CONFIG_CMD_BOOTZ=y ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_IDE=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x100000@0x0(uboot),0x20000@0x100000(ubootenv),0x6de0000@0x120000(ubi),0xa00000@0x6f00000(mini),0x500000@0x7900000(config),0x200000@0x7e00000(my-dlink)" ++CONFIG_CMD_UBI=y ++CONFIG_ISO_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_MVSATA_IDE=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_MTD_RAW_NAND=y ++CONFIG_MVGBE=y ++CONFIG_MII=y ++CONFIG_SYS_NS16550=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y ++CONFIG_OF_LIBFDT=y ++CONFIG_NET_RANDOM_ETHADDR=y +--- /dev/null ++++ b/include/configs/dns320l.h +@@ -0,0 +1,69 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2015 ++ * Gerald Kerma ++ * Tony Dinh ++ * Luka Perkov ++ */ ++ ++#ifndef _CONFIG_DNS320L_H ++#define _CONFIG_DNS320L_H ++ ++/* high level configuration options */ ++#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ ++#define CONFIG_KW88F6192 1 /* SOC Name */ ++#define CONFIG_KW88F6702 1 /* SOC Name */ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* compression configuration */ ++#define CONFIG_BZIP2 ++ ++/* commands configuration */ ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* environment variables configuration */ ++ ++/* default environment variables */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "console=console=ttyS0,115200\0" \ ++ "mtdids=nand0=orion_nand\0" \ ++ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \ ++ "bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0" ++ ++/* Ethernet driver configuration */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_NETCONSOLE ++#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 1 ++#define CONFIG_RESET_PHY_R ++#endif /* CONFIG_CMD_NET */ ++ ++/* SATA driver configuration */ ++#ifdef CONFIG_IDE ++#define __io ++#define CONFIG_IDE_PREINIT ++#define CONFIG_MVSATA_IDE_USE_PORT0 ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#endif /* CONFIG_IDE */ ++ ++/* ++ * Enable GPI0 support ++*/ ++#define CONFIG_KIRKWOOD_GPIO ++ ++/* RTC driver configuration */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#endif /* CONFIG_CMD_DATE */ ++ ++#endif /* _CONFIG_DNS320L_H */ diff --git a/package/utils/dns320l-mcu/Makefile b/package/utils/dns320l-mcu/Makefile new file mode 100644 index 0000000000..724a664a8b --- /dev/null +++ b/package/utils/dns320l-mcu/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=dns320l-mcu +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/wigyori/dns320l-daemon.git +PKG_SOURCE_DATE:=2024-05-11 +PKG_SOURCE_VERSION:=c74941880e0a8d2bc0344b3256b984397512e8c3 +PKG_MIRROR_HASH:=e0f186a0c139ccfac3d311f49e2fecdbd02fa3f9fe6ced4b1ce0baa603d49fc3 +PKG_MAINTAINER:=Zoltan HERPAI +PKG_LICENSE:=GPL-3.0+ + +include $(INCLUDE_DIR)/package.mk + +define Package/dns320l-mcu + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Utility to control the MCU on DNS-320L + DEPENDS:=@TARGET_kirkwood + URL:=https://github.com/wigyori/dns320l-mcu +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -Wall" +endef + +define Package/dns320l-mcu/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d + $(INSTALL_BIN) ./files/dns320l-mcu.init $(1)/etc/init.d/dns320l-mcu + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dns320l-daemon $(1)/usr/bin/dns320l-mcu +endef + +$(eval $(call BuildPackage,dns320l-mcu)) diff --git a/package/utils/dns320l-mcu/files/dns320l-mcu.init b/package/utils/dns320l-mcu/files/dns320l-mcu.init new file mode 100644 index 0000000000..eb1c579907 --- /dev/null +++ b/package/utils/dns320l-mcu/files/dns320l-mcu.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2024 OpenWrt.org + +START=99 + +USE_PROCD=1 +PROG=/usr/bin/dns320l-mcu + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_close_instance +} diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index 3ed2fa94b0..ff7897fe13 100644 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -19,6 +19,7 @@ kirkwood_setup_interfaces() cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ ctera,c200-v1|\ + dlink,dns320l|\ globalscale,sheevaplug|\ iom,iconnect-1.1|\ iom,ix2-200|\ @@ -60,6 +61,9 @@ kirkwood_setup_macs() local label_mac="" case "$board" in + dlink,dns320l) + lan_mac=$(mtd_get_mac_text "mini firmware") + ;; iptime,nas1) lan_mac=$(mtd_get_mac_binary u-boot 0x3ffa8) label_mac=$lan_mac diff --git a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts new file mode 100644 index 0000000000..bd86c04ea7 --- /dev/null +++ b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Device Tree file for DLINK DNS-320L + * + * Copyright (C) 2024, Zoltan HERPAI + * Copyright (C) 2015, Sunke Schlüters + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * This file is based on the works of: + * - Sunke Schlüters + * - https://github.com/scus1/dns320l/blob/master/kernel/dts/kirkwood-dns320l.dts + * - Andreas Böhler : + * - http://www.aboehler.at/doku/doku.php/projects:dns320l + * - http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "D-Link DNS-320L"; + compatible = "dlink,dns320l", "marvell,kirkwood-88f6702", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_buttons>; + pinctrl-names = "default"; + + button@1 { + label = "Reset push button"; + linux,code = ; + gpios = <&gpio0 28 1>; + }; + + button@2 { + label = "USB unmount button"; + linux,code = ; + gpios = <&gpio0 27 1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&pmx_leds>; + pinctrl-names = "default"; + + blue-usb { + label = "dns320l:usb:blue"; + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + }; + + orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + orange-l-hdd { + label = "dns320l:orange:l_hdd"; + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; + }; + + orange-r-hdd { + label = "dns320l:orange:r_hdd"; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + serial@12000 { + status = "okay"; + }; + + serial@12100 { + pinctrl-0 = <&pmx_uart1>; + pinctrl-names = "default"; + status = "okay"; + }; + }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_power_sata>; + pinctrl-names = "default"; + + sata_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "SATA Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 24 0>; + }; + }; +}; + +&nand { + pinctrl-0 = <&pmx_nand>; + pinctrl-names = "default"; + chip-delay = <40>; + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x100000>; + }; + + partition@100000 { + label = "ubootenv"; + reg = <0x100000 0x20000>; + }; + + partition@120000 { + label = "ubi"; + reg = <0x120000 0x6de0000>; + }; + + partition@6f00000 { + label = "mini firmware"; + reg = <0x6f00000 0xa00000>; + }; + + partition@7900000 { + label = "config"; + reg = <0x7900000 0x500000>; + }; + + partition@7e00000 { + label = "my-dlink"; + reg = <0x7e00000 0x200000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&pinctrl { + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp20"; + marvell,function = "sata1"; + }; + + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp21"; + marvell,function = "sata0"; + }; + + pmx_power_sata: pmx-power-sata { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + pmx_leds: pmx-leds { + marvell,pins = "mpp22", "mpp23", "mpp25", "mpp26"; + marvell,function = "gpio"; + }; + + pmx_buttons: pmx-buttons { + marvell,pins = "mpp27", "mpp28", "mpp29"; + marvell,function = "gpio"; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; diff --git a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts new file mode 100644 index 0000000000..bd86c04ea7 --- /dev/null +++ b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Device Tree file for DLINK DNS-320L + * + * Copyright (C) 2024, Zoltan HERPAI + * Copyright (C) 2015, Sunke Schlüters + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * This file is based on the works of: + * - Sunke Schlüters + * - https://github.com/scus1/dns320l/blob/master/kernel/dts/kirkwood-dns320l.dts + * - Andreas Böhler : + * - http://www.aboehler.at/doku/doku.php/projects:dns320l + * - http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "D-Link DNS-320L"; + compatible = "dlink,dns320l", "marvell,kirkwood-88f6702", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_buttons>; + pinctrl-names = "default"; + + button@1 { + label = "Reset push button"; + linux,code = ; + gpios = <&gpio0 28 1>; + }; + + button@2 { + label = "USB unmount button"; + linux,code = ; + gpios = <&gpio0 27 1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&pmx_leds>; + pinctrl-names = "default"; + + blue-usb { + label = "dns320l:usb:blue"; + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + }; + + orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + orange-l-hdd { + label = "dns320l:orange:l_hdd"; + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; + }; + + orange-r-hdd { + label = "dns320l:orange:r_hdd"; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + serial@12000 { + status = "okay"; + }; + + serial@12100 { + pinctrl-0 = <&pmx_uart1>; + pinctrl-names = "default"; + status = "okay"; + }; + }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_power_sata>; + pinctrl-names = "default"; + + sata_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "SATA Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 24 0>; + }; + }; +}; + +&nand { + pinctrl-0 = <&pmx_nand>; + pinctrl-names = "default"; + chip-delay = <40>; + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x100000>; + }; + + partition@100000 { + label = "ubootenv"; + reg = <0x100000 0x20000>; + }; + + partition@120000 { + label = "ubi"; + reg = <0x120000 0x6de0000>; + }; + + partition@6f00000 { + label = "mini firmware"; + reg = <0x6f00000 0xa00000>; + }; + + partition@7900000 { + label = "config"; + reg = <0x7900000 0x500000>; + }; + + partition@7e00000 { + label = "my-dlink"; + reg = <0x7e00000 0x200000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&pinctrl { + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp20"; + marvell,function = "sata1"; + }; + + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp21"; + marvell,function = "sata0"; + }; + + pmx_power_sata: pmx-power-sata { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + pmx_leds: pmx-leds { + marvell,pins = "mpp22", "mpp23", "mpp25", "mpp26"; + marvell,function = "gpio"; + }; + + pmx_buttons: pmx-buttons { + marvell,pins = "mpp27", "mpp28", "mpp29"; + marvell,function = "gpio"; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index cc13648890..48de5bee2b 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -182,6 +182,14 @@ define Device/ctera_c200-v1 endef TARGET_DEVICES += ctera_c200-v1 +define Device/dlink_dns320l + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DNS-320L + DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-gpio-button-hotplug \ + kmod-usb-storage kmod-usb-ledtrig-usbport dns320l-mcu +endef +TARGET_DEVICES += dlink_dns320l + define Device/endian_4i-edge-200 DEVICE_VENDOR := Endian DEVICE_MODEL := 4i Edge 200 diff --git a/target/linux/kirkwood/patches-6.1/118-dns-320l.patch b/target/linux/kirkwood/patches-6.1/118-dns-320l.patch new file mode 100644 index 0000000000..d6c84e2c59 --- /dev/null +++ b/target/linux/kirkwood/patches-6.1/118-dns-320l.patch @@ -0,0 +1,35 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-db-88f6282.dtb \ + kirkwood-dir665.dtb \ + kirkwood-dns320.dtb \ ++ kirkwood-dns320l.dtb \ + kirkwood-dns325.dtb \ + kirkwood-dockstar.dtb \ + kirkwood-dreamplug.dtb \ +--- a/arch/arm/boot/dts/kirkwood-dns320l.dts ++++ b/arch/arm/boot/dts/kirkwood-dns320l.dts +@@ -32,6 +32,13 @@ + reg = <0x00000000 0x10000000>; + }; + ++ aliases { ++ led-boot = &led_orange_usb; ++ led-failsafe = &led_orange_usb; ++ led-running = &led_orange_usb; ++ led-upgrade = &led_orange_usb; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; +@@ -68,7 +75,7 @@ + linux,default-trigger = "usbport"; + }; + +- orange-usb { ++ led_orange_usb: orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; diff --git a/target/linux/kirkwood/patches-6.6/118-dns-320l.patch b/target/linux/kirkwood/patches-6.6/118-dns-320l.patch new file mode 100644 index 0000000000..8f19441bbe --- /dev/null +++ b/target/linux/kirkwood/patches-6.6/118-dns-320l.patch @@ -0,0 +1,35 @@ +--- a/arch/arm/boot/dts/marvell/Makefile ++++ b/arch/arm/boot/dts/marvell/Makefile +@@ -92,6 +92,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-db-88f6282.dtb \ + kirkwood-dir665.dtb \ + kirkwood-dns320.dtb \ ++ kirkwood-dns320l.dtb \ + kirkwood-dns325.dtb \ + kirkwood-dockstar.dtb \ + kirkwood-dreamplug.dtb \ +--- a/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts ++++ b/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts +@@ -32,6 +32,13 @@ + reg = <0x00000000 0x10000000>; + }; + ++ aliases { ++ led-boot = &led_orange_usb; ++ led-failsafe = &led_orange_usb; ++ led-running = &led_orange_usb; ++ led-upgrade = &led_orange_usb; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; +@@ -68,7 +75,7 @@ + linux,default-trigger = "usbport"; + }; + +- orange-usb { ++ led_orange_usb: orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + };