oweals/u-boot.git
5 years agox86: Add a function to set variable MTRRs
Simon Glass [Wed, 25 Sep 2019 14:56:46 +0000 (08:56 -0600)]
x86: Add a function to set variable MTRRs

Normally U-Boot handles MTRRs through an add/commit process which
overwrites all MTRRs. But in very early boot it is not desirable to clear
the existing MTRRs since they may be in use and it can cause a hang.

Add a new mtrr_set_next_var() function which sets up the next available
MTRR to the required region.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: pass 'type' to set_var_mtrr() in mtrr_set_next_var()]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Refactor mtrr_commit() to allow for shared code
Simon Glass [Wed, 25 Sep 2019 14:56:45 +0000 (08:56 -0600)]
x86: Refactor mtrr_commit() to allow for shared code

Move the code that actually sets up the MTRR into another function so it
can be used elsewhere in the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Allow the PCH and LPC uclasses to work with of-platdata
Simon Glass [Wed, 25 Sep 2019 14:56:43 +0000 (08:56 -0600)]
x86: Allow the PCH and LPC uclasses to work with of-platdata

At present these uclasses assumes that they are used with a device tree.
Update them to support of-platdata as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: pci: Create a new sandbox_pci_read_bar() function
Simon Glass [Wed, 25 Sep 2019 14:56:42 +0000 (08:56 -0600)]
sandbox: pci: Create a new sandbox_pci_read_bar() function

The code in swapcase can be used by other sandbox drivers. Move it into a
common place to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: remove inclusion of <asm/test.h> in pci_sandbox.c]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Drop fdtdec_get_pci_addr()
Simon Glass [Wed, 25 Sep 2019 14:56:41 +0000 (08:56 -0600)]
dm: core: Drop fdtdec_get_pci_addr()

This function ise effectively replaced by ofnode_read_pci_addr() which
works with flat tree. Delete it to avoid code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Add new common CPU functions for turbo/burst mode
Simon Glass [Wed, 25 Sep 2019 14:56:40 +0000 (08:56 -0600)]
x86: Add new common CPU functions for turbo/burst mode

Add a few more CPU functions that are common on Intel CPUs. Also add
attribution for the code source.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: add missing MSR_IA32_MISC_ENABLE write back in cpu_set_eist();
        fix 2 typos in cpu_get_burst_mode_state() comments]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Tidy up some duplicate MSR defines
Simon Glass [Wed, 25 Sep 2019 14:56:39 +0000 (08:56 -0600)]
x86: Tidy up some duplicate MSR defines

Some MSR registers are defined twice in different parts of the file. Move
them together and remove the duplicates. Also drop some thermal defines
which are not used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Add common functions for TDP and perf control
Simon Glass [Wed, 25 Sep 2019 14:56:38 +0000 (08:56 -0600)]
x86: Add common functions for TDP and perf control

These functions are the same on modern Intel CPUs, so use common code to
set them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: return false instead of 0 in cpu_ivybridge_config_tdp_levels();
        fix 'muiltiplier' and 'desgn' typos]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Use a common bus clock for Intel CPUs
Simon Glass [Wed, 25 Sep 2019 14:56:37 +0000 (08:56 -0600)]
x86: Use a common bus clock for Intel CPUs

Modern Intel CPUs use a standard bus clock value of 100MHz, so put this in
a common file and tidy up the copies.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Add a common function to set CPU thermal target
Simon Glass [Wed, 25 Sep 2019 14:56:36 +0000 (08:56 -0600)]
x86: Add a common function to set CPU thermal target

This code appears in a few places, so move it to a common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Use a common definition of MSR_IA32_PERF_CTL
Simon Glass [Wed, 25 Sep 2019 14:56:35 +0000 (08:56 -0600)]
x86: Use a common definition of MSR_IA32_PERF_CTL

Remove the duplicate definition as it is not needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: pci: Drop the first parameter in pci_x86_r/w_config()
Simon Glass [Sun, 1 Sep 2019 03:23:18 +0000 (21:23 -0600)]
x86: pci: Drop the first parameter in pci_x86_r/w_config()

This parameter is needed by the PCI driver-mode interface but is always
NULL on x86. There are a number of calls to this function so it makes
sense to minimise the parameters.

Adjust the x86 function to omit the first parameter, and introduce stub
functions to handle the conversion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: rebase the patch against u-boot-x86/next to get it applied cleanly]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move acpi_s3.h to a common location
Simon Glass [Wed, 25 Sep 2019 14:56:32 +0000 (08:56 -0600)]
x86: Move acpi_s3.h to a common location

At present this hedaer is only available on x86. To allow sandbox to use
it for testing, move it to a common location.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Allow distinguishing between two phases in U-Boot
Simon Glass [Wed, 25 Sep 2019 14:56:30 +0000 (08:56 -0600)]
spl: Allow distinguishing between two phases in U-Boot

