Skip to content

Commit 12c1a20

Browse files
Merge branch 'openwrt:main' into wax206
2 parents 03d5683 + cc57e15 commit 12c1a20

172 files changed

Lines changed: 39059 additions & 831 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
- "target/linux/mediatek/**"
127127
- "package/boot/arm-trusted-firmware-mediatek/**"
128128
- "package/boot/uboot-mediatek/**"
129+
"target/microchipsw":
130+
- changed-files:
131+
- any-glob-to-any-file:
132+
- "target/linux/microchipsw/**"
133+
- "package/boot/arm-trusted-firmware-microchipsw/**"
134+
- "package/boot/uboot-microchipsw/**"
129135
"target/mpc85xx":
130136
- changed-files:
131137
- any-glob-to-any-file:

config/Config-images.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ menu "Target Images"
1818
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
1919
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
2020
default TARGET_INITRAMFS_COMPRESSION_ZSTD if TARGET_qualcommax
21+
default TARGET_INITRAMFS_COMPRESSION_ZSTD if TARGET_microchipsw
2122
default TARGET_INITRAMFS_COMPRESSION_XZ if USES_SEPARATE_INITRAMFS
2223
default TARGET_INITRAMFS_COMPRESSION_NONE
2324
depends on TARGET_ROOTFS_INITRAMFS
@@ -335,7 +336,7 @@ menu "Target Images"
335336
int "Root filesystem partition size (in MiB)"
336337
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS
337338
default 232 if TARGET_loongarch64
338-
default 448 if TARGET_mediatek
339+
default 448 if TARGET_mediatek || TARGET_microchipsw
339340
default 104
340341
help
341342
Select the root filesystem partition size.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_NAME:=arm-trusted-firmware-microchipsw
4+
PKG_RELEASE:=1
5+
6+
PKG_SOURCE_PROTO:=git
7+
PKG_SOURCE_URL=https://github.com/microchip-ung/arm-trusted-firmware.git
8+
PKG_SOURCE_DATE:=2024-08-13
9+
PKG_SOURCE_VERSION:=67fcfcab71f78ac7d4af834c37b29f8c98dd5ff1
10+
PKG_MIRROR_HASH:=777c68273e84028de77750f3fe8a1219b02f01d43ce35948893ac642d8eb10d7
11+
12+
PKG_MAINTAINER:=Robert Marko <robert.marko@sartura.hr>
13+
14+
include $(INCLUDE_DIR)/kernel.mk
15+
include $(INCLUDE_DIR)/trusted-firmware-a.mk
16+
include $(INCLUDE_DIR)/package.mk
17+
18+
define Trusted-Firmware-A/Default
19+
BUILD_TARGET:=microchipsw
20+
TFA_IMAGE:=fip.bin fwu_fip.bin fwu.html
21+
endef
22+
23+
define Trusted-Firmware-A/ev23x71a
24+
NAME:=Microchip EV23X71A
25+
BUILD_SUBTARGET:=lan969x
26+
BUILD_DEVICES:=microchip_ev23x71a
27+
PLAT:=lan969x_a0
28+
DEPENDS:=+u-boot-ev23x71a
29+
endef
30+
31+
TFA_TARGETS:= ev23x71a
32+
33+
MBEDTLS_NAME:=mbedtls
34+
MBEDTLS_RELEASE:=2.28.10
35+
MBEDTLS_SOURCE:=$(MBEDTLS_NAME)-$(MBEDTLS_RELEASE).tar.zst
36+
37+
define Download/mbedtls
38+
FILE:=$(MBEDTLS_SOURCE)
39+
PROTO:=git
40+
URL:=https://github.com/Mbed-TLS/mbedtls.git
41+
SOURCE_VERSION:=2fc8413bfcb51354c8e679141b17b3f1a5942561
42+
MIRROR_HASH:=40b94a76572ad1ca89738929ab81d6024f678f22691eb3bd633c076ac18a334a
43+
SUBDIR:=$(MBEDTLS_NAME)
44+
endef
45+
46+
define Build/Prepare
47+
# Download mbedtls
48+
$(eval $(call Download,mbedtls))
49+
50+
$(call Build/Prepare/Default,)
51+
52+
$(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(MBEDTLS_SOURCE)
53+
endef
54+
55+
# We must not pass OPENSSL_DIR as locally built mbedtls is used
56+
define Build/Compile
57+
+unset CC; \
58+
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
59+
CROSS_COMPILE=$(TARGET_CROSS) \
60+
$(if $(DTC),DTC="$(DTC)") \
61+
PLAT=$(PLAT) \
62+
BUILD_STRING="OpenWrt $(PKG_VERSION_PREFIX)$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
63+
$(TFA_MAKE_FLAGS)
64+
endef
65+
66+
TFA_MAKE_FLAGS += \
67+
MBEDTLS_DIR=$(PKG_BUILD_DIR)/$(MBEDTLS_NAME) \
68+
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \
69+
KEY_ALG=ecdsa GENERATE_COT=1 TRUSTED_BOARD_BOOT=1 \
70+
all fip fwu_fip
71+
72+
define Package/trusted-firmware-a/install
73+
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
74+
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin
75+
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/build/$(PLAT)/release/%,$(TFA_IMAGE)) $(1)/
76+
endef
77+
78+
$(eval $(call BuildPackage/Trusted-Firmware-A))
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_RELEASE:=1
4+
5+
PKG_SOURCE_PROTO:=git
6+
PKG_SOURCE_URL:=https://github.com/microchip-ung/u-boot.git
7+
PKG_SOURCE_DATE:=2025-09-22
8+
PKG_SOURCE_VERSION:=c1abab62a00a6b8f43f663a0a30dd0a7fd6a4e95
9+
PKG_MIRROR_HASH:=6405c426afd8bacbb4cc985da4ca1bd04b54a0d2aa3bb3ba8f7571dbe5913055
10+
11+
PKG_MAINTAINER:=Robert Marko <robert.marko@sartura.hr>
12+
13+
include $(INCLUDE_DIR)/u-boot.mk
14+
include $(INCLUDE_DIR)/package.mk
15+
include $(INCLUDE_DIR)/kernel.mk
16+
17+
define U-Boot/Default
18+
BUILD_TARGET:=microchipsw
19+
HIDDEN:=1
20+
UBOOT_IMAGE:=u-boot.bin
21+
endef
22+
23+
define U-Boot/ev23x71a
24+
NAME:=Microchip EV23X71A
25+
BUILD_DEVICES:=microchip_ev23x71a
26+
BUILD_SUBTARGET:=lan969x
27+
UBOOT_CONFIG:=mchp_lan969x
28+
endef
29+
30+
UBOOT_TARGETS:= ev23x71a
31+
32+
define Build/InstallDev
33+
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
34+
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)
35+
endef
36+
37+
$(eval $(call BuildPackage/U-Boot))
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
--- a/cmd/bootm.c
2+
+++ b/cmd/bootm.c
3+
@@ -260,6 +260,76 @@ U_BOOT_CMD(
4+
/* iminfo - print header info for a requested image */
5+
/*******************************************************************/
6+
#if defined(CONFIG_CMD_IMI)
7+
+#define SECTOR_SHIFT 9
8+
+static int image_totalsize(struct cmd_tbl *cmdtp, int flag, int argc,
9+
+ char *const argv[], short int in_blocks)
10+
+{
11+
+ ulong addr;
12+
+ void *hdr;
13+
+ uint32_t bsize, tsize = 0;
14+
+ char buf[16];
15+
+
16+
+ if (argc >= 2)
17+
+ addr = simple_strtoul(argv[1], NULL, 16);
18+
+ else
19+
+ addr = image_load_addr;
20+
+
21+
+ hdr = (void *)map_sysmem(addr, 0);
22+
+
23+
+ switch (genimg_get_format(hdr)) {
24+
+ case IMAGE_FORMAT_LEGACY:
25+
+ if(CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT))
26+
+ tsize = image_get_image_size(hdr);
27+
+ break;
28+
+ case IMAGE_FORMAT_FIT:
29+
+ if(CONFIG_IS_ENABLED(FIT))
30+
+ tsize = fit_get_totalsize(hdr);
31+
+ break;
32+
+ }
33+
+
34+
+ unmap_sysmem(hdr);
35+
+ if (tsize == 0)
36+
+ return 1;
37+
+
38+
+ bsize = (tsize >> SECTOR_SHIFT) + ((tsize & ((1 << SECTOR_SHIFT) - 1))?1:0);
39+
+
40+
+ if (!in_blocks)
41+
+ snprintf(buf, sizeof(buf), "%x", tsize);
42+
+ else
43+
+ snprintf(buf, sizeof(buf), "%x", bsize);
44+
+
45+
+ if (argc >= 3)
46+
+ return env_set(argv[2], buf);
47+
+ else
48+
+ printf("%s\n", buf);
49+
+
50+
+ return 0;
51+
+}
52+
+
53+
+static int do_imsz(struct cmd_tbl *cmdtp, int flag, int argc,
54+
+ char *const argv[])
55+
+{
56+
+ return image_totalsize(cmdtp, flag, argc, argv, 0);
57+
+}
58+
+
59+
+static int do_imszb(struct cmd_tbl *cmdtp, int flag, int argc,
60+
+ char *const argv[])
61+
+{
62+
+ return image_totalsize(cmdtp, flag, argc, argv, 1);
63+
+}
64+
+
65+
+U_BOOT_CMD(
66+
+ imsz, CONFIG_SYS_MAXARGS, 1, do_imsz,
67+
+ "get image total size (in bytes)",
68+
+ "addr [maxhdrlen] [varname]\n"
69+
+);
70+
+
71+
+U_BOOT_CMD(
72+
+ imszb, CONFIG_SYS_MAXARGS, 1, do_imszb,
73+
+ "get image total size (in blocks)",
74+
+ "addr [maxhdrlen] [varname]\n"
75+
+);
76+
+
77+
static int do_iminfo(struct cmd_tbl *cmdtp, int flag, int argc,
78+
char *const argv[])
79+
{
80+
--- a/boot/image-fit.c
81+
+++ b/boot/image-fit.c
82+
@@ -2054,6 +2054,47 @@ static const char *fit_get_image_type_pr
83+
return "unknown";
84+
}
85+
86+
+size_t fit_get_totalsize(const void *fit)
87+
+{
88+
+ int ret, ndepth, noffset, images_noffset;
89+
+ size_t data_size, hdrsize, img_total, max_size = 0;
90+
+ const void *data;
91+
+
92+
+ ret = fdt_check_header(fit);
93+
+ if (ret) {
94+
+ debug("Wrong FIT format: not a flattened device tree (err=%d)\n",
95+
+ ret);
96+
+ return 0;
97+
+ }
98+
+
99+
+ hdrsize = fdt_totalsize(fit);
100+
+
101+
+ /* take care of simple FIT with internal images */
102+
+ max_size = hdrsize;
103+
+
104+
+ images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
105+
+ if (images_noffset < 0)
106+
+ goto out;
107+
+
108+
+ for (ndepth = 0,
109+
+ noffset = fdt_next_node(fit, images_noffset, &ndepth);
110+
+ (noffset >= 0) && (ndepth > 0);
111+
+ noffset = fdt_next_node(fit, noffset, &ndepth)) {
112+
+ if (ndepth == 1) {
113+
+ ret = fit_image_get_data(fit, noffset, &data, &data_size);
114+
+ if (ret)
115+
+ goto out;
116+
+
117+
+ img_total = data_size + (data - fit);
118+
+
119+
+ max_size = (max_size > img_total) ? max_size : img_total;
120+
+ }
121+
+ }
122+
+
123+
+out:
124+
+ return max_size;
125+
+}
126+
+
127+
int fit_image_load(struct bootm_headers *images, ulong addr,
128+
const char **fit_unamep, const char **fit_uname_configp,
129+
int arch, int ph_type, int bootstage_id,
130+
--- a/include/image.h
131+
+++ b/include/image.h
132+
@@ -1113,6 +1113,7 @@ int fit_parse_subimage(const char *spec,
133+
ulong *addr, const char **image_name);
134+
135+
int fit_get_subimage_count(const void *fit, int images_noffset);
136+
+size_t fit_get_totalsize(const void *fit);
137+
void fit_print_contents(const void *fit);
138+
void fit_image_print(const void *fit, int noffset, const char *p);
139+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
fdt_high=0xffffffff
4+
baudrate=115200
5+
bootdelay=3
6+
loadaddr=0x64000000
7+
bootargs=console=ttyAT0,115200 root=PARTLABEL=rootfs rootwait
8+
mmc_read_kernel=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr $part_addr $image_size
9+
boot_system=part start mmc 0 kernel part_addr && part size mmc 0 kernel part_size && run mmc_read_kernel && bootm
10+
bootcmd=run boot_system

package/kernel/econet-eth/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_NAME:=econet-eth
4+
PKG_RELEASE:=1
5+
6+
PKG_SOURCE_PROTO:=git
7+
PKG_SOURCE_URL:=https://github.com/cjdelisle/econet_eth.git
8+
PKG_MIRROR_HASH:=764e18fe2f87cb0c742711c18ed995a2270b02f0072e7a0938906d0246287111
9+
PKG_SOURCE_DATE:=2025-11-07
10+
PKG_SOURCE_VERSION:=40aac736a46fec0d96beadd7513c53d1f0459737
11+
12+
include $(INCLUDE_DIR)/kernel.mk
13+
include $(INCLUDE_DIR)/package.mk
14+
15+
define KernelPackage/econet-eth
16+
SUBMENU:=Network Devices
17+
TITLE:=EcoNet EN751221 Ethernet Driver
18+
DEPENDS:=@TARGET_econet
19+
FILES:=$(PKG_BUILD_DIR)/econet-eth.ko
20+
AUTOLOAD:=$(call AutoLoad,90,econet-eth)
21+
endef
22+
23+
define KernelPackage/econet-eth/description
24+
Out-of-tree ethernet driver for EcoNet EN751221 devices.
25+
endef
26+
27+
define Build/Prepare
28+
$(call Build/Prepare/Default)
29+
endef
30+
31+
define Build/Compile
32+
$(KERNEL_MAKE) M=$(PKG_BUILD_DIR) modules
33+
endef
34+
35+
$(eval $(call KernelPackage,econet-eth))

package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static inline void clear_share_buffer(void)
220220
* int --- 0: Success
221221
* else: Error Code
222222
*/
223-
static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
223+
static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
224224
{
225225
volatile u32 *dest;
226226

package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static inline void clear_share_buffer(void)
159159
IFX_REG_W32(0, p++);
160160
}
161161

162-
static inline int pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
162+
static inline int pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
163163
{
164164
volatile u32 *dest;
165165

package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static inline void reset_ppe(struct platform_device *pdev)
106106
* int --- 0: Success
107107
* else: Error Code
108108
*/
109-
static inline int danube_pp32_download_code(u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
109+
static inline int danube_pp32_download_code(const u32 *code_src, unsigned int code_dword_len, const u32 *data_src, unsigned int data_dword_len)
110110
{
111111
volatile u32 *dest;
112112

0 commit comments

Comments
 (0)