[PATCH 1/2] clk: Check that composite clock's div has set_rate()

2023-12-05 Thread Igor Prusov
ox it will cause NULL dereference during clk_set_rate(). This patch adds rate_ops->set_rate check tp clk_composite_set_rate(). Signed-off-by: Igor Prusov --- drivers/clk/clk-composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-composite.c b/drivers

[PATCH 2/2] dm: test: clk: Add test for ccf clk_set_rate()

2023-12-05 Thread Igor Prusov
Add a simple test case which sets clock rate to its current value. Signed-off-by: Igor Prusov --- test/dm/clk_ccf.c | 9 + 1 file changed, 9 insertions(+) diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index e4ebb93cda..3b23982541 100644 --- a/test/dm/clk_ccf.c +++ b/test/dm

[PATCH 0/2] Fix NULL dereference in clk_composite_set_rate()

2023-12-05 Thread Igor Prusov
On sandbox it's possible to trigger NULL dereference when setting rate of a composite clock. It happens because sandbox composite divider does not implement set_rate() operation. This series adds NULL check and a test cases for clk_set_rate(). Igor Prusov (2): clk: Check that composite cl

[PATCH 00/13] Import "string" I/O functions from Linux

2023-11-14 Thread Igor Prusov
This series imports generic versions of ioread_rep/iowrite_rep and reads/writes from Linux. Some cleanup is done to make sure that all platforms have proper defines for implemented functions and there are no redefinitions. Igor Prusov (13): sandbox: move asm-generic include to the end of file

[PATCH 13/13] musb-new: Remove implementation of io.h functions

2023-11-14 Thread Igor Prusov
Since {read,write}s{l, w, b}() functions are now supported in linux/io.h there is no need to add custom implementation to driver. Signed-off-by: Igor Prusov --- drivers/usb/musb-new/musb_io.h | 24 1 file changed, 24 deletions(-) diff --git a/drivers/usb/musb-new

[PATCH 12/13] treewide: Include linux/io.h instead of asm-generic/io.h

2023-11-14 Thread Igor Prusov
Directly including asm-generic/io.h may break build because it will cause redefenition of generic io macros if linux/io.h gets included later, hence replace it with direct include of linux/io.h Signed-off-by: Igor Prusov --- drivers/spi/cadence_qspi.c | 2 +- drivers/usb/cdns3/cdns3

[PATCH 11/13] spi: meson_spifc_a1: Switch to io{read,write}32_rep()

2023-11-14 Thread Igor Prusov
Use io{read,write}32_rep() functions to sync code with Linux version. Signed-off-by: Igor Prusov --- drivers/spi/meson_spifc_a1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/meson_spifc_a1.c b/drivers/spi/meson_spifc_a1.c index 099c4c037d..a33b1a3879

[PATCH 10/13] asm-generic: Import functions from Linux

2023-11-14 Thread Igor Prusov
locally in some files, remove them to avoid redeclaration errors. Signed-off-by: Igor Prusov --- drivers/mtd/nand/raw/atmel/nand-controller.c | 34 -- drivers/mtd/nand/raw/nand_base.c | 33 -- include/asm-generic/io.h | 348 +++ 3 files changed, 348

[PATCH 09/13] xtensa: io.h: Add defines for ins/outs functions

2023-11-14 Thread Igor Prusov
Add defines for {in,out}s{b,w,l}() functions to make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov --- arch/xtensa/include/asm/io.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h index 76a646e882..87ad9faa29

[PATCH 08/13] powerpc: io.h: Add defines for __raw_{read, write} functions

2023-11-14 Thread Igor Prusov
Add defines for __raw_{read,write}{b,w,l}() functions to make make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov --- arch/powerpc/include/asm/io.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index

[PATCH 07/13] nios2: io.h: Add defines for ins/outs functions

2023-11-14 Thread Igor Prusov
Add defines for {in,out}s{b,w,l} functions to make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov --- arch/nios2/include/asm/io.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index 817cd72e00..321e4fd1ca 100644

[PATCH 06/13] riscv: io.h: Fix signatures of reads/writes functions

2023-11-14 Thread Igor Prusov
Change type of address parameter from int* to volatile void* for {read,write}s{b,w,l}() functions and add const qualifier for reads. This is done to keep function signatures in sync with asm-generic/io.h and other platforms. Signed-off-by: Igor Prusov --- arch/riscv/include/asm/io.h | 18

[PATCH 05/13] riscv: io.h: Add defines for reads/writes functions

2023-11-14 Thread Igor Prusov
Add defines for {read,write}s{b,w,l} functions to make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov --- arch/riscv/include/asm/io.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h index 4170877a1a..cedd5375d6

[PATCH 04/13] mips: io.h: Add defines for read/write/in/out functions

2023-11-14 Thread Igor Prusov
Add defines for {read,write}{b,w,l,q}(), {read,write}s{b,w,l,q}() and {in,out}s{b,w,l,q}() functions to make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov --- arch/mips/include/asm/io.h | 32 1 file changed, 32 insertions(+) diff --git a/arch/mips

[PATCH 03/13] mips: io.h: Add const to reads functions params

2023-11-14 Thread Igor Prusov
Currently reads{b,w,l}() functions don't have const qualifier for their address parameter. Since asm-generic/io.h in Linux has const for all read functions, add it here as well to keep signatures in sync. Signed-off-by: Igor Prusov --- arch/mips/include/asm/io.h | 3 ++- 1 file chang

[PATCH 02/13] x86: Add defines for ins/outs functions

