aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-08-22cmd: bind: allow to bind driver with driver dataPatrice Chotard1-2/+3
Initial implementation invokes device_bind_with_driver_data() with driver_data parameter equal to 0. For driver with driver data, the bind command can't bind correctly this driver or even worse causes data abort as shown below: As example, for debug purpose on STM32MP1 platform, ethernet (dwc_eth_qos.c) driver needed to be unbinded/binded. This driver is using driver data: static const struct udevice_id eqos_ids[] = { { .compatible = "nvidia,tegra186-eqos", .data = (ulong)&eqos_tegra186_config }, { .compatible = "snps,dwmac-4.20a", .data = (ulong)&eqos_stm32_config }, { } }; After unbinding/binding this driver and probing it (with the dhcp command), we got a prefetch abort as below: STM32MP> unbind eth ethernet@5800a000 STM32MP> bind /soc/ethernet@5800a000 eth_eqos STM32MP> dhcp prefetch abort pc : [<4310801c>] lr : [<ffc8f4ad>] reloc pc : [<035ba01c>] lr : [<c01414ad>] sp : fdaf19b0 ip : ffcea83c fp : 00000001 r10: ffcfd4a0 r9 : fdaffed0 r8 : 00000000 r7 : ffcff304 r6 : fdc63220 r5 : 00000000 r4 : fdc5b108 r3 : 43108020 r2 : 00003d39 r1 : ffcea544 r0 : fdc63220 Flags: nZCv IRQs off FIQs off Mode SVC_32 Code: data abort pc : [<ffc4f9c0>] lr : [<ffc4f9ad>] reloc pc : [<c01019c0>] lr : [<c01019ad>] sp : fdaf18b8 ip : 00000000 fp : 00000001 r10: ffcd69b2 r9 : fdaffed0 r8 : ffcd69aa r7 : 00000000 r6 : 00000008 r5 : 4310801c r4 : fffffffc r3 : 00000001 r2 : 00000028 r1 : 00000000 r0 : 00000006 Flags: NzCv IRQs on FIQs on Mode SVC_32 (T) Code: 2f00 d1e9 2c00 dce9 (f855) 2024 Resetting CPU ... Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-22dm: fix ofnode_read_addr/size_cells()Heinrich Schuchardt2-10/+20
In the case of the live tree ofnode_read_addr_cells() and ofnode_read_size_cells() return the #address-cells and #size-cells defined in the parent node. With the patch the same is done for a non-live tree. The only consumer of these functions is currently the CFI flash driver. This patch fixes the incorrect parsing of the device tree leading to 'saveenv' failing on qemu_arm64_defconfig. For testing qemu-system-aarch64 has to be called with -drive if=pflash,format=raw,index=1,file=envstore.img to provide the flash memory. envstore.img must be 64 MiB large. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-20Merge tag 'xilinx-for-v2020.10-rc3' of ↵Tom Rini57-241/+457
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2020.10-rc3 - Fix fdtfile variable setup - Fix bootm_*/fdt_high/initrd_high variables handling - Fix Kconfig dependencies for Xilinx drivers - Fix booting u-boot from lowest memory - Fix firmware payload argument count for Versal - Fix dfu configurations - Fix mio_bank property handling - Fix and align code around ID detection - Start to use ENV_VARS_UBOOT_RUNTIME_CONFIG - Simplify logic around reading MAC from eeprom - Decrease malloc length for zynqmp mini qspi - Enable preboot for ZynqMP and Versal i2c: - Fix i2c eeprom partitions handling mmc: - Fix logic around HS mode enabling and use proper functions
2020-08-20Merge branch '2020-08-19-mediatek-updates'Tom Rini13-7/+1177
- Assorted updates for MediaTek platforms
2020-08-20clk: versal: Move pm_query_id out of clock driverMichal Simek2-17/+17
There is no reason to have firmware specific structure in clock driver. Move it to generic location and also initialize enum values which is based on https://lore.kernel.org/linux-arm-kernel/20200318125003.GA2727094@kroah.com/ recommended way to go to make sure that values guaranteed by compiler. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20mmc: sdhci: Use upper/lower_32_bits macrosMichal Simek1-4/+4
Instead of recasting and shifting use macros which are designed for taking upper/lower 32bit value from 64bit variable. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20mmc: sdhci: Enable high speed conditional on the corresponding bitFaiz Abbas1-1/+4
The capabilities register has a field to indicate whether the host supports high speed mode or not. Add high speed host_caps based on this bit instead of enabling it by default. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Michal Simek <michal.simek@xilnx.com> Tested-by: Michal Simek <michal.simek@xilnx.com> (zcu104 with sdhci-caps-mask = <0 0x200000>;)
2020-08-20xilinx: common: Change bootm_size variable settingMichal Simek1-1/+5
Linux kernel for arm32 requires dtb and initrd to be placed in low memory to work properly. This requirement is described in chapter 4b) and 5) in Linux documentation (Documentation/arm/booting.rst). There is an issue on arm32 with 2GB of memory that bootm_size is bigger than Linux lowmem (for example with VMSPLIT_3G). That's why limit bootm size on these systems not to be above 768MB. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: common: Check return value from variable setupMichal Simek1-3/+8
env_set..() can failed that's why check return status and report it back to make sure that user is aware that's something went wrong. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: common: Get rid of initrd_high variable setupMichal Simek1-6/+0
When bootm_low/bootm_size are setup properly there is no need to setup any initrd_high address. Location for initrd is determined through LMB. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: common: Get rid of fdt_high variableMichal Simek3-3/+0
There is no need to setup this variable if bootm_low and bootm_size variable are properly setup. If fdt_high variable is missing U-Boot is asking LMB to return free memory which is not used. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: Change logic around zynq_board_read_rom_ethaddr()Michal Simek1-3/+2
There is no reason to build private function when CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET is not defined. There is already weak function which handles default case properly. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: Add support for ENV_VARS_UBOOT_RUNTIME_CONFIGMichal Simek4-0/+18
Start to use ENV_VARS_UBOOT_RUNTIME_CONFIG to enable/disable updating variables with run time information. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: versal: Enable i2c misc eeprom driverMichal Simek1-0/+3
Enable this driver to be able to work with i2c based eeproms on Versal. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: zynqmp: fix incorrect map not align with IPI HWIbai Erkiaga1-4/+10
Current IPI module register description is not align with IPI HW. The registers with the wrong offset are not used so it does not cause real issues. This patch aligns the register description. Additionally comments added to explain why recv function does not check any flag prior copying rx data. Fixes: 660b0c77d816 ("mailbox: zynqmp: ipi mailbox driver") Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: zynqmp: remove chip_id functionIbai Erkiaga2-38/+20
Remove chip_id function and integrate the firmware call in the zynqmp_get_silicon_idcode_name function. The change avoids querying the firmware twice and makes the code bit more clear. Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: zynqmp: get chip ID at EL3Ibai Erkiaga1-6/+4
Modify the board init function to allow getting the chip ID when U-Boot proper is executed at EL3. Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: zynqmp: get chip ID using firmware driverIbai Erkiaga1-52/+27
Current implementation for getting chip ID uses either raw access on EL3 or a SMC call to get the silicon information. Following change simplifies the code using always the firmware driver. Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: zynqmp: merge firmware calls for EL2 and EL3Ibai Erkiaga1-41/+43
This patch merges ZynqMP firmware calls under xilinx_pm_request in order to make trainsparent the EL. Calls at EL3 are send through IPI messages and EL2 through SMC calls. The EL2 call uses fixed payload and arg size as the EL3 call. The firmware is capable to handle PMUFW_PAYLOAD_ARG_CNT bytes but the firmware API is limited by the SMC call size. Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: zynqmp: synchronize firmware call return payloadIbai Erkiaga5-6/+11
Removes duplicated definition of PAYLOAD_ARG_CNT and define it in the firmware driver. Additionally fixes payload buffer declarations without macro usage Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20mmc: zynq: Fix default value for xlnx,mio-bankMichal Simek1-1/+1
DT binding is saying that default value is 0 not -1 that's why fix it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Peng Fan <peng.fan@nxp.com>
2020-08-20xilinx: Fix xlnx,mio_bank propertyMichal Simek23-30/+30
s/xlnx,mio_bank/xlnx,mio-bank/g DT binding is describing mio-bank not mio_bank that's why fix all DTSes and also driver itself. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Peng Fan <peng.fan@nxp.com>
2020-08-20i2c: eeprom: Use reg property instead of offset and sizeMichal Simek6-18/+41
Remove adhoc dt binding for fixed-partition definition for i2c eeprom. fixed-partition are using reg property instead of offset/size pair. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-20xilinx: zynqmp: Enable DFU tftp supportMichal Simek2-1/+4
Enable DFU tftp support for firmware update. Fill dfu_ram_tftp variable to have command present for showing how to use it. boot FIT image has been created from below fragment. Key part is that type of image has to be firmware. Also based on experiment load property is completely ignored and base addresses are taken from dfu_alt_info variable. $ cat update_uboot.its /dts-v1/; / { description = "Automatic U-Boot update"; #address-cells = <1>; images { Image { description = "Kernel"; data = /incbin/("/tftpboot/Image"); compression = "none"; arch = "arm64"; type = "firmware"; os = "linux"; load = <0x80000>; entry = <0x80000>; hash-1 { algo = "sha1"; }; }; system.dtb { description = "DTB"; data = /incbin/("/tftpboot/system.dtb"); compression = "none"; arch = "arm64"; type = "firmware"; load = <0>; hash-1 { algo = "sha1"; }; }; }; }; $ mkimage -f update_uboot.its /tftpboot/boot When U-Boot starts get IP address and server IP. dhcp setenv serverip 192.168.0.105 And then run prepared command. run dfu_ram_tftp Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: Align dfu ram with booti commandMichal Simek2-3/+5
Image should be loaded to 0x80000 address and not to $kernel_addr_r. Also kernel_addr, fdt_addr and fdt_size in zynqmp case are not defined that's why define it to be aligned with Versal. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20arm64: zynqmp: Reduce malloc memory for mini QSPI configurationAshok Reddy Soma1-1/+1
Mini U-boot runs on lower foot print of 256KB OCM. Hence 8K memory for malloc may not be required. Reduce it by 1.5K. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: versal: Use lowest memory for U-BootMichal Simek1-1/+1
Find and use the lowest memory for Versal to make sure that we keep u-boot as low as possible and never use memory above u-boot's maximum VA mapping. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20lib: fdt: Convert fdtdes_setup_mem..() to livetree APIMichal Simek1-32/+35
Convert fdtdec_setup_mem_size_base(), get_next_memory_node(), fdtdec_setup_memory_banksize() and fdtdec_setup_mem_size_base_lowest() to livetree API. Tested on ZynqMP zcu104 board. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-20lib: fdt: Introduce fdtdec_setup_mem_size_base_lowest()Michal Simek2-0/+62
New function should be called from board dram_init() because it initialized gd->ram_base/ram_size. It finds the lowest available memory. On systems with multiple memory nodes finding out the first memory node by fdtdec_setup_mem_size_base() is not enough because this memory can be above actual U-Boot VA mapping. Currently only mapping till 39bit is supported (Full 44bit mapping was removed by commit 7985cdf74b28 ("arm64: Remove non-full-va map code")). If DT starts with the first memory node above 39bit address then system can be unpredictable. The function is available only when multiple memory bank support is enabled. Calling fdtdec_setup_memory_banksize() from dram_init() is not possible because fdtdec_setup_memory_banksize() is saving dram information to bd structure which is placed on stack but not initialized at this time. Also stack is placed at location setup in dram_init(). Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-20versal: fix versal PM ret payload sizeIbai Erkiaga1-1/+1
The PM return payload size is defined as 4 bytes for Versal arquitecture while the PM calls implemented both in the Versal clock driver and ZynqMP firmware driver expects 5 bytes length. Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: versal: Add new versal loadpdi commandT Karthik Reddy4-0/+121
Versal loadpdi command is used for loading secure & non-secure pdi images. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20arm64: zynqmp: Fix set_fdtfile() not to break u-boots DTBIgor Lantsman1-6/+13
Origin function was calling strsep which replaced delimiter ',' by a null byte ('\0'). Operation was done directly on FDT which ends up with the following behavior: ZynqMP> printenv fdtfile fdtfile=xilinx/zynqmp.dtb ZynqMP> fdt addr $fdtcontroladdr ZynqMP> fdt print / compatible compatible = "xlnx", "zynqmp" As is visible fdtfile was correctly composed but a null byte caused that xlnx was separated from zynqmp. This hasn't been spotted because in all Xilinx DTs there are at least 3 compatible string and only the first one was affected by this issue. But for systems which only had one compatible string "xlnx,zynqmp" it was causing an issue when U-Boot's DT was used by Linux kernel. The patch removes strsep calling and strchr is called instead which just locate the first char after deliminator ',' (variable called "name"). And using this pointer in fdtfile composing. Fixes: 91d7e0c47f51 ("arm64: zynqmp: Create fdtfile from compatible string") Reported-by: Igor Lantsman <igor.lantsman@opsys-tech.com> Signed-off-by: Igor Lantsman <igor.lantsman@opsys-tech.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: Enable preboot feature for ZynqMP and VersalMichal Simek2-0/+2
Enable preboot functionality for ZynqMP and Versal platforms. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20xilinx: kconfig: Change Kconfig dependencies for Xilinx driversMichal Simek4-7/+6
Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in PL and vice versa. That's why change dependencies and do not limit enabling just for some platforms. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2020-08-20xilinx: Setup bootm variablesMichal Simek1-0/+3
On system with PL DDR which is placed before PS DDR in DT env_get_bootm_size() and env_get_bootm_low() without specifying bootm_low and bootm_size variables are taking by default gd->bd->bi_dram[0].start and gd->bd->bi_dram[0].size. As you see 0 means bank 0 which doesn't need to be PS ddr and even can be memory above 39bit VA which is what U-Boot supports now. That's why setup bootm variables based on ram_base/ram_size setting to make sure that boot images are placed to the same location as U-Boot is placed. This location should be by default location where OS can boot from. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-19dts: r64: add sata- and asm_sel nodesFrank Wunderlich2-0/+41
asm_sel is for switching between sata and pcie mode on r64 there is GPIO90 connected to ASM1480 which switches RX/TX pairs to PCIe/SATA connector output-low means sata-controller is active with 2020-10 now reg is also needed for the phy itself Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19ahci: mediatek: add ahci driverFrank Wunderlich3-0/+139
add AHCI driver ported from linux https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/ata/ahci_mtk.c Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19reset: add basic reset controller for pciesysFrank Wunderlich1-0/+15
bind reset controller to pciesys Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19phy: mtk-tphy: add PHY_TYPE_SATAFrank Wunderlich1-0/+105
add support for PHY_TYPE_SATA to Mediateks TPHY driver Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
2020-08-19arm: dts: mt7622: add SATA reset constantsFrank Wunderlich1-1/+4
add reset constants used for SATA to header file Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19arm: dts: mt7622: add PCIe nodes for BananaPi-R64Frank Wunderlich1-0/+31
this patch adds PCIe-Nodes for BananaPi R64 original nodes from Chuanjia Liu for mt7622-rfb Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19dts: r64: add r64 dtsFrank Wunderlich2-0/+207
add a separate DTS for BananaPi R64 because it has 1GB RAM and SATA-Support Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19arm: dts: add watchdog-node for mt7622Frank Wunderlich1-0/+5
adding a watchdog-node to mt7622 dtsi Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2020-08-19configs: mt7622: add PCIe controller related configsChuanjia Liu1-0/+4
Add PCIe command and related configs Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com> Signed-off-by: Henry Yen <henry.yen@mediatek.com>
2020-08-19arm: dts: mediatek: add PCIe node for MT7622Chuanjia Liu2-0/+103
This patch adds PCIe node in dts for Mediatek MT7622 Soc. Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com> Signed-off-by: Henry Yen <henry.yen@mediatek.com>
2020-08-19PCI: mediatek: Add PCIe support for MT7622Chuanjia Liu1-3/+459
This patch adds PCIe support for the Mediatek MT7622 SOC. Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com> Signed-off-by: Henry Yen <henry.yen@mediatek.com>
2020-08-19arm: dts: mediatek: add pciesys support for MT7622 SoCChuanjia Liu1-0/+7
This patch adds pciesys support in dts for MediaTek MT7622 SoC. Signed-off-by: Henry Yen <henry.yen@mediatek.com> Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
2020-08-19clk: mediatek: add pciesys support for MT7622 SoCChuanjia Liu1-0/+54
This patch adds pciesys support in clock driver for MediaTek MT7622 SoC. Signed-off-by: Henry Yen <henry.yen@mediatek.com> Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
2020-08-19pinctrl: mediatek: mt8512: fix the wrong start address of rangesChunfeng Yun1-3/+3
The start address of dout, pullen and pullsel ragnes are wrong, so fix up them. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
2020-08-18Merge tag 'uniphier-v2020.10-2' of ↵Tom Rini26-110/+255
https://gitlab.denx.de/u-boot/custodians/u-boot-uniphier UniPhier SoC updates for v2020.10 (2nd) - minor code cleanups - sync DT with Linux