From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [RFC 1/8] drivers: add generic remoteproc framework Date: Mon, 27 Jun 2011 17:35:49 -0600 Message-ID: References: <1308640714-17961-1-git-send-email-ohad@wizery.com> <1308640714-17961-2-git-send-email-ohad@wizery.com> <20110627204958.GB20865@ponder.secretlab.ca> <20110627232903.GB7736@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20110627232903.GB7736@n2100.arm.linux.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Russell King - ARM Linux Cc: Ohad Ben-Cohen , davinci-linux-open-source , Arnd Bergmann , Brian Swetland , Rusty Russell , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: linux-omap@vger.kernel.org On Mon, Jun 27, 2011 at 5:29 PM, Russell King - ARM Linux wrote: > On Mon, Jun 27, 2011 at 02:49:58PM -0600, Grant Likely wrote: >> > +struct { >> > + =A0 =A0 =A0char magic[4] =3D { 'R', 'P', 'R', 'C' }; >> > + =A0 =A0 =A0u32 version; >> > + =A0 =A0 =A0u32 header_len; >> > + =A0 =A0 =A0char header[...] =3D { header_len bytes of unformatted, t= extual header }; >> > + =A0 =A0 =A0struct section { >> > + =A0 =A0 =A0 =A0 =A0u32 type; >> > + =A0 =A0 =A0 =A0 =A0u64 da; >> > + =A0 =A0 =A0 =A0 =A0u32 len; >> > + =A0 =A0 =A0 =A0 =A0u8 content[...] =3D { len bytes of binary data }; >> > + =A0 =A0 =A0} [ no limit on number of sections ]; >> > +} __packed; >> >> Other have commented on the image format, so I'll skip this bit other >> than saying that I agree it would be great to have a common format. > > (Don't have the original message to reply to...) > > Do we really want to end up with header being 5 bytes, header_len set > as 5, and having to load/store all this data using byte loads/stores ? > > If we don't want that, then I suggest we get rid of the packed attribute, > and require stuff to be naturally aligned. > > First issue is that struct section could be much better layed out: > > struct section { > =A0 =A0 =A0 =A0u32 type; > =A0 =A0 =A0 =A0u32 len; > =A0 =A0 =A0 =A0u64 da; > =A0 =A0 =A0 =A0u8 content[]; > }; > > and require sizeof(struct section) % sizeof(u64) =3D=3D 0 - iow, to find > the next section, round len up to sizeof(u64). =A0Ditto for the header. Hopefully this will all be moot since it has been proposed to use elf images directly. g. -- = Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.