2023-11-14 Thread Igor Prusov
Add defines for {in,out}s{b,w,l}() functions to make sure that they will be used by asm-generic/io.h Signed-off-by: Igor Prusov --- arch/x86/include/asm/io.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 83dc09757e

[PATCH 01/13] sandbox: move asm-generic include to the end of file

2023-11-14 Thread Igor Prusov
Generic version of io.h should be included at the end of architecture-specific ones to make sure that arch implementations are used and to avoid redefinitions. Signed-off-by: Igor Prusov --- arch/sandbox/include/asm/io.h | 28 ++-- 1 file changed, 14 insertions(+), 14

Re: [PATCH] clk: meson: add Hardware Clock measure driver

2023-11-13 Thread Igor Prusov
ng_osc_out_15"), > + CLK_MSR_ID(105, "arm_ring_osc_out_16"), > + CLK_MSR_ID(106, "ephy_test"), > + CLK_MSR_ID(107, "au_dac_g128x"), > + CLK_MSR_ID(108, "audio_locker_out"), > + CLK_MSR_ID(109, "audio_locker_in"), > + CLK_MSR_ID(110, "audio_tdmout_c_sclk"), > + CLK_MSR_ID(111, "audio_tdmout_b_sclk"), > + CLK_MSR_ID(112, "audio_tdmout_a_sclk"), > + CLK_MSR_ID(113, "audio_tdmin_lb_sclk"), > + CLK_MSR_ID(114, "audio_tdmin_c_sclk"), > + CLK_MSR_ID(115, "audio_tdmin_b_sclk"), > + CLK_MSR_ID(116, "audio_tdmin_a_sclk"), > + CLK_MSR_ID(117, "audio_resample"), > + CLK_MSR_ID(118, "audio_pdm_sys"), > + CLK_MSR_ID(119, "audio_spdifout_b"), > + CLK_MSR_ID(120, "audio_spdifout"), > + CLK_MSR_ID(121, "audio_spdifin"), > + CLK_MSR_ID(122, "audio_pdm_dclk"), > + CLK_MSR_ID(123, "audio_resampled"), > + CLK_MSR_ID(124, "earcrx_pll"), > + CLK_MSR_ID(125, "earcrx_pll_test"), > + CLK_MSR_ID(126, "csi_phy0"), > + CLK_MSR_ID(127, "csi2_data"), > +}; > + > +static int meson_clk_msr_measure_id(struct meson_msr *priv, unsigned int id, > + unsigned int duration) > +{ > + unsigned int val; > + int ret; > + > + regmap_write(priv->regmap, MSR_CLK_REG0, 0); > + > + /* Set measurement duration */ > + regmap_update_bits(priv->regmap, MSR_CLK_REG0, MSR_DURATION, > +FIELD_PREP(MSR_DURATION, duration - 1)); > + > + /* Set ID */ > + regmap_update_bits(priv->regmap, MSR_CLK_REG0, MSR_CLK_SRC, > +FIELD_PREP(MSR_CLK_SRC, id)); > + > + /* Enable & Start */ > + regmap_update_bits(priv->regmap, MSR_CLK_REG0, > +MSR_RUN | MSR_ENABLE, > +MSR_RUN | MSR_ENABLE); > + > + ret = regmap_read_poll_timeout(priv->regmap, MSR_CLK_REG0, > +val, !(val & MSR_BUSY), 10, 1); > + if (ret) > + return ret; > + > + /* Disable */ > + regmap_update_bits(priv->regmap, MSR_CLK_REG0, MSR_ENABLE, 0); > + > + /* Get the value in multiple of gate time counts */ > + regmap_read(priv->regmap, MSR_CLK_REG2, &val); > + > + if (val >= MSR_VAL_MASK) > + return -EINVAL; > + > + return DIV_ROUND_CLOSEST_ULL((val & MSR_VAL_MASK) * 100ULL, > + duration); > +} > + > +static int meson_clk_msr_best_id(struct meson_msr *priv, unsigned int id, > + unsigned int *precision) > +{ > + unsigned int duration = DIV_MAX; > + int ret; > + > + /* Start from max duration and down to min duration */ > + do { > + ret = meson_clk_msr_measure_id(priv, id, duration); > + if (ret >= 0) > + *precision = (2 * 100) / duration; > + else > + duration -= DIV_STEP; > + } while (duration >= DIV_MIN && ret == -EINVAL); > + > + return ret; > +} > + > +static void meson_clk_msr_dump(struct udevice *dev) > +{ > + struct meson_msr *priv = dev_get_priv(dev); > + unsigned int precision = 0; > + int val, i; > + > + printf(" clock rateprecision\n"); > + printf("-\n"); > + > + for (i = 0 ; i < CLK_MSR_MAX ; ++i) { > + if (!priv->msr_table[i].name) > + continue; > + > + val = meson_clk_msr_best_id(priv, i, &precision); > + if (val < 0) > + return; > + > + printf(" %-20s %10d+/-%dHz\n", > +priv->msr_table[i].name, val, precision); > + } > +} > + > +static int meson_clk_msr_xlate(struct clk *clk, struct ofnode_phandle_args > *args) > +{ > + /* This driver doesn't expose any clocks */ > + return -EINVAL; > +} > + > +static int meson_clk_msr_probe(struct udevice *dev) > +{ > + struct meson_msr *priv = dev_get_priv(dev); > + int ret; > + > + priv->msr_table = (struct meson_msr_id *)dev_get_driver_data(dev); > + > + ret = regmap_init_mem(dev_ofnode(dev), &priv->regmap); > + if (ret) > + return ret; > + > + return 0; > +} > + > +static struct clk_ops meson_clk_msr_ops = { > + .of_xlate = meson_clk_msr_xlate, > + .dump = meson_clk_msr_dump, > +}; > + > +static const struct udevice_id meson_clk_msr_ids[] = { > + { > + .compatible = "amlogic,meson-gx-clk-measure", > + .data = (ulong)clk_msr_gx, > + }, > + { > + .compatible = "amlogic,meson8-clk-measure", > + .data = (ulong)clk_msr_m8, > + }, > + { > + .compatible = "amlogic,meson8b-clk-measure", > + .data = (ulong)clk_msr_m8, > + }, > + { > + .compatible = "amlogic,meson-axg-clk-measure", > + .data = (ulong)clk_msr_axg, > + }, > + { > + .compatible = "amlogic,meson-g12a-clk-measure", > + .data = (ulong)clk_msr_g12a, > + }, > + { > + .compatible = "amlogic,meson-sm1-clk-measure", > + .data = (ulong)clk_msr_sm1, > + }, > + { /* sentinel */ } > +}; > + > +U_BOOT_DRIVER(meson_clk_msr) = { > + .name = "meson_clk_msr", > + .id = UCLASS_CLK, > + .of_match = meson_clk_msr_ids, > + .priv_auto = sizeof(struct meson_msr), > + .ops= &meson_clk_msr_ops, > + .probe = meson_clk_msr_probe, > +}; > > --- > base-commit: 3221d10770b4c288ddb7d83350e1cd86c3b6ef55 > change-id: 20231113-uboot-meson-clk-msr-21cf9101278b > > Best regards, > -- > Neil Armstrong > -- Best Regards, Igor Prusov