U-Boot has two distinct phases: before and after relocation. These are
commonly referred to as F (running from Flash) and R (Relocated and
running from RAM). Some drivers want to do different things in these
phases so update the SPL phase function to return a different value for
each.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Convert CONFIG_SPL_SIZE_LIMIT to hex
Simon Glass [Wed, 25 Sep 2019 14:56:28 +0000 (08:56 -0600)]
spl: Convert CONFIG_SPL_SIZE_LIMIT to hex

This is currently a decimal value which is not as convenient or
meaningful. Also U-Boot tends to use hex everywhere.

Convert this option to hex and add a comment for the size_check macro.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct the typo in the commit title]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Allow tiny printf() to be controlled in SPL and TPL
Simon Glass [Wed, 25 Sep 2019 14:56:27 +0000 (08:56 -0600)]
spl: Allow tiny printf() to be controlled in SPL and TPL

At present there is only one control for this and it is used for both SPL
and TPL. But SPL might have a lot more space than TPL so the extra cost of
a full printf() might be acceptable.

Split the option into two, providing separate SPL and TPL controls. The
TPL setting defaults to the same as SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoarm: mxs: Correct CONFIG_SPL_NO_CPU_SUPPORT option
Simon Glass [Wed, 25 Sep 2019 14:56:26 +0000 (08:56 -0600)]
arm: mxs: Correct CONFIG_SPL_NO_CPU_SUPPORT option

At present this is defined in Kconfig but there is a separate one in the
CONFIG whitelist. It looks like these are duplicates.

Rename the non-Kconfig one and remove it from the whitelist.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoiod: Enhance to support display of multiple values
Simon Glass [Wed, 25 Sep 2019 14:56:25 +0000 (08:56 -0600)]
iod: Enhance to support display of multiple values

At present the 'iod' command differs from 'md' in that it only shows a
single value. It is useful to see a dump of multiple values, particularly
when x86 peripherals contain register sets accessible via I/O ports.

Enhance the command to match md.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct multi-line comment format style]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agocros_ec: Add MEC_EMI_BASE and size to the header file
Simon Glass [Wed, 25 Sep 2019 14:56:24 +0000 (08:56 -0600)]
cros_ec: Add MEC_EMI_BASE and size to the header file

Provide these values which are part of the EC interface now.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agolog: Add log_nop() to avoid unused-variable warnings
Simon Glass [Wed, 25 Sep 2019 14:56:23 +0000 (08:56 -0600)]
log: Add log_nop() to avoid unused-variable warnings

If a log statement includes a variable and logging is disabled, this can
generate warnings about unused variables. Add a bit more complexity to the
macros to avoid this for the common case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Take account of skip-at-start with image-header
Simon Glass [Wed, 25 Sep 2019 14:56:22 +0000 (08:56 -0600)]
binman: Take account of skip-at-start with image-header

The image-header currently sets it offset assuming that skip-at-start is
zero. This does not work on x86 where offsets end at 4GB. Add in this
value so that the offset is correct.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Handle reading data for end-at-4gb sections
Simon Glass [Wed, 25 Sep 2019 14:56:21 +0000 (08:56 -0600)]
binman: Handle reading data for end-at-4gb sections

Some x86 sections have special offsets which currently result in empty
data being returned from the 'extract' command. Fix this by taking account
of the skip-at-start property.

Add a little more debugging while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Add a base implementation of Entry.ReadChildData()
Simon Glass [Wed, 25 Sep 2019 14:56:20 +0000 (08:56 -0600)]
binman: Add a base implementation of Entry.ReadChildData()

At present this function is not present in the Entry base class so it is
hard to find the documentation for it. Move the docs from the section
class and expand it a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Allow verbose output with all commands
Simon Glass [Mon, 16 Sep 2019 00:10:36 +0000 (18:10 -0600)]
binman: Allow verbose output with all commands

At present the verbose flag only works for the 'build' command. This is
not intended, nor is it useful. Update the code to support the verbose
flag and make use of a command exception handler.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: rebase the patch against u-boot-x86/next to get it applied cleanly]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoserial: ns16550: Add a PCI device/function field
Simon Glass [Wed, 25 Sep 2019 14:56:18 +0000 (08:56 -0600)]
serial: ns16550: Add a PCI device/function field

When this UART is used early in boot (before PCI is set up) it is
convenient to store the PCI BDF of the UART so that it can be manually
configured. This is useful when it is used as a debug UART, for example.

Add a new field to hold this information, so that drivers can simply use
the existing platform data.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: pci: Add a function to read a PCI BAR
Simon Glass [Sun, 15 Sep 2019 18:08:58 +0000 (12:08 -0600)]
dm: pci: Add a function to read a PCI BAR

At present PCI address transaction is not supported so drivers must
manually read the correct BAR after reading the device tree info. The
ns16550 has a suitable implementation, so move this code into the core
DM support.

