From a25351325187eb8eff8b9b090acd8f2d7684c6ff Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 10 Sep 2010 10:15:07 +0200 Subject: upstream: minow hw updates. --- hw/arm-misc.h | 7 +++++-- hw/arm_boot.c | 20 +++++++++++++------- hw/bt-hci-csr.c | 11 +++++------ hw/bt-hci.c | 7 +------ hw/bt-hid.c | 3 +-- hw/bt-l2cap.c | 12 +++++------- hw/bt-sdp.c | 7 +++---- hw/bt.c | 3 +-- hw/bt.h | 4 +--- hw/devices.h | 6 +++--- hw/isa.h | 1 + hw/watchdog.h | 4 +--- 12 files changed, 40 insertions(+), 45 deletions(-) (limited to 'hw') diff --git a/hw/arm-misc.h b/hw/arm-misc.h index 7523d44..010acb4 100644 --- a/hw/arm-misc.h +++ b/hw/arm-misc.h @@ -11,8 +11,6 @@ #ifndef ARM_MISC_H #define ARM_MISC_H 1 -#include "cpu.h" - /* The CPU is also modeled as an interrupt controller. */ #define ARM_PIC_CPU_IRQ 0 #define ARM_PIC_CPU_FIQ 1 @@ -30,9 +28,14 @@ struct arm_boot_info { const char *initrd_filename; target_phys_addr_t loader_start; target_phys_addr_t smp_loader_start; + target_phys_addr_t smp_priv_base; int nb_cpus; int board_id; int (*atag_board)(struct arm_boot_info *info, void *p); + /* Used internally by arm_boot.c */ + int is_linux; + target_phys_addr_t initrd_size; + target_phys_addr_t entry; }; void arm_load_kernel(CPUState *env, struct arm_boot_info *info); diff --git a/hw/arm_boot.c b/hw/arm_boot.c index acfa67e..2061ee3 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -191,7 +191,8 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info) int n; int is_linux = 0; uint64_t elf_entry; - target_ulong entry; + target_phys_addr_t entry; + int big_endian; /* Load the kernel. */ if (!info->kernel_filename) { @@ -199,12 +200,15 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info) exit(1); } - if (!env->boot_info) { - if (info->nb_cpus == 0) - info->nb_cpus = 1; - env->boot_info = info; - qemu_register_reset(main_cpu_reset, 0, env); - } + if (info->nb_cpus == 0) + info->nb_cpus = 1; + env->boot_info = info; + +#ifdef TARGET_WORDS_BIGENDIAN + big_endian = 1; +#else + big_endian = 0; +#endif /* Assume that raw images are linux kernels, and ELF images are not. */ kernel_size = load_elf(info->kernel_filename, 0, &elf_entry, NULL, NULL); @@ -259,4 +263,6 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info) else set_kernel_args(info, initrd_size, info->loader_start); } + info->is_linux = is_linux; + qemu_register_reset(main_cpu_reset, 0, env); } diff --git a/hw/bt-hci-csr.c b/hw/bt-hci-csr.c index 183441b..982577d 100644 --- a/hw/bt-hci-csr.c +++ b/hw/bt-hci-csr.c @@ -15,8 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; if not, see . */ #include "qemu-common.h" @@ -227,7 +226,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) *rpkt ++ = 0x20; /* Operational settings negotation Ok */ memcpy(rpkt, pkt, 7); rpkt += 7; *rpkt ++ = 0xff; - *rpkt ++ = 0xff; + *rpkt = 0xff; break; case H4_ALIVE_PKT: @@ -239,7 +238,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) rpkt = csrhci_out_packet_csr(s, H4_ALIVE_PKT, 2); *rpkt ++ = 0xcc; - *rpkt ++ = 0x00; + *rpkt = 0x00; break; default: @@ -364,7 +363,7 @@ static int csrhci_ioctl(struct CharDriverState *chr, int cmd, void *arg) switch (cmd) { case CHR_IOCTL_SERIAL_SET_PARAMS: ssp = (QEMUSerialSetParams *) arg; - s->baud_delay = ticks_per_sec / ssp->speed; + s->baud_delay = get_ticks_per_sec() / ssp->speed; /* Moments later... (but shorter than 100ms) */ s->modem_state |= CHR_TIOCM_CTS; break; @@ -390,7 +389,7 @@ static void csrhci_reset(struct csrhci_s *s) s->out_len = 0; s->out_size = FIFO_LEN; s->in_len = 0; - s->baud_delay = ticks_per_sec; + s->baud_delay = get_ticks_per_sec(); s->enable = 0; s->in_hdr = INT_MAX; s->in_data = INT_MAX; diff --git a/hw/bt-hci.c b/hw/bt-hci.c index 669866a..f1ee92c 100644 --- a/hw/bt-hci.c +++ b/hw/bt-hci.c @@ -994,13 +994,12 @@ static int bt_hci_features_req(struct bt_hci_s *hci, uint16_t handle) static int bt_hci_version_req(struct bt_hci_s *hci, uint16_t handle) { - struct bt_device_s *slave; evt_read_remote_version_complete params; if (bt_hci_handle_bad(hci, handle)) return -ENODEV; - slave = bt_hci_remote_dev(hci, handle); + bt_hci_remote_dev(hci, handle); bt_hci_event_status(hci, HCI_SUCCESS); @@ -2080,7 +2079,6 @@ static void bt_submit_sco(struct HCIInfo *info, const uint8_t *data, int length) { struct bt_hci_s *hci = hci_from_info(info); - struct bt_link_s *link; uint16_t handle; int datalen; @@ -2089,7 +2087,6 @@ static void bt_submit_sco(struct HCIInfo *info, handle = acl_handle((data[1] << 8) | data[0]); datalen = data[2]; - data += 3; length -= 3; if (bt_hci_handle_bad(hci, handle)) { @@ -2097,7 +2094,6 @@ static void bt_submit_sco(struct HCIInfo *info, __FUNCTION__, handle); return; } - handle &= ~HCI_HANDLE_OFFSET; if (datalen > length) { fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n", @@ -2105,7 +2101,6 @@ static void bt_submit_sco(struct HCIInfo *info, return; } - link = hci->lm.handle[handle].link; /* TODO */ /* TODO: increase counter and send EVT_NUM_COMP_PKTS if synchronous diff --git a/hw/bt-hid.c b/hw/bt-hid.c index af0c3d5..e495dbf 100644 --- a/hw/bt-hid.c +++ b/hw/bt-hid.c @@ -15,8 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; if not, if not, see . */ #include "qemu-common.h" diff --git a/hw/bt-l2cap.c b/hw/bt-l2cap.c index b22b761..7e2f668 100644 --- a/hw/bt-l2cap.c +++ b/hw/bt-l2cap.c @@ -14,9 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA + * along with this program; if not, see . */ #include "qemu-common.h" @@ -998,10 +996,10 @@ static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid, l2cap_rexmit_enable(ch, !(hdr->data[0] >> 7)); if (hdr->data[0] & 1) { - if (len != 4) - /* TODO: Signal an error? */; + if (len != 4) { + /* TODO: Signal an error? */ return; - + } return l2cap_sframe_in(ch, le16_to_cpup((void *) hdr->data)); } @@ -1220,7 +1218,7 @@ static void l2cap_teardown(struct l2cap_instance_s *l2cap, int send_disconnect) for (cid = L2CAP_CID_ALLOC; cid < L2CAP_CID_MAX; cid ++) if (l2cap->cid[cid]) { l2cap->cid[cid]->params.close(l2cap->cid[cid]->params.opaque); - free(l2cap->cid[cid]); + qemu_free(l2cap->cid[cid]); } if (l2cap->role) diff --git a/hw/bt-sdp.c b/hw/bt-sdp.c index 992de0e..cc0bf2f 100644 --- a/hw/bt-sdp.c +++ b/hw/bt-sdp.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; if not, see . */ #include "qemu-common.h" @@ -160,7 +159,7 @@ static ssize_t sdp_svc_search(struct bt_l2cap_sdp_state_s *sdp, if (len < 3) return -SDP_INVALID_SYNTAX; - end = (req[0] << 8) | req[1]; + max = (req[0] << 8) | req[1]; req += 2; len -= 2; @@ -172,7 +171,7 @@ static ssize_t sdp_svc_search(struct bt_l2cap_sdp_state_s *sdp, } else start = 0; - if (len > 1); + if (len > 1) return -SDP_INVALID_SYNTAX; /* Output the results */ diff --git a/hw/bt.c b/hw/bt.c index 3f886b4..34bf004 100644 --- a/hw/bt.c +++ b/hw/bt.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; if not, see . */ #include "qemu-common.h" diff --git a/hw/bt.h b/hw/bt.h index 726905f..4a702ad 100644 --- a/hw/bt.h +++ b/hw/bt.h @@ -20,9 +20,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA + * along with this program; if not, see . */ /* BD Address */ diff --git a/hw/devices.h b/hw/devices.h index 156bde2..c788373 100644 --- a/hw/devices.h +++ b/hw/devices.h @@ -6,6 +6,9 @@ /* smc91c111.c */ void smc91c111_init(NICInfo *, uint32_t, qemu_irq); +/* lan9118.c */ +void lan9118_init(NICInfo *, uint32_t, qemu_irq); + /* tsc210x.c */ uWireSlave *tsc2102_init(qemu_irq pint); uWireSlave *tsc2301_init(qemu_irq penirq, qemu_irq kbirq, qemu_irq dav); @@ -64,7 +67,4 @@ qemu_irq tc6393xb_l3v_get(TC6393xbState *s); void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq, CharDriverState *chr); -/* usb-ohci.c */ -void usb_ohci_init_sm501(uint32_t mmio_base, uint32_t localmem_base, - int num_ports, int devfn, qemu_irq irq); #endif diff --git a/hw/isa.h b/hw/isa.h index f00a993..09b32a1 100644 --- a/hw/isa.h +++ b/hw/isa.h @@ -1,5 +1,6 @@ #ifndef HW_ISA_H #define HW_ISA_H + /* ISA bus */ #include "ioport.h" diff --git a/hw/watchdog.h b/hw/watchdog.h index 77b9965..8e955cc 100644 --- a/hw/watchdog.h +++ b/hw/watchdog.h @@ -14,9 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * along with this program; if not, see . * * By Richard W.M. Jones (rjones@redhat.com). */ -- cgit v1.1