aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-12-07usb: udc: implement DM versions of ↵Jean-Jacques Hiblot3-13/+53
usb_gadget_initialize()/_release()/_handle_interrupt() When DM_USB_GADGET the platform code for the USB device must be replaced by calls to a USB device driver. usb_gadget_initialize() probes the USB device driver. usb_gadget_release() removes the USB device driver. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-12-07usb: introduce a separate config option for DM USB deviceJean-Jacques Hiblot4-4/+19
Using CONFIG_DM_USB for this purpose prevents using DM_USB for host and not for device. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-12-07usb: gadget: Do not call board_usb_xxx() directly in USB gadget driversJean-Jacques Hiblot8-46/+28
Add 2 functions to wrap the calls to board_usb_init() and board_usb_cleanup(). This is a preparatory work for DM support for UDC drivers (DM_USB_GADGET). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-12-06rockchip: rk3399: Add MAINTAINERS entryTom Rini1-0/+5
Add an entry for the Ficus EE board to the existing rock960 MAINTAINERS file. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-06Merge tag 'for-master-20181206' of git://git.denx.de/u-boot-rockchipTom Rini16-7/+2627
- Changes the declaration of regs_phy in dwc2-otg to uintptr_t to ensure it can be cast to void* for use with writel(). - Add the Rock960 and Ficus boards.
2018-12-06rockchip: rk3399: Add Ficus EE board supportManivannan Sadhasivam3-0/+150
Add board support for Ficus EE board from Vamrs. This board utilizes common Rock960 family support. Following peripherals are tested and known to work: * Gigabit Ethernet * USB 2.0 * MMC Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> [Reworked based on common Rock960 family support] Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-06rockchip: rk3399: Add Rock960 CE board supportManivannan Sadhasivam4-0/+1651
Add board support for Rock960 CE board from Vamrs. This board utilizes common Rock960 family support. Following peripherals are tested and known to work: * USB 2.0 * MMC This commit also adds DDR configuration for LPDDR3-2GiB-1600MHz which is being used on the board. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-06rockchip: rk3399: Add common Rock960 family from VamrsManivannan Sadhasivam8-0/+776
Rock960 is a family of boards based on Rockchip RK3399 SoC from Vamrs. It consists of Rock960 (Consumer Edition) and Ficus (Enterprise Edition) 96Boards. Below are some of the key differences between both Rock960 and Ficus boards: 1. Different host enable GPIO for USB 2. Different power and reset GPIO for PCI-E 3. No Ethernet port on Rock960 The common board support will be utilized by both boards. The device tree has been organized in such a way that only the properties which differ between both boards are placed in the board specific dts and the reset of the nodes are placed in common dtsi file. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> [Added instructions for SD card boot] Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Peter Robinson <pbrobinson@gmail.com>
2018-12-06arm: dts: rockchip: add some common pin-settings to rk3399Randy Li1-6/+49
Those pins would be used by many boards. Commit grabbed from Linux: commit b41023282d07b61a53e2c9b9508912b1e7ce7b4f Author: Randy Li <ayaka@soulik.info> Date: Thu Jun 21 21:32:10 2018 +0800 arm64: dts: rockchip: add some common pin-settings to rk3399 Those pins would be used by many boards. Signed-off-by: Randy Li <ayaka@soulik.info> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Randy Li <ayaka@soulik.info> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-06usb: dwc2-otg: make regs_phy (in platdata) a uintptr_tPhilipp Tomsich1-1/+1
The regs_phy field of the platform data structure for dwc2-otg is today declared an unsigned int, but will eventually be cast into a void* for a writel operation. This triggers errors on modern GCC versions. E.g. we get the following error with GCC 6.3: drivers/usb/phy/rockchip_usb2_phy.c: In function 'property_enable': arch/arm/include/asm/io.h:49:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) ^ arch/arm/include/asm/io.h:117:48: note: in expansion of macro '__arch_putl' #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) ^~~~~~~~~~~ drivers/usb/phy/rockchip_usb2_phy.c:61:2: note: in expansion of macro 'writel' writel(val, pdata->regs_phy + reg->offset); ^~~~~~ This commit changes regs_phy to be a uintptr_t to ensure that it is large enough to hold any valid pointer (and fix the associated warning). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-05Merge tag 'dm-pull-5dec18' of git://git.denx.de/u-boot-dmTom Rini43-79/+935
Minor sandbox enhancements / fixes tpm improvements to clear up v1/v2 support buildman toolchain fixes New serial options to set/get config
2018-12-05Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini56-335/+1150
- Various MTD fixes from Boris - Zap various unused / legacy paths. - pxa3xx NAND update from Miquel Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-06mtd: sf: Make sf_mtd.c more robustBoris Brezillon1-3/+36
SPI flash based MTD devs can be registered/unregistered at any time through the sf probe command or the spi_flash_free() function. This commit does not try to fix the root cause as it would probably require rewriting most of the code and have an mtd_info object instance per spi_flash object (not to mention that the the spi-flash layer is likely to be replaced by a spi-nor layer ported from Linux). Instead, we try to be as safe as can be by checking the code returned by del_mtd_device() and complain loudly when there's nothing we can do about the deregistration failure. When that happens we also reset sf_mtd_info.priv to NULL, and check for NULL pointer in the mtd hooks so that -ENODEV is returned instead of hitting a NULL pointer dereference exception when the MTD instance is later accessed by a user. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: sf: Unregister the MTD device prior to removing the spi_flash objBoris Brezillon1-0/+9
The DM implementation of spi_flash_free() does not unregister the MTD device before removing the spi dev object. This leads to a use-after-free bug when the MTD device is later accessed by a MTD user (observed when attaching the device to UBI after env_sf_load() has called spi_flash_free()). Implement ->remove() and call spi_flash_mtd_unregister() from there. Fixes: 9fe6d8716e09 ("mtd, spi: Add MTD layer driver") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-12-06mtd: Don't stop MTD partition creation when it fails on one deviceBoris Brezillon3-28/+82
MTD partition creation code is a bit tricky. It tries to figure out when things have changed (either MTD dev list or mtdparts/mtdids vars) and when that happens it first deletes all the partitions that had been previously created and then creates the new ones based on the new mtdparts/mtdids values. But before deleting the old partitions, it ensures that none of the currently registered parts are being used and bails out when that's not the case. So, we end up in a situation where, if at least one MTD dev has one of its partitions used by someone (UBI for instance), the partitions update logic no longer works for other devs. Rework the code to relax the logic and allow updates of MTD parts on devices that are not being used (we still refuse to updates parts on devices who have at least one of their partitions used by someone). Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: Make sure we don't parse MTD partitions belonging to another devBoris Brezillon1-5/+12
The mtdparts variable might contain partition definitions for several MTD devices. Each partition layout is separated by a ';', so let's make sure we don't pick a wrong name when mtdparts is malformed. Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: Make sure the name passed in mtdparts fits in mtd_name[]Boris Brezillon1-3/+8
The local mtd_name[] variable is limited in size. Return an error if the name passed in mtdparts does not fit in this local var. Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: Be more strict on the "mtdparts=" prefix checkBoris Brezillon1-1/+1
strstr() does not guarantee that the string we're searching for is placed at the beginning. Use strncmp() instead. Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: Use get_mtdids() instead of env_get("mtdids") in ↵Boris Brezillon1-25/+24
mtd_search_alternate_name() The environment is not guaranteed to contain a valid mtdids variable when called from mtd_search_alternate_name(). Call get_mtdids() instead of env_get("mtdids"). Fixes: ff4afa8a981e ("mtd: uboot: search for an equivalent MTD name with the mtdids") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: sf: Make sure we don't register the same device twiceBoris Brezillon1-1/+12
spi_flash_mtd_register() can be called several times and each time it will register the same mtd_info instance like if it was a new one. The MTD ID allocation gets crazy when that happens, so let's track the status of the sf_mtd_info object to avoid that. Fixes: 9fe6d8716e09 ("mtd, spi: Add MTD layer driver") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-12-06mtd: Delete partitions attached to the device when a device is deletedBoris Brezillon2-0/+22
If we don't do that, partitions might still be exposed while the underlying device is gone. Fixes: 2a74930da57f ("mtd: mtdpart: implement proper partition handling") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: Parse mtdparts/mtdids again when the MTD list has been updatedBoris Brezillon1-1/+17
Updates to the MTD device list should trigger a new parsing of the mtdids/mtdparts vars even if those vars haven't changed. Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-06mtd: Add a function to report when the MTD dev list has been updatedBoris Brezillon2-1/+16
We need to parse mtdparts/mtids again everytime a device has been added/removed from the MTD list, but there's currently no way to know when such an update has been done. Add an ->updated field to the idr struct that we set to true every time a device is added/removed and expose a function returning the value of this field and resetting it to false. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
2018-12-05x86: acpi: Generate SPCR tableAndy Shevchenko2-0/+120
Microsoft specifies a SPCR (Serial Port Console Redirection Table) [1]. Let's provide it in U-Boot. [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05x86: acpi: Add SPCR table descriptionAndy Shevchenko1-0/+49
Add SPCR table description as it provided in Linux kernel. Port subtype for ACPI_DBG2_SERIAL_PORT is used as an interface type in SPCR. Thus, provide a set of definitions to be utilized later. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-12-05serial: ns16550: Provide ->getinfo() implementationAndy Shevchenko1-1/+21
New callback will supply necessary information, for example, to ACPI SPCR table. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05Merge git://git.denx.de/u-boot-riscvTom Rini9-21/+75
- Fix BBL may be corrupted problem. - Support U-Boot run in S-mode.
2018-12-05Merge tag 'video-updates-for-2019.01-rc2' of git://git.denx.de/u-boot-videoTom Rini9-18/+65
video, bmp and cls command updates
2018-12-05serial: ns16550: Read reg-io-width from device treeAndy Shevchenko2-0/+3
Cache the value of the reg-io-width property for the future use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05serial: ns16550: Group reg_* members of ns16550_platdataAndy Shevchenko1-1/+1
Group reg_* members of struct ns16550_platdata together for better maintenance. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05dm: serial: Introduce ->getinfo() callbackAndy Shevchenko5-0/+90
New callback will give a necessary information to fill up ACPI SPCR table, for example. Maybe used later for other purposes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error: Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05dm: serial: Add ->getconfig() callbackAndy Shevchenko5-3/+60
In some cases it would be good to know the settings, such as parity, of current serial console. One example might be an ACPI SPCR table to generate using these parameters. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05power: regulator: denied disable on always-on regulatorPatrick Delaunay1-0/+5
Don't disable regulator which are tagged as "regulator-always-on" in DT. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Mitchell <jack@embed.me.uk> Tested-by: Jack Mitchell <jack@embed.me.uk> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Richard Röjfors <richard@puffinpack.se> Tested-by: Richard Röjfors <richard@puffinpack.se> Reviewed-by: Felix Brack <fb@ltec.ch> Tested-by: Felix Brack <fb@ltec.ch>
2018-12-05dm: core: add functions to get/remap I/O addresses by nameÁlvaro Fernández Rojas6-2/+160
This functions allow us to get and remap I/O addresses by name, which is useful when there are multiple reg addresses indexed by reg-names property. This is needed in bmips dma/eth patch series, but can also be used on many other drivers. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05binman: Add myself as maintainerSimon Glass1-0/+5
Add an entry for my maintainership of this tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05dm: (re)sort uclass ids alphabeticallyPhilipp Tomsich1-4/+4
The comment in uclass-id.h states that "U-Boot uclasses start here - in alphabetical order" but the subsequent list is not sorted alphabetically. This reestablishes order. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-05dm: rtc: Fix function name in commentPhilipp Tomsich1-1/+1
The documentation comment for dm_rtc_set was referring to dm_rtc_put instead. Fix it. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-05buildman/toolchain.py: handle inconsistent tarball namesTrevor Woerner1-2/+3
Unfortunately, for some releases the kernel.org toolchain tarball names adhere to the following pattern: <hostarch>-gcc-<ver>-nolib-<targetarch>-<type>.tar.xz e.g.: x86_64-gcc-8.1.0-nolibc-aarch64-linux.tar.xz while others use the following pattern: <hostarch>-gcc-<ver>-nolib_<targetarch>-<type>.tar.xz e.g.: x86_64-gcc-7.3.0-nolibc_aarch64-linux.tar.xz Notice that the first pattern has dashes throughout, while the second has dashes throughout except just before the target architecture which has an underscore. The "dash throughout" versions from kernel.org are: 8.1.0, 6.4.0, 5.5.0, 4.9.4, 4.8.5, 4.6.1 while the "dash and underscore" versions from kernel.org are: 7.3.0, 4.9.0, 4.8.0, 4.7.3, 4.6.3, 4.6.2, 4.5.1, 4.2.4 This tweak allows the code to handle both versions. Note that this tweak also causes the architecture parsing to get confused and find the following two bogus architectures, "2.0" and "64", which are explicitly checked for, and removed. Signed-off-by: Trevor Woerner <trevor@toganlabs.com> Reviewed-by: Simon Glass <sjg@chromium.org> Change single quotes to double quotes: Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05buildman/toolchain.py: fix toolchain directoryTrevor Woerner1-1/+2
The hexagon toolchain (4.6.1) from kernel.org, for example, was packaged in a way that is different from most toolchains. The first entry when unpacking most toolchain tarballs is: gcc-<version>-nolib/<targetarch>-<system> e.g.: gcc-8.1.0-nolibc/aarch64-linux/ The first entry of the hexagon toolchain, however, is: gcc-4.6.1-nolibc/ This causes the buildman logic in toolchain.py::ScanPath() to not be able to find the "*gcc" executable since it looks in gcc-4.6.1-nolib/{.|bin|usr/bin} instead of gcc-4.6.1/hexagon-linux/{.|bin|usr/bin}. Therefore when buildman tries to download a set of toolchains that includes hexagon, the script fails. This update takes the second line of the tarball unpacking (which works for all the toolchains I've tested from kernel.org) and parses it to take the first two elements, separated by '/'. It makes this logic a bit more robust. Signed-off-by: Trevor Woerner <trevor@toganlabs.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05Add inttypes.hSimon Glass1-0/+271
Even if U-Boot does not use this, some libraries do. Add back this header file so that the build does not fall back to using the host version, which may include stdint.h and break the build due to conflicts with uint64_t, etc. This partially reverts commit dee37fc99d94 ("Remove <inttypes.h> includes and PRI* usages in printf() entirely") The only change from the file that was in U-Boot until recently is that it now comes twice as close to passing checkpatch. The remaining warnings pertain to the typedefs, which checkpatch does not like. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05Add UINT32_MAX and UINT64_MAXSimon Glass1-0/+4
These constants are defined by stdint.h but not by kernel.h, which is its stand-in in U-Boot. Add the definitions so that libraries which expect stdint.h constants can work. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05time: Update mdelay() to delay in one large chunkSimon Glass1-2/+1
The current function delays in one millisecond at a time. This does not work well on sandbox since it results in lots of calls to usleep(1000) in a tight loop. This makes the sleep duration quite variable since each call results in a sleep of *at least* 1000us, but possibly more. Depending on how busy the machine is, the sleep time can change quite a bit. We cannot fix this in general, but we can reduce the effect by doing a single sleep. The multiplication works fine with an unsigned long argument up until a sleep time of about 4m milliseconds. This is over an hour and we can be sure that delays of that length are not useful. Update the mdelay() function to call udelay() only once with the calculated delay value. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05video: backlight: Fix log message in enable_sequence()Simon Glass1-1/+1
This has an extra argument. Remove it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
2018-12-05input: i8042: Use remove() instead of exported functionsSimon Glass2-30/+20
We should not have exported functions in a driver. The i8042_disable() function is used to disable the keyboard. Provide a remove() method instead, which is the standard way of disabling a device. We could potentially add a method to flush input but that does not seem necessary. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05cros_ec: Adjust to use v1 vboot context onlySimon Glass1-4/+6
At present there are no users of the 64-byte v2 context. The v1 context is only 16 bytes long and currently an error is raised if too much data is returned from the EC. Update the code to limit the size to 16 bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05cros: Correct a printf() string and commentSimon Glass1-2/+2
Correct a warning that occurs on sandbox. Also fix the comment style in cros_ec_set_lid_shutdown_mask(). Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05tpm: Fix a logging warning in unpack_byte_string()Simon Glass1-1/+1
Fix the printf() string to avoid a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05tpm: Add non-volatile index attributes needed for v2Simon Glass1-0/+33
Version-2 TPMs support attributes for nvdata. Add definitions to the header file so that clients can use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05tpm: Export tpm_clear_and_reenable()Simon Glass1-0/+8
This function is intended to be exported but is not. Add it to the header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05tpm: Remove use of build-time TPM versionsSimon Glass3-11/+29
There is only one place in the code which assumes at build-time that we are using either a v1 or a v2 TPM. Fix this up and add a new function to return the version of a TPM. Supported TPM versions (v1 and v2) can be enabled independently and it is possible to use both versions at once. This is useful for sandbox when running tests. Signed-off-by: Simon Glass <sjg@chromium.org>