Note that there is no live-tree equivalent at present.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct the unclear comments in test.dts]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Show a message if PCI autoconfig fails
Simon Glass [Wed, 25 Sep 2019 14:56:16 +0000 (08:56 -0600)]
pci: Show a message if PCI autoconfig fails

At present this fails silently which can be confusing since some devices
on the PCI bus may not work correctly. Show a message in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: add a '\n' in the PCI autoconfig fail message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Add more debug detail when resources are exhausted
Simon Glass [Wed, 25 Sep 2019 14:56:15 +0000 (08:56 -0600)]
pci: Add more debug detail when resources are exhausted

If PCI auto-config runs out of memory, show a few more details to help
diagnose the problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: change %x to %llx to avoid build warnings on some platforms]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Correct 'specifified' and 'Plese' typos
Simon Glass [Wed, 25 Sep 2019 14:56:14 +0000 (08:56 -0600)]
pci: Correct 'specifified' and 'Plese' typos

Fix these spelling errors the header file and documentation.

Fix a small typo in the PCI documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Disable autoconfig in SPL
Simon Glass [Wed, 25 Sep 2019 14:56:13 +0000 (08:56 -0600)]
pci: Disable autoconfig in SPL

At present U-Boot runs autoconfig in SPL but this is best left to U-Boot
proper. For TPL and SPL we can normally used fixed BARs and save code size
and time.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Show the result of binding a device
Simon Glass [Wed, 25 Sep 2019 14:56:12 +0000 (08:56 -0600)]
pci: Show the result of binding a device

Update the debugging info a little to show the result of trying to bind
a PCI device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: sandbox: Probe PCI emulation devices when used
Simon Glass [Sat, 31 Aug 2019 23:59:32 +0000 (17:59 -0600)]
pci: sandbox: Probe PCI emulation devices when used

At present PCI emulation devices are not probed before use, since they
used to be children of the device that used them, and children cannot be
probed before their parents.

Now that PCI emulation devices are attached to the root node, we can
simply probe them, and avoid using the internal function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: rebase the patch against u-boot-x86/next to get it applied cleanly]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: sandbox: Move the emulators into their own node
Simon Glass [Wed, 25 Sep 2019 14:56:10 +0000 (08:56 -0600)]
pci: sandbox: Move the emulators into their own node

Sandbox pci works using emulation drivers which are currently children of
the pci device:

pci-controller {
pci@1f,0 {
compatible = "pci-generic";
reg = <0xf800 0 0 0 0>;
emul@1f,0 {
compatible = "sandbox,swap-case";
};
};
};

In this case the emulation device is attached to pci device on address
f800 (device 1f, function 0) and provides the swap-case functionality.

However this is not ideal, since every device on a PCI bus has a child
device. This is only really the case for sandbox, but we want to avoid
special-case code for sandbox.

Worse, child devices cannot be probed before their parents. This forces
us to use 'find' rather than 'get' to obtain the emulator device. In fact
the emulator devices are never probed. There is code in
sandbox_pci_emul_post_probe() which tries to track when emulators are
active, but at present this does not work.

A better approach seems to be to add a separate node elsewhere in the
device tree, an 'emulation parent'. This could be given a bogus address
(such as -1) to hide the emulators away from the 'pci' command, but it
seems better to keep it at the root node to avoid such hacks.

Then we can use a phandle to point from the device to the correct
emulator, and only on sandbox. The code to find an emulator does not
interfere with normal pci operation.

Add a new UCLASS_PCI_EMUL_PARENT uclass which allows finding an emulator
given a bus, and finding a bus given an emulator. Update the existing
device trees and the code for finding an emulator.

This brings PCI emulators more into line with I2C.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fix 3 typos in the commit message;
        encode bus number in the labels of swap_case_emul nodes;
        mention commit 4345998ae9df in sandbox_pci_get_emul()]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: Allow use of real I/O with readl(), etc.
Simon Glass [Wed, 25 Sep 2019 14:56:09 +0000 (08:56 -0600)]
sandbox: Allow use of real I/O with readl(), etc.

At present these functions are stubbed out. For more comprehensive testing
with PCI devices it is useful to be able to fully emulate I/O access. Add
simple implementations for these.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: change to use 'const void *' in sandbox_write();
        cast 'addr' in read/write macros in arch/sandbox/include/asm/io.h;
        remove the unnecessary cast in readq/writeq in nvme.h]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: pci: Increase the memory space
Simon Glass [Wed, 25 Sep 2019 14:56:08 +0000 (08:56 -0600)]
sandbox: pci: Increase the memory space

Increase the memory space so we can support the p2sb bus which needs
multiples of 1MB.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: Add a -T flag to use the test device tree
Simon Glass [Wed, 25 Sep 2019 14:56:07 +0000 (08:56 -0600)]
sandbox: Add a -T flag to use the test device tree

