[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] q800: implement mac rom reset function for BIOS-less mode
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] q800: implement mac rom reset function for BIOS-less mode |
Date: |
Thu, 2 Jan 2020 12:41:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 |
Le 02/01/2020 à 12:10, Laurent Vivier a écrit :
> Le 02/01/2020 à 11:36, Jason A. Donenfeld a écrit :
>> On Linux, calling `reboot(RB_AUTOBOOT);` will result in
>> arch/m68k/mac/misc.c's mac_reset function being called. That in turn
>> looks at the rombase (or uses 0x40800000 is there's no rombase), adds
>> 0xa, and jumps to that address. At the moment, there's nothing there, so
>> the kernel just crashes when trying to reboot. So, this commit adds a
>> very simple implementation at that location, which just writes to via2
>> to power down.
>>
>> Signed-off-by: Jason A. Donenfeld <address@hidden>
>> ---
>
> There are two cleaners solution to do that:
> 1- catch the jump to the ROM address in QEMU and shutdown the machine, see
>
> https://github.com/vivier/qemu-m68k/commit/51cd57d1128059819038b9800455fbf794430c15
>
> 2- or as you do, write a fake ROM but use the VIA2 port B bit 3 to
> shutdown the machine see hw/misc/mac_via.c mos6522_q800_via2_portB_write().
OK, 2 is what you do, so I think we can take this.
The assembly code is correct but not easy to read, could you use defined
values (VIA_BASE) and add some comments?
I think we don't need the BI_MAC_ROMBASE: in fact MACROM_ADDR is wrong,
you can change its definition to 0x40800000.
Thanks,
Laurent