public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/44] dm: blk: Add more driver-model support for block devices
@ 2016-04-10  2:44 Simon Glass
  2016-04-10  2:44 ` [U-Boot] [PATCH 01/44] Revert "dm: sandbox: Drop the pre-DM host implementation" Simon Glass
                   ` (43 more replies)
  0 siblings, 44 replies; 62+ messages in thread
From: Simon Glass @ 2016-04-10  2:44 UTC (permalink / raw)
  To: u-boot

This series adjusts the block device code to support conversion to driver
model. Specifically

- A new 'legacy' block interface is created, allowing block devices to be
defined by a linker list and accessed through function calls
- Block device commands (such as sata and scsi) are adjusted to use these
functions rather than the block device array directly
- These same function calls are then implemented by the block uclass
- The existing block-device table in part.c is dropped
- The opportunity is taken to clean up the code style, as block devices are
one of the few remaining dark corners in U-Boot

It is useful to enable all block device drivers with sandbox. This improves
sandbox code coverage and allows tests to be written. The following are
enabled by this series:

- IDE
- SCSI
- SATA
- Systemace

USB was already enabled. MMC will be enabled by a future series. Note that
these devices do not actually function in sandbox, but the code is compiled.

As mentioned, future work will enable MMC for sandbox including adding
rudimentary sandbox SD card emulation. It would also be possible to create
emulations for IDE, SCSI, SATA and Systemace but that work is not planned.

It should be noted that the current CONFIG_DM_MMC option does not fully
enable driver model for MMC, since the MMC operations are not running
through driver model. This will need to be addressed at some point.

This series is available at u-boot-dm/blka-working


