devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* microblaze console init
@ 2010-12-11 21:50 Walter Goossens
       [not found] ` <4D03F229.9070403-CmkmPbn3yAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Goossens @ 2010-12-11 21:50 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Hi list,

while working on fdt support for the nios2 I was reading some code for 
other archs I also looked at the microblaze code and I believe I found 
some leftovers from a copy/paste action, attached is a small patch 
(untested) to fix a debug print and (more important) remove a useless 
call to early_init_dt_check_for_initrd.

I do still have one concern, do I understand correctly that there is no 
way to do address-translation (the "ranges" stuff) on a flattenend tree, 
using the of_get_flat_dt_* functions? This would mean that this code 
would fail to get the correct address for a uartlite connected to a bus 
that has address-translation.

Greetingz
Walter

[-- Attachment #2: microblaze_prom_copy_paste_fix.patch --]
[-- Type: text/plain, Size: 702 bytes --]

diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index a105301..c881393 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -61,14 +61,12 @@ static int __init early_init_dt_scan_serial(unsigned long node,
 	char *p;
 	int *addr;
 
-	pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
+	pr_debug("search \"serial\", depth: %d, uname: %s\n", depth, uname);
 
 /* find all serial nodes */
 	if (strncmp(uname, "serial", 6) != 0)
 		return 0;
 
-	early_init_dt_check_for_initrd(node);
-
 /* find compatible node with uartlite */
 	p = of_get_flat_dt_prop(node, "compatible", &l);
 	if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&

[-- Attachment #3: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: microblaze console init
       [not found] ` <4D03F229.9070403-CmkmPbn3yAE@public.gmane.org>
@ 2010-12-11 21:59   ` Grant Likely
       [not found]     ` <AANLkTinw3mqpmiUkzf9Drgg+f+b3hFBUoHLmtWSO75GY-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Grant Likely @ 2010-12-11 21:59 UTC (permalink / raw)
  To: Walter Goossens; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Sat, Dec 11, 2010 at 2:50 PM, Walter Goossens <waltergoossens-CmkmPbn3yAE@public.gmane.org> wrote:
> I do still have one concern, do I understand correctly that there is no way
> to do address-translation (the "ranges" stuff) on a flattenend tree, using
> the of_get_flat_dt_* functions? This would mean that this code would fail to
> get the correct address for a uartlite connected to a bus that has
> address-translation.

Correct, none of the flat tree core code tries to do any range
translation.  In fact, it does very little in the way of looking at
reg properties at all.  Only the absolute bare minimum required to get
through early boot.  It could be done, but there really hasn't been a
use case for it up to this point.  Instead, ranges can be translated
after the tree has been unflattened into the live form.

g.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: microblaze console init
       [not found]     ` <AANLkTinw3mqpmiUkzf9Drgg+f+b3hFBUoHLmtWSO75GY-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-12-11 22:15       ` Walter Goossens
       [not found]         ` <4D03F803.6060903-CmkmPbn3yAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Goossens @ 2010-12-11 22:15 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 12/11/10 10:59 PM, Grant Likely wrote:
> On Sat, Dec 11, 2010 at 2:50 PM, Walter Goossens<waltergoossens-CmkmPbn3yAE@public.gmane.org>  wrote:
>> I do still have one concern, do I understand correctly that there is no way
>> to do address-translation (the "ranges" stuff) on a flattenend tree, using
>> the of_get_flat_dt_* functions? This would mean that this code would fail to
>> get the correct address for a uartlite connected to a bus that has
>> address-translation.
> Correct, none of the flat tree core code tries to do any range
> translation.  In fact, it does very little in the way of looking at
> reg properties at all.  Only the absolute bare minimum required to get
> through early boot.  It could be done, but there really hasn't been a
> use case for it up to this point.  Instead, ranges can be translated
> after the tree has been unflattened into the live form.
>
> g.
>
thanks for the quick response!
I was afraid of this... I'm affraid I do need to use it in the nios 
code, well I don't need to but in order to be flexible (and use the 
design I'm working with right now) but I would prefer it. The way around 
this I currently use is a special parameter in chosen with the address 
of the "early uart" (it's only used for early printk).
What's cleanest approach here? An extra property in "chosen" or range 
translation in the flatttened tree?

Walter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: microblaze console init
       [not found]         ` <4D03F803.6060903-CmkmPbn3yAE@public.gmane.org>
@ 2010-12-11 22:18           ` Grant Likely
  2010-12-11 22:24             ` Walter Goossens
  0 siblings, 1 reply; 7+ messages in thread
From: Grant Likely @ 2010-12-11 22:18 UTC (permalink / raw)
  To: Walter Goossens; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Sat, Dec 11, 2010 at 3:15 PM, Walter Goossens <waltergoossens-CmkmPbn3yAE@public.gmane.org> wrote:
