All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] hw/mips/fuloong2e fixes
@ 2020-12-16  2:25 Jiaxun Yang
  2020-12-16  2:25 ` [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

It can now boot Debian installer[1].
I'm going to add acceptance test for it later.

Thanks.

Jiaxun Yang (7):
  hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT
  hw/mips/fuloong2e: Relpace fault links
  hw/pci-host/bonito: Fixup IRQ mapping
  hw/pci-host/bonito: Fixup pci.lomem mapping
  hw/mips/fuloong2e: Remove unused env entry
  hw/mips/fuloong2e: Correct cpuclock env
  hw/mips/fuloong2e: Add highmem support

 hw/mips/fuloong2e.c  | 68 ++++++++++++++++++++++++++++----------------
 hw/pci-host/bonito.c | 45 +++++++----------------------
 2 files changed, 54 insertions(+), 59 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
@ 2020-12-16  2:25 ` Jiaxun Yang
  2020-12-16 16:49   ` Philippe Mathieu-Daudé
  2020-12-16  2:25 ` [PATCH 2/7] hw/mips/fuloong2e: Relpace fault links Jiaxun Yang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

Seems useless....

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/fuloong2e.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 9b0eb8a314..055b99e378 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -48,8 +48,6 @@
 #include "sysemu/reset.h"
 #include "qemu/error-report.h"
 
