Re: [PATCH] arm: mvebu: Enable bootstd and other modernization for Synology DS414 (Armada XP) board

2024-06-09 Thread Tony Dinh
Hi Phil, On Sat, Jun 8, 2024 at 4:32 PM Phil Sutter wrote: > > On Fri, Jun 07, 2024 at 04:14:26PM -0700, Tony Dinh wrote: > > On Fri, Jun 7, 2024 at 6:45 AM Phil Sutter wrote: > > > On Thu, Jun 06, 2024 at 04:44:36PM -0700, Tony Dinh wrote: > > > > - Switch to standard boot (in include/configs/d

[PATCH 1/6] usb: gadget: g_dnl: Drop usb_gadget_controller_number()

2024-06-09 Thread Marek Vasut
The bcdDevice field is defined as |Device release number in binary-coded decimal in the USB 2.0 specification. We use this field to distinguish the UDCs from each other. In theory this could be used on the host side to apply certain quirks if the "special" UDC in combination with this gadget is use

[PATCH 2/6] usb: gadget: ether: Drop usb_gadget_controller_number()

2024-06-09 Thread Marek Vasut
The bcdDevice field is defined as |Device release number in binary-coded decimal in the USB 2.0 specification. We use this field to distinguish the UDCs from each other. In theory this could be used on the host side to apply certain quirks if the "special" UDC in combination with this gadget is use

[PATCH 3/6] usb: gadget: Drop usb_gadget_controller_number()

2024-06-09 Thread Marek Vasut
The bcdDevice field is defined as |Device release number in binary-coded decimal in the USB 2.0 specification. We use this field to distinguish the UDCs from each other. In theory this could be used on the host side to apply certain quirks if the "special" UDC in combination with this gadget is use

[PATCH 4/6] usb: gadget: Drop all gadget_is_*() functions

2024-06-09 Thread Marek Vasut
The only actually used gadget_is_*() functions are the one for DWC3 used in epautoconf.c usb_ep_autoconfig() and one for MUSB in ether.c. The DWC3 one should be fixed in some separate patch. Inline the gadget_is_dwc3() and stop using ifdefs in favor of IS_ENABLED() macro. The rest of gadget_is_*(

[PATCH 5/6] usb: gadget: Add full ep_matches() check past .match_ep() callback

2024-06-09 Thread Marek Vasut
If .match_ep() callback returns non-NULL endpoint, immediately check its usability and if the returned endpoint is usable, stop search and return the endpoint. Otherwise, continue with best effort search for usable endpoint. Currently the code would attempt the best effort search in any case, whic

[PATCH 6/6] usb: dwc3: gadget: Convert epautoconf workaround to match_ep callback

2024-06-09 Thread Marek Vasut
Use the .match_ep() callback instead of workaround in core code. Replace descriptor parsing with ch9 macros with the same effect. Drop the SPL specific behavior, it is unclear why SPL should even be special. Signed-off-by: Marek Vasut --- Cc: Alexander Sverdlin Cc: Felipe Balbi Cc: Lukasz Majew

Re: [PATCH 14/42] mmc: dw_mmc: Use CONFIG_IS_ENABLED() to check config options

2024-06-09 Thread Sam Protsenko
On Thu, May 23, 2024 at 10:03 AM Quentin Schulz wrote: > > Hi Sam, > > On 5/23/24 1:31 AM, Sam Protsenko wrote: > > Use CONFIG_IS_ENABLED() macro to check config options as recommended by > > checkpatch, instead of checking those with just #ifdef CONFIG_... > > > > No functional change. > > > > Th

Re: [PATCH 06/42] mmc: dw_mmc: Extract clock on/off code into a separate routine

2024-06-09 Thread Sam Protsenko
On Mon, Jun 3, 2024 at 3:52 AM Quentin Schulz wrote: > > Hi Sam, > > On 5/30/24 2:06 AM, Sam Protsenko wrote: > > On Thu, May 23, 2024 at 9:36 AM Quentin Schulz > > wrote: > >> > >> Hi Sam, > >> > > > > Hi Quentin, > > > > Thanks for reviewing this series! My answers are below (inline). > > > >>

[PATCH] arm: dts: mvebu: Update DTS for Thecus N2350 board

2024-06-09 Thread Tony Dinh
- Change the spi-max-frequency to 5000 (50 Mhz). According to the data sheet[1], the MX25L3205D max frequency is 86 Mhz. Using 50 Mhz in the DTS to ensure u-boot is consistent with what Linux kernel expected. - Update GPIO fan to conform to the latest DT binding. [1] MX25L3205D-MX25L1605D-MX25

Re: [PATCH] arm: dts: mvebu: Update DTS for Thecus N2350 board

2024-06-09 Thread Dragan Simic
Hello Tony, Please see a few comments below. On 2024-06-10 02:34, Tony Dinh wrote: - Change the spi-max-frequency to 5000 (50 Mhz). According to the data sheet[1], the MX25L3205D max frequency is 86 Mhz. Using 50 Mhz in the DTS to ensure u-boot is consistent with what Linux kernel expected.

[PATCH v2 00/40] mmc: dw_mmc: Enable eMMC on E850-96 board

2024-06-09 Thread Sam Protsenko
Bring 64-bit support to dw_mmc core and Exynos dw_mmc drivers, and enable it on E850-96 board. Additionally do some related cleanups and device tree updates. 64-bit version of DesignWare MMC can be often found on modern ARM64 chips. It's different from its older 32-bit version (which is already im

[PATCH v2 01/40] mmc: dw_mmc: Remove common.h

2024-06-09 Thread Sam Protsenko
common.h header is marked for removal treewide and shouldn't be used. Remove it from DW MMC driver. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH v2 03/40] mmc: dw_mmc: Move struct idmac to dw_mmc.c

2024-06-09 Thread Sam Protsenko
struct idmac is only used in dw_mmc.c, so move it there from dwmmc.h to avoid cluttering the interface in the header. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 7 +++ include/dwmm

[PATCH v2 04/40] mmc: dw_mmc: Extract waiting for data busy into a separate routine

2024-06-09 Thread Sam Protsenko
Waiting for data busy is a logically separate operation and should be implemented as a separate routine. Follow Linux kernel example and extract it from dwmci_send_cmd(). This way it doesn't clutter dwmci_send_cmd() function, and can be reused later in other cases. No functional change. Signed-of

[PATCH v2 05/40] mmc: dw_mmc: Extract FIFO init into a separate routine

2024-06-09 Thread Sam Protsenko
Move FIFO threshold initialization into a separate function to make dwmci_init() more readable. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 25 +++-- 1 file changed,

[PATCH v2 02/40] mmc: dw_mmc: Remove unused version field from struct dwmci_host

2024-06-09 Thread Sam Protsenko
Nobody seems to use it, so just remove it. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin include/dwmmc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/dwmmc.h b/include/dwmmc.h index 136a95b8cdb6..

[PATCH v2 06/40] mmc: dw_mmc: Extract divider update to a separate function

2024-06-09 Thread Sam Protsenko
Extract the clock divider update into dwmci_update_div() function. It's a procedure recommended in TRM, so it's better to keep it in a dedicated function to make the code clearer. While at it also extract the clock control code into a separate routine to avoid code duplication in dwmci_setup_bus()

[PATCH v2 07/40] mmc: dw_mmc: Extract FIFO data transfer into a separate routine

2024-06-09 Thread Sam Protsenko
FIFO data transfer is implemented as quite a massive chunk of code. Extract it into a dedicated function to make dwmci_data_transfer() easier to read and reduce the indentation level of the code. No functional change. Signed-off-by: Sam Protsenko --- drivers/mmc/dw_mmc.c | 107 +

[PATCH v2 08/40] mmc: dw_mmc: Extract DMA transfer handling code into a separate routine

2024-06-09 Thread Sam Protsenko
Make dwmci_send_cmd() easier to read by moving the DMA transfer handling code into a dedicated function. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 51 ++---

[PATCH v2 09/40] mmc: dw_mmc: Extract setting the DMA descriptor into a separate routine

2024-06-09 Thread Sam Protsenko
Make dwmci_prepare_data() function easier to read by extracting the preparation of IDMAC descriptor into a dedicated function. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 52 +++

[PATCH v2 10/40] mmc: dw_mmc: Improve 32-bit IDMAC descriptor namings

2024-06-09 Thread Sam Protsenko
Prepare for adding 64-bit IDMAC descriptors by renaming current 32-bit descriptor and its fields accordingly. While at it, make use of virt_to_phys() to make it more obvious in which places the physical addresses have to be used. No functional change. Signed-off-by: Sam Protsenko --- drivers/mm

[PATCH v2 11/40] mmc: dw_mmc: Add support for 64-bit IDMAC

2024-06-09 Thread Sam Protsenko
Some DW MMC blocks (e.g. those on modern Exynos chips) support 64-bit DMA addressing mode. 64-bit DW MMC variants differ from their 32-bit counterparts: - the register layout is a bit different (because there are additional IDMAC registers present for storing upper part of 64-bit addresses)

[PATCH v2 12/40] mmc: dw_mmc: Replace fifoth_val property with fifo-depth

2024-06-09 Thread Sam Protsenko
Replace fifoth_val property with its fifo-depth counterpart in all DW MMC drivers. fifo-depth is a common property used in upstream Linux kernel. The FIFOTH register value will be calculated using fifo-depth value in DW MMC core (dw_mmc.c). This change reduces code duplication in platform drivers,

[PATCH v2 13/40] mmc: dw_mmc: Fix kernel-doc comments in dwmmc.h

2024-06-09 Thread Sam Protsenko
Rework kernel-doc comments in dwmmc.h header so it's actually possible to generate a proper documentation from it usin scripts/kernel-doc script, with no errors. No functional change. Signed-off-by: Sam Protsenko --- include/dwmmc.h | 41 ++--- 1 file changed

[PATCH v2 16/40] dt-bindings: exynos: Update bindings doc for DW MMC controller

2024-06-09 Thread Sam Protsenko
Update the bindings doc for Exynos DW MMC block to follow the upstream example and reflect the latest changes made in corresponding Linux kernel bindings. Signed-off-by: Sam Protsenko --- doc/device-tree-bindings/exynos/dwmmc.txt | 46 +-- 1 file changed, 27 insertions(+), 19

[PATCH v2 14/40] mmc: dw_mmc: Improve coding style

2024-06-09 Thread Sam Protsenko
Fix most of checkpatch warnings and other obvious style issues. No functional change. Signed-off-by: Sam Protsenko Reviewed-by: Quentin Schulz --- Changes in v2: - Added R-b tag from Quentin drivers/mmc/dw_mmc.c | 69 ++-- include/dwmmc.h | 149 ++--

[PATCH v2 15/40] arm: dts: exynos: Add upstream DW MMC properties to all Exynos dts

2024-06-09 Thread Sam Protsenko
Some device tree properties for DW MMC block were updated in Linux kernel. Let's follow its example and rework corresponding properties in all Exynos device trees. Don't remove outdated properties yet, it'll be done later once DW MMC driver is updated accordingly to read the updated properties inst

[PATCH v2 17/40] arm: exynos: Add header guard for dwmmc.h

2024-06-09 Thread Sam Protsenko
Add missing header guard to prevent possible build errors. Fixes: 77b55e8cfcee ("ARM: exynos: move SoC sources to mach-exynos") Signed-off-by: Sam Protsenko --- arch/arm/mach-exynos/include/mach/dwmmc.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-exynos/include/mach/dw

[PATCH v2 18/40] mmc: exynos_dw_mmc: Fix obtaining the base address of controller

2024-06-09 Thread Sam Protsenko
Getting the base address with outdated fdtdec_get_addr() API and further casting it to (void *) leads to next build warning on ARM64 platforms: In function 'exynos_dwmci_get_config': warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] hos

[PATCH v2 19/40] mmc: exynos_dw_mmc: Fix getting private data in exynos_dwmci_board_init()

2024-06-09 Thread Sam Protsenko
In case of CONFIG_DM_MMC, host->priv actually holds (struct udevice *), and not (struct dwmci_exynos_priv_data *). This makes *priv pointer invalid and may lead to Synchronous Abort during its dereference later in exynos_dwmci_board_init(). Fix it by extracting exynos_dwmmc_get_priv() helper from e

[PATCH v2 20/40] mmc: exynos_dw_mmc: Don't call pinmux functions on ARM64 chips

2024-06-09 Thread Sam Protsenko
Pinmux configuration on ARM64 platforms must be performed during startup in pinctrl driver using info from device tree. exynos_pinmux_config() and pinmux_decode_periph_id() are only available on ARM32 platforms, so don't call those functions on ARM64 platforms. Instead of the latter function, use "

[PATCH v2 21/40] mmc: exynos_dw_mmc: Obtain and use CIU clock via CCF API

2024-06-09 Thread Sam Protsenko
New Exynos chips should implement clock drivers using CCF framework. In that case corresponding CCF functions can be used to get/set the clock rates. Moreover, already existing get_mmc_clk() and set_mmc_clk() calls are only implemented for CONFIG_CPU_V7A (i.e. ARM32 chips). In case of ARM64 chips t

[PATCH v2 22/40] mmc: exynos_dw_mmc: Use .of_to_plat for device tree parsing

2024-06-09 Thread Sam Protsenko
exynos_dwmci_get_config() is called from the probe function and used to read data from device tree. Make use of .of_to_plat driver callback instead, and convert exynos_dwmci_get_config() to match its signature. No functional change. Signed-off-by: Sam Protsenko --- drivers/mmc/exynos_dw_mmc.c |

[PATCH v2 23/40] mmc: exynos_dw_mmc: Convert to use livetree API

2024-06-09 Thread Sam Protsenko
Update the driver to use livetree API instead of FDT one. No functional change. Signed-off-by: Sam Protsenko --- Changes in v2: - Moved exynos_dwmmc_of_to_plat() under #ifdef CONFIG_DM_MMC stanza drivers/mmc/exynos_dw_mmc.c | 17 - 1 file changed, 8 insertions(+), 9 deletions

[PATCH v2 24/40] mmc: exynos_dw_mmc: Read upstream SDR timing properties

2024-06-09 Thread Sam Protsenko
The obsolete "samsung,timing" dts property is now split into "samsung,dw-mshc-ciu-div" (for holding the internal DW MMC divider value) and "samsung,dw-mshc-sdr-timing" (for actual timing values) in upstream Linux kernel. Rework the driver to make use of new properties instead of the old one. All af

[PATCH v2 25/40] mmc: exynos_dw_mmc: Abstract CLKSEL register

2024-06-09 Thread Sam Protsenko
CLKSEL register offset may vary between different Exynos chips, e.g. on ARM64 vs ARM32 chips. Provide a way to specify its offset value for each compatible instead of hard-coding its value in read/write calls. No functional change. Signed-off-by: Sam Protsenko --- drivers/mmc/exynos_dw_mmc.c |

[PATCH v2 26/40] mmc: exynos_dw_mmc: Refactor fixed CIU clock divider

2024-06-09 Thread Sam Protsenko
Some chips like Exynos4412 have fixed internal CIU clock divider. Instead of reading it from non-standard "div" dts property, store its value in the driver internally, in static chip data associated with corresponding compatible. This makes it possible to avoid using host->div for storing it, so th

[PATCH v2 27/40] mmc: exynos_dw_mmc: Read common bus-width property

2024-06-09 Thread Sam Protsenko
Instead of using non-standard "samsung,bus-width" dts property, read common "bus-width" property used in upstream Linux kernel. It's safe to do so, as "bus-width" property was already added to corresponding nodes in all affected Exynos device tree files. No functional change. Signed-off-by: Sam P

[PATCH v2 28/40] mmc: exynos_dw_mmc: Read common clock-frequency property

2024-06-09 Thread Sam Protsenko
Instead of using non-standard "bus_hz" dts property, read common "clock-frequency" property used in upstream Linux kernel. It's safe to do so, as "clock-frequency" property was already added to corresponding nodes in all affected Exynos device tree files. No functional change. Signed-off-by: Sam

[PATCH v2 29/40] mmc: exynos_dw_mmc: Move quirks from struct dwmci_host to chip data

2024-06-09 Thread Sam Protsenko
host->quirks field is only used internally in exynos_dw_mmc.c driver. To avoid cluttering the scope of struct dwmci_host, move quirks field into Exynos driver's chip data, where it can be statically defined. No functional change. Signed-off-by: Sam Protsenko --- Changes in v2: - Replaced CONFI

[PATCH v2 30/40] mmc: exynos_dw_mmc: Read and use DDR timing when available

2024-06-09 Thread Sam Protsenko
DDR timing values should be defined in "samsung,dw-mshc-ddr-timing" dts property, and used when DDR MMC mode is selected. Read that value from dts and use it. If it's not available, use SDR timing values instead. This change is following upstream Linux kernel implementation. Signed-off-by: Sam Pro

[PATCH v2 31/40] mmc: exynos_dw_mmc: Set requested freq in get_mmc_clk() callback

2024-06-09 Thread Sam Protsenko
By now exynos_dw_mmc driver was relying on the correct CIU clock frequency being set on driver init. But dw_mmc core is actually trying to change CIU clock rate dynamically, on init and in set_ios() callback, which it's requesting via host->get_mmc_clk() callback (the name is misleading: although i

[PATCH v2 32/40] mmc: exynos_dw_mmc: Add support for ARM64 Exynos chips

2024-06-09 Thread Sam Protsenko
Add the compatible entry and corresponding chip data for Exynos7 compatible chips, which covers modern ARM64 based Exynos chips. They have some differences w.r.t. old ARM32 Exynos chips: - CLKSEL register offset is different - 64-bit IDMAC descriptor and 64-bit IDMAC registers are used (imp

[PATCH v2 33/40] mmc: exynos_dw_mmc: Remove common.h

2024-06-09 Thread Sam Protsenko
common.h header is marked for removal treewide and shouldn't be used. Remove it from Exynos DW MMC driver. No functional change. Signed-off-by: Sam Protsenko --- drivers/mmc/exynos_dw_mmc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mm

[PATCH v2 34/40] mmc: exynos_dw_mmc: Pull all init code into probe function

2024-06-09 Thread Sam Protsenko
There is no logical sense to split the initialization code between multiple functions. Pull both do_dwmci_init() and exynos_dwmci_core_init() into exynos_dwmmc_probe() to make the code more simple and obvious. No functional change. Signed-off-by: Sam Protsenko --- Changes in v2: - Replaced CON

[PATCH v2 35/40] mmc: exynos_dw_mmc: Don't call dwmci_setup_cfg() after add_dwmci()

2024-06-09 Thread Sam Protsenko
add_dwmci() is already calling dwmci_setup_cfg() internally, there is no needed to call dwmci_setup_cfg() again in case when add_dwmci() is used (for non-DM cases). Fix it by calling dwmci_setup_cfg() only in DM cases, when add_dwmci() wasn't called. Also, this assignment: host->mmc = &plat->m

[PATCH v2 37/40] mmc: exynos_dw_mmc: Improve coding style

2024-06-09 Thread Sam Protsenko
Fix most of checkpatch warnings and other obvious style issues. No functional change. Signed-off-by: Sam Protsenko --- arch/arm/mach-exynos/include/mach/dwmmc.h | 36 +-- drivers/mmc/exynos_dw_mmc.c | 26 ++-- 2 files changed, 29 insertions(+), 33 d

[PATCH v2 36/40] mmc: exynos_dw_mmc: Use dev->name as driver's displayed name

2024-06-09 Thread Sam Protsenko
Reduce U-Boot footprint by reusing dev->name as a driver's displayed name. This changes boot device name (and "mmc info" output) from "EXYNOS DWMMC" to something like "mmc@1210". Signed-off-by: Sam Protsenko --- drivers/mmc/exynos_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH v2 38/40] arm: dts: exynos: Remove outdated DW MMC properties in all Exynos dts

2024-06-09 Thread Sam Protsenko
Upstream properties were added to device trees to follow current Linux kernel. DW MMC driver was updated accordingly. Safely remove outdated MMC properties. Details on removed properties are as follows: * samsung,removable: replaced by non-removable * samsung,bus-width: replaced by bus-width * sam

[PATCH v2 40/40] doc: samsung: Mention enabled eMMC in E850-96 board doc

2024-06-09 Thread Sam Protsenko
eMMC is enabled on E850-96 board now. Mention that in the board documentation. Signed-off-by: Sam Protsenko --- doc/board/samsung/e850-96.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/board/samsung/e850-96.rst b/doc/board/samsung/e850-96.rst index 0cb95473e536.

[PATCH v2 39/40] configs: e850-96: Enable MMC

2024-06-09 Thread Sam Protsenko
Enable MMC subsystem and DW MMC driver support to make eMMC functional. Also enable a couple of related commands so the user can make use of eMMC from U-Boot shell. Signed-off-by: Sam Protsenko --- configs/e850-96_defconfig | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --

Re: [RFC PATCH 26/31] test: lmb: run lmb tests only manually

2024-06-09 Thread Sughosh Ganu
On Sat, 8 Jun 2024 at 10:09, Heinrich Schuchardt wrote: > > On 6/7/24 20:52, Sughosh Ganu wrote: > > The LMB code has been changed so that the memory reservations and > > allocations are now persistent and global. With this change, the > > design of the LMB tests needs to be changed accordingly. F

[PATCH] board: imx8mn_s2: Update timing with production one

2024-06-09 Thread Michael Trimarchi
The timing upstream was wrong corresponding to the production. This come evident after commit b614ddb5d33 (ddr: imx: Save the FW loading if it hasn't changed). This change fix booting from usb Signed-off-by: Michael Trimarchi --- board/bsh/imx8mn_smm_s2/ddr3l_timing_256m.c | 23 -

Re: [RFC PATCH 30/31] temp: cmd: efi_mem: add a command to test efi alloc/free

2024-06-09 Thread Sughosh Ganu
On Sat, 8 Jun 2024 at 09:07, Heinrich Schuchardt wrote: > > > > Am 7. Juni 2024 20:52:39 MESZ schrieb Sughosh Ganu : > >Not for committing. > > Best put "DON'T MERGE" into the title to avoid mishaps in future versions. Will do. > > In the final series we should have unit test covering all releva

Re: [RFC PATCH 31/31] temp: cmd: efi: add a command to dump EFI memory map

2024-06-09 Thread Sughosh Ganu
On Sat, 8 Jun 2024 at 09:03, Heinrich Schuchardt wrote: > > > > Am 7. Juni 2024 20:52:40 MESZ schrieb Sughosh Ganu : > >Add a command to dump the EFI memory map. > > What are you missing in 'efidebug memmap'? Nothing. I wasn't aware of this sub-command. Thanks for pointing it out. -sughosh > >