Пример #1
0
void
sacom_attach(struct device *parent, struct device *self, void *aux)
{
    struct sacom_softc *sc = (struct sacom_softc*)self;
    struct sa11x0_attach_args *sa = aux;

#ifdef hpcarm
    struct platid_data *p;
    void (*mdinit)(struct device *, struct sacom_softc *);
#endif

    printf("\n");

    sc->sc_iot = sa->sa_iot;
    sc->sc_baseaddr = sa->sa_addr;

    if (bus_space_map(sa->sa_iot, sa->sa_addr, sa->sa_size, 0,
                      &sc->sc_ioh)) {
        printf("%s: unable to map registers\n", sc->sc_dev.dv_xname);
        return;
    }

    printf("%s: ", sc->sc_dev.dv_xname);
    switch (sc->sc_baseaddr) {
    case SACOM1_BASE:
        printf("SA-11x0 UART1\n");
        break;
    case SACOM2_BASE:
        printf("SA-11x0 UART2 (IRDA)\n");
        break;
    case SACOM3_BASE:
        printf("SA-11x0 UART3\n");
        break;
    default:
        printf("unknown SA-11x0 UART\n");
        break;
    }

    sacom_attach_subr(sc);

#ifdef hpcarm
    /* Do hpcarm specific initialization, if any */
    if ((p = platid_search_data(&platid, sacom_platid_table)) != NULL) {
        mdinit = p->data;
        (mdinit)(parent, sc);
    }
#endif

    sa11x0_intr_establish(0, sa->sa_intr, 1, IPL_SERIAL, sacomintr, sc);
}
Пример #2
0
static void
j720_socket_setup(struct sapcic_socket *sp)
{
	int *ip;
	struct platid_data *p;
	int socket = sp->socket;

	p = platid_search_data(&platid, sacpcic_platid_table);

	if (p == NULL) {
		sp->power_capability = SAPCIC_POWER_5V;
	} else {
		ip = (int *)p->data;
		sp->power_capability = ip[socket];
	}

	sp->pcictag = &j720_sacpcic_functions;
}