mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Scherer, Thorsten" <thorsten.scherer@eckelmann.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] imd: model and compatible missing in metadata
Date: Wed, 23 Jan 2019 15:05:55 +0100	[thread overview]
Message-ID: <20190123140555.GC3923@ws067.eckelmann.group> (raw)
In-Reply-To: <20190122085337.rs6iyfddji5qmtlv@pengutronix.de>

Hello,

On Tue, Jan 22, 2019 at 09:53:37AM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Tue, Jan 22, 2019 at 09:10:40AM +0100, Scherer, Thorsten wrote:
> > i spent some time trying to understand the usage of imd_used etc. 
> > 
> > In another reply I stated:
> > 
> > 'I misread the documenation on IMD as "of_compatible and model will be
> > figured out and put into the proper location by barebox".'
> 
> That is wrong. The current code doesn't ensure that and I don't see a
> way how this could be done comfortably without per-board changes.
>  
> > I am not so sure, if that is really the case.
> > 
> > As far as i understand things:
> > 
> > 1. 	of_compatible and model are (should be) automagically added to imd from the
> > 	entries in the dts.
> > 
> > git show 97e81f2d7 | grep -A 1 'For.*model.*of_compatible'
> > cat scripts/gen-dtb-s | grep -A 23 -B 3 'barebox_imd_0'
> 
> The imd tags for compatible and model are generated, but not
> automatically included with this change. This is AFAICT the current
> state.
> 
> The problem is that the needed information is included in the "barebox"
> image (i.e. the file with the name "barebox" that is build in the top
> build dir) but then there is an additional step that extracts "all
> needed" parts from that image to create a binary that then is able to be
> started on your target. So if "barebox" has three entry points for
> different machines, there are three images generated and each only has a
> single entry point. Unused functions and data structures are stripped.
> The linker detects that the imd section that contains the compatible and
> model is not used and so this goes away in all three generated binaries.
> 

Thank you for the explanation.  Now things start to clear up a bit.  

> > 2.	the IMD_USED macro puts arbitrary tags in the metadata.  Which may
> > 	also be a tag named model.
> 
> The IMD_USED claims a certain data structure is used such that the
> linker doesn't throw it away.
>  

Ok.

> > Now I wonder, if the lack of the patch just covers up an issue at another
> > place or if there is something (in the context of multi image support?) which
> > I do not understand. 
> 
> Did you look at the patch I sent you?
> 

I did.  But not closely enough.  On the invokation of imd, model and
of_compatible were not displayed.  Somehow I did not get, that your
patch was made to apply for the imx25 boards and not for the imx6
board (the one which I was checking).  After adjusting the lowlevel.c
file of the imx6 board, everything went fine.

> > Maybe there is something messed up with the entries in
> > the device tree?
> > 
> > https://www.spinics.net/lists/arm-kernel/msg699453.html
> 
> This is unrelated, this is a patch for Linux to add a device tree.

Right.  It didn't make sense to add this.

> 
> Best regards
> Uwe
> 

Again, thank you for feedback.

Best regards
Thorsten

> -- 
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

-- 
Mit freundlichen Grüßen
Thorsten K. Scherer
Diplom-Ingenieur (FH)
Kälte- und Gebäudeleittechnik
Datentechnik


Eckelmann AG
Berliner Str. 161, 65205 Wiesbaden
Telefon +49 611 7103-329     
Fax +49 611 7103-133
thorsten.scherer@eckelmann.de
https://www.eckelmann.de

Eckelmann Group - Source of inspiration

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2019-01-23 14:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  6:33 Thorsten K. Scherer
2018-12-13  7:20 ` Sascha Hauer
2018-12-17 11:18 ` Antony Pavlov
2018-12-17 11:31   ` Sascha Hauer
2018-12-20 12:54     ` Scherer, Thorsten
2019-01-03 11:02       ` s.hauer
2019-01-22  8:10     ` Scherer, Thorsten
2019-01-22  8:53       ` Uwe Kleine-König
2019-01-23 14:05         ` Scherer, Thorsten [this message]

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=20190123140555.GC3923@ws067.eckelmann.group \
    --to=thorsten.scherer@eckelmann.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.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