U-Boot already supports using -D to indicate that it should use the normal
device tree. It is sometimes useful to run with the test device tree, e.g.
when running a test. Add a -T option for this along with some
documentation.

It can be used like this:

   /tmp/b/sandbox/u-boot -T -c "ut dm pci_busdev"

(this will use /tmp/b/sandbox/arch/sandbox/dts/test.dtb as the DT)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: pci: Move pci_offset_to_barnum() to pci.h
Simon Glass [Wed, 25 Sep 2019 14:56:06 +0000 (08:56 -0600)]
sandbox: pci: Move pci_offset_to_barnum() to pci.h

This function is useful in PCI emulators. More it into the header file to
avoid duplicating it in other drivers.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: pci: Drop the get_devfn() method
Simon Glass [Wed, 25 Sep 2019 14:56:04 +0000 (08:56 -0600)]
sandbox: pci: Drop the get_devfn() method

This method is not used anymore since the bus/device/function of PCI
devices can be obtained from their (parent's per-child) platform data.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: swap_case: Use statics where possible
Simon Glass [Wed, 25 Sep 2019 14:56:03 +0000 (08:56 -0600)]
sandbox: swap_case: Use statics where possible

Some functions and a struct should be marked static since they are not
used outside this file. Update them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: Add support for clrsetio_32() and friends
Simon Glass [Wed, 25 Sep 2019 14:56:02 +0000 (08:56 -0600)]
sandbox: Add support for clrsetio_32() and friends

These functions are available on x86 but not sandbox. They are useful
shortcuts and clarify the code, so add them to sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: Rename PCI ID for swap_case to be more specific
Simon Glass [Wed, 25 Sep 2019 14:56:01 +0000 (08:56 -0600)]
sandbox: Rename PCI ID for swap_case to be more specific

Rename this ID to SANDBOX_PCI_SWAP_CASE_EMUL_ID since it is more
descriptive and allows us to add new PCI emulators without any conflict or
confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: mmc: Fix up MMC emulator for valgrind
Simon Glass [Wed, 25 Sep 2019 14:56:00 +0000 (08:56 -0600)]
sandbox: mmc: Fix up MMC emulator for valgrind

At present running sandbox with valgrind produces some warnings due to the
MMC emulator not filling in all the expected fields. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: use sizeof() instead of hardcoded 16]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agosandbox: spmi: Add ranges property for address translation
Simon Glass [Wed, 25 Sep 2019 14:55:59 +0000 (08:55 -0600)]
sandbox: spmi: Add ranges property for address translation

At present address translation does not work since there is no ranges
property in the spmi nodes. Add empty ranges properties and a little more
logging so that this shows the error:

   /tmp/b/sandbox/u-boot -d /tmp/b/sandbox/arch/sandbox/dts/test.dtb \
-c "ut dm spmi_access_peripheral" -L7 -v
   ...
   pm8916_gpio_probe() bad address: returning err=-22

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: test: Correct a stray backslash in dm_test_destroy()
Simon Glass [Wed, 25 Sep 2019 14:55:57 +0000 (08:55 -0600)]
dm: test: Correct a stray backslash in dm_test_destroy()

This should perhaps be a period.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: add the ending period and reword the commit message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Add device_foreach_child()
Simon Glass [Wed, 25 Sep 2019 14:55:56 +0000 (08:55 -0600)]
dm: core: Add device_foreach_child()

We have a 'safe' version of this function but sometimes it is not needed.
Add a normal version too and update a few places that can use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Correct the return value for uclass_find_first_device()
Simon Glass [Wed, 25 Sep 2019 14:55:55 +0000 (08:55 -0600)]
dm: core: Correct the return value for uclass_find_first_device()

This function returns -ENODEV when there is no device. This is
inconsistent with other functions, such as uclass_find_next_device(),
which returns 0.

Update it and tidy up the incorrect '-1' values in the comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Call ofdata_to_platdata() with of-platdata
Simon Glass [Wed, 25 Sep 2019 14:55:53 +0000 (08:55 -0600)]
dm: core: Call ofdata_to_platdata() with of-platdata

At present this function is never called when of-platdata is enabled since
we never have a device tree. However, this function is responsible for
copying over the of-platdata, so we must call it. Otherwise the probe()
method would have to be used.

Correct this and fix the sandbox serial driver to not read from the device
tree and try to write to what is read-only platdata on some platforms.

Fixes: 396e343b3d (dm: core: Allow binding a device from a live tree)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: test: Don't fail when tests are skipped due to build
Simon Glass [Wed, 25 Sep 2019 14:55:52 +0000 (08:55 -0600)]
dm: test: Don't fail when tests are skipped due to build

