summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_msm_geni.c
AgeCommit message (Collapse)Author
2026-03-24serial: msm-geni: allow invalid clockCasey Connolly
Pre-relocation we may not have a clock but it's usually been enabled for us already, or worst case we will enable it after relocation. Erroring out in this case will almost always cause U-Boot to hang pre-relocation which is undesirable and may be hard to debug. Link: https://patch.msgid.link/20260320-casey-qcom-rpmh-serial-fixes-v1-1-b81d05832eec@linaro.org Signed-off-by: Casey Connolly <[email protected]>
2025-10-30serial: msm-geni: implement firmware loadingCasey Connolly
Teach the GENI UART driver to load firmware, similar to i2c. This is primarily intended for non-debug UARTs, but since we don't support using these as the console we abort probe for now. Remove duplicated register macros that are in the common geni-se header. Signed-off-by: Casey Connolly <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-10-30serial: msm-geni: Enable SE clk in probeStephen Boyd
Enable the serial engine clk in probe so that this driver can work on platforms that don't already initialize the clk for this device before this driver runs. This fixes a problem I see on Coreboot platforms like Trogdor where the UART hardware isn't enabled by coreboot unless the serial console build is used. Signed-off-by: Stephen Boyd <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-10-30misc: introduce Qcom GENI wrapperCasey Connolly
Qualcomm peripherals like UART, SPI, I2C, etc are all exposed under a common GENI Serial Engine wrapper device. Replace the stub driver we use for this currently with a full-on misc device and implement support for loading peripheral firmware. Each of the peripherals has it's own protocol-specific firmware, this is stored on the internal storage of the device with a well-known partition type GUID. To support this, GENI will bind peripherals in two stages. First the ones that already have firmware loaded (such as the serial port) are bound in the typical way. But devices that require firmware loading are deferred until EVT_LAST_STAGE_INIT. At this point we can be sure that the storage device is available, so we load the firmware and then bind and probe the remaining children. Child devices are expected to determine if firmware loading is necessary and call qcom_geni_load_firmware(). Since Linux currently doesn't support loading firmware (and firmware may not be available), we probe all GENI peripherals to ensure that they always load firmware if necessary. Signed-off-by: Casey Connolly <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13serial: msm-geni: No need to NULL check privAndrew Goodbody
The NULL check for priv in qcom_geni_serial_poll_bit serves no useful prupose as too much other code surrounding it relies on priv being valid. Remove the NULL check for priv and other related code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13serial: msm-geni: Detect error from get_clk_div_rateAndrew Goodbody
In msm_serial_setbrg if the call to get_clk_div_rate fails then there will not have been an assignment to clk_div which will lead to the call to geni_serial_baud using an uninitialised value. Check for an error from get_clk_div_rate and return an error code if so. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07serial: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Peter Robinson <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-04-04serial: msm-geni: support livetreeCaleb Connolly
When using OF_LIVE, the debug UART driver won't be probed if it's a subnode of the geni-se-qup controller. Add a NOP driver for the controller to correctly discover its child nodes. Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-04-04mach-snapdragon: disable power-domains for pre-reloc driversCaleb Connolly
Some devices like the UART and clock controller reference an RPM(h) power domain. We don't support this device in U-Boot, so add DM_FLAG_DEFAULT_PD_CTRL_OFF to tell DM core not to try and enable the power domain. Reviewed-by: Sumit Garg <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-01-16serial: msm-geni: handle devm_clk_get() errorsCaleb Connolly
devm_clk_get() returns an ERR_PTR on failure, not null. Fix the check to avoid the board crashing when the clock isn't available. Additionally, add the missing error handling for this function. Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver") Signed-off-by: Caleb Connolly <[email protected]>
2024-01-16serial: msm-geni: don't rely on parent misc deviceCaleb Connolly
commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver") introduced support for platform-specific oversampling values, necessary to configure the UART clocks on all platforms at runtime. However it relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag, this is not done consistently during boot. Instead, take another approach by relying on ofnode_ helpers to read the serial engine base address and do the read directly. This fixes early UART on boards with a non-default oversampling rate. Signed-off-by: Caleb Connolly <[email protected]>
2023-11-16treewide: use linux/time.h for time conversion definesIgor 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 <[email protected]> Reviewed-by: Svyatoslav Ryhel <[email protected]> # tegra Reviewed-by: Eugen Hristev <[email protected]> #at91 Reviewed-by: Caleb Connolly <[email protected]> #qcom geni Reviewed-by: Stefan Bosch <[email protected]> #nanopi2 Reviewed-by: Patrice Chotard <[email protected]>
2023-05-02serial: msm-geni: correct oversampling value based on QUP hardware revisionVladimir Zapolskiy
Starting from QUP v2.5 the value of oversampling is changed from 32 to 16, keeping the old value on newer platforms results on wrong set UART IP clock divider, thus the asked baudrate does not correspond to the actually set with all the consequencies for a user. The change links the driver to a new Qualcomm GENI SE QUP driver to get its hardware version and update the oversampling value. Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched, since a wanted baudrate can be controlled by setting a modified CONFIG_DEBUG_UART_CLOCK build time variable. Signed-off-by: Vladimir Zapolskiy <[email protected]>
2023-05-02serial: msm-geni: Use upstream Linux bindingsKonrad Dybcio
The name "se" is used in upstream Linux device trees and has been for ages, long before this U-Boot-ism was introduced. Same goes for the existing compatible. Get rid of that. [vzapolskiy: removed a ready change in the driver] Signed-off-by: Konrad Dybcio <[email protected]> Signed-off-by: Vladimir Zapolskiy <[email protected]>
2023-05-02serial: msm-geni: fix a compile time warning from msm_serial_setbrg()Vladimir Zapolskiy
A compiler warns about a missing function prototype, which is valid and fixed by converting the function into static one, also fix interleaved local variable declarations and assignments. Signed-off-by: Vladimir Zapolskiy <[email protected]> Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver") Reviewed-by: Konrad Dybcio <[email protected]>
2023-05-02serial: msm-geni: fix code indentationVladimir Zapolskiy
This a cosmetic change, which corrects code indentation in a few places. Signed-off-by: Vladimir Zapolskiy <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]>
2023-05-02serial: msm-geni: remove invalid se-clk clock nameVladimir Zapolskiy
There is only one clock supplier to the serial IP, thus getting it by name is not needed, also note that "clock-names" property is not listed under doc/device-tree-bindings/serial/msm-geni-serial.txt, and finally "se-clk" clock name is invalid, if added, it shall get "se" value like it's already described in Linux device tree documentation. Signed-off-by: Vladimir Zapolskiy <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]>
2023-05-02serial: msm-geni: Always bind before relocationKonrad Dybcio
In preparation for supporting upstream Linux device trees on Qualcomm platforms, make this the default behavior. [vzapolskiy: extracted the driver change from a combination with dts changes] Signed-off-by: Konrad Dybcio <[email protected]> Signed-off-by: Vladimir Zapolskiy <[email protected]>
2023-05-02serial: msm-geni: remove redundant includesVladimir Zapolskiy
For whatever reason, likely a driver stub was copied from another driver, the driver contains a bunch of unnecessary and confusing includes like watchdog.h etc., the change reduces the list. Signed-off-by: Vladimir Zapolskiy <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]>
2022-06-06serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE)Pali Rohár
CONFIG_VAL(DEBUG_UART_BASE) expands to CONFIG_DEBUG_UART_BASE or CONFIG_SPL_DEBUG_UART_BASE or CONFIG_TPL_DEBUG_UART_BASE and allows boards to set different values for SPL, TPL and U-Boot Proper. For ns16550 driver this support is there since commit d293759d55cc ("serial: ns16550: Add support for SPL_DEBUG_UART_BASE"). Signed-off-by: Pali Rohár <[email protected]>
2021-10-31serial: qcom: add support for GENI serial driverDzmitry Sankouski
Generic Interface (GENI) Serial Engine (SE) based uart can be found on newer qualcomm SOCs, starting from SDM845. Tested on Samsung SM-G9600(starqltechn) by chain-loading u-boot with stock bootloader. Signed-off-by: Dzmitry Sankouski <[email protected]> Cc: Ramon Fried <[email protected]> Cc: Tom Rini <[email protected]>