summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add a simple script to remove boardsSimon Glass2019-07-101-0/+150
| | | | | | | | | This script attempts to create a git commit which removes a single board. It is quite fallible and everything it does needs checking. But it can help speed up the process. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Chris Packham <judge.packham@gmail.com>
* patman: Update cover-coverage tests for Python 3Simon Glass2019-07-101-6/+9
| | | | | | | We need slightly different commands to run code coverage with Python 3. Update the RunTestCoverage() function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update the README.entries fileSimon Glass2019-07-101-0/+15
| | | | | | | | | A few minor changes have been made including one new entry. Update the documentation with: $ binman -E >tools/binman/README.entries Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Document parallel testsSimon Glass2019-07-101-0/+14
| | | | | | Since binman can run tests in parallel, document this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Read map files as textSimon Glass2019-07-101-1/+1
| | | | | | | | | | | | | | | | | These files are text files so should be read as such, so that string-equality assertions work as expected. With this binman tests work correctly on Python 2 and Python 3: PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt \ python ./tools/binman/binman -t Change first line of binman.py to end "python3": PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman \ python3 ./tools/binman/binman -t Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Fix up a format string in AssertInList()Simon Glass2019-07-101-1/+1
| | | | | | Add the missing 's' to the required '%s' here. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update 'text' entry for Python 3Simon Glass2019-07-101-3/+6
| | | | | | | This code reads a binary value and then uses it as a string to look up another value. Add conversions to make this work as expected on Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Update fmap code for Python 3Simon Glass2019-07-102-4/+11
| | | | | | | | This needs special care to ensure that the bytes type is used for binary data. Add conversion code to deal with strings and bytes correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update entry_test to support Python 3Simon Glass2019-07-101-1/+5
| | | | | | | The reload() function is in a different place in Python 3. Update the code to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Convert to use bytes typeSimon Glass2019-07-106-72/+77
| | | | | | | With Python 3 we want to use the 'bytes' type instead of 'str'. Adjust the code accordingly so that it works on both Python 2 and Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Avoid changing a dict during iterationSimon Glass2019-07-101-2/+5
| | | | | | | This code works OK in Python 2 but Python 3 complains. Adjust it to avoid deleting elements from a dict while iterating through it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow reading files in text modeSimon Glass2019-07-101-2/+2
| | | | | | | While reading files in binary mode is the norm, sometimes we want to use text mode. Add an optional parameter to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Update dtb_platdata to support Python 3Simon Glass2019-07-101-1/+2
| | | | | | | | | | | | | | | The only change needed is to update get_value() to support the 'bytes' type correctly with Python 3. With this the dtoc unit tests pass with both Python 2 and 3: PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt python \ ./tools/dtoc/dtoc -t PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman python3 \ ./tools/dtoc/dtoc -t Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Update fdt_util for Python 3Simon Glass2019-07-102-16/+2
| | | | | | | | | | | | | | | | | | Since we are now using the bytes type in Python 3, the conversion in fdt32_to_cpu() is not necessary, so drop it. Also use 'int' instead of 'long' to convert the integer value, since 'long' is not present in Python 3. With this, test_fdt passes with both Python 2 and 3: PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt python \ ./tools/dtoc/test_fdt -t PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman python3 \ ./tools/dtoc/test_fdt -t Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Add a unit test for BytesToValue()Simon Glass2019-07-101-1/+5
| | | | | | | | Add a simple unit test for one of the cases of this function, so that any fault can be seen directly, rather than appearing through the failure of another test. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Test full 64-bit properties with FdtCellsToCpu()Simon Glass2019-07-101-2/+9
| | | | | | | At present this test does not check the upper 32 bits of the returned value. Add some additional tests to cover this. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Use binary mode for reading filesSimon Glass2019-07-101-3/+3
| | | | | | | The .dtb files are binary so we should open them as binary files. This allows Python 3 to use the correct 'bytes' type. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Convert the Fdt.Node class to Python 3Simon Glass2019-07-101-2/+5
| | | | | | | | Update this class to work correctly on Python 3 and to pass its unit tests. The only required change is to deal with a difference in the behaviour of sorting with a None value. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Convert the Fdt.Prop class to Python 3Simon Glass2019-07-101-4/+4
| | | | | | | Update this class to work correctly on Python 3 and to pass its unit tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Use byte type instead of str in fdtSimon Glass2019-07-103-14/+43
| | | | | | | In Python 3 bytes and str are separate types. Use bytes to ensure that the code functions correctly with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Updates BytesToValue() for Python 3Simon Glass2019-07-102-16/+52
| | | | | | | | | The difference between the bytes and str types in Python 3 requires a number of minor changes to this function. Update it to handle the input data using the 'bytes' type. Create two useful helper functions which can be used by other modules too. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Move BytesToValue() out of the Prop classSimon Glass2019-07-101-51/+53
| | | | | | | This method does not actually use any members of the Prop class. Move it out of the class so that it is easier to add unit tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Use GetBytes() to obtain repeating bytesSimon Glass2019-07-102-3/+5
| | | | | | Use this helper function which works on both Python 2 and Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Sort platdata output from dtocSimon Glass2019-07-102-7/+8
| | | | | | | | At present the order of struct field emitted by this tool depends on the internal workings of a Python dictionary. Sort the fields to remove this uncertainty, so that tests are deterministic. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Adjust code for Python 3Simon Glass2019-07-104-9/+15
| | | | | | | | | Update a few things in this tool so that they support Python 3: - print statements - iteritems() - xrange() Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Don't require Python 2Simon Glass2019-07-101-1/+1
| | | | | | Update the shebang to allow either Python 2 or Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Tidy up a few more unicode conversionsSimon Glass2019-07-102-6/+3
| | | | | | Use the new functions in the tools module to handle conversion. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Adjust functional tests for Python 3Simon Glass2019-07-101-11/+14
| | | | | | | | | Change the code so that it works on both Python 2 and Python 3. This works by using unicode instead of latin1 for the test input, and ensuring that the output is converted to a string rather than a unicode object on Python 2. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Avoid unicode type in settings unit testsSimon Glass2019-07-101-8/+8
| | | | | | | | | The unicode type does not exist in Python 3 and when displaying strings they do not have the 'u' prefix. Adjusts the settings unit tests to deal with this difference, by converting the comparison value to a string, thus dropping the 'u'. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Sort series output for repeatabilySimon Glass2019-07-102-12/+12
| | | | | | | | We use sets to produce the list of To and Cc lines for a series. This does not result in stable ordering of the recipients. Sort each list to ensure that the output is repeatable. This is necessary for tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Move unicode helpers to toolsSimon Glass2019-07-104-16/+39
| | | | | | | | Create helper functions in the tools module to deal with the differences between unicode in Python 2 (where we use the 'unicode' type) and Python 3 (where we use the 'str' type). Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Support use of stringIO in Python 3Simon Glass2019-07-101-1/+6
| | | | | | With Python 3 this class has moved. Update the code to handle both cases. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Handle repeated bytes for Python 3Simon Glass2019-07-106-25/+50
| | | | | | | | | | | | The method of multiplying a character by a number works well for creating a repeated string in Python 2. But in Python 3 we need to use bytes() instead, to avoid unicode problems, since 'bytes' is no-longer just an alias of 'str'. Create a function to handle this detail and call it from the relevant places in binman. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Drop an unused input fileSimon Glass2019-07-101-1/+0
| | | | | | Drop this line which is not used or needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Use binary mode when compressing dataSimon Glass2019-07-102-2/+2
| | | | | | | | The lz4 utility inserts binary data in its output which cannot always be converted to unicode (nor should it be). Fix this by using the new binary mode for program output. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Provide a way to get program output in binary modeSimon Glass2019-07-102-3/+4
| | | | | | | | | At present cros_subprocess and the tools library use a string to obtain stdout from a program. This works fine on Python 2. With Python 3 we end up with unicode errors in some cases. Fix this by providing a binary mode, which returns the data as bytes() instead of a string. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: dtoc: Open all binary files in binary modeSimon Glass2019-07-101-1/+1
| | | | | | | Fix an open() statement to use binary mode, so that it works as expected with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: binman: Open all binary files in binary modeSimon Glass2019-07-101-15/+15
| | | | | | | | | At present some files are opened in text mode despite containing binary data. This works on Python 2 but not always on Python 3, due to unicode problems. BC&D are not my favourite people. Adjust the affected open() statements to use binary mode. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Use items() instead of iteritems()Simon Glass2019-07-105-6/+6
| | | | | | | Python 3 requires this, and Python 2 allows it. Convert the code over to ensure compatibility with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Use items() instead of iteritems()Simon Glass2019-07-101-1/+1
| | | | | | | Python 3 requires this, and Python 2 allows it. Convert the code over to ensure compatibility with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Remove use of Set()Simon Glass2019-07-103-9/+6
| | | | | | | A new built-in set() is used in both Python 2 and 3 now. Move it to use that instead of Set(). Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Don't show errors for failed testsSimon Glass2019-07-101-0/+12
| | | | | | | | An unfortunate new feature in Python 3.5 causes binman to print errors for non-existent tests, when the test filter is used. Work around this by detecting the unwanted tests and removing them from the result. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Convert print statements to Python 3Simon Glass2019-07-102-8/+12
| | | | | | Update all print statements to be functions, as required by Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Convert print statements to Python 3Simon Glass2019-07-103-15/+14
| | | | | | Update all print statements to be functions, as required by Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Update cros_subprocess to use bytesSimon Glass2019-07-102-20/+29
| | | | | | | | At present this function uses lists and strings. This does not work so well with Python 3, and testing against '' does not work for a bytearray. Update the code to fix these issues. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge https://gitlab.denx.de/u-boot/custodians/u-boot-i2cTom Rini2019-07-103-22/+89
|\
| * rtc: pcf2127: Fixed bug with rtc settings and getting error timeChuanhua Han2019-07-091-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous pcf2127 RTC chip could not read and set the correct time. When reading the data of internal registers, the read address was the value of register plus 1. This is because this chip requires the host to send a stop signal after setting the register address and before reading the register data. This patch sets the register address using dm_i2c_write and reads the register data using the original dm_i2c_xfer in order to generate a stop signal after the register address is set, and fixes the bug of the original read and write time. Signed-off-by: Biwen Li <biwen.li@nxp.com> Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
| * xilinx_xiic: Fix transfer initialisationMelin Tomas2019-07-091-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to starting a new transfer, conditionally wait for bus to not be busy. Reinitialise controller as otherwise operation is not stable. For reference, see linux kernel commit 9656eeebf3f1 ("i2c: Revert i2c: xiic: Do not reset controller before every transfer") hs: Fixed DOS line endings added missing '\n' Fixed git commit description style Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
| * xilinx_xiic: Fix fill tx fifo loopMelin Tomas2019-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Comparison should be against the actual message length, not loop index. len is used for stopping while loop, pos is position in message. stop should be sent when entire message is sent, not when len and pos meet. hs: fixed DOS line endings Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
| * i2c: designware: Get clock rate from clock DMLey Foon Tan2019-07-091-10/+45
| | | | | | | | | | | | | | | | Get clock rate from clock DM if CONFIG_CLK is enabled. Otherwise, uses IC_CLK define. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Marek Vasut <marex@denx.de>