From patchwork Wed Oct 16 15:46:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 835811 Delivered-To: patch@linaro.org Received: by 2002:a5d:6804:0:b0:37d:45d0:187 with SMTP id w4csp504853wru; Wed, 16 Oct 2024 08:47:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXl3YRBi4QrJ6MVq7M1I+pM91cbQQ1leT21mET3B4TQUe+AMGuBEaiO3h3HbIr8LvywSN5iag==@linaro.org X-Google-Smtp-Source: AGHT+IEBnVpiy2wu9ToVhz+V0lywmz/rPVvgDsA1G4XZqmLzeGNwqgIUiclAF3zuNLFIc86h36TO X-Received: by 2002:a6b:7a42:0:b0:82c:ec0f:a081 with SMTP id ca18e2360f4ac-83aadea1164mr569939f.4.1729093634858; Wed, 16 Oct 2024 08:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729093634; cv=none; d=google.com; s=arc-20240605; b=gZFX5OhqECh7kAi/sXH+10V6zkdMjuIsNpE4fpC3fdmlfH2eoiCqv0PEFw3jWcYBsz 3B3ttpZTa9bQc1UGzhjZ3bUI1IymIYaxIirGHTSXctOKNV7fYsjFAxZzUP/WEqoCE4O5 WeJ+MRpevLmPksOnmXsCcrdfGlraTho0qzVrxgqpNsGNjakjaAWnAlR6Rb1kb1+KtgwM qd7ksAJs11F51Q6+QEQAe3f2IiUxu+MrjjzN6iIUF5dGXIdL8hRJf/qfCWxO6KibDtwE V9JfNngssNDtBw/im6rgkl+aa+nHgDGIiQPPYBoHVL3a8+FlYw3wmApTnB1qV+h9xN/U jf/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=PMW3yg5/p4yI0H1hypV4NS4mBNeYrwpqtQgL+0Ly950=; fh=NEOAR4uguMrgWPhuh2zChp0mpOq28Pgd8ssVAjKWZpI=; b=I5zHtJPutSTNE5a6z+egY5HMlgzRx1ZtV3yGs4NJYpeN2Mm/rGBCfn+10Wh5+Sx1CR VbQA2eE6xOOUyf0cy1zygQS6qRcZiSGiFVghds9HjhEGkL1gKXWTOv4Xvz7GDPyYGetx 2qXCB5lkZI491S/c2VfSjhUID8mC30yWWI2zOeX9oIXFFupSVjxSRRKKz3HPe4mDR3ZZ g/eJ1DBmdG/BmrNlf4YqRRwtdxPX0j7YkR/rXJeL9Vnxqv7ZTGm0dMwauG9SCqOUP1BY xALtbcXUFK3lgqBEqnkUjkfJogVhgqtLrzgInQaPZ+2s06cRsAgHFd2JyfV1tLaiZJph CqyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PhkZQGh5; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ca18e2360f4ac-83a8b20fcc1si179491639f.17.2024.10.16.08.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 08:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PhkZQGh5; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 227E488D7E; Wed, 16 Oct 2024 17:47:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PhkZQGh5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3736988C05; Wed, 16 Oct 2024 17:47:02 +0200 (CEST) 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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 43C1188D14 for ; Wed, 16 Oct 2024 17:47:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-37d538fe5f2so3981270f8f.2 for ; Wed, 16 Oct 2024 08:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729093620; x=1729698420; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PMW3yg5/p4yI0H1hypV4NS4mBNeYrwpqtQgL+0Ly950=; b=PhkZQGh5F0SMy3WKHADdS9BxkgPhhR48ulzejIVRvMUxM1NqlEP/BIZvS9vqVhdT1W wG2ARljgpifOulm4yejySdUdWJ96MifiioIAaE8Q+RFVqpvxSMrhMRw6QTXIPBAOP00Y YON2+PJ8IP60ouMU1fJ8qsDwtCuG6LAX0HsgSLxHfY2MrkVPkwmspdX0mj5I71UMENM0 2l7tsySh7FxRGYDUyf/XKMccB6xNlw7LuA11E/6LV8PBmg2LBESm4DRGWC98FXq+2/nr qzcygYPxqUsvHdBO1PiiO5n5OeoL+vvDJrSHOstIARTDZ/YP4uDnSd+aIW8cK5wROSMc Mbqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729093620; x=1729698420; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PMW3yg5/p4yI0H1hypV4NS4mBNeYrwpqtQgL+0Ly950=; b=qV38rBwU057L/Z+4mmZb/402Oj6UN4PsH5BWYob69L2vimQxdn2y3ytvGZMHUkCZJP kEG7Tgc2RVOkiWEzM5Fzn3iNsp5aKFpiDm/fpn3dm3MtBoQXprw/hGhWBa9OWty3GEYa G4ZnY9GqbadGdDGxXOGn/aa3Met/93ejc6cMELy+uOEkjUGfigCzM9ubFoYhNFoQ3va/ Uq5ZLZpHFc983y9xrc14ZQmx030+82jAjSR/dx1qOUiaJsTuEJ7uMNe0JtAdIOxEK8LH wGs0fziLwM56o82mbJa2G5nOkUMT71Mbl7rSVl5qvF7JzkeZcgH1+Mn6BznuQ5Gom9E4 8QKw== X-Forwarded-Encrypted: i=1; AJvYcCVBEL1dykp9Y9cscIXp0AnCkKqd8FK2PZMoGEVbVnMVTZbKF07QfPrYNmkluaG1UnUZe2nWVm0=@lists.denx.de X-Gm-Message-State: AOJu0YyzHmsHSss6s/8HYWAAJ5yCwoXP2wiZhJn7Ts5Xo6Zs0iTsq+Lh D4oJV3vWbHSJRzWogfWntYaGhQboyi8zKOEei3M0Up3htvyxQl1VTmQ4BNg6Zoo= X-Received: by 2002:a5d:6e43:0:b0:37d:4d80:34ae with SMTP id ffacd0b85a97d-37d5519873emr13218544f8f.4.1729093619684; Wed, 16 Oct 2024 08:46:59 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4314a6fbb77sm37767315e9.14.2024.10.16.08.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 08:46:59 -0700 (PDT) From: Neil Armstrong Date: Wed, 16 Oct 2024 17:46:48 +0200 Subject: [PATCH 1/3] image: android: use ulong for kernel address MIME-Version: 1.0 Message-Id: <20241016-topic-fastboot-fixes-mkbootimg-v1-1-94fd9340722b@linaro.org> References: <20241016-topic-fastboot-fixes-mkbootimg-v1-0-94fd9340722b@linaro.org> In-Reply-To: <20241016-topic-fastboot-fixes-mkbootimg-v1-0-94fd9340722b@linaro.org> To: Tom Rini Cc: Mattijs Korpershoek , Guillaume La Roque , Caleb Connolly , u-boot-qcom@groups.io, u-boot@lists.denx.de, Neil Armstrong X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1790; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=MwJtIiuhsW2BMluGpsaSc56K536Ikm+rTmqQvN50x28=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnD9/wQTxZlfZj5BQHNIKBEgFYSL7K6Kr4NNGZAu9j /J8/y9iJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZw/f8AAKCRB33NvayMhJ0Q+WEA C7g4KTERIHDqa3Fhu6ZIk0ywKJJD0/igBeZK0y7HsblovM8cYYokkBBVLObfj06MFfxcQYrtzeXuoZ gdDG9opw1yFhPjhWUWkuzjUNHwg3jfPkdbNdE+YSqZOi/bfKughB2n+yf3N9zoUpxFk6Xau2WK1Dpg gY03+DFfdcZteyBqMKLDgWxGMmQGwDxAMA18C0kzNWU1Ed39fWjwTVB1a7EgetBgdpZkO5nk1e/MTA +dMmEMFHboI3VMH24Qr1b3kyDKUfS6r1Ki/2aJnAJRCPELVNOA01OfORFLF1iGUhbmG00tWWUWpa8o rYt2kHXk1TK8GlNmwr8MS+0W/A9dtIB8o5UA4ALH2ZFHsXKCwmifKftv6fqM9BP9QQYPYTBd+biPr1 pcFLTkNgEcJ7VvAwIa0sPDQlLuku72IsTJuvjuNqENB7+VEZSlcS/h0lQLkVNOZ6w2ySiPDAk1vbzl oKYFdktfV85HbQxOiDNGx0Pse58EmUhx8W3Alc6PqxcTSh2FnpnrkoWpjDAdF5X1SOeL5Po/0Gd9uf KDohSi8cyPd6CVq41kbsFFWhjBnjtKaQjIUj2aLOAz814oxEy+XNeXC+CUuZmgHoa4SkZs8PCG1uJ6 C3SNaP+UDTsIkBag+qkFYMBA6h+f5qgw8wWUCE04W4WQqgetFio5oHIf0l5w== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE 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.8 at phobos.denx.de X-Virus-Status: Clean When booting with platforms having > 4GiB of memory, the kernel physical address can be more than 32bits. Use ulong like all the other addresses, and fix the print to show the > 32bits address numbers. Signed-off-by: Neil Armstrong --- boot/image-android.c | 4 ++-- include/android_image.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/boot/image-android.c b/boot/image-android.c index e74dd498a30..bb5f4f84487 100644 --- a/boot/image-android.c +++ b/boot/image-android.c @@ -256,7 +256,7 @@ int android_image_get_kernel(const void *hdr, ulong *os_data, ulong *os_len) { struct andr_image_data img_data = {0}; - u32 kernel_addr; + ulong kernel_addr; const struct legacy_img_hdr *ihdr; if (!android_image_get_data(hdr, vendor_boot_img, &img_data)) @@ -275,7 +275,7 @@ int android_image_get_kernel(const void *hdr, if (strlen(andr_tmp_str)) printf("Android's image name: %s\n", andr_tmp_str); - printf("Kernel load addr 0x%08x size %u KiB\n", + printf("Kernel load addr 0x%08lx size %u KiB\n", kernel_addr, DIV_ROUND_UP(img_data.kernel_size, 1024)); int len = 0; diff --git a/include/android_image.h b/include/android_image.h index d503c980b23..96820709b42 100644 --- a/include/android_image.h +++ b/include/android_image.h @@ -348,7 +348,7 @@ struct andr_image_data { ulong bootconfig_addr; /* bootconfig image address */ ulong bootconfig_size; /* bootconfig image size */ - u32 kernel_addr; /* physical load addr */ + ulong kernel_addr; /* physical load addr */ ulong ramdisk_addr; /* physical load addr */ ulong ramdisk_ptr; /* ramdisk address */ ulong dtb_load_addr; /* physical load address for DTB image */