All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: chenhuacai@kernel.org, wainersm@redhat.com, crosa@redhat.com
Subject: Re: [PATCH v2 4/8] hw/pci-host/bonito: Fixup pci.lomem mapping
Date: Tue, 22 Dec 2020 08:36:04 +0800	[thread overview]
Message-ID: <1089c6a2-e446-9312-4edb-090a6ae8bf72@flygoat.com> (raw)
In-Reply-To: <05d6819c-67dd-9275-e9df-1a26baf807ee@amsat.org>

在 2020/12/22 上午4:45, Philippe Mathieu-Daudé 写道:
> On 12/19/20 8:18 AM, Jiaxun Yang wrote:
>> The original mapping had wrong base address.
>> Fix by correct the base adress and merge three alias into
>> a single.
> Why merge? Beside, typo "address".


Hi Philippe,

Thanks for your reviewing!

Because I can't understand why it was in three pieces.
I was just trying to do what kernel as I don't have much knowledge with
Fuloong2E.

The kernel treated PCI region as a whole part[1] at 0x10000000 with size
0x0c000000.

It fixed long lasting radeonfb starting failure.

>
>> 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);
> Why is your pci_mem mapped at 0?

It is actually started at 0x10000000.

As: #define BONITO_PCILO_BASE       0x10000000


Thanks.

[1]: 
https://elixir.bootlin.com/linux/latest/source/arch/mips/loongson2ef/common/pci.c

- Jiaxun
>
>> +    memory_region_add_subregion(get_system_memory(), BONITO_PCILO_BASE,
>> +                                pcimem_lo_alias);
>>   
>>       create_unimplemented_device("pci.io", BONITO_PCIIO_BASE, 1 * MiB);
>>   }
>>



  reply	other threads:[~2020-12-22  0:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-19  7:12 [PATCH v2 0/8] hm/mips/fuloong2e fixes Jiaxun Yang
2020-12-19  7:12 ` [PATCH v2 1/8] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
2020-12-22  0:26   ` Huacai Chen
2020-12-19  7:12 ` [PATCH v2 2/8] hw/mips/fuloong2e: Relpace fault links Jiaxun Yang
2020-12-19 17:52   ` Philippe Mathieu-Daudé
2020-12-22  0:30     ` Huacai Chen
2020-12-19  7:18 ` [PATCH v2 3/8] hw/pci-host/bonito: Fixup IRQ mapping Jiaxun Yang
2020-12-21 21:06   ` Philippe Mathieu-Daudé
2020-12-19  7:18 ` [PATCH v2 4/8] hw/pci-host/bonito: Fixup pci.lomem mapping Jiaxun Yang
2020-12-21 20:45   ` Philippe Mathieu-Daudé
2020-12-22  0:36     ` Jiaxun Yang [this message]
2020-12-22 12:13       ` Philippe Mathieu-Daudé
2020-12-19  7:21 ` [PATCH v2 5/8] hw/mips/fuloong2e: Remove unused env entry Jiaxun Yang
2020-12-22  0:27   ` Huacai Chen
2020-12-22 14:42   ` Philippe Mathieu-Daudé
2020-12-19  7:21 ` [PATCH v2 6/8] hw/mips/fuloong2e: Correct cpuclock env Jiaxun Yang
2020-12-19 18:22   ` Philippe Mathieu-Daudé
2020-12-22  0:28     ` Huacai Chen
2020-12-19  7:23 ` [PATCH v2 7/8] hw/mips/fuloong2e: Add highmem support Jiaxun Yang
2020-12-19 19:02   ` Philippe Mathieu-Daudé
2020-12-21 20:34   ` Philippe Mathieu-Daudé
2020-12-22  1:13     ` Huacai Chen
2020-12-19  7:23 ` [PATCH v2 8/8] tests/acceptance: Test boot_linux_console for fuloong2e Jiaxun Yang
2020-12-19 18:57   ` Philippe Mathieu-Daudé
2020-12-21 21:17   ` Wainer dos Santos Moschetta
2020-12-21 21:35   ` Willian Rampazzo
2020-12-22  0:24     ` Huacai Chen
2020-12-19 12:13 ` [PATCH v2 0/8] hm/mips/fuloong2e fixes BALATON Zoltan via
2020-12-19 12:37   ` Jiaxun Yang
2020-12-19 16:03     ` BALATON Zoltan via
2020-12-21  9:52       ` Gerd Hoffmann

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=1089c6a2-e446-9312-4edb-090a6ae8bf72@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhuacai@kernel.org \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.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.