At present tests that are marked as only for livetree fail when executed
on sandbox_flattree. They cannot actually be executed, but we should not
resport them as 'not found', since this causes errors. Instead, they
should be silently skipped.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: test: Fix running of multiple test from command line
Simon Glass [Wed, 25 Sep 2019 14:55:51 +0000 (08:55 -0600)]
dm: test: Fix running of multiple test from command line

At present when multiple 'ut dm' commands are executed, all but the first
is run with a flat tree, even if live tree is enabled. This is because the
live tree node pointer is set to NULL and never restored.

This does not affect normal test running, which just runs all the test in
one go, but can be confusing when several individual tests are run during
the same U-Boot run.

Correct this by restoring the pointer.

Fixes: c166c47ba3 (dm: test: Add support for running tests with livetree)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Add documentation on how to debug driver model
Simon Glass [Wed, 25 Sep 2019 14:55:48 +0000 (08:55 -0600)]
dm: core: Add documentation on how to debug driver model

Sometimes devices don't appear and it can be confusing. Add a few notes to
help with this situation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fix 2 issues in the doc and include the doc in the index.rst]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Drop a few early returns
Simon Glass [Wed, 25 Sep 2019 14:55:47 +0000 (08:55 -0600)]
dm: core: Drop a few early returns

Two functions in this file return early for no good reason. Adjust the
code to match the standard DM style of returning 0 at the end of the
function on success.

Oddly enough this save 12 bytes of code size on ARM.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodm: core: Use U-Boot logging instead of pr_debug()
Simon Glass [Wed, 25 Sep 2019 14:55:45 +0000 (08:55 -0600)]
dm: core: Use U-Boot logging instead of pr_debug()

The pr_debug() functions do not response to setting the log level and in
fact have their own separate log level. Use U-Boot logging instead.

Perhaps we should make these options redirect to log_debug(), etc.?

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Rename turbo ratio MSR to MSR_TURBO_RATIO_LIMIT
Simon Glass [Wed, 25 Sep 2019 14:11:47 +0000 (08:11 -0600)]
x86: Rename turbo ratio MSR to MSR_TURBO_RATIO_LIMIT

This MSR number is used on most modern Intel processors, so drop the
confusing NHM prefix (which might mean Nehalem).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: drop MSR_IVT_TURBO_RATIO_LIMIT as no code uses it]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Add various MTRR indexes and values
Simon Glass [Wed, 25 Sep 2019 14:11:46 +0000 (08:11 -0600)]
x86: Add various MTRR indexes and values

Add some new MTRRs used by Apollolake as well as a mask for the MTRR
type.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Add more comments to the start-up code
Simon Glass [Wed, 25 Sep 2019 14:11:44 +0000 (08:11 -0600)]
x86: Add more comments to the start-up code

The full start-up sequence (TPL->SPL->U-Boot) can be a bit confusing since
each phase has its own 'start' file. Add comments to explain this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Change condition for using CAR
Simon Glass [Wed, 25 Sep 2019 14:11:43 +0000 (08:11 -0600)]
x86: Change condition for using CAR

At present we assume that CAR (Cache-as-RAM) is used if HOBs (Hand-off
blocks) are not, since HOBs typically indicate that an FSP is in use, and
FSPs handle the CAR init.

However this is a bit indirect, and for FSP2 machines which use their own
CAR implementation (such as apollolake) but use the FSP for other
functions, the logic is wrong.

To fix this, add a dedicated Kconfig option to indicate when CAR is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fix a typo in the commit message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Save usable RAM and hob_list in the handoff area
Simon Glass [Wed, 25 Sep 2019 14:11:41 +0000 (08:11 -0600)]
x86: fsp: Save usable RAM and hob_list in the handoff area

The useable RAM is calculated when the RAM is inited. Save this value so
that it can be easily used in U-Boot proper.

Also save a pointer to the hob list so that it is accessible (before
relocation only) in U-Boot proper. This avoids having to scan it in SPL,
for everything U-Boot proper might need later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: guard handoff_arch_save() with IS_ENABLED(CONFIG_USE_HOB)]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: spl: Move broadwell-specific code out of generic x86 spl
Simon Glass [Wed, 25 Sep 2019 14:11:40 +0000 (08:11 -0600)]
x86: spl: Move broadwell-specific code out of generic x86 spl

When TPL is running, broadwell needs to do different init from SPL. There
is no need for this code to be in the generic x86 SPL file, so move it to
arch_cpu_init().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: spl: Reduce priority of the basic SPL image loader
Simon Glass [Wed, 25 Sep 2019 14:11:39 +0000 (08:11 -0600)]
x86: spl: Reduce priority of the basic SPL image loader

This image loader works on systems where the flash is directly mapped to
the last part of the 32-bit address space. On recent Intel systems (such
as apollolake) this is not the case.

Reduce the priority of this loader so that another one can override it.