[PATCH 3/3] treewide: use linux/time.h for time conversion defines

2023-11-09 Thread Igor Prusov
Now that we have time conversion defines from in time.h there is no need for each driver to define their own version. Signed-off-by: Igor Prusov --- board/friendlyarm/nanopi2/onewire.c | 5 + drivers/clk/at91/clk-main.c | 2 +- drivers/i2c/stm32f7_i2c.c

[PATCH 0/3] Add time conversion defines from Linux.

2023-11-09 Thread Igor Prusov
-driver basis are replaced with time.h include. Igor Prusov (3): linux/time.h: Add Linux time conversion defines spi: meson_spifc_a1: Use define for time interval treewide: use linux/time.h for time conversion defines board/friendlyarm/nanopi2/onewire.c | 5 + drivers/clk

[PATCH 2/3] spi: meson_spifc_a1: Use define for time interval

2023-11-09 Thread Igor Prusov
Use USEC_PER_MSEC define for timeout to sync code with Linux version. Signed-off-by: Igor Prusov --- drivers/spi/meson_spifc_a1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/meson_spifc_a1.c b/drivers/spi/meson_spifc_a1.c index 099c4c037d..418d4d5e10

[PATCH 1/3] linux/time.h: Add Linux time conversion defines

2023-11-09 Thread Igor Prusov
Currently there are no defines for time conversion in time.h, which leads to drivers declaring those locally or not using defines at all, so add them from Linux. Signed-off-by: Igor Prusov --- include/linux/time.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux

[PATCH v7 8/8] cmd: clk: Make soc_clk_dump static

2023-11-09 Thread Igor Prusov
After introducing dump to clk_ops there is no need to override or expose this symbol anymore. Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov --- cmd/clk.c | 4 ++-- include/clk.h | 2 -- 2 files changed, 2 insertions(+), 4

[PATCH v7 7/8] clk: treewide: switch to clock dump from clk_ops

2023-11-09 Thread Igor Prusov
Switch to using new dump operation in clock provider drivers instead of overriding soc_clk_dump. Tested-by: Patrice Chotard Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov --- arch/mips/mach-pic32/cpu.c | 23 drivers/clk/aspeed/clk_ast2600.c | 13

[PATCH v7 6/8] cmd: clk: Use dump function from clk_ops

2023-11-09 Thread Igor Prusov
Add another loop to dump additional info from clock providers that implement dump operation. Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov --- cmd/clk.c | 9 + 1 file changed, 9 insertions(+) diff --git a/cmd/clk.c b

[PATCH v7 5/8] clk: Add dump operation to clk_ops

2023-11-09 Thread Igor Prusov
This adds dump function to struct clk_ops which should replace soc_clk_dump. It allows clock drivers to provide custom dump implementation without overriding generic CCF dump function. Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov

[PATCH v7 4/8] clk: amlogic: Move driver and ops structs

2023-11-09 Thread Igor Prusov
Move driver and ops structs to avoid forward declaration after switching to dump in clk_ops. Reviewed-by: Neil Armstrong Signed-off-by: Igor Prusov --- drivers/clk/meson/a1.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/clk

[PATCH v7 3/8] clk: k210: Move soc_clk_dump function

2023-11-09 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov --- drivers/clk/clk_k210.c | 92 +- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers

[PATCH v7 2/8] clk: ast2600: Move soc_clk_dump function

2023-11-09 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/aspeed/clk_ast2600.c | 70 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/clk/aspeed/clk_ast2600.c b

[PATCH v7 1/8] clk: zynq: Move soc_clk_dump to Zynq clock driver

2023-11-09 Thread Igor Prusov
Move clock dump function in preparation for switching to dump function in clk_ops. Acked-by: Michal Simek Signed-off-by: Igor Prusov --- arch/arm/mach-zynq/clk.c | 57 --- drivers/clk/clk_zynq.c | 58 2 files

