Skip to content

Commit

Permalink
Merge pull request #48 from openwrtdiy/openwrt-23.05
Browse files Browse the repository at this point in the history
Openwrt 23.05
  • Loading branch information
openwrtdiy authored Aug 14, 2023
2 parents 3e8c061 + b59d02b commit 49f655a
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- a/tools/fiptool/fiptool.c
+++ b/tools/fiptool/fiptool.c
@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-
+#define _DARWIN_C_SOURCE
#ifndef _MSC_VER
#include <sys/mount.h>
#endif
@@ -18,6 +18,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
+#define uuid_t fiptool_uuid_t

#include "fiptool.h"
#include "tbbr_config.h"
8 changes: 4 additions & 4 deletions package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@
+boot_tftp_recovery=run boot_update_conf ; tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run sdmmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
+mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
+mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
+part_default=production
+part_recovery=recovery
+reset_factory=eraseenv && reset
Expand Down Expand Up @@ -931,8 +931,8 @@
+boot_write_fip=mtd erase fip && mtd write fip $loadaddr
+boot_write_preloader=mtd erase bl2 && mtd write bl2 $loadaddr
+reset_factory=mtd erase u-boot-env
+nor_read_production=mtd read fit $loadaddr 0x0 0x1000 && imsz $loadaddr image_size && mtd read fit $loadaddr 0x0 $image_size
+nor_read_recovery=mtd read recovery $loadaddr 0x0 0x1000 && imsz $loadaddr image_size && mtd read recovery $loadaddr 0x0 $image_size
+nor_read_production=mtd read fit $loadaddr 0x0 0x20000 && imsz $loadaddr image_size && mtd read fit $loadaddr 0x0 $image_size
+nor_read_recovery=mtd read recovery $loadaddr 0x0 0x20000 && imsz $loadaddr image_size && mtd read recovery $loadaddr 0x0 $image_size
+nor_pad_size=imsz $loadaddr image_size ; setexpr image_eb 0x$image_size / 0x10000 ; setexpr tmp1 0x$image_size % 0x10000 ; test 0x$tmp1 -gt 0 && setexpr image_eb 0x$image_eb + 1 ; setexpr image_eb $image_eb * 0x10000
+nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x3000000 && mtd erase fit && mtd write fit $loadaddr 0x0 $image_eb
+nor_write_recovery=run nor_pad_size ; test 0x$image_eb -le 0x900000 && mtd erase recovery 0x0 0x$image_eb && mtd write recovery $loadaddr 0x0 $image_eb
Expand Down Expand Up @@ -1067,7 +1067,7 @@
+boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_update_conf=if nand info ; then setenv bootconf $bootconf_base#$bootconf_emmc#$bootconf_nand ; else setenv bootconf $bootconf_base#$bootconf_emmc#$bootconf_nor ; fi
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
+mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
+mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
+part_default=production
+part_recovery=recovery
+reset_factory=eraseenv && reset
Expand Down
11 changes: 0 additions & 11 deletions target/linux/armsr/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,6 @@ endef

$(eval $(call KernelPackage,marvell-mdio))

define KernelPackage/phy-marvell-10g
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Marvell Alaska 10G PHY driver
DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy
KCONFIG:=CONFIG_MARVELL_10G_PHY
FILES=$(LINUX_DIR)/drivers/net/phy/marvell10g.ko
AUTOLOAD=$(call AutoLoad,35,marvell10g)
endef

$(eval $(call KernelPackage,phy-marvell-10g))

define KernelPackage/mvneta
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Marvell Armada 370/38x/XP/37xx network driver
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From f5a05060670a4d8d6523afc7963eb559c2e3615f Mon Sep 17 00:00:00 2001
From: Olivier Maignial <[email protected]>
Date: Fri, 23 Jun 2023 17:33:37 +0200
Subject: [PATCH] mtd: spinand: winbond: Fix ecc_get_status

Reading ECC status is failing.

w25n02kv_ecc_get_status() is using on-stack buffer for
SPINAND_GET_FEATURE_OP() output. It is not suitable for
DMA needs of spi-mem.

Fix this by using the spi-mem operations dedicated buffer
spinand->scratchbuf.

See
spinand->scratchbuf:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/mtd/spinand.h?h=v6.3#n418
spi_mem_check_op():
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-mem.c?h=v6.3#n199

Fixes: 6154c7a58348 ("mtd: spinand: winbond: add Winbond W25N02KV flash support")
Cc: [email protected]
Signed-off-by: Olivier Maignial <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/DB4P250MB1032EDB9E36B764A33769039FE23A@DB4P250MB1032.EURP250.PROD.OUTLOOK.COM
---
drivers/mtd/nand/spi/winbond.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -108,7 +108,7 @@ static int w25n02kv_ecc_get_status(struc
{
struct nand_device *nand = spinand_to_nand(spinand);
u8 mbf = 0;
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, &mbf);
+ struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, spinand->scratchbuf);

switch (status & STATUS_ECC_MASK) {
case STATUS_ECC_NO_BITFLIPS:
@@ -126,7 +126,7 @@ static int w25n02kv_ecc_get_status(struc
if (spi_mem_exec_op(spinand->spimem, &op))
return nanddev_get_ecc_conf(nand)->strength;

- mbf >>= 4;
+ mbf = *(spinand->scratchbuf) >> 4;

if (WARN_ON(mbf > nanddev_get_ecc_conf(nand)->strength || !mbf))
return nanddev_get_ecc_conf(nand)->strength;
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ static const struct mtk_gate_regs infra3_cg_regs = {
#define GATE_INFRA3(_id, _name, _parent, _shift) \
GATE_INFRA3_FLAGS(_id, _name, _parent, _shift, 0)

#define GATE_CRITICAL(_id, _name, _parent, _regs, _shift) { \
.id = _id, .name = _name, .parent_name = _parent, \
.regs = _regs, .shift = _shift, \
.flags = CLK_IS_CRITICAL, \
.ops = &mtk_clk_gate_ops_setclr, \
}

static const struct mtk_gate infra_clks[] = {
/* INFRA0 */
GATE_INFRA0(CLK_INFRA_PCIE_PERI_26M_CK_P0,
Expand Down Expand Up @@ -271,7 +278,7 @@ static const struct mtk_gate infra_clks[] = {
"sysaxi_sel", 17),
GATE_INFRA2(CLK_INFRA_66M_FLASHIF_AXI, "infra_hf_66m_flashif_axi",
"sysaxi_sel", 18),
GATE_INFRA2(CLK_INFRA_RTC, "infra_f_frtc", "top_rtc_32k", 19),
GATE_CRITICAL(CLK_INFRA_RTC, "infra_f_frtc", "top_rtc_32k", &infra2_cg_regs, 19),
GATE_INFRA2(CLK_INFRA_26M_ADC_BCK, "infra_f_26m_adc_bck",
"csw_infra_f26m_sel", 20),
GATE_INFRA2(CLK_INFRA_RC_ADC, "infra_f_frc_adc", "infra_f_26m_adc_bck",
Expand Down

0 comments on commit 49f655a

Please sign in to comment.