Commit 3e3f67547b2007592960e5b2d01f53a1ee0d863a

Authored by balrog
1 parent 775616c3

Gumstix Verdex (ARM) board support by Thorsten Zitterell.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3732 c046a42c-6fe2-441c-8c8c-71466251a162
hw/boards.h
@@ -78,6 +78,7 @@ extern QEMUMachine palmte_machine; @@ -78,6 +78,7 @@ extern QEMUMachine palmte_machine;
78 78
79 /* gumstix.c */ 79 /* gumstix.c */
80 extern QEMUMachine connex_machine; 80 extern QEMUMachine connex_machine;
  81 +extern QEMUMachine verdex_machine;
81 82
82 /* stellaris.c */ 83 /* stellaris.c */
83 extern QEMUMachine lm3s811evb_machine; 84 extern QEMUMachine lm3s811evb_machine;
hw/gumstix.c
@@ -7,6 +7,29 @@ @@ -7,6 +7,29 @@
7 * 7 *
8 * This code is licensed under the GNU GPL v2. 8 * This code is licensed under the GNU GPL v2.
9 */ 9 */
  10 +
  11 +/*
  12 + * Example usage:
  13 + *
  14 + * connex:
  15 + * =======
  16 + * create image:
  17 + * # dd of=flash bs=1k count=16k if=/dev/zero
  18 + * # dd of=flash bs=1k conv=notrunc if=u-boot.bin
  19 + * # dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2
  20 + * start it:
  21 + * # qemu-system-arm -M connex -pflash flash -monitor null -nographic
  22 + *
  23 + * verdex:
  24 + * =======
  25 + * create image:
  26 + * # dd of=flash bs=1k count=32k if=/dev/zero
  27 + * # dd of=flash bs=1k conv=notrunc if=u-boot.bin
  28 + * # dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2
  29 + * # dd of=flash bs=1k conv=notrunc seek=31744 if=uImage
  30 + * start it:
  31 + * # qemu-system-arm -M verdex -pflash flash -monitor null -nographic -m 289
  32 + */
10 33
11 #include "hw.h" 34 #include "hw.h"
12 #include "pxa.h" 35 #include "pxa.h"
@@ -16,26 +39,24 @@ @@ -16,26 +39,24 @@
16 #include "devices.h" 39 #include "devices.h"
17 #include "boards.h" 40 #include "boards.h"
18 41
19 -/* Board init. */  
20 -enum gumstix_model_e { connex };  
21 -  
22 -static void gumstix_common_init(int ram_size, int vga_ram_size,  
23 - DisplayState *ds, const char *kernel_filename,  
24 - const char *kernel_cmdline, const char *initrd_filename,  
25 - const char *cpu_model, enum gumstix_model_e model) 42 +static void connex_init(int ram_size, int vga_ram_size,
  43 + const char *boot_device, DisplayState *ds,
  44 + const char **fd_filename, int snapshot,
  45 + const char *kernel_filename, const char *kernel_cmdline,
  46 + const char *initrd_filename, const char *cpu_model)
26 { 47 {
27 struct pxa2xx_state_s *cpu; 48 struct pxa2xx_state_s *cpu;
28 49
29 - uint32_t gumstix_rom = 0x02000000;  
30 - uint32_t gumstix_ram = 0x08000000; 50 + uint32_t connex_rom = 0x01000000;
  51 + uint32_t connex_ram = 0x04000000;
31 52
32 - if (ram_size < (gumstix_ram + gumstix_rom + PXA2XX_INTERNAL_SIZE)) { 53 + if (ram_size < (connex_ram + connex_rom + PXA2XX_INTERNAL_SIZE)) {
33 fprintf(stderr, "This platform requires %i bytes of memory\n", 54 fprintf(stderr, "This platform requires %i bytes of memory\n",
34 - gumstix_ram + gumstix_rom + PXA2XX_INTERNAL_SIZE); 55 + connex_ram + connex_rom + PXA2XX_INTERNAL_SIZE);
35 exit(1); 56 exit(1);
36 } 57 }
37 58
38 - cpu = pxa255_init(gumstix_ram, ds); 59 + cpu = pxa255_init(connex_ram, ds);
39 60
40 if (pflash_table[0] == NULL) { 61 if (pflash_table[0] == NULL) {
41 fprintf(stderr, "A flash image must be given with the " 62 fprintf(stderr, "A flash image must be given with the "
@@ -43,9 +64,9 @@ static void gumstix_common_init(int ram_size, int vga_ram_size, @@ -43,9 +64,9 @@ static void gumstix_common_init(int ram_size, int vga_ram_size,
43 exit(1); 64 exit(1);
44 } 65 }
45 66
46 - if (!pflash_register(0x00000000, gumstix_ram + PXA2XX_INTERNAL_SIZE, 67 + if (!pflash_register(0x00000000, connex_ram + PXA2XX_INTERNAL_SIZE,
47 pflash_table[0], 128 * 1024, 128, 2, 0, 0, 0, 0)) { 68 pflash_table[0], 128 * 1024, 128, 2, 0, 0, 0, 0)) {
48 - fprintf(stderr, "qemu: Error register flash memory.\n"); 69 + fprintf(stderr, "qemu: Error registering flash memory.\n");
49 exit(1); 70 exit(1);
50 } 71 }
51 72
@@ -56,13 +77,41 @@ static void gumstix_common_init(int ram_size, int vga_ram_size, @@ -56,13 +77,41 @@ static void gumstix_common_init(int ram_size, int vga_ram_size,
56 pxa2xx_gpio_in_get(cpu->gpio)[36]); 77 pxa2xx_gpio_in_get(cpu->gpio)[36]);
57 } 78 }
58 79
59 -static void connex_init(int ram_size, int vga_ram_size, 80 +static void verdex_init(int ram_size, int vga_ram_size,
60 const char *boot_device, DisplayState *ds, 81 const char *boot_device, DisplayState *ds,
61 const char *kernel_filename, const char *kernel_cmdline, 82 const char *kernel_filename, const char *kernel_cmdline,
62 const char *initrd_filename, const char *cpu_model) 83 const char *initrd_filename, const char *cpu_model)
63 { 84 {
64 - gumstix_common_init(ram_size, vga_ram_size, ds, kernel_filename,  
65 - kernel_cmdline, initrd_filename, cpu_model, connex); 85 + struct pxa2xx_state_s *cpu;
  86 +
  87 + uint32_t verdex_rom = 0x02000000;
  88 + uint32_t verdex_ram = 0x10000000;
  89 +
  90 + if (ram_size < (verdex_ram + verdex_rom + PXA2XX_INTERNAL_SIZE)) {
  91 + fprintf(stderr, "This platform requires %i bytes of memory\n",
  92 + verdex_ram + verdex_rom + PXA2XX_INTERNAL_SIZE);
  93 + exit(1);
  94 + }
  95 +
  96 + cpu = pxa270_init(verdex_ram, ds, "pxa270-c0");
  97 +
  98 + if (pflash_table[0] == NULL) {
  99 + fprintf(stderr, "A flash image must be given with the "
  100 + "'pflash' parameter\n");
  101 + exit(1);
  102 + }
  103 +
  104 + if (!pflash_register(0x00000000, verdex_ram + PXA2XX_INTERNAL_SIZE,
  105 + pflash_table[0], 128 * 1024, 256, 2, 0, 0, 0, 0)) {
  106 + fprintf(stderr, "qemu: Error registering flash memory.\n");
  107 + exit(1);
  108 + }
  109 +
  110 + cpu->env->regs[15] = 0x00000000;
  111 +
  112 + /* Interrupt line of NIC is connected to GPIO line 99 */
  113 + smc91c111_init(&nd_table[0], 0x04000300,
  114 + pxa2xx_gpio_in_get(cpu->gpio)[99]);
66 } 115 }
67 116
68 QEMUMachine connex_machine = { 117 QEMUMachine connex_machine = {
@@ -70,3 +119,9 @@ QEMUMachine connex_machine = { @@ -70,3 +119,9 @@ QEMUMachine connex_machine = {
70 "Gumstix Connex (PXA255)", 119 "Gumstix Connex (PXA255)",
71 connex_init, 120 connex_init,
72 }; 121 };
  122 +
  123 +QEMUMachine verdex_machine = {
  124 + "verdex",
  125 + "Gumstix Verdex (PXA270)",
  126 + verdex_init,
  127 +};
@@ -7450,6 +7450,7 @@ static void register_machines(void) @@ -7450,6 +7450,7 @@ static void register_machines(void)
7450 qemu_register_machine(&lm3s811evb_machine); 7450 qemu_register_machine(&lm3s811evb_machine);
7451 qemu_register_machine(&lm3s6965evb_machine); 7451 qemu_register_machine(&lm3s6965evb_machine);
7452 qemu_register_machine(&connex_machine); 7452 qemu_register_machine(&connex_machine);
  7453 + qemu_register_machine(&verdex_machine);
7453 #elif defined(TARGET_SH4) 7454 #elif defined(TARGET_SH4)
7454 qemu_register_machine(&shix_machine); 7455 qemu_register_machine(&shix_machine);
7455 qemu_register_machine(&r2d_machine); 7456 qemu_register_machine(&r2d_machine);