28 Nov, 2017

1 commit


17 Aug, 2017

1 commit


01 Aug, 2017

1 commit


12 Jul, 2017

5 commits

  • Some AHCI drivers use SCSI under the hood. Rather than making the AHCI
    driver be in the SCSI uclass it makes sense to have the AHCI device create
    a SCSI device as a child. That way we can handle any AHCI-specific
    operations rather than trying to pretend tha the device is just SCSI.

    To handle this we need to provide a way for AHCI drivers to bind a SCSI
    device as its child, and probe it. Add functions for this.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • With driver model we cannot have static data or assume that there is only
    one device of each time. Adjust the code so that 'probe_ent' is not needed
    with driver model. Add a new ahci_init_dm() function which can init AHCI
    for driver model without re-allocating the uclass data. Move over the only
    existing driver to use this new function.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • Two AHCI drivers use SCSI with CONFIG_DM_SCSI. The SCSI uclass calls
    scsi_low_level_init() which is implemented by ahci.c. If
    CONFIG_SCSI_AHCI_PLAT is defined it does one thing and if it is not
    it does something else.

    We don't need to call through scsi_low_level_init() to get the init
    completed. Instead, adjust the two drivers to call into AHCI directly.
    Drop the post-probe init in the SCSI uclass. This means that driver model
    doesn't need to use scsi_low_level_init(). It is a legacy function and
    driver model should use a driver's probe() method instead.

    While we are here, add a comment to the top of the file explaining what
    ahci.c does.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • This array relates to the AHCI controller so should be exist out on its
    own in the file. Move it into the structure. Adjust functions that need
    access to this to take the structure as a parameter.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • This is not a very useful name since once it is probed it still hangs
    around. With driver model we will use uclass data for this, so rename the
    struct.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     

20 Dec, 2016

1 commit

  • All sata based drivers are bind and corresponding block
    device is created. Based on this find_scsi_device() is able
    to get back block device based on scsi_curr_dev pointer.

    intr_scsi() is commented now but it can be replaced by calling
    find_scsi_device() and scsi_scan().

    scsi_dev_desc[] is commented out but common/scsi.c heavily depends on
    it. That's why CONFIG_SYS_SCSI_MAX_DEVICE is hardcoded to 1 and symbol
    is reassigned to a block description allocated by uclass.
    There is only one block description by device now but it doesn't need to
    be correct when more devices are present.

    scsi_bind() ensures corresponding block device creation.
    uclass post_probe (scsi_post_probe()) is doing low level init.

    SCSI/SATA DM based drivers requires to have 64bit base address as
    the first entry in platform data structure to setup mmio_base.

    Signed-off-by: Michal Simek
    Reviewed-by: Simon Glass

    Michal Simek
     

09 Dec, 2016

1 commit


08 Dec, 2016

1 commit

  • All sata based drivers are bind and corresponding block
    device is created. Based on this find_scsi_device() is able
    to get back block device based on scsi_curr_dev pointer.

    intr_scsi() is commented now but it can be replaced by calling
    find_scsi_device() and scsi_scan().

    scsi_dev_desc[] is commented out but common/scsi.c heavily depends on
    it. That's why CONFIG_SYS_SCSI_MAX_DEVICE is hardcoded to 1 and symbol
    is reassigned to a block description allocated by uclass.
    There is only one block description by device now but it doesn't need to
    be correct when more devices are present.

    scsi_bind() ensures corresponding block device creation.
    uclass post_probe (scsi_post_probe()) is doing low level init.

    SCSI/SATA DM based drivers requires to have 64bit base address as
    the first entry in platform data structure to setup mmio_base.

    Signed-off-by: Michal Simek
    Reviewed-by: Simon Glass
    Series-changes: 2
    - Use CONFIG_DM_SCSI instead of mix of DM_SCSI and DM_SATA
    Ceva sata has never used sata commands that's why keep it in
    SCSI part only.
    - Separate scsi_scan() for DM_SCSI and do not change cmd/scsi.c
    - Extend platdata

    Series-changes: 3
    - Fix scsi_scan return path
    - Fix header location uclass-internal.h
    - Add scsi_max_devs under !DM_SCSI
    - Add new header device-internal because of device_probe()
    - Redesign block device creation algorithm
    - Use device_unbind in error path
    - Create block device with id and lun numbers (lun was there in v2)
    - Cleanup dev_num initialization in block device description
    with fixing parameters in blk_create_devicef
    - Create new Kconfig menu for SATA/SCSI drivers
    - Extend description for DM_SCSI
    - Fix Kconfig dependencies
    - Fix kernel doc format in scsi_platdata
    - Fix ahci_init_one - vendor variable

    Series-changes: 4
    - Fix Kconfig entry
    - Remove SPL ifdef around SCSI uclass
    - Clean ahci_print_info() ifdef logic

    Michal Simek
     

