From: Oleg Kolosov <bazurbat@gmail.com>
To: "Måns Rullgård" <mans@mansr.com>,
"Kevin Cernekee" <cernekee@chromium.org>
Cc: Linux MIPS Mailing List <linux-mips@linux-mips.org>
Subject: Re: Few questions about porting Linux to SMP86xx boards
Date: Tue, 03 Feb 2015 03:35:32 +0300 [thread overview]
Message-ID: <54D017D4.70200@gmail.com> (raw)
In-Reply-To: <yw1xwq409odv.fsf@unicorn.mansr.com>
On 02/02/15 21:09, Måns Rullgård wrote:
> Kevin Cernekee <cernekee@chromium.org> writes:
>
>> On Sun, Feb 1, 2015 at 2:46 PM, Oleg Kolosov <bazurbat@gmail.com> wrote:
>>> 1. They (Sigma Designs) have overridden __fast_iob which is identical to
>>> the default one except for one line:
>>> ...
>>
>> I do not have any direct experience with these SoCs, but you might
>> want to look at the memory map to try to figure this one out. i.e. if
>> __fast_iob() normally performs an uncached dummy read from the first
>> word of physical memory, does the address need to be adjusted by 64MB
>> on the Sigma chips because system memory (or the memory allocated to
>> the Linux application processor) starts at PA 0x0400_0000 instead of
>> 0x0000_0000?
>>
>> That theory would also explain why the exception vectors were adjusted
>> by the same offset.
>
> The 86xx has two DRAM controllers mapped with 1GB windows at 0x8000_0000
> and 0xc000_0000, and also with 256MB windows at 0x1000_0000 and 0x2000_0000.
> To complicate matters, CPU physical addresses starting at 0x04000000 are
> subjected to a set of remapping registers translating 6 blocks of 64MB
> to an arbitrary (64MB-aligned) bus address (not that these addresses
> overlap with the low mappings of the DRAM controllers). The obvious way
> to support this would be to simply set these registers to an identity
> mapping and use highmem for anything that doesn't fit the low windows.
> Obviously, they didn't do that.
>
Thanks for the explanations! This is really useful.
>> BTW, you can override ebase from the platform code, as was done in
>> arch/mips/kernel/smp-bmips.c. It probably isn't necessary to change
>> the common per_cpu_trap_init() code (but it may have been necessary
>> way back in 2.6.32).
>
> Most of the hacks they've done to generic code are actually completely
> unnecessary, if not outright wrong.
>
That was my suspicion as well. It is reassuring to have a confirmation
from someone more knowledgeable. Thanks!
>>> 2. In io.h they have added explicit __sync() to the end of
>>> pfx##write##bwlq and pfx##out##bwlq##p. Is this really necessary? I've
>>> not yet found any adverse effects of not doing so. Maybe this was a
>>> workaround for some old kernel issue which was fixed since then?
>>
>> Adding a barrier in writel(), as was done on ARM, might have something
>> to do with the SoC's busing or peripherals. Sometimes there are chip
>> bugs that cause MMIO transaction ordering to break in unexpected ways.
>> Or it could be there to compensate for missing barriers or bad
>> assumptions in a driver somewhere.
>>
>> For #2 and #3, it is likely that somebody at Sigma could find a bug
>> report or changelog explaining why it was added. In my experience
>> these sorts of changes are usually made to work around subtle problems
>> discovered in testing or production. Figuring out the exact problem
>> that inspired the patch can be difficult without insider knowledge,
>> unless you happened to run across the same failure.
>
> I suspect the Sigma patches were produced by randomly prodding a kernel
> with a stick until it started working.
>
--
Regards, Oleg
Art System
next prev parent reply other threads:[~2015-02-03 0:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-01 22:46 Few questions about porting Linux to SMP86xx boards Oleg Kolosov
2015-02-01 23:55 ` Kevin Cernekee
2015-02-02 18:09 ` Måns Rullgård
2015-02-03 0:35 ` Oleg Kolosov [this message]
2015-02-03 11:39 ` Maciej W. Rozycki
2015-02-03 14:28 ` Kevin Cernekee
2015-02-03 15:08 ` Måns Rullgård
2015-02-03 16:40 ` Kevin Cernekee
2015-02-05 13:37 ` Maciej W. Rozycki
2015-02-02 15:19 ` Steven J. Hill
2015-02-02 15:19 ` Steven J. Hill
2015-02-02 17:56 ` Måns Rullgård
2015-02-02 17:56 ` Måns Rullgård
2015-02-03 0:17 ` Oleg Kolosov
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=54D017D4.70200@gmail.com \
--to=bazurbat@gmail.com \
--cc=cernekee@chromium.org \
--cc=linux-mips@linux-mips.org \
--cc=mans@mansr.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox