NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-hpcarm/43780: NetBSD/hpcarm on Jornada 720 panic during boot.



> >Synopsis:       NetBSD/hpcarm on Jornada 720 panic during boot.

> netbsd:sacom_j720_init+0x

Looks softc/device_t split botch.  Try attached patch.
(j720 quirk should rather be handled by proplib,
 but probably it should be in another commit)


Index: arch/arm/sa11x0/sa11x0_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/sa11x0/sa11x0_com.c,v
retrieving revision 1.46
diff -u -p -r1.46 sa11x0_com.c
--- arch/arm/sa11x0/sa11x0_com.c        6 Dec 2009 21:33:45 -0000       1.46
+++ arch/arm/sa11x0/sa11x0_com.c        19 Aug 2010 14:12:01 -0000
@@ -159,7 +159,7 @@ static inline void sacom_schedrx(struct 
 
 #ifdef hpcarm
 /* HPCARM specific functions */
-static void    sacom_j720_init(struct sa11x0_softc *, struct sacom_softc *);
+static void    sacom_j720_init(device_t, device_t);
 #endif
 
 #define COMUNIT_MASK   0x7ffff
@@ -234,7 +234,7 @@ sacom_attach(device_t parent, device_t s
 
 #ifdef hpcarm
        struct platid_data *p;
-       void (*mdinit)(device_t, struct sacom_softc *);
+       void (*mdinit)(device_t, device_t);
 #endif
 
        aprint_normal("\n");
@@ -270,7 +270,7 @@ sacom_attach(device_t parent, device_t s
        /* Do hpcarm specific initialization, if any */
        if ((p = platid_search_data(&platid, sacom_platid_table)) != NULL) {
                mdinit = p->data;
-               (mdinit)(parent, sc);
+               (*mdinit)(parent, self);
        }
 #endif
 
@@ -1400,12 +1400,16 @@ sacomintr(void *arg)
 }
 
 static void
-sacom_j720_init(struct sa11x0_softc *parent, struct sacom_softc *sc) {
+sacom_j720_init(device_t parent, device_t self)
+{
+       struct sa11x0_softc *sasc;
+
+       sasc = device_private(parent);
 
        /* XXX  this should be done at sc->enable function */
-       bus_space_write_4(parent->sc_iot, parent->sc_gpioh,
+       bus_space_write_4(sasc->sc_iot, sasc->sc_gpioh,
            SAGPIO_PCR, 0xa0000);
-       bus_space_write_4(parent->sc_iot, parent->sc_gpioh,
+       bus_space_write_4(sasc->sc_iot, sasc->sc_gpioh,
            SAGPIO_PSR, 0x100);
 }
 

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index