Re: [PATCH 6/7] tegra: enable VDE driver

2024-05-17 Thread Tomasz Maciej Nowak
W dniu 17.05.2024 o 16:16, Hauke Mehrtens pisze:
> On 5/15/24 8:05 PM, Tomasz Maciej Nowak wrote:
>> From: Tomasz Maciej Nowak 
>>
>> This drives power domain responsible for clean reboot on at least
>> Tegra 2 devices.
>>
>> Signed-off-by: Tomasz Maciej Nowak 
> 
> Hi,

Hi

> Could you explain this change a bit more.

Will do.

> My do you deactivate the kmod-video-mem2mem and kmod-video-dma?
> Do you build it into the kernel and it was not automatically deactivated?

I didn't investigate it thoroughly, but when I built it with CONFIG_ALL_KMODS
the build system always complained about missing .ko files. It might be that 
some
kmod depends on these packages and HIDDEN attribute forces them to be created?
Normally the faulty packages should end up empty.
I'll try to get to the bottom of this or try to build VDE driver as module, 
since
the issue is with reboot we can load VDE later (unless something unloads it
earlier).

> Hauke
> 
>> ---
>>   package/kernel/linux/modules/video.mk |  4 ++--
>>   target/linux/tegra/config-6.6 | 20 
>>   2 files changed, 22 insertions(+), 2 deletions(-)
>>
>> diff --git a/package/kernel/linux/modules/video.mk 
>> b/package/kernel/linux/modules/video.mk
>> index dc1953279e43..0fae20b7700c 100644
>> --- a/package/kernel/linux/modules/video.mk
>> +++ b/package/kernel/linux/modules/video.mk
>> @@ -1157,7 +1157,7 @@ define KernelPackage/video-mem2mem
>>     SUBMENU:=$(VIDEO_MENU)
>>     TITLE:=Memory 2 Memory device support
>>     HIDDEN:=1
>> -  DEPENDS:=+kmod-video-videobuf2
>> +  DEPENDS:=@!TARGET_tegra_generic +kmod-video-videobuf2
>>     KCONFIG:= \
>>   CONFIG_V4L_MEM2MEM_DRIVERS=y \
>>   CONFIG_V4L2_MEM2MEM_DEV
>> @@ -1176,7 +1176,7 @@ define KernelPackage/video-dma
>>     SUBMENU:=$(VIDEO_MENU)
>>     TITLE:=Video DMA support
>>     HIDDEN:=1
>> -  DEPENDS:=+kmod-video-videobuf2
>> +  DEPENDS:=@!TARGET_tegra_generic +kmod-video-videobuf2
>>     KCONFIG:= \
>>   CONFIG_VIDEOBUF2_DMA_CONTIG \
>>   CONFIG_VIDEOBUF2_DMA_SG
>> diff --git a/target/linux/tegra/config-6.6 b/target/linux/tegra/config-6.6
>> index 4326326d3c89..c301dc6f 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
> 

-- 
TMN

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/7] kernel/tegra: Restore kernel files for v5.15

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

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 ..1600dd7f2103
--- /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 

[PATCH 4/7] tegra: 6.6: refresh config and patches

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

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 1600dd7f2103..4326326d3c89 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
 CONF

[PATCH 6/7] tegra: enable VDE driver

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This drives power domain responsible for clean reboot on at least
Tegra 2 devices.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/linux/modules/video.mk |  4 ++--
 target/linux/tegra/config-6.6 | 20 
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/package/kernel/linux/modules/video.mk 
b/package/kernel/linux/modules/video.mk
index dc1953279e43..0fae20b7700c 100644
--- a/package/kernel/linux/modules/video.mk
+++ b/package/kernel/linux/modules/video.mk
@@ -1157,7 +1157,7 @@ define KernelPackage/video-mem2mem
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=Memory 2 Memory device support
   HIDDEN:=1
-  DEPENDS:=+kmod-video-videobuf2
+  DEPENDS:=@!TARGET_tegra_generic +kmod-video-videobuf2
   KCONFIG:= \
 CONFIG_V4L_MEM2MEM_DRIVERS=y \
 CONFIG_V4L2_MEM2MEM_DEV
@@ -1176,7 +1176,7 @@ define KernelPackage/video-dma
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=Video DMA support
   HIDDEN:=1
-  DEPENDS:=+kmod-video-videobuf2
+  DEPENDS:=@!TARGET_tegra_generic +kmod-video-videobuf2
   KCONFIG:= \
CONFIG_VIDEOBUF2_DMA_CONTIG \
CONFIG_VIDEOBUF2_DMA_SG
diff --git a/target/linux/tegra/config-6.6 b/target/linux/tegra/config-6.6
index 4326326d3c89..c301dc6f 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
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/7] tegra: refresh 5.15 config

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

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 257ffda252ad..1600dd7f2103 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
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] uboot-tegra: bump version to 2024.04

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Since swig is mentioned as build dependency and buildbots have it
installed we can safely bump version.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/uboot-tegra/Makefile | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/package/boot/uboot-tegra/Makefile 
b/package/boot/uboot-tegra/Makefile
index d47ef6f6f01a..5bed6b97dd9c 100644
--- a/package/boot/uboot-tegra/Makefile
+++ b/package/boot/uboot-tegra/Makefile
@@ -6,10 +6,10 @@
 #
 include $(TOPDIR)/rules.mk
 
-PKG_VERSION := 2020.04
-PKG_RELEASE:=3
+PKG_VERSION := 2024.04
+PKG_RELEASE:=1
 
-PKG_HASH := fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
+PKG_HASH := 18a853fe39fad7ad03a90cc2d4275aeaed6da69735defac3492b80508843dd4a
 
 PKG_MAINTAINER := Tomasz Maciej Nowak 
 
@@ -46,11 +46,6 @@ define Build/bct-image
)
 endef
 
-define Build/Configure
-   sed '/select BINMAN/d' -i $(PKG_BUILD_DIR)/arch/arm/mach-tegra/Kconfig
-   $(call Build/Configure/U-Boot)
-endef
-
 define Build/Compile
$(call Build/Compile/U-Boot)
$(call Build/bct-image)
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 7/7] tegra: trimslice: adjust LED patch to upstream changes

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

LED subsystem has undergone changes how the function and color of LEDs
should be specified, so use that, while still keeping the old label.

Signed-off-by: Tomasz Maciej Nowak 
---
 ...enable-front-panel-leds-in-TrimSlice.patch | 28 ++-
 1 file changed, 21 insertions(+), 7 deletions(-)

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 9ec7f8b839f6..fa6d6db861f4 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,6 +1,14 @@
 --- a/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
 +++ b/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
-@@ -201,16 +201,17 @@
+@@ -2,6 +2,7 @@
+ /dts-v1/;
+ 
+ #include 
++#include 
+ #include "tegra20.dtsi"
+ #include "tegra20-cpu-opp.dtsi"
+ 
+@@ -201,16 +202,17 @@
conf_ata {
nvidia,pins = "ata", "atc", "atd", "ate",
"crtp", "dap2", "dap3", "dap4", "dta",
@@ -23,20 +31,26 @@
nvidia,pull = ;
nvidia,tristate = ;
};
-@@ -408,6 +409,20 @@
+@@ -408,6 +410,26 @@
};
};
  
-+  gpio-leds {
++  leds {
 +  compatible = "gpio-leds";
 +
-+  ds2 {
-+  label = "trimslice:green:right";
++  led-ds2 {
++  label = "green:right";
++  color = ;
++  function = LED_FUNCTION_STATUS;
++  function-enumerator = <1>;
 +  gpios = < TEGRA_GPIO(D, 2) GPIO_ACTIVE_LOW>;
 +  };
 +
-+  ds3 {
-+  label = "trimslice:green:left";
++  led-ds3 {
++  label = "green:left";
++  color = ;
++  function = LED_FUNCTION_STATUS;
++  function-enumerator = <2>;
 +  gpios = < TEGRA_GPIO(BB, 5) GPIO_ACTIVE_LOW>;
 +  };
 +  };
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 0/7] tegra: kernel 6.6 introduction

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Next release skips 6.1 in favour of 6.6, so here it is one for tegra
target. This series depends on "tegra: assorted fixes"[1]

1. https://patchwork.ozlabs.org/project/openwrt/list/?series=406948

Tomasz Maciej Nowak (7):
  tegra: refresh 5.15 config
  kernel/tegra: Create kernel files for v6.6 (from v5.15)
  kernel/tegra: Restore kernel files for v5.15
  tegra: 6.6: refresh config and patches
  tegra: add testing 6.6 kernel
  tegra: enable VDE driver
  tegra: trimslice: adjust LED patch to upstream changes

 package/kernel/linux/modules/video.mk |   4 +-
 target/linux/tegra/Makefile   |   1 +
 target/linux/tegra/config-5.15|   3 +
 target/linux/tegra/config-6.6 | 580 ++
 target/linux/tegra/image/Makefile |   9 +-
 ...enable-front-panel-leds-in-TrimSlice.patch |  60 ++
 6 files changed, 653 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/tegra/config-6.6
 create mode 100644 
target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch

-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 5/7] tegra: add testing 6.6 kernel

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

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 43ca154e8a08..3513e2751e52 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 da0b3813bb2f..7103b6d36e6e 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
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/7] kernel/tegra: Create kernel files for v6.6 (from v5.15)

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

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
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/4] tegra: drop console specifiers from kernel commad line

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Because recent changes to procd, last "console" argument was used as
primary argument and causing no terminal to be spawned on serial
interface. So drop the hardcoded consoles in boot script, since dts has
already an alias specified, which lets procd decide where to spawn the
terminal.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/image/generic-bootscript | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/tegra/image/generic-bootscript 
b/target/linux/tegra/image/generic-bootscript
index 0e7816490d9e..5d4620c4d200 100644
--- a/target/linux/tegra/image/generic-bootscript
+++ b/target/linux/tegra/image/generic-bootscript
@@ -1,6 +1,6 @@
 part uuid ${devtype} ${devnum}:2 ptuuid
 
-setenv bootargs "root=PARTUUID=${ptuuid} rw rootwait console=ttyS0,115200 
console=tty0"
+setenv bootargs "root=PARTUUID=${ptuuid} rw rootwait"
 
 load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} zImage
 load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${soc}-${board}.dtb
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/4] tegra: trimslice: enable GPIO LEDs driver

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

LEDs are on all the time since boot, until there's driver to claim them.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/tegra/image/Makefile 
b/target/linux/tegra/image/Makefile
index 8a331f260753..609cf5dd38f9 100644
--- a/target/linux/tegra/image/Makefile
+++ b/target/linux/tegra/image/Makefile
@@ -43,8 +43,8 @@ define Device/compulab_trimslice
   DEVICE_VENDOR := CompuLab
   DEVICE_MODEL := TrimSlice
   DEVICE_DTS := tegra20-trimslice
-  DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
-   kmod-usb-storage wpad-basic-mbedtls
+  DEVICE_PACKAGES := kmod-leds-gpio kmod-r8169 kmod-rt2800-usb \
+   kmod-rtc-em3027 kmod-usb-storage wpad-basic-mbedtls
   UBOOT := trimslice-mmc
 endef
 TARGET_DEVICES += compulab_trimslice
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/4] tegra: pad rootfs to recreate overlay after upgrade

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

The old overlay remained after upgrades and would cause failure on first
boot after upgrade, in which no new overlay could be created while old
one was unusable.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/image/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/tegra/image/Makefile 
b/target/linux/tegra/image/Makefile
index 82394f4ab6fa..8a331f260753 100644
--- a/target/linux/tegra/image/Makefile
+++ b/target/linux/tegra/image/Makefile
@@ -16,12 +16,13 @@ define Build/tegra-sdcard
-n '$(DEVICE_TITLE) OpenWrt bootscript' \
-d $(BOOT_SCRIPT) \
$@.boot/boot.scr
+   $(CP) $@ $@.rootfs
 
SIGNATURE="$(IMG_PART_SIGNATURE)" \
$(SCRIPT_DIR)/gen_image_generic.sh \
$@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
-   $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
+   $(CONFIG_TARGET_ROOTFS_PARTSIZE) $@.rootfs \
2048
 
$(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 
skip=1 seek=1 conv=notrunc)
@@ -32,7 +33,7 @@ DEVICE_VARS += BOOT_SCRIPT UBOOT
 define Device/Default
   BOOT_SCRIPT := generic-bootscript
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := tegra-sdcard | gzip | append-metadata
+  IMAGE/sdcard.img.gz := append-rootfs | pad-extra 128k | tegra-sdcard | gzip 
| append-metadata
   KERNEL_NAME := zImage
   KERNEL := kernel-bin
   PROFILES := Default
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 4/4] tegra: trimslice: enable USB HID driver

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Without serial or network access the only option for initial
configuration, is a attached display with USB keyboard, but the keyboard
driver needs to be installed first. So enable keyboard driver by default
to avoid this issue.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/tegra/image/Makefile 
b/target/linux/tegra/image/Makefile
index 609cf5dd38f9..da0b3813bb2f 100644
--- a/target/linux/tegra/image/Makefile
+++ b/target/linux/tegra/image/Makefile
@@ -44,7 +44,7 @@ define Device/compulab_trimslice
   DEVICE_MODEL := TrimSlice
   DEVICE_DTS := tegra20-trimslice
   DEVICE_PACKAGES := kmod-leds-gpio kmod-r8169 kmod-rt2800-usb \
-   kmod-rtc-em3027 kmod-usb-storage wpad-basic-mbedtls
+   kmod-rtc-em3027 kmod-usb-hid kmod-usb-storage wpad-basic-mbedtls
   UBOOT := trimslice-mmc
 endef
 TARGET_DEVICES += compulab_trimslice
-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 0/4] tegra: assorted fixes

2024-05-15 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Few minor fixes found when perparing 6.6 bump.

Tomasz Maciej Nowak (4):
  tegra: pad rootfs to recreate overlay after upgrade
  tegra: drop console specifiers from kernel commad line
  tegra: trimslice: enable GPIO LEDs driver
  tegra: trimslice: enable USB HID driver

 target/linux/tegra/image/Makefile   | 9 +
 target/linux/tegra/image/generic-bootscript | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

-- 
2.45.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3] ath79: add support for Dell SonicPoint ACe APL26-0AE

2024-04-17 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Dell/SonicWall APL26-0AE (marketed as SonicPoint ACe) is a dual band
wireless access point. End of life as of 2022-07-31.

Specification
SoC: QualcommAtheros QCA9550
RAM: 256 MB DDR2
Flash: 32 MB SPI NOR
WIFI: 2.4 GHz 3T3R integrated
  5 GHz 3T3R QCA9890 oversized Mini PCIe card
Ethernet: 2x 10/100/1000 Mbps QCA8334
  port labeled lan1 is PoE capable (802.3at)
USB: 1x 2.0
LEDs: LEDs: 6x which 5 are GPIO controlled and two of them are dual color
Buttons: 2x GPIO controlled
Serial: RJ-45 port, SonicWall pinout
baud: 115200, parity: none, flow control: none

Before flashing, be sure to have a copy of factory firmware, in case You
wish to revert to original firmware.
All described procedures were done in following environment:
ROM Version: SonicROM (U-Boot) 8.0.0.0-11o
SafeMode Firmware Version: SonicOS 8.0.0.0-14o
Firmware Version: SonicOS 9.0.1.0
In case of other versions, following installation instructions might be
ineffective.

Installation
1. Prepare TFTP server with OpenWrt sysupgrade image and rename that
   image to "sp_fw.bin".
2. Connect to one of LAN ports.
3. Connect to serial port.
4. Hold the reset button (small through hole on side of the unit),
   power on the device and when prompted to stop autoboot, hit any key.
   The held button can now be released.
5. Alter U-Boot environment with following commands:
setenv bootcmd bootm 0x9F11
saveenv
6. Adjust "ipaddr" (access point, default is 192.168.1.1) and "serverip"
   (TFTP server, default is 192.168.1.10) addresses in U-Boot
   environment, then run following commands:
tftp 0x8006 sp_fw.bin
erase 0x9F11 +0x1EF
cp.b 0x8006 0x9F11 $filesize
7. After successful flashing, execute:
boot
8. The access point will boot to OpenWrt. Wait few minutes, until the
wrench LED will stop blinking, then it's ready for configuration.

Known issues
Initramfs image can't be bigger than specified kernel size, otherwise
bootloader will throw LZMA decompressing error. Switching to lzma-loader
should workaround that.
This device has Winbond 25Q256FVFG and doesn't have reliable reset, which
causes hang on reboot, thus broken-flash-reset needs to be added. This
property addition causes dispaly of "scary" warning on each boot, take
this warnig into consideration.

Signed-off-by: Tomasz Maciej Nowak 
---
v2 -> v3
The initial changes date is before the EoL date, so I considered going
back to stock firmware, in case someone was not satisfied. Now that
without valid license, the device is useless, there's no point going
back to stock firmware, thus there's no point for more than 10MiB lying
dormant. There's still possibility to go back to stock firmware but it's
slightly more involving.

- incorporate safemode, config and log partitions to firmware partition
- adjust installation instructions to new partition scheme

 package/boot/uboot-envtools/files/ath79   |   3 +
 .../ath79/dts/qca9550_dell_apl26-0ae.dts  | 228 ++
 .../generic/base-files/etc/board.d/01_leds|   4 +
 .../generic/base-files/etc/board.d/02_network |   4 +
 target/linux/ath79/image/generic.mk   |  16 ++
 5 files changed, 255 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts

diff --git a/package/boot/uboot-envtools/files/ath79 
b/package/boot/uboot-envtools/files/ath79
index 567bf9824ddc..2c97e61498e9 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -117,6 +117,9 @@ buffalo,wzr-hp-g300nh-s|\
 linksys,ea4500-v3)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2" "0x2"
;;
+dell,apl26-0ae)
+   ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4" "0x1"
+   ;;
 domywifi,dw33d)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x1" "0x1"
;;
diff --git a/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts 
b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
new file mode 100644
index ..6ef2eb846d87
--- /dev/null
+++ b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
@@ -0,0 +1,228 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include 
+#include 
+#include 
+
+#include "qca955x.dtsi"
+
+/ {
+   model = "Dell SonicPoint ACe (APL26-0AE)";
+   compatible = "dell,apl26-0ae", "qca,qca9550", "qca,qca9558";
+
+   aliases {
+   label-mac-device = 
+   led-boot = _wrench;
+   led-failsafe = _wrench;
+   led-upgrade = _wrench;
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   button-reset {
+   label = "reset";
+   gpios = < 21 GPIO_ACTIVE_LOW>;
+ 

[PATCH v2] ath79: add support for Dell SonicPoint ACe APL26-0AE

2024-04-16 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Dell/SonicWall APL26-0AE (marketed as SonicPoint ACe) is a dual band
wireless access point. End of life as of 2022-07-31.

Specification
SoC: QualcommAtheros QCA9550
RAM: 256 MB DDR2
Flash: 32 MB SPI NOR
WIFI: 2.4 GHz 3T3R integrated
  5 GHz 3T3R QCA9890 oversized Mini PCIe card
Ethernet: 2x 10/100/1000 Mbps QCA8334
  port labeled lan1 is PoE capable (802.3at)
USB: 1x 2.0
LEDs: LEDs: 6x which 5 are GPIO controlled and two of them are dual color
Buttons: 2x GPIO controlled
Serial: RJ-45 port, SonicWall pinout
baud: 115200, parity: none, flow control: none

Before flashing, be sure to have a copy of factory firmware, in case You
wish to revert to original firmware.
All described procedures were done in following environment:
ROM Version: SonicROM (U-Boot) 8.0.0.0-11o
SafeMode Firmware Version: SonicOS 8.0.0.0-14o
Firmware Version: SonicOS 9.0.1.0
In case of other versions, following installation instructions might be
ineffective.

Installation
1. Prepare TFTP server with OpenWrt sysupgrade image and rename that
   image to "sp_fw.bin".
2. Connect to one of LAN ports.
3. Connect to serial port.
4. Hold the reset button (small through hole on side of the unit),
   power on the device and when prompted to stop autoboot, hit any key.
   The held button can now be released.
5. Alter U-Boot environment with following commands:
setenv bootcmd bootm 0x9F51
saveenv
6. Adjust "ipaddr" (access point, default is 192.168.1.1) and "serverip"
   (TFTP server, default is 192.168.1.10) addresses in U-Boot
   environment, then run following command:
run lf
7. After successful flashing, execute:
boot
8. The access point will boot to OpenWrt. Wait few minutes, until the
wrench LED will stop blinking, then it's ready for configuration.

Known issues
Initramfs image can't be bigger than specified kernel size, otherwise
bootloader will throw LZMA decompressing error. Switching to lzma-loader
should workaround that.
This device has Winbond 25Q256FVFG and doesn't have reliable reset, which
causes hang on reboot, thus broken-flash-reset needs to be added. This
property addition causes dispaly of "scary" warning on each boot, take
this warnig into consideration.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
- add EoL notice
- correct LEDs description
- add default IP addresses from U-Boot

 package/boot/uboot-envtools/files/ath79   |   3 +
 .../ath79/dts/qca9550_dell_apl26-0ae.dts  | 246 ++
 .../generic/base-files/etc/board.d/01_leds|   4 +
 .../generic/base-files/etc/board.d/02_network |   4 +
 target/linux/ath79/image/generic.mk   |  16 ++
 5 files changed, 273 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts

diff --git a/package/boot/uboot-envtools/files/ath79 
b/package/boot/uboot-envtools/files/ath79
index 567bf9824ddc..2c97e61498e9 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -117,6 +117,9 @@ buffalo,wzr-hp-g300nh-s|\
 linksys,ea4500-v3)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2" "0x2"
;;
+dell,apl26-0ae)
+   ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4" "0x1"
+   ;;
 domywifi,dw33d)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x1" "0x1"
