From d6213e206c441a3b2b83c0588954c851c3610d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Wed, 9 Mar 2022 20:46:01 +0100 Subject: Nokia RX-51: Convert to CONFIG_DM_VIDEO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mechanically convert video_hw_init() function to UCLASS_VIDEO probe callback and replace CONFIG_CFB_CONSOLE by CONFIG_DM_VIDEO. As framebuffer base address is setup by the bootloader which loads U-Boot, set plat->base to that fixed framebuffer address. This change was tested in qemu n900 machine and is working fine. What does not work is CONFIG_VIDEO_LOGO, seems to be buggy. Signed-off-by: Pali Rohár --- include/configs/nokia_rx51.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 9be64c3d3f8..e837b12b568 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -70,19 +70,12 @@ #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP -/* - * Framebuffer - */ -/* Video console */ -#define VIDEO_FB_16BPP_PIXEL_SWAP -#define VIDEO_FB_16BPP_WORD_SWAP - /* Environment information */ #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ "stdin=usbtty,serial,keyboard\0" \ - "stdout=usbtty,serial,vga\0" \ - "stderr=usbtty,serial,vga\0" \ + "stdout=usbtty,serial,vidconsole\0" \ + "stderr=usbtty,serial,vidconsole\0" \ "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \ "switchmmc=mmc dev ${mmcnum}\0" \ "kernaddr=0x82008000\0" \ -- cgit v1.2.3 From fd426b31066ba61ee1ff96a2b56c919251ffdd9e Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Tue, 1 Mar 2022 10:35:39 +0000 Subject: k210: use the board vendor name rather than the marketing name "kendryte" is the marketing name for the K210 RISC-V SoC produced by Canaan Inc. Rather than "kendryte,k210", use the usual "canaan,k210" vendor,SoC compatibility string format in the device tree files and use the SoC name for file names. With these changes, the device tree files are more in sync with the Linux kernel DTS and drivers, making uboot device tree usable by the kernel. Signed-off-by: Damien Le Moal Signed-off-by: Niklas Cassel Reviewed-by: Leo Yu-Chi Liang --- include/configs/sipeed-maix.h | 2 +- include/k210/pll.h | 24 ++++++++++++++++++++++++ include/kendryte/pll.h | 24 ------------------------ 3 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 include/k210/pll.h delete mode 100644 include/kendryte/pll.h (limited to 'include') diff --git a/include/configs/sipeed-maix.h b/include/configs/sipeed-maix.h index 1f74702ea7f..1cc2992c804 100644 --- a/include/configs/sipeed-maix.h +++ b/include/configs/sipeed-maix.h @@ -20,7 +20,7 @@ "fdt_addr_r=0x80400000\0" \ "scriptaddr=0x80020000\0" \ "kernel_addr_r=0x80060000\0" \ - "fdtfile=kendryte/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ + "fdtfile=k210/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ "k210_bootcmd=load mmc 0:1 $loadaddr /uImage && " \ "load mmc 0:1 $fdt_addr_r /k210.dtb && " \ "bootm $loadaddr - $fdt_addr_r\0" diff --git a/include/k210/pll.h b/include/k210/pll.h new file mode 100644 index 00000000000..fd16a89cb20 --- /dev/null +++ b/include/k210/pll.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019-20 Sean Anderson + */ +#ifndef K210_PLL_H +#define K210_PLL_H + +#include + +struct k210_pll_config { + u8 r; + u8 f; + u8 od; +}; + +#ifdef CONFIG_UNIT_TEST +TEST_STATIC int k210_pll_calc_config(u32 rate, u32 rate_in, + struct k210_pll_config *best); +#ifndef nop +#define nop() +#endif + +#endif +#endif /* K210_PLL_H */ diff --git a/include/kendryte/pll.h b/include/kendryte/pll.h deleted file mode 100644 index fd16a89cb20..00000000000 --- a/include/kendryte/pll.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2019-20 Sean Anderson - */ -#ifndef K210_PLL_H -#define K210_PLL_H - -#include - -struct k210_pll_config { - u8 r; - u8 f; - u8 od; -}; - -#ifdef CONFIG_UNIT_TEST -TEST_STATIC int k210_pll_calc_config(u32 rate, u32 rate_in, - struct k210_pll_config *best); -#ifndef nop -#define nop() -#endif - -#endif -#endif /* K210_PLL_H */ -- cgit v1.2.3 From 925f6900c8f51f2b9d4c5cd389be51c19121e974 Mon Sep 17 00:00:00 2001 From: Haibo Chen Date: Tue, 22 Feb 2022 11:28:18 +0800 Subject: mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON when necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit f132aab40327 ("Revert "mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output""), it involve issue in mmc_switch_voltage(), because of the special design of usdhc. For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, these are reserved bits(Though RM contain the definition of these bits, but actually internal IC logic do not implement, already confirm with IC team). Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the card clock output. Here is the definition of this bit in RM: [8] FRC_SDCLK_ON Force CLK output active Do not set this bit to 1 unless it is necessary. Also, make sure that this bit is cleared when uSDHC’s clock is about to be changed (frequency change, clock source change, or delay chain tuning). 0b - CLK active or inactive is fully controlled by the hardware. 1b - Force CLK active In default, the FRC_SDCLK_ON is 0. This means, when there is no command or data transfer on bus, hardware will gate off the card clock. But in some case, we need the card clock keep on. Take IO voltage 1.8v switch as example, after IO voltage change to 1.8v, spec require gate off the card clock for 5ms, and gate on the clock back, once detect the card clock on, then the card will draw the dat0 to high immediately. If there is not clock gate off/on behavior, some card will keep the dat0 to low level. This is the reason we fail in mmc_switch_voltage(). To fix this issue, and concern that this is only the fsl usdhc hardware design limitation, set the bit FRC_SDCLK_ON in the beginning of the wait_dat0() and clear it in the end. To make sure the 1.8v IO voltage switch process align with SD specification. For standard tuning process, usdhc specification also require the card clock keep on, so also add these behavior in fsl_esdhc_execute_tuning(). Reviewed-by: Marek Vasut Tested-by: Fabio Estevam Signed-off-by: Haibo Chen Reviewed-by: Peng Fan Reviewed-by: Jaehoon Chung --- include/fsl_esdhc_imx.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/fsl_esdhc_imx.h b/include/fsl_esdhc_imx.h index 2153f29bef2..b8efd2a1664 100644 --- a/include/fsl_esdhc_imx.h +++ b/include/fsl_esdhc_imx.h @@ -37,6 +37,7 @@ #define VENDORSPEC_HCKEN 0x00001000 #define VENDORSPEC_IPGEN 0x00000800 #define VENDORSPEC_INIT 0x20007809 +#define VENDORSPEC_FRC_SDCLK_ON 0x00000100 #define IRQSTAT 0x0002e030 #define IRQSTAT_DMAE (0x10000000) @@ -94,6 +95,7 @@ #define PRSSTAT_CINS (0x00010000) #define PRSSTAT_BREN (0x00000800) #define PRSSTAT_BWEN (0x00000400) +#define PRSSTAT_SDOFF (0x00000080) #define PRSSTAT_SDSTB (0X00000008) #define PRSSTAT_DLA (0x00000004) #define PRSSTAT_CICHB (0x00000002) -- cgit v1.2.3 From 2a1d7c635fdede97a05d16067a936bba0a37f908 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Tue, 15 Mar 2022 20:46:26 +0300 Subject: mmc: sdhci: Add HS400 Enhanced Strobe support Delegate setting the Enhanced Strobe configuration to individual drivers if they set a function for it. Return -ENOTSUPP if they do not, like what the MMC uclass does. Signed-off-by: Alper Nebi Yasak Reviewed-by: Jaehoon Chung Reviewed-by: Kever Yang --- include/sdhci.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/sdhci.h b/include/sdhci.h index c8d69f5a63f..88f1917480b 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -272,6 +272,18 @@ struct sdhci_ops { int (*platform_execute_tuning)(struct mmc *host, u8 opcode); int (*set_delay)(struct sdhci_host *host); int (*deferred_probe)(struct sdhci_host *host); + + /** + * set_enhanced_strobe() - Set HS400 Enhanced Strobe config + * + * This is called after setting the card speed and mode to + * HS400 ES, and should set any host-specific configuration + * necessary for it. + * + * @host: SDHCI host structure + * Return: 0 if successful, -ve on error + */ + int (*set_enhanced_strobe)(struct sdhci_host *host); }; #define ADMA_MAX_LEN 65532 -- cgit v1.2.3 From e4015661c39383c786e00beec586bddb0cf1541c Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Fri, 24 Dec 2021 16:43:45 +0300 Subject: rockchip: bob: Enable more configs This patch enables some configs that should be working on the Bob board, based on what is observed to work on the Kevin board. The Bob board uses an Embedded DisplayPort panel compatible with the simple panel and Rockchip eDP drivers. Its backlight is controlled by the Chromium OS Embedded Controller Pulse Width Modulator. Enable these for the board. Also set VIDEO_ROCKCHIP_MAX_{XRES,YRES} to 1280x800, the resolution of its panel. This had to be done for the Kevin board, but it's untested if this is actually necessary for Bob. The Rockchip video driver needs to assert/deassert some resets, so also enable the reset controller. RESET_ROCKCHIP defaults to y for this board when DM_RESET=y, so it's enough to set that. The Bob board has two USB 3.0 Type-C ports and one USB 2.0 Type-A port on its right side. Enable the configs relevant to USB devices so these can be used. This is despite a known issue with RK3399 boards where USB de-init causes a hang, as there is a known workaround. Some other rk3399-based devices enable support for the SoC's random number generator in commit a475bef5340c ("configs: rk3399: enable rng on firefly/rock960/rockpro64"), as it can provide a KASLR seed when booting using UEFI. Enable it for Bob as well. The default misc_init_r() for Rockchip boards sets cpuid and ethernet MAC address based on e-fuse block. A previous patch extends this on Gru boards to set registers related to SoC IO domains as is necessary on these boards. Enable this function and configs for it on Bob. The microSD card slot on this board (and others based on Gru) is connected to a GPIO controlled regulator (ppvar-sd-card-io), which must be operable by U-Boot. Enable the relevant config option to allow this. Bob boards also use the Winbond W25Q64DW SPI flash chip, enable support for Winbond SPI flash chips in the board config so U-Boot can boot with this chip. Signed-off-by: Alper Nebi Yasak Reviewed-by: Kever Yang Reviewed-by: Simon Glass Tested-by: Simon Glass --- include/configs/gru.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/configs/gru.h b/include/configs/gru.h index be2dc79968c..b1084bb21d4 100644 --- a/include/configs/gru.h +++ b/include/configs/gru.h @@ -13,4 +13,7 @@ #include +#define CONFIG_USB_OHCI_NEW +#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 + #endif -- cgit v1.2.3 From 6d36e92d28c9d009c786e29623c9558b7652ceda Mon Sep 17 00:00:00 2001 From: "Marty E. Plummer" Date: Fri, 24 Dec 2021 16:43:46 +0300 Subject: rockchip: rk3399: Add support for chromebook_kevin Add support for Kevin, an RK3399-based convertible chromebook that is very similar to Bob. This patch is mostly based on existing support for Bob, with only minor changes for Kevin-specific things. Unlike other Gru boards, coreboot sets Kevin's center logic to 925 mV, so adjust it here in the dts as well. The rk3399-gru-kevin devicetree has an unknown event code reference which has to be defined, set it to the Linux counterpart. The new defconfig is copied from Bob with the diffconfig: DEFAULT_DEVICE_TREE "rk3399-gru-bob" -> "rk3399-gru-kevin" DEFAULT_FDT_FILE "rockchip/rk3399-gru-bob.dtb" -> "rockchip/rk3399-gru-kevin.dtb" VIDEO_ROCKCHIP_MAX_XRES 1280 -> 2400 VIDEO_ROCKCHIP_MAX_YRES 800 -> 1600 +TARGET_CHROMEBOOK_KEVIN y With this Kevin can boot from SPI flash to a usable U-Boot prompt on the display with the keyboard working, but cannot boot into Linux for unknown reasons. eMMC starts in a working state but fails to re-init, microSD card works but at a lower-than-expected speed, USB works but causes a hang on de-init. There are known workarounds to solve eMMC and USB issues. Cc: Marty E. Plummer Cc: Simon Glass [Alper: commit message, resync config with Bob, update MAINTAINERS, add to Rockchip doc, add Kconfig help message, set regulator] Co-developed-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak Reviewed-by: Kever Yang Reviewed-by: Simon Glass Tested-by: Simon Glass --- include/dt-bindings/input/linux-event-codes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dt-bindings/input/linux-event-codes.h b/include/dt-bindings/input/linux-event-codes.h index 87cf351bab0..331458c0e71 100644 --- a/include/dt-bindings/input/linux-event-codes.h +++ b/include/dt-bindings/input/linux-event-codes.h @@ -749,7 +749,8 @@ #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ #define SW_LINEIN_INSERT 0x0d /* set = inserted */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ -#define SW_MAX 0x0f +#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ +#define SW_MAX 0x10 #define SW_CNT (SW_MAX+1) /* -- cgit v1.2.3 From 8399488672e8717d3aa454f9f67408f96168074f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 26 Feb 2022 12:10:10 +0100 Subject: efi_loader: export efi_dp_shorten() Rename function shorten_path() to efi_dp_shorten() and export it. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 110d8ae79cc..1ffcdfc4856 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -725,7 +725,8 @@ extern void *efi_bounce_buffer; #define EFI_LOADER_BOUNCE_BUFFER_SIZE (64 * 1024 * 1024) #endif - +/* shorten device path */ +struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp); struct efi_device_path *efi_dp_next(const struct efi_device_path *dp); int efi_dp_match(const struct efi_device_path *a, const struct efi_device_path *b); -- cgit v1.2.3 From c409593d0853da646194b0a3d65c8b45fe7cb6d4 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 4 Mar 2022 08:20:00 +0100 Subject: efi_loader: fix efi_dp_find_obj() efi_dp_find_obj() should not return any handle with a partially matching device path but the handle with the maximum matching device path. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 1ffcdfc4856..6271d40125e 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -730,8 +730,8 @@ struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp); struct efi_device_path *efi_dp_next(const struct efi_device_path *dp); int efi_dp_match(const struct efi_device_path *a, const struct efi_device_path *b); -struct efi_object *efi_dp_find_obj(struct efi_device_path *dp, - struct efi_device_path **rem); +efi_handle_t efi_dp_find_obj(struct efi_device_path *dp, + struct efi_device_path **rem); /* get size of the first device path instance excluding end node */ efi_uintn_t efi_dp_instance_size(const struct efi_device_path *dp); /* size of multi-instance device path excluding end node */ -- cgit v1.2.3 From e46ef1db9e2c87d5aa13a04ea2329b8bae7ea9db Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 19 Mar 2022 06:35:43 +0100 Subject: efi_loader: efi_dp_find_obj() add protocol check Let function efi_dp_find_obj() additionally check if a given protocol is installed on the handle relating to the device-path. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 6271d40125e..1ae47a87137 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -731,6 +731,7 @@ struct efi_device_path *efi_dp_next(const struct efi_device_path *dp); int efi_dp_match(const struct efi_device_path *a, const struct efi_device_path *b); efi_handle_t efi_dp_find_obj(struct efi_device_path *dp, + const efi_guid_t *guid, struct efi_device_path **rem); /* get size of the first device path instance excluding end node */ efi_uintn_t efi_dp_instance_size(const struct efi_device_path *dp); -- cgit v1.2.3 From 90dcd9b2d3a318391453d9d623d931a568906cb5 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 19 Mar 2022 07:04:03 +0100 Subject: efi_loader: export efi_system_partition_guid The efi_system_partition_guid is needed in multiple places. Export it. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 1ae47a87137..156056fcd3d 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -260,6 +260,8 @@ extern const efi_guid_t efi_block_io_guid; extern const efi_guid_t efi_global_variable_guid; extern const efi_guid_t efi_guid_console_control; extern const efi_guid_t efi_guid_device_path; +/* GUID of the EFI system partition */ +extern const efi_guid_t efi_system_partition_guid; /* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ extern const efi_guid_t efi_guid_driver_binding_protocol; /* event group ExitBootServices() invoked */ -- cgit v1.2.3 From b78631d54f72f063e1f2a5d14a349b1b0d8fbce7 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 5 Mar 2022 00:36:50 +0100 Subject: efi_loader: remove efi_disk_is_system_part() The block IO protocol may be installed on any handle. We should make no assumption about the structure the handle points to. efi_disk_is_system_part() makes an illegal widening cast from a handle to a struct efi_disk_obj. Remove the function. Fixes: Fixes: 41fd506842c2 ("efi_loader: disk: add efi_disk_is_system_part()") Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 156056fcd3d..af36639ec6a 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -541,8 +541,6 @@ efi_status_t tcg2_measure_pe_image(void *efi, u64 efi_size, int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc, const char *if_typename, int diskid, const char *pdevname); -/* Check if it is EFI system partition */ -bool efi_disk_is_system_part(efi_handle_t handle); /* Called by bootefi to make GOP (graphical) interface available */ efi_status_t efi_gop_register(void); /* Called by bootefi to make the network interface available */ -- cgit v1.2.3 From ed48490f8d3f8715b23071a8a1cbe5bba8c8626e Mon Sep 17 00:00:00 2001 From: Han Xu Date: Fri, 25 Mar 2022 08:36:38 -0500 Subject: mtd: gpmi: fix the bch setting backward compatible issue Previous u-boot code changed the default bch setting behavior and caused backward compatible issue. This fix choose the legacy bch geometry back again as the default option. If the minimum ecc strength that NAND chips required need to be chosen, it can be enabled by either adding DT flag "fsl,use-minimum-ecc" or CONFIG_NAND_MXS_USE_MINIMUM_ECC in configs. The unused flag "fsl,legacy-bch-geometry" get removed. Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geometry) Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob NAND) Tested-by: Tim Harvey Tested-by: Sean Nyekjaer Signed-off-by: Han Xu Reviewed-by: Miquel Raynal --- include/mxs_nand.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/mxs_nand.h b/include/mxs_nand.h index 66c909318d1..741dc8734ea 100644 --- a/include/mxs_nand.h +++ b/include/mxs_nand.h @@ -44,8 +44,6 @@ struct mxs_nand_info { struct udevice *dev; unsigned int max_ecc_strength_supported; bool use_minimum_ecc; - /* legacy bch geometry flag */ - bool legacy_bch_geometry; int cur_chip; uint32_t cmd_queue_len; -- cgit v1.2.3