[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 02/43] hw/mips: Add a bootloader helper
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PULL 02/43] hw/mips: Add a bootloader helper |
Date: |
Sun, 21 Feb 2021 18:30:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/21/21 3:33 PM, Philippe Mathieu-Daudé wrote:
> From: Jiaxun Yang <jiaxun.yang@flygoat.com>
>
> Add a bootloader helper to generate simple bootloaders for kernel.
> It can help us reduce inline hex hack and also keep MIPS release 6
> compatibility easier.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Message-Id: <20210127065424.114125-2-jiaxun.yang@flygoat.com>
> [PMD: Restricted bl_reg enum to C source, inverted bl_gen_write() args]
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/hw/mips/bootloader.h | 14 +++
> hw/mips/bootloader.c | 200 +++++++++++++++++++++++++++++++++++
> hw/mips/meson.build | 2 +-
> 3 files changed, 215 insertions(+), 1 deletion(-)
> create mode 100644 include/hw/mips/bootloader.h
> create mode 100644 hw/mips/bootloader.c
>
> diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h
> new file mode 100644
> index 00000000000..88eb9f49180
> --- /dev/null
> +++ b/include/hw/mips/bootloader.h
> @@ -0,0 +1,14 @@
> +#ifndef HW_MIPS_BOOTLOADER_H
> +#define HW_MIPS_BOOTLOADER_H
Missing license...
> +
> +#include "exec/cpu-defs.h"
> +
> +void bl_gen_jump_to(uint32_t **p, target_ulong jump_addr);
> +void bl_gen_jump_kernel(uint32_t **p, target_ulong sp, target_ulong a0,
> + target_ulong a1, target_ulong a2, target_ulong a3,
> + target_ulong kernel_addr);
> +void bl_gen_write_ulong(uint32_t **p, target_ulong addr, target_ulong val);
> +void bl_gen_write_u32(uint32_t **p, target_ulong addr, uint32_t val);
> +void bl_gen_write_u64(uint32_t **p, target_ulong addr, uint64_t val);
> +
> +#endif
> diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
> new file mode 100644
> index 00000000000..6ec83144909
> --- /dev/null
> +++ b/hw/mips/bootloader.c
> @@ -0,0 +1,200 @@
> +/*
> + * Utility for QEMU MIPS to generate it's simple bootloader
> + *
> + * Instructions used here are carefully selected to keep compatibility with
> + * MIPS Release 6.
> + *
> + * Copyright (C) 2020 Jiaxun Yang <jiaxun.yang@flygoat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
- [PULL 00/43] MIPS patches for 2021-02-21, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 01/43] hw/mips: loongson3: Drop 'struct MemmapEntry', Philippe Mathieu-Daudé, 2021/02/21
- [PULL 02/43] hw/mips: Add a bootloader helper, Philippe Mathieu-Daudé, 2021/02/21
- Re: [PULL 02/43] hw/mips: Add a bootloader helper,
Philippe Mathieu-Daudé <=
- [PULL 03/43] hw/mips/fuloong2e: Use bl_gen_kernel_jump to generate bootloaders, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 05/43] hw/mips/boston: Use bootloader helper to set GCRs, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 06/43] hw/intc/loongson_liointc: Fix per core ISR handling, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 07/43] tests/acceptance: Test PMON with Loongson-3A1000 CPU, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 08/43] target/mips: fetch code with translator_ld, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 04/43] hw/mips/boston: Use bl_gen_kernel_jump to generate bootloaders, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 09/43] target/mips: Remove access_type argument from map_address() handler, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 10/43] target/mips: Remove access_type argument from get_seg_physical_address, Philippe Mathieu-Daudé, 2021/02/21
- [PULL 11/43] target/mips: Remove access_type arg from get_segctl_physical_address(), Philippe Mathieu-Daudé, 2021/02/21
- [PULL 12/43] target/mips: Remove access_type argument from get_physical_address(), Philippe Mathieu-Daudé, 2021/02/21