[PATCH v7 0/8] clk: Switch from soc_clk_dump to clk_ops function

2023-11-09 Thread Igor Prusov
tion diagnostic v6 -> v7: - fix return type of k210_clk_dump() - fix clk_ops dump() docs since it returns void now Igor Prusov (8): clk: zynq: Move soc_clk_dump to Zynq clock driver clk: ast2600: Move soc_clk_dump function clk: k210: Move soc_clk_dump function clk: amlogic: Move driv

Re: [PATCH v6 7/8] clk: treewide: switch to clock dump from clk_ops

2023-11-09 Thread Igor Prusov
On Wed, Nov 08, 2023 at 12:02:44PM -0500, Sean Anderson wrote: > On 11/5/23 03:38, Igor Prusov wrote: > > Switch to using new dump operation in clock provider drivers instead of > > overriding soc_clk_dump. > > > > Signed-off-by: Igor Prusov > > Tested-by: Patri

[PATCH v6 8/8] cmd: clk: Make soc_clk_dump static

2023-11-05 Thread Igor Prusov
After introducing dump to clk_ops there is no need to override or expose this symbol anymore. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson --- cmd/clk.c | 4 ++-- include/clk.h | 2 -- 2 files changed, 2 insertions(+), 4

[PATCH v6 7/8] clk: treewide: switch to clock dump from clk_ops

2023-11-05 Thread Igor Prusov
Switch to using new dump operation in clock provider drivers instead of overriding soc_clk_dump. Signed-off-by: Igor Prusov Tested-by: Patrice Chotard Reviewed-by: Sean Anderson --- arch/mips/mach-pic32/cpu.c | 23 drivers/clk/aspeed/clk_ast2600.c | 13

[PATCH v6 1/8] clk: zynq: Move soc_clk_dump to Zynq clock driver

2023-11-05 Thread Igor Prusov
Move clock dump function in preparation for switching to dump function in clk_ops. Signed-off-by: Igor Prusov Acked-by: Michal Simek --- arch/arm/mach-zynq/clk.c | 57 --- drivers/clk/clk_zynq.c | 58 2 files

[PATCH v6 3/8] clk: k210: Move soc_clk_dump function

2023-11-05 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov Reviewed-by: Sean Anderson --- drivers/clk/clk_k210.c | 92 +- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers

[PATCH v6 2/8] clk: ast2600: Move soc_clk_dump function

2023-11-05 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/aspeed/clk_ast2600.c | 70 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/clk/aspeed/clk_ast2600.c b

[PATCH v6 4/8] clk: amlogic: Move driver and ops structs

2023-11-05 Thread Igor Prusov
Move driver and ops structs to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov Reviewed-by: Neil Armstrong --- drivers/clk/meson/a1.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/clk

[PATCH v6 5/8] clk: Add dump operation to clk_ops

2023-11-05 Thread Igor Prusov
This adds dump function to struct clk_ops which should replace soc_clk_dump. It allows clock drivers to provide custom dump implementation without overriding generic CCF dump function. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- include/clk-uclass.h

[PATCH v6 6/8] cmd: clk: Use dump function from clk_ops

2023-11-05 Thread Igor Prusov
Add another loop to dump additional info from clock providers that implement dump operation. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- cmd/clk.c | 9 + 1 file changed, 9 insertions(+) diff --git a/cmd/clk.c b/cmd/clk.c index c7c379d7a6

[PATCH v6 0/8] clk: Switch from soc_clk_dump to clk_ops function

2023-11-05 Thread Igor Prusov
tion diagnostic Igor Prusov (8): clk: zynq: Move soc_clk_dump to Zynq clock driver clk: ast2600: Move soc_clk_dump function clk: k210: Move soc_clk_dump function clk: amlogic: Move driver and ops structs clk: Add dump operation to clk_ops cmd: clk: Use dump function from clk_ops clk: t

Re: [PATCH v5 5/8] clk: Add dump operation to clk_ops

2023-11-04 Thread Igor Prusov
On Sat, Nov 04, 2023 at 02:40:34PM -0400, Sean Anderson wrote: > On 11/4/23 14:09, Igor Prusov wrote: > > On Sat, Nov 04, 2023 at 11:24:32AM -0400, Sean Anderson wrote: > > > On 11/2/23 08:20, Igor Prusov wrote: > > > > This adds dump function to struc

Re: [PATCH v5 5/8] clk: Add dump operation to clk_ops

2023-11-04 Thread Igor Prusov
On Sat, Nov 04, 2023 at 11:24:32AM -0400, Sean Anderson wrote: > On 11/2/23 08:20, Igor Prusov wrote: > > This adds dump function to struct clk_ops which should replace > > soc_clk_dump. It allows clock drivers to provide custom dump > > implementation without overriding gene

[PATCH v5 7/8] clk: treewide: switch to clock dump from clk_ops

2023-11-02 Thread Igor Prusov
Switch to using new dump operation in clock provider drivers instead of overriding soc_clk_dump. Signed-off-by: Igor Prusov Tested-by: Patrice Chotard Reviewed-by: Sean Anderson --- arch/mips/mach-pic32/cpu.c | 23 --- drivers/clk/aspeed/clk_ast2600.c | 13

[PATCH v5 8/8] cmd: clk: Make soc_clk_dump static