-#define DEBUG_FULOONG2E_INIT
-
 #define ENVP_PADDR              0x2000
 #define ENVP_VADDR              cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR)
 #define ENVP_NB_ENTRIES         16
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/7] hw/mips/fuloong2e: Relpace fault links
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
  2020-12-16  2:25 ` [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
@ 2020-12-16  2:25 ` Jiaxun Yang
  2020-12-16  2:25 ` [PATCH 3/7] hw/pci-host/bonito: Fixup IRQ mapping Jiaxun Yang
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

Websites are downing, but GitHub may last forever.
Loongson even doesn't recogonize 2E as their products nowadays..

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/fuloong2e.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 055b99e378..a5b75b230a 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -14,8 +14,8 @@
  * Fuloong 2e mini pc is based on ICT/ST Loongson 2e CPU (MIPS III like, 800MHz)
  * https://www.linux-mips.org/wiki/Fuloong_2E
  *
- * Loongson 2e user manual:
- * http://www.loongsondeveloper.com/doc/Loongson2EUserGuide.pdf
+ * Loongson 2e manuals:
+ * https://github.com/loongson-community/docs/tree/master/2E
  */
 
 #include "qemu/osdep.h"
@@ -61,14 +61,7 @@
  * PMON is not part of qemu and released with BSD license, anyone
  * who want to build a pmon binary please first git-clone the source
  * from the git repository at:
- * http://www.loongson.cn/support/git/pmon
- * Then follow the "Compile Guide" available at:
- * http://dev.lemote.com/code/pmon
- *
- * Notes:
- * 1, don't use the source at http://dev.lemote.com/http_git/pmon.git
- * 2, use "Bonito2edev" to replace "dir_corresponding_to_your_target_hardware"
- * in the "Compile Guide".
+ * https://github.com/loongson-community/pmon-2ef
  */
 #define FULOONG_BIOSNAME "pmon_2e.bin"
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/7] hw/pci-host/bonito: Fixup IRQ mapping
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
  2020-12-16  2:25 ` [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
  2020-12-16  2:25 ` [PATCH 2/7] hw/mips/fuloong2e: Relpace fault links Jiaxun Yang
@ 2020-12-16  2:25 ` Jiaxun Yang
  2020-12-16  2:25 ` [PATCH 4/7] hw/pci-host/bonito: Fixup pci.lomem mapping Jiaxun Yang
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

Accroading to arch/mips/pci/fixup-fuloong2e.c in kernel,
despites south bridge IRQs needs special care, all other
IRQ pins are mapped by 'LOONGSON_IRQ_BASE + 25 + pin'.

As south bridge IRQs are all handled by ISA bus, we can simply
remove BONITO_IRQ_BASE and direct map IRQs here.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/pci-host/bonito.c | 28 +++++-----------------------
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index a99eced065..43b79448a9 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -546,19 +546,16 @@ static const MemoryRegionOps bonito_spciconf_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-#define BONITO_IRQ_BASE 32
-
 static void pci_bonito_set_irq(void *opaque, int irq_num, int level)
 {
     BonitoState *s = opaque;
     qemu_irq *pic = s->pic;
     PCIBonitoState *bonito_state = s->pci_dev;
-    int internal_irq = irq_num - BONITO_IRQ_BASE;
 
-    if (bonito_state->regs[BONITO_INTEDGE] & (1 << internal_irq)) {
+    if (bonito_state->regs[BONITO_INTEDGE] & (1 << irq_num)) {
         qemu_irq_pulse(*pic);
     } else {   /* level triggered */
-        if (bonito_state->regs[BONITO_INTPOL] & (1 << internal_irq)) {
+        if (bonito_state->regs[BONITO_INTPOL] & (1 << irq_num)) {
             qemu_irq_raise(*pic);
         } else {
             qemu_irq_lower(*pic);
@@ -566,25 +563,10 @@ static void pci_bonito_set_irq(void *opaque, int irq_num, int level)
     }
 }
 
-/* map the original irq (0~3) to bonito irq (16~47, but 16~31 are unused) */
-static int pci_bonito_map_irq(PCIDevice *pci_dev, int irq_num)
+/* PCI slots IRQ pins started from 25 */
+static int pci_bonito_map_irq(PCIDevice *pci_dev, int pin)
 {
-    int slot;
-
-    slot = (pci_dev->devfn >> 3);
-
-    switch (slot) {
-    case 5:   /* FULOONG2E_VIA_SLOT, SouthBridge, IDE, USB, ACPI, AC97, MC97 */
-        return irq_num % 4 + BONITO_IRQ_BASE;
-    case 6:   /* FULOONG2E_ATI_SLOT, VGA */
-        return 4 + BONITO_IRQ_BASE;
-    case 7:   /* FULOONG2E_RTL_SLOT, RTL8139 */
-        return 5 + BONITO_IRQ_BASE;
-    case 8 ... 12: /* PCI slot 1 to 4 */
-        return (slot - 8 + irq_num) + 6 + BONITO_IRQ_BASE;
-    default:  /* Unknown device, don't do any translation */
-        return irq_num;
-    }
+    return 25 + pin;
 }
 
 static void bonito_reset(void *opaque)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/7] hw/pci-host/bonito: Fixup pci.lomem mapping
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
                   ` (2 preceding siblings ...)
  2020-12-16  2:25 ` [PATCH 3/7] hw/pci-host/bonito: Fixup IRQ mapping Jiaxun Yang
@ 2020-12-16  2:25 ` Jiaxun Yang
  2020-12-16  2:31 ` [PATCH 5/7] hw/mips/fuloong2e: Remove unused env entry Jiaxun Yang
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

The original mapping had wrong base address.
Fix by correct the base adress and merge three alias into
a single.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/pci-host/bonito.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 43b79448a9..3a31ba42f2 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -608,7 +608,7 @@ static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
 {
     PCIHostState *phb = PCI_HOST_BRIDGE(dev);
     BonitoState *bs = BONITO_PCI_HOST_BRIDGE(dev);
-    MemoryRegion *pcimem_lo_alias = g_new(MemoryRegion, 3);
+    MemoryRegion *pcimem_lo_alias = g_new(MemoryRegion, 1);
 
     memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem", BONITO_PCIHI_SIZE);
     phb->bus = pci_register_root_bus(dev, "pci",
@@ -616,16 +616,11 @@ static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
                                      dev, &bs->pci_mem, get_system_io(),
                                      0x28, 32, TYPE_PCI_BUS);
 
-    for (size_t i = 0; i < 3; i++) {
-        char *name = g_strdup_printf("pci.lomem%zu", i);
-
-        memory_region_init_alias(&pcimem_lo_alias[i], NULL, name,
-                                 &bs->pci_mem, i * 64 * MiB, 64 * MiB);
-        memory_region_add_subregion(get_system_memory(),
-                                    BONITO_PCILO_BASE + i * 64 * MiB,
-                                    &pcimem_lo_alias[i]);
-        g_free(name);
-    }
+    memory_region_init_alias(pcimem_lo_alias, OBJECT(dev), "pci.lomem",
+                             &bs->pci_mem, BONITO_PCILO_BASE,
+                             BONITO_PCILO_SIZE);
+    memory_region_add_subregion(get_system_memory(), BONITO_PCILO_BASE,
+                                pcimem_lo_alias);
 
     create_unimplemented_device("pci.io", BONITO_PCIIO_BASE, 1 * MiB);
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/7] hw/mips/fuloong2e: Remove unused env entry
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
                   ` (3 preceding siblings ...)
  2020-12-16  2:25 ` [PATCH 4/7] hw/pci-host/bonito: Fixup pci.lomem mapping Jiaxun Yang
@ 2020-12-16  2:31 ` Jiaxun Yang
  2020-12-16  2:31 ` [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env Jiaxun Yang
  2020-12-16  2:31 ` [PATCH 7/7] hw/mips/fuloong2e: Add highmem support Jiaxun Yang
  6 siblings, 0 replies; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

modetty and busclock is not handled by kernel and the parameter
here seems unreasonable.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/fuloong2e.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index a5b75b230a..256c7867e4 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -159,10 +159,8 @@ static uint64_t load_kernel(CPUMIPSState *env)
     }
 
     /* Setup minimum environment variables */
