Skip to content
Snippets Groups Projects
  1. Feb 06, 2020
  2. Jan 24, 2020
  3. Jan 17, 2020
  4. Jan 07, 2020
  5. Dec 17, 2019
  6. Dec 15, 2019
  7. Dec 10, 2019
  8. Dec 02, 2019
  9. Nov 14, 2019
  10. Nov 12, 2019
  11. Oct 27, 2019
  12. Oct 22, 2019
  13. Oct 15, 2019
  14. Oct 13, 2019
  15. Oct 08, 2019
    • Simon Glass's avatar
      sandbox: pci: Create a new sandbox_pci_read_bar() function · 75d8f494
      Simon Glass authored
      
      The code in swapcase can be used by other sandbox drivers. Move it into a
      common place to allow this.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Tested-by: default avatarBin Meng <bmeng.cn@gmail.com>
      [bmeng: remove inclusion of <asm/test.h> in pci_sandbox.c]
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      75d8f494
    • Simon Glass's avatar
      dm: pci: Add a function to read a PCI BAR · 33c215af
      Simon Glass authored
      
      At present PCI address transaction is not supported so drivers must
      manually read the correct BAR after reading the device tree info. The
      ns16550 has a suitable implementation, so move this code into the core
      DM support.
      
      Note that there is no live-tree equivalent at present.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Tested-by: default avatarBin Meng <bmeng.cn@gmail.com>
      [bmeng: correct the unclear comments in test.dts]
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      33c215af
    • Simon Glass's avatar
      pci: sandbox: Move the emulators into their own node · 9b69ba4a
      Simon Glass authored
      
      Sandbox pci works using emulation drivers which are currently children of
      the pci device:
      
      	pci-controller {
      		pci@1f,0 {
      			compatible = "pci-generic";
      			reg = <0xf800 0 0 0 0>;
      			emul@1f,0 {
      				compatible = "sandbox,swap-case";
      			};
      		};
      	};
      
      In this case the emulation device is attached to pci device on address
      f800 (device 1f, function 0) and provides the swap-case functionality.
      
      However this is not ideal, since every device on a PCI bus has a child
      device. This is only really the case for sandbox, but we want to avoid
      special-case code for sandbox.
      
      Worse, child devices cannot be probed before their parents. This forces
      us to use 'find' rather than 'get' to obtain the emulator device. In fact
      the emulator devices are never probed. There is code in
      sandbox_pci_emul_post_probe() which tries to track when emulators are
      active, but at present this does not work.
      
      A better approach seems to be to add a separate node elsewhere in the
      device tree, an 'emulation parent'. This could be given a bogus address
      (such as -1) to hide the emulators away from the 'pci' command, but it
      seems better to keep it at the root node to avoid such hacks.
      
      Then we can use a phandle to point from the device to the correct
      emulator, and only on sandbox. The code to find an emulator does not
      interfere with normal pci operation.
      
      Add a new UCLASS_PCI_EMUL_PARENT uclass which allows finding an emulator
      given a bus, and finding a bus given an emulator. Update the existing
      device trees and the code for finding an emulator.
      
      This brings PCI emulators more into line with I2C.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Tested-by: default avatarBin Meng <bmeng.cn@gmail.com>
      [bmeng: fix 3 typos in the commit message;
              encode bus number in the labels of swap_case_emul nodes;
              mention commit 4345998a in sandbox_pci_get_emul()]
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      9b69ba4a
    • Simon Glass's avatar
      sandbox: Allow use of real I/O with readl(), etc. · e77663cf
      Simon Glass authored
      
      At present these functions are stubbed out. For more comprehensive testing
      with PCI devices it is useful to be able to fully emulate I/O access. Add
      simple implementations for these.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Tested-by: default avatarBin Meng <bmeng.cn@gmail.com>
      [bmeng: change to use 'const void *' in sandbox_write();
              cast 'addr' in read/write macros in arch/sandbox/include/asm/io.h;
              remove the unnecessary cast in readq/writeq in nvme.h]
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      e77663cf
Loading