All of lore.kernel.org
 help / color / mirror / Atom feed
From: david.vrabel@citrix.com (David Vrabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 6/9] ARM: vexpress: Motherboard RS1 memory map support
Date: Thu, 19 Jan 2012 16:46:56 +0000	[thread overview]
Message-ID: <4F184900.8050901@citrix.com> (raw)
In-Reply-To: <1326979266.32197.60.camel@hornet.cambridge.arm.com>

On 19/01/12 13:21, Pawel Moll wrote:
> Hi,
> 
> Sorry about loooong delay - I've been on holiday.
> 
> On Wed, 2012-01-04 at 16:35 +0000, David Vrabel wrote:
>> On 15/12/11 14:02, Pawel Moll wrote:
>>> This patch adds support for RS1 memory map based Versatile Express
>>> motherboard.
>>>
>> [...]
>>> --- a/arch/arm/mach-vexpress/include/mach/debug-macro.S
>>> +++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S
>>> @@ -10,12 +10,41 @@
>>>   * published by the Free Software Foundation.
>>>   */
>>>  
>>> -#define DEBUG_LL_UART_OFFSET	0x00009000
>>> +#define DEBUG_LL_PHYS_BASE		0x10000000
>>> +#define DEBUG_LL_UART_OFFSET		0x00009000
>>> +
>>> +#define DEBUG_LL_PHYS_BASE_RS1		0x1c000000
>>> +#define DEBUG_LL_UART_OFFSET_RS1	0x00090000
>>> +
>>> +#define DEBUG_LL_VIRT_BASE		0xf8000000
>>>  
>>>  		.macro	addruart,rp,rv,tmp
>>> -		mov	\rp, #DEBUG_LL_UART_OFFSET
>>> -		orr	\rv, \rp, #0xf8000000	@ virtual base
>>> -		orr	\rp, \rp, #0x10000000	@ physical base
>>> +
>>> +		@ Check the MMU state
>>> +#if defined(CONFIG_MMU)
>>> +		mrc	p15, 0, \tmp, c1, c0	@ SCTRL
>>> +		tst	\tmp, #1		@ MMU enabled?
>>> +		moveq	\tmp, #DEBUG_LL_PHYS_BASE
>>> +		movne	\tmp, #DEBUG_LL_VIRT_BASE
>>> +#else
>>> +		mov	\tmp, #DEBUG_LL_PHYS_BASE
>>> +#endif
>>> +
>>> +		@ PL011 present in "original" place?
>>> +		orr	\tmp, \tmp, #DEBUG_LL_UART_OFFSET
>>> +		ldr	\tmp, [\tmp, #0xfe0]	@ PeriphID0
>>
>> This doesn't work with CONFIG_EARLY_PRINTK=y on a system with the RS1
>> memory map.  
> 
> It does for me:
> 
> # zcat /proc/config.gz | grep EARLY_PRINTK
> CONFIG_EARLY_PRINTK=y
> # cat /proc/device-tree/motherboard/arm,v2m-memory-map && echo
> rs1     
> #

earlyprintk needs to be on the kernel command line to enable it.
Without this option it will work fine.

> Can you tell me what exactly is going wrong in your case? Does it hang
> without any warning? Do you get at least part of the boot log? Can you
> send me (privately probably) your kernel config?

The only output is from the zImage decompressor.

It's a synchronous data fault and DFAR is 0xf8009fe0.

>>  __create_page_tables has only mapped the single physical
>> page at 0x1c090000 and thus the test for the UART in the other memory
>> map faults.
> 
> I investigated this when writing the code and I vaguely remember it was
> fine, partly by accident. I'll dig in again and let you know my
> findings.

It's also a problem when running as a guest under a hypervisor as there
won't be any stage 2 translation table entries for non-existent peripherals.

I think there needs to be someway of finding out from the DTB which UART
to use.

David

WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
To: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v6 6/9] ARM: vexpress: Motherboard RS1 memory map support
Date: Thu, 19 Jan 2012 16:46:56 +0000	[thread overview]
Message-ID: <4F184900.8050901@citrix.com> (raw)
In-Reply-To: <1326979266.32197.60.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>

