Skip to content

Commit

Permalink
spi-cadence-xspi: Fix base address for SPI controllers
Browse files Browse the repository at this point in the history
New generation SoCs has different address for SPI controllers,
use them while decoding SPI instance.

Change-Id: I4a22d06337fe0b79d11ec1350790e18b94c9de90
Signed-off-by: Jakub Lewalski <[email protected]>
Signed-off-by: Suneel Garapati <[email protected]>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/131155
Reviewed-by: Chandrakala Chavva <[email protected]>
Tested-by: sa_ip-sw-jenkins <[email protected]>
  • Loading branch information
Jakub Lewalski authored and Sunil Kovvuri Goutham committed Jul 12, 2024
1 parent bf4986a commit 779d43a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/spi/spi-cadence-xspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ struct dentry *mrvl_spi_debug_root;
#define CHANGE_GPIO_SMC_ID 0xc2000b14
#define SPI_GPIO(x) (x+GPIO_OFFSET)

#define SPI0_BASE 0x8040
#define SPI1_BASE 0x8050
#define SPI0_SOC1_BASE 0x8040
#define SPI1_SOC1_BASE 0x8050
#define SPI0_SOC2_BASE 0xCF10
#define SPI1_SOC2_BASE 0xCF11

#define SPI_NOT_CLAIMED 0x00
#define SPI_AP_NS_OWN 0x02
Expand Down Expand Up @@ -1106,7 +1108,7 @@ static int cdns_xspi_of_get_plat_data(struct platform_device *pdev)
if (device_property_read_u32(&pdev->dev, "reg", &base_addr))
dev_info(&pdev->dev, "Missing reg property");

if (base_addr == SPI0_BASE)
if (base_addr == SPI0_SOC1_BASE || base_addr == SPI0_SOC2_BASE)
cdns_xspi->xspi_id = 0;
else
cdns_xspi->xspi_id = 1;
Expand Down

0 comments on commit 779d43a

Please sign in to comment.