-    prom_set(prom_buf, index++, "busclock=33000000");
     prom_set(prom_buf, index++, "cpuclock=100000000");
     prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB);
-    prom_set(prom_buf, index++, "modetty0=38400n8r");
     prom_set(prom_buf, index++, NULL);
 
     rom_add_blob_fixed("prom", prom_buf, prom_size, ENVP_PADDR);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
                   ` (4 preceding siblings ...)
  2020-12-16  2:31 ` [PATCH 5/7] hw/mips/fuloong2e: Remove unused env entry Jiaxun Yang
@ 2020-12-16  2:31 ` Jiaxun Yang
  2020-12-16 16:55   ` Philippe Mathieu-Daudé
  2020-12-16  2:31 ` [PATCH 7/7] hw/mips/fuloong2e: Add highmem support Jiaxun Yang
  6 siblings, 1 reply; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

It should be 533080000.
See clock_set_hz.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/fuloong2e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 256c7867e4..af2d259dc4 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -159,7 +159,7 @@ static uint64_t load_kernel(CPUMIPSState *env)
     }
 
     /* Setup minimum environment variables */
-    prom_set(prom_buf, index++, "cpuclock=100000000");
+    prom_set(prom_buf, index++, "cpuclock=533080000");
     prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB);
     prom_set(prom_buf, index++, NULL);
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] hw/mips/fuloong2e: Add highmem support
  2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
                   ` (5 preceding siblings ...)
  2020-12-16  2:31 ` [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env Jiaxun Yang
@ 2020-12-16  2:31 ` Jiaxun Yang
  6 siblings, 0 replies; 10+ messages in thread
From: Jiaxun Yang @ 2020-12-16  2:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenhuacai, f4bug, Jiaxun Yang

highmem started from 0x20000000.
Now we can have up to 2G RAM.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/fuloong2e.c | 49 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 39 insertions(+), 10 deletions(-)

diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index af2d259dc4..dec6ac3b13 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -56,6 +56,7 @@
 /* Fuloong 2e has a 512k flash: Winbond W39L040AP70Z */
 #define BIOS_SIZE               (512 * KiB)
 #define MAX_IDE_BUS             2
+#define HIGHMEM_START           0x20000000
 
 /*
  * PMON is not part of qemu and released with BSD license, anyone
@@ -71,7 +72,8 @@
 #define FULOONG2E_RTL8139_SLOT    7
 
 static struct _loaderparams {
-    int ram_size;
+    int ram_low_size;
+    int ram_high_size;
     const char *kernel_filename;
     const char *kernel_cmdline;
     const char *initrd_filename;
@@ -128,14 +130,14 @@ static uint64_t load_kernel(CPUMIPSState *env)
         initrd_size = get_image_size(loaderparams.initrd_filename);
         if (initrd_size > 0) {
             initrd_offset = ROUND_UP(kernel_high, INITRD_PAGE_SIZE);
-            if (initrd_offset + initrd_size > loaderparams.ram_size) {
+            if (initrd_offset + initrd_size > loaderparams.ram_low_size) {
                 error_report("memory too small for initial ram disk '%s'",
                              loaderparams.initrd_filename);
                 exit(1);
             }
             initrd_size = load_image_targphys(loaderparams.initrd_filename,
                                               initrd_offset,
-                                              loaderparams.ram_size - initrd_offset);
+                                              loaderparams.ram_low_size - initrd_offset);
         }
         if (initrd_size == (target_ulong) -1) {
             error_report("could not load initial ram disk '%s'",
@@ -160,7 +162,11 @@ static uint64_t load_kernel(CPUMIPSState *env)
 
     /* Setup minimum environment variables */
     prom_set(prom_buf, index++, "cpuclock=533080000");
-    prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB);
+    prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_low_size / MiB);
+    if (loaderparams.ram_high_size > 0) {
+            prom_set(prom_buf, index++, "highmemsize=%"PRIi64,
+                    loaderparams.ram_high_size / MiB);
+    }
     prom_set(prom_buf, index++, NULL);
 
     rom_add_blob_fixed("prom", prom_buf, prom_size, ENVP_PADDR);
@@ -186,7 +192,7 @@ static void write_bootloader(CPUMIPSState *env, uint8_t *base,
     p = (uint32_t *)(base + 0x040);
 
     bl_gen_jump_kernel(&p, ENVP_VADDR - 64, 2, ENVP_VADDR,
-                       ENVP_VADDR + 8, loaderparams.ram_size,
+                       ENVP_VADDR + 8, loaderparams.ram_low_size,
                        kernel_addr);
 }
 
@@ -258,8 +264,11 @@ static void mips_fuloong2e_init(MachineState *machine)
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
+    ram_addr_t ram_low_size, ram_high_size = 0;
     char *filename;
     MemoryRegion *address_space_mem = get_system_memory();
+    MemoryRegion *ram_low_alias = g_new(MemoryRegion, 1);
+    MemoryRegion *ram_high_alias;
     MemoryRegion *bios = g_new(MemoryRegion, 1);
     long bios_size;
     uint8_t *spd_data;
@@ -282,12 +291,31 @@ static void mips_fuloong2e_init(MachineState *machine)
 
     qemu_register_reset(main_cpu_reset, cpu);
 
