summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-11-17rockchip: clk: add px30 clock driverKever Yang4-0/+2452
The px30 contains 2 separate clock controllers, pmucru and cru. Add drivers for them. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17pinctrl: rockchip: add px30 pinctrl driverDavid Wu2-0/+369
Add the necessary glue code to allow pinctrl setting on px30 socs. Signed-off-by: David Wu <david.wu@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17rockchip: add core px30 headersHeiko Stuebner4-0/+249
Add headers needed by the upcoming px30 support, including two new dt-binding headers taken from the Linux kernel. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17spl: separate SPL_FRAMEWORK config for spl and tplHeiko Stuebner7-4/+18
Right now enabling SPL_FRAMEWORK will also enable it for the TPL in all cases, making the TPL bigger. There may be cases where the TPL is really size constrained due to its underlying ram size. Therefore introduce a new TPL_FRAMEWORK option and make the relevant conditionals check for both. The default is set to "y if SPL_FRAMEWORK" to mimic the previous behaviour where the TPL would always get the SPL framework if it was enabled in SPL. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: Fix dram setting to make dram more stableYouMin Chen1-21/+20
There are some code different with rockchip vendor code which may lead to different bugs, including: 1) Fix setting error about LPDDR3 dram size ODT. 2) Set phy io speed to 0x2. 3) Fix setting error about phy_pad_fdbk_drive. 4) Fix setting error about PI_WDQLVL_VREF_EN Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: update calculate_strideKever Yang2-39/+128
Update the calculation of the stride to support all the DRAM case. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: Sync the io setting from Rockchip vendor codeKever Yang1-30/+14
The io setting are updated after some bugfix in different rk3399 boards, sync the code from vendor. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: update lpddr4 timing for rk3399Kever Yang2-9/+9
Update lpddr timing in lpddr4-400 and lpddr4-800 file from rockchip vendor code; Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: add support detect capacityYouMin Chen1-21/+215
Add capacity detect for rk3399 so that the driver able to detect the capacity automatically. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: update the function of sdram_initYouMin Chen1-123/+296
Clean up the sdram_init to keep sync with rockchip source code. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: fix error about get_ddrc0_con reg addrYouMin Chen1-1/+1
Correct the register to its correct name. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: Clean up codeYouMin Chen1-83/+93
Clean up rk3399 dram driver source code for more readable. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3399: migrate to use common codeYouMin Chen14-171/+179
For there are some structures and functions are common for all rockchip SoCs, migrate to use the common code so that we can clean up reduandent codes. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rk3328: use common sdram driverYouMin Chen9-906/+295
RK3328 has a similar controller and phy with PX30, so we can use the common driver for it and remove the duplicate codes. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: px30: add sdram driverYouMin Chen9-1/+1302
Add the sdram driver for PX30 to support ddr3, ddr4, lpddr2 and lpddr3. For TPL_BUILD, the driver implement full dram init and without DM support due to the limit of internal SRAM size. For SPL and U-Boot proper, it's a simple driver with dm for get dram_info like other SoCs. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: add common msch reg definitionKever Yang1-0/+85
The noc register bit definition may be the same for different SoC while the offset of the register may be different, add the struction definition as common code. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: add phy driver code for PX30Kever Yang3-0/+326
This sdram_phy_px30.c is based on PX30 SoC, the functions are common for phy, other SoCs with similar hardware could re-use it. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: add controller code for PX30Kever Yang2-0/+344
This sdram_pctl_px30.c is based on PX30 SoC, the functions are common for controller, other SoCs with similar hardware could re-use it. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: Default enable DRAM debug infoKever Yang1-0/+1
The debug info for dram is main about the capacity related info which is very important the board init, so set this default enable. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: move sdram_debug function into sdram_commonKever Yang3-148/+144
The functions for dram info print are part of common code. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: add common code for sdram driverKever Yang4-0/+323
There are some function like os_reg setting, capacity detect functions, can be used as common code for different Rockchip SoCs, add a sdram_common.c for all these functions. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17rockchip: sdram: update the sys_reg to sys_reg2Kever Yang1-16/+16
We are using sys_reg2 and sys_reg3 as ddr cap info, sync the variable name to what we real use to avoid confuse people. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17rockchip: sdram: extend to use sys_reg3 for capacity infoKever Yang3-47/+152
Since we have new DRAM type and to support different DRAM size in different CS, we need more bits, so introduce sys_reg3 to record the info. Note that the info in sys_reg3 is extension to sys_reg2 and the info in sys_reg2 is the same as before. We define the DRAM_INFO with sys_reg3 as VERSION2. All the ENC macro are moved to sdram_common.h since the sdram.c only need to do the info decode. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17rockchip: sdram: move cap structure and debug function to sdram_common.hKever Yang4-48/+61
The sdram.h suppose to be helper file for sdram.c which including dram size decode and some u-boot related dram init interface, and all structure and function for dram driver move to sdram_common.h Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: rename sdram_common.c/h to sdram.cKever Yang13-14/+14
rename sdram_common.c in arch/arm/mach-rockchip to sdram.c; so that we can use the file name sdram_common.c in dram driver for better understand the code; clean the related file who has use the header file at the same time. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-17ram: rockchip: rename sdram.h to sdram_rk3288.hKever Yang5-4/+3
The header file sdram.h is used for rk3288 and similar SoCs, rename it to make it more understandable. Signed-off-by: YouMin Chen <cym@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-14Merge tag 'efi-2020-01-rc3' of ↵Tom Rini11-11/+164
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-01-rc3 The following changes for the UEFI subsystem are provided: * allow building UEFI binaries on the sandbox * enable access to file systems without partition tables * correctly check the return value of efi_dp_from_file()
2019-11-14Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvellTom Rini2-10/+4
- Clearfog: Fix SD card booting (Baruch) - Fix potential dereference NULL pointer in dram_init() (Chris)
2019-11-14patman: fix coverletter cc list with nullsRobert Beckett1-1/+1
fixes: 8ab452d5877638a97e5bdd521d119403b70b45f5 When compiling list of cover letter cc addresses, using null as a separater, then encoding to utf-8 results in lots of "\x00" as separators. patman then doesnt understand that when it comes to repoting the list to send-email. Fix this by not encoding to utf-8, as done for the other patch files. Signed-off-by: Robert Beckett <bob.beckett@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14patman: fix some typos in commentsAnatolij Gustschin3-5/+5
s/Subprocress/Subprocess/ s/easiler/easier/ s/repositiory/repository/ s/rangem/range/ s/Retruns/Returns/ Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14sandbox: use correct type reading /proc/self/mapsHeinrich Schuchardt1-2/+2
Compiling arch/sandbox/cpu/os.c results in an error ../arch/sandbox/cpu/os.c: In function ‘os_find_text_base’: ../arch/sandbox/cpu/os.c:823:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 823 | base = (void *)addr; | ^ cc1: all warnings being treated as errors The size of void* differs from that of unsigned long long on 32bit systems. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14tests: add OP-TEE test suiteHeiko Stuebner11-0/+250
OP-TEE can get supplied with a devicetree and will then insert its firmware node and reserved-memory sections into it. As this devicetree often is not the one supplied to a later loaded kernel, a previous commit added functionality to transfer these nodes onto that new devicetree. To make sure this functionality stays intact, also add a test for the transfer functionality. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14image: fdt: copy possible optee nodes to a loaded devicetreeHeiko Stuebner3-0/+157
The loading convention for optee or any other tee on arm64 is as bl32 parameter to the trusted-firmware. So TF-A gets invoked with the TEE as bl32 and main u-boot as bl33. Once it has done its startup TF-A jumps into the bl32 for the TEE startup, returns to TF-A and then jumps to bl33. All of them get passed a devicetree as parameter and all components often get loaded from a FIT image. OP-TEE will create additional nodes in that devicetree namely a firmware node and possibly multiple reserved-memory nodes. While this devicetree is used in main u-boot, in most cases it won't be the one passed to the actual kernel. Instead most boot commands will load a new devicetree from somewhere like mass storage of the network, so if that happens u-boot should transfer the optee nodes to that new devicetree. To make that happen introduce optee_copy_fdt_nodes() called from the dt setup function in image-fdt which after checking for the optee presence in the u-boot dt will make sure a optee node is present in the kernel dt and transfer any reserved-memory regions it can find. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2019-11-14fdtdec: only create phandle if caller wants it in fdtdec_add_reserved_memory()Heiko Stuebner2-8/+10
The phandlep pointer returning the phandle to the caller is optional and if it is not set when calling fdtdec_add_reserved_memory() it is highly likely that the caller is not interested in a phandle to the created reserved-memory area and really just wants that area added. So just don't create a phandle in that case. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14fdtdec: protect against another NULL phandlep in fdtdec_add_reserved_memory()Heiko Stuebner2-1/+3
The change adding fdtdec_add_reserved_memory() already protected the added phandle against the phandlep being NULL - making the phandlep var optional. But in the early code checking for an already existing carveout this check was not done and thus the phandle assignment could run into trouble, so add a check there as well, which makes the function still return successfully if a matching region is found, even though no-one wants to work with the phandle. Fixes: c9222a08b3f7 ("fdtdec: Implement fdtdec_add_reserved_memory()") Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14pinctrol: dm: remove the function pinctrl_decode_pin_configPatrick Delaunay2-25/+0
Remove the pinctrl_decode_pin_config() API, because this function is unused and not compatible with livetree (it uses fdtdec_get_bool instead of ofnode API). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-14arm: mvebu: clearfog: fix boot from SD cardBaruch Siach1-0/+4
Enable gpio0 in SPL to allow the sdhci driver read the SD card-detect signal. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefan Roese <sr@denx.de>
2019-11-14ARM: mvebu: don't dereference null bd pointerChris Packham1-10/+0
As mentioned in doc/README.arm-relocation gd->bd is not available in dram_init() so we shouldn't attempt to access it. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2019-11-13efi_selftest: enable all UEFI unit tests on the sandboxHeinrich Schuchardt1-2/+5
As we can build relocation code for the sandbox now we should enable the unit tests that had to be disabled up to now. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-11-13efi_loader: support building UEFI binaries on sandboxHeinrich Schuchardt7-1/+139
On the sandbox the UEFI binaries must match the host architectures. Adjust the Makefiles. Provide the PE/COFF header and relocation files. Allow building helloworld.efi on the sandbox. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-11-13efi_loader: call add_u_boot_and_runtime() on sandboxHeinrich Schuchardt1-4/+5
On the sandbox we should mark the stack area as EFI runtime memory like we do on any other architecture. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-11-13efi_loader: disk: install file system protocol to a whole diskAKASHI Takahiro1-1/+3
Currently, a whole disk without any partitions is not associated with EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. So even if it houses some file system, there is a chance that we may not be able to access it, particularly, when accesses are to be attempted after searching that protocol against a device handle. With this patch, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed to such a disk if part_get_info() shows there is no partition table installed on it. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Only if no partition table exists, check for a file system on disk level. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-11-13efi_loader: fix efi_dp_from_name()Heinrich Schuchardt1-3/+12
Correctly check the return value of efi_dp_from_file(). If we can determine device path for the file, should not depend on the device path for the device being requested. Provide a function description for efi_dp_from_name(). Reported-by: Coverity CID 273159, CID 273158 Fixes: 08c51fff30cc ("efi_loader: device_path: check against file path length") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-11-12Merge branch '2019-11-12-migrate-SYS_REDUNDAND_ENVIRONMENT'Tom Rini204-70/+176
- Migrate the symbol CONFIG_SYS_REDUNDAND_ENVIRONMENT to Kconfig. This is size neutral outside of two platforms with latent bugs being fixed now and they no longer have "ENV_IS_NOWHERE" set along with their intended location.
2019-11-12defconfigs: Migrate CONFIG_SYS_REDUNDAND_ENVIRONMENTTom Rini202-68/+174
Move this symbol to Kconfig. As part of this we can drop a UBI-specific symbol that was a stop-gap for not having this particular symbol in Kconfig. Signed-off-by: Tom Rini <trini@konsulko.com>
2019-11-12pfla02: Migrate CONFIG_ENV_IS_IN_SPI_FLASH to defconfigTom Rini2-1/+1
This board is setting CONFIG_ENV_IS_IN_SPI_FLASH in the header rather than defconfig, fix. Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2019-11-12evb-rk3128: Migrate CONFIG_ENV_IS_IN_MMC to defconfigTom Rini2-1/+1
This board is setting CONFIG_ENV_IS_IN_MMC in the header rather than defconfig, fix. Cc: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2019-11-12video: stm32: remove the compatible "synopsys, dw-mipi-dsi" supportPatrick Delaunay4-19/+14
Remove the compatible "synopsys,dw-mipi-dsi" added in U-Boot (it don't exist in Linux kernel binding); it is only used to bind the generic synopsys UCLASS_DSI_HOST "dw_mipi_dsi" to the driver "stm32-display-dsi" UCLASS_VIDEO_BRIDGE This binding is done in Linux kernel drivers without compatible (dw_mipi_dsi_bind() is called in bind of driver, for example in drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c). This patch does the same in U-Boot driver, the STM32 driver calls during its bind the function device_bind_driver_to_node to bind the generic driver "dw_mipi_dsi" at the same address. This patch reduces the device tree differences between Linux kernel and U-Boot for stm32mp1 platform. Tested with v2020.01-rc1 on STM32MP157C-EV1 and STM32MP157C-DK2. The dependency of driver is clearer and the probe order is guaranteed. STM32MP> dm tree Class Index Probed Driver Name ----------------------------------------------------------- root 0 [ + ] root_driver root_driver sysreset 0 [ ] syscon_reboot |-- reboot simple_bus 0 [ + ] generic_simple_bus |-- soc serial 0 [ + ] serial_stm32 | |-- serial@40010000 ... video_brid 0 [ + ] stm32-display-dsi | |-- dsi@5a000000 dsi_host 0 [ + ] dw_mipi_dsi | | |-- dsihost panel 0 [ + ] rm68200_panel | | `-- panel-dsi@0 ... Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-11-12Merge tag 'u-boot-imx-20191105' of ↵Tom Rini54-341/+5802
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20191105 ------------------- i.MX8MN SoC support ROM API image download support i.MX8MM enet enabling
2019-11-12video: mxsfb: Configure the clock after eLCDIF resetFabio Estevam1-3/+3
Running stress reboot test on a i.MX6ULL evk board with a custom LCD can lead to splash screen failure (black screen). After comparing the eLCDIF initialization with the Linux kernel driver, it was noticed that the eLCDIF reset is the first operation that needs to be done. So do like the eLCDIF Linux driver and move the eLCDIF clock frequency configuration after the eLCDIF reset and just prior to setting the RUN bit. With this change applied, no more black screen issues has been found during overnight reboot stress tests. Signed-off-by: Fabio Estevam <festevam@gmail.com>