From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRRJ7-0002rr-Q4 for qemu-devel@nongnu.org; Mon, 17 Aug 2015 16:47:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRRJ6-0007bZ-JH for qemu-devel@nongnu.org; Mon, 17 Aug 2015 16:47:01 -0400 Date: Mon, 17 Aug 2015 22:46:57 +0200 From: Aurelien Jarno Message-ID: <20150817204657.GB20321@aurel32.net> References: <1439389236-22158-1-git-send-email-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439389236-22158-1-git-send-email-linux@roeck-us.net> Subject: Re: [Qemu-devel] [PATCH] sh4: Fix initramfs initialization for endiannes-mismatched targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Guenter Roeck Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org On 2015-08-12 07:20, Guenter Roeck wrote: > If host and target endianness does not match, loding an initramfs does not work. > Fix by writing boot parameters with appropriate endianness conversion. > > Signed-off-by: Guenter Roeck > --- > hw/sh4/r2d.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c > index 5e22ed7..3b0b2ec 100644 > --- a/hw/sh4/r2d.c > +++ b/hw/sh4/r2d.c > @@ -338,9 +338,9 @@ static void r2d_init(MachineState *machine) > } > > /* initialization which should be done by firmware */ > - boot_params.loader_type = 1; > - boot_params.initrd_start = INITRD_LOAD_OFFSET; > - boot_params.initrd_size = initrd_size; > + boot_params.loader_type = tswap32(1); > + boot_params.initrd_start = tswap32(INITRD_LOAD_OFFSET); > + boot_params.initrd_size = tswap32(initrd_size); > } > > if (kernel_cmdline) { Reviewed-by: Aurelien Jarno Good catch. I have added it to my sh4-next queue: http://git.aurel32.net/?p=qemu.git;a=shortlog;h=refs/heads/sh4-next -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net