From: Chunhe Lan <b25806@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2 v4] powerpc/p1023rds: Disable nor flash node and enable nand flash node
Date: Mon, 29 Aug 2011 17:02:27 +0800 [thread overview]
Message-ID: <op.v0ywqdimrxq6oa@localhost.localdomain> (raw)
In-Reply-To: <20110829074209.5F19F18C46F8@gemini.denx.de>
On Mon, 29 Aug 2011 15:42:09 +0800, Wolfgang Denk <wd@denx.de> wrote:
> Dear Chunhe Lan,
>
> In message <1314602152-9114-1-git-send-email-Chunhe.Lan@freescale.com>
> you wrote:
>> In the p1023rds, accessing exclusively nor flash or nand flash device by
>> BR0/OR0.
> ...
>> When booting from nor flash, the status of nor node is null that means
>> it
>> is enabled and the status of nand node is disabled in the default dts
>> file,
>> so do not do anything.
>
> It would be more intuitive to the reader, when the enabled node would
> use an explicit
>
> status = "enabled";
>
>> +#ifdef CONFIG_NAND_U_BOOT
>> + do_fixup_by_path_string(fdt, "nor_flash", "status", "disabled");
>> + do_fixup_by_path_string(fdt, "nand_flash", "status", "okay");
>> +#endif
>
> What does ""okay" mean? This is not documented anywhere. Is this
> supposed to mean "enabled"? Then please write "enabled" - for certain
> configurations it is definitely OK to disable the device.
In the kernel, whether the status of node is enabled or not, it is
determined by
of_device_is_available( ).
The following content of of_device_is_available( ):
245 /**
246 * of_device_is_available - check if a device is available for use
247 *
248 * @device: Node to check for availability
249 *
250 * Returns 1 if the status property is absent or set to "okay" or
"ok",
251 * 0 otherwise
252 */
253 int of_device_is_available(const struct device_node *device)
254 {
255 const char *status;
256 int statlen;
257
258 status = of_get_property(device, "status", &statlen);
259 if (status == NULL)
260 return 1;
261
262 if (statlen > 0) {
263 if (!strcmp(status, "okay") || !strcmp(status, "ok"))
264 return 1;
265 }
266
267 return 0;
268 }
" return 1" is enabled.
" return 0" is disabled.
So, we do NOT use "enabled" to set status.
Thanks.
-Jack Lan
> Best regards,
>
> Wolfgang Denk
>
next prev parent reply other threads:[~2011-08-29 9:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 7:15 [U-Boot] [PATCH 2/2 v4] powerpc/p1023rds: Disable nor flash node and enable nand flash node Chunhe Lan
2011-08-29 7:42 ` Wolfgang Denk
2011-08-29 9:02 ` Chunhe Lan [this message]
2011-08-29 11:56 ` Wolfgang Denk
2011-08-29 16:29 ` Scott Wood
2011-08-29 20:05 ` Wolfgang Denk
2011-08-29 20:23 ` Tabi Timur-B04825
2011-08-30 2:54 ` Chunhe Lan
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=op.v0ywqdimrxq6oa@localhost.localdomain \
--to=b25806@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 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.