;;
diff --git a/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts 
b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
new file mode 100644
index ..2f243e027471
--- /dev/null
+++ b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
@@ -0,0 +1,246 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include 
+#include 
+#include 
+
+#include "qca955x.dtsi"
+
+/ {
+   model = "Dell SonicPoint ACe (APL26-0AE)";
+   compatible = "dell,apl26-0ae", "qca,qca9550", "qca,qca9558";
+
+   aliases {
+   label-mac-device = 
+   led-boot = _wrench;
+   led-failsafe = _wrench;
+   led-upgrade = _wrench;
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   button-reset {
+   label = "reset";
+   gpios = < 21 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   /* Accessible only after disassembling the casing */
+   button-service {
+   label = "service";
+   gpios = < 22 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>

Re: [PATCH] ath79: add support for Dell SonicPoint ACe APL26-0AE

2024-04-16 Thread Tomasz Maciej Nowak
W dniu 15.04.2024 o 14:32, Paul D pisze:
> 
>>> 6. Adjust "ipaddr" (access point) and "serverip" (TFTP server) addresses
> Might be an idea to explicitly document these IPs so that dedicated users can 
> already set their gear to those IPs and just smash enter

Will add them in v2, but given the addresses that are set by default
(192.168.1.1 for AP) one might find it simpler to adjust them single time in
U-Boot environment.

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ath79: add support for Dell SonicPoint ACe APL26-0AE

2024-04-13 Thread Tomasz Maciej Nowak
W dniu 13.04.2024 o 16:05, Tomasz Maciej Nowak pisze:
> From: Tomasz Maciej Nowak 
> 
> Dell/SonicWall APL26-0AE (marketed as SonicPoint ACe) is a dual band
> wireless access point.
> 
> Specification
> SoC: QualcommAtheros QCA9550
> RAM: 256 MB DDR2
> Flash: 32 MB SPI NOR
> WIFI: 2.4 GHz 3T3R integrated
>   5 GHz 3T3R QCA9890 oversized Mini PCIe card
> Ethernet: 2x 10/100/1000 Mbps QCA8334
>   port labeled lan1 is PoE capable (802.3at)
> USB: 1x 2.0
> LEDs: 3x GPIO controlled

Ooops, forgot to update description should be:
LEDs: 6x which 5 are GPIO controlled, an two of them are dual color

Please replace that in the commit message
.
> Buttons: 2x GPIO controlled
> Serial: RJ-45 port, SonicWall pinout
> baud: 115200, parity: none, flow control: none
> 
> Before flashing, be sure to have a copy of factory firmware, in case You
> wish to revert to original firmware.
> All described procedures were done in following environment:
> ROM Version: SonicROM (U-Boot) 8.0.0.0-11o
> SafeMode Firmware Version: SonicOS 8.0.0.0-14o
> Firmware Version: SonicOS 9.0.1.0
> In case of other versions, following installation instructions might be
> ineffective.
> 
> Installation
> 1. Prepare TFTP server with OpenWrt sysupgrade image and rename that
>image to "sp_fw.bin".
> 2. Connect to one of LAN ports.
> 3. Connect to serial port.
> 4. Hold the reset button (small through hole on side of the unit),
>power on the device and when prompted to stop autoboot, hit any key.
>The held button can now be released.
> 5. Alter U-Boot environment with following commands:
> setenv bootcmd bootm 0x9F51
> saveenv
> 6. Adjust "ipaddr" (access point) and "serverip" (TFTP server) addresses
>in U-Boot environment, then run following command:
> run lf
> 7. After successful flashing, execute:
> boot
> 8. The access point will boot to OpenWrt. Wait few minutes, until the
> wrench LED will stop blinking, then it's ready for configuration.
> 
> Known issues
> Initramfs image can't be bigger than specified kernel size, otherwise
> bootloader will throw LZMA decompressing error. Switching to lzma-loader
> should workaround that.
> This device has Winbond 25Q256FVFG and doesn't have reliable reset, which
> causes hang on reboot, thus broken-flash-reset needs to be added. This
> property addition causes dispaly of "scary" warning on each boot, take
> this warnig into consideration.
> 
> Signed-off-by: Tomasz Maciej Nowak 
> ---
>  package/boot/uboot-envtools/files/ath79   |   3 +
>  .../ath79/dts/qca9550_dell_apl26-0ae.dts  | 246 ++
>  .../generic/base-files/etc/board.d/01_leds|   4 +
>  .../generic/base-files/etc/board.d/02_network |   4 +
>  target/linux/ath79/image/generic.mk   |  16 ++
>  5 files changed, 273 insertions(+)
>  create mode 100644 target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
> 
> diff --git a/package/boot/uboot-envtools/files/ath79 
> b/package/boot/uboot-envtools/files/ath79
> index 567bf9824ddc..2c97e61498e9 100644
> --- a/package/boot/uboot-envtools/files/ath79
> +++ b/package/boot/uboot-envtools/files/ath79
> @@ -117,6 +117,9 @@ buffalo,wzr-hp-g300nh-s|\
>  linksys,ea4500-v3)
>   ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2" "0x2"
>   ;;
> +dell,apl26-0ae)
> + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4" "0x1"
> + ;;
>  domywifi,dw33d)
>   ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x1" "0x1"
>   ;;
> diff --git a/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts 
> b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
> new file mode 100644
> index ..2f243e027471
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
> @@ -0,0 +1,246 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
> +
> +#include 
> +#include 
> +#include 
> +
> +#include "qca955x.dtsi"
> +
> +/ {
> + model = "Dell SonicPoint ACe (APL26-0AE)";
> + compatible = "dell,apl26-0ae", "qca,qca9550", "qca,qca9558";
> +
> + aliases {
> + label-mac-device = 
> + led-boot = _wrench;
> + led-failsafe = _wrench;
> + led-upgrade = _wrench;
> + };
> +
> + keys {
> + compatible = "gpio-keys";
> +
> + button-reset {
> + label = "reset";
> + gpios = < 21 GPIO_ACTIVE_LOW>;
> +  

[PATCH] ath79: add support for Dell SonicPoint ACe APL26-0AE

2024-04-13 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Dell/SonicWall APL26-0AE (marketed as SonicPoint ACe) is a dual band
wireless access point.

Specification
SoC: QualcommAtheros QCA9550
RAM: 256 MB DDR2
Flash: 32 MB SPI NOR
WIFI: 2.4 GHz 3T3R integrated
  5 GHz 3T3R QCA9890 oversized Mini PCIe card
Ethernet: 2x 10/100/1000 Mbps QCA8334
  port labeled lan1 is PoE capable (802.3at)
USB: 1x 2.0
LEDs: 3x GPIO controlled
Buttons: 2x GPIO controlled
Serial: RJ-45 port, SonicWall pinout
baud: 115200, parity: none, flow control: none

Before flashing, be sure to have a copy of factory firmware, in case You
wish to revert to original firmware.
All described procedures were done in following environment:
ROM Version: SonicROM (U-Boot) 8.0.0.0-11o
SafeMode Firmware Version: SonicOS 8.0.0.0-14o
Firmware Version: SonicOS 9.0.1.0
In case of other versions, following installation instructions might be
ineffective.

Installation
1. Prepare TFTP server with OpenWrt sysupgrade image and rename that
   image to "sp_fw.bin".
2. Connect to one of LAN ports.
3. Connect to serial port.
4. Hold the reset button (small through hole on side of the unit),
   power on the device and when prompted to stop autoboot, hit any key.
   The held button can now be released.
5. Alter U-Boot environment with following commands:
setenv bootcmd bootm 0x9F51
saveenv
6. Adjust "ipaddr" (access point) and "serverip" (TFTP server) addresses
   in U-Boot environment, then run following command:
run lf
7. After successful flashing, execute:
boot
8. The access point will boot to OpenWrt. Wait few minutes, until the
wrench LED will stop blinking, then it's ready for configuration.

Known issues
Initramfs image can't be bigger than specified kernel size, otherwise
bootloader will throw LZMA decompressing error. Switching to lzma-loader
should workaround that.
This device has Winbond 25Q256FVFG and doesn't have reliable reset, which
causes hang on reboot, thus broken-flash-reset needs to be added. This
property addition causes dispaly of "scary" warning on each boot, take
this warnig into consideration.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/uboot-envtools/files/ath79   |   3 +
 .../ath79/dts/qca9550_dell_apl26-0ae.dts  | 246 ++
 .../generic/base-files/etc/board.d/01_leds|   4 +
 .../generic/base-files/etc/board.d/02_network |   4 +
 target/linux/ath79/image/generic.mk   |  16 ++
 5 files changed, 273 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts

diff --git a/package/boot/uboot-envtools/files/ath79 
b/package/boot/uboot-envtools/files/ath79
index 567bf9824ddc..2c97e61498e9 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -117,6 +117,9 @@ buffalo,wzr-hp-g300nh-s|\
 linksys,ea4500-v3)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2" "0x2"
;;
+dell,apl26-0ae)
+   ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4" "0x1"
+   ;;
 domywifi,dw33d)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x1" "0x1"
;;
diff --git a/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts 
b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
new file mode 100644
index ..2f243e027471
--- /dev/null
+++ b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts
@@ -0,0 +1,246 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include 
+#include 
+#include 
+
+#include "qca955x.dtsi"
+
+/ {
+   model = "Dell SonicPoint ACe (APL26-0AE)";
+   compatible = "dell,apl26-0ae", "qca,qca9550", "qca,qca9558";
+
+   aliases {
+   label-mac-device = 
+   led-boot = _wrench;
+   led-failsafe = _wrench;
+   led-upgrade = _wrench;
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   button-reset {
+   label = "reset";
+   gpios = < 21 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   /* Accessible only after disassembling the casing */
+   button-service {
+   label = "service";
+   gpios = < 22 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   led-lan1-amber {
+   color = ;
+   function = LED_FUNCTION_LAN;
+   function-enumerator = <1>;
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+  

Re: [PATCH] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets

2024-04-03 Thread Tomasz Maciej Nowak
W dniu 29.03.2024 o 19:08, Elliott Mitchell pisze:
> On Fri, Mar 29, 2024 at 04:32:18PM +0100, Paul D wrote:
>> Recommend avoiding -a and -o params.
>>
>> Use instead e.g.
>>
>> [ -n "$GUID" ] || [ "$KERNELPARTTYPE" = "6" ] || [ "$KERNELPARTTYPE" = "c" ]
>>
>> https://www.shellcheck.net/wiki/SC2166
> 
> The examples pointed to amounted to "be careful with untrusted input to
> shell scripts".  Build systems must already be pretty much 100% trusted.
> If someone slips something problematic into one there is pretty much
> nothing to be done about it.
> 
> 
> I've been getting the feeling the whole community is slowly trying to
> recreate SunOS 5.7^WSolaris 2.7^WSoliaris 7 (used to be a Sun Thiing,
> but now everyone's version numbers tend to be inflated).  Where
> /bin/false, /bin/true and /bin/test were all Korne Shell scripts.
> 
> This nominally saved development work since Korne shell has
> implementations of all these internally.  Problem is this killed
> performance for any shell script /not/ written in a shell with those as
> built-in.  While Korne shell is very fast once it has finished parsing
> its input, it is slow at parsing its scripts.
> 
> Having `gunzip` be a shell script seems headed in this direction.  The
> above seems a similar sort of situation, adding an extra fork()/execve()
> to avoid warnings.
> 
> I'm placing SC2166 on my disregard list.  Yes, this is nominally not well
> defined, but unlike most warnings this one has a major impact on
> performance.
> 
> (fork()/execve() are the two most expensive routinely used system calls)
> 

Thanks, I did consider the execution penalty but as this script is small I 
decided
to go with Paul's suggestion, and as bonus, just to avoid future noise around
this, when someone else validates this script with shellcheck.

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets

2024-04-03 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some old or proprietary bootloader recognise only FAT file system
variants on storage devices with MBR but unfortunately script ties
format of kernel partition to GPT partition table. So, allow kernel
partition file system to be FAT16 or FAT32 if appropriate type is set
in partition table.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
- use well defined conditional syntax

 scripts/gen_image_generic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 11e40f38868f..190cb6ae4a48 100755
--- a/scripts/gen_image_generic.sh
+++ b/scripts/gen_image_generic.sh
@@ -49,7 +49,7 @@ dos_dircopy() {
 [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" 
conv=notrunc count="$ROOTFSSIZE"
 dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
 
-if [ -n "$GUID" ]; then
+if [ -n "$GUID" ] || [ "$KERNELPARTTYPE" = "6" ] || [ "$KERNELPARTTYPE" = "c" 
]; then
 [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 
seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect"
 mkfs.fat --invariant -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 
1024))"
 LC_ALL=C dos_dircopy "$KERNELDIR" /
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] kernel: kmod-phy-smsc: add dependency on crc16

2024-03-29 Thread Tomasz Maciej Nowak
W dniu 29.03.2024 o 09:57, Robert Marko pisze:
> On Thu, 28 Mar 2024 at 18:03, Tomasz Maciej Nowak  wrote:
>>
>> From: Tomasz Maciej Nowak 
>>
>> Introduced WoL feature needs CRC16 support.
>>
>> Signed-off-by: Tomasz Maciej Nowak 
>> ---
>>  package/kernel/linux/modules/netdevices.mk | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/kernel/linux/modules/netdevices.mk 
>> b/package/kernel/linux/modules/netdevices.mk
>> index af1d8b485e00..724f35df74a2 100644
>> --- a/package/kernel/linux/modules/netdevices.mk
>> +++ b/package/kernel/linux/modules/netdevices.mk
>> @@ -363,7 +363,7 @@ define KernelPackage/phy-smsc
>> SUBMENU:=$(NETWORK_DEVICES_MENU)
>> TITLE:=SMSC PHY driver
>> KCONFIG:=CONFIG_SMSC_PHY
>> -   DEPENDS:=+kmod-libphy
>> +   DEPENDS:=+kmod-libphy +!LINUX_5_15||!LINUX_6_1:kmod-lib-crc16
> I would prefer depending on 6.6 for the kmod, not the other way around.

I do prefer this version, otherwise if new major version is introduced and we
still will have three kernel versions, like at the moment, someone adding 
support
for it would need to add it to dependency list of this module. This would
naturally increase diffstat meaning more lines to review, while in this variant
other kernel version should naturally go away when it's dropped.

Nonetheless, v2 sent.
 
> 
> Regards,
> Robert

Regards

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] kernel: kmod-phy-smsc: add dependency on crc16

2024-03-29 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Introduced WoL feature needs CRC16 support.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
- strictly depend on 6.6 version

 package/kernel/linux/modules/netdevices.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index af1d8b485e00..9fdbdc9ec7ae 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -363,7 +363,7 @@ define KernelPackage/phy-smsc
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=SMSC PHY driver
KCONFIG:=CONFIG_SMSC_PHY
-   DEPENDS:=+kmod-libphy
+   DEPENDS:=+kmod-libphy +LINUX_6_6:kmod-lib-crc16
FILES:=$(LINUX_DIR)/drivers/net/phy/smsc.ko
AUTOLOAD:=$(call AutoProbe,smsc)
 endef
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel: kmod-phy-smsc: add dependency on crc16

2024-03-28 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Introduced WoL feature needs CRC16 support.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/linux/modules/netdevices.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index af1d8b485e00..724f35df74a2 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -363,7 +363,7 @@ define KernelPackage/phy-smsc
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=SMSC PHY driver
KCONFIG:=CONFIG_SMSC_PHY
-   DEPENDS:=+kmod-libphy
+   DEPENDS:=+kmod-libphy +!LINUX_5_15||!LINUX_6_1:kmod-lib-crc16
FILES:=$(LINUX_DIR)/drivers/net/phy/smsc.ko
AUTOLOAD:=$(call AutoProbe,smsc)
 endef
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets

2024-03-28 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some old or proprietary bootloader recognize only FAT file system
variants on storage devices with MBR, unfortunately script ties
format of kernel partition to GPT partition table. So, allow kernel
partition file system to be FAT16 or FAT32 if appropriate type is set
in partition table.

Signed-off-by: Tomasz Maciej Nowak 
---
 scripts/gen_image_generic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 11e40f38868f..44837fde1e12 100755
--- a/scripts/gen_image_generic.sh
+++ b/scripts/gen_image_generic.sh
@@ -49,7 +49,7 @@ dos_dircopy() {
 [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" 
conv=notrunc count="$ROOTFSSIZE"
 dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
 
-if [ -n "$GUID" ]; then
+if [ -n "$GUID" -o "$KERNELPARTTYPE" = "6" -o "$KERNELPARTTYPE" = "c" ]; then
 [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 
seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect"
 mkfs.fat --invariant -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 
1024))"
 LC_ALL=C dos_dircopy "$KERNELDIR" /
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] image: drop IB guards around dtb recipes

2024-02-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This guard is unnecessary, since target using these recipes are already
exempted from running in Image Builder.

Signed-off-by: Tomasz Maciej Nowak 
---
 include/image.mk | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 3a92fb0c8cab..e54f06a44703 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -575,7 +575,6 @@ define Device/Build/compile
 
 endef
 
-ifndef IB
 define Device/Build/dtb
   ifndef BUILD_DTS_$(1)
   BUILD_DTS_$(1) := 1
@@ -597,7 +596,6 @@ define Device/Build/dtbo
   endif
 
 endef
-endif
 
 define Device/Build/kernel
   $$(eval $$(foreach dts,$$(DEVICE_DTS), \
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] image: build dtb with host compiler for image builder

2024-02-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Device tree blobs are arch agnostic, so we don't need to cross compile
them.

Signed-off-by: Tomasz Maciej Nowak 
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index 4b6acbe1aad6..3a92fb0c8cab 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -180,7 +180,7 @@ endef
 # $(3) extra CPP flags
 # $(4) extra DTC flags
 define Image/BuildDTB/sub
-   $(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
+   $(if IB, , $(TARGET_CROSS))cpp -nostdinc -x assembler-with-cpp \
$(DTS_CPPFLAGS) \
-I$(DTS_DIR) \
-I$(DTS_DIR)/include \
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] imagebuilder: include device tree bindings

2024-02-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Image Builder includes target dts which might reference device tree
bindings for various integrated peripherals and trying to build dtb
without access to bindings will fail.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/imagebuilder/Makefile | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile
index c3b6c9c10c58..fb187c90228c 100644
--- a/target/imagebuilder/Makefile
+++ b/target/imagebuilder/Makefile
@@ -26,7 +26,7 @@ all: compile
 
 $(BIN_DIR)/$(IB_NAME).tar.xz: clean
rm -rf $(PKG_BUILD_DIR)
-   mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
+   mkdir -p $(IB_KDIR) $(IB_LDIR)/include 
$(PKG_BUILD_DIR)/staging_dir/host/lib \
$(PKG_BUILD_DIR)/target/linux $(PKG_BUILD_DIR)/scripts 
$(IB_DTSDIR)
-cp $(TOPDIR)/.config $(PKG_BUILD_DIR)/.config
$(SED) 's/^CONFIG_BINARY_FOLDER=.*/# CONFIG_BINARY_FOLDER is not set/' 
$(PKG_BUILD_DIR)/.config
@@ -99,6 +99,9 @@ endif
if [ -d $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts ]; then \
$(CP) -L $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts/* 
$(IB_DTSDIR); \
fi
+   if [ -d $(LINUX_DIR)/include/dt-bindings ]; then \
+   $(CP) -L $(LINUX_DIR)/include/dt-bindings $(IB_LDIR)/include; \
+   fi
$(SED) 's,^# REVISION:=.*,REVISION:=$(REVISION),g' 
$(PKG_BUILD_DIR)/include/version.mk
$(SED) 's,^# 
SOURCE_DATE_EPOCH:=.*,SOURCE_DATE_EPOCH:=$(SOURCE_DATE_EPOCH),g' 
$(PKG_BUILD_DIR)/include/version.mk
$(SED) '/LINUX_VERMAGIC:=/ { s,unknown,$(LINUX_VERMAGIC),g }' 
$(PKG_BUILD_DIR)/include/kernel.mk
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] mvebu: fill additional info for mvneta tx queue workaround patch

2024-02-26 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Because some still unresolved bugs in this driver, which sprout
occasional questions what this patch works around, point to the issue
which started this. Being here, fill headers required by git am.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
- rebase

 .../mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch   | 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch 
b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch
index 918132e2936c..14f93592fe3a 100644
--- a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch
+++ b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch
@@ -1,3 +1,6 @@
+From: Felix Fietkau 
+Subject: mvneta: tx queue workaround
+
 The hardware queue scheduling is apparently configured with fixed
 priorities, which creates a nasty fairness issue where traffic from one
 CPU can starve traffic from all other CPUs.
@@ -5,6 +8,8 @@ CPU can starve traffic from all other CPUs.
 Work around this issue by forcing all tx packets to go through one CPU,
 until this issue is fixed properly.
 
+Ref: https://github.com/openwrt/openwrt/issues/5411
+
 Signed-off-by: Felix Fietkau 
 ---
 --- a/drivers/net/ethernet/marvell/mvneta.c
-- 
2.44.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH firmware-utils] zycast: disable build on non-Linux OS

2024-02-12 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Fails with following errors on MacOS builder:

[ 96%] Building C object CMakeFiles/zycast.dir/src/zycast.c.o
/usr/bin/gcc   
-I/Users/runner/work/firmware-utils/firmware-utils/openwrt/tools/include 
-I/usr/local/opt/libressl/include -O3 -DNDEBUG -isysroot 
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk
 -mmacosx-version-min=12.7   -Wall -Wno-unused-parameter -MD -MT 
CMakeFiles/zycast.dir/src/zycast.c.o -MF CMakeFiles/zycast.dir/src/zycast.c.o.d 
-o CMakeFiles/zycast.dir/src/zycast.c.o -c 
/Users/runner/work/firmware-utils/firmware-utils/src/zycast.c
/Users/runner/work/firmware-utils/firmware-utils/src/zycast.c:205:35: error: 
use of undeclared identifier 'MSG_MORE'
if (send(sockfd, phdr, HDRSIZE, MSG_MORE | MSG_DONTROUTE) < 0)
^
/Users/runner/work/firmware-utils/firmware-utils/src/zycast.c:285:39: error: 
use of undeclared identifier 'SO_BINDTODEVICE'
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,  
optarg, strlen(optarg)) < 0)
   ^
2 errors generated.

These seem to be Linux only definitions and there are no equivalents,
so leave rewrite of zycast to someone interested in running it on
other OS.

Signed-off-by: Tomasz Maciej Nowak 
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6963ad64e74..f0f608aa39d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,7 +110,9 @@ FW_UTIL(uimage_sgehdr "" "" "${ZLIB_LIBRARIES}")
 FW_UTIL(wrt400n src/cyg_crc32.c "" "")
 FW_UTIL(xiaomifw "" "" "")
 FW_UTIL(xorimage "" "" "")
-FW_UTIL(zycast "" "" "")
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  FW_UTIL(zycast "" "" "")
+endif()
 FW_UTIL(zyimage "" "" "")
 FW_UTIL(zytrx "" "" "")
 FW_UTIL(zyxbcm "" "" "")
-- 
2.43.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] mvebu: fill additional info for mvneta tx queue workaround patch

2024-01-10 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Because some still unresolved bugs in this driver, which sprout
occasional questions what this patch works around, point to the issue
which started this. Being here, fill headers required by git am.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch  | 5 +
 .../mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch   | 5 +
 2 files changed, 10 insertions(+)

diff --git 
a/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch 
b/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch
index 32e8ef4b7d87..039dbc06dd04 100644
--- a/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch
+++ b/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch
@@ -1,3 +1,6 @@
+From: Felix Fietkau 
+Subject: mvneta: tx queue workaround
+
 The hardware queue scheduling is apparently configured with fixed
 priorities, which creates a nasty fairness issue where traffic from one
 CPU can starve traffic from all other CPUs.
@@ -5,6 +8,8 @@ CPU can starve traffic from all other CPUs.
 Work around this issue by forcing all tx packets to go through one CPU,
 until this issue is fixed properly.
 
+Ref: https://github.com/openwrt/openwrt/issues/5411
+
 Signed-off-by: Felix Fietkau 
 ---
 --- a/drivers/net/ethernet/marvell/mvneta.c
diff --git 
a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch 
b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch
index 15762be81d40..f80d4e301ada 100644
--- a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch
+++ b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch
@@ -1,3 +1,6 @@
+From: Felix Fietkau 
+Subject: mvneta: tx queue workaround
+
 The hardware queue scheduling is apparently configured with fixed
 priorities, which creates a nasty fairness issue where traffic from one
 CPU can starve traffic from all other CPUs.
@@ -5,6 +8,8 @@ CPU can starve traffic from all other CPUs.
 Work around this issue by forcing all tx packets to go through one CPU,
 until this issue is fixed properly.
 
+Ref: https://github.com/openwrt/openwrt/issues/5411
+
 Signed-off-by: Felix Fietkau 
 ---
 --- a/drivers/net/ethernet/marvell/mvneta.c
-- 
2.43.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3] ramips: mt76x8: add support for TP-Link RE365 v1

2024-01-10 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

TP-Link RE365 is a wireless range extender, hardware-wise resembles
RE305 with slight changes regarding buttons and LEDs.

Specification
SoC: MediaTek MT7628AN
RAM: 64 MiB DDR2
Flash: 8 MiB SPI NOR
WiFi: 2.4 GHz 2T2R integrated
  5 GHz 2T2R MediaTek MT7612EN conncted to PCIe lanes
Ethernet: 1x 10/100 Mbps integrated
LEDs: 6x GPIO controlled
Buttons: 4x GPIO controlled
UART: row of 4 holes marked on PCB as J1, starting count from white
  triangle
  1. VCC (3.3V), 2. GND, 3. RX, 4. TX
  baud: 57600, parity: none, flow control: none

Installation
1. Open web management interface.
2. Go to Settings > System Tools > Firmware upgrade.
3. Select "Browse" and select the OpenWrt image with factory.bin suffix.
4. After selecting "Upgrade" firmware writing process will start.
5. Wait till device reboots, power LED should stay solid when it's fully
   booted, then it's ready for configuration through LAN port.

Additional information
With how device manufacturer patrtitioned the flash memory, it's possible
that with default packages set, initial factory.bin image won't be
created. In such case, try to reduce packages amount or use older release
for initial conversion to OpenWrt. Later You can use sysupgrade.bin
image with full set of packages because OpenWrt uses unpartitioned flash
memory space unused by vendor firmware.

Reverting to vendor firmware involves converting firmware using
tplink-safeloader with -z option (can be found in ImageBuilder or SDK)
and forcibly applying converted firmware as sysupgrade.

Known issues
WARNING: after removing casing of the device one is exposed to high
voltage and is in a risk of being electrocuted.

Caution when interfacing whith bootloader, saving its environment either
by issuing "saveenv" or selecting option "1: Load system code to SDRAM
via TFTP." in boot menu, any of those will lead to overwriting part of
kernel. This will lead to need of firmware recovery. The cause of this
issue is bootloader having environment offset on flash at 0x4,
while kernel starts from 0x2.

Signed-off-by: Tomasz Maciej Nowak 
---
v2 -> v3
- list virtual flash devices as separate objects
- add kernel size restriction

 .../ramips/dts/mt7628an_tplink_re365-v1.dts   | 213 ++
 target/linux/ramips/image/mt76x8.mk   |  12 +
 .../mt76x8/base-files/etc/board.d/01_leds |   3 +
 .../mt76x8/base-files/etc/board.d/02_network  |   1 +
 4 files changed, 229 insertions(+)
 create mode 100644 target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts

diff --git a/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts 
b/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts
new file mode 100644
index ..5743ae1bbc5c
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7628an.dtsi"
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "TP-Link RE365 v1";
+   compatible = "tplink,re365-v1", "mediatek,mt7628an-soc";
+
+   aliases {
+   led-boot = _power;
+   led-failsafe = _power;
+   led-running = _power;
+   led-upgrade = _power;
+   label-mac-device = 
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   button-led {
+   label = "led";
+   gpios = < 44 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-power {
+   label = "power";
+   gpios = < 11 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-reset {
+   label = "reset";
+   gpios = < 37 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-wps {
+   label = "wps";
+   gpios = < 38 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led-lan {
+   color = ;
+   function = LED_FUNCTION_LAN;
+   gpios = < 4 GPIO_ACTIVE_LOW>;
+   };
+
+   led_power: led-power {
+   color = ;
+   function = LED_FUNCTION_POWER;
+   gpios = < 39 GPIO_ACTIVE_LOW>;
+   panic-indicator;
+   };
+
+   led-rssi-bad {
+   color = ;
+   function = LED_FUNCTION_INDICATOR;
+   gpios = < 43 GPIO_ACTIVE_HIGH>;
+   };
+
+   led-rssi-good 

[PATCH] ramips: mt76x8: enable small_flash feature

2024-01-10 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some of devices in this target have only 8 MiB space and are closing to
borders of usable space. Particularly, TP-Link RE305 v1 already suffers
from this issue[1], where with current partition layout, on release
images, there's not enough space for overlay. So activate small_flash
feature, which will remove some userspace hardening but will gain almost
1 MiB additional flash memory space. Here is small size comparison of
similar device (RE365 v1) with default config + LuCI:

kernel  rootfs  sysupgrade
current:2305728 3635044 5964584
small_flash:1713571 3320132 5047080

1. https://github.com/openwrt/openwrt/issues/14215

Suggested-by: Sander Vanheule 
Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ramips/mt76x8/target.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/mt76x8/target.mk 
b/target/linux/ramips/mt76x8/target.mk
index 862736cb2f38..cfc2655cac18 100644
--- a/target/linux/ramips/mt76x8/target.mk
+++ b/target/linux/ramips/mt76x8/target.mk
@@ -4,7 +4,7 @@
 
 SUBTARGET:=mt76x8
 BOARDNAME:=MT76x8 based boards
-FEATURES+=usb ramdisk
+FEATURES+=usb ramdisk small_flash
 CPU_TYPE:=24kc
 
 DEFAULT_PACKAGES += kmod-mt7603 wpad-basic-mbedtls swconfig
-- 
2.43.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2] ramips: mt76x8: add support for TP-Link RE365 v1

2024-01-07 Thread Tomasz Maciej Nowak
W dniu 7.01.2024 o 14:06, Sander Vanheule pisze:
> Hi Tomasz,
> 
> On Fri, 2023-12-22 at 11:36 +0100, Tomasz Maciej Nowak wrote:
>> From: Tomasz Maciej Nowak 
>>
>> TP-Link RE365 is a wireless range extender, hardware-wise resembles
>> RE305 with slight changes regarding buttons and LEDs.
>>
>> Specification
>> SoC: MediaTek MT7628AN
>> RAM: 64 MiB DDR2
>> Flash: 8 MiB SPI NOR
> 
> Ouch.

Indeed

> 
>> WiFi: 2.4 GHz 2T2R integrated
>>   5 GHz 2T2R MediaTek MT7612EN conncted to PCIe lanes
>> Ethernet: 1x 10/100 Mbps integrated
>> LEDs: 6x GPIO controlled
>> Buttons: 4x GPIO controlled
>> UART: row of 4 holes marked on PCB as J1, starting count from white
>>   triangle
>>   1. VCC (3.3V), 2. GND, 3. RX, 4. TX
>>   baud: 57600, parity: none, flow control: none
>>
>> Installation
>> 1. Open web management interface.
>> 2. Go to Settings > System Tools > Firmware upgrade.
>> 3. Select "Browse" and select the OpenWrt image with factory.bin suffix.
>> 4. After selecting "Upgrade" firmware writing process will start.
>> 5. Wait till device reboots, power LED should stay solid when it's fully
>>    booted, then it's ready for configuration through LAN port.
> 
> [...]
> 
>> +
>> +virtual_flash {
>> +compatible = "mtd-concat";
>> +devices = < >;
> 
> Both have the same representation in the resulting DTB, but this is a list, 
> so:
>   devices = <>, <>;

ACK.

> 
> [...]
> 
>> + {
>> +status = "okay";
>> +
>> +flash@0 {
>> +compatible = "jedec,spi-nor";
>> +reg = <0>;
>> +spi-max-frequency = <1000>;
>> +
>> +partitions {
>> +compatible = "fixed-partitions";
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +
>> +partition@0 {
>> +label = "u-boot";
>> +reg = <0x0 0x2>;
>> +read-only;
>> +};
>> +
>> +fwconcat0: partition@2 {
>> +label = "fwconcat0";
>> +reg = <0x2 0x5e>;
>> +};
> 
> Since this is where the bootloader is going to look for a kernel, I'm pretty 
> sure the
> kernel will need to be contained entirely in this partition (or you need a 
> kernel loader).
> That would mean it must fit inside 6016 kiB.

Yes, I forgot to limit the kernel size. TBF I don't think our kernel loader has 
support for split kerne chunks.

> 
> [...]
> 
>> +define Device/tplink_re365-v1
>> +  $(Device/tplink-safeloader)
>> +  DEVICE_MODEL := RE365
>> +  DEVICE_VARIANT := v1
>> +  DEVICE_PACKAGES := kmod-mt76x2
>> +  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
>> check-size |
>> append-metadata
>> +  IMAGE_SIZE := 7680k
> 
> So you will probably need two check-size calls here:
> 
>   IMAGE/sysupgrade.bin := append-kernel | check-size 6016k | \
>   append-rootfs | pad-rootfs | check-size | append-metadata

I'll add KERNEL_SIZE, should be sufficient. Will need to check if it'll work
as I think it does, or I did miss something.

> Side note: You're definitely not the only one with flash constraints on 
> mt76x8, so I
> wonder if a small-flash configuration/package selection would make sense.

Yes, that is really needed. There is already a report for RE305[1] which has 
same
vendor partition layout, where overlay is too small. If I add LuCI to current
master, factory image isn't created for RE365 (I'll need to backport this patch
to 23.05, so there will be a permanent factory image for initial installation).

1. https://github.com/openwrt/openwrt/issues/14215

> 
> Best,
> Sander

Thank for the review. I'll send v3 after testing and will check how much we gain
when small flash is set.

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] ramips: mt76x8: add support for TP-Link RE365 v1

2023-12-22 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

TP-Link RE365 is a wireless range extender, hardware-wise resembles
RE305 with slight changes regarding buttons and LEDs.

Specification
SoC: MediaTek MT7628AN
RAM: 64 MiB DDR2
Flash: 8 MiB SPI NOR
WiFi: 2.4 GHz 2T2R integrated
  5 GHz 2T2R MediaTek MT7612EN conncted to PCIe lanes
Ethernet: 1x 10/100 Mbps integrated
LEDs: 6x GPIO controlled
Buttons: 4x GPIO controlled
UART: row of 4 holes marked on PCB as J1, starting count from white
  triangle
  1. VCC (3.3V), 2. GND, 3. RX, 4. TX
  baud: 57600, parity: none, flow control: none

Installation
1. Open web management interface.
2. Go to Settings > System Tools > Firmware upgrade.
3. Select "Browse" and select the OpenWrt image with factory.bin suffix.
4. After selecting "Upgrade" firmware writing process will start.
5. Wait till device reboots, power LED should stay solid when it's fully
   booted, then it's ready for configuration through LAN port.

Additional information
With how device manufacturer patrtitioned the flash memory, it's possible
that with default packages set, initial factory.bin image won't be
created. In such case, try to reduce packages amount or use older release
for initial conversion to OpenWrt. Later You can use sysupgrade.bin
image with full set of packages, because OpenWrt uses unpartitioned flash
memory space unused by vendor firmware.

Reverting to vendor firmware involves converting firmware using
tplink-safeloader with -z option (can be found in ImageBuilder or SDK)
and forcibly applying converted firmware as sysupgrade.

Known issues
WARNING: after removing casing of the device one is exposed to high
voltage and is in a risk of being electrocuted.

Caution when interfacing whith bootloader, saving its environment either
by issuing "saveenv" or selecting option "1: Load system code to SDRAM
via TFTP." in boot menu, one of those will lead to overwriting part of
kernel. This will lead to need of firmware recovery. The cause of this
issue is bootloader having environment offset on flash at 0x4 while
kernel starts from 0x2.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
correct commit message, obviously "2: Load system code then write to
Flash via TFTP." will overwrite kernel, so replace it with intended
content "1: Load system code to SDRAM via TFTP."

 .../ramips/dts/mt7628an_tplink_re365-v1.dts   | 213 ++
 target/linux/ramips/image/mt76x8.mk   |  11 +
 .../mt76x8/base-files/etc/board.d/01_leds |   3 +
 .../mt76x8/base-files/etc/board.d/02_network  |   1 +
 4 files changed, 228 insertions(+)
 create mode 100644 target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts

diff --git a/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts 
b/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts
new file mode 100644
index ..50999ab6b229
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7628an.dtsi"
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "TP-Link RE365 v1";
+   compatible = "tplink,re365-v1", "mediatek,mt7628an-soc";
+
+   aliases {
+   led-boot = _power;
+   led-failsafe = _power;
+   led-running = _power;
+   led-upgrade = _power;
+   label-mac-device = 
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   button-led {
+   label = "led";
+   gpios = < 44 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-power {
+   label = "power";
+   gpios = < 11 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-reset {
+   label = "reset";
+   gpios = < 37 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-wps {
+   label = "wps";
+   gpios = < 38 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led-lan {
+   color = ;
+   function = LED_FUNCTION_LAN;
+   gpios = < 4 GPIO_ACTIVE_LOW>;
+   };
+
+   led_power: led-power {
+   color = ;
+   function = LED_FUNCTION_POWER;
+   gpios = < 39 GPIO_ACTIVE_LOW>;
+   panic-indicator;
+   };
+
+   led-rssi-bad {
+   color = ;
+   funct

[PATCH firmware-utils] tplink-safeloader: add RE365 v1

2023-12-21 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Partition layout same as RE305 v1. Values extracted from vendor
firmware. This will only be used for creating factory image.

Signed-off-by: Tomasz Maciej Nowak 
---
 src/tplink-safeloader.c | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
index 695550f287c8..3dc470d93ec7 100644
--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -2989,6 +2989,44 @@ static struct device_info boards[] = {
.last_sysupgrade_partition = "file-system"
},
 
+   /** Firmware layout for the RE365 v1 */
+   {
+   .id = "RE365",
+   .vendor = "",
+   .support_list =
+   "SupportList:\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4555}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:5553}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4a50}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4252}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4b52}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4155}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4341}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:5457}\r\n"
+   
"{product_name:RE365,product_ver:1.0.0,special_id:4153}\r\n",
+   .part_trail = 0x00,
+   .soft_ver = SOFT_VER_DEFAULT,
+
+   .partitions = {
+   {"fs-uboot", 0x0, 0x2},
+   {"firmware", 0x2, 0x5e},
+   {"partition-table", 0x60, 0x02000},
+   {"default-mac", 0x61, 0x00020},
+   {"pin", 0x610100, 0x00020},
+   {"product-info", 0x611100, 0x01000},
+   {"soft-version", 0x62, 0x01000},
+   {"support-list", 0x621000, 0x01000},
+   {"profile", 0x622000, 0x08000},
+   {"user-config", 0x63, 0x1},
+   {"default-config", 0x64, 0x1},
+   {"radio", 0x7f, 0x1},
+   {NULL, 0, 0}
+   },
+
+   .first_sysupgrade_partition = "os-image",
+   .last_sysupgrade_partition = "file-system"
+   },
+
/** Firmware layout for the RE450 */
{
.id = "RE450",
-- 
2.43.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips: mt76x8: add support for TP-Link RE365 v1

2023-12-21 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

TP-Link RE365 is a wireless range extender, hardware-wise similar to
RE305 with slight changes regarding buttons and LEDs.

Specification
SoC: MediaTek MT7628AN
RAM: 64 MiB DDR2
Flash: 8 MiB SPI NOR
WiFi: 2.4 GHz 2T2R integrated
  5 GHz 2T2R MediaTek MT7612EN conncted to PCIe lanes
Ethernet: 1x 10/100 Mbps integrated
LEDs: 6x GPIO controlled
Buttons: 4x GPIO controlled
UART: row of 4 holes marked on PCB as J1, starting count from white
  triangle
  1. VCC (3.3V), 2. GND, 3. RX, 4. TX
  baud: 57600, parity: none, flow control: none

Installation
1. Open web management interface.
2. Go to Settings > System Tools > Firmware upgrade.
3. Select "Browse" and select the OpenWrt image with factory.bin suffix.
4. After selecting "Upgrade" firmware writing process will start.
5. Wait till device reboots, power LED should stay solid when it's fully
   booted, then it's ready for configuration through LAN port.

Additional information
With how device manufacturer patrtitioned the flash memory, it's possible
that with default packages set, initial factory.bin image won't be
created. In such case, try to reduce packages amount or use older release
for initial conversion to OpenWrt. Later You can use sysupgrade.bin
image with full set of packages because OpenWrt uses unpartitioned flash
memory space unused by vendor firmware.

Reverting to vendor firmware involves converting firmware using
tplink-safeloader with -z option (can be found in ImageBuilder or SDK)
and forcibly applying converted firmware as sysupgrade.

Known issues
WARNING: after removing casing of the device one is exposed to high
voltage and is in a risk of being electrocuted.

Caution when interfacing whith bootloader, saving its environment either
by issuing "saveenv" or selecting option "2: Load system code then write
to Flash via TFTP." in boot menu, one of those will lead to overwriting
part of kernel. This will lead to need of firmware recovery. The cause
of this issue is bootloader having environment offset on flash at 0x4
while kernel starts from 0x2.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../ramips/dts/mt7628an_tplink_re365-v1.dts   | 213 ++
 target/linux/ramips/image/mt76x8.mk   |  11 +
 .../mt76x8/base-files/etc/board.d/01_leds |   3 +
 .../mt76x8/base-files/etc/board.d/02_network  |   1 +
 4 files changed, 228 insertions(+)
 create mode 100644 target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts

diff --git a/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts 
b/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts
new file mode 100644
index ..50999ab6b229
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_tplink_re365-v1.dts
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7628an.dtsi"
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "TP-Link RE365 v1";
+   compatible = "tplink,re365-v1", "mediatek,mt7628an-soc";
+
+   aliases {
+   led-boot = _power;
+   led-failsafe = _power;
+   led-running = _power;
+   led-upgrade = _power;
+   label-mac-device = 
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   button-led {
+   label = "led";
+   gpios = < 44 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-power {
+   label = "power";
+   gpios = < 11 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-reset {
+   label = "reset";
+   gpios = < 37 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   button-wps {
+   label = "wps";
+   gpios = < 38 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led-lan {
+   color = ;
+   function = LED_FUNCTION_LAN;
+   gpios = < 4 GPIO_ACTIVE_LOW>;
+   };
+
+   led_power: led-power {
+   color = ;
+   function = LED_FUNCTION_POWER;
+   gpios = < 39 GPIO_ACTIVE_LOW>;
+   panic-indicator;
+   };
+
+   led-rssi-bad {
+   color = ;
+   function = LED_FUNCTION_INDICATOR;
+   gpios = < 43 GPIO_ACTIVE_HIGH>;
+   };
+
+   led-rssi-good {
+   color = ;
+   function = LED_FUNC

Re: [PATCH v4 5/7] ixp4xx: Resurrect IXP4xx support using device tree

2023-10-24 Thread Tomasz Maciej Nowak
W dniu 23.10.2023 o 08:43, Linus Walleij pisze:
> This resurrects the support for IXP4xx using device tree
> rather than the old (deleted) board files. The final pieces
> of IXP4xx board files were deleted in Linux v5.19.
> 
> Ext4 root filesystems on CF and USB are supported by the
> default config.
> 
> We support these three initial targets:
> 
> - The Gateworks Avila GW2348 reference design has 64MB of RAM
>   and 32MB of flash and also supports USB and CompactFlash.
> 
> - The Gateworks Cambria GW2358 reference design has 128MB of
>   RAM and 32MB of flash and also supports USB and CompactFlash.
> 
> - The old and stable Linksys NSLU2 works fine as well, albeit
>   it only has 32MB of RAM so it has been marked as non-default.
>   The 8MB of flash can only fit the kernel, so it has been
>   patched to boot from exteral media on USB. I have used
>   it successfully as a NAS with ksmbd and LUCI web API, see:
>   https://dflund.se/~triad/krad/ixp4xx/
> 
> Signed-off-by: Howard Harte 
> Signed-off-by: Linus Walleij 

Thank You for following suggestions, with that:
Reviewed-by: Tomasz Maciej Nowak 

> ---
> ChangeLog v2->v3:
> - Don't add the apex package on the NSLU2, the dependency
>   is resolved in the other direction, apex should only build
>   itself for the targets that need it.
> - Alter the path for the apex binaries slightly.
> - Split out resurrection of the microcode package to its
>   own patch.
> - Use only the ip command and not both ip and ifconfig in
>   the MAC setup script.
> - Drop unsupported device from the MAC setup script.
> - Name devices with device tuples like gateworks_avila.
> - Fix name confusion Gateway -> Gateworks.
> ChangeLog v1->v2:
> - Have NSLU2 select the apex boot loader instead of having
>   it default built for all targets.
> - SPDX header for the microcode package.
> - Set microcode package version back to 1.
> - Split the microcode firmware package in two, one for
>   just regular ethernet, one for WAN/HSS and select the
>   right package for each device, ridding us one useless
>   firmware file per device.
> - Cleanup Kconfig using make kernel_oldconfig.
> - Remove several surplus kernel Kconfig options, some
>   pointless 8250 extensions for example.
> - Drop all the RTCs from the Kconfig and use the corresponding
>   kernel modules for each device instead, saving space.
> - Drop all the HWMON drivers from the Kconfig and use the
>   corresponding kernel modules for each device instead.
> - Use a kernel module for EEPROM access on Gateworks devices.
> - Fold in an ethernet numbering fix from Howard Harte
> - Activate Marvell MV88E6060 DSA switch as used by
>   USRobotics USR8200.
> ---
>  target/linux/ixp4xx/Makefile   |  27 +++
>  .../linux/ixp4xx/base-files/etc/board.d/02_network |  21 ++
>  .../base-files/lib/preinit/05_set_ether_mac_ixp4xx |  38 
>  target/linux/ixp4xx/config-6.1 | 252 
> +
>  target/linux/ixp4xx/image/Makefile |  77 +++
>  ...01-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch |  74 ++
>  ...-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch |  24 ++
>  7 files changed, 513 insertions(+)

[...]

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 0/9] Resurrect OpenWrt IXP4xx support

2023-10-04 Thread Tomasz Maciej Nowak
W dniu 4.10.2023 o 19:11, Jonas Gorski pisze:
> Hi,
> 
> On Thu, 28 Sept 2023 at 15:29, Linus Walleij  wrote:
>>
>> XP4xx was deleted because of lack of maintenance in 2020.
>>
>> In the years since, the upstream Linux support for IXP4xx has
>> been rewritten from scratch. It is now pretty well supported
>> using device tree and modern subsystems that didn't exist
>> 20 years ago when the first IXP4xx port was done.
>>
>> With the switch to kernel v6.1, OpenWrt has the required
>> baseline to bring IXP4xx back.
>>
>> With the (suspiciously similarly named!) IPQ4xxx now supporting
>> v6.1 exclusively, the door should be open for IXP4xx!
>>
>> This is a reimplementation of the IXP4xx support which is
>> using all the contemporary abstractions, the only thing
>> actually resurrected is the APEX boot loader. The port is
>> thus "slim" and not patching a lot on the mainline kernel
>> as pretty much everything is upstream.
>>
>> As a starter, we bring back two Gateworks reference designs,
>> one for IXP42x and one for IXP43x, and the classic NSLU2
>> NAS. We also bring back USRobotics USR8200 because it has
>> active users and testers.
>>
>> Here you find binaries and illustrations if you want to check
>> out how the support works right now, if you have an NSLU2
>> you can flash the binary and rootfs and it "just works",
>> though NSLU2 is not a default build:
>> https://dflund.se/~triad/krad/ixp4xx/
>>
>> Thanks to Imre Kaloz add Krzysztof Halasa for all cheering
>> and reference designs :)
>>
>> Thanks to Howard Harte and Joseph for stepping in and helping
>> out with device support and debugging.
>>
>> Thanks for Hauke for the the in-depth review of the v1
>> patch set.
>>
>> I am pretty confident that we can bring back any IXP4xx with
>> this, they just need some time and focus. I will add more
>> routers as time permits.
>>
>> I don't know who can import this from patches or pull request:
>> it may be best if I just apply for commit access to the
>> OpenWrt git repository and import it myself perhaps?
> 
> Fails to build for me when enabling all kmods:
> 
> Package kmod-crypto-lib-chacha20poly1305 is missing dependencies for
> the following libraries:
> chacha-neon.ko
> poly1305-arm.ko
> make[3]: *** [modules/crypto.mk:570:
> /home/jonas/git/openwrt/bin/targets/ixp4xx/generic/packages/kmod-crypto-lib-chacha20poly1305_6.1.55-1_armeb_xscale.ipk]
> Error 1

This is because armeb is not defined in crypto.mk, fix should  look something 
like
this:

--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -517,6 +517,8 @@ define KernelPackage/crypto-lib-chacha20/mips32r2
   FILES:=$(LINUX_DIR)/arch/mips/crypto/chacha-mips.ko
 endef
 
+KernelPackage/crypto-lib-chacha20/armeb=$(KernelPackage/crypto-lib-chacha20/arm)
+
 ifeq ($(CONFIG_CPU_MIPS32_R2),y)
   KernelPackage/crypto-lib-chacha20/$(ARCH)=\
  $(KernelPackage/crypto-lib-chacha20/mips32r2)
@@ -610,6 +612,7 @@ define KernelPackage/crypto-lib-poly1305/mips
   FILES:=$(LINUX_DIR)/arch/mips/crypto/poly1305-mips.ko
 endef
 
+KernelPackage/crypto-lib-poly1305/armeb=$(KernelPackage/crypto-lib-poly1305/arm)
 
KernelPackage/crypto-lib-poly1305/mipsel=$(KernelPackage/crypto-lib-poly1305/mips)
 
KernelPackage/crypto-lib-poly1305/mips64=$(KernelPackage/crypto-lib-poly1305/mips)
 
KernelPackage/crypto-lib-poly1305/mips64el=$(KernelPackage/crypto-lib-poly1305/mips)

For the record, pushing this repository to GitHub (no need to create PR) will
trigger various checks which could show this error.

Regards

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 5/9] ixp4xx: Resurrect IXP4xx support using device tree

2023-10-04 Thread Tomasz Maciej Nowak
Hi,
some comments inline.

W dniu 28.09.2023 o 15:28, Linus Walleij pisze:
> This resurrects the support for IXP4xx using device tree
> rather than the old (deleted) board files. The final pieces
> of IXP4xx board files were deleted in Linux v5.19.
> 
> Ext4 root filesystems on CF and USB are supported by the
> default config.
> 
> We support these three initial targets:
> 
> - The Gateworks Avila GW2348 reference design has 64MB of RAM
>   and 32MB of flash and also supports USB and CompactFlash.
> 
> - The Gateworks Cambria GW2358 reference design has 128MB of
>   RAM and 32MB of flash and also supports USB and CompactFlash.
> 
> - The old and stable Linksys NSLU2 works fine as well, albeit
>   it only has 32MB of RAM so it has been marked as non-default.
>   The 8MB of flash can only fit the kernel, so it has been
>   patched to boot from exteral media on USB. I have used
>   it successfully as a NAS with ksmbd and LUCI web API, see:
>   https://dflund.se/~triad/krad/ixp4xx/

What I'm lacking is sysupgrade image. Currently, as I see it, if kernel grows
beyond what's stored in FIS table, user will need to go back to bootloader 
console
to update whole system. That's not very convenient. We have devices with RedBoot
which support sysupgrade, alas only for devices which have FIS table and RedBoot
config on separate erase block, if that's the case for ones in this target,
check how we create sysupgrade image for adtran_bsap1880 in ath79 target.
The paths of interest would be:
target/linux/ath79/image/generic.mk
target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
target/linux/ath79/generic/base-files/lib/upgrade/redboot-fis.sh

The "slug" seems to be different one, but it has access to the flash from 
running
OpenWrt, so definitely sysupgrade path could be created for it.

> 
> Signed-off-by: Howard Harte 
> Signed-off-by: Linus Walleij 
> ---
> ChangeLog v1->v2:
> - Have NSLU2 select the apex boot loader instead of having
>   it default built for all targets.
> - SPDX header for the microcode package.
> - Set microcode package version back to 1.
> - Split the microcode firmware package in two, one for
>   just regular ethernet, one for WAN/HSS and select the
>   right package for each device, ridding us one useless
>   firmware file per device.
> - Cleanup Kconfig using make kernel_oldconfig.
> - Remove several surplus kernel Kconfig options, some
>   pointless 8250 extensions for example.
> - Drop all the RTCs from the Kconfig and use the corresponding
>   kernel modules for each device instead, saving space.
> - Drop all the HWMON drivers from the Kconfig and use the
>   corresponding kernel modules for each device instead.
> - Use a kernel module for EEPROM access on Gateworks devices.
> - Fold in an ethernet numbering fix from Howard Harte
> - Activate Marvell MV88E6060 DSA switch as used by
>   USRobotics USR8200.
> ---
>  package/firmware/ixp4xx-microcode/Makefile |  77 +++
>  .../firmware/ixp4xx-microcode/src/IxNpeMicrocode.h | 148 
>  package/firmware/ixp4xx-microcode/src/LICENSE.IPL  |  27 +++
>  target/linux/ixp4xx/Makefile   |  27 +++
>  .../linux/ixp4xx/base-files/etc/board.d/02_network |  21 ++
>  .../base-files/lib/preinit/05_set_ether_mac_ixp4xx |  45 
>  target/linux/ixp4xx/config-6.1 | 252 
> +
>  target/linux/ixp4xx/image/Makefile |  76 +++
>  ...01-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch |  74 ++
>  ...-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch |  24 ++
>  10 files changed, 771 insertions(+)
> 

[...]

> diff --git 
> a/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx 
> b/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx
> new file mode 100644
> index ..2feacbfe313e
> --- /dev/null
> +++ b/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx
> @@ -0,0 +1,45 @@
> +#!/bin/sh
> +. /lib/functions.sh
> +. /lib/functions/system.sh
> +
> +set_from_redboot () {
> + for npe in eth0 eth1 eth2
> + do
> + if ifconfig $npe > /dev/null 2>&1; then

Small nitpick, here "ifconfig" but later "ip", I know it's just an applet
but some consistency would be nice.

> + ip link set dev $npe address $(fconfig -s -r -d /dev/$1 
> -n npe_"$npe"_esa)
> + fi
> + done
> +
> + # -- Fixup for the WG302v1, need someone with a WAG302v1 to fix that, 
> too

Patch doesn't introduce support for this board, so remove cases for boards which
are not included in this patch.

> +
> + if [ "$(ifconfig eth0 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" 
> ]; then
> + ip link set dev $npe address $(fconfig -s -r -d /dev/$1 -n 
> zcom_npe_esa)
> + fi
> +
> + # Others (*cough*, Tonze) are not handling mac addresses at all
> +
> + if [ "$(ifconfig eth0 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" 
> ]; then
> + ip link set dev eth0 address 

[PATCH 23.05] mvebu: cortexa72: enable USB PHY

2023-09-20 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Since kernel 5.13 this is needed to enable USB ports on all devices in
subtarget. Previously TF-A and COMPHY driver might have set up this PHY,
but not anymore.

Signed-off-by: Tomasz Maciej Nowak 
Tested-by: Robert Marko 
(cherry picked from commit eac192843030d16046a0d603284c2b4c89822431)
---
 target/linux/mvebu/cortexa72/config-5.15 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/mvebu/cortexa72/config-5.15 
b/target/linux/mvebu/cortexa72/config-5.15
index cb27e0285faa..978208f1cb5a 100644
--- a/target/linux/mvebu/cortexa72/config-5.15
+++ b/target/linux/mvebu/cortexa72/config-5.15
@@ -72,6 +72,7 @@ CONFIG_PCIE_DW_HOST=y
 CONFIG_PGTABLE_LEVELS=3
 CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_PHY_MVEBU_CP110_COMPHY=y
+CONFIG_PHY_MVEBU_CP110_UTMI=y
 CONFIG_PINCTRL_ARMADA_37XX=y
 CONFIG_PINCTRL_ARMADA_AP806=y
 CONFIG_PINCTRL_ARMADA_CP110=y
-- 
2.42.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/2] mvebu: cortexa72: enable USB PHY

2023-09-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Since kernel 5.13 this is needed to enable USB ports on all devices in
subtarget. Previously TF-A and COMPHY driver might have set up this PHY,
but not anymore.

Signed-off-by: Tomasz Maciej Nowak 
---
Please backport config-5.15 changes to 23.05 and 22.03 branches.

 target/linux/mvebu/cortexa72/config-5.15 | 1 +
 target/linux/mvebu/cortexa72/config-6.1  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/mvebu/cortexa72/config-5.15 
b/target/linux/mvebu/cortexa72/config-5.15
index cb27e0285faa..978208f1cb5a 100644
--- a/target/linux/mvebu/cortexa72/config-5.15
+++ b/target/linux/mvebu/cortexa72/config-5.15
@@ -72,6 +72,7 @@ CONFIG_PCIE_DW_HOST=y
 CONFIG_PGTABLE_LEVELS=3
 CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_PHY_MVEBU_CP110_COMPHY=y
+CONFIG_PHY_MVEBU_CP110_UTMI=y
 CONFIG_PINCTRL_ARMADA_37XX=y
 CONFIG_PINCTRL_ARMADA_AP806=y
 CONFIG_PINCTRL_ARMADA_CP110=y
diff --git a/target/linux/mvebu/cortexa72/config-6.1 
b/target/linux/mvebu/cortexa72/config-6.1
index 5a3dcc66f720..535b67225e70 100644
--- a/target/linux/mvebu/cortexa72/config-6.1
+++ b/target/linux/mvebu/cortexa72/config-6.1
@@ -76,6 +76,7 @@ CONFIG_PCIE_DW_HOST=y
 CONFIG_PGTABLE_LEVELS=3
 CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_PHY_MVEBU_CP110_COMPHY=y
+CONFIG_PHY_MVEBU_CP110_UTMI=y
 CONFIG_PINCTRL_AC5=y
 CONFIG_PINCTRL_ARMADA_37XX=y
 CONFIG_PINCTRL_ARMADA_AP806=y
-- 
2.42.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] mvebu: refresh 6.1 configs

2023-09-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This should be a part of kernel major bump. Fortunately it didn't stall
compilation, so no fixes tag.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/config-6.1   | 26 ++---
 target/linux/mvebu/cortexa53/config-6.1 | 10 +-
 target/linux/mvebu/cortexa72/config-6.1 | 11 +--
 target/linux/mvebu/cortexa9/config-6.1  |  5 +
 4 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/target/linux/mvebu/config-6.1 b/target/linux/mvebu/config-6.1
index 0811ee6d4ce0..88e5fff4d999 100644
--- a/target/linux/mvebu/config-6.1
+++ b/target/linux/mvebu/config-6.1
@@ -29,13 +29,11 @@ CONFIG_ARM_ATAG_DTB_COMPAT=y
 # CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
 CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y
 CONFIG_ARM_CPU_SUSPEND=y
-CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_720789=y
 CONFIG_ARM_ERRATA_764369=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_GLOBAL_TIMER=y
 CONFIG_ARM_GT_INITIAL_PRESCALER_VAL=1
-CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
@@ -58,11 +56,17 @@ CONFIG_BLK_MQ_PCI=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_FEROCEON_L2 is not set
 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_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_COMMON_CLK=y
+CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
 CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_CONTEXT_TRACKING=y
+CONFIG_CONTEXT_TRACKING_IDLE=y
 CONFIG_CPUFREQ_DT=y
 CONFIG_CPUFREQ_DT_PLATDEV=y
 CONFIG_CPU_32v6K=y
@@ -111,7 +115,10 @@ CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_CRYPTO_ESSIV=y
 CONFIG_CRYPTO_HASH_INFO=y
 CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
 CONFIG_CRYPTO_LIB_DES=y
+CONFIG_CRYPTO_LIB_SHA1=y
+CONFIG_CRYPTO_LIB_UTILS=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_SHA1=y
@@ -133,18 +140,17 @@ CONFIG_DEBUG_UART_8250=y
 CONFIG_DEBUG_UART_8250_SHIFT=2
 CONFIG_DEBUG_UART_PHYS=0xd0012000
 CONFIG_DEBUG_UART_VIRT=0xfec12000
-CONFIG_DEBUG_UNCOMPRESS=y
 CONFIG_DEBUG_USER=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_ENGINE_RAID=y
 CONFIG_DMA_OF=y
 CONFIG_DMA_OPS=y
-CONFIG_DMA_REMAP=y
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=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
@@ -154,6 +160,8 @@ CONFIG_FS_IOMAP=y
 CONFIG_FS_MBCACHE=y
 CONFIG_FWNODE_MDIO=y
 CONFIG_FW_LOADER_PAGED_BUF=y
+CONFIG_FW_LOADER_SYSFS=y
+CONFIG_GCC11_NO_ARRAY_BOUNDS=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ARCH_TOPOLOGY=y
 CONFIG_GENERIC_BUG=y
@@ -182,7 +190,6 @@ CONFIG_GENERIC_STRNLEN_USER=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GENERIC_VDSO_32=y
 CONFIG_GLOB=y
-CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_CDEV=y
 CONFIG_GPIO_GENERIC=y
@@ -191,7 +198,6 @@ CONFIG_GPIO_MVEBU=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GRO_CELLS=y
-CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
@@ -315,6 +321,9 @@ CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PADATA=y
 CONFIG_PAGE_OFFSET=0xC000
 CONFIG_PAGE_POOL=y
+CONFIG_PAGE_POOL_STATS=y
+CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
+CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
 CONFIG_PCI=y
 CONFIG_PCI_BRIDGE_EMUL=y
 CONFIG_PCI_DOMAINS=y
@@ -330,7 +339,6 @@ CONFIG_PHYLINK=y
 # CONFIG_PHY_MVEBU_A3700_UTMI is not set
 # CONFIG_PHY_MVEBU_A38X_COMPHY is not set
 # CONFIG_PHY_MVEBU_CP110_COMPHY is not set
-# CONFIG_PHY_MVEBU_CP110_UTMI is not set
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_ARMADA_370=y
 CONFIG_PINCTRL_ARMADA_38X=y
@@ -343,9 +351,11 @@ CONFIG_PLAT_ORION=y
 CONFIG_PM_OPP=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_GPIO=y
+CONFIG_PREEMPT_NONE_BUILD=y
 CONFIG_PTP_1588_CLOCK_OPTIONAL=y
 CONFIG_PWM=y
 CONFIG_PWM_SYSFS=y
+CONFIG_RANDSTRUCT_NONE=y
 CONFIG_RATIONAL=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_I2C=y
@@ -381,6 +391,7 @@ CONFIG_SMP=y
 CONFIG_SMP_ON_UP=y
 CONFIG_SOCK_RX_QUEUE_MAPPING=y
 CONFIG_SOC_BUS=y
+CONFIG_SOFTIRQ_ON_OWN_STACK=y
 CONFIG_SPARSE_IRQ=y
 CONFIG_SPI=y
 # CONFIG_SPI_ARMADA_3700 is not set
@@ -431,5 +442,6 @@ CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
+CONFIG_ZSTD_COMMON=y
 CONFIG_ZSTD_COMPRESS=y
 CONFIG_ZSTD_DECOMPRESS=y
diff --git a/target/linux/mvebu/cortexa53/config-6.1 
b/target/linux/mvebu/cortexa53/config-6.1
index 27d410f68b91..3534537b54ff 100644
--- a/target/linux/mvebu/cortexa53/config-6.1
+++ b/target/linux/mvebu/cortexa53/config-6.1
@@ -1,4 +1,6 @@
 CONFIG_64BIT=y
+CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
+CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
 CONFIG_ARCH_DMA_ADDR_T_64BIT=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 CONFIG_ARCH_MMAP_RND_BITS=18
@@ -8,6 +10,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
 CONFIG_ARCH_PROC_KCORE_TEXT=y
 CONFIG_ARCH_STACKWALK=y
 CONFIG_ARCH_WANTS_NO_INSTR=y
+CONFIG_ARCH_WANTS_

[PATCH 22.03] ath79: image: allow changing kernel option in mkubntimage

2023-08-16 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Backport didn't include changes to mkubntimage invocation, which allowed
to pass arguments. This in result produces broken routerstation factory
images, which have kernel embedded as kernel partition instead of LZMA
loader.

Fixes: #13260
Fixes: 8e09f9ffc3cc ("ath79: switch some RedBoot based devices to OKLI loader")
Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ath79/image/common-ubnt.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ath79/image/common-ubnt.mk 
b/target/linux/ath79/image/common-ubnt.mk
index 625f0b4f3f12..76d6de000ba6 100644
--- a/target/linux/ath79/image/common-ubnt.mk
+++ b/target/linux/ath79/image/common-ubnt.mk
@@ -10,7 +10,7 @@ UBNT_REVISION := $(VERSION_DIST)-$(REVISION)
 define Build/mkubntimage
-$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
-v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) 
\
-   -k $(IMAGE_KERNEL) -r $@ -o $@
+   -k $(if $(1),$(1),$(IMAGE_KERNEL)) -r $@ -o $@
 endef
 
 define Build/mkubntimage2
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/4] tegra: initial kernel 6.1 support

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

- refresh patches
- adjust kernel config, with main change enabling VIDEO_TEGRA_VDE,
  necessary for driving power domain responsible for clean reboot
- adjust LED patch to changes in LED drivers

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/linux/modules/video.mk |  4 +-
 target/linux/tegra/Makefile   |  1 +
 target/linux/tegra/config-6.1 | 77 +--
 ...interrupts-due-to-tegra2-silicon-bug.patch |  2 +-
 ...enable-front-panel-leds-in-TrimSlice.patch | 22 --
 5 files changed, 90 insertions(+), 16 deletions(-)

diff --git a/package/kernel/linux/modules/video.mk 
b/package/kernel/linux/modules/video.mk
index e8a2d479ee03..b0f5c027ed60 100644
--- a/package/kernel/linux/modules/video.mk
+++ b/package/kernel/linux/modules/video.mk
@@ -1058,7 +1058,7 @@ define KernelPackage/video-mem2mem
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=Memory 2 Memory device support
   HIDDEN:=1
-  DEPENDS:=+kmod-video-videobuf2
+  DEPENDS:=@!TARGET_tegra +kmod-video-videobuf2
   KCONFIG:= CONFIG_V4L_MEM2MEM_DRIVERS=y
   FILES:= $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-mem2mem.ko
   AUTOLOAD:=$(call AutoLoad,66,v4l2-mem2mem)
@@ -1075,7 +1075,7 @@ define KernelPackage/video-dma
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=Video DMA support
   HIDDEN:=1
-  DEPENDS:=+kmod-video-videobuf2
+  DEPENDS:=@!TARGET_tegra +kmod-video-videobuf2
   KCONFIG:= \
CONFIG_VIDEOBUF2_DMA_CONTIG \
CONFIG_VIDEOBUF2_DMA_SG
diff --git a/target/linux/tegra/Makefile b/target/linux/tegra/Makefile
index 43ca154e8a08..95d62cf6b0f5 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.1
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/tegra/config-6.1 b/target/linux/tegra/config-6.1
index 257ffda252ad..1f244916 100644
--- a/target/linux/tegra/config-6.1
+++ b/target/linux/tegra/config-6.1
@@ -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
@@ -55,6 +54,8 @@ CONFIG_BLK_MQ_PCI=y
 CONFIG_BLK_PM=y
 CONFIG_BOUNCE=y
 CONFIG_CACHE_L2X0=y
+CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
+CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CLZ_TAB=y
@@ -70,7 +71,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 +101,7 @@ 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_PABRT_V7=y
 CONFIG_CPU_PM=y
 CONFIG_CPU_RMAP=y
@@ -120,7 +125,9 @@ CONFIG_CRYPTO_ECHAINIV=y
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_JITTERENTROPY=y
 CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=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
@@ -137,30 +144,37 @@ 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
 # 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_DEVFREQ_THERMAL is not set
 # 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_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
 CONFIG_DRM_KMS_HELPER=y
 CONFIG_DRM_MIPI_DSI=y
+CONFIG_DRM_NOMODESET=y
 CONFIG_DRM_PANEL=y
 CONFIG_DRM_PANEL_BRIDGE=y
 CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
@@ -170,6 +184,7 @@ 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
@@ -187,6 +202,7 @@ CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FS_IOMAP=y
 CONFIG_FS_MBCACHE=y
 CONFIG_FW_LOADER_PAGED_BUF=y
+CONFIG_FW_LOADER_SYSFS=y
 CONFIG

[PATCH 4/4] tegra: switch to 6.1 kernel

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Testing results were all good, so move target to newer kernel by default.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/tegra/Makefile b/target/linux/tegra/Makefile
index 95d62cf6b0f5..f289c09c05c0 100644
--- a/target/linux/tegra/Makefile
+++ b/target/linux/tegra/Makefile
@@ -12,7 +12,7 @@ CPU_TYPE := cortex-a9
 CPU_SUBTYPE := vfpv3-d16
 SUBTARGETS := generic
 
-KERNEL_PATCHVER := 5.15
+KERNEL_PATCHVER := 6.1
 KERNEL_TESTING_PATCHVER := 6.1
 
 include $(INCLUDE_DIR)/target.mk
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/4] tegra: copy patches and config for kernel 6.1

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Prepare for addition of kernel 6.1 support.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/config-6.1 | 504 ++
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 ...enable-front-panel-leds-in-TrimSlice.patch |  46 ++
 3 files changed, 627 insertions(+)
 create mode 100644 target/linux/tegra/config-6.1
 create mode 100644 
target/linux/tegra/patches-6.1/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
 create mode 100644 
target/linux/tegra/patches-6.1/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch

diff --git a/target/linux/tegra/config-6.1 b/target/linux/tegra/config-6.1
new file mode 100644
index ..257ffda252ad
--- /dev/null
+++ b/target/linux/tegra/config-6.1
@@ -0,0 +1,504 @@
+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_DM

[PATCH 0/4] tegra: bump to 6.1

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Straightforward update and small generic config modification.

Tomasz Maciej Nowak (4):
  kernel: 6.1: move NO_ARRAY_BOUNDS to generic
  tegra: copy patches and config for kernel 6.1
  tegra: initial kernel 6.1 support
  tegra: switch to 6.1 kernel

 package/kernel/linux/modules/video.mk |   4 +-
 target/linux/bcm27xx/bcm2708/config-6.1   |   2 -
 target/linux/bcm27xx/bcm2709/config-6.1   |   2 -
 target/linux/bcm27xx/bcm2710/config-6.1   |   2 -
 target/linux/bcm27xx/bcm2711/config-6.1   |   2 -
 target/linux/bmips/bcm6318/config-6.1 |   2 -
 target/linux/bmips/bcm63268/config-6.1|   2 -
 target/linux/bmips/bcm6328/config-6.1 |   2 -
 target/linux/bmips/bcm6358/config-6.1 |   2 -
 target/linux/bmips/bcm6362/config-6.1 |   2 -
 target/linux/bmips/bcm6368/config-6.1 |   2 -
 target/linux/generic/config-6.1   |   2 +
 target/linux/mediatek/filogic/config-6.1  |   2 -
 target/linux/mediatek/mt7622/config-6.1   |   2 -
 target/linux/mediatek/mt7623/config-6.1   |   2 -
 target/linux/mediatek/mt7629/config-6.1   |   2 -
 target/linux/qualcommax/config-6.1|   2 -
 target/linux/rockchip/armv8/config-6.1|   2 -
 target/linux/tegra/Makefile   |   3 +-
 target/linux/tegra/config-6.1 | 565 ++
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 ...enable-front-panel-leds-in-TrimSlice.patch |  58 ++
 target/linux/uml/config-6.1   |   1 -
 23 files changed, 706 insertions(+), 36 deletions(-)
 create mode 100644 target/linux/tegra/config-6.1
 create mode 100644 
target/linux/tegra/patches-6.1/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
 create mode 100644 
target/linux/tegra/patches-6.1/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch

-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/4] kernel: 6.1: move NO_ARRAY_BOUNDS to generic

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Array bounds are disabled for GCC 11 or later. It's better to track it in
global (generic) config.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/bcm27xx/bcm2708/config-6.1  | 2 --
 target/linux/bcm27xx/bcm2709/config-6.1  | 2 --
 target/linux/bcm27xx/bcm2710/config-6.1  | 2 --
 target/linux/bcm27xx/bcm2711/config-6.1  | 2 --
 target/linux/bmips/bcm6318/config-6.1| 2 --
 target/linux/bmips/bcm63268/config-6.1   | 2 --
 target/linux/bmips/bcm6328/config-6.1| 2 --
 target/linux/bmips/bcm6358/config-6.1| 2 --
 target/linux/bmips/bcm6362/config-6.1| 2 --
 target/linux/bmips/bcm6368/config-6.1| 2 --
 target/linux/generic/config-6.1  | 2 ++
 target/linux/mediatek/filogic/config-6.1 | 2 --
 target/linux/mediatek/mt7622/config-6.1  | 2 --
 target/linux/mediatek/mt7623/config-6.1  | 2 --
 target/linux/mediatek/mt7629/config-6.1  | 2 --
 target/linux/qualcommax/config-6.1   | 2 --
 target/linux/rockchip/armv8/config-6.1   | 2 --
 target/linux/uml/config-6.1  | 1 -
 18 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/target/linux/bcm27xx/bcm2708/config-6.1 
b/target/linux/bcm27xx/bcm2708/config-6.1
index c5d604e6bc25..29884c661305 100644
--- a/target/linux/bcm27xx/bcm2708/config-6.1
+++ b/target/linux/bcm27xx/bcm2708/config-6.1
@@ -56,7 +56,6 @@ CONFIG_BRCM_CHAR_DRIVERS=y
 # CONFIG_CACHE_L2X0 is not set
 CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
 CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
-CONFIG_CC_NO_ARRAY_BOUNDS=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLK_BCM2711_DVP=y
 CONFIG_CLK_BCM2835=y
@@ -170,7 +169,6 @@ CONFIG_FWNODE_MDIO=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_FW_LOADER_SYSFS=y
-CONFIG_GCC11_NO_ARRAY_BOUNDS=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
diff --git a/target/linux/bcm27xx/bcm2709/config-6.1 
b/target/linux/bcm27xx/bcm2709/config-6.1
index ec2e7f3fa610..7479ee37a31f 100644
--- a/target/linux/bcm27xx/bcm2709/config-6.1
+++ b/target/linux/bcm27xx/bcm2709/config-6.1
@@ -70,7 +70,6 @@ CONFIG_BROADCOM_PHY=y
 # CONFIG_CACHE_L2X0 is not set
 CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
 CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
-CONFIG_CC_NO_ARRAY_BOUNDS=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLK_BCM2711_DVP=y
 CONFIG_CLK_BCM2835=y
@@ -207,7 +206,6 @@ CONFIG_FWNODE_MDIO=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_FW_LOADER_SYSFS=y
-CONFIG_GCC11_NO_ARRAY_BOUNDS=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ARCH_TOPOLOGY=y
 CONFIG_GENERIC_BUG=y
diff --git a/target/linux/bcm27xx/bcm2710/config-6.1 
b/target/linux/bcm27xx/bcm2710/config-6.1
index b0abd49c7f12..f0af261f1691 100644
--- a/target/linux/bcm27xx/bcm2710/config-6.1
+++ b/target/linux/bcm27xx/bcm2710/config-6.1
@@ -87,7 +87,6 @@ CONFIG_CAVIUM_ERRATUM_27456=y
 CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
 CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
 CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
-CONFIG_CC_NO_ARRAY_BOUNDS=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLK_BCM2711_DVP=y
 CONFIG_CLK_BCM2835=y
@@ -217,7 +216,6 @@ CONFIG_FWNODE_MDIO=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_FW_LOADER_SYSFS=y
-CONFIG_GCC11_NO_ARRAY_BOUNDS=y
 CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ARCH_TOPOLOGY=y
diff --git a/target/linux/bcm27xx/bcm2711/config-6.1 
b/target/linux/bcm27xx/bcm2711/config-6.1
index ff88926e3df5..f44019cee3f1 100644
--- a/target/linux/bcm27xx/bcm2711/config-6.1
+++ b/target/linux/bcm27xx/bcm2711/config-6.1
@@ -91,7 +91,6 @@ CONFIG_CAVIUM_ERRATUM_27456=y
 CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
 CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
 CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
-CONFIG_CC_NO_ARRAY_BOUNDS=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLK_BCM2711_DVP=y
 CONFIG_CLK_BCM2835=y
@@ -222,7 +221,6 @@ CONFIG_FWNODE_MDIO=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_FW_LOADER_SYSFS=y
-CONFIG_GCC11_NO_ARRAY_BOUNDS=y
 CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ARCH_TOPOLOGY=y
diff --git a/target/linux/bmips/bcm6318/config-6.1 
b/target/linux/bmips/bcm6318/config-6.1
index 526319da33d8..9837bc74458e 100644
--- a/target/linux/bmips/bcm6318/config-6.1
+++ b/target/linux/bmips/bcm6318/config-6.1
@@ -18,7 +18,6 @@ CONFIG_BLK_MQ_PCI=y
 CONFIG_BLK_PM=y
 CONFIG_BMIPS_GENERIC=y
 CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
-CONFIG_CC_NO_ARRAY_BOUNDS=y
 CONFIG_CEVT_R4K=y
 # CONFIG_CLK_BCM63268_TIMER is not set
 CONFIG_CLK_BCM_63XX_GATE=y
@@ -82,7 +81,6 @@ CONFIG_FWNODE_MDIO=y
 CONFIG_FW_CFE=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_FW_LOADER_SYSFS=y
-CONFIG_GCC11_NO_ARRAY_BOUNDS=y
 CONFIG_GENERIC_ATOMIC64=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CMOS_UPDATE=y
diff --git a/target/linux/bmips/bcm63268/config-6.1 
b/target/linux/bmips/bcm63268/config-6.1
index 624c00556db9..534307bd3222 100644
--- a/target/linux/

[PATCH v4 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Alter booting command in U-Boot on first boot after upgrade to workaround
the kernel size limitation. The kernel size read from flash will be 8MiB,
which should suffice for forseable future. As precaution a warning
interupting upgrade is emited, explaining what to do.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../etc/uci-defaults/05_fix-compat-version |  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
 target/linux/ipq40xx/image/generic.mk  |  8 +++-
 3 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

diff --git 
a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version 
b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
index c01192089712..a3f90125c6e5 100644
--- a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
+++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
@@ -4,7 +4,8 @@ case "$(board_name)" in
 linksys,ea6350v3|\
 linksys,ea8300|\
 linksys,mr8300|\
-ezviz,cs-w3-wd1200g-eup)
+ezviz,cs-w3-wd1200g-eup|\
+pakedge,wr-1)
uci set system.@system[0].compat_version="2.0"
uci commit system
;;
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh 
b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
new file mode 100644
index ..0cc0ab0fca6f
--- /dev/null
+++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
@@ -0,0 +1,14 @@
+. /lib/functions.sh
+
+preinit_patch_uboot_env() {
+   case $(board_name) in
+   pakedge,wr-1)
+   if ! fw_printenv -n OpenWrt &>/dev/null; then
+   fw_setenv OpenWrt 'sf probe; sf read 0x8400 
0x18 0x80; bootm 0x8400'
+   fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 
's,bootipq,run OpenWrt,')"
+   fi
+   ;;
+   esac
+}
+
+boot_hook_add preinit_main preinit_patch_uboot_env
diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index 13b6ce1fee41..742576a29e5e 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -957,8 +957,14 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
-   KERNEL_SIZE := 4096k
+   KERNEL_SIZE := 8192k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
+   DEVICE_COMPAT_VERSION := 2.0
+   DEVICE_COMPAT_MESSAGE := \n$\
+   Booting command in U-Boot needs to be changed because of kernel 
\n$\
+   growing beyond 4MiB. Force upgrade to 23.05.0 first and it will 
\n$\
+   automatically amend booting command in U-Boot on first boot. 
\n$\
+   Then proceed with the upgrade to desired version.
 endef
 TARGET_DEVICES += pakedge_wr-1
 
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 1/3] ipq40xx: image: limit kernel size for NOR devices

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

'bootipq' command on some devices, with kernel on NOR flash chip, read
kernel partition size from Qualcomm proprietary partition table, which
seems to be stored in MIBIB partition. The partition table can be read
by 'smeminfo' command in U-Boot command line interface. Because this
partition table is never updated on sysupgrade (even when the kernel
size changes) kernel size is capped at initial value, usually 4MiB.
Sysupgrading such kernel will soft-brick the device, which will need
serial console for recovery. Some devices already suffer from this,
beacuse its U-Boot does not allow to boot LZMA or GZIP compressed kernel
image. Even some devices allowing to boot LZMA compressed kernel will hit
this limitation later. Therefore limit the kernel size to 4MiB for
devices not having it specified, so we won't create soft-bricking images.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ipq40xx/image/generic.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index a9dd2aa0912f..13b6ce1fee41 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -400,6 +400,7 @@ define Device/dlink_dap-2610
WRGG_DEVNAME := /dev/mtdblock/8
WRGG_SIGNATURE := wapac30_dkbs_dap2610
IMAGE_SIZE := 14080k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
# Bootloader expects a special 160 byte header which is added by
# wrgg-image.
@@ -478,6 +479,7 @@ define Device/engenius_emd1
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 30720k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
@@ -800,6 +802,7 @@ define Device/netgear_ex61x0v2
NETGEAR_BOARD_ID := EX6150v2series
NETGEAR_HW_ID := 29765285+16+0+128+2x2
IMAGE_SIZE := 14400k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4018
 endef
 
@@ -954,6 +957,7 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
 endef
 TARGET_DEVICES += pakedge_wr-1
@@ -1030,6 +1034,7 @@ define Device/qxwlan_e2600ac-c1
BOARD_NAME := e2600ac-c1
SOC := qcom-ipq4019
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c1
@@ -1218,6 +1223,7 @@ define Device/zyxel_wre6606
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 13184k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
check-size | append-metadata
DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
 endef
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 0/3] ipq40xx: remedy potential of producing soft-bricking images

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some of devices having kernel on NOR flash could reach limit of kernel
partition size at 4MiB and soft-brick them. Unfortunately we don't know
if all of them are affected, thus kernel size limit is added to all of
remaining ones. Later commit allows for some devices to prepare painless
transition, while the last one shows how it can be done for device i
introduced. I tried to make transition for the device as generic as
possible so it coulld be used on others, but unfortunately I own only
one device, which means the owners of the rest device need to verify if
it works for them and add their devices.

Tomasz Maciej Nowak (3):
  ipq40xx: image: limit kernel size for NOR devices
v1 -> v2: no changes
v2 -> v3: no changes
v3 -> v4: remove Habanero board (does not have a limit),
  straighten inaccuracy in commit message (zImage is
  self-extracting which doesn't depend on U-Boot
  capabilities, while GZIPped uImage does) 
  ipq40xx: dts: allow writing to U-Boot environment
v1 -> v2: no changes
v2 -> v3: no changes
v3 -> v4: straighten inaccuracy in commit message (zImage is
  self-extracting which doesn't depend on U-Boot
  capabilities, while GZIPped uImage does)
  ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB
v1 -> v2: remove printing command from sed invocation which prints
  double output and breaks future 'bootcmd' modifications
v2 -> v3: shortened description of problem presented to user as
  users having firmware 23.05.0 or later won't see the
  message
    v3 -> v4: no changes


Tomasz Maciej Nowak (3):
  ipq40xx: image: limit kernel size for NOR devices
  ipq40xx: dts: allow writing to U-Boot environment
  ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

 .../etc/uci-defaults/05_fix-compat-version |  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
 .../boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-eap1300.dts |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-emr3500.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-wre6606.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts  |  1 -
 .../arm/boot/dts/qcom-ipq4019-habanero-dvk.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts   |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4028-wpj428.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts|  1 -
 target/linux/ipq40xx/image/generic.mk  | 12 
 19 files changed, 28 insertions(+), 17 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 2/3] ipq40xx: dts: allow writing to U-Boot environment