Simon Glass (44):
  Revert "dm: sandbox: Drop the pre-DM host implementation"
  dm: sandbox: Add a board for sandbox without CONFIG_BLK
  pci: Drop CONFIG_SYS_SCSI_SCAN_BUS_REVERSE
  dm: Rename disk uclass to ahci
  Allow iotrace byte access to use an address of any size
  sandbox: Add string and 16-bit I/O functions
  sandbox: Add dummy SCSI functions
  sandbox: Add dummy SATA functions
  dm: scsi: Remove the forward declarations
  dm: scsi: Fix up code style
  dm: ide: Correct various code style problems
  dm: ide: Remove the forward declarations
  dm: sata: Fix code style problems in cmd/sata.c
  dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSI
  dm: blk: Add a legacy block interface
  dm: systemace: Add a legacy block interface
  dm: sandbox: Add a legacy host block interface
  dm: usb: Add a legacy block interface for USB storage
  dm: mmc: Add a legacy block interface for MMC
  dm: mmc: Add an implementation of the 'devnum' functions
  dm: scsi: Separate the non-command code into its own file
  dm: ide: Separate the non-command code into its own file
  dm: sata: Separate the non-command code into its own file
  dm: disk: Use legacy block driver info for block device access
  dm: usb: Drop the get_dev() function
  dm: ide: Drop the get_dev() function
  dm: mmc: Drop the get_dev() function
  dm: scsi: Drop the get_dev() function
  dm: sata: Drop the get_dev() function
  dm: systemace: Drop the get_dev() function
  dm: blk: Drop the systemace.h header
  dm: sandbox: Drop the host_get_dev() function
  dm: part: Drop the get_dev() method
  dm: ide: Add support for driver-model block devices
  dm: sandbox: Enable IDE
  dm: scsi: Add support for driver-model block devices
  dm: sandbox: Enable SCSI
  dm: sata: Add support for driver-model block devices
  dm: sandbox: Enable SATA
  dm: blk: Allow blk_create_device() to allocate the device number
  dm: blk: Add a easier way to create a named block device
  dm: systemace: Reorder function to avoid forward declarataions
  dm: systemace: Add driver-mode block-device support
  dm: sandbox: Enable systemace

 README                                         |    4 +-
 api/api_storage.c                              |    2 +-
 arch/arm/include/asm/arch-ls102xa/config.h     |    2 +-
 arch/sandbox/include/asm/io.h                  |   22 +
 arch/x86/Kconfig                               |    3 +
 arch/x86/cpu/broadwell/sata.c                  |    2 +-
 arch/x86/cpu/intel_common/cpu.c                |    2 +-
 arch/x86/cpu/ivybridge/bd82x6x.c               |    2 +-
 arch/x86/cpu/ivybridge/sata.c                  |    2 +-
 board/cm5200/fwupdate.c                        |    2 +-
 board/mpl/pip405/README                        |    6 +-
 board/sandbox/MAINTAINERS                      |    7 +
 cmd/Makefile                                   |    8 +-
 cmd/disk.c                                     |    2 +-
 cmd/ide.c                                      | 1352 +-----------------------
 cmd/mmc.c                                      |    2 +-
 cmd/sata.c                                     |  142 +--
 cmd/scsi.c                                     |  753 ++-----------
 cmd/usb.c                                      |   16 +-
 common/Makefile                                |    6 +
 common/board_r.c                               |    4 +-
 common/ide.c                                   | 1231 +++++++++++++++++++++
 common/sata.c                                  |  115 ++
 common/scsi.c                                  |  592 +++++++++++
 common/spl/spl_sata.c                          |    2 +-
 common/spl/spl_usb.c                           |    2 +-
 common/usb_storage.c                           |   37 +-
 configs/sandbox_noblk_defconfig                |   98 ++
 disk/part.c                                    |   22 +-
 drivers/Makefile                               |    1 +
 drivers/block/Kconfig                          |    5 +-
 drivers/block/Makefile                         |    8 +-
 drivers/block/{disk-uclass.c => ahci-uclass.c} |    6 +-
 drivers/block/blk-uclass.c                     |  324 ++++++
 drivers/block/blk_legacy.c                     |  258 +++++
 drivers/block/sandbox.c                        |  103 +-
 drivers/block/sandbox_scsi.c                   |   29 +
 drivers/block/sata_sandbox.c                   |   33 +
 drivers/block/sym53c8xx.c                      |    2 +-
 drivers/block/systemace.c                      |  110 +-
 drivers/mmc/mmc.c                              |   24 +-
 drivers/pci/pci.c                              |    4 -
 fs/fat/fat.c                                   |    2 +-
 include/blk.h                                  |  226 +++-
 include/config_cmd_all.h                       |    2 +-
 include/config_distro_bootcmd.h                |    6 +-
 include/config_fallbacks.h                     |    2 +-
 include/configs/MPC8544DS.h                    |    2 +-
 include/configs/MPC8572DS.h                    |    2 +-
 include/configs/MPC8610HPCD.h                  |    2 +-
 include/configs/MPC8641HPCN.h                  |    4 +-
 include/configs/PIP405.h                       |    2 +-
 include/configs/am57xx_evm.h                   |    2 +-
 include/configs/cm_t54.h                       |    2 +-
 include/configs/db-88f6820-gp.h                |    2 +-
 include/configs/dra7xx_evm.h                   |    2 +-
 include/configs/efi-x86.h                      |    2 +-
 include/configs/galileo.h                      |    2 +-
 include/configs/highbank.h                     |    2 +-
 include/configs/ls1043aqds.h                   |    2 +-
 include/configs/ls2080aqds.h                   |    2 +-
 include/configs/ls2080ardb.h                   |    2 +-
 include/configs/omap5_uevm.h                   |    2 +-
 include/configs/qemu-x86.h                     |    2 +-
 include/configs/sandbox.h                      |   23 +
 include/configs/sbc8641d.h                     |    2 -
 include/configs/sunxi-common.h                 |    2 +-
 include/configs/x86-common.h                   |    2 +-
 include/configs/xilinx_zynqmp.h                |    2 +-
 include/dm/uclass-id.h                         |    2 +-
 include/ide.h                                  |    8 +
 include/iotrace.h                              |    5 +-
 include/part.h                                 |   15 -
 include/systemace.h                            |   17 -
 include/usb.h                                  |    1 -
 75 files changed, 3392 insertions(+), 2308 deletions(-)
 create mode 100644 common/ide.c
 create mode 100644 common/sata.c
 create mode 100644 common/scsi.c
 create mode 100644 configs/sandbox_noblk_defconfig
 rename drivers/block/{disk-uclass.c => ahci-uclass.c} (72%)
 create mode 100644 drivers/block/blk_legacy.c
 create mode 100644 drivers/block/sandbox_scsi.c
 create mode 100644 drivers/block/sata_sandbox.c
 delete mode 100644 include/systemace.h

