Simon Glass [Sat, 20 Jul 2019 18:24:08 +0000 (12:24 -0600)]
binman: Update state when replacing device-tree entries
Since the state module holds references to all the device trees used by
binman, it must be updated when the device trees are updated. Add support
for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:07 +0000 (12:24 -0600)]
patman: Reset the output directory when it is removed
At present outdir remains set ever after the output directory has been
removed. Fix this to avoid trying to access it when it is not present.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:06 +0000 (12:24 -0600)]
binman: Support replacing data in a cbfs
At present binman cannot replace data within a CBFS since it does not
allow rewriting of the files in that CBFS. Implement this by using the
new WriteData() method to handle the case.
Add a header to compressed data so that the amount of compressed data can
be determined without reference to the size of the containing entry. This
allows the entry to be larger that the contents, without causing errors in
decompression. This is necessary to cope with a compressed device tree
being updated in such a way that it shrinks after the entry size is
already set (an obscure case). It is not used with CBFS since it has its
own metadata for this. Increase the number of passes allowed to resolve
the position of entries, to handle this case.
Add a test for this new logic.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:05 +0000 (12:24 -0600)]
binman: Update Entry.WriteData() to handle special sections
At present this method assumes that the parent section does not need
to recalculate its position or adjust any metadata it may contain. But
when the entry changes size this may not be true. Also if the parent
section is more than just a container (e.g. it is a CBFS) then the
section may need to regenerate its output.
Add a new WriteChildData() method to sections and call this from the
WriteData() method, to handle this situation.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:04 +0000 (12:24 -0600)]
binman: Update Entry.ReadEntry() to work through classes
At present we simply extract the data directly from entries using the
image_pos information. This happens to work on current entry types, but
cannot work if the entry type encodes the data in some way. Update the
ReadData() method to provide the data by calling a new ReadChildData()
method in the parent. This allows the entry_Section class, or possibly
any other container class, to return the correct data in all cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:03 +0000 (12:24 -0600)]
binman: Add a prefix before CBFS hex offsets
Add a 0x prefix to these errors to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:02 +0000 (12:24 -0600)]
binman: Add a few more features to the wishlist
Add mention of a few other desirable features that may be implemented in
the future.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:01 +0000 (12:24 -0600)]
binman: Place Intel descriptor at image start
The Intel descriptor must always appear at the start of an (x86) image,
so it is supposed to position itself there always. However there is no
explicit test for this. Add one and fix a bug introduced by the recent
change to adjust Entry to read the node in a separate call.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:24:00 +0000 (12:24 -0600)]
binman: Adjust fmap to ignore CBFS files
The FMAP is not intended to show the files inside a CBFS. The FMAP can be
used to locate the CBFS itself, but then the CBFS must be read to find out
what is in it.
Update the FMAP to work this way and add some debugging while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:59 +0000 (12:23 -0600)]
libfdt: Copy the struct region in fdt_resize()
At present this function appears to copy only the data before the struct
region and the data in the string region. It does not seem to copy the
struct region itself.
>From the arguments of this function it seems that it should support fdt
and buf being different. This patch attempts to fix this problem.
Upstream commit:
c72fa77 libfdt: Copy the struct region in fdt_resize()
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:58 +0000 (12:23 -0600)]
binman: Support shrinking a entry after packing
Sometimes an entry may shrink after it has already been packed. In that
case we must repack the items. Of course it is always possible to just
leave the entry at its original size and waste space at the end. This is
what binman does by default, since there is the possibility of the entry
changing size every time binman calculates its contents, thus causing a
loop.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:57 +0000 (12:23 -0600)]
binman: Update the _testing entry to support shrinkage
Sometimes entries shrink after packing. As a start towards supporting
this, update the _testing entry to handle the test case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:56 +0000 (12:23 -0600)]
binman: Allow updating entries that change size
So far we don't allow entries to change size when repacking. But this is
not very useful since it is common for entries to change size after an
updated binary is built, etc.
Add support for this, respecting the original offset/size/alignment
constraints of the image layout. For this to work the original image
must have been created with the 'allow-repack' property.
This does not support entry types with sub-entries such as files and
CBFS, but it does support sections.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:55 +0000 (12:23 -0600)]
binman: Add more tests for image header position
The positioning does not currently work correctly if at the end of an
image with no fixed size. Also if the header is in the middle of an image
it can cause a gap in the image since the header position is normally at
the image end, so entries after it are placed after the end of the image.
Fix these problems and add more tests to cover these cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:54 +0000 (12:23 -0600)]
binman: Move Image.BuildImage() into a single function
Now that an Image is an Entry_section, there is no need for the separate
BuildSection() function. Drop it and add a bit of logging.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:53 +0000 (12:23 -0600)]
binman: Write the original input fdtmap to a file
When reading an image in, write its fdtmap to a file in the output
directory. This is useful for debugging. Update the 'ls' command to set up
the output directory; otherwise it will fail.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:52 +0000 (12:23 -0600)]
binman: Update documentation for image creation
There are a few more steps in the process now. Update the documentation to
reflect this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:51 +0000 (12:23 -0600)]
binman: Add info to allow safely repacking an image later
At present it is not possible to discover the contraints to repacking an
image (e.g. maximum section size) since this information is not preserved
from the original image description.
Add new 'orig-offset' and 'orig-size' properties to hold this. Add them to
the main device tree in the image.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:50 +0000 (12:23 -0600)]
binman: Support updating entries in an existing image
While it is useful and efficient to build images in a single pass from a
unified description, it is sometimes desirable to update the image later.
Add support for replace an existing file with one of the same size. This
avoids needing to repack the file. Support for more advanced updates will
come in future patches.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:49 +0000 (12:23 -0600)]
binman: Tidy up _SetupDtb() to use its own temporary file
At present EnsureCompiled() uses an file from the 'output' directory (in
the tools module) when compiling the device tree. This is fine in most
cases, allowing useful inspection of the output files from binman.
However in functional tests, _SetupDtb() creates an output directory and
immediately removes it afterwards. This serves no benefit and just
confuses things, since the 'official' output directory is supposed to be
created and destroyed in control.Binman().
Add a new parameter for the optional temporary directory to use, and use a
separate temporary directory in _SetupDtb().
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:48 +0000 (12:23 -0600)]
binman: Allow the fdtmap to remain unchanged
When updating an existing image where the size of all entries remains the
same, we should not need to regenerate the fdtmap. Update the entry to
return the same fdtmap as was read from the image.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:47 +0000 (12:23 -0600)]
binman: Add a constant for common entry properties
We use this same combination of properties several times in tests. Add a
constant for it to avoid typos, etc.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:46 +0000 (12:23 -0600)]
binman: Add a function to obtain the image for an Entry
At present we have an 'image' property in the entry for this purpose, but
this is not necessary and seems error-prone in the presence of
inheritance. Add a function instead. The Entry_section class overrides
this with a special version, since top-level sections are in fact images,
since Image inherits Entry_section.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:45 +0000 (12:23 -0600)]
binman: Adjust Entry to read the node in a separate call
At present the Entry constructor sets up the object and then immediately
reads its device-tree node to obtain its properties.
This breaks a convention that constructors should not do any processing.
A consequence is that we must pass all arguments to the constructor and
cannot have the node-reading proceed in a different way unless we pass
flags to that constructor. We already have a 'test' flag in a few cases,
and now need to control whether the 'orig_offset' and 'orig_size'
properties are set or not.
Adjust the code to require a separate call to ReadNode() after
construction. The Image class remains as it was.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:44 +0000 (12:23 -0600)]
binman: Add an image name into the fdtmap
Since binman supports multiple images it is useful to know which one
created the image that has been read. Then it is possible to look up that
name in the 'master' device tree (containing the description of all
images).
Add a property for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:43 +0000 (12:23 -0600)]
binman: Store the entry in output_fdt_files
In some cases we want to access the Entry object for a particular device
tree. This allows us to read its contents or update it. Add this
information to output_fdt_files and provide a function to read it.
Also rename output_fdt_files since its name is no-longer descriptive.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:42 +0000 (12:23 -0600)]
binman: Allow state functions to fail to return data
At present these state functions raise an exception if they cannot find
what is requested. But in some cases the information is optional (e.g. an
fdtmap in a coming patch) so it is better to return gracefully.
Update these two functions to return None when the data cannot be found.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:41 +0000 (12:23 -0600)]
binman: Support loading entry data from a file
When modifying an image it is convenient to load the data from the file
into each entry so that it can be reprocessed. Add a new LoadData() method
to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:40 +0000 (12:23 -0600)]
binman: Store image fdtmap when loading from a file
This data provides all the information about the position and size of each
entry. Store it for later use when loading an image. It can be reused as
is if the image is modified without changing offsets/sizes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:39 +0000 (12:23 -0600)]
dtoc: Update Fdt.GetNode() to handle the root node
This function currently fails if the root node is requested. Requesting
the root node is sometimes useful, so fix the bug.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:38 +0000 (12:23 -0600)]
dtoc: Update Fdt.FromData() to allow a name
It is confusing when something goes wrong with a device tree which was
created from data rather than a file, since there is no identifying
filename. Add an option to provide this. Use the filename as the name,
where available
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:37 +0000 (12:23 -0600)]
binman: Show a helpful error when a DT property is missing
At present a Python exception is raised which does not show the node
information. Add a more helpful exception in this case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:36 +0000 (12:23 -0600)]
binman: Add a bit of logging in entries when packing
Use the new logging feature to log information about progress with
packing. This is useful to see how binman is figuring things out.
Also update elf.py to use the same feature.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:35 +0000 (12:23 -0600)]
patman: Update tout to avoid open-coding the debug levels
Use the debug level constants instead of open-coding them in the file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:34 +0000 (12:23 -0600)]
binman: Drop state.fdt_set as this is not needed
We can iterate through the output files so don't need this global anymore.
Remove it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:33 +0000 (12:23 -0600)]
binman: Simplify state.fdt_subset
At present this excludes the device tree passed in to binman since it
is always returned first by GetAllFdts(). However, this is easy to ensure
by adding a check in that function. Change this dict to includes all
device trees, and rename it to fdt_set.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:32 +0000 (12:23 -0600)]
binman: Adjust state.fdt_files to be keyed by entry type
It makes more sense to use entry type as the key for this dictionary,
since the filename can in principle be anything. Make this change and also
rename fdt_files and add a comment to explain it better.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:31 +0000 (12:23 -0600)]
binman: Adjust GetFdt() to be keyed by etype
At present the FDTs are keyed by their default filename (not their actual
filename). It seems easier to key by the entry type, since this is always
the same for each FDT type.
To do this, add a new Entry method called GetFdtEtype(). This is necessary
since some entry types contain a device tree which are not the simple
three entry types 'u-boot-dtb', 'u-boot-spl' or 'u-boot-tpl'.
The code already returns a dict for GetFdt(). Update the value of that
dict to include the filename so that existing code can work.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:30 +0000 (12:23 -0600)]
binman: Rename state.GetFdt()
This function name conflicts with Fdt.Node.GetFdt() which has a different
purpose. Rename it to avoid confusion.
The new name suggests it is indexed by entry type rather than filename.
This will be tidied up in a future commit.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:29 +0000 (12:23 -0600)]
binman: Rename state.GetFdts()
This function name conflicts with Entry.GetFdts() which has a different
purpose. Rename it to avoid confusion. Also update a stale comment
relating to this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:28 +0000 (12:23 -0600)]
binman: Convert GetFdtSet() to use a dict
At present this function returns a set of device-tree filenames. It has no
way of returning the actual device-tree object. Change it to a dictionary
so that we can add this feature in a future patch.
Also drop fdt_set since it is no-longer used.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:27 +0000 (12:23 -0600)]
binman: Move image/fdt code into PrepareImagesAndDtbs()
Further reduce the size of the main Binman() function by moving this setup
code into its own function.
Note that the 'images' value is accessed from other modules so must be made
a global.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:26 +0000 (12:23 -0600)]
binman: Use print() to print output
At present tout writes directly to stdout. This is not necessary and it
prevents tests from redirecting output. Change it to use print() for the
non-progress output.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:25 +0000 (12:23 -0600)]
binman: Move GetFdtSet() into blob_dtb
At present we check the filename to see if an entry holds a device-tree
file. It is easier to use the base class designed for this purpose.
Move this method implementation into Entry_blob_dtb and update the default
one to return an empty set.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:24 +0000 (12:23 -0600)]
binman: Move image-processing code into a function
The Binman() function is very long. Split out the image code to make it
more manageable.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2019 18:23:23 +0000 (12:23 -0600)]
dtoc: Return a non-zero exit code when tests fail
At present 'dtoc -t' return a success code even if some of the tests fail.
Fix this by checking the test result and setting the exit code. This
allows 'make qcheck' to function as expected.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tom Rini [Sat, 27 Jul 2019 23:50:52 +0000 (19:50 -0400)]
Merge branch '2019-07-26-ti-imports'
- Bring in the rest of the J271E platform
- Various OMAP3/AM3517, DA850 fixes
Sam Protsenko [Fri, 12 Jul 2019 17:38:12 +0000 (20:38 +0300)]
env: ti: boot: Use ttyS2 instead of ttyO2
ttyO2 console enables legacy CONFIG_SERIAL_OMAP driver in kernel.
Nowadays it's preferred to use the generic CONFIG_SERIAL_8250_OMAP
driver, which being enabled via ttyS2 console. Both drivers are enabled
in multi_v7_defconfig and in omap2plus_defconfig, for compatibility
reasons. Let's switch to ttyS2 console, to be sure that standard 8250
serial driver is used.
Similar behavior can be also achieved by enabling
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP option in kernel, but it's better not
to rely on that, as it can be disabled or removed after transitional
period.
Right now on DRA7/AM57x platforms the 8250-omap driver is being probed
first, and omap-serial driver is only probed if the first one failed.
It can be seen from uart3 definition in arch/arm/boot/dts/dra7-l4.dtsi:
compatible = "ti,dra742-uart", "ti,omap4-uart";
So the kernel already uses 8250 driver. This change basically allows
kernel developers to throw away the omap-serial driver and associated
compatibility options. Similar discussions [1,2] have started several
years ago, so it should be safe to do that now.
[1] https://patchwork.kernel.org/patch/
6198471/
[2] http://processors.wiki.ti.com/index.php/Sitara_Linux_UART_-_Switching_to_8250_Driver
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Andrew F. Davis <afd@ti.com>
[trini: Update omap5_uevm]
Signed-off-by: Tom Rini <trini@konsulko.com>
Sam Protsenko [Tue, 2 Jul 2019 17:56:09 +0000 (20:56 +0300)]
arm: am57xx: Allow bootm to load larger kernels
linux-mainline with multi_v7_defconfig + Android configs takes more
space than regular TI Android kernel and bootm will fail to load it.
Let's increase max kernel size up to 64 MiB to make it possible to run
such kernel.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Adam Ford [Fri, 19 Jul 2019 21:24:50 +0000 (16:24 -0500)]
ARM: da850-evm: Remove dead/unneeded code
The DA8850-evm supports DM_I2C and boots with SPL_DM, so we can
drop some of the code which disables DM_I2C in SPL. This
patch removes some #undef's now rendered obsolete.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Wed, 17 Jul 2019 14:35:27 +0000 (09:35 -0500)]
ARM: omap3/omap35_logic: Fix broken Logic PD Torpedo booting
The SOM-LV and Torpedo boards are very similar, but something
happened growing SPL enough to break the Torpedo. The SOM-LV
board were not doing alias sequencing during SPL and they
continue to work while something broke the Torpedo. This
patch disables SPL_DM_SEQ_ALIAS allowing it to boot again.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Mon, 15 Jul 2019 19:07:52 +0000 (14:07 -0500)]
ARM: dts: Logic PD SOM-LV and Torpedo Boards: Resync DTS
Re-sync all Logic PD OMAP35 and AM/DM37 boards with Kernel
5.2.1
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Tue, 2 Jul 2019 15:36:28 +0000 (10:36 -0500)]
ARM: da850evm: Remove legacy OHCI referencs and unify platform
OHCI was added with DM_USB support, so there are a few unneeded
items in the header file that can be removed. This also
unifies da850evm with NOR and NAND booting options so all have
OHCI support.
Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Migrate da850_am18xxevm]
Signed-off-by: Tom Rini <trini@konsulko.com>
Adam Ford [Mon, 1 Jul 2019 14:33:39 +0000 (09:33 -0500)]
ARM: am3517_evm: Fix pin muxing to enable EHCI Host in the future
This patch enables the pinmuxing to support gpio_57 for phy reset
and fixes the pinmuxing for the ECHI tranceiver. The clocks
don't appear to by fully enabled yet, so OMAP-EHCI on am3517 is
still not yet working, but we're one step closer.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Sun, 30 Jun 2019 22:30:50 +0000 (17:30 -0500)]
ARM: omap3_logic & omap35_logic: Disable OMAP EHCI for Torpedo
The OMAP35 and AM/DM37 Torpedo boards do not have a USB
tranceiver connected to the USB host port, so this patch
removes it from the defconfig files.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Sun, 30 Jun 2019 22:30:49 +0000 (17:30 -0500)]
ARM: omap3_logic: Enable OMAP EHCI support for SOM-LV Boards
The SOM-LV boards support the OMAP EHCI driver using port 2.
With the driver updated to support device tree, this patch sets
the corresponding pin muxing for the tranceiver as well as the
reset pin.
Signed-off-by: Adam Ford <aford173@gmail.com>
Tom Rini [Sat, 27 Jul 2019 13:35:05 +0000 (09:35 -0400)]
Merge tag 'u-boot-imx-
20190719' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-
20190719
- CCF for i.MX6
- nandbcb command to write SPL into NAND
- Switch to DM (i.MX28)
- Boards: Toradex, engicam, DH
- Fixes for i.MX8
- Fixes for i.MX7ULP
Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/
561147504
Tom Rini [Sat, 27 Jul 2019 13:34:07 +0000 (09:34 -0400)]
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi
- fix for fsl_qspi read timeout (Thomas)
- spi-mem read data size fix (Ye Li)
- SiFive SPI driver, mmc_spi flags (Bhargav, Anup)
- Micron spi-nor parts (Ashish)
- MT7629 spi-mem driver(Weijie)
Adam Ford [Tue, 25 Jun 2019 19:14:08 +0000 (14:14 -0500)]
ARM: am3517-evm: Remove non-DM legacy code
With both SPL and U-Boot now supporting DM, we can start removing
legacy code. This patch removes the legacy MMC initalization and
legacy I2C initialization since both are now available via DM and
device tree.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Mon, 24 Jun 2019 16:57:25 +0000 (11:57 -0500)]
ARM: am3517-evm: Migrate to SPL_OF_CONTROL
Like the other Logic PD OMAP35/DM37 boards, this board has device
tree enabled for U-Boot. This patch converts the board to enable
SPL_OF_CONTROL and further shrinks the device tree in SPL to limit
it to UART3 (console), MMC1, i2c1, and GPIO4 (for mmc1 CD and WP).
There appears to be a bug in minicom so users may need to
switch the minicom terminal emulation to ANSI from VT102 due
to the junk that gets pushed out of the UART on startup.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Sun, 23 Jun 2019 23:30:54 +0000 (18:30 -0500)]
ARM: da850-evm: Remove repeated pinmuxing calls
arch_cpu_init() initializes the pinmuxing which is called fairly
early in the start sequences, so the board_init function doesn't
need to do it again. This patch removes the call from board_init.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Sun, 23 Jun 2019 22:48:36 +0000 (17:48 -0500)]
ARM: da850-evm: Remove duplicate UART initialization
The Low Level init functions start the UART, so it doesn't need
to happen during board_init. This patch removes it from
board_init.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Sun, 23 Jun 2019 05:42:14 +0000 (00:42 -0500)]
ARM: am3517-evm: Remove manual ethernet reset code
The reset line going to the ethernet controller is controlled
by a global reset controlling multiple peripherals. There
is no need to manually invoke the reset.
Signed-off-by: Adam Ford <aford173@gmail.com>
Adam Ford [Fri, 14 Jun 2019 14:06:48 +0000 (09:06 -0500)]
ARM: am3517-evm: Enable DM_PMIC and DM_REGULATOR functions
The PBIAS regulator is available on OMAP3's, and it's shared on
the AM35, so this patch enables that in U-Boot along with GPIO
based regulators.
Signed-off-by: Adam Ford <aford173@gmail.com>
Faiz Abbas [Thu, 20 Jun 2019 09:37:22 +0000 (15:07 +0530)]
ARM: dts: dra76x: Update MMC2_HS200_MANUAL1 iodelay values
Update the MMC2_HS200_MANUAL1 iodelay values to match with the latest
dra76x data manual[1].
Also this particular pinctrl-array is using spaces instead of tabs for
spacing between the values and the comments. Fix this as well.
[1] http://www.ti.com/lit/ds/symlink/dra76p.pdf
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Faiz Abbas [Thu, 20 Jun 2019 09:37:21 +0000 (15:07 +0530)]
ARM: dts: am57xx: Disable voltage switching for SD card
If UHS speed modes are enabled, a compatible SD card switches down to 1.8V
during enumeration. If after this a software reboot/crash takes place and
on-chip ROM tries to enumerate the SD card, the difference in
IO voltages (host @ 3.3V and card @ 1.8V) may end up damaging the card.
The fix for this is to have support for power cycling the card in
hardware (with a PORz/soft-reset line causing a power cycle of the card).
Because the beaglebone X15 (rev A,B and C), am57xx-evms and am57xx-idks don't
have this capability, disable voltage switching for these boards.
The major effect of this is that the maximum supported speed mode is now
high speed(50 MHz) down from SDR104(200 MHz).
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Faiz Abbas [Thu, 20 Jun 2019 09:37:20 +0000 (15:07 +0530)]
ARM: dts: am574x-idk: Add pinmuxes for mmc1 and mmc2
Sync with kernel dts by adding pinmuxes for mmc1 and mmc2. This fixes an
issue where mmc2 (eMMC) was coming up in HS52 mode instead of the
highest DDR52 mode.
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Faiz Abbas [Thu, 20 Jun 2019 09:37:19 +0000 (15:07 +0530)]
ARM: dts: dra7-mmc-iodelay: Add a new pinctrl group for clk line without pullup
During a short period when the bus voltage is switched from 3.3v to 1.8v,
(to enumerate UHS mode), the mmc module is disabled and the mmc IO lines
are kept in a state according to the programmed pad mux pull type.
According to 4.2.4.2 Timing to Switch Signal Voltage in "SD Specifications
Part 1 Physical Layer Specification Version 5.00 February 22, 2016", the
host should hold CLK low for at least 5ms.
In order to keep the card line low during voltage switch, the pad mux of
mmc1_clk line should be configured to pull down.
Add a new pinctrl group for clock line without pullup to be used in boards
where mmc1_clk line is not connected to an external pullup.
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:57 +0000 (10:29 +0530)]
configs: j721e_evm_a72: Add initial support
Add initial defconfig support for J721e that runs on A72.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[trini: Add MAINTAINERS entry]
Signed-off-by: Tom Rini <trini@konsulko.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:56 +0000 (10:29 +0530)]
configs: j721e_evm_r5: Add initial support
Add initial defconfig support for J721e that runs on R5.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[trini: Add MAINTAINERS file]
Signed-off-by: Tom Rini <trini@konsulko.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:55 +0000 (10:29 +0530)]
arm: dts: k3-j721e: Add r5 specific dt support
Add initial support for dt that runs on r5.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:54 +0000 (10:29 +0530)]
arm: dts: k3-j721e: Add initial support for common processor board
Common Processor board is the baseboard that has most of the actual connectors,
power supply etc. A SOM (System on Module) is plugged on to the common
processor board and this contains the SoC, PMIC, DDR and basic highspeed
components necessary for functionality. Add initial dt support for this
common processor board.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:53 +0000 (10:29 +0530)]
arm: dts: ti: Add Support for J721E SoC
Add initial SoC definition for J721E SoC.
Kernel dts posted here:
https://lore.kernel.org/lkml/
20190522161921.20750-1-nm@ti.com/
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:52 +0000 (10:29 +0530)]
dt-bindings: pinctrl: k3: Introduce pinmux definitions for J721E
Add pinctrl macros for J721E SoC. These macro definitions are
similar to that of AM6, but adding new definitions to avoid
any naming confusions in the soc dts files.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Faiz Abbas [Thu, 13 Jun 2019 04:59:51 +0000 (10:29 +0530)]
mmc: am654_sdhci: Separate J721E compatible into 8bit and 4bit versions
The j721e 4 bit instances don't have a hard DLL and therefore don't need
any DLL related configurations. Split the compatibles into an 8 bit and a
4 bit one. Add a private flags field which can be used to check if the
DLL is present and don't register the set_ios_post callback for the 4 bit
compatible instances.
Also update the compatibles in k3-j721e-main.dtsi to avoid breaking boot
with the new compatibles.
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Suman Anna [Thu, 13 Jun 2019 04:59:50 +0000 (10:29 +0530)]
board: ti: j721e: Enable fixing up msmc sram node
Create a ft_board_setup() api that gets called as part of
DT fixup before jumping to kernel. In this ft_board_setup()
call fdt_fixup_msmc_ram that update msmc sram node.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:49 +0000 (10:29 +0530)]
board: ti: j721e: Add board support for j721e evm
Add board specific initialization for j721e evm
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Suman Anna [Thu, 13 Jun 2019 04:59:48 +0000 (10:29 +0530)]
armv8: K3: j721e: Add custom MMU support
The A72 U-Boot code loads and boots a number of remote processors
including the C71x DSP, both the C66_0 and C66_1 DSPs, and the various
Main R5FSS Cores. Change the memory attributes for the DDR regions used
by the remote processors so that the cores can see and execute the
proper code.
A separate table based on the current AM65x table is added for J721E SoCs,
since the number of remote processors and their DDR usage will be different
between the two SoC families.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Andreas Dannenberg [Thu, 13 Jun 2019 04:59:47 +0000 (10:29 +0530)]
armv7R: K3: j721e: Load SYSFW binary and config from boot media
Use the System Firmware (SYSFW) loader framework to load and start
the SYSFW as part of the J721E early initialization sequence. While
at it also initialize the MCU_UART0 pinmux as it is used by SYSFW
to print diagnostic messages.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:46 +0000 (10:29 +0530)]
armv7R: K3: j721e: Shut down R5 core after ATF startup on A72
Populate the release_resources_for_core_shutdown() api with
shutting down r5 cores so that it will by called just after
jumping to ATF.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Andreas Dannenberg [Thu, 13 Jun 2019 04:59:45 +0000 (10:29 +0530)]
armv7R: K3: j721e: Store boot index from ROM
Obtain the boot index as left behind by the device boot ROM and store
it in scratch pad SRAM for later use before it may get overwritten.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Andreas Dannenberg [Thu, 13 Jun 2019 04:59:44 +0000 (10:29 +0530)]
armv7R: K3: j721e: Unlock all applicable control MMR registers
To access various control MMR functionality the registers need to
be unlocked. Do that for all control MMR regions in the MCU and MAIN
domains. We may want to go back later and limit the unlocking that's
being done.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:43 +0000 (10:29 +0530)]
armv7R: K3: j721e: Add support for boot device detection
J721E allows for booting from primary or backup boot media.
Both media can be chosen individually based on switch settings.
ROM looks for a valid image in primary boot media, if not found
then looks in backup boot media. In order to pass this boot media
information to boot loader, ROM stores a value at a particular
address. Add support for reading this information and determining
the boot media correctly.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Lokesh Vutla [Thu, 13 Jun 2019 04:59:42 +0000 (10:29 +0530)]
arm: K3: j721e: Add basic support for J721E SoC definition
The J721E SoC belongs to the K3 Multicore SoC architecture platform,
providing advanced system integration to enable lower system costs
of automotive applications such as infotainment, cluster, premium
Audio, Gateway, industrial and a range of broad market applications.
This SoC is designed around reducing the system cost by eliminating
the need of an external system MCU and is targeted towards ASIL-B/C
certification/requirements in addition to allowing complex software
and system use-cases.
Some highlights of this SoC are:
* Dual Cortex-A72s in a single cluster, three clusters of lockstep
capable dual Cortex-R5F MCUs, Deep-learning Matrix Multiply Accelerator(MMA),
C7x floating point Vector DSP, Two C66x floating point DSPs.
* 3D GPU PowerVR Rogue 8XE GE8430
* Vision Processing Accelerator (VPAC) with image signal processor and Depth
and Motion Processing Accelerator (DMPAC)
* Two Gigabit Industrial Communication Subsystems (ICSSG), each with dual
PRUs and dual RTUs
* Two CSI2.0 4L RX plus one CSI2.0 4L TX, one eDP/DP, One DSI Tx, and
up to two DPI interfaces.
* Integrated Ethernet switch supporting up to a total of 8 external ports in
addition to legacy Ethernet switch of up to 2 ports.
* System MMU (SMMU) Version 3.0 and advanced virtualisation
capabilities.
* Upto 4 PCIe-GEN3 controllers, 2 USB3.0 Dual-role device subsystems,
16 MCANs, 12 McASP, eMMC and SD, UFS, OSPI/HyperBus memory controller, QSPI,
I3C and I2C, eCAP/eQEP, eHRPWM, MLB among other peripherals.
* Two hardware accelerator block containing AES/DES/SHA/MD5 called SA2UL
management.
* Configurable L3 Cache and IO-coherent architecture with high data throughput
capable distributed DMA architecture under NAVSS
* Centralized System Controller for Security, Power, and Resource
Management (DMSC)
See J721E Technical Reference Manual (SPRUIL1, May 2019)
for further details: http://www.ti.com/lit/pdf/spruil1
Add base support for J721E SoC
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:55:59 +0000 (19:25 +0530)]
remoteproc: k3_rproc: Rename to ti_k3_arm64_rproc
k3_rproc driver is specifically meant for controlling an arm64
core using TISCI protocol. So rename the driver, Kconfig symbol,
compatible and functions accordingly.
While at it drop this remoteproc selection for a53 defconfig.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:55:58 +0000 (19:25 +0530)]
remoteproc: k3_rproc: Update the driver to use ti_sci_proc helpers
Update the k3_rproc driver to use the generic ti_sci_proc helper
apis which simplifies the driver a bit.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:55:57 +0000 (19:25 +0530)]
remoteproc: tisci: add TI-SCI processor control helper functions
Texas Instruments' K3 generation SoCs has specific modules/register
spaces used for configuring the various aspects of a remote processor.
These include power, reset, boot vector and other configuration features
specific to each compute processor present on the SoC. These registers
are managed by the System Controller such as DMSC on K3 AM65x SoCs.
The Texas Instrument's System Control Interface (TI-SCI) Message Protocol
is used to communicate to the System Controller from various compute
processors to invoke specific services provided by the firmware running
on the System Controller.
Add a common processor control interface header file that can be used by
multiple remoteproc drivers. The helper functions within this header file
abstract the various TI SCI protocol ops for the remoteproc drivers, and
allow them to request the System Controller to be able to program and
manage various remote processors on the SoC. The common macros required
by the R5 remoteproc driver were also added. The remoteproc drivers are
expected to manage the life-cycle of their ti_sci_proc_dev local
structures.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:55:56 +0000 (19:25 +0530)]
cmd: remoteproc: Allow list command to print the probed devices
'rproc list' is currently allowed only after probing all the
available remoteproc devices. Given that 'rproc init' is updated
to probe and initialize devices individually, allow the 'rproc list'
command to print all probed devices at any point.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:55:55 +0000 (19:25 +0530)]
cmd: remoteproc: Add support for initializing devices individually
'rproc init' does the probe and initialization of all the available
remoteproc devices in the system. This doesn't allow the flexibility
to initialize the remote cores needed as per use case. In order
to provide flexibility, update 'rproc init' command to accept one
more parameter with rproc id which when passed initializes only
that specific core. If no id is passed, command will initializes
all the cores which is compatible with the existing behaviour.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:47 +0000 (19:24 +0530)]
arm: dts: k3-am654: Update power-domains property for each node
Update the power-domain-cells to 2 and add the permissions
to each node. Mark the following nodes accessed by r5 as shared:
- DDR node
- main uart 0
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:46 +0000 (19:24 +0530)]
power: domain: ti_sci_power_domains: Add support for exclusive and shared access
TISCI protocol supports for enabling the device either with exclusive
permissions for the requesting host or with sharing across the hosts.
There are certain devices which are exclusive to Linux context and
there are certain devices that are shared across different host contexts.
So add support for getting this information from DT by increasing
the power-domain cells to 2.
For keeping the DT backward compatibility intact, defaulting the
device permissions to set the exclusive flag set. In this case the
power-domain-cells is 1.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:45 +0000 (19:24 +0530)]
dt-bindings: ti_sci_pm_domains: Add support for exclusive and shared access
TISCI protocol supports for enabling the device either with exclusive
permissions for the requesting host or with sharing across the hosts.
There are certain devices which are exclusive to Linux context and
there are certain devices that are shared across different host contexts.
So add support for getting this information from DT by increasing
the power-domain cells to 2.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:44 +0000 (19:24 +0530)]
power-domain: Add private data to power domain
Certain drivers want to attach private data corresponding to each
power domain. This data might be specific be to the drvier. So add
a priv entry into the power_domain structure.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:43 +0000 (19:24 +0530)]
armv7R: k3: Release all the exclusive devices
Release all the exclusive devices held by SPL.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Andreas Dannenberg [Fri, 7 Jun 2019 13:54:42 +0000 (19:24 +0530)]
armv7R: K3: am654: Shut down R5 core after ATF startup on A53
Rather than simply parking the R5 core in WFE after starting up ATF
on A53 instead use SYSFW API to properly shut down the R5 CPU cores
as well as associated timer resources that were pre-allocated. This
allows software further downstream to properly and gracefully bring
the R5 cores back online if desired.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:41 +0000 (19:24 +0530)]
firmware: ti_sci: Add a command for releasing all exclusive devices
Any host while requesting for a device can request for its exclusive
access. If an exclusive permission is obtained then it is the host's
responsibility to release the device before the software entity on
the host completes its execution. Else any other host's request for
the device will be nacked. So add a command that releases all the
exclusive devices that is acquired by the current host. This should
be used with utmost care and can be called only at the end of the
execution.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Andreas Dannenberg [Fri, 7 Jun 2019 13:54:40 +0000 (19:24 +0530)]
firmware: ti_sci: Add processor shutdown API method
Add and expose a new processor shutdown API that wraps the two TISCI
messages involved in initiating a core shutdown. The API will first
queue a message to have the DMSC wait for a certain processor boot
status to happen followed by a message to trigger the actual shutdown-
with both messages being sent without waiting or requesting for a
response. Note that the processor shutdown API call will need to be
followed up by user software placing the respective core into either
WFE or WFI mode.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Lokesh Vutla [Fri, 7 Jun 2019 13:54:39 +0000 (19:24 +0530)]
firmware: ti_sci: Allow for device shared and exclusive requests
Sysfw provides an option for requesting exclusive access for a
device using the flags MSG_FLAG_DEVICE_EXCLUSIVE. If this flag is
not used, the device is meant to be shared across hosts. Once a device
is requested from a host with this flag set, any request to this
device from a different host will be nacked by sysfw. Current tisci
driver enables this flag for every device requests. But this may not
be true for all the devices. So provide a separate commands in driver
for exclusive and shared device requests.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tom Rini [Thu, 25 Jul 2019 19:02:36 +0000 (15:02 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-net
- DaVinci emac DM work
- NXP driver work
- macb updates for RISC-V
Emmanuel Vadot [Fri, 19 Jul 2019 20:26:38 +0000 (22:26 +0200)]
net: sun8i_emac: Test the correct phy
H3/H5 can either use the internal phy or an external one.
Before getting clock and resets for the internal phy,
test that we are using it because otherwise it break emac
when using an external phy.
Tested-on: OrangePi PC2 (H5)
Fixes:
2348453c41 (net: sun8i_emac: Add EPHY CLK and RESET support)
Signed-off-by: Emmanuel Vadot <manu@freebsd.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>