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)
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) -
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 resultSigned-off-by: Ye Li
(cherry picked from commit 7f753d1b5950015b11be58aa937e5c14b9f26d7a)
(cherry picked from commit 6ac1ee462c7000e7017c55f76550551a6267dc58) -
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) -
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 clocksSigned-off-by: Ye Li
(cherry picked from commit 76e89f4a9a2ed1331572f60b30854463afdfed50) -
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) -
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)
18 Feb, 2020
1 commit
-
Unfortunately a recent change adjusted the order of the checks here such
that 400MHz now shows up as fast-plus speed (1Mbps). Fix it.Signed-off-by: Simon Glass
Fixes: d96440d1e3 ("i2c: designware_i2c: Add support for fast-plus speed")
11 Feb, 2020
1 commit
-
sandbox conversion to SDL2
TPM TEE driver
Various minor sandbox video enhancements
New driver model core utility functions
07 Feb, 2020
1 commit
-
Now that we have uclass_first_device_drvdata(), use it from the I2C driver
to reduce code duplication.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher
Reviewed-by: Bin Meng
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
-
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
04 Feb, 2020
1 commit
-
This adds DM_FLAG_PRE_RELOC flag to probe i2c driver
before relocationSigned-off-by: Biwen Li
Reviewed-by: Priyanka Jain
27 Jan, 2020
21 commits
-
Move some of the code currently in the ofdata_to_platdata() method to
probe() so that it is not executed when generating ACPI tables.Signed-off-by: Simon Glass
-
We want to be able to calculate the speed separately from actually setting
the speed, so we can generate the required ACPI tables. Split out the
calculation into its own function.Drop the double underscore on __dw_i2c_set_bus_speed while we are here.
That is reserved for compiler internals.Signed-off-by: Simon Glass
-
This is used to store the speed information for a bus. We want to provide
this to ACPI so that it can tell the kernel. Move this struct to the
header file so it can be accessed by the ACPI i2c implementation being
added later.Signed-off-by: Simon Glass
-
Fast-plus runs at 1MHz and is used by some devices. Add support for this.
Signed-off-by: Simon Glass
-
Convert the obvious uses of i2c bus speeds to use the enum.
Use livetree access for code changes.
Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Update this driver to use the new standard enums for speed.
Signed-off-by: Simon Glass
Reviewed-by: Patrick Delaunay
Tested-by: Patrick Delaunay
Reviewed-by: Heiko Schocher -
Update this driver to use the new standard enums for speed.
Note: This driver needs to move to driver model.
Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Update this driver to use the new standard enums for speed.
Note: This driver needs to move to driver model.
Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Update this driver to use the new standard enums for speed.
Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Update this driver to use the new standard enums for speed.
Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Some versions of this peripheral include a spike-suppression phase of the
bus. Add support for this.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
At present the driver can end up with timing parameters which are slightly
faster than those expected. It is possible to optimise the parameters to
get the best possible result.Create a new function to handle the timing calculation. This uses a table
of defaults for each speed mode rather than writing it in code.The function works by calculating the 'period' of each bit on the bus in
terms of the input clock to the controller (IC_CLK). It makes sure that
the constraints are met and that the different components of that period
add up correctly.This code was taken from coreboot which has ended up with this same
driver, but now in a much-different form.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Create a struct to hold the three timing parameters. This will make it
easier to move these calculations into a separate function in a later
patch.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Instead of passing this parameter into __dw_i2c_set_bus_speed(), pass in
the driver's private data, from which the function can obtain that
information. This allows the function to have access to the full state of
the driver.Signed-off-by: Sicomp_param1mon Glass
Reviewed-by: Heiko Schocher
Signed-off-by: Simon Glass -
The i2c controller defines a few timing properties. Read these in and
store them for use by the driver.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
At present the driver uses an approximation for the bus clock, e.g. 166MHz
instead of 166 2/3 MHz.This can result in small errors in the resulting I2C speed, perhaps 0.5%
or so.Adjust the existing code to start from the accurate figure, even if later
rounding reduces this accuracy.Update the bus speed code to work in KHz instead of MHz, which removes
most of the error.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Group these #defines into an enum to make it easier to understand the
relationship between them.Signed-off-by: Simon Glass
Reviewed-by: Jun Chen
Reviewed-by: Heiko Schocher -
Some SoCs support a higher speed than what is currently called 'max' in
this driver. Rename it to 'high' speed, which is the official name of the
3.4MHz speed.Signed-off-by: Simon Glass
Reviewed-by: Jun Chen
Reviewed-by: Heiko Schocher -
We use struct clk here so really should include this header file to avoid
build errors. Also switch the order of clk.h in the C file to match the
required code style.Signed-off-by: Simon Glass
Reviewed-by: Ley Foon Tan
Reviewed-by: Jun Chen
Reviewed-by: Heiko Schocher -
If a different input clock is required then the correct way to do this is
with a clock driver. Don't allow boards to override IC_CLK.Signed-off-by: Simon Glass
Reviewed-by: Heiko Schocher -
Some versions of this peripherals provide more control of the bus
behaviour. Add definitions for these registers.Signed-off-by: Simon Glass
Reviewed-by: Ley Foon Tan
Reviewed-by: Jun Chen
Reviewed-by: Heiko Schocher
18 Dec, 2019
1 commit
-
- Various x86 common codes updated for TPL/SPL
- I2C designware driver updated for PCI
- ICH SPI driver updated to support Apollo Lake
- Add Intel FSP2 base support
- Intel Apollo Lake platform specific drivers support
- Add a new board Google Chromebook Coral
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
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 -
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 -
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 -
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