2023-07-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Devices allowing to boot LZMA or GZIP compressed kernel didn't hit yet
the 4MiB boundary for kernel size, thus allowing to prepare workaround
for the issue, without need for serial console attachment.
The workaround is modifying 'bootcmd' variable in U-Boot environment
which will replace 'bootipq' command with equivalent not limited by
imposed partition table.
This commit also touches devices which boot uncompressed kernel, so
even if those are already soft-bricked, it will still allow to alter
U-Boot environment from initramfs booted device.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts  | 1 -
 .../files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts| 1 -
 16 files changed, 16 deletions(-)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
index 22a48c12c44e..0772c5ac464a 100644
--- 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
+++ 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
@@ -185,7 +185,6 @@
partition5@E {
label = "APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
 
partition6@F {
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
index 493905d56d8f..dea90b13e209 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
@@ -117,7 +117,6 @@
partition@e {
label = "APPSBLENV";
reg = <0xe 0x1>;
-   read-only;
};
partition@f {
label = "APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
index a8f24aa00e60..2e9cb8ecdb68 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
@@ -165,7 +165,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
index 396595ba5185..615c6aaf678f 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
@@ -163,7 +163,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
index 361614945145..8c038917b668 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
+++ b/target/linux/ipq40xx/files/arch/arm

Re: [PATCH v3 1/3] ipq40xx: image: limit kernel size for NOR devices

2023-07-25 Thread Tomasz Maciej Nowak
W dniu 25.07.2023 o 12:27, Robert Marko pisze:
> On Mon, 24 Jul 2023 at 15:31, Tomasz Maciej Nowak  wrote:
>>
>> From: Tomasz Maciej Nowak 
>>
>> 'bootipq' command on some devices, with kernel on NOR flash chip, read
>> kernel partition size from Qualcomm proprietary partition table, which
>> seems to be stored in MIBIB partition. The partition table can be read
>> by 'smeminfo' command in U-Boot command line interface. Because this
>> partition table is never updated on sysupgrade (even when the kernel
>> size changes) kernel size is capped at initial value, usually 4MiB.
>> Sysupgrading such kernel will soft-brick the device, which will need
>> serial console for recovery. Some devices already suffer from this,
>> beacuse its U-Boot does not allow to boot LZMA compressed kernel image
>> and/or kernel zImage. Even some devices allowing to boot LZMA compressed
>> kernel will hit this limitation later. Therefore limit the kernel size
>> to 4MiB for devices not having it specified, so we won't create
>> soft-bricking images.
>>
>> Signed-off-by: Tomasz Maciej Nowak 
>> ---
>>  target/linux/ipq40xx/image/generic.mk | 7 +++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/target/linux/ipq40xx/image/generic.mk 
>> b/target/linux/ipq40xx/image/generic.mk
>> index f15463ae8ca5..d9d60a25ff0f 100644
>> --- a/target/linux/ipq40xx/image/generic.mk
>> +++ b/target/linux/ipq40xx/image/generic.mk
>> @@ -130,6 +130,7 @@ define Device/8dev_habanero-dvk
>> DEVICE_VENDOR := 8devices
>> DEVICE_MODEL := Habanero DVK
>> IMAGE_SIZE := 30976k
>> +   KERNEL_SIZE := 4096k
> 
> Habanero does not have a kernel size limit as its not using bootipq for 
> booting.

Thanks, I'll remove it from the patch in next iteration.

> 
> Regards,
> Robert

Regards

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 0/3] ipq40xx: remedy potential of producing soft-bricking images

2023-07-24 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some of devices having kernel on NOR flash could reach limit of kernel
partition size at 4MiB and soft-brick them. Unfortunately we don't know
if all of them are affected, thus kernel size limit is added to all of
remaining ones. Later commit allows for some devices to prepare painless
transition, while the last one shows how it can be done for device i
introduced. I tried to make transition for the device as generic as
possible so it coulld be used on others, but unfortunately I own only
one device, which means the owners of the rest device need to verify if
it works for them and add their devices.

Tomasz Maciej Nowak (3):
  ipq40xx: image: limit kernel size for NOR devices
v1 -> v2: no changes
v2 -> v3: no changes
  ipq40xx: dts: allow writing to U-Boot environment
v1 -> v2: no changes
v2 -> v3: no changes
  ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB
v1 -> v2: remove printing command from sed invocation which prints
  double output and breaks future 'bootcmd' modifications
v2 -> v3: shortened description of problem presented to user as
  users having firmware 23.05.0 or later won't see the
      message

Tomasz Maciej Nowak (3):
  ipq40xx: image: limit kernel size for NOR devices
  ipq40xx: dts: allow writing to U-Boot environment
  ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

 .../etc/uci-defaults/05_fix-compat-version |  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
 .../boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-eap1300.dts |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-emr3500.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-wre6606.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts  |  1 -
 .../arm/boot/dts/qcom-ipq4019-habanero-dvk.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts   |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4028-wpj428.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts|  1 -
 target/linux/ipq40xx/image/generic.mk  | 13 +
 19 files changed, 29 insertions(+), 17 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

2023-07-24 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Alter booting command in U-Boot on first boot after upgrade to workaround
the kernel size limitation. The kernel size read from flash will be 8MiB,
which should suffice for forseable future. As precaution a warning
interupting upgrade is emited, explaining what to do.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../etc/uci-defaults/05_fix-compat-version |  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
 target/linux/ipq40xx/image/generic.mk  |  8 +++-
 3 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

diff --git 
a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version 
b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
index c01192089712..a3f90125c6e5 100644
--- a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
+++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
@@ -4,7 +4,8 @@ case "$(board_name)" in
 linksys,ea6350v3|\
 linksys,ea8300|\
 linksys,mr8300|\
-ezviz,cs-w3-wd1200g-eup)
+ezviz,cs-w3-wd1200g-eup|\
+pakedge,wr-1)
uci set system.@system[0].compat_version="2.0"
uci commit system
;;
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh 
b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
new file mode 100644
index ..0cc0ab0fca6f
--- /dev/null
+++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
@@ -0,0 +1,14 @@
+. /lib/functions.sh
+
+preinit_patch_uboot_env() {
+   case $(board_name) in
+   pakedge,wr-1)
+   if ! fw_printenv -n OpenWrt &>/dev/null; then
+   fw_setenv OpenWrt 'sf probe; sf read 0x8400 
0x18 0x80; bootm 0x8400'
+   fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 
's,bootipq,run OpenWrt,')"
+   fi
+   ;;
+   esac
+}
+
+boot_hook_add preinit_main preinit_patch_uboot_env
diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index d9d60a25ff0f..1b4ea8f8648c 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -958,8 +958,14 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
-   KERNEL_SIZE := 4096k
+   KERNEL_SIZE := 8192k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
+   DEVICE_COMPAT_VERSION := 2.0
+   DEVICE_COMPAT_MESSAGE := \n$\
+   Booting command in U-Boot needs to be changed because of kernel 
\n$\
+   growing beyond 4MiB. Force upgrade to 23.05.0 first and it will 
\n$\
+   automatically amend booting command in U-Boot on first boot. 
\n$\
+   Then proceed with the upgrade to desired version.
 endef
 TARGET_DEVICES += pakedge_wr-1
 
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 1/3] ipq40xx: image: limit kernel size for NOR devices

