Simon Glass [Sat, 3 Oct 2020 17:31:37 +0000 (11:31 -0600)]
dm: core: Convert #ifdef to if() in root.c
Convert a few conditions to use compile-time checks to reduce the number
of build paths.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:36 +0000 (11:31 -0600)]
dm: Add a test for of-platdata parent information
Add a simple test that we can obtain the correct parent for an I2C
device. This requires updating the driver names to match the compatible
strings, adding them to the devicetree and enabling a few options.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:35 +0000 (11:31 -0600)]
dm: Support parent devices with of-platdata
At present of-platdata does not provide parent information. But this is
useful for I2C devices, for example, since it allows them to determine
which bus they are on.
Add support for setting the parent correctly, by storing the parent
driver_info index in dtoc and reading this in lists_bind_drivers(). This
needs multiple passes since we must process children after their parents
already have been bound.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:34 +0000 (11:31 -0600)]
sandbox: Fix up building for of-platdata
There is no devicetree with of-platdata. Update a few uclasses to allow
them to be built for sandbox_spl. Also drop the i2c-gpio from SPL to avoid
build errors, since it does not support of-platdata.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:33 +0000 (11:31 -0600)]
dm: Use an allocated array for run-time device info
At present we update the driver_info struct with a pointer to the device
that it created (i.e. caused to be bound). This works fine when U-Boot SPL
is stored in read-write memory. But on some platforms, such as Intel
Apollo Lake, it is not possible to update the data memory.
In any case, it is bad form to put this information in a structure that is
in the data region, since it expands the size of the binary.
Create a new driver_rt structure which holds runtime information about
drivers. Update the code to store the device pointer in this instead.
Also update the test check that this works.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:32 +0000 (11:31 -0600)]
dm: test: Add a test for of-platdata phandles
We have a test in dtoc for this feature, but not one in U-Boot itself.
Add a simple test that checks that the information comes through
correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:31 +0000 (11:31 -0600)]
dm: test: Add a check that all devices have a dev value
With of-platdata, the driver_info struct is updated with the device
pointer when it is bound. This makes it easy for a device to be found by
its driver info with the device_get_by_driver_info() function.
Add a test that all devices (except the root device) have such an entry.
Fix a bug that the function does not set *devp to NULL on failure, which
the documentation asserts.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:28 +0000 (11:31 -0600)]
dm: Add a C test for of-platdata properties
At present properties are tested in a roundabout way. The driver's probe()
method writes out the values of the properties and the Python test checks
the output from U-Boot SPL.
Add a C test which checks these values more directly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:36 +0000 (20:38 -0600)]
Azure/GitLab/Travis: Add SPL unit tests
Run SPL unit tests in all test environments.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:35 +0000 (20:38 -0600)]
dm: test: Drop of-platdata pytest
Now that we have a C version of this test, drop the Python implementation.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:34 +0000 (20:38 -0600)]
test: Run only the selected SPL test
Use the new -k option to select the test to run.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:33 +0000 (20:38 -0600)]
sandbox: Allow selection of SPL unit tests
Now that we have more than one test, add a way to select the test to run.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:32 +0000 (20:38 -0600)]
test: Run SPL unit tests
Update the 'run' script to include SPL unit tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:31 +0000 (20:38 -0600)]
pytest: Collect SPL unit tests
Add a new test_spl fixture to handle running SPL unit tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:30 +0000 (20:38 -0600)]
Makefile: Generate a symbol file for u-boot-spl
Add a rule to generate u-boot-spl.sym so that pytest can discover the
available unit tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:29 +0000 (20:38 -0600)]
dm: test: Add a very simple of-platadata test
At present we have a pytest that covers of-platadata. Add a very simple
unit test that just checks that a device can be found. This shows the
ability to write these tests in C.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:28 +0000 (20:38 -0600)]
dm: test: Add a way to run SPL tests
Add a -u flag for U-Boot SPL which requests that unit tests be run. To
make this work, export dm_test_main() and update it to skip test features
that are not used with of-platdata.
To run the tests:
$ spl/u-boot-spl -u
U-Boot SPL 2020.10-rc5 (Oct 01 2020 - 07:35:39 -0600)
Running 0 driver model tests
Failures: 0
At present there are no SPL unit tests.
Note that there is one wrinkle with these tests. SPL has limited memory
available for allocation. Also malloc_simple does not free memory
(free() is a nop) and running tests repeatedly causes driver-model to
reinit multiple times and allocate memory. Therefore it is not possible
to run more than a few tests at a time. One solution is to increase the
amount of malloc space in sandbox_spl. This is not a problem for pytest,
since it runs each test individually, so for now this is left as is.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:27 +0000 (20:38 -0600)]
dm: test: Update the test runner to support of-platdata
At present DM tests assume that a devicetree is available. This is not the
case with of-platadata.
Update the code to add this condition.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 26 Oct 2020 02:38:26 +0000 (20:38 -0600)]
dm: test: Build tests for SPL
We want to run unit tests in SPL. Add a new Kconfig to control this and
enable it for sandbox_spl
Signed-off-by: Simon Glass <sjg@chromium.org>
Dario Binacchi [Sun, 11 Oct 2020 12:27:07 +0000 (14:27 +0200)]
dm: core: fix typo in device.h
Replace 'a the' with 'the' in include/dm/device.h.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Fri, 9 Oct 2020 21:44:11 +0000 (23:44 +0200)]
sandbox: make SDL window resizable
Without resizing the SDL window showed by
./u-boot -D -l
is not legible on a high resolution screen.
Allow resizing the window
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:27 +0000 (11:31 -0600)]
dtoc: Fix widening of int to bytes
At present an integer is converted to bytes incorrectly. The whole 32-bit
integer is inserted as the first element of the byte array, and the other
three bytes are skipped. This was not noticed because the unit test did
not check it, and the functional test was checking for wrong values.
Update the code to handle this as a special case. Add one more test to
cover all code paths.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:26 +0000 (11:31 -0600)]
dm: core: Allow dm_warn() to be used in SPL
At present this option is disabled in SPL, meaning that warnings are not
displayed. It is sometimes useful to see warnings in SPL for debugging
purposes.
Add a new Kconfig option to permit this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:25 +0000 (11:31 -0600)]
dtoc: Order the structures internally by name
At present the structures are written in name order, but parents have to
be written before their children, so the file does not end up being in
order. The order of nodes in _valid_nodes matches the order of the
devicetree.
Update the code so that _valid_nodes is in sorted order, by C name of
the structure. This allows us to assign a sequential ordering to each
U_BOOT_DEVICE() declaration.
U-Boot's linker lists are also ordered alphabetically, which means that
the order in the driver_info list will match the order used by dtoc. This
defines an index ('idx') for the U_BOOT_DEVICE declarations. They appear
in alphabetical order, numbered from 0 in _valid_nodes and in the
driver_info linker list.
Add a comment against each declaration, showing the idx value.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:24 +0000 (11:31 -0600)]
dtoc: Document the return value of scan_structs()
Add documentation to this function as well as generate_structs(), where
the return value is ultimately passed in.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 17:31:23 +0000 (11:31 -0600)]
sandbox: Drop ad-hoc device declarations in SPL
Since sandbox's SPL is build with of-platadata, we should not use
U_BOOT_DEVICE() declarations as well. Drop them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:26 +0000 (09:25 -0600)]
dm: test: Disable some tests that should not run in SPL
Tests are easier to run in U-Boot proper. Running them in SPL does not add
test coverage in most cases. Also some tests use features that are not
available in SPL.
Update the build rules to disable these tests in SPL. We still need
test-main to be able to actually run SPL tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:25 +0000 (09:25 -0600)]
dm: test: Make use of CONFIG_UNIT_TEST
At present we always include test/dm from the main Makefile. We have a
CONFIG_UNIT_TEST that should control whether the test/ directory is built,
so rely on that instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:24 +0000 (09:25 -0600)]
dm: test: Update Makefile conditions
At present most of the tests in test/Makefile are dependent on
CONFIG_SANDBOX. But this is not ideal since they rely on commands being
available and SPL does not support commands.
Use CONFIG_COMMAND instead. This has the dual purpose of allowing these
tests to be used on other boards and allowing SPL to skip them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:23 +0000 (09:25 -0600)]
dm: test: Sort the Makefile
Move everything into alphabetical order.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:22 +0000 (09:25 -0600)]
dm: Avoid using #ifdef for CONFIG_OF_LIVE
At present this option results in a number of #ifdefs due to the presence
or absence of the global_data of_root member.
Add a few macros to global_data.h to work around this. Update the code
accordingly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:21 +0000 (09:25 -0600)]
dm: core: Avoid void * in the of-platdata structs
These pointers point to drivers. Update the definition to make this clear.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:20 +0000 (09:25 -0600)]
dm: core: Expand the comment for DM_GET_DEVICE()
The current documentation for this is not particularly enlightening. Add
a little more detail.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:19 +0000 (09:25 -0600)]
dtoc: Use a namedtuple for _links
The use of strings to access a dict is a bit ugly. Use a namedtuple for
this instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 3 Oct 2020 15:25:18 +0000 (09:25 -0600)]
dtoc: Extract inner loop from output_node()
This function is very long. Put the inner loop in a separate function
to enhance readability.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 28 Sep 2020 00:46:20 +0000 (18:46 -0600)]
binman: Support multiple images in the library
Add support for multiple images, since these are used on x86 now. Select
the first image for now, since that is generally the correct one. At some
point we can add a way to determine which image is currently running.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 28 Sep 2020 00:46:19 +0000 (18:46 -0600)]
binman: Add a way to read the ROM offset
Provide a function to read the ROM offset so that we can store the value
in one place and clients don't need to store it themselves after calling
binman_set_rom_offset().
Signed-off-by: Simon Glass <sjg@chromium.org>
Tom Rini [Thu, 29 Oct 2020 15:30:29 +0000 (11:30 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
- Armada 8k: Add NAND support via PXA3xx NAND driver (Baruch)
- Armada 8k: Use ATF serdes init instead of the "old" U-Boot version
(Baruch)
- Minor update to Octeon TX/TX2 defconfig (Stefan)
Tom Rini [Thu, 29 Oct 2020 15:30:15 +0000 (11:30 -0400)]
Merge tag 'xilinx-for-v2021.01-v2' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze
Xilinx changes for v2021.01-v2
common:
- Add support for 64bit loadables from SPL
xilinx:
- Update documentation and record ownership
- Enable eeprom board detection based legacy and fru formats
- Add support for FRU format
microblaze:
- Optimize low level ASM code
- Enable SPI/I2C
- Enable distro boot
zynq:
- Add support for Zturn V5
zynqmp:
- Improve silicon detection code
- Enable several kconfig options
- Align DT with the latest state
- Enabling security commands
- Enable and support FPGA loading from SPL
- Optimize xilinx_pm_request() calling
versal:
- Some DTs/Kconfig/defconfig alignments
- Add binding header for clock and power
zynq-sdhci:
- Add support for tap delay programming
zynq-spi/zynq-qspi:
- Use clock framework for getting clocks
xilinx-spi:
- Fix some code issues (unused variables)
serial:
- Check return value from clock functions in pl01x
Tom Rini [Thu, 29 Oct 2020 14:48:01 +0000 (10:48 -0400)]
configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py
Signed-off-by: Tom Rini <trini@konsulko.com>
Andre Przywara [Wed, 28 Oct 2020 23:37:43 +0000 (23:37 +0000)]
MAINTAINERS, git-mailrc: Update sunxi maintainers
Maxime mentioned that he feels not having the time to be an Allwinner
maintainer anymore. Take over from him.
Maxime, many thanks for your great work in the past! I hope I can still
relay the occasional technical question to you in the future.
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tom Rini [Thu, 29 Oct 2020 13:10:24 +0000 (09:10 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
- Bug fixes and updates on vid, ls1088a lx2160a and other layerscape
platforms.
- Add optee_rpmb support for LX2 & Kontron sl28 support
Shmuel Hazan [Thu, 29 Oct 2020 06:52:20 +0000 (08:52 +0200)]
mtd: nand: pxa3xx: enable NAND controller if the SoC needs it
Based on Linux kernel commit
fc256f5789cb ("mtd: nand: pxa3xx: enable
NAND controller if the SoC needs it"). This commit adds support for the
Armada 8040 nand controller.
The kernel commit says this:
Marvell recent SoCs like A7k/A8k do not boot with NAND flash
controller activated by default. Enabling the controller is a matter
of writing in a system controller register that may also be used for
other NAND related choices.
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Shmuel Hazan <shmuel.h@siklu.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Michal Simek [Tue, 27 Oct 2020 09:04:17 +0000 (10:04 +0100)]
xilinx: Enable SPI driver for Versal
Enable Zynq SPI driver for Versal.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 26 Oct 2020 11:26:13 +0000 (12:26 +0100)]
xilinx: Consolidate board_fit_config_name_match() for Xilinx platforms
Move board_fit_config_name_match() from Zynq/ZynqMP to common location.
This change will open a way to use it also by Microblaze and Versal.
Through this function there is a way to handle images with multiple DTBs.
For now match it with DEVICE_TREE as is done for Zynq.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Ashok Reddy Soma [Fri, 23 Oct 2020 10:59:04 +0000 (04:59 -0600)]
mmc: zynq_sdhci: Add common function to set input/output tapdelays
Remove setting tapdelays for different speeds separately. Instead use
the ITAP and OTAP delay values which are read from the device tree.
If the DT does not contain tap delay values, the predefined values
will be used for the same.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Ashok Reddy Soma [Fri, 23 Oct 2020 10:59:03 +0000 (04:59 -0600)]
mmc: zynq_sdhci: Extend UHS timings till hs200
Fix the condition to set UHS timings for speeds upto HS200.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Baruch Siach [Thu, 29 Oct 2020 06:52:19 +0000 (08:52 +0200)]
mtd: pxa3xx_nand: remove dead code
The kfree() call is unreachable, and is not needed. Remove this call and
the fail_disable_clk label.
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Shmuel Hazan [Thu, 29 Oct 2020 06:52:18 +0000 (08:52 +0200)]
mtd: pxa3xx_nand: port to use driver model
Use the generic DT code to find the device compatible property for us.
This makes the driver look more like other current drivers. It also make
it easier to add support for other variants like Armada 8K in a future
commit.
Signed-off-by: Shmuel Hazan <shmuel.h@siklu.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Baruch Siach [Thu, 29 Oct 2020 06:52:17 +0000 (08:52 +0200)]
arm: dts: armada-cp110-master: update nand-controller
Align node properties to kernel dts node.
The change of compatible property does not affect any currently
supported board.
Keep U-Boot specific nand-enable-arbiter, and num-cs for compatibility
with the current driver.
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Shmuel Hazan [Thu, 29 Oct 2020 06:52:16 +0000 (08:52 +0200)]
arm: dts: armada-cp110-slave: add missing cps_nand
Align node properties to kernel dts node.
Keep U-Boot specific nand-enable-arbiter, and num-cs for compatibility
with the current driver.
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Shmuel Hazan <shmuel.h@siklu.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Stefan Roese [Mon, 19 Oct 2020 06:02:12 +0000 (08:02 +0200)]
arm: octeontx: Enable network support in supported boards
Enable the now included network drivers in the currently supported
Marvell Octeon TX & TX2 boards.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Suneel Garapati <sgarapati@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Igal Liberman [Sun, 18 Oct 2020 14:11:13 +0000 (17:11 +0300)]
phy: marvell: cp110: update mode parameter for pcie power on calls
It helps ATF to determine who called power on function (U-boot/Linux).
The corresponding ATF code was added in this commit:
mvebu: cp110: avoid pcie power on/off sequence when called from Linux
https://github.com/ARM-software/arm-trusted-firmware/commit/
55df84f974ea37abbb4f93f000f101f70cda5303
Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Grzegorz Jaszczyk [Sun, 18 Oct 2020 14:11:12 +0000 (17:11 +0300)]
phy: marvell: cp110: let the firmware configure comphy for PCIe
Replace the comphy initialization for PCIe with appropriate SMC call, so
the firmware will perform appropriate comphy initialization.
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Grzegorz Jaszczyk [Sun, 18 Oct 2020 14:11:11 +0000 (17:11 +0300)]
phy: marvell: cp110: let the firmware configure the comphy
Replace all comphy initialization with appropriate smc calls. It will
result with triggering synchronous exception that is handled by Secure
Monitor code in EL3. Then the Secure Monitor code will dispatch each smc
call (by parsing the smc function identifier) and triggers appropriate
comphy initialization.
This patch reworks serdes handling for: SATA, SGMII, HS-SGMII and SFI
interfaces.
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Tom Rini [Wed, 28 Oct 2020 20:30:06 +0000 (16:30 -0400)]
Prepare v2021.01-rc1
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Wed, 28 Oct 2020 18:50:09 +0000 (14:50 -0400)]
Merge branch '2020-10-28-mux-driver-framework'
- Add a framework for mux drivers
Pratyush Yadav [Fri, 16 Oct 2020 10:46:36 +0000 (16:16 +0530)]
test: mux-cmd: Add tests for the 'mux' command
Tests tests run the three mux subcommands: list, select, and deselect,
and verify that the commands do what we expect.
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Pratyush Yadav [Fri, 16 Oct 2020 10:46:35 +0000 (16:16 +0530)]
cmd: Add a mux command
This command lets the user list, select, and deselect mux controllers
introduced with the mux framework on the fly. It has 3 subcommands:
list, select, and deselect.
List: Lists all the mux present on the system. The muxes are listed for
each chip. The chip is identified by its device name. Each chip can have
a number of mux controllers. Each is listed in sequence and is assigned
a sequential ID based on its position in the mux chip. It lists details
like ID, whether the mux is currently selected or not, the current
state, the idle state, and the number of states.
A sample output would look something like:
=> mux list
a-mux-controller:
ID Selected Current State Idle State Num States
0 no unknown as-is 0x4
1 no 0x2 0x2 0x10
2 no 0x73 0x73 0x100
another-mux-controller:
ID Selected Current State Idle State Num States
0 no 0x1 0x1 0x4
1 no 0x2 0x2 0x4
Select: Selects a given mux and puts it in the specified state. This
subcommand takes 3 arguments: mux chip, mux ID, state to set
the mux in. The arguments mux chip and mux ID are used to identify which
mux needs to be selected, and then it is selected to the given state.
The mux needs to be deselected before it can be selected again in
another state. The state should be a hexadecimal number.
For example:
=> mux list
a-mux-controller:
ID Selected Current State Idle State Num States
0 no 0x1 0x1 0x4
1 no 0x1 0x1 0x4
=> mux select a-mux-controller 0 0x3
=> mux list
a-mux-controller:
ID Selected Current State Idle State Num States
0 yes 0x3 0x1 0x4
1 no 0x1 0x1 0x4
Deselect: Deselects a given mux and puts it in its idle state. This
subcommand takes 2 arguments: the mux chip and mux ID to identify which
mux needs to be deselected. So in the above example, we can deselect mux
0 using:
=> mux deselect a-mux-controller 0
=> mux list
a-mux-controller:
ID Selected Current State Idle State Num States
0 no 0x1 0x1 0x4
1 no 0x1 0x1 0x4
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Jean-Jacques Hiblot [Fri, 16 Oct 2020 10:46:34 +0000 (16:16 +0530)]
test: Add tests for the multiplexer framework
Provide tests to check the behavior of the multiplexer framework.
Two sets of tests are added. One is using an emulated multiplexer driver
that can be used to test basic functionality like select, deselect, etc.
The other is using the mmio mux which adds tests specific to it.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Pratyush Yadav [Fri, 16 Oct 2020 10:46:33 +0000 (16:16 +0530)]
Kconfig: Increase the pre-relocation memory
The memory is close to full and adding a syscon node in test.dts makes
it go over the limit and makes malloc() fail on startup.
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Jean-Jacques Hiblot [Fri, 16 Oct 2020 10:46:32 +0000 (16:16 +0530)]
drivers: mux: mmio-based syscon mux controller
This adds a driver for mmio-based syscon multiplexers controlled by
bitfields in a syscon register range.
This is heavily based on the linux mmio-mux driver.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Jean-Jacques Hiblot [Fri, 16 Oct 2020 10:46:31 +0000 (16:16 +0530)]
dm: board: complete the initialization of the muxes in initr_dm()
This will probe the multiplexer devices that have a "u-boot,mux-autoprobe"
property. As a consequence they will be put in their idle state.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Jean-Jacques Hiblot [Fri, 16 Oct 2020 10:46:30 +0000 (16:16 +0530)]
drivers: Add a new framework for multiplexer devices
Add a new subsystem that handles multiplexer controllers. The API is the
same as in Linux.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
[trini: Update some error calls to use different functions or pass
correct arguments]
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Wed, 28 Oct 2020 12:35:28 +0000 (08:35 -0400)]
Merge tag 'efi-2021-01-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-01-rc2
A software RTC driver is supplied for UEFI SCT testing.
The following UEFI related bugs are fixed:
* correct handling of daylight saving time in GetTime() and SetTime()
* handling of the gd register in function tracing on RISC-V
* disable U-Boot devices in ExitBootServices()
Tom Rini [Wed, 28 Oct 2020 12:34:11 +0000 (08:34 -0400)]
Merge branch '2020-10-27-further-log-enhancements'
- Allow for log message continuation.
- Test fix, build time error checking for new categories
Heinrich Schuchardt [Fri, 23 Oct 2020 11:00:01 +0000 (13:00 +0200)]
log: correct and check array size of log categories
The log command has led to NULL dereferences if an unknown category name
name was used due to missing entries in the list of category names.
Add compile time checks for the array sizes of log_cat_name and
log_lvl_name to avoid future mishaps.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Fri, 23 Oct 2020 03:30:29 +0000 (05:30 +0200)]
efi_loader: daylight saving time
Adjust the SetTime() and GetTime() runtime services to correctly convert
the daylight saving time information when communicating with the RTC.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Ilias Apalodimas [Wed, 21 Oct 2020 22:04:21 +0000 (01:04 +0300)]
efi_loader: Disable devices before handing over control
U-Boot Driver Model is supposed to remove devices with either
DM_REMOVE_ACTIVE_DMA or DM_REMOVE_OS_PREPARE flags set, before exiting.
Our bootm command does that by explicitly calling calling
"dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL);" and we also disable any
USB devices.
The EFI equivalent is doing none of those at the moment. As a result
probing an fTPM driver now renders it unusable in Linux. During our
(*probe) callback we open a session with OP-TEE, which is supposed to
close with our (*remove) callback. Since the (*remove) is never called,
once we boot into Linux and try to probe the device again we are getting
a busy error response. Moreover all uclass (*preremove) functions won't
run.
So let's fix this by mimicking what bootm does and disconnect devices
when efi_exit_boot_services() is called.
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Ilias Apalodimas [Wed, 21 Oct 2020 22:04:20 +0000 (01:04 +0300)]
efi_loader: Sort header file ordering
Order header files according to https://www.denx.de/wiki/U-Boot/CodingStyle
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Thu, 15 Oct 2020 10:30:09 +0000 (12:30 +0200)]
trace: conserve gd register on RISC-V
An UEFI application may change the value of the register that gd lives in.
But some of our functions like get_ticks() access this register. So we
have to set the gd register to the U-Boot value when entering a trace
point and set it back to the application value when exiting the trace
point.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Thu, 22 Oct 2020 21:52:14 +0000 (23:52 +0200)]
rtc: provide an emulated RTC
On a board without hardware clock this software real time clock can be
used. The build time is used to initialize the RTC. So you will have
to adjust the time either manually using the 'date' command or use
the 'sntp' to update the RTC with the time from a network time server.
See CONFIG_CMD_SNTP and CONFIG_BOOTP_NTPSERVER. The RTC time is
advanced according to CPU ticks.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Sun, 25 Oct 2020 06:25:05 +0000 (07:25 +0100)]
Makefile: provide constant with seconds since epoch
Provide a constant U_BOOT_EPOCH with the number of seconds since
1970-01-01. This constant can be used to initialize a software
real time clock until it is updated via the 'sntp' command.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt [Sat, 17 Oct 2020 12:31:59 +0000 (14:31 +0200)]
test: log: test message continuation
Provide a unit test checking that a continuation message will use the same
log level and log category as the previous message.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Sat, 17 Oct 2020 12:31:58 +0000 (14:31 +0200)]
log: allow for message continuation
Some drivers use macro pr_cont() for continuing a message sent via printk.
Hence if we want to convert printk messaging to using the logging system,
we must support continuation of log messages too.
As pr_cont() does not provide a message level we need a means of
remembering the last log level.
With the patch a pseudo log level LOGL_CONT as well as a pseudo log
category LOGC_CONT are introduced. Using these results in the application
of the same log level and category as in the previous log message.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Sat, 17 Oct 2020 12:31:57 +0000 (14:31 +0200)]
log: move processing_msg to global data
Replace the static variable processing_msg by a field in the global data.
Make the field bool at it can only be true or false.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Anatolij Gustschin [Tue, 27 Oct 2020 07:47:17 +0000 (08:47 +0100)]
nokia_rx51: re-enable CONSOLE_MUX and SYS_CONSOLE_IS_IN_ENV
With disabled legacy VIDEO option CONSOLE_MUX is not auto-selected
any more, re-enable it.
Fixes:
9dec5a0ea130 ("nokia_rx51: disable obsolete VIDEO config")
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
Ashok Reddy Soma [Fri, 23 Oct 2020 10:59:02 +0000 (04:59 -0600)]
mmc: zynq_sdhci: Add clock phase delays for Versal
Define default values for input and output clock phase delays for
Versal. Also define functions for setting tapdelays based on these
clock phase delays.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Ashok Reddy Soma [Fri, 23 Oct 2020 10:59:01 +0000 (04:59 -0600)]
mmc: zynq_sdhci: Set tapdelays based on clk phase delays
Define and use functions for setting input and output tapdelays
based on clk phase delays.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Michal Simek [Fri, 23 Oct 2020 10:59:00 +0000 (04:59 -0600)]
mmc: zynq_sdhci: Read clock phase delays from dt
Define input and output clock phase delays with pre-defined values.
Define arasan_sdhci_clk_data type structure and add it to priv
structure and store these clock phase delays in it.
Read input and output clock phase delays from dt. If these values are
not passed through dt, use pre-defined values.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Michal Simek [Fri, 23 Oct 2020 10:58:59 +0000 (04:58 -0600)]
mmc: zynq_sdhci: Move macro to the top
Just group macros below headers. Other patches will be using this location
too.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Ashok Reddy Soma [Fri, 23 Oct 2020 10:58:58 +0000 (04:58 -0600)]
mmc: Define timing macro's
Define timing macro's for all the available speeds of mmc. This is
done similar to linux. Replace speed macro's used with these new timing
macro's wherever applicable.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Ashok Reddy Soma [Fri, 23 Oct 2020 10:58:57 +0000 (04:58 -0600)]
Revert "mmc: zynq: parse dt when probing"
This reverts commit
942b5fc03218d1c94468fc658e7dec65dabcc830.
This is partial revert of the above commit.
mmc_of_parse() is reading no-1-8-v from device tree and if set,
it is clearing the UHS speed capabilities of cfg->host_caps.
cfg->host_caps &= ~(UHS_CAPS | MMC_MODE_HS200 |
MMC_MODE_HS400 | MMC_MODE_HS400_ES);
This is still missing to clear UHS speeds like SDHCI_SUPPORT_SDR104,
SDHCI_SUPPORT_SDR50 and SDHCI_SUPPORT_DDR50.
Even if we clear the flags SDHCI_SUPPORT_XXX in mmc_of_parse(),
these speed flags are getting set again in cfg->host_caps in
sdhci_setup_cfg().
The reason for this is, SDHCI_SUPPORT_XXX flags are cleared
only if controller is not capable of supporting MMC_VDD_165_195 volts.
if (caps & SDHCI_CAN_VDD_180)
cfg->voltages |= MMC_VDD_165_195;
if (!(cfg->voltages & MMC_VDD_165_195))
caps_1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
SDHCI_SUPPORT_DDR50);
It means "no-1-8-v", which is read from DT is not coming in to effect.
So it is better we keep the host quirks(SDHCI_QUIRK_NO_1_8_V) to
clear UHS speeds based on no-1-8-v from device tree.
Hence revert the functionality related to no-1-8-v only, rest is fine
in the patch.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Ashok Reddy Soma [Tue, 28 Jan 2020 14:39:04 +0000 (07:39 -0700)]
spi: zynq_qspi: Add function description
Add function description for zynq_qspi_init_hw and zynq_qspi_chipselect.
Fix zqspi to priv in function descriptions.
Change the description of priv as pointer to zynq_qspi_priv structure.
Fix other function descriptions to kernel-doc style.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 26 Oct 2020 10:28:27 +0000 (11:28 +0100)]
mtd: spi: Fix incorrect indentation
Use tabs to be aligned with the rest of the code.
Fixes:
658df8bd9464 ("mtd: spi-nor-core: Add octal mode support")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 23 Oct 2020 07:36:36 +0000 (09:36 +0200)]
microblaze: Enable board_late_init()
In board_late_init() several variables are setup to match the current
configuration.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 23 Oct 2020 05:54:18 +0000 (07:54 +0200)]
microblaze: Wire generic xilinx board_late_init_xilinx()
Call generic board_late_init_xilinx() to be aligned with the rest of xilinx
platforms. Also getting rid of initrd_high/fdt_high and use
bootm_low/boot_size instead.
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 22 Oct 2020 09:08:58 +0000 (11:08 +0200)]
xilinx: Merge together BOOT_SCRIPT_OFFSET between MB and ARM
There is no reason not to use commong Kconfig by Microblaze too.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 22 Oct 2020 08:37:00 +0000 (10:37 +0200)]
xilinx: Remove additional newline in config files
Trivial fix.
Fixes:
e519f03a1846 ("cmd: mem: Remove CONFIG_SYS_MEMTEST_SCRATCH mapping")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 22 Oct 2020 08:34:43 +0000 (10:34 +0200)]
xilinx: Enable SF_TEST command for all ARM based platforms
Enable this command by default.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 22 Oct 2020 08:34:00 +0000 (10:34 +0200)]
xilinx: zynq: Enable AES command
Enable AES command to be able to use it directly.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 22 Oct 2020 08:59:08 +0000 (10:59 +0200)]
xilinx: zynq: Change types from u32 to uint32_t
Change parameter type to avoid compilation error:
In file included from ./tools/../lib/rsa/rsa-verify.c:23:0,
from tools/lib/rsa/rsa-verify.c:1:
include/u-boot/rsa-mod-exp.h:69:18: error: unknown type name ‘u32’; did you mean ‘__u32’?
int zynq_pow_mod(u32 *keyptr, u32 *inout);
^~~
__u32
include/u-boot/rsa-mod-exp.h:69:31: error: unknown type name ‘u32’; did you mean ‘__u32’?
int zynq_pow_mod(u32 *keyptr, u32 *inout);
^~~
__u32
Fixes:
37e3a36a5475 ("xilinx: zynq: Add support to secure images")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 22 Oct 2020 08:33:29 +0000 (10:33 +0200)]
xilinx: Enable FRU command for all ARM based platforms
Enable it by default for board detection.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
T Karthik Reddy [Wed, 1 Apr 2020 12:01:21 +0000 (06:01 -0600)]
xilinx: Add DDR base address to bootscript address
Add ram base address to scriptaddr env variable to make boot
script address to be a valid address when ddr base address changes.
This works properly if the first memory region is the region where uboot
runs. Also the solution was taken in respect of a lot of jtag script
putting u-boot script to certain address. For standard cases
bd->bi_dram[0].start is 0 all the time. Only for systems with DDR placed
out of this location it does calculation.
This is not the best solution and should be done differently in future but
enough for now till we don't have full solution ready yet.
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
T Karthik Reddy [Wed, 22 Jul 2020 08:27:34 +0000 (02:27 -0600)]
arm64: zynqmp: Fix zynqmp mini qspi max frequency
For zynqmp qspi, frequencies up to 40MHz will work irrespective
of feedback clock enabled or disabled. If we want higher than
40Mhz the feedback clock should be enabled.
With spi-max-frequency 108MHz it is not working when the feedback
clock is disabled. Change it to 40MHz so that it works irrespective
of feedback clock enabled or disabled.
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 21 Oct 2020 10:23:17 +0000 (12:23 +0200)]
xilinx: zynqmp: Use tab for macro indentation
Trivial fix.
Fixes:
fa793165daf7 ("xilinx: zynqmp: refactor silicon name function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 21 Oct 2020 10:17:44 +0000 (12:17 +0200)]
xilinx: zynqmp: Do not check 0 as invalid return from snprintf
U-Boot SPL on ZynqMP is using CONFIG_SPL_USE_TINY_PRINTF which doesn't
return any return value and all the time returns 0. That's why
even correct snprintf was returning in SPL chip ID as "unknown".
Change checking condition and allow snprintf to return 0 which is according
manual patch successful return.
"If an output error is encountered, a negative value is returned."
Fixes:
43a138956f7e ("arm64: zynqmp: Get rid of simple_itoa and replace it by snprintf")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 21 Oct 2020 10:16:50 +0000 (12:16 +0200)]
xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name()
Fix hex format from 0x%0X to 0x%0x to show correct numbers.
Fixes:
fa793165daf7 ("xilinx: zynqmp: refactor silicon name function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 21 Oct 2020 10:16:02 +0000 (12:16 +0200)]
xilinx: zynqmp: Check return value from xilinx_pm_request()
xilinx_pm_request() can failed that's why also check return value.
Fixes:
050f10f103cd ("xilinx: zynqmp: remove chip_id function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 3 Aug 2020 14:14:23 +0000 (16:14 +0200)]
xilinx: board: Add FRU decoder support
FMC cards are using FRU format for card identification. That's why add
support for this format.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>