summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2023-04-27ide: Correct LBA settingSimon Glass
Fix a longstanding bug where the LBA is calculated as the size of the media instead of the number of blocks. This was perhaps not noticed earlier since it prints the correct value first, before setting the wrong value. Drop the unnecessary blksz variable while we are here. Signed-off-by: Simon Glass <[email protected]> Fixes: 68e6f221ed0 ("block: ide: Fix block read/write with driver model")
2023-04-27ide: Use a single local blk_desc for ide_ident()Simon Glass
We only use one member of the ide_dev_desc[] array at a time and it does not stick around outside ide_probe(). Use a single element instead. Copy over the missing members of blk_desc at the same, since this was missing from the previous code. Signed-off-by: Simon Glass <[email protected]> Fixes: 68e6f221ed0 ("block: ide: Fix block read/write with driver model")
2023-04-27ide: Move all blk_desc init into ide_ident()Simon Glass
Rather than having the caller fill some of this in, do it all in the ide_ident() function, since it knows all the values. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Make ide_ident() return an error codeSimon Glass
Update ide_ident() to indicate whether it finds a device or not. Use that to decide whether to create a block device for it, rather than looking DEV_TYPE_UNKNOWN. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Use desc consistently for struct blk_descSimon Glass
Most of the code uses 'desc' as the variable name for a blk descriptor. Change ide to do the same. Tidy up some extra brackets and types while we are here. Leave the code in ide_probe() alone since it is about to be refactored. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Combine the two loops in ide_probe()Simon Glass
The two loops in this function operate on the same ide_dev_desc[] array. Combine them to reduce duplication. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Move ide_init() entirely within ide_probe()Simon Glass
Now that ide_probe() is the only caller of ide_init(), move all the code into the probe function, so it is easier to refactor it. Move ide_dev_desc[] into ide_probe() to, since it is the only user. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Move setting of vendor strings into ide_probe()Simon Glass
The current implementation adds this information in the block device's probe() function, which is called in the blk_probe_or_unbind() in ide_probe(). It is simpler to do this in ide_probe() itself, since the effect is the same. This helps to consolidate use of ide_dev_desc[] which we would like to remove. Use strlcpy() to keep checkpatch happy. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Make ide_bus_ok a local variableSimon Glass
This is only used in one place now, so make it a local variable. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Move bus init into a functionSimon Glass
Move this code into a separate function which returns whether the bus was found, or not. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Avoid preprocessor for CONFIG_LBA48Simon Glass
Use IS_ENABLED() instead for all conditions. Add the 'lba48' flag into struct blk_desc always, since it uses very little space. Use a bool so the meaning is clearer. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-04-27ide: Avoid preprocessor for CONFIG_ATAPISimon Glass
Use IS_ENABLED() instead for all conditions. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Simplify success conditionSimon Glass
Change the if() to remove extra brackets and check for the positive case first, i.e. when a device is found. Exit the loop in that case, with the retry logic in the 'else' part. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Refactor confusing loop codeSimon Glass
This code is hard to follow as it uses #ifdef in a strange way. Adjust it to avoid the preprocessor. Drop the special return for the non-ATAPI case since we can rely on tries becoming 0 and exiting the loop. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Change the retries variableSimon Glass
Use a 'tries' variable which starts at the number of tries we want to do, rather than a 'retries' one that stops at either 1 or 2. This will make it easier to refactor the code to avoid the horrible #ifdefs Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Make function staticSimon Glass
Only one function is called from outside this file. Make all the others static. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Correct use of ATAPISimon Glass
The use of atapi_read() was incorrect dropped. Fix this so that it will be used when needed. Use a udevice for the first argument of atapi_read() so it is consistent with ide_read(). This requires much of the ATAPI code to be brought out from behind the existing #ifdef. It will still be removed by the compiler if it is not needed. Add an atapi flag to struct blk_desc so the information can be retained. Fixes: 145df842b44 ("dm: ide: Add support for driver-model block devices") Fixes: d0075059e4d ("ide: Drop non-DM code for BLK") Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Create a prototype for ide_set_reset()Simon Glass
This is used by a board so should be in the header file. Add it. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Drop weak functionsSimon Glass
These are not used from outside this file anymore. Make them static and remove them from the header file. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Move a few functions further up the fileSimon Glass
Move these functions so they appear before they are used. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Drop ide_device_present()Simon Glass
This function is not used anymore. Drop it. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Move ide_init() into probingSimon Glass
At present the code does ide_init() as a separate operation, then calls device_probe() to copy over the information. We can call ide_init() from probe just as easily. The only difference is that using 'ide init' twice will do nothing. However it already fails to copy over the new data in that case, so the effect is the same. For now, unbind the block devices and remove the IDE device, which causes the bus to be probed again. Later patches will fix this up fully, so that all blk_desc data is copied across. Since ide_reset() is only called from ide_init(), there is no need to init the ide_dev_desc[] array. This is already done at the end of ide_init() so drop this code. The call to uclass_first_device() is now within the probe() function of the same device, so does nothing. Drop it. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Use mdelay() for long delaysSimon Glass
Rather than using very large numbers with udelay(), use mdelay(), which is easier to follow. Signed-off-by: Simon Glass <[email protected]>
2023-04-27ide: Move ATA_CURR_BASE to C fileSimon Glass
This is not used outside one C file. Move it out of the header to reduce its visbility. Signed-off-by: Simon Glass <[email protected]>
2023-04-26virtio: Ensure PCI is set up firstSimon Glass
Sometimes virtio may rely on PCI, or at least that is what the distro_bootcmd script suggests. Add this in. Signed-off-by: Simon Glass <[email protected]>
2023-04-26spi: cadence-quadspi: Reset CMD_CTRL Reg on cmd r/w completionDhruva Gole
If one leaves the CQSPI_REG_CMDCTRL in an unclean state this may cause issues in future command reads. This issue came to light when some flash reads in STIG mode were coming back dirty. Co-developed-by: Apurva Nandan <[email protected]> Signed-off-by: Apurva Nandan <[email protected]> Signed-off-by: Dhruva Gole <[email protected]> Acked-by: Jagan Teki <[email protected]>
2023-04-26spi: cadence-quadspi: Use STIG mode for all ops with small payloadApurva Nandan
OSPI controller supports all types of op variants in STIG mode, only limitation being that the data payload should be less than 8 bytes when not using memory banks. STIG mode is more stable for operations that send small data payload and is more efficient than using DMA for few bytes of memory accesses. It overcomes the limitation of minimum 4 bytes read from flash into RAM seen in DAC mode. Use STIG mode for all read and write operations that require data input/output of less than 8 bytes from the flash, and thereby support all four phases, cmd/address/dummy/data, through OSPI STIG. Also, remove the reorder address chunk in apb_command_write since we now setup ADDR BIT field that does the same job in a cleaner way. Signed-off-by: Apurva Nandan <[email protected]> Signed-off-by: Dhruva Gole <[email protected]> Acked-by: Jagan Teki <[email protected]>
2023-04-26spi: cadence-quadspi: Fix check condition for DTR opsApurva Nandan
buswidth and dtr fields in spi_mem_op are only valid when the corresponding spi_mem_op phase has a non-zero length. For example, SPI NAND core doesn't set buswidth when using SPI_MEM_OP_NO_ADDR phase. Fix the dtr checks in set_protocol() to ignore empty spi_mem_op phases, as checking for dtr field in empty phase will result in false negatives. Signed-off-by: Apurva Nandan <[email protected]> Signed-off-by: Dhruva Gole <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-26mtd: spi-nor-core: Add fixups for s25fs512sTakahiro Kuwano
This patch adds fixups for s25fs512s to address the following issues from reading SFDP: - Non-uniform sectors by factory default. The setting needs to be checked and assign erase hook as needed. - Page size is wrongly advertised in SFDP. - READ_1_1_2 (3Bh/3Ch), READ_1_1_4 (6Bh/6Ch), and PP_1_1_4 (32h/34h) are not supported. - Bank Address Register (BAR) is not supported. In addition, volatile version of Quad Enable is used for safety. Based on patch by Takahiro Kuwano with s25fs_s_post_bfpt_fixup() updated to use 4-byte address commands instead of extended address mode and the page_size is fixed to 256 For future use, manufacturer code should be moved out from framework code as same as in Linux. Reviewed-by: Marek Vasut <[email protected]> Signed-off-by: Takahiro Kuwano <[email protected]> Signed-off-by: Hai Pham <[email protected]> Signed-off-by: Cong Dang <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-26video: panel: add generic endeavoru panelSvyatoslav Ryhel
Family of panels used by HTC in One X. Though were used variants at least from 3 vendors, this driver provides generic support for all of them. Tested-by: Ion Agorria <[email protected]> # HTC One X T30 Sony Tested-by: Svyatoslav Ryhel <[email protected]> # HTC One X T30 Sharp Signed-off-by: Svyatoslav Ryhel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-26video: tegra: add DC based PWM backlight driverSvyatoslav Ryhel
DC based PWM backlight is found on some T20 and T30 devices (HTC One X). This backlight is controlled by Tegra DC and is adjustable by the DC PM0 or PM1 signal. Tested-by: Andreas Westman Dorcsak <[email protected]> # HTC One X T30 Tested-by: Svyatoslav Ryhel <[email protected]> # HTC One X T30 Signed-off-by: Svyatoslav Ryhel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-26video: panel: add Renesas R69328 MIPI DSI panel driverSvyatoslav Ryhel
Driver adds support for panels with Renesas R69328 IC Currently supported compatible is: - jdi,dx12d100vm0eaa Tested-by: Andreas Westman Dorcsak <[email protected]> # LG P880 T30 Tested-by: Svyatoslav Ryhel <[email protected]> # LG P895 T30 Signed-off-by: Svyatoslav Ryhel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-26video: panel: add Renesas R61307 MIPI DSI panel driverSvyatoslav Ryhel
R61307 is liquid crystal driver for high-definition amorphous silicon (a-Si) panels and is ideal for tablets and smartphones. Supported compatibles are: - koe,tx13d100vm0eaa - hitachi,tx13d100vm0eaa Tested-by: Andreas Westman Dorcsak <[email protected]> # LG P880 T30 Tested-by: Svyatoslav Ryhel <[email protected]> # LG P895 T30 Signed-off-by: Svyatoslav Ryhel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-26video: bridge: add Solomon SSD2825 DSI/LVDS driverSvyatoslav Ryhel
SSD2825 is an innovative and cost-effective MIPI Bridge Chip solution targeting high resolution smartphones. It can convert 24bit RGB interface into 4-lane MIPI-DSI interface to drive extremely high resolution display modules of up to 800 x 1366, while supporting AMOLED, a-si LCD or LTPS advanced panel technologies for smartphone applications. Bridge is wrapped in panel uClass model for wider compatibility. Tested-by: Andreas Westman Dorcsak <[email protected]> # LG P880 T30 Tested-by: Svyatoslav Ryhel <[email protected]> # LG P895 T30 Signed-off-by: Svyatoslav Ryhel <[email protected]>
2023-04-26video: add lm3533 backlight driverSvyatoslav Ryhel
This is basic lm3533 driver only with bank A and backlight cell support. Tested-by: Andreas Westman Dorcsak <[email protected]> # LG P880 T30 Tested-by: Svyatoslav Ryhel <[email protected]> # LG P895 T30 Signed-off-by: Svyatoslav Ryhel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-25gpio-uclass: fix off-by-one in gpio_request_list_by_name_nodev()Rasmus Villemoes
By the time we jump to the err label, count represents the number of gpios we've successfully requested. So by subtracting one, we fail to free the most recently requested. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-25xen: Limit execution to EL1 onlyMichal Simek
Xen core_init() is calling HVC which should be called from EL1 level that's why do Xen initialization only when U-Boot runs in EL1. Signed-off-by: Michal Simek <[email protected]>
2023-04-25ata: pci: enable bus masteringChristian Gmeiner
The non DM code path already would enable pci bus mastering. Do the same for the DM code path. Fixes AHCI problems I am seeing on an Intel Apollolake device. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Bin Meng <[email protected]> [trini: Use ahci_dev not dev in the calls] Signed-off-by: Tom Rini <[email protected]>
2023-04-25sysreset: psci: add psci_sysreset_get_statusPeng Fan
Add weak function psci_sysreset_get_status for platform to define their own reset status with CONFIG_SYSRESET enabled. Signed-off-by: Peng Fan <[email protected]>
2023-04-25sysreset: psci: enable DM_FLAG_PRE_RELOCPeng Fan
It is possible that cpu core may reset before relocation with PSCI reset Signed-off-by: Peng Fan <[email protected]>
2023-04-25firmware: psci: enable DM_FLAG_PRE_RELOCPeng Fan
It is possible that cpu core may reset before relocation with PSCI reset Signed-off-by: Peng Fan <[email protected]>
2023-04-25xen: Fix Kconfig dependenciesMichal Simek
XEN config can be enabled by other platforms (even it doesn't need to make sense) that's why fix dependencies. XEN (xenbus.c) requires sscanf (also pvblock needs it). And PVBLOCK is inside drivers/xen folder which requires XEN to be enabled. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2023-04-25usb: gadget: f_mass_storage: Rework do_request_sense slightlyTom Rini
When building with clang, it notes that sdinfo may be unused uninitialized in some cases. This appears to be true from reading the code, and we can simply set the variable to zero to start with and be as correct as before. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2023-04-25soc: soc_ti_k3: fix revision array bounds checksRasmus Villemoes
If rev is equal to the array size, we'll access the array one-past-the-end. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Bryan Brattlof <[email protected]>
2023-04-25spi: synquacer: Silence uninitialized variable warningsIlias Apalodimas
When building with clang, the compiler compains with drivers/spi/spi-synquacer.c:212:11: warning: variable 'bus_width' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] else if (priv->mode & SPI_TX_OCTAL) ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/spi/spi-synquacer.c:276:11: note: uninitialized use occurs here val |= ((bus_width >> 1) << BUS_WIDTH); ^~~~~~~~~ drivers/spi/spi-synquacer.c:212:7: note: remove the 'if' if its condition is always true else if (priv->mode & SPI_TX_OCTAL) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/spi/spi-synquacer.c:189:25: note: initialize the variable 'bus_width' to silence this warning So initialize bus_width to 1 and add a warning if none of the configured modes matches Signed-off-by: Ilias Apalodimas <[email protected]> Acked-by: Jassi Brar <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-25mtd: spi-nor: missing fallthrough in set_4byte()Heinrich Schuchardt
Add a missing fallthrough macro to avoid a -Wimplicit-fallthrough warning. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-25spi: npcm-fiu: add regulator feature and remove set clockJim Liu
NPCM7xx/NPCM8xx default is boot from flash. removed set clock feature due to reliability and security. the clock will set by bootblock or tip. Signed-off-by: Jim Liu <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-25spi: f-ospi: Add missing spi_mem_default_supports_op() helperKunihiko Hayashi
The .supports_op() callback function returns true by default after performing driver-specific checks. Therefore the driver cannot apply the buswidth in devicetree. Call spi_mem_default_supports_op() helper to handle the buswidth in devicetree. Fixes: 358f803ae21c ("spi: Add Socionext F_OSPI SPI flash controller driver") Signed-off-by: Kunihiko Hayashi <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-25spi: spi-mem: perform odd len check only while writing dataDhruva Gole
in spi_mem_dtr_supports_op we have a check for allowing only even number of bytes to be r/w. Odd bytes writing can be a concern while writing data to a flash for example because 8 DTR mode doesn't support it. However, reading ODD Bytes even though may not be physically possible we can still allow for it because it will not have serious implications on any critical registers being overwritten since they are just reads. Cc: Vaishnav Achath <[email protected]> Cc: Pratyush Yadav <[email protected]> Cc: Vignesh Raghavendra <[email protected]> Tested-by: Nikhil M Jain <[email protected]> Signed-off-by: Dhruva Gole <[email protected]> Reviewed-by: Jagan Teki <[email protected]>
2023-04-25spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op()Dhruva Gole
This should have been op->data.buswidth instead as we check for octal bus width for the data related ops Also add explanation for why there is checks for 8D even data bytes Cc: Pratyush Yadav <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Tested-by: Nikhil M Jain <[email protected]> Signed-off-by: Dhruva Gole <[email protected]> Reviewed-by: Jagan Teki <[email protected]>