13 Jan, 2016

1 commit


10 Jul, 2015

1 commit

  • When compling under 64bit platforms, there are lots of warnings,
    like:

    drivers/block/ahci.c:114:18: warning: cast to pointer from integer
    of different size [-Wint-to-pointer-cast]
    u8 *port_mmio = (u8 *)probe_ent->port[port].port_mmio;
    ^
    drivers/block/ahci.c: In function ?.hci_host_init?.
    drivers/block/ahci.c:218:49: warning: cast from pointer to integer
    of different size [-Wpointer-to-int-cast]
    probe_ent->port[i].port_mmio = ahci_port_base((u32) mmio, i);

    ......

    Reviewed-by: Simon Glass
    Signed-off-by: Shaohui Xie
    Signed-off-by: Tang Yuantian

    Tang Yuantian
     

19 Apr, 2015

1 commit

  • Don't store it in a u32.

    Don't dereference the bus address as if it were a virtual address
    (fixes 284231e49a2b4 ("ahci: Support splitting of read transactions
    into multiple chunks")).

    Fixes crash on boot in MPC8641HPCN_36BIT target.

    Signed-off-by: Scott Wood
    Cc: Vadim Bendebury
    Acked-by: York Sun

    Scott Wood
     

06 Jan, 2015

1 commit


31 Jul, 2014

1 commit

  • This enables the necessary clocks, in AHB0 and in PLL6_CFG. This is done
    for sun7i only since I don't have access to any other sunxi platforms
    with sata included.

    The PHY setup is derived from the Alwinner releases and Linux, but is mostly
    undocumented.

    The Allwinner AHCI controller also requires some magic (and, again,
    undocumented) DMA initialisation when starting a port. This is added under a
    suitable ifdef.

    This option is enabled for Cubieboard, Cubieboard2 and Cubietruck based on
    contents of Linux DTS files, including SATA power pin config taken from the
    DTS. All build tested, but runtime tested on Cubieboard2 and Cubietruck only.

    Signed-off-by: Ian Campbell
    Acked-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Ian Campbell
     

07 Sep, 2013

2 commits


24 Jul, 2013

1 commit


03 Nov, 2012

1 commit

  • - print the correct speed
    - print all the AHCI capability flags
    (information taken from Linux kernel driver)
    - clean up some comments

    For example, this might show the following string:
    AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3 impl SATA mode

    Signed-off-by: Stefan Reinauer

    Commit-Ready: Stefan Reinauer
    Signed-off-by: Simon Glass
    Tested-by: Stefan Reinauer

    Stefan Reinauer
     

15 May, 2012

1 commit


26 Jul, 2011

1 commit


29 Jul, 2009

1 commit


21 May, 2008

1 commit

  • This commit gets rid of a huge amount of silly white-space issues.
    Especially, all sequences of SPACEs followed by TAB characters get
    removed (unless they appear in print statements).

    Also remove all embedded "vim:" and "vi:" statements which hide
    indentation problems.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

23 Aug, 2006

1 commit