On 19/01/12 13:21, Pawel Moll wrote:
> Hi,
> 
> Sorry about loooong delay - I've been on holiday.
> 
> On Wed, 2012-01-04 at 16:35 +0000, David Vrabel wrote:
>> On 15/12/11 14:02, Pawel Moll wrote:
>>> This patch adds support for RS1 memory map based Versatile Express
>>> motherboard.
>>>
>> [...]
>>> --- a/arch/arm/mach-vexpress/include/mach/debug-macro.S
>>> +++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S
>>> @@ -10,12 +10,41 @@
>>>   * published by the Free Software Foundation.
>>>   */
>>>  
>>> -#define DEBUG_LL_UART_OFFSET	0x00009000
>>> +#define DEBUG_LL_PHYS_BASE		0x10000000
>>> +#define DEBUG_LL_UART_OFFSET		0x00009000
>>> +
>>> +#define DEBUG_LL_PHYS_BASE_RS1		0x1c000000
>>> +#define DEBUG_LL_UART_OFFSET_RS1	0x00090000
>>> +
>>> +#define DEBUG_LL_VIRT_BASE		0xf8000000
>>>  
>>>  		.macro	addruart,rp,rv,tmp
>>> -		mov	\rp, #DEBUG_LL_UART_OFFSET
>>> -		orr	\rv, \rp, #0xf8000000	@ virtual base
>>> -		orr	\rp, \rp, #0x10000000	@ physical base
>>> +
>>> +		@ Check the MMU state
>>> +#if defined(CONFIG_MMU)
>>> +		mrc	p15, 0, \tmp, c1, c0	@ SCTRL
>>> +		tst	\tmp, #1		@ MMU enabled?
>>> +		moveq	\tmp, #DEBUG_LL_PHYS_BASE
>>> +		movne	\tmp, #DEBUG_LL_VIRT_BASE
>>> +#else
>>> +		mov	\tmp, #DEBUG_LL_PHYS_BASE
>>> +#endif
>>> +
>>> +		@ PL011 present in "original" place?
>>> +		orr	\tmp, \tmp, #DEBUG_LL_UART_OFFSET
>>> +		ldr	\tmp, [\tmp, #0xfe0]	@ PeriphID0
>>
>> This doesn't work with CONFIG_EARLY_PRINTK=y on a system with the RS1
>> memory map.  
> 
> It does for me:
> 
> # zcat /proc/config.gz | grep EARLY_PRINTK
> CONFIG_EARLY_PRINTK=y
> # cat /proc/device-tree/motherboard/arm,v2m-memory-map && echo
> rs1     
> #

earlyprintk needs to be on the kernel command line to enable it.
Without this option it will work fine.

> Can you tell me what exactly is going wrong in your case? Does it hang
> without any warning? Do you get at least part of the boot log? Can you
> send me (privately probably) your kernel config?

The only output is from the zImage decompressor.

It's a synchronous data fault and DFAR is 0xf8009fe0.

>>  __create_page_tables has only mapped the single physical
>> page at 0x1c090000 and thus the test for the UART in the other memory
>> map faults.
> 
> I investigated this when writing the code and I vaguely remember it was
> fine, partly by accident. I'll dig in again and let you know my
> findings.

It's also a problem when running as a guest under a hypervisor as there
won't be any stage 2 translation table entries for non-existent peripherals.

I think there needs to be someway of finding out from the DTB which UART
to use.

David

  reply	other threads:[~2012-01-19 16:46 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 14:02 [PATCH v6 0/9] Versatile Express DT support Pawel Moll
2011-12-15 14:02 ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 1/9] ARM: versatile: Add missing ENDPROC to headsmp.S Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 2/9] ARM: vexpress: Get rid of MMIO_P2V Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 3/9] ARM: versatile: Map local timers using Device Tree when possible Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2011-12-15 14:53   ` Rob Herring
2011-12-15 14:53     ` Rob Herring
2011-12-15 15:25     ` Pawel Moll
2011-12-15 15:25       ` Pawel Moll
2011-12-15 17:25       ` Pawel Moll
2011-12-15 17:25         ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 4/9] ARM: vexpress: Use FDT data in platform SMP calls Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 5/9] ARM: vexpress: Add Device Tree support Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2012-01-10 11:13   ` Jon Medhurst (Tixy)
2012-01-10 11:13     ` Jon Medhurst (Tixy)
2011-12-15 14:02 ` [PATCH v6 6/9] ARM: vexpress: Motherboard RS1 memory map support Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2012-01-04 16:35   ` David Vrabel
2012-01-04 16:35     ` David Vrabel
2012-01-19 13:21     ` Pawel Moll
2012-01-19 13:21       ` Pawel Moll
2012-01-19 16:46       ` David Vrabel [this message]
2012-01-19 16:46         ` David Vrabel
2012-01-19 17:31         ` Pawel Moll
2012-01-19 17:31           ` Pawel Moll
2012-01-27 14:02         ` Pawel Moll
2012-01-27 14:02           ` Pawel Moll
2012-01-30 17:32           ` Dave Martin
2012-01-30 17:32             ` Dave Martin
2012-01-30 17:26       ` Dave Martin
2012-01-30 17:26         ` Dave Martin
2011-12-15 14:02 ` [PATCH v6 7/9] ARM: vexpress: Add Device Tree for V2P-CA5s core tile Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 8/9] ARM: vexpress: Add Device Tree for V2P-CA9 " Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2011-12-15 14:02 ` [PATCH v6 9/9] ARM: vexpress: Add Device Tree for V2P-CA15 core tile (TC1 variant) Pawel Moll
2011-12-15 14:02   ` Pawel Moll
2012-01-10 14:21   ` David Vrabel
2012-01-10 14:21     ` David Vrabel
2012-01-19 13:27     ` Pawel Moll
2012-01-19 13:27       ` Pawel Moll
2012-01-19 13:34       ` Rob Herring
2012-01-19 13:34         ` Rob Herring
2012-01-19 13:43         ` Pawel Moll
2012-01-19 13:43           ` Pawel Moll
2012-01-19 14:01           ` Rob Herring
2012-01-19 14:01             ` Rob Herring
2012-01-19 14:51             ` Pawel Moll
2012-01-19 14:51               ` Pawel Moll
2012-01-19 17:00               ` David Vrabel
2012-01-19 17:00                 ` David Vrabel
2012-01-19 17:11                 ` Russell King - ARM Linux
2012-01-19 17:11                   ` Russell King - ARM Linux
2012-01-19 17:27                 ` Pawel Moll
2012-01-19 17:27                   ` Pawel Moll
2012-01-19 17:50                   ` Russell King - ARM Linux
2012-01-19 17:50                     ` Russell King - ARM Linux
2012-01-19 17:59                     ` Grant Likely
2012-01-19 17:59                       ` Grant Likely
2012-01-19 18:09                       ` Nicolas Pitre
2012-01-19 18:09                         ` Nicolas Pitre
2012-01-19 22:07                         ` Grant Likely
2012-01-19 22:07                           ` Grant Likely
2012-01-25 17:43                 ` Pawel Moll
2012-01-25 17:43                   ` Pawel Moll
2012-01-30 17:42                   ` Dave Martin
2012-01-30 17:42                     ` Dave Martin
2012-01-30 21:31                     ` Grant Likely
2012-01-30 21:31                       ` Grant Likely
2012-01-31 11:50                       ` Dave Martin
2012-01-31 11:50                         ` Dave Martin

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=4F184900.8050901@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=linux-arm-kernel@lists.infradead.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.