From 8ed934f3719fe679f5cf78ee7c82f236d40ad463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Veronese?= Date: Mon, 2 Oct 2023 22:17:09 +0200 Subject: [PATCH 1/2] uboot-mediatek: fix global pll clock override on mtk_spim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With patch 101-03-spi-mtk_spim-get-spi-clk-rate-only-once.patch a new system to calculate the SPI clocks has been added. Unfortunately, the do_div macro overrides the global priv->pll_clk_rate field. This will cause to have a reduced clock rate on each subsequent SPI call. Signed-off-by: Valerio 'ftp21' Mancini Signed-off-by: Nicolò Veronese (cherry picked from commit 8849ccb9957e69d85c93ad4b58400573a181ad18) --- ...im-prevent-global-pll-clock-override.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch diff --git a/package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch b/package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch new file mode 100644 index 00000000000000..c4e0fff921f453 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch @@ -0,0 +1,47 @@ +From 41f225dae30ea6ddcff10f120a9e732f994d3a07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nicol=C3=B2=20Veronese?= +Date: Tue, 3 Oct 2023 23:46:52 +0200 +Subject: [PATCH] spi: mtk_spim: prevent global pll clock override +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With commit 793e6230118032a099ec42a1ea67f434721edcc0 + a new system to calculate the SPI clocks has been added. + +Unfortunately, the do_div macro overrides the global + priv->pll_clk_rate field. This will cause to have a reduced + clock rate on each subsequent SPI call. + +Signed-off-by: Valerio 'ftp21' Mancini +Signed-off-by: Nicolò Veronese +--- + drivers/spi/mtk_spim.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/spi/mtk_spim.c ++++ b/drivers/spi/mtk_spim.c +@@ -409,7 +409,7 @@ static int mtk_spim_transfer_wait(struct + { + struct udevice *bus = dev_get_parent(slave->dev); + struct mtk_spim_priv *priv = dev_get_priv(bus); +- u32 sck_l, sck_h, clk_count, reg; ++ u32 pll_clk, sck_l, sck_h, clk_count, reg; + ulong us = 1; + int ret = 0; + +@@ -418,11 +418,12 @@ static int mtk_spim_transfer_wait(struct + else + clk_count = op->data.nbytes; + ++ pll_clk = priv->pll_clk_rate; + sck_l = readl(priv->base + SPI_CFG2_REG) >> SPI_CFG2_SCK_LOW_OFFSET; + sck_h = readl(priv->base + SPI_CFG2_REG) & SPI_CFG2_SCK_HIGH_MASK; +- do_div(priv->pll_clk_rate, sck_l + sck_h + 2); ++ do_div(pll_clk, sck_l + sck_h + 2); + +- us = CLK_TO_US(priv->pll_clk_rate, clk_count * 8); ++ us = CLK_TO_US(pll_clk, clk_count * 8); + us += 1000 * 1000; /* 1s tolerance */ + + if (us > UINT_MAX) From 610ae4d344bd283e5e77cbfda7bb28ccb9e99263 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Tue, 24 Oct 2023 17:21:27 +0100 Subject: [PATCH 2/2] odhcpd: Bump to latest commits d8118f6 config: make sure timer is not on the timeouts list before freeing 4bbc6e7 add hostsfile output in addition to statefile Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 0221b860321ca2dd2bdc6339c01aa9adb3ddb34e) --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 0eadcc9a5d5b20..ba6358f7795a86 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_MIRROR_HASH:=e2e00e2bb6b7bacda5dcb713e4f9a4b1e316d75b140a4aa77145471bf6fe5c17 -PKG_SOURCE_DATE:=2023-06-24 -PKG_SOURCE_VERSION:=52112643308bb02a3b4fa2894dd7d4340ba4a237 +PKG_MIRROR_HASH:=9936331b64880260cf969cc5656e1e1a8b7dc0e0843d64621242c500a330b4d6 +PKG_SOURCE_DATE:=2023-10-24 +PKG_SOURCE_VERSION:=d8118f6e76e5519881f9a37137c3a06b3cb60fd2 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0