From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LN9VH-00048R-Cc for qemu-devel@nongnu.org; Wed, 14 Jan 2009 12:26:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LN9VD-00043o-E6 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 12:26:04 -0500 Received: from [199.232.76.173] (port=34346 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN9VD-00043Y-7A for qemu-devel@nongnu.org; Wed, 14 Jan 2009 12:26:03 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]:5431) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LN9VC-0002pr-Jv for qemu-devel@nongnu.org; Wed, 14 Jan 2009 12:26:03 -0500 Received: by ug-out-1314.google.com with SMTP id 29so424980ugc.36 for ; Wed, 14 Jan 2009 09:26:01 -0800 (PST) From: Marek Vasut Subject: Re: [Qemu-devel] [PATCH] Add Palm Tungsten|C support Date: Wed, 14 Jan 2009 18:26:00 +0100 References: <5e26b58e0901140443k5a35224j8f589e100a79978d@mail.gmail.com> <20090114161725.GL26085@game.jcrosoft.org> <200901141808.40974.marek.vasut@gmail.com> In-Reply-To: <200901141808.40974.marek.vasut@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_qAibJonQzaMxVjW" Message-Id: <200901141826.02098.marek.vasut@gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jean-Christophe PLAGNIOL-VILLARD Cc: qemu-devel@nongnu.org --Boundary-00=_qAibJonQzaMxVjW Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 14 of January 2009 18:08:40 Marek Vasut wrote: > On Wednesday 14 of January 2009 17:17:25 Jean-Christophe PLAGNIOL-VILLARD > > wrote: > > On 17:23 Wed 14 Jan , Marek Vasut wrote: > > > On Wednesday 14 of January 2009 17:02:05 Jean-Christophe > > > PLAGNIOL-VILLARD > > > > > > wrote: > > > > On 16:20 Wed 14 Jan , Marek Va=C5=A1ut wrote: > > > > > Hi, > > > > > > > > > > this patch adds Palm TC support. It's a PXA based handheld device > > > > > (unlike PalmTE defined in palm.c which is OMAP) so I decided to > > > > > separate these and create new palmpxa.c . Near future plan is to > > > > > add basic support for other pxa-based palm models as well. Please > > > > > consider applying. > > > > > > > > IIRC some hacker port u-boot on it maybe you could try it > > > > > > uboot on what? palmtc? Nikolay ported uboot on palmt2, I ported it to > > > palmz71. There is also port of uboot for palmt3, but there never was > > > port for palmtc. Actually PalmOS can boot to some place even on this > > > basic setup. > > > > I known about the Z71 but we report me that some hacker work on the TC > > but I never see or search the patches > > Im not really sure I got your point, but I'm working on the palmtc linux > port and I know of noone else who does work in it. Also, I added some code > to old qemu fork in palmlinux project. > > > Best Regards, > > J. btw here is a new version of the patch, you should be OK with this one. --Boundary-00=_qAibJonQzaMxVjW Content-Type: text/x-diff; charset="iso 8859-15"; name="0001-add-palmtc-v2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-add-palmtc-v2.diff" Index: Makefile.target =================================================================== --- Makefile.target (revision 6290) +++ Makefile.target (working copy) @@ -716,6 +716,7 @@ OBJS+= tsc2005.o bt-hci-csr.o OBJS+= mst_fpga.o mainstone.o OBJS+= musicpal.o pflash_cfi02.o +OBJS+= palmpxa.o CPPFLAGS += -DHAS_AUDIO endif ifeq ($(TARGET_BASE_ARCH), sh4) Index: hw/boards.h =================================================================== --- hw/boards.h (revision 6290) +++ hw/boards.h (working copy) @@ -95,6 +95,9 @@ /* palm.c */ extern QEMUMachine palmte_machine; +/* palmpxa.c */ +extern QEMUMachine palmtc_machine; + /* nseries.c */ extern QEMUMachine n800_machine; extern QEMUMachine n810_machine; Index: target-arm/machine.c =================================================================== --- target-arm/machine.c (revision 6290) +++ target-arm/machine.c (working copy) @@ -14,6 +14,7 @@ qemu_register_machine(&sx1_machine_v1); qemu_register_machine(&sx1_machine_v2); qemu_register_machine(&palmte_machine); + qemu_register_machine(&palmtc_machine); qemu_register_machine(&n800_machine); qemu_register_machine(&n810_machine); qemu_register_machine(&lm3s811evb_machine); Index: hw/palmpxa.c =================================================================== --- hw/palmpxa.c (revision 0) +++ hw/palmpxa.c (revision 0) @@ -0,0 +1,64 @@ +/* + * Intel PXA2xx-based Palm PDA Platforms + * + * Copyright (c) 2009 by Marek Vasut + * + * Code based on spitz platform by Andrzej Zaborowski + * + * This code is licensed under the GNU GPL v2. + */ + +#include "hw.h" +#include "pxa.h" +#include "net.h" +#include "flash.h" +#include "sysemu.h" +#include "devices.h" +#include "boards.h" + +/* Platform specific */ +#define PALMTC_ROM (0x01000000) /* 16 Mb of ROM */ +#define PALMTC_RAM (0x04000000) /* 64 Mb of RAM */ + +/* GPIOs */ +#define PALMTC_GPIO_nPOWER 9 + +static const int sector_len = 128 * 1024; + +static void palmtc_init(ram_addr_t ram_size, int vga_ram_size, + const char *boot_device, DisplayState *ds, + const char *kernel_filename, const char *kernel_cmdline, + const char *initrd_filename, const char *cpu_model) +{ + struct pxa2xx_state_s *cpu; + int index; + + /* CPU */ + cpu = pxa255_init(PALMTC_RAM, ds); + + /* Onboard FlashROM */ + index = drive_get_index(IF_PFLASH, 0, 0); + if (index == -1) { + fprintf(stderr, "A flash image must be given with the " + "'pflash' parameter\n"); + exit(1); + } + + if (!pflash_cfi01_register(0x00000000, qemu_ram_alloc(PALMTC_ROM), + drives_table[index].bdrv, sector_len, PALMTC_ROM / sector_len, + 2, 0, 0, 0, 0)) { + fprintf(stderr, "qemu: Error registering flash memory.\n"); + exit(1); + } + + /* Deassert power button */ + qemu_set_irq(pxa2xx_gpio_in_get(cpu->gpio)[PALMTC_GPIO_nPOWER], 1); +} + +QEMUMachine palmtc_machine = { + .name = "palmtc", + .desc = "Palm Tungsten|C (PXA255)", + .init = palmtc_init, + .ram_require = (PALMTC_RAM + PALMTC_ROM + PXA2XX_INTERNAL_SIZE) | + RAMSIZE_FIXED, +}; --Boundary-00=_qAibJonQzaMxVjW--