Commit Graph

43845 Commits

Author SHA1 Message Date
Simon Glass
1d88ebb270 fdt: Update fdt_test to use 'dt' instead of 'fdt'
Since fdt is a module it conflicts with this variable name and prevents it
being used in tests. Rename the variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
ee95d10ba9 fdt: Build the new python libfdt module
Build the upstream python libfdt module. At present the legacy module is
still built and is the one that it used. Future work will switch this
over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
555ba4889c fdt: Rename existing python libfdt module
Now that this module has been accepted upstream we should stop using the
local U-Boot one. In preparation for this, rename it to indicate it is for
legacy use.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
330274f19d fdt: Add all source files to the libfdt build
At present only a subset of source files are build. Add the rest and
refactor this so that a source file list is available also. This will be
used in later commit.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
7e91b10253 fdt: Allow swig options to be provided by Makefile
U-Boot needs to provide some swig include directories. Add this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
a2b2caae5a fdt: Move header files into lib/libfdt
These header files are actually part of libfdt. Move them there to make
it easier to build pylibfdt and easier to merge changes from upstream.

Update the license header to use SPDX at the same time.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:46 -06:00
Simon Glass
c40bfbadf2 fdt: Use SPDX format for licenses in the libfdt headers
These should follow the UBoot standard. Update them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:46 -06:00
Simon Glass
c69380f85d fdt: Correct cast for sandbox in fdtdec_setup_memory_size()
This gives a warning with some native compilers:

lib/fdtdec.c:1203:8: warning: format ‘%llx’ expects argument of type
   ‘long long unsigned int’, but argument 3 has type
   ‘long unsigned int’ [-Wformat=]

Fix it with a cast.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:46 -06:00
Simon Glass
84d7f9168b pci: Correct cast for sandbox
This gives a warning with some native compilers:

cmd/pci.c:152:11: warning: format ‘%llx’ expects argument of type
   ‘long long unsigned int’, but argument 3 has type
   ‘u64 {aka long unsigned int}’ [-Wformat=]

Fix it with a cast.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:46 -06:00
Simon Glass
cf2064d785 fdt: Add Python bindings
An early version of this is available upstream. Bring it in as a starting
point. This is from dtc upstream commit e56f2b0.

