All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v6 02/15] target-tricore: Add board for systemmode
Date: Fri, 29 Aug 2014 20:00:23 +0100	[thread overview]
Message-ID: <5400CDC7.1030601@mail.uni-paderborn.de> (raw)
In-Reply-To: <CAFEAcA-T2dU7eZG=DX19CnH86cjbO3Tr7tD9=fa-OZL0HWV_=w@mail.gmail.com>

Hi Peter,

On 08/29/2014 03:30 PM, Peter Maydell wrote:
>
>> +
>> +    dinfo = drive_get(IF_PFLASH, 0, 0);
>> +    if (!pflash_cfi01_register(TRICORE_FLASH_ADDR, NULL,
>> +                          "tricore_testboard.flash",
>> +                          TRICORE_FLASH_SIZE, dinfo ? dinfo->bdrv : NULL,
>> +                          TRICORE_FLASH_SECT_SIZE,
>> +                          TRICORE_FLASH_SIZE / TRICORE_FLASH_SECT_SIZE,
>> +                          2, 0x00, 0x00, 0x0000, 0x0, 0)) {
> Don't use pflash_cfi01_register() in new code, it gives you a
> weird not-like-hardware flash device that we only have for
> backwards compatibility with existing board models. Instantiate
> and configure the flash device directly (compare vexpress.c's
> ve_pflash_cfi01_register(), but use the correct config for the
> hardware you're modelling, which might not be two parallel
> 16 bit wide flash chips).

This board does not exists. It's purpose is just to be able to run 
TriCore binaries. So I rather just get rid of the flash drive.
>> +    }
>> +
>> +    tricoretb_binfo.ram_size = machine->ram_size;
>> +    tricoretb_binfo.kernel_filename = machine->kernel_filename;
>> +
>> +    if (machine->kernel_filename) {
>> +        tricore_load_kernel(env);
>> +    }
>> +}
>> +
>> +static void tricoreboard_init(MachineState *machine)
>> +{
>> +    tricore_testboard_init(machine, 0x183);
>> +}
>> +
>> +static QEMUMachine ttb_machine = {
>> +    .name = "tricore_testboard",
>> +    .desc = "Just for testing",
>> +    .init = tricoreboard_init,
>> +    .is_default = 1,
>> +};
> The .desc text here appears in the user-visible help output, so
> can we have something slightly more useful to them, please?
>
> $ ./build/all/tricore-softmmu/qemu-system-tricore -M help
> Supported machines are:
> tricore_testboard    Just for testing (default)
> none                 empty machine

Same as above. The description shows exactly the board's purpose. It is 
just for testing and not a real board. How about I change it to "a 
minimal TriCore board"?
I see your point about the default. For now I would leave it as is, 
since there are not other boards and qemu would give an error, when 
launched without -M.

