Skip to content

Commit

Permalink
scsi: Drop CONFIG_SYS_SCSI_MAX_DEVICE
Browse files Browse the repository at this point in the history
This is defined based on two other CONFIGs for all boards except sandbox
and durian.

For sandbox the value does not matter. For durian the value seems
excessive.

Drop the option completely, to simplify configuration and reduce the
number of things we need to convert to Kconfig.

Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Stefan Roese <[email protected]>
  • Loading branch information
sjg20 authored and trini committed Feb 9, 2022
1 parent f73a756 commit ce30e3f
Show file tree
Hide file tree
Showing 29 changed files with 12 additions and 56 deletions.
8 changes: 3 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,9 @@ The following options need to be configured:
Default is 32bit.

- SCSI Support:
CONFIG_SYS_SCSI_MAX_LUN [8], CONFIG_SYS_SCSI_MAX_SCSI_ID [7] and
CONFIG_SYS_SCSI_MAX_DEVICE [CONFIG_SYS_SCSI_MAX_SCSI_ID *
CONFIG_SYS_SCSI_MAX_LUN] can be adjusted to define the
maximum numbers of LUNs, SCSI ID's and target
devices.
CONFIG_SYS_SCSI_MAX_LUN [8] and CONFIG_SYS_SCSI_MAX_SCSI_ID [7]
can be adjusted to define the maximum numbers of LUNs and SCSI
IDs.

The environment variable 'scsidevs' is set to the number of
SCSI devices found during the last scan.
Expand Down
3 changes: 2 additions & 1 deletion api/api_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <common.h>
#include <api_public.h>
#include <part.h>
#include <scsi.h>

#if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
#include <usb.h>
Expand Down Expand Up @@ -71,7 +72,7 @@ void dev_stor_init(void)
specs[ENUM_SATA].name = "sata";
#endif
#if defined(CONFIG_SCSI)
specs[ENUM_SCSI].max_dev = CONFIG_SYS_SCSI_MAX_DEVICE;
specs[ENUM_SCSI].max_dev = SCSI_MAX_DEVICE;
specs[ENUM_SCSI].enum_started = 0;
specs[ENUM_SCSI].enum_ended = 0;
specs[ENUM_SCSI].type = DEV_TYP_STOR | DT_STOR_SCSI;
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/include/asm/arch-ls102xa/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#ifdef CONFIG_DDR_SPD
#define CONFIG_VERY_BIG_RAM
#define CONFIG_SYS_LS1_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Expand Down
6 changes: 3 additions & 3 deletions drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int scsi_max_devs; /* number of highest available scsi device */

static int scsi_curr_dev; /* current device */

static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
static struct blk_desc scsi_dev_desc[SCSI_MAX_DEVICE];
#endif

/* almost the maximum amount of the scsi_ext command.. */
Expand Down Expand Up @@ -655,7 +655,7 @@ int scsi_scan(bool verbose)

if (verbose)
printf("scanning bus for devices...\n");
for (i = 0; i < CONFIG_SYS_SCSI_MAX_DEVICE; i++)
for (i = 0; i < SCSI_MAX_DEVICE; i++)
scsi_init_dev_desc(&scsi_dev_desc[i], i);

