From patchwork Sun Feb 5 19:46:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737762 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=mqIvo4hv; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90Xh22Qhz23r4 for ; Mon, 6 Feb 2023 06:57:08 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC051858EC; Sun, 5 Feb 2023 20:56:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mqIvo4hv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F841857EA; Sun, 5 Feb 2023 20:46:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3E17D8577C for ; Sun, 5 Feb 2023 20:46:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id l128so3811319iof.2 for ; Sun, 05 Feb 2023 11:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MiZJo+tV2cIg0xV9oR0kL1VMT6tryk3FVHbqrU7wMUI=; b=mqIvo4hvtl5xW3/iX0lUUp7YnDfipkEkhEurggFs6AcLe1td+vgBS+rwzkKaeB3Z16 swkvE6xPjc2GxuQhAKhRA4MrD4WN6ILBlXrM/c2wj9FQP3NyVUOlkDGw7VgPnHpHhmOf 6BFHO0FlQGKW5zU2KUHClVJqq7PMrn1EMTX4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MiZJo+tV2cIg0xV9oR0kL1VMT6tryk3FVHbqrU7wMUI=; b=exzmsU3354pSU001xQnY/LUfiw6axYqeWpg7FlAA1ta0rD6Rv6CzeK4i8nmMfeVNw9 i02ytYHFRkl7WZyd6sK2clUHwwG9y1dF8KrHvZxjq5R2EApXOEDUH84hfnydwc3IEWTm SnHodk0oWncKyu9116MosleOCYC2HT8IuWJmYmF9GwquvStcZw9PRufHqFFfc59uvh1u zLzEE6SqL+PJewWs291k9dXJ9zluFCklaxqUkAHmRj8ANNvw/pXJB8tL9ZjXAixD0X/H l4vNwIiRMuUm+MYBENvwN8ycoYShfQvdCQ8FYDPuJq5QX4SQ7BeUnN1rEMf1nmf9XvJh Nlsw== X-Gm-Message-State: AO0yUKUBZCrDRK0xHYFt7AvbSbebkVCL39TPRtxzHBQzCkMk71XBnwIk nqSC1OUVKM8m+xGy/DLQx3YbWXRasBWzu9az X-Google-Smtp-Source: AK7set/ns8LqIStasF+KKMFXRRheu/ag2geCla3CAAj4e+xndHMNZNWtjqWxUJ8avAfvUy5XFbGsrw== X-Received: by 2002:a5d:9c90:0:b0:71d:6bb6:8a3e with SMTP id p16-20020a5d9c90000000b0071d6bb68a3emr8320931iop.7.1675626400815; Sun, 05 Feb 2023 11:46:40 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:40 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 01/11] efi: video: Move payload code into a function Date: Sun, 5 Feb 2023 12:46:17 -0700 Message-Id: <20230205194627.203961-2-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Put this into a function, as we have done for the app implementation. Comment both functions. FOr now the app still does not access it correctly. Signed-off-by: Simon Glass --- drivers/video/efi.c | 83 +++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 26 deletions(-) diff --git a/drivers/video/efi.c b/drivers/video/efi.c index b11e42c0ebf..fc37a68b376 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -50,6 +50,15 @@ static void efi_find_pixel_bits(u32 mask, u8 *pos, u8 *size) *size = len; } +/** + * get_mode_info() - Ask EFI for the mode information + * + * Gets info from the graphics-output protocol + * + * @vesa: Place to put the mode information + * Returns: 0 if OK, -ENOSYS if boot services are not available, -ENOTSUPP if + * the protocol is not supported by EFI + */ static int get_mode_info(struct vesa_mode_info *vesa) { efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; @@ -72,32 +81,54 @@ static int get_mode_info(struct vesa_mode_info *vesa) return 0; } +/** + * get_mode_from_entry() - Obtain fb info from the EFIET_GOP_MODE payload entry + * + * This gets the mode information provided by the stub to the payload and puts + * it into a vesa structure. It also returns the mode information. + * + * @vesa: Place to put the mode information + * @infop: Returns a pointer to the mode info + * Returns: 0 if OK, -ve on error + */ +static int get_mode_from_entry(struct vesa_mode_info *vesa, + struct efi_gop_mode_info **infop) +{ + struct efi_gop_mode *mode; + int size; + int ret; + + ret = efi_info_get(EFIET_GOP_MODE, (void **)&mode, &size); + if (ret) { + printf("EFI graphics output entry not found\n"); + return ret; + } + vesa->phys_base_ptr = mode->fb_base; + vesa->x_resolution = mode->info->width; + vesa->y_resolution = mode->info->height; + *infop = mode->info; + + return 0; +} + static int save_vesa_mode(struct vesa_mode_info *vesa) { - struct efi_entry_gopmode *mode; const struct efi_framebuffer *fbinfo; - int size; + struct efi_gop_mode_info *info; int ret; - if (IS_ENABLED(CONFIG_EFI_APP)) { + if (IS_ENABLED(CONFIG_EFI_APP)) ret = get_mode_info(vesa); - if (ret) { - printf("EFI graphics output protocol not found\n"); - return -ENXIO; - } - } else { - ret = efi_info_get(EFIET_GOP_MODE, (void **)&mode, &size); - if (ret == -ENOENT) { - printf("EFI graphics output protocol mode not found\n"); - return -ENXIO; - } - vesa->phys_base_ptr = mode->fb_base; - vesa->x_resolution = mode->info->width; - vesa->y_resolution = mode->info->height; + else + ret = get_mode_from_entry(vesa, &info); + if (ret) { + printf("EFI graphics output protocol not found (err=%dE)\n", + ret); + return ret; } - if (mode->info->pixel_format < EFI_GOT_BITMASK) { - fbinfo = &efi_framebuffer_format_map[mode->info->pixel_format]; + if (info->pixel_format < EFI_GOT_BITMASK) { + fbinfo = &efi_framebuffer_format_map[info->pixel_format]; vesa->red_mask_size = fbinfo->red.size; vesa->red_mask_pos = fbinfo->red.pos; vesa->green_mask_size = fbinfo->green.size; @@ -108,29 +139,29 @@ static int save_vesa_mode(struct vesa_mode_info *vesa) vesa->reserved_mask_pos = fbinfo->rsvd.pos; vesa->bits_per_pixel = 32; - vesa->bytes_per_scanline = mode->info->pixels_per_scanline * 4; - } else if (mode->info->pixel_format == EFI_GOT_BITMASK) { - efi_find_pixel_bits(mode->info->pixel_bitmask[0], + vesa->bytes_per_scanline = info->pixels_per_scanline * 4; + } else if (info->pixel_format == EFI_GOT_BITMASK) { + efi_find_pixel_bits(info->pixel_bitmask[0], &vesa->red_mask_pos, &vesa->red_mask_size); - efi_find_pixel_bits(mode->info->pixel_bitmask[1], + efi_find_pixel_bits(info->pixel_bitmask[1], &vesa->green_mask_pos, &vesa->green_mask_size); - efi_find_pixel_bits(mode->info->pixel_bitmask[2], + efi_find_pixel_bits(info->pixel_bitmask[2], &vesa->blue_mask_pos, &vesa->blue_mask_size); - efi_find_pixel_bits(mode->info->pixel_bitmask[3], + efi_find_pixel_bits(info->pixel_bitmask[3], &vesa->reserved_mask_pos, &vesa->reserved_mask_size); vesa->bits_per_pixel = vesa->red_mask_size + vesa->green_mask_size + vesa->blue_mask_size + vesa->reserved_mask_size; - vesa->bytes_per_scanline = (mode->info->pixels_per_scanline * + vesa->bytes_per_scanline = (info->pixels_per_scanline * vesa->bits_per_pixel) / 8; } else { debug("efi set unknown framebuffer format: %d\n", - mode->info->pixel_format); + info->pixel_format); return -EINVAL; } From patchwork Sun Feb 5 19:46:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737763 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=dlpuqKVD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90Xw5q9Zz23r4 for ; Mon, 6 Feb 2023 06:57:20 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5311C85799; Sun, 5 Feb 2023 20:56:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="dlpuqKVD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5D1A85797; Sun, 5 Feb 2023 20:46:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3847685798 for ; Sun, 5 Feb 2023 20:46:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id q6so3788923ior.12 for ; Sun, 05 Feb 2023 11:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=solQ8iwTNF1Td624/rDyeDAN3hSQEquu7iJDlBNCBQg=; b=dlpuqKVDAk9zhqioegGE+mPWXP4ASdQYTVfB2Z38jsmhx2Wk6iEJgHydnU7TIUcRVV gJDqSb7MwW0hh+sy13+A/lEivs9AOxaSyhx2YjTiFpP3OfwAcmNl5ca9F/ur6gHe4itd ++P9lZFpuagUjeB/Dj7r10xXchY8xlW9n3ujQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=solQ8iwTNF1Td624/rDyeDAN3hSQEquu7iJDlBNCBQg=; b=1Q4WY2OhDyEgdRmKIINtx01107DnvwUHCpsrHZbCGDQWW5zI4TW1Fmud+CXlSYSA/g fwRWbfIiiOpEGKHWBwqSMijy4TcpKUd4/7gUONv71lYYR4cdMrnoMOBgyAQvU9aRWq/N dHihT4GGaH+x2wAIBzVI8VF3M9q9R50qsSGiT9Y2UWmgxh+RcVKMv5bzz0uwKcuFfmXL rCt7Zi1dh35xdxKJ8mTMPPkfVy18zsVrT9tkklP4AFCAkExe96hBAHLpSrahIKOh/UVG m5dM5qvYCtSz7VKPo/QUsYz9paxJivQzEF3eufgw+YLaWqahEq11yhpH5GDd8UFMGSL6 vsGw== X-Gm-Message-State: AO0yUKWSe+JYcD+zGDfCCoRIK70uZ1rYg6hyu1O+mNxMWAd0TE09ywz3 yH/xBUVg3gOZIQA+caQMJ2ldbbQBgpu59vzi X-Google-Smtp-Source: AK7set/BYKdJ2t7nrUffR13EQkcP1tNgbqTsVNGddb7Rh8mq51JbUMjA2FdY380SyvbjZkbX4uLiQA== X-Received: by 2002:a6b:8f57:0:b0:6df:820f:beae with SMTP id r84-20020a6b8f57000000b006df820fbeaemr11640447iod.18.1675626401678; Sun, 05 Feb 2023 11:46:41 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:41 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 02/11] efi: video: Return mode info for app also Date: Sun, 5 Feb 2023 12:46:18 -0700 Message-Id: <20230205194627.203961-3-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The mode info is currently not initialised for the app. Fix this by returning it from the function. Signed-off-by: Simon Glass --- drivers/video/efi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/efi.c b/drivers/video/efi.c index fc37a68b376..0479f207032 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -56,10 +56,12 @@ static void efi_find_pixel_bits(u32 mask, u8 *pos, u8 *size) * Gets info from the graphics-output protocol * * @vesa: Place to put the mode information + * @infop: Returns a pointer to the mode info * Returns: 0 if OK, -ENOSYS if boot services are not available, -ENOTSUPP if * the protocol is not supported by EFI */ -static int get_mode_info(struct vesa_mode_info *vesa) +static int get_mode_info(struct vesa_mode_info *vesa, + struct efi_gop_mode_info **infop) { efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; struct efi_boot_services *boot = efi_get_boot(); @@ -77,6 +79,7 @@ static int get_mode_info(struct vesa_mode_info *vesa) vesa->phys_base_ptr = mode->fb_base; vesa->x_resolution = mode->info->width; vesa->y_resolution = mode->info->height; + *infop = mode->info; return 0; } @@ -118,7 +121,7 @@ static int save_vesa_mode(struct vesa_mode_info *vesa) int ret; if (IS_ENABLED(CONFIG_EFI_APP)) - ret = get_mode_info(vesa); + ret = get_mode_info(vesa, &info); else ret = get_mode_from_entry(vesa, &info); if (ret) { From patchwork Sun Feb 5 19:46:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737753 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=e8r9KojC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90K03xprz23fc for ; Mon, 6 Feb 2023 06:47:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 94006857A8; Sun, 5 Feb 2023 20:46:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="e8r9KojC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 313F28578A; Sun, 5 Feb 2023 20:46:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7D8E6857A8 for ; Sun, 5 Feb 2023 20:46:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id y2so3799912iot.4 for ; Sun, 05 Feb 2023 11:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XwBkNOwV5/pYgw8gbZL0ParbVKjJa/YdD0Wo1if8cnU=; b=e8r9KojCxUIGU1T4xDhvoClhSznZDat0KwiBAqd09HWhCAW17CvK4GPMsXJxR+6fgL 1Qo7KvePf3w2KiDNcXDtH1CnqYGax6tja34AxKxk2AWu2wbEgmepT18OnqyP0r5KUacD aCDOIBgZy51geYnrjBJ6lW97MwCqhfZLg/wBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XwBkNOwV5/pYgw8gbZL0ParbVKjJa/YdD0Wo1if8cnU=; b=1xiRiTohsKgnJACzhI4ud4822xPtNBH0bv0VhTtGe4PhiV9X9jVF2u00LpDMwsLXO8 DAGGIkG9jhcZNvJaKpxatmxdNCQxI0mzJIKTReDgwwPtIDG1jOid3z3DRq0GOb218Wo4 lJ7L96X9EsjS9ZS68CiwArV4n2IIeuUGtXmpTXAwKL+n8blnpbNAhv5GuTys+4dHmAl8 VpEdf+/na21juYyhIgROYQZ2HNnGQT0GAt2MkPc7DBZOHIEt038Ud4BjRRjcZncnZKqA ZE9JvRvaZQYqbxHrxH/TLxhs+hDAtzSm+g8j1O7ONzPeMZ2yGovMH+ZdO2WJC/SaNw4c +O3A== X-Gm-Message-State: AO0yUKUWG/zfPna173/FpheFcACRgbDoU5bsJE7w8oLfw1k0eMVR3Ncl uEGcyGf85/lajW/WMpGJoPda0feF0HRufyBg X-Google-Smtp-Source: AK7set98dotMLd2dycZGLxurZLX3E/vffvvKhDKfC6V4HXuVBaM/CH0kSJHHqsT+Zze7pQay0Jqr5w== X-Received: by 2002:a5d:8d89:0:b0:712:d45b:858a with SMTP id b9-20020a5d8d89000000b00712d45b858amr7787262ioj.6.1675626402578; Sun, 05 Feb 2023 11:46:42 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:42 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass , Bin Meng Subject: [PATCH 03/11] efi: Support a 64-bit frame buffer address Date: Sun, 5 Feb 2023 12:46:19 -0700 Message-Id: <20230205194627.203961-4-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The current vesa structure only provides a 32-bit value for the frame buffer. Many modern machines use an address outside the range. It is still useful to have this common struct, but add a separate frame-buffer address as well. Add a comment for vesa_setup_video_priv() while we are here. Signed-off-by: Simon Glass --- arch/x86/lib/fsp/fsp_graphics.c | 2 +- drivers/pci/pci_rom.c | 10 ++++++---- drivers/video/coreboot.c | 2 +- drivers/video/efi.c | 34 +++++++++++++++++++++------------ include/vesa.h | 16 +++++++++++++++- 5 files changed, 45 insertions(+), 19 deletions(-) diff --git a/arch/x86/lib/fsp/fsp_graphics.c b/arch/x86/lib/fsp/fsp_graphics.c index b07c666caf7..2bcc49f6051 100644 --- a/arch/x86/lib/fsp/fsp_graphics.c +++ b/arch/x86/lib/fsp/fsp_graphics.c @@ -106,7 +106,7 @@ static int fsp_video_probe(struct udevice *dev) vesa->phys_base_ptr = dm_pci_read_bar32(dev, 2); gd->fb_base = vesa->phys_base_ptr; - ret = vesa_setup_video_priv(vesa, uc_priv, plat); + ret = vesa_setup_video_priv(vesa, vesa->phys_base_ptr, uc_priv, plat); if (ret) goto err; diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 4eb4f967446..16a5491d20e 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -325,7 +325,7 @@ err: return ret; } -int vesa_setup_video_priv(struct vesa_mode_info *vesa, +int vesa_setup_video_priv(struct vesa_mode_info *vesa, u64 fb, struct video_priv *uc_priv, struct video_uc_plat *plat) { @@ -348,9 +348,9 @@ int vesa_setup_video_priv(struct vesa_mode_info *vesa, /* Use double buffering if enabled */ if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->base) - plat->copy_base = vesa->phys_base_ptr; + plat->copy_base = fb; else - plat->base = vesa->phys_base_ptr; + plat->base = fb; log_debug("base = %lx, copy_base = %lx\n", plat->base, plat->copy_base); plat->size = vesa->bytes_per_scanline * vesa->y_resolution; @@ -377,7 +377,9 @@ int vesa_setup_video(struct udevice *dev, int (*int15_handler)(void)) return ret; } - ret = vesa_setup_video_priv(&mode_info.vesa, uc_priv, plat); + ret = vesa_setup_video_priv(&mode_info.vesa, + mode_info.vesa.phys_base_ptr, uc_priv, + plat); if (ret) { if (ret == -ENFILE) { /* diff --git a/drivers/video/coreboot.c b/drivers/video/coreboot.c index d2d87c75c89..c586475e41e 100644 --- a/drivers/video/coreboot.c +++ b/drivers/video/coreboot.c @@ -57,7 +57,7 @@ static int coreboot_video_probe(struct udevice *dev) goto err; } - ret = vesa_setup_video_priv(vesa, uc_priv, plat); + ret = vesa_setup_video_priv(vesa, vesa->phys_base_ptr, uc_priv, plat); if (ret) { ret = log_msg_ret("setup", ret); goto err; diff --git a/drivers/video/efi.c b/drivers/video/efi.c index 0479f207032..169637c2882 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -5,6 +5,8 @@ * EFI framebuffer driver based on GOP */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include @@ -56,11 +58,12 @@ static void efi_find_pixel_bits(u32 mask, u8 *pos, u8 *size) * Gets info from the graphics-output protocol * * @vesa: Place to put the mode information + * @fbp: Returns the address of the frame buffer * @infop: Returns a pointer to the mode info * Returns: 0 if OK, -ENOSYS if boot services are not available, -ENOTSUPP if * the protocol is not supported by EFI */ -static int get_mode_info(struct vesa_mode_info *vesa, +static int get_mode_info(struct vesa_mode_info *vesa, u64 *fbp, struct efi_gop_mode_info **infop) { efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; @@ -74,9 +77,13 @@ static int get_mode_info(struct vesa_mode_info *vesa, ret = boot->locate_protocol(&efi_gop_guid, NULL, (void **)&gop); if (ret) return log_msg_ret("prot", -ENOTSUPP); - mode = gop->mode; + log_debug("maxmode %u, mode %u, info %p, size %lx, fb %lx, fb_size %lx\n", + mode->max_mode, mode->mode, mode->info, mode->info_size, + (ulong)mode->fb_base, (ulong)mode->fb_size); + vesa->phys_base_ptr = mode->fb_base; + *fbp = mode->fb_base; vesa->x_resolution = mode->info->width; vesa->y_resolution = mode->info->height; *infop = mode->info; @@ -91,10 +98,11 @@ static int get_mode_info(struct vesa_mode_info *vesa, * it into a vesa structure. It also returns the mode information. * * @vesa: Place to put the mode information + * @fbp: Returns the address of the frame buffer * @infop: Returns a pointer to the mode info * Returns: 0 if OK, -ve on error */ -static int get_mode_from_entry(struct vesa_mode_info *vesa, +static int get_mode_from_entry(struct vesa_mode_info *vesa, u64 *fbp, struct efi_gop_mode_info **infop) { struct efi_gop_mode *mode; @@ -107,6 +115,7 @@ static int get_mode_from_entry(struct vesa_mode_info *vesa, return ret; } vesa->phys_base_ptr = mode->fb_base; + *fbp = mode->fb_base; vesa->x_resolution = mode->info->width; vesa->y_resolution = mode->info->height; *infop = mode->info; @@ -114,16 +123,17 @@ static int get_mode_from_entry(struct vesa_mode_info *vesa, return 0; } -static int save_vesa_mode(struct vesa_mode_info *vesa) +static int save_vesa_mode(struct vesa_mode_info *vesa, u64 *fbp) { const struct efi_framebuffer *fbinfo; struct efi_gop_mode_info *info; int ret; + printf("start\n"); if (IS_ENABLED(CONFIG_EFI_APP)) - ret = get_mode_info(vesa, &info); + ret = get_mode_info(vesa, fbp, &info); else - ret = get_mode_from_entry(vesa, &info); + ret = get_mode_from_entry(vesa, fbp, &info); if (ret) { printf("EFI graphics output protocol not found (err=%dE)\n", ret); @@ -163,8 +173,7 @@ static int save_vesa_mode(struct vesa_mode_info *vesa) vesa->bytes_per_scanline = (info->pixels_per_scanline * vesa->bits_per_pixel) / 8; } else { - debug("efi set unknown framebuffer format: %d\n", - info->pixel_format); + log_err("Unknown framebuffer format: %d\n", info->pixel_format); return -EINVAL; } @@ -176,19 +185,20 @@ static int efi_video_probe(struct udevice *dev) struct video_uc_plat *plat = dev_get_uclass_plat(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev); struct vesa_mode_info *vesa = &mode_info.vesa; + u64 fb; int ret; /* Initialize vesa_mode_info structure */ - ret = save_vesa_mode(vesa); + ret = save_vesa_mode(vesa, &fb); if (ret) goto err; - ret = vesa_setup_video_priv(vesa, uc_priv, plat); + ret = vesa_setup_video_priv(vesa, fb, uc_priv, plat); if (ret) goto err; - printf("Video: %dx%dx%d\n", uc_priv->xsize, uc_priv->ysize, - vesa->bits_per_pixel); + printf("Video: %dx%dx%d @ %lx\n", uc_priv->xsize, uc_priv->ysize, + vesa->bits_per_pixel, (ulong)fb); return 0; diff --git a/include/vesa.h b/include/vesa.h index a42c1796863..98112208114 100644 --- a/include/vesa.h +++ b/include/vesa.h @@ -108,7 +108,21 @@ extern struct vesa_state mode_info; struct video_priv; struct video_uc_plat; -int vesa_setup_video_priv(struct vesa_mode_info *vesa, + +/** + * vesa_setup_video_priv() - Set up a video device using VESA information + * + * The vesa struct is used by various x86 drivers, so this is a common function + * to use it to set up the video. + * + * @vesa: Vesa information to use (vesa->phys_base_ptr is ignored) + * @fb: Frame buffer address (since vesa->phys_base_ptr is only 32 bits) + * @uc_priv: Video device's uclass-private information + * @plat: Video devices's uclass-private platform data + * @return 0 if OK, -ENXIO if the x resolution is 0, -EEPROTONOSUPPORT if the + * pixel format is not supported + */ +int vesa_setup_video_priv(struct vesa_mode_info *vesa, u64 fb, struct video_priv *uc_priv, struct video_uc_plat *plat); int vesa_setup_video(struct udevice *dev, int (*int15_handler)(void)); From patchwork Sun Feb 5 19:46:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737761 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hkeNWpHj; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90XR15Ztz23r4 for ; Mon, 6 Feb 2023 06:56:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 829C08576A; Sun, 5 Feb 2023 20:56:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hkeNWpHj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C84A985786; Sun, 5 Feb 2023 20:46:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EA65085794 for ; Sun, 5 Feb 2023 20:46:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id j17so1912026ioa.9 for ; Sun, 05 Feb 2023 11:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QAx3kInEASwQXfAlA4OvdzYBsPhuR0728XVY36dkEAk=; b=hkeNWpHj0ktbKHJgFj/cgOJz3ec2LgrAgqV9oJghwr2t4Si+bxXMndl70dcyUnSBys iq1iubS+MZNHSWaOQtVIPMxJV+nRCw9jma8flhUA7JbupyytZ9CJ+lo/kWTljYitRKtC O1x1+p0+0Gzmq0ZMzeel8fjJoSRt+6UyrUKKg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QAx3kInEASwQXfAlA4OvdzYBsPhuR0728XVY36dkEAk=; b=kK4xhxbslLi29R9XgJRvNJPW6fpLsAvnh7W6cN+MsbSmS2GHnXv4g13XWs3NToUYJs i6pCWQFRymtnrtc7DpxJYh8ozWdI9ZXihFdOCKqKpIAHnUDawfRKW8zFRbjEF/3t/AC5 qZe1CApylwfTi/0GB7bHHak0JekRBKYEmbgxU2lDxQOIamWOkx8O6iYYsAyfMeIeKuj4 lAKSwFD2AmboBL0kLH/zI7lxXpOHIOYJ8GGyqO8zj2WbjaPtDq6ocVI7CHh6D2K6lYT7 XyppSIyqrJlNnJvFYmi0ixG9SIQf7fjr8DiiD+2byXDyAp6KzviCu9QyRo8LcuRBr2A8 7V9g== X-Gm-Message-State: AO0yUKWQFgOwID51f1qz//8MG8hvpGYpQWCq/tCyRwamoIwA8lyHpYg3 9KBc91ZKOI6aTHEmBacrrGSMEf49QCEWgQLu X-Google-Smtp-Source: AK7set947G6tFBDv1FOD3XXaxXARRm9aiujSe3fCZ6pR6Lx9Fq0NRrtZ+zfUEgntzSjjRLw13fmTGw== X-Received: by 2002:a5d:8456:0:b0:71c:1516:1b09 with SMTP id w22-20020a5d8456000000b0071c15161b09mr10554261ior.0.1675626403423; Sun, 05 Feb 2023 11:46:43 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:43 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass , Bin Meng Subject: [PATCH 04/11] x86: Add a few more items to bdinfo Date: Sun, 5 Feb 2023 12:46:20 -0700 Message-Id: <20230205194627.203961-5-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add the timer and vendor/model information. Signed-off-by: Simon Glass --- arch/x86/lib/bdinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/lib/bdinfo.c b/arch/x86/lib/bdinfo.c index 0cb79b01bd3..896de37dce4 100644 --- a/arch/x86/lib/bdinfo.c +++ b/arch/x86/lib/bdinfo.c @@ -16,6 +16,10 @@ DECLARE_GLOBAL_DATA_PTR; void arch_print_bdinfo(void) { bdinfo_print_num_l("prev table", gd->arch.table); + bdinfo_print_num_l("clock_rate", gd->arch.clock_rate); + bdinfo_print_num_l("tsc_base", gd->arch.tsc_base); + bdinfo_print_num_l("vendor", gd->arch.x86_vendor); + bdinfo_print_num_l("model", gd->arch.x86_model); if (IS_ENABLED(CONFIG_EFI_STUB)) efi_show_bdinfo(); From patchwork Sun Feb 5 19:46:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737754 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Wq7jN/XJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90KH50tSz23fc for ; Mon, 6 Feb 2023 06:47:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9528857C8; Sun, 5 Feb 2023 20:46:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Wq7jN/XJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 515D18579B; Sun, 5 Feb 2023 20:46:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 17593857C1 for ; Sun, 5 Feb 2023 20:46:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd35.google.com with SMTP id y2so3799922iot.4 for ; Sun, 05 Feb 2023 11:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gF0LwGCqRPJQnmwFG0+e5QlpFTfGBX6xwT6ysySN2GI=; b=Wq7jN/XJDAYf6QnVpMQvp+Ur18K8ayQIzhwhDVAWhBgBBBdfqZB8lo29SjWJUyDRY/ tgZadfMWua9FDbH/mWaYiV39ecWmB5cFLXW5n+FtFEnY3+FpWzmoqLXAlvyBaydJQrsv Z8NTkd0V7gNN7vh3FsY+SaLckfsZXvyGR/wZo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gF0LwGCqRPJQnmwFG0+e5QlpFTfGBX6xwT6ysySN2GI=; b=rFnwr4pMBmN2Pwv0N14SgCfqENq/CIXMXPAe3DaeQIs2IZzQg/aoQ9D4PSqqqOWAyu +Y7d3LvwUmTzXbWrBQ9wcBCMq382kgCy3UZdeWIbzqltCTZ9PIk05WbtREwIKBlUFyrk VommpX1J1dmei1XR4CihGRaic0w2Zi6PatBGmE2WhRlursU9CV9Jo4vi2lDyOmYZWoC9 d+TyWvZAi66ONDma+GIB+CLLVVzluTxZNbu9G024xO2tZ3bLo2p1R7fjd7WZr25Om6ug Ot6yuOhTdWB2bo6uMhmGzgvn8wf318fnMsqKVJId+0VCGX3a7GNsXTr1M5vagTmkICge 5eiw== X-Gm-Message-State: AO0yUKWRl3t5m+eK+eUKnvxiXVScfgrPV7yJs24PYmVBBRSJNugs1MMB cqBIsAqGVuvnWL1jt5xGsjbURhGtY6HASySm X-Google-Smtp-Source: AK7set+0CA1ZOaxm+IFUY/mCm8SqGBfsJrWEhK+i0mOUIGRWJEwTB07ZA6TaFgVi4+pu2qBOQZPghA== X-Received: by 2002:a5e:dc03:0:b0:71e:45d5:9b30 with SMTP id b3-20020a5edc03000000b0071e45d59b30mr11524050iok.13.1675626404280; Sun, 05 Feb 2023 11:46:44 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:43 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 05/11] efi: Use a fixed value for the timer clock Date: Sun, 5 Feb 2023 12:46:21 -0700 Message-Id: <20230205194627.203961-6-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean It is not yet clear how to read the timer via EFI. The current value seems much too high on a Framework laptop I tried. Adjust it to a lower hard-coded value for now. Signed-off-by: Simon Glass --- drivers/timer/tsc_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c index 50ab4e86dca..44c6cc363e0 100644 --- a/drivers/timer/tsc_timer.c +++ b/drivers/timer/tsc_timer.c @@ -404,6 +404,10 @@ static void tsc_timer_ensure_setup(bool early) if (!gd->arch.clock_rate) { unsigned long fast_calibrate; + if (IS_ENABLED(CONFIG_EFI_APP)) { + fast_calibrate = 2750; + goto done; + } fast_calibrate = native_calibrate_tsc(); if (fast_calibrate) goto done; From patchwork Sun Feb 5 19:46:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737757 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=nxOQ1XNU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90L10vr5z23fc for ; Mon, 6 Feb 2023 06:47:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 76004857C2; Sun, 5 Feb 2023 20:47:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="nxOQ1XNU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 18D018573E; Sun, 5 Feb 2023 20:47:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BF378857CE for ; Sun, 5 Feb 2023 20:46:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id r6so3802133ioj.5 for ; Sun, 05 Feb 2023 11:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Na1NXm2HqGCgykOloqtVtjwLoS1Stje6dVGhG7kV1JI=; b=nxOQ1XNUCUBYzHzeODRRceCQwjVRDyDxB/mC5lcLXL9HFwB6KRGBp4wl5R7yxZ80S8 XMndz4VyslkNs6cS3C/dPqrkZrn9sm0dxm4OQQZSBniaGF/fm7Y6F+QsHMUSMbmFJoDN IH2Jk8C3ww8dhrSku2W8HPj15J/9Ymsed6GQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Na1NXm2HqGCgykOloqtVtjwLoS1Stje6dVGhG7kV1JI=; b=m1sijpzAPRsI6Z8zOS+2P1Nw/H2VWu3087aSiffTXct0MAa8BWaY+0tpsL5yRiRW0z 3oOIIkwto9GcA42ThcORCu2W2UEkckPDfVhkGTMcuLrcZvxVEGDkCv/7QJLi5RXj9mHq gXCC4MYZkWQ2Ak3lcd+Hi0CKGXXjPeeWaIcL55dZ5RSMphHuXKoDCMM3hxMu+I39yaPu HtH4C9tuz2VwlxJ254SNTMbwtF/OBTUHYv0KFRpKP7KhyQWNsQfaLXrAwkjA4jdaT3d1 txTxBvgbQ2qXYWI6Hqy/kxuNDw/7JaBLP9m+0Zd6kuPjatshPaVKpMngDrHXyEIAMHHo 5N6g== X-Gm-Message-State: AO0yUKWqgHqtS0D0H0f9ArW3zcueHdXlZBeCqk72A15eKkkHHxF8Hu90 drkAX6wC2Dow9gkACdwLhbW8bHpHKNA7JkvH X-Google-Smtp-Source: AK7set9/sEIUe7LAQw24es0rAMCOxeKlpO8AriJDfTIraPWRTRSQiDjn3elWSftBUceUDZSZPmhKnQ== X-Received: by 2002:a05:6602:2f16:b0:6e5:25a2:c63d with SMTP id q22-20020a0566022f1600b006e525a2c63dmr16976497iow.21.1675626405130; Sun, 05 Feb 2023 11:46:45 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:44 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass , Bin Meng Subject: [PATCH 06/11] efi: Support copy framebuffer Date: Sun, 5 Feb 2023 12:46:22 -0700 Message-Id: <20230205194627.203961-7-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add support for this to EFI in case it becomes useful. At present it just slows things down. Enable CONFIG_VIDEO_COPY to turn it on. Signed-off-by: Simon Glass --- arch/x86/dts/efi-x86_app.dts | 1 + drivers/video/efi.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/x86/dts/efi-x86_app.dts b/arch/x86/dts/efi-x86_app.dts index a5316e2a1a7..7afa3d72d57 100644 --- a/arch/x86/dts/efi-x86_app.dts +++ b/arch/x86/dts/efi-x86_app.dts @@ -27,6 +27,7 @@ }; efi-fb { compatible = "efi-fb"; + u-boot,dm-pre-reloc; }; }; diff --git a/drivers/video/efi.c b/drivers/video/efi.c index 169637c2882..9135a8e8187 100644 --- a/drivers/video/efi.c +++ b/drivers/video/efi.c @@ -207,6 +207,16 @@ err: return ret; } +static int efi_video_bind(struct udevice *dev) +{ + struct video_uc_plat *plat = dev_get_uclass_plat(dev); + + /* Use a 16MB frame buffer in case VIDEO_COPY is enabled */ + plat->copy_size = 16 << 20; + + return 0; +} + static const struct udevice_id efi_video_ids[] = { { .compatible = "efi-fb" }, { } @@ -216,5 +226,6 @@ U_BOOT_DRIVER(efi_video) = { .name = "efi_video", .id = UCLASS_VIDEO, .of_match = efi_video_ids, + .bind = efi_video_bind, .probe = efi_video_probe, }; From patchwork Sun Feb 5 19:46:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737755 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CmIwig5M; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90KY5KLnz23fc for ; Mon, 6 Feb 2023 06:47:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5DEEA8577C; Sun, 5 Feb 2023 20:47:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CmIwig5M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5B20857A1; Sun, 5 Feb 2023 20:46:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 76C04857C8 for ; Sun, 5 Feb 2023 20:46:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id y2so3799938iot.4 for ; Sun, 05 Feb 2023 11:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=56daZ9oVoJi318PhcrMG+2kB/22zd03Xp+VZl4Kpty4=; b=CmIwig5Ma+DPOIG8QCDbigtIC4BWM9sk6TeYlBTJl1eosaM+DoeVj/DeJPrrA1L4Nx dq2w09Qn//XOLC/Oj1RqwDBMhjvqy51ncNwIlsUIgGVPD/8nkznpdraXmh3NODIqpljf 9Y1snHSRxWVFG1TWxw+uadps5afIoVPe0bG8c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=56daZ9oVoJi318PhcrMG+2kB/22zd03Xp+VZl4Kpty4=; b=WnN5QlTtDYvVyDhAy7caAOL1dMX6wyHZdQu5xVvxTCdrKkCExMhrURJS8xOtO+UR9q jAUDF7dLuQVOLCjmI5Ytinny0qzUU5P9PYsMobtOqSyq9kptZNcdu4I+wNoHnCIiTFhd 2akRlkBa1ZBFF2dqWgbhczFygJ8Js4lDGoBa4OIHq0070yv7fRrRUvh0zn9Dxc5c7IVP ESvoIxtRNGAod2ggneWYLk+pfehkXb3u+gAoY1cSiT7/VXaVsBBjroBK36sGjeYNzZlh xajHyZA4BUO9fy0vvaymLIak2EiK6q7kESyxLgyZPpsORrTt1y9FFcfpc16gqfQGn6f0 g/dg== X-Gm-Message-State: AO0yUKX6Khxwo7EuKfWZ54sBkr/HCyENvtgvE2QBEI5njK/29vTbM0hu yvBqQqb0t0O1jbkoPleY6fnC8GicgwFP2acH X-Google-Smtp-Source: AK7set/dejjjFPD6tjH2WhRpJKptM8oB4p7TYiLg1QrljvOlEdORSw6lJnvnhNJaYaGif+CHStobGQ== X-Received: by 2002:a05:6602:2d0a:b0:71c:c276:421c with SMTP id c10-20020a0566022d0a00b0071cc276421cmr13651846iow.3.1675626405933; Sun, 05 Feb 2023 11:46:45 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:45 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 07/11] video: Allow a copy framebuffer with pre-allocated fb Date: Sun, 5 Feb 2023 12:46:23 -0700 Message-Id: <20230205194627.203961-8-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean At present it is not possible for the video driver to use a pre-allocated frame buffer (such as is done with EFI) with the copy framebuffer. This can be useful to speed up the display. Adjust the implementation so that copy_size can be set to the required size, with this being allocated if the normal framebuffer size is 0. Signed-off-by: Simon Glass --- drivers/video/video-uclass.c | 32 ++++++++++++++++++++++++-------- include/video.h | 2 ++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 0b773af2ff3..954ebbce23a 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -78,24 +78,40 @@ void video_set_flush_dcache(struct udevice *dev, bool flush) priv->flush_dcache = flush; } +static ulong alloc_fb_(ulong align, ulong size, ulong *addrp) +{ + ulong base; + + align = align ? align : 1 << 20; + base = *addrp - size; + base &= ~(align - 1); + size = *addrp - base; + *addrp = base; + + return size; +} + static ulong alloc_fb(struct udevice *dev, ulong *addrp) { struct video_uc_plat *plat = dev_get_uclass_plat(dev); - ulong base, align, size; + ulong size; + + if (!plat->size) { + if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->copy_size) { + size = alloc_fb_(plat->align, plat->copy_size, addrp); + plat->copy_base = *addrp; + return size; + } - if (!plat->size) return 0; + } /* Allow drivers to allocate the frame buffer themselves */ if (plat->base) return 0; - align = plat->align ? plat->align : 1 << 20; - base = *addrp - plat->size; - base &= ~(align - 1); - plat->base = base; - size = *addrp - base; - *addrp = base; + size = alloc_fb_(plat->align, plat->size, addrp); + plat->base = *addrp; return size; } diff --git a/include/video.h b/include/video.h index 3f67a93bc93..4d99e5dc27f 100644 --- a/include/video.h +++ b/include/video.h @@ -24,6 +24,7 @@ struct udevice; * @base: Base address of frame buffer, 0 if not yet known * @copy_base: Base address of a hardware copy of the frame buffer. See * CONFIG_VIDEO_COPY. + * @copy_size: Size of copy framebuffer, used if @size is 0 * @hide_logo: Hide the logo (used for testing) */ struct video_uc_plat { @@ -31,6 +32,7 @@ struct video_uc_plat { uint size; ulong base; ulong copy_base; + ulong copy_size; bool hide_logo; }; From patchwork Sun Feb 5 19:46:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737758 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=YOOe606K; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90LK09yHz23fc for ; Mon, 6 Feb 2023 06:48:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 41E188581C; Sun, 5 Feb 2023 20:47:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YOOe606K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 46FFE85776; Sun, 5 Feb 2023 20:47:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 317548577F for ; Sun, 5 Feb 2023 20:46:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id l7so3801938ioa.7 for ; Sun, 05 Feb 2023 11:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vma0PpsEeZc3PYCNOiOJgeLXTHwMd4UHPxTpuIow1BQ=; b=YOOe606K8BAG2/1+XV3vjySAdtHrGDcJb2x72qv+nx+YsWMfz/TyqzdGfVOORHiyOy i53v1nHy+Dr6Zgm6kd8CQA8NTdlvtHnLCIdm/7bHzqwH6FS25mYbH4dzgWbtFD5i+KVd gD8N3ELbiNzdQ0i9krff01g/a97Q22xd+eYhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vma0PpsEeZc3PYCNOiOJgeLXTHwMd4UHPxTpuIow1BQ=; b=aWesVOQ4OLonHAl+qu+E/LcjlMh8aQScedIQ1gFvYzNTUH7Q5Br8SC8cHpDjBD2IPR H469P6yh6YLqgVUxXKWKDRDNRmnaBf/7Wqd0D9B0t29w1S6Td7sKNtDpC+O+Y5A6Nyf/ MLVh+LjfU21tP27x8c2GvgAhdRES5sBWleJ12M+wRub0zwXoarG8oIIgnc1V0szftPDA FUkblxjXc8rDZbNyCN093wopOgEjGo1C6lAv35PoGEeXzcXgfxQ9mFP5kzf6blF6e6gU /Rk5Q6cfEfNxWDJvvh9gkRpJU/KnBsQTSsuek7O7LXYEqFQySJfRUwPpAFYziNfh7iui vUGA== X-Gm-Message-State: AO0yUKWY656we2mHOW2VqVfLqQfJq3IGhSp17yrcFoB1za8zcNOoutOk Evexmvj/ffqL2EvRSNr0SB/8ng8yoy9d1Ww2 X-Google-Smtp-Source: AK7set+/Yz1VU68HB7doVa5/k1KrgwvyjdMEAN/jnraskgiLQXa7dMghT2XNJmB9XjJu8jLWMNcejw== X-Received: by 2002:a5d:8892:0:b0:72a:c7a5:6bdd with SMTP id d18-20020a5d8892000000b0072ac7a56bddmr5713304ioo.2.1675626406691; Sun, 05 Feb 2023 11:46:46 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:46 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 08/11] video: Remove duplicate cursor-positioning function Date: Sun, 5 Feb 2023 12:46:24 -0700 Message-Id: <20230205194627.203961-9-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean There are two functions for positioning the cursor on the console. Remove one of them. Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 44 +++++++------------------------ 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 72a13d30527..9f8b8ebe8ac 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -126,26 +126,14 @@ void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y) priv->ycur = y; } -/** - * set_cursor_position() - set cursor position - * - * @priv: private data of the video console - * @row: new row - * @col: new column - */ -static void set_cursor_position(struct vidconsole_priv *priv, int row, int col) +void vidconsole_position_cursor(struct udevice *dev, uint col, uint row) { - /* - * Ensure we stay in the bounds of the screen. - */ - if (row >= priv->rows) - row = priv->rows - 1; - if (col >= priv->cols) - col = priv->cols - 1; - - priv->ycur = row * priv->y_charsize; - priv->xcur_frac = priv->xstart_frac + - VID_TO_POS(col * priv->x_charsize); + struct vidconsole_priv *priv = dev_get_uclass_priv(dev); + short x, y; + + x = min_t(short, col, priv->cols - 1) * priv->x_charsize; + y = min_t(short, row, priv->rows - 1) * priv->y_charsize; + vidconsole_set_cursor_pos(dev, x, y); } /** @@ -192,7 +180,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) int row = priv->row_saved; int col = priv->col_saved; - set_cursor_position(priv, row, col); + vidconsole_position_cursor(dev, col, row); priv->escape = 0; return; } @@ -254,7 +242,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) if (row < 0) row = 0; /* Right and bottom overflows are handled in the callee. */ - set_cursor_position(priv, row, col); + vidconsole_position_cursor(dev, col, row); break; } case 'H': @@ -278,7 +266,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) if (col) --col; - set_cursor_position(priv, row, col); + vidconsole_position_cursor(dev, col, row); break; } @@ -644,15 +632,3 @@ int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, return vidconsole_sync_copy(dev, dst, dst + size); } #endif - -void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row) -{ - struct vidconsole_priv *priv = dev_get_uclass_priv(dev); - struct udevice *vid_dev = dev->parent; - struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev); - short x, y; - - x = min_t(short, col * priv->x_charsize, vid_priv->xsize - 1); - y = min_t(short, row * priv->y_charsize, vid_priv->ysize - 1); - vidconsole_set_cursor_pos(dev, x, y); -} From patchwork Sun Feb 5 19:46:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737759 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=K8cIRJ7M; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90LY5KNlz23fc for ; Mon, 6 Feb 2023 06:48:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9CACF8590F; Sun, 5 Feb 2023 20:47:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="K8cIRJ7M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5EC0857C1; Sun, 5 Feb 2023 20:47:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1286A8583C for ; Sun, 5 Feb 2023 20:46:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2e.google.com with SMTP id w24so3786595iow.13 for ; Sun, 05 Feb 2023 11:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2zWOI9nYGzMGA7Px2qQEI6kOJ+/If9W5mBHFbfeW01E=; b=K8cIRJ7MkrS+6r/FYg53GJ9wnlKGbSswDgvqCaJDCNB3Q/7K0d3gOx+SgVUzKtB3wC QaZ1eap4XmcECMdQv0giXdMS+E5mTeybnyj4U8BfifHwBSUa5bSwABUJlRtSWSSZzhYD 9S/tvaerLYjgzLwcx6/rZE5Esldl44JflpUXI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2zWOI9nYGzMGA7Px2qQEI6kOJ+/If9W5mBHFbfeW01E=; b=cAm+jzloav7rQdo5eAPK5QSw4Q2etMlGp4kOaBHxW7rBqffEfLFdA4MPVlADpjJwjv e4DWY5Q4mueVoE4Sbp5kllhprUwkXLrc+gSDpakuAr7KrR3ar5WPrqHCap9hvTUNp92R 0+bRW5+TRf+tyumJWOiQLhB5j49zRaqpjbVZZvjCUtlwYrnNN6qECRo5diLGfz0NmUn6 6/jG1ilnwF+dLYOTHFdm+k2L+P8lhcoH51ixgfR5vdc5WO2OzAgQHtNDq1UrGbeCbl1y oiVEeWQGGlEOKA2UE/JCjHUWTFnwiKgmggNqh2BSP7lmGqdzf6ORp7Hkxr1QY2DsUIic wUeA== X-Gm-Message-State: AO0yUKWcjFX8aAj/idYCwgBAZLs8pgsi74S8/FcyQ3ILkCgwQGqWJJST 4R5V9rWxBvMSRGhcliLezwDoxFegqPLycgfe X-Google-Smtp-Source: AK7set9G5vhWeBHV9/Yw40HwOlegVneHj5aln4u8CQY6SUars3fM0XgGt/aDabgJunLccWWnHEw/uA== X-Received: by 2002:a5d:955a:0:b0:71b:3544:887 with SMTP id a26-20020a5d955a000000b0071b35440887mr11158592ios.10.1675626407679; Sun, 05 Feb 2023 11:46:47 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:47 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 09/11] video: Clear the vidconsole rather than the video Date: Sun, 5 Feb 2023 12:46:25 -0700 Message-Id: <20230205194627.203961-10-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean It is better to clear the console device rather than the video device, since the console has the text display. We also need to reset the cursor position with the console, but not with the video device. Add a new function to handle this and update the 'cls' command to use it. Signed-off-by: Simon Glass --- cmd/cls.c | 12 ++++++++---- drivers/video/vidconsole-uclass.c | 12 ++++++++++++ include/video_console.h | 9 +++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/cmd/cls.c b/cmd/cls.c index 40a32eeab63..073ba5a6c86 100644 --- a/cmd/cls.c +++ b/cmd/cls.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #define CSI "\x1b[" @@ -19,12 +19,16 @@ static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc, /* Send clear screen and home */ printf(CSI "2J" CSI "1;1H"); - if (IS_ENABLED(CONFIG_VIDEO) && !IS_ENABLED(CONFIG_VIDEO_ANSI)) { - if (uclass_first_device_err(UCLASS_VIDEO, &dev)) + if (IS_ENABLED(CONFIG_VIDEO_ANSI)) + return 0; + + if (IS_ENABLED(CONFIG_VIDEO)) { + if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; - if (video_clear(dev)) + if (vidconsole_clear_and_reset(dev)) return CMD_RET_FAILURE; } + return CMD_RET_SUCCESS; } diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 9f8b8ebe8ac..1bb36bd66c7 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -632,3 +632,15 @@ int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, return vidconsole_sync_copy(dev, dst, dst + size); } #endif + +int vidconsole_clear_and_reset(struct udevice *dev) +{ + int ret; + + ret = video_clear(dev_get_parent(dev)); + if (ret) + return ret; + vidconsole_position_cursor(dev, 0, 0); + + return 0; +} diff --git a/include/video_console.h b/include/video_console.h index 9d2c0f210e4..aebf1d5eb99 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -276,6 +276,15 @@ int vidconsole_put_string(struct udevice *dev, const char *str); void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row); +/** + * vidconsole_clear_and_reset() - Clear the console and reset the cursor + * + * The cursor is placed at the start of the console + * + * @dev: vidconsole device to adjust + */ +int vidconsole_clear_and_reset(struct udevice *dev); + /** * vidconsole_set_cursor_pos() - set cursor position * From patchwork Sun Feb 5 19:46:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737756 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=h4HhwgeC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90Kn2kkkz23fc for ; Mon, 6 Feb 2023 06:47:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AC87B8578A; Sun, 5 Feb 2023 20:47:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="h4HhwgeC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B87BC8576D; Sun, 5 Feb 2023 20:46:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 12ED385821 for ; Sun, 5 Feb 2023 20:46:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id l128so3811377iof.2 for ; Sun, 05 Feb 2023 11:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NHCRbW50vDYRyz9kMpb6DQsbmv8HP1M2WZv6XOQm/0E=; b=h4HhwgeCWPjGDaqIteD0WYSbM1Pr4icfAhrFVJ+dWVY+FfvIaga2ZzmOjYBvlsisiw /pSTyC0iOvmv8DypnoaxD+TpULXQy8VD5R454KUUmWAJjWDB2+4z8q1D+te0QjiRmZn4 T+Ms3jnAzScvyFP8Q4P/u8Nnn4qAbxungEGzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NHCRbW50vDYRyz9kMpb6DQsbmv8HP1M2WZv6XOQm/0E=; b=HjF26RNvmqyECy6MbDdDH+orO2aWBui6l3HK0DE8+da9UDqlKCUcn/FArM3Mp5LT+c 8W17mBhrUlm52G1JIlxeWcmWNONlcNY1I88W4bXp7SQXvGXiziFAQs5W5yWzYEsukUEP iYIT89oPnHMGjZEpK4s6dtaCNUfAmJXS4IddmQS7HGo5FFhTqd4yVLD2B5NibJNFuvT2 eS2nC6QY6/xzsmhWneSYjTAOnF6ZJUrbow2wse73VH91tEUPtKiRArDBPE/anFCfRq9/ WiEgrR1gnl83VKwIQdRoVKOklVYDV0KD39UV5O043tMzxhpuIDjCGLazUO3q3hHPyRFp 5wqQ== X-Gm-Message-State: AO0yUKWA9ypHR3JhURFsAZbsiyTPLQq3scoUsgcAX2C+mTdnTqjs0cTl dZUl1Y03fT0jQTi70hxd6wvwOMEAKVBrQlsq X-Google-Smtp-Source: AK7set8q9hNbFAz9sVgB/icG75TzCc3+b5zgqZGZsl3ahB8wlWhIRMATXdEMwBLAIoMSy9oiemrziQ== X-Received: by 2002:a5d:8d89:0:b0:712:d45b:858a with SMTP id b9-20020a5d8d89000000b00712d45b858amr7787360ioj.6.1675626408566; Sun, 05 Feb 2023 11:46:48 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:48 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 10/11] efi: Add dhrystone, dcache and scroll lines to app Date: Sun, 5 Feb 2023 12:46:26 -0700 Message-Id: <20230205194627.203961-11-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add these options to provide some performance measurement, see cache status and slightly speed up the appallingly slow console. Signed-off-by: Simon Glass --- configs/efi-x86_app64_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/efi-x86_app64_defconfig b/configs/efi-x86_app64_defconfig index 605d49ff8cb..dae48840493 100644 --- a/configs/efi-x86_app64_defconfig +++ b/configs/efi-x86_app64_defconfig @@ -22,6 +22,7 @@ CONFIG_SYS_PBSIZE=532 # CONFIG_CMD_BOOTM is not set CONFIG_CMD_PART=y # CONFIG_CMD_NET is not set +CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -39,7 +40,9 @@ CONFIG_BOOTFILE="bzImage" CONFIG_USE_ROOTPATH=y CONFIG_REGMAP=y CONFIG_SYSCON=y +CONFIG_CONSOLE_SCROLL_LINES=5 # CONFIG_REGEX is not set +CONFIG_CMD_DHRYSTONE=y # CONFIG_GZIP is not set CONFIG_EFI=y CONFIG_EFI_APP_64BIT=y From patchwork Sun Feb 5 19:46:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1737760 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PX4L9feM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P90Lk672Jz23fc for ; Mon, 6 Feb 2023 06:48:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6AC7F85854; Sun, 5 Feb 2023 20:47:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PX4L9feM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 83BA9857C1; Sun, 5 Feb 2023 20:47:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 924488577F for ; Sun, 5 Feb 2023 20:47:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd35.google.com with SMTP id e2so3794040iot.11 for ; Sun, 05 Feb 2023 11:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/WwMiYp4CFX9X6lx66aApMZsRO85Z0KHVw3rmr9T40k=; b=PX4L9feMo6rS3W4MHLp8EUrEmLWgzIxqEJJ6kRHIBpnJdDr2Q9R9YFVOqJPRavr4ey Yfd7QTNm9cXTDvOiKq7Qe9JimgdOMnqhOL7oG6KFQ41g0+nEVP8ahRhquX0ss6NMbDqX Z1EDej4wiaPPSxpwuDm+D5Lm4qdArpgCs9+PU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/WwMiYp4CFX9X6lx66aApMZsRO85Z0KHVw3rmr9T40k=; b=yZE1GeGUObQlI6AP9tRNp+QWPZWb7TWhzxZd+g5tZw8G4ke+ggh+GmOHIgitwXlNin hz67sK1rZkbsX+Lgb2p1zZ7+5gyt/FzUKPLbYAVt2ClgBllfyfMoxkxyXEbbAXt54hir m+BsVdqUCX5RtdWuXJ+gAExySRIUtyyfD+VWNDDMtOqvqkJNiv/R7Vdv5LpiWRz7w1rr mIyR1md1wPJe6s22p4JD48HKpa6us/tjJxn8OICCWN0kI22BhOcuHavRJuYmXgv5D29U gnKvrWj+CrnANoQWbANn+xG0cyyd1FgNwdIB/KVxsfKq/P1Gm8DkHI8ZA2/77m+ZYLn0 shlQ== X-Gm-Message-State: AO0yUKUtbS980bjHA0szJA68OQ0Z1MHovW7KKa1sSD1cd8EDiJq0NW4W GPb9R823SdtwkP+gIbluA3tHAmxhg6QfK7eU X-Google-Smtp-Source: AK7set+FyXxoHfZRV69xZfn1Fb8yU4QWRlhtL2vgwwotr6Zva7fSC/hgMst8Jec5ao/tAKGCzVnbTg== X-Received: by 2002:a05:6602:2d0a:b0:719:d382:9d7f with SMTP id c10-20020a0566022d0a00b00719d3829d7fmr15097456iow.4.1675626409360; Sun, 05 Feb 2023 11:46:49 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b007219624f89fsm2594282iod.11.2023.02.05.11.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 11:46:49 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Heinrich Schuchardt , Simon Glass Subject: [PATCH 11/11] video: Add a note about the broken implementation Date: Sun, 5 Feb 2023 12:46:27 -0700 Message-Id: <20230205194627.203961-12-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230205194627.203961-1-sjg@chromium.org> References: <20230205194627.203961-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The cls command is broken. Previous discussion about this was at [1] and [2]. For now, add a note to the source code. [1] https://patchwork.ozlabs.org/project/uboot/patch/ 20221022092058.106052-1-heinrich.schuchardt@canonical.com/ [2] https://patchwork.ozlabs.org/project/uboot/patch/ 20230106145243.411626-12-sjg@chromium.org/ Signed-off-by: Simon Glass --- cmd/cls.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/cls.c b/cmd/cls.c index 073ba5a6c86..1125a3f81bb 100644 --- a/cmd/cls.c +++ b/cmd/cls.c @@ -17,7 +17,13 @@ static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc, { __maybe_unused struct udevice *dev; - /* Send clear screen and home */ + /* + * Send clear screen and home + * + * FIXME(Heinrich Schuchardt ): This should go + * through an API and only be written to serial terminals, not video + * displays + */ printf(CSI "2J" CSI "1;1H"); if (IS_ENABLED(CONFIG_VIDEO_ANSI)) return 0;