> On Sep 13, 2017, at 3:34 AM, Thomas Huth <h...@tuxfamily.org> wrote:
> 
> On 12.09.2017 21:05, William Mahoney wrote:
>> OK a bit of an update and another question or two. First, you’re right, “it 
>> just plain works”. What I’d like to verify today is that I am “doing the 
>> right thing” is all. 
>> 
>> 1) I made a copy of qemu/hw/m68k/mcf5208.c as mcf5282.c and I - for now - 
>> changed all 5208 to 5282 inside the source. Threw in some fprintfs while I 
>> was at it.
>> 
>> 2) Added mcf5282.o to the Makefile.objs that is in that directory.
> 
> That sounds right.

You do have to do a configure again because it needs to update all the 
dependencies - minor thing. 

>> 3) Went into emu/target/m68k/cpu.c and duplicated (with a name change) the 
>> init function for the 5208, then added the 5282 (currently named 
>> “m5282-bill”) to the list of m68k_cpus. Took a bit of grepping. 
> 
> I think that's likely the right thing to do ... but I currently wonder
> whether we really want to have a duplicate entry for each of the MCF
> variants, or rather a generic ColdFire V2 core instead (we already have
> a generic "cfv4e" for V4, for example). So the "cfv2" core could be
> shared between the mcf5208evb and the mcf5282evb machine …?

Let’s see if I can get a few things to work… I haven’t quite decided 100% to 
work on it, to be perfectly honest. I need to compare the 5208 and 5282 first 
to see what’s needed and I haven’t had time yet.

By the way, there is a link to a uClinux image on the emu documentation pages 
but the link times out. Is there a uClinux 5208 kernel image somewhere else? I 
only wanted to try that to make sure that everything else (serial ports) is set 
up, etc.

>> Now I can do 'qemu-system-m68k -cpu m5282-bill -bios /tmp/mybios’ and it 
>> stops (gdb) at the init function in my 5282 with everything set and ready to 
>> rock and roll.
> 
> You likely still ended up with the m5208 machine here. You've got to
> select the right machine with "-M mcf5282evb", too. Please also make
> sure to remove the "mc->is_default = 1" line from your new machine
> (since we likely do not want to change the default machine).

Yep. I discovered this after posting the note. Also, it was puzzling for a 
while because cpu.c wants to call the init function for all the machines listed 
in the table, one after the other, so it init’s the 5208 and then inits the 
5282, then selects the 5282 as the default (for the very reason you pointed 
out). This is as far as I got with it yesterday and it’ll be a bit before I can 
get back to it.

>> So after all this description, just a simple question. Is this “how you are 
>> supposed to do it”, in general? There’s no master list of dependencies I 
>> needed to update, or a Makefile I need to change, or… ? As long as I do 
>> another configure to let it know the dependencies, that’s pretty much it, 
>> right? Just wanting to do it the correct way for future use.
> 
> Right, adding your new board to hw/m68k/Makefile.objs should be
> sufficient here.

Cool. 

> 
> Thomas

Reply via email to