scsi_max_devs = 0;
Expand Down Expand Up @@ -703,7 +703,7 @@ U_BOOT_DRIVER(scsi_blk) = {
U_BOOT_LEGACY_BLK(scsi) = {
.if_typename = "scsi",
.if_type = IF_TYPE_SCSI,
.max_devs = CONFIG_SYS_SCSI_MAX_DEVICE,
.max_devs = SCSI_MAX_DEVICE,
.desc = scsi_dev_desc,
};
#endif
2 changes: 0 additions & 2 deletions include/configs/am57xx_evm.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/*
* Default to using SPI for environment, etc.
Expand Down
2 changes: 0 additions & 2 deletions include/configs/clearfog.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#endif

/* Keep device tree and initrd in lower memory so the kernel can access them */
Expand Down
2 changes: 0 additions & 2 deletions include/configs/controlcenterdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/* Environment in SPI NOR flash */

Expand Down
2 changes: 0 additions & 2 deletions include/configs/db-88f6820-gp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/* Environment in SPI NOR flash */

Expand Down
1 change: 0 additions & 1 deletion include/configs/durian.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
/* SCSI */
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 4
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE 128
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SATA_MAX_DEVICE 4

Expand Down
2 changes: 0 additions & 2 deletions include/configs/helios4.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#endif

/* Keep device tree and initrd in lower memory so the kernel can access them */
Expand Down
2 changes: 0 additions & 2 deletions include/configs/highbank.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 5
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

#define CONFIG_BOOT_RETRY_TIME -1
#define CONFIG_RESET_TO_RETRY
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1012a2g5rdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1012a_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/* I2C */

Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1021aiot.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/* SPI */

Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1028aqds.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
#define CONFIG_SYS_SATA1 AHCI_BASE_ADDR1
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#ifndef SPL_NO_ENV
#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1028ardb.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
/* SATA */
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#define SCSI_VEND_ID 0x1b4b
#define SCSI_DEV_ID 0x9170
#define CONFIG_SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID}
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1043aqds.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/*
* IFC Definitions
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1043ardb.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@
#ifndef SPL_NO_SATA
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
#define CONFIG_SYS_SCSI_MAX_LUN 2
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#define SCSI_VEND_ID 0x1b4b
#define SCSI_DEV_ID 0x9170
#define CONFIG_SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID}
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1046a_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#endif

/* FMan ucode */
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls1088a_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ unsigned long long get_qixis_addr(void);

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#endif

/* Physical Memory Map */
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls2080aqds.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

#define CONFIG_SYS_NOR0_CSPR_EXT (0x0)
#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024)
Expand Down
2 changes: 0 additions & 2 deletions include/configs/ls2080ardb.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

#if !defined(CONFIG_FSL_QSPI) || defined(CONFIG_TFABOOT)

Expand Down
2 changes: 0 additions & 2 deletions include/configs/lx2160a_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@
#define CONFIG_SYS_SATA2 AHCI_BASE_ADDR2
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
#endif

/* USB */
Expand Down
2 changes: 0 additions & 2 deletions include/configs/mvebu_armada-37xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 1) \
Expand Down
2 changes: 0 additions & 2 deletions include/configs/mvebu_armada-8k.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@

#define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

/*
* PCI configuration
Expand Down
2 changes: 0 additions & 2 deletions include/configs/omap5_uevm.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,5 @@
#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

#endif /* __CONFIG_OMAP5_EVM_H */
1 change: 0 additions & 1 deletion include/configs/sandbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#endif

#define CONFIG_SCSI_AHCI_PLAT
#define CONFIG_SYS_SCSI_MAX_DEVICE 2
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 8
#define CONFIG_SYS_SCSI_MAX_LUN 4

Expand Down
4 changes: 4 additions & 0 deletions include/scsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <asm/cache.h>
#include <linux/dma-direction.h>

/* Fix this to the maximum */
#define SCSI_MAX_DEVICE \
(CONFIG_SYS_SCSI_MAX_SCSI_ID * CONFIG_SYS_SCSI_MAX_LUN)

struct udevice;

struct scsi_cmd {
Expand Down
1 change: 0 additions & 1 deletion scripts/config_whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,6 @@ CONFIG_SYS_SCCR_TSEC1CM
CONFIG_SYS_SCCR_TSEC2CM
CONFIG_SYS_SCCR_USBDRCM
CONFIG_SYS_SCR
CONFIG_SYS_SCSI_MAX_DEVICE
CONFIG_SYS_SCSI_MAX_LUN
CONFIG_SYS_SCSI_MAX_SCSI_ID
CONFIG_SYS_SDRAM
Expand Down

0 comments on commit ce30e3f

Please sign in to comment.