- distro boot support for SPI flash - sifive spi flash driver
This commit is contained in:
@@ -48,6 +48,8 @@
|
||||
|
||||
#define ENV_MEM_LAYOUT_SETTINGS \
|
||||
"scriptaddr=0x00500000\0" \
|
||||
"script_offset_f=0xffe000\0" \
|
||||
"script_size_f=0x2000\0" \
|
||||
"pxefile_addr_r=0x00600000\0" \
|
||||
"fdt_addr_r=0x01f00000\0" \
|
||||
"kernel_addr_r=0x02080000\0" \
|
||||
@@ -58,6 +60,7 @@
|
||||
#endif
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
#include <environment/distro/sf.h>
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
ENV_MEM_LAYOUT_SETTINGS \
|
||||
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
|
||||
|
||||
@@ -41,11 +41,26 @@
|
||||
#define BOOT_TARGET_DHCP(func)
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(CMD_SF)
|
||||
#define BOOT_TARGET_SF(func) func(SF, sf, 0)
|
||||
#else
|
||||
#define BOOT_TARGET_SF(func)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RK3399
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
BOOT_TARGET_MMC(func) \
|
||||
BOOT_TARGET_USB(func) \
|
||||
BOOT_TARGET_PXE(func) \
|
||||
BOOT_TARGET_DHCP(func) \
|
||||
BOOT_TARGET_SF(func)
|
||||
#else
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
BOOT_TARGET_MMC(func) \
|
||||
BOOT_TARGET_USB(func) \
|
||||
BOOT_TARGET_PXE(func) \
|
||||
BOOT_TARGET_DHCP(func)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
#define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
|
||||
|
||||
41
include/environment/distro/sf.h
Normal file
41
include/environment/distro/sf.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2020 Amarula Solutions(India)
|
||||
*
|
||||
* SF distro configurations.
|
||||
*/
|
||||
|
||||
#ifndef __DISTRO_SF_CONFIG_H
|
||||
#define __DISTRO_SF_CONFIG_H
|
||||
|
||||
#if CONFIG_IS_ENABLED(CMD_SF)
|
||||
#define BOOTENV_SHARED_SF(devtypel) \
|
||||
#devtypel "_boot=" \
|
||||
"if " #devtypel " probe ${busnum}; then " \
|
||||
"devtype=" #devtypel "; " \
|
||||
"run scan_sf_for_scripts; " \
|
||||
"fi\0"
|
||||
#define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \
|
||||
"bootcmd_" #devtypel #instance "=" \
|
||||
"busnum=" #instance "; " \
|
||||
"run " #devtypel "_boot\0"
|
||||
#define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \
|
||||
#devtypel #instance " "
|
||||
#else
|
||||
#define BOOTENV_SHARED_SF(devtypel)
|
||||
#define BOOTENV_DEV_SF \
|
||||
BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
|
||||
#define BOOTENV_DEV_NAME_SF \
|
||||
BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
|
||||
|
||||
#endif /* CONFIG_CMD_SF */
|
||||
|
||||
#define BOOTENV_SF \
|
||||
BOOTENV_SHARED_SF(sf) \
|
||||
"scan_sf_for_scripts=" \
|
||||
"${devtype} read ${scriptaddr} " \
|
||||
"${script_offset_f} ${script_size_f}; " \
|
||||
"source ${scriptaddr}; " \
|
||||
"echo SCRIPT FAILED: continuing...\0"
|
||||
|
||||
#endif /* __DISTRO_SF_CONFIG_H */
|
||||
@@ -22,6 +22,7 @@
|
||||
#define SNOR_MFR_INTEL CFI_MFR_INTEL
|
||||
#define SNOR_MFR_ST CFI_MFR_ST /* ST Micro <--> Micron */
|
||||
#define SNOR_MFR_MICRON CFI_MFR_MICRON /* ST Micro <--> Micron */
|
||||
#define SNOR_MFR_ISSI CFI_MFR_PMC
|
||||
#define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX
|
||||
#define SNOR_MFR_SPANSION CFI_MFR_AMD
|
||||
#define SNOR_MFR_SST CFI_MFR_SST
|
||||
|
||||
@@ -204,6 +204,7 @@ struct spinand_manufacturer {
|
||||
extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer macronix_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer micron_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer toshiba_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer winbond_spinand_manufacturer;
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,10 +60,12 @@
|
||||
/**
|
||||
* enum spi_mem_data_dir - describes the direction of a SPI memory data
|
||||
* transfer from the controller perspective
|
||||
* @SPI_MEM_NO_DATA: no data transferred
|
||||
* @SPI_MEM_DATA_IN: data coming from the SPI memory
|
||||
* @SPI_MEM_DATA_OUT: data sent the SPI memory
|
||||
*/
|
||||
enum spi_mem_data_dir {
|
||||
SPI_MEM_NO_DATA,
|
||||
SPI_MEM_DATA_IN,
|
||||
SPI_MEM_DATA_OUT,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user