Revision 99a0949b hw/omap1.c
b/hw/omap1.c | ||
---|---|---|
27 | 27 |
#include "pc.h" |
28 | 28 |
|
29 | 29 |
/* Should signal the TCMI/GPMC */ |
30 |
uint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr)
|
|
30 |
uint32_t omap_badwidth_read8(void *opaque, a_target_phys_addr addr)
|
|
31 | 31 |
{ |
32 | 32 |
uint8_t ret; |
33 | 33 |
|
... | ... | |
36 | 36 |
return ret; |
37 | 37 |
} |
38 | 38 |
|
39 |
void omap_badwidth_write8(void *opaque, target_phys_addr_t addr,
|
|
39 |
void omap_badwidth_write8(void *opaque, a_target_phys_addr addr,
|
|
40 | 40 |
uint32_t value) |
41 | 41 |
{ |
42 | 42 |
uint8_t val8 = value; |
... | ... | |
45 | 45 |
cpu_physical_memory_write(addr, (void *) &val8, 1); |
46 | 46 |
} |
47 | 47 |
|
48 |
uint32_t omap_badwidth_read16(void *opaque, target_phys_addr_t addr)
|
|
48 |
uint32_t omap_badwidth_read16(void *opaque, a_target_phys_addr addr)
|
|
49 | 49 |
{ |
50 | 50 |
uint16_t ret; |
51 | 51 |
|
... | ... | |
54 | 54 |
return ret; |
55 | 55 |
} |
56 | 56 |
|
57 |
void omap_badwidth_write16(void *opaque, target_phys_addr_t addr,
|
|
57 |
void omap_badwidth_write16(void *opaque, a_target_phys_addr addr,
|
|
58 | 58 |
uint32_t value) |
59 | 59 |
{ |
60 | 60 |
uint16_t val16 = value; |
... | ... | |
63 | 63 |
cpu_physical_memory_write(addr, (void *) &val16, 2); |
64 | 64 |
} |
65 | 65 |
|
66 |
uint32_t omap_badwidth_read32(void *opaque, target_phys_addr_t addr)
|
|
66 |
uint32_t omap_badwidth_read32(void *opaque, a_target_phys_addr addr)
|
|
67 | 67 |
{ |
68 | 68 |
uint32_t ret; |
69 | 69 |
|
... | ... | |
72 | 72 |
return ret; |
73 | 73 |
} |
74 | 74 |
|
75 |
void omap_badwidth_write32(void *opaque, target_phys_addr_t addr,
|
|
75 |
void omap_badwidth_write32(void *opaque, a_target_phys_addr addr,
|
|
76 | 76 |
uint32_t value) |
77 | 77 |
{ |
78 | 78 |
OMAP_32B_REG(addr); |
... | ... | |
196 | 196 |
bank->irqs = (bank->inputs &= ~(1 << n)) | bank->swi; |
197 | 197 |
} |
198 | 198 |
|
199 |
static uint32_t omap_inth_read(void *opaque, target_phys_addr_t addr)
|
|
199 |
static uint32_t omap_inth_read(void *opaque, a_target_phys_addr addr)
|
|
200 | 200 |
{ |
201 | 201 |
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; |
202 | 202 |
int i, offset = addr; |
... | ... | |
273 | 273 |
return 0; |
274 | 274 |
} |
275 | 275 |
|
276 |
static void omap_inth_write(void *opaque, target_phys_addr_t addr,
|
|
276 |
static void omap_inth_write(void *opaque, a_target_phys_addr addr,
|
|
277 | 277 |
uint32_t value) |
278 | 278 |
{ |
279 | 279 |
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; |
... | ... | |
406 | 406 |
qemu_set_irq(s->parent_intr[1], 0); |
407 | 407 |
} |
408 | 408 |
|
409 |
struct omap_intr_handler_s *omap_inth_init(target_phys_addr_t base,
|
|
409 |
struct omap_intr_handler_s *omap_inth_init(a_target_phys_addr base,
|
|
410 | 410 |
unsigned long size, unsigned char nbanks, qemu_irq **pins, |
411 | 411 |
qemu_irq parent_irq, qemu_irq parent_fiq, omap_clk clk) |
412 | 412 |
{ |
... | ... | |
431 | 431 |
return s; |
432 | 432 |
} |
433 | 433 |
|
434 |
static uint32_t omap2_inth_read(void *opaque, target_phys_addr_t addr)
|
|
434 |
static uint32_t omap2_inth_read(void *opaque, a_target_phys_addr addr)
|
|
435 | 435 |
{ |
436 | 436 |
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; |
437 | 437 |
int offset = addr; |
... | ... | |
508 | 508 |
return 0; |
509 | 509 |
} |
510 | 510 |
|
511 |
static void omap2_inth_write(void *opaque, target_phys_addr_t addr,
|
|
511 |
static void omap2_inth_write(void *opaque, a_target_phys_addr addr,
|
|
512 | 512 |
uint32_t value) |
513 | 513 |
{ |
514 | 514 |
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; |
... | ... | |
624 | 624 |
omap2_inth_write, |
625 | 625 |
}; |
626 | 626 |
|
627 |
struct omap_intr_handler_s *omap2_inth_init(target_phys_addr_t base,
|
|
627 |
struct omap_intr_handler_s *omap2_inth_init(a_target_phys_addr base,
|
|
628 | 628 |
int size, int nbanks, qemu_irq **pins, |
629 | 629 |
qemu_irq parent_irq, qemu_irq parent_fiq, |
630 | 630 |
omap_clk fclk, omap_clk iclk) |
... | ... | |
748 | 748 |
timer->rate = omap_clk_getrate(timer->clk); |
749 | 749 |
} |
750 | 750 |
|
751 |
static uint32_t omap_mpu_timer_read(void *opaque, target_phys_addr_t addr)
|
|
751 |
static uint32_t omap_mpu_timer_read(void *opaque, a_target_phys_addr addr)
|
|
752 | 752 |
{ |
753 | 753 |
struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque; |
754 | 754 |
|
... | ... | |
767 | 767 |
return 0; |
768 | 768 |
} |
769 | 769 |
|
770 |
static void omap_mpu_timer_write(void *opaque, target_phys_addr_t addr,
|
|
770 |
static void omap_mpu_timer_write(void *opaque, a_target_phys_addr addr,
|
|
771 | 771 |
uint32_t value) |
772 | 772 |
{ |
773 | 773 |
struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque; |
... | ... | |
819 | 819 |
s->it_ena = 1; |
820 | 820 |
} |
821 | 821 |
|
822 |
struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base,
|
|
822 |
struct omap_mpu_timer_s *omap_mpu_timer_init(a_target_phys_addr base,
|
|
823 | 823 |
qemu_irq irq, omap_clk clk) |
824 | 824 |
{ |
825 | 825 |
int iomemtype; |
... | ... | |
849 | 849 |
int reset; |
850 | 850 |
}; |
851 | 851 |
|
852 |
static uint32_t omap_wd_timer_read(void *opaque, target_phys_addr_t addr)
|
|
852 |
static uint32_t omap_wd_timer_read(void *opaque, a_target_phys_addr addr)
|
|
853 | 853 |
{ |
854 | 854 |
struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque; |
855 | 855 |
|
... | ... | |
869 | 869 |
return 0; |
870 | 870 |
} |
871 | 871 |
|
872 |
static void omap_wd_timer_write(void *opaque, target_phys_addr_t addr,
|
|
872 |
static void omap_wd_timer_write(void *opaque, a_target_phys_addr addr,
|
|
873 | 873 |
uint32_t value) |
874 | 874 |
{ |
875 | 875 |
struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque; |
... | ... | |
943 | 943 |
omap_timer_update(&s->timer); |
944 | 944 |
} |
945 | 945 |
|
946 |
struct omap_watchdog_timer_s *omap_wd_timer_init(target_phys_addr_t base,
|
|
946 |
struct omap_watchdog_timer_s *omap_wd_timer_init(a_target_phys_addr base,
|
|
947 | 947 |
qemu_irq irq, omap_clk clk) |
948 | 948 |
{ |
949 | 949 |
int iomemtype; |
... | ... | |
968 | 968 |
struct omap_mpu_timer_s timer; |
969 | 969 |
}; |
970 | 970 |
|
971 |
static uint32_t omap_os_timer_read(void *opaque, target_phys_addr_t addr)
|
|
971 |
static uint32_t omap_os_timer_read(void *opaque, a_target_phys_addr addr)
|
|
972 | 972 |
{ |
973 | 973 |
struct omap_32khz_timer_s *s = (struct omap_32khz_timer_s *) opaque; |
974 | 974 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
990 | 990 |
return 0; |
991 | 991 |
} |
992 | 992 |
|
993 |
static void omap_os_timer_write(void *opaque, target_phys_addr_t addr,
|
|
993 |
static void omap_os_timer_write(void *opaque, a_target_phys_addr addr,
|
|
994 | 994 |
uint32_t value) |
995 | 995 |
{ |
996 | 996 |
struct omap_32khz_timer_s *s = (struct omap_32khz_timer_s *) opaque; |
... | ... | |
1045 | 1045 |
s->timer.ar = 1; |
1046 | 1046 |
} |
1047 | 1047 |
|
1048 |
struct omap_32khz_timer_s *omap_os_timer_init(target_phys_addr_t base,
|
|
1048 |
struct omap_32khz_timer_s *omap_os_timer_init(a_target_phys_addr base,
|
|
1049 | 1049 |
qemu_irq irq, omap_clk clk) |
1050 | 1050 |
{ |
1051 | 1051 |
int iomemtype; |
... | ... | |
1066 | 1066 |
} |
1067 | 1067 |
|
1068 | 1068 |
/* Ultra Low-Power Device Module */ |
1069 |
static uint32_t omap_ulpd_pm_read(void *opaque, target_phys_addr_t addr)
|
|
1069 |
static uint32_t omap_ulpd_pm_read(void *opaque, a_target_phys_addr addr)
|
|
1070 | 1070 |
{ |
1071 | 1071 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
1072 | 1072 |
uint16_t ret; |
... | ... | |
1128 | 1128 |
omap_clk_canidle(omap_findclk(s, "usb_clk0"), (~value >> 3) & 1); |
1129 | 1129 |
} |
1130 | 1130 |
|
1131 |
static void omap_ulpd_pm_write(void *opaque, target_phys_addr_t addr,
|
|
1131 |
static void omap_ulpd_pm_write(void *opaque, a_target_phys_addr addr,
|
|
1132 | 1132 |
uint32_t value) |
1133 | 1133 |
{ |
1134 | 1134 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
1282 | 1282 |
omap_clk_reparent(omap_findclk(mpu, "ck_48m"), omap_findclk(mpu, "dpll4")); |
1283 | 1283 |
} |
1284 | 1284 |
|
1285 |
static void omap_ulpd_pm_init(target_phys_addr_t base,
|
|
1285 |
static void omap_ulpd_pm_init(a_target_phys_addr base,
|
|
1286 | 1286 |
struct omap_mpu_state_s *mpu) |
1287 | 1287 |
{ |
1288 | 1288 |
int iomemtype = cpu_register_io_memory(omap_ulpd_pm_readfn, |
... | ... | |
1293 | 1293 |
} |
1294 | 1294 |
|
1295 | 1295 |
/* OMAP Pin Configuration */ |
1296 |
static uint32_t omap_pin_cfg_read(void *opaque, target_phys_addr_t addr)
|
|
1296 |
static uint32_t omap_pin_cfg_read(void *opaque, a_target_phys_addr addr)
|
|
1297 | 1297 |
{ |
1298 | 1298 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
1299 | 1299 |
|
... | ... | |
1395 | 1395 |
omap_clk_onoff(omap_findclk(s, "usb_hhc_ck"), (value >> 9) & 1); |
1396 | 1396 |
} |
1397 | 1397 |
|
1398 |
static void omap_pin_cfg_write(void *opaque, target_phys_addr_t addr,
|
|
1398 |
static void omap_pin_cfg_write(void *opaque, a_target_phys_addr addr,
|
|
1399 | 1399 |
uint32_t value) |
1400 | 1400 |
{ |
1401 | 1401 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
1497 | 1497 |
memset(mpu->mod_conf_ctrl, 0, sizeof(mpu->mod_conf_ctrl)); |
1498 | 1498 |
} |
1499 | 1499 |
|
1500 |
static void omap_pin_cfg_init(target_phys_addr_t base,
|
|
1500 |
static void omap_pin_cfg_init(a_target_phys_addr base,
|
|
1501 | 1501 |
struct omap_mpu_state_s *mpu) |
1502 | 1502 |
{ |
1503 | 1503 |
int iomemtype = cpu_register_io_memory(omap_pin_cfg_readfn, |
... | ... | |
1508 | 1508 |
} |
1509 | 1509 |
|
1510 | 1510 |
/* Device Identification, Die Identification */ |
1511 |
static uint32_t omap_id_read(void *opaque, target_phys_addr_t addr)
|
|
1511 |
static uint32_t omap_id_read(void *opaque, a_target_phys_addr addr)
|
|
1512 | 1512 |
{ |
1513 | 1513 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
1514 | 1514 |
|
... | ... | |
1550 | 1550 |
return 0; |
1551 | 1551 |
} |
1552 | 1552 |
|
1553 |
static void omap_id_write(void *opaque, target_phys_addr_t addr,
|
|
1553 |
static void omap_id_write(void *opaque, a_target_phys_addr addr,
|
|
1554 | 1554 |
uint32_t value) |
1555 | 1555 |
{ |
1556 | 1556 |
OMAP_BAD_REG(addr); |
... | ... | |
1579 | 1579 |
} |
1580 | 1580 |
|
1581 | 1581 |
/* MPUI Control (Dummy) */ |
1582 |
static uint32_t omap_mpui_read(void *opaque, target_phys_addr_t addr)
|
|
1582 |
static uint32_t omap_mpui_read(void *opaque, a_target_phys_addr addr)
|
|
1583 | 1583 |
{ |
1584 | 1584 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
1585 | 1585 |
|
... | ... | |
1607 | 1607 |
return 0; |
1608 | 1608 |
} |
1609 | 1609 |
|
1610 |
static void omap_mpui_write(void *opaque, target_phys_addr_t addr,
|
|
1610 |
static void omap_mpui_write(void *opaque, a_target_phys_addr addr,
|
|
1611 | 1611 |
uint32_t value) |
1612 | 1612 |
{ |
1613 | 1613 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
1650 | 1650 |
s->mpui_ctrl = 0x0003ff1b; |
1651 | 1651 |
} |
1652 | 1652 |
|
1653 |
static void omap_mpui_init(target_phys_addr_t base,
|
|
1653 |
static void omap_mpui_init(a_target_phys_addr base,
|
|
1654 | 1654 |
struct omap_mpu_state_s *mpu) |
1655 | 1655 |
{ |
1656 | 1656 |
int iomemtype = cpu_register_io_memory(omap_mpui_readfn, |
... | ... | |
1672 | 1672 |
uint16_t enh_control; |
1673 | 1673 |
}; |
1674 | 1674 |
|
1675 |
static uint32_t omap_tipb_bridge_read(void *opaque, target_phys_addr_t addr)
|
|
1675 |
static uint32_t omap_tipb_bridge_read(void *opaque, a_target_phys_addr addr)
|
|
1676 | 1676 |
{ |
1677 | 1677 |
struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque; |
1678 | 1678 |
|
... | ... | |
1697 | 1697 |
return 0; |
1698 | 1698 |
} |
1699 | 1699 |
|
1700 |
static void omap_tipb_bridge_write(void *opaque, target_phys_addr_t addr,
|
|
1700 |
static void omap_tipb_bridge_write(void *opaque, a_target_phys_addr addr,
|
|
1701 | 1701 |
uint32_t value) |
1702 | 1702 |
{ |
1703 | 1703 |
struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque; |
... | ... | |
1752 | 1752 |
s->enh_control = 0x000f; |
1753 | 1753 |
} |
1754 | 1754 |
|
1755 |
struct omap_tipb_bridge_s *omap_tipb_bridge_init(target_phys_addr_t base,
|
|
1755 |
struct omap_tipb_bridge_s *omap_tipb_bridge_init(a_target_phys_addr base,
|
|
1756 | 1756 |
qemu_irq abort_irq, omap_clk clk) |
1757 | 1757 |
{ |
1758 | 1758 |
int iomemtype; |
... | ... | |
1770 | 1770 |
} |
1771 | 1771 |
|
1772 | 1772 |
/* Dummy Traffic Controller's Memory Interface */ |
1773 |
static uint32_t omap_tcmi_read(void *opaque, target_phys_addr_t addr)
|
|
1773 |
static uint32_t omap_tcmi_read(void *opaque, a_target_phys_addr addr)
|
|
1774 | 1774 |
{ |
1775 | 1775 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
1776 | 1776 |
uint32_t ret; |
... | ... | |
1803 | 1803 |
return 0; |
1804 | 1804 |
} |
1805 | 1805 |
|
1806 |
static void omap_tcmi_write(void *opaque, target_phys_addr_t addr,
|
|
1806 |
static void omap_tcmi_write(void *opaque, a_target_phys_addr addr,
|
|
1807 | 1807 |
uint32_t value) |
1808 | 1808 |
{ |
1809 | 1809 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
1865 | 1865 |
mpu->tcmi_regs[0x40 >> 2] = 0x00000000; |
1866 | 1866 |
} |
1867 | 1867 |
|
1868 |
static void omap_tcmi_init(target_phys_addr_t base,
|
|
1868 |
static void omap_tcmi_init(a_target_phys_addr base,
|
|
1869 | 1869 |
struct omap_mpu_state_s *mpu) |
1870 | 1870 |
{ |
1871 | 1871 |
int iomemtype = cpu_register_io_memory(omap_tcmi_readfn, |
... | ... | |
1876 | 1876 |
} |
1877 | 1877 |
|
1878 | 1878 |
/* Digital phase-locked loops control */ |
1879 |
static uint32_t omap_dpll_read(void *opaque, target_phys_addr_t addr)
|
|
1879 |
static uint32_t omap_dpll_read(void *opaque, a_target_phys_addr addr)
|
|
1880 | 1880 |
{ |
1881 | 1881 |
struct dpll_ctl_s *s = (struct dpll_ctl_s *) opaque; |
1882 | 1882 |
|
... | ... | |
1887 | 1887 |
return 0; |
1888 | 1888 |
} |
1889 | 1889 |
|
1890 |
static void omap_dpll_write(void *opaque, target_phys_addr_t addr,
|
|
1890 |
static void omap_dpll_write(void *opaque, a_target_phys_addr addr,
|
|
1891 | 1891 |
uint32_t value) |
1892 | 1892 |
{ |
1893 | 1893 |
struct dpll_ctl_s *s = (struct dpll_ctl_s *) opaque; |
... | ... | |
1938 | 1938 |
omap_clk_setrate(s->dpll, 1, 1); |
1939 | 1939 |
} |
1940 | 1940 |
|
1941 |
static void omap_dpll_init(struct dpll_ctl_s *s, target_phys_addr_t base,
|
|
1941 |
static void omap_dpll_init(struct dpll_ctl_s *s, a_target_phys_addr base,
|
|
1942 | 1942 |
omap_clk clk) |
1943 | 1943 |
{ |
1944 | 1944 |
int iomemtype = cpu_register_io_memory(omap_dpll_readfn, |
... | ... | |
1952 | 1952 |
|
1953 | 1953 |
/* UARTs */ |
1954 | 1954 |
struct omap_uart_s { |
1955 |
target_phys_addr_t base;
|
|
1955 |
a_target_phys_addr base;
|
|
1956 | 1956 |
SerialState *serial; /* TODO */ |
1957 | 1957 |
struct omap_target_agent_s *ta; |
1958 | 1958 |
omap_clk fclk; |
... | ... | |
1976 | 1976 |
s->clksel = 0; |
1977 | 1977 |
} |
1978 | 1978 |
|
1979 |
struct omap_uart_s *omap_uart_init(target_phys_addr_t base,
|
|
1979 |
struct omap_uart_s *omap_uart_init(a_target_phys_addr base,
|
|
1980 | 1980 |
qemu_irq irq, omap_clk fclk, omap_clk iclk, |
1981 | 1981 |
qemu_irq txdma, qemu_irq rxdma, CharDriverState *chr) |
1982 | 1982 |
{ |
... | ... | |
1992 | 1992 |
return s; |
1993 | 1993 |
} |
1994 | 1994 |
|
1995 |
static uint32_t omap_uart_read(void *opaque, target_phys_addr_t addr)
|
|
1995 |
static uint32_t omap_uart_read(void *opaque, a_target_phys_addr addr)
|
|
1996 | 1996 |
{ |
1997 | 1997 |
struct omap_uart_s *s = (struct omap_uart_s *) opaque; |
1998 | 1998 |
|
... | ... | |
2026 | 2026 |
return 0; |
2027 | 2027 |
} |
2028 | 2028 |
|
2029 |
static void omap_uart_write(void *opaque, target_phys_addr_t addr,
|
|
2029 |
static void omap_uart_write(void *opaque, a_target_phys_addr addr,
|
|
2030 | 2030 |
uint32_t value) |
2031 | 2031 |
{ |
2032 | 2032 |
struct omap_uart_s *s = (struct omap_uart_s *) opaque; |
... | ... | |
2085 | 2085 |
qemu_irq irq, omap_clk fclk, omap_clk iclk, |
2086 | 2086 |
qemu_irq txdma, qemu_irq rxdma, CharDriverState *chr) |
2087 | 2087 |
{ |
2088 |
target_phys_addr_t base = omap_l4_attach(ta, 0, 0);
|
|
2088 |
a_target_phys_addr base = omap_l4_attach(ta, 0, 0);
|
|
2089 | 2089 |
struct omap_uart_s *s = omap_uart_init(base, irq, |
2090 | 2090 |
fclk, iclk, txdma, rxdma, chr); |
2091 | 2091 |
int iomemtype = cpu_register_io_memory(omap_uart_readfn, |
... | ... | |
2107 | 2107 |
} |
2108 | 2108 |
|
2109 | 2109 |
/* MPU Clock/Reset/Power Mode Control */ |
2110 |
static uint32_t omap_clkm_read(void *opaque, target_phys_addr_t addr)
|
|
2110 |
static uint32_t omap_clkm_read(void *opaque, a_target_phys_addr addr)
|
|
2111 | 2111 |
{ |
2112 | 2112 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
2113 | 2113 |
|
... | ... | |
2303 | 2303 |
} |
2304 | 2304 |
} |
2305 | 2305 |
|
2306 |
static void omap_clkm_write(void *opaque, target_phys_addr_t addr,
|
|
2306 |
static void omap_clkm_write(void *opaque, a_target_phys_addr addr,
|
|
2307 | 2307 |
uint32_t value) |
2308 | 2308 |
{ |
2309 | 2309 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
2393 | 2393 |
omap_badwidth_write16, |
2394 | 2394 |
}; |
2395 | 2395 |
|
2396 |
static uint32_t omap_clkdsp_read(void *opaque, target_phys_addr_t addr)
|
|
2396 |
static uint32_t omap_clkdsp_read(void *opaque, a_target_phys_addr addr)
|
|
2397 | 2397 |
{ |
2398 | 2398 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
2399 | 2399 |
|
... | ... | |
2432 | 2432 |
SET_ONOFF("dspxor_ck", 1); /* EN_XORPCK */ |
2433 | 2433 |
} |
2434 | 2434 |
|
2435 |
static void omap_clkdsp_write(void *opaque, target_phys_addr_t addr,
|
|
2435 |
static void omap_clkdsp_write(void *opaque, a_target_phys_addr addr,
|
|
2436 | 2436 |
uint32_t value) |
2437 | 2437 |
{ |
2438 | 2438 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
2499 | 2499 |
s->clkm.dsp_rstct2 = 0x0000; |
2500 | 2500 |
} |
2501 | 2501 |
|
2502 |
static void omap_clkm_init(target_phys_addr_t mpu_base,
|
|
2503 |
target_phys_addr_t dsp_base, struct omap_mpu_state_s *s)
|
|
2502 |
static void omap_clkm_init(a_target_phys_addr mpu_base,
|
|
2503 |
a_target_phys_addr dsp_base, struct omap_mpu_state_s *s)
|
|
2504 | 2504 |
{ |
2505 | 2505 |
int iomemtype[2] = { |
2506 | 2506 |
cpu_register_io_memory(omap_clkm_readfn, omap_clkm_writefn, s), |
... | ... | |
2578 | 2578 |
s->row_latch = ~rows; |
2579 | 2579 |
} |
2580 | 2580 |
|
2581 |
static uint32_t omap_mpuio_read(void *opaque, target_phys_addr_t addr)
|
|
2581 |
static uint32_t omap_mpuio_read(void *opaque, a_target_phys_addr addr)
|
|
2582 | 2582 |
{ |
2583 | 2583 |
struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque; |
2584 | 2584 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
2633 | 2633 |
return 0; |
2634 | 2634 |
} |
2635 | 2635 |
|
2636 |
static void omap_mpuio_write(void *opaque, target_phys_addr_t addr,
|
|
2636 |
static void omap_mpuio_write(void *opaque, a_target_phys_addr addr,
|
|
2637 | 2637 |
uint32_t value) |
2638 | 2638 |
{ |
2639 | 2639 |
struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque; |
... | ... | |
2743 | 2743 |
omap_mpuio_kbd_update(s); |
2744 | 2744 |
} |
2745 | 2745 |
|
2746 |
struct omap_mpuio_s *omap_mpuio_init(target_phys_addr_t base,
|
|
2746 |
struct omap_mpuio_s *omap_mpuio_init(a_target_phys_addr base,
|
|
2747 | 2747 |
qemu_irq kbd_int, qemu_irq gpio_int, qemu_irq wakeup, |
2748 | 2748 |
omap_clk clk) |
2749 | 2749 |
{ |
... | ... | |
2823 | 2823 |
} |
2824 | 2824 |
} |
2825 | 2825 |
|
2826 |
static uint32_t omap_gpio_read(void *opaque, target_phys_addr_t addr)
|
|
2826 |
static uint32_t omap_gpio_read(void *opaque, a_target_phys_addr addr)
|
|
2827 | 2827 |
{ |
2828 | 2828 |
struct omap_gpio_s *s = (struct omap_gpio_s *) opaque; |
2829 | 2829 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
2856 | 2856 |
return 0; |
2857 | 2857 |
} |
2858 | 2858 |
|
2859 |
static void omap_gpio_write(void *opaque, target_phys_addr_t addr,
|
|
2859 |
static void omap_gpio_write(void *opaque, a_target_phys_addr addr,
|
|
2860 | 2860 |
uint32_t value) |
2861 | 2861 |
{ |
2862 | 2862 |
struct omap_gpio_s *s = (struct omap_gpio_s *) opaque; |
... | ... | |
2942 | 2942 |
s->pins = ~0; |
2943 | 2943 |
} |
2944 | 2944 |
|
2945 |
struct omap_gpio_s *omap_gpio_init(target_phys_addr_t base,
|
|
2945 |
struct omap_gpio_s *omap_gpio_init(a_target_phys_addr base,
|
|
2946 | 2946 |
qemu_irq irq, omap_clk clk) |
2947 | 2947 |
{ |
2948 | 2948 |
int iomemtype; |
... | ... | |
3011 | 3011 |
} |
3012 | 3012 |
} |
3013 | 3013 |
|
3014 |
static uint32_t omap_uwire_read(void *opaque, target_phys_addr_t addr)
|
|
3014 |
static uint32_t omap_uwire_read(void *opaque, a_target_phys_addr addr)
|
|
3015 | 3015 |
{ |
3016 | 3016 |
struct omap_uwire_s *s = (struct omap_uwire_s *) opaque; |
3017 | 3017 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
3040 | 3040 |
return 0; |
3041 | 3041 |
} |
3042 | 3042 |
|
3043 |
static void omap_uwire_write(void *opaque, target_phys_addr_t addr,
|
|
3043 |
static void omap_uwire_write(void *opaque, a_target_phys_addr addr,
|
|
3044 | 3044 |
uint32_t value) |
3045 | 3045 |
{ |
3046 | 3046 |
struct omap_uwire_s *s = (struct omap_uwire_s *) opaque; |
... | ... | |
3111 | 3111 |
s->setup[4] = 0; |
3112 | 3112 |
} |
3113 | 3113 |
|
3114 |
struct omap_uwire_s *omap_uwire_init(target_phys_addr_t base,
|
|
3114 |
struct omap_uwire_s *omap_uwire_init(a_target_phys_addr base,
|
|
3115 | 3115 |
qemu_irq *irq, qemu_irq dma, omap_clk clk) |
3116 | 3116 |
{ |
3117 | 3117 |
int iomemtype; |
... | ... | |
3152 | 3152 |
} |
3153 | 3153 |
} |
3154 | 3154 |
|
3155 |
static uint32_t omap_pwl_read(void *opaque, target_phys_addr_t addr)
|
|
3155 |
static uint32_t omap_pwl_read(void *opaque, a_target_phys_addr addr)
|
|
3156 | 3156 |
{ |
3157 | 3157 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
3158 | 3158 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
3167 | 3167 |
return 0; |
3168 | 3168 |
} |
3169 | 3169 |
|
3170 |
static void omap_pwl_write(void *opaque, target_phys_addr_t addr,
|
|
3170 |
static void omap_pwl_write(void *opaque, a_target_phys_addr addr,
|
|
3171 | 3171 |
uint32_t value) |
3172 | 3172 |
{ |
3173 | 3173 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
3217 | 3217 |
omap_pwl_update(s); |
3218 | 3218 |
} |
3219 | 3219 |
|
3220 |
static void omap_pwl_init(target_phys_addr_t base, struct omap_mpu_state_s *s,
|
|
3220 |
static void omap_pwl_init(a_target_phys_addr base, struct omap_mpu_state_s *s,
|
|
3221 | 3221 |
omap_clk clk) |
3222 | 3222 |
{ |
3223 | 3223 |
int iomemtype; |
... | ... | |
3232 | 3232 |
} |
3233 | 3233 |
|
3234 | 3234 |
/* Pulse-Width Tone module */ |
3235 |
static uint32_t omap_pwt_read(void *opaque, target_phys_addr_t addr)
|
|
3235 |
static uint32_t omap_pwt_read(void *opaque, a_target_phys_addr addr)
|
|
3236 | 3236 |
{ |
3237 | 3237 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
3238 | 3238 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
3249 | 3249 |
return 0; |
3250 | 3250 |
} |
3251 | 3251 |
|
3252 |
static void omap_pwt_write(void *opaque, target_phys_addr_t addr,
|
|
3252 |
static void omap_pwt_write(void *opaque, a_target_phys_addr addr,
|
|
3253 | 3253 |
uint32_t value) |
3254 | 3254 |
{ |
3255 | 3255 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; |
... | ... | |
3311 | 3311 |
s->pwt.gcr = 0; |
3312 | 3312 |
} |
3313 | 3313 |
|
3314 |
static void omap_pwt_init(target_phys_addr_t base, struct omap_mpu_state_s *s,
|
|
3314 |
static void omap_pwt_init(a_target_phys_addr base, struct omap_mpu_state_s *s,
|
|
3315 | 3315 |
omap_clk clk) |
3316 | 3316 |
{ |
3317 | 3317 |
int iomemtype; |
... | ... | |
3368 | 3368 |
return (num & 15) + 10 * (num >> 4); |
3369 | 3369 |
} |
3370 | 3370 |
|
3371 |
static uint32_t omap_rtc_read(void *opaque, target_phys_addr_t addr)
|
|
3371 |
static uint32_t omap_rtc_read(void *opaque, a_target_phys_addr addr)
|
|
3372 | 3372 |
{ |
3373 | 3373 |
struct omap_rtc_s *s = (struct omap_rtc_s *) opaque; |
3374 | 3374 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
3445 | 3445 |
return 0; |
3446 | 3446 |
} |
3447 | 3447 |
|
3448 |
static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
|
|
3448 |
static void omap_rtc_write(void *opaque, a_target_phys_addr addr,
|
|
3449 | 3449 |
uint32_t value) |
3450 | 3450 |
{ |
3451 | 3451 |
struct omap_rtc_s *s = (struct omap_rtc_s *) opaque; |
... | ... | |
3729 | 3729 |
omap_rtc_tick(s); |
3730 | 3730 |
} |
3731 | 3731 |
|
3732 |
struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
|
|
3732 |
struct omap_rtc_s *omap_rtc_init(a_target_phys_addr base,
|
|
3733 | 3733 |
qemu_irq *irq, omap_clk clk) |
3734 | 3734 |
{ |
3735 | 3735 |
int iomemtype; |
... | ... | |
3956 | 3956 |
omap_mcbsp_rx_stop(s); |
3957 | 3957 |
} |
3958 | 3958 |
|
3959 |
static uint32_t omap_mcbsp_read(void *opaque, target_phys_addr_t addr)
|
|
3959 |
static uint32_t omap_mcbsp_read(void *opaque, a_target_phys_addr addr)
|
|
3960 | 3960 |
{ |
3961 | 3961 |
struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; |
3962 | 3962 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
4049 | 4049 |
return 0; |
4050 | 4050 |
} |
4051 | 4051 |
|
4052 |
static void omap_mcbsp_writeh(void *opaque, target_phys_addr_t addr,
|
|
4052 |
static void omap_mcbsp_writeh(void *opaque, a_target_phys_addr addr,
|
|
4053 | 4053 |
uint32_t value) |
4054 | 4054 |
{ |
4055 | 4055 |
struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; |
... | ... | |
4187 | 4187 |
OMAP_BAD_REG(addr); |
4188 | 4188 |
} |
4189 | 4189 |
|
4190 |
static void omap_mcbsp_writew(void *opaque, target_phys_addr_t addr,
|
|
4190 |
static void omap_mcbsp_writew(void *opaque, a_target_phys_addr addr,
|
|
4191 | 4191 |
uint32_t value) |
4192 | 4192 |
{ |
4193 | 4193 |
struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; |
... | ... | |
4249 | 4249 |
qemu_del_timer(s->sink_timer); |
4250 | 4250 |
} |
4251 | 4251 |
|
4252 |
struct omap_mcbsp_s *omap_mcbsp_init(target_phys_addr_t base,
|
|
4252 |
struct omap_mcbsp_s *omap_mcbsp_init(a_target_phys_addr base,
|
|
4253 | 4253 |
qemu_irq *irq, qemu_irq *dma, omap_clk clk) |
4254 | 4254 |
{ |
4255 | 4255 |
int iomemtype; |
... | ... | |
4364 | 4364 |
omap_lpg_update(s); |
4365 | 4365 |
} |
4366 | 4366 |
|
4367 |
static uint32_t omap_lpg_read(void *opaque, target_phys_addr_t addr)
|
|
4367 |
static uint32_t omap_lpg_read(void *opaque, a_target_phys_addr addr)
|
|
4368 | 4368 |
{ |
4369 | 4369 |
struct omap_lpg_s *s = (struct omap_lpg_s *) opaque; |
4370 | 4370 |
int offset = addr & OMAP_MPUI_REG_MASK; |
... | ... | |
4381 | 4381 |
return 0; |
4382 | 4382 |
} |
4383 | 4383 |
|
4384 |
static void omap_lpg_write(void *opaque, target_phys_addr_t addr,
|
|
4384 |
static void omap_lpg_write(void *opaque, a_target_phys_addr addr,
|
|
4385 | 4385 |
uint32_t value) |
4386 | 4386 |
{ |
4387 | 4387 |
struct omap_lpg_s *s = (struct omap_lpg_s *) opaque; |
... | ... | |
4426 | 4426 |
omap_lpg_update(s); |
4427 | 4427 |
} |
4428 | 4428 |
|
4429 |
struct omap_lpg_s *omap_lpg_init(target_phys_addr_t base, omap_clk clk)
|
|
4429 |
struct omap_lpg_s *omap_lpg_init(a_target_phys_addr base, omap_clk clk)
|
|
4430 | 4430 |
{ |
4431 | 4431 |
int iomemtype; |
4432 | 4432 |
struct omap_lpg_s *s = (struct omap_lpg_s *) |
... | ... | |
4446 | 4446 |
} |
4447 | 4447 |
|
4448 | 4448 |
/* MPUI Peripheral Bridge configuration */ |
4449 |
static uint32_t omap_mpui_io_read(void *opaque, target_phys_addr_t addr)
|
|
4449 |
static uint32_t omap_mpui_io_read(void *opaque, a_target_phys_addr addr)
|
|
4450 | 4450 |
{ |
4451 | 4451 |
if (addr == OMAP_MPUI_BASE) /* CMR */ |
4452 | 4452 |
return 0xfe4d; |
... | ... | |
4517 | 4517 |
} |
4518 | 4518 |
|
4519 | 4519 |
static const struct omap_map_s { |
4520 |
target_phys_addr_t phys_dsp;
|
|
4521 |
target_phys_addr_t phys_mpu;
|
|
4520 |
a_target_phys_addr phys_dsp;
|
|
4521 |
a_target_phys_addr phys_mpu;
|
|
4522 | 4522 |
uint32_t size; |
4523 | 4523 |
const char *name; |
4524 | 4524 |
} omap15xx_dsp_mm[] = { |
... | ... | |
4586 | 4586 |
|
4587 | 4587 |
/* DMA ports for OMAP1 */ |
4588 | 4588 |
static int omap_validate_emiff_addr(struct omap_mpu_state_s *s, |
4589 |
target_phys_addr_t addr)
|
|
4589 |
a_target_phys_addr addr)
|
|
4590 | 4590 |
{ |
4591 | 4591 |
return addr >= OMAP_EMIFF_BASE && addr < OMAP_EMIFF_BASE + s->sdram_size; |
4592 | 4592 |
} |
4593 | 4593 |
|
4594 | 4594 |
static int omap_validate_emifs_addr(struct omap_mpu_state_s *s, |
4595 |
target_phys_addr_t addr)
|
|
4595 |
a_target_phys_addr addr)
|
|
4596 | 4596 |
{ |
4597 | 4597 |
return addr >= OMAP_EMIFS_BASE && addr < OMAP_EMIFF_BASE; |
4598 | 4598 |
} |
4599 | 4599 |
|
4600 | 4600 |
static int omap_validate_imif_addr(struct omap_mpu_state_s *s, |
4601 |
target_phys_addr_t addr)
|
|
4601 |
a_target_phys_addr addr)
|
|
4602 | 4602 |
{ |
4603 | 4603 |
return addr >= OMAP_IMIF_BASE && addr < OMAP_IMIF_BASE + s->sram_size; |
4604 | 4604 |
} |
4605 | 4605 |
|
4606 | 4606 |
static int omap_validate_tipb_addr(struct omap_mpu_state_s *s, |
4607 |
target_phys_addr_t addr)
|
|
4607 |
a_target_phys_addr addr)
|
|
4608 | 4608 |
{ |
4609 | 4609 |
return addr >= 0xfffb0000 && addr < 0xffff0000; |
4610 | 4610 |
} |
4611 | 4611 |
|
4612 | 4612 |
static int omap_validate_local_addr(struct omap_mpu_state_s *s, |
4613 |
target_phys_addr_t addr)
|
|
4613 |
a_target_phys_addr addr)
|
|
4614 | 4614 |
{ |
4615 | 4615 |
return addr >= OMAP_LOCALBUS_BASE && addr < OMAP_LOCALBUS_BASE + 0x1000000; |
4616 | 4616 |
} |
4617 | 4617 |
|
4618 | 4618 |
static int omap_validate_tipb_mpui_addr(struct omap_mpu_state_s *s, |
4619 |
target_phys_addr_t addr)
|
|
4619 |
a_target_phys_addr addr)
|
|
4620 | 4620 |
{ |
4621 | 4621 |
return addr >= 0xe1010000 && addr < 0xe1020004; |
4622 | 4622 |
} |
... | ... | |
4627 | 4627 |
int i; |
4628 | 4628 |
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) |
4629 | 4629 |
qemu_mallocz(sizeof(struct omap_mpu_state_s)); |
4630 |
ram_addr_t imif_base, emiff_base;
|
|
4630 |
a_ram_addr imif_base, emiff_base;
|
|
4631 | 4631 |
qemu_irq *cpu_irq; |
4632 | 4632 |
qemu_irq dma_irqs[6]; |
4633 | 4633 |
DriveInfo *dinfo; |
Also available in: Unified diff