> Also, think about whether you really want to set the
> is_default flag. Will all users of TriCore based boards
> always want the test board?
>
>> +++ b/include/hw/tricore/tricore.h
>> @@ -0,0 +1,54 @@
>> +#ifndef TRICORE_MISC_H
>> +#define TRICORE_MISC_H 1
>> +
>> +#include "exec/memory.h"
>> +#include "hw/irq.h"
>> +
>> +struct tricore_boot_info {
>> +    uint64_t ram_size;
>> +    const char *kernel_filename;
>> +    const char *kernel_cmdline;
>> +    const char *initrd_filename;
>> +    const char *dtb_filename;
>> +    hwaddr loader_start;
>> +    /* multicore boards that use the default secondary core boot functions
>> +     * need to put the address of the secondary boot code, the boot reg,
>> +     * and the GIC address in the next 3 values, respectively. boards that
>> +     * have their own boot functions can use these values as they want.
>> +     */
>> +    hwaddr smp_loader_start;
>> +    hwaddr smp_bootreg_addr;
>> +    hwaddr gic_cpu_if_addr;
>> +    int nb_cpus;
>> +    int board_id;
>> +    int (*atag_board)(const struct tricore_boot_info *info, void *p);
>> +    /* multicore boards that use the default secondary core boot functions
>> +     * can ignore these two function calls. If the default functions won't
>> +     * work, then write_secondary_boot() should write a suitable blob of
>> +     * code mimicking the secondary CPU startup process used by the board's
>> +     * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
>> +     * perform any necessary CPU reset handling and set the PC for the
>> +     * secondary CPUs to point at this boot blob.
>> +     */
>> +    void (*write_secondary_boot)(TRICORECPU *cpu,
>> +                                 const struct tricore_boot_info *info);
>> +    void (*secondary_cpu_reset_hook)(TRICORECPU *cpu,
>> +                                     const struct tricore_boot_info *info);
>> +    /* if a board is able to create a dtb without a dtb file then it
>> +     * sets get_dtb. This will only be used if no dtb file is provided
>> +     * by the user. On success, sets *size to the length of the created
>> +     * dtb, and returns a pointer to it. (The caller must free this memory
>> +     * with g_free() when it has finished with it.) On failure, returns NULL.
>> +     */
>> +    void *(*get_dtb)(const struct tricore_boot_info *info, int *size);
>> +    /* if a board needs to be able to modify a device tree provided by
>> +     * the user it should implement this hook.
>> +     */
>> +    void (*modify_dtb)(const struct tricore_boot_info *info, void *fdt);
>> +    /* Used internally by arm_boot.c */
>> +    int is_linux;
>> +    hwaddr initrd_start;
>> +    hwaddr initrd_size;
>> +    hwaddr entry;
>> +};
> This looks pretty obviously like you just copied it wholesale from
> the ARM board support code. Please only include struct fields
> you actually use.
>
> thanks
> -- PMM
>

Thanks,
Bastian

  reply	other threads:[~2014-08-29 17:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 16:52 [Qemu-devel] [PATCH v6 00/15] TriCore architecture guest implementation Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 01/15] target-tricore: Add target stubs and qom-cpu Bastian Koppelmann
2014-08-29 14:18   ` Peter Maydell
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 02/15] target-tricore: Add board for systemmode Bastian Koppelmann
2014-08-29 14:30   ` Peter Maydell
2014-08-29 19:00     ` Bastian Koppelmann [this message]
2014-08-29 18:08       ` Peter Maydell
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 03/15] target-tricore: Add softmmu support Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 04/15] target-tricore: Add initialization for translation and activate target Bastian Koppelmann
2014-08-29 14:33   ` Peter Maydell
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 05/15] target-tricore: Add masks and opcodes for decoding Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 06/15] target-tricore: Add instructions of SRC opcode format Bastian Koppelmann
2014-08-22 20:57   ` Richard Henderson
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 07/15] target-tricore: Add instructions of SRR " Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 08/15] target-tricore: Add instructions of SSR " Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 09/15] target-tricore: Add instructions of SRRS and SLRO " Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 10/15] target-tricore: Add instructions of SB " Bastian Koppelmann
2014-08-22 20:59   ` Richard Henderson
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 11/15] target-tricore: Add instructions of SBC and SBRN " Bastian Koppelmann
2014-08-22 21:08   ` Richard Henderson
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 12/15] target-tricore: Add instructions of SBR " Bastian Koppelmann
2014-08-22 21:06   ` Richard Henderson
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 13/15] target-tricore: Add instructions of SC " Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 14/15] target-tricore: Add instructions of SLR, SSRO and SRO " Bastian Koppelmann
2014-08-22 16:52 ` [Qemu-devel] [PATCH v6 15/15] target-tricore: Add instructions of SR " Bastian Koppelmann
2014-08-22 21:08   ` Richard Henderson
2014-08-26 19:48 ` [Qemu-devel] [PATCH v6 00/15] TriCore architecture guest implementation Richard Henderson
2014-08-29 14:39   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5400CDC7.1030601@mail.uni-paderborn.de \
    --to=kbastian@mail.uni-paderborn.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.