mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-29 14:41:26 +01:00
net: pfe_eth: Remove non-DM code check from pfe_spi_flash_init
CONFIG_DM_SPI_FLASH is only supported now with passing of driver conversion deadline from non-DM to DM model. Hence, it's safe to remove non-DM code check from pfe_spi_flash_init. Also use CONFIG_ENV_SPI_MODE and CONFIG_ENV_SPI_MAX_HZ instead of reading reading values from DT. Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
This commit is contained in:
parent
63d5344615
commit
6fe7743d05
@ -167,26 +167,20 @@ static int pfe_fit_check(void)
|
|||||||
int pfe_spi_flash_init(void)
|
int pfe_spi_flash_init(void)
|
||||||
{
|
{
|
||||||
struct spi_flash *pfe_flash;
|
struct spi_flash *pfe_flash;
|
||||||
|
struct udevice *new;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
|
void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
|
||||||
|
|
||||||
if (!addr)
|
if (!addr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
#ifdef CONFIG_DM_SPI_FLASH
|
|
||||||
struct udevice *new;
|
|
||||||
|
|
||||||
/* speed and mode will be read from DT */
|
|
||||||
ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS,
|
ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS,
|
||||||
CONFIG_ENV_SPI_CS, 0, 0, &new);
|
|
||||||
|
|
||||||
pfe_flash = dev_get_uclass_priv(new);
|
|
||||||
#else
|
|
||||||
pfe_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS,
|
|
||||||
CONFIG_ENV_SPI_CS,
|
CONFIG_ENV_SPI_CS,
|
||||||
CONFIG_ENV_SPI_MAX_HZ,
|
CONFIG_ENV_SPI_MAX_HZ,
|
||||||
CONFIG_ENV_SPI_MODE);
|
CONFIG_ENV_SPI_MODE,
|
||||||
#endif
|
&new);
|
||||||
|
|
||||||
|
pfe_flash = dev_get_uclass_priv(new);
|
||||||
if (!pfe_flash) {
|
if (!pfe_flash) {
|
||||||
printf("SF: probe for pfe failed\n");
|
printf("SF: probe for pfe failed\n");
|
||||||
free(addr);
|
free(addr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user