Commit 4eeed608c5999f52c1fe682262721fb01aee26e9

Authored by edgar_igl
1 parent f6953f13

ETRAX: Connect both ethernet controllers.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4488 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 11 additions and 5 deletions
hw/etraxfs.c
... ... @@ -60,7 +60,7 @@ void bareetraxfs_init (ram_addr_t ram_size, int vga_ram_size,
60 60 {
61 61 CPUState *env;
62 62 qemu_irq *pic;
63   - struct etraxfs_dma_client *eth0;
  63 + struct etraxfs_dma_client *eth[2] = {NULL, NULL};
64 64 int kernel_size;
65 65 int i;
66 66 ram_addr_t phys_ram;
... ... @@ -106,12 +106,18 @@ void bareetraxfs_init (ram_addr_t ram_size, int vga_ram_size,
106 106 etraxfs_dmac_connect(etraxfs_dmac, i, pic + 7 + i, i & 1);
107 107 }
108 108  
109   - /* It has 2, but let's start with one ethernet block. */
110   - eth0 = etraxfs_eth_init(&nd_table[0], env, pic + 25, 0xb0034000);
  109 + /* Add the two ethernet blocks. */
  110 + eth[0] = etraxfs_eth_init(&nd_table[0], env, pic + 25, 0xb0034000);
  111 + if (&nd_table[1])
  112 + eth[1] = etraxfs_eth_init(&nd_table[1], env, pic + 26, 0xb0036000);
111 113  
112 114 /* The DMA Connector block is missing, hardwire things for now. */
113   - etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth0);
114   - etraxfs_dmac_connect_client(etraxfs_dmac, 1, eth0 + 1);
  115 + etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]);
  116 + etraxfs_dmac_connect_client(etraxfs_dmac, 1, eth[0] + 1);
  117 + if (eth[1]) {
  118 + etraxfs_dmac_connect_client(etraxfs_dmac, 6, eth[1]);
  119 + etraxfs_dmac_connect_client(etraxfs_dmac, 7, eth[1] + 1);
  120 + }
115 121  
116 122 /* 2 timers. */
117 123 etraxfs_timer_init(env, pic + 0x1b, 0xb001e000);
... ...