From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC18u-0004hC-RQ for qemu-devel@nongnu.org; Mon, 06 Jul 2015 03:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC18r-0006Ly-Ip for qemu-devel@nongnu.org; Mon, 06 Jul 2015 03:48:44 -0400 Received: from mail-la0-x22b.google.com ([2a00:1450:4010:c03::22b]:35816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC18r-0006Lt-5D for qemu-devel@nongnu.org; Mon, 06 Jul 2015 03:48:41 -0400 Received: by lagh6 with SMTP id h6so144060150lag.2 for ; Mon, 06 Jul 2015 00:48:40 -0700 (PDT) Date: Mon, 6 Jul 2015 10:55:20 +0300 From: Antony Pavlov Message-Id: <20150706105520.dc7563825f29d33e62d07a37@gmail.com> In-Reply-To: References: <16270e45922ea6a8c8622e76f702c46ce7ce15ac.1435723168.git.serge.vakulenko@gmail.com> <20150702085640.9fdcf1295876818e4ee75ee9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH pic32 v2 5/5] Two new machine platforms: pic32mz7 and pic32mz. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Vakulenko Cc: Leon Alrae , qemu-devel@nongnu.org, Aurelien Jarno On Sun, 5 Jul 2015 21:27:04 -0700 Serge Vakulenko wrote: > On Wed, Jul 1, 2015 at 10:56 PM, Antony Pavlov = wrote: > > On Tue, 30 Jun 2015 21:12:34 -0700 > > Serge Vakulenko wrote: > > > >> Signed-off-by: Serge Vakulenko > >> --- > >> hw/mips/Makefile.objs | 3 + > >> hw/mips/mips_pic32mx7.c | 1652 +++++++++++++++++++++++++ > >> hw/mips/mips_pic32mz.c | 2840 ++++++++++++++++++++++++++++++++++= +++++++++ > >> hw/mips/pic32_ethernet.c | 557 +++++++++ > >> hw/mips/pic32_gpio.c | 39 + > >> hw/mips/pic32_load_hex.c | 238 ++++ > >> hw/mips/pic32_peripherals.h | 210 ++++ > >> hw/mips/pic32_sdcard.c | 428 +++++++ > >> hw/mips/pic32_spi.c | 121 ++ > >> hw/mips/pic32_uart.c | 228 ++++ > >> hw/mips/pic32mx.h | 1290 ++++++++++++++++++++ > >> hw/mips/pic32mz.h | 2093 +++++++++++++++++++++++++++++++ > >> 12 files changed, 9699 insertions(+) > >> create mode 100644 hw/mips/mips_pic32mx7.c > >> create mode 100644 hw/mips/mips_pic32mz.c > >> create mode 100644 hw/mips/pic32_ethernet.c > >> create mode 100644 hw/mips/pic32_gpio.c > >> create mode 100644 hw/mips/pic32_load_hex.c > >> create mode 100644 hw/mips/pic32_peripherals.h > >> create mode 100644 hw/mips/pic32_sdcard.c > >> create mode 100644 hw/mips/pic32_spi.c > >> create mode 100644 hw/mips/pic32_uart.c > >> create mode 100644 hw/mips/pic32mx.h > >> create mode 100644 hw/mips/pic32mz.h > >> > >> diff --git a/hw/mips/Makefile.objs b/hw/mips/Makefile.objs > >> index 9633f3a..dcbaec9 100644 > >> --- a/hw/mips/Makefile.objs > >> +++ b/hw/mips/Makefile.objs > >> @@ -3,3 +3,6 @@ obj-y +=3D addr.o cputimer.o mips_int.o > >> obj-$(CONFIG_JAZZ) +=3D mips_jazz.o > >> obj-$(CONFIG_FULONG) +=3D mips_fulong2e.o > >> obj-y +=3D gt64xxx_pci.o > >> +obj-y +=3D mips_pic32mz.o mips_pic32mx7.o > >> +obj-y +=3D pic32_load_hex.o pic32_sdcard.o pic32_spi.o pic32_uart.o p= ic32_gpio.o > >> +obj-y +=3D pic32_ethernet.o > > > > Can we move mips-unrelated stuff to the appropriate dirs? > > E.g. pic32_gpio.c can to go to hw/gpio. >=20 > All these files are pic32-related. They depend on pic32_t data > structure declared in pic32_peripherals.h and register definitions in > pic32mx.h and pic32mz.h. I see no point to move them around. But why hw/gpio/pic32_gpio.c can't include pic32_peripherals.h? You can see that mainline qemu.git/hw/mips/ does not contain any header fil= e, so just put your header files into the proper dir (I suppose qemu.git/inclu= de/hw/mips). > > Also please use separate patch for every peripheral controller (see Aur= elien's comment). >=20 > Agreed. >=20 > >> diff --git a/hw/mips/mips_pic32mx7.c b/hw/mips/mips_pic32mx7.c > >> new file mode 100644 > >> index 0000000..1d8ffb5 > >> --- /dev/null > >> +++ b/hw/mips/mips_pic32mx7.c > >> @@ -0,0 +1,1652 @@ > >> +/* > >> + * QEMU support for Microchip PIC32MX7 microcontroller. > >> + * > >> + * Copyright (c) 2015 Serge Vakulenko > >> + * > >> + * Permission is hereby granted, free of charge, to any person obtain= ing a copy > >> + * of this software and associated documentation files (the "Software= "), to deal > >> + * in the Software without restriction, including without limitation = the rights > >> + * to use, copy, modify, merge, publish, distribute, sublicense, and/= or sell > >> + * copies of the Software, and to permit persons to whom the Software= is > >> + * furnished to do so, subject to the following conditions: > >> + * > >> + * The above copyright notice and this permission notice shall be inc= luded in > >> + * all copies or substantial portions of the Software. > >> + * > >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EX= PRESS OR > >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTAB= ILITY, > >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT = SHALL > >> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES = OR OTHER > >> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, AR= ISING FROM, > >> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL= INGS IN > >> + * THE SOFTWARE. > >> + */ > >> + > >> +/* Only 32-bit little endian mode supported. */ > >> +#include "config.h" > >> +#if !defined TARGET_MIPS64 && !defined TARGET_WORDS_BIGENDIAN > > > > Please don't use C preprocessor directive for conditional compilation o= f the whole file. > > Use Makefile instead. See CONFIG_FULONG for example (fulong2e is mips64= le-only). >=20 > Makes sense. >=20 > Thanks, > --Serge >=20 > > -- > > Best regards, > > Antony Pavlov --=20 --=A0 Best regards, =A0 Antony Pavlov