21 Feb, 2014

1 commit


09 Jan, 2014

1 commit

  • Provide a way to use any host file or device as a block device in U-Boot.
    This can be used to provide filesystem access within U-Boot to an ext2
    image file on the host, for example.

    The support is plumbed into the filesystem and partition interfaces.

    We don't want to print a message in the driver every time we find a missing
    device. Pass the information back to the caller where a message can be printed
    if desired.

    Signed-off-by: Henrik Nordström
    Signed-off-by: Simon Glass
    - Removed change to part.c get_device_and_partition()

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

    Henrik Nordström
     

04 Dec, 2013

2 commits

  • Align the ATA ID buffer to the cache-line boundary. This gets rid
    of the below error mesages on ARM v7 platforms.

    scanning bus for devices...
    ERROR: v7_dcache_inval_range - start address is not aligned - 0xfee48618
    ERROR: v7_dcache_inval_range - stop address is not aligned - 0xfee48818

    CC: Aneesh V
    Signed-off-by: Roger Quadros

    Roger Quadros
     
  • If malloc() fails, we don't want to continue in ahci_init() and
    ahci_init_one(). Also print a more informative error message on
    malloc() failures.

    CC: Rob Herring
    Signed-off-by: Roger Quadros

    Roger Quadros
     

01 Nov, 2013

1 commit


15 Oct, 2013

1 commit


20 Sep, 2013

1 commit


07 Sep, 2013

8 commits


25 Jul, 2013

1 commit


24 Jul, 2013

2 commits


26 Jun, 2013

1 commit


02 May, 2013

1 commit


02 Apr, 2013

1 commit

  • 'bool' is defined in random places. This patch consolidates them into a
    single header file include/linux/types.h, using stdbool.h introduced in C99.

    All other #define, typedef and enum are removed. They are all consistent with
    true = 1, false = 0.

    Replace FALSE, False with false. Replace TRUE, True with true.
    Skip *.py, *.php, lib/* files.

    Signed-off-by: York Sun

    York Sun
     

12 Mar, 2013

1 commit


04 Feb, 2013

3 commits


05 Nov, 2012

1 commit

  • sata_sil.c:371:7: warning: symbol 'sil_sata_rw_lba28' was not declared. Should it be static?
    sata_sil.c:399:7: warning: symbol 'sil_sata_rw_lba48' was not declared. Should it be static?
    sata_sil.c:429:6: warning: symbol 'sil_sata_cmd_flush_cache' was not declared. Should it be static?
    sata_sil.c:441:6: warning: symbol 'sil_sata_cmd_flush_cache_ext' was not declared. Should it be static?
    sata_sil.c:489:7: warning: symbol 'sata_read' was not declared. Should it be static?
    sata_sil.c:505:7: warning: symbol 'sata_write' was not declared. Should it be static?
    sata_sil.c:526:5: warning: symbol 'init_sata' was not declared. Should it be static?
    sata_sil.c:588:5: warning: symbol 'scan_sata' was not declared. Should it be static?
    fsl_sata.c:59:6: warning: symbol 'dprint_buffer' was not declared. Should it be static?
    fsl_sata.c:187:42: warning: incorrect type in assignment (different base types)
    fsl_sata.c:187:42: expected unsigned int [unsigned] [usertype] cda
    fsl_sata.c:187:42: got restricted __le32 [usertype]
    fsl_sata.c:291:6: warning: symbol 'fsl_sata_hardware_reset' was not declared. Should it be static?
    fsl_sata.c:418:27: warning: incorrect type in assignment (different base types)
    fsl_sata.c:418:27: expected unsigned int [unsigned] [usertype] dba
    fsl_sata.c:418:27: got restricted __le32 [usertype]
    fsl_sata.c:424:41: warning: incorrect type in assignment (different base types)
    fsl_sata.c:424:41: expected unsigned int [unsigned] [usertype] ext_c_ddc
    fsl_sata.c:424:41: got restricted __le32 [usertype]
    fsl_sata.c:431:41: warning: incorrect type in assignment (different base types)
    fsl_sata.c:431:41: expected unsigned int [unsigned] [usertype] ext_c_ddc
    fsl_sata.c:431:41: got restricted __le32 [usertype]
    fsl_sata.c:442:22: warning: incorrect type in assignment (different base types)
    fsl_sata.c:442:22: expected unsigned int [unsigned] [usertype] cda
    fsl_sata.c:442:22: got restricted __le32 [usertype]
    fsl_sata.c:446:31: warning: incorrect type in assignment (different base types)
    fsl_sata.c:446:31: expected unsigned int [unsigned] [usertype] prde_fis_len
    fsl_sata.c:446:31: got restricted __le32 [usertype]
    fsl_sata.c:448:22: warning: incorrect type in assignment (different base types)
    fsl_sata.c:448:22: expected unsigned int [unsigned] [usertype] ttl
    fsl_sata.c:448:22: got restricted __le32 [usertype]
    fsl_sata.c:460:28: warning: incorrect type in assignment (different base types)
    fsl_sata.c:460:28: expected unsigned int [unsigned] [usertype] attribute
    fsl_sata.c:460:28: got restricted __le32 [usertype]
    fsl_sata.c:623:6: warning: symbol 'fsl_sata_flush_cache' was not declared. Should it be static?
    fsl_sata.c:667:5: warning: symbol 'fsl_sata_rw_ncq_cmd' was not declared. Should it be static?
    fsl_sata.c:710:6: warning: symbol 'fsl_sata_flush_cache_ext' was not declared. Should it be static?
    fsl_sata.c:725:6: warning: symbol 'fsl_sata_software_reset' was not declared. Should it be static?
    fsl_sata.c:760:5: warning: symbol 'ata_low_level_rw_lba48' was not declared. Should it be static?
    fsl_sata.c:795:5: warning: symbol 'ata_low_level_rw_lba28' was not declared. Should it be static?

    the following compiler warnings show up after fixing the above, so
    remove those three functions:

    fsl_sata.c:59:13: warning: 'dprint_buffer' defined but not used [-Wunused-function]
    fsl_sata.c:291:13: warning: 'fsl_sata_hardware_reset' defined but not used [-Wunused-function]
    fsl_sata.c:726:13: warning: 'fsl_sata_software_reset' defined but not used [-Wunused-function]

    Other than that, the following are fixed by __iomem annotation:

    fsl_sata.c:84:39: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:84:39: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:84:39: got unsigned int volatile *addr
    fsl_sata.c:172:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:172:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:172:26: got unsigned int *
    fsl_sata.c:175:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:175:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:175:19: got unsigned int *
    fsl_sata.c:181:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:181:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:181:19: got unsigned int *
    fsl_sata.c:184:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:184:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:184:26: got unsigned int *
    fsl_sata.c:186:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:186:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:186:19: got unsigned int *
    fsl_sata.c:189:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:189:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:189:26: got unsigned int *
    fsl_sata.c:191:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:191:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:191:19: got unsigned int *
    fsl_sata.c:194:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:194:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:194:26: got unsigned int *
    fsl_sata.c:195:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:195:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:195:19: got unsigned int *
    fsl_sata.c:198:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:198:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:198:19: got unsigned int *
    fsl_sata.c:201:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:201:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:201:19: got unsigned int *
    fsl_sata.c:204:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:204:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:204:26: got unsigned int *
    fsl_sata.c:205:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:205:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:205:19: got unsigned int *
    fsl_sata.c:208:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:208:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:208:26: got unsigned int *
    fsl_sata.c:209:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:209:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:209:19: got unsigned int *
    fsl_sata.c:212:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:212:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:212:26: got unsigned int *
    fsl_sata.c:213:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:213:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:213:19: got unsigned int *
    fsl_sata.c:216:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:216:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:216:19: got unsigned int *
    fsl_sata.c:219:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:219:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:219:19: got unsigned int *
    fsl_sata.c:222:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:222:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:222:19: got unsigned int *
    fsl_sata.c:225:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:225:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:225:26: got unsigned int *
    fsl_sata.c:227:19: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:227:19: expected unsigned int volatile [noderef] *addr
    fsl_sata.c:227:19: got unsigned int *
    fsl_sata.c:242:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:242:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:242:26: got unsigned int *
    fsl_sata.c:256:32: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:256:32: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:256:32: got unsigned int *
    fsl_sata.c:262:26: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:262:26: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:262:26: got unsigned int *
    fsl_sata.c:274:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:274:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:274:53: got unsigned int *
    fsl_sata.c:275:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:275:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:275:53: got unsigned int *
    fsl_sata.c:276:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:276:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:276:53: got unsigned int *
    fsl_sata.c:277:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:277:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:277:53: got unsigned int *
    fsl_sata.c:278:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:278:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:278:53: got unsigned int *
    fsl_sata.c:279:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:279:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:279:53: got unsigned int *
    fsl_sata.c:280:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:280:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:280:53: got unsigned int *
    fsl_sata.c:281:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:281:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:281:53: got unsigned int *
    fsl_sata.c:282:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:282:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:282:53: got unsigned int *
    fsl_sata.c:283:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:283:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:283:53: got unsigned int *
    fsl_sata.c:284:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:284:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:284:53: got unsigned int *
    fsl_sata.c:285:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:285:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:285:53: got unsigned int *
    fsl_sata.c:286:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:286:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:286:53: got unsigned int *
    fsl_sata.c:287:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:287:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:287:53: got unsigned int *
    fsl_sata.c:288:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:288:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:288:53: got unsigned int *
    fsl_sata.c:289:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:289:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:289:53: got unsigned int *
    fsl_sata.c:290:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:290:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:290:53: got unsigned int *
    fsl_sata.c:291:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:291:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:291:53: got unsigned int *
    fsl_sata.c:292:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:292:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:292:53: got unsigned int *
    fsl_sata.c:293:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:293:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:293:53: got unsigned int *
    fsl_sata.c:294:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:294:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:294:53: got unsigned int *
    fsl_sata.c:295:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:295:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:295:53: got unsigned int *
    fsl_sata.c:296:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:296:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:296:53: got unsigned int *
    fsl_sata.c:297:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:297:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:297:53: got unsigned int *
    fsl_sata.c:298:53: warning: incorrect type in argument 1 (different address spaces)
    fsl_sata.c:298:53: expected unsigned int const volatile [noderef] *addr
    fsl_sata.c:298:53: got unsigned int *

    Signed-off-by: Kim Phillips

    Kim Phillips
     

03 Nov, 2012

14 commits

  • Currently, this driver uses a 28bit interface to AHCI, this
    limits the number of blocks addressable to 2^28, or the max
    disk size to 512(2^28) or about 137GB. This change allows
    supporting drives up to about 2TB.

    Testing this is a bit difficult. There is test code that
    can be inserted into U-Boot that will write test patterns
    into certain unused blocks. These patterns can be manually
    checked using 'dd' after boot. Another way is to confirm the
    original error that exposed this bug is fixed. IOW: see if
    AU (Auto Update) will now work on the drive. Also, check
    that there are no warning messages from the 'cgpt' utility.

    Signed-off-by: Walter Murphy
    Signed-off-by: Simon Glass

    Walter Murphy
     
  • Writes in u-boot are so rare, and the logic to know when is
    the last write and do a flush only there is sufficiently
    difficult. Just do a flush after every write. This incurs,
    usually, one extra flush when the rare writes do happen.

    Signed-off-by: Marc Jones
    Signed-off-by: Simon Glass

    Marc Jones
     
  • Add HDD handling to the SSD-only AHCI driver, by separately dealing with
    spin-up and link-up.

    Signed-off-by: Marc Jones
    Signed-off-by: Simon Glass

    Marc Jones
     
  • Note: These are timeout values and not delay values, so the event being
    timed out will complete whenever it is actually ready, with a
    measurement granularity of 1 millisecond, up till the timeout value.
    Therefore, there is no effect on SSD booting.

    The values were determined by instrumenting the code and measuring the
    actual time taken by several different models of HDD for each of the
    parameters and then adding 50% more for the spinup value and just
    doubling the command timeout value.

    Signed-off-by: Walter Murphy
    Signed-off-by: Simon Glass

    Walter Murphy
     
  • Exynos5 automatically performs DMA when the SATA controller executes
    commands. This adds the necessary dcache-to-memory flush &
    invalidation calls to allow the DMA to properly function.

    Signed-off-by: Taylor Hutt
    Signed-off-by: Simon Glass

    Taylor Hutt
     
  • Update the assignment of various physical memory buffers used by the
    SATA controller to explicitly be denoted as physical addresses.

    The memory is identity-mapped, so these function calls are a nop, but
    they provide good semantic documentation for any maintainers.

    The return value of virt_to_phys() is 'unsigned long'. On machines
    where sizeof(unsigned long) != sizeof(pointer), a cast through
    (uintptr_t) is needed to appease the compiler due to the potential of
    losing the upper 32 bits of the address.

    In compilation this scenario, a physical address could be 64-bits, yet
    the C pointer environment only allows 32-bit addresses; the constraint
    is that pointers cannot address more than 4Gb of memory and if
    virt_to_phys() ever returns an out-of-range value for the physical
    address, there are issues with emmory mapping which must be solved.
    However, since the memory is identify mappeed, there is no problem
    introducing the cast: the original pointer will reside in 32-bits, so
    the physical address will also be within in 32-bits.

    Signed-off-by: Taylor Hutt
    Signed-off-by: Simon Glass

    Taylor Hutt
     
  • This fixes a spelling error in a message which can be output to the
    console.

    Signed-off-by: Taylor Hutt
    Signed-off-by: Simon Glass

    Taylor Hutt
     
  • This cleanup replaces the hardcoded use of '20', which represents the
    number of bytes in the FIS, with sizeof(fis).

    Signed-off-by: Taylor Hutt
    Signed-off-by: Simon Glass

    Taylor Hutt
     
  • In the structure returned by the ATA identify device command, there are two
    fields which describe the device capacity. One is a 32 bit data type which
    reports the number of sectors as a 28 bit LBA, and the other is a 64 bit data
    type which is for a 48 bit LBA. If the device doesn't support 48 bit LBAs,
    the small value is the only value with the correct size. If it supports more,
    if the number of sectors is small enough to fit into 28 bits, both fields
    reflect the correct value. If it's too large, the smaller field has 28 bits of
    1s, 0xfffffff, and the other field has the correct value.

    The AHCI driver is implemented by attaching to the generic SCSI code and
    translating on the fly between SCSI binary data structures and AHCI data
    structures. It responds to requests to execute specific SCSI commands by
    executing the equivalent AHCI commands and then crafting a response which
    matches what a SCSI disk would send.

    The AHCI driver now considers both fields and chooses the correct one when
    implementing both the SCSI READ CAPACITY (10) and READ CAPACITY (16) commands.

    Signed-off-by: Gabe Black
    Signed-off-by: Simon Glass

    Gabe Black
     
  • The "scsi write" command requires support from underlying driver.
    This CL enables SCSI_WRITE10 in AHCI driver.

    Tested in U-Boot console, try to i/o with sector #64:
    scsi read 1000 40 1
    md.b 1000 200 # check if things are not 0xcc
    mw.b 1000 cc 200 # try to fill with 0xcc
    scsi write 1000 40 1
    mw.b 1000 0 200 # fill with zero
    md.b 1000 200 # should be all 0
    scsi read 1000 40 1
    md.b 1000 200 # should be all 0xcc

    Signed-off-by: Hung-Te Lin
    Signed-off-by: Simon Glass

    Hung-Te Lin
     
  • This command doesn't really do anything when talking to a SATA device, and
    sending it confuses some of them. This change makes sending the command
    optional, and defaults to not. The situations where it should be sent are not
    the common case.

    With the standard SSD in the machine, here are some times with the option
    turned off:
    1. 8277
    2. 8273
    3. 8050

    And turned on:
    1. 8303
    2. 8155
    3. 8276

    Sending that command seems to have no meaningful effect on performance.

    This fixes problems with an SSD marked Toshiba NV6424, Taiwan 11159AE P
    and TC58NVG5D2FTA10.

    Signed-off-by: Gabe Black
    Signed-off-by: Taylor Hutt
    Signed-off-by: Simon Glass

    Gabe Black
     
  • - 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
     
  • - remove unused ssleep macro
    - add some useful debugging information

    Signed-off-by: Stefan Reinauer
    Signed-off-by: Simon Glass

    Stefan Reinauer
     
  • The existing code waits a whole second for the AHCI controller to reset.
    Instead, let's poll the status register to see if the reset has
    succeeded and return earlier if possible. This brings down the time for
    AHCI probing from 1s to 20ms.

    Signed-off-by: Stefan Reinauer
    Signed-off-by: Simon Glass

    Stefan Reinauer