From patchwork Mon Jan 13 19:55:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856942 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1601058wrc; Mon, 13 Jan 2025 11:56:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVVL7l/Kef3QWK+hpoj15//aChyLVf2IYOYKELWy0y82vC4BW/C5AfjMBqVdgKLeBq8WqOmMA==@linaro.org X-Google-Smtp-Source: AGHT+IHlyY3nkF7zhagozRxFFqBAjFQEimAj0zeQidkqNGWR5BJ/GULdWSB+ELvla7RXKnTaXkFo X-Received: by 2002:a05:622a:c5:b0:467:6283:3c9d with SMTP id d75a77b69052e-46c710032fdmr408791461cf.13.1736798205364; Mon, 13 Jan 2025 11:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736798205; cv=none; d=google.com; s=arc-20240605; b=hsIwEYzr4/5FUGIiAvyoFa0ttKrJvvJhU7jGqO8bm3+qoj51ydERMTSoys/NYMuCvE d7/3qC5VLqvO3cYCI3iFKCbCbabFaEVqpLT/QnC7508DgvVqa2lsQPq1UsWRveEzZJw3 gS8dRCeeuFj042RUNXABXjc1mQwd3bVH5wX2OcyhAQiyjHwETT6eZfQaWLw9WjqVtx9f 6hyMRUhZ6/FwAWXuKYKmxoiv9M5CA/toInlTceIyrgG7Zri9Ejijugv7uUBCZTF5W7cB 95b7FRBs/KFlc+pyyTLYZEBHZGPN4omrClrxg2nPaGZ35FVCSQx8F+nrGJw6m61yZGl8 w1Sw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TyQ/od43vNMa0q6wCQy5fR9/uoB2I9o4Ue/+fqk0SAo=; fh=wMwPlu6s3WDa+luMUca6ONpSmNJKUwF5E3uCFeq1PI4=; b=jH6UBMz+icOwh3/uEktfcJakEtUkhvgnPeC3C6+ca8Yyujt89oDNcQjSbVdOo9k79n UZFGGy7EQVuRqXmP8y71XD8QSOWh+4wG94f4I5RoHcTOlZwHr0s+Olxl+HcJ/gjvTajO Z5xh7D/WliA7ahPxElIgQawdzEyov2xLRUNRVtBRT+2vyzXmnSo4tewa5rCBmMpb+FBK SnbjDTGn9XZ2TVJQIlxIYznVi8clOExEhbsSfcFl3hNKqr/ZUpKFoSO7VmmCxsgVzGld hRB4gYzivQ5rS/2biH16G0VzY8v6g8BCiUWMaB9i3E0CgmSlBbCt7hsicmQ/L5aMlzKo 6KvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ehqSbI4u; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873310f7si105192361cf.4.2025.01.13.11.56.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jan 2025 11:56:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ehqSbI4u; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXQY4-0006HE-7o; Mon, 13 Jan 2025 14:56:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXQXq-0006Ez-5c for qemu-devel@nongnu.org; Mon, 13 Jan 2025 14:56:18 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXQXo-0007Tp-CO for qemu-devel@nongnu.org; Mon, 13 Jan 2025 14:56:17 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso2522618f8f.3 for ; Mon, 13 Jan 2025 11:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736798174; x=1737402974; darn=nongnu.org; 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=TyQ/od43vNMa0q6wCQy5fR9/uoB2I9o4Ue/+fqk0SAo=; b=ehqSbI4u8qpOqm9Rs2y1bk39pYtzRIOnQeOHb9hopjxZRrSjXaYRjx7yJexBgjPU1h S3T5jvOvCGo7BslQfa1saH0Y4/x+So3rztMkdDnjT1zUegAfPChuSJ5A6WpvOj80Q/VO LaysfMqKmXxpxkLBocaT9imvAObpsbIpyT/3YnY56nWPoXivIfh2XWag2ceLe3Qxe6jA IZoS2FuOJf/7r1f+L7AHKRzuGQ4y4mK0tWCfBmT2GZXz23q9PfahM2GdoFsnTFnHwPpo e9GXcU1ItWk9Z69CcUyRves62YLSdWyeaKmAhXRXRljhSBdVTAgxdRu8iAP+GHKLReQN NoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736798174; x=1737402974; 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=TyQ/od43vNMa0q6wCQy5fR9/uoB2I9o4Ue/+fqk0SAo=; b=u0v0sN+1p7JY05AQcehF7MkuYWrpwYh55G1O9vx3MpmbDvF37M1x79O4ZjgPzE7jiu TsvSyvYl7K6IdiNxHVRYyr/1tNSv4b/27uejKkOYaglbH3o8qX0vh7onZVhYefZ2iJyi e88H/l6M/ThFswwmK3McLCQEjNKKtQ5WKYWdQsxBYtwmN+rfYjm4c7Cml0JIJjNz4xDI bzysWBj94LG68oS+EN0/65UUX88GE1iknY2tWMFbmxftr7sFS7Bvels4raIVqrQqAuz1 me9YHxoHx9N6MNMFqpl/OA5EjYZpkLwJjVrvR2GHXM1AYdWM2m2D0PP56l02wWPRrhV/ Vrgg== X-Gm-Message-State: AOJu0YzSlfrEYwn9K3GXq4cjMFFl2F776hj/RnFFFRBKTdtsl+c+6c4/ 8a39fT3YePwaKtyWoMY7ps5tAA9DzGFcGVLSEo4hY5duheMcJLU9deTUU2yQ5mCGqcA4BMQZRYV HjX0= X-Gm-Gg: ASbGncvsM4PRLlfjUK8Ig/Zz61sStMgaY3uZlSfEtciVhkn/TT62/If3pZgWOouWSh4 2t+egmfvoXbUoDcfOCkn6TdqcpdtWW0ngu/EP0A0rIxZt+2exbgbRYX6tIlN0ql2Rpx+xHZgJHx 3gd5Bfj/x8MsvRKTbUXg6Ffgd/wDr9tlqHRXntck1z5TX2ehpxPeW+XFDvUDhZoZZUtUox/8TRt TeIY4hwGhNSbFXSe7begqPzltqpbqh9limmqklBGab3naOoU5NIrEycI712gIwf1uwj1D2BWkQt CvCb25gHoggVaaUV2MVaacoLqtXc8Bk= X-Received: by 2002:a5d:47c4:0:b0:385:f69a:7e5f with SMTP id ffacd0b85a97d-38a87308ae0mr24633188f8f.38.1736798173175; Mon, 13 Jan 2025 11:56:13 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38d008sm13296048f8f.59.2025.01.13.11.56.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 11:56:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paul Burton , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Huacai Chen Subject: [PATCH v2 09/19] hw/mips/bootloader: Document public API Date: Mon, 13 Jan 2025 20:55:15 +0100 Message-ID: <20250113195525.57150-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113195525.57150-1-philmd@linaro.org> References: <20250113195525.57150-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Document bl_gen_write_u[32,64,long]() and bl_gen_jump_[to,kernel]() prototypes. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/mips/bootloader.h | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h index c32f6c28356..8533a16ca62 100644 --- a/include/hw/mips/bootloader.h +++ b/include/hw/mips/bootloader.h @@ -11,7 +11,30 @@ #include "exec/cpu-defs.h" +/** + * bl_gen_jump_to: Generate bootloader code to jump to an address + * + * @ptr: Pointer to buffer where to write the bootloader code + * @jump_addr: Address to jump to + */ void bl_gen_jump_to(void **ptr, target_ulong jump_addr); + +/** + * bl_gen_jump_kernel: Generate bootloader code to jump to a Linux kernel + * + * @ptr: Pointer to buffer where to write the bootloader code + * @set_sp: Whether to set $sp register + * @set_a0: Whether to set $a0 register + * @set_a1: Whether to set $a1 register + * @set_a2: Whether to set $a2 register + * @set_a3: Whether to set $a3 register + * @sp: Value to set $sp to if @set_sp is set + * @a0: Value to set $a0 to if @set_a0 is set + * @a1: Value to set $a0 to if @set_a1 is set + * @a2: Value to set $a0 to if @set_a2 is set + * @a3: Value to set $a0 to if @set_a3 is set + * @kernel_addr: Start address of the kernel to jump to + */ void bl_gen_jump_kernel(void **ptr, bool set_sp, target_ulong sp, bool set_a0, target_ulong a0, @@ -19,8 +42,35 @@ void bl_gen_jump_kernel(void **ptr, bool set_a2, target_ulong a2, bool set_a3, target_ulong a3, target_ulong kernel_addr); + +/** + * bl_gen_write_ulong: Generate bootloader code to write an unsigned long + * value at an address + * + * @ptr: Pointer to buffer where to write the bootloader code + * @addr: Address to write to + * @val: Value to write at @addr + */ void bl_gen_write_ulong(void **ptr, target_ulong addr, target_ulong val); + +/** + * bl_gen_write_u32: Generate bootloader code to write a 32-bit unsigned + * value at an address + * + * @ptr: Pointer to buffer where to write the bootloader code + * @addr: Address to write to + * @val: Value to write at @addr + */ void bl_gen_write_u32(void **ptr, target_ulong addr, uint32_t val); + +/** + * bl_gen_write_u64: Generate bootloader code to write a 64-bit unsigned + * value at an address + * + * @ptr: Pointer to buffer where to write the bootloader code + * @addr: Address to write to + * @val: Value to write at @addr + */ void bl_gen_write_u64(void **ptr, target_ulong addr, uint64_t val); #endif