qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] hw/mips: Add a bootloader helper


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/5] hw/mips: Add a bootloader helper
Date: Mon, 7 Dec 2020 19:27:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

On 12/7/20 7:14 PM, Philippe Mathieu-Daudé wrote:
> Hi Jiaxun,
> 
> On 12/7/20 6:02 AM, Jiaxun Yang wrote:
>> 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.
> 
> Great idea :)
> 
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>>  hw/mips/bootloader.c      | 150 ++++++++++++++++++++++++++++++++++++++
>>  hw/mips/meson.build       |   2 +-
>>  include/hw/mips/cpudevs.h |   8 ++
>>  3 files changed, 159 insertions(+), 1 deletion(-)
>>  create mode 100644 hw/mips/bootloader.c
...
>> +void bl_gen_writeq(uint32_t **p, uint64_t val, uint32_t addr)
> 
> Well, addr has to be uint64_t... else you wrap KSEG1 on 64-bit.

Oops I misread addr/val.

> 
> bl_gen_write_u64?
> 
>> +{
>> +    /* 64 Only */
> 
>        if (!cpu_supports_isa(cpu, ISA_MIPS64)) {
>            g_assert_not_reached(); /* unsupported */
>        }
> 
>> +    bl_gen_dli(p, 26, val);
>> +    bl_gen_li(p, 27, addr);
>> +    bl_gen_sd(p, 26, 27, 0x0);
>> +}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]