While we are here, rename the loader to BOOT_DEVICE_SPI_MMAP since
BOOT_DEVICE_BOARD is not very descriptive.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: spl: Use hang() instead of a while() loop
Simon Glass [Wed, 25 Sep 2019 14:11:38 +0000 (08:11 -0600)]
x86: spl: Use hang() instead of a while() loop

Use the standard hang() function when booting fails since this implements
the defined U-Boot behaviour for this situation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: pci: Add a function to clear and set PCI config regs
Simon Glass [Wed, 25 Sep 2019 14:11:37 +0000 (08:11 -0600)]
x86: pci: Add a function to clear and set PCI config regs

At present the x86 pre-DM equivalent of pci_bus_clrset_config32() does not
exist. Add it to simplify PCI init code on x86.

Also add the missing functions to this header.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Add binman symbols to the image
Simon Glass [Wed, 25 Sep 2019 14:11:36 +0000 (08:11 -0600)]
x86: Add binman symbols to the image

It is useful in SPL and TPL to access symbols from binman, such as the
position and size of an entry in the ROM. Collect these symbols together
in the SPL binaries.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move common Intel CPU info code into a function
Simon Glass [Wed, 25 Sep 2019 14:11:35 +0000 (08:11 -0600)]
x86: Move common Intel CPU info code into a function

Add cpu_intel_get_info() to find out the CPU info on modern Intel CPUs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: add parameter and return value descriptions]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Add access to variable MRC data
Simon Glass [Wed, 25 Sep 2019 14:11:34 +0000 (08:11 -0600)]
x86: fsp: Add access to variable MRC data

With FSP2 the non-volatile storage used by the FSP to init memory can be
split into a fixed piece (determined at compile time) and a variable piece
(determined at run time). Add support for reading the latter.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Add a few more definitions for FSP2
Simon Glass [Wed, 25 Sep 2019 14:11:33 +0000 (08:11 -0600)]
x86: fsp: Add a few more definitions for FSP2

Add definitions for the FSP signature and the FSP init phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoefi: Move inline functions to unconditional part of header
Simon Glass [Wed, 25 Sep 2019 14:11:32 +0000 (08:11 -0600)]
efi: Move inline functions to unconditional part of header

At present these two functions are defined in efi_loader.h but only if
CONFIG_EFI_LOADER is enabled. But these are functions that are useful to
other code, such as that which deals with Intel Handoff Blocks (HOBs).

Move these to the top of the function.

Possibly ascii2unicode() should not be an inline function, since this
might impact code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Move common support functions into a common file
Simon Glass [Wed, 25 Sep 2019 14:11:31 +0000 (08:11 -0600)]
x86: fsp: Move common support functions into a common file

Some of this file can be shared between FSP1 and FSP2. Move it into a
shared file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move common fsp functions into a common file
Simon Glass [Wed, 25 Sep 2019 14:11:30 +0000 (08:11 -0600)]
x86: Move common fsp functions into a common file

Some of this file can be shared between FSP1 and FSP2. Move it into a
shared file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Move common dram functions into a common file
Simon Glass [Sat, 24 Aug 2019 20:10:32 +0000 (14:10 -0600)]
x86: fsp: Move common dram functions into a common file

Most of the DRAM functionality can be shared between FSP1 and FSP2. Move
it into a shared file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: rebase the patch against u-boot-x86/next to get it applied cleanly]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Tidy up comment style a little
Simon Glass [Sun, 25 Aug 2019 16:10:59 +0000 (10:10 -0600)]
x86: fsp: Tidy up comment style a little

The comments in the FSP code use a different style from the rest of the
x86 code. I am not sure it this is intentional.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fix 2 comment style issues]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Use if() instead of #ifdef
Simon Glass [Wed, 25 Sep 2019 14:11:27 +0000 (08:11 -0600)]
x86: fsp: Use if() instead of #ifdef

Update a few #ifdefs to if() to improve build coverage.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: recover the codes that got wrongly deleted in dram_init()]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: fsp: Create a common fsp_support.h header
Simon Glass [Sat, 24 Aug 2019 20:19:05 +0000 (14:19 -0600)]
x86: fsp: Create a common fsp_support.h header

Many support functions are common between FSP1 and FSP2. Add a new header
to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: remove forward declarations in fsp_support.h]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Rename some FSP functions to have an fsp_ prefix
Simon Glass [Wed, 25 Sep 2019 14:11:25 +0000 (08:11 -0600)]
x86: Rename some FSP functions to have an fsp_ prefix

Given these exported function an fsp_ prefix since they are declared in an
fsp.h header.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: sysreset: Allow reset driver to be included in SPL/TPL
Simon Glass [Wed, 25 Sep 2019 14:11:24 +0000 (08:11 -0600)]
x86: sysreset: Allow reset driver to be included in SPL/TPL

At present this driver is always included in SPL and TPL, if U-Boot proper
enables it. Update the Makefile to provide full control using the existing
Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: make the Kconfig help text a little bit clearer]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Add a function to determine the U-Boot phase
Simon Glass [Wed, 25 Sep 2019 14:11:20 +0000 (08:11 -0600)]
spl: Add a function to determine the U-Boot phase

