[oe] [PATHC] ATAG export for the linux kernel

Richard Purdie rpurdie at rpsys.net
Mon Dec 10 13:35:46 UTC 2007


Hi Uli,

On Mon, 2007-12-10 at 10:26 +0000, Uli Luckas wrote:
> Richard Purdie wrote:
> I think we are talking about different approaches here. The patch Hans 
> Henry but on bugs.openembedded.org is not what I posted. It still 
> contains code from Mike which is not needed any more. Could you please 
> reconsider export_atags_2.patch + the userspace patches only?

Hans Henry is working against an old 2.6.17 kernel and I think the code
from Mike was merged into mainline but is still needed for 2.6.17. There
are a few problems in the Zaurus use case (and in general).

I appreciate his backport of the atags patch isn't 100% up to date but
its actually 2.6.23+patches I've been looking at (I'm assuming
backporting is straightforward and will therefore worry about that
later).

The zaurus does not set boot_params. This means the section of code
which does this:

--- linux-2.6.21_orig2/arch/arm/kernel/setup.c	2007-11-16 13:17:11.000000000 -0800
+++ linux-2.6.21/arch/arm/kernel/setup.c	2007-11-16 13:24:26.000000000 -0800
@@ -823,6 +824,9 @@
 	if (tags->hdr.tag == ATAG_CORE) {
 		if (meminfo.nr_banks != 0)
 			squash_mem_tags(tags);
+                if (mdesc->boot_params)
+                        save_atags(mdesc->boot_params, tags);
+
 		parse_tags(tags);
 	}

will not work.

In setup.c there is also the code:

	if (__atags_pointer) {
		kexec_boot_params_address = __atags_pointer;
		memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
	} else if (mdesc->boot_params) {
		kexec_boot_params_address = mdesc->boot_params;
		memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
	}

and the structure pointed at by boot_params could be in the old format
(see arch/arm/compat.c).

So, I think that:
  * save_atags() should be called unconditionally
  * We should memcpy the tags after the conversion or rely entirely on 
    save_atags() (probably the latter).
  * Userspace should always rebuild the tag list and provide in a new 
    location within the first 32kiB so machines which don't use 
    boot_params still work and only one structure is used to pass 
    parameters, simplifying the situation.

This isn't really a fundamental change to how it currently works, just a
simplification to make it clear, simple and work in all cases.

Cheers,

Richard





More information about the Openembedded-devel mailing list