~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to .pc/ubuntu/linaro/0002-hw-sd-Expose-sd_reset-as-public-function.patch/include/hw/sd.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * SD Memory Card emulation.  Mostly correct for MMC too.
 
3
 *
 
4
 * Copyright (c) 2006 Andrzej Zaborowski  <balrog@zabor.org>
 
5
 *
 
6
 * Redistribution and use in source and binary forms, with or without
 
7
 * modification, are permitted provided that the following conditions
 
8
 * are met:
 
9
 *
 
10
 * 1. Redistributions of source code must retain the above copyright
 
11
 *    notice, this list of conditions and the following disclaimer.
 
12
 * 2. Redistributions in binary form must reproduce the above copyright
 
13
 *    notice, this list of conditions and the following disclaimer in
 
14
 *    the documentation and/or other materials provided with the
 
15
 *    distribution.
 
16
 *
 
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
 
18
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 
20
 * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
22
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 
24
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 
25
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
28
 */
 
29
#ifndef __hw_sd_h
 
30
#define __hw_sd_h               1
 
31
 
 
32
#define OUT_OF_RANGE            (1 << 31)
 
33
#define ADDRESS_ERROR           (1 << 30)
 
34
#define BLOCK_LEN_ERROR         (1 << 29)
 
35
#define ERASE_SEQ_ERROR         (1 << 28)
 
36
#define ERASE_PARAM             (1 << 27)
 
37
#define WP_VIOLATION            (1 << 26)
 
38
#define CARD_IS_LOCKED          (1 << 25)
 
39
#define LOCK_UNLOCK_FAILED      (1 << 24)
 
40
#define COM_CRC_ERROR           (1 << 23)
 
41
#define ILLEGAL_COMMAND         (1 << 22)
 
42
#define CARD_ECC_FAILED         (1 << 21)
 
43
#define CC_ERROR                (1 << 20)
 
44
#define SD_ERROR                (1 << 19)
 
45
#define CID_CSD_OVERWRITE       (1 << 16)
 
46
#define WP_ERASE_SKIP           (1 << 15)
 
47
#define CARD_ECC_DISABLED       (1 << 14)
 
48
#define ERASE_RESET             (1 << 13)
 
49
#define CURRENT_STATE           (7 << 9)
 
50
#define READY_FOR_DATA          (1 << 8)
 
51
#define APP_CMD                 (1 << 5)
 
52
#define AKE_SEQ_ERROR           (1 << 3)
 
53
#define OCR_CCS_BITN        30
 
54
 
 
55
typedef enum {
 
56
    sd_none = -1,
 
57
    sd_bc = 0,  /* broadcast -- no response */
 
58
    sd_bcr,     /* broadcast with response */
 
59
    sd_ac,      /* addressed -- no data transfer */
 
60
    sd_adtc,    /* addressed with data transfer */
 
61
} sd_cmd_type_t;
 
62
 
 
63
typedef struct {
 
64
    uint8_t cmd;
 
65
    uint32_t arg;
 
66
    uint8_t crc;
 
67
} SDRequest;
 
68
 
 
69
typedef struct SDState SDState;
 
70
 
 
71
SDState *sd_init(BlockDriverState *bs, bool is_spi);
 
72
int sd_do_command(SDState *sd, SDRequest *req,
 
73
                  uint8_t *response);
 
74
void sd_write_data(SDState *sd, uint8_t value);
 
75
uint8_t sd_read_data(SDState *sd);
 
76
void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert);
 
77
bool sd_data_ready(SDState *sd);
 
78
void sd_enable(SDState *sd, bool enable);
 
79
 
 
80
#endif  /* __hw_sd_h */