add busdma tag to s3c2xx0_softc and attach arg.

initialize busdma tag in s3c2410_attach()
This commit is contained in:
bsh 2003-08-05 11:26:54 +00:00
parent 3bf70b2edf
commit 0b5ec916cd
2 changed files with 16 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: s3c2410.c,v 1.2 2003/08/04 12:15:22 bsh Exp $ */
/* $NetBSD: s3c2410.c,v 1.3 2003/08/05 11:26:54 bsh Exp $ */
/*
* Copyright (c) 2003 Genetec corporation. All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: s3c2410.c,v 1.2 2003/08/04 12:15:22 bsh Exp $");
__KERNEL_RCSID(0, "$NetBSD: s3c2410.c,v 1.3 2003/08/05 11:26:54 bsh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -152,12 +152,14 @@ s3c2410_attach(struct device *parent, struct device *self, void *aux)
/* calculate current clock frequency */
s3c24x0_clock_freq(&sc->sc_sx);
aprint_normal(": fclk %d MHz hclk %d MHz pclk %d MHz\n",
printf(": fclk %d MHz hclk %d MHz pclk %d MHz",
sc->sc_sx.sc_fclk / 1000000, sc->sc_sx.sc_hclk / 1000000,
sc->sc_sx.sc_pclk / 1000000);
aprint_naive("\n");
printf("\n");
/* get busdma tag for the platform */
sc->sc_sx.sc_dmat = s3c2xx0_bus_dma_init(&s3c2xx0_bus_dma);
/*
* Attach devices.
@ -185,6 +187,8 @@ s3c2410_search(struct device * parent, struct cfdata * cf, void *aux)
aa.sa_index = cf->cf_loc[SSIOCF_INDEX];
aa.sa_intr = cf->cf_loc[SSIOCF_INTR];
aa.sa_dmat = sc->sc_sx.sc_dmat;
if (config_match(parent, cf, &aa))
config_attach(parent, cf, &aa, s3c2410_print);

View File

@ -1,4 +1,4 @@
/* $NetBSD: s3c2xx0var.h,v 1.2 2003/05/13 05:06:39 bsh Exp $ */
/* $NetBSD: s3c2xx0var.h,v 1.3 2003/08/05 11:26:54 bsh Exp $ */
/*
* Copyright (c) 2002 Fujitsu Component Limited
@ -48,6 +48,8 @@ struct s3c2xx0_softc {
bus_space_handle_t sc_gpio_ioh; /* GPIO */
bus_space_handle_t sc_rtc_ioh; /* real time clock */
bus_dma_tag_t sc_dmat;
/* clock frequency */
int sc_fclk; /* CPU clock */
int sc_hclk; /* AHB bus clock */
@ -63,9 +65,14 @@ struct s3c2xx0_attach_args {
bus_size_t sa_size;
int sa_intr;
int sa_index;
bus_dma_tag_t sa_dmat;
};
extern struct bus_space s3c2xx0_bs_tag;
extern struct s3c2xx0_softc *s3c2xx0_softc;
extern struct arm32_bus_dma_tag s3c2xx0_bus_dma;
/* Platform needs to provide this */
bus_dma_tag_t s3c2xx0_bus_dma_init(struct arm32_bus_dma_tag *);
#endif /* _ARM_S3C2XX0VAR_H_ */