All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Greg Ungerer <gregungerer@westnet.com.au>
Cc: Angelo Dureghello <angelo@sysam.it>,
	Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: [PATCH] m68k: allow ColdFire m5441x parts to run with MMU enabled
Date: Fri, 1 Sep 2017 15:30:25 +0200	[thread overview]
Message-ID: <CAMuHMdW-yih8Cm3TnXNHxpCOr-UnbT+NARTKiQS8zyaU3fWL+Q@mail.gmail.com> (raw)
In-Reply-To: <bda55359-b4b8-1af7-52bc-d00ef1dd78c4@westnet.com.au>

Hi Greg,

On Fri, Sep 1, 2017 at 3:21 PM, Greg Ungerer <gregungerer@westnet.com.au> wrote:
> On 01/09/17 17:49, Geert Uytterhoeven wrote:
>> On Fri, Sep 1, 2017 at 12:38 AM, Angelo Dureghello <angelo@sysam.it>
>> wrote:
>>> did some additional study and tests.
>>>
>>> Actually i cannot find any simpler patch, i just adjusted it a
>>> bit. I believe this patch will work on your cpu with 0-based
>>> memoryas well.
>>> I attach it for your comments.
>>
>>
>> I think your issue is caused by arch/m68k/include/asm/page_offset.h:
>>
>>      #if defined(CONFIG_RAMBASE)
>>      #define PAGE_OFFSET_RAW         CONFIG_RAMBASE
>>      #elif defined(CONFIG_SUN3)
>>      #define PAGE_OFFSET_RAW         0x0E000000
>>      #else
>>      #define PAGE_OFFSET_RAW         0x00000000
>>      #endif
>>
>> and arch/m68k/Kconfig.machine:
>>
>> if !MMU || COLDFIRE
>>
>>      config RAMBASE
>>              hex "Address of the base of RAM"
>>              default "0"
>>
>> So on MC680[2346]0 with MMU (and ignoring Sun-3, which is special),
>> PAGE_OFFSET == PAGE_OFFSET_RAW == 0.
>>
>> On Greg's zero-based Coldfire with MMU, CONFIG_RAMBASE is zero, and thus
>> PAGE_OFFSET is also zero.
>>
>> On your board CONFIG_RAMBASE is non-zero, hence PAGE_OFFSET is also
>> non-zero,
>> and thus you have to compensate for that, cfr. your second patch.
>>
>> Does it work if you force PAGE_OFFSET_RAW to zero?
>>
>> If yes, we either need:
>>
>> --- a/arch/m68k/include/asm/page_offset.h
>> +++ b/arch/m68k/include/asm/page_offset.h
>> @@ -1,6 +1,6 @@
>>   /* This handles the memory map.. */
>>
>> -#if defined(CONFIG_RAMBASE)
>> +#if !defined(CONFIG_MMU)
>>   #define PAGE_OFFSET_RAW                CONFIG_RAMBASE
>>   #elif defined(CONFIG_SUN3)
>>   #define PAGE_OFFSET_RAW                0x0E000000
>>
>> or
>>
>> --- a/arch/m68k/Kconfig.machine
>> +++ b/arch/m68k/Kconfig.machine
>> @@ -325,6 +325,7 @@ comment "RAM configuration"
>>
>>   config RAMBASE
>>          hex "Address of the base of RAM"
>> +       depends on MMU
>
>
> Did you mean "depends on !MMU" here?

Sorry, yes, depends on !MMU.

>> depending on whether anything else in the Coldfire code needs RAMBASE.
>
> There are a couple of places we depend on CONFIG_RAMBASE even
> when running with the MMU enabled. Most importantly in setting
> the cachable regions in arch/m68k/include/asm/m54xxacr.h.
> So this is probably not going to work on its own.

OK, as I already feared/expected...

> But the first patch above should be ok. It should certainly work on
> my 0 address base 5475 ColdFire setup. Angelo can you try that one?

Right.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2017-09-01 13:30 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 23:21 Re:[PATCH] m68k: allow ColdFire m5441x parts to run with MMU enabled Angelo Dureghello
2017-07-14 23:47 ` [PATCH] " Angelo Dureghello
2017-08-09 13:04   ` Greg Ungerer
2017-08-09 15:32     ` Angelo Dureghello
2017-08-10  7:06       ` Greg Ungerer
2017-08-12 11:17         ` Angelo Dureghello
2017-08-14  4:16           ` Greg Ungerer
2017-08-17 15:02             ` Angelo Dureghello
2017-08-20 12:44               ` Greg Ungerer
2017-08-20 13:26                 ` Angelo Dureghello
2017-08-21  7:15                   ` Greg Ungerer
2017-08-21 14:58                     ` Angelo Dureghello
2017-08-21 20:11                       ` Geert Uytterhoeven
2017-08-22  0:15                         ` Angelo Dureghello
2017-08-22  0:35                     ` Angelo Dureghello
2017-08-22  1:08                       ` Greg Ungerer
2017-08-23  7:06                       ` Greg Ungerer
2017-08-27  0:31                         ` Angelo Dureghello
2017-08-31 22:38                           ` Angelo Dureghello
2017-09-01  7:49                             ` Geert Uytterhoeven
2017-09-01 13:21                               ` Greg Ungerer
2017-09-01 13:30                                 ` Geert Uytterhoeven [this message]
2017-09-01 22:08                                   ` Angelo Dureghello
2017-09-04  6:08                                     ` Greg Ungerer
2017-09-04 14:42                                       ` Angelo Dureghello
2017-09-07  2:01                                         ` Greg Ungerer
2017-09-07 20:23                                           ` Angelo Dureghello
2017-09-08  0:48                                             ` Greg Ungerer
2017-08-13  1:15         ` Angelo Dureghello
  -- strict thread matches above, loose matches on Subject: below --
2017-01-11 11:35 Greg Ungerer

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=CAMuHMdW-yih8Cm3TnXNHxpCOr-UnbT+NARTKiQS8zyaU3fWL+Q@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=angelo@sysam.it \
    --cc=gregungerer@westnet.com.au \
    --cc=linux-m68k@vger.kernel.org \
    /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.