> On 12/11/10 10:59 PM, Grant Likely wrote:
>>
>> On Sat, Dec 11, 2010 at 2:50 PM, Walter Goossens<waltergoossens-CmkmPbn3yAE@public.gmane.org>
>>  wrote:
>>>
>>> I do still have one concern, do I understand correctly that there is no
>>> way
>>> to do address-translation (the "ranges" stuff) on a flattenend tree,
>>> using
>>> the of_get_flat_dt_* functions? This would mean that this code would fail
>>> to
>>> get the correct address for a uartlite connected to a bus that has
>>> address-translation.
>>
>> Correct, none of the flat tree core code tries to do any range
>> translation.  In fact, it does very little in the way of looking at
>> reg properties at all.  Only the absolute bare minimum required to get
>> through early boot.  It could be done, but there really hasn't been a
>> use case for it up to this point.  Instead, ranges can be translated
>> after the tree has been unflattened into the live form.
>>
>> g.
>>
> thanks for the quick response!
> I was afraid of this... I'm affraid I do need to use it in the nios code,
> well I don't need to but in order to be flexible (and use the design I'm
> working with right now) but I would prefer it. The way around this I
> currently use is a special parameter in chosen with the address of the
> "early uart" (it's only used for early printk).
> What's cleanest approach here? An extra property in "chosen" or range
> translation in the flatttened tree?

Implement ranges translation in the flat tree code.  It wouldn't be
very hard, and will be a lot more maintainable in the long run.

g.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: microblaze console init
  2010-12-11 22:18           ` Grant Likely
@ 2010-12-11 22:24             ` Walter Goossens
       [not found]               ` <4D03FA1B.9040804-CmkmPbn3yAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Goossens @ 2010-12-11 22:24 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 12/11/10 11:18 PM, Grant Likely wrote:
> On Sat, Dec 11, 2010 at 3:15 PM, Walter Goossens<waltergoossens-CmkmPbn3yAE@public.gmane.org>  wrote:
>> On 12/11/10 10:59 PM, Grant Likely wrote:
>>> On Sat, Dec 11, 2010 at 2:50 PM, Walter Goossens<waltergoossens-CmkmPbn3yAE@public.gmane.org>
>>>   wrote:
>>>> I do still have one concern, do I understand correctly that there is no
>>>> way
>>>> to do address-translation (the "ranges" stuff) on a flattenend tree,
>>>> using
>>>> the of_get_flat_dt_* functions? This would mean that this code would fail
>>>> to
>>>> get the correct address for a uartlite connected to a bus that has
>>>> address-translation.
>>> Correct, none of the flat tree core code tries to do any range
>>> translation.  In fact, it does very little in the way of looking at
>>> reg properties at all.  Only the absolute bare minimum required to get
>>> through early boot.  It could be done, but there really hasn't been a
>>> use case for it up to this point.  Instead, ranges can be translated
>>> after the tree has been unflattened into the live form.
>>>
>>> g.
>>>
>> thanks for the quick response!
>> I was afraid of this... I'm affraid I do need to use it in the nios code,
>> well I don't need to but in order to be flexible (and use the design I'm
>> working with right now) but I would prefer it. The way around this I
>> currently use is a special parameter in chosen with the address of the
>> "early uart" (it's only used for early printk).
>> What's cleanest approach here? An extra property in "chosen" or range
>> translation in the flatttened tree?
> Implement ranges translation in the flat tree code.  It wouldn't be
> very hard, and will be a lot more maintainable in the long run.
>
> g.
>
I'll have a stab at it.

Thanks!
Walter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: microblaze console init
       [not found]               ` <4D03FA1B.9040804-CmkmPbn3yAE@public.gmane.org>
@ 2010-12-13 18:59                 ` Scott Wood
       [not found]                   ` <20101213125947.12a6db54-N/eSCTBpGwP7j4BuCOFQISmX4OfbXNuMKnGXBo5VDl8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Wood @ 2010-12-13 18:59 UTC (permalink / raw)
  To: Walter Goossens; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Sat, 11 Dec 2010 23:24:27 +0100
Walter Goossens <waltergoossens-CmkmPbn3yAE@public.gmane.org> wrote:

> On 12/11/10 11:18 PM, Grant Likely wrote:
> > Implement ranges translation in the flat tree code.  It wouldn't be
> > very hard, and will be a lot more maintainable in the long run.
> >
> > g.
> >
> I'll have a stab at it.

Some code for this exists in arch/powerpc/boot/devtree.c

-Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: microblaze console init
       [not found]                   ` <20101213125947.12a6db54-N/eSCTBpGwP7j4BuCOFQISmX4OfbXNuMKnGXBo5VDl8@public.gmane.org>
@ 2010-12-13 21:06                     ` Walter Goossens
  0 siblings, 0 replies; 7+ messages in thread
From: Walter Goossens @ 2010-12-13 21:06 UTC (permalink / raw)
  To: Scott Wood; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 12/13/10 7:59 PM, Scott Wood wrote:
> On Sat, 11 Dec 2010 23:24:27 +0100
> Walter Goossens<waltergoossens-CmkmPbn3yAE@public.gmane.org>  wrote:
>
>> On 12/11/10 11:18 PM, Grant Likely wrote:
>>> Implement ranges translation in the flat tree code.  It wouldn't be
>>> very hard, and will be a lot more maintainable in the long run.
>>>
>>> g.
>>>
>> I'll have a stab at it.
> Some code for this exists in arch/powerpc/boot/devtree.c
>
Sweet!
thnx for the pointer.

Walter
> -Scott
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-13 21:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-11 21:50 microblaze console init Walter Goossens
     [not found] ` <4D03F229.9070403-CmkmPbn3yAE@public.gmane.org>
2010-12-11 21:59   ` Grant Likely
     [not found]     ` <AANLkTinw3mqpmiUkzf9Drgg+f+b3hFBUoHLmtWSO75GY-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-11 22:15       ` Walter Goossens
     [not found]         ` <4D03F803.6060903-CmkmPbn3yAE@public.gmane.org>
2010-12-11 22:18           ` Grant Likely
2010-12-11 22:24             ` Walter Goossens
     [not found]               ` <4D03FA1B.9040804-CmkmPbn3yAE@public.gmane.org>
2010-12-13 18:59                 ` Scott Wood
     [not found]                   ` <20101213125947.12a6db54-N/eSCTBpGwP7j4BuCOFQISmX4OfbXNuMKnGXBo5VDl8@public.gmane.org>
2010-12-13 21:06                     ` Walter Goossens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).