diff options
author | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-28 19:24:52 +0000 |
---|---|---|
committer | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-28 19:24:52 +0000 |
commit | 8e129e0748f866d730f1e39bff296219fedac244 (patch) | |
tree | 8d36251447df9838009b97317a5d4996d7c444e2 /hw/palm.c | |
parent | 38a34e1d7aa1ac64c2615952ee732da47eee9f14 (diff) |
Handle MMC card insertion/removal/readonly signals.
Hook them up to Palm T|E GPIOs.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3471 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/palm.c')
-rw-r--r-- | hw/palm.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -57,6 +57,24 @@ static CPUWriteMemoryFunc *static_writefn[] = { }; /* Palm Tunsgten|E support */ + +/* Shared GPIOs */ +#define PALMTE_USBDETECT_GPIO 0 +#define PALMTE_USB_OR_DC_GPIO 1 +#define PALMTE_TSC_GPIO 4 +#define PALMTE_PINTDAV_GPIO 6 +#define PALMTE_MMC_WP_GPIO 8 +#define PALMTE_MMC_POWER_GPIO 9 +#define PALMTE_HDQ_GPIO 11 +#define PALMTE_HEADPHONES_GPIO 14 +#define PALMTE_SPEAKER_GPIO 15 +/* MPU private GPIOs */ +#define PALMTE_DC_GPIO 2 +#define PALMTE_MMC_SWITCH_GPIO 4 +#define PALMTE_MMC1_GPIO 6 +#define PALMTE_MMC2_GPIO 7 +#define PALMTE_MMC3_GPIO 11 + static void palmte_microwire_setup(struct omap_mpu_state_s *cpu) { } @@ -90,6 +108,14 @@ static void palmte_button_event(void *opaque, int keycode) !(keycode & 0x80)); } +static void palmte_mmc_cover(void *opaque, int line, int level) +{ + struct omap_mpu_state_s *cpu = (struct omap_mpu_state_s *) opaque; + + qemu_set_irq(omap_mpuio_in_get(cpu->mpuio)[PALMTE_MMC_SWITCH_GPIO], + !level); +} + static void palmte_init(int ram_size, int vga_ram_size, int boot_device, DisplayState *ds, const char **fd_filename, int snapshot, const char *kernel_filename, const char *kernel_cmdline, @@ -132,6 +158,9 @@ static void palmte_init(int ram_size, int vga_ram_size, int boot_device, qemu_add_kbd_event_handler(palmte_button_event, cpu); + omap_mmc_handlers(cpu->mmc, 0, + qemu_allocate_irqs(palmte_mmc_cover, cpu, 1)[0]); + /* Setup initial (reset) machine state */ if (nb_option_roms) { rom_size = get_image_size(option_rom[0]); |