1. 15 11月, 2018 40 次提交
    • B
      video: simplefb: Remove DM_FLAG_PRE_RELOC flag · e3245e42
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      e3245e42
    • B
      sysreset: Remove DM_FLAG_PRE_RELOC flag in various drivers · ef329a6a
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      ef329a6a
    • B
      serial: Remove DM_FLAG_PRE_RELOC flag in various drivers · 46879196
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      46879196
    • B
      timer: Remove DM_FLAG_PRE_RELOC flag in various drivers · d7a184d4
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      d7a184d4
    • B
      ram: bmips: Remove DM_FLAG_PRE_RELOC flag · 05e42481
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      05e42481
    • B
      pinctrl: Remove DM_FLAG_PRE_RELOC flag in various drivers · ad0e8048
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      ad0e8048
    • B
      mmc: omap: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check · 223b10ca
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      223b10ca
    • B
      i2c: omap24xx: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check · e0cfc209
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      e0cfc209
    • B
      gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers · 695c4994
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NPatrick Delaunay <patrick.delaunay@st.com>
      695c4994
    • B
      clk: Remove DM_FLAG_PRE_RELOC flag in various drivers · e2508066
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      e2508066
    • B
      arm: stm32mp: Remove DM_FLAG_PRE_RELOC flag · 4854ebc5
      Bin Meng 提交于
      When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
      bound before relocation. However due to a bug in the DM core,
      the flag only takes effect when devices are statically declared
      via U_BOOT_DEVICE(). This bug has been fixed recently by commit
      "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
      lists_bind_fdt()", but with the fix, it has a side effect that
      all existing drivers that declared DM_FLAG_PRE_RELOC flag will
      be bound before relocation now. This may expose potential boot
      failure on some boards due to insufficient memory during the
      pre-relocation stage.
      
      To mitigate this potential impact, the following changes are
      implemented:
      
      - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
        only supports configuration from device tree (OF_CONTROL)
      - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
        is statically declared via U_BOOT_DEVICE()
      - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
        drivers that support both statically declared devices and
        configuration from device tree
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NPatrick Delaunay <patrick.delaunay@st.com>
      4854ebc5
    • S
      serial: ns16550: fix debug uart putc called before init · 6f57c344
      Simon Goldschmidt 提交于
      If _debug_uart_putc() is called before _debug_uart_init(), the
      ns16550 debug uart driver hangs in a tight loop waiting for the
      tx FIFO to get empty.
      
      As this can happen via a printf sneaking in before the port calls
      debug_uart_init(), let's rather ignore characters before the debug
      uart is initialized.
      
      This is done by reading the baudrate divisor and aborting if is zero.
      
      Tested on socfpga_cyclone5_socrates.
      Signed-off-by: NSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      6f57c344
    • L
      uclass: Use uclass_foreach_dev() macro instead of open coding · 81f351d6
      Liviu Dudau 提交于
      Use the uclass_foreach_dev() macro instead of the open coded version.
      Signed-off-by: NLiviu Dudau <liviu.dudau@foss.arm.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      81f351d6
    • B
      doc: Document virtio support · 216460ec
      Bin Meng 提交于
      Add REAME.virtio to describe the information about U-Boot support for
      VirtIO devices, including supported boards, build instructions, driver
      details etc.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      216460ec
    • B
      test: dm: virtio: Add test cases for virtio uclass · 4f89d494
      Bin Meng 提交于
      Now that we have a sandbox virtio transport driver, add some test
      cases to test virtio uclass driver.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      4f89d494
    • B
      virtio: Add a Sandbox transport driver · 640aae0f
      Bin Meng 提交于
      This driver provides support for Sandbox implementation of virtio
      transport driver which is used for testing purpose only.
      
      Two drivers are provided. The 2nd one is a driver that lacks the
      'notify' op.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      640aae0f
    • B
      virtio: net: Support non-legacy device · 699aae08
      Bin Meng 提交于
      For v1.0 compliant device, it always assumes the member 'num_buffers'
      exists in the struct virtio_net_hdr while the legacy driver only
      presented 'num_buffers' when VIRTIO_NET_F_MRG_RXBUF was negotiated.
      Without that feature the structure was 2 bytes shorter.
      
      Update the driver to support the non-legacy device.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      699aae08
    • B
      virtio: pci: Support non-legacy PCI transport device · 550435ed
      Bin Meng 提交于
      By default QEMU creates legacy PCI transport devices, but we can
      ask QEMU to create non-legacy one if we pass additional device
      property/value pairs in the command line:
      
        -device virtio-blk-pci,disable-legacy=true,disable-modern=false
      
      This adds a new driver driver to support non-legacy (modern) device
      mode. Previous driver/file name is changed accordingly.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      550435ed
    • B
      test: dm: pci: Add cases for finding next PCI capability APIs · 7a20614e
      Bin Meng 提交于
      Add test cases to cover the two newly added PCI APIs:
      dm_pci_find_next_capability() & dm_pci_find_next_ext_capability().
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      7a20614e
    • B
      dm: pci: Add APIs to find next capability and extended capability · a8c5f8d3
      Bin Meng 提交于
      This introduces two new APIs dm_pci_find_next_capability() and
      dm_pci_find_next_ext_capability() to get PCI capability address
      and PCI express extended capability address for a given PCI device
      starting from a given offset.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      a8c5f8d3
    • B
      x86: qemu: Imply virtio PCI transport and device drivers · c80c7798
      Bin Meng 提交于
      Add virtio drivers for QEMU x86 targets.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      c80c7798
    • B
      arm: qemu: Enumerate virtio bus during early boot · b9b5956e
      Bin Meng 提交于
      Currently devices on the virtio bus is not automatically enumerated,
      which means peripherals on the virtio bus are not discovered by their
      drivers. This uses board_init() to do the virtio enumeration.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      b9b5956e
    • B
      arm: qemu: Add a Kconfig in the board directory · 6f332765
      Bin Meng 提交于
      This adds a Kconfig file in the board directory, so that some
      board-specific options can be specified there.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      6f332765
    • B
      virtio: Add virtio over pci transport driver · 4135e107
      Bin Meng 提交于
      This adds a transport driver that implements UCLASS_VIRTIO for
      virtio over pci, which is commonly used on x86.
      
      It only supports the legacy interface of the pci transport, which
      is the default device that QEMU emulates.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      4135e107
    • B
      x86: Implement arch-specific io accessor routines · 3bf9a8e8
      Bin Meng 提交于
      At present the generic io{read,write}{8,16,32} routines only support
      MMIO access. With architecture like x86 that has a separate IO space,
      these routines cannot be used to access I/O ports.
      
      Implement x86-specific version to support both PIO and MMIO access,
      so that drivers for multiple architectures can use these accessors
      without the need to know whether it's MMIO or PIO.
      
      These are ported from Linux kernel lib/iomap.c, with slight changes.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      3bf9a8e8
    • B
      kconfig: Introduce HAVE_ARCH_IOMAP · 2895c4b7
      Bin Meng 提交于
      Introduce a new Kconfig option for architecture codes to control
      whether it provides io{read,write}{8,16,32} I/O accessor functions.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      2895c4b7
    • B
      riscv: qemu: Include some useful commands · 440d9a47
      Bin Meng 提交于
      With the virtio net and blk drivers, we can do more stuff with some
      useful commands. Imply those in the board Kconfig.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      440d9a47
    • B
      riscv: qemu: Enumerate virtio bus during early boot · 3c5196dc
      Bin Meng 提交于
      Currently devices on the virtio bus is not automatically enumerated,
      which means peripherals on the virtio bus are not discovered by their
      drivers. This uses board_init() to do the virtio enumeration.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      3c5196dc
    • T
      virtio: cmd: Add virtio command for virtio devices · 78e12901
      Tuomas Tynkkynen 提交于
      Add 'virtio' command in U-Boot command line.
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      78e12901
    • T
      virtio: Add block driver support · f4802209
      Tuomas Tynkkynen 提交于
      This adds virtio block device driver support.
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      f4802209
    • T
      blk: Introduce IF_TYPE_VIRTIO · 4ad54ec4
      Tuomas Tynkkynen 提交于
      This adds a new block interface type for VirtIO block devices.
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      4ad54ec4
    • B
      blk: Make blk_next_free_devnum() public · c879eeb7
      Bin Meng 提交于
      blk_next_free_devnum() can be helpful in some cases. Make it
      a public API.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      c879eeb7
    • B
      blk: Drop blk_prepare_device() · c515ee5c
      Bin Meng 提交于
      With the post_probe() changes, this API is no longer needed.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      c515ee5c
    • B
      blk: Call part_init() in the post_probe() method · d0851c89
      Bin Meng 提交于
      part_init() is currently called in every DM BLK driver, either
      in its bind() or probe() method. However we can use the BLK
      uclass driver's post_probe() method to do it automatically.
      
      Update all DM BLK drivers to adopt this change.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      d0851c89
    • B
      efi_driver: blk: Switch to use platdata_auto_alloc_size for the driver data · f26ce03b
      Bin Meng 提交于
      Currently the efi block driver uses priv_auto_alloc_size for the
      driver data, however that's only available after the device probe
      phase. In order to make it accessible in an earlier phase, switch
      to use platdata_auto_alloc_size instead.
      
      This patch is the prerequisite for the follow up patch of DM BLK
      driver changes to work with EFI loader.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      f26ce03b
    • B
      sandbox: blk: Switch to use platdata_auto_alloc_size for the driver data · 8f994c86
      Bin Meng 提交于
      Currently the sandbox block driver uses priv_auto_alloc_size for
      the driver data, however that's only available after the device
      probe phase. In order to make it accessible in an earlier phase,
      switch to use platdata_auto_alloc_size instead.
      
      This patch is the prerequisite for the follow up patch of DM BLK
      driver changes to work with Sandbox.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      8f994c86
    • B
      test: dm: blk: Correct blk_base test case · fa583f86
      Bin Meng 提交于
      The blk_base test case creates a USB mass storage block device with
      the Sandbox host block device as its parent. This does not make any
      sense and causes potential issue, for example if the test case tries
      to read/write anything on the USB mass storage block device it will
      definitely fail as its parent is not on USB bus at all.
      
      Correct the test case by creating another Sandbox host block device
      instead of the USB mass storage one and adjust the case accordingly.
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      fa583f86
    • T
      virtio: Add net driver support · f371ad30
      Tuomas Tynkkynen 提交于
      This adds virtio net device driver support.
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      f371ad30
    • B
      virtio: Add virtio over mmio transport driver · fdc4aca8
      Bin Meng 提交于
      VirtIO can use various different buses and virtio devices are
      commonly implemented as PCI devices. But virtual environments
      without PCI support (a common situation in embedded devices
      models) might use simple memory mapped device (“virtio-mmio”)
      instead of the PCI device.
      
      This adds a transport driver that implements UCLASS_VIRTIO for
      virtio over mmio.
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      fdc4aca8
    • T
      virtio: Add codes for virtual queue/ring management · c011641e
      Tuomas Tynkkynen 提交于
      This adds support for managing virtual queue/ring, the channel
      for high performance I/O between host and guest.
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      c011641e