Skip to content

Commit

Permalink
fix this thing to work with usb-ehci, lsusb from an arch image now sh…
Browse files Browse the repository at this point in the history
…ows everything along with string descriptors and all
  • Loading branch information
rms committed Jan 3, 2013
1 parent 919b455 commit f155a8d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions hw/ipad1g.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ static void ipad1g_init(ram_addr_t ram_size,
s5l8930_state *cpu;
uint32_t llb_size, vrom_size;
ram_addr_t phys_flash, ramoff;
//target_phys_addr_t llb_base = LLB_LOAD_ADDR;
target_phys_addr_t llb_base = IBOOT_LOAD_ADDR;
target_phys_addr_t llb_base = LLB_LOAD_ADDR;
//target_phys_addr_t llb_base = IBOOT_LOAD_ADDR;
//target_phys_addr_t llb_base = 0;
target_phys_addr_t vrom_base = 0x000000000;

Expand Down
2 changes: 1 addition & 1 deletion hw/s5l8930_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static uint32_t s5l8930_spi_mm_read(void *opaque, target_phys_addr_t offset)
{
S5L8930SPIState *s = (S5L8930SPIState *)opaque;

fprintf(stderr, "%s: base 0x%08x offset 0x%08x\n", __func__, s->base, offset);
// fprintf(stderr, "%s: base 0x%08x offset 0x%08x\n", __func__, s->base, offset);

switch (offset) {
case SPI_CONTROL:
Expand Down
6 changes: 3 additions & 3 deletions hw/tcp_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "usb.h"
#include "tcp_usb.h"

//#define DEBUG_TCP_USB
#define DEBUG_TCP_USB

void tcp_usb_init(tcp_usb_state_t *_state, tcp_usb_callback_t _cb, tcp_usb_closed_t _closed, void *_arg)
{
Expand Down Expand Up @@ -121,7 +121,7 @@ static void tcp_usb_callback(tcp_usb_state_t *state, int _can_read, int _can_wri

// Fall through
case tcp_usb_read_request:
debug_printf("%s: tcp_usb_read_request\n", __func__);
// debug_printf("%s: tcp_usb_read_request\n", __func__);

if(state->amount_done < sizeof(*state->header))
{
Expand Down Expand Up @@ -335,7 +335,7 @@ static void tcp_usb_callback(tcp_usb_state_t *state, int _can_read, int _can_wri

// Fall through
case tcp_usb_read_response:
debug_printf("%s: tcp_usb_read_response\n", __func__);
// debug_printf("%s: tcp_usb_read_response\n", __func__);

if(state->amount_done < sizeof(*state->header))
{
Expand Down
7 changes: 2 additions & 5 deletions hw/tcp_usb_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@

#define DEVICE_NAME "tcp_usb_bus"

//#define TCP_USB_BUS_DEBUG
#define TCP_USB_BUS_DEBUG

#ifdef TCP_USB_BUS_DEBUG
# define debug_printf(args...) fprintf(stderr, DEVICE_NAME ": " args);
#else
# define debug_printf(args...)
#endif


typedef struct _tcp_bus_state
Expand Down Expand Up @@ -357,6 +353,7 @@ static void *tcp_bus_thread(void *_arg)
(tcp_passthrough_state_t*)usb_create(bus, "tcp_usb_passthrough");
dev->parent = state;
dev->tcp = newState;
dev->dev.speed = 0x0400;
newState->callback_arg = dev;
qdev_init_nofail(&dev->dev.qdev);

Expand Down
14 changes: 6 additions & 8 deletions hw/usb_synopsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static int synopsys_usb_tcp_callback(tcp_usb_state_t *_state, void *_arg, tcp_us
if(txfs + txfz > sizeof(state->fifos))
hw_error("usb_synopsys: USB transfer would overflow FIFO buffer!\n");

//printf("USB: Starting IN transfer on EP %d (%d)...\n", ep, amtDone);
printf("USB: Starting IN transfer on EP %d (%d)...\n", ep, amtDone);

if(amtDone > 0)
{
Expand Down Expand Up @@ -486,7 +486,6 @@ static int synopsys_usb_tcp_callback(tcp_usb_state_t *_state, void *_arg, tcp_us

if(_hdr->flags & tcp_usb_setup)
{
/*
printf("USB: Setup %02x %02x %02x %02x %02x %02x %02x %02x\n",
state->fifos[0],
state->fifos[1],
Expand All @@ -496,7 +495,6 @@ static int synopsys_usb_tcp_callback(tcp_usb_state_t *_state, void *_arg, tcp_us
state->fifos[5],
state->fifos[6],
state->fifos[7]);
*/
eps->interrupt_status |= USB_EPINT_SetUp;
}
else
Expand Down Expand Up @@ -763,7 +761,7 @@ static void synopsys_usb_write(void *_arg, target_phys_addr_t _addr, uint32_t _v
{
synopsys_usb_state *state = _arg;

//printf("USB: Write 0x%08x to 0x%08x.\n", _val, _addr);
printf("USB: Write 0x%08x to 0x%08x.\n", _val, _addr);

switch(_addr)
{
Expand Down Expand Up @@ -1027,10 +1025,10 @@ void register_synopsys_usb(target_phys_addr_t _addr, qemu_irq _irq, uint32_t _hw
synopsys_usb_state *state = DO_UPCAST(synopsys_usb_state,
busdev, sysbus_from_qdev(dev));

state->ghwcfg1 = _hwcfg[0];
state->ghwcfg2 = _hwcfg[1];
state->ghwcfg3 = _hwcfg[2];
state->ghwcfg4 = _hwcfg[3];
state->ghwcfg1 = 0xdeadbeef;
state->ghwcfg2 = 0xdeadbeef;
state->ghwcfg3 = 0xdeadbeef;
state->ghwcfg4 = 0xdeadbeef;

qdev_init_nofail(dev);

Expand Down
2 changes: 1 addition & 1 deletion skin/skin_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void *skin_loadpng(const char *fn, unsigned *_width, unsigned *_height)
case PNG_COLOR_TYPE_GRAY:
printf("\n");
if(bitdepth < 8) {
png_set_gray_1_2_4_to_8(p);
//png_set_gray_1_2_4_to_8(p);
}

default:
Expand Down

0 comments on commit f155a8d

Please sign in to comment.