summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-06-02usb: dwc2: Replace uint<x>_t types with u<x>Kongyang Liu
Updates all instances of uint8_t, uint16_t, and uint32_t to u8, u16, and u32 respectively, ensuring consistent use of kernel-preferred types and resolving checkpatch.pl warnings. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-8-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Unify flush and reset logic with v4.20a supportKongyang Liu
This patch merges flush and reset logic for both host and gadget code into a common set of functions, reducing duplication. It also adds support for the updated reset logic to compatible with core version since v4.20a. This patch mainly refers to the patch in the kernel. link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=65dc2e725286106f99c6f6b78e3d9c52c15f3a9c Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Marek Vasut <marex@denx.de> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-7-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Extract macro definitions to common headerKongyang Liu
Some macros are shared between host and gadget code, causing duplicated definitions. Move DWC2 macro definitions from host and gadget code into a common header to reduce duplication. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-6-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Align macros with Linux kernel definitionsKongyang Liu
Update the DWC2 macros to match those used in the Linux kernel, making it easier to synchronize updates with kernel. Also removed some unused macros to cleanup the code. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-5-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Clean up with bitfield macrosKongyang Liu
Use FIELD_PREP, FIELD_GET, BIT, and GENMASK macros to standardize bit manipulation across the DWC2 code, improving readability and maintainability without altering functionality. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-4-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Fix HBstLen setting for external DMA modeKongyang Liu
The loop used to calculate HBstLen for extern DMA mode does not produce the correct result according to the datasheet [1]. Replacing that loop with a direct calculation using LOG2 to correctly assign the burst length in the GAHBCFG register for external DMA mode. [1] https://rockchip.fr/RK312X%20TRM/chapter-26-usb-otg-2-0.pdf#page=24 Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-3-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Fix incorrect ULPI_UTMI_SEL bit settingJunhui Liu
The ULPI_UTMI_SEL bit in the DWC2 driver was set incorrectly. According to the datasheet [1], this bit should be set to 0 for UTMI interface and 1 for ULPI interface. The existing code had this logic reversed, causing the interface selection to be incorrect. This commit corrects the ULPI_UTMI_SEL bit setting to match the datasheet's description. Referencing the kernel's code [2] also confirms this fix. [1] https://rockchip.fr/RK312X%20TRM/chapter-26-usb-otg-2-0.pdf#page=30 [2] https://github.com/torvalds/linux/blob/v6.13-rc3/drivers/usb/dwc2/core.c#L1106 Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-2-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-02usb: dwc2: Extract register definitions to common header fileKongyang Liu
The same registers are accessed in both the otg and gatet drivers of dwc2, and these registers are repeatedly defined in these two parts. Extract register definitions into a common header file to reduce redundancy and make the code more maintainable. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-1-987f4fd6f8b2@pigmoral.tech Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-05-30Merge tag 'dm-pull-30may25' of git://git.denx.de/u-boot-dm into nextTom Rini
Bring in recent expo enhancements: - multi-line text - highlighting of menu items - rationalisation of menu and expo code - support for object alignment - editable strings - various bug fixes and tweaks This also includes some required abuf improvements.
2025-05-30Merge patch series "test/py: enable HTTP testing"Tom Rini
Adriano Cordova <adrianox@gmail.com> says: Enable HTTP server in CI to support HTTP tests in pytest QEMU does not emulate an HTTP server, unlike other services like DHCP or TFTP. To enable HTTP tests during CI runs, start a simple Python HTTP server on port 80. This allows tests that require HTTP access to run. The HTTP server is launched on the host. For QEMU environments launched with '-netdev,user' this means that the HTTP server runs together with DHCP at 10.0.2.2. HTTP testing needs to be explicitly enabled with env__efi_helloworld_net_http_test_skip = False. We also default `WGET=y` in `ARCH_QEMU` configurations so that these HTTP tests are included automatically when using QEMU in CI. Link: https://lore.kernel.org/r/20250516085256.30386-1-adriano.cordova@canonical.com
2025-05-30cmd/Kconfig: select CMD_WGET if ARCH_QEMUAdriano Cordova
select CMD_WGET for ARCH_QEMU. This way HTTP can be tested on the qemu platforms in CI. Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-30CI testing: add http server to CI testsAdriano Cordova
Add an http server to CI tests so that HTTP booting and loading can be tested. Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-30image: Fix FIT image loadable section custom processingMarek Vasut
The original commit always generated linker list entries with the same entry variable name, because _function passed to ll_entry_declare() is not a variable and therefore was interpreted as fixed string. Change it to _type which is a variable and which does allow generation of multiple unique linker list entries, one for each U_BOOT_FIT_LOADABLE_HANDLER(). Fixes: d7be50921ed3 ("image: Add FIT image loadable section custom processing") Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
2025-05-30Gitlab: Rework sjg-lab calling test.py to be closer to test.py stageTom Rini
There are a few differences between how the test.py stage invokes test.py and how the sjg-lab stage invokes test.py. As a start of making both the code and the output and artifacts similar, this updates the sjg-lab stage with the following: - Pass "-ra" so that we get the summary information in the job - Make use of TEST_PY_EXTRA for passing "--capture=tee-sys" - Re-order some of the arguments to be the same order when possible. And most importantly: - Create and save as an artifact the junitxml output. The last part here is the kind of test result information that in the future we should determine how to archive for future reference. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-30Merge patch series "Almost complete DM_SERIAL migration"Tom Rini
Tom Rini <trini@konsulko.com> says: In a private thread, Simon asked about what's needed to get PowerPC migrated to DM_SERIAL. I went and took a look, and to complete the entire DM_SERIAL migration (excluding SPL/TPL) we're actually nearly there. This series first migrates PowerPC (and some NXP Layerscape boards that share history more clearly with PowerPC parts), with the biggest change being to make sure we still use the correct legacy drivers in SPL/TPL (where SPL is extremely constrained). With that out of the way, I looked at what was left. With two exceptions, it's platforms which can be trivially enabled for conversion, and so we do that. Link: https://lore.kernel.org/r/20250502201226.1369013-1-trini@konsulko.com
2025-05-30global: Convert almost all remaining non-DM_SERIAL usersTom Rini
This converts almost all of the remaining non-DM_SERIAL users to enable DM_SERIAL. These are platforms where there have long been other SoC boards that have switched and so it's been a matter of inertia keeping these from being converted. Do so now. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-30PowerPC / Layerscape: Finish migration to DM_SERIALTom Rini
Migrate the few ARM Layerscape platforms that had not been switched along with all remaining PowerPC platforms to DM_SERIAL. For PowerPC, this means that platforms which use SPL/TPL, keeping the non-DM serial driver enabled there as they do not use DM. We also rework the guards on how to define CFG_SYS_NS16550_CLK so that this is mostly in one place now. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-30expo: Drop the special theme code for bootflow_menuSimon Glass
The expo now has all that is needed to apply a suitable theme, so drop this unnecessary code. Any further tweaks can be added to the generic expo code. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Set up menu fully in bootflow_menu_start()Simon Glass
Apply the theme, calculate dimensions, highlight the menu and arrange the scene correctly, so that everything is ready to go when the expo is rendered. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Split setting up the menu from adding itemsSimon Glass
Some callers may wish to add items later as they are discovered. Split the setup code into its own function, to permit this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Update bootflow_menu_poll() to return a sequence IDSimon Glass
Rather than returning a bootflow, return the index of the bootflow. This will allow callers to do their own translation to bootflows or some other data structure. Also return a special code when the user tries to move the pointer, so that the caller can cancel the boot-menu timeout, if this is in use. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Improve the visual appearance of the menuSimon Glass
The menu is currently quite basic. Make use of some recently added features in expo, to: - Show proper prompts - Highlight the current item - Centre text - Use multi-line text instead of two independent lines - Put a box around the items Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Provide a way to position things relative to displaySimon Glass
It is often necessary to centre objects within the display area. Add a special position value to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Drop the render from expo_poll()Simon Glass
Within tests it is useful to be able to control rendering of the expo. Drop the automatic call to expo_render() within expo_poll() and adjust its callers to handle this instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Adjust expo_poll() to avoid looping foreverSimon Glass
If the user does not quickly provide some input, exit so that other things can be done, such as searching for the next OS. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support highlighting menu itemsSimon Glass
Expo normally uses a pointer to show the current item. Add support for highlighting as well, since this makes it easier for the user to see the current item. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Add forward declarations to scene_internal.hSimon Glass
Provide some forward declarations for types used in this file, to keep the LSP happy and avoid errors if the caller happens not to include the required header. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Drop the gap between groups of menu itemsSimon Glass
The gap is intended to separate options which are on different bootdevs, but most of the time there is only one. So drop this gap. Keep the code around in case it becomes useful to have it in the style, or based on some other mechanism. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Use a simpler name for USB mediaSimon Glass
For USB devices we use the string 'usb_mass_storage' which is a bit verbose. Use 'USB' instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Begin implementation of a text editorSimon Glass
It is useful to be able to edit text, e.g. to allow the user to edit the environment or the command-line arguments for the OS. Add the beginnings of an implementation. Future work is needed to finish this: keypress handling and scrolling. For now it just displays the text. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support object alignmentSimon Glass
Add support for left, right and centred alignment for text, in the horizontal dimension. Also support top, bottom and centred in the vertical dimension, for the text object as a whole. Alignment is not yet implemented for images. It has no meaning for menus. A textline object uses a text object internally, so alignment is supported there. Provide some documentation to explain how objects are positioned. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Implement a boxSimon Glass
It is useful to be able to draw a box around elements in the menu. Add support for an unfilled box with a selectable thickness. Note that there is no support for selecting the colour for any expo objects yet. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support white-on-black in the themeSimon Glass
Allow this setting to be controlled from the theme. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support rendering multiple lines of textSimon Glass
Use the measurement info to write each line of text separately, thus respecting word-wrapping and newlines. Fix up the comment for scene_obj_render() while we are here. Since a lineedit does not support alignment, add a special case to just display the text if there is no measurement. This happens assuming the lineedit is initially empty. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Check the screen contents after renderingSimon Glass
Make sure that the screen contents are as expected when a scene has been rendered. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Allow strings to be editableSimon Glass
In some cases dynamic text is needed, e.g. for a menu countdown. Add a function which handles this, allowing the caller to take control of the text that is shown on each render. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Tidy up scene_txt_render()Simon Glass
Add an early return if there is no string. Move all declarations to the top of the function. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Move text-rendering into its own functionSimon Glass
The code to render text is quite long, so put it in its own function. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Create a struct for generic text attributesSimon Glass
In preparation for adding more text types, refactor the common fields into a new structure. This will allow common code to be used. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Line up all menu objectsSimon Glass
At present labels are lined up vertically. Do the same with keys and descriptions, since it looks nicer. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support setting the size and bounds of an objectSimon Glass
Add a function to allow the size of an object to be set independently of its position. Also add a function to permit the object's bounding box to be set independently of its dimensions. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Make bounding-box calculation more flexibleSimon Glass
In some cases it is useful to obtain more than just two bounding boxes from a menu, e.g. to line up all descriptions vertically. Use an array to obtain bounding-box information and calculate it separately for each item. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Separate dimensions from the bounding boxSimon Glass
At present each object has a width and height and the bounding box is implicit in that. This is not flexible enough to handle objects which are larger than their contents might need. For example, when centring a text object we might want to have it stretch across the whole width of the display even if the text itself does not need that much space. Create a new 'dimensions' field and convert the existing width/height into x1/y1 coordinates. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Use an abuf to hold stringsSimon Glass
It is more convenient to put strings in an abuf so they can easily be resized. Adjust the struct accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Rename x and y in struct scene_obj_bboxSimon Glass
These coordinates are the top left values, so rename them to x0 and y0 in preparation for changing the width and height to x1 and y1 Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Rename scene_dim to scene_obj_bboxSimon Glass
At present we assume that each object is a simple box and that it fills the whole box. This is quite limiting for text objects, which we may want to centre within the box. We need a position within the box where drawing starts. Rename the scene_dim struct to indicate that it is a bounding box. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Allow adding a single bootflow to a menuSimon Glass
Refactor bootflow_menu_add_all() to call a new bootflow_menu_add() to add each of its bootflows. Move the last_bootdev value into struct menu_priv to make this work. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Split bootflow_menu_new() into two piecesSimon Glass
Split the iteration piece of this function into bootflow_menu_add_all() so that it is possible for the caller to be in control of adding items to the menu. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Split bootflow_menu_run() into two piecesSimon Glass
Split the starting piece of this function into bootflow_menu_start() and the polling part into bootflow_menu_poll() so that it is possible for the caller to be in control of the event loop. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Test editing a lineeditSimon Glass
Open the lineedit and add a few characters, to check that things look right. At present when the user moves to a new menu item, the menu code handles this immediately. This means it is not possible to use an expo action to effect the same change. Update this so that EXPOACT_POINT_ITEM is handled in cedit_do_action(). Expand the test to cover this. Signed-off-by: Simon Glass <sjg@chromium.org>