2023-07-24 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

'bootipq' command on some devices, with kernel on NOR flash chip, read
kernel partition size from Qualcomm proprietary partition table, which
seems to be stored in MIBIB partition. The partition table can be read
by 'smeminfo' command in U-Boot command line interface. Because this
partition table is never updated on sysupgrade (even when the kernel
size changes) kernel size is capped at initial value, usually 4MiB.
Sysupgrading such kernel will soft-brick the device, which will need
serial console for recovery. Some devices already suffer from this,
beacuse its U-Boot does not allow to boot LZMA compressed kernel image
and/or kernel zImage. Even some devices allowing to boot LZMA compressed
kernel will hit this limitation later. Therefore limit the kernel size
to 4MiB for devices not having it specified, so we won't create
soft-bricking images.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ipq40xx/image/generic.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index f15463ae8ca5..d9d60a25ff0f 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -130,6 +130,7 @@ define Device/8dev_habanero-dvk
DEVICE_VENDOR := 8devices
DEVICE_MODEL := Habanero DVK
IMAGE_SIZE := 30976k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4019
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | 
pad-rootfs | check-size | append-metadata
 endef
@@ -400,6 +401,7 @@ define Device/dlink_dap-2610
WRGG_DEVNAME := /dev/mtdblock/8
WRGG_SIGNATURE := wapac30_dkbs_dap2610
IMAGE_SIZE := 14080k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
# Bootloader expects a special 160 byte header which is added by
# wrgg-image.
@@ -478,6 +480,7 @@ define Device/engenius_emd1
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 30720k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
@@ -800,6 +803,7 @@ define Device/netgear_ex61x0v2
NETGEAR_BOARD_ID := EX6150v2series
NETGEAR_HW_ID := 29765285+16+0+128+2x2
IMAGE_SIZE := 14400k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4018
 endef
 
