[BACK]Return to sa1111.c CVS log [TXT][DIR] Up to [local] / sys / arch / arm / sa11x0

Diff for /sys/arch/arm/sa11x0/sa1111.c between version 1.1 and 1.2

version 1.1, 2008/03/04 16:05:18 version 1.2, 2008/03/05 11:11:22
Line 100 
Line 100 
 #include <machine/cpu.h>  #include <machine/cpu.h>
 #include <machine/bus.h>  #include <machine/bus.h>
   
 //#include <arm/mainbus/mainbus.h>  
   
 #include <arm/sa11x0/sa1111_reg.h>  #include <arm/sa11x0/sa1111_reg.h>
 #include <arm/sa11x0/sa11x0_var.h>  #include <arm/sa11x0/sa11x0_var.h>
 #include <arm/sa11x0/sa11x1_var.h>  #include <arm/sa11x0/sa11x1_var.h>
   
 struct sacc_softc {  //#include <arm/sa11x0/sa1111_gpiovar.h>
         struct device sc_dev;  
         bus_space_tag_t sc_bust;  
         bus_dma_tag_t sc_dmat;  
 };  
   
 /* prototypes */  /* prototypes */
 int     sacc_match(struct device *, void *, void *);  int     sacc_match(struct device *, void *, void *);
 void    sacc_attach(struct device *, struct device *, void *);  void    sacc_attach(struct device *, struct device *, void *);
 int     sacc_search(struct device *, void *, void *);  int     sacc_search(struct device *, void *, void *);
 int     sacc_print(void *, const char *);  int     sacc_print(void *, const char *);
   void    sacc_attach_critical(struct sacc_softc *sc);
   
 /* attach structures */  /* attach structures */
 struct cfattach sacc_ca = {  struct cfattach sacc_ca = {
Line 141 
Line 136 
 {  {
         struct sacc_softc *sc = (struct sacc_softc *)self;          struct sacc_softc *sc = (struct sacc_softc *)self;
         struct saip_attach_args *saa = aux;          struct saip_attach_args *saa = aux;
         bus_space_handle_t      sbih;  
         uint32_t        skid;          uint32_t        skid;
   
         sacc_sc = sc;          sacc_sc = sc;
         sc->sc_bust = &sa11x1_bs_tag;          sc->sc_bust = &sa11x1_bs_tag;
           sc->sc_intr = saa->sai_intr;
   
         /* XXX preserve our base addr for sa11x1_bs_map() */          /* XXX preserve our base addr for sa11x1_bs_map() */
         sa11x1_bs_tag.bs_cookie = &saa->sai_addr;          sa11x1_bs_tag.bs_cookie = &saa->sai_addr;
   
         /* map SBI module */          /*
         if (bus_space_map(sc->sc_bust, 0 /* SACCSBI_BASE */, 3 /* SACCSBI_SIZE */, 0, &sbih)) {           * Map whole I/O space.
            */
           if (bus_space_map(sc->sc_bust, 0, 128 * 12, 0, &sc->sc_ioh)) {
                 printf(": can't map i/o space\n");                  printf(": can't map i/o space\n");
                 return;                  return;
         }          }
Line 159 
Line 156 
         /*          /*
          * Identify chip.           * Identify chip.
          */           */
         skid = bus_space_read_4(sc->sc_bust, sbih, SACCSBI_SKID);          skid = bus_space_read_4(sc->sc_bust, sc->sc_ioh, SACCSBI_SKID);
         bus_space_unmap(sc->sc_bust, sbih, 3 /* SACCSBI_SIZE */);  
         if ((skid & 0xffffff00) != 0x690cc200) {          if ((skid & 0xffffff00) != 0x690cc200) {
                 printf(": incorrect SA-1111 chip ID\n");                  printf(": incorrect SA-1111 chip ID\n");
                   bus_space_unmap(sc->sc_bust, sc->sc_ioh, 128 * 12);
                 return;                  return;
         }          }
         printf(": SA-1111 companion chip rev. %d/%d\n", skid & 0xf0, skid & 0x0f);          printf(": SA-1111 companion chip rev. %d/%d\n", skid & 0xf0, skid & 0x0f);
   
         /*          /*
          * Attach all other devices           * Attach critical devices.
          */           */
           sacc_attach_critical(sc);
   
           /*
            * Attach all other devices.
            */
         config_search(sacc_search, self, sc);          config_search(sacc_search, self, sc);
 }  }
   
Line 183 
Line 185 
         aa.sac_iot = sc->sc_bust;          aa.sac_iot = sc->sc_bust;
         aa.sac_dmat = sc->sc_dmat;          aa.sac_dmat = sc->sc_dmat;
   
         aa.sac_addr = (cf->cf_loc)[0];          aa.sac_xintr = (cf->cf_loc)[0];
         aa.sac_size = (cf->cf_loc)[1];  
         aa.sac_intr = (cf->cf_loc)[2];  
   
         config_found(parent, &aa, sacc_print);          config_found(parent, &aa, sacc_print);
   
Line 197 
Line 197 
 {  {
         struct sacc_attach_args *sa = (struct sacc_attach_args*)aux;          struct sacc_attach_args *sa = (struct sacc_attach_args*)aux;
   
         if (sa->sac_addr != -1) {          if (sa->sac_xintr != -1)
                 printf(" addr 0x%lx", sa->sac_addr);                  printf(" xintr %d", sa->sac_xintr);
                 if (sa->sac_size > -1)  
                         printf("-0x%lx", sa->sac_addr + sa->sac_size-1);  
         }  
         if (sa->sac_intr != -1)  
                 printf(" xintr %d", sa->sac_intr);  
   
         return (UNCONF);          return (UNCONF);
   }
   
   void
   sacc_attach_critical(struct sacc_softc *sc)
   {
           /*
            * Attach Interrupt and GPIO controllers because
            * their functionality is needed for the rest of our onboard devices.
            */
           struct sacc_attach_args saa;
   
           saa.sac_iot = sc->sc_bust;
           saa.sac_dmat = sc->sc_dmat;
   
           /* XXX sac_xintr is an internal to us interrupt number, but here we use it
                           to inform our INTC about which intr line it uses on main INTC.  */
           saa.sac_xintr = sc->sc_intr;
           saa.sac_typecookie = SACC_TYPE_INTC;
           config_found(&sc->sc_dev, &saa, sacc_print);
   
   #if 0
           saa.sac_xintr = -1;     /* is not widely used, spec defines most of them */
           saa.sac_typecookie = SACC_TYPE_GPIO;
           config_found(&sc->sc_dev, &saa, sacc_print);
   #endif
 }  }
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb