From: Aurelien Jarno <aurelien@aurel32.net>
To: Serge Vakulenko <serge.vakulenko@gmail.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH pic32 v2 4/5] Two new processor variants: M4K and microAptivP.
Date: Wed, 1 Jul 2015 15:37:32 +0200 [thread overview]
Message-ID: <20150701133732.GA8793@aurel32.net> (raw)
In-Reply-To: <3e0f5249da1e943da65e0cea0f907a1c7bc3271a.1435723168.git.serge.vakulenko@gmail.com>
On 2015-06-30 21:12, Serge Vakulenko wrote:
> Signed-off-by: Serge Vakulenko <serge.vakulenko@gmail.com>
> ---
> target-mips/cpu.h | 2 ++
> target-mips/translate_init.c | 46 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 48 insertions(+)
>
> diff --git a/target-mips/cpu.h b/target-mips/cpu.h
> index ab830ee..9f5890c 100644
> --- a/target-mips/cpu.h
> +++ b/target-mips/cpu.h
> @@ -394,6 +394,7 @@ struct CPUMIPSState {
> #define CP0C0_M 31
> #define CP0C0_K23 28
> #define CP0C0_KU 25
> +#define CP0C0_SB 21
Bits in the range 16:24 are implementation specific, so I do wonder if
we want to have this bit there. At least we should mark it as
implementation specific.
> #define CP0C0_MDU 20
> #define CP0C0_MM 17
> #define CP0C0_BM 16
> @@ -479,6 +480,7 @@ struct CPUMIPSState {
> #define CP0C5_NFExists 0
> int32_t CP0_Config6;
> int32_t CP0_Config7;
> +#define CP0C7_WII 31
Same as above, Config6 and Config7 are implementation dependent.
> /* XXX: Maybe make LLAddr per-TC? */
> uint64_t lladdr;
> target_ulong llval;
> diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c
> index ddfaff8..430a547 100644
> --- a/target-mips/translate_init.c
> +++ b/target-mips/translate_init.c
> @@ -232,6 +232,52 @@ static const mips_def_t mips_defs[] =
> .mmu_type = MMU_TYPE_FMT,
> },
> {
> + /* Configuration for Microchip PIC32MX microcontroller. */
> + .name = "M4K",
> + .CP0_PRid = 0x00018765,
> + .CP0_Config0 = MIPS_CONFIG0 | (2 << CP0C0_K23) | (2 << CP0C0_KU) |
> + (1 << CP0C0_SB) | (1 << CP0C0_BM) |
> + (1 << CP0C0_AR) | (MMU_TYPE_FMT << CP0C0_MT),
> + .CP0_Config1 = (1U << CP0C1_M) | (1 << CP0C1_CA) | (1 << CP0C1_EP),
> + .CP0_Config2 = MIPS_CONFIG2,
> + .CP0_Config3 = (1 << CP0C3_VEIC) | (1 << CP0C3_VInt),
> + .CP0_LLAddr_rw_bitmask = 0,
> + .CP0_LLAddr_shift = 4,
> + .SYNCI_Step = 32,
> + .CCRes = 2,
> + .CP0_Status_rw_bitmask = 0x1258FF17,
> + .SEGBITS = 32,
> + .PABITS = 32,
> + .insn_flags = CPU_MIPS32R2 | ASE_MIPS16,
> + .mmu_type = MMU_TYPE_FMT,
> + },
> + {
> + /* Configuration for Microchip PIC32MZ microcontroller. */
> + .name = "microAptivP",
> + .CP0_PRid = 0x00019e28,
> + .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) |
> + (MMU_TYPE_R4000 << CP0C0_MT),
> + .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | (1 << CP0C1_PC),
> + .CP0_Config2 = MIPS_CONFIG2,
> + .CP0_Config3 = (1 << CP0C3_M) | (1 << CP0C3_IPLW) | (1 << CP0C3_MCU) |
> + (2 << CP0C3_ISA) | (1 << CP0C3_ULRI) | (1 << CP0C3_RXI) |
> + (1 << CP0C3_DSP2P) | (1 << CP0C3_DSPP) | (1 << CP0C3_VEIC) |
> + (1 << CP0C3_VInt),
DSP and DSPr2 are enabled here...
> + .CP0_Config4 = (1 << CP0C4_M),
> + .CP0_Config5 = (1 << CP0C5_NFExists),
> + .CP0_Config6 = 0,
> + .CP0_Config7 = (1 << CP0C7_WII),
> + .CP0_LLAddr_rw_bitmask = 0,
> + .CP0_LLAddr_shift = 4,
> + .SYNCI_Step = 32,
> + .CCRes = 2,
> + .CP0_Status_rw_bitmask = 0x1278FF17,
> + .SEGBITS = 32,
> + .PABITS = 32,
> + .insn_flags = CPU_MIPS32R2,
so I guess you want to enable ASE_DSP and ASE_DSPR2 here.
> + .mmu_type = MMU_TYPE_R4000,
> + },
> + {
> .name = "24Kc",
> .CP0_PRid = 0x00019300,
> .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) |
Otherwise it looks ok, though I haven't look at the PIC32 manual to
check the values.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2015-07-01 13:37 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 4:12 [Qemu-devel] [PATCH pic32 v2 0/5] Support for Microchip pic32mx7 and pic32mz microcontrollers Serge Vakulenko
[not found] ` <cover.1435723168.git.serge.vakulenko@gmail.com>
2015-07-01 4:12 ` [Qemu-devel] [PATCH pic32 v2 1/5] Speed of MIPS CPU timer made configurable per platform Serge Vakulenko
2015-07-01 10:02 ` Aurelien Jarno
2015-07-05 23:25 ` Serge Vakulenko
2015-07-06 8:31 ` Aurelien Jarno
2015-07-01 4:12 ` [Qemu-devel] [PATCH pic32 v2 2/5] Fixed random index generation for TLBWR instruction. It was not quite random and did not skip Wired entries Serge Vakulenko
2015-07-01 10:11 ` Aurelien Jarno
2015-07-03 21:39 ` Maciej W. Rozycki
2015-07-06 0:16 ` Serge Vakulenko
2015-07-06 0:03 ` Serge Vakulenko
2015-07-06 8:32 ` Aurelien Jarno
2015-07-02 7:52 ` Antony Pavlov
2015-07-06 0:06 ` Serge Vakulenko
2015-07-01 4:12 ` [Qemu-devel] [PATCH pic32 v2 3/5] Added support for external interrupt controller (EIC) mode Serge Vakulenko
2015-07-01 11:07 ` Aurelien Jarno
2015-07-06 3:05 ` Serge Vakulenko
2015-07-06 3:31 ` Serge Vakulenko
2015-07-06 9:31 ` Aurelien Jarno
2015-07-06 9:28 ` Aurelien Jarno
2015-07-01 4:12 ` [Qemu-devel] [PATCH pic32 v2 4/5] Two new processor variants: M4K and microAptivP Serge Vakulenko
2015-07-01 13:37 ` Aurelien Jarno [this message]
2015-07-03 22:04 ` Maciej W. Rozycki
2015-07-06 4:15 ` Serge Vakulenko
2015-07-06 3:48 ` Serge Vakulenko
2015-07-06 8:40 ` Aurelien Jarno
2015-07-01 4:12 ` [Qemu-devel] [PATCH pic32 v2 5/5] Two new machine platforms: pic32mz7 and pic32mz Serge Vakulenko
2015-07-01 13:41 ` Aurelien Jarno
2015-07-06 4:18 ` Serge Vakulenko
2015-07-06 7:33 ` Antony Pavlov
2015-07-06 18:58 ` Serge Vakulenko
2015-07-06 21:43 ` Peter Crosthwaite
2015-07-07 7:30 ` Antony Pavlov
2015-07-07 14:08 ` Aurelien Jarno
2015-07-02 5:56 ` Antony Pavlov
2015-07-06 4:27 ` Serge Vakulenko
2015-07-06 7:55 ` Antony Pavlov
2015-07-02 5:31 ` [Qemu-devel] [PATCH pic32 v2 0/5] Support for Microchip pic32mx7 and pic32mz microcontrollers Antony Pavlov
2015-07-06 0:39 ` Serge Vakulenko
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=20150701133732.GA8793@aurel32.net \
--to=aurelien@aurel32.net \
--cc=leon.alrae@imgtec.com \
--cc=qemu-devel@nongnu.org \
--cc=serge.vakulenko@gmail.com \
/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.