@@ -954,6 +958,7 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
 endef
 TARGET_DEVICES += pakedge_wr-1
@@ -1030,6 +1035,7 @@ define Device/qxwlan_e2600ac-c1
BOARD_NAME := e2600ac-c1
SOC := qcom-ipq4019
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c1
@@ -1202,6 +1208,7 @@ define Device/zyxel_wre6606
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 13184k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
check-size | append-metadata
DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
 endef
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 2/3] ipq40xx: dts: allow writing to U-Boot environment

2023-07-24 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Devices allowing to boot LZMA compressed kernel or zImage kernel didn't
hit yet the 4MiB boundary for kernel size, thus allowing to prepare
workaround for the issue, without need for serial console attachment.
The workaround is modifying 'bootcmd' variable in U-Boot environment
which will replace 'bootipq' command with equivalent not limited by
imposed partition table.
This commit also touches devices which boot uncompressed kernel, so
even if those are already soft-bricked, it will still allow to alter
U-Boot environment from initramfs booted device.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts  | 1 -
 .../files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts| 1 -
 16 files changed, 16 deletions(-)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
index 22a48c12c44e..0772c5ac464a 100644
--- 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
+++ 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
@@ -185,7 +185,6 @@
partition5@E {
label = "APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
 
partition6@F {
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
index 493905d56d8f..dea90b13e209 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
@@ -117,7 +117,6 @@
partition@e {
label = "APPSBLENV";
reg = <0xe 0x1>;
-   read-only;
};
partition@f {
label = "APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
index a8f24aa00e60..2e9cb8ecdb68 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
@@ -165,7 +165,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
index 396595ba5185..615c6aaf678f 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
@@ -163,7 +163,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
index 361614945145..8c038917b668 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
+++ b/target/linux/ipq40xx/files/arch/arm

Re: [PATCH] sdk: rename README

2023-07-15 Thread Tomasz Maciej Nowak
W dniu 11.07.2023 o 16:09, Tomasz Maciej Nowak pisze:
> From: Tomasz Maciej Nowak 
> 
> 'help' target fails not finding a file, so follow up on a change[2] made
> as a fix for main README[1].
> 
> 1. d0113711a31f ("README: port to 21st century")
> 2. 751486b31fd9 ("build: fix README.md reference after rename")
> 
> Signed-off-by: Tomasz Maciej Nowak 
> ---
>  target/sdk/files/{README.SDK => README.md} | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  rename target/sdk/files/{README.SDK => README.md} (100%)
> 
> diff --git a/target/sdk/files/README.SDK b/target/sdk/files/README.md
> similarity index 100%
> rename from target/sdk/files/README.SDK
> rename to target/sdk/files/README.md

Sorry for the fallout and thanks for the fix. I had a dirty tree with "sdk: fix
git initialization" commit from https://github.com/openwrt/openwrt/pull/11379
applied which fixes other issue in SDK.

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ib: split out processing user provided packages

2023-07-11 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some device recipes remove default target packages. If user tries to add
them back they will be ignored, since packages list is processed in one
go. Process the device recipe packages first and do user ones later, so
additions won't get filtered out.

Signed-off-by: Tomasz Maciej Nowak 
---

Test case is simple, download ath79 SDK and invoke:
make image PROFILE=ubnt_routerstation PACKAGES=kmod-ath9k
The resulting image won't include kmod-ath9k.

 target/imagebuilder/files/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/imagebuilder/files/Makefile 
b/target/imagebuilder/files/Makefile
index 502037379245..78ec7e2e94a9 100644
--- a/target/imagebuilder/files/Makefile
+++ b/target/imagebuilder/files/Makefile
@@ -127,9 +127,11 @@ _call_info: FORCE
echo 'Available Profiles:'
echo; $(PROFILE_LIST)
 
-BUILD_PACKAGES:=$(USER_PACKAGES) $(sort $(DEFAULT_PACKAGES) 
$($(USER_PROFILE)_PACKAGES) kernel)
+BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel)
 # "-pkgname" in the package list means remove "pkgname" from the package list
 BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst 
-%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
+BUILD_PACKAGES:=$(USER_PACKAGES) $(BUILD_PACKAGES)
+BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst 
-%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
 PACKAGES:=
 
 _call_image: staging_dir/host/.prereq-build
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] sdk: rename README

2023-07-11 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

'help' target fails not finding a file, so follow up on a change[2] made
as a fix for main README[1].

1. d0113711a31f ("README: port to 21st century")
2. 751486b31fd9 ("build: fix README.md reference after rename")

Signed-off-by: Tomasz Maciej Nowak 
---
 target/sdk/files/{README.SDK => README.md} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename target/sdk/files/{README.SDK => README.md} (100%)

diff --git a/target/sdk/files/README.SDK b/target/sdk/files/README.md
similarity index 100%
rename from target/sdk/files/README.SDK
rename to target/sdk/files/README.md
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

2023-07-10 Thread Tomasz Maciej Nowak
W dniu 10.07.2023 o 00:16, Felix Baumann pisze:
> Am 9. Juli 2023 23:26:13 MESZ schrieb Tomasz Maciej Nowak :
>> W dniu 9.07.2023 o 12:43, Felix Baumann pisze:
>>> Am 7. Juli 2023 17:11:43 MESZ schrieb Tomasz Maciej Nowak 
>>> :
>>>> From: Tomasz Maciej Nowak 
>>>>
>>>> Alter command boot sequence in U-Boot on first boot after upgrade to
>>>> workaround the kernel size limitation. The kernel size read from flash
>>>> will be 8MiB, which should suffice for forseable future. As precaution a
>>>> warning interupting upgrade is emited, explaining what to do.
>>>>
>>>> Signed-off-by: Tomasz Maciej Nowak 
>>>> ---
>>>> .../etc/uci-defaults/05_fix-compat-version |  3 ++-
>>>> .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
>>>> target/linux/ipq40xx/image/generic.mk  | 10 +-
>>>> 3 files changed, 25 insertions(+), 2 deletions(-)
>>>> create mode 100644 
>>>> target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
>>>>
>>>> diff --git 
>>>> a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version 
>>>> b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
>>>> index c01192089712..a3f90125c6e5 100644
>>>> --- 
>>>> a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
>>>> +++ 
>>>> b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
>>>> @@ -4,7 +4,8 @@ case "$(board_name)" in
>>>> linksys,ea6350v3|\
>>>> linksys,ea8300|\
>>>> linksys,mr8300|\
>>>> -ezviz,cs-w3-wd1200g-eup)
>>>> +ezviz,cs-w3-wd1200g-eup|\
>>>> +pakedge,wr-1)
>>>>uci set system.@system[0].compat_version="2.0"
>>>>uci commit system
>>>>;;
>>>> diff --git 
>>>> a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh 
>>>> b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
>>>> new file mode 100644
>>>> index ..0cc0ab0fca6f
>>>> --- /dev/null
>>>> +++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
>>>> @@ -0,0 +1,14 @@
>>>> +. /lib/functions.sh
>>>> +
>>>> +preinit_patch_uboot_env() {
>>>> +  case $(board_name) in
>>>> +  pakedge,wr-1)
>>>> +  if ! fw_printenv -n OpenWrt &>/dev/null; then
>>>> +  fw_setenv OpenWrt 'sf probe; sf read 0x8400 
>>>> 0x18 0x80; bootm 0x8400'
>>>> +  fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 
>>>> 's,bootipq,run OpenWrt,')"
>>>> +  fi
>>>> +  ;;
>>>> +  esac
>>>> +}
>>>> +
>>>> +boot_hook_add preinit_main preinit_patch_uboot_env
>>>> diff --git a/target/linux/ipq40xx/image/generic.mk 
>>>> b/target/linux/ipq40xx/image/generic.mk
>>>> index d9d60a25ff0f..0dadae122a87 100644
>>>> --- a/target/linux/ipq40xx/image/generic.mk
>>>> +++ b/target/linux/ipq40xx/image/generic.mk
>>>> @@ -958,8 +958,16 @@ define Device/pakedge_wr-1
>>>>SOC := qcom-ipq4018
>>>>BLOCKSIZE := 64k
>>>>IMAGE_SIZE := 31232k
>>>> -  KERNEL_SIZE := 4096k
>>>> +  KERNEL_SIZE := 8192k
>>>>IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
>>>> append-rootfs | pad-rootfs | append-metadata
>>>> +  DEVICE_COMPAT_VERSION := 2.0
>>>> +  DEVICE_COMPAT_MESSAGE := \n$\
>>>> +  Booting command in U-Boot needs to be changed because of kernel 
>>>> \n$\
>>>> +  growing beyond 4MiB. If OpenWrt 23.05.0 or later is running on 
>>>> \n$\
>>>> +  on the device, it has already been done and You can safely 
>>>> force \n$\
>>>> +  upgrade. If that's not the case, first upgrade to 23.05.0 and 
>>>> it \n$\
>>>> +  will automatically amend booting command in U-Boot on first 
>>>> boot. \n$\
>>>> +  Then proceed with the upgrade to desired version.
>>>> endef
>>>> TARGET_DEVICES += pakedge_wr-1
>>>>
>>>
>>> This is one way of fixing this. But we could also switch all of these from 
>>> FitImage to Fi

