From: Gabor Juhos <juhosg@openwrt.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 06/10] MIPS: qemu-malta: add PCI support
Date: Thu, 23 May 2013 13:59:57 +0200 [thread overview]
Message-ID: <519E04BD.4030101@openwrt.org> (raw)
In-Reply-To: <CACUy__XNsMfPa3JzPKY6fi4WLh-YMRhgpJHb4tM9cHfwN2uzmQ@mail.gmail.com>
Hi Daniel,
Thank you for the review!
> 2013/5/22 Gabor Juhos <juhosg@openwrt.org>:
>> Qemu emulates the Galileo GT64120 System Controller
>> which provides a CPU bus to PCI bus bridge.
>>
>> The patch adds driver for this bridge and enables
>> PCI support for the emulated Malta board.
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
>
>
> ELDK-5.3 shows some warnings:
>
> pci_indirect.c: In function 'indirect_read_config_byte':
> pci_indirect.c:101:1: warning: implicit declaration of function
> 'out_le32' [-Wimplicit-function-declaration]
> pci_indirect.c:101:1: warning: implicit declaration of function 'in_8'
> [-Wimplicit-function-declaration]
> pci_indirect.c: In function 'indirect_read_config_word':
> pci_indirect.c:102:1: warning: implicit declaration of function
> 'in_le16' [-Wimplicit-function-declaration]
> pci_indirect.c: In function 'indirect_read_config_dword':
> pci_indirect.c:103:1: warning: implicit declaration of function
> 'in_le32' [-Wimplicit-function-declaration]
> pci_indirect.c: In function 'indirect_write_config_byte':
> pci_indirect.c:109:1: warning: implicit declaration of function
> 'out_8' [-Wimplicit-function-declaration]
> pci_indirect.c: In function 'indirect_write_config_word':
> pci_indirect.c:110:1: warning: implicit declaration of function
> 'out_le16' [-Wimplicit-function-declaration]
Hm, you are right. My toolchain also shows the warning but I did not notice
those because I forgot to redirect stderr when I have generated the build logs.
The pci_indirect.c file is always compiled when CONFIG_PCI is defined although
it is not needed at all for Malta PCI support.
The issue can be resolved on a few different ways:
1. Extend the '#if !defined(__I386__)' directive in pci_indirect.c with a new
'&& !defined(__MIPS__)' condition. This would be the simplest solution but the
drawback of this is that indirect support will not be usable on any MIPS board.
2. Introduce a new 'CONFIG_PCI_INDIRECT_BRIDGE' option and only compile the
pci_indirect.c file if this option is present. Probably this is the best
solution however the new symbol should be added into the configuration of the
affected boards.
3. Introduce a new 'CONFIG_PCI_NO_INDIRECT_BRIDGE' option and use an '#ifndef
CONFIG_PCI_NO_INDIRECT_BRIDGE' directive in pci_indirect.c.
I'm unsure about which approach is preferred.
> pci_gt64120.c: In function 'gt64120_pci_init':
> pci_gt64120.c:178:1: warning: control reaches end of non-void function
> [-Wreturn-type]
<snip>
>> +int gt64120_pci_init(void *regs, unsigned long sys_bus, unsigned long sys_phys,
>> + unsigned long sys_size, unsigned long mem_bus,
>> + unsigned long mem_phys, unsigned long mem_size,
>> + unsigned long io_bus, unsigned long io_phys,
>> + unsigned long io_size)
>> +{
>> + static struct gt64120_pci_controller global_gt;
>> + struct gt64120_pci_controller *gt;
>> + struct pci_controller *hose;
>> +
>> + gt = &global_gt;
>> + gt->regs = regs;
>> +
>> + hose = >->hose;
>> +
>> + hose->first_busno = 0;
>> + hose->last_busno = 0;
>> +
>> + /* System memory space */
>> + pci_set_region(&hose->regions[0], sys_bus, sys_phys, sys_size,
>> + PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
>> +
>> + /* PCI memory space */
>> + pci_set_region(&hose->regions[1], mem_bus, mem_phys, mem_size,
>> + PCI_REGION_MEM);
>> +
>> + /* PCI I/O space */
>> + pci_set_region(&hose->regions[2], io_bus, io_phys, io_size,
>> + PCI_REGION_IO);
>> +
>> + hose->region_count = 3;
>> +
>> + pci_set_ops(hose,
>> + pci_hose_read_config_byte_via_dword,
>> + pci_hose_read_config_word_via_dword,
>> + gt_read_config_dword,
>> + pci_hose_write_config_byte_via_dword,
>> + pci_hose_write_config_word_via_dword,
>> + gt_write_config_dword);
>> +
>> + pci_register_hose(hose);
>> + hose->last_busno = pci_hose_scan(hose);
>
> missing return keyword
Correct. However the function never fails, so I will convert it to void instead
of adding a 'return 0;' line.
>
>> +}
-Gabor
next prev parent reply other threads:[~2013-05-23 11:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 13:57 [U-Boot] [PATCH v3 00/10] MIPS: initial support for emulated Malta board Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 01/10] MIPS: qemu-malta: add support for emulated MIPS " Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 02/10] MIPS: qemu-malta: add reset support Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 03/10] MIPS: qemu-malta: enable flash support Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 04/10] MIPS: import gt64120.h header from Linux Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 05/10] MIPS: qemu-malta: setup GT64120 registers as done by YAMON Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 06/10] MIPS: qemu-malta: add PCI support Gabor Juhos
2013-05-22 20:15 ` Daniel Schwierzeck
2013-05-23 11:59 ` Gabor Juhos [this message]
2013-05-23 13:55 ` Daniel Schwierzeck
2013-05-23 15:49 ` Tom Rini
2013-05-24 18:55 ` Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 07/10] net: pcnet: use pci_virt_to_mem to obtain buffer addresses Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 08/10] MIPS: qemu-malta: bring up ethernet Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 09/10] MIPS: bootm.c: add YAMON style Linux preparation/jump code Gabor Juhos
2013-05-22 13:57 ` [U-Boot] [PATCH v3 10/10] MIPS: start.S: emulate REVISION register for qemu-malta Gabor Juhos
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=519E04BD.4030101@openwrt.org \
--to=juhosg@openwrt.org \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox