/[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-RC2/dev_c3600_iofpga.c revision 3 by dpavlin, Sat Oct 6 16:05:34 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 599  dev_c3660_iofpga_access(cpu_mips_t *cpu, Line 596  dev_c3660_iofpga_access(cpu_mips_t *cpu,
596  /* Initialize EEPROM groups */  /* Initialize EEPROM groups */
597  void c3600_init_eeprom_groups(c3600_t *router)  void c3600_init_eeprom_groups(c3600_t *router)
598  {  {
    struct nmc93c46_group *g;  
599     int i;     int i;
600    
601     /* Copy Mainboard EEPROM definition */     /* Initialize Mainboard EEPROM */
602     memcpy(&router->mb_eeprom,&eeprom_mb_def,sizeof(eeprom_mb_def));     router->mb_eeprom_group = eeprom_mb_group;
603       router->mb_eeprom_group.eeprom[0] = &router->mb_eeprom;
604       router->mb_eeprom.data = NULL;
605       router->mb_eeprom.len  = 0;
606    
607       /* Initialize NM EEPROM for 3620/3640 */
608       router->nm_eeprom_group = eeprom_nm_group;
609       router->nm_eeprom_group.eeprom[0] = NULL;
610    
611     /* 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 */  
612     for(i=0;i<C3600_MAX_NM_BAYS;i++) {     for(i=0;i<C3600_MAX_NM_BAYS;i++) {
613        memcpy(&router->c3660_nm_eeprom_def[i],&eeprom_nm_def,        router->c3660_nm_eeprom_group[i] = eeprom_nm_group;
614               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];  
615     }     }
616  }  }
617    

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

  ViewVC Help
Powered by ViewVC 1.1.26