Re: [PATCH v2 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

2023-07-09 Thread Tomasz Maciej Nowak
W dniu 9.07.2023 o 12:43, Felix Baumann pisze:
> Am 7. Juli 2023 17:11:43 MESZ schrieb Tomasz Maciej Nowak :
>> From: Tomasz Maciej Nowak 
>>
>> Alter command boot sequence in U-Boot on first boot after upgrade to
>> workaround the kernel size limitation. The kernel size read from flash
>> will be 8MiB, which should suffice for forseable future. As precaution a
>> warning interupting upgrade is emited, explaining what to do.
>>
>> Signed-off-by: Tomasz Maciej Nowak 
>> ---
>> .../etc/uci-defaults/05_fix-compat-version |  3 ++-
>> .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
>> target/linux/ipq40xx/image/generic.mk  | 10 +-
>> 3 files changed, 25 insertions(+), 2 deletions(-)
>> create mode 100644 
>> target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
>>
>> diff --git 
>> a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version 
>> b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
>> index c01192089712..a3f90125c6e5 100644
>> --- a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
>> +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
>> @@ -4,7 +4,8 @@ case "$(board_name)" in
>> linksys,ea6350v3|\
>> linksys,ea8300|\
>> linksys,mr8300|\
>> -ezviz,cs-w3-wd1200g-eup)
>> +ezviz,cs-w3-wd1200g-eup|\
>> +pakedge,wr-1)
>>  uci set system.@system[0].compat_version="2.0"
>>  uci commit system
>>  ;;
>> diff --git 
>> a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh 
>> b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
>> new file mode 100644
>> index ..0cc0ab0fca6f
>> --- /dev/null
>> +++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
>> @@ -0,0 +1,14 @@
>> +. /lib/functions.sh
>> +
>> +preinit_patch_uboot_env() {
>> +case $(board_name) in
>> +pakedge,wr-1)
>> +if ! fw_printenv -n OpenWrt &>/dev/null; then
>> +fw_setenv OpenWrt 'sf probe; sf read 0x8400 
>> 0x18 0x80; bootm 0x8400'
>> +fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 
>> 's,bootipq,run OpenWrt,')"
>> +fi
>> +;;
>> +esac
>> +}
>> +
>> +boot_hook_add preinit_main preinit_patch_uboot_env
>> diff --git a/target/linux/ipq40xx/image/generic.mk 
>> b/target/linux/ipq40xx/image/generic.mk
>> index d9d60a25ff0f..0dadae122a87 100644
>> --- a/target/linux/ipq40xx/image/generic.mk
>> +++ b/target/linux/ipq40xx/image/generic.mk
>> @@ -958,8 +958,16 @@ define Device/pakedge_wr-1
>>  SOC := qcom-ipq4018
>>  BLOCKSIZE := 64k
>>  IMAGE_SIZE := 31232k
>> -KERNEL_SIZE := 4096k
>> +KERNEL_SIZE := 8192k
>>  IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
>> append-rootfs | pad-rootfs | append-metadata
>> +DEVICE_COMPAT_VERSION := 2.0
>> +DEVICE_COMPAT_MESSAGE := \n$\
>> +Booting command in U-Boot needs to be changed because of kernel 
>> \n$\
>> +growing beyond 4MiB. If OpenWrt 23.05.0 or later is running on 
>> \n$\
>> +on the device, it has already been done and You can safely 
>> force \n$\
>> +upgrade. If that's not the case, first upgrade to 23.05.0 and 
>> it \n$\
>> +will automatically amend booting command in U-Boot on first 
>> boot. \n$\
>> +Then proceed with the upgrade to desired version.
>> endef
>> TARGET_DEVICES += pakedge_wr-1
>>
> 
> This is one way of fixing this. But we could also switch all of these from 
> FitImage to FitzImage. (self-decompressing xz) 
> That should suffice for quite a while (kernel was 1/4 smaller for my device 
> afterwards). 3MiB in use leaves us quite some headroom.

This device uses FitImageLZMA, so it's not affected, yet.

> Headroom to implement lzma-loader at some point.

That's one way to remedy the problem. The second option would be writing 
extension
for mtd to update Qualcomm partition table in MIBIB partition with new partition
sizes, similar to devices with RedBoot bootloader. Unfortunately all of devices
have MIBIB partition marked as read-only so that would be a hassle to introduce.
BTW The Qualcomm SMEM flash partition parser is already in kernel tree[1].
Both of options are outside of my capabilities and I'm not inclined to wait for
someone implementing those. Waiting brings only bigger pain l

[PATCH] mvebu: mcbin-singleshot: enable hearbeat LED by default

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This has been a part of modified upstream patch but got lost on major
kernel bump to 5.15, so bring it back.

Signed-off-by: Tomasz Maciej Nowak 
---

Please backport to 23.05 branch

 ...vell-enable-heartbeat-LED-by-default.patch | 22 +++
 1 file changed, 22 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.15/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch

diff --git 
a/target/linux/mvebu/patches-5.15/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch
 
b/target/linux/mvebu/patches-5.15/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch
new file mode 100644
index ..7221e04de1dd
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.15/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch
@@ -0,0 +1,22 @@
+From: Tomasz Maciej Nowak 
+Date: Fri, 7 Jul 2023 19:06:05 +0200
+Subject: [PATCH] arm64: dts: marvell: enable heartbeat LED by default
+
+Some boards could be placed in an enclosure, so enable LED18 by default,
+since that'll be the only visible indicator that the board is operating.
+
+Signed-off-by: Tomasz Maciej Nowak 
+---
+ arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts
 b/arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts
+@@ -25,6 +25,7 @@
+   function = LED_FUNCTION_HEARTBEAT;
+   color = ;
+   linux,default-trigger = "heartbeat";
++  default-state = "on";
+   };
+   };
+ };
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 2/3] ipq40xx: dts: allow writing to U-Boot environment

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Devices allowing to boot LZMA compressed kernel or zImage kernel didn't
hit yet the 4MiB boundary for kernel size, thus allowing to prepare
workaround for the issue, without need for serial console attachment.
The workaround is modifying 'bootcmd' variable in U-Boot environment
which will replace 'bootipq' command with equivalent not limited by
imposed partition table.
This commit also touches devices which boot uncompressed kernel, so
even if those are already soft-bricked, it will still allow to alter
U-Boot environment from initramfs booted device.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts  | 1 -
 .../files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts| 1 -
 16 files changed, 16 deletions(-)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
index 22a48c12c44e..0772c5ac464a 100644
--- 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
+++ 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
@@ -185,7 +185,6 @@
partition5@E {
label = "APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
 
partition6@F {
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
index 493905d56d8f..dea90b13e209 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
@@ -117,7 +117,6 @@
partition@e {
label = "APPSBLENV";
reg = <0xe 0x1>;
-   read-only;
};
partition@f {
label = "APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
index a8f24aa00e60..2e9cb8ecdb68 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
@@ -165,7 +165,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
index 396595ba5185..615c6aaf678f 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
@@ -163,7 +163,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
index 361614945145..8c038917b668 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
+++ b/target/linux/ipq40xx/files/arch/arm

[PATCH v2 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Alter command boot sequence in U-Boot on first boot after upgrade to
workaround the kernel size limitation. The kernel size read from flash
will be 8MiB, which should suffice for forseable future. As precaution a
warning interupting upgrade is emited, explaining what to do.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../etc/uci-defaults/05_fix-compat-version |  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
 target/linux/ipq40xx/image/generic.mk  | 10 +-
 3 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

diff --git 
a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version 
b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
index c01192089712..a3f90125c6e5 100644
--- a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
+++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
@@ -4,7 +4,8 @@ case "$(board_name)" in
 linksys,ea6350v3|\
 linksys,ea8300|\
 linksys,mr8300|\
-ezviz,cs-w3-wd1200g-eup)
+ezviz,cs-w3-wd1200g-eup|\
+pakedge,wr-1)
uci set system.@system[0].compat_version="2.0"
uci commit system
;;
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh 
b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
new file mode 100644
index ..0cc0ab0fca6f
--- /dev/null
+++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
@@ -0,0 +1,14 @@
+. /lib/functions.sh
+
+preinit_patch_uboot_env() {
+   case $(board_name) in
+   pakedge,wr-1)
+   if ! fw_printenv -n OpenWrt &>/dev/null; then
+   fw_setenv OpenWrt 'sf probe; sf read 0x8400 
0x18 0x80; bootm 0x8400'
+   fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 
's,bootipq,run OpenWrt,')"
+   fi
+   ;;
+   esac
+}
+
+boot_hook_add preinit_main preinit_patch_uboot_env
diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index d9d60a25ff0f..0dadae122a87 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -958,8 +958,16 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
-   KERNEL_SIZE := 4096k
+   KERNEL_SIZE := 8192k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
+   DEVICE_COMPAT_VERSION := 2.0
+   DEVICE_COMPAT_MESSAGE := \n$\
+   Booting command in U-Boot needs to be changed because of kernel 
\n$\
+   growing beyond 4MiB. If OpenWrt 23.05.0 or later is running on 
\n$\
+   on the device, it has already been done and You can safely 
force \n$\
+   upgrade. If that's not the case, first upgrade to 23.05.0 and 
it \n$\
+   will automatically amend booting command in U-Boot on first 
boot. \n$\
+   Then proceed with the upgrade to desired version.
 endef
 TARGET_DEVICES += pakedge_wr-1
 
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 0/3] ipq40xx: remedy potential of producing soft-bricking images

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some of devices having kernel on NOR flash could reach limit of kernel
partition size at 4MiB and soft-brick them. Unfortunately we don't know
if all of them are affected, thus kernel size limit is added to all of
remaining ones. Later commit allows for some devices to prepare painless
transition, while the last one shows how it can be done for device i
introduced. I tried to make transition for the device as generic as
possible so it coulld be used on others, but unfortunately I own only
one device, which means the owners of the rest device need to verify if
it works for them and add their devices.

Tomasz Maciej Nowak (3):
  ipq40xx: image: limit kernel size for NOR devices
v1 -> v2: no changes
  ipq40xx: dts: allow writing to U-Boot environment
v1 -> v2: no changes
  ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB
v1 -> v2: remove printing command from sed invocation which prints
  double output and breaks future 'bootcmd' modifications

 .../etc/uci-defaults/05_fix-compat-version|  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh  | 14 ++
 .../boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-eap1300.dts|  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-emr3500.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi  |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-wre6606.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts |  1 -
 .../arm/boot/dts/qcom-ipq4019-habanero-dvk.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-x1pro.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4028-wpj428.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts   |  1 -
 target/linux/ipq40xx/image/generic.mk | 15 +++
 19 files changed, 31 insertions(+), 17 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 1/3] ipq40xx: image: limit kernel size for NOR devices

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

'bootipq' command, on some devices with kernel on NOR flash chip, read
kernel partition size from Qualcomm proprietary partition table, which
seems to be stored in MIBIB partition. The partition table can be read
by 'smeminfo' command in U-Boot command line interface. Because this
partition table is never updated on sysupgrade (even when the kernel
size changes) kernel size is capped at initial value, usually 4MiB.
Sysupgrading such kernel will soft-brick the device, which will need
serial console for recovery. Some devices already suffer from this,
beacuse its U-Boot does not allow to boot LZMA compressed kernel image
and/or kernel zImage. Even some devices allowing to boot LZMA compressed
kernel will hit this limitation later. Therefore limit the kernel size
to 4MiB for devices not having it specified, so we won't create
soft-bricking images.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ipq40xx/image/generic.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index f15463ae8ca5..d9d60a25ff0f 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -130,6 +130,7 @@ define Device/8dev_habanero-dvk
DEVICE_VENDOR := 8devices
DEVICE_MODEL := Habanero DVK
IMAGE_SIZE := 30976k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4019
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | 
pad-rootfs | check-size | append-metadata
 endef
@@ -400,6 +401,7 @@ define Device/dlink_dap-2610
WRGG_DEVNAME := /dev/mtdblock/8
WRGG_SIGNATURE := wapac30_dkbs_dap2610
IMAGE_SIZE := 14080k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
# Bootloader expects a special 160 byte header which is added by
# wrgg-image.
@@ -478,6 +480,7 @@ define Device/engenius_emd1
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 30720k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
@@ -800,6 +803,7 @@ define Device/netgear_ex61x0v2
NETGEAR_BOARD_ID := EX6150v2series
NETGEAR_HW_ID := 29765285+16+0+128+2x2
IMAGE_SIZE := 14400k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4018
 endef
 
@@ -954,6 +958,7 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
 endef
 TARGET_DEVICES += pakedge_wr-1
@@ -1030,6 +1035,7 @@ define Device/qxwlan_e2600ac-c1
BOARD_NAME := e2600ac-c1
SOC := qcom-ipq4019
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c1
@@ -1202,6 +1208,7 @@ define Device/zyxel_wre6606
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 13184k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
check-size | append-metadata
DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
 endef
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/3] ipq40xx: dts: allow writing to U-Boot environment

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Devices allowing to boot LZMA compressed kernel or zImage kernel didn't
hit yet the 4MiB boundary for kernel size, thus allowing to prepare
workaround for the issue, without need for serial console attachment.
The workaround is modifying 'bootcmd' variable in U-Boot environment
which will replace 'bootipq' command with equivalent not limited by
imposed partition table.
This commit also touches devices which boot uncompressed kernel, so
even if those are already soft-bricked, it will still allow to alter
U-Boot environment from initramfs booted device.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts   | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts  | 1 -
 .../files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts   | 1 -
 .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts  | 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts| 1 -
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts| 1 -
 16 files changed, 16 deletions(-)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
index 22a48c12c44e..0772c5ac464a 100644
--- 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
+++ 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts
@@ -185,7 +185,6 @@
partition5@E {
label = "APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
 
partition6@F {
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
index 493905d56d8f..dea90b13e209 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
@@ -117,7 +117,6 @@
partition@e {
label = "APPSBLENV";
reg = <0xe 0x1>;
-   read-only;
};
partition@f {
label = "APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
index a8f24aa00e60..2e9cb8ecdb68 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts
@@ -165,7 +165,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
index 396595ba5185..615c6aaf678f 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts
@@ -163,7 +163,6 @@
partition5@e {
label = "0:APPSBLENV";
reg = <0x000e 0x0001>;
-   read-only;
};
partition6@f {
label = "0:APPSBL";
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
index 361614945145..8c038917b668 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts
+++ b/target/linux/ipq40xx/files/arch/arm

[PATCH 0/3] ipq40xx: remedy potential of producing

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some of devices having kernel on NOR flash could reach limit of kernel
partition size at 4MiB and soft-brick them. Unfortunately we don't know
if all of them are affected, thus kernel size limit is added to all of
remaining ones. Later commit allows for some devices to prepare painless
transition, while the last one shows how it can be done for device i
introduced. I tried to make transition for the device as generic as
possible so it coulld be used on others, but unfortunately I own only
one device, which means the owners of the rest device need to verify if
it works for them and add their devices.

Tomasz Maciej Nowak (3):
  ipq40xx: image: limit kernel size for NOR devices
  ipq40xx: dts: allow writing to U-Boot environment
  ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

 .../etc/uci-defaults/05_fix-compat-version|  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh  | 14 ++
 .../boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-eap1300.dts|  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-emr3500.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi  |  1 -
 .../files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4018-wre6606.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts |  1 -
 .../arm/boot/dts/qcom-ipq4019-habanero-dvk.dts|  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4019-x1pro.dts  |  1 -
 .../arch/arm/boot/dts/qcom-ipq4028-wpj428.dts |  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts   |  1 -
 .../arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts   |  1 -
 target/linux/ipq40xx/image/generic.mk | 15 +++
 19 files changed, 31 insertions(+), 17 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Alter command boot sequence in U-Boot on first boot after upgrade to
workaround the kernel size limitation. The kernel size read from flash
will be 8MiB, which should suffice for forseable future. As precaution a
warning interupting upgrade is emited, explaining what to do.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../etc/uci-defaults/05_fix-compat-version |  3 ++-
 .../base-files/lib/preinit/81_patch_uboot_env.sh   | 14 ++
 target/linux/ipq40xx/image/generic.mk  | 10 +-
 3 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh

diff --git 
a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version 
b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
index c01192089712..a3f90125c6e5 100644
--- a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
+++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version
@@ -4,7 +4,8 @@ case "$(board_name)" in
 linksys,ea6350v3|\
 linksys,ea8300|\
 linksys,mr8300|\
-ezviz,cs-w3-wd1200g-eup)
+ezviz,cs-w3-wd1200g-eup|\
+pakedge,wr-1)
uci set system.@system[0].compat_version="2.0"
uci commit system
;;
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh 
b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
new file mode 100644
index ..b5e508aac402
--- /dev/null
+++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh
@@ -0,0 +1,14 @@
+. /lib/functions.sh
+
+preinit_patch_uboot_env() {
+   case $(board_name) in
+   pakedge,wr-1)
+   if ! fw_printenv -n OpenWrt &>/dev/null; then
+   fw_setenv OpenWrt 'sf probe; sf read 0x8400 
0x18 0x80; bootm 0x8400'
+   fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 
's,bootipq,run OpenWrt,p')"
+   fi
+   ;;
+   esac
+}
+
+boot_hook_add preinit_main preinit_patch_uboot_env
diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index d9d60a25ff0f..0dadae122a87 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -958,8 +958,16 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
-   KERNEL_SIZE := 4096k
+   KERNEL_SIZE := 8192k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
+   DEVICE_COMPAT_VERSION := 2.0
+   DEVICE_COMPAT_MESSAGE := \n$\
+   Booting command in U-Boot needs to be changed because of kernel 
\n$\
+   growing beyond 4MiB. If OpenWrt 23.05.0 or later is running on 
\n$\
+   on the device, it has already been done and You can safely 
force \n$\
+   upgrade. If that's not the case, first upgrade to 23.05.0 and 
it \n$\
+   will automatically amend booting command in U-Boot on first 
boot. \n$\
+   Then proceed with the upgrade to desired version.
 endef
 TARGET_DEVICES += pakedge_wr-1
 
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/3] ipq40xx: image: limit kernel size for NOR devices

2023-07-07 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

'bootipq' command, on some devices with kernel on NOR flash chip, read
kernel partition size from Qualcomm proprietary partition table, which
seems to be stored in MIBIB partition. The partition table can be read
by 'smeminfo' command in U-Boot command line interface. Because this
partition table is never updated on sysupgrade (even when the kernel
size changes) kernel size is capped at initial value, usually 4MiB.
Sysupgrading such kernel will soft-brick the device, which will need
serial console for recovery. Some devices already suffer from this,
beacuse its U-Boot does not allow to boot LZMA compressed kernel image
and/or kernel zImage. Even some devices allowing to boot LZMA compressed
kernel will hit this limitation later. Therefore limit the kernel size
to 4MiB for devices not having it specified, so we won't create
soft-bricking images.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ipq40xx/image/generic.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index f15463ae8ca5..d9d60a25ff0f 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -130,6 +130,7 @@ define Device/8dev_habanero-dvk
DEVICE_VENDOR := 8devices
DEVICE_MODEL := Habanero DVK
IMAGE_SIZE := 30976k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4019
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | 
pad-rootfs | check-size | append-metadata
 endef
@@ -400,6 +401,7 @@ define Device/dlink_dap-2610
WRGG_DEVNAME := /dev/mtdblock/8
WRGG_SIGNATURE := wapac30_dkbs_dap2610
IMAGE_SIZE := 14080k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
# Bootloader expects a special 160 byte header which is added by
# wrgg-image.
@@ -478,6 +480,7 @@ define Device/engenius_emd1
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 30720k
+   KERNEL_SIZE := 4096k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
@@ -800,6 +803,7 @@ define Device/netgear_ex61x0v2
NETGEAR_BOARD_ID := EX6150v2series
NETGEAR_HW_ID := 29765285+16+0+128+2x2
IMAGE_SIZE := 14400k
+   KERNEL_SIZE := 4096k
SOC := qcom-ipq4018
 endef
 
@@ -954,6 +958,7 @@ define Device/pakedge_wr-1
SOC := qcom-ipq4018
BLOCKSIZE := 64k
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
 endef
 TARGET_DEVICES += pakedge_wr-1
@@ -1030,6 +1035,7 @@ define Device/qxwlan_e2600ac-c1
BOARD_NAME := e2600ac-c1
SOC := qcom-ipq4019
IMAGE_SIZE := 31232k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
append-metadata
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c1
@@ -1202,6 +1208,7 @@ define Device/zyxel_wre6606
DEVICE_DTS_CONFIG := config@4
SOC := qcom-ipq4018
IMAGE_SIZE := 13184k
+   KERNEL_SIZE := 4096k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | 
check-size | append-metadata
DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
 endef
-- 
2.41.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Non-SoC target for ARM64

2023-06-01 Thread Tomasz Maciej Nowak
W dniu 1.06.2023 o 18:58, Philip Prindeville pisze:
> Hi,

Hi.

> I'm thinking about the utility of being able to build a generalized ARM64 
> image (not "armvirt") for bring up on new platforms for testing.
> 
> There are a lot of generalized computing platforms like the Ampere Altra 
> servers that you might want to use as in inbound Apache proxy server, a load 
> balancer, a traffic shaper, etc.
> 
> Can we add a generic target for ARM64 just as x86_64 (or x86/64) is the 
> generic AMD64 target?
> 
> I'd like something that I could easily run on a Graviton2 or Altra or Ten64, 
> etc.
> 
> Also not clear to me why the various ARM targets like "layerscape", "imx", 
> "octeontx", etc. don't live under a common directory.
> 
> Yes, ARM is more optimized for SoCs that have I/O on-chip and hence there's 
> less mix-n-match compared to x86, but it's not completely unheard of either.
> 
> What do you all think of adding a generic target for aarch64?
> 
> And how awful would refactoring arm and aarch64 be?

Did You overlook this message 
http://lists.openwrt.org/pipermail/openwrt-devel/2023-May/041091.html ? Posted 
a week ago.
It's modifying armvirt target to boot it effortlessly on arm64 hardware.
The name of target stays but that's only a name.

> Thanks,
> 
> -Philip

Regards

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] download: create immutable subversion checkout archive

2023-05-10 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

On each generation of the archive check sum will differ, because when
checking out subversion repository, current date is used for directories
creation. Force tar to assign creation date of the last revision for all
items inside archive.

Signed-off-by: Tomasz Maciej Nowak 
---
 include/download.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/download.mk b/include/download.mk
