summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ARM: uniphier: change the default of SoC select to UNIPHIER_V7_MULTIMasahiro Yamada2017-10-151-1/+1
| | | | | | | ARCH_UNIPHIER_V8_MULTI depends on !SPL, so the default may be hidden. Use a clearer default. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* reset: uniphier: fix the first argument passed to dev_err()Masahiro Yamada2017-10-151-1/+2
| | | | | | priv->dev does not exist. Pass the correct pointer to udevice. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* clk: uniphier: add PXs3 clock dataMasahiro Yamada2017-10-153-0/+23
| | | | | | Add basic clock data for Socionext's new SoC PXs3. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* clk: uniphier: rework for better clock tree structureMasahiro Yamada2017-10-154-183/+323
| | | | | | | | U-Boot does not support fancy clock tree structures like the Linux common clock framework. Implement a simple clock tree model at the driver level. With this, the clock data will be simplified. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* i2c: uniphier-f: replace debug() with dev_dbg()Masahiro Yamada2017-10-151-62/+52
| | | | | | | | | | Use dev_dbg() functions. It will be helpful to prefix log messages with the corresponding device name when the core framework is ready. While I am here, I renamed "dev", which was actually private data, into "priv" because dev->dev looks confusing. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* i2c: uniphier: replace debug() with dev_dbg()Masahiro Yamada2017-10-151-30/+33
| | | | | | | | | | Use dev_dbg() functions. It will be helpful to prefix log messages with the corresponding device name when the core framework is ready. While I am here, I renamed "dev", which was actually private data, into "priv" because dev->dev looks confusing. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* usb: dwc3-uniphier: replace <common.h> with <linux/bitops.h>Masahiro Yamada2017-10-151-1/+1
| | | | | | | | Including <common.h> pulls in a lot of bloat. What this driver needs is BIT(), so replace it with <linux/bitops.h> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Marek Vasut <marex@denx.de>
* ARM: uniphier: use pr_() instead of printf() where appropriateMasahiro Yamada2017-10-159-19/+35
| | | | | | Replace printf() with pr_() to specify proper loglevel. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* pinctrl: uniphier: simplify input enable and delete pin arraysMasahiro Yamada2017-10-156-89/+3
| | | | | | | | | The pin data are implemented for old SoCs to specify the bit shift of the IECTRL register. They are not wortwhile given the required memory footprint. Delete all the pin data and enable all bits of the IECTRL register. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* pinctrl: uniphier: set PUPD_SIMPLE cap flag for PXs3Masahiro Yamada2017-10-151-1/+2
| | | | | | | Like other recenct UniPhier SoCs, the pupdctrl number of PXs3 matches to the pin number. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: dts: uniphier: update GPIO nodesMasahiro Yamada2017-10-157-802/+71
| | | | | | Switch to the single node design. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* gpio: uniphier: rework single device node modelMasahiro Yamada2017-10-151-51/+89
| | | | | | | | | | | | | | | | First, I implemented this driver as per-bank model, but it was a design mistake. - There are 31 banks in the maximum case. It is painful to add so many nodes to DT. - The IRQ control registers are shared between banks. Per-bank design is a problem for Linux. The counterpart for Linux turned around to the single node model. Rework based on the driver for Linux. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* ARM: uniphier: switch to CONFIG_ENV_IS_NOWHEREMasahiro Yamada2017-10-151-1/+0
| | | | | | | The non-volatile storage varies board by board. The default should be NOWHERE. Please choose a proper device via Kconfig. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* mtd: nand: do not check R/B# for CMD_SET_FEATURES in nand_command(_lp)Masahiro Yamada2017-10-151-0/+2
| | | | | | | | | | | | | | | | | Set Features (0xEF) command toggles the R/B# pin after 4 sub feature parameters are written. Currently, nand_command(_lp) calls chip->dev_ready immediately after the address cycle because NAND_CMD_SET_FEATURES falls into default: label. No wait is needed at this point. If you see nand_onfi_set_features(), R/B# is already cared by the chip->waitfunc call. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [ Linux commit: c5d664aa5a4c4b257a54eb35045031630d105f49 ]
* mtd: nand: do not check R/B# for CMD_READID in nand_command(_lp)Masahiro Yamada2017-10-151-0/+2
| | | | | | | | | | | Read ID (0x90) command does not toggle the R/B# pin. Without this patch, NAND_CMD_READID falls into the default: label, then R/B# is checked by chip->dev_ready(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [ Linux commit: 3158fa0e739615769cc047d2428f30f4c3b6640e ]
* moveconfig: fix error message in do_autoconf()Chris Packham2017-10-151-1/+1
| | | | | | | | | Move the % arch outside the double quote so that the missing toolchain message is displayed correctly. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2017-10-1321-258/+1688
|\ | | | | | | | | | | | | | | | | | | | | Patch queue for efi - 2017-10-13 This is the second batch of amazing improvements for efi_loader in 2017.11: - New self tests to verify our own code - A few bug fixes - colored text support - event and SNP improvements, should get us close to iPXE working
| * efi_selftest: correctly check return valuesHeinrich Schuchardt2017-10-132-2/+2
| | | | | | | | | | | | | | | | When cancelling the timer we should check the return value provided by the set_timer service. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: console support for color attributesRob Clark2017-10-122-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Shell.efi uses this, and supporting color attributes makes things look nicer. Map the EFI fg/bg color attributes to ANSI escape sequences. Not all colors have a perfect match, but spec just says "Devices supporting a different number of text colors are required to emulate the above colors to the best of the device’s capabilities". Signed-off-by: Rob Clark <robdclark@gmail.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@suse.de> [agraf: s/unsigned/unsigned int/] Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: Add mem-mapped for fallbackRob Clark2017-10-125-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | When we don't have a real device/image path, such as 'bootefi hello', construct a mem-mapped device-path. This fixes 'bootefi hello' after devicepath refactoring. Fixes: 95c5553ea2 ("efi_loader: refactor boot device and loaded_image handling") Signed-off-by: Rob Clark <robdclark@gmail.com> Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: don't increment part twice per loopJonathan Gray2017-10-101-1/+0
| | | | | | | | | | | | | | | | | | | | Correct a mistake in the part number handling of commit 16a73b249d138fedeb188710533902ed7aac1ddc and only increment part once per loop. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: MAX_UTF8_PER_UTF16 = 3Heinrich Schuchardt2017-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constant MAX_UTF8_PER_UTF16 is used to calculate required memory when converting from UTF-16 to UTF-8. If this constant is too big we waste memory. A code point encoded by one UTF-16 symbol is converted to a maximum of three UTF-8 symbols, e.g. 0xffff could be encoded as 0xef 0xbf 0xbf. The first byte carries four bits, the second and third byte carry six bits each. A code point encoded by two UTF-16 symbols is converted to four UTF-8 symbols. So in this case we need a maximum of two UTF-8 symbols per UTF-16 symbol. As the overall maximum is three UTF-8 symobls per UTF-16 symbol we need MAX_UTF8_PER_UTF16 = 3. Fixes: 78178bb0c9d lib: add some utf16 handling helpers Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: search all possible disk partitionsJonathan Gray2017-10-101-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When searching for partitions don't stop if a partition is not present for a given partition number as there may be valid partitions after. Search for up to MAX_SEARCH_PARTITIONS matching the other callers of part_get_info(). This allows OpenBSD to boot via the efi_loader on rpi_3 again after changes made after U-Boot 2017.09. With MBR partitioning OpenBSD will by default use the fourth partition for the 0xA6 (OpenBSD) partition. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: error handling in SNP testHeinrich Schuchardt2017-10-091-1/+8
| | | | | | | | | | | | | | | | | | Avoid NULL pointer dereference after setup failed due to a missing network. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: comments for functions add missing @returnHeinrich Schuchardt2017-10-091-1/+8
| | | | | | | | | | | | | | | | | | | | For some functions the @return description is missing. Fix typo. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: Fix disk dp's for pre-DM/legacy devicesRob Clark2017-10-091-0/+11
| | | | | | | | | | | | | | | | | | | | | | This fixes an issue with OpenBSD's bootloader, and I think should also fix a similar issue with grub2 on legacy devices. In the legacy case we were creating disk objects for the partitions, but not also the parent device. Reported-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: avoid NULL dereference in efi_dp_matchHeinrich Schuchardt2017-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When calling bootefi hello twice a kernel dump occurs. Neither bootefi hello nor bootefi selftest have an image device patch. So do not try to dereference the NULL value. Fixes: 95c5553ea26 efi_loader: refactor boot device and loaded_image handling Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: avoid dereferencing NULL in tpl testHeinrich Schuchardt2017-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | The task priority levels test uses two events one passes the notification counter as context. The other passes NULL. Both use the same notification function. So we need to check for NULL here. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: efi_st_memcmp return difference of bytesHeinrich Schuchardt2017-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | If the memory regions are different efi_st_memcmp currently returns the difference of the addresses. Insted the difference of the first differing byte pair should be returned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: supply EFI network testHeinrich Schuchardt2017-10-094-1/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides an EFI application to check the correct function of the Simple Network Protocol implementation. It sends a DHCP request and analyzes the DHCP offer. Different error conditions including a 10s timeout are checked. A successful execution will look like this: => bootefi nettest Scanning disk ide.blk#0... Found 1 disks WARNING: Invalid device tree, expect boot to fail Network test DHCP Discover DHCP reply received from 192.168.76.2 (52:55:c0:a8:4c:02) as broadcast message. OK. The test was completed successfully. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: allow printing MAC addressesHeinrich Schuchardt2017-10-091-1/+40
| | | | | | | | | | | | | | | | | | Add %pm as format string to print a MAC address. This is helpful when analyzing network problems. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: correct definition of efi_st_errorHeinrich Schuchardt2017-10-091-2/+2
| | | | | | | | | | | | | | | | | | Enclose definition in parantheses to allow using efi_st_error like a void function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: fill return values in SimpleNetworkProtocolHeinrich Schuchardt2017-10-091-2/+25
| | | | | | | | | | | | | | | | In the receive function all return values should be filled. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: size fields in SimpleNetworkProtocolHeinrich Schuchardt2017-10-092-6/+22
| | | | | | | | | | | | | | | | | | | | | | The size fields in the Simple Network Protocol are all UINTN in the UEFI spec. So use size_t. Provide a function description of the receive function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: fix efi_net_get_statusHeinrich Schuchardt2017-10-092-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The returned interrupt status was wrong. As out transmit buffer is empty we need to always set EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT. When we have received a packet we need to set EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT. Furthermore we should call efi_timer_check() to handle events. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: implement WaitForPacket eventHeinrich Schuchardt2017-10-091-0/+16
| | | | | | | | | | | | | | | | | | The WaitForPacket event informs that a network package has been received by the SimpleNetworkProtocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: Move is_signaled = true line into efi_net_push()] Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: use events for efi_net_receiveHeinrich Schuchardt2017-10-091-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A timer event is defined. The timer handler cares for receiving new packets. efi_timer_check is called both in efi_net_transmit and efi_net_receive to enable events during network communication. Calling efi_timer_check in efi_net_get_status is implemented in a separate patch. [agraf] This patch is needed to make efi_net_get_status() actually report incoming packets. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: fix spelling in comment] Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_net: return EFI_UNSUPPORTED where appropriateHeinrich Schuchardt2017-10-091-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | U-Boot does not implement all functions of the simple network protocol. The unimplemented functions return either of EFI_SUCCESS and EFI_INVALID_PARAMETER. The UEFI spec foresees to return EFI_UNSUPPORTED in these cases. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: efi_net: hwaddr_size = 6Heinrich Schuchardt2017-10-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The length of a MAC address is 6. We have to set this length in the EFI_SIMPLE_NETWORK_MODE structure of the EFI_SIMPLE_NETWORK_PROTOCOL. Without this patch iPXE fails to initialize the network with error message SNP MAC(001e0633bcbf,0x0) has invalid hardware address length 0 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: fill simple network protocol revisionHeinrich Schuchardt2017-10-092-0/+4
| | | | | | | | | | | | | | | | | | | | Provide the simple network protocol revision. This revision number could be used to identify backwards compatible enhancements of the protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: correct bits of receive_filters bit maskHeinrich Schuchardt2017-10-091-5/+6
| | | | | | | | | | | | | | | | | | Remove extraneous commas. Add comment. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: incorrect definition of EFI_SIMPLE_NETWORK_PROTOCOLHeinrich Schuchardt2017-10-091-1/+1
| | | | | | | | | | | | | | | | WaitForPacket is an event and not a function pointer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: wrong type in wait_for_eventHeinrich Schuchardt2017-10-094-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The UEFI spec defines parameter index of WaitForEvent as UINTN*. So we should use size_t here. I deliberately do not use UINTN because I hold a following patch that will eliminate UINTN because uppercase types to not match the U-Boot coding style. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: pass GUIDs as const efi_guid_t *Heinrich Schuchardt2017-10-092-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | We need to call some boottime services internally. Our GUIDs are stored as const efi_guid_t *. The boottime services never change GUIDs. So we can define the parameters as const efi_guid_t *. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: parameters of CopyMem and SetMemHeinrich Schuchardt2017-10-092-9/+8
| | | | | | | | | | | | | | | | | | | | | | The UEFI spec defines the length parameters of CopyMem and SetMem as UINTN. We should size_t here. The source buffer of CopyMem should be marked as const. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: call EFI_EXIT in efi_copy_mem, efi_set_memHeinrich Schuchardt2017-10-091-0/+2
| | | | | | | | | | | | | | | | EFI_ENTRY and EFI_EXIT calls must match. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: replace efi_div10 by do_divHeinrich Schuchardt2017-10-091-34/+2
| | | | | | | | | | | | | | | | We should use the existing 64bit division instead of reinventing the wheel. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: provide function comments for boot servicesHeinrich Schuchardt2017-10-091-2/+638
| | | | | | | | | | | | | | Provide comments describing the boot service functions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: make tests easier to readHeinrich Schuchardt2017-10-095-100/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename counter to more illustrative names. Update notification function description. Simplify notification function. Add comment for arbitrary non-zero value. Document @return. Use constants for return values of setup, execute, teardown. Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: use type bool for event statesHeinrich Schuchardt2017-10-093-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Queued and signaled describe boolean states of events. So let's use type bool and rename the structure members to is_queued and is_signaled. Update the comments for is_queued and is_signaled. Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>