2023-11-02 Thread Igor Prusov
After introducing dump to clk_ops there is no need to override or expose this symbol anymore. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson --- cmd/clk.c | 4 ++-- include/clk.h | 2 -- 2 files changed, 2 insertions(+), 4

[PATCH v5 6/8] cmd: clk: Use dump function from clk_ops

2023-11-02 Thread Igor Prusov
Add another loop to dump additional info from clock providers that implement dump operation. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- cmd/clk.c | 9 + 1 file changed, 9 insertions(+) diff --git a/cmd/clk.c b/cmd/clk.c index c7c379d7a6

[PATCH v5 5/8] clk: Add dump operation to clk_ops

2023-11-02 Thread Igor Prusov
This adds dump function to struct clk_ops which should replace soc_clk_dump. It allows clock drivers to provide custom dump implementation without overriding generic CCF dump function. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- include/clk-uclass.h

[PATCH v5 1/8] clk: zynq: Move soc_clk_dump to Zynq clock driver

2023-11-02 Thread Igor Prusov
Move clock dump function in preparation for switching to dump function in clk_ops. Signed-off-by: Igor Prusov Acked-by: Michal Simek --- arch/arm/mach-zynq/clk.c | 57 --- drivers/clk/clk_zynq.c | 58 2 files

[PATCH v5 4/8] clk: amlogic: Move driver and ops structs

2023-11-02 Thread Igor Prusov
Move driver and ops structs to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov Reviewed-by: Neil Armstrong --- drivers/clk/meson/a1.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/clk

[PATCH v5 3/8] clk: k210: Move soc_clk_dump function

2023-11-02 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov Reviewed-by: Sean Anderson --- drivers/clk/clk_k210.c | 92 +- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers

[PATCH v5 2/8] clk: ast2600: Move soc_clk_dump function

2023-11-02 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/aspeed/clk_ast2600.c | 70 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/clk/aspeed/clk_ast2600.c b

[PATCH v5 0/8] clk: Switch from soc_clk_dump to clk_ops function

2023-11-02 Thread Igor Prusov
mlogic A1 clock controller driver v4 -> v5: - Add docs for dump() function in clk_ops - Print driver and device names before calling corresponding dump() Igor Prusov (8): clk: zynq: Move soc_clk_dump to Zynq clock driver clk: ast2600: Move soc_clk_dump function clk: k210: Move soc_clk_d

[PATCH v2 2/2] ARM: amlogic: ad401: enable SPIFC

2023-10-24 Thread Igor Prusov
Enable Amlogic A1 SPI FLash Controller support. Signed-off-by: Igor Prusov Reviewed-by: Neil Armstrong --- configs/ad401_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/ad401_defconfig b/configs/ad401_defconfig index b9aca3ab0d..b44b9c63e8 100644 --- a/configs

[PATCH v2 1/2] spi: add support for Amlogic A1 SPI Flash Controller

2023-10-24 Thread Igor Prusov
From: Igor Prusov Add A1 SPIFC driver from Linux. Slightly modified to use u-boot driver framework and accommodate to lack of ioread32_rep/iowrite32_rep. Based on Linux version 6.6-rc4 Signed-off-by: Igor Prusov Signed-off-by: Martin Kurbanov Reviewed-by: Simon Glass --- drivers/spi

[PATCH v2 0/2] ARM: amlogic: Add A1 SPIFC support

2023-10-24 Thread Igor Prusov
check for NULL during probe Igor Prusov (2): spi: add support for Amlogic A1 SPI Flash Controller ARM: amlogic: ad401: enable SPIFC configs/ad401_defconfig | 1 + drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1 + drivers/spi/meson_spifc_a1.c | 384

Re: [RESEND PATCH v1 1/2] spi: add support for Amlogic A1 SPI Flash Controller

2023-10-19 Thread Igor Prusov
On Tue, Oct 17, 2023 at 09:33:02PM -0600, Simon Glass wrote: > Hi Igor, > > On Tue, 17 Oct 2023 at 11:18, Igor Prusov wrote: > > > > From: Igor Prusov > > > > Add A1 SPIFC driver from Linux. Slightly modified to use u-boot driver > > framework

Re: [RESEND PATCH v1 1/2] spi: add support for Amlogic A1 SPI Flash Controller

2023-10-19 Thread Igor Prusov
On Tue, Oct 17, 2023 at 09:33:02PM -0600, Simon Glass wrote: > Hi Igor, > > On Tue, 17 Oct 2023 at 11:18, Igor Prusov wrote: > > > > From: Igor Prusov > > > > Add A1 SPIFC driver from Linux. Slightly modified to use u-boot driver > > framework

[PATCH v1 2/2] arm: meson-a1: dts: Sync DT with Linux

2023-10-17 Thread Igor Prusov
Import device tree changes from Linux v6.6-rc6 for Amlogic A1 board. Signed-off-by: Igor Prusov --- arch/arm/dts/meson-a1.dtsi | 356 - 1 file changed, 351 insertions(+), 5 deletions(-) diff --git a/arch/arm/dts/meson-a1.dtsi b/arch/arm/dts/meson-a1.dtsi

[PATCH v1 1/2] serial: amlogic: Add UART compatible for A1 board

2023-10-17 Thread Igor Prusov
Add additional compatible to allow using serial driver with A1 board. After compatible change in DTS [1], serial_meson driver should still be able to work with console device. [1] https://lore.kernel.org/all/20230705181833.16137-8-ddroko...@sberdevices.ru/ Signed-off-by: Igor Prusov

[PATCH v1 0/2] arm: dts: meson-a1 Sync DT with Linux

