public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tang Yuantian-B29983 <Yuantian.Tang@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, 2/3] mpc85xx: Add deep sleep framework support
Date: Wed, 26 Feb 2014 16:13:01 +0800	[thread overview]
Message-ID: <530DA20D.1070309@freescale.com> (raw)
In-Reply-To: <1393269065.6733.926.camel@snotra.buserror.net>


On 2014/2/25 ??? 3:11, Scott Wood wrote:
>>>> Why what? Why we need it?
>>>>
>>>> It is a help function and used by ASM code in which
>>>> we can't determine whether it is a warm reset boot.
>>> Why don't you just open code it?
>> I can't check the warmboot status in ASM code.
>> In order to get the warmboot status in ASM code, I wrote this function.
> Why can't you check it in asm code?  See lib/asm-offsets.c.
Found it. Still learn how to use it.

Thanks,
Yuantian

>>>>>> +	if (gd->flags & GD_FLG_WARM_BOOT) {
>>>>>> +		src = (u64 *)in_be32(&scfg->sparecr[2]);
>>>>>> +		dst = (u64 *)(0);
>>>>>> +		for (i = 0; i < 128/sizeof(u64); i++) {
>>>>>> +			*dst = *src;
>>>>>> +			dst++;
>>>>>> +			src++;
>>>>>> +		}
>>>>>> +	}
>>>>> (u64 *)(0) is a NULL pointer.  Dereferencing NULL pointers is undefined
>>>>> and GCC has been getting increasingly free with making surprising
>>>>> optimizations based on that (such as assuming any code path that it knows
>>>>> can reach a NULL dereference is dead code and can be removed).
>>>>>
>>>> Then how we operate 0 address if not dereferencing NULL pointer?
>>>>
>>> With an I/O accessor (or other inline asm), a TLB mapping, or using a
>>> different memory location.
>> we found the zero address has benefit.
>> I don't know how to achieve this in inline asm or TLB mapping, could you
>> be more specific or write a example for me?
> Inline asm would be something like:
>
> 	asm("stw %1, 0(%0); stw %2, 4(%0)" : "=r" (dst) :
> 		"r" ((u32)(src >> 32)), "r" ((u32)src));
>
> -Scott
>
>

  parent reply	other threads:[~2014-02-26  8:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-26  6:00 [U-Boot] [PATCH 1/3] mpc85xx: Add support for the supplement configuration unit register Tang Yuantian
2014-01-26  6:00 ` [U-Boot] [PATCH 2/3] mpc85xx: Add deep sleep framework support Tang Yuantian
2014-02-13  0:44   ` [U-Boot] [U-Boot, " Scott Wood
     [not found]     ` <07dc877206434a4ea634d912c02da3a5@BL2PR03MB115.namprd03.prod.outlook.com>
2014-02-14 22:21       ` Scott Wood
2014-02-24  7:47         ` Tang Yuantian-B29983
2014-02-24 19:11           ` Scott Wood
2014-02-26  7:49             ` Tang Yuantian-B29983
2014-02-26  8:13             ` Tang Yuantian-B29983 [this message]
     [not found]     ` <c321feb926884bca922904aec215fdff@BL2PR03MB115.namprd03.prod.outlook.com>
2014-02-14 22:59       ` Scott Wood
2014-02-17  9:18         ` [U-Boot] test Tang Yuantian
     [not found]         ` <95751c79b09a4a15a7b4d577fd86ff3e@BL2PR03MB115.namprd03.prod.outlook.com>
2014-02-17 19:18           ` [U-Boot] [U-Boot, 2/3] mpc85xx: Add deep sleep framework support Scott Wood
2014-02-24  6:44             ` Tang Yuantian-B29983
2014-02-24 19:11               ` Scott Wood
2014-02-26  5:52                 ` Tang Yuantian-B29983
2014-01-26  6:00 ` [U-Boot] [PATCH 3/3] mpc85xx: Add deep sleep support on T1040QDS Tang Yuantian

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=530DA20D.1070309@freescale.com \
    --to=yuantian.tang@freescale.com \
    --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