Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yocto 5 #43

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/dts/sc5xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
};

spi2: spi2 {
compatible = "adi,spi3";
compatible = "adi,spi-mm";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
Expand Down
17 changes: 16 additions & 1 deletion common/spl/spl_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include <asm/global_data.h>
#include <dm/ofnode.h>

#define OSPI_BUS 0
#define OSPI_CS 0

#if CONFIG_IS_ENABLED(OS_BOOT)
/*
* Load the kernel, check for a valid header we can parse, and if found load
Expand Down Expand Up @@ -106,6 +109,11 @@ unsigned int __weak spl_spi_get_default_speed(void)
return CONFIG_SF_DEFAULT_SPEED;
}

unsigned int spl_get_ezkit_fastest_spi_clock(void)
{
return ADI_OSPI_SF_DEFAULT_SPEED;
}

/*
* The main entry for SPI booting. It's necessary that SDRAM is already
* configured and available since this code loads the main U-Boot image
Expand All @@ -126,11 +134,18 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
* In DM mode: defaults speed and mode will be
* taken from DT when available
*/

#if defined(CONFIG_ADI_FALCON) && defined(CONFIG_ADI_CARRIER_SOMCRR_EZKIT)
Copy link

@jdanielllopis jdanielllopis Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the commit ae08c53 is simplified when options ADI_FALCON and carrier board are true, because one place to call spi_flash_probe() with default settings.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new branch (yocto_5_rev) from yocto_5 with possible updates

printf("Probe @%dHz\n", spl_get_ezkit_fastest_spi_clock());
flash = spi_flash_probe(OSPI_BUS, OSPI_CS,
spl_get_ezkit_fastest_spi_clock(),
CONFIG_SF_DEFAULT_MODE);
#else
flash = spi_flash_probe(spl_spi_get_default_bus(),
spl_spi_get_default_cs(),
spl_spi_get_default_speed(),
CONFIG_SF_DEFAULT_MODE);

#endif
if (!flash) {
puts("SPI probe failed.\n");
return -ENODEV;
Expand Down
3 changes: 1 addition & 2 deletions configs/sc598-som-ezkit-falcon_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ CONFIG_CDU0_CLKO13=3
CONFIG_CDU0_CLKO14=3
CONFIG_SYS_LOAD_ADDR=0x0
CONFIG_FIT=y
CONFIG_SPL_FIT_SIGNATURE=y
CONFIG_SPL_LOAD_FIT_FULL=y
CONFIG_LEGACY_IMAGE_FORMAT=y
CONFIG_BOARD_EARLY_INIT_F=y
Expand Down Expand Up @@ -124,7 +123,7 @@ CONFIG_SPL_PINCTRL=y
CONFIG_REMOTEPROC_ADI_SC5XX=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_ADI_SPI3=y
CONFIG_ADI_QSPI=y
CONFIG_CADENCE_QSPI=y
CONFIG_HAS_CQSPI_REF_CLK=y
CONFIG_CQSPI_REF_CLK=500000000
Expand Down
2 changes: 1 addition & 1 deletion configs/sc598-som-ezkit-spl_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CONFIG_SPL_PINCTRL=y
CONFIG_REMOTEPROC_ADI_SC5XX=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_ADI_SPI3=y
CONFIG_ADI_QSPI=y
CONFIG_CADENCE_QSPI=y
CONFIG_HAS_CQSPI_REF_CLK=y
CONFIG_CQSPI_REF_CLK=500000000
Expand Down
10 changes: 9 additions & 1 deletion drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ config ADI_SPI3
bool "Enable ADI SPI Driver"
help
Enable the ADI (Analog Devices) SPI controller driver. This
driver enables the support for SC5XX spi controller.
driver enables the support for SC5XX spi controller for generic
SPI.

config ADI_QSPI
bool "Enable ADI QSPI Driver"
help
Enable the ADI SPI controller in memory mapped mode. This driver
does not support generic SPI. The implementation supports only the
spi-mem interface.

config ALTERA_SPI
bool "Altera SPI driver"
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ obj-$(CONFIG_SPI_MEM) += spi-mem-nodm.o
endif

obj-$(CONFIG_ADI_SPI3) += adi_spi3.o
obj-$(CONFIG_ADI_QSPI) += adi_qspi.o
obj-$(CONFIG_ALTERA_SPI) += altera_spi.o
obj-$(CONFIG_APPLE_SPI) += apple_spi.o
obj-$(CONFIG_ATH79_SPI) += ath79_spi.o
Expand Down
Loading