aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2018-12-06pinctrl: stm32: make pinctrl use hwspinlockBenjamin Gaignard
Protect configuration registers with a hardware spinlock. If a hwspinlock is defined in the device-tree node used it to be sure that none of the others processors on the SoC could change the configuration at the same time. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2018-12-06hwspinlock: add stm32 hardware spinlock supportBenjamin Gaignard
Implement hardware spinlock support for STM32MP1. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2018-12-06clk: stm32: add hardware spinlock clockBenjamin Gaignard
Add hardware spinlock in the list of the clocks. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2018-12-06dm: Add Hardware Spinlock classBenjamin Gaignard
This is uclass for Hardware Spinlocks. It implements two mandatory operations: lock and unlock and one optional relax operation. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2018-12-06clk: Allow clock defaults to be set during re-reloc state for SPL onlyPhilipp Tomsich
In commit e5e06b65ad65 ("clk: Allow clock defaults to be set also during re-reloc state") the earlier guard against setting clock defaults in pre-reloc state was removed. While it is easy to filter 'assigned-clocks' properties for SPL using CONFIG_OF_SPL_REMOVE_PROPS, no such mechanism exists for the pre-reloc stage of the full U-Boot. With the default defconfig for the RK3399-Q7 (which filter the 'assigned-clocks' property for the DTS used by SPL anyway), this caused a pause during startup of the full U-Boot stage that lasted for almost 10s (due to the CPU not having been clocked up yet). This reintroduces the guard from commit f4fcba5c5baa ("clk: Allow clock defaults to be set also during re-reloc state") and extends it to only apply outside of a TPL/SPL build: i.e. clk_set_defaults will now run in pre-reloc state for SPL, but only after reloc for the full U-Boot. References: commit f4fcba5c5baa ("clk: implement clk_set_defaults()") References: commit e5e06b65ad65 ("clk: Allow clock defaults to be set also during re-reloc state") Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-06w1: fix occasional enumeration failureMartin Fuzzey
Sometimes enumeration fails (about 1 in 50 times on my custom board). The underlying reason is probably electrical but Linux does not have the problem. Comparing the Linux / u-boot implementations shows that Linux retries the error case whereas u-boot aborts early. Removing the early abort in u-boot fixes the problem. Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
2018-12-05Merge tag 'dm-pull-5dec18' of git://git.denx.de/u-boot-dmTom Rini
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 Rini
- 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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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 Brezillon
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-05serial: ns16550: Provide ->getinfo() implementationAndy Shevchenko
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 tag 'video-updates-for-2019.01-rc2' of git://git.denx.de/u-boot-videoTom Rini
video, bmp and cls command updates
2018-12-05serial: ns16550: Read reg-io-width from device treeAndy Shevchenko
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-05dm: serial: Introduce ->getinfo() callbackAndy Shevchenko
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 Shevchenko
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 Delaunay
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 Rojas
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-05video: backlight: Fix log message in enable_sequence()Simon Glass
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 Glass
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 Glass
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 Glass
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-05sandbox: sysreset: Update to support power-on resetSimon Glass
If U-Boot is started from SPL or TPL, then those earlier phases deal with the reset cause. On real hardware this cause may be lost once it is read. Emulate that behaviour in sandbox by reporting a warm reset when a previous phase has run since start-up. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05sandbox: net: Correct name copy in eth_raw_bus_post_bind()Simon Glass
We cannot be sure that the interface name takes up the full length of the space available to it. Use strcpy() instead of memcpy() in this case. This corrects a valgrind warning. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-04video: use BMP_ALIGN_CENTER define from splash.hAnatolij Gustschin
Drop BMP_ALIGN_CENTER define in lcd.c and video_bmp.c as it is already defined by splash.h. Include splash.h in bmp code. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2018-12-04mmc: Do not issue CMD 6 on SD 1.00 and SD 1.01Marek Vasut
According to SD Specifications Part 1 Physical Layer Simplified Specification Version 6.00 August 29, 2018, section 4.3.10 (Switch Function Command) and section 5.6 (SCR register), SD cards version 1.00 and 1.01 do not support the SD CMD 6. Currently, U-Boot will issue CMD 6 unconditionally in sd_set_card_speed() while configuring the bus for selected frequency. This will make SD cards version 1.00 and 1.01 time out and thus fail detection altogether. Fix this by not sending CMD 6 on such cards. Tested on Matsushita Electric Industrial Co., Ltd. Japan RP-SD008B / Victor 8MB SD card, CU-SD008, which is correctly detected with this patch as: Device: sd@ee160000 Manufacturer ID: 1 OEM: 5041 Name: S008B Bus Speed: 25000000 Mode : SD Legacy Rd Block Len: 512 SD version 1.0 High Capacity: No Capacity: 6.5 MiB Bus Width: 4-bit Erase Group Size: 512 Bytes Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-03Revert "serial: ns16550: fix debug uart putc called before init"Simon Goldschmidt
This reverts commit 6f57c34473d37b8da5e6a3764d0d377d748aeef1 since it does not seem to work at least on rk3399. The Rockchip Technical Reference Manual (TRM) for the rk3399 says the baud rate prescaler register is readable only when USR[0] is zero. Since this bit is defined as "reserved" in the socfpga cylcone5 TRM, let's rather drop this than making the ns16550 debug uart more platform specific. Reported-by: Roosen Henri <Henri.Roosen@ginzinger.com> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com
2018-12-03Merge tag 'xilinx-for-v2019.01' of git://git.denx.de/u-boot-microblazeTom Rini
Xilinx changes for v2019.01 microblaze: - Use default functions for memory decoding - Showing model from DT zynq: - Fix spi flash DTs - Fix zynq_help_text with CONFIG_SYS_LONGHELP - Tune cse/mini configurations - Enabling cse/mini testing with current targets zynqmp: - Enable gzip SPL support - Fix chip detection logic - Tune mini configurations - DT fixes(spi-flash, models, clocks, etc) - Add support for OF_SEPARATE configurations - Enabling mini testing with current targets - Add mini mtest configuration - Some minor config setting nand: - arasan: Add subpage configuration net: - gem: Add 64bit DMA support
2018-12-03Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini
Patch queue for efi - 2018-12-03 This release is fully packed with lots of glorious improvements in UEFI land again! - Make PE images more standards compliant - Improve sandbox support - Improve correctness - Fix RISC-V execution on virt model - Honor board defined top of ram (fixes a few boards) - Imply DM USB access when distro boot is available - Code cleanups
2018-12-03Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini
- MMC fixes for R-Car Gen3
2018-12-03video: Allow driver to specify the line lengthSimon Glass
At present line_length is always calculated in video_post_probe(). But some hardware may use a different line length, e.g. with a 1366-wide display. Allow the driver to set this value if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-12-03spi, mpc8xx: migrate to DM_SPIChristophe Leroy
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-12-03drivers: serial: get rid of non DM mpc8xx driverChristophe Leroy
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-12-03drivers: serial: migrate mpc8xx to DMChristophe Leroy
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-12-03drivers: watchdog: add a DM driver for the MPC8xx watchdogChristophe Leroy
This patch adds a DM driver for the MPC8xx watchdog. Basically, the watchdog is enabled by default from the start and SYPCR register has to be writen once to set the timeout and/or deactivate the watchdog. Once written, it cannot be written again. It means that wdt_stop() can be called before wdt_start() to stop the watchdog, but cannot be called if wdt_start() has been called. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-12-03rtc: m41t62: Convert the RTC driver to support the driver model (DM)Lukasz Majewski
After this change the m41t62.c can be used with RTC subsystem (i.e. date command) which uses device model (DM). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
2018-12-03rtc: m41t62: Extract common RTC handling code to facilitate DM conversionLukasz Majewski
This change facilitates the conversion of m41t62 RTC driver to device model (DM). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
2018-12-03rtc: m41t62: Break i2c_write() arguments to fix checkpatch warningLukasz Majewski
No functional change for this commit. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
2018-12-03Kconfig: Migrate CONFIG_RTC_M41T62 define to KconfigLukasz Majewski
This patch moves the RTC M41T62 config define to Kconfig. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-03net: zynq_gem: Add check for 64-bit dma support by hardwareSiva Durga Prasad Paladugu
This patch throws an error if 64-bit support is expected but DMA hardware is not capable of 64-bit support. It also prints a debug message if DMA is capable of 64-bit but not using it. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
2018-12-03net: zynq_gem: Added 64-bit addressing supportVipul Kumar
This patch adds 64-bit addressing support for zynq gem. This means it can perform send and receive operations on 64-bit address buffers. Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
2018-12-03ARM: meson: Add regmap support for clock driverLoic Devulder
This patch modifies the meson clock driver to use syscon/regmap like the Linux kernel does, as it is needed if we want to share the same DTS files. DTS files are synchronized from Linux 4.19. Signed-off-by: Loic Devulder <ldevulder@suse.de> Acked-by: Neil Armstrong <narmstrong@baylibre.com>