2023-10-17 Thread Igor Prusov
differentiates between ttyAML and ttyS names for serial console devices. Igor Prusov (2): serial: amlogic: Add UART compatible for A1 board arm: meson-a1: dts: Sync DT with Linux arch/arm/dts/meson-a1.dtsi| 356 +- drivers/serial/serial_meson.c | 1 + 2

[PATCH v2 1/1] mtd: spinand: add support for ESMT F50x1G41LB

2023-10-17 Thread Igor Prusov
with explicit JEDEC ID in variable name. Datasheets: https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F50L1G41LB(2M).pdf https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F50D1G41LB(2M).pdf Signed-off-by: Igor Prusov Signed-off-by: Chuanhong Guo Signed-off-by: Martin Kurbanov Signed-off-by

[PATCH v2 0/1] mtd: spinand: add support for ESMT F50x1G41LB

2023-10-17 Thread Igor Prusov
8acaec923b. Igor Prusov (1): mtd: spinand: add support for ESMT F50x1G41LB drivers/mtd/nand/spi/Makefile | 3 +- drivers/mtd/nand/spi/core.c | 1 + drivers/mtd/nand/spi/esmt.c | 137 ++ include/linux/mtd/spinand.h | 1 + 4 files changed, 141

Re: [PATCH v1 1/2] mtd: spinand: rework detect procedure for different READ_ID operation

2023-10-17 Thread Igor Prusov
Hi Frieder, On Mon, Oct 09, 2023 at 10:23:53AM +0200, Frieder Schrempf wrote: > On 04.10.23 17:07, Igor Prusov wrote: > > Adaptation of Linux commit f1541773af49. > > > > Currently there are 3 different variants of read_id implementation: > > 1. opcode only. Found i

[RESEND PATCH v1 1/2] spi: add support for Amlogic A1 SPI Flash Controller

2023-10-17 Thread Igor Prusov
From: Igor Prusov Add A1 SPIFC driver from Linux. Slightly modified to use u-boot driver framework and accommodate to lack of ioread32_rep/iowrite32_rep. Based on Linux version 6.6-rc4 Signed-off-by: Igor Prusov Signed-off-by: Martin Kurbanov --- drivers/spi/Kconfig | 8

[RESEND PATCH v1 2/2] ARM: amlogic: ad401: enable SPIFC

2023-10-17 Thread Igor Prusov
From: Igor Prusov Enable Amlogic A1 SPI FLash Controller support. Signed-off-by: Igor Prusov Reviewed-by: Neil Armstrong --- configs/ad401_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/ad401_defconfig b/configs/ad401_defconfig index b9aca3ab0d..b44b9c63e8 100644 --- a

[RESEND PATCH v1 0/2] ARM: amlogic: Add A1 SPIFC support

2023-10-17 Thread Igor Prusov
A1 family boards have new version of SPIFC controller, that is incompatible with meson_spifc driver. This series ports A1 SPIFC driver from Linux and enables it for ad401 board. Igor Prusov (2): spi: add support for Amlogic A1 SPI Flash Controller ARM: amlogic: ad401: enable SPIFC configs

[PATCH v4 7/8] clk: treewide: switch to clock dump from clk_ops

2023-10-17 Thread Igor Prusov
Switch to using new dump operation in clock provider drivers instead of overriding soc_clk_dump. Signed-off-by: Igor Prusov Tested-by: Patrice Chotard --- arch/mips/mach-pic32/cpu.c | 23 --- drivers/clk/aspeed/clk_ast2600.c | 13 - drivers/clk/clk_k210.c

[PATCH v4 8/8] cmd: clk: Make soc_clk_dump static

2023-10-17 Thread Igor Prusov
After introducing dump to clk_ops there is no need to override or expose this symbol anymore. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- cmd/clk.c | 4 ++-- include/clk.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd

[PATCH v4 6/8] cmd: clk: Use dump function from clk_ops

2023-10-17 Thread Igor Prusov
Add another loop to dump additional info from clock providers that implement dump operation. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- cmd/clk.c | 9 + 1 file changed, 9 insertions(+) diff --git a/cmd/clk.c b/cmd/clk.c index c7c379d7a6

[PATCH v4 5/8] clk: Add dump operation to clk_ops

2023-10-17 Thread Igor Prusov
This adds dump function to struct clk_ops which should replace soc_clk_dump. It allows clock drivers to provide custom dump implementation without overriding generic CCF dump function. Signed-off-by: Igor Prusov Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard --- include/clk-uclass.h

[PATCH v4 3/8] clk: k210: Move soc_clk_dump function

2023-10-17 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/clk_k210.c | 92 +- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/clk/clk_k210.c b/drivers/clk

[PATCH v4 4/8] clk: amlogic: Move driver and ops structs

2023-10-17 Thread Igor Prusov
Move driver and ops structs to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/meson/a1.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/clk/meson/a1.c b/drivers/clk/meson

[PATCH v4 0/8] clk: Switch from soc_clk_dump to clk_ops function

2023-10-17 Thread Igor Prusov
mlogic A1 clock controller driver Igor Prusov (8): clk: zynq: Move soc_clk_dump to Zynq clock driver clk: ast2600: Move soc_clk_dump function clk: k210: Move soc_clk_dump function clk: amlogic: Move driver and ops structs clk: Add dump operation to clk_ops cmd: clk: Use dump function fro

[PATCH v4 2/8] clk: ast2600: Move soc_clk_dump function

2023-10-17 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/aspeed/clk_ast2600.c | 70 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/clk/aspeed/clk_ast2600.c b

