From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVDzs-0007qZ-AQ for qemu-devel@nongnu.org; Fri, 28 Aug 2015 03:22:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVDzp-0006GF-44 for qemu-devel@nongnu.org; Fri, 28 Aug 2015 03:22:48 -0400 Message-ID: <55E00C42.2060400@sysgo.com> Date: Fri, 28 Aug 2015 09:22:42 +0200 From: Rudolf Marek MIME-Version: 1.0 References: <55CDD5E2.60405@sysgo.com> <55D71A96.70703@sysgo.com> <55DD83BD.2000308@suse.de> In-Reply-To: <55DD83BD.2000308@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] e500 ATMU register reads broken List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc , qemu-devel@nongnu.org Hi all, > Sorry for the long delay. Please CC qemu-ppc@nongnu.org on the next > submission, so that more PPC people have the chance to review the patch= ;). I see, I missed this mailing list - http://wiki.qemu.org/Contribute/SubmitAPatch As it do not not mention it. > Thanks, applied to ppc-next. Thanks! Will it be part of 2.4.x ? > Would you mind to follow up with a patch to the mpc8544ds machine file > that programs the ATMUs on init? I also use -kernel option. Hm I don't know how to program it in QEMU internally, what I'm currently = doing=20 in my code is bellow. The PCI_IO and PCI_MEM are the addresses of the translation windows in CP= U=20 space. I guess you can set them to match MPC8544ds Here is my current WIP= code=20 to do it: /* Disable all translations */ pit[0].war =3D 0; pit[1].war =3D 0; pit[2].war =3D 0; pot[0].war =3D 0; pot[1].war =3D 0; pot[2].war =3D 0; pot[3].war =3D 0; pot[4].war =3D 0; __asm__ volatile ("eieio"); /* setup the PCI inbound window 1:1 for first 2GB */ pit[0].war =3D 0; pit[0].ar =3D 0; pit[0].war =3D 0; pit[0].wbear =3D 0; /* 2^31 is 2GB, it is -1 encoded as 30 */ pit[0].war =3D PIWAR_EN | PIWAR_PF | PIWAR_LOCAL | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP | 30; /* setup the outbound translation as 1:1 256M */ pot[1].war =3D 0; pot[1].ear =3D 0; /* 2^28 is 256M it is -1 encoded as 27 */ pot[1].wbar =3D (PCI_MEM >> 12) & 0x000fffff; pot[1].ar =3D (PCI_MEM >> 12) & 0x000fffff; __asm__ volatile ("eieio"); pot[1].war =3D POWAR_EN | POWAR_MEM_READ | POWAR_MEM_WRITE | 27; /* Outbound IO port window size of window is 64K */ pot[2].war =3D 0; pot[2].ear =3D 0; pot[2].wbar =3D (PCI_IO >> 12) & 0x000fffff; pot[2].ar =3D 0; __asm__ volatile ("eieio"); /* 2^16 is 64K it is -1 encoded as 15 */ pot[2].war =3D POWAR_EN | POWAR_IO_READ | POWAR_IO_WRITE | 15; It programs the 1:1 PCI to CPU for 2GB of RAM. And it programs the PCI MM= IO=20 window 1:1 with start PCI_MEM size 256M and it places the i/o ports at PC= I_IO. In theory you should also enable the MEM decoder of the PCI root device, = but I=20 think QEMU does not need it (see u-boot what it is doing). Feel free to use this code as a template for the QEMU support, Thanks Rudolf - S p=C5=99=C3=A1telsk=C3=BDm pozdravem / Best regards / Mit freundlichen G= r=C3=BC=C3=9Fen Ing. Rudolf Marek SYSGO s.r.o. Zelen=C3=BD pruh 99 CZ-14800 Praha 4 Phone: +420 222138 111, +49 6136 9948 111 Fax: +420 296374890, +49 6136 9948 1 111 rudolf.marek@sysgo.com http://www.sysgo.com | http://www.elinos.com | http://www.pikeos.com