index 34d31653b1a4..9ab0b6c08fca 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -187,7 +187,7 @@ define DownloadMethod/svn
svn export --non-interactive --trust-server-cert -r$(VERSION) 
$(URL) $(SUBDIR) || \
svn export --non-interactive -r$(VERSION) $(URL) $(SUBDIR) ) && 
\
echo "Packing checkout..." && \
-   export TAR_TIMESTAMP="" && \
+   export TAR_TIMESTAMP="`svn info -r$(VERSION) --show-item 
last-changed-date $(URL)`" && \
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
rm -rf $(SUBDIR); \
-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/6] kernel: refresh swconfig_leds to handle new trigger locking

2023-04-27 Thread Tomasz Maciej Nowak
From: Christian Marangi 

Refresh swconfig_leds source to handle new trigger locking that is now a
spinlock.

Signed-off-by: Christian Marangi 
---
 .../files/drivers/net/phy/swconfig_leds.c| 16 
 1 file changed, 16 insertions(+)

diff --git a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c 
b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
index df53e5cd4a21..1d309c046c8d 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
@@ -85,7 +85,11 @@ swconfig_trig_update_port_mask(struct led_trigger *trigger)
sw_trig = (void *) trigger;
 
port_mask = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
+   spin_lock(>leddev_list_lock);
+#else
read_lock(>leddev_list_lock);
+#endif
list_for_each(entry, >led_cdevs) {
struct led_classdev *led_cdev;
struct swconfig_trig_data *trig_data;
@@ -98,7 +102,11 @@ swconfig_trig_update_port_mask(struct led_trigger *trigger)
read_unlock(_data->lock);
}
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
+   spin_unlock(>leddev_list_lock);
+#else
read_unlock(>leddev_list_lock);
+#endif
 
sw_trig->port_mask = port_mask;
 
@@ -418,14 +426,22 @@ swconfig_trig_update_leds(struct switch_led_trigger 
*sw_trig)
struct led_trigger *trigger;
 
trigger = _trig->trig;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
+   spin_lock(>leddev_list_lock);
+#else
read_lock(>leddev_list_lock);
+#endif
list_for_each(entry, >led_cdevs) {
struct led_classdev *led_cdev;
 
led_cdev = list_entry(entry, struct led_classdev, trig_list);
swconfig_trig_led_event(sw_trig, led_cdev);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
+   spin_unlock(>leddev_list_lock);
+#else
read_unlock(>leddev_list_lock);
+#endif
 }
 
 static void
-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 4/6] kernel: fallback-sprom: rename random_ether_addr

2023-04-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This helper has been renamed looong time ago, and with
ba530fea8ca1 ("ethernet: remove random_ether_addr()") the old name is no
longer available, so rename accordingly.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/generic/files/drivers/bcma/fallback-sprom.c | 2 +-
 target/linux/generic/files/drivers/ssb/fallback-sprom.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/files/drivers/bcma/fallback-sprom.c 
b/target/linux/generic/files/drivers/bcma/fallback-sprom.c
index ce93560a4829..db583fca9cc2 100644
--- a/target/linux/generic/files/drivers/bcma/fallback-sprom.c
+++ b/target/linux/generic/files/drivers/bcma/fallback-sprom.c
@@ -494,7 +494,7 @@ static int bcma_fbs_probe(struct platform_device *pdev)
if (is_valid_ether_addr(mac)) {
dev_info(dev, "mtd mac %pM\n", mac);
} else {
-   random_ether_addr(mac);
+   eth_random_addr(mac);
dev_info(dev, "random mac %pM\n", mac);
}
 
diff --git a/target/linux/generic/files/drivers/ssb/fallback-sprom.c 
b/target/linux/generic/files/drivers/ssb/fallback-sprom.c
index 26f0fd2f0366..b8a4dcedcf4f 100644
--- a/target/linux/generic/files/drivers/ssb/fallback-sprom.c
+++ b/target/linux/generic/files/drivers/ssb/fallback-sprom.c
@@ -705,7 +705,7 @@ static int ssb_fbs_probe(struct platform_device *pdev)
if (is_valid_ether_addr(mac)) {
dev_info(dev, "mtd mac %pM\n", mac);
} else {
-   random_ether_addr(mac);
+   eth_random_addr(mac);
dev_info(dev, "random mac %pM\n", mac);
}
 
-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 5/6] ubnt-ledbar: add kernel 6.1 compat

2023-04-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

As of ed5c2f5fd10d ("i2c: Make remove callback return void") return
value of remove function is ignored.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c 
b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
index 555340c5e87f..ee9d34601c6f 100644
--- a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
+++ b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /**
  * Driver for the Ubiquiti RGB LED controller (LEDBAR).
@@ -218,13 +219,19 @@ static int ubnt_ledbar_probe(struct i2c_client *client,
return ubnt_ledbar_apply_state(ledbar);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
 static int ubnt_ledbar_remove(struct i2c_client *client)
+#else
+static void ubnt_ledbar_remove(struct i2c_client *client)
+#endif
 {
struct ubnt_ledbar *ledbar = i2c_get_clientdata(client);
 
mutex_destroy(>lock);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
+#endif
 }
 
 static const struct i2c_device_id ubnt_ledbar_id[] = {
-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 0/6] Preparation for kernel 6.1

2023-04-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Small set of non-invasive compat code preping support for 6.1 kernel
with two additional cosmetic commits. Should not break buildability of
touched parts.

Christian Marangi (2):
  kernel: refresh IFF_NO_IP_ALIGN ifdef for kernel >= 6.1
  kernel: refresh swconfig_leds to handle new trigger locking

Tomasz Maciej Nowak (4):
  generic: mtk_wed: correct kernel version
  kernel: fallback-sprom: rename random_ether_addr
  ubnt-ledbar: add kernel 6.1 compat
  ubnt-ledbar: depend on mediatek and ramips subtargets

 package/kernel/ubnt-ledbar/Makefile  |  2 +-
 .../kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c|  7 +++
 .../linux/ath25/files/drivers/net/phy/mvswitch.c |  8 ++--
 ...rnet-mtk_wed-introduce-wed-mcu-support.patch} |  0
 ...ernet-mtk_wed-introduce-wed-wo-support.patch} |  0
 ...tk_wed-rename-tx_wdma-array-in-rx_wdma.patch} |  0
 ...t-mtk_wed-add-configure-wed-wo-support.patch} |  0
 ...t-ethernet-mtk_wed-add-rx-mib-counters.patch} |  0
 ...tk_eth_soc-do-not-overwrite-mtu-config.patch} |  0
 ...tk_eth_soc-remove-cpu_relax-in-mtk_pen.patch} |  0
 .../generic/files/drivers/bcma/fallback-sprom.c  |  2 +-
 .../linux/generic/files/drivers/net/phy/ar8216.c |  8 ++--
 .../files/drivers/net/phy/swconfig_leds.c| 16 
 .../generic/files/drivers/ssb/fallback-sprom.c   |  2 +-
 14 files changed, 38 insertions(+), 7 deletions(-)
 rename 
target/linux/generic/backport-5.15/{729-01-v6.1-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
 => 729-01-v6.2-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-02-v6.1-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
 => 729-02-v6.2-net-ethernet-mtk_wed-introduce-wed-wo-support.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-03-v6.1-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
 => 729-03-v6.2-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch} 
(100%)
 rename 
target/linux/generic/backport-5.15/{729-04-v6.1-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
 => 729-04-v6.2-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-05-v6.1-net-ethernet-mtk_wed-add-rx-mib-counters.patch
 => 729-05-v6.2-net-ethernet-mtk_wed-add-rx-mib-counters.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
 => 729-06-v6.2-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch} 
(100%)
 rename 
target/linux/generic/backport-5.15/{729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch
 => 729-07-v6.2-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch} 
(100%)

-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/6] generic: mtk_wed: correct kernel version

2023-04-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

These patches were accepted during 6.2 merge window, so rename
accordingly.

Signed-off-by: Tomasz Maciej Nowak 
---
 ...-01-v6.2-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch} | 0
 ...9-02-v6.2-net-ethernet-mtk_wed-introduce-wed-wo-support.patch} | 0
 2-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch} | 0
 ...-v6.2-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch} | 0
 ...=> 729-05-v6.2-net-ethernet-mtk_wed-add-rx-mib-counters.patch} | 0
 2-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch} | 0
 2-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch} | 0
 7 files changed, 0 insertions(+), 0 deletions(-)
 rename 
target/linux/generic/backport-5.15/{729-01-v6.1-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
 => 729-01-v6.2-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-02-v6.1-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
 => 729-02-v6.2-net-ethernet-mtk_wed-introduce-wed-wo-support.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-03-v6.1-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
 => 729-03-v6.2-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch} 
(100%)
 rename 
target/linux/generic/backport-5.15/{729-04-v6.1-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
 => 729-04-v6.2-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-05-v6.1-net-ethernet-mtk_wed-add-rx-mib-counters.patch
 => 729-05-v6.2-net-ethernet-mtk_wed-add-rx-mib-counters.patch} (100%)
 rename 
target/linux/generic/backport-5.15/{729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
 => 729-06-v6.2-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch} 
(100%)
 rename 
target/linux/generic/backport-5.15/{729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch
 => 729-07-v6.2-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch} 
(100%)

diff --git 
a/target/linux/generic/backport-5.15/729-01-v6.1-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
 
b/target/linux/generic/backport-5.15/729-01-v6.2-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
similarity index 100%
rename from 
target/linux/generic/backport-5.15/729-01-v6.1-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
rename to 
target/linux/generic/backport-5.15/729-01-v6.2-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
diff --git 
a/target/linux/generic/backport-5.15/729-02-v6.1-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
 
b/target/linux/generic/backport-5.15/729-02-v6.2-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
similarity index 100%
rename from 
target/linux/generic/backport-5.15/729-02-v6.1-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
rename to 
target/linux/generic/backport-5.15/729-02-v6.2-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
diff --git 
a/target/linux/generic/backport-5.15/729-03-v6.1-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
 
b/target/linux/generic/backport-5.15/729-03-v6.2-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
similarity index 100%
rename from 
target/linux/generic/backport-5.15/729-03-v6.1-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
rename to 
target/linux/generic/backport-5.15/729-03-v6.2-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
diff --git 
a/target/linux/generic/backport-5.15/729-04-v6.1-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
 
b/target/linux/generic/backport-5.15/729-04-v6.2-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
similarity index 100%
rename from 
target/linux/generic/backport-5.15/729-04-v6.1-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
rename to 
target/linux/generic/backport-5.15/729-04-v6.2-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
diff --git 
a/target/linux/generic/backport-5.15/729-05-v6.1-net-ethernet-mtk_wed-add-rx-mib-counters.patch
 
b/target/linux/generic/backport-5.15/729-05-v6.2-net-ethernet-mtk_wed-add-rx-mib-counters.patch
similarity index 100%
rename from 
target/linux/generic/backport-5.15/729-05-v6.1-net-ethernet-mtk_wed-add-rx-mib-counters.patch
rename to 
target/linux/generic/backport-5.15/729-05-v6.2-net-ethernet-mtk_wed-add-rx-mib-counters.patch
diff --git 
a/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
 
b/target/linux/generic/backport-5.15/729-06-v6.2-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
similarity index 100%
rename from 
target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
rename to 
target/linux/generic/backport-5.15/729-06-v6.2-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
diff --git 
a/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch

[PATCH 6/6] ubnt-ledbar: depend on mediatek and ramips subtargets

2023-04-27 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

It's only used on devices in mt7621 and mt7622 subtargets, so no reason
to compile it for others.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/ubnt-ledbar/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/ubnt-ledbar/Makefile 
b/package/kernel/ubnt-ledbar/Makefile
index 90eccf1c21b3..69236ffbb330 100644
--- a/package/kernel/ubnt-ledbar/Makefile
+++ b/package/kernel/ubnt-ledbar/Makefile
@@ -20,7 +20,7 @@ define KernelPackage/leds-ubnt-ledbar
   FILES:= \
$(PKG_BUILD_DIR)/leds-ubnt-ledbar.ko
   AUTOLOAD:=$(call AutoProbe,leds-ubnt-ledbar,1)
-  DEPENDS:=+kmod-i2c-core
+  DEPENDS:=@TARGET_mediatek_mt7622||TARGET_ramips_mt7621 +kmod-i2c-core
 endef
 
 define KernelPackage/leds-ubnt-ledbar/description
-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/6] kernel: refresh IFF_NO_IP_ALIGN ifdef for kernel >= 6.1

2023-04-27 Thread Tomasz Maciej Nowak
From: Christian Marangi 

Kernel 6.1 expanded the priv_flags to long bitmap so update and restore
it to priv_flags.

Signed-off-by: Christian Marangi 
---
 target/linux/ath25/files/drivers/net/phy/mvswitch.c | 8 ++--
 target/linux/generic/files/drivers/net/phy/ar8216.c | 8 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/target/linux/ath25/files/drivers/net/phy/mvswitch.c 
b/target/linux/ath25/files/drivers/net/phy/mvswitch.c
index e3550d55baf8..1f5a94798647 100644
--- a/target/linux/ath25/files/drivers/net/phy/mvswitch.c
+++ b/target/linux/ath25/files/drivers/net/phy/mvswitch.c
@@ -312,7 +312,9 @@ mvswitch_config_init(struct phy_device *pdev)
priv->orig_features = dev->features;
 
 #ifdef HEADER_MODE
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+   dev->priv_flags |= IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
 #else
dev->priv_flags |= IFF_NO_IP_ALIGN;
@@ -376,7 +378,9 @@ mvswitch_detach(struct phy_device *pdev)
dev->eth_mangle_rx = NULL;
dev->eth_mangle_tx = NULL;
dev->features = priv->orig_features;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+   dev->priv_flags &= ~IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
 #else
dev->priv_flags &= ~IFF_NO_IP_ALIGN;
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index bf98fd599ecb..54a964094f60 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2467,7 +2467,9 @@ ar8xxx_phy_config_init(struct phy_device *phydev)
/* VID fixup only needed on ar8216 */
if (chip_is_ar8216(priv)) {
dev->phy_ptr = priv;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+   dev->priv_flags |= IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
 #else
dev->priv_flags |= IFF_NO_IP_ALIGN;
@@ -2706,7 +2708,9 @@ ar8xxx_phy_detach(struct phy_device *phydev)
 
 #ifdef CONFIG_ETHERNET_PACKET_MANGLE
dev->phy_ptr = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+   dev->priv_flags &= ~IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
 #else
dev->priv_flags &= ~IFF_NO_IP_ALIGN;
-- 
2.40.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] sdk: expose PATENTED an NLS build options

2023-02-17 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some packages offer functionalities guarded by these options and it'll
be impossible to reach them without changing Config-build.in. So allow
to toggle these in more friendly way, by exposing them in configuration
menu.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
* drop uClibc from NLS help description, not supported anymore

 target/sdk/files/Config.in | 17 +
 1 file changed, 17 insertions(+)

diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in
index 7926e124265a..a14c17fe955b 100644
--- a/target/sdk/files/Config.in
+++ b/target/sdk/files/Config.in
@@ -18,6 +18,23 @@ menu "Global build settings"
bool "Cryptographically sign package lists"
default y
 
+   comment "General build options"
+
+   config BUILD_PATENTED
+   default n
+   bool "Compile with support for patented functionality"
+   help
+ When this option is disabled, software which provides 
patented functionality
+ will not be built.  In case software provides optional 
support for patented
+ functionality, this optional support will get disabled for 
this package.
+
+   config BUILD_NLS
+   default n
+   bool "Compile with full language support"
+   help
+ When this option is enabled, packages are built with the full 
versions of
+ iconv and GNU gettext instead of the default OpenWrt stubs.
+
comment "Package build options"
 
config DEBUG
-- 
2.39.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] sdk: expose PATENTED an NLS build options

2023-01-24 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Some packages offer functionalities guarded by these options and it'll
be impossible to reach them without changing Config-build.in. So allow
to toggle these in more friendly way, by exposing them in configuration
menu.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/sdk/files/Config.in | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in
index 12c0f6a6246c..e0b8160e5dfb 100644
--- a/target/sdk/files/Config.in
+++ b/target/sdk/files/Config.in
@@ -18,6 +18,24 @@ menu "Global build settings"
bool "Cryptographically sign package lists"
default y
 
+   comment "General build options"
+
+   config BUILD_PATENTED
+   default n
+   bool "Compile with support for patented functionality"
+   help
+ When this option is disabled, software which provides 
patented functionality
+ will not be built.  In case software provides optional 
support for patented
+ functionality, this optional support will get disabled for 
this package.
+
+   config BUILD_NLS
+   default n
+   bool "Compile with full language support"
+   help
+ When this option is enabled, packages are built with the full 
versions of
+ iconv and GNU gettext instead of the default OpenWrt stubs. 
If uClibc is
+ used, it is also built with locale support.
+
comment "Package build options"
 
config DEBUG
-- 
2.39.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] x86: add Barracuda Networks F12 interfaces

2023-01-23 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Match interface numbers with printed numbers on device enclosure and
assign first port as WAN interface.

Notes
Serial console is available through RJ-45 port with Cisco pinout
baud: 19200, parity: none, flow control: none
The device is setup with UEFI. To enter setup hold DEL or ESC key on
boot. Default UEFI Administrator password is: bcndk1
For users using graphics IC it's advisable to disable display with:
i915.disable_display=1
appending to kernel command line inside bootloader, to save about
0.5-0.6W energy on idle.
For users not using graphics IC, disable it in UEFI, this will save about
1.5W energy on idle.
Pins marked CN19 are ATX power On/Off button.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/x86/base-files/etc/board.d/02_network | 8 
 1 file changed, 8 insertions(+)

diff --git a/target/linux/x86/base-files/etc/board.d/02_network 
b/target/linux/x86/base-files/etc/board.d/02_network
index 5befba0a62d0..094a45f91483 100644
--- a/target/linux/x86/base-files/etc/board.d/02_network
+++ b/target/linux/x86/base-files/etc/board.d/02_network
@@ -8,6 +8,14 @@
 board_config_update
 
 case "$(board_name)" in
+barracuda-networks-inc-barracuda-ng-firewall-f12)
+   ucidef_set_network_device_path "eth1" 
"pci:00/:00:14.0/:01:00.0"
+   ucidef_set_network_device_path "eth2" 
"pci:00/:00:14.1/:02:00.0"
+   ucidef_set_network_device_path "eth3" 
"pci:00/:00:13.0/:03:00.0"
+   ucidef_set_network_device_path "eth4" 
"pci:00/:00:13.1/:04:00.0"
+   ucidef_set_network_device_path "eth5" 
"pci:00/:00:13.2/:05:00.0"
+   ucidef_set_interfaces_lan_wan "eth2 eth3 eth4 eth5" "eth1"
+   ;;
 cisco-mx100-hw)
ucidef_set_network_device_path "mgmt" 
"pci:00/:00:01.2/:03:00.3"
ucidef_set_network_device_path "wan" 
"pci:00/:00:01.2/:03:00.2"
-- 
2.39.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] x86: remove bootloader upgrade from preinit

2023-01-23 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This hack was to bring all existing installations to the newest GRUB
version as fast as possible. Since 19.07.x is EoL we can assume this
task is completed. Now sysupgrade will solely be responsible for
bootloader upgrade.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../lib/preinit/81_upgrade_bootloader  | 18 --
 .../x86/base-files/lib/upgrade/platform.sh |  3 +--
 2 files changed, 1 insertion(+), 20 deletions(-)
 delete mode 100644 
target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader

diff --git a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader 
b/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader
deleted file mode 100644
index 42f04d76a7ec..
--- a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader
+++ /dev/null
@@ -1,18 +0,0 @@
-upgrade_bootloader() {
-   local diskdev
-
-   . /lib/upgrade/common.sh
-
-   if [ ! -f /boot/grub/upgraded ] && export_bootdevice && 
export_partdevice diskdev 0; then
-   part_magic_efi "/dev/$diskdev" && return 0
-   echo "(hd0) /dev/$diskdev" > /tmp/device.map
-   /usr/sbin/grub-bios-setup \
-   -m "/tmp/device.map" \
-   -d "/boot/grub" \
-   -r "hd0,msdos1" \
-   "/dev/$diskdev" \
-   && touch /boot/grub/upgraded
-   fi
-}
-
-[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main upgrade_bootloader
diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh 
b/target/linux/x86/base-files/lib/upgrade/platform.sh
index d8f2eba97ecb..5dad7a538a59 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -62,8 +62,7 @@ platform_do_bootloader_upgrade() {
-m "/tmp/device.map" \
-d "/tmp/boot/boot/grub" \
-r "hd0,${parttable}1" \
-   "/dev/$diskdev" \
-   && touch /tmp/boot/boot/grub/upgraded
+   "/dev/$diskdev"
 
umount /tmp/boot
fi
-- 
2.39.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] x86: remove bootloader upgrade from preinit

2023-01-23 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

This hack was to bring all existing installations to the newest GRUB
version as fast as possible. Since 19.07.x is EoL we can assume this
task is completed. Now sysupgrade will solely be responsible for
bootloader upgrade.

Signed-off-by: Tomasz Maciej Nowak 
---

Some glitch rejected this email. Re-sending.

 .../lib/preinit/81_upgrade_bootloader  | 18 --
 .../x86/base-files/lib/upgrade/platform.sh |  3 +--
 2 files changed, 1 insertion(+), 20 deletions(-)
 delete mode 100644 
target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader

diff --git a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader 
b/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader
deleted file mode 100644
index 42f04d76a7ec..
--- a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader
+++ /dev/null
@@ -1,18 +0,0 @@
-upgrade_bootloader() {
-   local diskdev
-
-   . /lib/upgrade/common.sh
-
-   if [ ! -f /boot/grub/upgraded ] && export_bootdevice && 
export_partdevice diskdev 0; then
-   part_magic_efi "/dev/$diskdev" && return 0
-   echo "(hd0) /dev/$diskdev" > /tmp/device.map
-   /usr/sbin/grub-bios-setup \
-   -m "/tmp/device.map" \
-   -d "/boot/grub" \
-   -r "hd0,msdos1" \
-   "/dev/$diskdev" \
-   && touch /boot/grub/upgraded
-   fi
-}
-
-[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main upgrade_bootloader
diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh 
b/target/linux/x86/base-files/lib/upgrade/platform.sh
index d8f2eba97ecb..5dad7a538a59 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -62,8 +62,7 @@ platform_do_bootloader_upgrade() {
-m "/tmp/device.map" \
-d "/tmp/boot/boot/grub" \
-r "hd0,${parttable}1" \
-   "/dev/$diskdev" \
-   && touch /tmp/boot/boot/grub/upgraded
+   "/dev/$diskdev"
 
umount /tmp/boot
fi
-- 
2.39.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/2] grub2: re-add test module

2023-01-23 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

It seems more hardware needs early load of firmware when initialised
to work properly (at least Intel hardware). One of previous case is CPU
microcode, which this series[1] tried to change. The second one is Intel
graphics IC, which needs firmware for controlling DMC circuit (switch
conncted display to DC6 power state). As it stands, the i915 module is
built-in and it seems the hardware can't cope with firmware loaded
later from rootfs, it needs to be supplied when the module is loaded.
Unfortunately we need bootloader to handle the load of firmware in this
case, but as previously mentioned series[1], there was an error when
initrd was hardcoded, instead of testing existence for it and then
loading. To remedy this in later the 55b808e0c4be ('x86: image: add test
module to bootloader') was commited. Which was later accidentally
dropped when grub2 image creation was moved to packages. Therefore bring
back test module, so we can test for cases of existing firmware in
grub.cfg.

1. 
https://patchwork.ozlabs.org/project/openwrt/cover/20181120162044.16371-1-tome...@o2.pl

Fixes: 5a5df62d95f5 ("x86/grub2: move grub2 image creation to package")
Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/grub2/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index c4cc43de2e60..7d6cfd539594 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -122,14 +122,14 @@ define Package/grub2/install
-O i386-pc \
-c $(PKG_BUILD_DIR)/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/gpt-core.img \
-   at_keyboard biosdisk boot chain configfile fat linux ls 
part_gpt reboot search serial vga
+   at_keyboard biosdisk boot chain configfile fat linux ls 
part_gpt reboot search serial test vga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
-O i386-pc \
-c ./files/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/generic-core.img \
-   at_keyboard biosdisk boot chain configfile ext2 linux ls 
part_msdos reboot search serial vga
+   at_keyboard biosdisk boot chain configfile ext2 linux ls 
part_msdos reboot search serial test vga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
@@ -154,7 +154,7 @@ define Package/grub2-efi/install
-O $(CONFIG_ARCH)-efi \
-c $(PKG_BUILD_DIR)/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/boot$(if 
$(CONFIG_x86_64),x64,ia32).efi \
-   at_keyboard boot chain configfile fat linux ls part_gpt reboot 
serial efi_gop efi_uga
+   at_keyboard boot chain configfile fat linux ls part_gpt reboot 
serial test efi_gop efi_uga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
-- 
2.39.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: mt7621 GPIO mapping mystery

2023-01-21 Thread Tomasz Maciej Nowak
Hi.

W dniu 21.01.2023 o 16:33, Lukas Zeller pisze:
> Hi Sergio, thanks for the reply!
> 
> On 21 Jan 2023, at 14:00, Sergio Paracuellos  
> wrote:
> 
>> On Sat, Jan 21, 2023 at 1:19 PM Lukas Zeller  wrote:
>>> [...]So while I understand that using only the DT mechanisms for 
>>> configuring GPIO modes, named gpios and libgpiod instead of /sys/class/gpio 
>>> etc. is the way to go, I must also state that without loadable DT overlays, 
>>> this essentially makes openwrt unsuitable for experimental/educational 
>>> devices.
>>
>> Configure the GPIO modes is not something that is expected to be done
>> by a user since all of that belongs to the pinctrl driver space and
>> AFAIK linux kernel people are not thinking in doing pinctrl driver
>> user-space tools.
> 
> Apparently, yes.
> 
> I also fully understand this from a system designer's point of view.
> 
> What pin is connected to what external hardware, is something that is, in a 
> given system, on a given PCB, pretty immutable and thus DT is the correct and 
> only place to also define it in a way that is immutable between flashing 
> firmwares.
> 
>> The libgpiod is useful to detect and set to on and
>> off different pins (among other pure GPIO operations) but from the
>> already function GPIO set up in them.
> 
> This draws a pretty arbitrary boundary for what a educational/experimental 
> use consists of. Toggling predefined GPIOs on and off, yes, using the same 
> pin for PWM (say, GPIO18 on MT76x8), no? rotary-encoder? W1? GPIO-based SPI, 
> I2C?
> 
>> I am not doing the rules,
> 
> :-)
> 
>> I am just saying the things that are now in the kernel and user space as I
>> think they are. As I have already said, I am not an expert in this
>> topic at all but maybe if we want to do such complex things like
>> configuring the mode of a pin from user space some kind of user space
>> drivers need to be provided in some way... So, if openWRT is using
>> linux kernel, at the end they have to also live with kernel people's
>> decisions in some way...
> 
> In some way.
> 
> But OpenWrt does patch the kernel to adjust things that Linux mainline does 
> not provide.
> 
> So it *is* an OpenWrt question whether to support HW tinkering and to what 
> degree.
> 
> Having that loadable DT overlay patch (which works on 5.10, I'm using it) as 
> a menuconfig option disabled by default would have two benefits:
> 
> - going with the linux kernel way, to have these HW config things in the DT, 
> and only there.
> 
> - one single, completely HW independent switch, off by default, to allow HW 
> experiments or not (compiling in the dynamically loadable DT overlays code).
> 
> Builds for targets that *want* to be open for educational/experimental HW 
> tinkering, with the set of risks that comes with that, can set this switch. 
> All normal router targets will not set set it, and thus are not affected.
> 
> I think this would be better and easier to maintain, than reverting back to 
> driver-level hacks like we had in 19.x with *_gpio_custom and friends.
> 
> So basically, I'm suggesting to revisit the decision to reject the patch from 
> Daniel Golle [1].

Instead of doing it the hard way of patching, why not using out-of-tree kernel
module[2] for loading dtb overlay with configfs? It already exists for some
time. Unfortunately I didn't test it, as the board I wanted to use it has gone
in flames. For ready to use recipe see the attachment. Feel free to submit it
to packages feed and take over maintainership after giving it a test.

> [1] http://lists.openwrt.org/pipermail/openwrt-devel/2021-November/037139.html

2. https://github.com/ikwzm/dtbocfg

-- 
TMN
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (c) 2022 Tomasz Maciej Nowak 

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME := dtbocfg
PKG_VERSION := 0.0.9
PKG_RELEASE := 1

PKG_LICENSE := BSD-2-Clause
PKG_LICENSE_FILES := LICENSE

PKG_SOURCE_PROTO := git
PKG_SOURCE_URL := https://github.com/ikwzm/dtbocfg.git
PKG_SOURCE_VERSION := 2d5593ba4fea35b75fce716a5d9538f984493cbd
PKG_MIRROR_HASH := 
7cbb8aa089dc3d261ea5461297a970aa3d4cb667b9459850969eec233f409898

PKG_MAINTAINER := Tomasz Maciej Nowak 
PKG_BUILD_PARALLEL := 1
PKG_FLAGS := nonshared

include $(INCLUDE_DIR)/package.mk

define KernelPackage/fs-dtbocfg
  SUBMENU := Filesystems
  TITLE := Device Tree Blob Overlay Configuration File System
  DEPENDS := +kmod-fs-configfs @!TARGET_bcm27xx
  FILES := $(PKG_BUILD_DIR)/dtbocfg.ko
  AUTOLOAD := $(call AutoLoad,31,dtbocfg,)
endef

define KernelPackage/fs-dtbocfg/description
 Device Tree Overlay is a mechanism that enables dynamic loading/unloading
 of a new device tree blob on top of the kernel device tree.
endef

define Build/Compile
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
endef

$(eval $(call KernelPackage,fs-dtbocfg))
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: how to add to list of Image files or supplementary files?

2022-10-24 Thread Tomasz Maciej Nowak
W dniu 20.10.2022 o 23:04, Tim Harvey pisze:
> Greetings,
> 
> How would I go about getting a file added to the list of Image Files
> or Supplementary Files made by the auto-builder?
> 
> For the octeontx target the kernel should be provided as a downloadable as 
> well.

I'm not exactly sure, but the code installing images in octeontx target never 
gets
called, because it lacks filesystem in FEATURES variable in target Makefile. 
This,
in result, doesn't select any images by default. At least put "ramdisk" there,
adding others might be also good, depending on boot medium. Check "Target 
Images"
in menuconfig what's available.

> 
> Best Regards,
> 
> Tim

Regards

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 21.02] ipq40xx: luma_wrtq-acn329: swap ethernet MAC addresses

2022-10-03 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Adjust them according to OEM firmware.

Fixes: e24635710c7e (" ipq40xx: add support for Luma Home WRTQ-329ACN")
Signed-off-by: Tomasz Maciej Nowak 
---
 .../files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
index 2465348a821e..1496f145bd29 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
@@ -9,6 +9,11 @@
model = "Luma Home WRTQ-329ACN";
compatible = "luma,wrtq-329acn";
 
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
i2c-gpio {
compatible = "i2c-gpio";
sda-gpios = < 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
-- 
2.37.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 22.03] ipq40xx: luma_wrtq-acn329: swap ethernet MAC addresses

2022-10-03 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Adjust them according to OEM firmware.

Fixes: e24635710c7e (" ipq40xx: add support for Luma Home WRTQ-329ACN")
Signed-off-by: Tomasz Maciej Nowak 
---
This is different than
https://patchwork.ozlabs.org/project/openwrt/patch/20220923124739.5979-1,
where I made a blunder and tested the change with DSA patches enabled,
which made the change absolutely moot on pre-DSA driver. Since the DSA
series was about to be accepted I didn't send the revert and causing
more noise. Sorry.

 .../files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
index 5b0c8cf10690..0eed441a2d75 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
@@ -9,6 +9,11 @@
model = "Luma Home WRTQ-329ACN";
compatible = "luma,wrtq-329acn";
 
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   };
+
i2c-gpio {
compatible = "i2c-gpio";
sda-gpios = < 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
-- 
2.37.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ipq40xx: pakedge_wr-1: convert to DSA

2022-10-03 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

And enable the device.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../ipq40xx/base-files/etc/board.d/02_network |  1 +
 .../arch/arm/boot/dts/qcom-ipq4018-wr-1.dts   | 37 +++
 target/linux/ipq40xx/image/generic.mk |  3 +-
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network 
b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index d9a162b10d42..163dcdcbc681 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -21,6 +21,7 @@ ipq40xx_setup_interfaces()
mikrotik,hap-ac3|\
p2w,r619ac-64m|\
p2w,r619ac-128m|\
+   pakedge,wr-1|\
zyxel,nbg6617)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts
index 317fe26e2e9a..16951da47fc0 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts
@@ -11,6 +11,7 @@
compatible = "pakedge,wr-1";
 
aliases {
+   label-mac-device = 
led-boot = _power;
led-failsafe = _power;
led-running = _power;
@@ -177,6 +178,10 @@
status = "okay";
 };
 
+ {
+   status = "okay";
+};
+
  {
status = "okay";
 };
@@ -185,6 +190,38 @@
status = "okay";
 };
 
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+
+   label = "lan4";
+};
+
+ {
+   status = "okay";
+
+   label = "lan3";
+};
+
+ {
+   status = "okay";
+
+   label = "lan2";
+};
+
+ {
+   status = "okay";
+
+   label = "lan1";
+};
+
+ {
+   status = "okay";
+};
+
  {
key_pins: key_pinmux {
mux {
diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index 69ec42c26657..3c1cf6744882 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -938,8 +938,7 @@ define Device/pakedge_wr-1
IMAGE_SIZE := 31232k
IMAGE/sysupgrade.bin := append-kernel | pad-to (BLOCKSIZE) | 
append-rootfs | pad-rootfs | append-metadata
 endef
-# Missing DSA Setup
-#TARGET_DEVICES += pakedge_wr-1
+TARGET_DEVICES += pakedge_wr-1
 
 define Device/plasmacloud_pa1200
$(call Device/FitImageLzma)
-- 
2.37.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ipq40xx: luma_wrtq-329acn: convert to DSA

2022-10-03 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

And enable the device.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../ipq40xx/base-files/etc/board.d/02_network |  1 +
 .../arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts | 55 +--
 target/linux/ipq40xx/image/generic.mk |  3 +-
 3 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network 
b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 3d05589369b5..d9a162b10d42 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -30,6 +30,7 @@ ipq40xx_setup_interfaces()
cilab,meshpoint-one|\
edgecore,ecw5211|\
glinet,gl-b2200|\
+   luma,wrtq-329acn|\
mikrotik,cap-ac|\
netgear,wac510)
ucidef_set_interfaces_lan_wan "lan" "wan"
diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
index 2407698fe1c8..4694c5681914 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
@@ -45,10 +45,6 @@
status = "okay";
};
 
-   mdio@9 {
-   status = "okay";
-   };
-
tcsr@1949000 {
compatible = "qcom,tcsr";
reg = <0x1949000 0x100>;
@@ -213,6 +209,45 @@
status = "okay";
 };
 
+ {
+   status = "okay";
+};
+
+ {
+   status = "disabled";
+};
+
+ {
+   status = "disabled";
+};
+
+ {
+   status = "disabled";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+
+   label = "lan";
+   nvmem-cell-names = "mac-address";
+   nvmem-cells = <_art_6>;
+};
+
+ {
+   status = "okay";
+
+   nvmem-cell-names = "mac-address";
+   nvmem-cells = <_art_0>;
+};
+
  {
serial0_pins: serial0_pinmux {
mux {
@@ -252,18 +287,6 @@
status = "okay";
 };
 
- {
-   status = "disabled";
-};
-
- {
-   status = "disabled";
-};
-
- {
-   status = "disabled";
-};
-
  {
status = "okay";
nvmem-cell-names = "pre-calibration";
diff --git a/target/linux/ipq40xx/image/generic.mk 
b/target/linux/ipq40xx/image/generic.mk
index 47e8c129b49c..69ec42c26657 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -727,8 +727,7 @@ define Device/luma_wrtq-329acn
BLOCKSIZE := 128k
PAGESIZE := 2048
 endef
-# Missing DSA Setup
-#TARGET_DEVICES += luma_wrtq-329acn
+TARGET_DEVICES += luma_wrtq-329acn
 
 define Device/meraki_mr33
$(call Device/FitImage)
-- 
2.37.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ipq40xx: base-files: properly close case

2022-09-23 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Fix this occurence during boot:
/bin/board_detect: line 10: Unsupported: not found

Fixes: 80baffd2aa91 (" ipq40xx: add support for Pakedge WR-1")
Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ipq40xx/base-files/etc/board.d/02_network | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network 
b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index db58eb9363bf..040f3ee61974 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -228,6 +228,7 @@ ipq40xx_setup_macs()
;;
pakedge,wr-1)
wan_mac=$(macaddr_add $(get_mac_label) 1)
+   ;;
esac
 
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
-- 
2.37.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ipq40xx: luma_wrtq-329acn: differentiate ethernet mac addresses

2022-09-23 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

On OEM firmware both addresses for In and Out ports are different. Set
them as such also in OpenWrt.

Fixes: e24635710c7e (" ipq40xx: add support for Luma Home WRTQ-329ACN")
Signed-off-by: Tomasz Maciej Nowak 
---
 .../arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts   | 12 
 1 file changed, 12 insertions(+)

diff --git 
a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts 
b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
index 5b0c8cf10690..2af429634218 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts
@@ -182,6 +182,14 @@
#address-cells = <1>;
#size-cells = <1>;
 
+   macaddr_art_0: macaddr@0{
+   reg = <0x 0x0006>;
+   };
+
+   macaddr_art_6: macaddr@6{
+   reg = <0x0006 0x0006>;
+   };
+
precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>;
};
@@ -227,11 +235,15 @@
  {
qcom,phy_mdio_addr = <2>;
qcom,poll_required = <1>;
+   nvmem-cell-names = "mac-address";
+   nvmem-cells = <_art_6>;
 };
 
  {
qcom,phy_mdio_addr = <4>;
qcom,poll_required = <1>;
+   nvmem-cell-names = "mac-address";
+   nvmem-cells = <_art_0>;
 };
 
  {
-- 
2.37.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 1/2] tegra: copy patches and config for kernel 5.15

2022-09-13 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

Simple copy to better illustrate the forthcoming changes.

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
- fix commit message

 target/linux/tegra/config-5.15| 484 ++
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 ...enable-front-panel-leds-in-TrimSlice.patch |  46 ++
 3 files changed, 607 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 ..8d808595d9d1
--- /dev/null
+++ b/target/linux/tegra/config-5.15
@@ -0,0 +1,484 @@
+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_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_LOOP=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_PM=y
+CONFIG_BLK_SCSI_REQUEST=y
+CONFIG_BOUNCE=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=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_COMMON_CLK=y
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_CONTIG_ALLOC=y
+# CONFIG_CPUFREQ_DT is not set
+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_ACOMP2=y
+CONFIG_CRYPTO_AES_ARM=y
+CONFIG_CRYPTO_AKCIPHER=y
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_BLAKE2S=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_NULL=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_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_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_FBDEV_EMULATION=y
+CONFIG_DRM_FB

[PATCH v2 2/2] tegra: add kernel 5.15 support

2022-09-13 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

- refresh config
- disable suspend as it's pointless in the sope of OpenWrt
- enable CPU frequency scaling

Signed-off-by: Tomasz Maciej Nowak 
---
v1 -> v2
- fix unresolved symbols pointed by Petr

 target/linux/tegra/Makefile|  1 +
 target/linux/tegra/config-5.15 | 62 +++---
 2 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/target/linux/tegra/Makefile b/target/linux/tegra/Makefile
index 76dfeab4026d..51019607f25b 100644
--- a/target/linux/tegra/Makefile
+++ b/target/linux/tegra/Makefile
@@ -12,6 +12,7 @@ CPU_TYPE := cortex-a9
 CPU_SUBTYPE := vfpv3-d16
 
 KERNEL_PATCHVER := 5.10
+KERNEL_TESTING_PATCHVER := 5.15
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/tegra/config-5.15 b/target/linux/tegra/config-5.15
index 8d808595d9d1..794fa8b7146a 100644
--- a/target/linux/tegra/config-5.15
+++ b/target/linux/tegra/config-5.15
@@ -36,6 +36,8 @@ 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
@@ -47,13 +49,12 @@ 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_BLK_SCSI_REQUEST=y
 CONFIG_BOUNCE=y
 CONFIG_CACHE_L2X0=y
-CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CLZ_TAB=y
@@ -67,10 +68,12 @@ CONFIG_CMA_SIZE_MBYTES=16
 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 is not set
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
 CONFIG_CPU_32v6K=y
 CONFIG_CPU_32v7=y
 CONFIG_CPU_ABRT_EV7=y
@@ -105,11 +108,7 @@ CONFIG_CRC16=y
 # CONFIG_CRC32_SARWATE is not set
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CROSS_MEMORY_ATTACH=y
-CONFIG_CRYPTO_ACOMP2=y
 CONFIG_CRYPTO_AES_ARM=y
-CONFIG_CRYPTO_AKCIPHER=y
-CONFIG_CRYPTO_AKCIPHER2=y
-CONFIG_CRYPTO_BLAKE2S=y
 CONFIG_CRYPTO_CRC32=y
 CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_CRYPTD=y
@@ -125,7 +124,6 @@ CONFIG_CRYPTO_LIB_SHA256=y
 CONFIG_CRYPTO_LZ4=y
 CONFIG_CRYPTO_LZ4HC=y
 CONFIG_CRYPTO_LZO=y
-CONFIG_CRYPTO_NULL=y
 CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_RNG_DEFAULT=y
@@ -135,12 +133,19 @@ 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
@@ -154,7 +159,6 @@ CONFIG_DRM=y
 CONFIG_DRM_BRIDGE=y
 CONFIG_DRM_FBDEV_EMULATION=y
 CONFIG_DRM_FBDEV_OVERALLOC=100
-CONFIG_DRM_KMS_FB_HELPER=y
 CONFIG_DRM_KMS_HELPER=y
 CONFIG_DRM_MIPI_DSI=y
 CONFIG_DRM_PANEL=y
@@ -166,7 +170,6 @@ CONFIG_DRM_TEGRA=y
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
-CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_EXT4_FS=y
 CONFIG_EXTCON=y
 CONFIG_F2FS_FS=y
@@ -181,10 +184,8 @@ CONFIG_FB_SYS_FILLRECT=y
 CONFIG_FB_SYS_FOPS=y
 CONFIG_FB_SYS_IMAGEBLIT=y
 CONFIG_FIX_EARLYCON_MEM=y
-CONFIG_FREEZER=y
 CONFIG_FS_IOMAP=y
 CONFIG_FS_MBCACHE=y
-# CONFIG_FW_CACHE is not set
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ARCH_TOPOLOGY=y
@@ -192,6 +193,7 @@ 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
@@ -200,6 +202,7 @@ 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
@@ -214,6 +217,8 @@ 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
@@ -240,8 +245,11 @@ 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_LAZY is not set
+CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
 # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not s

[PATCH v3] arm-trusted-firmware-mvebu: stop cluttering Image Builder

2022-09-11 Thread Tomasz Maciej Nowak
From: Tomasz Maciej Nowak 

All contents of staging_dir/image are included in Image Builder (IB) in
case some binary needs to be included in final image. But in case of
this package, all sources are stored there and those clutter the final
tarball of IB for no reason. Those sources are not used during image
creation and are just dead weight. To put it in perspective, the IB for
21.02.0 is 158 MiB, 22.03.0-rc6 is 366 MiB and snapshot is over 620 MiB!
To fix it, put them in package build directory, so they won't end up
included in IB tarball.

Signed-off-by: Tomasz Maciej Nowak 
Reviewed-by: Andre Heider 
---
v2 -> v3
- extract sources to root of build_dir instead of extarcting them for
  each variant which would increase build time, as pointed by Hauke
- bring back cleaning definition

 .../boot/arm-trusted-firmware-mvebu/Makefile  | 41 +--
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile 
b/package/boot/arm-trusted-firmware-mvebu/Makefile
index dba4836a6b98..3b7fd7a7cc5a 100644
--- a/package/boot/arm-trusted-firmware-mvebu/Makefile
+++ b/package/boot/arm-trusted-firmware-mvebu/Makefile
@@ -108,12 +108,12 @@ TFA_TARGETS:= \
udpu
 
 TFA_MAKE_FLAGS += \
-   
CROSS_CM3=$(STAGING_DIR_IMAGE)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi-
 \
+   
CROSS_CM3=$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi-
 \
BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \
-   MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \
-   WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \
-   
WTMI_IMG=$(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE)/wtmi_app.bin \
-   CRYPTOPP_PATH=$(STAGING_DIR_IMAGE)/$(CRYPTOPP_NAME) \
+   MV_DDR_PATH=$(BUILD_DIR)/$(MV_DDR_NAME) \
+   WTP=$(BUILD_DIR)/$(A3700_UTILS_NAME) \
+   
WTMI_IMG=$(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE)/wtmi_app.bin \
+   CRYPTOPP_PATH=$(BUILD_DIR)/$(CRYPTOPP_NAME) \
USE_COHERENT_MEM=0 \
FIP_ALIGN=0x100 \
DDR_TOPOLOGY=$(DDR_TOPOLOGY) \
@@ -190,11 +190,11 @@ endef
 
 define Build/Clean
rm -rf \
-   $(STAGING_DIR_IMAGE)/$(CRYPTOPP_NAME) \
-   $(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \
-   $(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \
-   $(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
-   
$(STAGING_DIR_IMAGE)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)
+   $(BUILD_DIR)/$(CRYPTOPP_NAME) \
+   $(BUILD_DIR)/$(A3700_UTILS_NAME) \
+   $(BUILD_DIR)/$(MV_DDR_NAME) \
+   $(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
+   
$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)
 endef
 
 define Build/Prepare
@@ -207,23 +207,22 @@ define Build/Prepare
 
$(call Build/Prepare/Default,)
 
-   mkdir -p $(STAGING_DIR_IMAGE)
-   $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(CRYPTOPP_SOURCE)
-   $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE)
-   $(call 
PatchDir/Default,$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME),./patches-a3700-utils)
-   $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MV_DDR_SOURCE)
-   $(call 
PatchDir/Default,$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME),./patches-mv-ddr-marvell)
-   $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MOX_BB_SOURCE)
-   $(call 
PatchDir/Default,$(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE),./patches-mox-boot-builder)
-   $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(CM3_GCC_SOURCE)
+   $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(CRYPTOPP_SOURCE)
+   $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE)
+   $(call 
PatchDir/Default,$(BUILD_DIR)/$(A3700_UTILS_NAME),./patches-a3700-utils)
+   $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(MV_DDR_SOURCE)
+   $(call 
PatchDir/Default,$(BUILD_DIR)/$(MV_DDR_NAME),./patches-mv-ddr-marvell)
+   $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(MOX_BB_SOURCE)
+   $(call 
PatchDir/Default,$(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE),./patches-mox-boot-builder)
+   $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(CM3_GCC_SOURCE)
 endef
 
 define Build/Compile
+$(MAKE) \
-   
CROSS_CM3=$(STAGING_DIR_IMAGE)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi-
 \
+   
CROSS_CM3=$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi-
 \
WTMI_VERSION=$(MOX_BB_RELEASE) \
CRYPTOPP_PATH=$PWD/cryptopp/ \
-   -C $(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
+   -C $(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
wtmi_app.bin
$(call Build/Compile/Default)
 endef
-- 
2.3

Re: [PATCH v2] arm-trusted-firmware-mvebu: stop cluttering Image Builder

2022-09-07 Thread Tomasz Maciej Nowak
W dniu 7.09.2022 o 22:57, Hauke Mehrtens pisze:
> On 9/7/22 19:23, Tomasz Maciej Nowak wrote:
>> W dniu 7.09.2022 o 00:15, Hauke Mehrtens pisze:
>>> On 8/31/22 17:03, Tomasz Maciej Nowak wrote:
>>>> From: Tomasz Maciej Nowak 
>>>>
>>>> All contents of staging_dir/image are included in Image Builder (IB) in
>>>> case some binary needs to be included in final image. But in case of
>>>> this package, all sources are stored there and those clutter the final
>>>> tarball of IB for no reason. Those sources are not used during image
>>>> creation and are just dead weight. To put it in perspective, the IB for
>>>> 21.02.0 is 158 MiB, 22.03.0-rc6 is 366 MiB and snapshot is over 620 MiB!
>>>> To fix it, put them in package build directory, so they won't end up
>>>> included in IB tarball. With that, the custom clean definition can be
>>>> removed, as the default one will take over.
>>>>
>>>> Signed-off-by: Tomasz Maciej Nowak 
>>>> Reviewed-by: Andre Heider 
>>>> ---
>>>> v1 -> v2
>>>> - as pointed by Andre, we can use default clean definition
>>>> - add his review tag
>>>
>>> I think the build times are much higher with this change compared to before.
>>
>> Yes, that's correct, since all source is extracted/rebuilt for each variant.
>> The toolchain tarball is huge and it takes lot of time to extract. The second
>> culprit is cryptopp. It's rebuilt for each variant with one job.
>>
>>> I haven't found the time to do real measurements. I used this configuration 
>>> to test:
>>> CONFIG_TARGET_mvebu=y
>>> CONFIG_TARGET_mvebu_cortexa53=y
>>> CONFIG_TARGET_mvebu_cortexa53_DEVICE_globalscale_espressobin=y
>>
>> I did measurements, before change:
>> time make -j4 package/arm-trusted-firmware-mvebu/compile
>> [ ... ]
>> real    13m17,046s
>> user    25m24,272s
>> sys 1m49,963s
>>
>> with the change:
>> time make -j4 package/arm-trusted-firmware-mvebu/compile
>> [ ... ]
>> real    28m26,566s
>> user    79m45,906s
>> sys 4m6,547s
>>
>> As You can see it's more than double. I also did test where $(BUILD_DIR)
>> was used:
>> time make -j4 package/arm-trusted-firmware-mvebu/compile
>> [ ... ]
>> real    13m19,462s
>> user    25m21,511s
>> sys 1m53,047s
>>
>> which looks same as in current state (ignore spinning rust hiccups). Should
>> I use $(BUILD_DIR) for the sources?
> 
> did you mean a common folder in $(BUILD_DIR) with your $(BUILD_DIR) approach?

Simply $(BUILD_DIR), which in our example translates to
"build_dir/target-aarch64_cortex-a53_musl" without any subdir. Naturally each
source is untarred to own subdir.

> I think it would be better to place the bootloader toolchain in some common 
> place and not duplicated for each variant.

That's with current state using STAGING_DIR_IMAGE or with using BUILD_DIR,
so I'll use BUILD_DIR instead of PKG_BUILD_DIR.

> Is cryptopp also common for all variant and only used on the host?

Yes to both.

> Maybe we can make this all a host package?

That would make sense if we would untangle the whole TF-A build for mvebu,
which at current form, needs work, as we already discussed that [1]. Having
a second look at the build flow of it, I saw it's even more entangled than 
what I described in that topic. Anyway, lets keep it in current state, until
me/someone finds time to fix it.

1. http://lists.openwrt.org/pipermail/openwrt-devel/2020-October/031677.html

> Hauke

Regards, Tomek

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


  1   2   3   4   5   6   >