static int vlynq_tnetw1130_init(VLYNQDevice* vlynq_dev) { vlynq_tnetw1130_t *d = DO_UPCAST(vlynq_tnetw1130_t, dev, vlynq_dev); //~ uint8_t *pci_conf = d->dev.config; tnetw1130_t *s = &d->tnetw1130; #if defined(DEBUG_TNETW1130) set_traceflags("DEBUG_AR7"); #endif TRACE(TNETW, logout("\n")); /* TI TNETW1130 */ //~ tnetw1130_pci_config(pci_conf); /* Handler for memory-mapped I/O */ // TODO: Code is missing. logout("vlynq i/o is missing\n"); //~ s->io_memory[0] = //~ cpu_register_io_memory(tnetw1130_region0_read, tnetw1130_region0_write, //~ d, DEVICE_NATIVE_ENDIAN); //~ s->io_memory[1] = //~ cpu_register_io_memory(tnetw1130_region1_read, tnetw1130_region1_write, //~ d, DEVICE_NATIVE_ENDIAN); TRACE(TNETW, logout("io_memory = 0x%08x, 0x%08x\n", s->io_memory[0], s->io_memory[1])); //~ memcpy(s->mem1 + 0x0001f000, pci_conf, 64); /* eCPU is halted. */ reg_write16(s->mem0, TNETW1130_ECPU_CTRL, 1); //~ tnetw1130_mem_map(&d->dev, 0, 0x04000000, 0x22000, 0); /* 0xf0000000 */ //~ tnetw1130_mem_map(&d->dev, 1, 0x04022000, 0x40000, 0); /* 0xc0000000 */ //~ tnetw1130_mem_map(&d->dev, 1, 0x04000000, 0x40000, 0); //~ tnetw1130_mem_map(&d->dev, 0, 0x04040000, 0x22000, 0); tnetw1130_mem_map(&d->dev, 0, 0x04000000, TNETW1130_MEM0_SIZE, 0); tnetw1130_mem_map(&d->dev, 1, 0x04022000, TNETW1130_MEM1_SIZE, 0); return 0; }
void vlynq_tnetw1130_init(void) { pci_tnetw1130_t *d = &vlynq; uint8_t *pci_conf = d->dev.config; tnetw1130_t *s = &d->tnetw1130; #if defined(DEBUG_TNETW1130) set_traceflags("DEBUG_AR7"); #endif TRACE(TNETW, logout("\n")); /* TI TNETW1130 */ tnetw1130_pci_config(pci_conf); /* Handler for memory-mapped I/O */ s->io_memory[0] = cpu_register_io_memory(0, tnetw1130_region0_read, tnetw1130_region0_write, d); s->io_memory[1] = cpu_register_io_memory(0, tnetw1130_region1_read, tnetw1130_region1_write, d); TRACE(TNETW, logout("io_memory = 0x%08x, 0x%08x\n", s->io_memory[0], s->io_memory[1])); pci_register_io_region(&d->dev, 0, TNETW1130_MEM0_SIZE, PCI_ADDRESS_SPACE_MEM, tnetw1130_mem_map); pci_register_io_region(&d->dev, 1, TNETW1130_MEM1_SIZE, PCI_ADDRESS_SPACE_MEM, tnetw1130_mem_map); memcpy(s->mem1 + 0x0001f000, pci_conf, 64); /* eCPU is halted. */ reg_write16(s->mem0, TNETW1130_ECPU_CTRL, 1); //~ tnetw1130_mem_map(&d->dev, 0, 0x04000000, 0x22000, 0); /* 0xf0000000 */ //~ tnetw1130_mem_map(&d->dev, 1, 0x04022000, 0x40000, 0); /* 0xc0000000 */ //~ tnetw1130_mem_map(&d->dev, 1, 0x04000000, 0x40000, 0); //~ tnetw1130_mem_map(&d->dev, 0, 0x04040000, 0x22000, 0); tnetw1130_mem_map(&d->dev, 0, 0x04000000, TNETW1130_MEM0_SIZE, 0); tnetw1130_mem_map(&d->dev, 1, 0x04022000, TNETW1130_MEM1_SIZE, 0); }