usb/hcd-ehci: Replace PORTSC macros with variables

Replace PORTSC macros with variables which could then be
configured in ehci_xxxx_class_init(...)

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Kuo-Jung Su 2013-06-06 15:41:12 +02:00 committed by Gerd Hoffmann
parent 20c570432e
commit cc8d6a8481
4 changed files with 28 additions and 14 deletions

View file

@ -40,11 +40,7 @@
#define MMIO_SIZE 0x1000
#define CAPA_SIZE 0x10
#define PORTSC 0x0044
#define PORTSC_BEGIN PORTSC
#define PORTSC_END (PORTSC + 4 * NB_PORTS)
#define NB_PORTS 6 /* Number of downstream ports */
#define NB_PORTS 6 /* Max. Number of downstream ports */
typedef struct EHCIPacket EHCIPacket;
typedef struct EHCIQueue EHCIQueue;
@ -268,6 +264,8 @@ struct EHCIState {
int companion_count;
uint16_t capsbase;
uint16_t opregbase;
uint16_t portscbase;
uint16_t portnr;
/* properties */
uint32_t maxframes;
@ -278,7 +276,7 @@ struct EHCIState {
*/
uint8_t caps[CAPA_SIZE];
union {
uint32_t opreg[PORTSC_BEGIN/sizeof(uint32_t)];
uint32_t opreg[0x44/sizeof(uint32_t)];
struct {
uint32_t usbcmd;
uint32_t usbsts;
@ -363,6 +361,8 @@ typedef struct SysBusEHCIClass {
uint16_t capsbase;
uint16_t opregbase;
uint16_t portscbase;
uint16_t portnr;
} SysBusEHCIClass;
#endif