~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to hw/palm.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU General Public License as
8
 
 * published by the Free Software Foundation; either version 2 of
9
 
 * the License, or (at your option) any later version.
 
8
 * published by the Free Software Foundation; either version 2 or
 
9
 * (at your option) version 3 of the License.
10
10
 *
11
11
 * This program is distributed in the hope that it will be useful,
12
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
14
 * GNU General Public License for more details.
15
15
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19
 
 * MA 02111-1307 USA
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
18
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
19
 */
21
20
#include "hw.h"
22
21
#include "audio/audio.h"
25
24
#include "omap.h"
26
25
#include "boards.h"
27
26
#include "arm-misc.h"
 
27
#include "devices.h"
28
28
 
29
29
static uint32_t static_readb(void *opaque, target_phys_addr_t offset)
30
30
{
32
32
    return *val >> ((offset & 3) << 3);
33
33
}
34
34
 
35
 
static uint32_t static_readh(void *opaque, target_phys_addr_t offset) {
 
35
static uint32_t static_readh(void *opaque, target_phys_addr_t offset)
 
36
{
36
37
    uint32_t *val = (uint32_t *) opaque;
37
38
    return *val >> ((offset & 1) << 3);
38
39
}
39
40
 
40
 
static uint32_t static_readw(void *opaque, target_phys_addr_t offset) {
 
41
static uint32_t static_readw(void *opaque, target_phys_addr_t offset)
 
42
{
41
43
    uint32_t *val = (uint32_t *) opaque;
42
44
    return *val >> ((offset & 0) << 3);
43
45
}
82
84
#define PALMTE_MMC2_GPIO        7
83
85
#define PALMTE_MMC3_GPIO        11
84
86
 
 
87
static struct mouse_transform_info_s palmte_pointercal = {
 
88
    .x = 320,
 
89
    .y = 320,
 
90
    .a = { -5909, 8, 22465308, 104, 7644, -1219972, 65536 },
 
91
};
 
92
 
85
93
static void palmte_microwire_setup(struct omap_mpu_state_s *cpu)
86
94
{
87
95
    struct uwire_slave_s *tsc;
96
104
 
97
105
    omap_uwire_attach(cpu->microwire, tsc, 0);
98
106
    omap_mcbsp_i2s_attach(cpu->mcbsp1, tsc210x_codec(tsc));
 
107
 
 
108
    tsc210x_set_transform(tsc, &palmte_pointercal);
99
109
}
100
110
 
101
111
static struct {
183
193
    qemu_irq_raise(omap_mpuio_in_get(cpu->mpuio)[11]);
184
194
}
185
195
 
186
 
static void palmte_init(int ram_size, int vga_ram_size,
187
 
                const char *boot_device, DisplayState *ds,
 
196
static struct arm_boot_info palmte_binfo = {
 
197
    .loader_start = OMAP_EMIFF_BASE,
 
198
    .ram_size = 0x02000000,
 
199
    .board_id = 0x331,
 
200
};
 
201
 
 
202
static void palmte_init(ram_addr_t ram_size, int vga_ram_size,
 
203
                const char *boot_device,
188
204
                const char *kernel_filename, const char *kernel_cmdline,
189
205
                const char *initrd_filename, const char *cpu_model)
190
206
{
191
207
    struct omap_mpu_state_s *cpu;
192
208
    int flash_size = 0x00800000;
193
 
    int sdram_size = 0x02000000;
 
209
    int sdram_size = palmte_binfo.ram_size;
194
210
    int io;
195
211
    static uint32_t cs0val = 0xffffffff;
196
212
    static uint32_t cs1val = 0x0000e1a0;
198
214
    static uint32_t cs3val = 0xe1a0e1a0;
199
215
    ram_addr_t phys_flash;
200
216
    int rom_size, rom_loaded = 0;
 
217
    DisplayState *ds = get_displaystate();
201
218
 
202
219
    if (ram_size < flash_size + sdram_size + OMAP15XX_SRAM_SIZE) {
203
220
        fprintf(stderr, "This architecture uses %i bytes of memory\n",
205
222
        exit(1);
206
223
    }
207
224
 
208
 
    cpu = omap310_mpu_init(sdram_size, ds, cpu_model);
 
225
    cpu = omap310_mpu_init(sdram_size, cpu_model);
209
226
 
210
227
    /* External Flash (EMIFS) */
211
228
    cpu_register_physical_memory(OMAP_CS0_BASE, flash_size,
250
267
    /* Load the kernel.  */
251
268
    if (kernel_filename) {
252
269
        /* Start at bootloader.  */
253
 
        cpu->env->regs[15] = OMAP_EMIFF_BASE;
 
270
        cpu->env->regs[15] = palmte_binfo.loader_start;
254
271
 
255
 
        arm_load_kernel(cpu->env, sdram_size, kernel_filename, kernel_cmdline,
256
 
                        initrd_filename, 0x331, OMAP_EMIFF_BASE);
 
272
        palmte_binfo.kernel_filename = kernel_filename;
 
273
        palmte_binfo.kernel_cmdline = kernel_cmdline;
 
274
        palmte_binfo.initrd_filename = initrd_filename;
 
275
        arm_load_kernel(cpu->env, &palmte_binfo);
257
276
    }
258
277
 
259
 
    dpy_resize(ds, 320, 320);
 
278
    /* FIXME: We shouldn't really be doing this here.  The LCD controller
 
279
       will set the size once configured, so this just sets an initial
 
280
       size until the guest activates the display.  */
 
281
    ds->surface = qemu_resize_displaysurface(ds->surface, 320, 320, 32, 4 * 320);
 
282
    dpy_resize(ds);
260
283
}
261
284
 
262
285
QEMUMachine palmte_machine = {
263
 
    "cheetah",
264
 
    "Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
265
 
    palmte_init,
 
286
    .name = "cheetah",
 
287
    .desc = "Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
 
288
    .init = palmte_init,
 
289
    .ram_require = (0x02000000 + 0x00800000 + OMAP15XX_SRAM_SIZE) |
 
290
            RAMSIZE_FIXED,
266
291
};