U-Boot is built in three phases: TPL, SPL and U-Boot proper. Sometimes
it is necessary to use different init code depending on the phase. For
example, TPL might do very basic CPU init, SPL might do a little more
and U-Boot proper might bring the CPU up to full speed and enable all
cores.

Add a function which allows easy determination of the current phase being
built.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Set up the bloblist in board_init_r()
Simon Glass [Wed, 25 Sep 2019 14:11:19 +0000 (08:11 -0600)]
spl: Set up the bloblist in board_init_r()

At present the bloblist is set up in spl_common_init() which can be called
from spl_early_init(), i.e. before SDRAM is ready. This prevents the
bloblist from being located in SDRAM, which is useful on some platforms
where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region).

It doesn't serve much purpose to have the bloblist available early, since
very little is known about the platform then, and the handoff info is
written when SPL is about to jump to U-Boot.

Move the code to board_init_r() to avoid any restrictions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Add an arch-specific hook for writing to SPL handoff
Simon Glass [Wed, 25 Sep 2019 14:11:18 +0000 (08:11 -0600)]
spl: Add an arch-specific hook for writing to SPL handoff

At present there is an arch-specific area in the SPL handoff area intended
for use by arch-specific code, but there is no explicit call to fill in
this data. Add a hook for this.

Also use the hook to remove the sandbox-specific test code from
write_spl_handoff().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: handoff: Correct Kconfig condition for SPL and TPL
Simon Glass [Wed, 25 Sep 2019 14:11:17 +0000 (08:11 -0600)]
spl: handoff: Correct Kconfig condition for SPL and TPL

At present these options can be enabled when bloblist is not enabled for
SPL or TPL. This is incorrect as SPL handoff requires bloblist. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: Avoid checking for Ctrl-C in SPL with print_buffer()
Simon Glass [Wed, 25 Sep 2019 14:11:16 +0000 (08:11 -0600)]
spl: Avoid checking for Ctrl-C in SPL with print_buffer()

We don't have a console in SPL so it doesn't make sense to check for
Ctrl-C when printing a memory dump. Skip this so that print_buffer() can
be used in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoserial: ns16550: Allow serial to enabled/disabled in SPL
Simon Glass [Wed, 25 Sep 2019 14:11:14 +0000 (08:11 -0600)]
serial: ns16550: Allow serial to enabled/disabled in SPL

At present this driver uses the wrong condition for including the code and
drivers in SPL/TPL. Update it so that the code is only included if
DM_SERIAL is enabled for SPL/TPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agomtd: spi: Add 'struct spi_flash {' to the code
Simon Glass [Wed, 25 Sep 2019 14:11:13 +0000 (08:11 -0600)]
mtd: spi: Add 'struct spi_flash {' to the code

At present spi_flash is defined to be spi_nor which is confusing since it
is not possible to find the 'spi_flash' by normal text search. Add a
comment to help with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Allow selection of logging verbosity
Simon Glass [Wed, 25 Sep 2019 14:11:11 +0000 (08:11 -0600)]
binman: Allow selection of logging verbosity

Support a new BINMAN_VERBOSE option to the build, to allow passing the
-v flag to binman.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Pass the toolpath to binman from the main Makefile
Simon Glass [Wed, 25 Sep 2019 14:11:10 +0000 (08:11 -0600)]
binman: Pass the toolpath to binman from the main Makefile

Pass in the toolpath in case binman needs to use tools compiled in the
U-Boot tools/ directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_ffs.h include to fsp_arch.h
Simon Glass [Wed, 25 Sep 2019 14:00:20 +0000 (08:00 -0600)]
x86: Move fsp_ffs.h include to fsp_arch.h

This include file is only used for FSP v1. Avoid including it from
fdt_support.h so we can use the latter with FSP v2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_bootmode.h to the generic fsp directory
Simon Glass [Wed, 25 Sep 2019 14:00:19 +0000 (08:00 -0600)]
x86: Move fsp_bootmode.h to the generic fsp directory

This header file is the same for FSP v1 and v2, although there may be
some additions to come. Move it into the generic fsp directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_infoheader.h to the generic fsp directory
Simon Glass [Wed, 2 Oct 2019 00:26:41 +0000 (08:26 +0800)]
x86: Move fsp_infoheader.h to the generic fsp directory

This header file is the same for FSP v1 and v2. Move it into the general
fsp directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: move rename of fsp_infoheader.h from previous patch to this one]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_hob.h to the generic fsp directory
Simon Glass [Wed, 2 Oct 2019 00:25:10 +0000 (08:25 +0800)]
x86: Move fsp_hob.h to the generic fsp directory

