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.
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.
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,
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.
22
21
#include "audio/audio.h"
32
32
return *val >> ((offset & 3) << 3);
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
37
uint32_t *val = (uint32_t *) opaque;
37
38
return *val >> ((offset & 1) << 3);
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)
41
43
uint32_t *val = (uint32_t *) opaque;
42
44
return *val >> ((offset & 0) << 3);
82
84
#define PALMTE_MMC2_GPIO 7
83
85
#define PALMTE_MMC3_GPIO 11
87
static struct mouse_transform_info_s palmte_pointercal = {
90
.a = { -5909, 8, 22465308, 104, 7644, -1219972, 65536 },
85
93
static void palmte_microwire_setup(struct omap_mpu_state_s *cpu)
87
95
struct uwire_slave_s *tsc;
97
105
omap_uwire_attach(cpu->microwire, tsc, 0);
98
106
omap_mcbsp_i2s_attach(cpu->mcbsp1, tsc210x_codec(tsc));
108
tsc210x_set_transform(tsc, &palmte_pointercal);
183
193
qemu_irq_raise(omap_mpuio_in_get(cpu->mpuio)[11]);
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,
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)
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;
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();
202
219
if (ram_size < flash_size + sdram_size + OMAP15XX_SRAM_SIZE) {
203
220
fprintf(stderr, "This architecture uses %i bytes of memory\n",
208
cpu = omap310_mpu_init(sdram_size, ds, cpu_model);
225
cpu = omap310_mpu_init(sdram_size, cpu_model);
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;
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);
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);
262
285
QEMUMachine palmte_machine = {
264
"Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
287
.desc = "Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
289
.ram_require = (0x02000000 + 0x00800000 + OMAP15XX_SRAM_SIZE) |