-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2016-05-01 18:56 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-10  2:44 [U-Boot] [PATCH 00/44] dm: blk: Add more driver-model support for block devices Simon Glass
2016-04-10  2:44 ` [U-Boot] [PATCH 01/44] Revert "dm: sandbox: Drop the pre-DM host implementation" Simon Glass
2016-04-10  2:44 ` [U-Boot] [PATCH 02/44] dm: sandbox: Add a board for sandbox without CONFIG_BLK Simon Glass
2016-04-10  2:44 ` [U-Boot] [PATCH 03/44] pci: Drop CONFIG_SYS_SCSI_SCAN_BUS_REVERSE Simon Glass
2016-04-11  5:02   ` Bin Meng
2016-04-10  2:44 ` [U-Boot] [PATCH 04/44] dm: Rename disk uclass to ahci Simon Glass
2016-04-10  2:44 ` [U-Boot] [PATCH 05/44] Allow iotrace byte access to use an address of any size Simon Glass
2016-04-12 20:00   ` Stephen Warren
2016-04-10  2:44 ` [U-Boot] [PATCH 06/44] sandbox: Add string and 16-bit I/O functions Simon Glass
2016-04-12 20:02   ` Stephen Warren
2016-04-10  2:44 ` [U-Boot] [PATCH 07/44] sandbox: Add dummy SCSI functions Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 08/44] sandbox: Add dummy SATA functions Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 09/44] dm: scsi: Remove the forward declarations Simon Glass
2016-04-12 20:04   ` Stephen Warren
2016-04-10  2:45 ` [U-Boot] [PATCH 10/44] dm: scsi: Fix up code style Simon Glass
2016-04-12 20:05   ` Stephen Warren
2016-04-10  2:45 ` [U-Boot] [PATCH 11/44] dm: ide: Correct various code style problems Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 12/44] dm: ide: Remove the forward declarations Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 13/44] dm: sata: Fix code style problems in cmd/sata.c Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 14/44] dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSI Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 15/44] dm: blk: Add a legacy block interface Simon Glass
2016-04-12 20:28   ` Stephen Warren
2016-05-01 18:56     ` Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 16/44] dm: systemace: " Simon Glass
2016-04-12 20:31   ` Stephen Warren
2016-05-01 18:56     ` Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 17/44] dm: sandbox: Add a legacy host " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 18/44] dm: usb: Add a legacy block interface for USB storage Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 19/44] dm: mmc: Add a legacy block interface for MMC Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 20/44] dm: mmc: Add an implementation of the 'devnum' functions Simon Glass
2016-04-12 20:40   ` Stephen Warren
2016-05-01 18:56     ` Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 21/44] dm: scsi: Separate the non-command code into its own file Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 22/44] dm: ide: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 23/44] dm: sata: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 24/44] dm: disk: Use legacy block driver info for block device access Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 25/44] dm: usb: Drop the get_dev() function Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 26/44] dm: ide: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 27/44] dm: mmc: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 28/44] dm: scsi: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 29/44] dm: sata: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 30/44] dm: systemace: " Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 31/44] dm: blk: Drop the systemace.h header Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 32/44] dm: sandbox: Drop the host_get_dev() function Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 33/44] dm: part: Drop the get_dev() method Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 34/44] dm: ide: Add support for driver-model block devices Simon Glass
2016-04-12 20:49   ` Stephen Warren
2016-05-01 18:56     ` Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 35/44] dm: sandbox: Enable IDE Simon Glass
2016-04-12 20:50   ` Stephen Warren
2016-05-01 18:56     ` Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 36/44] dm: scsi: Add support for driver-model block devices Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 37/44] dm: sandbox: Enable SCSI Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 38/44] dm: sata: Add support for driver-model block devices Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 39/44] dm: sandbox: Enable SATA Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 40/44] dm: blk: Allow blk_create_device() to allocate the device number Simon Glass
2016-04-12 20:56   ` Stephen Warren
2016-05-01 18:56     ` Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 41/44] dm: blk: Add a easier way to create a named block device Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 42/44] dm: systemace: Reorder function to avoid forward declarataions Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 43/44] dm: systemace: Add driver-mode block-device support Simon Glass
2016-04-10  2:45 ` [U-Boot] [PATCH 44/44] dm: sandbox: Enable systemace Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox