Skip to contentSkip to conversation

Add Palm Tungsten|C support

PATCH In review Marek Vašut 2 participants 6 messages Jan 14, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add Palm Tungsten|C support

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.

Thanks
Marek

Makefile.target +1 -0
Index: Makefile.target
===================================================================
@@ -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)
boards.h +3 -0
Index: hw/boards.h
===================================================================
@@ -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;
palmpxa.c +69 -0

69 lines not on this page · raw message

#1 lore raw
Quoted 7 lines · Marek Vašut

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

and please update the doc too

Best Regards,
J.

Quoted 58 lines

Thanks
Marek

Index: Makefile.target
===================================================================

Makefile.target +1 -0
@@ -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
===================================================================

boards.h +3 -0
@@ -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: hw/palmpxa.c
===================================================================

palmpxa.c +22 -0
@@ -0,0 +1,69 @@
+/*
+ * Intel PXA2xx-based Palm PDA Platforms
+ *
+ * Copyright (c) 2009 by Marek Vasut <[email protected]>
+ *
+ * Code based on spitz platform by Andrzej Zaborowski <[email protected]>
+ *
+ * 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"
+
+#define PALMTC_GPIO_nPOWER	9
+
+static const int sector_len = 128 * 1024;
+

palmpxa.c line 32

Quoted 10 lines
palmpxa.c +10 -0
+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;
+
+	uint32_t palmtc_rom = 0x01000000;	/* 16 Mb of ROM */
+	uint32_t palmtc_ram = 0x04000000;	/* 64 Mb of RAM */

why not define macro of the size and use it in the ram_require

palmpxa.c line 38

Quoted 6 lines
palmpxa.c +6 -0
+
+	if (ram_size < (palmtc_ram + palmtc_rom + PXA2XX_INTERNAL_SIZE)) {
+		fprintf(stderr, "This platform requires %i bytes of memory\n",
+			palmtc_ram + palmtc_rom + PXA2XX_INTERNAL_SIZE);
+		exit(1);
+	}

no need will be check agoist the ram_require

Quoted 8 lines
palmpxa.c +8 -0
+
+	/* 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 "

palmpxa.c line 56

Quoted 10 lines
palmpxa.c +10 -0
+			"'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);
+	}

could you specify which flash is used on the rela hard?

palmpxa.c line 61

Quoted 5 lines
palmpxa.c +5 -0
+
+	/* Deassert power button */
+	qemu_set_irq(pxa2xx_gpio_in_get(cpu->gpio)[PALMTC_GPIO_nPOWER], 1);
+
+	cpu->env->regs[15] = 0x00000000;	/* Start from ROM */

why don't you have the -kernel option support?
Best Regards,
J.

#2 lore raw
Quoted 9 lines · On Wednesday 14 of January 2009 17:02:05 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 6 lines · Marek Vašut

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.

Quoted 5 lines

and please update the doc too

Best Regards,
J.

#3 lore raw
Quoted 10 lines · Marek Vasut
Quoted 8 lines · On Wednesday 14 of January 2009 17:02:05 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 6 lines · Marek Vašut

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.

Quoted 5 lines
Quoted 1 line

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

Best Regards,
J.

#4 lore raw
Quoted 15 lines · On Wednesday 14 of January 2009 17:17:25 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 14 lines · Marek Vasut

On Wednesday 14 of January 2009 17:02:05 Jean-Christophe PLAGNIOL-VILLARD

Quoted 10 lines · wrote:
Quoted 7 lines · Marek Vašut

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

Quoted 7 lines
Quoted 4 lines

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.

Quoted 3 lines

Best Regards,
J.

#5 lore raw
Quoted 24 lines · 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

Quoted 21 lines · wrote:
Quoted 19 lines · Marek Vasut

On Wednesday 14 of January 2009 17:02:05 Jean-Christophe PLAGNIOL-VILLARD

Quoted 10 lines · wrote:
Quoted 7 lines · Marek Vašut

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.

Quoted 9 lines
Quoted 2 lines

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.

Quoted 2 lines

Best Regards,
J.

btw here is a new version of the patch, you should be OK with this one.

Makefile.target +1 -0
Index: Makefile.target
===================================================================
@@ -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)
boards.h +3 -0
Index: hw/boards.h
===================================================================
@@ -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;
machine.c +1 -0
Index: target-arm/machine.c
===================================================================
@@ -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);
palmpxa.c +64 -0

64 lines not on this page · raw message