Beispiel #1
0
static void
at32intc_attach(struct device *parent, struct device *self, void *aux)
{
	struct at32bus_attach_args *aa = (void *)aux;
	struct at32intc_softc *sc = (struct at32intc_softc *)self;
	int i;

	printf("\n");

	sc->sc_regt = aa->aa_regt;
	if (bus_space_alloc(sc->sc_regt,
			    AT32INTC_BASE, AT32INTC_BASE + AT32INTC_SPAN,
			    AT32INTC_SPAN, AT32INTC_SPAN,
			    0, 0, 0, &sc->sc_regh))
		panic("at32intc_attach: cannot alloc device registers");

	sc->sc_clk = at32pm_alloc_clk(self, "INTC");
	if (sc->sc_clk == NULL)
		panic("at32intc_attach: cannot allocate device clock");

	/* Enable INTC clock in PM PBB. */
	at32pm_clk_enable(sc->sc_clk);

	/* Map every group to interrupt level 0. */
	for (i = 0; i < AT32INTC_NR_IPR; i++) {
		WR4(AT32INTC_IPR(i), AT32INTC_IPR_LEVEL_0);
	}

	/* Except for the COUNT group, which gets high priority. */
	WR4(AT32INTC_IPR(AT32AP7000_IPR_GROUP_COUNT), 
			 AT32INTC_IPR_LEVEL_2);

	/* Success. */
	at32intc_sc = sc;
}
/*
 * Allocation and deallocation operations.
 */
int
bs_through_bs_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend,
    bus_size_t size, bus_size_t align, bus_size_t boundary, int cacheable,
    bus_addr_t *addrp, bus_space_handle_t *bshp)
{
	return bus_space_alloc(t->bs_base, rstart, rend, size, align, boundary,
	    cacheable, addrp, bshp);
}
Beispiel #3
0
int
isa_mem_alloc(bus_space_tag_t t, bus_size_t size, bus_size_t align,
    bus_addr_t boundary, int flags, bus_addr_t *addrp, bus_space_handle_t *bshp)
{
	/* Allocate physical address space in the ISA hole. */
	return bus_space_alloc(t, IOM_BEGIN, IOM_END - 1, size, align,
	    boundary, flags, addrp, bshp);
}
Beispiel #4
0
static void
at32pm_attach(struct device *parent, struct device *self, void *aux)
{
	struct at32bus_attach_args *aa = (void *)aux;
	struct at32pm_softc *sc = (struct at32pm_softc *)self;
	uint32_t mask;

	printf("\n");

	sc->sc_regt = aa->aa_regt;
	if (bus_space_alloc(sc->sc_regt,
			    AT32PM_BASE, AT32PM_BASE + AT32PM_SPAN,
			    AT32PM_SPAN, AT32PM_SPAN,
			    0, 0, 0, &sc->sc_regh))
		panic("at32pm_attach: cannot alloc device registers");

	at32pm_sc = sc;
}