aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-12-18riscv: qemu: Add platform-specific Kconfig optionsBin Meng
Add the QEMU RISC-V platform-specific Kconfig options, to include CPU and timer drivers. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-18riscv: Implement riscv_get_time() API using rdtime instructionAnup Patel
This adds an implementation of riscv_get_time() API that is using rdtime instruction. This is the case for S-mode U-Boot, and is useful for processors that support rdtime in M-mode too. Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2018-12-18riscv: Add a SYSCON driver for SiFive's Core Local InterruptorBin Meng
This adds U-Boot syscon driver for SiFive's Core Local Interruptor (CLINT). The CLINT block holds memory-mapped control and status registers associated with software and timer interrupts. This driver implements the riscv_get_time() API as required by the generic RISC-V timer driver, as well as some other APIs that are needed for handling IPI. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-18riscv: Introduce a Kconfig option for machine modeAnup Patel
So far we have a Kconfig option for supervisor mode. This adds an option for the machine mode. Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2018-12-18riscv: ax25: Hide the ax25-specific Kconfig optionBin Meng
There is no need to expose RISCV_NDS to the Kconfig menu as it is an ax25-specific option. Introduce a dedicated Kconfig option for the cache ops of ax25 platform and use that to guard the cache ops. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Rick Chen <rick@andestech.com>
2018-12-18timer: Add generic driver for RISC-V privileged architecture defined timerBin Meng
RISC-V privileged architecture v1.10 defines a real-time counter, exposed as a memory-mapped machine-mode register - mtime. mtime must run at constant frequency, and the platform must provide a mechanism for determining the timebase of mtime. The mtime register has a 64-bit precision on all RV32, RV64, and RV128 systems. Different platform may have different implementation of the mtime block hence an API riscv_get_time() is required by this driver for platform codes to hide such implementation details. For example, on some platforms mtime is provided by the CLINT module, while on some other platforms a simple 'rdtime' can be used to get the timer counter. With this timer driver the U-Boot timer functionalities like delay works correctly now. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-18cpu: Add a RISC-V CPU driverBin Meng
This adds a driver for RISC-V CPU. Note the driver will bind a RISC-V timer driver if "timebase-frequency" property is present in the device tree. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-18riscv: qemu: Create a simple-bus driver for the soc nodeBin Meng
To enumerate devices on the /soc/ node, create a "simple-bus" driver to match "riscv-virtio-soc". Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-18dm: cpu: Add timebase frequency to the platdataBin Meng
This adds a timebase_freq member to the 'struct cpu_platdata', to hold the "timebase-frequency" value in the cpu or /cpus node. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-18riscv: add Kconfig entries for the code modelLukas Auer
RISC-V has two code models, medium low (medlow) and medium any (medany). Medlow limits addressable memory to a single 2 GiB range between the absolute addresses -2 GiB and +2 GiB. Medany limits addressable memory to any single 2 GiB address range. By default, medlow is selected for U-Boot on both 32-bit and 64-bit systems. The -mcmodel compiler flag is selected according to the Kconfig configuration. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> [bmeng: adjust to make medlow the default code model for U-Boot] Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2018-12-17Prepare v2019.01-rc2Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-17arm: ti: boot: Increase system partition sizeSam Protsenko
Android code base is growing, so since Android "Pie" the size of system.img grew up to be about 740 MiB. Let's increase system.img to 1 GiB to accommodate for those changes and leave some margin for future changes. We don't want to make it more than 1 GiB, because we should keep userdata partition big enough (for user files, like media etc.), and eMMC size on BeagleBoard-X15 is only 3.5 GiB. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Acked-by: Praneeth Bajjuri <praneeth@ti.com>
2018-12-17Makefile: output migration warnings to stderrChris Packham
Output the device model migration warnings to stderr. This allows tools like buildman to pick them up rather than suppressing them along with the normal build output on stdout. Signed-off-by: Chris Packham <judge.packham@gmail.com>
2018-12-17Restore compatibility of image type IDsStefano Babic
Commit a2b96ece5be146f4995d737f047e5bbb76079b8f breaks the enumeration of the Image Types. New image types can be appended, but they cannot be inserted in the list else backward compatibility is broken. This restores the images types as before 2018.11 and move i.MX8 related images at the end. Signed-off-by: Robert Berger <robert.berger@ReliableEmbeddedSystems.com> Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Tom Rini <trini@konsulko.com>
2018-12-16Merge tag 'for-master-20181216' of git://git.denx.de/u-boot-rockchipTom Rini
Improvements and fixes or u-boot-rockchip: - new board: adds rv1108-elgin-r1 board support - rk3288-evb: dts: remove 'vmmc' from emmc node - rk3399-puma: dts: remove obsolete DTS node 'vcc5v0_host'
2018-12-16ARM: rockchip: Add rv1108-elgin-r1 board supportOtavio Salvador
Add the initial support for Elgin R1 board, which is based on the RV1108 SoC and has the following features currently supported in U-Boot: - UART - eMMC - USB Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-15Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
- Second half of the USB Gadget DM conversion
2018-12-15Merge branch '2018-12-15-master-imports'Tom Rini
- Introduce tools-only build for host tools - Bugfixes to poplar, syscon and the hashtable, a tee return code - Fix a warning on gcc-8 by reworking part of mtk_image to be not unsafe wrt strings. - serial_stm32 reset support
2018-12-15rockchip: rk3288-evb: dts: remove 'vmmc' from emmc nodeKever Yang
This is a sync with kernel mainline dts. The U-Boot eMMC does not need to care about the power for Rockchip SoCs, because if the board is using eMMC, the power will default on (for bootrom), so the 'vmmc', 'vqmmc' is only useful for SD in U-Boot. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-15rockchip: rk3399-puma: Remove obsolete DTS node 'vcc5v0_host'.Christoph Muellner
vcc5v0_host and usbhub_enable share gpio4 RK_PA3, which is a problem during probing (the second probe will trigger a -EBUSY, when trying to get the gpio handle). An analysis of the situation shows, that both regulators are actually describing the same supply. This patch removes the (currenlty not successful probing) regulator vcc5v0_host from the DTS and adds the pinctrl-* setting to usbhub_enable. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Reviewed-by: Phiilipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-15syscon: update syscon_node_to_regmap to use the DM functionsPatrick Delaunay
+ Update the function syscon_node_to_regmap() to force bound on syscon uclass and directly use the list of device from DM. + Remove the static list syscon_list. This patch avoid issue (crash) when syscon_node_to_regmap() is called before and after reallocation (list content is invalid). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-12-15tools: mtk_image: replace strncpy(d, s, sizeof(d)) with snprintf()Andy Shevchenko
Starting from version 8 the GCC, i.e. C compiler, starts complaining about possible '\0' terminator loss or, as in this case, garbage copy. In function ‘mtk_image_set_gen_header’, inlined from ‘mtk_image_set_header’ at tools/mtk_image.c:733:3: tools/mtk_image.c:659:2: warning: ‘strncpy’ specified bound 12 equals destination size [-Wstringop-truncation] strncpy(hdr->boot.name, bootname, sizeof(hdr->boot.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘mtk_brom_parse_imagename’, inlined from ‘mtk_image_check_params’ at tools/mtk_image.c:388:9: tools/mtk_image.c:325:5: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] strncpy(lk_name, val, sizeof(lk_name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Replace it with snprintf() to tell compiler how much room we have in the destination buffer for source string. Fixes: 3b975a147c3c ("tools: MediaTek: add MTK boot header generation to mkimage") Cc: Ryder Lee <ryder.lee@mediatek.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
2018-12-15serial: serial_stm32: Add reset supportPatrice Chotard
In some cases, UART is configured by early boot stage. To be sure of the initial state of UART and to avoid spurious chars on console, reset the serial block before configuring it. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-15poplar: fix boot failure caused by serial driver changeShawn Guo
Commit 4687919684e0 ("serial: Remove DM_FLAG_PRE_RELOC flag in various drivers") essentially drops flag DM_FLAG_PRE_RELOC from serial_pl01x driver for Poplar platform, because the platform falls into the following strategy category made by the commit. Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree Before the commit lands, Poplar platform works by statically declaring pl011 serial device via U_BOOT_DEVICE() with DM_FLAG_PRE_RELOC flag set in the driver. But since Poplar also supports device configuration from device tree, the commit practically drops the flag for Poplar, and hence breaks the platform from booting. This patch changes platform code and device tree to initiate pl011 serial device from device tree rather than static declaration, so that above strategy about DM_FLAG_PRE_RELOC applies to Poplar, and therefore the reported boot failure gets fixed. Reported-by: Igor Opaniuk <igor.opaniuk@linaro.org> Fixes: 4687919684e0 ("serial: Remove DM_FLAG_PRE_RELOC flag in various drivers") Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org> Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-12-15poplar: add a co-maintainer for poplar boardShawn Guo
Add myself as co-maintainer for poplar board, as I'm actively working on the board. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2018-12-15tools: add a generic config for native tools buildingOtavio Salvador
The motivation for this is to allow distributions to distribute all possible tools in a generic way, avoiding the need of specific tools building for each machine. Especially on OpenEmbedded / Yocto Project ecosystem, it is very common each BSP to end providing their specific tools when they need to generate images for some SoC (e.g MX23 / MX28 in meta-freescale case). Using this, we can package the tools doing: $: make tools-only_defconfig $: make tools-only Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> [trini: Add MAINTAINERS entry for myself, add to .travis.yml, make U-Boot itself buildable to not trip up other frameworks] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-15test: Only descend into test/ when CONFIG_UNIT_TEST is enabledTom Rini
The contents of the test subdirectories only make sense when we have CONFIG_UNIT_TEST set. We will otherwise attempt to build code on for example sandbox that needs CONFIG_UNIT_TEST otherwise and rather than complicate the Makefiles simply leave them out when we can. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-15cmd: Move the "dm" command from test/dm/ to cmd/Tom Rini
The "dm" command under CONFIG_CMD_DM should live under cmd/ rather than test/dm/ so move it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-15hashtable: fix length calculation in hexport_rAKASHI Takahiro
The commit below incorrectly fixed hexport_r(); > size = totlen + 1; One extra byte is necessary to NULL-terminate a whole buffer, "resp." Fixes: f1b20acb4a03 ("hashtable: Fix length calculation in hexport_r") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2018-12-15tee: change return code for REE FS supplicant cmdIgor Opaniuk
If OP-TEE core is compiled with support of REE FS and RPMB at the same time (CFG_RPMB_FS ?= y; CFG_RPMB_FS ?= y), and persistent storage API is used with TEE_STORAGE_PRIVATE storage id, it will lead to TA panic. E/TC:? 0 TA panicked with code 0xffff0009 ..... E/TC:? 0 Call stack: E/TC:? 0 0x000000004002f2f8 TEE_OpenPersistentObject at lib/libutee/tee_api_objects.c:422 In this particular case TEE_ERROR_STORAGE_NOT_AVAILABLE is more suitable than TEE_ERROR_NOT_IMPLEMENTED, as it provides to a TA a possibility to handle this error code [1]. >From GPD TEE Internal Core specification [2]: TEE_ERROR_STORAGE_NOT_AVAILABLE - if the persistent object is stored in a storage area which is currently inaccessible. It may be associated with the device but unplugged, busy, or inaccessible for some other reason. [1]: https://github.com/OP-TEE/optee_os/blob/94db01ef448d1e552161c2d861d57a5f8bda0cc0/lib/libutee/tee_api_objects.c#L419 [2]: https://globalplatform.org/wp-content/uploads/2018/06/GPD_TEE_Internal_Core_API_Specification_v1.1.2.50_PublicReview.pdf Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-12-14Merge tag 'dm-pull-14dec18' of git://git.denx.de/u-boot-dmTom Rini
Complete conversion of sound to driver model
2018-12-14usb: musb-new: sunxi: Fix null pointer accessStefan Mavrodiev
When the device is in peripheral mode there is no struct usb_bus_priv allocated pointer, as the uclass driver ("usb_dev_generic") doesn't call per_device_auto_alloc_size. This results in writing to the internal SDRAM at priv->desc_before_addr = true; Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
2018-12-14usb: composite: Fix max packet size for USB3.0Siva Durga Prasad Paladugu
For USB3.0, the max packetsize for GET_DESCRIPTOR should be sent as exponent value for 2. This means for 512, max packet size should be filled with 9(2^9=512). Also, fill the USB version field with 3.0 if speed is negotiated to Superspeed. This fixes the issue of DFU gadget download failure with superspeed. Without this patch, the max packet size is overflowed to zero as the bMaxPacketsize is of u8 and hence host is not able to detect this device. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-12-14configs: am335x_boneblack_vboot: enable DM_USB and RNDIS boot in SPlJean-Jacques Hiblot
Enable DM_USB and DM_USB_GADGET for this platform. Also enable RNDIS boot support (SPL load u-boot over USB RNDIS). This is an example of how to use DM_USB on a am335x-based board. A subsequent series will take this a step further and modify more defconfigs. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14configs: am335x_evm: Do not disable DM_USB in SPLJean-Jacques Hiblot
DM_USB is now supported in the SPL. Do not undef it Besides to support DM_USB in SPL, one now has to use SPL_DM_USB Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14arm: am33xx: Register USB controllers if DM_USB is used but not OF_CONTROLJean-Jacques Hiblot
When DM_USB is used, either the USB controllers are bound when the DTB is parsed (when OF_CONTROL is enabled) or they are bound using the U_BOOT_DEVICES() macro. In the later case, the platform data is passed in a struct ti_musb_platdata because it cannot be read from the DTB. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14usb: musb-new: Add support for DM_USBJean-Jacques Hiblot
Enable DM for USB peripheral in the musb-new driver. Also make sure that the driver can be used in the SPL. This implies that: * the driver must work with and without the OF_CONTROL option. That in turn, implies that the platform data can be passed in a struct ti_musb_platdata or be read from the dtb * usb.o is linked in the SPL if host support is enabled Another change is that the driver does not fail to bind (and stop the boot process) if one of the child driver does not bind. Reporting the error is enough. This kind of error would appear if the port is configured in the DTS but the driver is not activated in the config. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14usb: musb-new: Allow the diver not to use the set_phy_power() callbackJean-Jacques Hiblot
The set_phy_power() callback is part of struct omap_musb_board_data. This structure is part of the platform data passed to the musb-new driver. This does not really fit with the Driver Model, so allow not to use struct omap_musb_board_data to turn the phy on or off. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14configs: am43xx: Enable RNDIS support in SPLJean-Jacques Hiblot
The AM43xx SOCs have the ability to download the SPl through USB (RNDIS). Adding support for RNDIS in SPL allows to also download u-boot through USB. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14configs: am43xx_evm: Enable DM_USB and DM_USB_GADGETJean-Jacques Hiblot
Enable DM_USB and DM_USB_GADGET for AM43xx EVM boards. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14dts: am4372: Enable USB1 in SPLJean-Jacques Hiblot
USB1 can be used by the romboot on all am4372 platforms to download a firmware (SPL in our case). It makes sense to enable USB1 in the SPL to download u-boot. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14dts: Add a u-boot specific dtsi file for the am4372Jean-Jacques Hiblot
This file is used to override the values found in am4372.dtsi Use it to fix the "compatible" options for the controllers used to support the USB (parent bus and syscons). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14board: ti: am43xx: turn on USB clocksJean-Jacques Hiblot
Enable USB clocks in late init stage to support ports under DM_USB. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14dwc3-generic: Add support for the am437xJean-Jacques Hiblot
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14phy: omap_usb2: Add support for am437xJean-Jacques Hiblot
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14spl: net: dm: usb: bind the gadget before attempting to load the imageJean-Jacques Hiblot
If DM_USB_GADGET is used, the usb ethernet gadget driver must be bound to a controller before the image can be downloaded over the network. In u-boot this can be done with the bind command. In SPL it must be done programmatically. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14spl: drivers: Link usb common library to SPL if USB gadget is enabledJean-Jacques Hiblot
Some drivers might need to access common USB functions such as usb_get_maximum_speed() or usb_get_dr_mode(). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14configs: k2g_evm: Enable DFU on K2G EVMJean-Jacques Hiblot
The K2G evm uses the generic DWC3 driver. DFU can thus be enabled. Enabling DFU for easier firmware update. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14usb: host: replace xhci-keystone driver by the generic dwc3 driverJean-Jacques Hiblot
The keystone platforms can use the generic DC3 driver. Removing the keystone-spcecific xchi driver and add the configuration options to enable the generic DWC3 driver on all K2 platforms. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-14PHY: Add phy driver for the keystone USB PHYJean-Jacques Hiblot
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>