-    /* TODO: support more than 256M RAM as highmem */
-    if (machine->ram_size != 256 * MiB) {
-        error_report("Invalid RAM size, should be 256MB");
+    if (machine->ram_size > 2 * GiB) {
+        error_report("Too much memory for this machine: %" PRId64 "MB,"
+                     " maximum 2048MB", machine->ram_size / MiB);
         exit(EXIT_FAILURE);
     }
-    memory_region_add_subregion(address_space_mem, 0, machine->ram);
+
+    ram_low_size = MIN(machine->ram_size, 256 * MiB);
+
+    memory_region_init_alias(ram_low_alias, NULL,
+                            "ram_low_alias",
+                            machine->ram, 0,
+                            ram_low_size);
+    memory_region_add_subregion(address_space_mem, 0,
+                                ram_low_alias);
+ 
+    if (machine->ram_size > 256 * MiB) {
+        ram_high_alias = g_new(MemoryRegion, 1);
+        ram_high_size = machine->ram_size - ram_low_size;
+        memory_region_init_alias(ram_high_alias, NULL,
+                                "ram_high_alias",
+                                machine->ram, ram_low_size,
+                                ram_high_size);
+        memory_region_add_subregion(address_space_mem, HIGHMEM_START,
+                                    ram_high_alias);
+    }
 
     /* Boot ROM */
     memory_region_init_rom(bios, NULL, "fuloong2e.bios", BIOS_SIZE,
@@ -300,7 +328,8 @@ static void mips_fuloong2e_init(MachineState *machine)
      */
 
     if (kernel_filename) {
-        loaderparams.ram_size = machine->ram_size;
+        loaderparams.ram_low_size = ram_low_size;
+        loaderparams.ram_high_size = ram_high_size;
         loaderparams.kernel_filename = kernel_filename;
         loaderparams.kernel_cmdline = kernel_cmdline;
         loaderparams.initrd_filename = initrd_filename;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT
  2020-12-16  2:25 ` [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
@ 2020-12-16 16:49   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-16 16:49 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel; +Cc: chenhuacai

On 12/16/20 3:25 AM, Jiaxun Yang wrote:
> Seems useless....

Indeed, introduced in 051c190bce5 ("MIPS: Initial support of
fulong mini pc (machine construction)") but never used.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>  hw/mips/fuloong2e.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
> index 9b0eb8a314..055b99e378 100644
> --- a/hw/mips/fuloong2e.c
> +++ b/hw/mips/fuloong2e.c
> @@ -48,8 +48,6 @@
>  #include "sysemu/reset.h"
>  #include "qemu/error-report.h"
>  
> -#define DEBUG_FULOONG2E_INIT
> -
>  #define ENVP_PADDR              0x2000
>  #define ENVP_VADDR              cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR)
>  #define ENVP_NB_ENTRIES         16
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env
  2020-12-16  2:31 ` [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env Jiaxun Yang
@ 2020-12-16 16:55   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-16 16:55 UTC (permalink / raw)
  To: Jiaxun Yang, qemu-devel; +Cc: chenhuacai

On 12/16/20 3:31 AM, Jiaxun Yang wrote:
> It should be 533080000.
> See clock_set_hz.

Missed in 3ca7639ff00 ("hw/mips/fuloong2e: Set CPU frequency
to 533 MHz").

> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>  hw/mips/fuloong2e.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
> index 256c7867e4..af2d259dc4 100644
> --- a/hw/mips/fuloong2e.c
> +++ b/hw/mips/fuloong2e.c
> @@ -159,7 +159,7 @@ static uint64_t load_kernel(CPUMIPSState *env)
>      }
>  
>      /* Setup minimum environment variables */
> -    prom_set(prom_buf, index++, "cpuclock=100000000");
> +    prom_set(prom_buf, index++, "cpuclock=533080000");

Actually it should be "cpuclock=%u" of clock_get_hz(cpuclk).

>      prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size / MiB);
>      prom_set(prom_buf, index++, NULL);
>  
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-12-16 17:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  2:25 [PATCH 0/7] hw/mips/fuloong2e fixes Jiaxun Yang
2020-12-16  2:25 ` [PATCH 1/7] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
2020-12-16 16:49   ` Philippe Mathieu-Daudé
2020-12-16  2:25 ` [PATCH 2/7] hw/mips/fuloong2e: Relpace fault links Jiaxun Yang
2020-12-16  2:25 ` [PATCH 3/7] hw/pci-host/bonito: Fixup IRQ mapping Jiaxun Yang
2020-12-16  2:25 ` [PATCH 4/7] hw/pci-host/bonito: Fixup pci.lomem mapping Jiaxun Yang
2020-12-16  2:31 ` [PATCH 5/7] hw/mips/fuloong2e: Remove unused env entry Jiaxun Yang
2020-12-16  2:31 ` [PATCH 6/7] hw/mips/fuloong2e: Correct cpuclock env Jiaxun Yang
2020-12-16 16:55   ` Philippe Mathieu-Daudé
2020-12-16  2:31 ` [PATCH 7/7] hw/mips/fuloong2e: Add highmem support Jiaxun Yang

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.