[U-Boot] [PATCH v2 00/29] dm: scsi: Enhance SCSI support for driver model

Simon Glass sjg at chromium.org
Thu Jun 15 03:28:19 UTC 2017


At present U-Boot has a SCSI uclass but it does not have any operations.
The global scsi_exec() function is still used to execute SCSI commands.

This series tidies this up with the following changes:
- Move CONFIG_SCSI and CONFIG_CMD_SATA to use Kconfig
- Move SCSI and SATA code into separate drivers/ directories
- Add operations to the SCSI uclass
- Add driver-model support to AHCI
- Move link over to use CONFIG_DM_SCSI
- Drops an old SCSI driver for a single board that will likely be removed

More work is still needed, such as adding operations to the AHCI uclass,
but from what I can tell this can be done as a separate step.

Changes in v2:
- Move the "imply SCSI" before the "help" message
- Change 'enabled' to 'enables' in config SCSI
- Fix 'hear' typo
- Make it clear that non-PCI AHCI is not yet supported
- Update link64 and panther also
- Drop the PCI_DEVICE declarations
- Drop RFC tag

Simon Glass (29):
  configs: Resync with savedefconfig
  Convert CONFIG_SCSI to Kconfig
  scsi: Drop sym53c8xx driver
  scsi: Drop scsi_print_error()
  Convert CONFIG_CMD_SATA to Kconfig
  Kconfig: Add CONFIG_SATA to enable SATA
  sata: Move drivers into new drivers/ata directory
  scsi: Move drivers into new drivers/scsi directory
  dm: scsi: Rearrange header file for driver model
  dm: scsi: Rename struct SCSI_cmd_block to struct scsi_cmd
  dm: scsi: Drop the ccb typedef
  dm: scsi: Use the uclass platform data
  dm: ahci: Rename struct ahci_probe_ent
  dm: sata: Move ataid into struct ahci_uc_priv
  dm: ahci: Refactor to avoid static variables
  dm: scsi: Indent the confusing #ifdefs
  dm: ahci: Move common code for starting ports into a function
  dm: ahci: Unwind the confusing init code
  dm: ahci: Drop use of probe_ent
  dm: scsi: Add operations
  dm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()
  dm: scsi: Document and rename the scsi_scan() parameter
  dm: ahci: Create a local version of two SCSI functions
  dm: scsi: Add operations for SCSI devices
  dm: scsi: Adjust return value of scsi_exec()
  dm: scsi: Split out the bus scanning code
  dm: ahci: Add a driver for SCSI on AHCI
  dm: scsi: Drop scsi_init() when driver model is used
  x86: Move link to use driver model for SCSI

 README                                             |   6 -
 api/api_storage.c                                  |   2 +-
 arch/Kconfig                                       |   2 +
 arch/arm/Kconfig                                   |  10 +
 arch/arm/cpu/armv7/ls102xa/Kconfig                 |   1 +
 arch/arm/cpu/armv7/ls102xa/ls102xa_sata.c          |   2 +-
 arch/arm/cpu/armv7/mx6/Kconfig                     |   4 +
 arch/arm/cpu/armv7/mx6/clock.c                     |   6 +-
 arch/arm/cpu/armv8/fsl-layerscape/Kconfig          |   2 +
 arch/arm/cpu/armv8/fsl-layerscape/soc.c            |   4 +-
 arch/arm/imx-common/Makefile                       |   2 +-
 arch/arm/imx-common/cpu.c                          |   2 +-
 arch/arm/include/asm/arch-ls102xa/config.h         |   1 -
 arch/arm/mach-mvebu/Kconfig                        |   4 +
 arch/arm/mach-omap2/omap5/Kconfig                  |   2 +
 arch/arm/mach-omap2/sata.c                         |   4 +-
 arch/powerpc/cpu/mpc83xx/Kconfig                   |   1 +
 arch/powerpc/cpu/mpc85xx/Kconfig                   |  46 ++
 arch/powerpc/cpu/mpc85xx/cpu_init.c                |   4 +-
 arch/powerpc/cpu/mpc86xx/Kconfig                   |   1 +
 arch/x86/cpu/ivybridge/sata.c                      |  22 +-
 board/advantech/dms-ba16/dms-ba16.c                |   2 +-
 board/bachmann/ot1200/ot1200.c                     |   2 +-
 board/boundary/nitrogen6x/nitrogen6x.c             |   2 +-
 board/congatec/Kconfig                             |   1 +
 board/congatec/cgtqmx6eval/cgtqmx6eval.c           |   2 +-
 board/dfi/Kconfig                                  |   1 +
 board/gateworks/gw_ventana/gw_ventana.c            |   2 +-
 board/highbank/ahci.c                              |   2 +-
 board/highbank/highbank.c                          |   2 +-
 board/kosagi/novena/novena.c                       |   2 +-
 board/mpl/pip405/README                            |   5 +-
 board/toradex/apalis_imx6/apalis_imx6.c            |   2 +-
 board/toradex/colibri_imx6/colibri_imx6.c          |   2 +-
 board/udoo/udoo.c                                  |   2 +-
 board/wandboard/wandboard.c                        |   2 +-
 cmd/Kconfig                                        |  13 +
 cmd/scsi.c                                         |   6 +-
 common/Makefile                                    |   5 -
 common/spl/spl_sata.c                              |   2 +-
 common/splash_source.c                             |   2 +-
 common/usb_storage.c                               |  44 +-
 configs/A10-OLinuXino-Lime_defconfig               |   1 +
 configs/A20-OLinuXino-Lime2_defconfig              |   1 +
 configs/A20-OLinuXino-Lime_defconfig               |   1 +
 configs/A20-OLinuXino_MICRO_defconfig              |   1 +
 configs/A20-Olimex-SOM-EVB_defconfig               |   1 +
 configs/Bananapi_M2_Ultra_defconfig                |   1 +
 configs/Bananapi_defconfig                         |   1 +
 configs/Bananapro_defconfig                        |   1 +
 configs/Cubieboard2_defconfig                      |   1 +
 configs/Cubieboard_defconfig                       |   1 +
 configs/Cubietruck_defconfig                       |   1 +
 configs/Itead_Ibox_A20_defconfig                   |   1 +
 configs/Lamobo_R1_defconfig                        |   1 +
 configs/Linksprite_pcDuino3_Nano_defconfig         |   1 +
 configs/Linksprite_pcDuino3_defconfig              |   1 +
 configs/MPC8315ERDB_defconfig                      |   1 +
 configs/MPC8349ITX_LOWBOOT_defconfig               |   1 +
 configs/MPC8349ITX_defconfig                       |   1 +
 configs/MPC837XERDB_defconfig                      |   1 +
 configs/MPC8544DS_defconfig                        |   1 +
 configs/MPC8610HPCD_defconfig                      |   1 +
 configs/Marsboard_A10_defconfig                    |   1 +
 configs/Mele_A1000_defconfig                       |   1 +
 configs/Mele_M5_defconfig                          |   1 +
 configs/Orangepi_defconfig                         |   1 +
 configs/Orangepi_mini_defconfig                    |   1 +
 configs/Sinovoip_BPI_M2_Plus_defconfig             |   1 -
 configs/UCP1020_SPIFLASH_defconfig                 |   2 +-
 configs/UCP1020_defconfig                          |   2 +-
 configs/Wits_Pro_A20_DKT_defconfig                 |   1 +
 configs/adp-ae3xx_defconfig                        |   6 +-
 configs/adp-ag101p_defconfig                       |   6 +-
 configs/am335x_baltos_defconfig                    |   4 +-
 configs/am335x_boneblack_vboot_defconfig           |   1 -
 configs/am335x_evm_defconfig                       |   1 -
 configs/am335x_hs_evm_defconfig                    |   4 -
 configs/am335x_igep003x_defconfig                  |   6 +-
 configs/am335x_shc_defconfig                       |   4 +-
 configs/am335x_shc_ict_defconfig                   |   4 +-
 configs/am335x_shc_netboot_defconfig               |   4 +-
 configs/am335x_shc_prompt_defconfig                |   4 +-
 configs/am335x_shc_sdboot_defconfig                |   4 +-
 configs/am335x_shc_sdboot_prompt_defconfig         |   4 +-
 configs/am335x_sl50_defconfig                      |   4 +-
 configs/am43xx_evm_defconfig                       |   3 +-
 configs/am43xx_evm_usbhost_boot_defconfig          |   1 -
 configs/am43xx_hs_evm_defconfig                    |   3 +-
 configs/am57xx_evm_defconfig                       |   5 +-
 configs/am57xx_hs_evm_defconfig                    |   5 +-
 configs/at91sam9263ek_norflash_boot_defconfig      |   2 +-
 configs/at91sam9263ek_norflash_defconfig           |   2 +-
 configs/bayleybay_defconfig                        |   1 +
 configs/bcm958622hr_defconfig                      |   2 +-
 configs/birdland_bav335a_defconfig                 |   2 +-
 configs/birdland_bav335b_defconfig                 |   2 +-
 configs/blanche_defconfig                          |   1 -
 configs/brppt1_mmc_defconfig                       |   2 +-
 configs/brppt1_nand_defconfig                      |   2 +-
 configs/brppt1_spi_defconfig                       |   2 +-
 configs/brxre1_defconfig                           |   2 +-
 configs/canyonlands_defconfig                      |   1 +
 configs/cgtqmx6eval_defconfig                      |   1 +
 configs/chiliboard_defconfig                       |   4 +-
 configs/chromebook_link64_defconfig                |   3 +
 configs/chromebook_link_defconfig                  |   3 +
 configs/chromebook_minnie_defconfig                |   2 +-
 configs/chromebook_samus_defconfig                 |   1 +
 configs/chromebox_panther_defconfig                |   3 +
 configs/clearfog_defconfig                         |   2 -
 configs/cm_fx6_defconfig                           |   3 +-
 configs/cm_t335_defconfig                          |   2 +-
 configs/cm_t43_defconfig                           |   2 +-
 configs/cm_t54_defconfig                           |   1 +
 configs/colibri_imx7_defconfig                     |   2 +-
 configs/colibri_vf_defconfig                       |   2 +-
 configs/comtrend_ar5387un_ram_defconfig            |  66 +-
 configs/comtrend_ct5361_ram_defconfig              |  68 +-
 configs/comtrend_vr3032u_ram_defconfig             |  66 +-
 .../controlcenterd_36BIT_SDCARD_DEVELOP_defconfig  |   1 +
 configs/controlcenterd_36BIT_SDCARD_defconfig      |   1 +
 configs/controlcenterdc_defconfig                  |   1 +
 configs/cougarcanyon2_defconfig                    |   1 +
 configs/crownbay_defconfig                         |   1 +
 configs/db-88f6820-gp_defconfig                    |   1 +
 configs/db-mv784mp-gp_defconfig                    |   1 +
 configs/dra7xx_evm_defconfig                       |  12 +-
 configs/dra7xx_hs_evm_defconfig                    |   9 +-
 configs/evb-ast2500_defconfig                      |  12 +-
 configs/evb-rk3399_defconfig                       |   5 +-
 configs/firefly-rk3399_defconfig                   |   2 +-
 configs/gwventana_emmc_defconfig                   |   2 +-
 configs/gwventana_gw5904_defconfig                 |   2 +-
 configs/gwventana_nand_defconfig                   |   2 +-
 configs/highbank_defconfig                         |   1 +
 configs/huawei_hg556a_ram_defconfig                |  67 +-
 configs/imx6qdl_icore_mmc_defconfig                |   4 +-
 configs/imx6qdl_icore_rqs_mmc_defconfig            |   2 +-
 configs/k2e_evm_defconfig                          |   5 +-
 configs/k2e_hs_evm_defconfig                       |   3 +-
 configs/k2g_evm_defconfig                          |   5 +-
 configs/k2g_hs_evm_defconfig                       |   6 +-
 configs/k2hk_evm_defconfig                         |   4 +-
 configs/k2hk_hs_evm_defconfig                      |   3 +-
 configs/k2l_evm_defconfig                          |   4 +-
 configs/ls1012aqds_qspi_defconfig                  |   1 +
 configs/ls2081ardb_defconfig                       |  14 +-
 configs/ls2088ardb_qspi_defconfig                  |  13 +-
 configs/m53evk_defconfig                           |   3 +-
 configs/minnowmax_defconfig                        |   1 +
 configs/mx51evk_defconfig                          |   2 +-
 configs/mx53cx9020_defconfig                       |   2 +-
 configs/mx53loco_defconfig                         |   3 +-
 configs/mx6cuboxi_defconfig                        |   2 +-
 configs/mx6qsabrelite_defconfig                    |   1 +
 configs/mx6sxsabresd_defconfig                     |   2 +-
 configs/mx6sxsabresd_spl_defconfig                 |   2 +-
 configs/mx7dsabresd_defconfig                      |   2 +-
 configs/nanopi_neo_air_defconfig                   |   2 +-
 configs/nanopi_neo_defconfig                       |   2 +-
 configs/netgear_cg3100d_ram_defconfig              |  66 +-
 configs/nitrogen6q2g_defconfig                     |   1 +
 configs/nitrogen6q_defconfig                       |   1 +
 configs/novena_defconfig                           |   3 +-
 configs/omap3_logic_defconfig                      |   1 -
 configs/omap5_uevm_defconfig                       |   1 +
 configs/opos6uldev_defconfig                       |   2 +-
 configs/orangepi_2_defconfig                       |   1 -
 configs/orangepi_lite_defconfig                    |   1 -
 configs/orangepi_one_defconfig                     |   1 -
 configs/orangepi_pc2_defconfig                     |   1 -
 configs/orangepi_pc_defconfig                      |   1 -
 configs/orangepi_pc_plus_defconfig                 |   1 -
 configs/orangepi_plus2e_defconfig                  |   1 -
 configs/orangepi_plus_defconfig                    |   1 -
 configs/orangepi_zero_defconfig                    |   2 +-
 configs/pcm051_rev1_defconfig                      |   2 +-
 configs/pcm051_rev3_defconfig                      |   2 +-
 configs/pengwyn_defconfig                          |   2 +-
 configs/pepper_defconfig                           |   2 +-
 configs/pine64_plus_defconfig                      |   3 +-
 configs/pxm2_defconfig                             |   2 +-
 configs/r8a7795_salvator-x_defconfig               |  19 +-
 configs/r8a7796_salvator-x_defconfig               |  20 +-
 configs/rut_defconfig                              |   2 +-
 configs/sagem_f at st1704_ram_defconfig               |  66 +-
 configs/sama5d2_xplained_mmc_defconfig             |   4 +-
 configs/sama5d2_xplained_spiflash_defconfig        |   2 +-
 configs/sandbox_defconfig                          |   9 +-
 configs/sandbox_flattree_defconfig                 |  11 +-
 configs/sandbox_noblk_defconfig                    |   5 +-
 configs/sandbox_spl_defconfig                      |   4 +-
 configs/sfr_nb4-ser_ram_defconfig                  |  66 +-
 configs/som-db5800-som-6867_defconfig              |   1 +
 configs/stm32f746-disco_defconfig                  |  11 +-
 configs/tbs2910_defconfig                          |   3 +-
 configs/udoo_defconfig                             |   1 +
 configs/wandboard_defconfig                        |   1 +
 configs/xilinx_zynqmp_ep_defconfig                 |   1 +
 configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig   |   2 +-
 configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig   |   2 +-
 configs/xilinx_zynqmp_zcu102_defconfig             |   3 +-
 configs/xilinx_zynqmp_zcu102_revB_defconfig        |   3 +-
 drivers/Kconfig                                    |   4 +
 drivers/Makefile                                   |   4 +-
 drivers/ata/Kconfig                                |  62 ++
 drivers/ata/Makefile                               |  22 +
 drivers/{block => ata}/ahci-uclass.c               |   0
 drivers/{block => ata}/ahci.c                      | 395 ++++++----
 drivers/{block => ata}/dwc_ahci.c                  |  10 +-
 drivers/{block => ata}/dwc_ahsata.c                |  74 +-
 drivers/{block => ata}/dwc_ahsata.h                |   0
 drivers/{block => ata}/fsl_sata.c                  |   0
 drivers/{block => ata}/fsl_sata.h                  |   0
 drivers/{block => ata}/libata.c                    |   0
 drivers/{block => ata}/mvsata_ide.c                |   0
 drivers/{block => ata}/mxc_ata.c                   |   0
 {common => drivers/ata}/sata.c                     |   0
 drivers/{block => ata}/sata_ceva.c                 |   9 +-
 drivers/{block => ata}/sata_dwc.c                  |   0
 drivers/{block => ata}/sata_dwc.h                  |   0
 drivers/{block => ata}/sata_mv.c                   |   0
 drivers/{block => ata}/sata_sandbox.c              |   0
 drivers/{block => ata}/sata_sil.c                  |   0
 drivers/{block => ata}/sata_sil.h                  |   0
 drivers/{block => ata}/sata_sil3114.c              |   0
 drivers/{block => ata}/sata_sil3114.h              |   0
 drivers/block/Kconfig                              |  41 -
 drivers/block/Makefile                             |  17 +-
 drivers/block/scsi-uclass.c                        |  27 -
 drivers/block/sym53c8xx.c                          | 851 ---------------------
 drivers/scsi/Kconfig                               |  17 +
 drivers/scsi/Makefile                              |  20 +
 drivers/{block => scsi}/sandbox_scsi.c             |   9 +-
 drivers/scsi/scsi-uclass.c                         |  40 +
 {common => drivers/scsi}/scsi.c                    | 147 ++--
 drivers/usb/emul/sandbox_flash.c                   |   2 +-
 fs/fat/fat.c                                       |   2 +-
 include/ahci.h                                     |  57 +-
 include/config_cmd_all.h                           |   1 -
 include/config_distro_bootcmd.h                    |   6 +-
 include/config_fallbacks.h                         |   2 +-
 include/configs/MPC8315ERDB.h                      |   1 -
 include/configs/MPC8349ITX.h                       |   4 -
 include/configs/MPC837XEMDS.h                      |   1 -
 include/configs/MPC837XERDB.h                      |   1 -
 include/configs/MPC8536DS.h                        |   1 -
 include/configs/MPC8544DS.h                        |   1 -
 include/configs/MPC8572DS.h                        |   1 -
 include/configs/MPC8610HPCD.h                      |   1 -
 include/configs/MPC8641HPCN.h                      |   1 -
 include/configs/P1010RDB.h                         |   1 -
 include/configs/P1022DS.h                          |   1 -
 include/configs/P2041RDB.h                         |   1 -
 include/configs/P4080DS.h                          |   1 -
 include/configs/PIP405.h                           |  10 -
 include/configs/T102xQDS.h                         |   1 -
 include/configs/T1040QDS.h                         |   1 -
 include/configs/T104xRDB.h                         |   1 -
 include/configs/T208xQDS.h                         |   1 -
 include/configs/T208xRDB.h                         |   1 -
 include/configs/T4240QDS.h                         |   1 -
 include/configs/T4240RDB.h                         |   2 -
 include/configs/UCP1020.h                          |   1 -
 include/configs/advantech_dms-ba16.h               |   1 -
 include/configs/am57xx_evm.h                       |   1 -
 include/configs/apalis_imx6.h                      |   4 -
 include/configs/canyonlands.h                      |   1 -
 include/configs/cgtqmx6eval.h                      |   1 -
 include/configs/cm_fx6.h                           |   1 -
 include/configs/cm_t54.h                           |   1 -
 include/configs/controlcenterd.h                   |   1 -
 include/configs/controlcenterdc.h                  |   1 -
 include/configs/corenet_ds.h                       |   1 -
 include/configs/cyrus.h                            |   1 -
 include/configs/db-88f6820-gp.h                    |   1 -
 include/configs/db-mv784mp-gp.h                    |   1 -
 include/configs/dra7xx_evm.h                       |   1 -
 include/configs/efi-x86.h                          |   1 -
 include/configs/galileo.h                          |   1 -
 include/configs/gw_ventana.h                       |   1 -
 include/configs/highbank.h                         |   1 -
 include/configs/ls1012aqds.h                       |   1 -
 include/configs/ls1012ardb.h                       |   1 -
 include/configs/ls1043aqds.h                       |   1 -
 include/configs/ls1046aqds.h                       |   1 -
 include/configs/ls1046ardb.h                       |   1 -
 include/configs/ls2080aqds.h                       |   1 -
 include/configs/ls2080ardb.h                       |   1 -
 include/configs/m53evk.h                           |   1 -
 include/configs/mvebu_armada-37xx.h                |   1 -
 include/configs/mvebu_armada-8k.h                  |   1 -
 include/configs/mx53loco.h                         |   1 -
 include/configs/nitrogen6x.h                       |   4 -
 include/configs/novena.h                           |   1 -
 include/configs/omap5_uevm.h                       |   1 -
 include/configs/ot1200.h                           |   4 -
 include/configs/p1_p2_rdb_pc.h                     |   1 -
 include/configs/p1_twr.h                           |   1 -
 include/configs/qemu-x86.h                         |   1 -
 include/configs/sandbox.h                          |   2 -
 include/configs/sunxi-common.h                     |   1 -
 include/configs/t4qds.h                            |   1 -
 include/configs/tbs2910.h                          |   1 -
 include/configs/theadorable.h                      |   1 -
 include/configs/udoo.h                             |   1 -
 include/configs/wandboard.h                        |   1 -
 include/configs/x86-common.h                       |   1 -
 include/configs/xilinx_zynqmp.h                    |   1 -
 include/scsi.h                                     |  85 +-
 scripts/config_whitelist.txt                       |   4 -
 312 files changed, 1255 insertions(+), 1874 deletions(-)
 create mode 100644 drivers/ata/Kconfig
 create mode 100644 drivers/ata/Makefile
 rename drivers/{block => ata}/ahci-uclass.c (100%)
 rename drivers/{block => ata}/ahci.c (74%)
 rename drivers/{block => ata}/dwc_ahci.c (92%)
 rename drivers/{block => ata}/dwc_ahsata.c (92%)
 rename drivers/{block => ata}/dwc_ahsata.h (100%)
 rename drivers/{block => ata}/fsl_sata.c (100%)
 rename drivers/{block => ata}/fsl_sata.h (100%)
 rename drivers/{block => ata}/libata.c (100%)
 rename drivers/{block => ata}/mvsata_ide.c (100%)
 rename drivers/{block => ata}/mxc_ata.c (100%)
 rename {common => drivers/ata}/sata.c (100%)
 rename drivers/{block => ata}/sata_ceva.c (95%)
 rename drivers/{block => ata}/sata_dwc.c (100%)
 rename drivers/{block => ata}/sata_dwc.h (100%)
 rename drivers/{block => ata}/sata_mv.c (100%)
 rename drivers/{block => ata}/sata_sandbox.c (100%)
 rename drivers/{block => ata}/sata_sil.c (100%)
 rename drivers/{block => ata}/sata_sil.h (100%)
 rename drivers/{block => ata}/sata_sil3114.c (100%)
 rename drivers/{block => ata}/sata_sil3114.h (100%)
 delete mode 100644 drivers/block/scsi-uclass.c
 delete mode 100644 drivers/block/sym53c8xx.c
 create mode 100644 drivers/scsi/Kconfig
 create mode 100644 drivers/scsi/Makefile
 rename drivers/{block => scsi}/sandbox_scsi.c (75%)
 create mode 100644 drivers/scsi/scsi-uclass.c
 rename {common => drivers/scsi}/scsi.c (86%)

-- 
2.13.1.518.g3df882009-goog



More information about the U-Boot mailing list