This header file is the same for FSP v1 and v2. Move it into the general
fsp directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: remove inclusion of fsp_hob.h in fsp_support.h]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_fv.h to the generic fsp directory
Simon Glass [Wed, 25 Sep 2019 14:00:16 +0000 (08:00 -0600)]
x86: Move fsp_fv.h to the generic fsp directory

This header file is the same for FSP v1 and v2. Move it into the general
fsp directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_types.h to the generic fsp directory
Simon Glass [Wed, 25 Sep 2019 14:00:15 +0000 (08:00 -0600)]
x86: Move fsp_types.h to the generic fsp directory

This header file is the same for FSP v1 and v2. Move it into the general
fsp directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_api.h inclusion out of fsp_support.h
Simon Glass [Wed, 25 Sep 2019 14:00:14 +0000 (08:00 -0600)]
x86: Move fsp_api.h inclusion out of fsp_support.h

This header file is different for each version of FSP. Move it into the
fsp_arch.h header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Create a new fsp_arch.h header
Simon Glass [Wed, 25 Sep 2019 14:00:13 +0000 (08:00 -0600)]
x86: Create a new fsp_arch.h header

At present fsp_support.h includes fsp_vpd.h which is an FPSv1 concept
(VPD means Vital Product Data). For FSPv2 only UPD (Updatable Product
Data) is used.

To avoid mangling header files, put these two includes in a separate
header which we can adjust as necessary for FSPv2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Move fsp_azalia.h to the generic fsp directory
Simon Glass [Wed, 25 Sep 2019 14:00:12 +0000 (08:00 -0600)]
x86: Move fsp_azalia.h to the generic fsp directory

This header file is the same for FSP v1 and v2. Move it into the general
fsp directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: remove forward declarations in fsp_support.h]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: Rename existing FSP code to fsp1
Simon Glass [Wed, 25 Sep 2019 14:00:11 +0000 (08:00 -0600)]
x86: Rename existing FSP code to fsp1

Since there is now a new version of the FSP and it is incompatible with
the existing version, move the code into an fsp1 directory. This will
allow us to put FSP v2 code into an fsp2 directory.

Add a Kconfig which defines which version is in use.

Some of the code in this new fsp1/ directory is generic across both FSPv1
and FSPv2. Future patches will address this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoPrepare v2019.10 v2019.10
Tom Rini [Mon, 7 Oct 2019 21:14:02 +0000 (17:14 -0400)]
Prepare v2019.10

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoNET: DW: fix regression for ARC boards
Eugeniy Paltsev [Mon, 7 Oct 2019 16:10:50 +0000 (19:10 +0300)]
NET: DW: fix regression for ARC boards

The commit
642b80d256e ("net: designware: drop compatible altr, socfpga-stmmac")
breaks designware ethernet for all ARC boards. It removes
"altr, socfpga-stmmac" compatible from "drivers/net/designware.c"
without changing compatible in the boards which use it.

Fix that by adding "snps,arc-dwmac-3.70a" compatible string to
"drivers/net/designware.c" and using it in ARC boards device tree.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
5 years agoMerge branch '2019-10-06-master-imports'
Tom Rini [Sun, 6 Oct 2019 22:02:18 +0000 (18:02 -0400)]
Merge branch '2019-10-06-master-imports'

- Regression work-around on SoCFPGA by disabling WDT in some cases.
- Fix seg fault on 'host info' in some cases.

5 years agocmd: host: fix seg fault at "host info"
AKASHI Takahiro [Thu, 22 Aug 2019 07:47:39 +0000 (16:47 +0900)]
cmd: host: fix seg fault at "host info"

With the patch below applied, host_block_dev structure was switched
to be placed in platdata rather than priv. The command "host info"
must be aligned with this change. Otherwise, we will see "Segmentation
Fault."

Fixes: 8f994c860d91 ("sandbox: blk: Switch to use platdata_auto_alloc_size for the driver data")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMAINTAINERS: Update my email address
Maxime Ripard [Thu, 3 Oct 2019 16:32:11 +0000 (18:32 +0200)]
MAINTAINERS: Update my email address

I'm not at bootlin anymore, and my mail address doesn't work any longer.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
5 years agoarm: socfpga: disable CONFIG_SPL_WDT for gen5 and a10
Simon Goldschmidt [Sat, 5 Oct 2019 20:10:11 +0000 (22:10 +0200)]
arm: socfpga: disable CONFIG_SPL_WDT for gen5 and a10

These boards don't have a watchdog enabled in SPL, so make sure
CONFIG_SPL_WDT is not enabled.

Fixes: commit 6874cb72204f ("watchdog: Split WDT from SPL_WDT")

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agogitlab-ci: fix typo 'plaforms'
Heinrich Schuchardt [Sun, 6 Oct 2019 10:26:16 +0000 (12:26 +0200)]
gitlab-ci: fix typo 'plaforms'

%s/plaforms/platforms/g

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>