]> xenbits.xensource.com Git - people/sstabellini/qemu-dm.git/.git/commitdiff
MIPS: Initial support of fulong mini pc (CPU definition)
authorHuacai Chen <zltjiangshi@gmail.com>
Tue, 29 Jun 2010 02:50:27 +0000 (10:50 +0800)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 29 Jun 2010 21:07:52 +0000 (23:07 +0200)
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips/mips-defs.h
target-mips/translate_init.c

index a7f46974e3f6c134e73411c93954d3e3cb7419f4..bf094a3bd556e32410636a6b6ef70cd1b3fd680a 100644 (file)
@@ -41,6 +41,8 @@
 #define        ASE_MICROMIPS   0x00080000
 
 /* Chip specific instructions. */
+#define                INSN_LOONGSON2E  0x20000000
+#define                INSN_LOONGSON2F  0x40000000
 #define                INSN_VR54XX     0x80000000
 
 /* MIPS CPU defines. */
@@ -49,6 +51,8 @@
 #define                CPU_MIPS3       (CPU_MIPS2 | ISA_MIPS3)
 #define                CPU_MIPS4       (CPU_MIPS3 | ISA_MIPS4)
 #define                CPU_VR54XX      (CPU_MIPS4 | INSN_VR54XX)
+#define                CPU_LOONGSON2E  (CPU_MIPS3 | INSN_LOONGSON2E)
+#define                CPU_LOONGSON2F  (CPU_MIPS3 | INSN_LOONGSON2F)
 
 #define                CPU_MIPS5       (CPU_MIPS4 | ISA_MIPS5)
 
index b79ed568047bc57610f1a67873358860ba5497e1..0d9899e1bd314bd6027419ec72f4f88b64dedb20 100644 (file)
@@ -454,6 +454,41 @@ static const mips_def_t mips_defs[] =
         .insn_flags = CPU_MIPS64R2 | ASE_MIPS3D,
         .mmu_type = MMU_TYPE_R4000,
     },
+    {
+        .name = "Loongson-2E",
+        .CP0_PRid = 0x6302,
+        /*64KB I-cache and d-cache. 4 way with 32 bit cache line size*/
+        .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) | (0x1<<5) |
+                       (0x1<<4) | (0x1<<1),
+        /* Note: Config1 is only used internally, Loongson-2E has only Config0. */
+        .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU),
+        .SYNCI_Step = 16,
+        .CCRes = 2,
+        .CP0_Status_rw_bitmask = 0x35D0FFFF,
+        .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x1 << FCR0_REV),
+        .SEGBITS = 40,
+        .PABITS = 40,
+        .insn_flags = CPU_LOONGSON2E,
+        .mmu_type = MMU_TYPE_R4000,
+    },
+    {
+      .name = "Loongson-2F",
+      .CP0_PRid = 0x6303,
+      /*64KB I-cache and d-cache. 4 way with 32 bit cache line size*/
+      .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) | (0x1<<5) |
+                     (0x1<<4) | (0x1<<1),
+      /* Note: Config1 is only used internally, Loongson-2F has only Config0. */
+      .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU),
+      .SYNCI_Step = 16,
+      .CCRes = 2,
+      .CP0_Status_rw_bitmask = 0xF5D0FF1F,   /*bit5:7 not writeable*/
+      .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x1 << FCR0_REV),
+      .SEGBITS = 40,
+      .PABITS = 40,
+      .insn_flags = CPU_LOONGSON2F,
+      .mmu_type = MMU_TYPE_R4000,
+    },
+
 #endif
 };