From: Donald White <dbwhite@asu.edu>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Please explain this code in drivers/pci.c
Date: Mon, 19 May 2003 17:47:08 -0700 [thread overview]
Message-ID: <3EC97B0C.3050705@asu.edu> (raw)
In-Reply-To: 9F5558593173D21190EA0008C7B17698731384@innsys1
Rune Torgersen wrote:
>
>>Subject: [U-Boot-Users] Please explain this code in drivers/pci.c
>
>
>>The value of bar_response is 0xffff8008 which looks good. This gives bar
>
> size of
>
>>0x8000 which also looks good. The value of mem is initially 0x90000000.
>
> So,
>
>>(mem - 1) = 0x8fffffff and (bar_size - 1) = 0x7fff). When these are or'd
>
> one gets
>
>>0x8fffffff and adding 1 gives 0x90000000. This result is that the card is
>
> given 4
>
>>address bases all at 0x90000000.
>
>
>
> If the card wants 4 different memory regiuons, I assume it has 4 BAR
> registers? Each BAR must have the correct base address, so you have to add
> the size of the last region to the memory pointer before writing the
> address to the next BAR
>
>
I am not sure if you are trying to clarify the question or provide an answer. My
complaint is that the code does not do what you say. I believe the code should
provide four unique values for the four BARs, but it does not. Each gets the same
value because the ORing logic does not succeed in doing a new base = old base + size.
The logic envoked by CONFIG_PCI_PNP gets the calculation right. If someone is
familiar with the code and can confirm that it is not behaving as intended, then I
will do a patch. The ORing logic looks to me to be copied from the Linux kernel
where the allocation starts at the top of the address range and proceeds downward,
but maybe it is an attempt to force alignment. I don't know.
Don
next prev parent reply other threads:[~2003-05-20 0:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-19 15:19 [U-Boot-Users] Please explain this code in drivers/pci.c Rune Torgersen
2003-05-20 0:47 ` Donald White [this message]
[not found] ` <3EC9CCC5.4060006@bigfoot.com>
2003-05-21 3:14 ` Donald White
-- strict thread matches above, loose matches on Subject: below --
2003-05-18 23:39 Donald White
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=3EC97B0C.3050705@asu.edu \
--to=dbwhite@asu.edu \
--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