19 May, 2020

1 commit

  • Current driver calls the devfdt_get_addr to get the base address
    of lpi2c controller in each sub-functions. Since the devfdt_get_addr
    accesses the DTB and translate the address, it introduces much
    overhead.
    Improve the codes to use private variable which has recorded the
    base address from probe.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 59f728f4a2bdd6b005f7e9f3a33f84c7bce0f677)

    Ye Li
     

27 Apr, 2020

6 commits

  • Add the fuse checking in drivers, when the module is disabled in fuse,
    the driver will not work.

    Changed drivers: BEE, GPMI, APBH-DMA, ESDHC, FEC, QSPI, ECSPI, I2C,
    USB-EHCI, GIS, LCDIF and EPDC.

    Signed-off-by: Ye Li
    (cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e)
    (cherry picked from commit 2d3b5df8530cd5ef883750378838dea7c40259af)
    (cherry picked from commit 6e8c9ae136bee8ec0121c1db4b935510caad09db)
    (cherry picked from commit 99b54a6965904a879afdb6883a519de726cb4e96)

    Ye Li
     
  • When we probe device with virtual i2c driver, it will definitely
    fail to power up the PD. Becasue the resource is owned by M4. So
    set this driver to ignore the power up result

    Signed-off-by: Ye Li
    (cherry picked from commit 7f753d1b5950015b11be58aa937e5c14b9f26d7a)
    (cherry picked from commit 6ac1ee462c7000e7017c55f76550551a6267dc58)

    Ye Li
     
  • Add a new private flag I2C_M_SRTM_STOP(0x0200) to indicate if STOP
    is needed for current message.
    When reading/writing registers for slave devices, generally we have two messages,
    the first message writes the register address, second message reads/writes the value.
    Only the last message needs STOP. But previously M4 sends STOP for each message,
    this causes some slave devices treat it as end of transfer. Then, second message won't
    have any effect. To solve the problem, we introduce this private STOP flag, so M4 can
    STOP according to the flag.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit e8f70409620da897917dfa29dbe65be82c9129fd)
    (cherry picked from commit b165fa3ee0ebabf77d4f68ee61d98a3cc5adbba5)

    Ye Li
     
  • When we probe device with virtual i2c driver, assigning default clock
    will definitely return false, becasue the resource is owned by M4. So
    set this driver to ignore the default clocks

    Signed-off-by: Ye Li
    (cherry picked from commit 76e89f4a9a2ed1331572f60b30854463afdfed50)

    Ye Li
     
  • We provide override binding function, so the ARCH level can use it
    to determine if it is ok to bind with lpi2c driver.

    Signed-off-by: Ye Li
    (cherry picked from commit b19418270a3d532eacb1069606fa2ab100e04601)
    (cherry picked from commit 3624faca59ed1dda7cd5f9c688598ea4941cac61)

    Ye Li
     
  • Add virtual i2c driver which replies on the VService to send SRTM i2c
    messages with M4.
    For each output on i2c mux, M4 side abstracts a i2c bus with special bus
    id. The virtual i2c mux follows basic mux design, but uses dedicated flag
    to pass the abstract bus id for the mux output to virtual i2c driver.

    Virtual i2c and virtual i2c mux will bind nodes with compatible string
    "fsl,imx-virt-i2c" and "fsl,imx-virt-i2c-mux".

    To support binding local i2c driver or virtual i2c driver at runtime. We
    provides a override function for the driver bind. ARCH level is responsible
    to implement it.

    Signed-off-by: Ye Li
    (cherry picked from commit 25095e9f0d9816c22da97945b66439dfa277aa2b)
    (cherry picked from commit c19550012c6143be0100a49485bf8452a90e9379)

    Ye Li
     

18 Feb, 2020

1 commit


11 Feb, 2020

1 commit


07 Feb, 2020

1 commit


06 Feb, 2020

2 commits

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present devres.h is included in all files that include dm.h but few
    make use of it. Also this pulls in linux/compat which adds several more
    headers. Drop the automatic inclusion and require files to include devres
    themselves. This provides a good indication of which files use devres.

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

    Simon Glass
     

04 Feb, 2020

1 commit


27 Jan, 2020

21 commits


18 Dec, 2019

1 commit


17 Dec, 2019

1 commit

  • Some devices (2 wire eeproms for example) use some bits from the chip
    address to represent the high bits of the offset instead of or as well
    as using multiple bytes for the offset, effectively stealing chip
    addresses on the bus.

    Add a chip offset mask that can be set for any i2c chip which gets
    filled with the offset overflow during offset setup.

    Signed-off-by: Robert Beckett
    Signed-off-by: Ian Ray
    Reviewed-by: Heiko Schocher

    Robert Beckett
     

15 Dec, 2019

4 commits

  • For Apollo Lake we need to take the I2C bus controller out of reset before
    using this. Add this functionality to the driver.

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

    Simon Glass
     
  • Allow this driver to set up an IO address in SPL using an 'early-regs'
    property. This allows SPL to use the I2C driver without having to enable
    the full PCI stack.

    Also split out ofdata_to_platdata in designware driver since this is more
    correct, and more convenient for the new logic.

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

    Simon Glass
     
  • Drivers are not allowed to use static data since they may be used in SPL
    where BSS is not available.

    It is possible that driver model may provide support for numbering devices
    in the future. But for now, move this to global_data.

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

    Simon Glass
     
  • This is hacked into the driver at present. It seems better to have it as
    a separate driver that uses the base driver. Create a new file and put
    the X86 code into it.

    Actually the Baytrail settings should really come from the device tree.

    Note that 'has_max_speed' is added as well. This is currently always false
    but since only Baytrail provides the config, it does not affect operation
    for other devices.

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

    Simon Glass