/[dynamips]/upstream/dynamips-0.2.6-RC4/dev_c3600_iofpga.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.6-RC4/dev_c3600_iofpga.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.6-RC1/dev_c3600_iofpga.c revision 2 by dpavlin, Sat Oct 6 16:03:58 2007 UTC upstream/dynamips-0.2.6-RC4/dev_c3600_iofpga.c revision 5 by dpavlin, Sat Oct 6 16:08:03 2007 UTC
# Line 70  struct iofpga_data { Line 70  struct iofpga_data {
70  static const struct nmc93c46_eeprom_def eeprom_mb_def = {  static const struct nmc93c46_eeprom_def eeprom_mb_def = {
71     EEPROM_MB_CLK, EEPROM_MB_CS,     EEPROM_MB_CLK, EEPROM_MB_CS,
72     EEPROM_MB_DIN, EEPROM_MB_DOUT,     EEPROM_MB_DIN, EEPROM_MB_DOUT,
    NULL, 0,  
73  };  };
74    
75  /* Mainboard EEPROM */  /* Mainboard EEPROM */
76  static const struct nmc93c46_group eeprom_mb_group = {  static const struct nmc93c46_group eeprom_mb_group = {
77     1, 0, "Mainboard EEPROM", 0, { NULL }, { { 0, 0, 0, 0, 0} },     1, 0, "Mainboard EEPROM", 0, { &eeprom_mb_def },
78  };  };
79    
80  /* NM EEPROM definition */  /* NM EEPROM definition */
81  static const struct nmc93c46_eeprom_def eeprom_nm_def = {  static const struct nmc93c46_eeprom_def eeprom_nm_def = {
82     EEPROM_NM_CLK, EEPROM_NM_CS,     EEPROM_NM_CLK, EEPROM_NM_CS,
83     EEPROM_NM_DIN, EEPROM_NM_DOUT,     EEPROM_NM_DIN, EEPROM_NM_DOUT,
    NULL, 0,  
84  };  };
85    
86  /* NM EEPROM */  /* NM EEPROM */
87  static const struct nmc93c46_group eeprom_nm_group = {  static const struct nmc93c46_group eeprom_nm_group = {
88     1, 0, "NM EEPROM", 0, { NULL }, { { 0, 0, 0, 0, 0} },     1, 0, "NM EEPROM", 0, { &eeprom_nm_def },
89  };  };
90    
91  /* C3660 NM presence masks */  /* C3660 NM presence masks */
# Line 103  static const m_uint16_t c3660_nm_masks[6 Line 101  static const m_uint16_t c3660_nm_masks[6
101  /* Select the current NM EEPROM */  /* Select the current NM EEPROM */
102  static void nm_eeprom_select(struct iofpga_data *d,u_int slot)  static void nm_eeprom_select(struct iofpga_data *d,u_int slot)
103  {  {
104     d->router->nm_eeprom.data = d->router->nm_bay[slot].eeprom_data;     d->router->nm_eeprom_group.eeprom[0] = &d->router->nm_bay[slot].eeprom;
    d->router->nm_eeprom.data_len = d->router->nm_bay[slot].eeprom_data_len;  
105  }  }
106    
107  /* Return the NM status register given the detected EEPROM (3620/3640) */  /* Return the NM status register given the detected EEPROM (3620/3640) */
# Line 291  dev_c3620_c3640_iofpga_access(cpu_mips_t Line 288  dev_c3620_c3640_iofpga_access(cpu_mips_t
288              d->io_mask = *data;              d->io_mask = *data;
289           break;           break;
290    
291        /* ??? */        /*
292        /* 0: 3640, 4 << 5: 3620, 3 << 5: 3660 */         * Platform type ?
293           * 0: 3640, 4 << 5: 3620, 3 << 5: 3660
294           */
295        case 0x30000:        case 0x30000:
296           if (op_type == MTS_READ) {           if (op_type == MTS_READ) {
297              switch(c3600_chassis_get_id(d->router)) {              switch(c3600_chassis_get_id(d->router)) {
# Line 599  dev_c3660_iofpga_access(cpu_mips_t *cpu, Line 598  dev_c3660_iofpga_access(cpu_mips_t *cpu,
598  /* Initialize EEPROM groups */  /* Initialize EEPROM groups */
599  void c3600_init_eeprom_groups(c3600_t *router)  void c3600_init_eeprom_groups(c3600_t *router)
600  {  {
    struct nmc93c46_group *g;  
601     int i;     int i;
602    
603     /* Copy Mainboard EEPROM definition */     /* Initialize Mainboard EEPROM */
604     memcpy(&router->mb_eeprom,&eeprom_mb_def,sizeof(eeprom_mb_def));     router->mb_eeprom_group = eeprom_mb_group;
605       router->mb_eeprom_group.eeprom[0] = &router->mb_eeprom;
606       router->mb_eeprom.data = NULL;
607       router->mb_eeprom.len  = 0;
608    
609       /* Initialize NM EEPROM for 3620/3640 */
610       router->nm_eeprom_group = eeprom_nm_group;
611       router->nm_eeprom_group.eeprom[0] = NULL;
612    
613     /* Initialize group */     /* Initialize NM EEPROM for 3660 */
    g = &router->mb_eeprom_group;  
    memcpy(g,&eeprom_mb_group,sizeof(eeprom_mb_group));  
    g->def[0] = &router->mb_eeprom;  
   
    /* Copy NM EEPROM definition (3620/3640) */  
    memcpy(&router->nm_eeprom,&eeprom_nm_def,sizeof(eeprom_nm_def));  
    router->nm_eeprom.data = NULL;  
    router->nm_eeprom.data_len = 0;  
   
    /* Initialize group (3620/3640) */  
    g = &router->nm_eeprom_group;  
    memcpy(g,&eeprom_nm_group,sizeof(eeprom_nm_group));  
    g->def[0] = &router->nm_eeprom;  
   
    /* 3660 NM EEPROM */  
614     for(i=0;i<C3600_MAX_NM_BAYS;i++) {     for(i=0;i<C3600_MAX_NM_BAYS;i++) {
615        memcpy(&router->c3660_nm_eeprom_def[i],&eeprom_nm_def,        router->c3660_nm_eeprom_group[i] = eeprom_nm_group;
616               sizeof(struct nmc93c46_eeprom_def));        router->c3660_nm_eeprom_group[i].eeprom[0] = &router->nm_bay[i].eeprom;
   
       memcpy(&router->c3660_nm_eeprom_group[i],&eeprom_nm_group,  
              sizeof(struct nmc93c46_group));  
   
       router->c3660_nm_eeprom_group[i].def[0] =  
          &router->c3660_nm_eeprom_def[i];  
617     }     }
618  }  }
619    

Legend:
Removed from v.2  
changed lines
  Added in v.5

  ViewVC Help
Powered by ViewVC 1.1.26