Future work will plumb it into dtoc and remove the now-unnecessary local
libraries.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:46 -06:00
Simon Glass
46bac66b20 sandbox: Move to use live tree
This updates sandbox to use a live device tree. This means that after
relocation (from board_init_r() onwards) it no-longer uses flat device
tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:17 -06:00
Simon Glass
04048d58a8 dm: gpio: power: Convert pm8916 drivers to livetree
This PMIC driver (power and GPIO) is used by the sandbox SPMI tests.
Update the drivers to support a live device tree so that the tests pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:17 -06:00
Simon Glass
fe3c0b5b93 dm: test: Fix nit with position of backslash
Line up this backslash with all the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:17 -06:00
Simon Glass
03753c9a7b dm: sandbox: sysreset: Convert driver to livetree
Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:17 -06:00
Simon Glass
a11817999f dm: sandbox: spi: Convert driver to support livetree
Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:16 -06:00
Simon Glass
656f29d1ca dm: spi-flash: Convert uclass to livetree
Update the SPI flash uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:16 -06:00
Simon Glass
2ceb6484c2 dm: sandbox: i2c_rtc: Drop fdtdec.h header
This is not needed in this driver. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:16 -06:00
Simon Glass
aabf79929e dm: sandbox: i2c: Drop fdtdec.h header
This is not needed in this driver. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:16 -06:00
Simon Glass
279e26f5a3 dm: spi: Convert uclass to livetree
Update the SPI uclass to support a live device tree. Also adjust
spi_slave_ofdata_to_platdata() to accept a device instead of a blob and
offset.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:16 -06:00
Simon Glass
8327d41b19 cros_ec: Update the cros_ec keyboard driver to livetree
Update this driver and key_matrix to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:16 -06:00
Simon Glass
2dd57f5e47 dm: Update the I2C eeprom driver for livetree
Update this driver so that it works with livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
bf501595cd dm: pci: Update uclass to support livetree
Update the PCI uclass to support livetree. This mostly involves fixing
the address decoding from the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
40a475e841 dm: reset: Update uclass to support livetree
Update the reset domain uclass to support livetree. Fix the xlate() method
which has no callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
424b2fe939 dm: power-domain: Update uclass to support livetree
Update the power domain uclass to support livetree. Fix the xlate() method
which has no callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
5204e9b86b sandbox: phy: Update driver for livetree
Update the sandbox phy driver to support livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
23558bb67a dm: phy: Update uclass to support livetree
Update the phy uclass to support livetree. Fix the xlate() method
which has no callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
5e1ff6480f dm: mailbox: Update uclass to support livetree
Update the mailbox uclass to support livetree. Fix the xlate() method
in all callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:15 -06:00
Simon Glass
ac206a0f4e dm: phy: Update tests to use ut_asserteq()
Use ut_asserteq() to test equality since this gives a better error message
on failure. Also make a few of the tests more specific.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:14 -06:00
Simon Glass
86b54ece82 dm: test: Disable the fdt_offset test with livetree
We cannot run this test with livetree since it uses device tree offsets.
Mark it as flat tree only.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:14 -06:00
Simon Glass
298afb52cb dm: test: Separate out the bus DT offset test
We cannot access the device tree via an offset when running in livetree
mode. Separate out that part of the bus' children tests and mark it as
for the flat tree only.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:14 -06:00
Simon Glass
8b92e1cd59 dm: clk: fixed: Update to support livetree
Update the fixed-rate clock driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:14 -06:00
Simon Glass
aa9bb0944a dm: clk: Update uclass to support livetree
Update the clk uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:14 -06:00
Simon Glass
a4e0ef50da clk: Modify xlate() method for livetree
Update the xlate() method to use ofnode_phandle_args instead of the fdtdec
variant. This will allow drivers to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:14 -06:00
Simon Glass
a1e4adee99 sandbox: usb: Convert emulators to livetree
Update the sandbox flash and hub USB emulators to support a live device
tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
d20fd27d8f dm: usb: Convert uclass to livetree
Update the usb uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
53d788d868 dm: adc: Convert uclass to livetree
Update the adc uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
66e0ed5c17 dm: mmc: Convert uclass to livetree
Update the mmc uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
a5493f828e dm: regulator: Update fixed regulator to support livetree.
Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
f15cd4f131 dm: regulator: Convert regulator uclass to support livetree
Update the regulator uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
0402d003e7 sandbox: pmic: Convert pmic emulator to support livetree
Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:13 -06:00
Simon Glass
7a869e6cd1 dm: pmic: Convert uclass to livetree
Update the pmic uclass and all pmics to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:12 -06:00
Simon Glass
f6e76202d4 samsung: Move pmic header out of config file
We should not be including a PMIC header file in the board config. Move it
to a C file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:12 -06:00
Simon Glass
1704308eb6 dm: i2c: Convert uclass to livetree
Update the i2c uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:12 -06:00
Simon Glass
a7d0021063 string: Add strcspn()
Add an implementation of strcspn() which returns the number of initial
characters that do not match any in a rejection list.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:12 -06:00
Simon Glass
6b45ba45fb string: Add strchrnul()
This functions works like strchr() but returns the end of the string if
the character is not found. Add an implementation of this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:12 -06:00
Simon Glass
a4b8e372d5 dm: Add more livetree helpers and definitions
Add some definitions and helpers for livetree in the main of.h header
file. These include:

- reading multi-cell integers
- default number of address/size cells
- functions for comparing names

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:12 -06:00
Simon Glass
eed36609b5 fdt: Rename a few functions in fdt_support
These two functions have an of_ prefix which conflicts with naming used
in of_addr. Rename them:

   fdt_read_number
   fdt_support_bus_default_count_cells

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:11 -06:00
Simon Glass
029ab15a69 test: Update 'make test' to run more tests
The standard sandbox board cannot run the of-platdata test since it needs
SPL. Also, we should test the flat tree version of sandbox.

Add these tests to the default test script.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:11 -06:00
Simon Glass
554c983e45 sandbox: Add a new sandbox_flattree board
Add a sandbox board to test the non-livetree build (i.e. with
CONFIG_OF_FLAT disabled). This increases our build and test coverage.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:11 -06:00
Simon Glass
2ec9d171bc cros_ec: Convert to support live tree
Convert this driver to support the live device tree and remove the old
fdtdec support.

The keyboard is not yet converted.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:11 -06:00