| #
9689b7dd |
| 14-Dec-2020 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
UPSTREAM: spi: spi-uclass: Fix spi_claim_bus() speed/mode setup logic
Currently, when different spi slaves claim the bus consecutively using spi_claim_bus(), spi_set_speed_mode() will only be execut
UPSTREAM: spi: spi-uclass: Fix spi_claim_bus() speed/mode setup logic
Currently, when different spi slaves claim the bus consecutively using spi_claim_bus(), spi_set_speed_mode() will only be executed on the first two calls, leaving the bus in a bad state starting with the third call.
This patch drops spi_slave->speed member and adds caching of bus speed/mode in dm_spi_bus struct. It also updates spi_claim_bus() to call spi_set_speed_mode() if either speed or mode is different from what the bus is currently configured for. Current behavior is to only take into account the speed, but not the mode, which seems wrong.
Fixes: 60e2809a848 ("dm: spi: Avoid setting the speed with every transfer") Reviewed-by: Simon Glass <sjg@chromium.org> Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reported-by: Moshe, Yaniv <yanivmo@amazon.com> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> (cherry picked from commit 741280e9accd3da20650a04f716538944d878482) Change-Id: I29912ceaf1e252fe6f124aea69190ef5e6160119 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
show more ...
|
| #
86348c7b |
| 14-Sep-2020 |
Faiz Abbas <faiz_abbas@ti.com> |
UPSTREAM: spi: spi-uclass: Block dm_scan_fdt_dev with OF_CONTROL to prevent build failures
There are devices which don't use OF_CONTROL or OF_PLATDATA but instead rely on statically defined platdata
UPSTREAM: spi: spi-uclass: Block dm_scan_fdt_dev with OF_CONTROL to prevent build failures
There are devices which don't use OF_CONTROL or OF_PLATDATA but instead rely on statically defined platdata. Block dm_scan_fdt_dev() with both configs to avoid build failures under this condition.
Change-Id: Ie3e5ff4c6174d995e8108b018fe35784313ff4c6 Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 280af011563574844fa3c20acd2cbbd7ee669da8)
show more ...
|
| #
305d7e6e |
| 05-Dec-2019 |
Vignesh Raghavendra <vigneshr@ti.com> |
UPSTREAM: mtd: spi-nor-core: Add octal mode support
Add support for Octal flash devices. Octal flash devices use 8 IO lines for data transfer. Currently only 1-1-8 Octal Read mode is supported.
Sig
UPSTREAM: mtd: spi-nor-core: Add octal mode support
Add support for Octal flash devices. Octal flash devices use 8 IO lines for data transfer. Currently only 1-1-8 Octal Read mode is supported.
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> (cherry picked from commit 658df8bd946493e7fa7b0048a3a9bd658a1f4518) Change-Id: I1fabb494a963ceccb873c8a04fc3241eddd65069 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
show more ...
|
| #
0962b023 |
| 21-Nov-2019 |
Marcin Wojtas <mw@semihalf.com> |
UPSTREAM: spi: prevent overriding established bus settings
The SPI stack relies on a proper bus speed/mode configuration by calling dm_spi_claim_bus(). However the hitherto code allowed to accidenta
UPSTREAM: spi: prevent overriding established bus settings
The SPI stack relies on a proper bus speed/mode configuration by calling dm_spi_claim_bus(). However the hitherto code allowed to accidentally override those settings in the spi_get_bus_and_cs() routine.
The initially established speed could be discarded by using the slave platdata, which turned out to be an issue on the platforms whose slave maximum supported frequency is not on par with the maximum frequency of the bus controller.
This patch fixes above issue by configuring the bus from spi_get_bus_and_cs() only in case it was not done before.
Change-Id: I7b8268046ae5e086de8dd456a5e13ba8b7dc0f5c Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit f7dd5370986087af9b9cfa601f34b344ec910b87)
show more ...
|
| #
5a1c4376 |
| 09-Sep-2019 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: spi: Check cs number before accessing slaves
Add chip select number check in spi_find_chip_select().
Change-Id: I13f3ec8f3f7e881e41a57638e6ae70ee4d0b82d5 Signed-off-by: Bin Meng <bmen
UPSTREAM: dm: spi: Check cs number before accessing slaves
Add chip select number check in spi_find_chip_select().
Change-Id: I13f3ec8f3f7e881e41a57638e6ae70ee4d0b82d5 Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # SoPine Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 7bacce524d48594dae399f9ee9280ab105f6c8cf)
show more ...
|
| #
2c7db7c3 |
| 17-Sep-2019 |
Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> |
UPSTREAM: spi: Fix manual relocation calling more times
When two instances of AXI QSPI with flash are added and tested simultaneously the spi driver operations are relocated twice. As a result code
UPSTREAM: spi: Fix manual relocation calling more times
When two instances of AXI QSPI with flash are added and tested simultaneously the spi driver operations are relocated twice. As a result code is accessing addresses outside of RAM when relocated second time which is causing a crash.
Tested on Microblaze.
Similar change was done in past by: commit f238b3f0fbc9 ("watchdog: dm: Support manual relocation for watchdogs") commit 2588f2ddfd60 ("dm: sf: Add support for all targets which requires MANUAL_RELOC") commit 1b4c2aa25bdf ("gpio: dm: Support manual relocation for gpio")
Change-Id: Ic807bfcd2703807e91a8d633d8bfb198d3e41266 Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 4d9b1afa415ddf998f6f40283f95770106cef35b)
show more ...
|
| #
f75b9e50 |
| 07-Dec-2019 |
Simon Glass <sjg@chromium.org> |
UPSTREAM: spi: Correct operations check in dm_spi_xfer()
At present we have to have an xfer() method even if it does nothing. This is not correct, so fix it.
Signed-off-by: Simon Glass <sjg@chromiu
UPSTREAM: spi: Correct operations check in dm_spi_xfer()
At present we have to have an xfer() method even if it does nothing. This is not correct, so fix it.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> (cherry picked from commit ccdabd8956936319c5f7112bf5774e839b085874) Change-Id: I49ef01fa907e48e09850364a400c9451783c8056 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
show more ...
|
| #
7ac3b0ed |
| 21-Oct-2019 |
Simon Glass <sjg@chromium.org> |
UPSTREAM: spi: Add support for memory-mapped flash
On x86 platforms the SPI flash can be mapped into memory so that the contents can be read with normal memory accesses.
Add a new SPI method to fin
UPSTREAM: spi: Add support for memory-mapped flash
On x86 platforms the SPI flash can be mapped into memory so that the contents can be read with normal memory accesses.
Add a new SPI method to find the location of the SPI flash in memory. This differs from the existing device-tree "memory-map" mechanism in that the location can be discovered at run-time.
Change-Id: Ia736a9119159bad4770073f19a8862e0ea2610e9 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit c53b318e1bad2e0d5c2b846fadfc79ec77bfc5f7)
show more ...
|
| #
5a712789 |
| 09-Sep-2019 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: spi: Return 0 if driver does not implement ops->cs_info
If an SPI controller driver does not implement ops->cs_info, that probably means any chip select number could be valid, hence le
UPSTREAM: dm: spi: Return 0 if driver does not implement ops->cs_info
If an SPI controller driver does not implement ops->cs_info, that probably means any chip select number could be valid, hence let's return 0 for spi_cs_info().
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # SoPine Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> (cherry picked from commit 4dd520b36bce9b35f7a12f3ffd9a95269d425170) Change-Id: Ie27710ff4328fc6aad4a0ed0f1b29b2aba62fca1 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
show more ...
|
| #
0e760d45 |
| 06-Sep-2019 |
Thomas Fitzsimmons <fitzsim@fitzsim.org> |
UPSTREAM: dm: spi: Do not assume first SPI bus
When CONFIG_OF_PRIOR_STAGE is enabled, this workaround was needed before device_bind_common assigned request numbers sequentially in the absence of ali
UPSTREAM: dm: spi: Do not assume first SPI bus
When CONFIG_OF_PRIOR_STAGE is enabled, this workaround was needed before device_bind_common assigned request numbers sequentially in the absence of aliases.
Change-Id: I89742a27b4f7ba1d844cab528ea7c590bff278d1 Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 640abba50763b215317468062a5e1b867ae57a76)
show more ...
|
| #
a3171fa3 |
| 22-Jul-2019 |
Jagan Teki <jagan@amarulasolutions.com> |
UPSTREAM: spi: Add spi_write_then_read
Add support for SPI synchronous write followed by read, this is common interface call from spi-nor to spi drivers.
Reviewed-by: Simon Glass <sjg@chromium.org>
UPSTREAM: spi: Add spi_write_then_read
Add support for SPI synchronous write followed by read, this is common interface call from spi-nor to spi drivers.
Reviewed-by: Simon Glass <sjg@chromium.org> Change-Id: Id064c8a2703d409ca64399cef498f4c768e26ac0 Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Adam Ford <aford173@gmail.com> #da850-evm Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 8473b32127232d8b602d905a2ed26ed48d352f6e)
show more ...
|
| #
448ceaf5 |
| 30-Oct-2018 |
Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> |
UPSTREAM: dm: spi: prevent setting a speed of 0 Hz
When the device tree is missing a correct spi slave description below the bus (compatible "spi-flash" or spi-max-frequency are missing), the 'set_s
UPSTREAM: dm: spi: prevent setting a speed of 0 Hz
When the device tree is missing a correct spi slave description below the bus (compatible "spi-flash" or spi-max-frequency are missing), the 'set_speed' callback can be called with 'speed' == 0 Hz. At least with cadence qspi, this leads to a division by zero.
Prevent this by initializing speed to 100 kHz in this case (same fallback value as is done in 'dm_spi_claim_bus') and issue a warning to console.
Change-Id: Ie9e619fd2fe894be6b3043a6a8843ac8c621d6c0 Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 12bfb2e05fc29bfbec7eb76ea8cc02e130268801)
show more ...
|
| #
f36ea2f6 |
| 08-Jun-2018 |
Thomas Fitzsimmons <fitzsim@fitzsim.org> |
UPSTREAM: board: arm: Add support for Broadcom BCM7445
Add support for loading U-Boot on the Broadcom 7445 SoC. This port assumes Broadcom's BOLT bootloader is acting as the second stage bootloader
UPSTREAM: board: arm: Add support for Broadcom BCM7445
Add support for loading U-Boot on the Broadcom 7445 SoC. This port assumes Broadcom's BOLT bootloader is acting as the second stage bootloader, and U-Boot is acting as the third stage bootloader, loaded as an ELF program by BOLT.
Change-Id: I79d19ced6ed7c76a862b94162a92ceaddf09b062 Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 894c3ad27fa940beb7fdc07d01dcfe81c03d0481)
show more ...
|
| #
8849a3be |
| 15-Jan-2018 |
Mario Six <mario.six@gdsys.cc> |
UPSTREAM: spi: spi-uclass: Fix style violations
Remove a superfluous newline, and reduce the scope of a variable.
Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev
UPSTREAM: spi: spi-uclass: Fix style violations
Remove a superfluous newline, and reduce the scope of a variable.
Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com> Change-Id: I8916ae85b0339d29d7b50382182a263848e21a39 Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 24fc1ec2ee71cd852e556f90bd352cc809ddeef9)
show more ...
|
| #
e806bc1c |
| 15-Jan-2018 |
Mario Six <mario.six@gdsys.cc> |
UPSTREAM: spi: Remove spi_setup_slave_fdt
A previous patch removed the spi_flash_probe_fdt function, which contained the last call of the spi_setup_slave_fdt function, which is now equally obsolete.
UPSTREAM: spi: Remove spi_setup_slave_fdt
A previous patch removed the spi_flash_probe_fdt function, which contained the last call of the spi_setup_slave_fdt function, which is now equally obsolete.
This patch removes the function.
Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com> Change-Id: I0836438bec6597bb99038997ae6a549d647f1666 Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 184fa1c8da54d3c5305b3e1975e284e01de68bea)
show more ...
|
| #
ee9b3572 |
| 27-Feb-2019 |
Patrick Delaunay <patrick.delaunay@st.com> |
UPSTREAM: dm: spi: Read default speed and mode values from DT
This patch update the behavior introduced by commit 96907c0fe50a ("dm: spi: Read default speed and mode values from DT")
In case of DT
UPSTREAM: dm: spi: Read default speed and mode values from DT
This patch update the behavior introduced by commit 96907c0fe50a ("dm: spi: Read default speed and mode values from DT")
In case of DT boot, don't read default speed and mode for SPI from CONFIG_* but instead read from DT node. This will make sure that boards with multiple SPI/QSPI controllers can be probed at different bus frequencies and SPI modes.
Remove also use in boards of the value speed=0 (no more supported) for ENV in SPI by using CONFIG_ENV_SPI_MAX_HZ=0.
DT values will be always used when available (full DM support of SPI slave with available DT node) even if speed and mode are requested; for example in splash screen support (in splash_sf_read_raw) or in SPL boot (in spl_spi_load_image). The caller of spi_get_bus_and_cs() no more need to force speed=0.
But the current behavior don't change if the SPI slave is not present (device with generic driver is created automatically) or if platdata is used (CONFIG_OF_PLATDATA).
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com> Change-Id: I6f5990b73f33815a7acb9b5da9c90dce48b6211d Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit b0cc1b846fcb310c0ac2f8cbeb4ed5947dc52912)
show more ...
|
| #
519ddfff |
| 01-Oct-2018 |
Simon Glass <sjg@chromium.org> |
UPSTREAM: dm: spi: Add logging of some return values
When SPI flash operations fail it is helpful to be able to see the error codes and where they are generated. Add logging to capture this informat
UPSTREAM: dm: spi: Add logging of some return values
When SPI flash operations fail it is helpful to be able to see the error codes and where they are generated. Add logging to capture this information for read operations.
Change-Id: I58270e564a558fbaf9ae2c5b0d888d3af842e09c Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 5e24a2ef8bf4f09b18cf4e943c73bfdd169a7581)
show more ...
|
| #
279e26f5 |
| 19-May-2017 |
Simon Glass <sjg@chromium.org> |
dm: spi: Convert uclass to livetree
Update the SPI uclass to support a live device tree. Also adjust spi_slave_ofdata_to_platdata() to accept a device instead of a blob and offset.
Signed-off-by: S
dm: spi: Convert uclass to livetree
Update the SPI uclass to support a live device tree. Also adjust spi_slave_ofdata_to_platdata() to accept a device instead of a blob and offset.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
433647a7 |
| 05-Apr-2017 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
706865af |
| 20-Mar-2017 |
Stefan Roese <sr@denx.de> |
dm: core: Add flags parameter to device_remove()
This patch adds the flags parameter to device_remove() and changes all calls to this function to provide the default value of DM_REMOVE_NORMAL for "n
dm: core: Add flags parameter to device_remove()
This patch adds the flags parameter to device_remove() and changes all calls to this function to provide the default value of DM_REMOVE_NORMAL for "normal" device removal.
This is in preparation for the driver specific pre-OS (e.g. DMA cancelling) remove support.
Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
21342d4a |
| 08-Feb-2017 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
e160f7d4 |
| 17-Jan-2017 |
Simon Glass <sjg@chromium.org> |
dm: core: Replace of_offset with accessor
At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree,
dm: core: Replace of_offset with accessor
At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree, which uses a node pointer instead, refactor existing code to access this field through an inline function.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
0b4bc1b3 |
| 16-Dec-2016 |
Tom Rini <trini@konsulko.com> |
Merge branch 'master' of git://git.denx.de/u-boot-spi
|
| #
1b7c28f5 |
| 30-Nov-2016 |
Simon Glass <sjg@chromium.org> |
spi: Add error checking for invalid bus widths
At present an invalid bus width prints a message but does not return an error. This is the opposite of the correct behaviour. Adjust it to avoid code b
spi: Add error checking for invalid bus widths
At present an invalid bus width prints a message but does not return an error. This is the opposite of the correct behaviour. Adjust it to avoid code bloat in the common case, and avoid hard-to-debug failure in the uncommon case.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com>
show more ...
|
| #
2d221489 |
| 29-Nov-2016 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
|