[PATCH v4 1/8] clk: zynq: Move soc_clk_dump to Zynq clock driver

2023-10-17 Thread Igor Prusov
Move clock dump function in preparation for switching to dump function in clk_ops. Signed-off-by: Igor Prusov Acked-by: Michal Simek --- arch/arm/mach-zynq/clk.c | 57 --- drivers/clk/clk_zynq.c | 58 2 files

[PATCH v1 2/2] mtd: spinand: add support for ESMT F50x1G41LB

2023-10-04 Thread Igor Prusov
with explicit JEDEC ID in variable name. Datasheets: https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F50L1G41LB(2M).pdf https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F50D1G41LB(2M).pdf Signed-off-by: Igor Prusov Signed-off-by: Chuanhong Guo Signed-off-by: Martin Kurbanov Signed-off-by

[PATCH v1 1/2] mtd: spinand: rework detect procedure for different READ_ID operation

2023-10-04 Thread Igor Prusov
current detect methods do exactly the same id matching procedure, unify them into core.c and remove detect method from manufacture_ops. Signed-off-by: Chuanhong Guo Signed-off-by: Igor Prusov --- drivers/mtd/nand/spi/core.c | 85 +++ drivers/mtd/nand/spi/gi

[PATCH v1 0/2] mtd: spinand: add support for ESMT F50x1G41LB

2023-10-04 Thread Igor Prusov
evice ID does not. This forces spinand_manufacturer_detect function to stop and report an error. Porting a rework from Linux allows us to fix this issue and keep u-boot and kernel in sync. Igor Prusov (2): mtd: spinand: rework detect procedure for different READ_ID operation mtd: spinand: add su

[PATCH v1 2/2] ARM: amlogic: ad401: enable SPIFC

2023-10-03 Thread Igor Prusov
From: Igor Prusov Enable Amlogic A1 SPI FLash Controller support. Signed-off-by: Igor Prusov --- configs/ad401_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/ad401_defconfig b/configs/ad401_defconfig index 31752cc7f5..9a88e20a6a 100644 --- a/configs/ad401_defconfig

[PATCH v1 1/2] spi: add support for Amlogic A1 SPI Flash Controller

2023-10-03 Thread Igor Prusov
From: Igor Prusov Add A1 SPIFC driver from Linux. Slightly modified to use u-boot driver framework and accommodate to lack of ioread32_rep/iowrite32_rep. Based on Linux version 6.6-rc4 Signed-off-by: Igor Prusov Signed-off-by: Martin Kurbanov --- drivers/spi/Kconfig | 8

[PATCH v1 0/2] ARM: amlogic: Add A1 SPIFC support

2023-10-03 Thread Igor Prusov
A1 family boards have new version of SPIFC controller, that is incompatible with meson_spifc driver. This series ports A1 SPIFC driver from Linux and enables it for ad401 board. Igor Prusov (2): spi: add support for Amlogic A1 SPI Flash Controller ARM: amlogic: ad401: enable SPIFC configs

[PATCH v2 2/2] clk: Add clock driver for Amlogic A1

2023-09-25 Thread Igor Prusov
This patch adds basic clock driver for Amlogic A1 Family which supports enabling/disabling some gates, getting frequencies and setting rate with limited reparenting. Signed-off-by: Igor Prusov Reviewed-by: Simon Glass --- arch/arm/include/asm/arch-meson/clock-a1.h | 23 + drivers/clk/meson

[PATCH v2 1/2] dt-bindings: clock: Add Amlogic A1 clock bindings

2023-09-25 Thread Igor Prusov
Add clock bindings for Amlogic A1 from linux-next next-20230821. Signed-off-by: Igor Prusov Reviewed-by: Simon Glass --- .../clock/amlogic,a1-peripherals-clkc.h | 168 ++ .../dt-bindings/clock/amlogic,a1-pll-clkc.h | 25 +++ 2 files changed, 193 insertions(+) create

[PATCH v2 0/2] clk: amlogic: a1: Add Amlogic A1 clock driver

2023-09-25 Thread Igor Prusov
This series adds dt-bindings and driver implementation for Amlogic A1 PLL and Peripherals clock controllers. V1: https://lore.kernel.org/all/20230917101308.1250-1-ivpru...@salutedevices.com/ V1 -> V2: - Add more verbose comments for driver Igor Prusov (2): dt-bindings: clock: Add Amlogic

Re: [RESEND PATCH v1 2/2] clk: Add clock driver for Amlogic A1

2023-09-19 Thread Igor Prusov
Hi Simon, On Mon, Sep 18, 2023 at 07:04:47PM -0600, Simon Glass wrote: > On Sun, 17 Sept 2023 at 04:14, Igor Prusov wrote: > > > > This patch adds basic clock driver for Amlogic A1 Family which supports > > enabling/disabling some gates, getting frequencies and setting

[RESEND PATCH v1 2/2] clk: Add clock driver for Amlogic A1

2023-09-17 Thread Igor Prusov
This patch adds basic clock driver for Amlogic A1 Family which supports enabling/disabling some gates, getting frequencies and setting rate with limited reparenting. Signed-off-by: Igor Prusov --- arch/arm/include/asm/arch-meson/clock-a1.h | 23 + drivers/clk/meson/Kconfig

[RESEND PATCH v1 1/2] dt-bindings: clock: Add Amlogic A1 clock bindings

2023-09-17 Thread Igor Prusov
Add clock bindings for Amlogic A1 from linux-next next-20230821. Signed-off-by: Igor Prusov --- .../clock/amlogic,a1-peripherals-clkc.h | 168 ++ .../dt-bindings/clock/amlogic,a1-pll-clkc.h | 25 +++ 2 files changed, 193 insertions(+) create mode 100644 include/dt

[RESEND PATCH v1 0/2] clk: amlogic: a1: Add Amlogic A1 clock driver

2023-09-17 Thread Igor Prusov
This series adds dt-bindings and driver implementation for Amlogic A1 PLL and Peripherals clock controllers. Igor Prusov (2): dt-bindings: clock: Add Amlogic A1 clock bindings clk: Add clock driver for Amlogic A1 arch/arm/include/asm/arch-meson/clock-a1.h| 23 + drivers/clk/meson

[PATCH v1 2/2] clk: Add clock driver for Amlogic A1

2023-08-28 Thread Igor Prusov
This patch adds basic clock driver for Amlogic A1 Family which supports enabling/disabling some gates, getting frequencies and setting rate with limited reparenting. Signed-off-by: Igor Prusov --- arch/arm/include/asm/arch-meson/clock-a1.h | 23 + drivers/clk/meson/Kconfig

[PATCH v1 1/2] dt-bindings: clock: Add Amlogic A1 clock bindings

2023-08-28 Thread Igor Prusov
Add clock bindings for Amlogic A1 from linux-next next-20230821. Signed-off-by: Igor Prusov --- .../clock/amlogic,a1-peripherals-clkc.h | 168 ++ .../dt-bindings/clock/amlogic,a1-pll-clkc.h | 25 +++ 2 files changed, 193 insertions(+) create mode 100644 include/dt

[PATCH v1 0/2] clk: amlogic: a1: Add Amlogic A1 clock driver

2023-08-28 Thread Igor Prusov
This series adds dt-bindings and driver implementation for Amlogic A1 PLL and Peripherals clock controllers. Igor Prusov (2): dt-bindings: clock: Add Amlogic A1 clock bindings clk: Add clock driver for Amlogic A1 arch/arm/include/asm/arch-meson/clock-a1.h| 23 + drivers/clk/meson

Re: [PATCH v3 0/7] clk: Switch from soc_clk_dump to clk_ops function

2023-07-31 Thread Igor Prusov
+Simon Glass Hi Simon, Apologies for the ping, but could you please take a look at this series? There was not much feedback after a while, so I'd like to understand whether proposed fix is viable or not. On Fri, Jul 14, 2023 at 06:24:37PM +0300, Igor Prusov wrote: > Current

[PATCH v3 6/7] clk: treewide: switch to clock dump from clk_ops

2023-07-14 Thread Igor Prusov
Switch to using new dump operation in clock provider drivers instead of overriding soc_clk_dump. Signed-off-by: Igor Prusov --- arch/mips/mach-pic32/cpu.c | 23 --- drivers/clk/aspeed/clk_ast2600.c | 13 - drivers/clk/clk_k210.c | 11

[PATCH v3 7/7] cmd: clk: Make soc_clk_dump static

2023-07-14 Thread Igor Prusov
After introducing dump to clk_ops there is no need to override or expose this symbol anymore. Signed-off-by: Igor Prusov --- cmd/clk.c | 4 ++-- include/clk.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/clk.c b/cmd/clk.c index 55fb96e631..59155d7902 100644

[PATCH v3 5/7] cmd: clk: Use dump function from clk_ops

2023-07-14 Thread Igor Prusov
Add another loop to dump additional info from clock providers that implement dump operation. Signed-off-by: Igor Prusov --- cmd/clk.c | 9 + 1 file changed, 9 insertions(+) diff --git a/cmd/clk.c b/cmd/clk.c index ff7c7649a1..55fb96e631 100644 --- a/cmd/clk.c +++ b/cmd/clk.c @@ -62,6

[PATCH v3 4/7] clk: Add dump operation to clk_ops

2023-07-14 Thread Igor Prusov
This adds dump function to struct clk_ops which should replace soc_clk_dump. It allows clock drivers to provide custom dump implementation without overriding generic CCF dump function. Signed-off-by: Igor Prusov --- include/clk-uclass.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH v3 3/7] clk: k210: Move soc_clk_dump function

2023-07-14 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/clk_k210.c | 92 +- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/clk/clk_k210.c b/drivers/clk

[PATCH v3 0/7] clk: Switch from soc_clk_dump to clk_ops function

2023-07-14 Thread Igor Prusov
on sandbox target will not show CCF clocks because k210 driver overrides common soc_clk_dump. Changelog: v1 -> v2: - Add missing static to dump functions v2 -> v3: - Make soc_clk_dump in cmd/clk.c static instead of removing __weak Igor Prusov (7): clk: zynq: Move soc_clk_dump to Zynq

[PATCH v3 1/7] clk: zynq: Move soc_clk_dump to Zynq clock driver

2023-07-14 Thread Igor Prusov
Move clock dump function in preparation for switching to dump function in clk_ops. Signed-off-by: Igor Prusov Acked-by: Michal Simek --- arch/arm/mach-zynq/clk.c | 57 --- drivers/clk/clk_zynq.c | 58 2 files

[PATCH v3 2/7] clk: ast2600: Move soc_clk_dump function

2023-07-14 Thread Igor Prusov
Move clock dump function to avoid forward declaration after switching to dump in clk_ops. Signed-off-by: Igor Prusov --- drivers/clk/aspeed/clk_ast2600.c | 70 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/clk/aspeed/clk_ast2600.c b

  1   2   >